@inkeep/open-knowledge 0.4.0-beta.22 → 0.4.0-beta.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +5 -0
  2. package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
  3. package/dist/cli.mjs +5 -5
  4. package/dist/constants-CZmHtQUh.mjs +2 -0
  5. package/dist/{dist-Uy_vpwwu.mjs → dist-BT7_1SJl.mjs} +1 -1
  6. package/dist/{dist-Ix94KDj_.mjs → dist-DSb6dRAy.mjs} +8 -8
  7. package/dist/{dist-DqLw4dfn.mjs → dist-IguRFGXq.mjs} +14 -14
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-PJ5YfBnb.mjs → init-CMfH982u.mjs} +3 -3
  10. package/dist/init-DesafuF7.mjs +1 -0
  11. package/dist/loader-C9UcssXM.mjs +1 -0
  12. package/dist/{loader-B6i90X0D.mjs → loader-DvG1wpAx.mjs} +2 -2
  13. package/dist/preview-C8UFVYvI.mjs +1 -0
  14. package/dist/{preview-BIh3n95I.mjs → preview-DgYoFNt8.mjs} +2 -2
  15. package/dist/public/assets/{ActivityModeContent-BaGVDcQB.js → ActivityModeContent-C9by936Y.js} +1 -1
  16. package/dist/public/assets/{ConsentDialogBody-BPEdQGkb.js → ConsentDialogBody-Ch5CwNgh.js} +1 -1
  17. package/dist/public/assets/DocumentContext-BWaxMbNn.js +37 -0
  18. package/dist/public/assets/{GraphPanel-BTZEGMOS.js → GraphPanel-BIq7awkX.js} +2 -2
  19. package/dist/public/assets/{McpConsentDialogBody-bOHJX0J3.js → McpConsentDialogBody-8EQrQlPS.js} +1 -1
  20. package/dist/public/assets/OutlinePanel-B5lJ2ZKC.js +2 -0
  21. package/dist/public/assets/SettingsDialog-C7u67QFY.js +11 -0
  22. package/dist/public/assets/{SourceEditor-Bu09lOf3.js → SourceEditor-BoEQaOVh.js} +2 -2
  23. package/dist/public/assets/{agent-presence-Ds2n3U5P.js → agent-presence-BrTlNKmt.js} +1 -1
  24. package/dist/public/assets/{checkbox-DRtAIYeh.js → checkbox-DBLbPikY.js} +1 -1
  25. package/dist/public/assets/config-validation-events-CQhUgigt.js +10 -0
  26. package/dist/public/assets/{dialog-CKgDyF3E.js → dialog-BFN-ujuF.js} +1 -1
  27. package/dist/public/assets/{dist-ClFYZdbN.js → dist-Bej94Urx.js} +1 -1
  28. package/dist/public/assets/{dist-1cEl720w.js → dist-Cg-Qaqw_.js} +1 -1
  29. package/dist/public/assets/{dist-Dy1vgWd7.js → dist-OTL8-1C2.js} +1 -1
  30. package/dist/public/assets/{doc-hash-BRguOnak.js → doc-hash-DAxgYkBj.js} +143 -143
  31. package/dist/public/assets/index-BzPHdvNz.css +1 -0
  32. package/dist/public/assets/index-C0DBsuvp.js +1853 -0
  33. package/dist/public/assets/{input-CK6fFyb4.js → input-BOmkuBId.js} +1 -1
  34. package/dist/public/assets/{label-DsL9nuZ1.js → label-Dv_9VZWz.js} +1 -1
  35. package/dist/public/assets/{panel-BgMqDESF.js → panel-8fydlQgn.js} +1 -1
  36. package/dist/public/assets/{target-navigation-intent-D5LaeHK7.js → target-navigation-intent-CKIqVD_0.js} +1 -1
  37. package/dist/public/assets/{textarea-DeHOTn8t.js → textarea-57j4gLcZ.js} +1 -1
  38. package/dist/public/assets/{toggle-group-DTdA3eDP.js → toggle-group-CHwk3w0Y.js} +1 -1
  39. package/dist/public/assets/{tooltip-D34u3P2u.js → tooltip-DNV87xh_.js} +1 -1
  40. package/dist/public/index.html +20 -20
  41. package/dist/{src-D9NIHAFh.mjs → src-Bdc8vmx9.mjs} +2 -2
  42. package/dist/start-1_WAnc88.mjs +1 -0
  43. package/dist/{start-DctXQAXz.mjs → start-CPFpaTRH.mjs} +2 -2
  44. package/package.json +1 -1
  45. package/dist/constants-Cpf02rXq.mjs +0 -2
  46. package/dist/init-FSmHR1GH.mjs +0 -1
  47. package/dist/loader-DPOOkTyF.mjs +0 -1
  48. package/dist/preview-rIaCs9hP.mjs +0 -1
  49. package/dist/public/assets/DocumentContext-BXt0WTWI.js +0 -37
  50. package/dist/public/assets/OutlinePanel-BxucJpZs.js +0 -2
  51. package/dist/public/assets/SettingsDialog-CXjXISCU.js +0 -11
  52. package/dist/public/assets/config-validation-events-DVW5UZfG.js +0 -10
  53. package/dist/public/assets/index-Bxv0NuA_.js +0 -1853
  54. package/dist/public/assets/index-CnYbivIH.css +0 -1
  55. package/dist/start-B9392Wvk.mjs +0 -1
  56. /package/dist/public/assets/{button-BsFpqlpT.js → button-C1nwPVFQ.js} +0 -0
@@ -0,0 +1,11 @@
1
+ import{o as e,t}from"./chunk-CFjPhJqf.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{O as a,Tt as o,Ut as s,Wt as c,Yt as l,et as u,n as d}from"./DocumentContext-BWaxMbNn.js";import{$ as f,An as p,Dr as m,Nr as h,Or as g,Ut as _,kr as v,s as y,tt as b,yn as x}from"./doc-hash-DAxgYkBj.js";import{C as S,_ as C,r as w,t as T}from"./button-C1nwPVFQ.js";import{$ as E,A as D,B as O,F as k,I as A,J as j,L as M,M as N,N as ee,P as te,R as ne,S as re,V as ie,Y as ae,a as oe,at as P,b as F,c as se,ct as ce,d as le,et as ue,f as de,g as fe,h as pe,i as me,it as he,j as ge,l as _e,lt as ve,m as ye,n as be,nt as xe,o as Se,p as Ce,rt as we,s as Te,st as Ee,u as De,ut as Oe,v as ke,x as Ae,z as je}from"./config-validation-events-CQhUgigt.js";import{n as Me}from"./dist-Bej94Urx.js";import{m as Ne,p as I}from"./dist-OTL8-1C2.js";import{n as Pe,t as Fe}from"./toggle-group-CHwk3w0Y.js";import{t as Ie}from"./label-Dv_9VZWz.js";import{i as Le,n as Re,t as ze}from"./tooltip-DNV87xh_.js";import{a as Be,c as Ve,i as He,t as Ue}from"./dialog-BFN-ujuF.js";import{t as We}from"./input-BOmkuBId.js";var Ge=S(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),L=i(),R=e(n(),1),Ke=e=>e.type===`checkbox`,qe=e=>e instanceof Date,z=e=>e==null,Je=e=>typeof e==`object`,B=e=>!z(e)&&!Array.isArray(e)&&Je(e)&&!qe(e),Ye=e=>B(e)&&e.target?Ke(e.target)?e.target.checked:e.target.value:e,Xe=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),Ze=e=>{let t=e.constructor&&e.constructor.prototype;return B(t)&&t.hasOwnProperty(`isPrototypeOf`)},Qe=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function V(e){if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(Qe&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&!(B(e)&&Ze(e)))return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=V(e[t]));return r}var $e=e=>/^\w*$/.test(e),H=e=>e===void 0,et=e=>Array.isArray(e)?e.filter(Boolean):[],tt=e=>et(e.replace(/["|']|\]/g,``).split(/\.|\[/)),U=(e,t,n)=>{if(!t||!B(e))return n;let r=($e(t)?[t]:tt(t)).reduce((e,t)=>z(e)?void 0:e[t],e);return H(r)||r===e?H(e[t])?n:e[t]:r},W=e=>typeof e==`boolean`,G=e=>typeof e==`function`,K=(e,t,n)=>{let r=-1,i=$e(t)?[t]:tt(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=B(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(t===`__proto__`||t===`constructor`||t===`prototype`)return;e[t]=a,e=e[t]}},nt={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},q={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},J={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},rt=`form`,it=`root`,at=R.createContext(null);at.displayName=`HookFormControlContext`;var ot=()=>R.useContext(at),st=(e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==q.all&&(t._proxyFormState[i]=!r||q.all),n&&(n[i]=!0),e[i]}});return i},ct=typeof window<`u`?R.useLayoutEffect:R.useEffect;function lt(e){let t=ot(),{control:n=t,disabled:r,name:i,exact:a}=e||{},[o,s]=R.useState(n._formState),c=R.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ct(()=>n._subscribe({name:i,formState:c.current,exact:a,callback:e=>{!r&&s({...n._formState,...e})}}),[i,r,a]),R.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),R.useMemo(()=>st(o,n,c.current,!1),[o,n])}var Y=e=>typeof e==`string`,ut=(e,t,n,r,i)=>Y(e)?(r&&t.watch.add(e),U(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),U(n,e))):(r&&(t.watchAll=!0),n),dt=e=>z(e)||!Je(e);function X(e,t,n=new WeakSet){if(e===t)return!0;if(dt(e)||dt(t))return Object.is(e,t);if(qe(e)&&qe(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(qe(r)&&qe(e)||(B(r)||Array.isArray(r))&&(B(e)||Array.isArray(e))?!X(r,e,n):!Object.is(r,e))return!1}}return!0}function ft(e){let t=ot(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=R.useRef(i),l=R.useRef(s),u=R.useRef(void 0),d=R.useRef(n),f=R.useRef(r);l.current=s;let[p,m]=R.useState(()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e}),h=R.useCallback(e=>{let t=ut(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),g=R.useCallback(e=>{if(!a){let t=ut(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);X(e,u.current)||(m(e),u.current=e)}else m(t)}},[n._formValues,n._names,a,r]);ct(()=>((d.current!==n||!X(f.current,r))&&(d.current=n,f.current=r,g()),n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{g(e.values)}})),[n,o,r,g]),R.useEffect(()=>n._removeUnmounted());let _=d.current!==n,v=f.current,y=R.useMemo(()=>{if(a)return null;let e=!_&&!X(v,r);return _||e?h():null},[a,_,r,v,h]);return y===null?p:y}function pt(e){let t=ot(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=Xe(i._names.array,n),l=ft({control:i,name:n,defaultValue:R.useMemo(()=>U(i._formValues,n,U(i._defaultValues,n,o)),[i,n,o]),exact:s}),u=lt({control:i,name:n,exact:s}),d=R.useRef(e),f=R.useRef(i.register(n,{...e.rules,value:l,...W(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let p=R.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!U(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!U(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!U(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!U(u.validatingFields,n)},error:{enumerable:!0,get:()=>U(u.errors,n)}}),[u,n]),m=R.useCallback(e=>f.current.onChange({target:{value:Ye(e),name:n},type:nt.CHANGE}),[n]),h=R.useCallback(()=>f.current.onBlur({target:{value:U(i._formValues,n),name:n},type:nt.BLUR}),[n,i._formValues]),g=R.useCallback(e=>{let t=U(i._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>G(e.focus)&&e.focus(),select:()=>G(e.select)&&e.select(),setCustomValidity:t=>G(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>G(e.reportValidity)&&e.reportValidity()})},[i._fields,n]),_=R.useMemo(()=>({name:n,value:l,...W(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:m,onBlur:h,ref:g}),[n,r,u.disabled,m,h,g,l]);return R.useEffect(()=>{let e=i._options.shouldUnregister||a;i.register(n,{...d.current.rules,...W(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=U(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=V(U(i._options.defaultValues,n,d.current.defaultValue));K(i._defaultValues,n,e),H(U(i._formValues,n))&&K(i._formValues,n,e)}return!c&&i.register(n),()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),R.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),R.useMemo(()=>({field:_,formState:u,fieldState:p}),[_,u,p])}var mt=e=>e.render(pt(e)),ht=R.createContext(null);ht.displayName=`HookFormContext`;var gt=()=>R.useContext(ht),_t=e=>{let{children:t,watch:n,getValues:r,getFieldState:i,setError:a,clearErrors:o,setValue:s,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:p,control:m,register:h,setFocus:g,subscribe:_}=e,v=R.useMemo(()=>({watch:n,getValues:r,getFieldState:i,setError:a,clearErrors:o,setValue:s,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:p,control:m,register:h,setFocus:g,subscribe:_}),[o,m,l,i,r,f,h,d,u,a,g,s,_,c,p,n]);return R.createElement(ht.Provider,{value:v},R.createElement(at.Provider,{value:v.control},t))},vt=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},yt=e=>Array.isArray(e)?e:[e],bt=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function xt(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&B(i)&&a){let e=xt(i,a);B(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var Z=e=>B(e)&&!Object.keys(e).length,St=e=>e.type===`file`,Ct=e=>{if(!Qe)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},wt=e=>e.type===`select-multiple`,Tt=e=>e.type===`radio`,Et=e=>Tt(e)||Ke(e),Dt=e=>Ct(e)&&e.isConnected;function Ot(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;){if(z(e)){e=void 0;break}e=e[t[r]],r++}return e}function kt(e){for(let t in e)if(e.hasOwnProperty(t)&&!H(e[t]))return!1;return!0}function Q(e,t){if(Y(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:$e(t)?[t]:tt(t),r=n.length===1?e:Ot(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(B(r)&&Z(r)||Array.isArray(r)&&kt(r))&&Q(e,n.slice(0,-1)),e}var At=e=>{for(let t in e)if(G(e[t]))return!0;return!1};function jt(e){return Array.isArray(e)||B(e)&&!At(e)}function Mt(e,t={}){for(let n in e){let r=e[n];jt(r)?(t[n]=Array.isArray(r)?[]:{},Mt(r,t[n])):H(r)||(t[n]=!0)}return t}function Nt(e,t,n){n||=Mt(t);for(let r in e){let i=e[r];if(jt(i))H(t)||dt(n[r])?n[r]=Mt(i,Array.isArray(i)?[]:{}):Nt(i,z(t)?{}:t[r],n[r]);else{let e=t[r];n[r]=!X(i,e)}}return n}var Pt={value:!1,isValid:!1},Ft={value:!0,isValid:!0},It=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!H(e[0].attributes.value)?H(e[0].value)||e[0].value===``?Ft:{value:e[0].value,isValid:!0}:Ft:Pt}return Pt},Lt=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>H(e)?e:t?e===``?NaN:e&&+e:n&&Y(e)?new Date(e):r?r(e):e,Rt={isValid:!1,value:null},zt=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Rt):Rt;function Bt(e){let t=e.ref;return St(t)?t.files:Tt(t)?zt(e.refs).value:wt(t)?[...t.selectedOptions].map(({value:e})=>e):Ke(t)?It(e.refs).value:Lt(H(t.value)?e.ref.value:t.value,e)}var Vt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Ht=(e,t,n,r)=>{let i={};for(let n of e){let e=U(t,n);e&&K(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Ut=e=>e instanceof RegExp,Wt=e=>H(e)?e:Ut(e)?e.source:B(e)?Ut(e.value)?e.value.source:e.value:e,Gt=e=>({isOnSubmit:!e||e===q.onSubmit,isOnBlur:e===q.onBlur,isOnChange:e===q.onChange,isOnAll:e===q.all,isOnTouch:e===q.onTouched}),Kt=`AsyncFunction`,qt=e=>!!e&&!!e.validate&&!!(G(e.validate)&&e.validate.constructor.name===Kt||B(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Kt)),Jt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Yt=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))),Xt=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=U(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(Xt(a,t))break}else if(B(a)&&Xt(a,t))break}}};function Zt(e,t,n){let r=U(e,n);if(r||$e(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=U(t,r),o=U(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Qt=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return Z(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||q.all))},$t=(e,t,n)=>!e||!t||e===t||yt(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))),en=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,tn=(e,t)=>!et(U(e,t)).length&&Q(e,t),nn=(e,t,n)=>{let r=yt(U(e,n));return K(r,it,t[n]),K(e,n,r),e};function rn(e,t,n=`validate`){if(Y(e)||Array.isArray(e)&&e.every(Y)||W(e)&&!e)return{type:n,message:Y(e)?e:``,ref:t}}var an=e=>B(e)&&!Ut(e)?e:{value:e,message:``},on=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=U(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{i&&y.reportValidity&&(y.setCustomValidity(W(e)?``:e||``),y.reportValidity())},x={},S=Tt(o),C=Ke(o),w=S||C,T=(g||St(o))&&H(o.value)&&H(v)||Ct(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length||g&&typeof v==`number`&&isNaN(v),E=vt.bind(null,h,r,x),D=(e,t,n,r=J.maxLength,i=J.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||z(v))||W(v)&&!v||C&&!It(s).isValid||S&&!zt(s).isValid)){let{value:e,message:t}=Y(c)?{value:!!c,message:c}:an(c);if(e&&(x[h]={type:J.required,message:t,ref:y,...E(J.required,t)},!r))return b(t),x}if(!T&&(!z(d)||!z(f))){let e,t,n=an(f),i=an(d);if(!z(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;z(n.value)||(e=r>n.value),z(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;Y(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),Y(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,J.max,J.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(Y(v)||a&&Array.isArray(v))){let e=an(l),t=an(u),n=!z(e.value)&&v.length>+e.value,i=!z(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&Y(v)){let{value:e,message:t}=an(p);if(Ut(e)&&!v.match(e)&&(x[h]={type:J.pattern,message:t,ref:o,...E(J.pattern,t)},!r))return b(t),x}if(m){if(G(m)){let e=rn(await m(v,n),y);if(e&&(x[h]={...e,...E(J.validate,e.message)},!r))return b(e.message),x}else if(B(m)){let e={};for(let t in m){if(!Z(e)&&!r)break;let i=rn(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!Z(e)&&(x[h]={ref:y,...e},!r))return x}}return b(!0),x},sn={mode:q.onSubmit,reValidateMode:q.onChange,shouldFocusError:!0};function cn(e={}){let t={...sn,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:G(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=(B(t.defaultValues)||B(t.values))&&V(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:V(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,l=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u},f={...d},p={array:bt(),state:bt()},m=t.criteriaMode===q.all,h=e=>t=>{clearTimeout(l),l=setTimeout(e,t)},g=async e=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||f.isValid||e)){let e;t.resolver?(e=Z((await T()).errors),_()):e=await O({fields:r,onlyCheckValid:!0,eventType:nt.VALID}),e!==n.isValid&&p.state.next({isValid:e})}},_=(e,r)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((e||Array.from(s.mount)).forEach(e=>{e&&(r?K(n.validatingFields,e,r):Q(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!Z(n.validatingFields)}))},v=e=>{let t=Nt(i,a),r=Vt(e);K(n.dirtyFields,r,U(t,r))},y=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){if(o.action=!0,u&&Array.isArray(U(r,e))){let t=s(U(r,e),c.argA,c.argB);l&&K(r,e,t)}if(u&&Array.isArray(U(n.errors,e))){let t=s(U(n.errors,e),c.argA,c.argB);l&&K(n.errors,e,t),tn(n.errors,e)}if((d.touchedFields||f.touchedFields)&&u&&Array.isArray(U(n.touchedFields,e))){let t=s(U(n.touchedFields,e),c.argA,c.argB);l&&K(n.touchedFields,e,t)}(d.dirtyFields||f.dirtyFields)&&v(e),p.state.next({name:e,isDirty:A(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else K(a,e,i)},b=(e,t)=>{K(n.errors,e,t),p.state.next({errors:n.errors})},x=e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},S=(e,t,n,s)=>{let c=U(r,e);if(c){let r=U(a,e,H(n)?U(i,e):n);H(r)||s&&s.defaultChecked||t?K(a,e,t?r:Bt(c._f)):N(e,r),o.mount&&!o.action&&g()}},C=(e,r,a,o,s)=>{let c=!1,l=!1,u={name:e};if(!t.disabled){if(!a||o){(d.isDirty||f.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=A(),c=l!==u.isDirty);let t=X(U(i,e),r);l=!!U(n.dirtyFields,e),t?Q(n.dirtyFields,e):K(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c||=(d.dirtyFields||f.dirtyFields)&&l!==!t}if(a){let t=U(n.touchedFields,e);t||(K(n.touchedFields,e,a),u.touchedFields=n.touchedFields,c||=(d.touchedFields||f.touchedFields)&&t!==a)}c&&s&&p.state.next(u)}return c?u:{}},w=(e,r,i,a)=>{let o=U(n.errors,e),s=(d.isValid||f.isValid)&&W(r)&&n.isValid!==r;if(t.delayError&&i?(c=h(()=>b(e,i)),c(t.delayError)):(clearTimeout(l),c=null,i?K(n.errors,e,i):Q(n.errors,e)),(i?!X(o,i):o)||!Z(a)||s){let t={...a,...s&&W(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},T=async e=>(_(e,!0),await t.resolver(a,t.context,Ht(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),E=async e=>{let{errors:t}=await T(e);if(_(e),e)for(let r of e){let e=U(t,r);e?K(n.errors,r,e):Q(n.errors,r)}else n.errors=t;return t},D=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(B(i))for(let e in i)i[e]&&se(`${rt}.${e}`,{message:Y(i.message)?i.message:``,type:J.validate});else Y(i)||!i?se(rt,{message:i||``,type:J.validate}):F(rt);return i}return!0},O=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await D({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...f}=u;if(r){let o=s.array.has(r.name),c=u._f&&qt(u._f);c&&d.validatingFields&&_([r.name],!0);let f=await on(u,s.disabled,a,m,t.shouldUseNativeValidation&&!i,o);if(c&&d.validatingFields&&_([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(U(f,r.name)?o?nn(n.errors,f,r.name):K(n.errors,r.name,f[r.name]):Q(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!Z(f)&&await O({context:l,onlyCheckValid:i,fields:f,name:o,eventType:c})}}return l.valid},k=()=>{for(let e of s.unMount){let t=U(r,e);t&&(t._f.refs?t._f.refs.every(e=>!Dt(e)):!Dt(t._f.ref))&&de(e)}s.unMount=new Set},A=(e,n)=>!t.disabled&&(e&&n&&K(a,e,n),!X(oe(),i)),j=(e,t,n)=>ut(e,s,{...o.mount?a:H(t)?i:Y(e)?{[e]:t}:t},n,t),M=e=>et(U(o.mount?a:i,e,t.shouldUnregister?U(i,e,[]):[])),N=(e,t,n={})=>{let i=U(r,e),o=t;if(i){let n=i._f;n&&(!n.disabled&&K(a,e,Lt(t,n)),o=Ct(n.ref)&&z(t)?``:t,wt(n.ref)?[...n.ref.options].forEach(e=>e.selected=o.includes(e.value)):n.refs?Ke(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):n.refs.forEach(e=>e.checked=e.value===o):St(n.ref)?n.ref.value=``:(n.ref.value=o,n.ref.type||p.state.next({name:e,values:V(a)})))}(n.shouldDirty||n.shouldTouch)&&C(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&ae(e)},ee=(e,t,n)=>{for(let i in t){if(!t.hasOwnProperty(i))return;let a=t[i],o=e+`.`+i,c=U(r,o);(s.array.has(e)||B(a)||c&&!c._f)&&!qe(a)?ee(o,a,n):N(o,a,n)}},te=(e,t,i={})=>{let c=U(r,e),l=s.array.has(e),u=V(t),d=X(U(a,e),u);if(K(a,e,u),l)p.array.next({name:e,values:V(a)}),i.shouldDirty&&(v(e),p.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:A(e,u)}));else{let t=Array.isArray(u)&&!u.length||Z(u);!c||c._f||z(u)||t?N(e,u,i):ee(e,u,i)}d||(Yt(e,s)?p.state.next({...n,name:e,values:V(a)}):p.state.next({name:o.mount?e:void 0,values:V(a)}))},ne=e=>{let t=G(e)?e(a):e;X(a,t)||(a={...a,...t},p.state.next({...n,values:a}))},re=async i=>{o.mount=!0;let l=i.target,u=l.name,h=!0,v=U(r,u),y=e=>{h=Number.isNaN(e)||qe(e)&&isNaN(e.getTime())||X(e,U(a,u,e))},b=Gt(t.mode),x=Gt(t.reValidateMode);if(v){let o,S,E=l.type?Bt(v._f):Ye(i),k=i.type===nt.BLUR||i.type===nt.FOCUS_OUT,A=!Jt(v._f)&&!e.validate&&!t.resolver&&!U(n.errors,u)&&!v._f.deps||en(k,U(n.touchedFields,u),n.isSubmitted,x,b),j=Yt(u,s,k);K(a,u,E),k?(!l||!l.readOnly)&&(v._f.onBlur&&v._f.onBlur(i),c&&c(0)):v._f.onChange&&v._f.onChange(i);let M=C(u,E,k),N=!Z(M)||j;if(!k&&p.state.next({name:u,type:i.type,values:V(a)}),A)return(d.isValid||f.isValid)&&(t.mode===`onBlur`?k&&g():k||g()),N&&p.state.next({name:u,...j?{}:M});if(!t.resolver&&e.validate&&await D({name:u,eventType:i.type}),!k&&j&&p.state.next({...n}),t.resolver){let{errors:e}=await T([u]);if(_([u]),y(E),h){let t=Zt(n.errors,r,u),i=Zt(e,r,t.name||u);o=i.error,u=i.name,S=Z(e)}}else _([u],!0),o=(await on(v,s.disabled,a,m,t.shouldUseNativeValidation))[u],_([u]),y(E),h&&(o?S=!1:(d.isValid||f.isValid)&&(S=await O({fields:r,onlyCheckValid:!0,name:u,eventType:i.type})));h&&(v._f.deps&&(!Array.isArray(v._f.deps)||v._f.deps.length>0)&&ae(v._f.deps),w(u,S,o,M))}},ie=(e,t)=>{if(U(n.errors,t)&&e.focus)return e.focus(),1},ae=async(e,i={})=>{let a,o,c=yt(e);if(t.resolver){let t=await E(H(e)?e:c);a=Z(t),o=e?!c.some(e=>U(t,e)):a}else e?(o=(await Promise.all(c.map(async e=>{let t=U(r,e);return await O({fields:t&&t._f?{[e]:t}:t,eventType:nt.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&g()):o=a=await O({fields:r,name:e,eventType:nt.TRIGGER});return p.state.next({...!Y(e)||(d.isValid||f.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&Xt(r,ie,e?c:s.mount),o},oe=(e,t)=>{let r={...o.mount?a:i};return t&&(r=xt(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),H(e)?r:Y(e)?U(r,e):e.map(e=>U(r,e))},P=(e,t)=>({invalid:!!U((t||n).errors,e),isDirty:!!U((t||n).dirtyFields,e),error:U((t||n).errors,e),isValidating:!!U(n.validatingFields,e),isTouched:!!U((t||n).touchedFields,e)}),F=e=>{let t=e?yt(e):void 0;t?.forEach(e=>Q(n.errors,e)),t?t.forEach(e=>{p.state.next({name:e,errors:n.errors})}):p.state.next({errors:{}})},se=(e,t,i)=>{let a=(U(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=U(n.errors,e)||{};K(n.errors,e,{...l,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},ce=(e,t)=>G(e)?p.state.subscribe({next:n=>`values`in n&&e(n.values||j(void 0,t),n)}):j(e,t,!0),le=e=>p.state.subscribe({next:t=>{if($t(e.name,t.name,e.exact)&&Qt(t,e.formState||d,xe,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}}).unsubscribe,ue=e=>(o.mount=!0,f={...f,...e.formState},le({...e,formState:{...u,...e.formState}})),de=(e,o={})=>{for(let c of e?yt(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(Q(r,c),Q(a,c)),!o.keepError&&Q(n.errors,c),!o.keepDirty&&Q(n.dirtyFields,c),!o.keepTouched&&Q(n.touchedFields,c),!o.keepIsValidating&&Q(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&Q(i,c);p.state.next({values:V(a)}),p.state.next({...n,...o.keepDirty?{isDirty:A()}:{}}),!o.keepIsValid&&g()},fe=({disabled:e,name:t})=>{if(W(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&g()}},pe=(e,n={})=>{let a=U(r,e),c=W(n.disabled)||W(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return K(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?fe({disabled:W(n.disabled)?n.disabled:t.disabled,name:e}):S(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:Wt(n.min),max:Wt(n.max),minLength:Wt(n.minLength),maxLength:Wt(n.maxLength),pattern:Wt(n.pattern)}:{},name:e,onChange:re,onBlur:re,ref:c=>{if(c){s.registerName.add(e),pe(e,n),s.registerName.delete(e),a=U(r,e);let t=H(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=Et(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;K(r,e,{_f:{...a._f,...o?{refs:[...l.filter(Dt),t,...Array.isArray(U(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),S(e,!1,void 0,t)}else a=U(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(Xe(s.array,e)&&o.action)&&s.unMount.add(e)}}},me=()=>t.shouldFocusError&&Xt(r,ie,s.mount),he=e=>{W(e)&&(p.state.next({disabled:e}),Xt(r,(t,n)=>{let i=U(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},ge=(e,i)=>async o=>{let c;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let l=V(a);if(p.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await T();_(),n.errors=e,l=V(t)}else await O({fields:r,eventType:nt.SUBMIT});if(s.disabled.size)for(let e of s.disabled)Q(l,e);if(Q(n.errors,it),Z(n.errors)){p.state.next({errors:{}});try{await e(l,o)}catch(e){c=e}}else i&&await i({...n.errors},o),me(),setTimeout(me);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Z(n.errors)&&!c,submitCount:n.submitCount+1,errors:n.errors}),c)throw c},_e=(e,t={})=>{U(r,e)&&(H(t.defaultValue)?te(e,V(U(i,e))):(te(e,t.defaultValue),K(i,e,V(t.defaultValue))),t.keepTouched||Q(n.touchedFields,e),t.keepDirty||(Q(n.dirtyFields,e),n.isDirty=t.defaultValue?A(e,V(U(i,e))):A()),t.keepError||(Q(n.errors,e),d.isValid&&g()),p.state.next({...n}))},ve=(e,c={})=>{let l=e?V(e):i,u=V(l),f=Z(e),m=f?i:u;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...Object.keys(Nt(i,a))]);for(let t of Array.from(e)){let e=U(n.dirtyFields,t),r=U(a,t),i=U(m,t);e&&!H(r)?K(m,t,r):!e&&!H(i)&&te(t,i)}}else{if(Qe&&H(e))for(let e of s.mount){let t=U(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Ct(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)te(e,U(m,e));else r={}}a=t.shouldUnregister?c.keepDefaultValues?V(i):{}:V(m),p.array.next({values:{...m}}),p.state.next({values:{...m}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!d.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!Z(m),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,c.keepErrors||(n.errors={}),p.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:f?!1:c.keepDirty?n.isDirty:!!(c.keepDefaultValues&&!X(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:f?{}:c.keepDirtyValues?c.keepDefaultValues&&a?Nt(i,a):n.dirtyFields:c.keepDefaultValues&&e?Nt(i,e):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},ye=(e,n)=>ve(G(e)?e(a):e,{...t.resetOptions,...n}),be=(e,t={})=>{let n=U(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&G(e.select)&&e.select()})}},xe=e=>{n={...n,...e}},Se={control:{register:pe,unregister:de,getFieldState:P,handleSubmit:ge,setError:se,_subscribe:le,_runSchema:T,_updateIsValidating:_,_focusError:me,_getWatch:j,_getDirty:A,_setValid:g,_setFieldArray:y,_setDisabledField:fe,_setErrors:x,_getFieldArray:M,_reset:ve,_resetDefaultValues:()=>G(t.defaultValues)&&t.defaultValues().then(e=>{ye(e,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:k,_disableForm:he,_subjects:p,_proxyFormState:d,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e}}},subscribe:ue,trigger:ae,register:pe,handleSubmit:ge,watch:ce,setValue:te,setValues:ne,getValues:oe,reset:ye,resetField:_e,clearErrors:F,unregister:de,setError:se,setFocus:be,getFieldState:P};return{...Se,formControl:Se}}function ln(e={}){let t=R.useRef(void 0),n=R.useRef(void 0),[r,i]=R.useState({isDirty:!1,isValidating:!1,isLoading:G(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:G(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!G(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...i}=cn(e);t.current={...i,formState:r}}let a=t.current.control;return a._options=e,ct(()=>{let e=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),R.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),R.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),R.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),R.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),R.useEffect(()=>{if(a._proxyFormState.isDirty){let e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}},[a,r.isDirty]),R.useEffect(()=>{e.values&&!X(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions?.keepIsValid||a._setValid(),n.current=e.values,i(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),R.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=R.useMemo(()=>st(r,a),[a,r]),t.current}var $=r(),un=_t,dn=R.createContext({}),fn=e=>{let t=(0,L.c)(9),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;t[2]===n.name?r=t[3]:(r={name:n.name},t[2]=n.name,t[3]=r);let i;t[4]===n?i=t[5]:(i=(0,$.jsx)(mt,{...n}),t[4]=n,t[5]=i);let a;return t[6]!==r||t[7]!==i?(a=(0,$.jsx)(dn.Provider,{value:r,children:i}),t[6]=r,t[7]=i,t[8]=a):a=t[8],a},pn=()=>{let e=(0,L.c)(13),t=R.use(dn),n=R.use(mn),{getFieldState:r}=gt(),i;e[0]===t.name?i=e[1]:(i={name:t.name},e[0]=t.name,e[1]=i);let a=lt(i),o;e[2]!==t.name||e[3]!==a||e[4]!==r?(o=r(t.name,a),e[2]=t.name,e[3]=a,e[4]=r,e[5]=o):o=e[5];let s=o;if(!t)throw Error(`useFormField should be used within <FormField>`);let{id:c}=n,l=`${c}-form-item`,u=`${c}-form-item-description`,d=`${c}-form-item-message`,f;return e[6]!==t.name||e[7]!==s||e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==d?(f={id:c,name:t.name,formItemId:l,formDescriptionId:u,formMessageId:d,...s},e[6]=t.name,e[7]=s,e[8]=c,e[9]=l,e[10]=u,e[11]=d,e[12]=f):f=e[12],f},mn=R.createContext({});function hn(e){let t=(0,L.c)(13),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=R.useId(),a;t[3]===i?a=t[4]:(a={id:i},t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=w(`grid gap-2`,n),t[5]=n,t[6]=o);let s;t[7]!==r||t[8]!==o?(s=(0,$.jsx)(`div`,{"data-slot":`form-item`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9];let c;return t[10]!==a||t[11]!==s?(c=(0,$.jsx)(mn.Provider,{value:a,children:s}),t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function gn(e){let t=(0,L.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{error:i,formItemId:a}=pn(),o=!!i,s;t[3]===n?s=t[4]:(s=w(`data-[error=true]:text-destructive`,n),t[3]=n,t[4]=s);let c;return t[5]!==a||t[6]!==r||t[7]!==o||t[8]!==s?(c=(0,$.jsx)(Ie,{"data-slot":`form-label`,"data-error":o,className:s,htmlFor:a,...r}),t[5]=a,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function _n(e){let t=(0,L.c)(7),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{error:r,formItemId:i,formDescriptionId:a,formMessageId:o}=pn(),s=r?`${a} ${o}`:`${a}`,c=!!r,l;return t[2]!==i||t[3]!==n||t[4]!==s||t[5]!==c?(l=(0,$.jsx)(C,{"data-slot":`form-control`,id:i,"aria-describedby":s,"aria-invalid":c,...n}),t[2]=i,t[3]=n,t[4]=s,t[5]=c,t[6]=l):l=t[6],l}function vn(e){let t=(0,L.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{formDescriptionId:i}=pn(),a;t[3]===n?a=t[4]:(a=w(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==r||t[7]!==a?(o=(0,$.jsx)(`p`,{"data-slot":`form-description`,id:i,className:a,...r}),t[5]=i,t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function yn(e){let t=(0,L.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{error:i,formMessageId:a}=pn(),o=i?String(i?.message??``):r.children;if(!o)return null;let s=i?`alert`:void 0,c;t[3]===n?c=t[4]:(c=w(`text-sm text-destructive`,n),t[3]=n,t[4]=c);let l;return t[5]!==o||t[6]!==a||t[7]!==r||t[8]!==s||t[9]!==c?(l=(0,$.jsx)(`p`,{"data-slot":`form-message`,id:a,role:s,className:c,...r,children:o}),t[5]=o,t[6]=a,t[7]=r,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}var bn=2500;function xn(){let e=(0,L.c)(18),{channel:t,setChannel:n}=Ee(),[r,i]=(0,R.useState)(null),a=(0,R.useRef)(null),o,s;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{a.current&&clearTimeout(a.current)},s=[],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,R.useEffect)(o,s),t===null)return null;let c;e[2]!==t||e[3]!==n?(c=async e=>{if(!(e!==`latest`&&e!==`beta`)&&e!==t)try{await n(e),i(e),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>i(null),bn)}catch(e){let t=e;I.error(`Couldn’t change update channel.`,{description:t instanceof Error?t.message:void 0})}},e[2]=t,e[3]=n,e[4]=c):c=e[4];let l=c,u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`h2`,{id:`settings-channel-title`,className:`text-base font-semibold`,children:`Channel`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Which update stream this app follows. Beta builds may include in-flight bugs.`})]}),e[5]=u):u=e[5];let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(he,{value:`latest`,id:`settings-channel-latest`,className:`mt-0.5`,"data-testid":`settings-channel-latest`}),e[6]=d):d=e[6];let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border p-3`,children:[d,(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(Ie,{htmlFor:`settings-channel-latest`,className:`cursor-pointer text-sm font-medium`,children:`Stable (recommended)`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Safe, well-tested releases. Recommended for everyday use.`})]})]}),e[7]=f):f=e[7];let p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(he,{value:`beta`,id:`settings-channel-beta`,className:`mt-0.5`,"data-testid":`settings-channel-beta`}),e[8]=p):p=e[8];let m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border p-3`,children:[p,(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(Ie,{htmlFor:`settings-channel-beta`,className:`cursor-pointer text-sm font-medium`,children:`Beta (early access)`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Early access to in-flight features. May include bugs. New beta builds released as the team merges work to main.`})]})]}),e[9]=m):m=e[9];let h;e[10]!==t||e[11]!==l?(h=(0,$.jsxs)(we,{value:t,onValueChange:l,"aria-label":`Update channel`,className:`gap-2`,"data-testid":`settings-channel-radio-group`,children:[f,m]}),e[10]=t,e[11]=l,e[12]=h):h=e[12];let g=r?`Channel saved. New version checks will use the ${r===`beta`?`Beta`:`Stable`} channel.`:``,_;e[13]===g?_=e[14]:(_=(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`min-h-4 text-xs text-emerald-600`,"data-testid":`settings-channel-flash`,children:g}),e[13]=g,e[14]=_);let v;return e[15]!==_||e[16]!==h?(v=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-channel-title`,className:`space-y-3`,children:[u,h,_]}),e[15]=_,e[16]=h,e[17]=v):v=e[17],v}var Sn=e(t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}var r=``,i=` `,a=`\\`,o=/^\s+$/,s=/(?:[^\\]|^)\\$/,c=/^\\!/,l=/^\\#/,u=/\r?\n/g,d=/^\.*\/|^\.+$/,f=`/`,p=`node-ignore`;typeof Symbol<`u`&&(p=Symbol.for(`node-ignore`));var m=p,h=(e,t,n)=>Object.defineProperty(e,t,{value:n}),g=/([0-z])-([0-z])/g,_=()=>!1,v=e=>e.replace(g,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:r),y=e=>{let{length:t}=e;return e.slice(0,t-t%2)},b=[[/^\uFEFF/,()=>r],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?i:r)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+i}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===a?`\\[${n}${y(r)}${i}`:i===`]`&&r.length%2==0?`[${v(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],x=Object.create(null),S=(e,t)=>{let n=x[e];return n||(n=b.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),x[e]=n),t?new RegExp(n,`i`):new RegExp(n)},C=e=>typeof e==`string`,w=e=>e&&C(e)&&!o.test(e)&&!s.test(e)&&e.indexOf(`#`)!==0,T=e=>e.split(u),E=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}},D=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(c,`!`).replace(l,`#`);let i=S(e,t);return new E(n,e,r,i)},O=(e,t)=>{throw new t(e)},k=(e,t,n)=>C(e)?e?k.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),A=e=>d.test(e);k.isNotRelative=A,k.convert=e=>e;var j=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){h(this,m,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[m]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(w(e)){let t=D(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(C(e)?T(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&k.convert(e);return k(i,e,this._allowRelativePaths?_:O),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(f),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(f)+f,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},M=e=>new j(e);if(M.isPathValid=e=>k(e&&k.convert(e),e,_),M.default=M,t.exports=M,typeof process<`u`&&({}.IGNORE_TEST_WIN32||process.platform===`win32`)){k.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;k.isNotRelative=t=>e.test(t)||A(t)}}))(),1),Cn=new Map;function wn(e){let t=Cn.get(e);if(t)return Cn.delete(e),Cn.set(e,t),t;let n=(0,Sn.default)();if(n.add(e),Cn.set(e,n),Cn.size>256){let e=Cn.keys().next().value;e!==void 0&&Cn.delete(e)}return n}function Tn(e,t){let n=e.trim();if(n.length===0||n.startsWith(`#`))return 0;let r=wn(n),i=0;for(let e of t)e.length!==0&&r.ignores(e)&&(i+=1);return i}var En={"trailing-backslash":`Trailing backslash — line continuation isn't supported.`,"unmatched-bracket":`Unmatched [ — character class is open.`,"lone-bang":`Lone ! — negation needs a pattern after it.`,"leading-whitespace":`Leading whitespace — the rule may not match as expected.`,"embedded-newline":`Embedded line break — the row spans multiple lines.`};function Dn(e){let t=[];if(e.length===0||e.trimStart().startsWith(`#`))return t;/[\r\n]/.test(e)&&t.push({code:`embedded-newline`,message:En[`embedded-newline`]}),/^\s/.test(e)&&t.push({code:`leading-whitespace`,message:En[`leading-whitespace`]});let n=e.trim();return n===`!`&&t.push({code:`lone-bang`,message:En[`lone-bang`]}),/\\$/.test(n)&&t.push({code:`trailing-backslash`,message:En[`trailing-backslash`]}),On(n,`[`)>On(n,`]`)&&t.push({code:`unmatched-bracket`,message:En[`unmatched-bracket`]}),t}function On(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}var kn=`https://inkeep.github.io/open-knowledge/features/ignore-patterns`,An=1200,jn=150,Mn=150,Nn=5e3,Pn=600,Fn=400,In=`okignore-show-advanced`;function Ln(e){let t=(0,L.c)(3),{binding:n,synced:r}=e;if(n===null||!r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rn,{}),t[0]=e):e=t[0],e}let i;return t[1]===n?i=t[2]:(i=(0,$.jsx)(zn,{binding:n}),t[1]=n,t[2]=i),i}function Rn(){let e=(0,L.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-okignore-title`,className:`space-y-3`,"data-testid":`settings-okignore-skeleton`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`h2`,{id:`settings-okignore-title`,className:`text-base font-semibold`,children:`Ignore patterns`}),(0,$.jsx)(P,{className:`h-4 w-72`})]}),(0,$.jsx)(P,{className:`h-20 w-full`})]}),e[0]=t):t=e[0],t}function zn(e){let t=(0,L.c)(70),{binding:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.current(),t[0]=n,t[1]=r);let[i,a]=(0,R.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>n.subscribe(e=>{a(e)}),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,R.useEffect)(o,s);let{pages:c,pageMeta:l,assetPaths:u}=y(),d;t[5]!==u||t[6]!==l||t[7]!==c?(d=cr(c,l,u),t[5]=u,t[6]=l,t[7]=c,t[8]=d):d=t[8];let f=d,p,m;t[9]===i?(p=t[10],m=t[11]):(p=se(i),m=Te(p),t[9]=i,t[10]=p,t[11]=m);let h=m,g=h.length===0,[_,v]=(0,R.useState)(null),b=(0,R.useRef)(null),S,C;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>()=>{b.current&&clearTimeout(b.current)},C=[],t[12]=S,t[13]=C):(S=t[12],C=t[13]),(0,R.useEffect)(S,C);let w;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{v({key:e,ts:Date.now()}),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>v(null),An)},t[14]=w):w=t[14];let T=w,[E,D]=(0,R.useState)(null),k=(0,R.useRef)(null),j,ee;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>()=>{k.current&&clearTimeout(k.current)},j=[],t[15]=j,t[16]=ee):(j=t[15],ee=t[16]),(0,R.useEffect)(ee,j);let te,ne;t[17]===n?(te=t[18],ne=t[19]):(te=()=>be(e=>{e.docName===`__config__/okignore`&&n.notifyRejection(e.error)}),ne=[n],t[17]=n,t[18]=te,t[19]=ne),(0,R.useEffect)(te,ne);let re,ie;t[20]===n?(re=t[21],ie=t[22]):(re=()=>n.subscribeRejection(e=>{let{error:t}=e,n=ir(t);D({message:n?.detail??x(t),lineNumber:n?.lineNumber,ts:Date.now()}),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>D(null),Nn)}),ie=[n],t[20]=n,t[21]=re,t[22]=ie),(0,R.useEffect)(re,ie);let ae;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ae=[],t[23]=ae):ae=t[23],(0,R.useEffect)(Bn,ae);let P;t[24]===n?P=t[25]:(P=e=>{n.patch(e)},t[24]=n,t[25]=P);let F=P,ce;t[26]!==F||t[27]!==p||t[28]!==h?(ce=(e,t)=>{let n=t.trim(),r=h[e];if(r&&n!==r.text){if(n.length===0){F(le(_e(p,e)));return}F(le(Se(p,e,n))),T(rr(n,e))}},t[26]=F,t[27]=p,t[28]=h,t[29]=ce):ce=t[29];let ue=ce,de;t[30]!==F||t[31]!==p?(de=e=>{F(le(_e(p,e)))},t[30]=F,t[31]=p,t[32]=de):de=t[32];let fe=de,pe;t[33]!==F||t[34]!==p||t[35]!==h.length?(pe=e=>{let t=e.trim();t.length!==0&&(F(le(oe(p,t))),T(rr(t,h.length)))},t[33]=F,t[34]=p,t[35]=h.length,t[36]=pe):pe=t[36];let me=pe,he;t[37]!==F||t[38]!==p?(he=e=>{let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=nr(t),i=nr(n);r<0||i<0||r===i||F(le(De(p,r,i)))},t[37]=F,t[38]=p,t[39]=he):he=t[39];let ge=he,ve;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ve={activationConstraint:{distance:4}},t[40]=ve):ve=t[40];let ye;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ye={coordinateGetter:N},t[41]=ye):ye=t[41];let xe=O(je(M,ve),je(A,ye)),Ce=E===null?null:`rejection-${E.ts}`,[we,Ee]=dr(),Oe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(`h2`,{id:`settings-okignore-title`,className:`text-base font-semibold`,children:`Ignore patterns`}),t[42]=Oe):Oe=t[42];let ke;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[Oe,(0,$.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Hide files and folders from your knowledge base. Hidden items don’t appear in the file tree, search, or AI tools.`,` `,(0,$.jsx)(`a`,{href:kn,target:`_blank`,rel:`noreferrer noopener`,className:`text-primary underline-offset-2 hover:underline`,"data-testid":`settings-okignore-primer`,children:`Learn more about patterns`}),`.`]})]}),t[43]=ke):ke=t[43];let Ae;t[44]===E?Ae=t[45]:(Ae=E===null?null:(0,$.jsx)(Wn,{rejection:E}),t[44]=E,t[45]=Ae);let Me;t[46]!==n||t[47]!==f||t[48]!==me||t[49]!==ge||t[50]!==ue||t[51]!==fe||t[52]!==g||t[53]!==h||t[54]!==Ce||t[55]!==_||t[56]!==xe||t[57]!==we||t[58]!==i?(Me=we?(0,$.jsx)(Hn,{binding:n,text:i}):g?(0,$.jsx)(Gn,{onAdd:me,rejectionFlashKey:Ce,filePaths:f}):(0,$.jsx)(Kn,{patterns:h,sensors:xe,onDragEnd:ge,onEdit:ue,onRemove:fe,onAdd:me,savedFlash:_,rejectionFlashKey:Ce,filePaths:f}),t[46]=n,t[47]=f,t[48]=me,t[49]=ge,t[50]=ue,t[51]=fe,t[52]=g,t[53]=h,t[54]=Ce,t[55]=_,t[56]=xe,t[57]=we,t[58]=i,t[59]=Me):Me=t[59];let Ne;t[60]!==Ee||t[61]!==we?(Ne=()=>Ee(!we),t[60]=Ee,t[61]=we,t[62]=Ne):Ne=t[62];let I;t[63]!==we||t[64]!==Ne?(I=(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(Un,{enabled:we,onToggle:Ne})}),t[63]=we,t[64]=Ne,t[65]=I):I=t[65];let Pe;return t[66]!==Ae||t[67]!==Me||t[68]!==I?(Pe=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-okignore-title`,className:`space-y-3`,"data-testid":`settings-okignore-section`,children:[ke,Ae,Me,I]}),t[66]=Ae,t[67]=Me,t[68]=I,t[69]=Pe):Pe=t[69],Pe}function Bn(){return me(Vn)}function Vn(e){I.error(`Nested .okignore error in ${e.path}`,{description:e.error,id:`okignore-nested-error:${e.path}`,duration:8e3})}function Hn(e){let t=(0,L.c)(25),{binding:n,text:r}=e,[i,a]=(0,R.useState)(r),o=(0,R.useRef)(r),s=(0,R.useRef)(!1),c=(0,R.useRef)(r),l=(0,R.useRef)(null),u,d;t[0]===r?(u=t[1],d=t[2]):(u=()=>{s.current||r!==o.current&&(a(r),c.current=r,o.current=r)},d=[r],t[0]=r,t[1]=u,t[2]=d),(0,R.useEffect)(u,d);let f,p;t[3]===i?(f=t[4],p=t[5]):(f=()=>{c.current=i},p=[i],t[3]=i,t[4]=f,t[5]=p),(0,R.useEffect)(f,p);let m,h;t[6]===n?(m=t[7],h=t[8]):(m=()=>()=>{l.current&&(clearTimeout(l.current),l.current=null,c.current!==o.current&&(n.patch(c.current),o.current=c.current))},h=[n],t[6]=n,t[7]=m,t[8]=h),(0,R.useEffect)(m,h);let g;t[9]===n?g=t[10]:(g=e=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,e!==o.current&&(o.current=e,n.patch(e))},Fn)},t[9]=n,t[10]=g);let _=g,v;t[11]===n?v=t[12]:(v=()=>{l.current&&=(clearTimeout(l.current),null),c.current!==o.current&&(o.current=c.current,n.patch(c.current))},t[11]=n,t[12]=v);let y=v,b;t[13]===_?b=t[14]:(b=e=>{a(e.target.value),_(e.target.value)},t[13]=_,t[14]=b);let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{s.current=!0},t[15]=x):x=t[15];let S;t[16]===y?S=t[17]:(S=()=>{s.current=!1,y()},t[16]=y,t[17]=S);let C;t[18]===i?C=t[19]:(C=i.split(`
2
+ `),t[18]=i,t[19]=C);let w=Math.max(6,Math.min(20,C.length+1)),T;return t[20]!==i||t[21]!==S||t[22]!==w||t[23]!==b?(T=(0,$.jsx)(`textarea`,{value:i,onChange:b,onFocus:x,onBlur:S,spellCheck:!1,rows:w,"aria-label":`Ignore patterns (raw text)`,placeholder:`# One pattern per line.
3
+ # Examples:
4
+ # drafts/
5
+ # *.draft.md
6
+ # !keep.md`,className:`min-h-32 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,"data-testid":`settings-okignore-advanced-textarea`}),t[20]=i,t[21]=S,t[22]=w,t[23]=b,t[24]=T):T=t[24],T}function Un(e){let t=(0,L.c)(4),{enabled:n,onToggle:r}=e,i=n?`Hide advanced`:`Show advanced`,a;return t[0]!==n||t[1]!==r||t[2]!==i?(a=(0,$.jsx)(T,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,"aria-pressed":n,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,"data-testid":`settings-okignore-show-advanced-toggle`,children:i}),t[0]=n,t[1]=r,t[2]=i,t[3]=a):a=t[3],a}function Wn(e){let t=(0,L.c)(4),{rejection:n}=e,r=n.lineNumber?` (line ${n.lineNumber})`:``,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(h,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n.message?(a=(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":`settings-okignore-rejection-banner`,className:`flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive animate-in fade-in`,children:[i,(0,$.jsxs)(`span`,{children:[`Pattern syntax error`,r,`: `,n.message]})]}),t[1]=r,t[2]=n.message,t[3]=a):a=t[3],a}function Gn(e){let t=(0,L.c)(5),{onAdd:n,rejectionFlashKey:r,filePaths:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No patterns yet. Type a folder or file name below to start hiding files.`}),t[0]=a):a=t[0];let o;return t[1]!==i||t[2]!==n||t[3]!==r?(o=(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border border-dashed p-4`,"data-testid":`settings-okignore-empty`,children:[a,(0,$.jsx)(Xn,{onAdd:n,placeholder:`e.g. drafts/ or *.draft.md`,rejectionFlashKey:r,filePaths:i})]}),t[1]=i,t[2]=n,t[3]=r,t[4]=o):o=t[4],o}function Kn(e){let t=(0,L.c)(29),{patterns:n,sensors:r,onDragEnd:i,onEdit:a,onRemove:o,onAdd:s,savedFlash:c,rejectionFlashKey:l,filePaths:u}=e,d;t[0]===n?d=t[1]:(d=n.map(qn),t[0]=n,t[1]=d);let f=d,p;if(t[2]!==u||t[3]!==a||t[4]!==o||t[5]!==n||t[6]!==c){let e;t[8]!==u||t[9]!==a||t[10]!==o||t[11]!==c?(e=(e,t)=>{let n=rr(e.text,t),r=c!==null&&c.key===n;return(0,$.jsx)(Jn,{sortableId:tr(t),patternIndex:t,pattern:e,onEdit:a,onRemove:o,flashActive:r,filePaths:u},tr(t))},t[8]=u,t[9]=a,t[10]=o,t[11]=c,t[12]=e):e=t[12],p=n.map(e),t[2]=u,t[3]=a,t[4]=o,t[5]=n,t[6]=c,t[7]=p}else p=t[7];let m;t[13]===p?m=t[14]:(m=(0,$.jsx)(`ul`,{"aria-label":`Ignore patterns`,className:`divide-y rounded-md border`,"data-testid":`settings-okignore-list`,children:p}),t[13]=p,t[14]=m);let h;t[15]!==f||t[16]!==m?(h=(0,$.jsx)(ge,{items:f,strategy:te,children:m}),t[15]=f,t[16]=m,t[17]=h):h=t[17];let g;t[18]!==i||t[19]!==r||t[20]!==h?(g=(0,$.jsx)(k,{sensors:r,collisionDetection:ne,onDragEnd:i,children:h}),t[18]=i,t[19]=r,t[20]=h,t[21]=g):g=t[21];let _;t[22]!==u||t[23]!==s||t[24]!==l?(_=(0,$.jsx)(Xn,{onAdd:s,placeholder:`Add another pattern…`,rejectionFlashKey:l,filePaths:u}),t[22]=u,t[23]=s,t[24]=l,t[25]=_):_=t[25];let v;return t[26]!==g||t[27]!==_?(v=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[g,_]}),t[26]=g,t[27]=_,t[28]=v):v=t[28],v}function qn(e,t){return tr(t)}function Jn(e){let t=(0,L.c)(41),{sortableId:n,patternIndex:r,pattern:i,onEdit:a,onRemove:o,flashActive:s,filePaths:c}=e,l;t[0]===n?l=t[1]:(l={id:n},t[0]=n,t[1]=l);let{attributes:u,listeners:d,setNodeRef:f,transform:p,transition:m,isDragging:h}=ee(l),g;t[2]===p?g=t[3]:(g=ie.Transform.toString(p),t[2]=p,t[3]=g);let _=h?.5:void 0,v=h?1:void 0,y;t[4]!==g||t[5]!==_||t[6]!==v||t[7]!==m?(y={transform:g,transition:m,opacity:_,zIndex:v},t[4]=g,t[5]=_,t[6]=v,t[7]=m,t[8]=y):y=t[8];let b=y,x=`Drag ${i.text} to reorder`,S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(ve,{className:`size-3.5`}),t[9]=S):S=t[9];let C;t[10]!==u||t[11]!==d||t[12]!==x?(C=(0,$.jsx)(T,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-drag-handle`,"aria-label":x,...u,...d,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/40 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing`,children:S}),t[10]=u,t[11]=d,t[12]=x,t[13]=C):C=t[13];let w;t[14]!==a||t[15]!==r?(w=e=>a(r,e),t[14]=a,t[15]=r,t[16]=w):w=t[16];let E;t[17]!==c||t[18]!==i.text||t[19]!==r||t[20]!==w?(E=(0,$.jsx)(Yn,{patternIndex:r,initialText:i.text,onCommit:w,filePaths:c}),t[17]=c,t[18]=i.text,t[19]=r,t[20]=w,t[21]=E):E=t[21];let D;t[22]===s?D=t[23]:(D=(0,$.jsx)(er,{visible:s}),t[22]=s,t[23]=D);let O=`Remove ${i.text}`,k;t[24]!==o||t[25]!==r?(k=()=>o(r),t[24]=o,t[25]=r,t[26]=k):k=t[26];let A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(Ne,{className:`size-3.5`}),t[27]=A):A=t[27];let j;t[28]!==O||t[29]!==k?(j=(0,$.jsx)(T,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-remove`,"aria-label":O,onClick:k,className:`h-7 w-7 shrink-0 text-muted-foreground hover:text-destructive`,children:A}),t[28]=O,t[29]=k,t[30]=j):j=t[30];let M;t[31]!==E||t[32]!==D||t[33]!==j||t[34]!==C?(M=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C,E,D,j]}),t[31]=E,t[32]=D,t[33]=j,t[34]=C,t[35]=M):M=t[35];let N;return t[36]!==r||t[37]!==f||t[38]!==b||t[39]!==M?(N=(0,$.jsx)(`li`,{ref:f,style:b,className:`flex flex-col gap-0.5 px-2 py-1.5`,"data-testid":`settings-okignore-row`,"data-pattern-index":r,children:M}),t[36]=r,t[37]=f,t[38]=b,t[39]=M,t[40]=N):N=t[40],N}function Yn(e){let t=(0,L.c)(28),{patternIndex:n,initialText:r,onCommit:i,filePaths:a}=e,[o,s]=(0,R.useState)(r),c=(0,R.useRef)(r),l=(0,R.useRef)(!1),u,d;t[0]===r?(u=t[1],d=t[2]):(u=()=>{l.current||r!==c.current&&(s(r),c.current=r)},d=[r],t[0]=r,t[1]=u,t[2]=d),(0,R.useEffect)(u,d);let f=ar(o),p=or(o,a),m;t[3]!==o||t[4]!==i?(m=()=>{o!==c.current&&(c.current=o,i(o))},t[3]=o,t[4]=i,t[5]=m):m=t[5];let h=m,g,_;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>s(e.target.value),_=()=>{l.current=!0},t[6]=g,t[7]=_):(g=t[6],_=t[7]);let v;t[8]===h?v=t[9]:(v=()=>{l.current=!1,h()},t[8]=h,t[9]=v);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),s(c.current),e.currentTarget.blur())},t[10]=y):y=t[10];let b=`Pattern ${n+1}`,x=f.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,S;t[11]===x?S=t[12]:(S=w(`h-7 flex-1 font-mono text-xs`,x),t[11]=x,t[12]=S);let C;t[13]!==o||t[14]!==S||t[15]!==v||t[16]!==b?(C=(0,$.jsx)(We,{value:o,onChange:g,onFocus:_,onBlur:v,onKeyDown:y,"aria-label":b,className:S,"data-testid":`settings-okignore-row-input`}),t[13]=o,t[14]=S,t[15]=v,t[16]=b,t[17]=C):C=t[17];let T;t[18]===f?T=t[19]:(T=(0,$.jsx)(Zn,{warnings:f}),t[18]=f,t[19]=T);let E;t[20]!==C||t[21]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[C,T]}),t[20]=C,t[21]=T,t[22]=E):E=t[22];let D;t[23]===p?D=t[24]:(D=(0,$.jsx)(sr,{count:p}),t[23]=p,t[24]=D);let O;return t[25]!==E||t[26]!==D?(O=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[E,D]}),t[25]=E,t[26]=D,t[27]=O):O=t[27],O}function Xn(e){let t=(0,L.c)(30),{onAdd:n,placeholder:r,rejectionFlashKey:i,filePaths:a}=e,[o,s]=(0,R.useState)(``),c=ar(o),l=or(o,a),u=pr(i),d;t[0]!==n||t[1]!==o?(d=()=>{let e=o.trim();e.length!==0&&(n(e),s(``))},t[0]=n,t[1]=o,t[2]=d):d=t[2];let f=d,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>s(e.target.value),t[3]=p):p=t[3];let m;t[4]===f?m=t[5]:(m=e=>{e.key===`Enter`&&(e.preventDefault(),f())},t[4]=f,t[5]=m);let h=u?`border-destructive ring-2 ring-destructive/30 focus-visible:ring-destructive/50`:c.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,g;t[6]===h?g=t[7]:(g=w(`h-8 text-sm`,h),t[6]=h,t[7]=g);let _=u?`true`:void 0,v;t[8]!==o||t[9]!==r||t[10]!==m||t[11]!==g||t[12]!==_?(v=(0,$.jsx)(We,{value:o,onChange:p,onKeyDown:m,placeholder:r,"aria-label":`New ignore pattern`,className:g,"data-testid":`settings-okignore-add-input`,"data-rejection-flashing":_}),t[8]=o,t[9]=r,t[10]=m,t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;t[14]===c?y=t[15]:(y=(0,$.jsx)(Zn,{warnings:c}),t[14]=c,t[15]=y);let b;t[16]===o?b=t[17]:(b=o.trim(),t[16]=o,t[17]=b);let x=b.length===0,S;t[18]!==f||t[19]!==x?(S=(0,$.jsx)(T,{size:`sm`,onClick:f,disabled:x,"data-testid":`settings-okignore-add-button`,children:`Add pattern`}),t[18]=f,t[19]=x,t[20]=S):S=t[20];let C;t[21]!==S||t[22]!==v||t[23]!==y?(C=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[v,y,S]}),t[21]=S,t[22]=v,t[23]=y,t[24]=C):C=t[24];let E;t[25]===l?E=t[26]:(E=(0,$.jsx)(sr,{count:l}),t[25]=l,t[26]=E);let D;return t[27]!==C||t[28]!==E?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,"data-testid":`settings-okignore-add`,children:[C,E]}),t[27]=C,t[28]=E,t[29]=D):D=t[29],D}function Zn(e){let t=(0,L.c)(17),{warnings:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`flex w-4 shrink-0 justify-center`,"data-testid":`settings-okignore-warning-indicator`,"data-warnings":`0`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.map($n).join(` `),t[1]=n,t[2]=r);let i=r,a=`Pattern warnings: ${i}`,o=String(n.length),s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`}),t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=(0,$.jsx)(`span`,{className:`sr-only`,children:i}),t[4]=i,t[5]=c);let l;t[6]!==a||t[7]!==o||t[8]!==c?(l=(0,$.jsx)(Le,{asChild:!0,children:(0,$.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"aria-label":a,className:`flex w-4 shrink-0 cursor-help justify-center text-amber-500`,"data-testid":`settings-okignore-warning-indicator`,"data-warnings":o,children:[s,c]})}),t[6]=a,t[7]=o,t[8]=c,t[9]=l):l=t[9];let u;t[10]===n?u=t[11]:(u=n.map(Qn),t[10]=n,t[11]=u);let d;t[12]===u?d=t[13]:(d=(0,$.jsx)(Re,{side:`top`,className:`max-w-xs`,children:(0,$.jsx)(`ul`,{className:`list-disc space-y-1 pl-4`,children:u})}),t[12]=u,t[13]=d);let f;return t[14]!==l||t[15]!==d?(f=(0,$.jsxs)(ze,{children:[l,d]}),t[14]=l,t[15]=d,t[16]=f):f=t[16],f}function Qn(e){return(0,$.jsx)(`li`,{children:e.message},e.code)}function $n(e){return e.message}function er(e){let t=(0,L.c)(4),{visible:n}=e,r;t[0]===n?r=t[1]:(r=n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Me,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:`Saved`})]}):null,t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`flex w-4 shrink-0 justify-center text-emerald-600`,"data-testid":`settings-okignore-saved-indicator`,children:r}),t[2]=r,t[3]=i),i}function tr(e){return`okignore-pattern-${e}`}function nr(e){let t=e.match(/^okignore-pattern-(\d+)$/);if(!t)return-1;let n=Number.parseInt(t[1]??``,10);return Number.isNaN(n)?-1:n}function rr(e,t){return`${t}::${e}`}function ir(e){return!p(e)||e.code!==`OKIGNORE_INVALID`?null:{detail:e.detail,lineNumber:e.lineNumber}}function ar(e){let t=(0,L.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.length===0?[]:Dn(e),t[0]=e,t[1]=n);let[r,i]=(0,R.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(e.length===0){i([]);return}let t=setTimeout(()=>{i(Dn(e))},jn);return()=>clearTimeout(t)},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,R.useEffect)(a,o),r}function or(e,t){let n=(0,L.c)(9),r;n[0]===e?r=n[1]:(r=e.trim(),n[0]=e,n[1]=r);let i=r,a;n[2]!==t||n[3]!==i?(a=()=>i.length===0?null:Tn(i,t),n[2]=t,n[3]=i,n[4]=a):a=n[4];let[o,s]=(0,R.useState)(a),c,l;return n[5]!==t||n[6]!==i?(c=()=>{if(i.length===0){s(null);return}let e=setTimeout(()=>{s(Tn(i,t))},Mn);return()=>clearTimeout(e)},l=[i,t],n[5]=t,n[6]=i,n[7]=c,n[8]=l):(c=n[7],l=n[8]),(0,R.useEffect)(c,l),o}function sr(e){let t=(0,L.c)(11),{count:n}=e;if(n===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`block h-3.5`,"data-testid":`settings-okignore-preview`,"data-preview-state":`hidden`}),t[0]=e):e=t[0],e}let r=n===0,i=String(n),a=r?`text-muted-foreground/70`:`text-muted-foreground`,o;t[1]===a?o=t[2]:(o=w(`block text-xs`,a),t[1]=a,t[2]=o);let s=n===1?`file`:`files`,c;t[3]===r?c=t[4]:(c=r?(0,$.jsx)(`span`,{className:`ml-1 text-muted-foreground/60`,children:`(some may already be hidden by other rules)`}):null,t[3]=r,t[4]=c);let l;return t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`settings-okignore-preview`,"data-preview-state":`visible`,"data-preview-count":i,className:o,children:[`matches `,n,` `,s,c]}),t[5]=n,t[6]=i,t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function cr(e,t,n){let r=[];for(let n of e){let e=t.get(n)?.docExt??`.md`;r.push(n+e)}for(let e of n)r.push(e);return r}function lr(){try{return globalThis.localStorage?.getItem(In)===`true`}catch{return!1}}function ur(e){try{globalThis.localStorage?.setItem(In,e?`true`:`false`)}catch(e){console.debug(`[OkignoreSection] localStorage unavailable; advanced toggle will not persist:`,e)}}function dr(){let e=(0,L.c)(3),[t,n]=(0,R.useState)(fr),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=e=>{n(e),ur(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a=[t,i],e[1]=t,e[2]=a),a}function fr(){return lr()}function pr(e){let t=(0,L.c)(3),[n,r]=(0,R.useState)(!1),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(e===null)return;r(!0);let t=setTimeout(()=>r(!1),Pn);return()=>clearTimeout(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,R.useEffect)(i,a),n}function mr(e){let t=(0,L.c)(98),{config:n}=e,{state:r,refresh:i}=xe(``),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),p,m,h,g,_,v,y,b,x,S;if(t[0]!==n.badge||t[1]!==n.description||t[2]!==n.emptyMessage||t[3]!==n.itemNoun||t[4]!==n.scope||t[5]!==n.settingsId||t[6]!==n.target||t[7]!==n.testIdPrefix||t[8]!==n.title||t[9]!==d||t[10]!==i||t[11]!==r.data||t[12]!==r.message||t[13]!==r.status){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.status===`ready`?(r.data.folder.templates_available??[]).filter(e=>e.scope===n.scope).sort(gr):[],a;if(t[24]!==n.target||t[25]!==i?(a=async function(e){u(!0);let t=await ke(``,e.name,n.target);if(u(!1),!t.ok){I.error(`Delete failed: ${t.error}`);return}I.success(`Template "${e.name}" deleted`),c(null),i()},t[24]=n.target,t[25]=i,t[26]=a):a=t[26],m=a,r.status===`error`){let e=`settings-${n.testIdPrefix}-section`,a;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>f(!0),t[27]=a):a=t[27];let o;t[28]!==n.description||t[29]!==n.settingsId||t[30]!==n.testIdPrefix||t[31]!==n.title?(o=(0,$.jsx)(_r,{settingsId:n.settingsId,testIdPrefix:n.testIdPrefix,title:n.title,description:n.description,onNewClick:a}),t[28]=n.description,t[29]=n.settingsId,t[30]=n.testIdPrefix,t[31]=n.title,t[32]=o):o=t[32];let s;t[33]!==n.itemNoun||t[34]!==r.message?(s=(0,$.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:[`Failed to load `,n.itemNoun,`s: `,r.message]}),t[33]=n.itemNoun,t[34]=r.message,t[35]=s):s=t[35];let c;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(c=new Set,t[36]=c):c=t[36];let l;t[37]!==n.target||t[38]!==d||t[39]!==i?(l=(0,$.jsx)(pe,{folderPath:``,existingNames:c,open:d,onOpenChange:f,onCreated:i,target:n.target}),t[37]=n.target,t[38]=d,t[39]=i,t[40]=l):l=t[40];let u;t[41]!==n.settingsId||t[42]!==e||t[43]!==o||t[44]!==s||t[45]!==l?(u=(0,$.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":n.settingsId,"data-testid":e,children:[o,s,l]}),t[41]=n.settingsId,t[42]=e,t[43]=o,t[44]=s,t[45]=l,t[46]=u):u=t[46],S=u;break bb0}if(r.status===`idle`||r.status===`loading`){let e=`settings-${n.testIdPrefix}-section`,r;t[47]!==n.description||t[48]!==n.settingsId||t[49]!==n.testIdPrefix||t[50]!==n.title?(r=(0,$.jsx)(_r,{settingsId:n.settingsId,testIdPrefix:n.testIdPrefix,title:n.title,description:n.description}),t[47]=n.description,t[48]=n.settingsId,t[49]=n.testIdPrefix,t[50]=n.title,t[51]=r):r=t[51];let i;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card p-3 space-y-2`,children:[(0,$.jsx)(P,{className:`h-12 w-full`}),(0,$.jsx)(P,{className:`h-12 w-full`})]}),t[52]=i):i=t[52];let a;t[53]!==n.settingsId||t[54]!==e||t[55]!==r?(a=(0,$.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":n.settingsId,"data-testid":e,children:[r,i]}),t[53]=n.settingsId,t[54]=e,t[55]=r,t[56]=a):a=t[56],S=a;break bb0}_=`space-y-3`,v=n.settingsId,y=`settings-${n.testIdPrefix}-section`;let s;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>f(!0),t[57]=s):s=t[57],t[58]!==n.description||t[59]!==n.settingsId||t[60]!==n.testIdPrefix||t[61]!==n.title?(b=(0,$.jsx)(_r,{settingsId:n.settingsId,testIdPrefix:n.testIdPrefix,title:n.title,description:n.description,onNewClick:s}),t[58]=n.description,t[59]=n.settingsId,t[60]=n.testIdPrefix,t[61]=n.title,t[62]=b):b=t[62];let l=e.length===0?(0,$.jsx)(`p`,{className:`px-3 py-4 text-sm text-muted-foreground`,"data-testid":`settings-${n.testIdPrefix}-empty`,children:n.emptyMessage}):(0,$.jsx)(`ul`,{className:`space-y-1 p-2`,"data-testid":`settings-${n.testIdPrefix}-list`,children:e.map(e=>(0,$.jsx)(vr,{template:e,badge:n.badge,testIdPrefix:n.testIdPrefix,onEdit:()=>o(e),onDelete:()=>c(e)},e.name))});t[63]===l?x=t[64]:(x=(0,$.jsx)(`div`,{className:`rounded-lg border bg-card`,children:l}),t[63]=l,t[64]=x),p=pe,h=``,g=new Set(e.map(hr))}t[0]=n.badge,t[1]=n.description,t[2]=n.emptyMessage,t[3]=n.itemNoun,t[4]=n.scope,t[5]=n.settingsId,t[6]=n.target,t[7]=n.testIdPrefix,t[8]=n.title,t[9]=d,t[10]=i,t[11]=r.data,t[12]=r.message,t[13]=r.status,t[14]=p,t[15]=m,t[16]=h,t[17]=g,t[18]=_,t[19]=v,t[20]=y,t[21]=b,t[22]=x,t[23]=S}else p=t[14],m=t[15],h=t[16],g=t[17],_=t[18],v=t[19],y=t[20],b=t[21],x=t[22],S=t[23];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[65]!==p||t[66]!==n.target||t[67]!==d||t[68]!==i||t[69]!==h||t[70]!==g?(C=(0,$.jsx)(p,{folderPath:h,existingNames:g,open:d,onOpenChange:f,onCreated:i,target:n.target}),t[65]=p,t[66]=n.target,t[67]=d,t[68]=i,t[69]=h,t[70]=g,t[71]=C):C=t[71];let w;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e||o(null)},t[72]=w):w=t[72];let T;t[73]!==n.target||t[74]!==a||t[75]!==i?(T=(0,$.jsx)(ye,{folderPath:``,template:a,onOpenChange:w,onSaved:i,target:n.target}),t[73]=n.target,t[74]=a,t[75]=i,t[76]=T):T=t[76];let E=!!s,D;t[77]===l?D=t[78]:(D=e=>{!e&&!l&&c(null)},t[77]=l,t[78]=D);let O;t[79]!==n.deleteWarning||t[80]!==n.itemNoun||t[81]!==s||t[82]!==l||t[83]!==m?(O=s&&(0,$.jsx)(fe,{itemName:`${n.itemNoun} "${s.name}"`,isSubmitting:l,onDelete:()=>m(s),customDescription:n.deleteWarning}),t[79]=n.deleteWarning,t[80]=n.itemNoun,t[81]=s,t[82]=l,t[83]=m,t[84]=O):O=t[84];let k;t[85]!==E||t[86]!==D||t[87]!==O?(k=(0,$.jsx)(Ue,{open:E,onOpenChange:D,children:O}),t[85]=E,t[86]=D,t[87]=O,t[88]=k):k=t[88];let A;return t[89]!==T||t[90]!==k||t[91]!==_||t[92]!==v||t[93]!==y||t[94]!==b||t[95]!==x||t[96]!==C?(A=(0,$.jsxs)(`section`,{className:_,"aria-labelledby":v,"data-testid":y,children:[b,x,C,T,k]}),t[89]=T,t[90]=k,t[91]=_,t[92]=v,t[93]=y,t[94]=b,t[95]=x,t[96]=C,t[97]=A):A=t[97],A}function hr(e){return e.name}function gr(e,t){let n=(e.title??e.name).toLowerCase(),r=(t.title??t.name).toLowerCase();return n.localeCompare(r)}function _r(e){let t=(0,L.c)(14),{settingsId:n,testIdPrefix:r,title:i,description:a,onNewClick:o}=e,s;t[0]!==n||t[1]!==i?(s=(0,$.jsx)(`h2`,{id:n,className:`text-base font-semibold`,children:i}),t[0]=n,t[1]=i,t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),t[3]=a,t[4]=c);let l;t[5]!==s||t[6]!==c?(l=(0,$.jsxs)(`div`,{children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]!==o||t[9]!==r?(u=o?(0,$.jsxs)(T,{variant:`outline`,size:`sm`,className:`font-mono uppercase shrink-0`,onClick:o,"data-testid":`settings-${r}-new-button`,children:[(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),`New template`]}):null,t[8]=o,t[9]=r,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function vr(e){let t=(0,L.c)(41),{template:n,badge:r,testIdPrefix:i,onEdit:a,onDelete:o}=e,u=n.title&&n.title!==n.name,d=`settings-${i}-row`,f=`settings-${i}-row-edit`,p=n.title??n.name,m;t[0]===p?m=t[1]:(m=(0,$.jsx)(`span`,{className:`font-medium truncate`,children:p}),t[0]=p,t[1]=m);let h;t[2]!==u||t[3]!==n.name?(h=u?(0,$.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground shrink-0`,children:n.name}):null,t[2]=u,t[3]=n.name,t[4]=h):h=t[4];let g;t[5]!==r.label||t[6]!==r.variant?(g=(0,$.jsx)(s,{variant:r.variant,className:`ml-auto shrink-0 text-2xs`,children:r.label}),t[5]=r.label,t[6]=r.variant,t[7]=g):g=t[7];let _;t[8]!==m||t[9]!==h||t[10]!==g?(_=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[m,h,g]}),t[8]=m,t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;t[12]===n.description?v=t[13]:(v=n.description?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:n.description}):null,t[12]=n.description,t[13]=v);let y;t[14]!==a||t[15]!==f||t[16]!==_||t[17]!==v?(y=(0,$.jsxs)(`button`,{type:`button`,onClick:a,className:`min-w-0 flex-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,"data-testid":f,children:[_,v]}),t[14]=a,t[15]=f,t[16]=_,t[17]=v,t[18]=y):y=t[18];let b=`Actions for ${n.title??n.name}`,x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(Oe,{className:`size-4`,"aria-hidden":!0}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,$.jsx)(D,{asChild:!0,children:(0,$.jsx)(T,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":b,children:x})}),t[20]=b,t[21]=S);let C=`settings-${i}-row-edit-menuitem`,w;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(l,{"aria-hidden":!0}),t[22]=w):w=t[22];let E;t[23]!==a||t[24]!==C?(E=(0,$.jsxs)(re,{onSelect:a,"data-testid":C,children:[w,`Edit`]}),t[23]=a,t[24]=C,t[25]=E):E=t[25];let O=`settings-${i}-row-delete-menuitem`,k;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(c,{"aria-hidden":!0}),t[26]=k):k=t[26];let A;t[27]!==o||t[28]!==O?(A=(0,$.jsxs)(re,{variant:`destructive`,onSelect:o,"data-testid":O,children:[k,`Delete`]}),t[27]=o,t[28]=O,t[29]=A):A=t[29];let j;t[30]!==E||t[31]!==A?(j=(0,$.jsxs)(Ae,{align:`end`,children:[E,A]}),t[30]=E,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==S||t[34]!==j?(M=(0,$.jsxs)(F,{children:[S,j]}),t[33]=S,t[34]=j,t[35]=M):M=t[35];let N;return t[36]!==d||t[37]!==M||t[38]!==y||t[39]!==n.name?(N=(0,$.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted/50 text-sm`,"data-testid":d,"data-template-name":n.name,children:[y,M]}),t[36]=d,t[37]=M,t[38]=y,t[39]=n.name,t[40]=N):N=t[40],N}function yr(){let e=(0,L.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)($.Fragment,{children:[`Stored at `,(0,$.jsx)(`code`,{className:`font-mono`,children:`.ok/templates/`}),` in this project. Available in every folder (folder-scoped templates can override by filename).`]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(mr,{config:{scope:`local`,target:`project`,title:`Project templates`,description:t,emptyMessage:`No project templates yet. Create one to make it available everywhere in this project. Folder-scoped templates live on each folder's overview page.`,deleteWarning:`This permanently removes the template from this project's .ok/templates/ directory. Agents and folders that reference it by name will fail until it's recreated.`,itemNoun:`project template`,badge:{label:`project`,variant:`gray`},settingsId:`settings-project-templates-title`,testIdPrefix:`project-templates`}}),e[1]=n):n=e[1],n}function br(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:br(r,t)}}function xr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function Sr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function Cr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function wr(){let e=(0,L.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)($.Fragment,{children:[`Stored at `,(0,$.jsx)(`code`,{className:`font-mono`,children:`~/.ok/templates/`}),`. Available in every OK project you open with this user account.`]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(mr,{config:{scope:`user`,target:`user`,title:`User templates`,description:t,emptyMessage:`No user templates yet. Create one to make it available in every OK project you open with this user account.`,deleteWarning:`This permanently removes the template from ~/.ok/templates/. It will no longer appear in any of your OK projects.`,itemNoun:`user template`,badge:{label:`user`,variant:`primary`},settingsId:`settings-user-templates-title`,testIdPrefix:`user-templates`}}),e[1]=n):n=e[1],n}function Tr(e){let t=(0,L.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=ln(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{Er(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,R.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Dr(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function Er(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Dr(e,t,n){let r=e.getValues(n),i=br(Ar(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(p(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:Or(a.error,n)});return!1}function Or(e,t){if(p(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>kr(e,t));if(n)return n.message}return x(e)}function kr(e,t){return e.path.map(String).join(`.`)===t}function Ar(e){return e.split(`.`)}var jr=[{path:[`appearance`,`theme`],label:`Theme`,description:`Light, dark, or follow the OS.`,control:`enum-toggle`}],Mr=[{path:[`preview`,`baseUrl`],label:`Preview base URL`,description:`URL of your team’s deployed wiki (project-only).`}];function Nr(e,t){let n=(0,L.c)(5),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={user:null,project:null},n[0]=r):r=n[0];let[i,a]=(0,R.useState)(r),s,c;return n[1]!==e||n[2]!==t?(s=()=>{if(!t||e===null){a({user:null,project:null});return}let n=(t,n)=>{let r=new o,i=new u({url:e,name:t,document:r}),s=_(i,n),c={provider:i,binding:s,synced:!1},l=()=>{a(e=>{let t=e[n];return t?.provider===i?{...e,[n]:{...t,synced:!0}}:e})};return i.on(`synced`,l),{conn:c,cleanup:()=>{i.off(`synced`,l),s.dispose(),i.destroy(),r.destroy()}}},r=n(b,`user`),i=n(f,`project`);return a({user:r.conn,project:i.conn}),()=>{r.cleanup(),i.cleanup(),a({user:null,project:null})}},c=[e,t],n[1]=e,n[2]=t,n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,R.useEffect)(s,c),i}function Pr(e){let t=(0,L.c)(30),{open:n,onOpenChange:r}=e,{collabUrl:i}=d(),a=Nr(i,n),{okignoreBinding:o,okignoreSynced:s}=E(),[c,l]=(0,R.useState)(`preferences`),u,f;t[0]===n?(u=t[1],f=t[2]):(u=()=>{n&&l(`preferences`)},f=[n],t[0]=n,t[1]=u,t[2]=f),(0,R.useEffect)(u,f);let p=i!==null,m=Fr(),h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={id:`user`,label:`User`,enabled:!0,items:[{id:`preferences`,label:`Preferences`},{id:`user-templates`,label:`User templates`}]},t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=[{id:`project-general`,label:`General`},{id:`project-templates`,label:`Templates`},{id:`okignore`,label:`Ignore patterns`}],t[4]=g):g=t[4];let _;t[5]===p?_=t[6]:(_={id:`project`,label:`This project`,enabled:p,items:g},t[5]=p,t[6]=_);let v;t[7]===m?v=t[8]:(v={id:`integrations`,label:`Integrations`,enabled:!0,items:m?[{id:`claude-desktop`,label:`Claude Desktop`}]:[]},t[7]=m,t[8]=v);let y;t[9]!==_||t[10]!==v?(y=[h,_,v],t[9]=_,t[10]=v,t[11]=y):y=t[11];let b=y,x,S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(Ve,{className:`sr-only`,children:`Settings`}),S=(0,$.jsx)(Be,{className:`sr-only`,children:`Configure user, project, and integration settings.`}),t[12]=x,t[13]=S):(x=t[12],S=t[13]);let C;t[14]!==c||t[15]!==b?(C=(0,$.jsx)(Ir,{groups:b,activeId:c,onSelect:l}),t[14]=c,t[15]=b,t[16]=C):C=t[16];let w=a.user?.synced?a.user.binding:null,T=a.project?.synced?a.project.binding:null,D;t[17]!==c||t[18]!==o||t[19]!==s||t[20]!==w||t[21]!==T?(D=(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,children:(0,$.jsx)(Rr,{activeId:c,userBinding:w,projectBinding:T,okignoreBinding:o,okignoreSynced:s})}),t[17]=c,t[18]=o,t[19]=s,t[20]=w,t[21]=T,t[22]=D):D=t[22];let O;t[23]!==C||t[24]!==D?(O=(0,$.jsxs)(He,{className:`grid h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] grid-cols-[220px_1fr] gap-0 overflow-hidden p-0 sm:max-w-[900px]`,"data-testid":`settings-dialog`,children:[x,S,C,D]}),t[23]=C,t[24]=D,t[25]=O):O=t[25];let k;return t[26]!==r||t[27]!==n||t[28]!==O?(k=(0,$.jsx)(Ue,{open:n,onOpenChange:r,children:O}),t[26]=r,t[27]=n,t[28]=O,t[29]=k):k=t[29],k}function Fr(){let e=(0,L.c)(2),[t,n]=(0,R.useState)(!0),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=(typeof window<`u`?window.okDesktop:void 0)?.skill?.detectClaudeDesktop;if(!e){n(!0);return}let t=!1;return e().then(e=>{t||n(e)}).catch(()=>{t||n(!0)}),()=>{t=!0}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,R.useEffect)(r,i),t}function Ir(e){let t=(0,L.c)(9),{groups:n,activeId:r,onSelect:i}=e,a;if(t[0]!==r||t[1]!==n||t[2]!==i){let e;t[4]!==r||t[5]!==i?(e=e=>(0,$.jsx)(Lr,{group:e,activeId:r,onSelect:i},e.id),t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=n,t[2]=i,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,$.jsx)(`aside`,{"aria-label":`Settings sections`,className:`h-full overflow-y-auto overscroll-contain subtle-scrollbar border-r bg-muted/30 px-3 py-4`,children:(0,$.jsx)(`nav`,{children:a})}),t[7]=a,t[8]=o),o}function Lr(e){let t=(0,L.c)(26),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,s=n.enabled?void 0:o,c=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,l;t[0]===c?l=t[1]:(l=w(`mb-1 px-2 text-xs font-semibold uppercase tracking-wide font-mono`,c),t[0]=c,t[1]=l);let u;t[2]!==n.label||t[3]!==a||t[4]!==s||t[5]!==l?(u=(0,$.jsx)(`h2`,{id:a,"aria-describedby":s,className:l,children:n.label}),t[2]=n.label,t[3]=a,t[4]=s,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==o||t[8]!==n.enabled?(d=n.enabled?null:(0,$.jsx)(`p`,{id:o,className:`mb-1 px-2 text-xs italic text-muted-foreground/60`,children:`Open a project to edit.`}),t[7]=o,t[8]=n.enabled,t[9]=d):d=t[9];let f;if(t[10]!==r||t[11]!==n.enabled||t[12]!==n.items||t[13]!==i){let e;t[15]!==r||t[16]!==n.enabled||t[17]!==i?(e=e=>(0,$.jsx)(`li`,{children:(0,$.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`true`:void 0,"aria-disabled":n.enabled?void 0:!0,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:w(`w-full rounded px-2 py-1.5 text-left text-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[15]=r,t[16]=n.enabled,t[17]=i,t[18]=e):e=t[18],f=n.items.map(e),t[10]=r,t[11]=n.enabled,t[12]=n.items,t[13]=i,t[14]=f}else f=t[14];let p;t[19]!==a||t[20]!==f?(p=(0,$.jsx)(`ul`,{"aria-labelledby":a,className:`space-y-0.5`,children:f}),t[19]=a,t[20]=f,t[21]=p):p=t[21];let m;return t[22]!==u||t[23]!==d||t[24]!==p?(m=(0,$.jsxs)(`div`,{className:`mb-4`,children:[u,d,p]}),t[22]=u,t[23]=d,t[24]=p,t[25]=m):m=t[25],m}function Rr(e){let t=(0,L.c)(14),{activeId:n,userBinding:r,projectBinding:i,okignoreBinding:a,okignoreSynced:o}=e;if(n===`preferences`){let e;t[0]===r?e=t[1]:(e=r?(0,$.jsx)(Vr,{title:`Appearance`,description:`UI preferences. Editor toggles continue to write localStorage as a cache.`,scope:`user`,binding:r,fields:jr}):(0,$.jsx)(Br,{}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(xn,{}),t[2]=n):n=t[2];let i;return t[3]===e?i=t[4]:(i=(0,$.jsxs)(`div`,{className:`space-y-8`,children:[e,n]}),t[3]=e,t[4]=i),i}if(n===`project-general`){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ur,{}),t[5]=e):e=t[5];let n;return t[6]===i?n=t[7]:(n=(0,$.jsxs)(`div`,{className:`space-y-8`,children:[e,i?(0,$.jsx)(Vr,{title:`Preview`,description:`Where the preview tab points when no local UI is running.`,scope:`project`,binding:i,fields:Mr}):(0,$.jsx)(Br,{})]}),t[6]=i,t[7]=n),n}if(n===`user-templates`){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(wr,{}),t[8]=e):e=t[8],e}if(n===`project-templates`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(yr,{}),t[9]=e):e=t[9],e}if(n===`okignore`){let e;return t[10]!==a||t[11]!==o?(e=(0,$.jsx)(Ln,{binding:a,synced:o}),t[10]=a,t[11]=o,t[12]=e):e=t[12],e}if(n===`claude-desktop`){let e;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Xr,{}),t[13]=e):e=t[13],e}return null}function zr(e){if(!p(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Br(){let e=(0,L.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(P,{className:`h-5 w-32`}),n=(0,$.jsx)(P,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(P,{className:`h-9 w-full`}),(0,$.jsx)(P,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Vr(e){let t=(0,L.c)(14),{title:n,description:r,scope:i,binding:a,fields:o}=e,{form:s,commitField:c}=Tr(a),[l,u]=(0,R.useState)(null),d=(0,R.useRef)(null),p,m;t[0]!==s||t[1]!==i?(p=()=>{let e=i===`project`?f:b,t=be(t=>{if(t.docName!==e)return;I.error(x(t.error),{duration:8e3});let n=zr(t.error);n&&(s.setError(n,{type:`config-validation-rejected`,message:Or(t.error,n)}),s.setFocus(n),u(n),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(null),s.clearErrors(n)},600))});return()=>{t(),d.current&&clearTimeout(d.current)}},m=[i,s],t[0]=s,t[1]=i,t[2]=p,t[3]=m):(p=t[2],m=t[3]),(0,R.useEffect)(p,m);let h;t[4]!==c||t[5]!==r||t[6]!==o||t[7]!==l||t[8]!==i||t[9]!==n?(h=(0,$.jsx)(Hr,{title:n,description:r,scope:i,fields:o,commitField:c,flashedPath:l}),t[4]=c,t[5]=r,t[6]=o,t[7]=l,t[8]=i,t[9]=n,t[10]=h):h=t[10];let g;return t[11]!==s||t[12]!==h?(g=(0,$.jsx)(un,{...s,children:h}),t[11]=s,t[12]=h,t[13]=g):g=t[13],g}function Hr(e){let t=(0,L.c)(23),{title:n,description:r,scope:i,fields:a,commitField:o,flashedPath:s}=e,c=`settings-section-${i}-title`,l;t[0]!==n||t[1]!==c?(l=(0,$.jsx)(`h2`,{id:c,className:`text-base font-semibold`,children:n}),t[0]=n,t[1]=c,t[2]=l):l=t[2];let u;t[3]===r?u=t[4]:(u=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}),t[3]=r,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f;if(t[8]!==o||t[9]!==a||t[10]!==s||t[11]!==i){let e;t[13]!==o||t[14]!==s||t[15]!==i?(e=e=>(0,$.jsx)(Wr,{field:e,scope:i,commitField:o,isFlashed:s===e.path.join(`.`)},e.path.join(`.`)),t[13]=o,t[14]=s,t[15]=i,t[16]=e):e=t[16],f=a.map(e),t[8]=o,t[9]=a,t[10]=s,t[11]=i,t[12]=f}else f=t[12];let p;t[17]===f?p=t[18]:(p=(0,$.jsx)(`div`,{className:`space-y-10`,children:f}),t[17]=f,t[18]=p);let m;return t[19]!==d||t[20]!==p||t[21]!==c?(m=(0,$.jsxs)(`section`,{"aria-labelledby":c,className:`space-y-10`,children:[d,p]}),t[19]=d,t[20]=p,t[21]=c,t[22]=m):m=t[22],m}function Ur(){let e=(0,L.c)(19),t=ue(),{confirmOpen:n,setConfirmOpen:r,onToggleRequest:i,onConfirm:o}=j(ae());if(t&&!t.hasRemote&&t.state===`dormant`)return null;let s=t?.syncEnabled??!1,c=t===null,l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`h2`,{id:`settings-sync-title`,className:`text-base font-semibold`,children:`Sync`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Auto-sync pushes/pulls commits to your git remote on intervals and on save. Toggling on requires confirmation.`})]}),e[0]=l):l=e[0];let u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`label`,{htmlFor:`settings-sync-toggle`,className:`text-sm font-medium`,children:`Git auto-sync`}),e[1]=u):u=e[1];let d=s?`Auto-sync is on — your commits push and remote changes pull on intervals.`:`Auto-sync is off — your edits stay local until you commit and push manually.`,f;e[2]===d?f=e[3]:(f=(0,$.jsxs)(`div`,{children:[u,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:d})]}),e[2]=d,e[3]=f);let p=s?`Disable git auto-sync`:`Enable git auto-sync`,m;e[4]!==c||e[5]!==s||e[6]!==i||e[7]!==p?(m=(0,$.jsx)(a,{id:`settings-sync-toggle`,checked:s,disabled:c,onCheckedChange:i,"aria-label":p,"data-testid":`settings-sync-toggle`}),e[4]=c,e[5]=s,e[6]=i,e[7]=p,e[8]=m):m=e[8];let h;e[9]!==f||e[10]!==m?(h=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[f,m]})}),e[9]=f,e[10]=m,e[11]=h):h=e[11];let g;e[12]!==n||e[13]!==o||e[14]!==r?(g=(0,$.jsx)(de,{open:n,onOpenChange:r,onConfirm:o}),e[12]=n,e[13]=o,e[14]=r,e[15]=g):g=e[15];let _;return e[16]!==h||e[17]!==g?(_=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-sync-title`,className:`space-y-3`,children:[l,h,g]}),e[16]=h,e[17]=g,e[18]=_):_=e[18],_}function Wr({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let i=gt(),a=v(m,e.path),o=a?Sr(a):void 0,s=a?xr(a):void 0,c=a?Cr(a):void 0,l=a?g(a):void 0,u=l?.scope===`project`&&t!==`project`||l?.scope===`user`&&t!==`user`,d=e.path.join(`.`),[f,p]=(0,R.useState)(!1),h=(0,R.useRef)(null);(0,R.useEffect)(()=>()=>{h.current&&clearTimeout(h.current)},[]);let _=()=>{p(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>p(!1),1200)},y=()=>{let e=n(d);return e&&_(),e},b=()=>i.getFieldState(d).isDirty?y():!0,x=()=>{let e=s===void 0?null:s;i.setValue(d,e,{shouldDirty:!1}),y()},S=w(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(fn,{control:i.control,name:d,render:({field:n})=>{let r=!u&&(s!==void 0||n.value!==void 0);return(0,$.jsxs)(hn,{className:S,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(gn,{className:`text-sm font-medium`,children:e.label}),r?(0,$.jsxs)(ze,{children:[(0,$.jsx)(Le,{asChild:!0,children:(0,$.jsx)(T,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:x,"aria-label":`Reset ${e.label} to default`,children:(0,$.jsx)(Ge,{className:`size-3.5`})})}),(0,$.jsx)(Re,{children:`Reset to default`})]}):null]}),e.description?(0,$.jsx)(vn,{className:`text-muted-foreground text-1sm`,children:e.description}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(_n,{children:(0,$.jsx)(Gr,{field:e,ctl:n,typeTag:o,enumOptions:c,onCommit:b})}),(0,$.jsx)(Yr,{visible:f})]}),(0,$.jsx)(yn,{"data-field-error":e.path.join(`.`)})]})}})}function Gr({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...o}){"use no memo";if(n===`boolean`)return(0,$.jsx)(a,{...o,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=o;return(0,$.jsx)(Fe,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":e.label,children:r.map((e,t)=>(0,$.jsx)(Pe,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(qr,{ctl:t,onCommit:i,...o}):n===`array`?(0,$.jsx)(Jr,{ctl:t,onCommit:i,...o}):(0,$.jsx)(Kr,{ctl:t,onCommit:i,...o})}function Kr({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(We,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function qr({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,R.useState)(e.value===void 0?``:String(e.value)),a=(0,R.useRef)(e.value);(0,R.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(We,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Jr({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
7
+ `):``,[i,a]=(0,R.useState)(r),o=(0,R.useRef)(r);(0,R.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
8
+ `):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
9
+ `).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
10
+ `)};return(0,$.jsx)(`textarea`,{...n,value:i,ref:e.ref,onChange:e=>a(e.target.value),onBlur:()=>{e.onBlur(),s()},rows:Math.max(2,Math.min(6,i.split(`
11
+ `).length)),className:`min-h-16 w-full rounded-md border border-input bg-background px-3 py-1.5 font-mono text-xs outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`})}function Yr(e){let t=(0,L.c)(4),{visible:n}=e,r;t[0]===n?r=t[1]:(r=n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Me,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:`Saved`})]}):null,t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-emerald-600`,children:r}),t[2]=r,t[3]=i),i}function Xr(){let e=(0,L.c)(5),[t,n]=(0,R.useState)(!1),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`h2`,{id:`settings-integrations-title`,className:`text-base font-semibold`,children:`Integrations`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect Open Knowledge to other tools you use.`})]}),e[0]=r):r=e[0];let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:`Install in Claude Desktop`}),(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:`Make this knowledge base available as a Claude Skill.`})]}),e[1]=i):i=e[1];let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>n(!0),"data-testid":`settings-install-claude-desktop`,className:`uppercase font-mono`,children:`Install`})]})}),e[2]=a):a=e[2];let o;return e[3]===t?o=e[4]:(o=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-integrations-title`,className:`space-y-3`,children:[r,a,(0,$.jsx)(Ce,{open:t,onOpenChange:n})]}),e[3]=t,e[4]=o),o}export{Pr as SettingsDialog};
@@ -1,2 +1,2 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{Nr as i,nn as a}from"./doc-hash-BRguOnak.js";import{C as o,Ct as s,Dt as c,Et as l,Ot as u,St as d,Tt as f,V as p,_ as m,_t as h,bt as g,g as _,h as ee,it as v,kt as y,ot as te,wt as b,xt as x,yt as S}from"./DocumentContext-BXt0WTWI.js";import{At as C,Dt as w,Et as ne,N as T,Pt as E,Q as D,Tt as O,Y as k,Z as A,bt as j,ft as M,lt as re,q as N,wt as P}from"./dist-B-xmnigy.js";import{a as ie,i as ae,o as oe,r as se,t as F}from"./OutlinePanel-BxucJpZs.js";var I=e(t(),1),ce=r(),L=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:b(this.yanchor),yhead:b(this.yhead)}}static fromJSON(t){return new e(d(t.yanchor),d(t.yhead))}},le=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new S(e)}toYPos(e,t=0){return s(this.ytext,e,t)}fromYPos(e){let t=x(d(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new L(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?O.cursor(n.pos,n.assoc):O.range(t.pos,n.pos)}},R=w.define({combine(e){return e[e.length-1]}}),z=j.define(),B=class{constructor(e){this.view=e,this.conf=e.state.facet(R),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[z.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(z)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
- `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},V=A.fromClass(B),H=k.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),U=j.define(),W=class extends D{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return f(`span`,[c(`class`,`cm-ySelectionCaret`),c(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[l(`⁠`),f(`div`,[c(`class`,`cm-ySelectionCaretDot`)]),l(`⁠`),f(`div`,[c(`class`,`cm-ySelectionInfo`)],[l(this.name)]),l(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},ue=class{constructor(e){this.conf=e.state.facet(R),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[U.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=C.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,r=this.conf.awareness,i=[],a=this.conf.awareness.getLocalState();if(a!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=n?e.state.selection.main:null,o=a.cursor==null?null:d(a.cursor.anchor),c=a.cursor==null?null:d(a.cursor.head);if(i!=null){let e=s(t,i.anchor),n=s(t,i.head);(a.cursor==null||!g(o,e)||!g(c,n))&&r.setLocalStateField(`cursor`,{anchor:e,head:n})}else a.cursor!=null&&n&&r.setLocalStateField(`cursor`,null)}r.getStates().forEach((a,o)=>{if(o===r.doc.clientID)return;let s=a.cursor;if(s==null||s.anchor==null||s.head==null)return;let c=x(s.anchor,n),l=x(s.head,n);if(c==null||l==null||c.type!==t||l.type!==t)return;let{color:d=`#30bced`,name:f=`Anonymous`}=a.user||{},p=a.user&&a.user.colorLight||d+`33`,m=y(c.index,l.index),h=u(c.index,l.index),g=e.view.state.doc.lineAt(m),_=e.view.state.doc.lineAt(h);if(g.number===_.number)i.push({from:m,to:h,value:N.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});else{i.push({from:m,to:g.from+g.length,value:N.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})}),i.push({from:_.from,to:h,value:N.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});for(let t=g.number+1;t<_.number;t++){let n=e.view.state.doc.line(t).from;i.push({from:n,to:n,value:N.line({attributes:{style:`background-color: ${p}`,class:`cm-yLineSelection`}})})}}i.push({from:l.index,to:l.index,value:N.widget({side:l.index-c.index>0?-1:1,block:!1,widget:new W(d,f)})})}),this.decorations=N.set(i,!0)}},de=A.fromClass(ue,{decorations:e=>e.decorations}),fe=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},G=w.define({combine(e){return e[e.length-1]}});j.define();var pe=class{constructor(e){this.view=e,this.conf=e.state.facet(G),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(R),this._beforeChangeSelection=null,this._mux=h(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[k.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(z)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},me=A.fromClass(pe),he=({state:e,dispatch:t})=>e.facet(G).undo()||!0,ge=({state:e,dispatch:t})=>e.facet(G).redo()||!0,_e=(e,t,{undoManager:n=new S(e)}={})=>{let r=new le(e,t),i=[R.of(r),V];return t&&i.push(H,de),n!==!1&&i.push(G.of(new fe(n)),me,k.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?he(t):e.inputType===`historyRedo`?ge(t):!1}})),i},ve=N.mark({class:`cm-link-ref-broken`}),K=/^\s{0,3}\[([^\]]+)\]:\s/,q=/\[([^\]]*)\]\[([^\]]*)\]/g,ye=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function J(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function be(e){let t=[];return T(e).iterate({enter(e){if(ye.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function Y(e){let t=new Set,n=[],r=e.doc,i=be(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(J(n.from,i))continue;let a=K.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!J(t.from,i)&&!K.test(t.text))for(q.lastIndex=0;;){let e=q.exec(t.text);if(!e)break;let r=t.from+e.index;if(J(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ve.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),N.set(a)}var xe=E.define({create(e){return Y(e)},update(e,t){return t.docChanged?Y(t.state):e},provide:e=>k.decorations.from(e)}),Se=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,Ce=N.mark({class:`cm-del`}),we=N.line({class:`cm-table-header`}),X=N.line({class:`cm-table-row`});function Te(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function Z(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(t.text!==`---`)return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(r.text===`---`)return{from:t.from,to:r.to}}return null}function Q(e,t){let n=[],r=T(e),i=Z(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(Ce.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=Se.exec(r.text),a=i?i[1].length:2,o=N.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=Te(r.text),a=N.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(we.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(X.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(X.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),N.set(n)}var Ee=class{decorations;constructor(e){this.decorations=Q(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||T(e.startState)!==T(e.state))&&(this.decorations=Q(e.view.state,e.view.visibleRanges))}},De=A.fromClass(Ee,{decorations:e=>e.decorations});function Oe(){return[De,xe]}var ke=n();function $(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&n.line(1).text===`---`){for(let e=2;e<=n.lines;e++)if(n.line(e).text===`---`){r=e+1;break}}let i=a(),o=0;for(let a=r;a<=n.lines;a++){let r=n.line(a);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(o===t.index){e.dispatch({selection:O.cursor(r.from),effects:k.scrollIntoView(r.from,{y:`start`})}),e.focus();return}o++}}}function Ae(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:O.cursor(r),effects:k.scrollIntoView(r,{y:`center`})}),e.focus()})}function je(e){let t=(0,ce.c)(25),{docName:n,ytext:r,provider:a,placeholder:o,isSourceModeActive:s}=e,c=(0,I.useRef)(null),l=(0,I.useRef)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=new P,t[0]=u):u=t[0];let d=(0,I.useRef)(u),f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=new P,t[1]=f):f=t[1];let h=(0,I.useRef)(f),[g,y]=(0,I.useState)(null);if(g)throw g;let{resolvedTheme:b}=i(),x=(0,I.useRef)(null),S;t[2]!==o||t[3]!==a||t[4]!==b||t[5]!==r?(S=()=>{let e=c.current;if(!e)return;let t=a.configuration.name??``,n,i=Me;try{n=v({docName:t,container:e,sizeStats:{viewCount:0,bytes:r.length},factory:e=>{let t=p({ydoc:a.document,ytext:r}),n=new k({state:ne.create({doc:r.toString(),extensions:[se,re.of([ae]),_e(r,a.awareness),...ee({themeCompartment:d.current,resolvedTheme:b,ydoc:a.document}),Oe(),t,h.current.of(M(o??``)),k.theme({"&":{height:`100%`}})]}),parent:e}),s=n.contentDOM;return s.addEventListener(`keydown`,i),s.addEventListener(`paste`,i),s.addEventListener(`drop`,i),s.addEventListener(`cut`,i),{view:n,ydoc:a.document,ytext:r,provider:a}}}),x.current=n,l.current=n.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),x.current=null,l.current=null,y(t instanceof Error?t:Error(String(t)))}return()=>{let e=x.current;e&&te(e),x.current=null,l.current=null}},t[2]=o,t[3]=a,t[4]=b,t[5]=r,t[6]=S):S=t[6];let C;t[7]!==a||t[8]!==r?(C=[r,a],t[7]=a,t[8]=r,t[9]=C):C=t[9],(0,I.useEffect)(S,C);let w,T;t[10]===b?(w=t[11],T=t[12]):(w=()=>{l.current&&l.current.dispatch({effects:d.current.reconfigure(b===`dark`?_:m)})},T=[b],t[10]=b,t[11]=w,t[12]=T),(0,I.useEffect)(w,T);let E,D;t[13]===o?(E=t[14],D=t[15]):(E=()=>{l.current&&l.current.dispatch({effects:h.current.reconfigure(M(o??``))})},D=[o],t[13]=o,t[14]=E,t[15]=D),(0,I.useEffect)(E,D);let O,A;t[16]!==n||t[17]!==s?(A=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!s)return;let r=l.current;r&&($(r,t),ie(n))};return window.addEventListener(F,e),()=>window.removeEventListener(F,e)},O=[n,s],t[16]=n,t[17]=s,t[18]=O,t[19]=A):(O=t[18],A=t[19]),(0,I.useEffect)(A,O);let j,N;t[20]!==n||t[21]!==s?(j=()=>{if(!s)return;let e=l.current;if(!e)return;let t=oe(n);if(t){if(t.kind===`outline`){$(e,t.detail);return}Ae(e,t.detail)}},N=[n,s],t[20]=n,t[21]=s,t[22]=j,t[23]=N):(j=t[22],N=t[23]),(0,I.useEffect)(j,N);let L;return t[24]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,ke.jsx)(`div`,{ref:c,className:`source-editor h-full py-3`}),t[24]=L):L=t[24],L}function Me(){return o()}export{je as SourceEditor};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{At as i,Dt as a,Et as o,Ft as s,H as c,It as l,Mt as u,Nt as d,Ot as f,Pt as p,_ as m,g as h,jt as g,kt as _,ot as v,st as y,v as ee,w as b,wt as x}from"./DocumentContext-BWaxMbNn.js";import{Ir as te,rn as S}from"./doc-hash-DAxgYkBj.js";import{At as C,Dt as w,Et as ne,N as T,Pt as E,Q as D,Tt as O,Y as k,Z as A,bt as j,ft as M,lt as re,q as N,wt as P}from"./dist-B-xmnigy.js";import{a as ie,i as ae,o as oe,r as se,t as F}from"./OutlinePanel-B5lJ2ZKC.js";var I=e(t(),1),ce=r(),L=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:g(this.yanchor),yhead:g(this.yhead)}}static fromJSON(t){return new e(_(t.yanchor),_(t.yhead))}},le=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new o(e)}toYPos(e,t=0){return i(this.ytext,e,t)}fromYPos(e){let t=f(_(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new L(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?O.cursor(n.pos,n.assoc):O.range(t.pos,n.pos)}},R=w.define({combine(e){return e[e.length-1]}}),z=j.define(),B=class{constructor(e){this.view=e,this.conf=e.state.facet(R),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[z.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(z)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
+ `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},V=A.fromClass(B),H=k.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),U=j.define(),W=class extends D{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return u(`span`,[p(`class`,`cm-ySelectionCaret`),p(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[d(`⁠`),u(`div`,[p(`class`,`cm-ySelectionCaretDot`)]),d(`⁠`),u(`div`,[p(`class`,`cm-ySelectionInfo`)],[d(this.name)]),d(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},ue=class{constructor(e){this.conf=e.state.facet(R),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[U.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=C.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,r=this.conf.awareness,o=[],c=this.conf.awareness.getLocalState();if(c!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),o=n?e.state.selection.main:null,s=c.cursor==null?null:_(c.cursor.anchor),l=c.cursor==null?null:_(c.cursor.head);if(o!=null){let e=i(t,o.anchor),n=i(t,o.head);(c.cursor==null||!a(s,e)||!a(l,n))&&r.setLocalStateField(`cursor`,{anchor:e,head:n})}else c.cursor!=null&&n&&r.setLocalStateField(`cursor`,null)}r.getStates().forEach((i,a)=>{if(a===r.doc.clientID)return;let c=i.cursor;if(c==null||c.anchor==null||c.head==null)return;let u=f(c.anchor,n),d=f(c.head,n);if(u==null||d==null||u.type!==t||d.type!==t)return;let{color:p=`#30bced`,name:m=`Anonymous`}=i.user||{},h=i.user&&i.user.colorLight||p+`33`,g=l(u.index,d.index),_=s(u.index,d.index),v=e.view.state.doc.lineAt(g),y=e.view.state.doc.lineAt(_);if(v.number===y.number)o.push({from:g,to:_,value:N.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});else{o.push({from:g,to:v.from+v.length,value:N.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})}),o.push({from:y.from,to:_,value:N.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});for(let t=v.number+1;t<y.number;t++){let n=e.view.state.doc.line(t).from;o.push({from:n,to:n,value:N.line({attributes:{style:`background-color: ${h}`,class:`cm-yLineSelection`}})})}}o.push({from:d.index,to:d.index,value:N.widget({side:d.index-u.index>0?-1:1,block:!1,widget:new W(p,m)})})}),this.decorations=N.set(o,!0)}},de=A.fromClass(ue,{decorations:e=>e.decorations}),fe=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},G=w.define({combine(e){return e[e.length-1]}});j.define();var pe=class{constructor(e){this.view=e,this.conf=e.state.facet(G),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(R),this._beforeChangeSelection=null,this._mux=x(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[k.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(z)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},me=A.fromClass(pe),he=({state:e,dispatch:t})=>e.facet(G).undo()||!0,ge=({state:e,dispatch:t})=>e.facet(G).redo()||!0,_e=(e,t,{undoManager:n=new o(e)}={})=>{let r=new le(e,t),i=[R.of(r),V];return t&&i.push(H,de),n!==!1&&i.push(G.of(new fe(n)),me,k.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?he(t):e.inputType===`historyRedo`?ge(t):!1}})),i},ve=N.mark({class:`cm-link-ref-broken`}),K=/^\s{0,3}\[([^\]]+)\]:\s/,q=/\[([^\]]*)\]\[([^\]]*)\]/g,ye=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function J(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function be(e){let t=[];return T(e).iterate({enter(e){if(ye.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function Y(e){let t=new Set,n=[],r=e.doc,i=be(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(J(n.from,i))continue;let a=K.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!J(t.from,i)&&!K.test(t.text))for(q.lastIndex=0;;){let e=q.exec(t.text);if(!e)break;let r=t.from+e.index;if(J(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ve.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),N.set(a)}var xe=E.define({create(e){return Y(e)},update(e,t){return t.docChanged?Y(t.state):e},provide:e=>k.decorations.from(e)}),Se=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,Ce=N.mark({class:`cm-del`}),we=N.line({class:`cm-table-header`}),X=N.line({class:`cm-table-row`});function Te(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function Z(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(t.text!==`---`)return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(r.text===`---`)return{from:t.from,to:r.to}}return null}function Q(e,t){let n=[],r=T(e),i=Z(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(Ce.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=Se.exec(r.text),a=i?i[1].length:2,o=N.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=Te(r.text),a=N.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(we.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(X.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(X.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),N.set(n)}var Ee=class{decorations;constructor(e){this.decorations=Q(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||T(e.startState)!==T(e.state))&&(this.decorations=Q(e.view.state,e.view.visibleRanges))}},De=A.fromClass(Ee,{decorations:e=>e.decorations});function Oe(){return[De,xe]}var ke=n();function $(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&n.line(1).text===`---`){for(let e=2;e<=n.lines;e++)if(n.line(e).text===`---`){r=e+1;break}}let i=S(),a=0;for(let o=r;o<=n.lines;o++){let r=n.line(o);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(a===t.index){e.dispatch({selection:O.cursor(r.from),effects:k.scrollIntoView(r.from,{y:`start`})}),e.focus();return}a++}}}function Ae(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:O.cursor(r),effects:k.scrollIntoView(r,{y:`center`})}),e.focus()})}function je(e){let t=(0,ce.c)(25),{docName:n,ytext:r,provider:i,placeholder:a,isSourceModeActive:o}=e,s=(0,I.useRef)(null),l=(0,I.useRef)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=new P,t[0]=u):u=t[0];let d=(0,I.useRef)(u),f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=new P,t[1]=f):f=t[1];let p=(0,I.useRef)(f),[g,_]=(0,I.useState)(null);if(g)throw g;let{resolvedTheme:b}=te(),x=(0,I.useRef)(null),S;t[2]!==a||t[3]!==i||t[4]!==b||t[5]!==r?(S=()=>{let e=s.current;if(!e)return;let t=i.configuration.name??``,n,o=Me;try{n=v({docName:t,container:e,sizeStats:{viewCount:0,bytes:r.length},factory:e=>{let t=c({ydoc:i.document,ytext:r}),n=new k({state:ne.create({doc:r.toString(),extensions:[se,re.of([ae]),_e(r,i.awareness),...h({themeCompartment:d.current,resolvedTheme:b,ydoc:i.document}),Oe(),t,p.current.of(M(a??``)),k.theme({"&":{height:`100%`}})]}),parent:e}),s=n.contentDOM;return s.addEventListener(`keydown`,o),s.addEventListener(`paste`,o),s.addEventListener(`drop`,o),s.addEventListener(`cut`,o),{view:n,ydoc:i.document,ytext:r,provider:i}}}),x.current=n,l.current=n.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),x.current=null,l.current=null,_(t instanceof Error?t:Error(String(t)))}return()=>{let e=x.current;e&&y(e),x.current=null,l.current=null}},t[2]=a,t[3]=i,t[4]=b,t[5]=r,t[6]=S):S=t[6];let C;t[7]!==i||t[8]!==r?(C=[r,i],t[7]=i,t[8]=r,t[9]=C):C=t[9],(0,I.useEffect)(S,C);let w,T;t[10]===b?(w=t[11],T=t[12]):(w=()=>{l.current&&l.current.dispatch({effects:d.current.reconfigure(b===`dark`?m:ee)})},T=[b],t[10]=b,t[11]=w,t[12]=T),(0,I.useEffect)(w,T);let E,D;t[13]===a?(E=t[14],D=t[15]):(E=()=>{l.current&&l.current.dispatch({effects:p.current.reconfigure(M(a??``))})},D=[a],t[13]=a,t[14]=E,t[15]=D),(0,I.useEffect)(E,D);let O,A;t[16]!==n||t[17]!==o?(A=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!o)return;let r=l.current;r&&($(r,t),ie(n))};return window.addEventListener(F,e),()=>window.removeEventListener(F,e)},O=[n,o],t[16]=n,t[17]=o,t[18]=O,t[19]=A):(O=t[18],A=t[19]),(0,I.useEffect)(A,O);let j,N;t[20]!==n||t[21]!==o?(j=()=>{if(!o)return;let e=l.current;if(!e)return;let t=oe(n);if(t){if(t.kind===`outline`){$(e,t.detail);return}Ae(e,t.detail)}},N=[n,o],t[20]=n,t[21]=o,t[22]=j,t[23]=N):(j=t[22],N=t[23]),(0,I.useEffect)(j,N);let L;return t[24]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,ke.jsx)(`div`,{ref:s,className:`source-editor h-full py-3`}),t[24]=L):L=t[24],L}function Me(){return b()}export{je as SourceEditor};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{C as i}from"./button-BsFpqlpT.js";var a=i(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),o=i(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),s=i(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),c=r(),l=n();function u(e){let t=(0,c.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Claude icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,l.jsx)(`g`,{clipPath:`url(#clip0_claude)`,children:(0,l.jsx)(`path`,{d:`M4.704 15.96L9.432 13.32L9.504 13.08L9.432 12.96H9.192L8.4 12.912L5.712 12.84L3.36 12.72L1.08 12.6L0.504 12.48L0 11.76L0.048 11.4L0.528 11.088L1.224 11.136L2.736 11.256L5.016 11.4L6.672 11.496L9.12 11.784H9.504L9.552 11.616L9.432 11.52L9.336 11.424L6.96 9.84L4.416 8.16L3.072 7.176L2.352 6.696L1.992 6.216L1.848 5.208L2.496 4.488L3.384 4.56L3.6 4.608L4.488 5.304L6.408 6.768L8.88 8.64L9.24 8.928L9.384 8.832L9.408 8.76L9.24 8.496L7.92 6L6.48 3.504L5.832 2.472L5.664 1.848C5.592 1.608 5.568 1.368 5.568 1.128L6.288 0.12L6.72 0L7.728 0.144L8.112 0.48L8.736 1.92L9.72 4.152L11.28 7.176L11.76 8.088L12 8.904L12.072 9.144H12.24V9.024L12.36 7.296L12.6 5.208L12.84 2.52L12.912 1.752L13.296 0.84L14.016 0.36L14.64 0.624L15.12 1.32L15.048 1.752L14.784 3.6L14.16 6.504L13.8 8.472H14.016L14.256 8.208L15.24 6.912L16.896 4.848L17.616 4.008L18.48 3.12L19.032 2.688H20.064L20.808 3.816L20.472 4.992L19.416 6.336L18.528 7.464L17.256 9.168L16.488 10.536L16.56 10.632H16.728L19.608 10.008L21.144 9.744L22.968 9.432L23.808 9.816L23.904 10.2L23.568 11.016L21.6 11.496L19.296 11.976L15.864 12.768L15.816 12.792L15.864 12.864L17.4 13.008L18.072 13.056H19.704L22.728 13.296L23.52 13.776L23.976 14.424L23.904 14.904L22.68 15.528L21.048 15.144L17.208 14.232L15.912 13.92H15.72V14.016L16.824 15.096L18.816 16.896L21.36 19.224L21.48 19.8L21.168 20.28L20.832 20.232L18.624 18.552L17.76 17.832L15.84 16.2H15.72V16.368L16.152 17.016L18.504 20.544L18.624 21.624L18.456 21.96L17.832 22.2L17.184 22.056L15.792 20.136L14.352 17.976L13.224 16.008L13.104 16.104L12.408 23.352L12.096 23.712L11.376 24L10.776 23.52L10.44 22.8L10.776 21.312L11.16 19.392L11.472 17.856L11.76 15.96L11.928 15.336V15.288H11.76L10.32 17.28L8.16 20.232L6.432 22.056L6.024 22.224L5.304 21.864L5.376 21.192L5.76 20.64L8.16 17.568L9.6 15.672L10.56 14.568L10.536 14.448H10.464L4.128 18.576L3 18.72L2.52 18.24L2.568 17.52L2.808 17.28L4.728 15.96H4.704Z`,fill:`currentColor`})}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,l.jsx)(`defs`,{children:(0,l.jsx)(`clipPath`,{id:`clip0_claude`,children:(0,l.jsx)(`rect`,{width:`24`,height:`24`,fill:`white`})})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Claude icon`,fill:`none`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function d(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Cline icon`}),r=(0,l.jsx)(`path`,{fill:`currentColor`,d:`M463.6,275.08l-29.26-58.75v-33.83c0-56.08-45.01-101.5-100.53-101.5h-50.01c3.62-7.43,5.61-15.79,5.61-24.61,0-31.17-25.08-56.39-56.07-56.39s-56.07,25.22-56.07,56.39c0,8.82,1.99,17.17,5.61,24.61h-50.01c-55.51,0-100.52,45.42-100.52,101.5v33.83l-29.87,58.59c-3.01,5.9-3.01,12.92,0,18.81l29.87,57.93v33.83c0,56.08,45.01,101.5,100.52,101.5h200.95c55.51,0,100.53-45.42,100.53-101.5v-33.83l29.21-58.13c2.9-5.79,2.9-12.61.05-18.46ZM202.75,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02ZM350.58,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Cline icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 466.73 487.04`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var f=e(t(),1);function p(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Codex icon`}),r=(0,l.jsx)(`path`,{stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`2.484`,d:`M22.356 19.797H17.17M9.662 12.29l1.979 3.576a.511.511 0 0 1-.005.504l-1.974 3.409M30.758 16c0 8.15-6.607 14.758-14.758 14.758-8.15 0-14.758-6.607-14.758-14.758C1.242 7.85 7.85 1.242 16 1.242c8.15 0 14.758 6.608 14.758 14.758Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Codex icon`,xmlns:`http://www.w3.org/2000/svg`,width:32,height:32,fill:`none`,viewBox:`0 0 32 32`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function m(e){let t=(0,c.c)(15),n=(0,f.useId)(),r;if(t[0]!==n){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],r=n.replace(e,``),t[0]=n,t[1]=r}else r=t[1];let i=`codex-brand-gradient-${r}`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(`title`,{children:`Codex icon`}),t[3]=a):a=t[3];let o=`url(#${i})`,s;t[4]===o?s=t[5]:(s=(0,l.jsx)(`path`,{d:`M3.03191 0.172167C3.39319 0.023523 3.7865 -0.030181 4.17441 0.0161665C4.67441 0.0736665 5.11991 0.286167 5.51091 0.653667C5.51591 0.658667 5.52291 0.662167 5.52941 0.664167C5.53647 0.665904 5.54385 0.665904 5.55091 0.664167C6.05923 0.532896 6.59731 0.581475 7.07391 0.801667L7.09741 0.812666L7.15541 0.841167C7.65429 1.09402 8.04342 1.52067 8.24941 2.04067C8.35391 2.29567 8.40591 2.56117 8.40691 2.83817C8.41442 3.04417 8.39185 3.25017 8.33991 3.44967C8.33735 3.45974 8.33738 3.47029 8.34 3.48035C8.34263 3.4904 8.34775 3.49963 8.35491 3.50717C8.65191 3.81067 8.84891 4.17217 8.94641 4.59217C9.09091 5.30467 8.94291 5.94717 8.50291 6.51917L8.43491 6.60217C8.14349 6.93574 7.761 7.17695 7.33441 7.29617C7.32515 7.29888 7.31666 7.30373 7.30962 7.31033C7.30259 7.31694 7.2972 7.3251 7.29391 7.33417C7.19841 7.60967 7.10241 7.84567 6.92391 8.08117C6.47391 8.67467 5.81291 9.00417 5.06841 9.00017C4.47491 8.99717 3.94891 8.78017 3.48991 8.34917C3.483 8.3427 3.4745 8.33819 3.46528 8.33608C3.45606 8.33397 3.44644 8.33435 3.43741 8.33717C3.24341 8.39967 3.04741 8.40867 2.83541 8.40617C2.49774 8.40346 2.16514 8.32377 1.86291 8.17317C1.54632 8.01629 1.27069 7.78773 1.05791 7.50567C0.981908 7.40467 0.906408 7.30967 0.850908 7.19717C0.775141 7.04279 0.713231 6.88199 0.665908 6.71667C0.566008 6.34048 0.563599 5.94504 0.658908 5.56767C0.662042 5.55869 0.663069 5.54911 0.661908 5.53967C0.660196 5.53039 0.655446 5.52195 0.648408 5.51567C0.417442 5.28189 0.240911 5.00002 0.131408 4.69017C0.0585831 4.49931 0.0162322 4.29818 0.00590778 4.09417C-0.0122568 3.82546 0.0115281 3.55556 0.0764078 3.29417C0.244908 2.73817 0.567408 2.30167 1.04291 1.98517C1.14891 1.91467 1.24941 1.85967 1.34341 1.82017C1.45091 1.77567 1.55841 1.73817 1.66641 1.70667C1.67413 1.70427 1.68113 1.70001 1.6868 1.69425C1.69247 1.68849 1.69663 1.68142 1.69891 1.67367C1.78091 1.37919 1.92194 1.10446 2.11341 0.866166C2.35477 0.559671 2.67114 0.320634 3.03191 0.172167ZM4.77291 5.45467C4.69165 5.45922 4.61522 5.49471 4.55931 5.55385C4.5034 5.61299 4.47225 5.69128 4.47225 5.77267C4.47225 5.85405 4.5034 5.93235 4.55931 5.99148C4.61522 6.05062 4.69165 6.08611 4.77291 6.09067H6.59091C6.63417 6.09309 6.67747 6.08667 6.71816 6.07178C6.75885 6.0569 6.79608 6.03387 6.82756 6.0041C6.85905 5.97433 6.88413 5.93846 6.90127 5.89866C6.91841 5.85887 6.92725 5.81599 6.92725 5.77267C6.92725 5.72934 6.91841 5.68647 6.90127 5.64667C6.88413 5.60688 6.85905 5.571 6.82756 5.54123C6.79608 5.51146 6.75885 5.48843 6.71816 5.47355C6.67747 5.45866 6.63417 5.45224 6.59091 5.45467H4.77291ZM2.73091 3.11517C2.68764 3.04469 2.61865 2.99381 2.53854 2.97328C2.45844 2.95275 2.37348 2.96419 2.30165 3.00517C2.22982 3.04615 2.17675 3.11346 2.15366 3.19287C2.13056 3.27228 2.13926 3.35756 2.17791 3.43067L2.81391 4.54267L2.18091 5.61067C2.1596 5.64662 2.14558 5.68641 2.13966 5.72778C2.13373 5.76914 2.13601 5.81127 2.14636 5.85176C2.15671 5.89225 2.17494 5.9303 2.2 5.96374C2.22506 5.99718 2.25646 6.02536 2.29241 6.04667C2.32836 6.06797 2.36815 6.08199 2.40952 6.08792C2.45088 6.09385 2.49301 6.09157 2.5335 6.08121C2.57399 6.07086 2.61204 6.05263 2.64548 6.02758C2.67892 6.00252 2.7071 5.97112 2.72841 5.93517L3.45541 4.70767C3.48407 4.65931 3.4994 4.60422 3.49984 4.548C3.50028 4.49179 3.48581 4.43647 3.45791 4.38767L2.73091 3.11517Z`,fill:o}),t[4]=o,t[5]=s);let u,d,p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,l.jsx)(`stop`,{stopColor:`#B1A7FF`}),d=(0,l.jsx)(`stop`,{offset:`0.5`,stopColor:`#7A9DFF`}),p=(0,l.jsx)(`stop`,{offset:`1`,stopColor:`#3941FF`}),t[6]=u,t[7]=d,t[8]=p):(u=t[6],d=t[7],p=t[8]);let m;t[9]===i?m=t[10]:(m=(0,l.jsx)(`defs`,{children:(0,l.jsxs)(`linearGradient`,{id:i,x1:`4.49991`,y1:`0.000166496`,x2:`4.49991`,y2:`9.00017`,gradientUnits:`userSpaceOnUse`,children:[u,d,p]})}),t[9]=i,t[10]=m);let h;return t[11]!==e||t[12]!==s||t[13]!==m?(h=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Codex icon`,xmlns:`http://www.w3.org/2000/svg`,width:9,height:9,fill:`none`,viewBox:`0 0 9 9`,...e,children:[a,s,m]}),t[11]=e,t[12]=s,t[13]=m,t[14]=h):h=t[14],h}function h(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`GitHub Copilot icon`}),r=(0,l.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,fill:`currentColor`,d:`M9.6225 2.682C10.2835 3.362 10.561 4.29 10.6775 5.5905C10.9885 5.5905 11.2775 5.658 11.4735 5.9175L11.8385 6.3995C11.9435 6.5385 12 6.7045 12 6.877V8.187C12 8.3565 11.9135 8.5215 11.7735 8.621C10.1195 9.801 8.0785 10.75 6 10.75C3.7 10.75 1.3975 9.4585 0.2265 8.621C0.0865 8.521 0.0005 8.356 0 8.187V6.877C0 6.7045 0.0565 6.5375 0.1605 6.399L0.5255 5.9175C0.7215 5.659 1.0125 5.5905 1.322 5.5905L1.3365 5.442C1.4615 4.219 1.7415 3.3355 2.3775 2.682C3.608 1.412 5.2325 1.2565 5.9505 1.25H6.0495C6.7675 1.2565 8.392 1.4115 9.6225 2.682ZM6.0005 4.846C5.8585 4.846 5.694 4.854 5.5195 4.871C5.458 5.0945 5.367 5.296 5.2345 5.425C4.7095 5.9365 4.0765 6.015 3.7375 6.015C3.4185 6.015 3.0845 5.95 2.812 5.783C2.554 5.8655 2.306 5.9845 2.29 6.281C2.26898 6.76138 2.25847 7.24216 2.2585 7.723L2.2575 7.963C2.2565 8.2445 2.255 8.526 2.251 8.808C2.252 8.971 2.353 9.123 2.506 9.1905C3.747 9.7415 4.921 10.019 6.001 10.019C7.079 10.019 8.253 9.7415 9.4935 9.1905C9.56814 9.15767 9.63181 9.10416 9.677 9.03628C9.72219 8.96841 9.747 8.88902 9.7485 8.8075C9.7635 7.9665 9.7515 7.1215 9.7105 6.281C9.695 5.983 9.4465 5.866 9.1875 5.783C8.9145 5.9495 8.5815 6.015 8.2625 6.015C7.924 6.015 7.2915 5.9365 6.766 5.425C6.633 5.296 6.5425 5.0945 6.481 4.871C6.321 4.855 6.1605 4.8465 6.0005 4.846ZM4.738 6.8525C5.0075 6.8525 5.226 7.0655 5.226 7.3275V8.204C5.226 8.4665 5.0075 8.679 4.738 8.679C4.61033 8.6806 4.48725 8.63149 4.39576 8.54243C4.30426 8.45338 4.25184 8.33166 4.25 8.204V7.328C4.25 7.0655 4.4685 6.8525 4.738 6.8525ZM7.238 6.8525C7.5075 6.8525 7.726 7.0655 7.726 7.3275V8.204C7.726 8.4665 7.5075 8.679 7.238 8.679C7.11033 8.6806 6.98725 8.63149 6.89576 8.54243C6.80426 8.45338 6.75184 8.33166 6.75 8.204V7.328C6.75 7.0655 6.9685 6.8525 7.238 6.8525ZM3.8175 2.5435C3.2925 2.5945 2.85 2.7625 2.625 2.9965C2.1375 3.515 2.2425 4.8305 2.52 5.1085C2.7225 5.3055 3.105 5.437 3.5175 5.437H3.5625C3.887 5.4305 4.455 5.349 4.9275 4.882C5.145 4.677 5.28 4.1655 5.265 3.647C5.25 3.23 5.13 2.887 4.95 2.7405C4.755 2.5725 4.3125 2.4995 3.8175 2.5435ZM7.05 2.7405C6.87 2.8865 6.75 3.2305 6.735 3.647C6.72 4.1655 6.855 4.677 7.0725 4.882C7.5565 5.3605 8.1405 5.434 8.4605 5.437H8.4825C8.895 5.437 9.2775 5.3055 9.48 5.1085C9.7575 4.8305 9.8625 3.515 9.375 2.9965C9.15 2.7625 8.7075 2.5945 8.1825 2.5435C7.6875 2.4995 7.245 2.5725 7.05 2.7405ZM6 3.8075C5.88 3.8075 5.7375 3.815 5.58 3.8295C5.595 3.9095 5.6025 3.9975 5.61 4.0925L5.6095 4.172C5.60894 4.21375 5.60661 4.25545 5.6025 4.297C5.715 4.286 5.815 4.2835 5.9085 4.283H6.0915C6.185 4.283 6.285 4.286 6.3975 4.297C6.39 4.224 6.39 4.1585 6.39 4.0925C6.3975 3.9975 6.405 3.91 6.42 3.8295C6.2804 3.81583 6.14026 3.80849 6 3.8075Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`GitHub Copilot icon`,xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function g(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Cursor icon`}),r=(0,l.jsx)(`path`,{fill:`currentColor`,d:`M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Cursor icon`,fill:`none`,height:24,width:24,viewBox:`0 0 466.73 532.09`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function _(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Windsurf icon`}),r=(0,l.jsx)(`path`,{fill:`currentColor`,d:`M21.3192 4.9697H21.1203C20.0734 4.96806 19.2238 5.81589 19.2238 6.86264V11.0961C19.2238 11.9415 18.525 12.6263 17.6934 12.6263C17.1993 12.6263 16.706 12.3777 16.4133 11.9603L12.0896 5.78492C11.7308 5.27214 11.1471 4.96643 10.5152 4.96643C9.52943 4.96643 8.64234 5.80448 8.64234 6.83902V11.0969C8.64234 11.9423 7.94932 12.6271 7.11197 12.6271C6.61625 12.6271 6.12376 12.3785 5.83105 11.9611L0.992853 5.0504C0.883594 4.89387 0.638184 4.97133 0.638184 5.1621V8.85424C0.638184 9.04094 0.695264 9.22193 0.802059 9.37517L5.56362 16.175C5.84492 16.5769 6.25994 16.8753 6.73852 16.9837C7.93627 17.256 9.03861 16.334 9.03861 15.1592V10.9037C9.03861 10.0583 9.7235 9.37354 10.569 9.37354H10.5714C11.081 9.37354 11.5588 9.62219 11.8515 10.0396L16.1761 16.2141C16.5356 16.7277 17.0892 17.0326 17.7497 17.0326C18.7574 17.0326 19.6209 16.1937 19.6209 15.16V10.9029C19.6209 10.0575 20.3058 9.37273 21.1512 9.37273H21.32C21.426 9.37273 21.5116 9.28713 21.5116 9.18116V5.16127C21.5116 5.05531 21.426 4.9697 21.32 4.9697H21.3192Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Windsurf icon`,xmlns:`http://www.w3.org/2000/svg`,width:22,height:22,viewBox:`0 0 22 22`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var v=class{map=new Map;constructor(e){if(this.limit=e,e<=0)throw Error(`LruStringCache: limit must be > 0 (got ${e})`)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}set(e,t){for(this.map.has(e)&&this.map.delete(e),this.map.set(e,t);this.map.size>this.limit;){let e=this.map.keys().next().value;if(e===void 0)break;this.map.delete(e)}}clear(){this.map.clear()}get size(){return this.map.size}};function y(e){let t=(0,c.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,l.jsx)(u,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,l.jsx)(g,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,l.jsx)(_,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,l.jsx)(p,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,l.jsx)(d,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,l.jsx)(h,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,l.jsx)(o,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function b(e){return typeof e==`object`&&!!e&&typeof e.getStates==`function`}function x(e,t,n){let r=[],i=[];for(let a of e.getStates().values()){let e=a.agentPresence;if(e)for(let[a,o]of Object.entries(e))o.currentDoc&&(n-o.ts>=5e3||(o.currentDoc===t?r.push({agentId:a,entry:o}):i.push({agentId:a,entry:o})))}return{current:r,crossDoc:i}}export{_ as a,m as c,u as d,s as f,v as i,p as l,a as m,x as n,g as o,o as p,y as r,h as s,b as t,d as u};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{C as i}from"./button-C1nwPVFQ.js";var a=i(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),o=i(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),s=i(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),c=r(),l=n();function u(e){let t=(0,c.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Claude icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,l.jsx)(`g`,{clipPath:`url(#clip0_claude)`,children:(0,l.jsx)(`path`,{d:`M4.704 15.96L9.432 13.32L9.504 13.08L9.432 12.96H9.192L8.4 12.912L5.712 12.84L3.36 12.72L1.08 12.6L0.504 12.48L0 11.76L0.048 11.4L0.528 11.088L1.224 11.136L2.736 11.256L5.016 11.4L6.672 11.496L9.12 11.784H9.504L9.552 11.616L9.432 11.52L9.336 11.424L6.96 9.84L4.416 8.16L3.072 7.176L2.352 6.696L1.992 6.216L1.848 5.208L2.496 4.488L3.384 4.56L3.6 4.608L4.488 5.304L6.408 6.768L8.88 8.64L9.24 8.928L9.384 8.832L9.408 8.76L9.24 8.496L7.92 6L6.48 3.504L5.832 2.472L5.664 1.848C5.592 1.608 5.568 1.368 5.568 1.128L6.288 0.12L6.72 0L7.728 0.144L8.112 0.48L8.736 1.92L9.72 4.152L11.28 7.176L11.76 8.088L12 8.904L12.072 9.144H12.24V9.024L12.36 7.296L12.6 5.208L12.84 2.52L12.912 1.752L13.296 0.84L14.016 0.36L14.64 0.624L15.12 1.32L15.048 1.752L14.784 3.6L14.16 6.504L13.8 8.472H14.016L14.256 8.208L15.24 6.912L16.896 4.848L17.616 4.008L18.48 3.12L19.032 2.688H20.064L20.808 3.816L20.472 4.992L19.416 6.336L18.528 7.464L17.256 9.168L16.488 10.536L16.56 10.632H16.728L19.608 10.008L21.144 9.744L22.968 9.432L23.808 9.816L23.904 10.2L23.568 11.016L21.6 11.496L19.296 11.976L15.864 12.768L15.816 12.792L15.864 12.864L17.4 13.008L18.072 13.056H19.704L22.728 13.296L23.52 13.776L23.976 14.424L23.904 14.904L22.68 15.528L21.048 15.144L17.208 14.232L15.912 13.92H15.72V14.016L16.824 15.096L18.816 16.896L21.36 19.224L21.48 19.8L21.168 20.28L20.832 20.232L18.624 18.552L17.76 17.832L15.84 16.2H15.72V16.368L16.152 17.016L18.504 20.544L18.624 21.624L18.456 21.96L17.832 22.2L17.184 22.056L15.792 20.136L14.352 17.976L13.224 16.008L13.104 16.104L12.408 23.352L12.096 23.712L11.376 24L10.776 23.52L10.44 22.8L10.776 21.312L11.16 19.392L11.472 17.856L11.76 15.96L11.928 15.336V15.288H11.76L10.32 17.28L8.16 20.232L6.432 22.056L6.024 22.224L5.304 21.864L5.376 21.192L5.76 20.64L8.16 17.568L9.6 15.672L10.56 14.568L10.536 14.448H10.464L4.128 18.576L3 18.72L2.52 18.24L2.568 17.52L2.808 17.28L4.728 15.96H4.704Z`,fill:`currentColor`})}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,l.jsx)(`defs`,{children:(0,l.jsx)(`clipPath`,{id:`clip0_claude`,children:(0,l.jsx)(`rect`,{width:`24`,height:`24`,fill:`white`})})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Claude icon`,fill:`none`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function d(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Cline icon`}),r=(0,l.jsx)(`path`,{fill:`currentColor`,d:`M463.6,275.08l-29.26-58.75v-33.83c0-56.08-45.01-101.5-100.53-101.5h-50.01c3.62-7.43,5.61-15.79,5.61-24.61,0-31.17-25.08-56.39-56.07-56.39s-56.07,25.22-56.07,56.39c0,8.82,1.99,17.17,5.61,24.61h-50.01c-55.51,0-100.52,45.42-100.52,101.5v33.83l-29.87,58.59c-3.01,5.9-3.01,12.92,0,18.81l29.87,57.93v33.83c0,56.08,45.01,101.5,100.52,101.5h200.95c55.51,0,100.53-45.42,100.53-101.5v-33.83l29.21-58.13c2.9-5.79,2.9-12.61.05-18.46ZM202.75,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02ZM350.58,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Cline icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 466.73 487.04`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var f=e(t(),1);function p(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Codex icon`}),r=(0,l.jsx)(`path`,{stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`2.484`,d:`M22.356 19.797H17.17M9.662 12.29l1.979 3.576a.511.511 0 0 1-.005.504l-1.974 3.409M30.758 16c0 8.15-6.607 14.758-14.758 14.758-8.15 0-14.758-6.607-14.758-14.758C1.242 7.85 7.85 1.242 16 1.242c8.15 0 14.758 6.608 14.758 14.758Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Codex icon`,xmlns:`http://www.w3.org/2000/svg`,width:32,height:32,fill:`none`,viewBox:`0 0 32 32`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function m(e){let t=(0,c.c)(15),n=(0,f.useId)(),r;if(t[0]!==n){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],r=n.replace(e,``),t[0]=n,t[1]=r}else r=t[1];let i=`codex-brand-gradient-${r}`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(`title`,{children:`Codex icon`}),t[3]=a):a=t[3];let o=`url(#${i})`,s;t[4]===o?s=t[5]:(s=(0,l.jsx)(`path`,{d:`M3.03191 0.172167C3.39319 0.023523 3.7865 -0.030181 4.17441 0.0161665C4.67441 0.0736665 5.11991 0.286167 5.51091 0.653667C5.51591 0.658667 5.52291 0.662167 5.52941 0.664167C5.53647 0.665904 5.54385 0.665904 5.55091 0.664167C6.05923 0.532896 6.59731 0.581475 7.07391 0.801667L7.09741 0.812666L7.15541 0.841167C7.65429 1.09402 8.04342 1.52067 8.24941 2.04067C8.35391 2.29567 8.40591 2.56117 8.40691 2.83817C8.41442 3.04417 8.39185 3.25017 8.33991 3.44967C8.33735 3.45974 8.33738 3.47029 8.34 3.48035C8.34263 3.4904 8.34775 3.49963 8.35491 3.50717C8.65191 3.81067 8.84891 4.17217 8.94641 4.59217C9.09091 5.30467 8.94291 5.94717 8.50291 6.51917L8.43491 6.60217C8.14349 6.93574 7.761 7.17695 7.33441 7.29617C7.32515 7.29888 7.31666 7.30373 7.30962 7.31033C7.30259 7.31694 7.2972 7.3251 7.29391 7.33417C7.19841 7.60967 7.10241 7.84567 6.92391 8.08117C6.47391 8.67467 5.81291 9.00417 5.06841 9.00017C4.47491 8.99717 3.94891 8.78017 3.48991 8.34917C3.483 8.3427 3.4745 8.33819 3.46528 8.33608C3.45606 8.33397 3.44644 8.33435 3.43741 8.33717C3.24341 8.39967 3.04741 8.40867 2.83541 8.40617C2.49774 8.40346 2.16514 8.32377 1.86291 8.17317C1.54632 8.01629 1.27069 7.78773 1.05791 7.50567C0.981908 7.40467 0.906408 7.30967 0.850908 7.19717C0.775141 7.04279 0.713231 6.88199 0.665908 6.71667C0.566008 6.34048 0.563599 5.94504 0.658908 5.56767C0.662042 5.55869 0.663069 5.54911 0.661908 5.53967C0.660196 5.53039 0.655446 5.52195 0.648408 5.51567C0.417442 5.28189 0.240911 5.00002 0.131408 4.69017C0.0585831 4.49931 0.0162322 4.29818 0.00590778 4.09417C-0.0122568 3.82546 0.0115281 3.55556 0.0764078 3.29417C0.244908 2.73817 0.567408 2.30167 1.04291 1.98517C1.14891 1.91467 1.24941 1.85967 1.34341 1.82017C1.45091 1.77567 1.55841 1.73817 1.66641 1.70667C1.67413 1.70427 1.68113 1.70001 1.6868 1.69425C1.69247 1.68849 1.69663 1.68142 1.69891 1.67367C1.78091 1.37919 1.92194 1.10446 2.11341 0.866166C2.35477 0.559671 2.67114 0.320634 3.03191 0.172167ZM4.77291 5.45467C4.69165 5.45922 4.61522 5.49471 4.55931 5.55385C4.5034 5.61299 4.47225 5.69128 4.47225 5.77267C4.47225 5.85405 4.5034 5.93235 4.55931 5.99148C4.61522 6.05062 4.69165 6.08611 4.77291 6.09067H6.59091C6.63417 6.09309 6.67747 6.08667 6.71816 6.07178C6.75885 6.0569 6.79608 6.03387 6.82756 6.0041C6.85905 5.97433 6.88413 5.93846 6.90127 5.89866C6.91841 5.85887 6.92725 5.81599 6.92725 5.77267C6.92725 5.72934 6.91841 5.68647 6.90127 5.64667C6.88413 5.60688 6.85905 5.571 6.82756 5.54123C6.79608 5.51146 6.75885 5.48843 6.71816 5.47355C6.67747 5.45866 6.63417 5.45224 6.59091 5.45467H4.77291ZM2.73091 3.11517C2.68764 3.04469 2.61865 2.99381 2.53854 2.97328C2.45844 2.95275 2.37348 2.96419 2.30165 3.00517C2.22982 3.04615 2.17675 3.11346 2.15366 3.19287C2.13056 3.27228 2.13926 3.35756 2.17791 3.43067L2.81391 4.54267L2.18091 5.61067C2.1596 5.64662 2.14558 5.68641 2.13966 5.72778C2.13373 5.76914 2.13601 5.81127 2.14636 5.85176C2.15671 5.89225 2.17494 5.9303 2.2 5.96374C2.22506 5.99718 2.25646 6.02536 2.29241 6.04667C2.32836 6.06797 2.36815 6.08199 2.40952 6.08792C2.45088 6.09385 2.49301 6.09157 2.5335 6.08121C2.57399 6.07086 2.61204 6.05263 2.64548 6.02758C2.67892 6.00252 2.7071 5.97112 2.72841 5.93517L3.45541 4.70767C3.48407 4.65931 3.4994 4.60422 3.49984 4.548C3.50028 4.49179 3.48581 4.43647 3.45791 4.38767L2.73091 3.11517Z`,fill:o}),t[4]=o,t[5]=s);let u,d,p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,l.jsx)(`stop`,{stopColor:`#B1A7FF`}),d=(0,l.jsx)(`stop`,{offset:`0.5`,stopColor:`#7A9DFF`}),p=(0,l.jsx)(`stop`,{offset:`1`,stopColor:`#3941FF`}),t[6]=u,t[7]=d,t[8]=p):(u=t[6],d=t[7],p=t[8]);let m;t[9]===i?m=t[10]:(m=(0,l.jsx)(`defs`,{children:(0,l.jsxs)(`linearGradient`,{id:i,x1:`4.49991`,y1:`0.000166496`,x2:`4.49991`,y2:`9.00017`,gradientUnits:`userSpaceOnUse`,children:[u,d,p]})}),t[9]=i,t[10]=m);let h;return t[11]!==e||t[12]!==s||t[13]!==m?(h=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Codex icon`,xmlns:`http://www.w3.org/2000/svg`,width:9,height:9,fill:`none`,viewBox:`0 0 9 9`,...e,children:[a,s,m]}),t[11]=e,t[12]=s,t[13]=m,t[14]=h):h=t[14],h}function h(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`GitHub Copilot icon`}),r=(0,l.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,fill:`currentColor`,d:`M9.6225 2.682C10.2835 3.362 10.561 4.29 10.6775 5.5905C10.9885 5.5905 11.2775 5.658 11.4735 5.9175L11.8385 6.3995C11.9435 6.5385 12 6.7045 12 6.877V8.187C12 8.3565 11.9135 8.5215 11.7735 8.621C10.1195 9.801 8.0785 10.75 6 10.75C3.7 10.75 1.3975 9.4585 0.2265 8.621C0.0865 8.521 0.0005 8.356 0 8.187V6.877C0 6.7045 0.0565 6.5375 0.1605 6.399L0.5255 5.9175C0.7215 5.659 1.0125 5.5905 1.322 5.5905L1.3365 5.442C1.4615 4.219 1.7415 3.3355 2.3775 2.682C3.608 1.412 5.2325 1.2565 5.9505 1.25H6.0495C6.7675 1.2565 8.392 1.4115 9.6225 2.682ZM6.0005 4.846C5.8585 4.846 5.694 4.854 5.5195 4.871C5.458 5.0945 5.367 5.296 5.2345 5.425C4.7095 5.9365 4.0765 6.015 3.7375 6.015C3.4185 6.015 3.0845 5.95 2.812 5.783C2.554 5.8655 2.306 5.9845 2.29 6.281C2.26898 6.76138 2.25847 7.24216 2.2585 7.723L2.2575 7.963C2.2565 8.2445 2.255 8.526 2.251 8.808C2.252 8.971 2.353 9.123 2.506 9.1905C3.747 9.7415 4.921 10.019 6.001 10.019C7.079 10.019 8.253 9.7415 9.4935 9.1905C9.56814 9.15767 9.63181 9.10416 9.677 9.03628C9.72219 8.96841 9.747 8.88902 9.7485 8.8075C9.7635 7.9665 9.7515 7.1215 9.7105 6.281C9.695 5.983 9.4465 5.866 9.1875 5.783C8.9145 5.9495 8.5815 6.015 8.2625 6.015C7.924 6.015 7.2915 5.9365 6.766 5.425C6.633 5.296 6.5425 5.0945 6.481 4.871C6.321 4.855 6.1605 4.8465 6.0005 4.846ZM4.738 6.8525C5.0075 6.8525 5.226 7.0655 5.226 7.3275V8.204C5.226 8.4665 5.0075 8.679 4.738 8.679C4.61033 8.6806 4.48725 8.63149 4.39576 8.54243C4.30426 8.45338 4.25184 8.33166 4.25 8.204V7.328C4.25 7.0655 4.4685 6.8525 4.738 6.8525ZM7.238 6.8525C7.5075 6.8525 7.726 7.0655 7.726 7.3275V8.204C7.726 8.4665 7.5075 8.679 7.238 8.679C7.11033 8.6806 6.98725 8.63149 6.89576 8.54243C6.80426 8.45338 6.75184 8.33166 6.75 8.204V7.328C6.75 7.0655 6.9685 6.8525 7.238 6.8525ZM3.8175 2.5435C3.2925 2.5945 2.85 2.7625 2.625 2.9965C2.1375 3.515 2.2425 4.8305 2.52 5.1085C2.7225 5.3055 3.105 5.437 3.5175 5.437H3.5625C3.887 5.4305 4.455 5.349 4.9275 4.882C5.145 4.677 5.28 4.1655 5.265 3.647C5.25 3.23 5.13 2.887 4.95 2.7405C4.755 2.5725 4.3125 2.4995 3.8175 2.5435ZM7.05 2.7405C6.87 2.8865 6.75 3.2305 6.735 3.647C6.72 4.1655 6.855 4.677 7.0725 4.882C7.5565 5.3605 8.1405 5.434 8.4605 5.437H8.4825C8.895 5.437 9.2775 5.3055 9.48 5.1085C9.7575 4.8305 9.8625 3.515 9.375 2.9965C9.15 2.7625 8.7075 2.5945 8.1825 2.5435C7.6875 2.4995 7.245 2.5725 7.05 2.7405ZM6 3.8075C5.88 3.8075 5.7375 3.815 5.58 3.8295C5.595 3.9095 5.6025 3.9975 5.61 4.0925L5.6095 4.172C5.60894 4.21375 5.60661 4.25545 5.6025 4.297C5.715 4.286 5.815 4.2835 5.9085 4.283H6.0915C6.185 4.283 6.285 4.286 6.3975 4.297C6.39 4.224 6.39 4.1585 6.39 4.0925C6.3975 3.9975 6.405 3.91 6.42 3.8295C6.2804 3.81583 6.14026 3.80849 6 3.8075Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`GitHub Copilot icon`,xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function g(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Cursor icon`}),r=(0,l.jsx)(`path`,{fill:`currentColor`,d:`M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Cursor icon`,fill:`none`,height:24,width:24,viewBox:`0 0 466.73 532.09`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function _(e){let t=(0,c.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(`title`,{children:`Windsurf icon`}),r=(0,l.jsx)(`path`,{fill:`currentColor`,d:`M21.3192 4.9697H21.1203C20.0734 4.96806 19.2238 5.81589 19.2238 6.86264V11.0961C19.2238 11.9415 18.525 12.6263 17.6934 12.6263C17.1993 12.6263 16.706 12.3777 16.4133 11.9603L12.0896 5.78492C11.7308 5.27214 11.1471 4.96643 10.5152 4.96643C9.52943 4.96643 8.64234 5.80448 8.64234 6.83902V11.0969C8.64234 11.9423 7.94932 12.6271 7.11197 12.6271C6.61625 12.6271 6.12376 12.3785 5.83105 11.9611L0.992853 5.0504C0.883594 4.89387 0.638184 4.97133 0.638184 5.1621V8.85424C0.638184 9.04094 0.695264 9.22193 0.802059 9.37517L5.56362 16.175C5.84492 16.5769 6.25994 16.8753 6.73852 16.9837C7.93627 17.256 9.03861 16.334 9.03861 15.1592V10.9037C9.03861 10.0583 9.7235 9.37354 10.569 9.37354H10.5714C11.081 9.37354 11.5588 9.62219 11.8515 10.0396L16.1761 16.2141C16.5356 16.7277 17.0892 17.0326 17.7497 17.0326C18.7574 17.0326 19.6209 16.1937 19.6209 15.16V10.9029C19.6209 10.0575 20.3058 9.37273 21.1512 9.37273H21.32C21.426 9.37273 21.5116 9.28713 21.5116 9.18116V5.16127C21.5116 5.05531 21.426 4.9697 21.32 4.9697H21.3192Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,l.jsxs)(`svg`,{role:`img`,"aria-label":`Windsurf icon`,xmlns:`http://www.w3.org/2000/svg`,width:22,height:22,viewBox:`0 0 22 22`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var v=class{map=new Map;constructor(e){if(this.limit=e,e<=0)throw Error(`LruStringCache: limit must be > 0 (got ${e})`)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}set(e,t){for(this.map.has(e)&&this.map.delete(e),this.map.set(e,t);this.map.size>this.limit;){let e=this.map.keys().next().value;if(e===void 0)break;this.map.delete(e)}}clear(){this.map.clear()}get size(){return this.map.size}};function y(e){let t=(0,c.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,l.jsx)(u,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,l.jsx)(g,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,l.jsx)(_,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,l.jsx)(p,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,l.jsx)(d,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,l.jsx)(h,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,l.jsx)(o,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function b(e){return typeof e==`object`&&!!e&&typeof e.getStates==`function`}function x(e,t,n){let r=[],i=[];for(let a of e.getStates().values()){let e=a.agentPresence;if(e)for(let[a,o]of Object.entries(e))o.currentDoc&&(n-o.ts>=5e3||(o.currentDoc===t?r.push({agentId:a,entry:o}):i.push({agentId:a,entry:o})))}return{current:r,crossDoc:i}}export{_ as a,m as c,u as d,s as f,v as i,p as l,a as m,x as n,g as o,o as p,y as r,h as s,b as t,d as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{f as i,h as a,l as o,m as s,r as c,u as l,x as u}from"./button-BsFpqlpT.js";import{n as d,t as f}from"./dist-ClFYZdbN.js";import{t as p}from"./dist-1cEl720w.js";var m=e(t(),1),h=n(),g=`Checkbox`,[_,v]=s(g),[y,b]=_(g);function x(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,_]=l({prop:n,defaultProp:i??!1,onChange:c,caller:g}),[v,b]=m.useState(null),[x,S]=m.useState(null),C=m.useRef(!1),w=v?!!o||!!v.closest(`form`):!0,T={checked:p,disabled:a,setChecked:_,control:v,setControl:b,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:C,required:u,defaultChecked:A(i)?!1:i,isFormControl:w,bubbleInput:x,setBubbleInput:S};return(0,h.jsx)(y,{scope:t,...T,children:k(f)?f(T):r})}var S=`CheckboxTrigger`,C=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{let{control:s,value:c,disabled:l,checked:d,required:f,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:_,isFormControl:v,bubbleInput:y}=b(S,e),x=u(o,p),C=m.useRef(d);return m.useEffect(()=>{let e=s?.form;if(e){let t=()=>g(C.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,g]),(0,h.jsx)(a.button,{type:`button`,role:`checkbox`,"aria-checked":A(d)?`mixed`:d,"aria-required":f,"data-state":j(d),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:x,onKeyDown:i(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:i(n,e=>{g(e=>A(e)?!0:!e),y&&v&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())})})});C.displayName=S;var w=m.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,h.jsx)(x,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(C,{...d,ref:t,__scopeCheckbox:n}),e&&(0,h.jsx)(O,{__scopeCheckbox:n})]})})});w.displayName=g;var T=`CheckboxIndicator`,E=m.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,s=b(T,n);return(0,h.jsx)(o,{present:r||A(s.checked)||s.checked===!0,children:(0,h.jsx)(a.span,{"data-state":j(s.checked),"data-disabled":s.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});E.displayName=T;var D=`CheckboxBubbleInput`,O=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:c,disabled:l,name:d,value:g,form:_,bubbleInput:v,setBubbleInput:y}=b(D,e),x=u(n,y),S=f(o),C=p(r);m.useEffect(()=>{let e=v;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(S!==o&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=A(o),n.call(e,A(o)?!1:o),e.dispatchEvent(t)}},[v,S,o,i]);let w=m.useRef(A(o)?!1:o);return(0,h.jsx)(a.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??w.current,required:c,disabled:l,name:d,value:g,form:_,...t,tabIndex:-1,ref:x,style:{...t.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});O.displayName=D;function k(e){return typeof e==`function`}function A(e){return e===`indeterminate`}function j(e){return A(e)?`indeterminate`:e?`checked`:`unchecked`}function M(){let e=null,t=null,n=new Set,r=!1,i=null;function a(){for(let e of n)e()}function o(){e!==null&&(e=null,a())}return{install({bridge:n}){if(n)return r?i??void 0:(r=!0,t=n,i=n.mcpWiring.onShow(t=>{e=t,a()}),n.mcpWiring.signalReady(),()=>{i?.(),i=null,r=!1,t=null,o()})},getSnapshot(){return e},subscribe(e){return n.add(e),()=>{n.delete(e)}},async confirm(e){let n=t;if(!n)return{ok:!1,error:`Not attached to desktop bridge`};try{let t=await n.mcpWiring.confirm(e);return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:`Unknown error`}}},async skip(){let e=t;if(!e)return{ok:!1,error:`Not attached to desktop bridge`};try{let t=await e.mcpWiring.skip();return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:`Unknown error`}}},dismiss(){o()}}}var N=M();function P(e){return N.install(e)}var F=r();function I(e){let t=(0,F.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,h.jsx)(E,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,h.jsx)(d,{})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,h.jsx)(w,{"data-slot":`checkbox`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}export{P as n,N as r,I as t};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{f as i,h as a,l as o,m as s,r as c,u as l,x as u}from"./button-C1nwPVFQ.js";import{n as d,t as f}from"./dist-Bej94Urx.js";import{t as p}from"./dist-Cg-Qaqw_.js";var m=e(t(),1),h=n(),g=`Checkbox`,[_,v]=s(g),[y,b]=_(g);function x(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,_]=l({prop:n,defaultProp:i??!1,onChange:c,caller:g}),[v,b]=m.useState(null),[x,S]=m.useState(null),C=m.useRef(!1),w=v?!!o||!!v.closest(`form`):!0,T={checked:p,disabled:a,setChecked:_,control:v,setControl:b,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:C,required:u,defaultChecked:A(i)?!1:i,isFormControl:w,bubbleInput:x,setBubbleInput:S};return(0,h.jsx)(y,{scope:t,...T,children:k(f)?f(T):r})}var S=`CheckboxTrigger`,C=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{let{control:s,value:c,disabled:l,checked:d,required:f,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:_,isFormControl:v,bubbleInput:y}=b(S,e),x=u(o,p),C=m.useRef(d);return m.useEffect(()=>{let e=s?.form;if(e){let t=()=>g(C.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,g]),(0,h.jsx)(a.button,{type:`button`,role:`checkbox`,"aria-checked":A(d)?`mixed`:d,"aria-required":f,"data-state":j(d),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:x,onKeyDown:i(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:i(n,e=>{g(e=>A(e)?!0:!e),y&&v&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())})})});C.displayName=S;var w=m.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,h.jsx)(x,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(C,{...d,ref:t,__scopeCheckbox:n}),e&&(0,h.jsx)(O,{__scopeCheckbox:n})]})})});w.displayName=g;var T=`CheckboxIndicator`,E=m.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,s=b(T,n);return(0,h.jsx)(o,{present:r||A(s.checked)||s.checked===!0,children:(0,h.jsx)(a.span,{"data-state":j(s.checked),"data-disabled":s.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});E.displayName=T;var D=`CheckboxBubbleInput`,O=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:c,disabled:l,name:d,value:g,form:_,bubbleInput:v,setBubbleInput:y}=b(D,e),x=u(n,y),S=f(o),C=p(r);m.useEffect(()=>{let e=v;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(S!==o&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=A(o),n.call(e,A(o)?!1:o),e.dispatchEvent(t)}},[v,S,o,i]);let w=m.useRef(A(o)?!1:o);return(0,h.jsx)(a.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??w.current,required:c,disabled:l,name:d,value:g,form:_,...t,tabIndex:-1,ref:x,style:{...t.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});O.displayName=D;function k(e){return typeof e==`function`}function A(e){return e===`indeterminate`}function j(e){return A(e)?`indeterminate`:e?`checked`:`unchecked`}function M(){let e=null,t=null,n=new Set,r=!1,i=null;function a(){for(let e of n)e()}function o(){e!==null&&(e=null,a())}return{install({bridge:n}){if(n)return r?i??void 0:(r=!0,t=n,i=n.mcpWiring.onShow(t=>{e=t,a()}),n.mcpWiring.signalReady(),()=>{i?.(),i=null,r=!1,t=null,o()})},getSnapshot(){return e},subscribe(e){return n.add(e),()=>{n.delete(e)}},async confirm(e){let n=t;if(!n)return{ok:!1,error:`Not attached to desktop bridge`};try{let t=await n.mcpWiring.confirm(e);return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:`Unknown error`}}},async skip(){let e=t;if(!e)return{ok:!1,error:`Not attached to desktop bridge`};try{let t=await e.mcpWiring.skip();return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:`Unknown error`}}},dismiss(){o()}}}var N=M();function P(e){return N.install(e)}var F=r();function I(e){let t=(0,F.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=c(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,h.jsx)(E,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,h.jsx)(d,{})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,h.jsx)(w,{"data-slot":`checkbox`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}export{P as n,N as r,I as t};