@inkeep/open-knowledge 0.10.0-beta.1 → 0.10.0-beta.2

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 (44) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +4 -4
  4. package/dist/constants-Aooo5mZf.mjs +2 -0
  5. package/dist/{dist-B_gH0hwY.mjs → dist-BChJILrk.mjs} +1 -1
  6. package/dist/{dist-dFbVRgjP.mjs → dist-DmAclKYw.mjs} +9 -9
  7. package/dist/{gh-detect-DH0jeaqh.mjs → gh-detect-DjiocciN.mjs} +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-DzrbCl9i.mjs → init-B1U5zssu.mjs} +4 -4
  10. package/dist/init-C2apfDIg.mjs +1 -0
  11. package/dist/loader-BEfkXa6p.mjs +1 -0
  12. package/dist/{loader-BMUcj0Gb.mjs → loader-D-MyijDv.mjs} +2 -2
  13. package/dist/preview-B7k4yYED.mjs +1 -0
  14. package/dist/{preview-CBkcN3yq.mjs → preview-CgQ_96_Y.mjs} +2 -2
  15. package/dist/public/assets/{ActivityModeContent-DqtdV56a.js → ActivityModeContent-Cag3qsEp.js} +1 -1
  16. package/dist/public/assets/{DocumentContext-Cf0J0V-D.js → DocumentContext-CV395VYL.js} +4 -4
  17. package/dist/public/assets/{GraphPanel-DyvuLzi4.js → GraphPanel-2TcKJgp2.js} +1 -1
  18. package/dist/public/assets/{SettingsDialogBody-DfwLWUB4.js → SettingsDialogBody-Co5_Xo6m.js} +1 -1
  19. package/dist/public/assets/{SourceEditor-CWDD_0Ko.js → SourceEditor-BDifJ_-m.js} +1 -1
  20. package/dist/public/assets/{config-validation-events-CTMArlH_.js → config-validation-events-B5G3zveS.js} +4 -4
  21. package/dist/public/assets/{index-BWU-OT-w.js → index-BE5VlQ00.js} +6 -6
  22. package/dist/public/assets/{keyboard-shortcuts-CwjLkUXk.js → keyboard-shortcuts-B4aOgyRn.js} +1 -1
  23. package/dist/public/assets/{prop-types-1LtPV_jm.js → prop-types-mM2mU4oh.js} +134 -134
  24. package/dist/public/assets/{target-navigation-intent-C3fRj6CU.js → target-navigation-intent-CxMMZ391.js} +1 -1
  25. package/dist/public/assets/{typing-burst-detector-B8t-SuQv.js → typing-burst-detector-DMPAdHvx.js} +1 -1
  26. package/dist/public/index.html +7 -7
  27. package/dist/{repair-launch-json-Dnz3TtnV.mjs → repair-launch-json-t7SBBUmJ.mjs} +2 -2
  28. package/dist/{repair-mcp-configs-Cmow_T2G.mjs → repair-mcp-configs-CFt0S96K.mjs} +2 -2
  29. package/dist/{repair-skills-DrBahEE9.mjs → repair-skills-4GbGPfQs.mjs} +2 -2
  30. package/dist/repair-skills-CEYqx9v7.mjs +1 -0
  31. package/dist/{server-lock-BpjJj3OD-uzESbCl1.mjs → server-lock-BpjJj3OD-CpgmesYM.mjs} +2 -2
  32. package/dist/server-lock-CyhBidkz-3npi9JMD.mjs +1 -0
  33. package/dist/{src-DzdHVeuo.mjs → src-DyJezQur.mjs} +2 -2
  34. package/dist/start-BSDJmh5u.mjs +1 -0
  35. package/dist/{start-CEPHRdwU.mjs → start-ddvEdLDZ.mjs} +2 -2
  36. package/dist/{write-project-skill-BgBD0HrT.mjs → write-project-skill-Bc9GzRes.mjs} +2 -2
  37. package/package.json +1 -1
  38. package/dist/constants-DBo6X59s.mjs +0 -2
  39. package/dist/init-5ScaZzxw.mjs +0 -1
  40. package/dist/loader-RJOf6d25.mjs +0 -1
  41. package/dist/preview-CNLDsQLX.mjs +0 -1
  42. package/dist/repair-skills-D5TVXlpu.mjs +0 -1
  43. package/dist/server-lock-CyhBidkz-BnpZYxAZ.mjs +0 -1
  44. package/dist/start-C1yS6bXD.mjs +0 -1
@@ -1,9 +1,9 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-CWYso-V4.js","./preload-helper-2ej06EnG.js","./chunk-U2HBQHQK-DenE4TdD.js","./src-DOAilbaA.js","./chunk-CFjPhJqf.js","./src-L3wpjxBL.js","./chunk-5PVQY5BW-BpceE2BZ.js","./dist-Bog19bCH.js","./chunk-ICPOFSXX-BC5Xd13f.js","./_baseFor-CVV1DSgL.js","./isObjectLike-DFnkciUU.js","./isEmpty-gGVpRSDa.js","./chunk-336JU56O-CtkQ28bg.js","./chunk-5FUZZQ4R-DF0EG1O8.js","./chunk-X2U36JSP-DSyuGkzP.js","./chunk-ZZ45TVLE-DHB0SHUz.js","./rough.esm-DDK-gphn.js","./chunk-ENJZ2VHE-CY9yto8o.js","./line-C59Ezo8Z.js","./path-C-grg3CZ.js","./array-COEOjKUv.js","./chunk-BSJP7CBP-BrRqu__W.js","./chunk-426QAEUC-jRhC4EYv.js","./chunk-XPW4576I-CLO5Bb_q.js","./pdf-CtJiipL_.js","./dist-DsbVHLNy.js","./dist-Du-s1q8P.js","./w3c-keyname-B5t0fahT.js","./dist-BYGzJeLM.js","./dist-Cq1LYbUj.js","./dist-CXGJFbY5.js","./dist-BrsSsfiw.js","./dist-CyaBbyDQ.js","./stex-CzCFWeB9.js"])))=>i.map(i=>d[i]);
2
- import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{a as r,i,o as a,r as o,t as s}from"./compiler-runtime-Cs91PcD2.js";import{$ as c,$n as l,$r as u,$t as d,Ai as f,An as p,Ar as m,B as h,Bt as g,Cn as _,Cr as v,D as y,Di as b,Dr as x,Ei as S,Er as C,F as w,Fi as T,Fn as E,Ft as D,Gi as O,Gn as k,Gr as A,Gt as j,H as M,Hr as N,Ht as P,I as F,In as I,Ir as L,J as ee,Ji as R,K as z,Ki as B,Kn as V,Kt as H,M as U,Mi as te,Mn as ne,Mr as re,Mt as ie,N as ae,Ni as W,Nn as oe,Nr as se,Nt as G,O as ce,Oi as le,Or as ue,Pi as de,Pn as fe,Pr as pe,Q as me,Qr as he,Qt as ge,R as _e,Rt as ve,Si as ye,Sn as be,Sr as xe,St as Se,T as Ce,Ti as we,Tn as Te,Tr as Ee,U as De,Ui as Oe,Ut as ke,V as Ae,Vr as je,Vt as Me,Wi as Ne,Wn as Pe,Wr as Fe,Xn as Ie,Xt as Le,Yi as Re,Yn as ze,Yt as Be,Z as Ve,Zi as He,Zn as Ue,Zt as We,_i as Ge,_n as Ke,_r as qe,_t as Je,ai as Ye,an as Xe,ar as Ze,at as Qe,bi as $e,bn as et,br as tt,ci as nt,cn as rt,cr as it,d as at,dr as ot,dt as st,ei as ct,en as lt,et as ut,f as dt,fr as ft,ft as pt,gn as mt,gr as ht,gt,hr as _t,i as vt,ii as yt,ir as bt,j as xt,ji as St,jr as Ct,ki as wt,kr as Tt,l as Et,li as Dt,lr as Ot,lt as kt,mi as At,mr as jt,mt as Mt,oi as Nt,on as Pt,p as Ft,pi as It,pn as Lt,pr as Rt,pt as zt,q as Bt,qi as Vt,qr as Ht,r as Ut,ri as Wt,rn as Gt,rr as Kt,s as qt,si as Jt,sn as Yt,sr as Xt,ti as Zt,tr as Qt,ui as $t,ur as en,ut as tn,v as nn,vi as rn,vn as an,vt as on,wi as sn,wt as cn,xi as ln,xt as un,y as dn,yi as fn,yn as pn,yr as mn,yt as hn,z as gn,zr as _n}from"./prop-types-1LtPV_jm.js";import{C as K,S as vn,_ as yn,a as bn,b as xn,c as Sn,d as Cn,g as wn,i as Tn,l as En,m as Dn,o as On,p as kn,r as An,s as jn,t as Mn,u as Nn,w as Pn,x as Fn,y as In}from"./button-DenIdY-r.js";import{_ as Ln,a as Rn,b as zn,c as Bn,d as Vn,f as Hn,g as Un,h as Wn,i as Gn,l as Kn,m as qn,n as Jn,o as Yn,p as Xn,r as Zn,s as Qn,t as $n,u as er,x as tr,y as nr}from"./dialog-B1es0EvU.js";import{a as rr,i as ir,n as ar,r as or,t as sr}from"./collapsible-BhpeB6tu.js";import{t as cr}from"./trace-api-CiCjX4Sz.js";import{n as lr,t as ur}from"./propagation-api-3kmMXRwS.js";import{n as dr,t as fr}from"./dist-DicqJavT.js";import{A as pr,At as mr,B as hr,Bt as gr,C as _r,Ct as vr,D as yr,Dt as br,E as xr,Et as Sr,F as Cr,Ft as wr,G as Tr,H as Er,Ht as Dr,It as Or,J as kr,K as Ar,L as jr,Lt as Mr,M as Nr,Mt as Pr,N as Fr,O as Ir,Ot as Lr,P as Rr,Pt as zr,Q as Br,R as q,S as Vr,St as Hr,T as Ur,Tt as Wr,U as Gr,V as Kr,Vt as qr,W as Jr,X as Yr,Y as Xr,a as Zr,b as Qr,c as $r,d as ei,dt as ti,f as ni,g as ri,i as ii,j as ai,l as oi,m as si,n as ci,o as li,p as ui,q as di,r as fi,s as pi,t as mi,u as hi,ut as gi,v as _i,x as vi,xt as yi}from"./dist-Du-s1q8P.js";import{i as bi,n as xi,r as Si,t as Ci}from"./dist-BYGzJeLM.js";import{a as wi,c as Ti,s as Ei,t as Di}from"./dist-BrsSsfiw.js";import{n as Oi}from"./dist-DsbVHLNy.js";import{n as ki}from"./dist-Cq1LYbUj.js";import{t as Ai}from"./stex-CzCFWeB9.js";(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var ji=K(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),Mi=K(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ni=K(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Pi=K(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Fi=K(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Ii=K(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Li=K(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Ri=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),zi=K(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Bi=K(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Vi=K(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Hi=K(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ui=K(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Wi=K(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Gi=K(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ki=K(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),qi=K(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ji=K(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Yi=K(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Xi=K(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Zi=K(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Qi=K(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),$i=K(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ea=K(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),ta=K(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),na=K(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),ra=K(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),ia=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),aa=K(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),oa=K(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),sa=K(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),ca=K(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),la=K(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),ua=K(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),da=K(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),fa=K(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),pa=K(`layout-panel-top`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),ma=K(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ha=K(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),ga=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],_a=K(`link-2`,ga),va=K(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),ya=K(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),ba=K(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),xa=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Sa=K(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),Ca=K(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),wa=K(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Ta=K(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Ea=K(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Da=K(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Oa=K(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),ka=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Aa=K(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),ja=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ma=K(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Na=K(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Pa=K(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),Fa=K(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Ia=K(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),La=K(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),Ra=K(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),za=K(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),Ba=K(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),Va=K(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),Ha=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ua=K(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Wa=K(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Ga=K(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Ka=K(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),qa=K(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Ja=K(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),J=s(),Y=e(r(),1);function Ya(e,t){let n=(0,J.c)(7),r,i;n[0]!==e||n[1]!==t?(r=()=>{if(t!==`light`&&t!==`dark`&&t!==`system`||!e)return;let n=!1;return e.setThemeSource(t).catch(e=>{console.warn(JSON.stringify({event:`theme-source-set-failed`,themeValue:t,error:e instanceof Error?e.message:String(e)}))}).finally(()=>{if(n)return;let t=window.matchMedia(`(prefers-reduced-transparency: reduce)`).matches;e.signalThemeApplied({reducedTransparency:t})}),()=>{n=!0}},i=[e,t],n[0]=e,n[1]=t,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,Y.useEffect)(r,i);let a,o;n[4]===e?(a=n[5],o=n[6]):(a=()=>{if(!e)return;let t=window.matchMedia(`(prefers-reduced-transparency: reduce)`),n=t=>{e.signalThemeApplied({reducedTransparency:t.matches})};return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}},o=[e],n[4]=e,n[5]=a,n[6]=o),(0,Y.useEffect)(a,o)}var Xa=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Za=t(((e,t)=>{t.exports=Xa()})),X=a(),Qa=e(Pn(),1);function $a(e,[t,n]){return Math.min(n,Math.max(t,e))}var eo=`Popover`,[to,no]=kn(eo,[De]),ro=De(),[io,ao]=to(eo),oo=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ro(t),c=Y.useRef(null),[l,u]=Y.useState(!1),[d,f]=En({prop:r,defaultProp:i??!1,onChange:a,caller:eo});return(0,X.jsx)(M,{...s,children:(0,X.jsx)(io,{scope:t,contentId:jn(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:Y.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:Y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:Y.useCallback(()=>u(!1),[]),modal:o,children:n})})};oo.displayName=eo;var so=`PopoverAnchor`,co=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ao(so,n),a=ro(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return Y.useEffect(()=>(o(),()=>s()),[o,s]),(0,X.jsx)(gn,{...a,...r,ref:t})});co.displayName=so;var lo=`PopoverTrigger`,uo=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ao(lo,n),a=ro(n),o=xn(t,i.triggerRef),s=(0,X.jsx)(Dn.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Eo(i.open),...r,ref:o,onClick:Cn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,X.jsx)(gn,{asChild:!0,...a,children:s})});uo.displayName=lo;var fo=`PopoverPortal`,[po,mo]=to(fo,{forceMount:void 0}),ho=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ao(fo,t);return(0,X.jsx)(po,{scope:t,forceMount:n,children:(0,X.jsx)(Sn,{present:n||a.open,children:(0,X.jsx)(Tn,{asChild:!0,container:i,children:r})})})};ho.displayName=fo;var go=`PopoverContent`,_o=Y.forwardRef((e,t)=>{let n=mo(go,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ao(go,e.__scopePopover);return(0,X.jsx)(Sn,{present:r||a.open,children:a.modal?(0,X.jsx)(yo,{...i,ref:t}):(0,X.jsx)(bo,{...i,ref:t})})});_o.displayName=go;var vo=yn(`PopoverContent.RemoveScroll`),yo=Y.forwardRef((e,t)=>{let n=ao(go,e.__scopePopover),r=Y.useRef(null),i=xn(t,r),a=Y.useRef(!1);return Y.useEffect(()=>{let e=r.current;if(e)return qn(e)},[]),(0,X.jsx)(Wn,{as:vo,allowPinchZoom:!0,children:(0,X.jsx)(xo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Cn(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Cn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Cn(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),bo=Y.forwardRef((e,t)=>{let n=ao(go,e.__scopePopover),r=Y.useRef(!1),i=Y.useRef(!1);return(0,X.jsx)(xo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),xo=Y.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ao(go,n),p=ro(n);return Un(),(0,X.jsx)(Ln,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,X.jsx)(bn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,X.jsx)(Ae,{"data-state":Eo(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),So=`PopoverClose`,Co=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ao(So,n);return(0,X.jsx)(Dn.button,{type:`button`,...r,ref:t,onClick:Cn(e.onClick,()=>i.onOpenChange(!1))})});Co.displayName=So;var wo=`PopoverArrow`,To=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ro(n);return(0,X.jsx)(h,{...i,...r,ref:t})});To.displayName=wo;function Eo(e){return e?`open`:`closed`}var Do=oo,Oo=co,ko=uo,Ao=ho,jo=_o,Mo=[` `,`Enter`,`ArrowUp`,`ArrowDown`],No=[` `,`Enter`],Po=`Select`,[Fo,Io,Lo]=dr(Po),[Ro,zo]=kn(Po,[Lo,De]),Bo=De(),[Vo,Ho]=Ro(Po),[Uo,Wo]=Ro(Po),Go=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=Bo(t),[g,_]=Y.useState(null),[v,y]=Y.useState(null),[b,x]=Y.useState(!1),S=fr(l),[C,w]=En({prop:r,defaultProp:i??!1,onChange:a,caller:Po}),[T,E]=En({prop:o,defaultProp:s,onChange:c,caller:Po}),D=Y.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=Y.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,X.jsx)(M,{...h,children:(0,X.jsxs)(Vo,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:jn(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,X.jsx)(Fo.Provider,{scope:t,children:(0,X.jsx)(Uo,{scope:e.__scopeSelect,onNativeOptionAdd:Y.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:Y.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,X.jsxs)(Bs,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,X.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};Go.displayName=Po;var Ko=`SelectTrigger`,qo=Y.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Bo(n),o=Ho(Ko,n),s=o.disabled||r,c=xn(t,o.onTriggerChange),l=Io(n),u=Y.useRef(`touch`),[d,f,p]=Hs(e=>{let t=l().filter(e=>!e.disabled),n=Us(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,X.jsx)(gn,{asChild:!0,...a,children:(0,X.jsx)(Dn.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Vs(o.value)?``:void 0,...i,ref:c,onClick:Cn(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Cn(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:Cn(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Mo.includes(e.key)&&(m(),e.preventDefault())})})})});qo.displayName=Ko;var Jo=`SelectValue`,Yo=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Ho(Jo,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=xn(t,c.onValueNodeChange);return Nn(()=>{l(u)},[l,u]),(0,X.jsx)(Dn.span,{...s,ref:d,style:{pointerEvents:`none`},children:Vs(c.value)?(0,X.jsx)(X.Fragment,{children:o}):a})});Yo.displayName=Jo;var Xo=`SelectIcon`,Zo=Y.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,X.jsx)(Dn.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Zo.displayName=Xo;var Qo=`SelectPortal`,$o=e=>(0,X.jsx)(Tn,{asChild:!0,...e});$o.displayName=Qo;var es=`SelectContent`,ts=Y.forwardRef((e,t)=>{let n=Ho(es,e.__scopeSelect),[r,i]=Y.useState();if(Nn(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Qa.createPortal((0,X.jsx)(rs,{scope:e.__scopeSelect,children:(0,X.jsx)(Fo.Slot,{scope:e.__scopeSelect,children:(0,X.jsx)(`div`,{children:e.children})})}),t):null}return(0,X.jsx)(ss,{...e,ref:t})});ts.displayName=es;var ns=10,[rs,is]=Ro(es),as=`SelectContentImpl`,os=yn(`SelectContent.RemoveScroll`),ss=Y.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=Ho(es,n),[y,b]=Y.useState(null),[x,S]=Y.useState(null),C=xn(t,e=>b(e)),[w,T]=Y.useState(null),[E,D]=Y.useState(null),O=Io(n),[k,A]=Y.useState(!1),j=Y.useRef(!1);Y.useEffect(()=>{if(y)return qn(y)},[y]),Un();let M=Y.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=Y.useCallback(()=>M([w,y]),[M,w,y]);Y.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;Y.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),Y.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[I,L]=Hs(e=>{let t=O().filter(e=>!e.disabled),n=Us(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ee=Y.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),R=Y.useCallback(()=>y?.focus(),[y]),z=Y.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),B=r===`popper`?ds:ls,V=B===ds?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,X.jsx)(rs,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ee,selectedItem:w,onItemLeave:R,itemTextRefCallback:z,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:I,children:(0,X.jsx)(Wn,{as:os,allowPinchZoom:!0,children:(0,X.jsx)(Ln,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Cn(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,X.jsx)(bn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,X.jsx)(B,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...V,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Cn(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&L(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});ss.displayName=as;var cs=`SelectItemAlignedPosition`,ls=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Ho(es,n),o=is(es,n),[s,c]=Y.useState(null),[l,u]=Y.useState(null),d=xn(t,e=>u(e)),f=Io(n),p=Y.useRef(!1),m=Y.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=Y.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ns,d=$a(a,[ns,Math.max(ns,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ns,d=$a(a,[ns,Math.max(ns,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-ns*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-ns,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${ns}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Nn(()=>y(),[y]);let[b,x]=Y.useState();return Nn(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,X.jsx)(fs,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:Y.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,X.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,X.jsx)(Dn.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});ls.displayName=cs;var us=`SelectPopperPosition`,ds=Y.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=ns,...a}=e,o=Bo(n);return(0,X.jsx)(Ae,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ds.displayName=us;var[fs,ps]=Ro(es,{}),ms=`SelectViewport`,hs=Y.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=is(ms,n),o=ps(ms,n),s=xn(t,a.onViewportChange),c=Y.useRef(0);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,X.jsx)(Fo.Slot,{scope:n,children:(0,X.jsx)(Dn.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Cn(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-ns*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});hs.displayName=ms;var gs=`SelectGroup`,[_s,vs]=Ro(gs),ys=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=jn();return(0,X.jsx)(_s,{scope:n,id:i,children:(0,X.jsx)(Dn.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});ys.displayName=gs;var bs=`SelectLabel`,xs=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=vs(bs,n);return(0,X.jsx)(Dn.div,{id:i.id,...r,ref:t})});xs.displayName=bs;var Ss=`SelectItem`,[Cs,ws]=Ro(Ss),Ts=Y.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Ho(Ss,n),c=is(Ss,n),l=s.value===r,[u,d]=Y.useState(a??``),[f,p]=Y.useState(!1),m=xn(t,e=>c.itemRefCallback?.(e,r,i)),h=jn(),g=Y.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,X.jsx)(Cs,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:Y.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,X.jsx)(Fo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,X.jsx)(Dn.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:Cn(o.onFocus,()=>p(!0)),onBlur:Cn(o.onBlur,()=>p(!1)),onClick:Cn(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Cn(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Cn(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Cn(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Cn(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Cn(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(No.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});Ts.displayName=Ss;var Es=`SelectItemText`,Ds=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Ho(Es,n),s=is(Es,n),c=ws(Es,n),l=Wo(Es,n),[u,d]=Y.useState(null),f=xn(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=Y.useMemo(()=>(0,X.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Nn(()=>(h(m),()=>g(m)),[h,g,m]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Dn.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Qa.createPortal(a.children,o.valueNode):null]})});Ds.displayName=Es;var Os=`SelectItemIndicator`,ks=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ws(Os,n).isSelected?(0,X.jsx)(Dn.span,{"aria-hidden":!0,...r,ref:t}):null});ks.displayName=Os;var As=`SelectScrollUpButton`,js=Y.forwardRef((e,t)=>{let n=is(As,e.__scopeSelect),r=ps(As,e.__scopeSelect),[i,a]=Y.useState(!1),o=xn(t,r.onScrollButtonChange);return Nn(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,X.jsx)(Ps,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});js.displayName=As;var Ms=`SelectScrollDownButton`,Ns=Y.forwardRef((e,t)=>{let n=is(Ms,e.__scopeSelect),r=ps(Ms,e.__scopeSelect),[i,a]=Y.useState(!1),o=xn(t,r.onScrollButtonChange);return Nn(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,X.jsx)(Ps,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Ns.displayName=Ms;var Ps=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=is(`SelectScrollButton`,n),o=Y.useRef(null),s=Io(n),c=Y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return Y.useEffect(()=>()=>c(),[c]),Nn(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,X.jsx)(Dn.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Cn(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Cn(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Cn(i.onPointerLeave,()=>{c()})})}),Fs=`SelectSeparator`,Is=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,X.jsx)(Dn.div,{"aria-hidden":!0,...r,ref:t})});Is.displayName=Fs;var Ls=`SelectArrow`,Rs=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Bo(n),a=Ho(Ls,n),o=is(Ls,n);return a.open&&o.position===`popper`?(0,X.jsx)(h,{...i,...r,ref:t}):null});Rs.displayName=Ls;var zs=`SelectBubbleInput`,Bs=Y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=Y.useRef(null),a=xn(r,i),o=Kn(t);return Y.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,X.jsx)(Dn.select,{...n,style:{...ut,...n.style},ref:a,defaultValue:t})});Bs.displayName=zs;function Vs(e){return e===``||e===void 0}function Hs(e){let t=On(e),n=Y.useRef(``),r=Y.useRef(0),i=Y.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=Y.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return Y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Us(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ws(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ws(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gs=Go,Ks=qo,qs=Yo,Js=Zo,Ys=$o,Xs=ts,Zs=hs,Qs=Ts,$s=Ds,ec=ks,tc=js,nc=Ns,rc=`Switch`,[ic,ac]=kn(rc),[oc,sc]=ic(rc),cc=Y.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=Y.useState(null),m=xn(t,e=>p(e)),h=Y.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=En({prop:i,defaultProp:a??!1,onChange:l,caller:rc});return(0,X.jsxs)(oc,{scope:n,checked:_,disabled:s,children:[(0,X.jsx)(Dn.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":pc(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:Cn(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,X.jsx)(fc,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});cc.displayName=rc;var lc=`SwitchThumb`,uc=Y.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=sc(lc,n);return(0,X.jsx)(Dn.span,{"data-state":pc(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});uc.displayName=lc;var dc=`SwitchBubbleInput`,fc=Y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=Y.useRef(null),s=xn(o,a),c=Kn(n),l=An(t);return Y.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,X.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});fc.displayName=dc;function pc(e){return e?`checked`:`unchecked`}var mc=cc,hc=uc;function gc(e){return e.kind===`doc`?e.docPath:e.folderPath}var _c=Fn(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3! font-mono uppercase`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,warning:`bg-yellow-500/10 text-yellow-600 [a]:hover:bg-yellow-500/20`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,dashed:`border-dashed border-border text-muted-foreground rounded-sm`,primary:`border border-primary/50 text-primary bg-primary/5 rounded-sm p-0.5 px-1.5 font-mono`,gray:`border border-border text-muted-foreground bg-muted rounded-sm p-0.5 px-1.5 font-mono`}},defaultVariants:{variant:`default`}});function vc(e){let t=(0,J.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?wn:`span`,c;t[5]!==n||t[6]!==o?(c=vn(_c({variant:o}),n),t[5]=n,t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==r||t[10]!==c||t[11]!==o?(l=(0,X.jsx)(s,{"data-slot":`badge`,"data-variant":o,className:c,...r}),t[8]=s,t[9]=r,t[10]=c,t[11]=o,t[12]=l):l=t[12],l}function yc(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Do,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function bc(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(ko,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function xc(e){let t=(0,J.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`center`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=vn(`z-50 w-72 rounded-lg border bg-popover p-4 text-popover-foreground shadow-md outline-hidden origin-(--radix-popover-content-transform-origin) duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,X.jsx)(Ao,{children:(0,X.jsx)(jo,{"data-slot":`popover-content`,align:o,sideOffset:s,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Sc(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Oo,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}var Cc={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.9.1`}?.VITE_APP_VERSION??`0.0.0-unknown`;function wc(){return E({kind:`web`,runtimeVersion:Cc})}function Tc(){return I({kind:`web`,runtimeVersion:Cc})}function Ec(e,t){return t}function Dc(e){let t=e.split(`/`);return t.length<2?`ok`:`${t[0]}/${t[1]}`}function Oc(e){if(!e)return;let t=Object.entries(e);if(t.length!==0)return t.map(([e,t])=>{if(t==null)return[e,String(t)];if(typeof t==`string`)return[e,t];if(typeof t==`number`||typeof t==`boolean`)return[e,String(t)];try{return[e,JSON.stringify(t)]}catch{return[e,`[unserializable]`]}})}function kc(e,t,n){if(typeof performance>`u`||!performance.measure)return;let r=Dc(e),i=Oc(t),a={devtools:{dataType:`track-entry`,track:r,...i?{properties:i}:{},...n?.tooltipText?{tooltipText:n.tooltipText}:{}}},o=performance.now(),s=n?.startTime??o,c=n?.duration??Math.max(0,o-s);try{performance.measure(e,{start:s,duration:c,detail:a})}catch{}({...t?{properties:t}:{}})}function Ac(e,t){}function jc(e,t,n){kc(e,{...t,durationMs:n},{duration:n})}var Z=Object.assign(kc,{count:Ac,histogram:jc});function Mc(e){let t=(0,J.c)(3),{name:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(Y.Profiler,{id:n,onRender:Nc,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}var Nc=(e,t,n,r,i,a)=>{Z(`ok/render/${e}`,{phase:t,actualDuration:Math.round(n*1e3)/1e3,baseDuration:Math.round(r*1e3)/1e3},{startTime:i,duration:Math.max(0,a-i)})},{getOwnPropertyNames:Pc,getOwnPropertySymbols:Fc}=Object,{hasOwnProperty:Ic}=Object.prototype;function Lc(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Rc(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function zc(e){return e?.[Symbol.toStringTag]}function Bc(e){return Pc(e).concat(Fc(e))}var Vc=Object.hasOwn||((e,t)=>Ic.call(e,t));function Hc(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Uc=`__v`,Wc=`__o`,Gc=`_owner`,{getOwnPropertyDescriptor:Kc,keys:qc}=Object;function Jc(e,t){return e.byteLength===t.byteLength&&sl(new Uint8Array(e),new Uint8Array(t))}function Yc(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Xc(e,t){return e.byteLength===t.byteLength&&sl(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Zc(e,t){return Hc(e.getTime(),t.getTime())}function Qc(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function $c(e,t){return e===t}function el(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var tl=Hc;function nl(e,t,n){let r=qc(e),i=r.length;if(qc(t).length!==i)return!1;for(;i-- >0;)if(!ll(e,t,n,r[i]))return!1;return!0}function rl(e,t,n){let r=Bc(e),i=r.length;if(Bc(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!ll(e,t,n,a)||(o=Kc(e,a),s=Kc(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function il(e,t){return Hc(e.valueOf(),t.valueOf())}function al(e,t){return e.source===t.source&&e.flags===t.flags}function ol(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function sl(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function cl(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function ll(e,t,n,r){return(r===Gc||r===Wc||r===Uc)&&(e.$$typeof||t.$$typeof)?!0:Vc(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var ul=`[object ArrayBuffer]`,dl=`[object Arguments]`,fl=`[object Boolean]`,pl=`[object DataView]`,ml=`[object Date]`,hl=`[object Error]`,gl=`[object Map]`,_l=`[object Number]`,vl=`[object Object]`,yl=`[object RegExp]`,bl=`[object Set]`,xl=`[object String]`,Sl={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Cl=`[object URL]`,wl=Object.prototype.toString;function Tl({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=wl.call(h);if(b===ml)return r(h,g,_);if(b===yl)return u(h,g,_);if(b===gl)return o(h,g,_);if(b===bl)return d(h,g,_);if(b===vl)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Cl)return p(h,g,_);if(b===hl)return i(h,g,_);if(b===dl)return c(h,g,_);if(Sl[b])return f(h,g,_);if(b===ul)return e(h,g,_);if(b===pl)return n(h,g,_);if(b===fl||b===_l||b===xl)return l(h,g,_);if(m){let e=m[b];if(!e){let t=zc(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function El({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Jc,areArraysEqual:n?rl:Yc,areDataViewsEqual:Xc,areDatesEqual:Zc,areErrorsEqual:Qc,areFunctionsEqual:$c,areMapsEqual:n?Lc(el,rl):el,areNumbersEqual:tl,areObjectsEqual:n?rl:nl,arePrimitiveWrappersEqual:il,areRegExpsEqual:al,areSetsEqual:n?Lc(ol,rl):ol,areTypedArraysEqual:n?Lc(sl,rl):sl,areUrlsEqual:cl,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Rc(r.areArraysEqual),t=Rc(r.areMapsEqual),n=Rc(r.areObjectsEqual),i=Rc(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Dl(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Ol({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var kl=Al();Al({strict:!0}),Al({circular:!0}),Al({circular:!0,strict:!0}),Al({createInternalComparator:()=>Hc}),Al({strict:!0,createInternalComparator:()=>Hc}),Al({circular:!0,createInternalComparator:()=>Hc}),Al({circular:!0,createInternalComparator:()=>Hc,strict:!0});function Al(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Tl(El(e));return Ol({circular:t,comparator:a,createState:r,equals:n?n(a):Dl(a),strict:i})}var jl=t((e=>{var t=r(),n=Za();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Ml=t(((e,t)=>{t.exports=jl()})),Nl=Za(),Pl=Ml(),Fl=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Il=({contentComponent:e})=>{let t=(0,Nl.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,X.jsx)(X.Fragment,{children:Object.values(t)})};function Ll(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:Qa.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var Rl=class extends Y.Component{constructor(e){super(e),this.editorContentRef=Y.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=Ll(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{ref:Fl(t,this.editorContentRef),...n}),e?.contentComponent&&(0,X.jsx)(Il,{contentComponent:e.contentComponent})]})}},zl=(0,Y.forwardRef)((e,t)=>{let n=Y.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Y.createElement(Rl,{key:n,innerRef:t,...e})}),Bl=Y.memo(zl),Vl=typeof window<`u`?Y.useLayoutEffect:Y.useEffect,Hl=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function Ul(e){let[t]=(0,Y.useState)(()=>new Hl(e.editor)),n=(0,Pl.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??kl);return Vl(()=>t.watch(e.editor),[e.editor,t]),(0,Y.useDebugValue)(n),n}typeof window>`u`||typeof window<`u`&&window.next;var Wl=(0,Y.createContext)({editor:null});Wl.Consumer;var Gl=()=>(0,Y.useContext)(Wl),Kl=(0,Y.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ql=()=>(0,Y.useContext)(Kl);function Jl({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=ql();return(0,X.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var Yl=Y.forwardRef((e,t)=>{let{onDragStart:n}=ql();return(0,X.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function Xl(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function Zl(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function Ql(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function $l(e){if(Xl(e)||Zl(e))return!0;if(Ql(e)){let t=e.type;if(t)return Xl(t)||Zl(t)}return!1}function eu(){try{if(Y.version)return parseInt(Y.version.split(`.`)[0],10)>=19}catch{}return!1}var tu=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,Qa.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=eu(),a=$l(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,X.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};Y.createContext({markViewContentRef:()=>{}});var nu=class extends Ye{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,Y.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,Y.memo)(e=>(0,X.jsx)(Kl.Provider,{value:t,children:(0,Y.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new tu(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},fn(this.editor,this.positionCheckCallback)}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:t}=this.editor.state.selection,n=this.currentPos;if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}let i=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?i===this.currentPos?!0:(this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()}),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.positionCheckCallback&&=(Nt(this.editor,this.positionCheckCallback),null),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=Dt(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function ru(e,t){return n=>n.editor.contentComponent?new nu(e,n,t):{}}var iu=(0,Y.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});iu.displayName=`TiptapContext`;var au=()=>(0,Y.useContext)(iu);function ou({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,Y.useMemo)(()=>({editor:r}),[r]),a=(0,Y.useMemo)(()=>({editor:r}),[r]);return(0,X.jsx)(Wl.Provider,{value:a,children:(0,X.jsx)(iu.Provider,{value:i,children:n})})}ou.displayName=`Tiptap`;function su({...e}){let{editor:t}=au();return(0,X.jsx)(Bl,{editor:t,...e})}su.displayName=`Tiptap.Content`,Object.assign(ou,{Content:su});var cu=()=>new Map,lu=e=>{let t=cu();return e.forEach((e,n)=>{t.set(n,e)}),t},uu=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},du=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},fu=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},pu=()=>new Set,mu=e=>e[e.length-1],hu=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},gu=Array.from,_u=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},vu=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},yu=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},bu=Array.isArray,xu=class{constructor(){this._observers=cu()}on(e,t){return uu(this._observers,e,pu).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return gu((this._observers.get(e)||cu()).values()).forEach(e=>e(...t))}destroy(){this._observers=cu()}},Su=class{constructor(){this._observers=cu()}on(e,t){uu(this._observers,e,pu).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return gu((this._observers.get(e)||cu()).values()).forEach(e=>e(...t))}destroy(){this._observers=cu()}},Cu=Math.floor,wu=Math.abs,Tu=(e,t)=>e<t?e:t,Eu=(e,t)=>e>t?e:t;Number.isNaN;var Du=e=>e===0?1/e<0:e<0,Ou=1<<17,ku=1<<18,Au=1<<19,ju=1<<20,Mu=1<<21,Nu=1<<22,Pu=1<<23,Fu=1<<24,Iu=1<<25,Lu=1<<26,Ru=1<<27,zu=1<<28,Bu=1<<29;Ou-1,ku-1,Au-1,ju-1,Mu-1,Nu-1,Pu-1,Fu-1,Iu-1,Lu-1,Ru-1,zu-1,Bu-1;var Vu=2**53-1,Hu=-(2**53-1),Uu=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&Cu(e)===e);Number.isNaN,Number.parseInt;var Wu=String.fromCharCode;String.fromCodePoint,Wu(65535);var Gu=e=>e.toLowerCase(),Ku=/^\s*/g,qu=e=>e.replace(Ku,``),Ju=/([A-Z])/g,Yu=(e,t)=>qu(e.replace(Ju,e=>`${t}${Gu(e)}`)),Xu=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Zu=typeof TextEncoder<`u`?new TextEncoder:null,Qu=Zu?e=>Zu.encode(e):Xu,$u=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});$u&&$u.decode(new Uint8Array).length===1&&($u=null);var ed=(e,t)=>yu(t,()=>e).join(``),td=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},nd=()=>new td,rd=e=>{let t=nd();return e(t),ad(t)},id=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},ad=e=>{let t=new Uint8Array(id(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},od=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Eu(n,t)*2),e.cpos=0)},sd=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},cd=sd,ld=(e,t)=>{for(;t>127;)sd(e,128|127&t),t=Cu(t/128);sd(e,127&t)},ud=(e,t)=>{let n=Du(t);for(n&&(t=-t),sd(e,(t>63?128:0)|(n?64:0)|63&t),t=Cu(t/64);t>0;)sd(e,(t>127?128:0)|127&t),t=Cu(t/128)},dd=new Uint8Array(3e4),fd=dd.length/3,pd=Zu&&Zu.encodeInto?(e,t)=>{if(t.length<fd){let n=Zu.encodeInto(t,dd).written||0;ld(e,n);for(let t=0;t<n;t++)sd(e,dd[t])}else hd(e,Qu(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;ld(e,r);for(let t=0;t<r;t++)sd(e,n.codePointAt(t))},md=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=Tu(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Eu(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},hd=(e,t)=>{ld(e,t.byteLength),md(e,t)},gd=(e,t)=>{od(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},_d=(e,t)=>gd(e,4).setFloat32(0,t,!1),vd=(e,t)=>gd(e,8).setFloat64(0,t,!1),yd=(e,t)=>gd(e,8).setBigInt64(0,t,!1),bd=new DataView(new ArrayBuffer(4)),xd=e=>(bd.setFloat32(0,e),bd.getFloat32(0)===e),Sd=(e,t)=>{switch(typeof t){case`string`:sd(e,119),pd(e,t);break;case`number`:Uu(t)&&wu(t)<=2147483647?(sd(e,125),ud(e,t)):xd(t)?(sd(e,124),_d(e,t)):(sd(e,123),vd(e,t));break;case`bigint`:sd(e,122),yd(e,t);break;case`object`:if(t===null)sd(e,126);else if(bu(t)){sd(e,117),ld(e,t.length);for(let n=0;n<t.length;n++)Sd(e,t[n])}else if(t instanceof Uint8Array)sd(e,116),hd(e,t);else{sd(e,118);let n=Object.keys(t);ld(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];pd(e,i),Sd(e,t[i])}}break;case`boolean`:sd(e,t?120:121);break;default:sd(e,127)}},Cd=class extends td{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ld(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},wd=e=>{e.count>0&&(ud(e.encoder,e.count===1?e.s:-e.s),e.count>1&&ld(e.encoder,e.count-2))},Td=class{constructor(){this.encoder=new td,this.s=0,this.count=0}write(e){this.s===e?this.count++:(wd(this),this.count=1,this.s=e)}toUint8Array(){return wd(this),ad(this.encoder)}},Ed=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);ud(e.encoder,t),e.count>1&&ld(e.encoder,e.count-2)}},Dd=class{constructor(){this.encoder=new td,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Ed(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Ed(this),ad(this.encoder)}},Od=class{constructor(){this.sarr=[],this.s=``,this.lensE=new Td}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new td;return this.sarr.push(this.s),this.s=``,pd(e,this.sarr.join(``)),md(e,this.lensE.toUint8Array()),ad(e)}},kd=e=>Error(e),Ad=()=>{throw kd(`Method unimplemented`)},jd=()=>{throw kd(`Unexpected case`)},Md=kd(`Unexpected end of array`),Nd=kd(`Integer out of Range`),Pd=class{constructor(e){this.arr=e,this.pos=0}},Fd=e=>new Pd(e),Id=e=>e.pos!==e.arr.length,Ld=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Rd=e=>Ld(e,Bd(e)),zd=e=>e.arr[e.pos++],Bd=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>Vu)throw Nd}throw Md},Vd=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>Vu)throw Nd}throw Md},Hd=$u?e=>$u.decode(Rd(e)):e=>{let t=Bd(e);if(t===0)return``;{let n=String.fromCodePoint(zd(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(zd(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Ud=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Wd=[e=>void 0,e=>null,Vd,e=>Ud(e,4).getFloat32(0,!1),e=>Ud(e,8).getFloat64(0,!1),e=>Ud(e,8).getBigInt64(0,!1),e=>!1,e=>!0,Hd,e=>{let t=Bd(e),n={};for(let r=0;r<t;r++){let t=Hd(e);n[t]=Gd(e)}return n},e=>{let t=Bd(e),n=[];for(let r=0;r<t;r++)n.push(Gd(e));return n},Rd],Gd=e=>Wd[127-zd(e)](e),Kd=class extends Pd{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Id(this)?this.count=Bd(this)+1:this.count=-1),this.count--,this.s}},qd=class extends Pd{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Vd(this);let e=Du(this.s);this.count=1,e&&(this.s=-this.s,this.count=Bd(this)+2)}return this.count--,this.s}},Jd=class extends Pd{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=Vd(this),t=e&1;this.diff=Cu(e/2),this.count=1,t&&(this.count=Bd(this)+2)}return this.s+=this.diff,this.count--,this.s}},Yd=class{constructor(e){this.decoder=new qd(e),this.str=Hd(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}};crypto.subtle;var Xd=crypto.getRandomValues.bind(crypto),Zd=Math.random,Qd=()=>Xd(new Uint32Array(1))[0],$d=e=>e[Cu(Zd()*e.length)],ef=`10000000-1000-4000-8000-100000000000`,tf=()=>ef.replace(/[018]/g,e=>(e^Qd()&15>>e/4).toString(16)),nf=Date.now,rf=e=>new Promise(e);Promise.all.bind(Promise);var af=e=>e===void 0?null:e,of=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}};try{typeof localStorage<`u`&&localStorage&&(of=localStorage)}catch{}var sf=of,cf=Symbol(`Equality`),lf=(e,t)=>e===t||!!e?.[cf]?.(t)||!1,uf=e=>typeof e==`object`,df=Object.assign,ff=Object.keys,pf=(e,t)=>{for(let n in e)t(e[n],n)},mf=e=>ff(e).length,hf=e=>{for(let t in e)return!1;return!0},gf=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},_f=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),vf=(e,t)=>e===t||mf(e)===mf(t)&&gf(e,(e,n)=>(e!==void 0||_f(t,n))&&lf(t[n],e)),yf=Object.freeze,bf=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&bf(e[t])}return yf(e)},xf=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&xf(e,t,n+1)}},Sf=e=>e,Cf=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[cf]!=null)return e[cf](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!Cf(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(mf(e)!==mf(t))return!1;for(let n in e)if(!_f(e,n)||!Cf(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Cf(e[n],t[n]))return!1;break;default:return!1}return!0},wf=(e,t)=>t.includes(e),Tf=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,Ef=typeof window<`u`&&typeof document<`u`&&!Tf;typeof navigator<`u`&&/Mac/.test(navigator.platform);var Df,Of=[],kf=()=>{if(Df===void 0)if(Tf){Df=cu();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&Df.set(t,``),t=r):t===null?Of.push(r):(Df.set(t,r),t=null)}t!==null&&Df.set(t,``)}else typeof location==`object`?(Df=cu(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);Df.set(`--${Yu(t,`-`)}`,n),Df.set(`-${Yu(t,`-`)}`,n)}})):Df=cu();return Df},Af=e=>kf().has(e),jf=e=>af(Tf?{}[e.toUpperCase().replaceAll(`-`,`_`)]:sf.getItem(e)),Mf=e=>Af(`--`+e)||jf(e)!==null,Nf=Mf(`production`),Pf=Tf&&wf({}.FORCE_COLOR,[`true`,`1`,`2`])||!Af(`--no-colors`)&&!Mf(`no-color`)&&(!Tf||process.stdout.isTTY)&&(!Tf||Af(`--color`)||jf(`COLORTERM`)!==null||(jf(`TERM`)||``).includes(`color`)),Ff=e=>new Uint8Array(e),If=Ef?e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=Wu(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),Lf=e=>{let t=Ff(e.byteLength);return t.set(e),t},Rf=e=>rd(t=>Sd(t,e)),zf=class{constructor(e,t){this.left=e,this.right=t}},Bf=(e,t)=>new zf(e,t),Vf=(e,t)=>e.forEach(e=>t(e.left,e.right)),Hf=e=>e.next()>=.5,Uf=(e,t,n)=>Cu(e.next()*(n+1-t)+t),Wf=(e,t,n)=>Cu(e.next()*(n+1-t)+t),Gf=(e,t,n)=>Wf(e,t,n),Kf=e=>Wu(Gf(e,97,122)),qf=(e,t=0,n=20)=>{let r=Gf(e,t,n),i=``;for(let t=0;t<r;t++)i+=Kf(e);return i},Jf=(e,t)=>t[Gf(e,0,t.length-1)],Yf=Symbol(`0schema`),Xf=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(ed(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
2
+ import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{a as r,i,o as a,r as o,t as s}from"./compiler-runtime-Cs91PcD2.js";import{$ as c,$n as l,$r as u,$t as d,Ai as f,An as p,Ar as m,B as h,Bt as g,Cn as _,Cr as v,D as y,Di as b,Dr as x,Ei as S,Er as C,F as w,Fi as T,Fn as E,Ft as D,Gi as O,Gn as k,Gr as A,Gt as j,H as M,Hr as N,Ht as P,I as F,In as I,Ir as L,J as ee,Ji as R,K as z,Ki as B,Kn as V,Kt as H,M as U,Mi as te,Mn as ne,Mr as re,Mt as ie,N as ae,Ni as W,Nn as oe,Nr as se,Nt as G,O as ce,Oi as le,Or as ue,Pi as de,Pn as fe,Pr as pe,Q as me,Qr as he,Qt as ge,R as _e,Rt as ve,Si as ye,Sn as be,Sr as xe,St as Se,T as Ce,Ti as we,Tn as Te,Tr as Ee,U as De,Ui as Oe,Ut as ke,V as Ae,Vr as je,Vt as Me,Wi as Ne,Wn as Pe,Wr as Fe,Xn as Ie,Xt as Le,Yi as Re,Yn as ze,Yt as Be,Z as Ve,Zi as He,Zn as Ue,Zt as We,_i as Ge,_n as Ke,_r as qe,_t as Je,ai as Ye,an as Xe,ar as Ze,at as Qe,bi as $e,bn as et,br as tt,ci as nt,cn as rt,cr as it,d as at,dr as ot,dt as st,ei as ct,en as lt,et as ut,f as dt,fr as ft,ft as pt,gn as mt,gr as ht,gt,hr as _t,i as vt,ii as yt,ir as bt,j as xt,ji as St,jr as Ct,ki as wt,kr as Tt,l as Et,li as Dt,lr as Ot,lt as kt,mi as At,mr as jt,mt as Mt,oi as Nt,on as Pt,p as Ft,pi as It,pn as Lt,pr as Rt,pt as zt,q as Bt,qi as Vt,qr as Ht,r as Ut,ri as Wt,rn as Gt,rr as Kt,s as qt,si as Jt,sn as Yt,sr as Xt,ti as Zt,tr as Qt,ui as $t,ur as en,ut as tn,v as nn,vi as rn,vn as an,vt as on,wi as sn,wt as cn,xi as ln,xt as un,y as dn,yi as fn,yn as pn,yr as mn,yt as hn,z as gn,zr as _n}from"./prop-types-mM2mU4oh.js";import{C as K,S as vn,_ as yn,a as bn,b as xn,c as Sn,d as Cn,g as wn,i as Tn,l as En,m as Dn,o as On,p as kn,r as An,s as jn,t as Mn,u as Nn,w as Pn,x as Fn,y as In}from"./button-DenIdY-r.js";import{_ as Ln,a as Rn,b as zn,c as Bn,d as Vn,f as Hn,g as Un,h as Wn,i as Gn,l as Kn,m as qn,n as Jn,o as Yn,p as Xn,r as Zn,s as Qn,t as $n,u as er,x as tr,y as nr}from"./dialog-B1es0EvU.js";import{a as rr,i as ir,n as ar,r as or,t as sr}from"./collapsible-BhpeB6tu.js";import{t as cr}from"./trace-api-CiCjX4Sz.js";import{n as lr,t as ur}from"./propagation-api-3kmMXRwS.js";import{n as dr,t as fr}from"./dist-DicqJavT.js";import{A as pr,At as mr,B as hr,Bt as gr,C as _r,Ct as vr,D as yr,Dt as br,E as xr,Et as Sr,F as Cr,Ft as wr,G as Tr,H as Er,Ht as Dr,It as Or,J as kr,K as Ar,L as jr,Lt as Mr,M as Nr,Mt as Pr,N as Fr,O as Ir,Ot as Lr,P as Rr,Pt as zr,Q as Br,R as q,S as Vr,St as Hr,T as Ur,Tt as Wr,U as Gr,V as Kr,Vt as qr,W as Jr,X as Yr,Y as Xr,a as Zr,b as Qr,c as $r,d as ei,dt as ti,f as ni,g as ri,i as ii,j as ai,l as oi,m as si,n as ci,o as li,p as ui,q as di,r as fi,s as pi,t as mi,u as hi,ut as gi,v as _i,x as vi,xt as yi}from"./dist-Du-s1q8P.js";import{i as bi,n as xi,r as Si,t as Ci}from"./dist-BYGzJeLM.js";import{a as wi,c as Ti,s as Ei,t as Di}from"./dist-BrsSsfiw.js";import{n as Oi}from"./dist-DsbVHLNy.js";import{n as ki}from"./dist-Cq1LYbUj.js";import{t as Ai}from"./stex-CzCFWeB9.js";(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var ji=K(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),Mi=K(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ni=K(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Pi=K(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Fi=K(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Ii=K(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Li=K(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Ri=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),zi=K(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Bi=K(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Vi=K(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Hi=K(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ui=K(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Wi=K(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Gi=K(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ki=K(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),qi=K(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ji=K(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Yi=K(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Xi=K(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Zi=K(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Qi=K(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),$i=K(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ea=K(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),ta=K(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),na=K(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),ra=K(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),ia=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),aa=K(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),oa=K(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),sa=K(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),ca=K(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),la=K(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),ua=K(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),da=K(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),fa=K(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),pa=K(`layout-panel-top`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),ma=K(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ha=K(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),ga=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],_a=K(`link-2`,ga),va=K(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),ya=K(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),ba=K(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),xa=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Sa=K(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),Ca=K(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),wa=K(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Ta=K(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Ea=K(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Da=K(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Oa=K(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),ka=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Aa=K(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),ja=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ma=K(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Na=K(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Pa=K(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),Fa=K(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Ia=K(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),La=K(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),Ra=K(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),za=K(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),Ba=K(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),Va=K(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),Ha=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ua=K(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Wa=K(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Ga=K(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Ka=K(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),qa=K(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Ja=K(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),J=s(),Y=e(r(),1);function Ya(e,t){let n=(0,J.c)(7),r,i;n[0]!==e||n[1]!==t?(r=()=>{if(t!==`light`&&t!==`dark`&&t!==`system`||!e)return;let n=!1;return e.setThemeSource(t).catch(e=>{console.warn(JSON.stringify({event:`theme-source-set-failed`,themeValue:t,error:e instanceof Error?e.message:String(e)}))}).finally(()=>{if(n)return;let t=window.matchMedia(`(prefers-reduced-transparency: reduce)`).matches;e.signalThemeApplied({reducedTransparency:t})}),()=>{n=!0}},i=[e,t],n[0]=e,n[1]=t,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,Y.useEffect)(r,i);let a,o;n[4]===e?(a=n[5],o=n[6]):(a=()=>{if(!e)return;let t=window.matchMedia(`(prefers-reduced-transparency: reduce)`),n=t=>{e.signalThemeApplied({reducedTransparency:t.matches})};return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}},o=[e],n[4]=e,n[5]=a,n[6]=o),(0,Y.useEffect)(a,o)}var Xa=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Za=t(((e,t)=>{t.exports=Xa()})),X=a(),Qa=e(Pn(),1);function $a(e,[t,n]){return Math.min(n,Math.max(t,e))}var eo=`Popover`,[to,no]=kn(eo,[De]),ro=De(),[io,ao]=to(eo),oo=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ro(t),c=Y.useRef(null),[l,u]=Y.useState(!1),[d,f]=En({prop:r,defaultProp:i??!1,onChange:a,caller:eo});return(0,X.jsx)(M,{...s,children:(0,X.jsx)(io,{scope:t,contentId:jn(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:Y.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:Y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:Y.useCallback(()=>u(!1),[]),modal:o,children:n})})};oo.displayName=eo;var so=`PopoverAnchor`,co=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ao(so,n),a=ro(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return Y.useEffect(()=>(o(),()=>s()),[o,s]),(0,X.jsx)(gn,{...a,...r,ref:t})});co.displayName=so;var lo=`PopoverTrigger`,uo=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ao(lo,n),a=ro(n),o=xn(t,i.triggerRef),s=(0,X.jsx)(Dn.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Eo(i.open),...r,ref:o,onClick:Cn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,X.jsx)(gn,{asChild:!0,...a,children:s})});uo.displayName=lo;var fo=`PopoverPortal`,[po,mo]=to(fo,{forceMount:void 0}),ho=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ao(fo,t);return(0,X.jsx)(po,{scope:t,forceMount:n,children:(0,X.jsx)(Sn,{present:n||a.open,children:(0,X.jsx)(Tn,{asChild:!0,container:i,children:r})})})};ho.displayName=fo;var go=`PopoverContent`,_o=Y.forwardRef((e,t)=>{let n=mo(go,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ao(go,e.__scopePopover);return(0,X.jsx)(Sn,{present:r||a.open,children:a.modal?(0,X.jsx)(yo,{...i,ref:t}):(0,X.jsx)(bo,{...i,ref:t})})});_o.displayName=go;var vo=yn(`PopoverContent.RemoveScroll`),yo=Y.forwardRef((e,t)=>{let n=ao(go,e.__scopePopover),r=Y.useRef(null),i=xn(t,r),a=Y.useRef(!1);return Y.useEffect(()=>{let e=r.current;if(e)return qn(e)},[]),(0,X.jsx)(Wn,{as:vo,allowPinchZoom:!0,children:(0,X.jsx)(xo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Cn(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Cn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Cn(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),bo=Y.forwardRef((e,t)=>{let n=ao(go,e.__scopePopover),r=Y.useRef(!1),i=Y.useRef(!1);return(0,X.jsx)(xo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),xo=Y.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ao(go,n),p=ro(n);return Un(),(0,X.jsx)(Ln,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,X.jsx)(bn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,X.jsx)(Ae,{"data-state":Eo(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),So=`PopoverClose`,Co=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ao(So,n);return(0,X.jsx)(Dn.button,{type:`button`,...r,ref:t,onClick:Cn(e.onClick,()=>i.onOpenChange(!1))})});Co.displayName=So;var wo=`PopoverArrow`,To=Y.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ro(n);return(0,X.jsx)(h,{...i,...r,ref:t})});To.displayName=wo;function Eo(e){return e?`open`:`closed`}var Do=oo,Oo=co,ko=uo,Ao=ho,jo=_o,Mo=[` `,`Enter`,`ArrowUp`,`ArrowDown`],No=[` `,`Enter`],Po=`Select`,[Fo,Io,Lo]=dr(Po),[Ro,zo]=kn(Po,[Lo,De]),Bo=De(),[Vo,Ho]=Ro(Po),[Uo,Wo]=Ro(Po),Go=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=Bo(t),[g,_]=Y.useState(null),[v,y]=Y.useState(null),[b,x]=Y.useState(!1),S=fr(l),[C,w]=En({prop:r,defaultProp:i??!1,onChange:a,caller:Po}),[T,E]=En({prop:o,defaultProp:s,onChange:c,caller:Po}),D=Y.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=Y.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,X.jsx)(M,{...h,children:(0,X.jsxs)(Vo,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:jn(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,X.jsx)(Fo.Provider,{scope:t,children:(0,X.jsx)(Uo,{scope:e.__scopeSelect,onNativeOptionAdd:Y.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:Y.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,X.jsxs)(Bs,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,X.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};Go.displayName=Po;var Ko=`SelectTrigger`,qo=Y.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Bo(n),o=Ho(Ko,n),s=o.disabled||r,c=xn(t,o.onTriggerChange),l=Io(n),u=Y.useRef(`touch`),[d,f,p]=Hs(e=>{let t=l().filter(e=>!e.disabled),n=Us(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,X.jsx)(gn,{asChild:!0,...a,children:(0,X.jsx)(Dn.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Vs(o.value)?``:void 0,...i,ref:c,onClick:Cn(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Cn(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:Cn(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Mo.includes(e.key)&&(m(),e.preventDefault())})})})});qo.displayName=Ko;var Jo=`SelectValue`,Yo=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Ho(Jo,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=xn(t,c.onValueNodeChange);return Nn(()=>{l(u)},[l,u]),(0,X.jsx)(Dn.span,{...s,ref:d,style:{pointerEvents:`none`},children:Vs(c.value)?(0,X.jsx)(X.Fragment,{children:o}):a})});Yo.displayName=Jo;var Xo=`SelectIcon`,Zo=Y.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,X.jsx)(Dn.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Zo.displayName=Xo;var Qo=`SelectPortal`,$o=e=>(0,X.jsx)(Tn,{asChild:!0,...e});$o.displayName=Qo;var es=`SelectContent`,ts=Y.forwardRef((e,t)=>{let n=Ho(es,e.__scopeSelect),[r,i]=Y.useState();if(Nn(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Qa.createPortal((0,X.jsx)(rs,{scope:e.__scopeSelect,children:(0,X.jsx)(Fo.Slot,{scope:e.__scopeSelect,children:(0,X.jsx)(`div`,{children:e.children})})}),t):null}return(0,X.jsx)(ss,{...e,ref:t})});ts.displayName=es;var ns=10,[rs,is]=Ro(es),as=`SelectContentImpl`,os=yn(`SelectContent.RemoveScroll`),ss=Y.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=Ho(es,n),[y,b]=Y.useState(null),[x,S]=Y.useState(null),C=xn(t,e=>b(e)),[w,T]=Y.useState(null),[E,D]=Y.useState(null),O=Io(n),[k,A]=Y.useState(!1),j=Y.useRef(!1);Y.useEffect(()=>{if(y)return qn(y)},[y]),Un();let M=Y.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=Y.useCallback(()=>M([w,y]),[M,w,y]);Y.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;Y.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),Y.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[I,L]=Hs(e=>{let t=O().filter(e=>!e.disabled),n=Us(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ee=Y.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),R=Y.useCallback(()=>y?.focus(),[y]),z=Y.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),B=r===`popper`?ds:ls,V=B===ds?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,X.jsx)(rs,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ee,selectedItem:w,onItemLeave:R,itemTextRefCallback:z,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:I,children:(0,X.jsx)(Wn,{as:os,allowPinchZoom:!0,children:(0,X.jsx)(Ln,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Cn(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,X.jsx)(bn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,X.jsx)(B,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...V,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Cn(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&L(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});ss.displayName=as;var cs=`SelectItemAlignedPosition`,ls=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Ho(es,n),o=is(es,n),[s,c]=Y.useState(null),[l,u]=Y.useState(null),d=xn(t,e=>u(e)),f=Io(n),p=Y.useRef(!1),m=Y.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=Y.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ns,d=$a(a,[ns,Math.max(ns,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ns,d=$a(a,[ns,Math.max(ns,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-ns*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-ns,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${ns}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Nn(()=>y(),[y]);let[b,x]=Y.useState();return Nn(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,X.jsx)(fs,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:Y.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,X.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,X.jsx)(Dn.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});ls.displayName=cs;var us=`SelectPopperPosition`,ds=Y.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=ns,...a}=e,o=Bo(n);return(0,X.jsx)(Ae,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ds.displayName=us;var[fs,ps]=Ro(es,{}),ms=`SelectViewport`,hs=Y.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=is(ms,n),o=ps(ms,n),s=xn(t,a.onViewportChange),c=Y.useRef(0);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,X.jsx)(Fo.Slot,{scope:n,children:(0,X.jsx)(Dn.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Cn(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-ns*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});hs.displayName=ms;var gs=`SelectGroup`,[_s,vs]=Ro(gs),ys=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=jn();return(0,X.jsx)(_s,{scope:n,id:i,children:(0,X.jsx)(Dn.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});ys.displayName=gs;var bs=`SelectLabel`,xs=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=vs(bs,n);return(0,X.jsx)(Dn.div,{id:i.id,...r,ref:t})});xs.displayName=bs;var Ss=`SelectItem`,[Cs,ws]=Ro(Ss),Ts=Y.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Ho(Ss,n),c=is(Ss,n),l=s.value===r,[u,d]=Y.useState(a??``),[f,p]=Y.useState(!1),m=xn(t,e=>c.itemRefCallback?.(e,r,i)),h=jn(),g=Y.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,X.jsx)(Cs,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:Y.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,X.jsx)(Fo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,X.jsx)(Dn.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:Cn(o.onFocus,()=>p(!0)),onBlur:Cn(o.onBlur,()=>p(!1)),onClick:Cn(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Cn(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Cn(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Cn(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Cn(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Cn(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(No.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});Ts.displayName=Ss;var Es=`SelectItemText`,Ds=Y.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Ho(Es,n),s=is(Es,n),c=ws(Es,n),l=Wo(Es,n),[u,d]=Y.useState(null),f=xn(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=Y.useMemo(()=>(0,X.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Nn(()=>(h(m),()=>g(m)),[h,g,m]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Dn.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Qa.createPortal(a.children,o.valueNode):null]})});Ds.displayName=Es;var Os=`SelectItemIndicator`,ks=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ws(Os,n).isSelected?(0,X.jsx)(Dn.span,{"aria-hidden":!0,...r,ref:t}):null});ks.displayName=Os;var As=`SelectScrollUpButton`,js=Y.forwardRef((e,t)=>{let n=is(As,e.__scopeSelect),r=ps(As,e.__scopeSelect),[i,a]=Y.useState(!1),o=xn(t,r.onScrollButtonChange);return Nn(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,X.jsx)(Ps,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});js.displayName=As;var Ms=`SelectScrollDownButton`,Ns=Y.forwardRef((e,t)=>{let n=is(Ms,e.__scopeSelect),r=ps(Ms,e.__scopeSelect),[i,a]=Y.useState(!1),o=xn(t,r.onScrollButtonChange);return Nn(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,X.jsx)(Ps,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Ns.displayName=Ms;var Ps=Y.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=is(`SelectScrollButton`,n),o=Y.useRef(null),s=Io(n),c=Y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return Y.useEffect(()=>()=>c(),[c]),Nn(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,X.jsx)(Dn.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Cn(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Cn(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Cn(i.onPointerLeave,()=>{c()})})}),Fs=`SelectSeparator`,Is=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,X.jsx)(Dn.div,{"aria-hidden":!0,...r,ref:t})});Is.displayName=Fs;var Ls=`SelectArrow`,Rs=Y.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Bo(n),a=Ho(Ls,n),o=is(Ls,n);return a.open&&o.position===`popper`?(0,X.jsx)(h,{...i,...r,ref:t}):null});Rs.displayName=Ls;var zs=`SelectBubbleInput`,Bs=Y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=Y.useRef(null),a=xn(r,i),o=Kn(t);return Y.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,X.jsx)(Dn.select,{...n,style:{...ut,...n.style},ref:a,defaultValue:t})});Bs.displayName=zs;function Vs(e){return e===``||e===void 0}function Hs(e){let t=On(e),n=Y.useRef(``),r=Y.useRef(0),i=Y.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=Y.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return Y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Us(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ws(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ws(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gs=Go,Ks=qo,qs=Yo,Js=Zo,Ys=$o,Xs=ts,Zs=hs,Qs=Ts,$s=Ds,ec=ks,tc=js,nc=Ns,rc=`Switch`,[ic,ac]=kn(rc),[oc,sc]=ic(rc),cc=Y.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=Y.useState(null),m=xn(t,e=>p(e)),h=Y.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=En({prop:i,defaultProp:a??!1,onChange:l,caller:rc});return(0,X.jsxs)(oc,{scope:n,checked:_,disabled:s,children:[(0,X.jsx)(Dn.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":pc(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:Cn(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,X.jsx)(fc,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});cc.displayName=rc;var lc=`SwitchThumb`,uc=Y.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=sc(lc,n);return(0,X.jsx)(Dn.span,{"data-state":pc(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});uc.displayName=lc;var dc=`SwitchBubbleInput`,fc=Y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=Y.useRef(null),s=xn(o,a),c=Kn(n),l=An(t);return Y.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,X.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});fc.displayName=dc;function pc(e){return e?`checked`:`unchecked`}var mc=cc,hc=uc;function gc(e){return e.kind===`doc`?e.docPath:e.folderPath}var _c=Fn(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3! font-mono uppercase`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,warning:`bg-yellow-500/10 text-yellow-600 [a]:hover:bg-yellow-500/20`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,dashed:`border-dashed border-border text-muted-foreground rounded-sm`,primary:`border border-primary/50 text-primary bg-primary/5 rounded-sm p-0.5 px-1.5 font-mono`,gray:`border border-border text-muted-foreground bg-muted rounded-sm p-0.5 px-1.5 font-mono`}},defaultVariants:{variant:`default`}});function vc(e){let t=(0,J.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?wn:`span`,c;t[5]!==n||t[6]!==o?(c=vn(_c({variant:o}),n),t[5]=n,t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==r||t[10]!==c||t[11]!==o?(l=(0,X.jsx)(s,{"data-slot":`badge`,"data-variant":o,className:c,...r}),t[8]=s,t[9]=r,t[10]=c,t[11]=o,t[12]=l):l=t[12],l}function yc(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Do,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function bc(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(ko,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function xc(e){let t=(0,J.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`center`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=vn(`z-50 w-72 rounded-lg border bg-popover p-4 text-popover-foreground shadow-md outline-hidden origin-(--radix-popover-content-transform-origin) duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,X.jsx)(Ao,{children:(0,X.jsx)(jo,{"data-slot":`popover-content`,align:o,sideOffset:s,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Sc(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Oo,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}var Cc={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.9.1`}?.VITE_APP_VERSION??`0.0.0-unknown`;function wc(){return E({kind:`web`,runtimeVersion:Cc})}function Tc(){return I({kind:`web`,runtimeVersion:Cc})}function Ec(e,t){return t}function Dc(e){let t=e.split(`/`);return t.length<2?`ok`:`${t[0]}/${t[1]}`}function Oc(e){if(!e)return;let t=Object.entries(e);if(t.length!==0)return t.map(([e,t])=>{if(t==null)return[e,String(t)];if(typeof t==`string`)return[e,t];if(typeof t==`number`||typeof t==`boolean`)return[e,String(t)];try{return[e,JSON.stringify(t)]}catch{return[e,`[unserializable]`]}})}function kc(e,t,n){if(typeof performance>`u`||!performance.measure)return;let r=Dc(e),i=Oc(t),a={devtools:{dataType:`track-entry`,track:r,...i?{properties:i}:{},...n?.tooltipText?{tooltipText:n.tooltipText}:{}}},o=performance.now(),s=n?.startTime??o,c=n?.duration??Math.max(0,o-s);try{performance.measure(e,{start:s,duration:c,detail:a})}catch{}({...t?{properties:t}:{}})}function Ac(e,t){}function jc(e,t,n){kc(e,{...t,durationMs:n},{duration:n})}var Z=Object.assign(kc,{count:Ac,histogram:jc});function Mc(e){let t=(0,J.c)(3),{name:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(Y.Profiler,{id:n,onRender:Nc,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}var Nc=(e,t,n,r,i,a)=>{Z(`ok/render/${e}`,{phase:t,actualDuration:Math.round(n*1e3)/1e3,baseDuration:Math.round(r*1e3)/1e3},{startTime:i,duration:Math.max(0,a-i)})},{getOwnPropertyNames:Pc,getOwnPropertySymbols:Fc}=Object,{hasOwnProperty:Ic}=Object.prototype;function Lc(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Rc(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function zc(e){return e?.[Symbol.toStringTag]}function Bc(e){return Pc(e).concat(Fc(e))}var Vc=Object.hasOwn||((e,t)=>Ic.call(e,t));function Hc(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Uc=`__v`,Wc=`__o`,Gc=`_owner`,{getOwnPropertyDescriptor:Kc,keys:qc}=Object;function Jc(e,t){return e.byteLength===t.byteLength&&sl(new Uint8Array(e),new Uint8Array(t))}function Yc(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Xc(e,t){return e.byteLength===t.byteLength&&sl(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Zc(e,t){return Hc(e.getTime(),t.getTime())}function Qc(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function $c(e,t){return e===t}function el(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var tl=Hc;function nl(e,t,n){let r=qc(e),i=r.length;if(qc(t).length!==i)return!1;for(;i-- >0;)if(!ll(e,t,n,r[i]))return!1;return!0}function rl(e,t,n){let r=Bc(e),i=r.length;if(Bc(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!ll(e,t,n,a)||(o=Kc(e,a),s=Kc(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function il(e,t){return Hc(e.valueOf(),t.valueOf())}function al(e,t){return e.source===t.source&&e.flags===t.flags}function ol(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function sl(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function cl(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function ll(e,t,n,r){return(r===Gc||r===Wc||r===Uc)&&(e.$$typeof||t.$$typeof)?!0:Vc(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var ul=`[object ArrayBuffer]`,dl=`[object Arguments]`,fl=`[object Boolean]`,pl=`[object DataView]`,ml=`[object Date]`,hl=`[object Error]`,gl=`[object Map]`,_l=`[object Number]`,vl=`[object Object]`,yl=`[object RegExp]`,bl=`[object Set]`,xl=`[object String]`,Sl={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Cl=`[object URL]`,wl=Object.prototype.toString;function Tl({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=wl.call(h);if(b===ml)return r(h,g,_);if(b===yl)return u(h,g,_);if(b===gl)return o(h,g,_);if(b===bl)return d(h,g,_);if(b===vl)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Cl)return p(h,g,_);if(b===hl)return i(h,g,_);if(b===dl)return c(h,g,_);if(Sl[b])return f(h,g,_);if(b===ul)return e(h,g,_);if(b===pl)return n(h,g,_);if(b===fl||b===_l||b===xl)return l(h,g,_);if(m){let e=m[b];if(!e){let t=zc(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function El({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Jc,areArraysEqual:n?rl:Yc,areDataViewsEqual:Xc,areDatesEqual:Zc,areErrorsEqual:Qc,areFunctionsEqual:$c,areMapsEqual:n?Lc(el,rl):el,areNumbersEqual:tl,areObjectsEqual:n?rl:nl,arePrimitiveWrappersEqual:il,areRegExpsEqual:al,areSetsEqual:n?Lc(ol,rl):ol,areTypedArraysEqual:n?Lc(sl,rl):sl,areUrlsEqual:cl,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Rc(r.areArraysEqual),t=Rc(r.areMapsEqual),n=Rc(r.areObjectsEqual),i=Rc(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Dl(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Ol({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var kl=Al();Al({strict:!0}),Al({circular:!0}),Al({circular:!0,strict:!0}),Al({createInternalComparator:()=>Hc}),Al({strict:!0,createInternalComparator:()=>Hc}),Al({circular:!0,createInternalComparator:()=>Hc}),Al({circular:!0,createInternalComparator:()=>Hc,strict:!0});function Al(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Tl(El(e));return Ol({circular:t,comparator:a,createState:r,equals:n?n(a):Dl(a),strict:i})}var jl=t((e=>{var t=r(),n=Za();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Ml=t(((e,t)=>{t.exports=jl()})),Nl=Za(),Pl=Ml(),Fl=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Il=({contentComponent:e})=>{let t=(0,Nl.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,X.jsx)(X.Fragment,{children:Object.values(t)})};function Ll(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:Qa.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var Rl=class extends Y.Component{constructor(e){super(e),this.editorContentRef=Y.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=Ll(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{ref:Fl(t,this.editorContentRef),...n}),e?.contentComponent&&(0,X.jsx)(Il,{contentComponent:e.contentComponent})]})}},zl=(0,Y.forwardRef)((e,t)=>{let n=Y.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Y.createElement(Rl,{key:n,innerRef:t,...e})}),Bl=Y.memo(zl),Vl=typeof window<`u`?Y.useLayoutEffect:Y.useEffect,Hl=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function Ul(e){let[t]=(0,Y.useState)(()=>new Hl(e.editor)),n=(0,Pl.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??kl);return Vl(()=>t.watch(e.editor),[e.editor,t]),(0,Y.useDebugValue)(n),n}typeof window>`u`||typeof window<`u`&&window.next;var Wl=(0,Y.createContext)({editor:null});Wl.Consumer;var Gl=()=>(0,Y.useContext)(Wl),Kl=(0,Y.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ql=()=>(0,Y.useContext)(Kl);function Jl({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=ql();return(0,X.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var Yl=Y.forwardRef((e,t)=>{let{onDragStart:n}=ql();return(0,X.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function Xl(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function Zl(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function Ql(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function $l(e){if(Xl(e)||Zl(e))return!0;if(Ql(e)){let t=e.type;if(t)return Xl(t)||Zl(t)}return!1}function eu(){try{if(Y.version)return parseInt(Y.version.split(`.`)[0],10)>=19}catch{}return!1}var tu=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,Qa.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=eu(),a=$l(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,X.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};Y.createContext({markViewContentRef:()=>{}});var nu=class extends Ye{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,Y.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,Y.memo)(e=>(0,X.jsx)(Kl.Provider,{value:t,children:(0,Y.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new tu(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},fn(this.editor,this.positionCheckCallback)}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:t}=this.editor.state.selection,n=this.currentPos;if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}let i=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?i===this.currentPos?!0:(this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()}),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.positionCheckCallback&&=(Nt(this.editor,this.positionCheckCallback),null),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=Dt(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function ru(e,t){return n=>n.editor.contentComponent?new nu(e,n,t):{}}var iu=(0,Y.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});iu.displayName=`TiptapContext`;var au=()=>(0,Y.useContext)(iu);function ou({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,Y.useMemo)(()=>({editor:r}),[r]),a=(0,Y.useMemo)(()=>({editor:r}),[r]);return(0,X.jsx)(Wl.Provider,{value:a,children:(0,X.jsx)(iu.Provider,{value:i,children:n})})}ou.displayName=`Tiptap`;function su({...e}){let{editor:t}=au();return(0,X.jsx)(Bl,{editor:t,...e})}su.displayName=`Tiptap.Content`,Object.assign(ou,{Content:su});var cu=()=>new Map,lu=e=>{let t=cu();return e.forEach((e,n)=>{t.set(n,e)}),t},uu=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},du=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},fu=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},pu=()=>new Set,mu=e=>e[e.length-1],hu=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},gu=Array.from,_u=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},vu=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},yu=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},bu=Array.isArray,xu=class{constructor(){this._observers=cu()}on(e,t){return uu(this._observers,e,pu).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return gu((this._observers.get(e)||cu()).values()).forEach(e=>e(...t))}destroy(){this._observers=cu()}},Su=class{constructor(){this._observers=cu()}on(e,t){uu(this._observers,e,pu).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return gu((this._observers.get(e)||cu()).values()).forEach(e=>e(...t))}destroy(){this._observers=cu()}},Cu=Math.floor,wu=Math.abs,Tu=(e,t)=>e<t?e:t,Eu=(e,t)=>e>t?e:t;Number.isNaN;var Du=e=>e===0?1/e<0:e<0,Ou=1<<17,ku=1<<18,Au=1<<19,ju=1<<20,Mu=1<<21,Nu=1<<22,Pu=1<<23,Fu=1<<24,Iu=1<<25,Lu=1<<26,Ru=1<<27,zu=1<<28,Bu=1<<29;Ou-1,ku-1,Au-1,ju-1,Mu-1,Nu-1,Pu-1,Fu-1,Iu-1,Lu-1,Ru-1,zu-1,Bu-1;var Vu=2**53-1,Hu=-(2**53-1),Uu=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&Cu(e)===e);Number.isNaN,Number.parseInt;var Wu=String.fromCharCode;String.fromCodePoint,Wu(65535);var Gu=e=>e.toLowerCase(),Ku=/^\s*/g,qu=e=>e.replace(Ku,``),Ju=/([A-Z])/g,Yu=(e,t)=>qu(e.replace(Ju,e=>`${t}${Gu(e)}`)),Xu=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Zu=typeof TextEncoder<`u`?new TextEncoder:null,Qu=Zu?e=>Zu.encode(e):Xu,$u=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});$u&&$u.decode(new Uint8Array).length===1&&($u=null);var ed=(e,t)=>yu(t,()=>e).join(``),td=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},nd=()=>new td,rd=e=>{let t=nd();return e(t),ad(t)},id=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},ad=e=>{let t=new Uint8Array(id(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},od=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Eu(n,t)*2),e.cpos=0)},sd=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},cd=sd,ld=(e,t)=>{for(;t>127;)sd(e,128|127&t),t=Cu(t/128);sd(e,127&t)},ud=(e,t)=>{let n=Du(t);for(n&&(t=-t),sd(e,(t>63?128:0)|(n?64:0)|63&t),t=Cu(t/64);t>0;)sd(e,(t>127?128:0)|127&t),t=Cu(t/128)},dd=new Uint8Array(3e4),fd=dd.length/3,pd=Zu&&Zu.encodeInto?(e,t)=>{if(t.length<fd){let n=Zu.encodeInto(t,dd).written||0;ld(e,n);for(let t=0;t<n;t++)sd(e,dd[t])}else hd(e,Qu(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;ld(e,r);for(let t=0;t<r;t++)sd(e,n.codePointAt(t))},md=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=Tu(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Eu(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},hd=(e,t)=>{ld(e,t.byteLength),md(e,t)},gd=(e,t)=>{od(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},_d=(e,t)=>gd(e,4).setFloat32(0,t,!1),vd=(e,t)=>gd(e,8).setFloat64(0,t,!1),yd=(e,t)=>gd(e,8).setBigInt64(0,t,!1),bd=new DataView(new ArrayBuffer(4)),xd=e=>(bd.setFloat32(0,e),bd.getFloat32(0)===e),Sd=(e,t)=>{switch(typeof t){case`string`:sd(e,119),pd(e,t);break;case`number`:Uu(t)&&wu(t)<=2147483647?(sd(e,125),ud(e,t)):xd(t)?(sd(e,124),_d(e,t)):(sd(e,123),vd(e,t));break;case`bigint`:sd(e,122),yd(e,t);break;case`object`:if(t===null)sd(e,126);else if(bu(t)){sd(e,117),ld(e,t.length);for(let n=0;n<t.length;n++)Sd(e,t[n])}else if(t instanceof Uint8Array)sd(e,116),hd(e,t);else{sd(e,118);let n=Object.keys(t);ld(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];pd(e,i),Sd(e,t[i])}}break;case`boolean`:sd(e,t?120:121);break;default:sd(e,127)}},Cd=class extends td{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ld(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},wd=e=>{e.count>0&&(ud(e.encoder,e.count===1?e.s:-e.s),e.count>1&&ld(e.encoder,e.count-2))},Td=class{constructor(){this.encoder=new td,this.s=0,this.count=0}write(e){this.s===e?this.count++:(wd(this),this.count=1,this.s=e)}toUint8Array(){return wd(this),ad(this.encoder)}},Ed=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);ud(e.encoder,t),e.count>1&&ld(e.encoder,e.count-2)}},Dd=class{constructor(){this.encoder=new td,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Ed(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Ed(this),ad(this.encoder)}},Od=class{constructor(){this.sarr=[],this.s=``,this.lensE=new Td}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new td;return this.sarr.push(this.s),this.s=``,pd(e,this.sarr.join(``)),md(e,this.lensE.toUint8Array()),ad(e)}},kd=e=>Error(e),Ad=()=>{throw kd(`Method unimplemented`)},jd=()=>{throw kd(`Unexpected case`)},Md=kd(`Unexpected end of array`),Nd=kd(`Integer out of Range`),Pd=class{constructor(e){this.arr=e,this.pos=0}},Fd=e=>new Pd(e),Id=e=>e.pos!==e.arr.length,Ld=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Rd=e=>Ld(e,Bd(e)),zd=e=>e.arr[e.pos++],Bd=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>Vu)throw Nd}throw Md},Vd=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>Vu)throw Nd}throw Md},Hd=$u?e=>$u.decode(Rd(e)):e=>{let t=Bd(e);if(t===0)return``;{let n=String.fromCodePoint(zd(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(zd(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Ud=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Wd=[e=>void 0,e=>null,Vd,e=>Ud(e,4).getFloat32(0,!1),e=>Ud(e,8).getFloat64(0,!1),e=>Ud(e,8).getBigInt64(0,!1),e=>!1,e=>!0,Hd,e=>{let t=Bd(e),n={};for(let r=0;r<t;r++){let t=Hd(e);n[t]=Gd(e)}return n},e=>{let t=Bd(e),n=[];for(let r=0;r<t;r++)n.push(Gd(e));return n},Rd],Gd=e=>Wd[127-zd(e)](e),Kd=class extends Pd{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Id(this)?this.count=Bd(this)+1:this.count=-1),this.count--,this.s}},qd=class extends Pd{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Vd(this);let e=Du(this.s);this.count=1,e&&(this.s=-this.s,this.count=Bd(this)+2)}return this.count--,this.s}},Jd=class extends Pd{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=Vd(this),t=e&1;this.diff=Cu(e/2),this.count=1,t&&(this.count=Bd(this)+2)}return this.s+=this.diff,this.count--,this.s}},Yd=class{constructor(e){this.decoder=new qd(e),this.str=Hd(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}};crypto.subtle;var Xd=crypto.getRandomValues.bind(crypto),Zd=Math.random,Qd=()=>Xd(new Uint32Array(1))[0],$d=e=>e[Cu(Zd()*e.length)],ef=`10000000-1000-4000-8000-100000000000`,tf=()=>ef.replace(/[018]/g,e=>(e^Qd()&15>>e/4).toString(16)),nf=Date.now,rf=e=>new Promise(e);Promise.all.bind(Promise);var af=e=>e===void 0?null:e,of=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}};try{typeof localStorage<`u`&&localStorage&&(of=localStorage)}catch{}var sf=of,cf=Symbol(`Equality`),lf=(e,t)=>e===t||!!e?.[cf]?.(t)||!1,uf=e=>typeof e==`object`,df=Object.assign,ff=Object.keys,pf=(e,t)=>{for(let n in e)t(e[n],n)},mf=e=>ff(e).length,hf=e=>{for(let t in e)return!1;return!0},gf=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},_f=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),vf=(e,t)=>e===t||mf(e)===mf(t)&&gf(e,(e,n)=>(e!==void 0||_f(t,n))&&lf(t[n],e)),yf=Object.freeze,bf=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&bf(e[t])}return yf(e)},xf=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&xf(e,t,n+1)}},Sf=e=>e,Cf=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[cf]!=null)return e[cf](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!Cf(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(mf(e)!==mf(t))return!1;for(let n in e)if(!_f(e,n)||!Cf(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Cf(e[n],t[n]))return!1;break;default:return!1}return!0},wf=(e,t)=>t.includes(e),Tf=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,Ef=typeof window<`u`&&typeof document<`u`&&!Tf;typeof navigator<`u`&&/Mac/.test(navigator.platform);var Df,Of=[],kf=()=>{if(Df===void 0)if(Tf){Df=cu();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&Df.set(t,``),t=r):t===null?Of.push(r):(Df.set(t,r),t=null)}t!==null&&Df.set(t,``)}else typeof location==`object`?(Df=cu(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);Df.set(`--${Yu(t,`-`)}`,n),Df.set(`-${Yu(t,`-`)}`,n)}})):Df=cu();return Df},Af=e=>kf().has(e),jf=e=>af(Tf?{}[e.toUpperCase().replaceAll(`-`,`_`)]:sf.getItem(e)),Mf=e=>Af(`--`+e)||jf(e)!==null,Nf=Mf(`production`),Pf=Tf&&wf({}.FORCE_COLOR,[`true`,`1`,`2`])||!Af(`--no-colors`)&&!Mf(`no-color`)&&(!Tf||process.stdout.isTTY)&&(!Tf||Af(`--color`)||jf(`COLORTERM`)!==null||(jf(`TERM`)||``).includes(`color`)),Ff=e=>new Uint8Array(e),If=Ef?e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=Wu(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),Lf=e=>{let t=Ff(e.byteLength);return t.set(e),t},Rf=e=>rd(t=>Sd(t,e)),zf=class{constructor(e,t){this.left=e,this.right=t}},Bf=(e,t)=>new zf(e,t),Vf=(e,t)=>e.forEach(e=>t(e.left,e.right)),Hf=e=>e.next()>=.5,Uf=(e,t,n)=>Cu(e.next()*(n+1-t)+t),Wf=(e,t,n)=>Cu(e.next()*(n+1-t)+t),Gf=(e,t,n)=>Wf(e,t,n),Kf=e=>Wu(Gf(e,97,122)),qf=(e,t=0,n=20)=>{let r=Gf(e,t,n),i=``;for(let t=0;t<r;t++)i+=Kf(e);return i},Jf=(e,t)=>t[Gf(e,0,t.length-1)],Yf=Symbol(`0schema`),Xf=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(ed(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
3
3
  `)}},Zf=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[cf]?lf(e,t):bu(e)?_u(e,e=>vu(t,t=>Zf(e,t))):uf(e)?gf(e,(e,n)=>Zf(e,t[n])):!1,Qf=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),Zf(t,n)}equals(e){return this.constructor===e.constructor&&Cf(this.shape,e.shape)}[Yf](){return!0}[cf](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){Ad()}get nullable(){return jp(this,Kp)}get optional(){return new lp(this)}cast(e){return Xp(e,this),e}expect(e){return Xp(e,this),e}},$f=class extends Qf{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},ep=(e,t=null)=>new $f(e,t);ep($f);var tp=class extends Qf{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},np=e=>new tp(e);ep(tp);var rp=class extends Qf{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},ip=(...e)=>new rp(e),ap=ep(rp),op=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),sp=e=>{if(Vp.check(e))return[op(e)];if(ap.check(e))return e.shape.map(e=>e+``);if(Bp.check(e))return[`[+-]?\\d+.?\\d*`];if(Hp.check(e))return[`.*`];if(Mp.check(e))return e.shape.map(sp).flat(1);jd()};ep(class extends Qf{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(sp).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var cp=Symbol(`optional`),lp=class extends Qf{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[cp](){return!0}},up=ep(lp),dp=class extends Qf{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new dp,ep(dp);var fp=class e extends Qf{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):gf(this.shape,(n,r)=>{let i=this._isPartial&&!_f(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},pp=e=>new fp(e),mp=ep(fp),hp=np(e=>e!=null&&(e.constructor===Object||e.constructor==null)),gp=class extends Qf{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&gf(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},_p=(e,t)=>new gp(e,t),vp=ep(gp),yp=class extends Qf{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&gf(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},bp=(...e)=>new yp(e);ep(yp);var xp=class extends Qf{constructor(e){super(),this.shape=e.length===1?e[0]:new Ap(e)}check(e,t){let n=bu(e)&&_u(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},Sp=(...e)=>new xp(e),Cp=ep(xp),wp=np(e=>bu(e)),Tp=class extends Qf{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},Ep=(e,t=null)=>new Tp(e,t);ep(Tp);var Dp=Ep(Qf),Op=ep(class extends Qf{constructor(e){super(),this.len=e.length-1,this.args=bp(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}}),kp=np(e=>typeof e==`function`);ep(class extends Qf{constructor(e){super(),this.shape=e}check(e,t){let n=_u(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var Ap=class extends Qf{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=vu(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},jp=(...e)=>e.findIndex(e=>Mp.check(e))>=0?jp(...e.map(e=>Yp(e)).map(e=>Mp.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new Ap(e),Mp=ep(Ap),Np=()=>!0,Pp=np(Np),Fp=ep(tp,e=>e.shape===Np),Ip=np(e=>typeof e==`bigint`),Lp=np(e=>e===Ip),Rp=np(e=>typeof e==`symbol`);np(e=>e===Rp);var zp=np(e=>typeof e==`number`),Bp=np(e=>e===zp),Vp=np(e=>typeof e==`string`),Hp=np(e=>e===Vp),Up=np(e=>typeof e==`boolean`),Wp=np(e=>e===Up),Gp=ip(void 0);ep(rp,e=>e.shape.length===1&&e.shape[0]===void 0),ip(void 0);var Kp=ip(null),qp=ep(rp,e=>e.shape.length===1&&e.shape[0]===null);ep(Uint8Array),ep($f,e=>e.shape===Uint8Array);var Jp=jp(zp,Vp,Kp,Gp,Ip,Up,Rp);(()=>{let e=Sp(Pp),t=_p(Vp,Pp),n=jp(zp,Vp,Kp,Up,e,t);return e.shape=n,t.shape.values=n,n})();var Yp=e=>{if(Dp.check(e))return e;if(hp.check(e)){let t={};for(let n in e)t[n]=Yp(e[n]);return pp(t)}else if(wp.check(e))return jp(...e.map(Yp));else if(Jp.check(e))return ip(e);else if(kp.check(e))return ep(e);jd()},Xp=Nf?()=>{}:(e,t)=>{let n=new Xf;if(!t.check(e,n))throw kd(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},Zp=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:Yp(e),h:t}),this}else(e){return this.if(Pp,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw kd(`Unhandled pattern`)}}},Qp=(e=>new Zp(e))(Pp).if(Bp,(e,t)=>Uf(t,Hu,Vu)).if(Hp,(e,t)=>qf(t)).if(Wp,(e,t)=>Hf(t)).if(Lp,(e,t)=>BigInt(Uf(t,Hu,Vu))).if(Mp,(e,t)=>$p(t,Jf(t,e.shape))).if(mp,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(up.check(i)){if(Hf(t))continue;i=i.shape}n[r]=Qp(i,t)}return n}).if(Cp,(e,t)=>{let n=[],r=Wf(t,0,42);for(let i=0;i<r;i++)n.push($p(t,e.shape));return n}).if(ap,(e,t)=>Jf(t,e.shape)).if(qp,(e,t)=>null).if(Op,(e,t)=>{let n=$p(t,e.res);return()=>n}).if(Fp,(e,t)=>$p(t,Jf(t,[zp,Vp,Kp,Gp,Ip,Up,Sp(zp),_p(jp(`a`,`b`,`c`),zp)]))).if(vp,(e,t)=>{let n={},r=Uf(t,0,3);for(let i=0;i<r;i++){let r=$p(t,e.shape.keys);n[r]=$p(t,e.shape.values)}return n}).done(),$p=(e,t)=>Qp(Yp(t),e),em=typeof document<`u`?document:{},tm=e=>em.createElement(e),nm=()=>em.createDocumentFragment();np(e=>e.nodeType===mm);var rm=e=>em.createTextNode(e);typeof DOMParser<`u`&&new DOMParser;var im=(e,t)=>(Vf(t,(t,n)=>{n===!1?e.removeAttribute(t):n===!0?e.setAttribute(t,``):e.setAttribute(t,n)}),e),am=e=>{let t=nm();for(let n=0;n<e.length;n++)um(t,e[n]);return t},om=(e,t)=>(um(e,am(t)),e),sm=(e,t=[],n=[])=>om(im(tm(e),t),n);np(e=>e.nodeType===dm);var cm=rm;np(e=>e.nodeType===fm);var lm=e=>du(e,(e,t)=>`${t}:${e};`).join(``),um=(e,t)=>e.appendChild(t),dm=em.ELEMENT_NODE,fm=em.TEXT_NODE;em.CDATA_SECTION_NODE,em.COMMENT_NODE;var pm=em.DOCUMENT_NODE;em.DOCUMENT_TYPE_NODE;var mm=em.DOCUMENT_FRAGMENT_NODE;np(e=>e.nodeType===pm);var hm=(e=>class{constructor(e){this._=e}destroy(){e(this._)}})(clearTimeout),gm=(e,t)=>new hm(setTimeout(t,e)),_m=Symbol,vm=_m(),ym=_m(),bm=_m(),xm=_m(),Sm=_m(),Cm=_m(),wm=_m(),Tm=_m(),Em=_m(),Dm=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n};nf();var Om={[vm]:Bf(`font-weight`,`bold`),[ym]:Bf(`font-weight`,`normal`),[bm]:Bf(`color`,`blue`),[Sm]:Bf(`color`,`green`),[xm]:Bf(`color`,`grey`),[Cm]:Bf(`color`,`red`),[wm]:Bf(`color`,`purple`),[Tm]:Bf(`color`,`orange`),[Em]:Bf(`color`,`black`)},km=Pf?e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=cu(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=Om[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=lm(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i}:Dm,Am=(...e)=>{console.log(...km(e)),Mm.forEach(t=>t.print(e))},jm=(...e)=>{console.warn(...km(e)),e.unshift(Tm),Mm.forEach(t=>t.print(e))},Mm=pu(),Nm=e=>({[Symbol.iterator](){return this},next:e}),Pm=(e,t)=>Nm(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Fm=(e,t)=>Nm(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}),Im=class{constructor(e,t){this.clock=e,this.len=t}},Lm=class{constructor(){this.clients=new Map}},Rm=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])rg(e,i,o.clock,o.len,n)}}),zm=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=Cu((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},Bm=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&zm(n,t.clock)!==null},Vm=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new Im(r.clock,Eu(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},Hm=e=>{let t=new Lm;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)hu(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return Vm(t),t},Um=(e,t,n,r)=>{uu(e.clients,t,()=>[]).push(new Im(n,r))},Wm=()=>new Lm,Gm=e=>{let t=Wm();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new Im(i,a))}}r.length>0&&t.clients.set(n,r)}),t},Km=(e,t)=>{ld(e.restEncoder,t.clients.size),gu(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),ld(e.restEncoder,t);let r=n.length;ld(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},qm=e=>{let t=new Lm,n=Bd(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=Bd(e.restDecoder),r=Bd(e.restDecoder);if(r>0){let i=uu(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new Im(e.readDsClock(),e.readDsLen()))}}return t},Jm=(e,t,n)=>{let r=new Lm,i=Bd(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=Bd(e.restDecoder),a=Bd(e.restDecoder),o=n.clients.get(i)||[],s=Yh(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&Um(r,i,s,a-s);let e=Zh(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,bv(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,bv(t,c,a-c.id.clock)),c.delete(t))}else Um(r,i,n,a-n)}}if(r.clients.size>0){let e=new ih;return ld(e.restEncoder,0),Km(e,r),e.toUint8Array()}return null},Ym=Qd,Xm=class e extends xu{constructor({guid:e=tf(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Ym(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new qh,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=rf(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>rf(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&dg(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(gu(this.subdocs).map(e=>e.guid))}transact(e,t=null){return dg(this,e,t)}get(e,t=Vg){let n=uu(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==Vg&&r!==t)if(r===Vg){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,c_)}getText(e=``){return this.get(e,k_)}getMap(e=``){return this.get(e,d_)}getXmlElement(e=``){return this.get(e,P_)}getXmlFragment(e=``){return this.get(e,M_)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,gu(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,dg(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},Zm=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Bd(this.restDecoder)}readDsLen(){return Bd(this.restDecoder)}},Qm=class extends Zm{readLeftID(){return kh(Bd(this.restDecoder),Bd(this.restDecoder))}readRightID(){return kh(Bd(this.restDecoder),Bd(this.restDecoder))}readClient(){return Bd(this.restDecoder)}readInfo(){return zd(this.restDecoder)}readString(){return Hd(this.restDecoder)}readParentInfo(){return Bd(this.restDecoder)===1}readTypeRef(){return Bd(this.restDecoder)}readLen(){return Bd(this.restDecoder)}readAny(){return Gd(this.restDecoder)}readBuf(){return Lf(Rd(this.restDecoder))}readJSON(){return JSON.parse(Hd(this.restDecoder))}readKey(){return Hd(this.restDecoder)}},$m=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Bd(this.restDecoder),this.dsCurrVal}readDsLen(){let e=Bd(this.restDecoder)+1;return this.dsCurrVal+=e,e}},eh=class extends $m{constructor(e){super(e),this.keys=[],Bd(e),this.keyClockDecoder=new Jd(Rd(e)),this.clientDecoder=new qd(Rd(e)),this.leftClockDecoder=new Jd(Rd(e)),this.rightClockDecoder=new Jd(Rd(e)),this.infoDecoder=new Kd(Rd(e),zd),this.stringDecoder=new Yd(Rd(e)),this.parentInfoDecoder=new Kd(Rd(e),zd),this.typeRefDecoder=new qd(Rd(e)),this.lenDecoder=new qd(Rd(e))}readLeftID(){return new Dh(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Dh(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Gd(this.restDecoder)}readBuf(){return Rd(this.restDecoder)}readJSON(){return Gd(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},th=class{constructor(){this.restEncoder=nd()}toUint8Array(){return ad(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ld(this.restEncoder,e)}writeDsLen(e){ld(this.restEncoder,e)}},nh=class extends th{writeLeftID(e){ld(this.restEncoder,e.client),ld(this.restEncoder,e.clock)}writeRightID(e){ld(this.restEncoder,e.client),ld(this.restEncoder,e.clock)}writeClient(e){ld(this.restEncoder,e)}writeInfo(e){cd(this.restEncoder,e)}writeString(e){pd(this.restEncoder,e)}writeParentInfo(e){ld(this.restEncoder,+!!e)}writeTypeRef(e){ld(this.restEncoder,e)}writeLen(e){ld(this.restEncoder,e)}writeAny(e){Sd(this.restEncoder,e)}writeBuf(e){hd(this.restEncoder,e)}writeJSON(e){pd(this.restEncoder,JSON.stringify(e))}writeKey(e){pd(this.restEncoder,e)}},rh=class{constructor(){this.restEncoder=nd(),this.dsCurrVal=0}toUint8Array(){return ad(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,ld(this.restEncoder,t)}writeDsLen(e){e===0&&jd(),ld(this.restEncoder,e-1),this.dsCurrVal+=e}},ih=class extends rh{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Dd,this.clientEncoder=new Td,this.leftClockEncoder=new Dd,this.rightClockEncoder=new Dd,this.infoEncoder=new Cd(cd),this.stringEncoder=new Od,this.parentInfoEncoder=new Cd(cd),this.typeRefEncoder=new Td,this.lenEncoder=new Td}toUint8Array(){let e=nd();return ld(e,0),hd(e,this.keyClockEncoder.toUint8Array()),hd(e,this.clientEncoder.toUint8Array()),hd(e,this.leftClockEncoder.toUint8Array()),hd(e,this.rightClockEncoder.toUint8Array()),hd(e,ad(this.infoEncoder)),hd(e,this.stringEncoder.toUint8Array()),hd(e,ad(this.parentInfoEncoder)),hd(e,this.typeRefEncoder.toUint8Array()),hd(e,this.lenEncoder.toUint8Array()),md(e,ad(this.restEncoder)),ad(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Sd(this.restEncoder,e)}writeBuf(e){hd(this.restEncoder,e)}writeJSON(e){Sd(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},ah=(e,t,n,r)=>{r=Eu(r,t[0].id.clock);let i=Zh(t,r);ld(e.restEncoder,t.length-i),e.writeClient(n),ld(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},oh=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{Yh(t,n)>e&&r.set(n,e)}),Jh(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),ld(e.restEncoder,r.size),gu(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{ah(e,t.clients.get(n),n,r)})},sh=(e,t)=>{let n=cu(),r=Bd(e.restDecoder);for(let i=0;i<r;i++){let r=Bd(e.restDecoder),i=Array(r),a=e.readClient(),o=Bd(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new U_(kh(a,o),t),o+=t;break}case 10:{let t=Bd(e.restDecoder);i[n]=new Dv(kh(a,o),t),o+=t;break}default:{let s=(r&192)==0,c=new Cv(kh(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,wv(e,r));i[n]=c,o+=c.length}}}}return n},ch=(e,t,n)=>{let r=[],i=gu(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new qh,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==Dv){let i=uu(d,u.id.client,()=>Yh(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,Yh(t,a)),f();else{u=e.refs[e.i++];continue}}else (i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new ih;return oh(e,s,new Map),ld(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},lh=(e,t)=>oh(e,t.doc.store,t.beforeState),uh=(e,t,n,r=new eh(e))=>dg(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=ch(e,i,sh(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<Yh(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=xg([o.update,a.update])}}else i.pendingStructs=a;let s=Jm(r,e,i);if(i.pendingDs){let t=new eh(Fd(i.pendingDs));Bd(t.restDecoder);let n=Jm(t,e,i);s&&n?i.pendingDs=xg([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,dh(e.doc,t)}},n,!1),dh=(e,t,n,r=eh)=>{let i=Fd(t);uh(i,e,n,new r(i))},fh=(e,t,n)=>dh(e,t,n,Qm),ph=(e,t,n=new Map)=>{oh(e,t.store,n),Km(e,Gm(t.store))},mh=(e,t=new Uint8Array([0]),n=new ih)=>{ph(n,e,_h(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Sg(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===nh)return yg(r.map((e,t)=>t===0?e:Dg(e)));if(n.constructor===ih)return xg(r)}return r[0]},hh=(e,t)=>mh(e,t,new nh),gh=e=>{let t=new Map,n=Bd(e.restDecoder);for(let r=0;r<n;r++){let n=Bd(e.restDecoder),r=Bd(e.restDecoder);t.set(n,r)}return t},_h=e=>gh(new Zm(Fd(e))),vh=(e,t)=>(ld(e.restEncoder,t.size),gu(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{ld(e.restEncoder,t),ld(e.restEncoder,n)}),e),yh=(e,t)=>vh(e,Jh(t.store)),bh=(e,t=new rh)=>(e instanceof Map?vh(t,e):yh(t,e),t.toUint8Array()),xh=e=>bh(e,new th),Sh=class{constructor(){this.l=[]}},Ch=()=>new Sh,wh=(e,t)=>e.l.push(t),Th=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},Eh=(e,t,n)=>xf(e.l,[t,n]),Dh=class{constructor(e,t){this.client=e,this.clock=t}},Oh=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,kh=(e,t)=>new Dh(e,t),Ah=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw jd()},jh=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},Mh=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},Nh=e=>{let t={};return e.type&&(t.type=e.type),e.tname&&(t.tname=e.tname),e.item&&(t.item=e.item),e.assoc!=null&&(t.assoc=e.assoc),t},Ph=e=>new Mh(e.type==null?null:kh(e.type.client,e.type.clock),e.tname??null,e.item==null?null:kh(e.item.client,e.item.clock),e.assoc==null?0:e.assoc),Fh=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},Ih=(e,t,n=0)=>new Fh(e,t,n),Lh=(e,t,n)=>{let r=null,i=null;return e._item===null?i=Ah(e):r=kh(e._item.id.client,e._item.id.clock),new Mh(r,i,t,n)},Rh=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return Lh(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return Lh(e,kh(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return Lh(e,r.lastId,n);r=r.right}return Lh(e,null,n)},zh=(e,t)=>{let n=Qh(e,t);return{item:n,diff:t.clock-n.id.clock}},Bh=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,c=null,l=0;if(i!==null){if(Yh(r,i.client)<=i.clock)return null;let e=n?vv(r,i):zh(r,i),t=e.item;if(!(t instanceof Cv))return null;if(c=t.parent,c._item===null||!c._item.deleted){l=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(l+=n.length),n=n.left}}else{if(o!==null)c=t.get(o);else if(a!==null){if(Yh(r,a.client)<=a.clock)return null;let{item:e}=n?vv(r,a):{item:Qh(r,a)};if(e instanceof Cv&&e.content instanceof gv)c=e.content.type;else return null}else throw jd();l=s>=0?c._length:0}return Ih(c,l,e.assoc)},Vh=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&Oh(e.item,t.item)&&Oh(e.type,t.type)&&e.assoc===t.assoc,Hh=class{constructor(e,t){this.ds=e,this.sv=t}},Uh=(e,t)=>new Hh(e,t);Uh(Wm(),new Map);var Wh=e=>Uh(Gm(e.store),Jh(e.store)),Gh=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Bm(t.ds,e.id),Kh=(e,t)=>{let n=uu(e.meta,Kh,pu),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<Yh(r,n)&&eg(e,kh(n,t))}),Rm(e,t.ds,e=>{}),n.add(t))},qh=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},Jh=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},Yh=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},Xh=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw jd()}n.push(t)},Zh=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=Cu(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=Cu((n+r)/2)}throw jd()},Qh=(e,t)=>{let n=e.clients.get(t.client);return n[Zh(n,t.clock)]},$h=(e,t,n)=>{let r=Zh(t,n),i=t[r];return i.id.clock<n&&i instanceof Cv?(t.splice(r+1,0,bv(e,i,n-i.id.clock)),r+1):r},eg=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[$h(e,n,t.clock)]},tg=(e,t,n)=>{let r=t.clients.get(n.client),i=Zh(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==U_&&r.splice(i+1,0,bv(e,a,n.clock-a.id.clock+1)),a},ng=(e,t,n)=>{let r=e.clients.get(t.id.client);r[Zh(r,t.id.clock)]=n},rg=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=$h(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&$h(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},ig=class{constructor(e,t,n){this.doc=e,this.deleteSet=new Lm,this.beforeState=Jh(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},ag=(e,t)=>t.deleteSet.clients.size===0&&!fu(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(Vm(t.deleteSet),lh(e,t),Km(e,t.deleteSet),!0),og=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&uu(e.changed,t,pu).add(n)},sg=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof Cv&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},cg=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=Zh(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof Cv&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},lg=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=Tu(r.length-1,1+Zh(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+sg(r,e)}})},ug=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{Vm(a),n.afterState=Jh(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{Eh(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&E_(n)})}),xf(e,[])}finally{r.gc&&cg(a,i,r.gcFilter),lg(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=Eu(Zh(e,r),1);for(let t=e.length-1;t>=n;)t-=1+sg(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=Zh(r,n);a+1<r.length&&sg(r,a+1)>1||a>0&&sg(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(Am(Tm,vm,`[yjs] `,ym,Cm,`Changed the client-id because another client seems to be using it.`),r.clientID=Ym()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new nh;ag(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new ih;ag(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):ug(e,t+1)}}},dg=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new ig(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&ug(i,0)}}return o},fg=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},pg=(e,t,n)=>{Rm(e,n.deletions,n=>{n instanceof Cv&&t.scope.some(t=>t===e.doc||jh(t,n))&&yv(n,!1)})},mg=(e,t,n)=>{let r=null,i=e.doc,a=e.scope;dg(i,n=>{for(;t.length>0&&e.currStackItem===null;){let r=i.store,o=t.pop(),s=new Set,c=[],l=!1;Rm(n,o.insertions,e=>{if(e instanceof Cv){if(e.redone!==null){let{item:t,diff:i}=vv(r,e.id);i>0&&(t=eg(n,kh(t.id.client,t.id.clock+i))),e=t}!e.deleted&&a.some(t=>t===n.doc||jh(t,e))&&c.push(e)}}),Rm(n,o.deletions,e=>{e instanceof Cv&&a.some(t=>t===n.doc||jh(t,e))&&!Bm(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{l=Sv(n,t,s,o.insertions,e.ignoreRemoteMapChanges,e)!==null||l});for(let t=c.length-1;t>=0;t--){let r=c[t];e.deleteFilter(r)&&(r.delete(n),l=!0)}e.currStackItem=l?o:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),r=n},e);let o=e.currStackItem;if(o!=null){let t=r.changedParentTypes;e.emit(`stack-item-popped`,[{stackItem:o,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o},hg=class extends xu{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:o=bu(e)?e[0].doc:e instanceof Xm?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,n=this.redoing,r=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);let i=new Lm;e.afterState.forEach((t,n)=>{let r=e.beforeState.get(n)||0,a=t-r;a>0&&Um(i,n,r,a)});let a=nf(),o=!1;if(this.lastChange>0&&a-this.lastChange<this.captureTimeout&&r.length>0&&!t&&!n){let t=r[r.length-1];t.deletions=Hm([t.deletions,e.deleteSet]),t.insertions=Hm([t.insertions,i])}else r.push(new fg(e.deleteSet,i)),o=!0;!t&&!n&&(this.lastChange=a),Rm(e,e.deleteSet,t=>{t instanceof Cv&&this.scope.some(n=>n===e.doc||jh(n,t))&&yv(t,!0)});let s=[{stackItem:r[r.length-1],origin:e.origin,type:t?`redo`:`undo`,changedParentTypes:e.changedParentTypes},this];o?this.emit(`stack-item-added`,s):this.emit(`stack-item-updated`,s)},this.doc.on(`afterTransaction`,this.afterTransactionHandler),this.doc.on(`destroy`,()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=bu(e)?e:[e],e.forEach(e=>{t.has(e)||(t.add(e),(e instanceof Vg?e.doc!==this.doc:e!==this.doc)&&jm(`[yjs#509] Not same Y.Doc`),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>pg(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>pg(n,this,e)),this.redoStack=[]),this.emit(`stack-cleared`,[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=mg(this,this.undoStack,`undo`)}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=mg(this,this.redoStack,`redo`)}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off(`afterTransaction`,this.afterTransactionHandler),super.destroy()}};function*gg(e){let t=Bd(e.restDecoder);for(let n=0;n<t;n++){let t=Bd(e.restDecoder),n=e.readClient(),r=Bd(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=Bd(e.restDecoder);yield new Dv(kh(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new Cv(kh(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,wv(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new U_(kh(n,r),t),r+=t}}}}var _g=class{constructor(e,t){this.gen=gg(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===Dv);return this.curr}},vg=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},yg=e=>xg(e,Qm,nh),bg=(e,t)=>{if(e.constructor===U_){let{client:n,clock:r}=e.id;return new U_(kh(n,r+t),e.length-t)}else if(e.constructor===Dv){let{client:n,clock:r}=e.id;return new Dv(kh(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new Cv(kh(r,i+t),null,kh(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},xg=(e,t=eh,n=ih)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(Fd(e))),i=r.map(e=>new _g(e,!0)),a=null,o=new n,s=new vg(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Dv?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)wg(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===Dv)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{wg(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new Dv(kh(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===Dv?a.struct.length-=t:n=bg(n,t)),a.struct.mergeWith(n)||(wg(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==Dv;n=e.next())wg(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(wg(s,a.struct,a.offset),a=null),Tg(s),Km(o,Hm(r.map(e=>qm(e)))),o.toUint8Array()},Sg=(e,t,n=eh,r=ih)=>{let i=_h(t),a=new r,o=new vg(a),s=new n(Fd(e)),c=new _g(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===Dv){c.next();continue}if(e.id.clock+e.length>n)for(wg(o,e,Eu(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)wg(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}return Tg(o),Km(a,qm(s)),a.toUint8Array()},Cg=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:ad(e.encoder.restEncoder)}),e.encoder.restEncoder=nd(),e.written=0)},wg=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Cg(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),ld(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Tg=e=>{Cg(e);let t=e.encoder.restEncoder;ld(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];ld(t,r.written),md(t,r.restEncoder)}},Eg=(e,t,n,r)=>{let i=new n(Fd(e)),a=new _g(i,!1),o=new r,s=new vg(o);for(let e=a.curr;e!==null;e=a.next())wg(s,t(e),0);return Tg(s),Km(o,qm(i)),o.toUint8Array()},Dg=e=>Eg(e,Sf,eh,nh),Og=`You must not compute changes after the event-handler fired.`,kg=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=Ag(this.currentTarget,this.target)}deletes(e){return Bm(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw kd(Og);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=mu(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=mu(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=mu(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw kd(Og);let t=this.target,n=pu(),r=pu(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},Ag=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},jg=()=>{jm(`Invalid access: Add Yjs type to a document before reading data.`)},Mg=80,Ng=0,Pg=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Ng++}},Fg=e=>{e.timestamp=Ng++},Ig=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Ng++},Lg=(e,t,n)=>{if(e.length>=Mg){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return Ig(r,t,n),r}else{let r=new Pg(t,n);return e.push(r),r}},Rg=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>wu(t-e.index)<wu(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,Fg(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&wu(n.index-i)<r.parent.length/Mg?(Ig(n,r,i),n):Lg(e._searchMarker,r,i)},zg=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=Eu(t,i.index+n))}},Bg=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;uu(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;Eh(r._eH,n,t)},Vg=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Ch(),this._dEH=Ch(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Ad()}clone(){throw Ad()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){wh(this._eH,e)}observeDeep(e){wh(this._dEH,e)}unobserve(e){Th(this._eH,e)}unobserveDeep(e){Th(this._dEH,e)}toJSON(){}},Hg=(e,t,n)=>{e.doc??jg(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},Ug=e=>{e.doc??jg();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},Wg=(e,t)=>{let n=[],r=e._start;for(;r!==null;){if(r.countable&&Gh(r,t)){let e=r.content.getContent();for(let t=0;t<e.length;t++)n.push(e[t])}r=r.right}return n},Gg=(e,t)=>{let n=0,r=e._start;for(e.doc??jg();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},Kg=(e,t)=>{let n=[];return Gg(e,(r,i)=>{n.push(t(r,i,e))}),n},qg=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},Jg=(e,t)=>{e.doc??jg();let n=Rg(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},Yg=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new Cv(kh(o,Yh(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new iv(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new Cv(kh(o,Yh(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new W_(new Uint8Array(n))),i.integrate(e,0);break;case Xm:i=new Cv(kh(o,Yh(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new Y_(n)),i.integrate(e,0);break;default:if(n instanceof Vg)i=new Cv(kh(o,Yh(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new gv(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},Xg=()=>kd(`Length exceeded!`),Zg=(e,t,n,r)=>{if(n>t._length)throw Xg();if(n===0)return t._searchMarker&&zg(t._searchMarker,n,r.length),Yg(e,t,null,r);let i=n,a=Rg(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&eg(e,kh(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&zg(t._searchMarker,i,r.length),Yg(e,t,o,r)},Qg=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return Yg(e,t,r,n)},$g=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=Rg(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&eg(e,kh(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&eg(e,kh(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw Xg();t._searchMarker&&zg(t._searchMarker,i,-a+r)},e_=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},t_=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new iv([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new iv([r]);break;case Uint8Array:s=new W_(r);break;case Xm:s=new Y_(r);break;default:if(r instanceof Vg)s=new gv(r);else throw Error(`Unexpected content type`)}new Cv(kh(o,Yh(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},n_=(e,t)=>{e.doc??jg();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},r_=e=>{let t={};return e.doc??jg(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},i_=(e,t)=>{e.doc??jg();let n=e._map.get(t);return n!==void 0&&!n.deleted},a_=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&Gh(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},o_=e=>(e.doc??jg(),Pm(e._map.entries(),e=>!e[1].deleted)),s_=class extends kg{},c_=class e extends Vg{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Vg?e.clone():e)),t}get length(){return this.doc??jg(),this._length}_callObserver(e,t){super._callObserver(e,t),Bg(this,e,new s_(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):dg(this.doc,n=>{Zg(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):dg(this.doc,t=>{Qg(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):dg(this.doc,n=>{$g(n,this,e,t)})}get(e){return Jg(this,e)}toArray(){return Ug(this)}slice(e=0,t=this.length){return Hg(this,e,t)}toJSON(){return this.map(e=>e instanceof Vg?e.toJSON():e)}map(e){return Kg(this,e)}forEach(e){Gg(this,e)}[Symbol.iterator](){return qg(this)}_write(e){e.writeTypeRef(lv)}},l_=e=>new c_,u_=class extends kg{constructor(e,t,n){super(e,t),this.keysChanged=n}},d_=class e extends Vg{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof Vg?e.clone():e)}),t}_callObserver(e,t){Bg(this,e,new u_(this,e,t))}toJSON(){this.doc??jg();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof Vg?r.toJSON():r}}),e}get size(){return[...o_(this)].length}keys(){return Fm(o_(this),e=>e[0])}values(){return Fm(o_(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Fm(o_(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??jg(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):dg(this.doc,t=>{e_(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):dg(this.doc,n=>{t_(n,this,e,t)}),t}get(e){return n_(this,e)}has(e){return i_(this,e)}clear(){this.doc===null?this._prelimContent.clear():dg(this.doc,e=>{this.forEach(function(t,n,r){e_(e,r,n)})})}_write(e){e.writeTypeRef(uv)}},f_=e=>new d_,p_=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&vf(e,t),m_=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&jd(),this.right.content.constructor){case $_:this.right.deleted||v_(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},h_=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case $_:t.right.deleted||v_(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&eg(e,kh(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},g_=(e,t,n,r)=>{let i=new Map,a=r?Rg(t,n):null;return a?h_(e,new m_(a.p.left,a.p,a.index,i),n-a.index):h_(e,new m_(null,t._start,0,i),n)},__=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===$_&&p_(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new Cv(kh(a,Yh(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new $_(o,r));l.integrate(e,0),n.right=l,n.forward()})},v_=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},y_=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===$_&&p_(t[e.right.content.key]??null,e.right.content.value));)e.forward()},b_=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!p_(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new Cv(kh(a,Yh(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new $_(s,c)),n.right.integrate(e,0),n.forward()}}return o},x_=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;y_(n,i);let s=b_(e,t,n,i),c=r.constructor===String?new ov(r):r instanceof Vg?new gv(r):new Z_(r),{left:l,right:u,index:d}=n;t._searchMarker&&zg(t._searchMarker,n.index,c.getLength()),u=new Cv(kh(o,Yh(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),__(e,t,n,s)},S_=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;y_(n,i);let s=b_(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===$_));){if(!n.right.deleted)switch(n.right.content.constructor){case $_:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(p_(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&eg(e,kh(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
4
4
  `;n.right=new Cv(kh(o,Yh(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new ov(i)),n.right.integrate(e,0),n.forward()}__(e,t,n,s)},C_=(e,t,n,r,i)=>{let a=t,o=cu();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===$_){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case $_:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&v_(i,n);break}}}t=t.right}return s},w_=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===$_){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},T_=e=>{let t=0;return dg(e.doc,n=>{let r=e._start,i=e._start,a=cu(),o=lu(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case $_:v_(o,i.content);break;default:t+=C_(n,r,i,a,o),a=lu(o),r=i;break}i=i.right}}),t},E_=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&rg(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===$_&&e.constructor!==U_&&t.add(e.parent)})}dg(n,n=>{Rm(e,e.deleteSet,e=>{if(e instanceof U_||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===$_?t.add(r):w_(n,e)});for(let e of t)T_(e)})},D_=(e,t,n)=>{let r=n,i=lu(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case gv:case Z_:case ov:n<t.right.length&&eg(e,kh(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&C_(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&zg(o._searchMarker,t.index,-r+n),t},O_=class extends kg{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){return this._changes===null&&(this._changes={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set}),this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];dg(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},hf(o)||(e.attributes=df({},o))),c=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case gv:case Z_:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case ov:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case $_:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(p_(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&u(),p_(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;p_(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(p_(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),v_(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},k_=class e extends Vg{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??jg(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new O_(this,e,t);Bg(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??jg();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===ov&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):dg(this.doc,n=>{let r=new m_(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
5
5
  `?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&x_(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&D_(n,r,a.delete):S_(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??jg();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(Gh(s,e)||t!==void 0&&Gh(s,t))switch(s.content.constructor){case ov:{let r=i.get(`ychange`);e!==void 0&&!Gh(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!Gh(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case gv:case Z_:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case $_:Gh(s,e)&&(c(),v_(i,s.content));break}s=s.right}c()};return e||t?dg(a,n=>{e&&Kh(n,e),t&&Kh(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):dg(r,r=>{let i=g_(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),x_(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):dg(r,r=>{let i=g_(r,this,e,!n);x_(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):dg(n,n=>{D_(n,g_(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):dg(r,r=>{let i=g_(r,this,e,!1);i.right!==null&&S_(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):dg(this.doc,t=>{e_(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):dg(this.doc,n=>{t_(n,this,e,t)})}getAttribute(e){return n_(this,e)}getAttributes(){return r_(this)}_write(e){e.writeTypeRef(dv)}},A_=e=>new k_,j_=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??jg()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===P_||t.constructor===M_)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}else e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},M_=class e extends Vg{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Vg?e.clone():e)),t}get length(){return this.doc??jg(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new j_(this,e)}querySelector(e){e=e.toUpperCase();let t=new j_(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),gu(new j_(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Bg(this,e,new I_(this,t,e))}toString(){return Kg(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),Gg(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):dg(this.doc,n=>{Zg(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)dg(this.doc,n=>{let r=e&&e instanceof Vg?e._item:e;Yg(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw kd(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):dg(this.doc,n=>{$g(n,this,e,t)})}toArray(){return Ug(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Jg(this,e)}slice(e=0,t=this.length){return Hg(this,e,t)}forEach(e){Gg(this,e)}_write(e){e.writeTypeRef(pv)}},N_=e=>new M_,P_=class e extends M_{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName);return pf(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof Vg?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):dg(this.doc,t=>{e_(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):dg(this.doc,n=>{t_(n,this,e,t)})}getAttribute(e){return n_(this,e)}hasAttribute(e){return i_(this,e)}getAttributes(e){return e?a_(this,e):r_(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return Gg(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(fv),e.writeKey(this.nodeName)}},F_=e=>new P_(e.readKey()),I_=class extends kg{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},L_=class e extends d_{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(mv),e.writeKey(this.hookName)}},R_=e=>new L_(e.readKey()),z_=class e extends k_{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(hv)}},B_=e=>new z_,V_=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Ad()}mergeWith(e){return!1}write(e,t,n){throw Ad()}integrate(e,t){throw Ad()}},H_=0,U_=class extends V_{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),Xh(e.doc.store,this)}write(e,t){e.writeInfo(H_),e.writeLen(this.length-t)}getMissing(e,t){return null}},W_=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw Ad()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},G_=e=>new W_(e.readBuf()),K_=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Um(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},q_=e=>new K_(e.readLen()),J_=(e,t)=>new Xm({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),Y_=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(J_(this.doc.guid,this.opts))}splice(e){throw Ad()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},X_=e=>new Y_(J_(e.readString(),e.readAny())),Z_=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw Ad()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},Q_=e=>new Z_(e.readJSON()),$_=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw Ad()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},ev=e=>new $_(e.readKey(),e.readJSON()),tv=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},nv=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new tv(n)},rv=jf(`node_env`)===`development`,iv=class e{constructor(e){this.arr=e,rv&&bf(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},av=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new iv(n)},ov=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},sv=e=>new ov(e.readString()),cv=[l_,f_,A_,F_,N_,R_,B_],lv=0,uv=1,dv=2,fv=3,pv=4,mv=5,hv=6,gv=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw Ad()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},_v=e=>new gv(cv[e.readTypeRef()](e)),vv=(e,t)=>{let n=t,r=0,i;do r>0&&(n=kh(n.client,n.clock+r)),i=Qh(e,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof Cv);return{item:i,diff:r}},yv=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},bv=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new Cv(kh(r,i+n),t,kh(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=kh(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},xv=(e,t)=>vu(e,e=>Bm(e.deletions,t)),Sv=(e,t,n,r,i,a)=>{let o=e.doc,s=o.store,c=o.clientID,l=t.redone;if(l!==null)return eg(e,l);let u=t.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||Sv(e,u,n,r,i,a)===null))return null;for(;u.redone!==null;)u=eg(e,u.redone)}let p=u===null?t.parent:u.content.type;if(t.parentSub===null){for(d=t.left,f=t;d!==null;){let t=d;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:eg(e,t.redone);if(t!==null&&t.parent._item===u){d=t;break}d=d.left}for(;f!==null;){let t=f;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:eg(e,t.redone);if(t!==null&&t.parent._item===u){f=t;break}f=f.right}}else if(f=null,t.right&&!i){for(d=t;d!==null&&d.right!==null&&(d.right.redone||Bm(r,d.right.id)||xv(a.undoStack,d.right.id)||xv(a.redoStack,d.right.id));)for(d=d.right;d.redone;)d=eg(e,d.redone);if(d&&d.right!==null)return null}else d=p._map.get(t.parentSub)||null;let m=kh(c,Yh(s,c)),h=new Cv(m,d,d&&d.lastId,f,f&&f.id,p,t.parentSub,t.content.copy());return t.redone=m,yv(h,!0),h.integrate(e,0),h},Cv=class e extends V_{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Yh(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Yh(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Dh&&this.id.client!==this.parent.client&&this.parent.clock>=Yh(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=tg(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=eg(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===U_||this.right&&this.right.constructor===U_)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Dh){let e=Qh(n,this.parent);e.constructor===U_?this.parent=null:this.parent=e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=tg(e,e.doc.store,kh(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),Oh(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(Oh(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(Qh(e.doc.store,n.origin)))r.has(Qh(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null)this.right=this.left.right,this.left.right=this;else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Xh(e.doc.store,this),this.content.integrate(e,this),og(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new U_(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:kh(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Oh(e.origin,this.lastId)&&this.right===e&&Oh(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),Um(e.deleteSet,this.id.client,this.id.clock,this.length),og(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw jd();this.content.gc(e),t?ng(e,this,new U_(this.id,this.length)):this.content=new K_(this.length)}write(e,t){let n=t>0?kh(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=Ah(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===Dh?(e.writeParentInfo(!1),e.writeLeftID(t)):jd();i!==null&&e.writeString(i)}this.content.write(e,t)}},wv=(e,t)=>Tv[t&31](e),Tv=[()=>{jd()},q_,nv,G_,sv,Q_,ev,_v,av,X_,()=>{jd()}],Ev=10,Dv=class extends V_{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){jd()}write(e,t){e.writeInfo(Ev),ld(e.restEncoder,this.length-t)}getMissing(e,t){return null}},Ov=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},kv=`__ $YJS$ __`;Ov[kv]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),Ov[kv]=!0;var Av=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},jv=/[\uD800-\uDBFF]/,Mv=/[\uDC00-\uDFFF]/,Nv=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&jv.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&Mv.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Pv=(e,t)=>e>>>t|e<<32-t,Fv=e=>Pv(e,2)^Pv(e,13)^Pv(e,22),Iv=e=>Pv(e,6)^Pv(e,11)^Pv(e,25),Lv=e=>Pv(e,7)^Pv(e,18)^e>>>3,Rv=e=>Pv(e,17)^Pv(e,19)^e>>>10,zv=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Bv=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Vv=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Bv),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=Rv(t[e-2])+t[e-7]+Lv(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+Iv(o)+(o&s^~o&c)+zv[e]+t[e]>>>0,d=Fv(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Bu,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},Hv=e=>new Vv().digest(e),Uv=new b(`y-sync`),Wv=new b(`y-undo`),Gv=new b(`yjs-cursor`),Kv=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},qv=e=>If(Kv(Hv(Rf(e)))),Jv=()=>({mapping:new Map,isOMark:new Map}),Yv=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Bm(t.ds,e.id),Xv=[{light:`#ecd44433`,dark:`#ecd444`}],Zv=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=pu();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,$d(t))}return e.get(n)},Qv=(e,{colors:t=Xv,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new ny(e,a),c=new S({props:{editable:e=>{let t=Uv.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:Uv,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(Uv);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&gm(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=Wv.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},Uv)})}},destroy:()=>{s.destroy()}})});return c},$v=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new sn(e.doc));else if(t.type===`node`){let r=jy(n.doc,n.type,t.anchor,n.mapping);e.setSelection(ey(e,r))}else{let r=jy(n.doc,n.type,t.anchor,n.mapping),i=jy(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(f.between(e.doc.resolve(r),e.doc.resolve(i)))}},ey=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?we.create(e.doc,t):f.near(n)},ty=(e,t)=>({type:t.selection.jsonID,anchor:ky(t.selection.anchor,e.type,e.mapping),head:ky(t.selection.head,e.type,e.mapping)}),ny=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=Av(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=ty(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(Ef&&this._domSelectionInView===null&&(gm(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=em.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=Uh(Wm(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(Uv,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>iy(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new T(W.from(e),0,0));t.setMeta(Uv,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>iy(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new T(W.from(t),0,0));if(e){let t=Tu(Eu(e.anchor,0),n.doc.content.size),r=Tu(Eu(e.head,0),n.doc.content.size);n.setSelection(f.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(Uv,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Wh(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&jd(),r=new Xm({gc:!1}),dh(r,t),t=Wh(r),dh(r,e),e=Wh(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[Zh(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Rm(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:Zv(n.colorMapping,n.colors,r)}},s=Wg(i,new Hh(t.ds,e.sv)).map(n=>!n._item.deleted||Yv(n._item,e)||Yv(n._item,t)?iy(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new T(W.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(Uv,{isChangeOrigin:!0}))},Uv)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=Uv.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);Rm(t,t.deleteSet,e=>{if(e.constructor===Cv){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>ry(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new T(W.from(n),0,0));$v(r,this.beforeTransactionSelection,this),r=r.setMeta(Uv,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof hg}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{Sy(this.doc,this.type,e,this),this.beforeTransactionSelection=ty(this,this.prosemirrorView.state)},Uv)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},ry=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof P_)return iy(e,t,n,r,i,a);throw Ad()}return o},iy=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof P_){let s=ry(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof k_&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=ay(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):Wg(e,new Hh(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(Yv(e._item,r)?Yv(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},ay=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,by(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},oy=(e,t)=>{let n=new z_,r=e.map(e=>({insert:e.text,attributes:xy(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},sy=(e,t)=>{let n=new P_(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,dy(e).map(e=>cy(e,t))),t.mapping.set(n,e),n},cy=(e,t)=>e instanceof Array?oy(e,t):sy(e,t),ly=e=>typeof e==`object`&&!!e,uy=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||ly(o)&&ly(s)&&uy(o,s)}return r},dy=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},fy=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&ff(e.attributes||{}).length===t[n].marks.length&&gf(e.attributes,(e,r)=>{let i=yy(r),a=t[n].marks;return a.find(e=>e.type.name===i)?uy(e,a.find(e=>e.type.name===i)?.attrs):!1}))},py=(e,t)=>{if(e instanceof P_&&!(t instanceof Array)&&Cy(e,t)){let n=dy(t);return e._length===n.length&&uy(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>py(e,n[t]))}return e instanceof z_&&t instanceof Array&&fy(e,t)},my=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),hy=(e,t,n)=>{let r=e.toArray(),i=dy(t),a=i.length,o=r.length,s=Tu(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(my(n.mapping.get(e),t))u=!0;else if(!py(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(my(n.mapping.get(e),t))u=!0;else if(!py(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},gy=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof ov?t+=n.content.str:n.content instanceof $_&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},_y=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=gy(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,xy(e.marks,n))})),{insert:o,remove:s,index:c}=Nv(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},vy=/(.*)(--[a-zA-Z0-9+/=]{8})$/,yy=e=>vy.exec(e)?.[1]??e,by=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(yy(r),e[r]));return n},xy=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=uu(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${qv(e.toJSON())}`:e.type.name]=e.attrs}}),n},Sy=(e,t,n,r)=>{if(t instanceof P_&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof P_){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=dy(n),a=i.length,o=t.toArray(),s=o.length,c=Tu(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!my(r.mapping.get(e),t))if(py(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!my(r.mapping.get(e),t))if(py(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof z_&&c instanceof Array)fy(n,c)||_y(n,c,r),l+=1;else{let i=n instanceof P_&&Cy(n,c),a=d instanceof P_&&Cy(d,f);if(i&&a){let e=hy(n,c,r),t=hy(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(Sy(e,n,c,r),l+=1):a?(Sy(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[cy(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof z_?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(cy(i[t],r));t.insert(l,e)}},Uv)},Cy=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,wy=null,Ty=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=Uv.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Ey=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=wy;wy=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Ty(t,r,e))})}),new e(n)}},Dy=(e=Ey.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||gm(0,()=>Dy(e,!0));return}throw r}n=!1,e.dequeueFirst()}},Oy=(e,t,n)=>{wy||(wy=new Map,gm(0,Dy)),uu(wy,e,cu).set(t,n)},ky=(e,t,n)=>{if(e===0)return Rh(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof z_){if(r._length>=e)return Rh(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new Mh(r._item===null?null:r._item.id,r._item===null?Ah(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new Mh(r._item===null?null:r._item.id,r._item===null?Ah(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw jd();if(e===0&&r.constructor!==z_&&r!==t)return Ay(r._item.parent,r._item)}return Rh(t,t._length,-1)},Ay=(e,t)=>{let n=null,r=null;return e._item===null?r=Ah(e):n=kh(e._item.id.client,e._item.id.clock),new Mh(n,r,t.id)},jy=(e,t,n,r)=>{let i=Bh(n,e);if(i===null||i.type!==t&&!jh(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===z_)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;t++,n instanceof z_?o+=n._length:o+=r.get(n).nodeSize}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;t.deleted||(e instanceof z_?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},My=(e,t)=>{let n=Jv(),r=e.toArray().map(e=>iy(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,W.fromArray(r)),meta:n,mapping:n.mapping}},Ny=(e,t,n)=>e!==t,Py=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},Fy=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Iy=/^#[0-9a-fA-F]{6}$/,Ly=(e,t,n,r,i)=>{let a=Uv.getState(e);if(a==null||a.doc==null||a.binding==null)return ye.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?ye.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:Iy.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=jy(o,a.type,Ph(t.cursor.anchor),a.binding.mapping),u=jy(o,a.type,Ph(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Eu(e.doc.content.size-1,0);l=Tu(l,t),u=Tu(u,t),s.push(ln.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=Tu(l,u),o=Eu(l,u);s.push(ln.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),ye.create(e.doc,s))},Ry=(e,{awarenessStateFilter:t=Ny,cursorBuilder:n=Py,selectionBuilder:r=Fy,getSelection:i=e=>e.selection}={},a=`cursor`)=>new S({key:Gv,state:{init(i,a){return Ly(a,e,t,n,r)},apply(i,a,o,s){let c=Uv.getState(s),l=i.getMeta(Gv);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?Ly(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>Gv.getState(e)},view:t=>{let n=()=>{t.docView&&Oy(t,Gv,{awarenessUpdated:!0})},r=()=>{let n=Uv.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ky(o.anchor,n.type,n.binding.mapping),c=ky(o.head,n.type,n.binding.mapping);(r.cursor==null||!Vh(Ph(r.cursor.anchor),s)||!Vh(Ph(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&jy(n.doc,n.type,Ph(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),zy=e=>{let t=Wv.getState(e).undoManager;if(t!=null)return t.undo(),!0},By=e=>{let t=Wv.getState(e).undoManager;if(t!=null)return t.redo(),!0},Vy=new Set([`paragraph`]),Hy=(e,t)=>!(e instanceof Cv)||!(e.content instanceof gv)||!(e.content.type instanceof k_||e.content.type instanceof P_&&t.has(e.content.type.nodeName))||e.content.type._length===0,Uy=({protectedNodes:e=Vy,trackedOrigins:t=[],undoManager:n=null}={})=>new S({key:Wv,state:{init:(r,i)=>{let a=Uv.getState(i),o=n||new hg(a.type,{trackedOrigins:new Set([Uv].concat(t)),deleteFilter:t=>Hy(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=Uv.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:ty(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=Uv.getState(e.state),n=Wv.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Wv.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}});function Wy(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=Jt(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function Gy(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
6
- `);return/\s/.test(n)}):!1}var Ky=new b(`suggestion`);function qy({pluginKey:e=Ky,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:h=Wy,shouldShow:g,shouldResetDismissed:_}){let v,y=p?.(),b=r&&!i,x=()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=t.view.coordsAtPos(e);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}},C=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:x,w=({match:e,dismissedRange:n,state:r,transaction:i})=>_?.({editor:t,state:r,range:n,match:e,transaction:i,allowSpaces:b})?!1:b?e.range.from===n.from:e.range.from===n.from&&!Gy(i);function T(n,r){var i;try{let r=e.getState(n.state),a=r?.decorationId?n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`):null,o={editor:t,range:r?.range||{from:0,to:0},query:r?.query||null,text:r?.text||null,items:[],command:e=>d({editor:t,range:r?.range||{from:0,to:0},props:e}),decorationNode:a,clientRect:C(n,a)};(i=y?.onExit)==null||i.call(y,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let E=new S({key:e,view(){return{update:async(e,n)=>{var r,i,a,o,s;let c=this.key?.getState(n),l=this.key?.getState(e.state),u=c.active&&l.active&&c.range.from!==l.range.from,p=!c.active&&l.active,m=c.active&&!l.active,h=!p&&!m&&c.query!==l.query,g=p||u&&h,_=h||u,b=m||u&&h;if(!g&&!_&&!b)return;let x=b&&!g?c:l,S=e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);v={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:e=>d({editor:t,range:x.range,props:e}),decorationNode:S,clientRect:C(e,S)},g&&((r=y?.onBeforeStart)==null||r.call(y,v)),_&&((i=y?.onBeforeUpdate)==null||i.call(y,v)),(_||g)&&(v.items=await f({editor:t,query:x.query})),b&&((a=y?.onExit)==null||a.call(y,v)),_&&((o=y?.onUpdate)==null||o.call(y,v)),g&&((s=y?.onStart)==null||s.call(y,v))},destroy:()=>{var e;v&&((e=y?.onExit)==null||e.call(y,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(s,c,l,u){let{isEditable:d}=t,{composing:f}=t.view,{selection:p}=s,{empty:_,from:v}=p,y={...c},b=s.getMeta(e);if(b&&b.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y.dismissedRange=c.active?{...c.range}:c.dismissedRange,y;if(y.composing=f,s.docChanged&&y.dismissedRange!==null&&(y.dismissedRange={from:s.mapping.map(y.dismissedRange.from),to:s.mapping.map(y.dismissedRange.to)}),d&&(_||t.view.composing)){(v<c.range.from||v>c.range.to)&&!f&&!c.composing&&(y.active=!1);let e=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:p.$from}),l=`id_${Math.floor(Math.random()*4294967295)}`;e&&m({editor:t,state:u,range:e.range,isActive:c.active})&&(!g||g({editor:t,range:e.range,query:e.query,text:e.text,transaction:s}))?(y.dismissedRange!==null&&!w({match:e,dismissedRange:y.dismissedRange,state:u,transaction:s})&&(y.dismissedRange=null),y.dismissedRange===null?(y.active=!0,y.decorationId=c.decorationId?c.decorationId:l,y.range=e.range,y.query=e.query,y.text=e.text):y.active=!1):(e||(y.dismissedRange=null),y.active=!1)}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(t,n){var r;let{active:i,range:a}=E.getState(t.state);if(!i)return!1;if(n.key===`Escape`||n.key===`Esc`){let i=E.getState(t.state);return(r=y?.onKeyDown)==null||r.call(y,{view:t,event:n,range:i.range}),T(t,e),!0}return(y?.onKeyDown)?.call(y,{view:t,event:n,range:a})||!1},decorations(e){let{active:t,range:n,decorationId:r,query:i}=E.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),ye.create(e.doc,[ln.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return E}var Jy=qy;function Yy(e){return e.kind===`create`?`create:${e.value}`:`tag:${e.value}`}function Xy(e){if(e.kind===`create`){let t=e.value;return B._({id:`XPqe3B`,values:{tagValue:t}})}let t=B._({id:`pckX1A`,values:{0:e.count}}),n=e.value;return B._({id:`m2T1Xj`,values:{tagValue:n,uses:t}})}function Zy(e){let t=(0,J.c)(38),{items:n,query:r,selectedIndex:a,onSelect:s,onHover:c,loading:l,error:u}=e,d=l===void 0?!1:l,f=u===void 0?null:u,{_:p}=i(),m=(0,Y.useRef)(null),h=(0,Y.useId)(),g=a>=0&&a<n.length?`${h}-option-${a}`:void 0,_,v;t[0]===a?(_=t[1],v=t[2]):(_=()=>{let e=m.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(a);t&&t.scrollIntoView({block:`nearest`})},v=[a],t[0]=a,t[1]=_,t[2]=v),(0,Y.useEffect)(_,v);let y=Qy;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:y,children:(0,X.jsx)(o,{id:`a_u4ck`})}),t[4]=n):n=t[4],n}if(n.length===0){let e;if(t[5]!==p||t[6]!==f||t[7]!==r){let n=r.trim();e=f??p(n?{id:`9R7pRC`,values:{trimmed:n}}:{id:`KRJ6xh`}),t[5]=p,t[6]=f,t[7]=r,t[8]=e}else e=t[8];let n=e,i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[9]=i):i=t[9];let a;return t[10]===n?a=t[11]:(a=(0,X.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:y,children:n}),t[10]=n,t[11]=a),a}let b=a>=0&&a<n.length?n[a]:null,x;t[12]===p?x=t[13]:(x=p({id:`SCoBBH`}),t[12]=p,t[13]=x);let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[14]=S):S=t[14];let C;t[15]===b?C=t[16]:(C=b?Xy(b):``,t[15]=b,t[16]=C);let w;t[17]===C?w=t[18]:(w=(0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:C}),t[17]=C,t[18]=w);let T;t[19]===f?T=t[20]:(T=f&&(0,X.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[19]=f,t[20]=T);let E;if(t[21]!==n||t[22]!==h||t[23]!==c||t[24]!==s||t[25]!==a){let e;t[27]!==h||t[28]!==c||t[29]!==s||t[30]!==a?(e=(e,t)=>{let n=t===a,r=Yy(e),i=e.kind===`create`;return(0,X.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,"data-testid":i?`tag-suggestion-create`:`tag-suggestion-tag-${e.value}`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},onPointerMove:c?()=>c(t):void 0,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-xs text-muted-foreground`,children:`#`}),(0,X.jsx)(`span`,{className:`truncate font-medium flex-1`,children:e.value}),i?(0,X.jsx)(`span`,{className:`shrink-0 rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary`,children:(0,X.jsx)(o,{id:`isRobC`})}):(0,X.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:e.count})]},r)},t[27]=h,t[28]=c,t[29]=s,t[30]=a,t[31]=e):e=t[31],E=n.map(e),t[21]=n,t[22]=h,t[23]=c,t[24]=s,t[25]=a,t[26]=E}else E=t[26];let D;return t[32]!==g||t[33]!==E||t[34]!==x||t[35]!==w||t[36]!==T?(D=(0,X.jsxs)(`div`,{ref:m,role:`listbox`,"aria-label":x,"aria-activedescendant":g,tabIndex:-1,onMouseDown:y,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:S,children:[w,T,E]}),t[32]=g,t[33]=E,t[34]=x,t[35]=w,t[36]=T,t[37]=D):D=t[37],D}function Qy(e){return e.preventDefault()}var $y=new WeakMap;function eb(e,t){$y.set(e,t)}function tb(e){return $y.get(e)??!1}function nb(e,t){let n=document.createElement(`div`);n.style.position=`fixed`,n.style.zIndex=`50`,n.style.visibility=`hidden`,document.body.appendChild(n);let r={getBoundingClientRect:()=>e()?.clientRect?.()??new DOMRect,get contextElement(){return e()?.editor.view.dom}},i=!1,a=!1,o=()=>{n.isConnected&&(n.style.removeProperty(`--suggestion-menu-max-height`),Bt(r,n,{placement:`bottom-start`,middleware:[Ve(4),ee(),me({padding:8}),c({apply({availableHeight:e}){n.isConnected&&n.style.setProperty(`--suggestion-menu-max-height`,`${Math.min(e,window.innerHeight*.4)}px`)}})]}).then(({x:e,y:t})=>{n.isConnected&&(n.style.left=`${e}px`,n.style.top=`${t}px`,i&&!a&&(n.style.removeProperty(`visibility`),a=!0))}).catch(e=>{n.isConnected&&console.warn(`[${t}] computePosition failed`,e)}))};return{popup:n,doPosition:o,startAutoUpdate:()=>z(r,n,o),reveal:()=>{a||(i=!0,o())}}}function rb(e){e.stopAutoUpdate?.(),e.stopAutoUpdate=null,e.popup?.remove(),e.popup=null}var ib=new b(`tagSuggestion`),ab=8,ob=/^[a-zA-Z][\w/-]*$/;async function sb(){let e=await fetch(`/api/tags`);if(!e.ok)throw Error(`/api/tags responded with ${e.status}`);let t=await e.json();return Array.isArray(t.tags)?t.tags:[]}function cb(e,t){let n=t.trim(),r=n.toLowerCase(),i=n===``?e.slice():e.filter(e=>e.name.toLowerCase().includes(r));return i.sort((e,t)=>{let n=+!e.name.toLowerCase().startsWith(r),i=+!t.name.toLowerCase().startsWith(r);return n===i?t.count===e.count?e.name.localeCompare(t.name):t.count-e.count:n-i}),i}function lb(e,t){let n=cb(e,t).slice(0,ab).map(e=>({kind:`tag`,value:e.name,count:e.count,isLeaf:e.isLeaf})),r=t.trim();return r&&ob.test(r)&&!e.some(e=>e.name===r)&&n.push({kind:`create`,value:r}),n}function ub(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``).match(/(^|[\s])#([a-zA-Z][\w/-]*)?$/);if(!n)return null;let r=n[2]??``,i=t.start(),a=n[1].length;return{range:{from:i+((n.index??0)+a),to:t.pos},query:r,text:`#${r}`}}function db(e){let t=[],n=!1,r=null,i=null;return Jy({editor:e,pluginKey:ib,char:`#`,allowedPrefixes:null,findSuggestionMatch:ub,allow:({editor:e})=>!tb(e),items:async({query:e})=>{if(!n){r||=sb();try{t=await r,i=null}catch(e){console.error(`[tag-suggestion] Failed to fetch tags:`,e),i=`Failed to load tags. Press Escape and type # again to retry, or continue typing to create a new tag.`,t=[]}finally{n=!0,r=null}}return lb(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=n.value;if(!r||!ob.test(r))return;e.chain().focus().deleteRange(t).insertContent({type:`tag`,attrs:{value:r}}).insertContent(` `).run()}catch(e){console.error(`[tag-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,a=null,o=0,s={popup:null,stopAutoUpdate:null},c=null,l=null,u=e=>{a?.command(e)},d=e=>{o!==e&&(o=e,p(null))};function f(e,t,r){let a=t===null?!n:t;return{items:e.items,query:e.query??``,selectedIndex:o,onSelect:r,onHover:d,loading:a,error:i}}let p=t=>{!e||!a||e.updateProps(f(a,t,u))};return{onBeforeStart(t){a=t,o=0;let n=nb(()=>a,`tag-suggestion`);s.popup=n.popup,c=n.doPosition,l=n.reveal,e=new tu(Zy,{props:f(t,!0,u),editor:t.editor}),n.popup.appendChild(e.element),s.stopAutoUpdate=n.startAutoUpdate()},onStart(e){a=e,o=0,p(null),l?.()},onUpdate(e){a=e,o=Math.min(o,Math.max(0,e.items.length-1)),p(null),c?.()},onKeyDown({event:e}){if(!a)return!1;let t=a.items;if(e.key===`ArrowDown`)return t.length===0?!1:(o=(o+1)%t.length,p(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(o=(o-1+t.length)%t.length,p(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[o];if(e)return a.command(e),!0;let n=(a.query??``).trim();return n&&ob.test(n)?(a.command({kind:`create`,value:n}),!0):!1}return e.key,!1},onExit(){rb(s),c=null,l=null,e?.destroy(),e=null,a=null,o=0,t=[],i=null,n=!1,r=null}}}})}var fb=1,pb=.9,mb=.8,hb=.17,gb=.1,_b=.999,vb=.9999,yb=.99,bb=/[\\\/_+.#"@\[\(\{&]/,xb=/[\\\/_+.#"@\[\(\{&]/g,Sb=/[\s-]/,Cb=/[\s-]/g;function wb(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?fb:yb;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=wb(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=fb:bb.test(e.charAt(l-1))?(d*=mb,p=e.slice(i,l-1).match(xb),p&&i>0&&(d*=_b**+p.length)):Sb.test(e.charAt(l-1))?(d*=pb,m=e.slice(i,l-1).match(Cb),m&&i>0&&(d*=_b**+m.length)):(d*=hb,i>0&&(d*=_b**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=vb)),(d<gb&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=wb(e,t,n,r,l+1,a+2,o),f*gb>d&&(d=f*gb)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Tb(e){return e.toLowerCase().replace(Cb,` `)}function Eb(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,wb(e,t,Tb(e),Tb(t),0,0,{})}var Db=`[cmdk-group=""]`,Ob=`[cmdk-group-items=""]`,kb=`[cmdk-group-heading=""]`,Ab=`[cmdk-item=""]`,jb=`${Ab}:not([aria-disabled="true"])`,Mb=`cmdk-item-select`,Nb=`data-value`,Pb=(e,t,n)=>Eb(e,t,n),Fb=Y.createContext(void 0),Ib=()=>Y.useContext(Fb),Lb=Y.createContext(void 0),Rb=()=>Y.useContext(Lb),zb=Y.createContext(void 0),Bb=Y.forwardRef((e,t)=>{let n=ex(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ex(()=>new Set),i=ex(()=>new Map),a=ex(()=>new Map),o=ex(()=>new Set),s=Qb(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=jn(),y=jn(),b=jn(),x=Y.useRef(null),S=rx();$b(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),$b(()=>{S(6,k)},[]);let C=Y.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=Y.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Pb;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Ob);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ob} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Ob} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Db}[${Nb}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Nb);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Db)?.querySelector(kb))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Ab}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(jb)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(Nb))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Nb))}function P(e){let t=A()?.closest(Db),n;for(;t&&!n;)t=e>0?Xb(t,Db):Zb(t,Db),n=t?.querySelector(jb);n?C.setState(`value`,n.getAttribute(Nb)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return Y.createElement(Dn.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Mb);t.dispatchEvent(e)}}}}},Y.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:ox},c),ax(e,e=>Y.createElement(Lb.Provider,{value:C},Y.createElement(Fb.Provider,{value:w},e))))}),Vb=Y.forwardRef((e,t)=>{let n=jn(),r=Y.useRef(null),i=Y.useContext(zb),a=Ib(),o=Qb(e),s=o.current?.forceMount??i?.forceMount;$b(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=nx(n,r,[e.value,e.children,r],e.keywords),l=Rb(),u=tx(e=>e.value&&e.value===c.current),d=tx(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Y.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Mb,f),()=>t.removeEventListener(Mb,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return Y.createElement(Dn.div,{ref:In(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Hb=Y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=jn(),s=Y.useRef(null),c=Y.useRef(null),l=jn(),u=Ib(),d=tx(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);$b(()=>u.group(o),[]),nx(o,s,[e.value,e.heading,c]);let f=Y.useMemo(()=>({id:o,forceMount:i}),[i]);return Y.createElement(Dn.div,{ref:In(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Y.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),ax(e,e=>Y.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Y.createElement(zb.Provider,{value:f},e))))}),Ub=Y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Y.useRef(null),a=tx(e=>!e.search);return!n&&!a?null:Y.createElement(Dn.div,{ref:In(i,t),...r,"cmdk-separator":``,role:`separator`})}),Wb=Y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Rb(),o=tx(e=>e.search),s=tx(e=>e.selectedItemId),c=Ib();return Y.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Y.createElement(Dn.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Gb=Y.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Y.useRef(null),o=Y.useRef(null),s=tx(e=>e.selectedItemId),c=Ib();return Y.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Y.createElement(Dn.div,{ref:In(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},ax(e,e=>Y.createElement(`div`,{ref:In(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Kb=Y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Y.createElement(Xn,{open:n,onOpenChange:r},Y.createElement(Hn,{container:o},Y.createElement(Vn,{"cmdk-overlay":``,className:i}),Y.createElement(er,{"aria-label":e.label,"cmdk-dialog":``,className:a},Y.createElement(Bb,{ref:t,...s}))))}),qb=Y.forwardRef((e,t)=>tx(e=>e.filtered.count===0)?Y.createElement(Dn.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Jb=Y.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Y.createElement(Dn.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ax(e,e=>Y.createElement(`div`,{"aria-hidden":!0},e)))}),Yb=Object.assign(Bb,{List:Gb,Item:Vb,Input:Wb,Group:Hb,Separator:Ub,Dialog:Kb,Empty:qb,Loading:Jb});function Xb(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Zb(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Qb(e){let t=Y.useRef(e);return $b(()=>{t.current=e}),t}var $b=typeof window>`u`?Y.useEffect:Y.useLayoutEffect;function ex(e){let t=Y.useRef();return t.current===void 0&&(t.current=e()),t}function tx(e){let t=Rb(),n=()=>e(t.snapshot());return Y.useSyncExternalStore(t.subscribe,n,n)}function nx(e,t,n,r=[]){let i=Y.useRef(),a=Ib();return $b(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Nb,s),i.current=s}),i}var rx=()=>{let[e,t]=Y.useState(),n=ex(()=>new Map);return $b(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ix(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function ax({asChild:e,children:t},n){return e&&Y.isValidElement(t)?Y.cloneElement(ix(t),{ref:t.ref},n(t.props.children)):n(t)}var ox={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function sx(e){let t=(0,J.c)(8),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=vn(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cx(e){let t=(0,J.c)(34),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({title:o,description:s,children:n,className:r,showCloseButton:c,commandProps:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`Command Palette`:o,u=s===void 0?`Search for a command to run`:s,d=c===void 0?!0:c,f;t[8]===i?f=t[9]:(f=i??{},t[8]=i,t[9]=f);let p,m;t[10]===f?(p=t[11],m=t[12]):({className:p,...m}=f,t[10]=f,t[11]=p,t[12]=m);let h;t[13]===r?h=t[14]:(h=vn(`top-[12vh] translate-y-0 overflow-hidden p-0`,r),t[13]=r,t[14]=h);let g;t[15]===l?g=t[16]:(g=(0,X.jsx)(Bn,{className:`sr-only`,children:l}),t[15]=l,t[16]=g);let _;t[17]===u?_=t[18]:(_=(0,X.jsx)(Rn,{className:`sr-only`,children:u}),t[17]=u,t[18]=_);let v;t[19]===p?v=t[20]:(v=vn(`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,p),t[19]=p,t[20]=v);let y;t[21]!==n||t[22]!==m||t[23]!==v?(y=(0,X.jsx)(sx,{className:v,...m,children:n}),t[21]=n,t[22]=m,t[23]=v,t[24]=y):y=t[24];let b;t[25]!==d||t[26]!==h||t[27]!==g||t[28]!==_||t[29]!==y?(b=(0,X.jsxs)(Gn,{className:h,showCloseButton:d,children:[g,_,y]}),t[25]=d,t[26]=h,t[27]=g,t[28]=_,t[29]=y,t[30]=b):b=t[30];let x;return t[31]!==a||t[32]!==b?(x=(0,X.jsx)($n,{...a,children:b}),t[31]=a,t[32]=b,t[33]=x):x=t[33],x}function lx(e){let t=(0,J.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]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(ja,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=vn(`flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,X.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,X.jsx)(Yb.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function ux(e){let t=(0,J.c)(8),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=vn(`max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function dx(e){let t=(0,J.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(Yb.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function fx(e){let t=(0,J.c)(8),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=vn(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function px(e){let t=(0,J.c)(8),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=vn(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mx(e){let t=(0,J.c)(8),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=vn(`ml-auto text-muted-foreground text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function hx(e,t){let n=null,r;try{n=await e.json()}catch(e){r=e}if(e.ok)return r!==void 0&&console.warn(`[parse-server-response] 2xx response with non-JSON body:`,r instanceof Error?r.message:String(r)),{ok:!0,body:r===void 0?n:null};if(r!==void 0){let t=r instanceof Error?r.message:String(r);return{ok:!1,title:`Server error (HTTP ${e.status}): ${t}`}}return{ok:!1,title:Ce(n)??t}}function gx(e,t,n,r){let i=e.safeParse(t);return i.success?i.data:(console.warn(`[parse-server-response] schema drift:`,n,`bodyShape=`,typeof t==`object`&&t?Object.keys(t):typeof t,`issues=`,i.error.issues),r)}var _x=new Map,vx=null;function yx(){return Ec(`PREWARM_CORRELATION_WINDOW_MS`,5e3)}function bx(){if(vx!==null)return;let e=Math.max(50,Math.floor(yx()/2));vx=setTimeout(()=>{vx=null,xx(Date.now()),_x.size>0&&bx()},e)}function xx(e){let t=yx();for(let[n,r]of _x)e-r.emittedAt>=t&&(_x.delete(n),Z.count(`ok/sidebar/prewarm`,{hit:!1}))}function Sx(e,t,n=Date.now()){_x.has(e)&&Z.count(`ok/sidebar/prewarm`,{hit:!1}),_x.set(e,{poolEventId:t,emittedAt:n}),bx()}function Cx(e,t,n=Date.now()){let r=_x.get(e);return!r||r.poolEventId!==t||n-r.emittedAt>=yx()?!1:(_x.delete(e),Z(`ok/sidebar/prewarm-clicked`,{docName:e,t:n,poolEventId:t}),Z.count(`ok/sidebar/prewarm`,{hit:!0}),!0)}Ne({event:Oe(`ok-branch-switched-clear-failed`),branch:O(),docName:O(),reason:O()});async function wx(e,t){let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}var Tx=null,Ex=new Set;function Dx(){return Tx}function Ox(e){let t=e!==null&&e.length>0?e:null;if(t!==Tx){Tx=t;for(let e of Ex)try{e()}catch(e){console.warn(`[server-instance-store] subscriber threw:`,e)}}}function kx(e){return Ex.add(e),()=>{Ex.delete(e)}}function Ax(){return(0,Y.useSyncExternalStore)(kx,Dx,Dx)}function jx(e){let t=!1;return()=>{t?e():t=!0}}function Mx(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function Nx(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=rt.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),Ox(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&(wx(e,i.data.currentBranch),dt(i.data.currentBranch)),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Mx(n)}catch{}e.observeDiskAckBatch(t)}}async function Px(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0,paneTarget:typeof r.paneTarget==`string`?r.paneTarget:null}}}function Fx(e){return Ux(e,pt)}function Ix(e){return Ux(e,Mt)}function Lx(e){return Ux(e,kt)}function Rx(e){return Ux(e,st)}function zx(e){return Ux(e,tn)}function Bx(e){let t=Ux(e,zt);if(!t)return null;try{return{docName:t.docName,sv:Vx(t.sv)}}catch{return null}}function Vx(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Hx(e,t){let n=Ix(e);if(n){t.onServerInfo?.(n);return}let r=Lx(e);if(r){t.onBranchSwitched?.(r);return}let i=Bx(e);if(i){t.onDiskAck?.(i);return}let a=Fx(e);if(a){t.onDerivedView?.(a);return}let o=Rx(e);if(o){t.onConfigValidationRejected?.(o);return}let s=zx(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function Ux(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function Wx(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function Gx(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function Kx(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var qx=2e3,Jx=15e3;function Yx(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??qx,r=e.maxDelayMs??Jx,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function Xx(){let e=(0,J.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,Y.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,Y.useRef)(i),[o,s]=(0,Y.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=Gx(window);if(t){r(Kx(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(Kx(t))});return()=>{n()}}let n=Yx({fetchConfig:Px,fallbackUrl:Wx,now:Date.now,setTimeout:eS,clearTimeout:$x,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let l;e[3]===o?l=e[4]:(l=[o],e[3]=o,e[4]=l),(0,Y.useEffect)(c,l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a.current.token=a.current.token+1,r(Qx),s(Zx)},e[5]=u):u=e[5];let d=u,f;return e[6]===n?f=e[7]:(f={...n,retry:d},e[6]=n,e[7]=f),f}function Zx(e){return e+1}function Qx(e){return{...e,terminal:!1,lastError:null}}function $x(e){return globalThis.clearTimeout(e)}function eS(e,t){return globalThis.setTimeout(e,t)}var tS=new Map,nS=new Set;function rS(){for(let e of nS)e()}function iS(e,t){tS.set(e,t),rS()}function aS(e,t){tS.get(e)===t&&(tS.delete(e),rS())}function oS(e){return tS.get(e)??null}function sS(e){return nS.add(e),()=>nS.delete(e)}var cS=new Map;function lS(e){return cS.get(e)}function uS(e,t){cS.set(e,t)}function dS(e){cS.delete(e)}var fS=`open-knowledge-app`,pS=new Map,mS=new Set,hS=1024,gS=1024;function _S(){return cr.getTracer(fS)}function vS(e,t,n){if(mS.has(e))return null;let r=pS.get(e);if(r)return r;if(pS.size>=gS){let e=pS.keys().next().value;if(e!==void 0){let t=pS.get(e);pS.delete(e);try{t?.span.end()}catch(e){console.warn(`[otel-spans] eviction span.end failed:`,e instanceof Error?e:String(e))}}}let i={span:_S().startSpan(`ok.cold-mount`,{attributes:{"mount.id":e,...t},startTime:n}),startTimeMs:n};return pS.set(e,i),i}function yS(e,t,n,r,i){try{let a=vS(e,n,r),o=a?cr.setSpan(lr.active(),a.span):lr.active();_S().startSpan(t,{attributes:{"mount.id":e,...n},startTime:r},o).end(i??Date.now())}catch(e){console.warn(`[otel-spans] emitColdMountChild failed:`,e instanceof Error?e:String(e))}}function bS(e,t){try{let n=pS.get(e);if(n&&(pS.delete(e),n.span.end(t??Date.now())),!mS.has(e)){if(mS.size>=hS){let e=mS.values().next().value;e!==void 0&&mS.delete(e)}mS.add(e)}}catch(e){console.warn(`[otel-spans] finalizeColdMountSpan failed:`,e instanceof Error?e:String(e))}}var xS=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}};function SS(){return Ec(`MOUNT_STALLED_THRESHOLD_MS`,1e4)}function CS(e){e.stalledHandle!==null&&(clearTimeout(e.stalledHandle),e.stalledHandle=null)}function wS(e,t,n){if(e.stalledMarkEmitted)return;e.stalledMarkEmitted=!0;let r=n-e.createdAt;Z(`ok/mount/stalled`,{docName:t,mountId:e.mountId,elapsedMs:r})}var TS=new Map,ES=new Set;function DS(e){ES.add(e);for(let[t,n]of TS)if(n.stalledMarkEmitted&&!n.settled)try{e(t,n.mountId)}catch{}return()=>{ES.delete(e)}}function OS(e,t){for(let n of ES)try{n(e,t.mountId)}catch{}}var kS=!1;function AS(){typeof document>`u`||document.visibilityState===`visible`&&NS(Date.now())}function jS(){kS||typeof document>`u`||typeof document.addEventListener==`function`&&(document.addEventListener(`visibilitychange`,AS),kS=!0)}function MS(){kS&&(typeof document>`u`||typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,AS),kS=!1))}function NS(e){let t=SS();for(let[n,r]of TS)r.settled||r.stalledMarkEmitted||e-r.createdAt<t||(wS(r,n,e),OS(n,r))}function PS(e){let{docName:t,mountId:n,construct:r,sizeStats:i}=e,a=TS.get(t);if(a)return a.promise;let o=new AbortController,s=Date.now(),c=()=>{},l=()=>{},u=new Promise((e,t)=>{c=e,l=t}),d={promise:u,rejectFn:l,controller:o,mountId:n,createdAt:s,settled:!1,resolved:!1,preMountEditor:null,stalledHandle:null,stalledMarkEmitted:!1};return d.stalledHandle=setTimeout(()=>{d.settled||(wS(d,t,Date.now()),OS(t,d))},SS()),o.signal.addEventListener(`abort`,()=>{d.settled||(d.settled=!0,CS(d),d.preMountEditor&&=(RS(t,d.preMountEditor,`aborted`),null),TS.delete(t),TS.size===0&&MS(),Z(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`aborted`}),l(new xS(t)),bS(d.mountId))}),TS.set(t,d),jS(),Z(`ok/mount/create`,{docName:t,mountId:d.mountId}),zS({docName:t,construct:r,sizeStats:i,entry:d,resolveFn:c,rejectFn:l}).catch(e=>{if(d.preMountEditor&&=(RS(t,d.preMountEditor,`backstop`),null),d.settled){Z(`ok/mount/post-settle-throw`,{docName:t,mountId:d.mountId,message:e instanceof Error?e.message:String(e)});return}d.settled=!0,CS(d);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`unhandled-body-throw`}),l(n),bS(d.mountId)}),u}function FS(e){return TS.get(e)?.resolved===!0}function IS(e){return TS.get(e)?.controller??null}function LS(e){let t=TS.get(e);t&&(t.settled=!0,CS(t),t.preMountEditor&&=(RS(e,t.preMountEditor,`aborted`),null),TS.delete(e),TS.size===0&&MS(),Z(`ok/mount/invalidate`,{docName:e,mountId:t.mountId}),bS(t.mountId),t.controller.abort())}function RS(e,t,n){let r=BS(t);try{t.destroy()}catch(t){Z(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function zS(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(bC(t)!==void 0){let e=iC({docName:t,container:s,factory:()=>{throw Error(`mount-promise: V2 cache contract violation — factory invoked on HIT for "${t}"`)}});i.settled=!0,i.resolved=!0,CS(i),a(e);return}if(await scheduler.yield(),i.controller.signal.aborted)return;let c=null;try{c=n()}catch(e){i.settled=!0,CS(i);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`construct-failed`}),o(n),bS(i.mountId);return}if(i.preMountEditor=c.editor,await scheduler.yield(),i.controller.signal.aborted){i.preMountEditor=null;return}try{c.editor.mount(s)}catch(e){RS(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,CS(i);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`mount-failed`}),o(n),bS(i.mountId);return}let l;try{l=iC({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){RS(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,CS(i);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`v2-register-failed`}),o(n),bS(i.mountId);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,CS(i);let u=Date.now()-i.createdAt;Z(`ok/mount/resolve`,{docName:t,mountId:i.mountId,elapsedMs:u}),Z.histogram(`ok/mount/resolve-elapsed-ms`,{docName:t,mountId:i.mountId},u),a(l);let d=Date.now();yS(i.mountId,`ok.mount-promise`,{"doc.name":t,elapsed_ms:u},i.createdAt,d),bS(i.mountId,d)}function BS(e){try{let t=e.state;return Wv.getState(t)?.undoManager??null}catch(e){return Z(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var VS=Ec(`MAX_CACHE`,10),HS=Ec(`VIEW_COUNT_CACHE_THRESHOLD`,50),US=Ec(`BYTES_CACHE_THRESHOLD`,8e6);function WS(e){return!(e.viewCount>0&&e.viewCount>=HS||e.bytes>US)}var GS=new Map,KS=new Map,qS=new Map;function JS(e,t){if(qS.size>=VS){let e=qS.keys().next().value;e!==void 0&&qS.delete(e)}qS.set(e,t),Z(`ok/cache/snapshot-stored`,{toDocName:e,htmlBytes:t.html.length,hasScroll:t.scrollTop>0,hasSelection:t.selection!==null})}function YS(e){return qS.get(e)??null}function XS(e){if(!qS.has(e))return;let t=qS.get(e)??null;qS.delete(e),Z(`ok/cache/snapshot-consumed`,{docName:e,hit:t!==null,hasScroll:t!==null&&t.scrollTop>0,hasSelection:t!==null&&t.selection!==null})}function ZS(){try{return typeof document>`u`?0:document.querySelector(`[data-testid="editor-scroll-container"]`)?.scrollTop??0}catch(e){return Z(`ok/cache/snapshot-scroll-read-failed`,{message:e instanceof Error?e.message:String(e)}),0}}function QS(e){try{let t=e.state.selection;return t instanceof f?{type:`text`,anchor:t.anchor,head:t.head}:t instanceof we?{type:`node`,from:t.from}:null}catch(e){return Z(`ok/cache/snapshot-selection-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}function $S(e){for(let t of e)try{let e=bC(t.fromDocName);if(e&&!e.editor.isDestroyed){if(e.ytext.length===0){Z(`ok/cache/snapshot-skipped-empty`,{fromDocName:t.fromDocName});continue}JS(t.toDocName,{html:e.editor.getHTML(),scrollTop:ZS(),selection:QS(e.editor)})}else Z(`ok/cache/snapshot-skipped`,{fromDocName:t.fromDocName})}catch(e){Z(`ok/cache/snapshot-capture-failed`,{fromDocName:t.fromDocName,message:e instanceof Error?e.message:String(e)})}}var eC=[],tC=[],nC=new Set;function rC(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,e}function iC(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!WS(i)){let e=r(n);return Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=GS.get(t);if(a){if(Z(`ok/cache/reparent-start`,{docName:t,mountId:lS(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),fC(a,n),a.activeMountKey=t,mC(eC,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return Z(`ok/cache/reparent-end`,{docName:t,mountId:lS(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Z(`ok/cache/hit`,{docName:t,mountId:lS(t),kind:`tiptap`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;GS.size>=VS;){let e=hC(eC,t);if(!e)break;oC(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return GS.set(t,s),mC(eC,t),Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function aC(e){let t=e.activeMountKey;if(e.__uncached){t&&LS(t);let n=BS(e.editor);try{e.editor.destroy()}catch(e){Z(`ok/cache/park-destroy-failed`,{docName:t??``,kind:`tiptap`,message:e instanceof Error?e.message:String(e)})}n&&(n.restore=void 0),e.activeMountKey=null;return}let n=uC(e.editor);if(n){e.hadFocus=dC(n.dom),e.scrollTop=(n.scrollDOM??n.dom.parentElement??n.dom).scrollTop??0;let t=n.dom.parentElement;t&&t.removeChild(n.dom),e.parkingNode||=rC(),e.parkingNode&&e.parkingNode.appendChild(n.dom)}e.activeMountKey=null}function oC(e){LS(e);let t=GS.get(e);if(!t)return!1;let n=BS(t.editor);try{t.editor.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}GS.delete(e);let r=eC.indexOf(e);return r!==-1&&eC.splice(r,1),Z(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function sC(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!WS(i)){let e=r(n);return Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=KS.get(t);if(a){if(Z(`ok/cache/reparent-start`,{docName:t,mountId:lS(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),pC(a,n),a.activeMountKey=t,mC(tC,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return Z(`ok/cache/reparent-end`,{docName:t,mountId:lS(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Z(`ok/cache/hit`,{docName:t,mountId:lS(t),kind:`cm`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;KS.size>=VS;){let e=hC(tC,t);if(!e)break;lC(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return KS.set(t,s),mC(tC,t),Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function cC(e){if(e.__uncached){try{e.view.destroy()}catch(t){Z(`ok/cache/park-destroy-failed`,{docName:e.activeMountKey??``,kind:`cm`,message:t instanceof Error?t.message:String(t)})}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=dC(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t),e.parkingNode||=rC(),e.parkingNode&&e.parkingNode.appendChild(t),e.activeMountKey=null}function lC(e){let t=KS.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}KS.delete(e);let n=tC.indexOf(e);return n!==-1&&tC.splice(n,1),Z(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function uC(e){return e.editorView??null}function dC(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function fC(e,t){let n=uC(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function pC(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function mC(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function hC(e,t){for(let n of e)if(n!==t&&!nC.has(n))return n;Z(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:nC.size});for(let n of e)if(n!==t)return n;return null}function gC(e){let t=nC,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=vC(e);if(t)try{t.disconnect(),Z(`ok/cache/disconnect`,{docName:e})}catch(t){Z(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=vC(e);if(!n)continue;let r=t=>{Z(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>Z(`ok/cache/connect`,{docName:e}),e=>r(e)):Z(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}nC=n}var _C=null;function vC(e){let t=GS.get(e);if(t)return t.provider;let n=KS.get(e);if(n)return n.provider;if(_C){let t=_C.entries.get(e);if(t)return t.provider}return null}function yC(e){_C=e;let t=e.onEvict(e=>{oC(e),lC(e)});return()=>{t(),_C===e&&(_C=null)}}function bC(e){return GS.get(e)}var xC=`ok-editor-tabs-v1:`,SC=`\0folder:`,CC=`\0asset:`,wC=`\0doc-tab:`;function TC(e){let t=e.lastIndexOf(wC);return t<0?{baseTabId:e,instanceSuffix:``}:{baseTabId:e.slice(0,t),instanceSuffix:e.slice(t)}}function EC(e){return TC(e).baseTabId}function DC(e){if(typeof e!=`string`||e.length===0)return!1;let t=EC(e);return t.startsWith(SC)?t.length>8:t.startsWith(CC)?t.length>7:!0}function OC(e){return e}function kC(e,t){return`${EC(e)}${wC}${t}`}function AC(e,t){return jC(e,OC(t))}function jC(e,t){let n=BC(e,2**53-1),r=EC(t);if(!n.includes(r))return r;let i=1,a;do a=kC(r,i),i++;while(n.includes(a));return a}function MC(e,t){let n=EC(t);return BC(e,2**53-1).find(e=>EC(e)===n)??null}function NC(e,t){return EC(e)===EC(t)}function PC(e){return`${SC}${e}`}function FC(e){return`${CC}${e}`}function IC(e,t){let n=e.lastIndexOf(`/`),r=n<0?e:e.slice(n+1),i=`${r}${t}`;return n<0?{baseName:r,extension:t,label:i,prefix:``}:{baseName:r,extension:t,label:i,prefix:`${e.slice(0,n)}/`}}function LC(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return OC(e.docName);case`folder`:return PC(e.folderPath);case`missing`:return OC(e.target);case`asset`:return FC(e.assetPath)}}function RC(e){let t=EC(e);return t.startsWith(SC)?{kind:`folder`,folderPath:t.slice(8)}:t.startsWith(CC)?{kind:`asset`,assetPath:t.slice(7)}:{kind:`doc`,docName:t}}function zC(e){let t=RC(e);return t.kind===`doc`?t.docName:null}function BC(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(DC(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function VC(e,t){let n=new Set(BC(t,2**53-1));return BC(e,2**53-1).filter(e=>n.has(e))}function HC(e,t,n){if(t<=0)return[];let r=new Set(BC(n,2**53-1)),i=BC(e,2**53-1);if(r.size===0&&i.length<=t)return i;let a=[],o=0;for(let e=i.length-1;e>=0;e--){let n=i[e];if(r.has(n)){a.push(n);continue}o>=t||(o++,a.push(n))}return a.reverse()}function UC(e,t,n){let r=VC(e,n);return!BC(n,2**53-1).includes(t)||r.includes(t)?r:[...r,t]}function WC(e,t){return BC(e,2**53-1).filter(e=>e!==t)}function GC(e,t){let n=new Set(BC(t,2**53-1));return BC(e,2**53-1).filter(e=>!n.has(e))}function KC(e,t,n){let r=BC(e,2**53-1),i=VC(t,r),a=r.indexOf(n);if(a<0)return i;let o=i.includes(n),s=a<i.length;return o===s?i:s?UC(i,n,r):WC(i,n)}function qC(e,t,n,r=[]){let i=HC(e,n,r);return!DC(t)||i.includes(t)?i:HC([...i,t],n,r)}function JC(e,t,n,r,i=[]){let a=HC(e,r,i);if(!DC(n))return a;if(!t||t===n)return qC(a,n,r,i);let o=a.filter(e=>e!==n),s=o.indexOf(t);if(s<0)return qC(o,n,r,i);let c=[...o];return c[s]=n,HC(c,r,i)}function YC(e,t,n){return XC(e,OC(t),n)}function XC(e,t,{behavior:n,currentTabId:r,limit:i,pinnedTabIds:a=[]}){let o=HC(e,i,a),s=EC(t);if(r&&o.includes(r)&&EC(r)===s)return{tabs:o,activeTabId:r};if(n!==`replace-active`)return{tabs:qC(o,s,i,a),activeTabId:s};let c=MC(o,s);if(c)return{tabs:o,activeTabId:c};let l=jC(o,s);return{tabs:JC(o,r,l,i,a),activeTabId:l}}function ZC(e,t){return e.filter(e=>e!==t)}function QC(e,t,n){let r=BC(t,2**53-1),i=new Set(r),a=new Set(n),o=new Set,s=[];for(let t of e)o.has(t)||!i.has(t)&&!a.has(t)||(o.add(t),s.push(t));for(let e of[...r,...n])o.has(e)||(o.add(e),s.push(e));return s}function $C(e,{pages:t,folderPaths:n,assetPaths:r,keepMissingDocName:i=null}){return BC(e,2**53-1).filter(e=>{let a=RC(e);return a.kind===`folder`?n.has(a.folderPath):a.kind===`asset`?r.has(a.assetPath):t.has(a.docName)||a.docName===i})}function ew(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return BC(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=e=>rw(nw(e,r),a),c=[],l=new Set;for(let t of e){let{instanceSuffix:e}=TC(t),a=RC(t),u=`${a.kind===`doc`?o.get(a.docName)??EC(t):a.kind===`folder`?PC(nw(a.folderPath,r)):FC(s(a.assetPath))}${e}`;if(!l.has(u)&&(l.add(u),c.push(u),i.length===0&&c.length>=n))break}return i.length===0?c:HC(c,n,i.map(e=>{let t=RC(e);return t.kind===`doc`?o.get(t.docName)??e:t.kind===`folder`?PC(nw(t.folderPath,r)):FC(s(t.assetPath))}))}function tw(e,t,n=[],r=[]){return ew(e,t,2**53-1,n,[],r)}function nw(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function rw(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function iw(e,t,n){if(t!==n)return t;let r=e.indexOf(n);return r<0?e[0]??null:e[r+1]??e[r-1]??null}function aw(e,t,n){if(!t)return null;let r=new Set(n);if(!r.has(t))return t;let i=e.indexOf(t);if(i<0)return e.find(e=>!r.has(e))??null;for(let t=i+1;t<e.length;t++)if(!r.has(e[t]))return e[t];for(let t=i-1;t>=0;t--)if(!r.has(e[t]))return e[t];return null}function ow(e,t){if(typeof e!=`object`||!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};let n=e,r=BC(n.openTabs,2**53-1),i=VC(n.pinnedTabIds,r),a=i.length===0?BC(n.openTabs,t):HC(r,t,i),o=VC(n.pinnedTabIds,a),s=typeof n.activeTabId==`string`&&a.includes(n.activeTabId)?n.activeTabId:typeof n.activeDocName==`string`&&a.includes(n.activeDocName)?n.activeDocName:null,c=s?RC(s):null;return{openTabs:a,pinnedTabIds:o,activeDocName:c?.kind===`doc`?c.docName:null,activeTabId:s,updatedAt:typeof n.updatedAt==`string`?n.updatedAt:null}}function sw(e,t,n=[],r=()=>new Date){let i=BC(e,2**53-1),a=t&&i.includes(t)?t:null,o=a?RC(a):null;return{openTabs:i,pinnedTabIds:VC(n,i),activeDocName:o?.kind===`doc`?o.docName:null,activeTabId:a,updatedAt:r().toISOString()}}function cw(e){return`${xC}${e}`}function lw(e,t,n){if(!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};try{let r=e.getItem(t);return r?ow(JSON.parse(r),n):{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}}function uw(e,t,n){if(e)try{e.setItem(t,JSON.stringify(n))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}var dw=Math.floor,fw=(e,t)=>e<t?e:t,pw=(e,t)=>e>t?e:t;Number.isNaN;var mw=128,hw=1<<17,gw=1<<18,_w=1<<19,vw=1<<20,yw=1<<21,bw=1<<22,xw=1<<23,Sw=1<<24,Cw=1<<25,ww=1<<26,Tw=1<<27,Ew=1<<28,Dw=1<<29,Ow=1<<30,kw=127;hw-1,gw-1,_w-1,vw-1,yw-1,bw-1,xw-1,Sw-1,Cw-1,ww-1,Tw-1,Ew-1,Dw-1,Ow-1;var Aw=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var jw=String.fromCharCode;String.fromCodePoint,jw(65535);var Mw=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Nw=typeof TextEncoder<`u`?new TextEncoder:null,Pw=Nw?e=>Nw.encode(e):Mw,Fw=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});Fw&&Fw.decode(new Uint8Array).length===1&&(Fw=null);var Iw=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Lw=(e,t)=>{for(;t>kw;)Iw(e,mw|kw&t),t=dw(t/128);Iw(e,kw&t)},Rw=new Uint8Array(3e4),zw=Rw.length/3,Bw=Nw&&Nw.encodeInto?(e,t)=>{if(t.length<zw){let n=Nw.encodeInto(t,Rw).written||0;Lw(e,n);for(let t=0;t<n;t++)Iw(e,Rw[t])}else Hw(e,Pw(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Lw(e,r);for(let t=0;t<r;t++)Iw(e,n.codePointAt(t))},Vw=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=fw(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(pw(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},Hw=(e,t)=>{Lw(e,t.byteLength),Vw(e,t)},Uw=e=>Error(e),Ww=Uw(`Unexpected end of array`),Gw=Uw(`Integer out of Range`),Kw=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},qw=e=>Kw(e,Yw(e)),Jw=e=>e.arr[e.pos++],Yw=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&kw)*n,n*=128,r<mw)return t;if(t>Aw)throw Gw}throw Ww},Xw=Fw?e=>Fw.decode(qw(e)):e=>{let t=Yw(e);if(t===0)return``;{let n=String.fromCodePoint(Jw(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Jw(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Zw=function(e){return e[e.Token=0]=`Token`,e[e.PermissionDenied=1]=`PermissionDenied`,e[e.Authenticated=2]=`Authenticated`,e}({}),Qw=(e,t)=>{Lw(e,Zw.Token),Bw(e,t)},$w=(e,t,n,r)=>{switch(Yw(e)){case Zw.Token:t();break;case Zw.PermissionDenied:n(Xw(e));break;case Zw.Authenticated:r(Xw(e));break;default:}},eT=e=>Array.from(e.entries()).map(([e,t])=>({clientId:e,...t})),tT=`\0`;function nT(e,t){return e+tT+t}function rT(e){let t=e.indexOf(tT);return t===-1?{documentName:e,sessionId:null}:{documentName:e.substring(0,t),sessionId:e.substring(t+1)}}var iT=function(e){return e[e.Connecting=0]=`Connecting`,e[e.Open=1]=`Open`,e[e.Closing=2]=`Closing`,e[e.Closed=3]=`Closed`,e}({});function aT(e){return e||={},{delay:e.delay===void 0?200:e.delay,initialDelay:e.initialDelay===void 0?0:e.initialDelay,minDelay:e.minDelay===void 0?0:e.minDelay,maxDelay:e.maxDelay===void 0?0:e.maxDelay,factor:e.factor===void 0?0:e.factor,maxAttempts:e.maxAttempts===void 0?3:e.maxAttempts,timeout:e.timeout===void 0?0:e.timeout,jitter:e.jitter===!0,initialJitter:e.initialJitter===!0,handleError:e.handleError===void 0?null:e.handleError,handleTimeout:e.handleTimeout===void 0?null:e.handleTimeout,beforeAttempt:e.beforeAttempt===void 0?null:e.beforeAttempt,calculateDelay:e.calculateDelay===void 0?null:e.calculateDelay}}async function oT(e){return new Promise(t=>setTimeout(t,e))}function sT(e,t){let n=t.delay;if(n===0)return 0;if(t.factor&&(n*=t.factor**(e.attemptNum-1),t.maxDelay!==0&&(n=Math.min(n,t.maxDelay))),t.jitter){let e=Math.ceil(t.minDelay);n=Math.floor(Math.random()*(Math.floor(n)-e+1))+e}return Math.round(n)}async function cT(e,t){let n=aT(t);for(let e of[`delay`,`initialDelay`,`minDelay`,`maxDelay`,`maxAttempts`,`timeout`]){let t=n[e];if(!Number.isInteger(t)||t<0)throw Error(`Value for ${e} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw Error(`Value for factor must be a number greater than or equal to 0`);if(n.delay<n.minDelay)throw Error(`delay cannot be less than minDelay (delay: ${n.delay}, minDelay: ${n.minDelay}`);let r={attemptNum:0,attemptsRemaining:n.maxAttempts?n.maxAttempts:-1,aborted:!1,abort(){r.aborted=!0}},i=n.calculateDelay||sT;async function a(){if(n.beforeAttempt&&n.beforeAttempt(r,n),r.aborted){let e=Error(`Attempt aborted`);throw e.code=`ATTEMPT_ABORTED`,e}let t=async e=>{if(n.handleError&&await n.handleError(e,r,n),r.aborted||r.attemptsRemaining===0)throw e;r.attemptNum++;let t=i(r,n);return t&&await oT(t),a()};return r.attemptsRemaining>0&&r.attemptsRemaining--,n.timeout?new Promise((i,a)=>{let o=setTimeout(()=>{if(n.handleTimeout)try{i(n.handleTimeout(r,n))}catch(e){a(e)}else{let e=Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${n.timeout})`);e.code=`ATTEMPT_TIMEOUT`,a(e)}},n.timeout);e(r,n).then(e=>{clearTimeout(o),i(e)}).catch(e=>{clearTimeout(o),t(e).then(i).catch(a)})}):e(r,n).catch(t)}let o=n.calculateDelay?n.calculateDelay(r,n):n.initialDelay;if(o&&await oT(o),r.attemptNum<1&&n.initialJitter){let e=i(r,n);e&&await oT(e)}return a()}var lT=Math.floor,uT=(e,t)=>e<t?e:t,dT=(e,t)=>e>t?e:t;Number.isNaN;var fT=64,pT=128,mT=1<<17,hT=1<<18,gT=1<<19,_T=1<<20,vT=1<<21,yT=1<<22,bT=1<<23,xT=1<<24,ST=1<<25,CT=1<<26,wT=1<<27,TT=1<<28,ET=1<<29,DT=1<<30,OT=63,kT=127;mT-1,hT-1,gT-1,_T-1,vT-1,yT-1,bT-1,xT-1,ST-1,CT-1,wT-1,TT-1,ET-1,DT-1;var AT=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var jT=()=>new Set,MT=Array.from;Array.isArray;var NT=String.fromCharCode;String.fromCodePoint,NT(65535);var PT=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},FT=typeof TextEncoder<`u`?new TextEncoder:null,IT=FT?e=>FT.encode(e):PT,LT=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});LT&&LT.decode(new Uint8Array).length===1&&(LT=null);var RT=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},zT=()=>new RT,BT=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},VT=e=>{let t=new Uint8Array(BT(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},HT=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},UT=(e,t)=>{for(;t>kT;)HT(e,pT|kT&t),t=lT(t/128);HT(e,kT&t)},WT=new Uint8Array(3e4),GT=WT.length/3,KT=FT&&FT.encodeInto?(e,t)=>{if(t.length<GT){let n=FT.encodeInto(t,WT).written||0;UT(e,n);for(let t=0;t<n;t++)HT(e,WT[t])}else JT(e,IT(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;UT(e,r);for(let t=0;t<r;t++)HT(e,n.codePointAt(t))},qT=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=uT(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(dT(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},JT=(e,t)=>{UT(e,t.byteLength),qT(e,t)},YT=e=>Error(e),XT=YT(`Unexpected end of array`),ZT=YT(`Integer out of Range`),QT=class{constructor(e){this.arr=e,this.pos=0}},$T=e=>new QT(e),eE=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},tE=e=>eE(e,rE(e)),nE=e=>e.arr[e.pos++],rE=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&kT)*n,n*=128,r<pT)return t;if(t>AT)throw ZT}throw XT},iE=e=>{let t=e.arr[e.pos++],n=t&OT,r=64,i=(t&fT)>0?-1:1;if((t&pT)===0)return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&kT)*r,r*=128,t<pT)return i*n;if(n>AT)throw ZT}throw XT},aE=LT?e=>LT.decode(tE(e)):e=>{let t=rE(e);if(t===0)return``;{let n=String.fromCodePoint(nE(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(nE(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},oE=e=>{let t=e.pos,n=aE(e);return e.pos=t,n},sE=Date.now,cE=()=>new Map,lE=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},uE=class{constructor(){this._observers=cE()}on(e,t){lE(this._observers,e,jT).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return MT((this._observers.get(e)||cE()).values()).forEach(e=>e(...t))}destroy(){this._observers=cE()}},dE=Symbol(`Equality`),fE=Object.keys,pE=e=>fE(e).length,mE=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),hE=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[dE]!=null)return e[dE](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!hE(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(pE(e)!==pE(t))return!1;for(let n in e)if(!mE(e,n)||!hE(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!hE(e[n],t[n]))return!1;break;default:return!1}return!0},gE=3e4,_E=class extends uE{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=sE();this.getLocalState()!==null&&gE/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&gE<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&vE(this,t,`timeout`)},lT(gE/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:sE()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),hE(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},vE=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:sE()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},yE=(e,t,n=e.states)=>{let r=t.length,i=zT();UT(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;UT(i,r),UT(i,s),KT(i,JSON.stringify(o))}return VT(i)},bE=(e,t,n)=>{let r=$T(t),i=sE(),a=[],o=[],s=[],c=[],l=rE(r);for(let t=0;t<l;t++){let t=rE(r),n=rE(r),l=JSON.parse(aE(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(hE(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},xE=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}},SE=class{constructor(e){this.data=e,this.encoder=zT(),this.decoder=$T(new Uint8Array(this.data))}peekVarString(){return oE(this.decoder)}readVarUint(){return rE(this.decoder)}readVarString(){return aE(this.decoder)}readVarUint8Array(){return tE(this.decoder)}writeVarUint(e){return UT(this.encoder,e)}writeVarString(e){return KT(this.encoder,e)}writeVarUint8Array(e){return JT(this.encoder,e)}length(){return BT(this.encoder)}},CE=function(e){return e[e.Sync=0]=`Sync`,e[e.Awareness=1]=`Awareness`,e[e.Auth=2]=`Auth`,e[e.QueryAwareness=3]=`QueryAwareness`,e[e.Stateless=5]=`Stateless`,e[e.CLOSE=7]=`CLOSE`,e[e.SyncStatus=8]=`SyncStatus`,e[e.Ping=9]=`Ping`,e[e.Pong=10]=`Pong`,e}({}),wE=function(e){return e.Connecting=`connecting`,e.Connected=`connected`,e.Disconnected=`disconnected`,e}({}),TE=class{constructor(){this.encoder=zT()}get(e){return e.encoder}toUint8Array(){return VT(this.encoder)}},EE=class extends TE{constructor(...e){super(...e),this.type=CE.CLOSE,this.description=`Ask the server to close the connection`}get(e){return KT(this.encoder,e.documentName),UT(this.encoder,this.type),this.encoder}},DE=class e extends xE{static{this.DEDUPLICATABLE_TYPES=new Set([CE.Awareness,CE.QueryAwareness])}constructor(e){super(),this.messageQueue=[],this.configuration={url:``,autoConnect:!0,preserveTrailingSlash:!1,document:void 0,WebSocketPolyfill:void 0,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,handleTimeout:null,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=wE.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on(`open`,this.configuration.onOpen),this.on(`open`,this.onOpen.bind(this)),this.on(`connect`,this.configuration.onConnect),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`status`,this.configuration.onStatus),this.on(`disconnect`,this.configuration.onDisconnect),this.on(`close`,this.configuration.onClose),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`close`,this.onClose.bind(this)),this.on(`message`,this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),this.shouldConnect&&this.connect()}async onOpen(e){this.status=wE.Connected,this.emit(`status`,{status:wE.Connected}),this.cancelWebsocketRetry=void 0,this.receivedOnOpenPayload=e}attach(e){let t=e.effectiveName,n=this.configuration.providerMap.get(t);if(n&&n!==e&&n.isAuthenticated)throw Error(`Cannot attach two providers with the same effective name "${t}". Use sessionAwareness: true to multiplex providers with the same document name.`);this.configuration.providerMap.set(t,e),this.status===wE.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&this.status===wE.Connected&&e.onOpen(this.receivedOnOpenPayload)}detach(e){let t=e.effectiveName;this.configuration.providerMap.has(t)&&(e.send(EE,{documentName:t}),this.configuration.providerMap.delete(t))}setConfiguration(e={}){this.configuration={...this.configuration,...e},this.configuration.autoConnect||(this.shouldConnect=!1)}async connect(){if(this.status===wE.Connected)return;this.cancelWebsocketRetry&&=(this.cancelWebsocketRetry(),void 0),this.receivedOnOpenPayload=void 0,this.shouldConnect=!0;let{retryPromise:e,cancelFunc:t}=(()=>{let e=!1;return{retryPromise:cT(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,handleTimeout:this.configuration.handleTimeout,beforeAttempt:t=>{(!this.shouldConnect||e)&&t.abort()}}).catch(e=>{if(e&&e.code!==`ATTEMPT_ABORTED`)throw e}),cancelFunc:()=>{e=!0}}})();return this.cancelWebsocketRetry=t,e}attachWebSocketListeners(e,t){let{identifier:n}=e,r=e=>this.emit(`message`,e),i=e=>this.emit(`close`,{event:e}),a=e=>this.emit(`open`,e),o=e=>{t(e)};this.webSocketHandlers[n]={message:r,close:i,open:a,error:o};let s=this.webSocketHandlers[e.identifier];Object.keys(s).forEach(t=>{e.addEventListener(t,s[t])})}cleanupWebSocket(){if(!this.webSocket)return;let{identifier:e}=this.webSocket,t=this.webSocketHandlers[e];Object.keys(t).forEach(n=>{this.webSocket?.removeEventListener(n,t[n]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,t)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;let n=new this.configuration.WebSocketPolyfill(this.url);n.binaryType=`arraybuffer`,n.identifier=this.identifier,this.attachWebSocketListeners(n,t),this.webSocket=n,this.status=wE.Connecting,this.emit(`status`,{status:wE.Connecting}),this.connectionAttempt={resolve:e,reject:t}})}onMessage(e){this.resolveConnectionAttempt(),this.lastMessageReceived=sE();let t=new Uint8Array(e.data);if(t.length===1&&t[0]===CE.Ping){this.sendPong();return}let n=new SE(t).peekVarString();this.configuration.providerMap.get(n)?.onMessage(e)}sendPong(){let e=zT();UT(e,CE.Pong),this.send(VT(e))}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=wE.Connected,this.emit(`status`,{status:wE.Connected}),this.emit(`connect`),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){this.connectionAttempt?.reject(),this.connectionAttempt=null}checkConnection(){this.status===wE.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=sE()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:`forced`}}),this.closeTries=0):(this.webSocket?.close(),this.messageQueue=[])))}get serverUrl(){if(this.configuration.preserveTrailingSlash)return this.configuration.url;let e=this.configuration.url;for(;e[e.length-1]===`/`;)e=e.slice(0,e.length-1);return e}get url(){return this.serverUrl}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch(e){console.error(e)}}parseQueuedMessage(e){try{let t=$T(e);return{documentName:aE(t),messageType:rE(t)}}catch{return null}}addToQueue(t){if(t instanceof Uint8Array){let n=this.parseQueuedMessage(t);n&&e.DEDUPLICATABLE_TYPES.has(n.messageType)&&(this.messageQueue=this.messageQueue.filter(e=>{if(!(e instanceof Uint8Array))return!0;let t=this.parseQueuedMessage(e);return t?!(t.documentName===n.documentName&&t.messageType===n.messageType):!0}))}this.messageQueue.push(t)}send(e){this.webSocket?.readyState===iT.Open?this.webSocket.send(e):this.addToQueue(e)}onClose({event:e}){this.closeTries=0,this.cleanupWebSocket(),this.connectionAttempt&&this.rejectConnectionAttempt(),this.status=wE.Disconnected,this.emit(`status`,{status:wE.Disconnected}),this.emit(`disconnect`,{event:e}),!this.cancelWebsocketRetry&&this.shouldConnect&&setTimeout(()=>{this.connect()},this.configuration.delay)}destroy(){this.emit(`destroy`),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}},OE=0,kE=1,AE=2,jE=(e,t)=>{UT(e,OE),JT(e,xh(t))},ME=(e,t,n)=>{UT(e,kE),JT(e,hh(t,n))},NE=(e,t,n)=>ME(t,n,tE(e)),PE=(e,t,n,r)=>{try{fh(t,tE(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},FE=(e,t)=>{UT(e,AE),JT(e,t)},IE=PE,LE=(e,t,n,r,i)=>{let a=rE(e);switch(a){case OE:NE(e,t,n);break;case kE:PE(e,n,r,i);break;case AE:IE(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},RE=class{constructor(e){this.message=e}apply(e,t){let{message:n}=this,r=n.readVarUint(),i=n.length();switch(r){case CE.Sync:this.applySyncMessage(e,t);break;case CE.Awareness:this.applyAwarenessMessage(e);break;case CE.Auth:this.applyAuthMessage(e);break;case CE.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case CE.Stateless:e.receiveStateless(aE(n.decoder));break;case CE.SyncStatus:this.applySyncStatusMessage(e,iE(n.decoder)===1);break;case CE.CLOSE:let i={code:1e3,reason:aE(n.decoder)};e.onClose(),e.configuration.onClose({event:i}),e.forwardClose({event:i});break;default:console.error(`Can’t apply message of unknown type: ${r}`)}n.length()>i+1&&e.send(TE,{encoder:n.encoder})}applySyncMessage(e,t){let{message:n}=this;n.writeVarUint(CE.Sync);let r=LE(n.decoder,n.encoder,e.document,e);t&&r===kE&&(e.synced=!0)}applySyncStatusMessage(e,t){t&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;bE(e.awareness,t.readVarUint8Array(),e)}applyAuthMessage(e){let{message:t}=this;$w(t.decoder,e.sendToken.bind(e),e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;t.writeVarUint(CE.Awareness),t.writeVarUint8Array(yE(e.awareness,Array.from(e.awareness.getStates().keys())))}},zE=class{constructor(e,t={}){this.message=new e,this.encoder=this.message.get(t)}create(){return VT(this.encoder)}send(e){e?.send(this.create())}},BE=`4.0.0-rc.1`,VE=class extends TE{constructor(...e){super(...e),this.type=CE.Auth,this.description=`Authentication`}get(e){if(e.token===void 0)throw Error("The authentication message requires `token` as an argument.");return KT(this.encoder,e.documentName),UT(this.encoder,this.type),Qw(this.encoder,e.token),KT(this.encoder,BE),this.encoder}},HE=class extends TE{constructor(...e){super(...e),this.type=CE.Awareness,this.description=`Awareness states update`}get(e){if(e.awareness===void 0)throw Error(`The awareness message requires awareness as an argument`);if(e.clients===void 0)throw Error(`The awareness message requires clients as an argument`);KT(this.encoder,e.documentName),UT(this.encoder,this.type);let t;return t=e.states===void 0?yE(e.awareness,e.clients):yE(e.awareness,e.clients,e.states),JT(this.encoder,t),this.encoder}},UE=class extends TE{constructor(...e){super(...e),this.type=CE.Stateless,this.description=`A stateless message`}get(e){return KT(this.encoder,e.documentName),UT(this.encoder,this.type),KT(this.encoder,e.payload??``),this.encoder}},WE=class extends TE{constructor(...e){super(...e),this.type=CE.Sync,this.description=`First sync step`}get(e){if(e.document===void 0)throw Error(`The sync step one message requires document as an argument`);return KT(this.encoder,e.documentName),UT(this.encoder,this.type),jE(this.encoder,e.document),this.encoder}},GE=class extends TE{constructor(...e){super(...e),this.type=CE.Sync,this.description=`A document update`}get(e){return KT(this.encoder,e.documentName),UT(this.encoder,this.type),FE(this.encoder,e.update),this.encoder}},KE=class extends Error{constructor(...e){super(...e),this.code=1001}},qE=class extends xE{get effectiveName(){return this.configuration.sessionAwareness?nT(this.configuration.name,this.sessionId):this.configuration.name}constructor(e){super(),this.configuration={name:``,document:void 0,awareness:void 0,token:null,sessionAwareness:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onSynced:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,onUnsyncedChanges:()=>null},this.isSynced=!1,this.unsyncedChanges=0,this.isAuthenticated=!1,this.authorizedScope=void 0,this.manageSocket=!1,this._isAttached=!1,this.sessionId=Math.random().toString(36).slice(2),this.intervals={forceSync:null},this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.forwardConnect=()=>this.emit(`connect`),this.forwardStatus=e=>this.emit(`status`,e),this.forwardClose=e=>this.emit(`close`,e),this.forwardDisconnect=e=>this.emit(`disconnect`,e),this.forwardDestroy=()=>this.emit(`destroy`),this.setConfiguration(e),this.configuration.document=e.document?e.document:new Xm,this.configuration.awareness=e.awareness===void 0?new _E(this.document):e.awareness,this.on(`open`,this.configuration.onOpen),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`synced`,this.configuration.onSynced),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`stateless`,this.configuration.onStateless),this.on(`unsyncedChanges`,this.configuration.onUnsyncedChanges),this.on(`authenticated`,this.configuration.onAuthenticated),this.on(`authenticationFailed`,this.configuration.onAuthenticationFailed),this.awareness?.on(`update`,()=>{this.emit(`awarenessUpdate`,{states:eT(this.awareness.getStates())})}),this.awareness?.on(`change`,()=>{this.emit(`awarenessChange`,{states:eT(this.awareness.getStates())})}),this.document.on(`update`,this.boundDocumentUpdateHandler),this.awareness?.on(`update`,this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&typeof this.configuration.forceSyncInterval==`number`&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.manageSocket&&this.attach()}setConfiguration(e={}){e.websocketProvider||(this.manageSocket=!0,this.configuration.websocketProvider=new DE(e)),this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get isAttached(){return this._isAttached}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}decrementUnsyncedChanges(){this.unsyncedChanges>0&&--this.unsyncedChanges,this.unsyncedChanges===0&&(this.synced=!0),this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}forceSync(){this.resetUnsyncedChanges(),this.send(WE,{document:this.document,documentName:this.effectiveName})}pageHide(){this.awareness&&vE(this.awareness,[this.document.clientID],`page hide`)}registerEventListeners(){typeof window>`u`||!(`addEventListener`in window)||window.addEventListener(`pagehide`,this.boundPageHide)}sendStateless(e){this.send(UE,{documentName:this.effectiveName,payload:e})}async sendToken(){let e;try{e=await this.getToken()}catch(e){this.permissionDeniedHandler(`Failed to get token during sendToken(): ${e}`);return}this.send(VE,{token:e??``,documentName:this.effectiveName})}documentUpdateHandler(e,t){t!==this&&(this.incrementUnsyncedChanges(),this.send(GE,{update:e,documentName:this.effectiveName}))}awarenessUpdateHandler({added:e,updated:t,removed:n},r){let i=e.concat(t).concat(n);this.send(HE,{awareness:this.awareness,clients:i,documentName:this.effectiveName})}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,e&&this.emit(`synced`,{state:e}))}receiveStateless(e){this.emit(`stateless`,{payload:e})}async connect(){if(this.manageSocket)return this.configuration.websocketProvider.connect();console.warn(`HocuspocusProvider::connect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}disconnect(){if(this.manageSocket)return this.configuration.websocketProvider.disconnect();console.warn(`HocuspocusProvider::disconnect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}async onOpen(e){this.isAuthenticated=!1,this.emit(`open`,{event:e}),await this.sendToken(),this.startSync()}async getToken(){return typeof this.configuration.token==`function`?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(WE,{document:this.document,documentName:this.effectiveName}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(HE,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.effectiveName})}send(e,t){if(!this._isAttached)return;let n=new zE(e,t);this.emit(`outgoingMessage`,{message:n.message}),n.send(this.configuration.websocketProvider)}onMessage(e){let t=new SE(e.data),{documentName:n}=rT(t.readVarString());t.writeVarString(this.effectiveName),this.emit(`message`,{event:e,message:new SE(e.data)}),new RE(t).apply(this,!0)}onClose(){this.isAuthenticated=!1,this.synced=!1,this.awareness&&vE(this.awareness,Array.from(this.awareness.getStates().keys()).filter(e=>e!==this.document.clientID),this)}destroy(){this.emit(`destroy`),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(vE(this.awareness,[this.document.clientID],`provider destroy`),this.awareness.off(`update`,this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off(`update`,this.boundDocumentUpdateHandler),this.removeAllListeners(),this.detach(),this.manageSocket&&this.configuration.websocketProvider.destroy(),!(typeof window>`u`||!(`removeEventListener`in window))&&window.removeEventListener(`pagehide`,this.boundPageHide)}detach(){this.configuration.websocketProvider.off(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.off(`connect`,this.forwardConnect),this.configuration.websocketProvider.off(`status`,this.forwardStatus),this.configuration.websocketProvider.off(`status`,this.configuration.onStatus),this.configuration.websocketProvider.off(`open`,this.boundOnOpen),this.configuration.websocketProvider.off(`close`,this.boundOnClose),this.configuration.websocketProvider.off(`close`,this.configuration.onClose),this.configuration.websocketProvider.off(`close`,this.forwardClose),this.configuration.websocketProvider.off(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.off(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.off(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.off(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.detach(this),this._isAttached=!1}attach(){this._isAttached||=(this.configuration.websocketProvider.on(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.on(`connect`,this.forwardConnect),this.configuration.websocketProvider.on(`status`,this.configuration.onStatus),this.configuration.websocketProvider.on(`status`,this.forwardStatus),this.configuration.websocketProvider.on(`open`,this.boundOnOpen),this.configuration.websocketProvider.on(`close`,this.boundOnClose),this.configuration.websocketProvider.on(`close`,this.configuration.onClose),this.configuration.websocketProvider.on(`close`,this.forwardClose),this.configuration.websocketProvider.on(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.on(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.on(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.on(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.attach(this),!0)}permissionDeniedHandler(e){this.emit(`authenticationFailed`,{reason:e}),this.isAuthenticated=!1}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit(`authenticated`,{scope:e})}setAwarenessField(e,t){if(!this.awareness)throw new KE(`Cannot set awareness field "${e}" to ${JSON.stringify(t)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,t)}},JE=e=>rf((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),YE=(e,t)=>rf((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(kd(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),XE=e=>JE(indexedDB.deleteDatabase(e)),ZE=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),QE=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>lD(r,e))},$E=(e,t)=>JE(e.count(t)),eD=(e,t)=>JE(e.get(t)),tD=(e,t)=>JE(e.delete(t)),nD=(e,t,n)=>JE(e.put(t,n)),rD=(e,t)=>JE(e.add(t)),iD=(e,t,n)=>JE(e.getAll(t,n)),aD=(e,t,n)=>{let r=null;return cD(e,t,e=>(r=e,!1),n).then(()=>r)},oD=(e,t=null)=>aD(e,t,`prev`),sD=(e,t)=>rf((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),cD=(e,t,n,r=`next`)=>sD(e.openKeyCursor(t,r),e=>n(e.key)),lD=(e,t)=>e.objectStore(t),uD=(e,t)=>IDBKeyRange.upperBound(e,t),dD=(e,t)=>IDBKeyRange.lowerBound(e,t),fD=`custom`,pD=`updates`,mD=(e,t=()=>{},n=()=>{})=>{let[r]=QE(e.db,[pD]);return iD(r,dD(e._dbref,!1)).then(i=>{e._destroyed||(t(r),dg(e.doc,()=>{i.forEach(t=>fh(e.doc,t))},e,!1),n(r))}).then(()=>oD(r).then(t=>{e._dbref=t+1})).then(()=>$E(r).then(t=>{e._dbsize=t})).then(()=>r)},hD=(e,t=!0)=>mD(e).then(n=>{(t||e._dbsize>=500)&&rD(n,hh(e.doc)).then(()=>tD(n,uD(e._dbref,!0))).then(()=>$E(n).then(t=>{e._dbsize=t}))}),gD=class extends Su{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=YE(e,e=>ZE(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=rf(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,mD(this,async e=>{await $E(e)>0&&rD(e,hh(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=QE(this.db,[pD]);rD(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{hD(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{XE(this.name)})}get(e){return this._db.then(t=>{let[n]=QE(t,[fD],`readonly`);return eD(n,e)})}set(e,t){return this._db.then(n=>{let[r]=QE(n,[fD]);return nD(r,t,e)})}del(e){return this._db.then(t=>{let[n]=QE(t,[fD]);return tD(n,e)})}};function _D(){return!0}var vD=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`;let i=_D()?0:performance.now();this._idb=new gD(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!_D()){let e=performance.now();Z(`ok/pool/idb-whensynced`,{docName:n,durationMs:Math.round((e-i)*1e3)/1e3},{startTime:i,duration:e-i})}return this})}get synced(){return this._idb.synced}async destroy(){let e=_D()?0:performance.now();try{await this._idb.destroy()}finally{if(!_D()){let t=performance.now();Z(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async clearData(){let e=_D()?0:performance.now();try{await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e}))}})}finally{if(!_D()){let t=performance.now();Z(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function yD(e){return new vD(e)}function bD(e){return xh(e)}function xD(e,t){return t===null?hh(e):hh(e,t)}function SD(e,t){if(e===null)return t;if(t===null)return e;let n=_h(e),r=_h(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return xh(i)}function CD(e){let t={};if(ur.inject(lr.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,r=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&r.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${r.join(`&`)}`}var wD=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new S({key:e||new b(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),TD=Wt.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[wD({key:new b(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function ED(e,t){let{state:n,view:r}=e;if(!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount!==0||!we.isSelectable(o))return!1;try{let t=we.create(n.doc,s);return e.view.dispatch(n.tr.setSelection(t).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return it(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L0`,reason:e.message.slice(0,500)})),!0}}function DD(e){let{state:t,view:n}=e;if(!(t.selection instanceof f)||!t.selection.empty||!n.endOfTextblock(`up`))return!1;let r=t.selection.$head,i=-1;for(let e=r.depth-1;e>=1;e--)if(r.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;for(let e=r.depth;e>i;e--)if(r.index(e-1)!==0)return!1;let a=r.before(i);try{let n=t.doc.resolve(a),r=le.findFrom(n,-1,!0);return!r||!(r instanceof f)?!1:(e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return it(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2c`,reason:e.message.slice(0,500)})),!0}}var OD=Wt.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof we){let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=f.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof f?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{if(ED(e,`up`)||DD(e))return!0;let{state:t}=e;if(!(t.selection instanceof we))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=we.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return it(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowDown:({editor:e})=>{if(ED(e,`down`))return!0;let{state:t}=e;if(!(t.selection instanceof we))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=we.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return it(`down`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`down`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowLeft:({editor:e})=>ED(e,`left`),ArrowRight:({editor:e})=>ED(e,`right`),Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof f)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let p=u+1;return s.setSelection(f.create(s.doc,p)),e.view.dispatch(s.scrollIntoView()),!0}}}}),kD={query:``,options:{caseSensitive:!1,wholeWord:!1},activeIndex:0,matches:[]},AD=/[A-Za-z0-9_]/;function jD(e){return e!==void 0&&AD.test(e)}function MD(e,t,n){return!jD(e[t-1])&&!jD(e[n])}function ND(e,t,n){if(t.length===0)return[];let r=n.caseSensitive?e:e.toLocaleLowerCase(),i=n.caseSensitive?t:t.toLocaleLowerCase(),a=[],o=0;for(;o<=r.length-i.length;){let t=r.indexOf(i,o);if(t===-1)break;let s=t+i.length;(!n.wholeWord||MD(e,t,s))&&a.push({start:t,end:s,text:e.slice(t,s)}),o=s}return a}function PD(e,t,n){if(t.length===0)return[];let r=[];return e.descendants((e,i)=>{if(!(!e.isText||typeof e.text!=`string`))for(let a of ND(e.text,t,n))r.push({from:i+a.start,to:i+a.end,text:a.text})}),r}var FD=new b(`findReplace`);function ID(e,t){return t<=0||!Number.isFinite(e)?0:Math.min(Math.max(Math.trunc(e),0),t-1)}function LD(e,t,n,r){let i=PD(e.doc,t,n);return{query:t,options:n,activeIndex:ID(r,i.length),matches:i}}function RD(e,t,n){return t<=0?0:(ID(e,t)+n+t)%t}function zD(e,t,n){if(e.length===0)return 0;let r=t+n,i=e.findIndex(e=>e.from>=r);return i===-1?0:i}function BD(e,t,n){if(t.matches.length===0)return null;let r=e.tr;for(let e of[...t.matches].reverse())r.insertText(n,e.from,e.to);let i=PD(r.doc,t.query,t.options),a=ID(0,i.length),o=i[a];return r.setMeta(FD,{type:`setActiveIndex`,activeIndex:a}),o&&r.setSelection(f.create(r.doc,o.from,o.to)),r.scrollIntoView()}function VD(e,t){let n=FD.getState(e)?.matches[t];return n?e.tr.setMeta(FD,{type:`setActiveIndex`,activeIndex:t}).setSelection(f.create(e.doc,n.from,n.to)).scrollIntoView():null}function HD(e){return FD.getState(e)??kD}function UD(){return new S({key:FD,state:{init:()=>kD,apply(e,t,n,r){let i=e.getMeta(FD);if(i?.type===`clear`)return kD;let a=t.query,o=t.options,s=t.activeIndex;if(i?.type===`setQuery`)a=i.query,o={...o,...i.options},s=i.activeIndex??0;else if(i?.type===`setOptions`)o={...o,...i.options},s=i.activeIndex??s;else if(i?.type===`setActiveIndex`)s=i.activeIndex;else if(!e.docChanged)return t;return a.length===0?{query:a,options:o,activeIndex:0,matches:[]}:LD(r,a,o,s)}},props:{decorations(e){let t=FD.getState(e);return!t||t.matches.length===0?null:ye.create(e.doc,t.matches.map((e,n)=>ln.inline(e.from,e.to,{class:n===t.activeIndex?`ok-find-match ok-find-match-active`:`ok-find-match`})))}}})}var WD=Wt.create({name:`findReplace`,addCommands(){return{setFindQuery:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(FD,{type:`setQuery`,query:e,options:t?.options,activeIndex:t?.activeIndex})),!0),setFindOptions:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(FD,{type:`setOptions`,options:e,activeIndex:t})),!0),setActiveFindIndex:e=>({state:t,dispatch:n})=>(n&&n(t.tr.setMeta(FD,{type:`setActiveIndex`,activeIndex:e})),!0),selectNextFindMatch:()=>({state:e,dispatch:t})=>{let n=HD(e),r=VD(e,RD(n.activeIndex,n.matches.length,1));return r?(t?.(r),!0):!1},selectPreviousFindMatch:()=>({state:e,dispatch:t})=>{let n=HD(e),r=VD(e,RD(n.activeIndex,n.matches.length,-1));return r?(t?.(r),!0):!1},replaceCurrentFindMatch:e=>({state:t,dispatch:n})=>{let r=HD(t),i=r.matches[r.activeIndex];if(!i||!n)return!1;let a=t.tr.insertText(e,i.from,i.to),o=PD(a.doc,r.query,r.options),s=zD(o,i.from,e.length),c=o[s];return a.setMeta(FD,{type:`setActiveIndex`,activeIndex:s}),c&&a.setSelection(f.create(a.doc,c.from,c.to)),a.scrollIntoView(),n(a),!0},replaceAllFindMatches:e=>({state:t,dispatch:n})=>{let r=HD(t);if(!n)return!1;let i=BD(t,r,e);return i?(n(i),!0):!1},clearFindMatches:()=>({state:e,dispatch:t})=>(t&&t(e.tr.setMeta(FD,{type:`clear`})),!0)}},addProseMirrorPlugins(){return[UD()]}}),GD=new WeakMap;function KD(e,t){if(t===null){GD.delete(e);return}GD.set(e,t)}function qD(e){return GD.get(e)??null}function JD(e){return`pagesBySlug`in e}function YD(e){return JD(e)?e.pages:e}function XD(e,t){return JD(e)?e.assetPaths??new Set:t??new Set}function ZD(e,t){let n=A(e);if(n){if(JD(t))return t.pagesBySlug.get(n);for(let e of t)if(A(e)===n)return e}}function QD(e,t){if(e.includes(`/`))return;let n=A(e);if(!n)return;if(JD(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);A(t===-1?e:e.slice(t+1))===n&&(r===void 0||e.localeCompare(r)<0)&&(r=e)}return r}function $D(e){let t=e.trim();if(!t)return null;let n=A(t);return n?{target:n,alias:n===t?null:t,anchor:null}:null}function eO(e){let t=e.trim();if(!t)return[];let n=A(t);return n.length>0&&n!==t?[n]:[]}function tO(e,t){let n=e.trim();if(!n)return;let r=YD(t);if(r.has(n))return n;let i=ZD(n,t);if(i)return i;for(let e of eO(n))if(r.has(e))return e;return nO(n,r)||QD(n,t)}function nO(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function rO(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function iO(e,t){let n=rO(e);if(!n)return null;if(t.has(n))return n;let r=n.toLowerCase();for(let e of t)if(e.toLowerCase()===r)return e;if(n.includes(`/`))return null;let i=[...t].filter(e=>{let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()===r});return i.length===0?null:i.sort((e,t)=>e.localeCompare(t))[0]??null}function aO(e,t,n){let r=e.trim();if(!r)return!1;if(iO(r,XD(t,n)))return!0;let i=YD(t);return i.has(r)||eO(r).some(e=>i.has(e))||ZD(r,t)!==void 0||nO(r,i)?!0:QD(r,t)!==void 0}var oO=class extends Error{status;instance;constructor(e,t={}){super(e,t.cause===void 0?void 0:{cause:t.cause}),this.name=`HttpResponseParseError`,this.status=t.status,this.instance=t.instance}},sO=new b(`imageUpload`);function cO(e){let t=document.createElement(`div`);t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`);let n=e?.name;return t.setAttribute(`aria-label`,n?B._({id:`KDuPiY`,values:{fileName:n}}):B._({id:`bGa3Fk`})),t}var lO=new S({key:sO,state:{init(){return{decorations:ye.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(sO);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=ln.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return sO.getState(e)?.decorations??ye.empty}}});function uO(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function dO(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function fO(e){return e.split(`/`).filter(e=>e!==``)}function pO(e,t){let n=uO(e),r=uO(t),i=dO(e);if(n===r)return i;let a=fO(r),o=fO(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function mO(e){return qD(e)}function hO(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t}:{src:t,controls:!0}}}}function gO(e){let t=Ie(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:g.has(t)?{kind:`jsx-img`,ext:t}:Ke.has(t)?{kind:`jsx-video`,ext:t}:Qe.has(t)?{kind:`jsx-audio`,ext:t}:ie.has(t)?{kind:`jsx-file`,ext:t}:an.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function _O(e,t,n){let r=mO(t),i=r?`${r}.md`:``;if(!i){nr.error(B._({id:`z5pqI8`}));return}let a=crypto.randomUUID(),o=cO(e);t.view.dispatch(t.state.tr.setMeta(sO,{type:`add`,id:a,pos:n,widget:o}));let s=new FormData;s.append(`file`,e),s.append(`parentDocName`,i);let c;try{c=await fetch(`/api/upload`,{method:`POST`,body:s})}catch(e){console.error(`[uploadAndInsert] Network error:`,e),vO(t,a);return}let u;try{u=await c.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),vO(t,a);return}if(!c.ok){let e=lt.safeParse(u);if(!e.success){let n=new oO(`Upload response did not match ProblemDetails.`,{cause:e.error,status:c.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),vO(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),vO(t,a,e.data.title);return}let d=mt.safeParse(u);if(!d.success){let e=new oO(`Upload success response did not match UploadAssetSuccess.`,{cause:d.error,status:c.status});console.error(`[uploadAndInsert] Response missing src:`,e),vO(t,a);return}let f=d.data,p=f.src,m=f.deduped===!0,h=uO(i),g=typeof f.path==`string`&&f.path.length>0?f.path:h?`${h}/${p}`:p;m&&nr.info(B._({id:`VbqhBI`,values:{assetContentPath:g}}));let _=gO(e.name),{state:v}=t,y=sO.getState(v)?.uploads.get(a)??n,b=v.tr.setMeta(sO,{type:`remove`,id:a}),x=pO(g,i),S=`/${g}`;if(_.kind===`jsx-file`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),vO(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:S,target:p,alias:null,anchor:null,size:l(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(sO,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(we.create(e.doc,n)),!0}).run();return}if(_.kind===`jsx-img`||_.kind===`jsx-video`||_.kind===`jsx-audio`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),vO(t,a);return}let e=hO(_.kind,S);t.chain().command(({tr:e})=>(e.setMeta(sO,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(we.create(e.doc,n)),!0}).run();return}if(_.kind===`wikiembed`){let e=v.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),vO(t,a);return}b.insert(y,e.create({target:p,alias:null,anchor:null,resolvedSrc:S}))}else if(_.kind===`wiki-link`){let n=v.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),vO(t,a);return}let r=$D(e.name.replace(/\.(md|mdx)$/i,``));r?b.insert(y,n.create(r)):b.insert(y,v.schema.text(e.name))}else{let t=v.schema.marks.link;if(t){let n=v.schema.text(e.name,[t.create({href:x})]);b.insert(y,n)}else b.insert(y,v.schema.text(e.name))}t.view.dispatch(b)}function vO(e,t,n){e.view.dispatch(e.state.tr.setMeta(sO,{type:`remove`,id:t})),nr.error(n??B._({id:`b3Thhd`}))}var yO=new Set;function bO(e){yO.add(e)}function xO(e){return yO.delete(e)}var SO=new b(`markIdentity`);function CO(){return{byId:new Map,counter:0}}function wO(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&TO(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function TO(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&!(typeof n==`object`&&n&&typeof i==`object`&&i&&TO(n,i)))return!1}return!0}function EO(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function DO(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new S({key:SO,state:{init(e,t){return wO(t.doc,CO(),a,n)},apply(e,t,r,i){return e.docChanged?wO(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=SO.getState(t.state);n&&(e=EO(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}var OO=300,kO=150,AO=500,jO=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function MO(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}function NO(e){return e?e.closest(`[data-ok-prop-panel]`)!==null:!1}function PO(){return typeof document>`u`?!1:document.querySelector(`[data-ok-layer-spawned]`)!==null}var FO=e=>{let t=(0,J.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,Y.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Y.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,X.jsxs)(X.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function IO(e){return e.editorView?.dom??null}function LO(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function RO(e){let{editor:t}=e,n=new jO,r=IO(t),i=!1,a=null,o=null,s=null,c=null,l=null,u=()=>{a!==null&&(clearTimeout(a),a=null),s=null},d=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{c!==null&&(clearTimeout(c),c=null)},p=e=>{if(n.getActiveNode()===e){d();return}s===e&&a!==null||(u(),d(),s=e,a=setTimeout(()=>{a=null,s=null,n.setActiveNode(e)},OO))},m=()=>{n.getActiveNode()!==null&&o===null&&(o=setTimeout(()=>{o=null,!PO()&&n.setActiveNode(null)},kO))},h=null,g=!1,_=e=>{try{g=!0,e.focus({preventScroll:!0})}catch{}finally{g=!1}},v=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;h=t&&LO(t,e)?t:null}return}if(typeof document>`u`)return;let i=h;if(h=null,i&&document.contains(i)&&typeof i.focus==`function`){_(i);return}let a=r??IO(t);a&&typeof a.focus==`function`&&_(a)}),y=e=>{let t=e;if(t.button!==2){if(t.metaKey||t.ctrlKey||t.button===1){u(),t.button===1&&t.preventDefault?.();return}if(t.pointerType===`touch`){let t=MO(e.target,n);if(t===null)return;f(),c=setTimeout(()=>{c=null,l=t,n.setActiveNode(t)},AO);return}u()}},b=()=>{f()},x=e=>{e.pointerType===`touch`&&c!==null&&f()},S=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1)return;let r=MO(e.target,n);if(r===null)return;if(l!==null){let e=l===r;if(l=null,e){t.preventDefault?.();return}}let i=t.metaKey||t.ctrlKey||t.button===1,a=n.getRegistration(r);if(a?.handlePrimary&&a.handlePrimary({nodeId:r,type:a.type,newTab:i})){t.preventDefault?.(),i||(u(),d(),n.getActiveNode()===r&&n.setActiveNode(null));return}i||(u(),d(),n.setActiveNode(r))},C=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(u(),d(),n.setActiveNode(null),t.preventDefault?.());return}if(t.key===`Tab`&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey){let r=MO(e.target,n);if(r!==null&&n.getActiveNode()===r){let e=document.querySelector(`[data-ok-prop-panel]`);if(e){let n=e.querySelector(`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(n){t.preventDefault?.(),n.focus();return}}}return}let r=t.key===`Enter`,i=t.key===` `||t.key===`Spacebar`;if(!r&&!i)return;let a=MO(e.target,n);if(a===null||i&&((e.target instanceof Element?e.target:null)?.closest(`[data-mark-id], [data-node-id]`)??null)?.getAttribute(`role`)===`link`)return;let o=n.getRegistration(a);if(t.preventDefault?.(),o?.handlePrimary&&o.handlePrimary({nodeId:a,type:o.type,newTab:!1})){u(),d(),n.getActiveNode()===a&&n.setActiveNode(null);return}n.setActiveNode(a)},w=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target;if(!(r instanceof Element))return;if(NO(r)){d();return}let i=MO(r,n);i!==null&&p(i)},T=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target,i=t.relatedTarget;if(!(r instanceof Element))return;let a=i instanceof Element?i:null,o=MO(r,n);if(o!==null){if(a&&NO(a)){d();return}if(a&&MO(a,n)===o)return;s===o&&u(),m();return}if(NO(r)){if(a&&NO(a))return;let e=n.getActiveNode();if(e!==null&&a&&MO(a,n)===e)return;m()}},E=e=>{if(g)return;let t=e.target;if(!(t instanceof Element))return;let r=MO(t,n);r!==null&&(u(),d(),n.setActiveNode(r))},D=e=>{let t=e;if(n.getActiveNode()===null)return;let r=t.relatedTarget,i=r instanceof Element?r:null;i&&NO(i)||i&&MO(i,n)!==null||m()},O=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||(u(),d(),n.setActiveNode(null)))},k=()=>{i||(r=IO(t),r&&(r.addEventListener(`pointerdown`,y,!0),r.addEventListener(`pointerup`,b,!0),r.addEventListener(`pointercancel`,b,!0),r.addEventListener(`pointermove`,x,!0),r.addEventListener(`click`,S,!0),r.addEventListener(`auxclick`,S,!0),r.addEventListener(`keydown`,C,!0),typeof document<`u`&&(document.addEventListener(`pointerover`,w,!0),document.addEventListener(`pointerout`,T,!0),document.addEventListener(`focusin`,E,!0),document.addEventListener(`focusout`,D,!0),document.addEventListener(`pointerdown`,O,!0)),i=!0))},A=()=>{i&&=(r?.removeEventListener(`pointerdown`,y,!0),r?.removeEventListener(`pointerup`,b,!0),r?.removeEventListener(`pointercancel`,b,!0),r?.removeEventListener(`pointermove`,x,!0),r?.removeEventListener(`click`,S,!0),r?.removeEventListener(`auxclick`,S,!0),r?.removeEventListener(`keydown`,C,!0),typeof document<`u`&&(document.removeEventListener(`pointerover`,w,!0),document.removeEventListener(`pointerout`,T,!0),document.removeEventListener(`focusin`,E,!0),document.removeEventListener(`focusout`,D,!0),document.removeEventListener(`pointerdown`,O,!0)),!1)};return k(),{register(e){n.register(e),i||k()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){A(),u(),d(),f(),v(),n.clear()},store:n}}var zO=e=>{let t=(0,J.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,X.jsx)(FO,{store:n})}),t[0]=n,t[1]=r),r},BO=new WeakMap;function VO(e){let t=BO.get(e);if(t)return t;let n=RO({editor:e});return BO.set(e,n),e.on(`destroy`,()=>{n.destroy(),BO.delete(e)}),n}var HO={AppWindow:ji,ChevronRight:rr,CopyPlus:Ki,FileText:$i,Film:na,GitBranch:aa,Image:ua,LayoutPanelTop:pa,MessageSquareWarning:Sa,PanelTop:Ea,Paperclip:Da,Sigma:Pa,SquarePlay:Ia,Volume2:Wa,Workflow:Ga,ZoomIn:qa};function UO(e){return e&&Object.hasOwn(HO,e)?HO[e]:Fi}var WO={Info:da,Lightbulb:ma,MessageSquareWarning:Sa,AlertTriangle:Vt,AlertOctagon:wa,ClipboardList:Ui,BookOpen:Pi,ListTodo:ya,CircleCheck:Re,CircleHelp:Vi,CircleX:Hi,Zap:Ka,Bug:Ii,FlaskConical:ra,Quote:Aa,ChevronRight:rr},GO=Object.entries(WO).sort(([e],[t])=>e.localeCompare(t));function KO(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(WO,t)?WO[t]??null:null}function qO(e){let t=(0,J.c)(24),n;t[0]===e.icon?n=t[1]:(n=KO(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(rr,{size:14,className:`accordion-chevron`,"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=r?(0,X.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[3]=r,t[4]=o);let s=e.title??`Accordion`,c;t[5]===s?c=t[6]:(c=(0,X.jsx)(`span`,{className:`accordion-title`,children:s}),t[5]=s,t[6]=c);let l;t[7]===e.description?l=t[8]:(l=e.description?(0,X.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[7]=e.description,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,X.jsxs)(`span`,{className:`accordion-title-group`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==u?(d=(0,X.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14];let f;t[15]===e.children?f=t[16]:(f=(0,X.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[15]=e.children,t[16]=f);let p;return t[17]!==e.defaultOpen||t[18]!==e.id||t[19]!==e.name||t[20]!==i||t[21]!==d||t[22]!==f?(p=(0,X.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[d,f]}),t[17]=e.defaultOpen,t[18]=e.id,t[19]=e.name,t[20]=i,t[21]=d,t[22]=f,t[23]=p):p=t[23],p}function JO(e){return e!==!1}function YO(e){let t=(0,J.c)(12),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:Fe(e.src),t[0]=e.src,t[1]=n);let r=e.title,i;t[2]===e.controls?i=t[3]:(i=JO(e.controls),t[2]=e.controls,t[3]=i);let a;return t[4]!==e.autoplay||t[5]!==e.loop||t[6]!==e.muted||t[7]!==e.preload||t[8]!==e.title||t[9]!==n||t[10]!==i?(a=(0,X.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[4]=e.autoplay,t[5]=e.loop,t[6]=e.muted,t[7]=e.preload,t[8]=e.title,t[9]=n,t[10]=i,t[11]=a):a=t[11],a}var XO={note:da,tip:ma,important:Sa,warning:Vt,caution:wa,abstract:Ui,info:Pi,todo:ya,success:Re,question:Vi,failure:Hi,danger:Ka,bug:Ii,example:ra,quote:Aa};function ZO(e,t){return KO(e)??XO[t]}var QO=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function $O(e){return typeof e==`string`&&QO.has(e)?e:`note`}function ek(e){let t=(0,J.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=$O(e.type),n=ZO(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,a;t[4]===e.color?a=t[5]:(a=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=a);let s=a,c;t[6]!==i||t[7]!==e.title?(c=e.title||i?(0,X.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,X.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,X.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=c):c=t[8];let l=c;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===l?i=t[10]:(i=l??(0,X.jsx)(`span`,{className:`callout-title`,children:(0,X.jsx)(o,{id:`URmyfc`})}),t[9]=l,t[10]=i);let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Ri,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=a):a=t[11];let c;t[12]===i?c=t[13]:(c=(0,X.jsxs)(`summary`,{className:`callout-summary`,contentEditable:!1,children:[i,a]}),t[12]=i,t[13]=c);let u;t[14]===e.children?u=t[15]:(u=(0,X.jsx)(`div`,{className:`callout-body`,children:e.children}),t[14]=e.children,t[15]=u);let d;return t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==u||t[20]!==r?(d=(0,X.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:s,children:[c,u]}),t[16]=n,t[17]=s,t[18]=c,t[19]=u,t[20]=r,t[21]=d):d=t[21],d}let u;t[22]===e.children?u=t[23]:(u=(0,X.jsx)(`div`,{className:`callout-body`,children:e.children}),t[22]=e.children,t[23]=u);let d;return t[24]!==l||t[25]!==s||t[26]!==u||t[27]!==r?(d=(0,X.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:s,children:[l,u]}),t[24]=l,t[25]=s,t[26]=u,t[27]=r,t[28]=d):d=t[28],d}var tk=(0,Y.createContext)(null);function nk(e){let t=(0,J.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(tk.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function rk(){return(0,Y.use)(tk)}var ik=[{key:`tl`,dx:-1,dy:-1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--tl`},{key:`t`,dx:0,dy:-1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--t`},{key:`tr`,dx:1,dy:-1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--tr`},{key:`r`,dx:1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--r`},{key:`br`,dx:1,dy:1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--br`},{key:`b`,dx:0,dy:1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--b`},{key:`bl`,dx:-1,dy:1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--bl`},{key:`l`,dx:-1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--l`}];function ak(e){let t=(0,J.c)(7),{targetRef:n,onResize:r,onResizeEnd:a,bounds:o}=e,{_:s}=i(),c=(0,Y.useRef)(null),l;t[0]!==o?.maxHeight||t[1]!==o?.maxWidth||t[2]!==o?.minHeight||t[3]!==o?.minWidth?(l=function(e,t){let n=t===`w`?o?.minWidth??64:o?.minHeight??64,r=t===`w`?o?.maxWidth??1/0:o?.maxHeight??1/0;return Math.max(n,Math.min(r,e))},t[0]=o?.maxHeight,t[1]=o?.maxWidth,t[2]=o?.minHeight,t[3]=o?.minWidth,t[4]=l):l=t[4];let u=l,d=function(e,t){let i=n.current;if(!i)return;e.preventDefault(),e.stopPropagation();let o=i.getBoundingClientRect();c.current={handle:t,startX:e.clientX,startY:e.clientY,startWidth:o.width,startHeight:o.height,latestWidth:o.width,latestHeight:o.height,hasMoved:!1},document.body.style.setProperty(`cursor`,t.cursor),document.body.style.setProperty(`user-select`,`none`);let s=function(e){let t=c.current;if(!t)return;let n=(e.clientX-t.startX)*t.handle.dx,i=(e.clientY-t.startY)*t.handle.dy,a=t.handle.dx===0?t.startWidth:u(t.startWidth+n,`w`),o=t.handle.dy===0?t.startHeight:u(t.startHeight+i,`h`);t.latestWidth=a,t.latestHeight=o,t.hasMoved=!0,r({width:a,height:o})};function l(){let e=c.current;if(!e)return;let t={width:e.latestWidth,height:e.latestHeight},n=e.hasMoved;c.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),n&&a?.(t)}window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l)},f=ik.map(e=>{let t=e.key;return(0,X.jsx)(`button`,{type:`button`,className:vn(e.className),"aria-label":s({id:`NxW-md`,values:{handleKey:t}}),tabIndex:-1,style:{cursor:e.cursor},onPointerDown:t=>d(t,e)},t)}),p;return t[5]===f?p=t[6]:(p=(0,X.jsx)(`div`,{className:`ok-resize-overlay`,contentEditable:!1,"aria-hidden":`true`,children:f}),t[5]=f,t[6]=p),p}var ok=`26rem`,sk=`Embedded content`,ck=/^https?:\/\//i;function lk(e){try{return new URL(e).origin!==window.location.origin}catch{return!1}}function uk(e){return!(typeof e!=`string`||!ck.test(e)||!lk(e))}function dk(e){let t=(0,J.c)(21),{src:n,title:r,width:i,height:a}=e,o=(0,Y.useRef)(null),s=rk(),c=i||void 0,l=a||ok,u;t[0]!==c||t[1]!==l?(u={width:c,height:l},t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==a||t[4]!==i?(f=()=>{let e=o.current;e&&(e.style.width=i||``,e.style.height=a||ok)},p=[i,a],t[3]=a,t[4]=i,t[5]=f,t[6]=p):(f=t[5],p=t[6]),(0,Y.useEffect)(f,p),!uk(n)){let e=`Embed a URL`;typeof n==`string`&&n.length>0&&(e=ck.test(n)?`Embed only supports cross-origin URLs`:`URL must start with http:// or https://`);let r;return t[7]===e?r=t[8]:(r=(0,X.jsx)(`div`,{className:`ok-embed ok-embed--placeholder`,contentEditable:!1,children:(0,X.jsx)(`span`,{children:e})}),t[7]=e,t[8]=r),r}let m;t[9]===s?m=t[10]:(m=e=>{if(!s)return;let{editor:t,getPos:n}=s,r=n();if(typeof r==`number`)try{let n=t.state.doc.nodeAt(r);if(!n||n.type.name!==`jsxComponent`)return;let i={...n.attrs.props??{},width:`${Math.round(e.width)}px`,height:`${Math.round(e.height)}px`};t.view.dispatch(t.state.tr.setNodeMarkup(r,null,{...n.attrs,props:i,sourceDirty:!0}))}catch(e){let t=e;if(t instanceof RangeError)return;throw t}},t[9]=s,t[10]=m);let h=m,g=r||sk,_;t[11]!==n||t[12]!==g?(_=(0,X.jsx)(`iframe`,{title:g,src:n,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation`,referrerPolicy:`no-referrer`,loading:`lazy`,className:`ok-embed-frame`}),t[11]=n,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==s||t[15]!==h?(v=s?(0,X.jsx)(ak,{targetRef:o,bounds:{minWidth:192,maxWidth:2e3,minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=o.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:h}):null,t[14]=s,t[15]=h,t[16]=v):v=t[16];let y;return t[17]!==d||t[18]!==_||t[19]!==v?(y=(0,X.jsxs)(`div`,{className:`ok-embed`,style:d,ref:o,contentEditable:!1,children:[_,v]}),t[17]=d,t[18]=_,t[19]=v,t[20]=y):y=t[20],y}function fk(e){if(!e)return``;let t,n=null;try{let r=new URL(e,`https://placeholder.local`);n=r.protocol,t=r.pathname}catch{t=e.split(`?`)[0]??e}if(n===`data:`||n===`blob:`)return``;let r=t.split(`/`),i=r[r.length-1]??``;try{return decodeURIComponent(i)}catch{return i}}function pk(e){let t=(0,J.c)(18),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||fk(e.src)||`Untitled file`,t[0]=e.name,t[1]=e.src,t[2]=n):n=t[2];let r=n,i=e.size?.trim()?e.size:null,a;t[3]===e.src?a=t[4]:(a=e.src?Fe(e.src):void 0,t[3]=e.src,t[4]=a);let o=a,s;t[5]===o?s=t[6]:(s=e=>{e.stopPropagation(),e.preventDefault(),o&&window.open(o,`_blank`,`noopener,noreferrer`)},t[5]=o,t[6]=s);let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(ea,{className:`ok-file-icon`,"aria-hidden":`true`}),t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,X.jsx)(`span`,{className:`ok-file-name`,children:r}),t[8]=r,t[9]=u);let d;t[10]===i?d=t[11]:(d=i?(0,X.jsx)(`span`,{className:`ok-file-size`,children:i}):null,t[10]=i,t[11]=d);let f;return t[12]!==c||t[13]!==o||t[14]!==e.title||t[15]!==u||t[16]!==d?(f=(0,X.jsxs)(`a`,{href:o,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:mk,onClick:c,children:[l,u,d]}),t[12]=c,t[13]=o,t[14]=e.title,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function mk(e){return e.stopPropagation()}function hk(){return Y.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Y.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function gk(){return Y.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Y.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function _k(e){return typeof Element>`u`?!1:e instanceof Element}var vk=(e,t)=>_k(t)&&t.tagName.toUpperCase()===e,yk=e=>vk(`DIV`,e)||vk(`SPAN`,e),bk=e=>vk(`IMG`,e),xk=e=>e.complete&&e.naturalHeight!==0,Sk=e=>vk(`SVG`,e),Ck=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),wk=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=Ck({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},Tk=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?wk({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):Ck({height:e,offset:r,width:t}),Ek=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,Dk=e=>{if(e!==null){if(bk(e))return e.currentSrc===``?void 0:e.currentSrc;if(yk(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return Ek.exec(t)?.[1]}}},Ok=e=>{if(e!==null)return bk(e)?e.alt:e.getAttribute(`aria-label`)??void 0},kk=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=Tk({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},Ak=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},jk=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=Ak({position:p,relativeNum:r-l*f}),g=Ak({position:m,relativeNum:e-c*f}),_=Tk({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=Ak({position:a,relativeNum:r-l}),f=Ak({position:u,relativeNum:e-c}),p=Tk({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=Tk({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},Mk=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=Ak({position:p,relativeNum:a-l*f}),g=Ak({position:m,relativeNum:n-c*f}),_=Tk({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=Ak({position:t,relativeNum:a-l}),f=Ak({position:u,relativeNum:n-c}),p=Tk({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=Ak({position:u,relativeNum:a}),p=Ak({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=Ak({position:_,relativeNum:a-l*g}),b=Ak({position:v,relativeNum:n-c*g}),x=Tk({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},Nk=/\.svg$/i,Pk=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&Nk.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&yk(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=kk({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?jk({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?Mk({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},Fk=e=>{if(e==null)return{};if(Sk(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},Ik=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},Lk=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Rk={overflow:``,width:``};function zk(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function Bk(e){e.preventDefault()}function Vk(e){return Y.createElement(Hk,{...e})}var Hk=class extends Y.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=Y.createRef(),this.refDialog=Y.createRef(),this.refModalContent=Y.createRef(),this.refModalImg=Y.createRef(),this.refWrap=Y.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Rk,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(Lk),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:Fk(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:Fk(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=Dk(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(bk(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:Fk(this.imgEl)})};t.decode().then(r).catch(()=>{if(xk(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||Sk(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=Rk},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(xk(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(Sk(e)){let r=e.cloneNode(!0);Ik(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=yk(a),j=bk(a),M=Sk(a),N=Ok(a),P=Dk(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,ee=h?.src!==void 0&&h.src!==``,R=this.hasImage(),z=N!==void 0&&N!==``?`${s}: ${N}`:s,B=T===`LOADING`||T===`LOADED`,V=R?`found`:`not-found`,H=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,U={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=R&&a!==null?Pk({hasZoomImg:ee,imgSrc:P,isSvg:M,isZoomed:f&&B,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let te=null;if(R){let t=j||A?Y.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?Y.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=Y.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},Y.createElement(u,null));te=m==null?Y.createElement(Y.Fragment,null,t,n):Y.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return Y.createElement(p,{"aria-owns":R?O:void 0,"data-rmiz":``,ref:x},Y.createElement(p,{"data-rmiz-content":V,ref:_,style:U},c),R&&Y.createElement(p,{"data-rmiz-ghost":``,style:D},Y.createElement(`button`,{"aria-label":z,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},Y.createElement(d,null))),R&&Qa.createPortal(Y.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:Bk,ref:v,role:`dialog`},Y.createElement(`div`,{"data-rmiz-modal-overlay":H}),Y.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},te)),zk()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};Hk.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:hk,IconZoom:gk,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Uk({onZoomChange:e,...t}){let[n,r]=Y.useState(!1),i=Y.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return Y.createElement(Vk,{...t,isZoomed:n,onZoomChange:i})}function Wk(e,t){return typeof e==`number`&&typeof t==`number`&&e>0&&t>0}function Gk(e,t,n){return Wk(e,t)?{...n,width:`${e}px`,aspectRatio:`${e} / ${t}`}:n}function Kk(e){let t=(0,J.c)(52),n,r,a,o,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({width:m,height:r,loadingTestId:d,slotTestId:f,slotClassName:c,className:n,onLoad:s,onError:o,src:l,style:u,alt:p,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=d===void 0?`image-loading-skeleton`:d,g=f===void 0?`image-slot`:f,_=p===void 0?``:p,{_:v}=i(),y=(0,Y.useRef)(null),[b,x]=(0,Y.useState)(!1),S;t[13]!==r||t[14]!==m?(S=Wk(m,r),t[13]=r,t[14]=m,t[15]=S):S=t[15];let C=S,w;t[16]!==r||t[17]!==u||t[18]!==m?(w=Gk(m,r,u),t[16]=r,t[17]=u,t[18]=m,t[19]=w):w=t[19];let T=w,E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{y.current?.complete?x(!0):x(!1)},t[20]=E):E=t[20];let D;t[21]===l?D=t[22]:(D=[l],t[21]=l,t[22]=D),(0,Y.useLayoutEffect)(E,D);let O=!C&&!b&&`aspect-[16/9] w-full max-w-full`,k;t[23]!==c||t[24]!==O?(k=vn(`relative inline-block overflow-hidden`,O,c),t[23]=c,t[24]=O,t[25]=k):k=t[25];let A;t[26]!==v||t[27]!==b||t[28]!==h?(A=!b&&(0,X.jsx)(`span`,{"data-testid":h,role:`status`,"aria-busy":`true`,"aria-label":v({id:`N1YYa7`}),className:`absolute inset-0 animate-pulse rounded-md bg-muted motion-reduce:animate-none`}),t[26]=v,t[27]=b,t[28]=h,t[29]=A):A=t[29];let j=b?`opacity-100`:`opacity-0`,M;t[30]!==n||t[31]!==j?(M=vn(`block max-w-full transition-opacity motion-reduce:transition-none`,j,n),t[30]=n,t[31]=j,t[32]=M):M=t[32];let N;t[33]===s?N=t[34]:(N=e=>{x(!0),s?.(e)},t[33]=s,t[34]=N);let P;t[35]===o?P=t[36]:(P=e=>{x(!0),o?.(e)},t[35]=o,t[36]=P);let F;t[37]!==_||t[38]!==r||t[39]!==a||t[40]!==l||t[41]!==M||t[42]!==N||t[43]!==P||t[44]!==m?(F=(0,X.jsx)(`img`,{...a,ref:y,src:l,alt:_,width:m,height:r,className:M,onLoad:N,onError:P}),t[37]=_,t[38]=r,t[39]=a,t[40]=l,t[41]=M,t[42]=N,t[43]=P,t[44]=m,t[45]=F):F=t[45];let I;return t[46]!==T||t[47]!==g||t[48]!==A||t[49]!==F||t[50]!==k?(I=(0,X.jsxs)(`span`,{"data-testid":g,className:k,style:T,children:[A,F]}),t[46]=T,t[47]=g,t[48]=A,t[49]=F,t[50]=k,t[51]=I):I=t[51],I}function qk(e){return e??`lazy`}function Jk(e){if(typeof e!=`string`)return e;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function Yk(e){let t=(0,J.c)(21),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:Fe(e.src),t[0]=e.src,t[1]=n);let r=e.alt??``,i;t[2]===e.width?i=t[3]:(i=Jk(e.width),t[2]=e.width,t[3]=i);let a;t[4]===e.height?a=t[5]:(a=Jk(e.height),t[4]=e.height,t[5]=a);let o=e.title,s;t[6]===e.loading?s=t[7]:(s=qk(e.loading),t[6]=e.loading,t[7]=s);let c;return t[8]!==e.crossorigin||t[9]!==e.decoding||t[10]!==e.fetchpriority||t[11]!==e.referrerpolicy||t[12]!==e.sizes||t[13]!==e.srcset||t[14]!==e.title||t[15]!==n||t[16]!==r||t[17]!==i||t[18]!==a||t[19]!==s?(c=(0,X.jsx)(Kk,{src:n,alt:r,width:i,height:a,title:o,loading:s,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy}),t[8]=e.crossorigin,t[9]=e.decoding,t[10]=e.fetchpriority,t[11]=e.referrerpolicy,t[12]=e.sizes,t[13]=e.srcset,t[14]=e.title,t[15]=n,t[16]=r,t[17]=i,t[18]=a,t[19]=s,t[20]=c):c=t[20],c}function Xk(e){let t=(0,J.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,X.jsx)(Uk,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,X.jsx)(Yk,{...e})}),t[1]=e,t[2]=r),r}var Zk=(0,Y.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-DX-tM4Fr.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,J.c)(7),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!0,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;n[2]===i?a=n[3]:(a={__html:i},n[2]=i,n[3]=a);let o;return n[4]!==t.id||n[5]!==a?(o=(0,X.jsx)(`div`,{className:`math math-display`,"data-component-type":`math`,id:t.id,dangerouslySetInnerHTML:a}),n[4]=t.id,n[5]=a,n[6]=o):o=n[6],o}return{default:t}});function Qk(e){let t=(0,J.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,X.jsx)(`div`,{className:`math math-placeholder`,"data-component-type":`math`,id:e.id,children:n}),t[0]=e.id,t[1]=n,t[2]=r):r=t[2],r}function $k(e){let t=(0,J.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,X.jsx)(Qk,{formula:n,id:e.id}),t[0]=n,t[1]=e.id,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e.id?(r=(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(Qk,{formula:n,id:e.id}),children:(0,X.jsx)(Zk,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}var eA=null;function tA(){return eA||=n(()=>import(`./mermaid.core-CWYso-V4.js`).then(e=>{let t=e.default;return t.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`default`,suppressErrorRendering:!0}),t}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url).catch(e=>{throw eA=null,e}),eA}function nA(e){let t=(0,J.c)(24),n=e.chart??``,r=(0,Y.useId)(),i;if(t[0]!==r){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],i=r.replace(e,`_`),t[0]=r,t[1]=i}else i=t[1];let a=`mermaid-${i}`,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={status:`idle`,svg:``,error:``},t[3]=s):s=t[3];let[c,l]=(0,Y.useState)(s),u,d;if(t[4]!==n||t[5]!==a?(u=()=>{if(!n.trim()){l({status:`idle`,svg:``,error:``});return}let e=!1;return l(rA),tA().then(async t=>{try{let r=await t.render(a,n);e||l({status:`ready`,svg:r.svg,error:``})}catch(t){let n=t;e||l({status:`error`,svg:``,error:n instanceof Error?n.message:String(n)})}}).catch(t=>{e||l({status:`error`,svg:``,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},d=[n,a],t[4]=n,t[5]=a,t[6]=u,t[7]=d):(u=t[6],d=t[7]),(0,Y.useEffect)(u,d),!n.trim()){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`mermaid mermaid-placeholder`,"data-component-type":`mermaid`,children:(0,X.jsx)(`span`,{className:`mermaid-empty`,children:` `})}),t[8]=e):e=t[8],e}if(c.status===`error`){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Vt,{className:`size-3.5 shrink-0 mt-0.5`,"aria-hidden":!0}),t[9]=e):e=t[9];let r;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`div`,{className:`font-medium`,children:(0,X.jsx)(o,{id:`OLBz-_`})}),t[10]=r):r=t[10];let i;t[11]===c.error?i=t[12]:(i=(0,X.jsxs)(`div`,{role:`alert`,className:`mermaid-error-message mb-2 flex items-start gap-2 rounded border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive`,children:[e,(0,X.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,X.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words font-mono text-[11px] opacity-90`,children:c.error})]})]}),t[11]=c.error,t[12]=i);let a;t[13]===n?a=t[14]:(a=(0,X.jsx)(`pre`,{className:`mermaid-error-source`,children:n}),t[13]=n,t[14]=a);let s;return t[15]!==c.error||t[16]!==i||t[17]!==a?(s=(0,X.jsxs)(`div`,{className:`mermaid mermaid-error`,"data-component-type":`mermaid`,title:c.error,children:[i,a]}),t[15]=c.error,t[16]=i,t[17]=a,t[18]=s):s=t[18],s}let f=`mermaid mermaid-${c.status}`,p;t[19]===c.svg?p=t[20]:(p={__html:c.svg},t[19]=c.svg,t[20]=p);let m;return t[21]!==f||t[22]!==p?(m=(0,X.jsx)(`div`,{className:f,"data-component-type":`mermaid`,dangerouslySetInnerHTML:p}),t[21]=f,t[22]=p,t[23]=m):m=t[23],m}function rA(e){return{...e,status:`rendering`}}var iA=null;function aA(){return iA||=new j({extensions:N}),iA}function oA(e,t){if(e.type===`mdxJsxFlowElement`){let n=e;if(n.name===`MirrorSource`){for(let e of n.attributes??[])if(e.type===`mdxJsxAttribute`&&e.name===`id`&&typeof e.value==`string`&&e.value===t)return n}}let n=e.children;if(Array.isArray(n))for(let e of n){let n=oA(e,t);if(n)return n}return null}function sA(e){return x({type:`root`,children:e.children??[]})}var cA=new Map,lA=30,uA=150,dA=1e4;function fA(e,t){let n=`${e}|${t}`,r=cA.get(n);if(r)return r.refcount+=1,r;let i=new Xm,a=new qE({url:e,name:t,document:i}),o=new Set,s={provider:a,ySource:i.getText(`source`),refcount:1,synced:!1,subscribers:o};return a.on(`synced`,()=>{s.synced=!0;for(let e of o)e.onSynced()}),s.ySource.observe(()=>{for(let e of o)e.onUpdate()}),cA.set(n,s),cA.size>lA&&console.warn(`[Mirror] provider pool exceeded ${lA} entries (current=${cA.size}). Many Mirrors pointing at distinct source docs — investigate if this is a runaway pattern.`),s}function pA(e,t){let n=`${e}|${t}`,r=cA.get(n);if(r&&(--r.refcount,r.refcount<=0)){try{r.provider.destroy()}catch(e){console.warn(`[Mirror] provider.destroy() failed during release`,{src:t,err:e})}cA.delete(n)}}function mA(e,t){let n=(0,J.c)(8),{collabUrl:r}=Xx(),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={kind:`loading`},n[0]=i):i=n[0];let[a,o]=(0,Y.useState)(i),s=(0,Y.useRef)(t),c=(0,Y.useRef)(null),l,u;n[1]!==r||n[2]!==e?(l=()=>{if(!e){o({kind:`empty-props`});return}if(!r){o({kind:`loading`});return}let t=fA(r,e),n=()=>{let n=s.current;if(!n){o({kind:`empty-props`});return}let r=t.ySource.toString();if(!r){o(t.synced?{kind:`source-removed`}:{kind:`loading`});return}let i;try{i=aA().parseToMdast(r)}catch(t){console.warn(`[Mirror] parseToMdast failed`,{src:e,anchor:n,err:t}),o({kind:`source-removed`});return}let a=oA(i,n);if(!a){o({kind:`anchor-not-found`});return}let c;try{c=sA(a)}catch(t){console.warn(`[Mirror] renderMirrorSubtree failed`,{src:e,anchor:n,err:t}),o({kind:`anchor-not-found`});return}o({kind:`ready`,html:c})},i=null,a={onUpdate:()=>{i&&clearTimeout(i),i=setTimeout(()=>{i=null,n()},uA)},onSynced:()=>{i&&=(clearTimeout(i),null),n()}};t.subscribers.add(a),c.current=n;let l=setTimeout(()=>{t.synced||o({kind:`source-removed`})},dA);return n(),()=>{clearTimeout(l),i&&clearTimeout(i),t.subscribers.delete(a),c.current=null,pA(r,e)}},u=[r,e],n[1]=r,n[2]=e,n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,Y.useEffect)(l,u);let d,f;return n[5]===t?(d=n[6],f=n[7]):(d=()=>{s.current=t,c.current?.()},f=[t],n[5]=t,n[6]=d,n[7]=f),(0,Y.useEffect)(d,f),a}function hA(e){let t=(0,J.c)(8),n=`ok-mirror-state flex items-start gap-2 rounded-md border border-dashed px-3 py-2 text-sm ${e.tone===`error`?`border-destructive/40 text-destructive`:`border-border text-muted-foreground`}`,r;t[0]===e.tone?r=t[1]:(r=e.tone===`error`?(0,X.jsx)(ha,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}):(0,X.jsx)(_a,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),t[0]=e.tone,t[1]=r);let i;t[2]===e.children?i=t[3]:(i=(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children}),t[2]=e.children,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,X.jsxs)(`div`,{className:n,children:[r,i]}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gA(e){let t=(0,J.c)(30),n=e.src??``,r=e.anchor??``,i=mA(n,r);if(i.kind===`empty-props`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(hA,{tone:`placeholder`,children:(0,X.jsx)(o,{id:`3SDfZl`,components:{0:(0,X.jsx)(`span`,{className:`font-medium`}),1:(0,X.jsx)(`code`,{}),2:(0,X.jsx)(`code`,{}),3:(0,X.jsx)(`code`,{})}})}),t[0]=e):e=t[0],e}if(i.kind===`loading`){let e=n&&r?`${n}#${r}`:``,i;t[1]===e?i=t[2]:(i={mirrorRef:e},t[1]=e,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a={0:(0,X.jsx)(`code`,{})},t[3]=a):a=t[3];let s;return t[4]===i?s=t[5]:(s=(0,X.jsx)(hA,{tone:`placeholder`,children:(0,X.jsx)(o,{id:`92rbk2`,values:i,components:a})}),t[4]=i,t[5]=s),s}if(i.kind===`source-removed`){let e;t[6]===n?e=t[7]:(e={src:n},t[6]=n,t[7]=e);let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,X.jsx)(`span`,{className:`font-medium`}),1:(0,X.jsx)(`code`,{})},t[8]=r):r=t[8];let i;return t[9]===e?i=t[10]:(i=(0,X.jsx)(hA,{tone:`error`,children:(0,X.jsx)(o,{id:`Ud0Pj9`,values:e,components:r})}),t[9]=e,t[10]=i),i}if(i.kind===`anchor-not-found`){let e=`<MirrorSource id="${r}">`,i;t[11]!==e||t[12]!==n?(i={mirrorSourceTag:e,src:n},t[11]=e,t[12]=n,t[13]=i):i=t[13];let a;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(a={0:(0,X.jsx)(`span`,{className:`font-medium`}),1:(0,X.jsx)(`code`,{}),2:(0,X.jsx)(`code`,{})},t[14]=a):a=t[14];let s;return t[15]===i?s=t[16]:(s=(0,X.jsx)(hA,{tone:`error`,children:(0,X.jsx)(o,{id:`mqSwZH`,values:i,components:a})}),t[15]=i,t[16]=s),s}let a;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(qi,{className:`size-3`,"aria-hidden":`true`}),t[17]=a):a=t[17];let s;t[18]===n?s=t[19]:(s={src:n},t[18]=n,t[19]=s);let c;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,X.jsx)(`code`,{className:`font-mono`})},t[20]=c):c=t[20];let l;t[21]===s?l=t[22]:(l=(0,X.jsxs)(`div`,{className:`ok-mirror-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,"aria-hidden":`true`,children:[a,(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`wQp1V3`,values:s,components:c})})]}),t[21]=s,t[22]=l);let u;t[23]===i.html?u=t[24]:(u=(0,X.jsx)(`div`,{dangerouslySetInnerHTML:{__html:i.html}}),t[23]=i.html,t[24]=u);let d;return t[25]!==r||t[26]!==n||t[27]!==l||t[28]!==u?(d=(0,X.jsxs)(`div`,{className:`ok-mirror-resolved relative -mx-3 prose-no-margin rounded-md border border-dashed border-transparent px-3 py-2 transition-colors [.jsx-component-wrapper:hover_&]:border-border/40 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/40`,"data-mirror-src":n,"data-mirror-anchor":r,children:[l,u]}),t[25]=r,t[26]=n,t[27]=l,t[28]=u,t[29]=d):d=t[29],d}function _A(e){let t=(0,J.c)(15),{_:n}=i(),r=e.id??``,a;t[0]!==n||t[1]!==r?(a=r||n({id:`12F9WL`}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let s=a,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(Ki,{className:`size-3`,"aria-hidden":`true`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l={label:s},t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={0:(0,X.jsx)(`code`,{className:`font-mono`})},t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,X.jsxs)(`div`,{className:`ok-mirror-source-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,children:[c,(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`Zon_qG`,values:l,components:u})})]}),t[7]=l,t[8]=d);let f;t[9]===e.children?f=t[10]:(f=(0,X.jsx)(`div`,{children:e.children}),t[9]=e.children,t[10]=f);let p;return t[11]!==r||t[12]!==d||t[13]!==f?(p=(0,X.jsxs)(`div`,{className:`ok-mirror-source relative -mx-3 rounded-md border border-dashed border-transparent px-3 py-1 transition-colors [.jsx-component-wrapper:hover_&]:border-border/50 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/50`,"data-mirror-source-id":r,children:[d,f]}),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}var vA=24,yA=24,bA=12,xA=.1;function SA(e,t,n,r){if(n<=0&&(e===`fit-width`||e===`two-odd`||e===`two-even`)||r<=0&&e===`fit-height`)return 1;switch(e){case`fit-width`:return Math.max(xA,(n-vA)/t.naturalWidth);case`fit-height`:return Math.max(xA,(r-yA)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(xA,((n-vA)/2-bA)/t.naturalWidth)}}var CA=600,wA=.5,TA=3,EA=.25,DA=null;function OA(){return DA||(DA=(async()=>{let e=await n(()=>import(`./pdf-CtJiipL_.js`),__vite__mapDeps([24,1]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-BZq-wJdz.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),DA.catch(()=>{DA=null})),DA}function kA(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function AA(e){let t=(0,J.c)(96),n,r;if(t[0]!==e.anchor||t[1]!==e.fillContainer){let{height:i,viewerFragment:a}=pe(e.anchor);n=i===null?e.fillContainer?`100%`:`${CA}px`:`${i}px`,r=IA(a),t[0]=e.anchor,t[1]=e.fillContainer,t[2]=n,t[3]=r}else n=t[2],r=t[3];let a=r,s=(0,Y.useRef)(null),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,Y.useRef)(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[5]=u):u=t[5];let d=(0,Y.useRef)(u),f=(0,Y.useRef)(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[6]=p):p=t[6];let[m,h]=(0,Y.useState)(p),[g,_]=(0,Y.useState)(!0),[v,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(a??1),[S,C]=(0,Y.useState)(String(a??1)),[w,T]=(0,Y.useState)(1),[E,D]=(0,Y.useState)(`fit-width`),[O,k]=(0,Y.useState)(!1),[A,j]=(0,Y.useState)(!1),[M,N]=(0,Y.useState)(0),[P,F]=(0,Y.useState)(0),{_:I}=i(),L=m.length,ee,R;t[7]!==I||t[8]!==e.src?(ee=()=>{if(!e.src){_(!1);return}let t=Fe(e.src),n=!1,r=null;return _(!0),y(null),(async()=>{try{let e=await(await OA()).getDocument({url:t,isEvalSupported:!1}).promise;if(n){await e.destroy();return}r=e,f.current=e;let i=[];for(let t=1;t<=e.numPages;t++){if(n)return;let r=(await e.getPage(t)).getViewport({scale:1});i.push({pageNumber:t,naturalWidth:r.width,naturalHeight:r.height})}if(n)return;h(i)}catch(e){let t=e;if(n)return;y(t instanceof Error?t.message:I({id:`jRHdCz`})),_(!1)}})(),()=>{n=!0,r&&=(r.destroy(),null),f.current=null}},R=[e.src,I],t[7]=I,t[8]=e.src,t[9]=ee,t[10]=R):(ee=t[9],R=t[10]),(0,Y.useEffect)(ee,R);let z,B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>{let e=s.current;if(!e)return;let t=()=>{N(e.clientWidth),F(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},B=[],t[11]=z,t[12]=B):(z=t[11],B=t[12]),(0,Y.useEffect)(z,B);let V,H;t[13]!==I||t[14]!==P||t[15]!==M||t[16]!==E||t[17]!==m||t[18]!==w?(V=()=>{let e=f.current;if(!e||m.length===0||M===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=l.current[i.pageNumber-1];if(!a)continue;let o=SA(E,i,M,P)*w,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:u,viewport:c}),await n.promise,n=null)}t||_(!1)}catch(e){let n=e;if(t||kA(n))return;console.warn(`[Pdf] page render failed:`,n),y(n instanceof Error?n.message:I({id:`_TF8ep`})),_(!1)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},H=[m,E,w,M,P,I],t[13]=I,t[14]=P,t[15]=M,t[16]=E,t[17]=m,t[18]=w,t[19]=V,t[20]=H):(V=t[19],H=t[20]),(0,Y.useEffect)(V,H);let U,te;t[21]!==m||t[22]!==O?(U=()=>{if(!O)return;let e=f.current;if(!e||m.length===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=d.current[i.pageNumber-1];if(!a)continue;let o=120/i.naturalWidth,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let l=a.getContext(`2d`);l&&(l.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:l,viewport:c}),await n.promise,n=null)}}catch(e){let t=e;kA(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},te=[O,m],t[21]=m,t[22]=O,t[23]=U,t[24]=te):(U=t[23],te=t[24]),(0,Y.useEffect)(U,te);let ne,re;t[25]!==g||t[26]!==a?(ne=()=>{if(g||!a)return;let e=s.current,t=l.current[a-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},re=[g,a],t[25]=g,t[26]=a,t[27]=ne,t[28]=re):(ne=t[27],re=t[28]),(0,Y.useEffect)(ne,re);let ie,ae;t[29]===m?(ie=t[30],ae=t[31]):(ie=()=>{let e=s.current;if(!e||m.length===0)return;let t=!1,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let n=e.scrollTop,r=1;for(let t of m){let i=l.current[t.pageNumber-1];i&&i.offsetTop-e.offsetTop<=n+40&&(r=t.pageNumber)}x(r),C(String(r))}))};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},ae=[m],t[29]=m,t[30]=ie,t[31]=ae),(0,Y.useEffect)(ie,ae);let W,oe;t[32]===A?(W=t[33],oe=t[34]):(W=()=>{if(!A)return;let e=e=>{let t=e.target,n=s.current?.closest(`.ok-pdf`);if(!n||!t||!n.contains(t)){j(!1);return}let r=n.querySelector(`.ok-pdf-layout-menu`);r&&!r.contains(t)&&j(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},oe=[A],t[32]=A,t[33]=W,t[34]=oe),(0,Y.useEffect)(W,oe);let se;t[35]===L?se=t[36]:(se=e=>{let t=Math.max(1,Math.min(L||1,e));x(t),C(String(t));let n=s.current,r=l.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[35]=L,t[36]=se);let G=se,ce;t[37]!==b||t[38]!==G||t[39]!==S?(ce=()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)){C(String(b));return}G(e)},t[37]=b,t[38]=G,t[39]=S,t[40]=ce):ce=t[40];let le=ce,ue;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>T(PA),t[41]=ue):ue=t[41];let de=ue,fe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>T(NA),t[42]=fe):fe=t[42];let me=fe,he;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(he=e=>{D(e),j(!1),T(1)},t[43]=he):he=t[43];let ge=he,_e;t[44]===n?_e=t[45]:(_e={height:n},t[44]=n,t[45]=_e);let ve;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>k(MA),t[46]=ve):ve=t[46];let ye;t[47]!==I||t[48]!==O?(ye=I(O?{id:`JK-Ave`}:{id:`iEYxO4`}),t[47]=I,t[48]=O,t[49]=ye):ye=t[49];let be;t[50]===I?be=t[51]:(be=I({id:`zo3Dl7`}),t[50]=I,t[51]=be);let xe;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,X.jsx)(Ta,{size:14,"aria-hidden":`true`}),t[52]=xe):xe=t[52];let Se;t[53]!==O||t[54]!==ye||t[55]!==be?(Se=(0,X.jsx)(`button`,{type:`button`,onClick:ve,"aria-label":ye,"aria-pressed":O,className:`ok-pdf-btn`,title:be,children:xe}),t[53]=O,t[54]=ye,t[55]=be,t[56]=Se):Se=t[56];let Ce=e.title??`PDF`,we;t[57]===Ce?we=t[58]:(we=(0,X.jsx)(`span`,{className:`ok-pdf-title`,children:Ce}),t[57]=Ce,t[58]=we);let Te;t[59]!==I||t[60]!==A||t[61]!==E||t[62]!==S||t[63]!==le||t[64]!==L||t[65]!==w?(Te=L>0&&(0,X.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,X.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),le()},children:(0,X.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,className:`ok-pdf-page-input`,value:S,onChange:e=>C(e.target.value.replace(/[^0-9]/g,``)),onBlur:le,"aria-label":I({id:`xsZhu-`})})}),(0,X.jsx)(`span`,{className:`ok-pdf-page-of`,children:(0,X.jsx)(o,{id:`1GhYxC`,values:{totalPages:L}})}),(0,X.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,X.jsx)(`button`,{type:`button`,onClick:me,disabled:w<=wA,"aria-label":I({id:`FjkaiT`}),className:`ok-pdf-btn`,title:I({id:`FjkaiT`}),children:(0,X.jsx)(Ja,{size:14,"aria-hidden":`true`})}),(0,X.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(w*100),`%`]}),(0,X.jsx)(`button`,{type:`button`,onClick:de,disabled:w>=TA,"aria-label":I({id:`AWOSPo`}),className:`ok-pdf-btn`,title:I({id:`AWOSPo`}),children:(0,X.jsx)(qa,{size:14,"aria-hidden":`true`})}),(0,X.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,X.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>j(jA),"aria-label":I({id:`GQDSBN`}),"aria-haspopup":`menu`,"aria-expanded":A,className:`ok-pdf-btn`,title:I({id:`rdU729`}),children:(0,X.jsx)(Ri,{size:14,"aria-hidden":`true`})}),A&&(0,X.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,X.jsx)(FA,{label:I({id:`vIxrEk`}),active:E===`fit-width`,onSelect:()=>ge(`fit-width`)}),(0,X.jsx)(FA,{label:I({id:`YlDuro`}),active:E===`fit-height`,onSelect:()=>ge(`fit-height`)}),(0,X.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,X.jsx)(FA,{label:I({id:`BGHHtQ`}),active:E===`single`,onSelect:()=>ge(`single`)}),(0,X.jsx)(FA,{label:I({id:`xK291b`}),active:E===`two-odd`,onSelect:()=>ge(`two-odd`)}),(0,X.jsx)(FA,{label:I({id:`NSnIUP`}),active:E===`two-even`,onSelect:()=>ge(`two-even`)})]})]})]}),t[59]=I,t[60]=A,t[61]=E,t[62]=S,t[63]=le,t[64]=L,t[65]=w,t[66]=Te):Te=t[66];let Ee;t[67]!==Se||t[68]!==we||t[69]!==Te?(Ee=(0,X.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[Se,we,Te]}),t[67]=Se,t[68]=we,t[69]=Te,t[70]=Ee):Ee=t[70];let De;t[71]!==I||t[72]!==b||t[73]!==G||t[74]!==m||t[75]!==O?(De=O&&(0,X.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":I({id:`nzaV6Q`}),children:m.map((e,t)=>{let{pageNumber:n}=e;return(0,X.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":b===n||void 0,onClick:()=>G(n),"aria-label":I({id:`qioCwA`,values:{pageNumber:n}}),children:[(0,X.jsx)(`canvas`,{ref:e=>{d.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,X.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:n})]},n)})}),t[71]=I,t[72]=b,t[73]=G,t[74]=m,t[75]=O,t[76]=De):De=t[76];let Oe;t[77]===g?Oe=t[78]:(Oe=g&&(0,X.jsx)(`div`,{className:`ok-pdf-loading`,children:(0,X.jsx)(o,{id:`T-654M`})}),t[77]=g,t[78]=Oe);let ke;t[79]===v?ke=t[80]:(ke=v&&(0,X.jsx)(`div`,{className:`ok-pdf-error`,children:(0,X.jsx)(o,{id:`WamGNs`,values:{error:v}})}),t[79]=v,t[80]=ke);let Ae;t[81]!==I||t[82]!==L?(Ae=Array.from({length:L},(e,t)=>{let n=t+1;return(0,X.jsx)(`canvas`,{ref:e=>{l.current[t]=e},className:`ok-pdf-page`,"aria-label":I({id:`XtRoxT`,values:{pageNumber:n}})},n)}),t[81]=I,t[82]=L,t[83]=Ae):Ae=t[83];let je;t[84]!==E||t[85]!==Oe||t[86]!==ke||t[87]!==Ae?(je=(0,X.jsxs)(`div`,{className:`ok-pdf-pages`,ref:s,"data-layout":E,children:[Oe,ke,Ae]}),t[84]=E,t[85]=Oe,t[86]=ke,t[87]=Ae,t[88]=je):je=t[88];let Me;t[89]!==De||t[90]!==je?(Me=(0,X.jsxs)(`div`,{className:`ok-pdf-body`,children:[De,je]}),t[89]=De,t[90]=je,t[91]=Me):Me=t[91];let Ne;return t[92]!==_e||t[93]!==Ee||t[94]!==Me?(Ne=(0,X.jsxs)(`div`,{className:`ok-pdf`,style:_e,children:[Ee,Me]}),t[92]=_e,t[93]=Ee,t[94]=Me,t[95]=Ne):Ne=t[95],Ne}function jA(e){return!e}function MA(e){return!e}function NA(e){return Math.max(wA,+(e-EA).toFixed(2))}function PA(e){return Math.min(TA,+(e+EA).toFixed(2))}function FA(e){let t=(0,J.c)(10),n=e.active||void 0,r;t[0]===e.active?r=t[1]:(r=e.active&&(0,X.jsx)(tr,{size:14}),t[0]=e.active,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,X.jsx)(`span`,{className:`ok-pdf-menu-check`,"aria-hidden":`true`,children:r}),t[2]=r,t[3]=i);let a;return t[4]!==e.active||t[5]!==e.label||t[6]!==e.onSelect||t[7]!==n||t[8]!==i?(a=(0,X.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.active,className:`ok-pdf-menu-item`,"data-active":n,onClick:e.onSelect,children:[i,e.label]}),t[4]=e.active,t[5]=e.label,t[6]=e.onSelect,t[7]=n,t[8]=i,t[9]=a):a=t[9],a}function IA(e){if(!e)return null;for(let t of e.split(`&`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e)===`page`){let n=Number.parseInt(t.slice(e+1),10);if(!Number.isNaN(n)&&n>=1)return n}}return null}function LA(e){let t=(0,J.c)(10),{label:n,id:r,children:i}=e,a=(0,Y.useId)(),o;t[0]!==r||t[1]!==a?(o=r||`tab-panel-${a.replace(/:/g,``)}`,t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c=`${s}-tab`,l;t[3]===n?l=t[4]:(l=n?.trim()||`Tab`,t[3]=n,t[4]=l);let u=l,d;return t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==c?(d=(0,X.jsx)(`section`,{className:`tab-panel`,id:s,role:`tabpanel`,"aria-labelledby":c,"data-tab-label":u,"data-tab-id":s,children:i}),t[5]=i,t[6]=s,t[7]=u,t[8]=c,t[9]=d):d=t[9],d}var RA=`[data-component-type="tabs"]`,zA=`[data-node-view-content-react] > .react-renderer`;function BA(e){let t=e.closest(RA);return t?Array.from(e.querySelectorAll(zA)).filter(e=>e.parentElement?.closest(RA)===t).map((e,t)=>{let n=e.querySelector(`[data-tab-label]`);return{index:t,label:(n?.getAttribute(`data-tab-label`))?.trim()||`Tab ${t+1}`,panelId:n?.getAttribute(`data-tab-id`)??null}}):[]}function VA(e){let t=(0,J.c)(33),{id:n,children:r}=e,[a,o]=(0,Y.useState)(0),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Y.useState)(s),u=(0,Y.useRef)(null),d=(0,Y.useRef)(null),f=(0,Y.useRef)(0),p=rk(),m=p?.addChild!=null,{_:h}=i(),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=u.current;if(!e)return;let t=BA(e);l(e=>{if(e.length!==t.length)return t;for(let n=0;n<e.length;n++)if(e[n].label!==t[n].label||e[n].panelId!==t[n].panelId)return t;return e})},t[1]=g):g=t[1],(0,Y.useLayoutEffect)(g);let _,v;t[2]===c.length?(_=t[3],v=t[4]):(_=()=>{c.length>f.current&&c.length>0&&o(c.length-1),f.current=c.length},v=[c.length],t[2]=c.length,t[3]=_,t[4]=v),(0,Y.useLayoutEffect)(_,v);let y;t[5]===n?y=t[6]:(y=()=>{let e=()=>{let e=window.location.hash.slice(1);if(!e)return;if(n&&e===n){o(0);return}let t=u.current;if(!t)return;let r=BA(t).findIndex(t=>t.panelId===e);r<0||(o(r),queueMicrotask(()=>{t.ownerDocument.getElementById(e)?.scrollIntoView({block:`start`,behavior:`auto`})}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},t[5]=n,t[6]=y),(0,Y.useLayoutEffect)(y);let b=c.length===0?0:Math.min(Math.max(a,0),c.length-1),x;t[7]!==c.length||t[8]!==b?(x=e=>{if(c.length===0)return;let t=null;e.key===`ArrowRight`?t=(b+1)%c.length:e.key===`ArrowLeft`?t=(b-1+c.length)%c.length:e.key===`Home`?t=0:e.key===`End`&&(t=c.length-1),t!==null&&(e.preventDefault(),o(t),(d.current?.querySelectorAll(`[role="tab"]`))?.[t]?.focus())},t[7]=c.length,t[8]=b,t[9]=x):x=t[9];let S=x,C=n?`Tabs: ${n}`:`Tabs`,w;if(t[10]!==c||t[11]!==b){let e;t[13]===b?e=t[14]:(e=e=>(0,X.jsx)(`button`,{id:e.panelId?`${e.panelId}-tab`:void 0,type:`button`,role:`tab`,className:`tabs-strip-pill`,"data-active":e.index===b,"aria-selected":e.index===b,"aria-controls":e.panelId??void 0,tabIndex:e.index===b?0:-1,onMouseDown:UA,onClick:()=>o(e.index),children:e.label},e.index),t[13]=b,t[14]=e),w=c.map(e),t[10]=c,t[11]=b,t[12]=w}else w=t[12];let T;t[15]!==S||t[16]!==C||t[17]!==w?(T=(0,X.jsx)(`div`,{ref:d,role:`tablist`,"aria-label":C,className:`tabs-tablist`,onKeyDown:S,children:w}),t[15]=S,t[16]=C,t[17]=w,t[18]=T):T=t[18];let E;t[19]!==h||t[20]!==m||t[21]!==p?(E=m&&(0,X.jsx)(`button`,{type:`button`,className:`tabs-strip-add`,"aria-label":h({id:`hjO0Mq`}),title:h({id:`hjO0Mq`}),onMouseDown:HA,onClick:()=>p?.addChild?.(),"data-tabs-strip-add":``,children:`+`}),t[19]=h,t[20]=m,t[21]=p,t[22]=E):E=t[22];let D;t[23]!==E||t[24]!==T?(D=(0,X.jsxs)(`div`,{className:`tabs-strip`,contentEditable:!1,children:[T,E]}),t[23]=E,t[24]=T,t[25]=D):D=t[25];let O;t[26]!==r||t[27]!==b?(O=(0,X.jsx)(`div`,{ref:u,className:`tabs-content`,"data-active-index":b,children:r}),t[26]=r,t[27]=b,t[28]=O):O=t[28];let k;return t[29]!==n||t[30]!==D||t[31]!==O?(k=(0,X.jsxs)(`div`,{className:`tabs`,id:n,children:[D,O]}),t[29]=n,t[30]=D,t[31]=O,t[32]=k):k=t[32],k}function HA(e){return e.preventDefault()}function UA(e){return e.preventDefault()}var WA=typeof global<`u`&&{}.toString.call(global)===`[object global]`,GA=typeof Bun<`u`,KA=typeof Deno<`u`,qA=typeof WebSocketPair==`function`&&caches?.default!==void 0,JA=WA||GA||KA||qA;function YA(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function XA(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function ZA(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function QA(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function $A(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function ej(e){let t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``);for(let e of[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`])if(n.endsWith(e))return n;return`vimeo.com`}function tj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(ZA(r))return`https://vimeo.com/${r}`;if(QA(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}var nj=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(t=>{e[r](t,n)}),{cancel:()=>a.forEach(t=>e[i](t,n))}};function rj(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!e||!t||typeof t.querySelectorAll!=`function`)return null;let n=t.querySelectorAll(`iframe`);for(let t=0;t<n.length;t++)if(n[t]&&n[t].contentWindow===e)return n[t];return null}var ij=Array.prototype.indexOf!==void 0,aj=typeof window<`u`&&window.postMessage!==void 0;if(!JA&&(!ij||!aj))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var oj=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function sj(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},`x`,{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:oj);var cj=sj(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,oj,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},`x`,{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),lj=new WeakMap;function uj(e,t,n){let r=lj.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),lj.set(e.element,r)}function dj(e,t){return(lj.get(e.element)||{})[t]||[]}function fj(e,t,n){let r=lj.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],lj.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),lj.set(e.element,r),r[t]&&r[t].length===0}function pj(e,t){let n=dj(e,t);if(n.length<1)return!1;let r=n.shift();return fj(e,t,r),r}function mj(e,t){let n=lj.get(e);lj.set(t,n),lj.delete(e)}function hj(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function gj(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)return;let r={method:t};n!==void 0&&(r.value=n);let i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}function _j(e,t){t=hj(t);let n=[],r;if(t.event)t.event===`error`&&dj(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),fj(e,t.data.method,n)}),n=dj(e,`event:${t.event}`),r=t.data;else if(t.method){let i=pj(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(t=>{try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}var vj=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function yj(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vj.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function bj(e,t){let{html:n}=e;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);let r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function xj(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((r,i)=>{if(!QA(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${ej(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(let e in t)t.hasOwnProperty(e)&&(a+=`&${e}=${encodeURIComponent(t[e])}`);let o=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;o.open(`GET`,a,!0),o.onload=function(){if(o.status===404){i(Error(`“${e}” was not found.`));return}if(o.status===403){i(Error(`“${e}” is not embeddable.`));return}try{let t=JSON.parse(o.responseText);if(t.domain_status_code===403){bj(t,n),i(Error(`“${e}” is not embeddable.`));return}r(t)}catch(e){i(e)}},o.onerror=function(){let e=o.status?` (${o.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},o.send()})}function Sj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=e=>{`console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(e=>{try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;let t=yj(e);xj(tj(t),t,e).then(t=>bj(t,e)).catch(n)}catch(e){n(e)}})}function Cj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!QA(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?rj(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function wj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!QA(t.origin))return;let n=hj(t.data);if(!n||n.event!==`ready`)return;let r=t.source?rj(t.source,e):null;r&&$A(r.src)&&new Nj(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function Tj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;window.VimeoCheckedUrlTimeParam=!0;let t=e=>{`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,n=>{if(!QA(n.origin))return;let r=hj(n.data);if(!r||r.event!==`ready`)return;let i=n.source?rj(n.source,e):null;if(i&&$A(i.src)){let e=new Nj(i);e.getVideoId().then(t=>{let n=RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);if(n&&n[1]){let t=decodeURI(n[1]);e.setCurrentTime(t)}}).catch(t)}})}function Ej(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!QA(e.origin))return;let t=hj(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?rj(e.source):null;if(!n)return;let r=n.getAttribute(`allow`)||``;if(!r.includes(`encrypted-media`)){n.setAttribute(`allow`,`${r}; encrypted-media`);let e=new URL(n.getAttribute(`src`));e.searchParams.set(`forcereload`,`drm`),n.setAttribute(`src`,e.toString());return}}))}function Dj(){let e=function(){let e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};for(;n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request(t){return new Promise((r,i)=>{let a=function(){n.off(`fullscreenchange`,a),r()};n.on(`fullscreenchange`,a),t||=document.documentElement;let o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit(){return new Promise((t,r)=>{if(!n.isFullscreen){t();return}let i=function(){n.off(`fullscreenchange`,i),t()};n.on(`fullscreenchange`,i);let a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on(e,n){let r=t[e];r&&document.addEventListener(r,n)},off(e,n){let r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[e.fullscreenEnabled]}}}),n}var Oj={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},kj=class extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;super(),this.logger=r,this.init(t,e,{...Oj,...n})}disconnect(){this.dispatchEvent(new Event(`disconnect`))}async init(e,t,n){if(await this.waitForTOReadyState(e,`open`),n.role===`viewer`){await this.updatePlayer(e,t,n);let r=nj(e,`change`,()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener(`disconnect`,()=>{i.cancel(),r.cancel()})}else{await this.updateTimingObject(e,t);let n=nj(t,[`seeked`,`play`,`pause`,`ratechange`],()=>this.updateTimingObject(e,t),`on`,`off`);this.addEventListener(`disconnect`,()=>n.cancel())}}async updateTimingObject(e,t){let[n,r,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:r?0:i})}async updatePlayer(e,t,n){let{position:r,velocity:i}=e.query();typeof r==`number`&&t.setCurrentTime(r),typeof i==`number`&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async e=>{e.name===`NotAllowedError`&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(e=>console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){let{allowedDrift:r,maxAllowedDrift:i,minCheckInterval:a,maxRateAdjustment:o,maxTimeToCatchUp:s}=n,c=Math.min(s,Math.max(a,i))*1e3,l=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;let n=e.query().position-await t.getCurrentTime(),a=Math.abs(n);if(this.log(`Drift: ${n}`),a>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log(`Resync by currentTime`);else if(a>r){let e=a/s,r=o,i=e<r?(r-e)/2:r;await this.adjustSpeed(t,i*Math.sign(n)),this.log(`Resync by playbackRate`)}},u=setInterval(()=>l(),c);return{cancel:()=>clearInterval(u)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;let n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{let r=()=>{e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})};r()})}},Aj=new WeakMap,jj=new WeakMap,Mj={},Nj=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),e=e[0]),typeof document<`u`&&typeof e==`string`&&(e=document.getElementById(e)),!XA(e))throw TypeError(`You must pass either a valid element or a valid id.`);if(e.nodeName!==`IFRAME`){let t=e.querySelector(`iframe`);t&&(e=t)}if(e.nodeName===`IFRAME`&&!QA(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if(Aj.has(e))return Aj.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new cj((n,r)=>{if(this._onMessage=e=>{if(!QA(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=hj(e.data);if(t&&t.event===`error`&&t.data&&t.data.method===`ready`){let e=Error(t.data.message);e.name=t.data.name,r(e);return}let i=t&&t.event===`ready`,a=t&&t.method===`ping`;if(i||a){this.element.setAttribute(`data-ready`,`true`),n();return}_j(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=yj(e,t);xj(tj(n),n,e).then(t=>{let n=bj(t,e);return this.element=n,this._originalElement=e,mj(e,n),Aj.set(this.element,this),t}).catch(r)}});if(jj.set(this,n),Aj.set(this.element,this),this.element.nodeName===`IFRAME`&&gj(this,`ping`),Mj.isEnabled){let e=()=>Mj.exit();this.fullscreenchangeHandler=()=>{Mj.isFullscreen?uj(this,`event:exitFullscreen`,e):fj(this,`event:exitFullscreen`,e),this.ready().then(()=>{gj(this,`fullscreenchange`,Mj.isFullscreen)})},Mj.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return QA(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new cj((n,r)=>this.ready().then(()=>{uj(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),gj(this,e,t)}).catch(r))}get(e){return new cj((t,n)=>(e=YA(e,`get`),this.ready().then(()=>{uj(this,e,{resolve:t,reject:n}),gj(this,e)}).catch(n)))}set(e,t){return new cj((n,r)=>{if(e=YA(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{uj(this,e,{resolve:n,reject:r}),gj(this,e,t)}).catch(r)})}on(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);dj(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),uj(this,`event:${e}`,t)}off(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);fj(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=jj.get(this)||new cj((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return cj.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}removeCuePoint(e){return this.callMethod(`removeCuePoint`,e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod(`disableTextTrack`)}selectAudioTrack(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`selectAudioTrack`,{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod(`selectDefaultAudioTrack`)}pause(){return this.callMethod(`pause`)}play(){return this.callMethod(`play`)}requestFullscreen(){return Mj.isEnabled?Mj.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return Mj.isEnabled?Mj.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return Mj.isEnabled?cj.resolve(Mj.isFullscreen):this.get(`fullscreen`)}requestPictureInPicture(){return this.callMethod(`requestPictureInPicture`)}exitPictureInPicture(){return this.callMethod(`exitPictureInPicture`)}getPictureInPicture(){return this.get(`pictureInPicture`)}remotePlaybackPrompt(){return this.callMethod(`remotePlaybackPrompt`)}unload(){return this.callMethod(`unload`)}destroy(){return new cj(e=>{if(jj.delete(this),Aj.delete(this.element),this._originalElement&&(Aj.delete(this._originalElement),this._originalElement.removeAttribute(`data-vimeo-initialized`)),this.element&&this.element.nodeName===`IFRAME`&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName===`DIV`&&this.element.parentNode){this.element.removeAttribute(`data-vimeo-initialized`);let e=this.element.querySelector(`iframe`);e&&e.parentNode&&(e.parentNode.parentNode&&this._originalElement&&this._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}this._window.removeEventListener(`message`,this._onMessage),Mj.isEnabled&&Mj.off(`fullscreenchange`,this.fullscreenchangeHandler),e()})}getAutopause(){return this.get(`autopause`)}setAutopause(e){return this.set(`autopause`,e)}getBuffered(){return this.get(`buffered`)}getCameraProps(){return this.get(`cameraProps`)}setCameraProps(e){return this.set(`cameraProps`,e)}getChapters(){return this.get(`chapters`)}getCurrentChapter(){return this.get(`currentChapter`)}getColor(){return this.get(`color`)}getColors(){return cj.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}setColor(e){return this.set(`color`,e)}setColors(e){if(!Array.isArray(e))return new cj((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new cj(e=>e(null)),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return cj.all(n)}getCuePoints(){return this.get(`cuePoints`)}getCurrentTime(){return this.get(`currentTime`)}setCurrentTime(e){return this.set(`currentTime`,e)}getDuration(){return this.get(`duration`)}getEnded(){return this.get(`ended`)}getLoop(){return this.get(`loop`)}setLoop(e){return this.set(`loop`,e)}setMuted(e){return this.set(`muted`,e)}getMuted(){return this.get(`muted`)}getPaused(){return this.get(`paused`)}getPlaybackRate(){return this.get(`playbackRate`)}setPlaybackRate(e){return this.set(`playbackRate`,e)}getPlayed(){return this.get(`played`)}getQualities(){return this.get(`qualities`)}getQuality(){return this.get(`quality`)}setQuality(e){return this.set(`quality`,e)}getRemotePlaybackAvailability(){return this.get(`remotePlaybackAvailability`)}getRemotePlaybackState(){return this.get(`remotePlaybackState`)}getSeekable(){return this.get(`seekable`)}getSeeking(){return this.get(`seeking`)}getTextTracks(){return this.get(`textTracks`)}getAudioTracks(){return this.get(`audioTracks`)}getEnabledAudioTrack(){return this.get(`enabledAudioTrack`)}getDefaultAudioTrack(){return this.get(`defaultAudioTrack`)}getVideoEmbedCode(){return this.get(`videoEmbedCode`)}getVideoId(){return this.get(`videoId`)}getVideoTitle(){return this.get(`videoTitle`)}getVideoWidth(){return this.get(`videoWidth`)}getVideoHeight(){return this.get(`videoHeight`)}getVideoUrl(){return this.get(`videoUrl`)}getVolume(){return this.get(`volume`)}setVolume(e){return this.set(`volume`,e)}async setTimingSrc(e,t){if(!e)throw TypeError(`A Timing Object must be provided.`);await this.ready();let n=new kj(this,e,t);return gj(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>gj(this,`notifyTimingObjectDisconnect`)),n}};JA||(Mj=Dj(),Sj(),Cj(),wj(),Tj(),Ej());function Pj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fj(e,t)}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fj(e,t)}var Ij={play:`onPlay`,playing:`onPlaying`,pause:`onPause`,ended:`onEnd`,timeupdate:`onTimeUpdate`,progress:`onProgress`,seeked:`onSeeked`,texttrackchange:`onTextTrackChange`,cuechange:`onCueChange`,cuepoint:`onCuePoint`,volumechange:`onVolumeChange`,playbackratechange:`onPlaybackRateChange`,error:`onError`,loaded:`onLoaded`},Lj=function(e){function t(t){var n=e.call(this,t)||this;return n.refContainer=n.refContainer.bind(n),n}Pj(t,e);var n=t.prototype;return n.componentDidMount=function(){this.createPlayer()},n.componentDidUpdate=function(e){var t=this,n=Object.keys(this.props).filter(function(n){return t.props[n]!==e[n]});this.updateProps(n)},n.componentWillUnmount=function(){this.player.destroy()},n.getInitialOptions=function(){var e,t=this.props.video,n=/^https?:/i.test(t)?`url`:`id`;return e={},e[n]=t,e.width=this.props.width,e.height=this.props.height,e.autopause=this.props.autopause,e.autoplay=this.props.autoplay,e.byline=this.props.showByline,e.color=this.props.color,e.controls=this.props.controls,e.loop=this.props.loop,e.portrait=this.props.showPortrait,e.title=this.props.showTitle,e.muted=this.props.muted,e.background=this.props.background,e.responsive=this.props.responsive,e.dnt=this.props.dnt,e.speed=this.props.speed,e.keyboard=this.props.keyboard,e.pip=this.props.pip,e.playsinline=this.props.playsInline,e.quality=this.props.quality,e.texttrack=this.props.textTrack,e.transparent=this.props.transparent,e},n.updateProps=function(e){var t=this,n=this.player;e.forEach(function(e){var r=t.props[e];switch(e){case`autopause`:n.setAutopause(r);break;case`color`:n.setColor(r);break;case`loop`:n.setLoop(r);break;case`volume`:n.setVolume(r);break;case`paused`:n.getPaused().then(function(e){return r&&!e?n.pause():!r&&e?n.play():null});break;case`width`:case`height`:n.element[e]=r;break;case`video`:if(r){var i=t.props.start,a=n.loadVideo(r);typeof i==`number`&&a.then(function(){n.setCurrentTime(i)})}else n.unload();break;case`playbackRate`:n.setPlaybackRate(r);break;case`quality`:n.setQuality(r);break}})},n.createPlayer=function(){var e=this,t=this.props,n=t.start,r=t.volume,i=t.playbackRate;this.player=new Nj(this.container,this.getInitialOptions()),Object.keys(Ij).forEach(function(t){var n=Ij[t];e.player.on(t,function(t){var r=e.props[n];r&&r(t)})});var a=this.props,o=a.onError,s=a.onReady;this.player.ready().then(function(){s&&s(e.player)},function(e){if(o)o(e);else throw e}),typeof n==`number`&&this.player.setCurrentTime(n),typeof r==`number`&&this.updateProps([`volume`]),typeof i==`number`&&this.updateProps([`playbackRate`])},n.refContainer=function(e){this.container=e},n.render=function(){var e=this.props,t=e.id,n=e.className,r=e.style;return Y.createElement(`div`,{id:t,className:n,style:r,ref:this.refContainer})},t}(Y.Component);Lj.defaultProps={autopause:!0,autoplay:!1,showByline:!0,controls:!0,loop:!1,showPortrait:!0,showTitle:!0,muted:!1,background:!1,responsive:!1,dnt:!1,speed:!1,keyboard:!0,pip:!1,playsInline:!0,transparent:!0};var Rj={default:120,mqdefault:320,hqdefault:480,sddefault:640,maxresdefault:1280},zj=(e,t,n,r=`maxresdefault`)=>{let[i,a]=(0,Y.useState)(``);return(0,Y.useEffect)(()=>{let i=`https://img.youtube.com/${t}/${e}/${r}.${n}`,o=`https://img.youtube.com/${t}/${e}/hqdefault.${n}`,s=Rj[r],c=new Image;c.onload=()=>{c.width<s?a(o):a(i)},c.onerror=()=>a(o),c.src=i},[e,t,n,r]),i};function Bj(e,t,n,r,i){let a={"@context":`https://schema.org`,"@type":`VideoObject`,name:i?.name||t,thumbnailUrl:[i?.thumbnailUrl||n],embedUrl:i?.embedUrl||`${r}/embed/${e}`,contentUrl:i?.contentUrl||`https://www.youtube.com/watch?v=${e}`,...i?.description&&{description:i.description},...i?.uploadDate&&{uploadDate:i.uploadDate},...i?.duration&&{duration:i.duration}};return JSON.stringify(a)}function Vj(e,t){let[n,r]=Y.useState(!1),[i,a]=Y.useState(e.alwaysLoadIframe||!1),o=encodeURIComponent(e.id),s=typeof e.playlistCoverId==`string`?encodeURIComponent(e.playlistCoverId):null,c=e.title,l=e.poster||`hqdefault`,u=e.announce||`Watch`,d=e.alwaysLoadIframe?e.autoplay&&e.muted:!0,f=Y.useMemo(()=>{let t=new URLSearchParams({...e.muted?{mute:`1`}:{},...d?{autoplay:`1`}:{},...e.enableJsApi?{enablejsapi:`1`}:{},...e.enableJsApi&&typeof window<`u`?{origin:window.location.origin}:{},...e.playlist?{list:o}:{}});return e.params&&new URLSearchParams(e.params.startsWith(`&`)?e.params.slice(1):e.params).forEach((e,n)=>{t.append(n,e)}),t},[e.muted,d,e.enableJsApi,e.playlist,o,e.params]),p=Y.useMemo(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`,[e.cookie]),m=Y.useMemo(()=>e.playlist?`${p}/embed/videoseries?${f.toString()}`:`${p}/embed/${o}?${f.toString()}`,[e.playlist,p,o,f]),h=!e.thumbnail&&!e.playlist&&l===`maxresdefault`,g=e.webp?`webp`:`jpg`,_=e.webp?`vi_webp`:`vi`,v=h?zj(e.id,_,g,l):null,y=Y.useMemo(()=>e.thumbnail||v||`https://i.ytimg.com/${_}/${e.playlist?s:o}/${l}.${g}`,[e.thumbnail,v,_,e.playlist,s,o,l,g]),b=e.activatedClass||`lyt-activated`,x=e.adNetwork||!1,S=e.aspectHeight||9,C=e.aspectWidth||16,w=e.iframeClass||``,T=e.playerClass||`lty-playbtn`,E=e.wrapperClass||`yt-lite`,D=Y.useCallback(e.onIframeAdded||function(){},[e.onIframeAdded]),O=e.rel?`prefetch`:`preload`,k=e.containerElement||`article`,A=e.noscriptFallback!==!1,j=()=>{n||r(!0)},M=()=>{i||a(!0)};return Y.useEffect(()=>{i&&(D(),e.focusOnLoad&&typeof t==`object`&&t?.current&&t.current.focus())},[i,D,e.focusOnLoad,t]),Y.useEffect(()=>{if(!i||!e.enableJsApi||!(e.onReady||e.onStateChange||e.onError||e.onPlay||e.onPause||e.onEnd||e.onBuffering||e.onPlaybackRateChange||e.onPlaybackQualityChange))return;let n=!1,r=!1,a=r=>{if(r.origin!==`https://www.youtube.com`&&r.origin!==`https://www.youtube-nocookie.com`)return;let i;try{i=typeof r.data==`string`?JSON.parse(r.data):r.data}catch{return}switch(i.event){case`onReady`:n||(n=!0,e.onReady&&e.onReady({videoId:e.id,title:c}));break;case`infoDelivery`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate),i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break;case`onStateChange`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}break;case`onError`:if(i.info&&`errorCode`in i.info){let t=i.info.errorCode;e.onError&&e.onError(t)}break;case`onPlaybackRateChange`:i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate);break;case`onPlaybackQualityChange`:i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break}};window.addEventListener(`message`,a);let s=[],l=()=>{typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"listening","id":"`+o+`"}`,`*`)},u=()=>{r||(r=!0,l(),[100,300,600,1200,2400].forEach(e=>{s.push(setTimeout(l,e))}))};return typeof t==`object`&&t?.current?(t.current.addEventListener(`load`,u),t.current.contentDocument?.readyState===`complete`&&u()):[200,500,1e3,2e3,3e3].forEach(e=>{s.push(setTimeout(l,e))}),()=>{window.removeEventListener(`message`,a),s.forEach(clearTimeout),typeof t==`object`&&t?.current&&t.current.removeEventListener(`load`,u)}},[i,e.enableJsApi,e.onReady,e.onStateChange,e.onError,e.onPlay,e.onPause,e.onEnd,e.onBuffering,e.onPlaybackRateChange,e.onPlaybackQualityChange,e.stopOnEnd,e.id,o,c,t]),(0,X.jsxs)(X.Fragment,{children:[!e.lazyLoad&&(0,X.jsx)(`link`,{rel:O,href:y,as:`image`}),(0,X.jsx)(X.Fragment,{children:n&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`link`,{rel:`preconnect`,href:p}),(0,X.jsx)(`link`,{rel:`preconnect`,href:`https://www.google.com`}),x&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`link`,{rel:`preconnect`,href:`https://static.doubleclick.net`}),(0,X.jsx)(`link`,{rel:`preconnect`,href:`https://googleads.g.doubleclick.net`})]})]})}),e.seo&&!e.playlist&&(0,X.jsx)(`script`,{type:`application/ld+json`,dangerouslySetInnerHTML:{__html:Bj(e.id,c,y,p,e.seo)}}),A&&!e.playlist&&(0,X.jsx)(`noscript`,{children:(0,X.jsxs)(`a`,{href:`https://www.youtube.com/watch?v=${e.id}`,"aria-label":`Watch ${c} on YouTube`,children:[`Watch "`,c,`" on YouTube`]})}),(0,X.jsxs)(k,{onPointerOver:j,onClick:M,className:`${E} ${i?b:``}`,"data-title":c,role:!i&&!e.lazyLoad?`img`:void 0,"aria-label":i?void 0:`${c} - YouTube video preview`,style:{...!e.lazyLoad&&{backgroundImage:`url(${y})`},"--aspect-ratio":`${S/C*100}%`,...e.style||{}},children:[e.lazyLoad&&!i&&(0,X.jsx)(`img`,{src:y,alt:`${c} - YouTube thumbnail`,className:`lty-thumbnail`,loading:`lazy`}),e.playlist&&!i&&(0,X.jsx)(`div`,{className:`lty-playlist-icon`,"aria-hidden":`true`}),!(e.hideButtonOnActivate&&i)&&(0,X.jsx)(`button`,{type:`button`,className:T,"aria-label":`${u} ${c}`,"aria-hidden":i||void 0,tabIndex:i?-1:0,onClick:M,children:(0,X.jsx)(`span`,{className:`lty-visually-hidden`,children:u})}),i&&(0,X.jsx)(`iframe`,{ref:t,className:w,title:c,width:`560`,height:`315`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,src:m,referrerPolicy:e.referrerPolicy||`strict-origin-when-cross-origin`})]})]})}var Hj=Y.forwardRef(Vj);function Uj(e){return e!==!1}function Wj(e,t){let n=[];return t.startSeconds!==null&&n.push(`start=${t.startSeconds}`),e.controls===!1&&n.push(`controls=0`),e.loop===!0&&n.push(`loop=1`,`playlist=${t.id}`),e.playsinline===!0&&n.push(`playsinline=1`),n.length>0?n.join(`&`):void 0}function Gj(e){if(e.width!==void 0)return{width:e.width}}function Kj(e){if(!(e.width===void 0||e.height===void 0))return{aspectRatio:`${e.width} / ${e.height}`}}function qj(e){let t=(0,J.c)(23),n=(0,Y.useRef)(null),r=e.title??`Vimeo video player`,i;t[0]===r?i=t[1]:(i=e=>{let t=e;n.current=t,t.element&&(t.element.title=r)},t[0]=r,t[1]=i);let a=i,o,s;t[2]===r?(o=t[3],s=t[4]):(o=()=>{let e=n.current;e?.element&&(e.element.title=r)},s=[r],t[2]=r,t[3]=o,t[4]=s),(0,Y.useEffect)(o,s);let c;t[5]===e?c=t[6]:(c=Gj(e),t[5]=e,t[6]=c);let l=e.width===void 0,u=e.autoplay===!0,d=e.muted===!0,f=e.muted===!0?0:1,p=e.loop===!0,m=e.controls!==!1,h=e.playsinline!==!1,g;t[7]!==a||t[8]!==e.height||t[9]!==e.src||t[10]!==e.width||t[11]!==h||t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(g=(0,X.jsx)(Lj,{video:e.src,responsive:l,width:e.width,height:e.height,autoplay:u,muted:d,volume:f,loop:p,controls:m,playsInline:h,onReady:a}),t[7]=a,t[8]=e.height,t[9]=e.src,t[10]=e.width,t[11]=h,t[12]=l,t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=g):g=t[18];let _;return t[19]!==e.title||t[20]!==g||t[21]!==c?(_=(0,X.jsx)(`div`,{className:`ok-video ok-video-vimeo`,style:c,title:e.title,children:g}),t[19]=e.title,t[20]=g,t[21]=c,t[22]=_):_=t[22],_}function Jj(e){let t=(0,J.c)(17),n;t[0]===e.src?n=t[1]:(n=se(e.src),t[0]=e.src,t[1]=n);let r=n;if(!r)return null;let i;t[2]!==r.startRaw||t[3]!==e.autoplay||t[4]!==e.muted?(i=[],r.startRaw!==null&&i.push(`t=${r.startRaw}`),e.autoplay===!0&&i.push(`autoplay=true`),e.muted===!0&&i.push(`muted=true`),t[2]=r.startRaw,t[3]=e.autoplay,t[4]=e.muted,t[5]=i):i=t[5];let a=i.length>0?`https://www.loom.com/embed/${r.id}?${i.join(`&`)}`:`https://www.loom.com/embed/${r.id}`,o;t[6]===e?o=t[7]:(o=Gj(e),t[6]=e,t[7]=o);let s=e.title??`Loom video player`,c;t[8]!==a||t[9]!==e.height||t[10]!==e.width||t[11]!==s?(c=(0,X.jsx)(`iframe`,{className:`ok-video-loom-iframe`,src:a,title:s,width:e.width,height:e.height,allow:`autoplay; fullscreen`,referrerPolicy:`strict-origin-when-cross-origin`,allowFullScreen:!0}),t[8]=a,t[9]=e.height,t[10]=e.width,t[11]=s,t[12]=c):c=t[12];let l;return t[13]!==e.title||t[14]!==o||t[15]!==c?(l=(0,X.jsx)(`div`,{className:`ok-video ok-video-loom`,style:o,title:e.title,children:c}),t[13]=e.title,t[14]=o,t[15]=c,t[16]=l):l=t[16],l}function Yj(e){let t=(0,J.c)(29);if(e.src!==void 0&&tt(e.src)){let n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(Jj,{...e,src:e.src}),t[0]=e,t[1]=n),n}if(e.src!==void 0&&Ee(e.src)){let n;return t[2]===e?n=t[3]:(n=(0,X.jsx)(qj,{...e,src:e.src}),t[2]=e,t[3]=n),n}let n;if(t[4]!==e){n=Symbol.for(`react.early_return_sentinel`);bb0:{let r=e.src===void 0?null:L(e.src);if(r!==null){let i=e.autoplay===!0&&e.muted===!0,a=e.width!==void 0&&e.height!==void 0,o=Gj(e),s;t[6]===e.poster?s=t[7]:(s=e.poster===void 0?void 0:Fe(e.poster),t[6]=e.poster,t[7]=s);let c=(0,X.jsx)(Hj,{id:r.id,title:e.title??`YouTube video player`,cookie:!r.noCookie,params:Wj(e,r),muted:e.muted===!0,autoplay:e.autoplay===!0,alwaysLoadIframe:i,thumbnail:s,aspectWidth:a?Number(e.width):void 0,aspectHeight:a?Number(e.height):void 0,style:Kj(e)}),l;t[8]!==o||t[9]!==c?(l=(0,X.jsx)(`div`,{className:`ok-video ok-video-youtube`,style:o,children:c}),t[8]=o,t[9]=c,t[10]=l):l=t[10],n=l;break bb0}}t[4]=e,t[5]=n}else n=t[5];if(n!==Symbol.for(`react.early_return_sentinel`))return n;let r;t[11]===e.src?r=t[12]:(r=e.src===void 0?void 0:Fe(e.src),t[11]=e.src,t[12]=r);let i=e.title,a;t[13]===e.controls?a=t[14]:(a=Uj(e.controls),t[13]=e.controls,t[14]=a);let o;t[15]===e.poster?o=t[16]:(o=e.poster===void 0?void 0:Fe(e.poster),t[15]=e.poster,t[16]=o);let s;return t[17]!==e.autoplay||t[18]!==e.height||t[19]!==e.loop||t[20]!==e.muted||t[21]!==e.playsinline||t[22]!==e.preload||t[23]!==e.title||t[24]!==e.width||t[25]!==r||t[26]!==a||t[27]!==o?(s=(0,X.jsx)(`video`,{className:`ok-video`,src:r,title:i,controls:a,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:o,preload:e.preload,width:e.width,height:e.height}),t[17]=e.autoplay,t[18]=e.height,t[19]=e.loop,t[20]=e.muted,t[21]=e.playsinline,t[22]=e.preload,t[23]=e.title,t[24]=e.width,t[25]=r,t[26]=a,t[27]=o,t[28]=s):s=t[28],s}function Xj(e){let t=(0,J.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,X.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var Zj={Callout:ek,img:Xk,video:Yj,audio:YO,Pdf:AA,File:pk,Embed:dk,Accordion:qO,Tabs:VA,Tab:LA,Math:$k,MermaidFence:nA,Mirror:gA,MirrorSource:_A,"*":Xj};function Qj(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var $j=Pe(),eM=new Map;function tM(e){if(e.surface===`compat`){let t=Zj[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:Qj(e.props)}}let t=Zj[e.name];return t?{Component:t,reactNodePropNames:Qj(e.props)}:null}for(let[e,t]of $j.entries()){let n=tM(t);n&&eM.set(e,n)}function nM(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function rM(e){let t=$j.getOrWildcard(e),n=eM.get(t.name)??eM.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return nM(t,n)}function iM(){let e=[];for(let[t,n]of $j.entries()){if(t===`*`)continue;let r=eM.get(t);r&&e.push(nM(n,r))}return e}var aM=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,oM=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,sM={Callout:{description:{id:`322lyb`},props:{type:`note`,title:`Heads up`},children:`Callouts draw attention to key information.`},Accordion:{description:{id:`mWVJRX`},props:{title:`Click to expand`,defaultOpen:!0},children:`Hidden content goes here.`},img:{description:{id:`VUijjF`},props:{src:aM,alt:`Sample image`}},video:{description:{id:`e1hptq`},props:{controls:!0,poster:oM}},audio:{description:{id:`9jnjV0`},props:{controls:!0}},Math:{description:{id:`Y-Urt2`},props:{formula:`c = \\pm\\sqrt{a^2 + b^2}`}},Embed:{description:{id:`jTLWxh`},render:()=>(0,X.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`https://example.com/embed`})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-2`,children:[(0,X.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1.5 w-full rounded-sm bg-muted-foreground/20`}),(0,X.jsx)(`span`,{className:`h-1.5 w-5/6 rounded-sm bg-muted-foreground/20`}),(0,X.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]})]})},Pdf:{description:{id:`Fqr8BP`},render:()=>(0,X.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-muted/40 px-1.5 py-1`,children:[(0,X.jsxs)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 text-muted-foreground`,"aria-hidden":`true`,children:[(0,X.jsx)(`title`,{children:`Thumbnails`}),(0,X.jsx)(`rect`,{x:`1`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,X.jsx)(`rect`,{x:`7`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,X.jsx)(`rect`,{x:`1`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,X.jsx)(`rect`,{x:`7`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`})]}),(0,X.jsxs)(`span`,{className:`ml-1 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5 font-mono`,children:`2`}),(0,X.jsx)(`span`,{children:`/ 12`})]}),(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] font-mono text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`−`}),(0,X.jsx)(`span`,{children:`100%`}),(0,X.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`+`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 gap-1 p-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex w-6 flex-col gap-0.5`,children:[(0,X.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`}),(0,X.jsx)(`span`,{className:`h-3 rounded-sm border border-foreground/60 bg-background`}),(0,X.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1 rounded-sm bg-background p-1.5`,children:[(0,X.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-sm bg-foreground/50`}),(0,X.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1 w-5/6 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1 w-2/3 rounded-sm bg-muted-foreground/30`})]})]})]})},MermaidFence:{description:{id:`z0a2EA`},render:()=>(0,X.jsxs)(`svg`,{viewBox:`0 0 200 120`,className:`h-full w-full text-foreground`,"aria-hidden":`true`,preserveAspectRatio:`xMidYMid meet`,children:[(0,X.jsx)(`title`,{children:`Mermaid flowchart preview`}),(0,X.jsx)(`defs`,{children:(0,X.jsx)(`marker`,{id:`mermaid-preview-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,X.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),(0,X.jsx)(`rect`,{x:`14`,y:`20`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,X.jsx)(`text`,{x:`42`,y:`38`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Start`}),(0,X.jsx)(`polygon`,{points:`100,18 140,50 100,82 60,50`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,X.jsx)(`text`,{x:`100`,y:`54`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Ready?`}),(0,X.jsx)(`rect`,{x:`130`,y:`84`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,X.jsx)(`text`,{x:`158`,y:`102`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`End`}),(0,X.jsx)(`line`,{x1:`70`,y1:`34`,x2:`80`,y2:`40`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,X.jsx)(`line`,{x1:`124`,y1:`62`,x2:`138`,y2:`82`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,X.jsx)(`text`,{x:`138`,y:`74`,fontSize:`8`,fill:`currentColor`,opacity:`0.6`,children:`yes`})]})},Tabs:{description:{id:`75Y1dk`},render:()=>(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex gap-1 border-b border-border pb-1`,children:[(0,X.jsx)(`span`,{className:`rounded-md bg-foreground/10 px-2 py-0.5 text-xs font-medium text-foreground`,children:`Tab 1`}),(0,X.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs text-muted-foreground`,children:`Tab 2`})]}),(0,X.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:(0,X.jsx)(o,{id:`m6YGpY`})})]})},Mirror:{description:{id:`8TLE9g`},render:()=>(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/40 px-2 py-1.5`,children:[(0,X.jsxs)(`span`,{className:`absolute -top-2 right-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(Yi,{className:`size-2.5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`EL_YRd`,components:{0:(0,X.jsx)(`code`,{className:`font-mono`})}})})]}),(0,X.jsx)(`span`,{className:`block h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`mt-1 block h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]}),(0,X.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,X.jsx)(o,{id:`qNOgUu`})})]})},MirrorSource:{description:{id:`-KCZ6n`},render:()=>(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/50 px-2 py-1.5`,children:[(0,X.jsxs)(`span`,{className:`absolute -top-2 left-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(Ki,{className:`size-2.5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`maDWIB`,components:{0:(0,X.jsx)(`code`,{className:`font-mono`})}})})]}),(0,X.jsx)(`span`,{className:`block h-1.5 w-4/5 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`mt-1 block h-1.5 w-3/5 rounded-sm bg-muted-foreground/20`})]}),(0,X.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,X.jsx)(o,{id:`emgiet`})})]})}};function cM(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function lM(e){let t=rM(e),n=cM(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var uM=new Set;function dM(e){uM.add(e)}function fM(e){if(typeof e==`number`)return uM.delete(e);let t=uM.values().next();return t.done?!1:(uM.delete(t.value),!0)}function pM(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(dM(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren&&e.commands.setTextSelection(t+2)}function mM(e){return t=>{let n=new WeakSet;t.state.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&n.add(t)});let r=lM(e.name);if(e.name===`Tabs`){let e=lM(`Tab`),t=lM(`Tab`),n=e.attrs,i=t.attrs;n.props={...n.props,label:`Tab 1`},i.props={...i.props,label:`Tab 2`},r.content=[e,t]}t.chain().focus().insertContent(r).run();let i=-1;t.state.doc.descendants((t,r)=>{if(i>=0)return!1;t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&!n.has(t)&&(i=r)}),!(i<0)&&pM(t,i,e)}}var hM=new Set([`File`,`Tab`]);function gM(){return[{name:`component-File`,label:B._({id:`J2eKUI`}),icon:ea,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",command:vM,preview:{description:B._({id:`t-JXbf`}),render:()=>(0,X.jsxs)(`div`,{className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5`,children:[(0,X.jsx)(ea,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:`quarterly-report.pdf`}),(0,X.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`1.4 MB`})]})}}]}function _M(){return[...iM().filter(e=>e.surface===`canonical`&&!hM.has(e.name)).map(e=>{let t=sM[e.name],n=e.Component,r=t?{description:B._(t.description),render:t.render??(()=>(0,X.jsx)(n,{...t.props,children:t.children}))}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:UO(e.icon),category:e.category??`content`,command:mM(e),aliases:e.searchTerms,description:e.description,preview:r}}),...gM()]}function vM(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`*/*`,t.style.display=`none`,t.addEventListener(`change`,()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;_O(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function yM(e,t){let n=SO.getState(e.state);if(!n)return null;for(let e of n.byId.values())if(e.markType===`link`&&e.from<=t&&t<e.to)return e.id;return null}function bM(){return[{name:`wikiLink`,label:B._({id:`mZHJju`}),icon:_a,category:`insert`,aliases:[`wiki`,`wikilink`,`[[`,`internal`,`page`,`backlink`,`cross-link`],description:"Link to another page (`[[page]]`) — opens a page picker",preview:{description:B._({id:`cqA3od`}),render:()=>(0,X.jsx)(`p`,{className:`text-sm leading-7`,children:(0,X.jsx)(o,{id:`u-9fWA`,components:{0:(0,X.jsx)(`span`,{className:`font-medium text-azure-blue underline underline-offset-2 dark:text-sky-blue`})}})})},command:e=>{e.chain().focus().insertContent(`[[`).run()}},{name:`externalLink`,label:B._({id:`0R4wMK`}),icon:Yi,category:`insert`,aliases:[`link`,`url`,`href`,`external`,`web`,`hyperlink`],description:"Link to an external URL (`https://…`)",preview:{description:B._({id:`ClDdyg`}),render:()=>(0,X.jsx)(`p`,{className:`text-sm leading-7`,children:(0,X.jsx)(o,{id:`QWT-Z9`,components:{0:(0,X.jsx)(`span`,{className:`font-medium text-azure-blue underline underline-offset-2 dark:text-sky-blue`}),1:(0,X.jsx)(`span`,{className:`text-[0.85em] opacity-60`})}})})},command:e=>{let t=e.state.selection.from;e.chain().focus().insertContent({type:`text`,text:`link`,marks:[{type:`link`,attrs:{href:`https://`}}]}).run();let n=yM(e,t);n&&(bO(n),requestAnimationFrame(()=>{VO(e).setActiveNode(n)}))}},{name:`component-Tag`,label:B._({id:`UL8A9w`}),icon:oa,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",preview:{description:B._({id:`5ClEAu`}),render:()=>(0,X.jsx)(`p`,{className:`text-sm leading-7`,children:(0,X.jsx)(o,{id:`KZLdgR`,components:{0:(0,X.jsx)(`a`,{className:`tag pointer-events-none`})}})})},command:e=>{e.chain().insertTag(``).run()}}]}function xM(e,t){e.chain().focus().insertContent({type:`codeBlock`,attrs:{language:`html`,meta:`preview`},content:[{type:`text`,text:t}]}).run()}var SM=`<div style="padding:20px;font-family:system-ui,sans-serif;color:var(--foreground)">
6
+ `);return/\s/.test(n)}):!1}var Ky=new b(`suggestion`);function qy({pluginKey:e=Ky,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:h=Wy,shouldShow:g,shouldResetDismissed:_}){let v,y=p?.(),b=r&&!i,x=()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=t.view.coordsAtPos(e);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}},C=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:x,w=({match:e,dismissedRange:n,state:r,transaction:i})=>_?.({editor:t,state:r,range:n,match:e,transaction:i,allowSpaces:b})?!1:b?e.range.from===n.from:e.range.from===n.from&&!Gy(i);function T(n,r){var i;try{let r=e.getState(n.state),a=r?.decorationId?n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`):null,o={editor:t,range:r?.range||{from:0,to:0},query:r?.query||null,text:r?.text||null,items:[],command:e=>d({editor:t,range:r?.range||{from:0,to:0},props:e}),decorationNode:a,clientRect:C(n,a)};(i=y?.onExit)==null||i.call(y,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let E=new S({key:e,view(){return{update:async(e,n)=>{var r,i,a,o,s;let c=this.key?.getState(n),l=this.key?.getState(e.state),u=c.active&&l.active&&c.range.from!==l.range.from,p=!c.active&&l.active,m=c.active&&!l.active,h=!p&&!m&&c.query!==l.query,g=p||u&&h,_=h||u,b=m||u&&h;if(!g&&!_&&!b)return;let x=b&&!g?c:l,S=e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);v={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:e=>d({editor:t,range:x.range,props:e}),decorationNode:S,clientRect:C(e,S)},g&&((r=y?.onBeforeStart)==null||r.call(y,v)),_&&((i=y?.onBeforeUpdate)==null||i.call(y,v)),(_||g)&&(v.items=await f({editor:t,query:x.query})),b&&((a=y?.onExit)==null||a.call(y,v)),_&&((o=y?.onUpdate)==null||o.call(y,v)),g&&((s=y?.onStart)==null||s.call(y,v))},destroy:()=>{var e;v&&((e=y?.onExit)==null||e.call(y,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(s,c,l,u){let{isEditable:d}=t,{composing:f}=t.view,{selection:p}=s,{empty:_,from:v}=p,y={...c},b=s.getMeta(e);if(b&&b.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y.dismissedRange=c.active?{...c.range}:c.dismissedRange,y;if(y.composing=f,s.docChanged&&y.dismissedRange!==null&&(y.dismissedRange={from:s.mapping.map(y.dismissedRange.from),to:s.mapping.map(y.dismissedRange.to)}),d&&(_||t.view.composing)){(v<c.range.from||v>c.range.to)&&!f&&!c.composing&&(y.active=!1);let e=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:p.$from}),l=`id_${Math.floor(Math.random()*4294967295)}`;e&&m({editor:t,state:u,range:e.range,isActive:c.active})&&(!g||g({editor:t,range:e.range,query:e.query,text:e.text,transaction:s}))?(y.dismissedRange!==null&&!w({match:e,dismissedRange:y.dismissedRange,state:u,transaction:s})&&(y.dismissedRange=null),y.dismissedRange===null?(y.active=!0,y.decorationId=c.decorationId?c.decorationId:l,y.range=e.range,y.query=e.query,y.text=e.text):y.active=!1):(e||(y.dismissedRange=null),y.active=!1)}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(t,n){var r;let{active:i,range:a}=E.getState(t.state);if(!i)return!1;if(n.key===`Escape`||n.key===`Esc`){let i=E.getState(t.state);return(r=y?.onKeyDown)==null||r.call(y,{view:t,event:n,range:i.range}),T(t,e),!0}return(y?.onKeyDown)?.call(y,{view:t,event:n,range:a})||!1},decorations(e){let{active:t,range:n,decorationId:r,query:i}=E.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),ye.create(e.doc,[ln.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return E}var Jy=qy;function Yy(e){return e.kind===`create`?`create:${e.value}`:`tag:${e.value}`}function Xy(e){if(e.kind===`create`){let t=e.value;return B._({id:`XPqe3B`,values:{tagValue:t}})}let t=B._({id:`pckX1A`,values:{0:e.count}}),n=e.value;return B._({id:`m2T1Xj`,values:{tagValue:n,uses:t}})}function Zy(e){let t=(0,J.c)(38),{items:n,query:r,selectedIndex:a,onSelect:s,onHover:c,loading:l,error:u}=e,d=l===void 0?!1:l,f=u===void 0?null:u,{_:p}=i(),m=(0,Y.useRef)(null),h=(0,Y.useId)(),g=a>=0&&a<n.length?`${h}-option-${a}`:void 0,_,v;t[0]===a?(_=t[1],v=t[2]):(_=()=>{let e=m.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(a);t&&t.scrollIntoView({block:`nearest`})},v=[a],t[0]=a,t[1]=_,t[2]=v),(0,Y.useEffect)(_,v);let y=Qy;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:y,children:(0,X.jsx)(o,{id:`a_u4ck`})}),t[4]=n):n=t[4],n}if(n.length===0){let e;if(t[5]!==p||t[6]!==f||t[7]!==r){let n=r.trim();e=f??p(n?{id:`9R7pRC`,values:{trimmed:n}}:{id:`KRJ6xh`}),t[5]=p,t[6]=f,t[7]=r,t[8]=e}else e=t[8];let n=e,i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[9]=i):i=t[9];let a;return t[10]===n?a=t[11]:(a=(0,X.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:y,children:n}),t[10]=n,t[11]=a),a}let b=a>=0&&a<n.length?n[a]:null,x;t[12]===p?x=t[13]:(x=p({id:`SCoBBH`}),t[12]=p,t[13]=x);let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[14]=S):S=t[14];let C;t[15]===b?C=t[16]:(C=b?Xy(b):``,t[15]=b,t[16]=C);let w;t[17]===C?w=t[18]:(w=(0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:C}),t[17]=C,t[18]=w);let T;t[19]===f?T=t[20]:(T=f&&(0,X.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[19]=f,t[20]=T);let E;if(t[21]!==n||t[22]!==h||t[23]!==c||t[24]!==s||t[25]!==a){let e;t[27]!==h||t[28]!==c||t[29]!==s||t[30]!==a?(e=(e,t)=>{let n=t===a,r=Yy(e),i=e.kind===`create`;return(0,X.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,"data-testid":i?`tag-suggestion-create`:`tag-suggestion-tag-${e.value}`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},onPointerMove:c?()=>c(t):void 0,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-xs text-muted-foreground`,children:`#`}),(0,X.jsx)(`span`,{className:`truncate font-medium flex-1`,children:e.value}),i?(0,X.jsx)(`span`,{className:`shrink-0 rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary`,children:(0,X.jsx)(o,{id:`isRobC`})}):(0,X.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:e.count})]},r)},t[27]=h,t[28]=c,t[29]=s,t[30]=a,t[31]=e):e=t[31],E=n.map(e),t[21]=n,t[22]=h,t[23]=c,t[24]=s,t[25]=a,t[26]=E}else E=t[26];let D;return t[32]!==g||t[33]!==E||t[34]!==x||t[35]!==w||t[36]!==T?(D=(0,X.jsxs)(`div`,{ref:m,role:`listbox`,"aria-label":x,"aria-activedescendant":g,tabIndex:-1,onMouseDown:y,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:S,children:[w,T,E]}),t[32]=g,t[33]=E,t[34]=x,t[35]=w,t[36]=T,t[37]=D):D=t[37],D}function Qy(e){return e.preventDefault()}var $y=new WeakMap;function eb(e,t){$y.set(e,t)}function tb(e){return $y.get(e)??!1}function nb(e,t){let n=document.createElement(`div`);n.style.position=`fixed`,n.style.zIndex=`50`,n.style.visibility=`hidden`,document.body.appendChild(n);let r={getBoundingClientRect:()=>e()?.clientRect?.()??new DOMRect,get contextElement(){return e()?.editor.view.dom}},i=!1,a=!1,o=()=>{n.isConnected&&(n.style.removeProperty(`--suggestion-menu-max-height`),Bt(r,n,{placement:`bottom-start`,middleware:[Ve(4),ee(),me({padding:8}),c({apply({availableHeight:e}){n.isConnected&&n.style.setProperty(`--suggestion-menu-max-height`,`${Math.min(e,window.innerHeight*.4)}px`)}})]}).then(({x:e,y:t})=>{n.isConnected&&(n.style.left=`${e}px`,n.style.top=`${t}px`,i&&!a&&(n.style.removeProperty(`visibility`),a=!0))}).catch(e=>{n.isConnected&&console.warn(`[${t}] computePosition failed`,e)}))};return{popup:n,doPosition:o,startAutoUpdate:()=>z(r,n,o),reveal:()=>{a||(i=!0,o())}}}function rb(e){e.stopAutoUpdate?.(),e.stopAutoUpdate=null,e.popup?.remove(),e.popup=null}var ib=new b(`tagSuggestion`),ab=8,ob=/^[a-zA-Z][\w/-]*$/;async function sb(){let e=await fetch(`/api/tags`);if(!e.ok)throw Error(`/api/tags responded with ${e.status}`);let t=await e.json();return Array.isArray(t.tags)?t.tags:[]}function cb(e,t){let n=t.trim(),r=n.toLowerCase(),i=n===``?e.slice():e.filter(e=>e.name.toLowerCase().includes(r));return i.sort((e,t)=>{let n=+!e.name.toLowerCase().startsWith(r),i=+!t.name.toLowerCase().startsWith(r);return n===i?t.count===e.count?e.name.localeCompare(t.name):t.count-e.count:n-i}),i}function lb(e,t){let n=cb(e,t).slice(0,ab).map(e=>({kind:`tag`,value:e.name,count:e.count,isLeaf:e.isLeaf})),r=t.trim();return r&&ob.test(r)&&!e.some(e=>e.name===r)&&n.push({kind:`create`,value:r}),n}function ub(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``).match(/(^|[\s])#([a-zA-Z][\w/-]*)?$/);if(!n)return null;let r=n[2]??``,i=t.start(),a=n[1].length;return{range:{from:i+((n.index??0)+a),to:t.pos},query:r,text:`#${r}`}}function db(e){let t=[],n=!1,r=null,i=null;return Jy({editor:e,pluginKey:ib,char:`#`,allowedPrefixes:null,findSuggestionMatch:ub,allow:({editor:e})=>!tb(e),items:async({query:e})=>{if(!n){r||=sb();try{t=await r,i=null}catch(e){console.error(`[tag-suggestion] Failed to fetch tags:`,e),i=`Failed to load tags. Press Escape and type # again to retry, or continue typing to create a new tag.`,t=[]}finally{n=!0,r=null}}return lb(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=n.value;if(!r||!ob.test(r))return;e.chain().focus().deleteRange(t).insertContent({type:`tag`,attrs:{value:r}}).insertContent(` `).run()}catch(e){console.error(`[tag-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,a=null,o=0,s={popup:null,stopAutoUpdate:null},c=null,l=null,u=e=>{a?.command(e)},d=e=>{o!==e&&(o=e,p(null))};function f(e,t,r){let a=t===null?!n:t;return{items:e.items,query:e.query??``,selectedIndex:o,onSelect:r,onHover:d,loading:a,error:i}}let p=t=>{!e||!a||e.updateProps(f(a,t,u))};return{onBeforeStart(t){a=t,o=0;let n=nb(()=>a,`tag-suggestion`);s.popup=n.popup,c=n.doPosition,l=n.reveal,e=new tu(Zy,{props:f(t,!0,u),editor:t.editor}),n.popup.appendChild(e.element),s.stopAutoUpdate=n.startAutoUpdate()},onStart(e){a=e,o=0,p(null),l?.()},onUpdate(e){a=e,o=Math.min(o,Math.max(0,e.items.length-1)),p(null),c?.()},onKeyDown({event:e}){if(!a)return!1;let t=a.items;if(e.key===`ArrowDown`)return t.length===0?!1:(o=(o+1)%t.length,p(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(o=(o-1+t.length)%t.length,p(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[o];if(e)return a.command(e),!0;let n=(a.query??``).trim();return n&&ob.test(n)?(a.command({kind:`create`,value:n}),!0):!1}return e.key,!1},onExit(){rb(s),c=null,l=null,e?.destroy(),e=null,a=null,o=0,t=[],i=null,n=!1,r=null}}}})}var fb=1,pb=.9,mb=.8,hb=.17,gb=.1,_b=.999,vb=.9999,yb=.99,bb=/[\\\/_+.#"@\[\(\{&]/,xb=/[\\\/_+.#"@\[\(\{&]/g,Sb=/[\s-]/,Cb=/[\s-]/g;function wb(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?fb:yb;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=wb(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=fb:bb.test(e.charAt(l-1))?(d*=mb,p=e.slice(i,l-1).match(xb),p&&i>0&&(d*=_b**+p.length)):Sb.test(e.charAt(l-1))?(d*=pb,m=e.slice(i,l-1).match(Cb),m&&i>0&&(d*=_b**+m.length)):(d*=hb,i>0&&(d*=_b**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=vb)),(d<gb&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=wb(e,t,n,r,l+1,a+2,o),f*gb>d&&(d=f*gb)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Tb(e){return e.toLowerCase().replace(Cb,` `)}function Eb(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,wb(e,t,Tb(e),Tb(t),0,0,{})}var Db=`[cmdk-group=""]`,Ob=`[cmdk-group-items=""]`,kb=`[cmdk-group-heading=""]`,Ab=`[cmdk-item=""]`,jb=`${Ab}:not([aria-disabled="true"])`,Mb=`cmdk-item-select`,Nb=`data-value`,Pb=(e,t,n)=>Eb(e,t,n),Fb=Y.createContext(void 0),Ib=()=>Y.useContext(Fb),Lb=Y.createContext(void 0),Rb=()=>Y.useContext(Lb),zb=Y.createContext(void 0),Bb=Y.forwardRef((e,t)=>{let n=ex(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ex(()=>new Set),i=ex(()=>new Map),a=ex(()=>new Map),o=ex(()=>new Set),s=Qb(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=jn(),y=jn(),b=jn(),x=Y.useRef(null),S=rx();$b(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),$b(()=>{S(6,k)},[]);let C=Y.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=Y.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Pb;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Ob);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ob} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Ob} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Db}[${Nb}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Nb);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Db)?.querySelector(kb))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Ab}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(jb)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(Nb))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Nb))}function P(e){let t=A()?.closest(Db),n;for(;t&&!n;)t=e>0?Xb(t,Db):Zb(t,Db),n=t?.querySelector(jb);n?C.setState(`value`,n.getAttribute(Nb)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return Y.createElement(Dn.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Mb);t.dispatchEvent(e)}}}}},Y.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:ox},c),ax(e,e=>Y.createElement(Lb.Provider,{value:C},Y.createElement(Fb.Provider,{value:w},e))))}),Vb=Y.forwardRef((e,t)=>{let n=jn(),r=Y.useRef(null),i=Y.useContext(zb),a=Ib(),o=Qb(e),s=o.current?.forceMount??i?.forceMount;$b(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=nx(n,r,[e.value,e.children,r],e.keywords),l=Rb(),u=tx(e=>e.value&&e.value===c.current),d=tx(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Y.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Mb,f),()=>t.removeEventListener(Mb,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return Y.createElement(Dn.div,{ref:In(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Hb=Y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=jn(),s=Y.useRef(null),c=Y.useRef(null),l=jn(),u=Ib(),d=tx(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);$b(()=>u.group(o),[]),nx(o,s,[e.value,e.heading,c]);let f=Y.useMemo(()=>({id:o,forceMount:i}),[i]);return Y.createElement(Dn.div,{ref:In(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Y.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),ax(e,e=>Y.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Y.createElement(zb.Provider,{value:f},e))))}),Ub=Y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Y.useRef(null),a=tx(e=>!e.search);return!n&&!a?null:Y.createElement(Dn.div,{ref:In(i,t),...r,"cmdk-separator":``,role:`separator`})}),Wb=Y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Rb(),o=tx(e=>e.search),s=tx(e=>e.selectedItemId),c=Ib();return Y.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Y.createElement(Dn.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Gb=Y.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Y.useRef(null),o=Y.useRef(null),s=tx(e=>e.selectedItemId),c=Ib();return Y.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Y.createElement(Dn.div,{ref:In(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},ax(e,e=>Y.createElement(`div`,{ref:In(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Kb=Y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Y.createElement(Xn,{open:n,onOpenChange:r},Y.createElement(Hn,{container:o},Y.createElement(Vn,{"cmdk-overlay":``,className:i}),Y.createElement(er,{"aria-label":e.label,"cmdk-dialog":``,className:a},Y.createElement(Bb,{ref:t,...s}))))}),qb=Y.forwardRef((e,t)=>tx(e=>e.filtered.count===0)?Y.createElement(Dn.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Jb=Y.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Y.createElement(Dn.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ax(e,e=>Y.createElement(`div`,{"aria-hidden":!0},e)))}),Yb=Object.assign(Bb,{List:Gb,Item:Vb,Input:Wb,Group:Hb,Separator:Ub,Dialog:Kb,Empty:qb,Loading:Jb});function Xb(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Zb(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Qb(e){let t=Y.useRef(e);return $b(()=>{t.current=e}),t}var $b=typeof window>`u`?Y.useEffect:Y.useLayoutEffect;function ex(e){let t=Y.useRef();return t.current===void 0&&(t.current=e()),t}function tx(e){let t=Rb(),n=()=>e(t.snapshot());return Y.useSyncExternalStore(t.subscribe,n,n)}function nx(e,t,n,r=[]){let i=Y.useRef(),a=Ib();return $b(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Nb,s),i.current=s}),i}var rx=()=>{let[e,t]=Y.useState(),n=ex(()=>new Map);return $b(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ix(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function ax({asChild:e,children:t},n){return e&&Y.isValidElement(t)?Y.cloneElement(ix(t),{ref:t.ref},n(t.props.children)):n(t)}var ox={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function sx(e){let t=(0,J.c)(8),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=vn(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cx(e){let t=(0,J.c)(34),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({title:o,description:s,children:n,className:r,showCloseButton:c,commandProps:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`Command Palette`:o,u=s===void 0?`Search for a command to run`:s,d=c===void 0?!0:c,f;t[8]===i?f=t[9]:(f=i??{},t[8]=i,t[9]=f);let p,m;t[10]===f?(p=t[11],m=t[12]):({className:p,...m}=f,t[10]=f,t[11]=p,t[12]=m);let h;t[13]===r?h=t[14]:(h=vn(`top-[12vh] translate-y-0 overflow-hidden p-0`,r),t[13]=r,t[14]=h);let g;t[15]===l?g=t[16]:(g=(0,X.jsx)(Bn,{className:`sr-only`,children:l}),t[15]=l,t[16]=g);let _;t[17]===u?_=t[18]:(_=(0,X.jsx)(Rn,{className:`sr-only`,children:u}),t[17]=u,t[18]=_);let v;t[19]===p?v=t[20]:(v=vn(`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,p),t[19]=p,t[20]=v);let y;t[21]!==n||t[22]!==m||t[23]!==v?(y=(0,X.jsx)(sx,{className:v,...m,children:n}),t[21]=n,t[22]=m,t[23]=v,t[24]=y):y=t[24];let b;t[25]!==d||t[26]!==h||t[27]!==g||t[28]!==_||t[29]!==y?(b=(0,X.jsxs)(Gn,{className:h,showCloseButton:d,children:[g,_,y]}),t[25]=d,t[26]=h,t[27]=g,t[28]=_,t[29]=y,t[30]=b):b=t[30];let x;return t[31]!==a||t[32]!==b?(x=(0,X.jsx)($n,{...a,children:b}),t[31]=a,t[32]=b,t[33]=x):x=t[33],x}function lx(e){let t=(0,J.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]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(ja,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=vn(`flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,X.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,X.jsx)(Yb.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function ux(e){let t=(0,J.c)(8),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=vn(`max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function dx(e){let t=(0,J.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(Yb.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function fx(e){let t=(0,J.c)(8),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=vn(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function px(e){let t=(0,J.c)(8),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=vn(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Yb.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mx(e){let t=(0,J.c)(8),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=vn(`ml-auto text-muted-foreground text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function hx(e,t){let n=null,r;try{n=await e.json()}catch(e){r=e}if(e.ok)return r!==void 0&&console.warn(`[parse-server-response] 2xx response with non-JSON body:`,r instanceof Error?r.message:String(r)),{ok:!0,body:r===void 0?n:null};if(r!==void 0){let t=r instanceof Error?r.message:String(r);return{ok:!1,title:`Server error (HTTP ${e.status}): ${t}`}}return{ok:!1,title:Ce(n)??t}}function gx(e,t,n,r){let i=e.safeParse(t);return i.success?i.data:(console.warn(`[parse-server-response] schema drift:`,n,`bodyShape=`,typeof t==`object`&&t?Object.keys(t):typeof t,`issues=`,i.error.issues),r)}var _x=new Map,vx=null;function yx(){return Ec(`PREWARM_CORRELATION_WINDOW_MS`,5e3)}function bx(){if(vx!==null)return;let e=Math.max(50,Math.floor(yx()/2));vx=setTimeout(()=>{vx=null,xx(Date.now()),_x.size>0&&bx()},e)}function xx(e){let t=yx();for(let[n,r]of _x)e-r.emittedAt>=t&&(_x.delete(n),Z.count(`ok/sidebar/prewarm`,{hit:!1}))}function Sx(e,t,n=Date.now()){_x.has(e)&&Z.count(`ok/sidebar/prewarm`,{hit:!1}),_x.set(e,{poolEventId:t,emittedAt:n}),bx()}function Cx(e,t,n=Date.now()){let r=_x.get(e);return!r||r.poolEventId!==t||n-r.emittedAt>=yx()?!1:(_x.delete(e),Z(`ok/sidebar/prewarm-clicked`,{docName:e,t:n,poolEventId:t}),Z.count(`ok/sidebar/prewarm`,{hit:!0}),!0)}Ne({event:Oe(`ok-branch-switched-clear-failed`),branch:O(),docName:O(),reason:O()});async function wx(e,t){let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}var Tx=null,Ex=new Set;function Dx(){return Tx}function Ox(e){let t=e!==null&&e.length>0?e:null;if(t!==Tx){Tx=t;for(let e of Ex)try{e()}catch(e){console.warn(`[server-instance-store] subscriber threw:`,e)}}}function kx(e){return Ex.add(e),()=>{Ex.delete(e)}}function Ax(){return(0,Y.useSyncExternalStore)(kx,Dx,Dx)}function jx(e){let t=!1;return()=>{t?e():t=!0}}function Mx(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function Nx(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=rt.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),Ox(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&(wx(e,i.data.currentBranch),dt(i.data.currentBranch)),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Mx(n)}catch{}e.observeDiskAckBatch(t)}}async function Px(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0,paneTarget:typeof r.paneTarget==`string`?r.paneTarget:null}}}function Fx(e){return Ux(e,pt)}function Ix(e){return Ux(e,Mt)}function Lx(e){return Ux(e,kt)}function Rx(e){return Ux(e,st)}function zx(e){return Ux(e,tn)}function Bx(e){let t=Ux(e,zt);if(!t)return null;try{return{docName:t.docName,sv:Vx(t.sv)}}catch{return null}}function Vx(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Hx(e,t){let n=Ix(e);if(n){t.onServerInfo?.(n);return}let r=Lx(e);if(r){t.onBranchSwitched?.(r);return}let i=Bx(e);if(i){t.onDiskAck?.(i);return}let a=Fx(e);if(a){t.onDerivedView?.(a);return}let o=Rx(e);if(o){t.onConfigValidationRejected?.(o);return}let s=zx(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function Ux(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function Wx(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function Gx(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function Kx(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var qx=2e3,Jx=15e3;function Yx(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??qx,r=e.maxDelayMs??Jx,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function Xx(){let e=(0,J.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,Y.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,Y.useRef)(i),[o,s]=(0,Y.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=Gx(window);if(t){r(Kx(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(Kx(t))});return()=>{n()}}let n=Yx({fetchConfig:Px,fallbackUrl:Wx,now:Date.now,setTimeout:eS,clearTimeout:$x,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let l;e[3]===o?l=e[4]:(l=[o],e[3]=o,e[4]=l),(0,Y.useEffect)(c,l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a.current.token=a.current.token+1,r(Qx),s(Zx)},e[5]=u):u=e[5];let d=u,f;return e[6]===n?f=e[7]:(f={...n,retry:d},e[6]=n,e[7]=f),f}function Zx(e){return e+1}function Qx(e){return{...e,terminal:!1,lastError:null}}function $x(e){return globalThis.clearTimeout(e)}function eS(e,t){return globalThis.setTimeout(e,t)}var tS=new Map,nS=new Set;function rS(){for(let e of nS)e()}function iS(e,t){tS.set(e,t),rS()}function aS(e,t){tS.get(e)===t&&(tS.delete(e),rS())}function oS(e){return tS.get(e)??null}function sS(e){return nS.add(e),()=>nS.delete(e)}var cS=new Map;function lS(e){return cS.get(e)}function uS(e,t){cS.set(e,t)}function dS(e){cS.delete(e)}var fS=`open-knowledge-app`,pS=new Map,mS=new Set,hS=1024,gS=1024;function _S(){return cr.getTracer(fS)}function vS(e,t,n){if(mS.has(e))return null;let r=pS.get(e);if(r)return r;if(pS.size>=gS){let e=pS.keys().next().value;if(e!==void 0){let t=pS.get(e);pS.delete(e);try{t?.span.end()}catch(e){console.warn(`[otel-spans] eviction span.end failed:`,e instanceof Error?e:String(e))}}}let i={span:_S().startSpan(`ok.cold-mount`,{attributes:{"mount.id":e,...t},startTime:n}),startTimeMs:n};return pS.set(e,i),i}function yS(e,t,n,r,i){try{let a=vS(e,n,r),o=a?cr.setSpan(lr.active(),a.span):lr.active();_S().startSpan(t,{attributes:{"mount.id":e,...n},startTime:r},o).end(i??Date.now())}catch(e){console.warn(`[otel-spans] emitColdMountChild failed:`,e instanceof Error?e:String(e))}}function bS(e,t){try{let n=pS.get(e);if(n&&(pS.delete(e),n.span.end(t??Date.now())),!mS.has(e)){if(mS.size>=hS){let e=mS.values().next().value;e!==void 0&&mS.delete(e)}mS.add(e)}}catch(e){console.warn(`[otel-spans] finalizeColdMountSpan failed:`,e instanceof Error?e:String(e))}}var xS=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}};function SS(){return Ec(`MOUNT_STALLED_THRESHOLD_MS`,1e4)}function CS(e){e.stalledHandle!==null&&(clearTimeout(e.stalledHandle),e.stalledHandle=null)}function wS(e,t,n){if(e.stalledMarkEmitted)return;e.stalledMarkEmitted=!0;let r=n-e.createdAt;Z(`ok/mount/stalled`,{docName:t,mountId:e.mountId,elapsedMs:r})}var TS=new Map,ES=new Set;function DS(e){ES.add(e);for(let[t,n]of TS)if(n.stalledMarkEmitted&&!n.settled)try{e(t,n.mountId)}catch{}return()=>{ES.delete(e)}}function OS(e,t){for(let n of ES)try{n(e,t.mountId)}catch{}}var kS=!1;function AS(){typeof document>`u`||document.visibilityState===`visible`&&NS(Date.now())}function jS(){kS||typeof document>`u`||typeof document.addEventListener==`function`&&(document.addEventListener(`visibilitychange`,AS),kS=!0)}function MS(){kS&&(typeof document>`u`||typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,AS),kS=!1))}function NS(e){let t=SS();for(let[n,r]of TS)r.settled||r.stalledMarkEmitted||e-r.createdAt<t||(wS(r,n,e),OS(n,r))}function PS(e){let{docName:t,mountId:n,construct:r,sizeStats:i}=e,a=TS.get(t);if(a)return a.promise;let o=new AbortController,s=Date.now(),c=()=>{},l=()=>{},u=new Promise((e,t)=>{c=e,l=t}),d={promise:u,rejectFn:l,controller:o,mountId:n,createdAt:s,settled:!1,resolved:!1,preMountEditor:null,stalledHandle:null,stalledMarkEmitted:!1};return d.stalledHandle=setTimeout(()=>{d.settled||(wS(d,t,Date.now()),OS(t,d))},SS()),o.signal.addEventListener(`abort`,()=>{d.settled||(d.settled=!0,CS(d),d.preMountEditor&&=(RS(t,d.preMountEditor,`aborted`),null),TS.delete(t),TS.size===0&&MS(),Z(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`aborted`}),l(new xS(t)),bS(d.mountId))}),TS.set(t,d),jS(),Z(`ok/mount/create`,{docName:t,mountId:d.mountId}),zS({docName:t,construct:r,sizeStats:i,entry:d,resolveFn:c,rejectFn:l}).catch(e=>{if(d.preMountEditor&&=(RS(t,d.preMountEditor,`backstop`),null),d.settled){Z(`ok/mount/post-settle-throw`,{docName:t,mountId:d.mountId,message:e instanceof Error?e.message:String(e)});return}d.settled=!0,CS(d);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`unhandled-body-throw`}),l(n),bS(d.mountId)}),u}function FS(e){return TS.get(e)?.resolved===!0}function IS(e){return TS.get(e)?.controller??null}function LS(e){let t=TS.get(e);t&&(t.settled=!0,CS(t),t.preMountEditor&&=(RS(e,t.preMountEditor,`aborted`),null),TS.delete(e),TS.size===0&&MS(),Z(`ok/mount/invalidate`,{docName:e,mountId:t.mountId}),bS(t.mountId),t.controller.abort())}function RS(e,t,n){let r=BS(t);try{t.destroy()}catch(t){Z(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function zS(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(bC(t)!==void 0){let e=iC({docName:t,container:s,factory:()=>{throw Error(`mount-promise: V2 cache contract violation — factory invoked on HIT for "${t}"`)}});i.settled=!0,i.resolved=!0,CS(i),a(e);return}if(await scheduler.yield(),i.controller.signal.aborted)return;let c=null;try{c=n()}catch(e){i.settled=!0,CS(i);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`construct-failed`}),o(n),bS(i.mountId);return}if(i.preMountEditor=c.editor,await scheduler.yield(),i.controller.signal.aborted){i.preMountEditor=null;return}try{c.editor.mount(s)}catch(e){RS(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,CS(i);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`mount-failed`}),o(n),bS(i.mountId);return}let l;try{l=iC({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){RS(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,CS(i);let n=e instanceof Error?e:Error(String(e));Z(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`v2-register-failed`}),o(n),bS(i.mountId);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,CS(i);let u=Date.now()-i.createdAt;Z(`ok/mount/resolve`,{docName:t,mountId:i.mountId,elapsedMs:u}),Z.histogram(`ok/mount/resolve-elapsed-ms`,{docName:t,mountId:i.mountId},u),a(l);let d=Date.now();yS(i.mountId,`ok.mount-promise`,{"doc.name":t,elapsed_ms:u},i.createdAt,d),bS(i.mountId,d)}function BS(e){try{let t=e.state;return Wv.getState(t)?.undoManager??null}catch(e){return Z(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var VS=Ec(`MAX_CACHE`,10),HS=Ec(`VIEW_COUNT_CACHE_THRESHOLD`,50),US=Ec(`BYTES_CACHE_THRESHOLD`,8e6);function WS(e){return!(e.viewCount>0&&e.viewCount>=HS||e.bytes>US)}var GS=new Map,KS=new Map,qS=new Map;function JS(e,t){if(qS.size>=VS){let e=qS.keys().next().value;e!==void 0&&qS.delete(e)}qS.set(e,t),Z(`ok/cache/snapshot-stored`,{toDocName:e,htmlBytes:t.html.length,hasScroll:t.scrollTop>0,hasSelection:t.selection!==null})}function YS(e){return qS.get(e)??null}function XS(e){if(!qS.has(e))return;let t=qS.get(e)??null;qS.delete(e),Z(`ok/cache/snapshot-consumed`,{docName:e,hit:t!==null,hasScroll:t!==null&&t.scrollTop>0,hasSelection:t!==null&&t.selection!==null})}function ZS(){try{return typeof document>`u`?0:document.querySelector(`[data-testid="editor-scroll-container"]`)?.scrollTop??0}catch(e){return Z(`ok/cache/snapshot-scroll-read-failed`,{message:e instanceof Error?e.message:String(e)}),0}}function QS(e){try{let t=e.state.selection;return t instanceof f?{type:`text`,anchor:t.anchor,head:t.head}:t instanceof we?{type:`node`,from:t.from}:null}catch(e){return Z(`ok/cache/snapshot-selection-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}function $S(e){for(let t of e)try{let e=bC(t.fromDocName);if(e&&!e.editor.isDestroyed){if(e.ytext.length===0){Z(`ok/cache/snapshot-skipped-empty`,{fromDocName:t.fromDocName});continue}JS(t.toDocName,{html:e.editor.getHTML(),scrollTop:ZS(),selection:QS(e.editor)})}else Z(`ok/cache/snapshot-skipped`,{fromDocName:t.fromDocName})}catch(e){Z(`ok/cache/snapshot-capture-failed`,{fromDocName:t.fromDocName,message:e instanceof Error?e.message:String(e)})}}var eC=[],tC=[],nC=new Set;function rC(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,e}function iC(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!WS(i)){let e=r(n);return Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=GS.get(t);if(a){if(Z(`ok/cache/reparent-start`,{docName:t,mountId:lS(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),fC(a,n),a.activeMountKey=t,mC(eC,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return Z(`ok/cache/reparent-end`,{docName:t,mountId:lS(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Z(`ok/cache/hit`,{docName:t,mountId:lS(t),kind:`tiptap`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;GS.size>=VS;){let e=hC(eC,t);if(!e)break;oC(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return GS.set(t,s),mC(eC,t),Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function aC(e){let t=e.activeMountKey;if(e.__uncached){t&&LS(t);let n=BS(e.editor);try{e.editor.destroy()}catch(e){Z(`ok/cache/park-destroy-failed`,{docName:t??``,kind:`tiptap`,message:e instanceof Error?e.message:String(e)})}n&&(n.restore=void 0),e.activeMountKey=null;return}let n=uC(e.editor);if(n){e.hadFocus=dC(n.dom),e.scrollTop=(n.scrollDOM??n.dom.parentElement??n.dom).scrollTop??0;let t=n.dom.parentElement;t&&t.removeChild(n.dom),e.parkingNode||=rC(),e.parkingNode&&e.parkingNode.appendChild(n.dom)}e.activeMountKey=null}function oC(e){LS(e);let t=GS.get(e);if(!t)return!1;let n=BS(t.editor);try{t.editor.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}GS.delete(e);let r=eC.indexOf(e);return r!==-1&&eC.splice(r,1),Z(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function sC(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!WS(i)){let e=r(n);return Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=KS.get(t);if(a){if(Z(`ok/cache/reparent-start`,{docName:t,mountId:lS(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),pC(a,n),a.activeMountKey=t,mC(tC,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return Z(`ok/cache/reparent-end`,{docName:t,mountId:lS(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Z(`ok/cache/hit`,{docName:t,mountId:lS(t),kind:`cm`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;KS.size>=VS;){let e=hC(tC,t);if(!e)break;lC(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return KS.set(t,s),mC(tC,t),Z(`ok/cache/miss`,{docName:t,mountId:lS(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&Z(`ok/cold/editor-mount-stats`,{docName:t,mountId:lS(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function cC(e){if(e.__uncached){try{e.view.destroy()}catch(t){Z(`ok/cache/park-destroy-failed`,{docName:e.activeMountKey??``,kind:`cm`,message:t instanceof Error?t.message:String(t)})}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=dC(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t),e.parkingNode||=rC(),e.parkingNode&&e.parkingNode.appendChild(t),e.activeMountKey=null}function lC(e){let t=KS.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Z(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}KS.delete(e);let n=tC.indexOf(e);return n!==-1&&tC.splice(n,1),Z(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function uC(e){return e.editorView??null}function dC(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function fC(e,t){let n=uC(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function pC(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function mC(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function hC(e,t){for(let n of e)if(n!==t&&!nC.has(n))return n;Z(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:nC.size});for(let n of e)if(n!==t)return n;return null}function gC(e){let t=nC,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=vC(e);if(t)try{t.disconnect(),Z(`ok/cache/disconnect`,{docName:e})}catch(t){Z(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=vC(e);if(!n)continue;let r=t=>{Z(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>Z(`ok/cache/connect`,{docName:e}),e=>r(e)):Z(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}nC=n}var _C=null;function vC(e){let t=GS.get(e);if(t)return t.provider;let n=KS.get(e);if(n)return n.provider;if(_C){let t=_C.entries.get(e);if(t)return t.provider}return null}function yC(e){_C=e;let t=e.onEvict(e=>{oC(e),lC(e)});return()=>{t(),_C===e&&(_C=null)}}function bC(e){return GS.get(e)}var xC=`ok-editor-tabs-v1:`,SC=`\0folder:`,CC=`\0asset:`,wC=`\0doc-tab:`;function TC(e){let t=e.lastIndexOf(wC);return t<0?{baseTabId:e,instanceSuffix:``}:{baseTabId:e.slice(0,t),instanceSuffix:e.slice(t)}}function EC(e){return TC(e).baseTabId}function DC(e){if(typeof e!=`string`||e.length===0)return!1;let t=EC(e);return t.startsWith(SC)?t.length>8:t.startsWith(CC)?t.length>7:!0}function OC(e){return e}function kC(e,t){return`${EC(e)}${wC}${t}`}function AC(e,t){return jC(e,OC(t))}function jC(e,t){let n=BC(e,2**53-1),r=EC(t);if(!n.includes(r))return r;let i=1,a;do a=kC(r,i),i++;while(n.includes(a));return a}function MC(e,t){let n=EC(t);return BC(e,2**53-1).find(e=>EC(e)===n)??null}function NC(e,t){return EC(e)===EC(t)}function PC(e){return`${SC}${e}`}function FC(e){return`${CC}${e}`}function IC(e,t){let n=e.lastIndexOf(`/`),r=n<0?e:e.slice(n+1),i=`${r}${t}`;return n<0?{baseName:r,extension:t,label:i,prefix:``}:{baseName:r,extension:t,label:i,prefix:`${e.slice(0,n)}/`}}function LC(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return OC(e.docName);case`folder`:return PC(e.folderPath);case`missing`:return OC(e.target);case`asset`:return FC(e.assetPath)}}function RC(e){let t=EC(e);return t.startsWith(SC)?{kind:`folder`,folderPath:t.slice(8)}:t.startsWith(CC)?{kind:`asset`,assetPath:t.slice(7)}:{kind:`doc`,docName:t}}function zC(e){let t=RC(e);return t.kind===`doc`?t.docName:null}function BC(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(DC(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function VC(e,t){let n=new Set(BC(t,2**53-1));return BC(e,2**53-1).filter(e=>n.has(e))}function HC(e,t,n){if(t<=0)return[];let r=new Set(BC(n,2**53-1)),i=BC(e,2**53-1);if(r.size===0&&i.length<=t)return i;let a=[],o=0;for(let e=i.length-1;e>=0;e--){let n=i[e];if(r.has(n)){a.push(n);continue}o>=t||(o++,a.push(n))}return a.reverse()}function UC(e,t,n){let r=VC(e,n);return!BC(n,2**53-1).includes(t)||r.includes(t)?r:[...r,t]}function WC(e,t){return BC(e,2**53-1).filter(e=>e!==t)}function GC(e,t){let n=new Set(BC(t,2**53-1));return BC(e,2**53-1).filter(e=>!n.has(e))}function KC(e,t,n){let r=BC(e,2**53-1),i=VC(t,r),a=r.indexOf(n);if(a<0)return i;let o=i.includes(n),s=a<i.length;return o===s?i:s?UC(i,n,r):WC(i,n)}function qC(e,t,n,r=[]){let i=HC(e,n,r);return!DC(t)||i.includes(t)?i:HC([...i,t],n,r)}function JC(e,t,n,r,i=[]){let a=HC(e,r,i);if(!DC(n))return a;if(!t||t===n)return qC(a,n,r,i);let o=a.filter(e=>e!==n),s=o.indexOf(t);if(s<0)return qC(o,n,r,i);let c=[...o];return c[s]=n,HC(c,r,i)}function YC(e,t,n){return XC(e,OC(t),n)}function XC(e,t,{behavior:n,currentTabId:r,limit:i,pinnedTabIds:a=[]}){let o=HC(e,i,a),s=EC(t);if(r&&o.includes(r)&&EC(r)===s)return{tabs:o,activeTabId:r};if(n!==`replace-active`)return{tabs:qC(o,s,i,a),activeTabId:s};let c=MC(o,s);if(c)return{tabs:o,activeTabId:c};let l=jC(o,s);return{tabs:JC(o,r,l,i,a),activeTabId:l}}function ZC(e,t){return e.filter(e=>e!==t)}function QC(e,t,n){let r=BC(t,2**53-1),i=new Set(r),a=new Set(n),o=new Set,s=[];for(let t of e)o.has(t)||!i.has(t)&&!a.has(t)||(o.add(t),s.push(t));for(let e of[...r,...n])o.has(e)||(o.add(e),s.push(e));return s}function $C(e,{pages:t,folderPaths:n,assetPaths:r,keepMissingDocName:i=null}){return BC(e,2**53-1).filter(e=>{let a=RC(e);return a.kind===`folder`?n.has(a.folderPath):a.kind===`asset`?r.has(a.assetPath):t.has(a.docName)||a.docName===i})}function ew(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return BC(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=e=>rw(nw(e,r),a),c=[],l=new Set;for(let t of e){let{instanceSuffix:e}=TC(t),a=RC(t),u=`${a.kind===`doc`?o.get(a.docName)??EC(t):a.kind===`folder`?PC(nw(a.folderPath,r)):FC(s(a.assetPath))}${e}`;if(!l.has(u)&&(l.add(u),c.push(u),i.length===0&&c.length>=n))break}return i.length===0?c:HC(c,n,i.map(e=>{let t=RC(e);return t.kind===`doc`?o.get(t.docName)??e:t.kind===`folder`?PC(nw(t.folderPath,r)):FC(s(t.assetPath))}))}function tw(e,t,n=[],r=[]){return ew(e,t,2**53-1,n,[],r)}function nw(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function rw(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function iw(e,t,n){if(t!==n)return t;let r=e.indexOf(n);return r<0?e[0]??null:e[r+1]??e[r-1]??null}function aw(e,t,n){if(!t)return null;let r=new Set(n);if(!r.has(t))return t;let i=e.indexOf(t);if(i<0)return e.find(e=>!r.has(e))??null;for(let t=i+1;t<e.length;t++)if(!r.has(e[t]))return e[t];for(let t=i-1;t>=0;t--)if(!r.has(e[t]))return e[t];return null}function ow(e,t){if(typeof e!=`object`||!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};let n=e,r=BC(n.openTabs,2**53-1),i=VC(n.pinnedTabIds,r),a=i.length===0?BC(n.openTabs,t):HC(r,t,i),o=VC(n.pinnedTabIds,a),s=typeof n.activeTabId==`string`&&a.includes(n.activeTabId)?n.activeTabId:typeof n.activeDocName==`string`&&a.includes(n.activeDocName)?n.activeDocName:null,c=s?RC(s):null;return{openTabs:a,pinnedTabIds:o,activeDocName:c?.kind===`doc`?c.docName:null,activeTabId:s,updatedAt:typeof n.updatedAt==`string`?n.updatedAt:null}}function sw(e,t,n=[],r=()=>new Date){let i=BC(e,2**53-1),a=t&&i.includes(t)?t:null,o=a?RC(a):null;return{openTabs:i,pinnedTabIds:VC(n,i),activeDocName:o?.kind===`doc`?o.docName:null,activeTabId:a,updatedAt:r().toISOString()}}function cw(e){return`${xC}${e}`}function lw(e,t,n){if(!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};try{let r=e.getItem(t);return r?ow(JSON.parse(r),n):{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}}function uw(e,t,n){if(e)try{e.setItem(t,JSON.stringify(n))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}var dw=Math.floor,fw=(e,t)=>e<t?e:t,pw=(e,t)=>e>t?e:t;Number.isNaN;var mw=128,hw=1<<17,gw=1<<18,_w=1<<19,vw=1<<20,yw=1<<21,bw=1<<22,xw=1<<23,Sw=1<<24,Cw=1<<25,ww=1<<26,Tw=1<<27,Ew=1<<28,Dw=1<<29,Ow=1<<30,kw=127;hw-1,gw-1,_w-1,vw-1,yw-1,bw-1,xw-1,Sw-1,Cw-1,ww-1,Tw-1,Ew-1,Dw-1,Ow-1;var Aw=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var jw=String.fromCharCode;String.fromCodePoint,jw(65535);var Mw=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Nw=typeof TextEncoder<`u`?new TextEncoder:null,Pw=Nw?e=>Nw.encode(e):Mw,Fw=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});Fw&&Fw.decode(new Uint8Array).length===1&&(Fw=null);var Iw=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Lw=(e,t)=>{for(;t>kw;)Iw(e,mw|kw&t),t=dw(t/128);Iw(e,kw&t)},Rw=new Uint8Array(3e4),zw=Rw.length/3,Bw=Nw&&Nw.encodeInto?(e,t)=>{if(t.length<zw){let n=Nw.encodeInto(t,Rw).written||0;Lw(e,n);for(let t=0;t<n;t++)Iw(e,Rw[t])}else Hw(e,Pw(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Lw(e,r);for(let t=0;t<r;t++)Iw(e,n.codePointAt(t))},Vw=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=fw(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(pw(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},Hw=(e,t)=>{Lw(e,t.byteLength),Vw(e,t)},Uw=e=>Error(e),Ww=Uw(`Unexpected end of array`),Gw=Uw(`Integer out of Range`),Kw=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},qw=e=>Kw(e,Yw(e)),Jw=e=>e.arr[e.pos++],Yw=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&kw)*n,n*=128,r<mw)return t;if(t>Aw)throw Gw}throw Ww},Xw=Fw?e=>Fw.decode(qw(e)):e=>{let t=Yw(e);if(t===0)return``;{let n=String.fromCodePoint(Jw(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Jw(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Zw=function(e){return e[e.Token=0]=`Token`,e[e.PermissionDenied=1]=`PermissionDenied`,e[e.Authenticated=2]=`Authenticated`,e}({}),Qw=(e,t)=>{Lw(e,Zw.Token),Bw(e,t)},$w=(e,t,n,r)=>{switch(Yw(e)){case Zw.Token:t();break;case Zw.PermissionDenied:n(Xw(e));break;case Zw.Authenticated:r(Xw(e));break;default:}},eT=e=>Array.from(e.entries()).map(([e,t])=>({clientId:e,...t})),tT=`\0`;function nT(e,t){return e+tT+t}function rT(e){let t=e.indexOf(tT);return t===-1?{documentName:e,sessionId:null}:{documentName:e.substring(0,t),sessionId:e.substring(t+1)}}var iT=function(e){return e[e.Connecting=0]=`Connecting`,e[e.Open=1]=`Open`,e[e.Closing=2]=`Closing`,e[e.Closed=3]=`Closed`,e}({});function aT(e){return e||={},{delay:e.delay===void 0?200:e.delay,initialDelay:e.initialDelay===void 0?0:e.initialDelay,minDelay:e.minDelay===void 0?0:e.minDelay,maxDelay:e.maxDelay===void 0?0:e.maxDelay,factor:e.factor===void 0?0:e.factor,maxAttempts:e.maxAttempts===void 0?3:e.maxAttempts,timeout:e.timeout===void 0?0:e.timeout,jitter:e.jitter===!0,initialJitter:e.initialJitter===!0,handleError:e.handleError===void 0?null:e.handleError,handleTimeout:e.handleTimeout===void 0?null:e.handleTimeout,beforeAttempt:e.beforeAttempt===void 0?null:e.beforeAttempt,calculateDelay:e.calculateDelay===void 0?null:e.calculateDelay}}async function oT(e){return new Promise(t=>setTimeout(t,e))}function sT(e,t){let n=t.delay;if(n===0)return 0;if(t.factor&&(n*=t.factor**(e.attemptNum-1),t.maxDelay!==0&&(n=Math.min(n,t.maxDelay))),t.jitter){let e=Math.ceil(t.minDelay);n=Math.floor(Math.random()*(Math.floor(n)-e+1))+e}return Math.round(n)}async function cT(e,t){let n=aT(t);for(let e of[`delay`,`initialDelay`,`minDelay`,`maxDelay`,`maxAttempts`,`timeout`]){let t=n[e];if(!Number.isInteger(t)||t<0)throw Error(`Value for ${e} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw Error(`Value for factor must be a number greater than or equal to 0`);if(n.delay<n.minDelay)throw Error(`delay cannot be less than minDelay (delay: ${n.delay}, minDelay: ${n.minDelay}`);let r={attemptNum:0,attemptsRemaining:n.maxAttempts?n.maxAttempts:-1,aborted:!1,abort(){r.aborted=!0}},i=n.calculateDelay||sT;async function a(){if(n.beforeAttempt&&n.beforeAttempt(r,n),r.aborted){let e=Error(`Attempt aborted`);throw e.code=`ATTEMPT_ABORTED`,e}let t=async e=>{if(n.handleError&&await n.handleError(e,r,n),r.aborted||r.attemptsRemaining===0)throw e;r.attemptNum++;let t=i(r,n);return t&&await oT(t),a()};return r.attemptsRemaining>0&&r.attemptsRemaining--,n.timeout?new Promise((i,a)=>{let o=setTimeout(()=>{if(n.handleTimeout)try{i(n.handleTimeout(r,n))}catch(e){a(e)}else{let e=Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${n.timeout})`);e.code=`ATTEMPT_TIMEOUT`,a(e)}},n.timeout);e(r,n).then(e=>{clearTimeout(o),i(e)}).catch(e=>{clearTimeout(o),t(e).then(i).catch(a)})}):e(r,n).catch(t)}let o=n.calculateDelay?n.calculateDelay(r,n):n.initialDelay;if(o&&await oT(o),r.attemptNum<1&&n.initialJitter){let e=i(r,n);e&&await oT(e)}return a()}var lT=Math.floor,uT=(e,t)=>e<t?e:t,dT=(e,t)=>e>t?e:t;Number.isNaN;var fT=64,pT=128,mT=1<<17,hT=1<<18,gT=1<<19,_T=1<<20,vT=1<<21,yT=1<<22,bT=1<<23,xT=1<<24,ST=1<<25,CT=1<<26,wT=1<<27,TT=1<<28,ET=1<<29,DT=1<<30,OT=63,kT=127;mT-1,hT-1,gT-1,_T-1,vT-1,yT-1,bT-1,xT-1,ST-1,CT-1,wT-1,TT-1,ET-1,DT-1;var AT=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var jT=()=>new Set,MT=Array.from;Array.isArray;var NT=String.fromCharCode;String.fromCodePoint,NT(65535);var PT=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},FT=typeof TextEncoder<`u`?new TextEncoder:null,IT=FT?e=>FT.encode(e):PT,LT=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});LT&&LT.decode(new Uint8Array).length===1&&(LT=null);var RT=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},zT=()=>new RT,BT=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},VT=e=>{let t=new Uint8Array(BT(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},HT=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},UT=(e,t)=>{for(;t>kT;)HT(e,pT|kT&t),t=lT(t/128);HT(e,kT&t)},WT=new Uint8Array(3e4),GT=WT.length/3,KT=FT&&FT.encodeInto?(e,t)=>{if(t.length<GT){let n=FT.encodeInto(t,WT).written||0;UT(e,n);for(let t=0;t<n;t++)HT(e,WT[t])}else JT(e,IT(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;UT(e,r);for(let t=0;t<r;t++)HT(e,n.codePointAt(t))},qT=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=uT(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(dT(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},JT=(e,t)=>{UT(e,t.byteLength),qT(e,t)},YT=e=>Error(e),XT=YT(`Unexpected end of array`),ZT=YT(`Integer out of Range`),QT=class{constructor(e){this.arr=e,this.pos=0}},$T=e=>new QT(e),eE=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},tE=e=>eE(e,rE(e)),nE=e=>e.arr[e.pos++],rE=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&kT)*n,n*=128,r<pT)return t;if(t>AT)throw ZT}throw XT},iE=e=>{let t=e.arr[e.pos++],n=t&OT,r=64,i=(t&fT)>0?-1:1;if((t&pT)===0)return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&kT)*r,r*=128,t<pT)return i*n;if(n>AT)throw ZT}throw XT},aE=LT?e=>LT.decode(tE(e)):e=>{let t=rE(e);if(t===0)return``;{let n=String.fromCodePoint(nE(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(nE(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},oE=e=>{let t=e.pos,n=aE(e);return e.pos=t,n},sE=Date.now,cE=()=>new Map,lE=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},uE=class{constructor(){this._observers=cE()}on(e,t){lE(this._observers,e,jT).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return MT((this._observers.get(e)||cE()).values()).forEach(e=>e(...t))}destroy(){this._observers=cE()}},dE=Symbol(`Equality`),fE=Object.keys,pE=e=>fE(e).length,mE=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),hE=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[dE]!=null)return e[dE](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!hE(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(pE(e)!==pE(t))return!1;for(let n in e)if(!mE(e,n)||!hE(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!hE(e[n],t[n]))return!1;break;default:return!1}return!0},gE=3e4,_E=class extends uE{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=sE();this.getLocalState()!==null&&gE/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&gE<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&vE(this,t,`timeout`)},lT(gE/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:sE()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),hE(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},vE=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:sE()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},yE=(e,t,n=e.states)=>{let r=t.length,i=zT();UT(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;UT(i,r),UT(i,s),KT(i,JSON.stringify(o))}return VT(i)},bE=(e,t,n)=>{let r=$T(t),i=sE(),a=[],o=[],s=[],c=[],l=rE(r);for(let t=0;t<l;t++){let t=rE(r),n=rE(r),l=JSON.parse(aE(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(hE(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},xE=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}},SE=class{constructor(e){this.data=e,this.encoder=zT(),this.decoder=$T(new Uint8Array(this.data))}peekVarString(){return oE(this.decoder)}readVarUint(){return rE(this.decoder)}readVarString(){return aE(this.decoder)}readVarUint8Array(){return tE(this.decoder)}writeVarUint(e){return UT(this.encoder,e)}writeVarString(e){return KT(this.encoder,e)}writeVarUint8Array(e){return JT(this.encoder,e)}length(){return BT(this.encoder)}},CE=function(e){return e[e.Sync=0]=`Sync`,e[e.Awareness=1]=`Awareness`,e[e.Auth=2]=`Auth`,e[e.QueryAwareness=3]=`QueryAwareness`,e[e.Stateless=5]=`Stateless`,e[e.CLOSE=7]=`CLOSE`,e[e.SyncStatus=8]=`SyncStatus`,e[e.Ping=9]=`Ping`,e[e.Pong=10]=`Pong`,e}({}),wE=function(e){return e.Connecting=`connecting`,e.Connected=`connected`,e.Disconnected=`disconnected`,e}({}),TE=class{constructor(){this.encoder=zT()}get(e){return e.encoder}toUint8Array(){return VT(this.encoder)}},EE=class extends TE{constructor(...e){super(...e),this.type=CE.CLOSE,this.description=`Ask the server to close the connection`}get(e){return KT(this.encoder,e.documentName),UT(this.encoder,this.type),this.encoder}},DE=class e extends xE{static{this.DEDUPLICATABLE_TYPES=new Set([CE.Awareness,CE.QueryAwareness])}constructor(e){super(),this.messageQueue=[],this.configuration={url:``,autoConnect:!0,preserveTrailingSlash:!1,document:void 0,WebSocketPolyfill:void 0,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,handleTimeout:null,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=wE.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on(`open`,this.configuration.onOpen),this.on(`open`,this.onOpen.bind(this)),this.on(`connect`,this.configuration.onConnect),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`status`,this.configuration.onStatus),this.on(`disconnect`,this.configuration.onDisconnect),this.on(`close`,this.configuration.onClose),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`close`,this.onClose.bind(this)),this.on(`message`,this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),this.shouldConnect&&this.connect()}async onOpen(e){this.status=wE.Connected,this.emit(`status`,{status:wE.Connected}),this.cancelWebsocketRetry=void 0,this.receivedOnOpenPayload=e}attach(e){let t=e.effectiveName,n=this.configuration.providerMap.get(t);if(n&&n!==e&&n.isAuthenticated)throw Error(`Cannot attach two providers with the same effective name "${t}". Use sessionAwareness: true to multiplex providers with the same document name.`);this.configuration.providerMap.set(t,e),this.status===wE.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&this.status===wE.Connected&&e.onOpen(this.receivedOnOpenPayload)}detach(e){let t=e.effectiveName;this.configuration.providerMap.has(t)&&(e.send(EE,{documentName:t}),this.configuration.providerMap.delete(t))}setConfiguration(e={}){this.configuration={...this.configuration,...e},this.configuration.autoConnect||(this.shouldConnect=!1)}async connect(){if(this.status===wE.Connected)return;this.cancelWebsocketRetry&&=(this.cancelWebsocketRetry(),void 0),this.receivedOnOpenPayload=void 0,this.shouldConnect=!0;let{retryPromise:e,cancelFunc:t}=(()=>{let e=!1;return{retryPromise:cT(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,handleTimeout:this.configuration.handleTimeout,beforeAttempt:t=>{(!this.shouldConnect||e)&&t.abort()}}).catch(e=>{if(e&&e.code!==`ATTEMPT_ABORTED`)throw e}),cancelFunc:()=>{e=!0}}})();return this.cancelWebsocketRetry=t,e}attachWebSocketListeners(e,t){let{identifier:n}=e,r=e=>this.emit(`message`,e),i=e=>this.emit(`close`,{event:e}),a=e=>this.emit(`open`,e),o=e=>{t(e)};this.webSocketHandlers[n]={message:r,close:i,open:a,error:o};let s=this.webSocketHandlers[e.identifier];Object.keys(s).forEach(t=>{e.addEventListener(t,s[t])})}cleanupWebSocket(){if(!this.webSocket)return;let{identifier:e}=this.webSocket,t=this.webSocketHandlers[e];Object.keys(t).forEach(n=>{this.webSocket?.removeEventListener(n,t[n]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,t)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;let n=new this.configuration.WebSocketPolyfill(this.url);n.binaryType=`arraybuffer`,n.identifier=this.identifier,this.attachWebSocketListeners(n,t),this.webSocket=n,this.status=wE.Connecting,this.emit(`status`,{status:wE.Connecting}),this.connectionAttempt={resolve:e,reject:t}})}onMessage(e){this.resolveConnectionAttempt(),this.lastMessageReceived=sE();let t=new Uint8Array(e.data);if(t.length===1&&t[0]===CE.Ping){this.sendPong();return}let n=new SE(t).peekVarString();this.configuration.providerMap.get(n)?.onMessage(e)}sendPong(){let e=zT();UT(e,CE.Pong),this.send(VT(e))}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=wE.Connected,this.emit(`status`,{status:wE.Connected}),this.emit(`connect`),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){this.connectionAttempt?.reject(),this.connectionAttempt=null}checkConnection(){this.status===wE.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=sE()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:`forced`}}),this.closeTries=0):(this.webSocket?.close(),this.messageQueue=[])))}get serverUrl(){if(this.configuration.preserveTrailingSlash)return this.configuration.url;let e=this.configuration.url;for(;e[e.length-1]===`/`;)e=e.slice(0,e.length-1);return e}get url(){return this.serverUrl}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch(e){console.error(e)}}parseQueuedMessage(e){try{let t=$T(e);return{documentName:aE(t),messageType:rE(t)}}catch{return null}}addToQueue(t){if(t instanceof Uint8Array){let n=this.parseQueuedMessage(t);n&&e.DEDUPLICATABLE_TYPES.has(n.messageType)&&(this.messageQueue=this.messageQueue.filter(e=>{if(!(e instanceof Uint8Array))return!0;let t=this.parseQueuedMessage(e);return t?!(t.documentName===n.documentName&&t.messageType===n.messageType):!0}))}this.messageQueue.push(t)}send(e){this.webSocket?.readyState===iT.Open?this.webSocket.send(e):this.addToQueue(e)}onClose({event:e}){this.closeTries=0,this.cleanupWebSocket(),this.connectionAttempt&&this.rejectConnectionAttempt(),this.status=wE.Disconnected,this.emit(`status`,{status:wE.Disconnected}),this.emit(`disconnect`,{event:e}),!this.cancelWebsocketRetry&&this.shouldConnect&&setTimeout(()=>{this.connect()},this.configuration.delay)}destroy(){this.emit(`destroy`),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}},OE=0,kE=1,AE=2,jE=(e,t)=>{UT(e,OE),JT(e,xh(t))},ME=(e,t,n)=>{UT(e,kE),JT(e,hh(t,n))},NE=(e,t,n)=>ME(t,n,tE(e)),PE=(e,t,n,r)=>{try{fh(t,tE(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},FE=(e,t)=>{UT(e,AE),JT(e,t)},IE=PE,LE=(e,t,n,r,i)=>{let a=rE(e);switch(a){case OE:NE(e,t,n);break;case kE:PE(e,n,r,i);break;case AE:IE(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},RE=class{constructor(e){this.message=e}apply(e,t){let{message:n}=this,r=n.readVarUint(),i=n.length();switch(r){case CE.Sync:this.applySyncMessage(e,t);break;case CE.Awareness:this.applyAwarenessMessage(e);break;case CE.Auth:this.applyAuthMessage(e);break;case CE.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case CE.Stateless:e.receiveStateless(aE(n.decoder));break;case CE.SyncStatus:this.applySyncStatusMessage(e,iE(n.decoder)===1);break;case CE.CLOSE:let i={code:1e3,reason:aE(n.decoder)};e.onClose(),e.configuration.onClose({event:i}),e.forwardClose({event:i});break;default:console.error(`Can’t apply message of unknown type: ${r}`)}n.length()>i+1&&e.send(TE,{encoder:n.encoder})}applySyncMessage(e,t){let{message:n}=this;n.writeVarUint(CE.Sync);let r=LE(n.decoder,n.encoder,e.document,e);t&&r===kE&&(e.synced=!0)}applySyncStatusMessage(e,t){t&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;bE(e.awareness,t.readVarUint8Array(),e)}applyAuthMessage(e){let{message:t}=this;$w(t.decoder,e.sendToken.bind(e),e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;t.writeVarUint(CE.Awareness),t.writeVarUint8Array(yE(e.awareness,Array.from(e.awareness.getStates().keys())))}},zE=class{constructor(e,t={}){this.message=new e,this.encoder=this.message.get(t)}create(){return VT(this.encoder)}send(e){e?.send(this.create())}},BE=`4.0.0-rc.1`,VE=class extends TE{constructor(...e){super(...e),this.type=CE.Auth,this.description=`Authentication`}get(e){if(e.token===void 0)throw Error("The authentication message requires `token` as an argument.");return KT(this.encoder,e.documentName),UT(this.encoder,this.type),Qw(this.encoder,e.token),KT(this.encoder,BE),this.encoder}},HE=class extends TE{constructor(...e){super(...e),this.type=CE.Awareness,this.description=`Awareness states update`}get(e){if(e.awareness===void 0)throw Error(`The awareness message requires awareness as an argument`);if(e.clients===void 0)throw Error(`The awareness message requires clients as an argument`);KT(this.encoder,e.documentName),UT(this.encoder,this.type);let t;return t=e.states===void 0?yE(e.awareness,e.clients):yE(e.awareness,e.clients,e.states),JT(this.encoder,t),this.encoder}},UE=class extends TE{constructor(...e){super(...e),this.type=CE.Stateless,this.description=`A stateless message`}get(e){return KT(this.encoder,e.documentName),UT(this.encoder,this.type),KT(this.encoder,e.payload??``),this.encoder}},WE=class extends TE{constructor(...e){super(...e),this.type=CE.Sync,this.description=`First sync step`}get(e){if(e.document===void 0)throw Error(`The sync step one message requires document as an argument`);return KT(this.encoder,e.documentName),UT(this.encoder,this.type),jE(this.encoder,e.document),this.encoder}},GE=class extends TE{constructor(...e){super(...e),this.type=CE.Sync,this.description=`A document update`}get(e){return KT(this.encoder,e.documentName),UT(this.encoder,this.type),FE(this.encoder,e.update),this.encoder}},KE=class extends Error{constructor(...e){super(...e),this.code=1001}},qE=class extends xE{get effectiveName(){return this.configuration.sessionAwareness?nT(this.configuration.name,this.sessionId):this.configuration.name}constructor(e){super(),this.configuration={name:``,document:void 0,awareness:void 0,token:null,sessionAwareness:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onSynced:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,onUnsyncedChanges:()=>null},this.isSynced=!1,this.unsyncedChanges=0,this.isAuthenticated=!1,this.authorizedScope=void 0,this.manageSocket=!1,this._isAttached=!1,this.sessionId=Math.random().toString(36).slice(2),this.intervals={forceSync:null},this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.forwardConnect=()=>this.emit(`connect`),this.forwardStatus=e=>this.emit(`status`,e),this.forwardClose=e=>this.emit(`close`,e),this.forwardDisconnect=e=>this.emit(`disconnect`,e),this.forwardDestroy=()=>this.emit(`destroy`),this.setConfiguration(e),this.configuration.document=e.document?e.document:new Xm,this.configuration.awareness=e.awareness===void 0?new _E(this.document):e.awareness,this.on(`open`,this.configuration.onOpen),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`synced`,this.configuration.onSynced),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`stateless`,this.configuration.onStateless),this.on(`unsyncedChanges`,this.configuration.onUnsyncedChanges),this.on(`authenticated`,this.configuration.onAuthenticated),this.on(`authenticationFailed`,this.configuration.onAuthenticationFailed),this.awareness?.on(`update`,()=>{this.emit(`awarenessUpdate`,{states:eT(this.awareness.getStates())})}),this.awareness?.on(`change`,()=>{this.emit(`awarenessChange`,{states:eT(this.awareness.getStates())})}),this.document.on(`update`,this.boundDocumentUpdateHandler),this.awareness?.on(`update`,this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&typeof this.configuration.forceSyncInterval==`number`&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.manageSocket&&this.attach()}setConfiguration(e={}){e.websocketProvider||(this.manageSocket=!0,this.configuration.websocketProvider=new DE(e)),this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get isAttached(){return this._isAttached}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}decrementUnsyncedChanges(){this.unsyncedChanges>0&&--this.unsyncedChanges,this.unsyncedChanges===0&&(this.synced=!0),this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}forceSync(){this.resetUnsyncedChanges(),this.send(WE,{document:this.document,documentName:this.effectiveName})}pageHide(){this.awareness&&vE(this.awareness,[this.document.clientID],`page hide`)}registerEventListeners(){typeof window>`u`||!(`addEventListener`in window)||window.addEventListener(`pagehide`,this.boundPageHide)}sendStateless(e){this.send(UE,{documentName:this.effectiveName,payload:e})}async sendToken(){let e;try{e=await this.getToken()}catch(e){this.permissionDeniedHandler(`Failed to get token during sendToken(): ${e}`);return}this.send(VE,{token:e??``,documentName:this.effectiveName})}documentUpdateHandler(e,t){t!==this&&(this.incrementUnsyncedChanges(),this.send(GE,{update:e,documentName:this.effectiveName}))}awarenessUpdateHandler({added:e,updated:t,removed:n},r){let i=e.concat(t).concat(n);this.send(HE,{awareness:this.awareness,clients:i,documentName:this.effectiveName})}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,e&&this.emit(`synced`,{state:e}))}receiveStateless(e){this.emit(`stateless`,{payload:e})}async connect(){if(this.manageSocket)return this.configuration.websocketProvider.connect();console.warn(`HocuspocusProvider::connect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}disconnect(){if(this.manageSocket)return this.configuration.websocketProvider.disconnect();console.warn(`HocuspocusProvider::disconnect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}async onOpen(e){this.isAuthenticated=!1,this.emit(`open`,{event:e}),await this.sendToken(),this.startSync()}async getToken(){return typeof this.configuration.token==`function`?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(WE,{document:this.document,documentName:this.effectiveName}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(HE,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.effectiveName})}send(e,t){if(!this._isAttached)return;let n=new zE(e,t);this.emit(`outgoingMessage`,{message:n.message}),n.send(this.configuration.websocketProvider)}onMessage(e){let t=new SE(e.data),{documentName:n}=rT(t.readVarString());t.writeVarString(this.effectiveName),this.emit(`message`,{event:e,message:new SE(e.data)}),new RE(t).apply(this,!0)}onClose(){this.isAuthenticated=!1,this.synced=!1,this.awareness&&vE(this.awareness,Array.from(this.awareness.getStates().keys()).filter(e=>e!==this.document.clientID),this)}destroy(){this.emit(`destroy`),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(vE(this.awareness,[this.document.clientID],`provider destroy`),this.awareness.off(`update`,this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off(`update`,this.boundDocumentUpdateHandler),this.removeAllListeners(),this.detach(),this.manageSocket&&this.configuration.websocketProvider.destroy(),!(typeof window>`u`||!(`removeEventListener`in window))&&window.removeEventListener(`pagehide`,this.boundPageHide)}detach(){this.configuration.websocketProvider.off(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.off(`connect`,this.forwardConnect),this.configuration.websocketProvider.off(`status`,this.forwardStatus),this.configuration.websocketProvider.off(`status`,this.configuration.onStatus),this.configuration.websocketProvider.off(`open`,this.boundOnOpen),this.configuration.websocketProvider.off(`close`,this.boundOnClose),this.configuration.websocketProvider.off(`close`,this.configuration.onClose),this.configuration.websocketProvider.off(`close`,this.forwardClose),this.configuration.websocketProvider.off(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.off(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.off(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.off(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.detach(this),this._isAttached=!1}attach(){this._isAttached||=(this.configuration.websocketProvider.on(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.on(`connect`,this.forwardConnect),this.configuration.websocketProvider.on(`status`,this.configuration.onStatus),this.configuration.websocketProvider.on(`status`,this.forwardStatus),this.configuration.websocketProvider.on(`open`,this.boundOnOpen),this.configuration.websocketProvider.on(`close`,this.boundOnClose),this.configuration.websocketProvider.on(`close`,this.configuration.onClose),this.configuration.websocketProvider.on(`close`,this.forwardClose),this.configuration.websocketProvider.on(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.on(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.on(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.on(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.attach(this),!0)}permissionDeniedHandler(e){this.emit(`authenticationFailed`,{reason:e}),this.isAuthenticated=!1}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit(`authenticated`,{scope:e})}setAwarenessField(e,t){if(!this.awareness)throw new KE(`Cannot set awareness field "${e}" to ${JSON.stringify(t)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,t)}},JE=e=>rf((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),YE=(e,t)=>rf((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(kd(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),XE=e=>JE(indexedDB.deleteDatabase(e)),ZE=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),QE=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>lD(r,e))},$E=(e,t)=>JE(e.count(t)),eD=(e,t)=>JE(e.get(t)),tD=(e,t)=>JE(e.delete(t)),nD=(e,t,n)=>JE(e.put(t,n)),rD=(e,t)=>JE(e.add(t)),iD=(e,t,n)=>JE(e.getAll(t,n)),aD=(e,t,n)=>{let r=null;return cD(e,t,e=>(r=e,!1),n).then(()=>r)},oD=(e,t=null)=>aD(e,t,`prev`),sD=(e,t)=>rf((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),cD=(e,t,n,r=`next`)=>sD(e.openKeyCursor(t,r),e=>n(e.key)),lD=(e,t)=>e.objectStore(t),uD=(e,t)=>IDBKeyRange.upperBound(e,t),dD=(e,t)=>IDBKeyRange.lowerBound(e,t),fD=`custom`,pD=`updates`,mD=(e,t=()=>{},n=()=>{})=>{let[r]=QE(e.db,[pD]);return iD(r,dD(e._dbref,!1)).then(i=>{e._destroyed||(t(r),dg(e.doc,()=>{i.forEach(t=>fh(e.doc,t))},e,!1),n(r))}).then(()=>oD(r).then(t=>{e._dbref=t+1})).then(()=>$E(r).then(t=>{e._dbsize=t})).then(()=>r)},hD=(e,t=!0)=>mD(e).then(n=>{(t||e._dbsize>=500)&&rD(n,hh(e.doc)).then(()=>tD(n,uD(e._dbref,!0))).then(()=>$E(n).then(t=>{e._dbsize=t}))}),gD=class extends Su{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=YE(e,e=>ZE(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=rf(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,mD(this,async e=>{await $E(e)>0&&rD(e,hh(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=QE(this.db,[pD]);rD(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{hD(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{XE(this.name)})}get(e){return this._db.then(t=>{let[n]=QE(t,[fD],`readonly`);return eD(n,e)})}set(e,t){return this._db.then(n=>{let[r]=QE(n,[fD]);return nD(r,t,e)})}del(e){return this._db.then(t=>{let[n]=QE(t,[fD]);return tD(n,e)})}};function _D(){return!0}var vD=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`;let i=_D()?0:performance.now();this._idb=new gD(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!_D()){let e=performance.now();Z(`ok/pool/idb-whensynced`,{docName:n,durationMs:Math.round((e-i)*1e3)/1e3},{startTime:i,duration:e-i})}return this})}get synced(){return this._idb.synced}async destroy(){let e=_D()?0:performance.now();try{await this._idb.destroy()}finally{if(!_D()){let t=performance.now();Z(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async clearData(){let e=_D()?0:performance.now();try{await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e}))}})}finally{if(!_D()){let t=performance.now();Z(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function yD(e){return new vD(e)}function bD(e){return xh(e)}function xD(e,t){return t===null?hh(e):hh(e,t)}function SD(e,t){if(e===null)return t;if(t===null)return e;let n=_h(e),r=_h(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return xh(i)}function CD(e){let t={};if(ur.inject(lr.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,r=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&r.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${r.join(`&`)}`}var wD=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new S({key:e||new b(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),TD=Wt.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[wD({key:new b(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function ED(e,t){let{state:n,view:r}=e;if(!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount!==0||!we.isSelectable(o))return!1;try{let t=we.create(n.doc,s);return e.view.dispatch(n.tr.setSelection(t).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return it(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L0`,reason:e.message.slice(0,500)})),!0}}function DD(e){let{state:t,view:n}=e;if(!(t.selection instanceof f)||!t.selection.empty||!n.endOfTextblock(`up`))return!1;let r=t.selection.$head,i=-1;for(let e=r.depth-1;e>=1;e--)if(r.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;for(let e=r.depth;e>i;e--)if(r.index(e-1)!==0)return!1;let a=r.before(i);try{let n=t.doc.resolve(a),r=le.findFrom(n,-1,!0);return!r||!(r instanceof f)?!1:(e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return it(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2c`,reason:e.message.slice(0,500)})),!0}}var OD=Wt.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof we){let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=f.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof f?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{if(ED(e,`up`)||DD(e))return!0;let{state:t}=e;if(!(t.selection instanceof we))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=we.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return it(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowDown:({editor:e})=>{if(ED(e,`down`))return!0;let{state:t}=e;if(!(t.selection instanceof we))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=we.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return it(`down`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`down`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowLeft:({editor:e})=>ED(e,`left`),ArrowRight:({editor:e})=>ED(e,`right`),Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof f)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let p=u+1;return s.setSelection(f.create(s.doc,p)),e.view.dispatch(s.scrollIntoView()),!0}}}}),kD={query:``,options:{caseSensitive:!1,wholeWord:!1},activeIndex:0,matches:[]},AD=/[A-Za-z0-9_]/;function jD(e){return e!==void 0&&AD.test(e)}function MD(e,t,n){return!jD(e[t-1])&&!jD(e[n])}function ND(e,t,n){if(t.length===0)return[];let r=n.caseSensitive?e:e.toLocaleLowerCase(),i=n.caseSensitive?t:t.toLocaleLowerCase(),a=[],o=0;for(;o<=r.length-i.length;){let t=r.indexOf(i,o);if(t===-1)break;let s=t+i.length;(!n.wholeWord||MD(e,t,s))&&a.push({start:t,end:s,text:e.slice(t,s)}),o=s}return a}function PD(e,t,n){if(t.length===0)return[];let r=[];return e.descendants((e,i)=>{if(!(!e.isText||typeof e.text!=`string`))for(let a of ND(e.text,t,n))r.push({from:i+a.start,to:i+a.end,text:a.text})}),r}var FD=new b(`findReplace`);function ID(e,t){return t<=0||!Number.isFinite(e)?0:Math.min(Math.max(Math.trunc(e),0),t-1)}function LD(e,t,n,r){let i=PD(e.doc,t,n);return{query:t,options:n,activeIndex:ID(r,i.length),matches:i}}function RD(e,t,n){return t<=0?0:(ID(e,t)+n+t)%t}function zD(e,t,n){if(e.length===0)return 0;let r=t+n,i=e.findIndex(e=>e.from>=r);return i===-1?0:i}function BD(e,t,n){if(t.matches.length===0)return null;let r=e.tr;for(let e of[...t.matches].reverse())r.insertText(n,e.from,e.to);let i=PD(r.doc,t.query,t.options),a=ID(0,i.length),o=i[a];return r.setMeta(FD,{type:`setActiveIndex`,activeIndex:a}),o&&r.setSelection(f.create(r.doc,o.from,o.to)),r.scrollIntoView()}function VD(e,t){let n=FD.getState(e)?.matches[t];return n?e.tr.setMeta(FD,{type:`setActiveIndex`,activeIndex:t}).setSelection(f.create(e.doc,n.from,n.to)).scrollIntoView():null}function HD(e){return FD.getState(e)??kD}function UD(){return new S({key:FD,state:{init:()=>kD,apply(e,t,n,r){let i=e.getMeta(FD);if(i?.type===`clear`)return kD;let a=t.query,o=t.options,s=t.activeIndex;if(i?.type===`setQuery`)a=i.query,o={...o,...i.options},s=i.activeIndex??0;else if(i?.type===`setOptions`)o={...o,...i.options},s=i.activeIndex??s;else if(i?.type===`setActiveIndex`)s=i.activeIndex;else if(!e.docChanged)return t;return a.length===0?{query:a,options:o,activeIndex:0,matches:[]}:LD(r,a,o,s)}},props:{decorations(e){let t=FD.getState(e);return!t||t.matches.length===0?null:ye.create(e.doc,t.matches.map((e,n)=>ln.inline(e.from,e.to,{class:n===t.activeIndex?`ok-find-match ok-find-match-active`:`ok-find-match`})))}}})}var WD=Wt.create({name:`findReplace`,addCommands(){return{setFindQuery:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(FD,{type:`setQuery`,query:e,options:t?.options,activeIndex:t?.activeIndex})),!0),setFindOptions:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(FD,{type:`setOptions`,options:e,activeIndex:t})),!0),setActiveFindIndex:e=>({state:t,dispatch:n})=>(n&&n(t.tr.setMeta(FD,{type:`setActiveIndex`,activeIndex:e})),!0),selectNextFindMatch:()=>({state:e,dispatch:t})=>{let n=HD(e),r=VD(e,RD(n.activeIndex,n.matches.length,1));return r?(t?.(r),!0):!1},selectPreviousFindMatch:()=>({state:e,dispatch:t})=>{let n=HD(e),r=VD(e,RD(n.activeIndex,n.matches.length,-1));return r?(t?.(r),!0):!1},replaceCurrentFindMatch:e=>({state:t,dispatch:n})=>{let r=HD(t),i=r.matches[r.activeIndex];if(!i||!n)return!1;let a=t.tr.insertText(e,i.from,i.to),o=PD(a.doc,r.query,r.options),s=zD(o,i.from,e.length),c=o[s];return a.setMeta(FD,{type:`setActiveIndex`,activeIndex:s}),c&&a.setSelection(f.create(a.doc,c.from,c.to)),a.scrollIntoView(),n(a),!0},replaceAllFindMatches:e=>({state:t,dispatch:n})=>{let r=HD(t);if(!n)return!1;let i=BD(t,r,e);return i?(n(i),!0):!1},clearFindMatches:()=>({state:e,dispatch:t})=>(t&&t(e.tr.setMeta(FD,{type:`clear`})),!0)}},addProseMirrorPlugins(){return[UD()]}}),GD=new WeakMap;function KD(e,t){if(t===null){GD.delete(e);return}GD.set(e,t)}function qD(e){return GD.get(e)??null}function JD(e){return`pagesBySlug`in e}function YD(e){return JD(e)?e.pages:e}function XD(e,t){return JD(e)?e.assetPaths??new Set:t??new Set}function ZD(e,t){let n=A(e);if(n){if(JD(t))return t.pagesBySlug.get(n);for(let e of t)if(A(e)===n)return e}}function QD(e,t){if(e.includes(`/`))return;let n=A(e);if(!n)return;if(JD(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);A(t===-1?e:e.slice(t+1))===n&&(r===void 0||e.localeCompare(r)<0)&&(r=e)}return r}function $D(e){let t=e.trim();if(!t)return null;let n=A(t);return n?{target:n,alias:n===t?null:t,anchor:null}:null}function eO(e){let t=e.trim();if(!t)return[];let n=A(t);return n.length>0&&n!==t?[n]:[]}function tO(e,t){let n=e.trim();if(!n)return;let r=YD(t);if(r.has(n))return n;let i=ZD(n,t);if(i)return i;for(let e of eO(n))if(r.has(e))return e;return nO(n,r)||QD(n,t)}function nO(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function rO(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function iO(e,t){let n=rO(e);if(!n)return null;if(t.has(n))return n;let r=n.toLowerCase();for(let e of t)if(e.toLowerCase()===r)return e;if(n.includes(`/`))return null;let i=[...t].filter(e=>{let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()===r});return i.length===0?null:i.sort((e,t)=>e.localeCompare(t))[0]??null}function aO(e,t,n){let r=e.trim();if(!r)return!1;if(iO(r,XD(t,n)))return!0;let i=YD(t);return i.has(r)||eO(r).some(e=>i.has(e))||ZD(r,t)!==void 0||nO(r,i)?!0:QD(r,t)!==void 0}var oO=class extends Error{status;instance;constructor(e,t={}){super(e,t.cause===void 0?void 0:{cause:t.cause}),this.name=`HttpResponseParseError`,this.status=t.status,this.instance=t.instance}},sO=new b(`imageUpload`);function cO(e){let t=document.createElement(`div`);t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`);let n=e?.name;return t.setAttribute(`aria-label`,n?B._({id:`KDuPiY`,values:{fileName:n}}):B._({id:`bGa3Fk`})),t}var lO=new S({key:sO,state:{init(){return{decorations:ye.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(sO);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=ln.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return sO.getState(e)?.decorations??ye.empty}}});function uO(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function dO(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function fO(e){return e.split(`/`).filter(e=>e!==``)}function pO(e,t){let n=uO(e),r=uO(t),i=dO(e);if(n===r)return i;let a=fO(r),o=fO(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function mO(e){return qD(e)}function hO(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t}:{src:t,controls:!0}}}}function gO(e){let t=Ie(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:g.has(t)?{kind:`jsx-img`,ext:t}:Ke.has(t)?{kind:`jsx-video`,ext:t}:Qe.has(t)?{kind:`jsx-audio`,ext:t}:ie.has(t)?{kind:`jsx-file`,ext:t}:an.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function _O(e,t,n){let r=mO(t),i=r?`${r}.md`:``;if(!i){nr.error(B._({id:`z5pqI8`}));return}let a=crypto.randomUUID(),o=cO(e);t.view.dispatch(t.state.tr.setMeta(sO,{type:`add`,id:a,pos:n,widget:o}));let s=new FormData;s.append(`file`,e),s.append(`parentDocName`,i);let c;try{c=await fetch(`/api/upload`,{method:`POST`,body:s})}catch(e){console.error(`[uploadAndInsert] Network error:`,e),vO(t,a);return}let u;try{u=await c.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),vO(t,a);return}if(!c.ok){let e=lt.safeParse(u);if(!e.success){let n=new oO(`Upload response did not match ProblemDetails.`,{cause:e.error,status:c.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),vO(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),vO(t,a,e.data.title);return}let d=mt.safeParse(u);if(!d.success){let e=new oO(`Upload success response did not match UploadAssetSuccess.`,{cause:d.error,status:c.status});console.error(`[uploadAndInsert] Response missing src:`,e),vO(t,a);return}let f=d.data,p=f.src,m=f.deduped===!0,h=uO(i),g=typeof f.path==`string`&&f.path.length>0?f.path:h?`${h}/${p}`:p;m&&nr.info(B._({id:`VbqhBI`,values:{assetContentPath:g}}));let _=gO(e.name),{state:v}=t,y=sO.getState(v)?.uploads.get(a)??n,b=v.tr.setMeta(sO,{type:`remove`,id:a}),x=pO(g,i),S=`/${g}`;if(_.kind===`jsx-file`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),vO(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:S,target:p,alias:null,anchor:null,size:l(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(sO,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(we.create(e.doc,n)),!0}).run();return}if(_.kind===`jsx-img`||_.kind===`jsx-video`||_.kind===`jsx-audio`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),vO(t,a);return}let e=hO(_.kind,S);t.chain().command(({tr:e})=>(e.setMeta(sO,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(we.create(e.doc,n)),!0}).run();return}if(_.kind===`wikiembed`){let e=v.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),vO(t,a);return}b.insert(y,e.create({target:p,alias:null,anchor:null,resolvedSrc:S}))}else if(_.kind===`wiki-link`){let n=v.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),vO(t,a);return}let r=$D(e.name.replace(/\.(md|mdx)$/i,``));r?b.insert(y,n.create(r)):b.insert(y,v.schema.text(e.name))}else{let t=v.schema.marks.link;if(t){let n=v.schema.text(e.name,[t.create({href:x})]);b.insert(y,n)}else b.insert(y,v.schema.text(e.name))}t.view.dispatch(b)}function vO(e,t,n){e.view.dispatch(e.state.tr.setMeta(sO,{type:`remove`,id:t})),nr.error(n??B._({id:`b3Thhd`}))}var yO=new Set;function bO(e){yO.add(e)}function xO(e){return yO.delete(e)}var SO=new b(`markIdentity`);function CO(){return{byId:new Map,counter:0}}function wO(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&TO(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function TO(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&!(typeof n==`object`&&n&&typeof i==`object`&&i&&TO(n,i)))return!1}return!0}function EO(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function DO(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new S({key:SO,state:{init(e,t){return wO(t.doc,CO(),a,n)},apply(e,t,r,i){return e.docChanged?wO(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=SO.getState(t.state);n&&(e=EO(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}var OO=300,kO=150,AO=500,jO=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function MO(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}function NO(e){return e?e.closest(`[data-ok-prop-panel]`)!==null:!1}function PO(){return typeof document>`u`?!1:document.querySelector(`[data-ok-layer-spawned]`)!==null}var FO=e=>{let t=(0,J.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,Y.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Y.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,X.jsxs)(X.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function IO(e){return e.editorView?.dom??null}function LO(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function RO(e){let{editor:t}=e,n=new jO,r=IO(t),i=!1,a=null,o=null,s=null,c=null,l=null,u=()=>{a!==null&&(clearTimeout(a),a=null),s=null},d=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{c!==null&&(clearTimeout(c),c=null)},p=e=>{if(n.getActiveNode()===e){d();return}s===e&&a!==null||(u(),d(),s=e,a=setTimeout(()=>{a=null,s=null,n.setActiveNode(e)},OO))},m=()=>{n.getActiveNode()!==null&&o===null&&(o=setTimeout(()=>{o=null,!PO()&&n.setActiveNode(null)},kO))},h=null,g=!1,_=e=>{try{g=!0,e.focus({preventScroll:!0})}catch{}finally{g=!1}},v=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;h=t&&LO(t,e)?t:null}return}if(typeof document>`u`)return;let i=h;if(h=null,i&&document.contains(i)&&typeof i.focus==`function`){_(i);return}let a=r??IO(t);a&&typeof a.focus==`function`&&_(a)}),y=e=>{let t=e;if(t.button!==2){if(t.metaKey||t.ctrlKey||t.button===1){u(),t.button===1&&t.preventDefault?.();return}if(t.pointerType===`touch`){let t=MO(e.target,n);if(t===null)return;f(),c=setTimeout(()=>{c=null,l=t,n.setActiveNode(t)},AO);return}u()}},b=()=>{f()},x=e=>{e.pointerType===`touch`&&c!==null&&f()},S=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1)return;let r=MO(e.target,n);if(r===null)return;if(l!==null){let e=l===r;if(l=null,e){t.preventDefault?.();return}}let i=t.metaKey||t.ctrlKey||t.button===1,a=n.getRegistration(r);if(a?.handlePrimary&&a.handlePrimary({nodeId:r,type:a.type,newTab:i})){t.preventDefault?.(),i||(u(),d(),n.getActiveNode()===r&&n.setActiveNode(null));return}i||(u(),d(),n.setActiveNode(r))},C=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(u(),d(),n.setActiveNode(null),t.preventDefault?.());return}if(t.key===`Tab`&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey){let r=MO(e.target,n);if(r!==null&&n.getActiveNode()===r){let e=document.querySelector(`[data-ok-prop-panel]`);if(e){let n=e.querySelector(`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(n){t.preventDefault?.(),n.focus();return}}}return}let r=t.key===`Enter`,i=t.key===` `||t.key===`Spacebar`;if(!r&&!i)return;let a=MO(e.target,n);if(a===null||i&&((e.target instanceof Element?e.target:null)?.closest(`[data-mark-id], [data-node-id]`)??null)?.getAttribute(`role`)===`link`)return;let o=n.getRegistration(a);if(t.preventDefault?.(),o?.handlePrimary&&o.handlePrimary({nodeId:a,type:o.type,newTab:!1})){u(),d(),n.getActiveNode()===a&&n.setActiveNode(null);return}n.setActiveNode(a)},w=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target;if(!(r instanceof Element))return;if(NO(r)){d();return}let i=MO(r,n);i!==null&&p(i)},T=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target,i=t.relatedTarget;if(!(r instanceof Element))return;let a=i instanceof Element?i:null,o=MO(r,n);if(o!==null){if(a&&NO(a)){d();return}if(a&&MO(a,n)===o)return;s===o&&u(),m();return}if(NO(r)){if(a&&NO(a))return;let e=n.getActiveNode();if(e!==null&&a&&MO(a,n)===e)return;m()}},E=e=>{if(g)return;let t=e.target;if(!(t instanceof Element))return;let r=MO(t,n);r!==null&&(u(),d(),n.setActiveNode(r))},D=e=>{let t=e;if(n.getActiveNode()===null)return;let r=t.relatedTarget,i=r instanceof Element?r:null;i&&NO(i)||i&&MO(i,n)!==null||m()},O=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||(u(),d(),n.setActiveNode(null)))},k=()=>{i||(r=IO(t),r&&(r.addEventListener(`pointerdown`,y,!0),r.addEventListener(`pointerup`,b,!0),r.addEventListener(`pointercancel`,b,!0),r.addEventListener(`pointermove`,x,!0),r.addEventListener(`click`,S,!0),r.addEventListener(`auxclick`,S,!0),r.addEventListener(`keydown`,C,!0),typeof document<`u`&&(document.addEventListener(`pointerover`,w,!0),document.addEventListener(`pointerout`,T,!0),document.addEventListener(`focusin`,E,!0),document.addEventListener(`focusout`,D,!0),document.addEventListener(`pointerdown`,O,!0)),i=!0))},A=()=>{i&&=(r?.removeEventListener(`pointerdown`,y,!0),r?.removeEventListener(`pointerup`,b,!0),r?.removeEventListener(`pointercancel`,b,!0),r?.removeEventListener(`pointermove`,x,!0),r?.removeEventListener(`click`,S,!0),r?.removeEventListener(`auxclick`,S,!0),r?.removeEventListener(`keydown`,C,!0),typeof document<`u`&&(document.removeEventListener(`pointerover`,w,!0),document.removeEventListener(`pointerout`,T,!0),document.removeEventListener(`focusin`,E,!0),document.removeEventListener(`focusout`,D,!0),document.removeEventListener(`pointerdown`,O,!0)),!1)};return k(),{register(e){n.register(e),i||k()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){A(),u(),d(),f(),v(),n.clear()},store:n}}var zO=e=>{let t=(0,J.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,X.jsx)(FO,{store:n})}),t[0]=n,t[1]=r),r},BO=new WeakMap;function VO(e){let t=BO.get(e);if(t)return t;let n=RO({editor:e});return BO.set(e,n),e.on(`destroy`,()=>{n.destroy(),BO.delete(e)}),n}var HO={AppWindow:ji,ChevronRight:rr,CopyPlus:Ki,FileText:$i,Film:na,GitBranch:aa,Image:ua,LayoutPanelTop:pa,MessageSquareWarning:Sa,PanelTop:Ea,Paperclip:Da,Sigma:Pa,SquarePlay:Ia,Volume2:Wa,Workflow:Ga,ZoomIn:qa};function UO(e){return e&&Object.hasOwn(HO,e)?HO[e]:Fi}var WO={Info:da,Lightbulb:ma,MessageSquareWarning:Sa,AlertTriangle:Vt,AlertOctagon:wa,ClipboardList:Ui,BookOpen:Pi,ListTodo:ya,CircleCheck:Re,CircleHelp:Vi,CircleX:Hi,Zap:Ka,Bug:Ii,FlaskConical:ra,Quote:Aa,ChevronRight:rr},GO=Object.entries(WO).sort(([e],[t])=>e.localeCompare(t));function KO(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(WO,t)?WO[t]??null:null}function qO(e){let t=(0,J.c)(24),n;t[0]===e.icon?n=t[1]:(n=KO(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(rr,{size:14,className:`accordion-chevron`,"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=r?(0,X.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[3]=r,t[4]=o);let s=e.title??`Accordion`,c;t[5]===s?c=t[6]:(c=(0,X.jsx)(`span`,{className:`accordion-title`,children:s}),t[5]=s,t[6]=c);let l;t[7]===e.description?l=t[8]:(l=e.description?(0,X.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[7]=e.description,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,X.jsxs)(`span`,{className:`accordion-title-group`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==u?(d=(0,X.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14];let f;t[15]===e.children?f=t[16]:(f=(0,X.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[15]=e.children,t[16]=f);let p;return t[17]!==e.defaultOpen||t[18]!==e.id||t[19]!==e.name||t[20]!==i||t[21]!==d||t[22]!==f?(p=(0,X.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[d,f]}),t[17]=e.defaultOpen,t[18]=e.id,t[19]=e.name,t[20]=i,t[21]=d,t[22]=f,t[23]=p):p=t[23],p}function JO(e){return e!==!1}function YO(e){let t=(0,J.c)(12),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:Fe(e.src),t[0]=e.src,t[1]=n);let r=e.title,i;t[2]===e.controls?i=t[3]:(i=JO(e.controls),t[2]=e.controls,t[3]=i);let a;return t[4]!==e.autoplay||t[5]!==e.loop||t[6]!==e.muted||t[7]!==e.preload||t[8]!==e.title||t[9]!==n||t[10]!==i?(a=(0,X.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[4]=e.autoplay,t[5]=e.loop,t[6]=e.muted,t[7]=e.preload,t[8]=e.title,t[9]=n,t[10]=i,t[11]=a):a=t[11],a}var XO={note:da,tip:ma,important:Sa,warning:Vt,caution:wa,abstract:Ui,info:Pi,todo:ya,success:Re,question:Vi,failure:Hi,danger:Ka,bug:Ii,example:ra,quote:Aa};function ZO(e,t){return KO(e)??XO[t]}var QO=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function $O(e){return typeof e==`string`&&QO.has(e)?e:`note`}function ek(e){let t=(0,J.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=$O(e.type),n=ZO(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,a;t[4]===e.color?a=t[5]:(a=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=a);let s=a,c;t[6]!==i||t[7]!==e.title?(c=e.title||i?(0,X.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,X.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,X.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=c):c=t[8];let l=c;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===l?i=t[10]:(i=l??(0,X.jsx)(`span`,{className:`callout-title`,children:(0,X.jsx)(o,{id:`URmyfc`})}),t[9]=l,t[10]=i);let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Ri,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=a):a=t[11];let c;t[12]===i?c=t[13]:(c=(0,X.jsxs)(`summary`,{className:`callout-summary`,contentEditable:!1,children:[i,a]}),t[12]=i,t[13]=c);let u;t[14]===e.children?u=t[15]:(u=(0,X.jsx)(`div`,{className:`callout-body`,children:e.children}),t[14]=e.children,t[15]=u);let d;return t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==u||t[20]!==r?(d=(0,X.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:s,children:[c,u]}),t[16]=n,t[17]=s,t[18]=c,t[19]=u,t[20]=r,t[21]=d):d=t[21],d}let u;t[22]===e.children?u=t[23]:(u=(0,X.jsx)(`div`,{className:`callout-body`,children:e.children}),t[22]=e.children,t[23]=u);let d;return t[24]!==l||t[25]!==s||t[26]!==u||t[27]!==r?(d=(0,X.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:s,children:[l,u]}),t[24]=l,t[25]=s,t[26]=u,t[27]=r,t[28]=d):d=t[28],d}var tk=(0,Y.createContext)(null);function nk(e){let t=(0,J.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(tk.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function rk(){return(0,Y.use)(tk)}var ik=[{key:`tl`,dx:-1,dy:-1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--tl`},{key:`t`,dx:0,dy:-1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--t`},{key:`tr`,dx:1,dy:-1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--tr`},{key:`r`,dx:1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--r`},{key:`br`,dx:1,dy:1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--br`},{key:`b`,dx:0,dy:1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--b`},{key:`bl`,dx:-1,dy:1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--bl`},{key:`l`,dx:-1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--l`}];function ak(e){let t=(0,J.c)(7),{targetRef:n,onResize:r,onResizeEnd:a,bounds:o}=e,{_:s}=i(),c=(0,Y.useRef)(null),l;t[0]!==o?.maxHeight||t[1]!==o?.maxWidth||t[2]!==o?.minHeight||t[3]!==o?.minWidth?(l=function(e,t){let n=t===`w`?o?.minWidth??64:o?.minHeight??64,r=t===`w`?o?.maxWidth??1/0:o?.maxHeight??1/0;return Math.max(n,Math.min(r,e))},t[0]=o?.maxHeight,t[1]=o?.maxWidth,t[2]=o?.minHeight,t[3]=o?.minWidth,t[4]=l):l=t[4];let u=l,d=function(e,t){let i=n.current;if(!i)return;e.preventDefault(),e.stopPropagation();let o=i.getBoundingClientRect();c.current={handle:t,startX:e.clientX,startY:e.clientY,startWidth:o.width,startHeight:o.height,latestWidth:o.width,latestHeight:o.height,hasMoved:!1},document.body.style.setProperty(`cursor`,t.cursor),document.body.style.setProperty(`user-select`,`none`);let s=function(e){let t=c.current;if(!t)return;let n=(e.clientX-t.startX)*t.handle.dx,i=(e.clientY-t.startY)*t.handle.dy,a=t.handle.dx===0?t.startWidth:u(t.startWidth+n,`w`),o=t.handle.dy===0?t.startHeight:u(t.startHeight+i,`h`);t.latestWidth=a,t.latestHeight=o,t.hasMoved=!0,r({width:a,height:o})};function l(){let e=c.current;if(!e)return;let t={width:e.latestWidth,height:e.latestHeight},n=e.hasMoved;c.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),n&&a?.(t)}window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l)},f=ik.map(e=>{let t=e.key;return(0,X.jsx)(`button`,{type:`button`,className:vn(e.className),"aria-label":s({id:`NxW-md`,values:{handleKey:t}}),tabIndex:-1,style:{cursor:e.cursor},onPointerDown:t=>d(t,e)},t)}),p;return t[5]===f?p=t[6]:(p=(0,X.jsx)(`div`,{className:`ok-resize-overlay`,contentEditable:!1,"aria-hidden":`true`,children:f}),t[5]=f,t[6]=p),p}var ok=`26rem`,sk=`Embedded content`,ck=/^https?:\/\//i;function lk(e){try{return new URL(e).origin!==window.location.origin}catch{return!1}}function uk(e){return!(typeof e!=`string`||!ck.test(e)||!lk(e))}function dk(e){let t=(0,J.c)(21),{src:n,title:r,width:i,height:a}=e,o=(0,Y.useRef)(null),s=rk(),c=i||void 0,l=a||ok,u;t[0]!==c||t[1]!==l?(u={width:c,height:l},t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==a||t[4]!==i?(f=()=>{let e=o.current;e&&(e.style.width=i||``,e.style.height=a||ok)},p=[i,a],t[3]=a,t[4]=i,t[5]=f,t[6]=p):(f=t[5],p=t[6]),(0,Y.useEffect)(f,p),!uk(n)){let e=`Embed a URL`;typeof n==`string`&&n.length>0&&(e=ck.test(n)?`Embed only supports cross-origin URLs`:`URL must start with http:// or https://`);let r;return t[7]===e?r=t[8]:(r=(0,X.jsx)(`div`,{className:`ok-embed ok-embed--placeholder`,contentEditable:!1,children:(0,X.jsx)(`span`,{children:e})}),t[7]=e,t[8]=r),r}let m;t[9]===s?m=t[10]:(m=e=>{if(!s)return;let{editor:t,getPos:n}=s,r=n();if(typeof r==`number`)try{let n=t.state.doc.nodeAt(r);if(!n||n.type.name!==`jsxComponent`)return;let i={...n.attrs.props??{},width:`${Math.round(e.width)}px`,height:`${Math.round(e.height)}px`};t.view.dispatch(t.state.tr.setNodeMarkup(r,null,{...n.attrs,props:i,sourceDirty:!0}))}catch(e){let t=e;if(t instanceof RangeError)return;throw t}},t[9]=s,t[10]=m);let h=m,g=r||sk,_;t[11]!==n||t[12]!==g?(_=(0,X.jsx)(`iframe`,{title:g,src:n,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation`,referrerPolicy:`no-referrer`,loading:`lazy`,className:`ok-embed-frame`}),t[11]=n,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==s||t[15]!==h?(v=s?(0,X.jsx)(ak,{targetRef:o,bounds:{minWidth:192,maxWidth:2e3,minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=o.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:h}):null,t[14]=s,t[15]=h,t[16]=v):v=t[16];let y;return t[17]!==d||t[18]!==_||t[19]!==v?(y=(0,X.jsxs)(`div`,{className:`ok-embed`,style:d,ref:o,contentEditable:!1,children:[_,v]}),t[17]=d,t[18]=_,t[19]=v,t[20]=y):y=t[20],y}function fk(e){if(!e)return``;let t,n=null;try{let r=new URL(e,`https://placeholder.local`);n=r.protocol,t=r.pathname}catch{t=e.split(`?`)[0]??e}if(n===`data:`||n===`blob:`)return``;let r=t.split(`/`),i=r[r.length-1]??``;try{return decodeURIComponent(i)}catch{return i}}function pk(e){let t=(0,J.c)(18),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||fk(e.src)||`Untitled file`,t[0]=e.name,t[1]=e.src,t[2]=n):n=t[2];let r=n,i=e.size?.trim()?e.size:null,a;t[3]===e.src?a=t[4]:(a=e.src?Fe(e.src):void 0,t[3]=e.src,t[4]=a);let o=a,s;t[5]===o?s=t[6]:(s=e=>{e.stopPropagation(),e.preventDefault(),o&&window.open(o,`_blank`,`noopener,noreferrer`)},t[5]=o,t[6]=s);let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(ea,{className:`ok-file-icon`,"aria-hidden":`true`}),t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,X.jsx)(`span`,{className:`ok-file-name`,children:r}),t[8]=r,t[9]=u);let d;t[10]===i?d=t[11]:(d=i?(0,X.jsx)(`span`,{className:`ok-file-size`,children:i}):null,t[10]=i,t[11]=d);let f;return t[12]!==c||t[13]!==o||t[14]!==e.title||t[15]!==u||t[16]!==d?(f=(0,X.jsxs)(`a`,{href:o,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:mk,onClick:c,children:[l,u,d]}),t[12]=c,t[13]=o,t[14]=e.title,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function mk(e){return e.stopPropagation()}function hk(){return Y.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Y.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function gk(){return Y.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Y.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function _k(e){return typeof Element>`u`?!1:e instanceof Element}var vk=(e,t)=>_k(t)&&t.tagName.toUpperCase()===e,yk=e=>vk(`DIV`,e)||vk(`SPAN`,e),bk=e=>vk(`IMG`,e),xk=e=>e.complete&&e.naturalHeight!==0,Sk=e=>vk(`SVG`,e),Ck=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),wk=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=Ck({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},Tk=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?wk({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):Ck({height:e,offset:r,width:t}),Ek=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,Dk=e=>{if(e!==null){if(bk(e))return e.currentSrc===``?void 0:e.currentSrc;if(yk(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return Ek.exec(t)?.[1]}}},Ok=e=>{if(e!==null)return bk(e)?e.alt:e.getAttribute(`aria-label`)??void 0},kk=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=Tk({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},Ak=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},jk=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=Ak({position:p,relativeNum:r-l*f}),g=Ak({position:m,relativeNum:e-c*f}),_=Tk({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=Ak({position:a,relativeNum:r-l}),f=Ak({position:u,relativeNum:e-c}),p=Tk({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=Tk({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},Mk=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=Ak({position:p,relativeNum:a-l*f}),g=Ak({position:m,relativeNum:n-c*f}),_=Tk({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=Ak({position:t,relativeNum:a-l}),f=Ak({position:u,relativeNum:n-c}),p=Tk({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=Ak({position:u,relativeNum:a}),p=Ak({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=Ak({position:_,relativeNum:a-l*g}),b=Ak({position:v,relativeNum:n-c*g}),x=Tk({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},Nk=/\.svg$/i,Pk=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&Nk.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&yk(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=kk({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?jk({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?Mk({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},Fk=e=>{if(e==null)return{};if(Sk(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},Ik=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},Lk=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Rk={overflow:``,width:``};function zk(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function Bk(e){e.preventDefault()}function Vk(e){return Y.createElement(Hk,{...e})}var Hk=class extends Y.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=Y.createRef(),this.refDialog=Y.createRef(),this.refModalContent=Y.createRef(),this.refModalImg=Y.createRef(),this.refWrap=Y.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Rk,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(Lk),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:Fk(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:Fk(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=Dk(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(bk(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:Fk(this.imgEl)})};t.decode().then(r).catch(()=>{if(xk(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||Sk(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=Rk},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(xk(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(Sk(e)){let r=e.cloneNode(!0);Ik(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=yk(a),j=bk(a),M=Sk(a),N=Ok(a),P=Dk(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,ee=h?.src!==void 0&&h.src!==``,R=this.hasImage(),z=N!==void 0&&N!==``?`${s}: ${N}`:s,B=T===`LOADING`||T===`LOADED`,V=R?`found`:`not-found`,H=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,U={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=R&&a!==null?Pk({hasZoomImg:ee,imgSrc:P,isSvg:M,isZoomed:f&&B,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let te=null;if(R){let t=j||A?Y.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?Y.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=Y.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},Y.createElement(u,null));te=m==null?Y.createElement(Y.Fragment,null,t,n):Y.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return Y.createElement(p,{"aria-owns":R?O:void 0,"data-rmiz":``,ref:x},Y.createElement(p,{"data-rmiz-content":V,ref:_,style:U},c),R&&Y.createElement(p,{"data-rmiz-ghost":``,style:D},Y.createElement(`button`,{"aria-label":z,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},Y.createElement(d,null))),R&&Qa.createPortal(Y.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:Bk,ref:v,role:`dialog`},Y.createElement(`div`,{"data-rmiz-modal-overlay":H}),Y.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},te)),zk()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};Hk.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:hk,IconZoom:gk,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Uk({onZoomChange:e,...t}){let[n,r]=Y.useState(!1),i=Y.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return Y.createElement(Vk,{...t,isZoomed:n,onZoomChange:i})}function Wk(e,t){return typeof e==`number`&&typeof t==`number`&&e>0&&t>0}function Gk(e,t,n){return Wk(e,t)?{...n,width:`${e}px`,aspectRatio:`${e} / ${t}`}:n}function Kk(e){let t=(0,J.c)(52),n,r,a,o,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({width:m,height:r,loadingTestId:d,slotTestId:f,slotClassName:c,className:n,onLoad:s,onError:o,src:l,style:u,alt:p,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=d===void 0?`image-loading-skeleton`:d,g=f===void 0?`image-slot`:f,_=p===void 0?``:p,{_:v}=i(),y=(0,Y.useRef)(null),[b,x]=(0,Y.useState)(!1),S;t[13]!==r||t[14]!==m?(S=Wk(m,r),t[13]=r,t[14]=m,t[15]=S):S=t[15];let C=S,w;t[16]!==r||t[17]!==u||t[18]!==m?(w=Gk(m,r,u),t[16]=r,t[17]=u,t[18]=m,t[19]=w):w=t[19];let T=w,E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{y.current?.complete?x(!0):x(!1)},t[20]=E):E=t[20];let D;t[21]===l?D=t[22]:(D=[l],t[21]=l,t[22]=D),(0,Y.useLayoutEffect)(E,D);let O=!C&&!b&&`aspect-[16/9] w-full max-w-full`,k;t[23]!==c||t[24]!==O?(k=vn(`relative inline-block overflow-hidden`,O,c),t[23]=c,t[24]=O,t[25]=k):k=t[25];let A;t[26]!==v||t[27]!==b||t[28]!==h?(A=!b&&(0,X.jsx)(`span`,{"data-testid":h,role:`status`,"aria-busy":`true`,"aria-label":v({id:`N1YYa7`}),className:`absolute inset-0 animate-pulse rounded-md bg-muted motion-reduce:animate-none`}),t[26]=v,t[27]=b,t[28]=h,t[29]=A):A=t[29];let j=b?`opacity-100`:`opacity-0`,M;t[30]!==n||t[31]!==j?(M=vn(`block max-w-full transition-opacity motion-reduce:transition-none`,j,n),t[30]=n,t[31]=j,t[32]=M):M=t[32];let N;t[33]===s?N=t[34]:(N=e=>{x(!0),s?.(e)},t[33]=s,t[34]=N);let P;t[35]===o?P=t[36]:(P=e=>{x(!0),o?.(e)},t[35]=o,t[36]=P);let F;t[37]!==_||t[38]!==r||t[39]!==a||t[40]!==l||t[41]!==M||t[42]!==N||t[43]!==P||t[44]!==m?(F=(0,X.jsx)(`img`,{...a,ref:y,src:l,alt:_,width:m,height:r,className:M,onLoad:N,onError:P}),t[37]=_,t[38]=r,t[39]=a,t[40]=l,t[41]=M,t[42]=N,t[43]=P,t[44]=m,t[45]=F):F=t[45];let I;return t[46]!==T||t[47]!==g||t[48]!==A||t[49]!==F||t[50]!==k?(I=(0,X.jsxs)(`span`,{"data-testid":g,className:k,style:T,children:[A,F]}),t[46]=T,t[47]=g,t[48]=A,t[49]=F,t[50]=k,t[51]=I):I=t[51],I}function qk(e){return e??`lazy`}function Jk(e){if(typeof e!=`string`)return e;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function Yk(e){let t=(0,J.c)(21),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:Fe(e.src),t[0]=e.src,t[1]=n);let r=e.alt??``,i;t[2]===e.width?i=t[3]:(i=Jk(e.width),t[2]=e.width,t[3]=i);let a;t[4]===e.height?a=t[5]:(a=Jk(e.height),t[4]=e.height,t[5]=a);let o=e.title,s;t[6]===e.loading?s=t[7]:(s=qk(e.loading),t[6]=e.loading,t[7]=s);let c;return t[8]!==e.crossorigin||t[9]!==e.decoding||t[10]!==e.fetchpriority||t[11]!==e.referrerpolicy||t[12]!==e.sizes||t[13]!==e.srcset||t[14]!==e.title||t[15]!==n||t[16]!==r||t[17]!==i||t[18]!==a||t[19]!==s?(c=(0,X.jsx)(Kk,{src:n,alt:r,width:i,height:a,title:o,loading:s,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy}),t[8]=e.crossorigin,t[9]=e.decoding,t[10]=e.fetchpriority,t[11]=e.referrerpolicy,t[12]=e.sizes,t[13]=e.srcset,t[14]=e.title,t[15]=n,t[16]=r,t[17]=i,t[18]=a,t[19]=s,t[20]=c):c=t[20],c}function Xk(e){let t=(0,J.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,X.jsx)(Uk,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,X.jsx)(Yk,{...e})}),t[1]=e,t[2]=r),r}var Zk=(0,Y.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-DX-tM4Fr.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,J.c)(7),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!0,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;n[2]===i?a=n[3]:(a={__html:i},n[2]=i,n[3]=a);let o;return n[4]!==t.id||n[5]!==a?(o=(0,X.jsx)(`div`,{className:`math math-display`,"data-component-type":`math`,id:t.id,dangerouslySetInnerHTML:a}),n[4]=t.id,n[5]=a,n[6]=o):o=n[6],o}return{default:t}});function Qk(e){let t=(0,J.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,X.jsx)(`div`,{className:`math math-placeholder`,"data-component-type":`math`,id:e.id,children:n}),t[0]=e.id,t[1]=n,t[2]=r):r=t[2],r}function $k(e){let t=(0,J.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,X.jsx)(Qk,{formula:n,id:e.id}),t[0]=n,t[1]=e.id,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e.id?(r=(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(Qk,{formula:n,id:e.id}),children:(0,X.jsx)(Zk,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}var eA=null;function tA(){return eA||=n(()=>import(`./mermaid.core-CWYso-V4.js`).then(e=>{let t=e.default;return t.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`default`,suppressErrorRendering:!0}),t}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url).catch(e=>{throw eA=null,e}),eA}function nA(e){let t=(0,J.c)(24),n=e.chart??``,r=(0,Y.useId)(),i;if(t[0]!==r){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],i=r.replace(e,`_`),t[0]=r,t[1]=i}else i=t[1];let a=`mermaid-${i}`,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={status:`idle`,svg:``,error:``},t[3]=s):s=t[3];let[c,l]=(0,Y.useState)(s),u,d;if(t[4]!==n||t[5]!==a?(u=()=>{if(!n.trim()){l({status:`idle`,svg:``,error:``});return}let e=!1;return l(rA),tA().then(async t=>{try{let r=await t.render(a,n);e||l({status:`ready`,svg:r.svg,error:``})}catch(t){let n=t;e||l({status:`error`,svg:``,error:n instanceof Error?n.message:String(n)})}}).catch(t=>{e||l({status:`error`,svg:``,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},d=[n,a],t[4]=n,t[5]=a,t[6]=u,t[7]=d):(u=t[6],d=t[7]),(0,Y.useEffect)(u,d),!n.trim()){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`mermaid mermaid-placeholder`,"data-component-type":`mermaid`,children:(0,X.jsx)(`span`,{className:`mermaid-empty`,children:` `})}),t[8]=e):e=t[8],e}if(c.status===`error`){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Vt,{className:`size-3.5 shrink-0 mt-0.5`,"aria-hidden":!0}),t[9]=e):e=t[9];let r;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`div`,{className:`font-medium`,children:(0,X.jsx)(o,{id:`OLBz-_`})}),t[10]=r):r=t[10];let i;t[11]===c.error?i=t[12]:(i=(0,X.jsxs)(`div`,{role:`alert`,className:`mermaid-error-message mb-2 flex items-start gap-2 rounded border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive`,children:[e,(0,X.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,X.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words font-mono text-[11px] opacity-90`,children:c.error})]})]}),t[11]=c.error,t[12]=i);let a;t[13]===n?a=t[14]:(a=(0,X.jsx)(`pre`,{className:`mermaid-error-source`,children:n}),t[13]=n,t[14]=a);let s;return t[15]!==c.error||t[16]!==i||t[17]!==a?(s=(0,X.jsxs)(`div`,{className:`mermaid mermaid-error`,"data-component-type":`mermaid`,title:c.error,children:[i,a]}),t[15]=c.error,t[16]=i,t[17]=a,t[18]=s):s=t[18],s}let f=`mermaid mermaid-${c.status}`,p;t[19]===c.svg?p=t[20]:(p={__html:c.svg},t[19]=c.svg,t[20]=p);let m;return t[21]!==f||t[22]!==p?(m=(0,X.jsx)(`div`,{className:f,"data-component-type":`mermaid`,dangerouslySetInnerHTML:p}),t[21]=f,t[22]=p,t[23]=m):m=t[23],m}function rA(e){return{...e,status:`rendering`}}var iA=null;function aA(){return iA||=new j({extensions:N}),iA}function oA(e,t){if(e.type===`mdxJsxFlowElement`){let n=e;if(n.name===`MirrorSource`){for(let e of n.attributes??[])if(e.type===`mdxJsxAttribute`&&e.name===`id`&&typeof e.value==`string`&&e.value===t)return n}}let n=e.children;if(Array.isArray(n))for(let e of n){let n=oA(e,t);if(n)return n}return null}function sA(e){return x({type:`root`,children:e.children??[]})}var cA=new Map,lA=30,uA=150,dA=1e4;function fA(e,t){let n=`${e}|${t}`,r=cA.get(n);if(r)return r.refcount+=1,r;let i=new Xm,a=new qE({url:e,name:t,document:i}),o=new Set,s={provider:a,ySource:i.getText(`source`),refcount:1,synced:!1,subscribers:o};return a.on(`synced`,()=>{s.synced=!0;for(let e of o)e.onSynced()}),s.ySource.observe(()=>{for(let e of o)e.onUpdate()}),cA.set(n,s),cA.size>lA&&console.warn(`[Mirror] provider pool exceeded ${lA} entries (current=${cA.size}). Many Mirrors pointing at distinct source docs — investigate if this is a runaway pattern.`),s}function pA(e,t){let n=`${e}|${t}`,r=cA.get(n);if(r&&(--r.refcount,r.refcount<=0)){try{r.provider.destroy()}catch(e){console.warn(`[Mirror] provider.destroy() failed during release`,{src:t,err:e})}cA.delete(n)}}function mA(e,t){let n=(0,J.c)(8),{collabUrl:r}=Xx(),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={kind:`loading`},n[0]=i):i=n[0];let[a,o]=(0,Y.useState)(i),s=(0,Y.useRef)(t),c=(0,Y.useRef)(null),l,u;n[1]!==r||n[2]!==e?(l=()=>{if(!e){o({kind:`empty-props`});return}if(!r){o({kind:`loading`});return}let t=fA(r,e),n=()=>{let n=s.current;if(!n){o({kind:`empty-props`});return}let r=t.ySource.toString();if(!r){o(t.synced?{kind:`source-removed`}:{kind:`loading`});return}let i;try{i=aA().parseToMdast(r)}catch(t){console.warn(`[Mirror] parseToMdast failed`,{src:e,anchor:n,err:t}),o({kind:`source-removed`});return}let a=oA(i,n);if(!a){o({kind:`anchor-not-found`});return}let c;try{c=sA(a)}catch(t){console.warn(`[Mirror] renderMirrorSubtree failed`,{src:e,anchor:n,err:t}),o({kind:`anchor-not-found`});return}o({kind:`ready`,html:c})},i=null,a={onUpdate:()=>{i&&clearTimeout(i),i=setTimeout(()=>{i=null,n()},uA)},onSynced:()=>{i&&=(clearTimeout(i),null),n()}};t.subscribers.add(a),c.current=n;let l=setTimeout(()=>{t.synced||o({kind:`source-removed`})},dA);return n(),()=>{clearTimeout(l),i&&clearTimeout(i),t.subscribers.delete(a),c.current=null,pA(r,e)}},u=[r,e],n[1]=r,n[2]=e,n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,Y.useEffect)(l,u);let d,f;return n[5]===t?(d=n[6],f=n[7]):(d=()=>{s.current=t,c.current?.()},f=[t],n[5]=t,n[6]=d,n[7]=f),(0,Y.useEffect)(d,f),a}function hA(e){let t=(0,J.c)(8),n=`ok-mirror-state flex items-start gap-2 rounded-md border border-dashed px-3 py-2 text-sm ${e.tone===`error`?`border-destructive/40 text-destructive`:`border-border text-muted-foreground`}`,r;t[0]===e.tone?r=t[1]:(r=e.tone===`error`?(0,X.jsx)(ha,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}):(0,X.jsx)(_a,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),t[0]=e.tone,t[1]=r);let i;t[2]===e.children?i=t[3]:(i=(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children}),t[2]=e.children,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,X.jsxs)(`div`,{className:n,children:[r,i]}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gA(e){let t=(0,J.c)(30),n=e.src??``,r=e.anchor??``,i=mA(n,r);if(i.kind===`empty-props`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(hA,{tone:`placeholder`,children:(0,X.jsx)(o,{id:`3SDfZl`,components:{0:(0,X.jsx)(`span`,{className:`font-medium`}),1:(0,X.jsx)(`code`,{}),2:(0,X.jsx)(`code`,{}),3:(0,X.jsx)(`code`,{})}})}),t[0]=e):e=t[0],e}if(i.kind===`loading`){let e=n&&r?`${n}#${r}`:``,i;t[1]===e?i=t[2]:(i={mirrorRef:e},t[1]=e,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a={0:(0,X.jsx)(`code`,{})},t[3]=a):a=t[3];let s;return t[4]===i?s=t[5]:(s=(0,X.jsx)(hA,{tone:`placeholder`,children:(0,X.jsx)(o,{id:`92rbk2`,values:i,components:a})}),t[4]=i,t[5]=s),s}if(i.kind===`source-removed`){let e;t[6]===n?e=t[7]:(e={src:n},t[6]=n,t[7]=e);let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,X.jsx)(`span`,{className:`font-medium`}),1:(0,X.jsx)(`code`,{})},t[8]=r):r=t[8];let i;return t[9]===e?i=t[10]:(i=(0,X.jsx)(hA,{tone:`error`,children:(0,X.jsx)(o,{id:`Ud0Pj9`,values:e,components:r})}),t[9]=e,t[10]=i),i}if(i.kind===`anchor-not-found`){let e=`<MirrorSource id="${r}">`,i;t[11]!==e||t[12]!==n?(i={mirrorSourceTag:e,src:n},t[11]=e,t[12]=n,t[13]=i):i=t[13];let a;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(a={0:(0,X.jsx)(`span`,{className:`font-medium`}),1:(0,X.jsx)(`code`,{}),2:(0,X.jsx)(`code`,{})},t[14]=a):a=t[14];let s;return t[15]===i?s=t[16]:(s=(0,X.jsx)(hA,{tone:`error`,children:(0,X.jsx)(o,{id:`mqSwZH`,values:i,components:a})}),t[15]=i,t[16]=s),s}let a;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(qi,{className:`size-3`,"aria-hidden":`true`}),t[17]=a):a=t[17];let s;t[18]===n?s=t[19]:(s={src:n},t[18]=n,t[19]=s);let c;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,X.jsx)(`code`,{className:`font-mono`})},t[20]=c):c=t[20];let l;t[21]===s?l=t[22]:(l=(0,X.jsxs)(`div`,{className:`ok-mirror-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,"aria-hidden":`true`,children:[a,(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`wQp1V3`,values:s,components:c})})]}),t[21]=s,t[22]=l);let u;t[23]===i.html?u=t[24]:(u=(0,X.jsx)(`div`,{dangerouslySetInnerHTML:{__html:i.html}}),t[23]=i.html,t[24]=u);let d;return t[25]!==r||t[26]!==n||t[27]!==l||t[28]!==u?(d=(0,X.jsxs)(`div`,{className:`ok-mirror-resolved relative -mx-3 prose-no-margin rounded-md border border-dashed border-transparent px-3 py-2 transition-colors [.jsx-component-wrapper:hover_&]:border-border/40 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/40`,"data-mirror-src":n,"data-mirror-anchor":r,children:[l,u]}),t[25]=r,t[26]=n,t[27]=l,t[28]=u,t[29]=d):d=t[29],d}function _A(e){let t=(0,J.c)(15),{_:n}=i(),r=e.id??``,a;t[0]!==n||t[1]!==r?(a=r||n({id:`12F9WL`}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let s=a,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(Ki,{className:`size-3`,"aria-hidden":`true`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l={label:s},t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={0:(0,X.jsx)(`code`,{className:`font-mono`})},t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,X.jsxs)(`div`,{className:`ok-mirror-source-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,children:[c,(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`Zon_qG`,values:l,components:u})})]}),t[7]=l,t[8]=d);let f;t[9]===e.children?f=t[10]:(f=(0,X.jsx)(`div`,{children:e.children}),t[9]=e.children,t[10]=f);let p;return t[11]!==r||t[12]!==d||t[13]!==f?(p=(0,X.jsxs)(`div`,{className:`ok-mirror-source relative -mx-3 rounded-md border border-dashed border-transparent px-3 py-1 transition-colors [.jsx-component-wrapper:hover_&]:border-border/50 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/50`,"data-mirror-source-id":r,children:[d,f]}),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}var vA=24,yA=24,bA=12,xA=.1;function SA(e,t,n,r){if(n<=0&&(e===`fit-width`||e===`two-odd`||e===`two-even`)||r<=0&&e===`fit-height`)return 1;switch(e){case`fit-width`:return Math.max(xA,(n-vA)/t.naturalWidth);case`fit-height`:return Math.max(xA,(r-yA)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(xA,((n-vA)/2-bA)/t.naturalWidth)}}var CA=600,wA=.5,TA=3,EA=.25,DA=null;function OA(){return DA||(DA=(async()=>{let e=await n(()=>import(`./pdf-CtJiipL_.js`),__vite__mapDeps([24,1]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-BZq-wJdz.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),DA.catch(()=>{DA=null})),DA}function kA(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function AA(e){let t=(0,J.c)(96),n,r;if(t[0]!==e.anchor||t[1]!==e.fillContainer){let{height:i,viewerFragment:a}=pe(e.anchor);n=i===null?e.fillContainer?`100%`:`${CA}px`:`${i}px`,r=IA(a),t[0]=e.anchor,t[1]=e.fillContainer,t[2]=n,t[3]=r}else n=t[2],r=t[3];let a=r,s=(0,Y.useRef)(null),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,Y.useRef)(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[5]=u):u=t[5];let d=(0,Y.useRef)(u),f=(0,Y.useRef)(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[6]=p):p=t[6];let[m,h]=(0,Y.useState)(p),[g,_]=(0,Y.useState)(!0),[v,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(a??1),[S,C]=(0,Y.useState)(String(a??1)),[w,T]=(0,Y.useState)(1),[E,D]=(0,Y.useState)(`fit-width`),[O,k]=(0,Y.useState)(!1),[A,j]=(0,Y.useState)(!1),[M,N]=(0,Y.useState)(0),[P,F]=(0,Y.useState)(0),{_:I}=i(),L=m.length,ee,R;t[7]!==I||t[8]!==e.src?(ee=()=>{if(!e.src){_(!1);return}let t=Fe(e.src),n=!1,r=null;return _(!0),y(null),(async()=>{try{let e=await(await OA()).getDocument({url:t,isEvalSupported:!1}).promise;if(n){await e.destroy();return}r=e,f.current=e;let i=[];for(let t=1;t<=e.numPages;t++){if(n)return;let r=(await e.getPage(t)).getViewport({scale:1});i.push({pageNumber:t,naturalWidth:r.width,naturalHeight:r.height})}if(n)return;h(i)}catch(e){let t=e;if(n)return;y(t instanceof Error?t.message:I({id:`jRHdCz`})),_(!1)}})(),()=>{n=!0,r&&=(r.destroy(),null),f.current=null}},R=[e.src,I],t[7]=I,t[8]=e.src,t[9]=ee,t[10]=R):(ee=t[9],R=t[10]),(0,Y.useEffect)(ee,R);let z,B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>{let e=s.current;if(!e)return;let t=()=>{N(e.clientWidth),F(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},B=[],t[11]=z,t[12]=B):(z=t[11],B=t[12]),(0,Y.useEffect)(z,B);let V,H;t[13]!==I||t[14]!==P||t[15]!==M||t[16]!==E||t[17]!==m||t[18]!==w?(V=()=>{let e=f.current;if(!e||m.length===0||M===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=l.current[i.pageNumber-1];if(!a)continue;let o=SA(E,i,M,P)*w,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:u,viewport:c}),await n.promise,n=null)}t||_(!1)}catch(e){let n=e;if(t||kA(n))return;console.warn(`[Pdf] page render failed:`,n),y(n instanceof Error?n.message:I({id:`_TF8ep`})),_(!1)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},H=[m,E,w,M,P,I],t[13]=I,t[14]=P,t[15]=M,t[16]=E,t[17]=m,t[18]=w,t[19]=V,t[20]=H):(V=t[19],H=t[20]),(0,Y.useEffect)(V,H);let U,te;t[21]!==m||t[22]!==O?(U=()=>{if(!O)return;let e=f.current;if(!e||m.length===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=d.current[i.pageNumber-1];if(!a)continue;let o=120/i.naturalWidth,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let l=a.getContext(`2d`);l&&(l.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:l,viewport:c}),await n.promise,n=null)}}catch(e){let t=e;kA(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},te=[O,m],t[21]=m,t[22]=O,t[23]=U,t[24]=te):(U=t[23],te=t[24]),(0,Y.useEffect)(U,te);let ne,re;t[25]!==g||t[26]!==a?(ne=()=>{if(g||!a)return;let e=s.current,t=l.current[a-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},re=[g,a],t[25]=g,t[26]=a,t[27]=ne,t[28]=re):(ne=t[27],re=t[28]),(0,Y.useEffect)(ne,re);let ie,ae;t[29]===m?(ie=t[30],ae=t[31]):(ie=()=>{let e=s.current;if(!e||m.length===0)return;let t=!1,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let n=e.scrollTop,r=1;for(let t of m){let i=l.current[t.pageNumber-1];i&&i.offsetTop-e.offsetTop<=n+40&&(r=t.pageNumber)}x(r),C(String(r))}))};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},ae=[m],t[29]=m,t[30]=ie,t[31]=ae),(0,Y.useEffect)(ie,ae);let W,oe;t[32]===A?(W=t[33],oe=t[34]):(W=()=>{if(!A)return;let e=e=>{let t=e.target,n=s.current?.closest(`.ok-pdf`);if(!n||!t||!n.contains(t)){j(!1);return}let r=n.querySelector(`.ok-pdf-layout-menu`);r&&!r.contains(t)&&j(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},oe=[A],t[32]=A,t[33]=W,t[34]=oe),(0,Y.useEffect)(W,oe);let se;t[35]===L?se=t[36]:(se=e=>{let t=Math.max(1,Math.min(L||1,e));x(t),C(String(t));let n=s.current,r=l.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[35]=L,t[36]=se);let G=se,ce;t[37]!==b||t[38]!==G||t[39]!==S?(ce=()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)){C(String(b));return}G(e)},t[37]=b,t[38]=G,t[39]=S,t[40]=ce):ce=t[40];let le=ce,ue;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>T(PA),t[41]=ue):ue=t[41];let de=ue,fe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>T(NA),t[42]=fe):fe=t[42];let me=fe,he;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(he=e=>{D(e),j(!1),T(1)},t[43]=he):he=t[43];let ge=he,_e;t[44]===n?_e=t[45]:(_e={height:n},t[44]=n,t[45]=_e);let ve;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>k(MA),t[46]=ve):ve=t[46];let ye;t[47]!==I||t[48]!==O?(ye=I(O?{id:`JK-Ave`}:{id:`iEYxO4`}),t[47]=I,t[48]=O,t[49]=ye):ye=t[49];let be;t[50]===I?be=t[51]:(be=I({id:`zo3Dl7`}),t[50]=I,t[51]=be);let xe;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,X.jsx)(Ta,{size:14,"aria-hidden":`true`}),t[52]=xe):xe=t[52];let Se;t[53]!==O||t[54]!==ye||t[55]!==be?(Se=(0,X.jsx)(`button`,{type:`button`,onClick:ve,"aria-label":ye,"aria-pressed":O,className:`ok-pdf-btn`,title:be,children:xe}),t[53]=O,t[54]=ye,t[55]=be,t[56]=Se):Se=t[56];let Ce=e.title??`PDF`,we;t[57]===Ce?we=t[58]:(we=(0,X.jsx)(`span`,{className:`ok-pdf-title`,children:Ce}),t[57]=Ce,t[58]=we);let Te;t[59]!==I||t[60]!==A||t[61]!==E||t[62]!==S||t[63]!==le||t[64]!==L||t[65]!==w?(Te=L>0&&(0,X.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,X.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),le()},children:(0,X.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,className:`ok-pdf-page-input`,value:S,onChange:e=>C(e.target.value.replace(/[^0-9]/g,``)),onBlur:le,"aria-label":I({id:`xsZhu-`})})}),(0,X.jsx)(`span`,{className:`ok-pdf-page-of`,children:(0,X.jsx)(o,{id:`1GhYxC`,values:{totalPages:L}})}),(0,X.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,X.jsx)(`button`,{type:`button`,onClick:me,disabled:w<=wA,"aria-label":I({id:`FjkaiT`}),className:`ok-pdf-btn`,title:I({id:`FjkaiT`}),children:(0,X.jsx)(Ja,{size:14,"aria-hidden":`true`})}),(0,X.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(w*100),`%`]}),(0,X.jsx)(`button`,{type:`button`,onClick:de,disabled:w>=TA,"aria-label":I({id:`AWOSPo`}),className:`ok-pdf-btn`,title:I({id:`AWOSPo`}),children:(0,X.jsx)(qa,{size:14,"aria-hidden":`true`})}),(0,X.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,X.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>j(jA),"aria-label":I({id:`GQDSBN`}),"aria-haspopup":`menu`,"aria-expanded":A,className:`ok-pdf-btn`,title:I({id:`rdU729`}),children:(0,X.jsx)(Ri,{size:14,"aria-hidden":`true`})}),A&&(0,X.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,X.jsx)(FA,{label:I({id:`vIxrEk`}),active:E===`fit-width`,onSelect:()=>ge(`fit-width`)}),(0,X.jsx)(FA,{label:I({id:`YlDuro`}),active:E===`fit-height`,onSelect:()=>ge(`fit-height`)}),(0,X.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,X.jsx)(FA,{label:I({id:`BGHHtQ`}),active:E===`single`,onSelect:()=>ge(`single`)}),(0,X.jsx)(FA,{label:I({id:`xK291b`}),active:E===`two-odd`,onSelect:()=>ge(`two-odd`)}),(0,X.jsx)(FA,{label:I({id:`NSnIUP`}),active:E===`two-even`,onSelect:()=>ge(`two-even`)})]})]})]}),t[59]=I,t[60]=A,t[61]=E,t[62]=S,t[63]=le,t[64]=L,t[65]=w,t[66]=Te):Te=t[66];let Ee;t[67]!==Se||t[68]!==we||t[69]!==Te?(Ee=(0,X.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[Se,we,Te]}),t[67]=Se,t[68]=we,t[69]=Te,t[70]=Ee):Ee=t[70];let De;t[71]!==I||t[72]!==b||t[73]!==G||t[74]!==m||t[75]!==O?(De=O&&(0,X.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":I({id:`nzaV6Q`}),children:m.map((e,t)=>{let{pageNumber:n}=e;return(0,X.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":b===n||void 0,onClick:()=>G(n),"aria-label":I({id:`qioCwA`,values:{pageNumber:n}}),children:[(0,X.jsx)(`canvas`,{ref:e=>{d.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,X.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:n})]},n)})}),t[71]=I,t[72]=b,t[73]=G,t[74]=m,t[75]=O,t[76]=De):De=t[76];let Oe;t[77]===g?Oe=t[78]:(Oe=g&&(0,X.jsx)(`div`,{className:`ok-pdf-loading`,children:(0,X.jsx)(o,{id:`T-654M`})}),t[77]=g,t[78]=Oe);let ke;t[79]===v?ke=t[80]:(ke=v&&(0,X.jsx)(`div`,{className:`ok-pdf-error`,children:(0,X.jsx)(o,{id:`WamGNs`,values:{error:v}})}),t[79]=v,t[80]=ke);let Ae;t[81]!==I||t[82]!==L?(Ae=Array.from({length:L},(e,t)=>{let n=t+1;return(0,X.jsx)(`canvas`,{ref:e=>{l.current[t]=e},className:`ok-pdf-page`,"aria-label":I({id:`XtRoxT`,values:{pageNumber:n}})},n)}),t[81]=I,t[82]=L,t[83]=Ae):Ae=t[83];let je;t[84]!==E||t[85]!==Oe||t[86]!==ke||t[87]!==Ae?(je=(0,X.jsxs)(`div`,{className:`ok-pdf-pages`,ref:s,"data-layout":E,children:[Oe,ke,Ae]}),t[84]=E,t[85]=Oe,t[86]=ke,t[87]=Ae,t[88]=je):je=t[88];let Me;t[89]!==De||t[90]!==je?(Me=(0,X.jsxs)(`div`,{className:`ok-pdf-body`,children:[De,je]}),t[89]=De,t[90]=je,t[91]=Me):Me=t[91];let Ne;return t[92]!==_e||t[93]!==Ee||t[94]!==Me?(Ne=(0,X.jsxs)(`div`,{className:`ok-pdf`,style:_e,children:[Ee,Me]}),t[92]=_e,t[93]=Ee,t[94]=Me,t[95]=Ne):Ne=t[95],Ne}function jA(e){return!e}function MA(e){return!e}function NA(e){return Math.max(wA,+(e-EA).toFixed(2))}function PA(e){return Math.min(TA,+(e+EA).toFixed(2))}function FA(e){let t=(0,J.c)(10),n=e.active||void 0,r;t[0]===e.active?r=t[1]:(r=e.active&&(0,X.jsx)(tr,{size:14}),t[0]=e.active,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,X.jsx)(`span`,{className:`ok-pdf-menu-check`,"aria-hidden":`true`,children:r}),t[2]=r,t[3]=i);let a;return t[4]!==e.active||t[5]!==e.label||t[6]!==e.onSelect||t[7]!==n||t[8]!==i?(a=(0,X.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.active,className:`ok-pdf-menu-item`,"data-active":n,onClick:e.onSelect,children:[i,e.label]}),t[4]=e.active,t[5]=e.label,t[6]=e.onSelect,t[7]=n,t[8]=i,t[9]=a):a=t[9],a}function IA(e){if(!e)return null;for(let t of e.split(`&`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e)===`page`){let n=Number.parseInt(t.slice(e+1),10);if(!Number.isNaN(n)&&n>=1)return n}}return null}function LA(e){let t=(0,J.c)(10),{label:n,id:r,children:i}=e,a=(0,Y.useId)(),o;t[0]!==r||t[1]!==a?(o=r||`tab-panel-${a.replace(/:/g,``)}`,t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c=`${s}-tab`,l;t[3]===n?l=t[4]:(l=n?.trim()||`Tab`,t[3]=n,t[4]=l);let u=l,d;return t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==c?(d=(0,X.jsx)(`section`,{className:`tab-panel`,id:s,role:`tabpanel`,"aria-labelledby":c,"data-tab-label":u,"data-tab-id":s,children:i}),t[5]=i,t[6]=s,t[7]=u,t[8]=c,t[9]=d):d=t[9],d}var RA=`[data-component-type="tabs"]`,zA=`[data-node-view-content-react] > .react-renderer`;function BA(e){let t=e.closest(RA);return t?Array.from(e.querySelectorAll(zA)).filter(e=>e.parentElement?.closest(RA)===t).map((e,t)=>{let n=e.querySelector(`[data-tab-label]`);return{index:t,label:(n?.getAttribute(`data-tab-label`))?.trim()||`Tab ${t+1}`,panelId:n?.getAttribute(`data-tab-id`)??null}}):[]}function VA(e){let t=(0,J.c)(33),{id:n,children:r}=e,[a,o]=(0,Y.useState)(0),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Y.useState)(s),u=(0,Y.useRef)(null),d=(0,Y.useRef)(null),f=(0,Y.useRef)(0),p=rk(),m=p?.addChild!=null,{_:h}=i(),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=u.current;if(!e)return;let t=BA(e);l(e=>{if(e.length!==t.length)return t;for(let n=0;n<e.length;n++)if(e[n].label!==t[n].label||e[n].panelId!==t[n].panelId)return t;return e})},t[1]=g):g=t[1],(0,Y.useLayoutEffect)(g);let _,v;t[2]===c.length?(_=t[3],v=t[4]):(_=()=>{c.length>f.current&&c.length>0&&o(c.length-1),f.current=c.length},v=[c.length],t[2]=c.length,t[3]=_,t[4]=v),(0,Y.useLayoutEffect)(_,v);let y;t[5]===n?y=t[6]:(y=()=>{let e=()=>{let e=window.location.hash.slice(1);if(!e)return;if(n&&e===n){o(0);return}let t=u.current;if(!t)return;let r=BA(t).findIndex(t=>t.panelId===e);r<0||(o(r),queueMicrotask(()=>{t.ownerDocument.getElementById(e)?.scrollIntoView({block:`start`,behavior:`auto`})}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},t[5]=n,t[6]=y),(0,Y.useLayoutEffect)(y);let b=c.length===0?0:Math.min(Math.max(a,0),c.length-1),x;t[7]!==c.length||t[8]!==b?(x=e=>{if(c.length===0)return;let t=null;e.key===`ArrowRight`?t=(b+1)%c.length:e.key===`ArrowLeft`?t=(b-1+c.length)%c.length:e.key===`Home`?t=0:e.key===`End`&&(t=c.length-1),t!==null&&(e.preventDefault(),o(t),(d.current?.querySelectorAll(`[role="tab"]`))?.[t]?.focus())},t[7]=c.length,t[8]=b,t[9]=x):x=t[9];let S=x,C=n?`Tabs: ${n}`:`Tabs`,w;if(t[10]!==c||t[11]!==b){let e;t[13]===b?e=t[14]:(e=e=>(0,X.jsx)(`button`,{id:e.panelId?`${e.panelId}-tab`:void 0,type:`button`,role:`tab`,className:`tabs-strip-pill`,"data-active":e.index===b,"aria-selected":e.index===b,"aria-controls":e.panelId??void 0,tabIndex:e.index===b?0:-1,onMouseDown:UA,onClick:()=>o(e.index),children:e.label},e.index),t[13]=b,t[14]=e),w=c.map(e),t[10]=c,t[11]=b,t[12]=w}else w=t[12];let T;t[15]!==S||t[16]!==C||t[17]!==w?(T=(0,X.jsx)(`div`,{ref:d,role:`tablist`,"aria-label":C,className:`tabs-tablist`,onKeyDown:S,children:w}),t[15]=S,t[16]=C,t[17]=w,t[18]=T):T=t[18];let E;t[19]!==h||t[20]!==m||t[21]!==p?(E=m&&(0,X.jsx)(`button`,{type:`button`,className:`tabs-strip-add`,"aria-label":h({id:`hjO0Mq`}),title:h({id:`hjO0Mq`}),onMouseDown:HA,onClick:()=>p?.addChild?.(),"data-tabs-strip-add":``,children:`+`}),t[19]=h,t[20]=m,t[21]=p,t[22]=E):E=t[22];let D;t[23]!==E||t[24]!==T?(D=(0,X.jsxs)(`div`,{className:`tabs-strip`,contentEditable:!1,children:[T,E]}),t[23]=E,t[24]=T,t[25]=D):D=t[25];let O;t[26]!==r||t[27]!==b?(O=(0,X.jsx)(`div`,{ref:u,className:`tabs-content`,"data-active-index":b,children:r}),t[26]=r,t[27]=b,t[28]=O):O=t[28];let k;return t[29]!==n||t[30]!==D||t[31]!==O?(k=(0,X.jsxs)(`div`,{className:`tabs`,id:n,children:[D,O]}),t[29]=n,t[30]=D,t[31]=O,t[32]=k):k=t[32],k}function HA(e){return e.preventDefault()}function UA(e){return e.preventDefault()}var WA=typeof global<`u`&&{}.toString.call(global)===`[object global]`,GA=typeof Bun<`u`,KA=typeof Deno<`u`,qA=typeof WebSocketPair==`function`&&caches?.default!==void 0,JA=WA||GA||KA||qA;function YA(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function XA(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function ZA(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function QA(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function $A(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function ej(e){let t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``);for(let e of[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`])if(n.endsWith(e))return n;return`vimeo.com`}function tj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(ZA(r))return`https://vimeo.com/${r}`;if(QA(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}var nj=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(t=>{e[r](t,n)}),{cancel:()=>a.forEach(t=>e[i](t,n))}};function rj(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!e||!t||typeof t.querySelectorAll!=`function`)return null;let n=t.querySelectorAll(`iframe`);for(let t=0;t<n.length;t++)if(n[t]&&n[t].contentWindow===e)return n[t];return null}var ij=Array.prototype.indexOf!==void 0,aj=typeof window<`u`&&window.postMessage!==void 0;if(!JA&&(!ij||!aj))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var oj=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function sj(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},`x`,{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:oj);var cj=sj(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,oj,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},`x`,{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),lj=new WeakMap;function uj(e,t,n){let r=lj.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),lj.set(e.element,r)}function dj(e,t){return(lj.get(e.element)||{})[t]||[]}function fj(e,t,n){let r=lj.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],lj.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),lj.set(e.element,r),r[t]&&r[t].length===0}function pj(e,t){let n=dj(e,t);if(n.length<1)return!1;let r=n.shift();return fj(e,t,r),r}function mj(e,t){let n=lj.get(e);lj.set(t,n),lj.delete(e)}function hj(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function gj(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)return;let r={method:t};n!==void 0&&(r.value=n);let i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}function _j(e,t){t=hj(t);let n=[],r;if(t.event)t.event===`error`&&dj(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),fj(e,t.data.method,n)}),n=dj(e,`event:${t.event}`),r=t.data;else if(t.method){let i=pj(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(t=>{try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}var vj=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function yj(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vj.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function bj(e,t){let{html:n}=e;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);let r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function xj(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((r,i)=>{if(!QA(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${ej(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(let e in t)t.hasOwnProperty(e)&&(a+=`&${e}=${encodeURIComponent(t[e])}`);let o=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;o.open(`GET`,a,!0),o.onload=function(){if(o.status===404){i(Error(`“${e}” was not found.`));return}if(o.status===403){i(Error(`“${e}” is not embeddable.`));return}try{let t=JSON.parse(o.responseText);if(t.domain_status_code===403){bj(t,n),i(Error(`“${e}” is not embeddable.`));return}r(t)}catch(e){i(e)}},o.onerror=function(){let e=o.status?` (${o.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},o.send()})}function Sj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=e=>{`console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(e=>{try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;let t=yj(e);xj(tj(t),t,e).then(t=>bj(t,e)).catch(n)}catch(e){n(e)}})}function Cj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!QA(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?rj(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function wj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!QA(t.origin))return;let n=hj(t.data);if(!n||n.event!==`ready`)return;let r=t.source?rj(t.source,e):null;r&&$A(r.src)&&new Nj(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function Tj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;window.VimeoCheckedUrlTimeParam=!0;let t=e=>{`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,n=>{if(!QA(n.origin))return;let r=hj(n.data);if(!r||r.event!==`ready`)return;let i=n.source?rj(n.source,e):null;if(i&&$A(i.src)){let e=new Nj(i);e.getVideoId().then(t=>{let n=RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);if(n&&n[1]){let t=decodeURI(n[1]);e.setCurrentTime(t)}}).catch(t)}})}function Ej(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!QA(e.origin))return;let t=hj(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?rj(e.source):null;if(!n)return;let r=n.getAttribute(`allow`)||``;if(!r.includes(`encrypted-media`)){n.setAttribute(`allow`,`${r}; encrypted-media`);let e=new URL(n.getAttribute(`src`));e.searchParams.set(`forcereload`,`drm`),n.setAttribute(`src`,e.toString());return}}))}function Dj(){let e=function(){let e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};for(;n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request(t){return new Promise((r,i)=>{let a=function(){n.off(`fullscreenchange`,a),r()};n.on(`fullscreenchange`,a),t||=document.documentElement;let o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit(){return new Promise((t,r)=>{if(!n.isFullscreen){t();return}let i=function(){n.off(`fullscreenchange`,i),t()};n.on(`fullscreenchange`,i);let a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on(e,n){let r=t[e];r&&document.addEventListener(r,n)},off(e,n){let r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[e.fullscreenEnabled]}}}),n}var Oj={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},kj=class extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;super(),this.logger=r,this.init(t,e,{...Oj,...n})}disconnect(){this.dispatchEvent(new Event(`disconnect`))}async init(e,t,n){if(await this.waitForTOReadyState(e,`open`),n.role===`viewer`){await this.updatePlayer(e,t,n);let r=nj(e,`change`,()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener(`disconnect`,()=>{i.cancel(),r.cancel()})}else{await this.updateTimingObject(e,t);let n=nj(t,[`seeked`,`play`,`pause`,`ratechange`],()=>this.updateTimingObject(e,t),`on`,`off`);this.addEventListener(`disconnect`,()=>n.cancel())}}async updateTimingObject(e,t){let[n,r,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:r?0:i})}async updatePlayer(e,t,n){let{position:r,velocity:i}=e.query();typeof r==`number`&&t.setCurrentTime(r),typeof i==`number`&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async e=>{e.name===`NotAllowedError`&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(e=>console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){let{allowedDrift:r,maxAllowedDrift:i,minCheckInterval:a,maxRateAdjustment:o,maxTimeToCatchUp:s}=n,c=Math.min(s,Math.max(a,i))*1e3,l=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;let n=e.query().position-await t.getCurrentTime(),a=Math.abs(n);if(this.log(`Drift: ${n}`),a>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log(`Resync by currentTime`);else if(a>r){let e=a/s,r=o,i=e<r?(r-e)/2:r;await this.adjustSpeed(t,i*Math.sign(n)),this.log(`Resync by playbackRate`)}},u=setInterval(()=>l(),c);return{cancel:()=>clearInterval(u)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;let n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{let r=()=>{e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})};r()})}},Aj=new WeakMap,jj=new WeakMap,Mj={},Nj=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),e=e[0]),typeof document<`u`&&typeof e==`string`&&(e=document.getElementById(e)),!XA(e))throw TypeError(`You must pass either a valid element or a valid id.`);if(e.nodeName!==`IFRAME`){let t=e.querySelector(`iframe`);t&&(e=t)}if(e.nodeName===`IFRAME`&&!QA(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if(Aj.has(e))return Aj.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new cj((n,r)=>{if(this._onMessage=e=>{if(!QA(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=hj(e.data);if(t&&t.event===`error`&&t.data&&t.data.method===`ready`){let e=Error(t.data.message);e.name=t.data.name,r(e);return}let i=t&&t.event===`ready`,a=t&&t.method===`ping`;if(i||a){this.element.setAttribute(`data-ready`,`true`),n();return}_j(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=yj(e,t);xj(tj(n),n,e).then(t=>{let n=bj(t,e);return this.element=n,this._originalElement=e,mj(e,n),Aj.set(this.element,this),t}).catch(r)}});if(jj.set(this,n),Aj.set(this.element,this),this.element.nodeName===`IFRAME`&&gj(this,`ping`),Mj.isEnabled){let e=()=>Mj.exit();this.fullscreenchangeHandler=()=>{Mj.isFullscreen?uj(this,`event:exitFullscreen`,e):fj(this,`event:exitFullscreen`,e),this.ready().then(()=>{gj(this,`fullscreenchange`,Mj.isFullscreen)})},Mj.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return QA(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new cj((n,r)=>this.ready().then(()=>{uj(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),gj(this,e,t)}).catch(r))}get(e){return new cj((t,n)=>(e=YA(e,`get`),this.ready().then(()=>{uj(this,e,{resolve:t,reject:n}),gj(this,e)}).catch(n)))}set(e,t){return new cj((n,r)=>{if(e=YA(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{uj(this,e,{resolve:n,reject:r}),gj(this,e,t)}).catch(r)})}on(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);dj(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),uj(this,`event:${e}`,t)}off(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);fj(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=jj.get(this)||new cj((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return cj.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}removeCuePoint(e){return this.callMethod(`removeCuePoint`,e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod(`disableTextTrack`)}selectAudioTrack(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`selectAudioTrack`,{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod(`selectDefaultAudioTrack`)}pause(){return this.callMethod(`pause`)}play(){return this.callMethod(`play`)}requestFullscreen(){return Mj.isEnabled?Mj.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return Mj.isEnabled?Mj.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return Mj.isEnabled?cj.resolve(Mj.isFullscreen):this.get(`fullscreen`)}requestPictureInPicture(){return this.callMethod(`requestPictureInPicture`)}exitPictureInPicture(){return this.callMethod(`exitPictureInPicture`)}getPictureInPicture(){return this.get(`pictureInPicture`)}remotePlaybackPrompt(){return this.callMethod(`remotePlaybackPrompt`)}unload(){return this.callMethod(`unload`)}destroy(){return new cj(e=>{if(jj.delete(this),Aj.delete(this.element),this._originalElement&&(Aj.delete(this._originalElement),this._originalElement.removeAttribute(`data-vimeo-initialized`)),this.element&&this.element.nodeName===`IFRAME`&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName===`DIV`&&this.element.parentNode){this.element.removeAttribute(`data-vimeo-initialized`);let e=this.element.querySelector(`iframe`);e&&e.parentNode&&(e.parentNode.parentNode&&this._originalElement&&this._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}this._window.removeEventListener(`message`,this._onMessage),Mj.isEnabled&&Mj.off(`fullscreenchange`,this.fullscreenchangeHandler),e()})}getAutopause(){return this.get(`autopause`)}setAutopause(e){return this.set(`autopause`,e)}getBuffered(){return this.get(`buffered`)}getCameraProps(){return this.get(`cameraProps`)}setCameraProps(e){return this.set(`cameraProps`,e)}getChapters(){return this.get(`chapters`)}getCurrentChapter(){return this.get(`currentChapter`)}getColor(){return this.get(`color`)}getColors(){return cj.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}setColor(e){return this.set(`color`,e)}setColors(e){if(!Array.isArray(e))return new cj((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new cj(e=>e(null)),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return cj.all(n)}getCuePoints(){return this.get(`cuePoints`)}getCurrentTime(){return this.get(`currentTime`)}setCurrentTime(e){return this.set(`currentTime`,e)}getDuration(){return this.get(`duration`)}getEnded(){return this.get(`ended`)}getLoop(){return this.get(`loop`)}setLoop(e){return this.set(`loop`,e)}setMuted(e){return this.set(`muted`,e)}getMuted(){return this.get(`muted`)}getPaused(){return this.get(`paused`)}getPlaybackRate(){return this.get(`playbackRate`)}setPlaybackRate(e){return this.set(`playbackRate`,e)}getPlayed(){return this.get(`played`)}getQualities(){return this.get(`qualities`)}getQuality(){return this.get(`quality`)}setQuality(e){return this.set(`quality`,e)}getRemotePlaybackAvailability(){return this.get(`remotePlaybackAvailability`)}getRemotePlaybackState(){return this.get(`remotePlaybackState`)}getSeekable(){return this.get(`seekable`)}getSeeking(){return this.get(`seeking`)}getTextTracks(){return this.get(`textTracks`)}getAudioTracks(){return this.get(`audioTracks`)}getEnabledAudioTrack(){return this.get(`enabledAudioTrack`)}getDefaultAudioTrack(){return this.get(`defaultAudioTrack`)}getVideoEmbedCode(){return this.get(`videoEmbedCode`)}getVideoId(){return this.get(`videoId`)}getVideoTitle(){return this.get(`videoTitle`)}getVideoWidth(){return this.get(`videoWidth`)}getVideoHeight(){return this.get(`videoHeight`)}getVideoUrl(){return this.get(`videoUrl`)}getVolume(){return this.get(`volume`)}setVolume(e){return this.set(`volume`,e)}async setTimingSrc(e,t){if(!e)throw TypeError(`A Timing Object must be provided.`);await this.ready();let n=new kj(this,e,t);return gj(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>gj(this,`notifyTimingObjectDisconnect`)),n}};JA||(Mj=Dj(),Sj(),Cj(),wj(),Tj(),Ej());function Pj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fj(e,t)}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fj(e,t)}var Ij={play:`onPlay`,playing:`onPlaying`,pause:`onPause`,ended:`onEnd`,timeupdate:`onTimeUpdate`,progress:`onProgress`,seeked:`onSeeked`,texttrackchange:`onTextTrackChange`,cuechange:`onCueChange`,cuepoint:`onCuePoint`,volumechange:`onVolumeChange`,playbackratechange:`onPlaybackRateChange`,error:`onError`,loaded:`onLoaded`},Lj=function(e){function t(t){var n=e.call(this,t)||this;return n.refContainer=n.refContainer.bind(n),n}Pj(t,e);var n=t.prototype;return n.componentDidMount=function(){this.createPlayer()},n.componentDidUpdate=function(e){var t=this,n=Object.keys(this.props).filter(function(n){return t.props[n]!==e[n]});this.updateProps(n)},n.componentWillUnmount=function(){this.player.destroy()},n.getInitialOptions=function(){var e,t=this.props.video,n=/^https?:/i.test(t)?`url`:`id`;return e={},e[n]=t,e.width=this.props.width,e.height=this.props.height,e.autopause=this.props.autopause,e.autoplay=this.props.autoplay,e.byline=this.props.showByline,e.color=this.props.color,e.controls=this.props.controls,e.loop=this.props.loop,e.portrait=this.props.showPortrait,e.title=this.props.showTitle,e.muted=this.props.muted,e.background=this.props.background,e.responsive=this.props.responsive,e.dnt=this.props.dnt,e.speed=this.props.speed,e.keyboard=this.props.keyboard,e.pip=this.props.pip,e.playsinline=this.props.playsInline,e.quality=this.props.quality,e.texttrack=this.props.textTrack,e.transparent=this.props.transparent,e},n.updateProps=function(e){var t=this,n=this.player;e.forEach(function(e){var r=t.props[e];switch(e){case`autopause`:n.setAutopause(r);break;case`color`:n.setColor(r);break;case`loop`:n.setLoop(r);break;case`volume`:n.setVolume(r);break;case`paused`:n.getPaused().then(function(e){return r&&!e?n.pause():!r&&e?n.play():null});break;case`width`:case`height`:n.element[e]=r;break;case`video`:if(r){var i=t.props.start,a=n.loadVideo(r);typeof i==`number`&&a.then(function(){n.setCurrentTime(i)})}else n.unload();break;case`playbackRate`:n.setPlaybackRate(r);break;case`quality`:n.setQuality(r);break}})},n.createPlayer=function(){var e=this,t=this.props,n=t.start,r=t.volume,i=t.playbackRate;this.player=new Nj(this.container,this.getInitialOptions()),Object.keys(Ij).forEach(function(t){var n=Ij[t];e.player.on(t,function(t){var r=e.props[n];r&&r(t)})});var a=this.props,o=a.onError,s=a.onReady;this.player.ready().then(function(){s&&s(e.player)},function(e){if(o)o(e);else throw e}),typeof n==`number`&&this.player.setCurrentTime(n),typeof r==`number`&&this.updateProps([`volume`]),typeof i==`number`&&this.updateProps([`playbackRate`])},n.refContainer=function(e){this.container=e},n.render=function(){var e=this.props,t=e.id,n=e.className,r=e.style;return Y.createElement(`div`,{id:t,className:n,style:r,ref:this.refContainer})},t}(Y.Component);Lj.defaultProps={autopause:!0,autoplay:!1,showByline:!0,controls:!0,loop:!1,showPortrait:!0,showTitle:!0,muted:!1,background:!1,responsive:!1,dnt:!1,speed:!1,keyboard:!0,pip:!1,playsInline:!0,transparent:!0};var Rj={default:120,mqdefault:320,hqdefault:480,sddefault:640,maxresdefault:1280},zj=(e,t,n,r=`maxresdefault`)=>{let[i,a]=(0,Y.useState)(``);return(0,Y.useEffect)(()=>{let i=`https://img.youtube.com/${t}/${e}/${r}.${n}`,o=`https://img.youtube.com/${t}/${e}/hqdefault.${n}`,s=Rj[r],c=new Image;c.onload=()=>{c.width<s?a(o):a(i)},c.onerror=()=>a(o),c.src=i},[e,t,n,r]),i};function Bj(e,t,n,r,i){let a={"@context":`https://schema.org`,"@type":`VideoObject`,name:i?.name||t,thumbnailUrl:[i?.thumbnailUrl||n],embedUrl:i?.embedUrl||`${r}/embed/${e}`,contentUrl:i?.contentUrl||`https://www.youtube.com/watch?v=${e}`,...i?.description&&{description:i.description},...i?.uploadDate&&{uploadDate:i.uploadDate},...i?.duration&&{duration:i.duration}};return JSON.stringify(a)}function Vj(e,t){let[n,r]=Y.useState(!1),[i,a]=Y.useState(e.alwaysLoadIframe||!1),o=encodeURIComponent(e.id),s=typeof e.playlistCoverId==`string`?encodeURIComponent(e.playlistCoverId):null,c=e.title,l=e.poster||`hqdefault`,u=e.announce||`Watch`,d=e.alwaysLoadIframe?e.autoplay&&e.muted:!0,f=Y.useMemo(()=>{let t=new URLSearchParams({...e.muted?{mute:`1`}:{},...d?{autoplay:`1`}:{},...e.enableJsApi?{enablejsapi:`1`}:{},...e.enableJsApi&&typeof window<`u`?{origin:window.location.origin}:{},...e.playlist?{list:o}:{}});return e.params&&new URLSearchParams(e.params.startsWith(`&`)?e.params.slice(1):e.params).forEach((e,n)=>{t.append(n,e)}),t},[e.muted,d,e.enableJsApi,e.playlist,o,e.params]),p=Y.useMemo(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`,[e.cookie]),m=Y.useMemo(()=>e.playlist?`${p}/embed/videoseries?${f.toString()}`:`${p}/embed/${o}?${f.toString()}`,[e.playlist,p,o,f]),h=!e.thumbnail&&!e.playlist&&l===`maxresdefault`,g=e.webp?`webp`:`jpg`,_=e.webp?`vi_webp`:`vi`,v=h?zj(e.id,_,g,l):null,y=Y.useMemo(()=>e.thumbnail||v||`https://i.ytimg.com/${_}/${e.playlist?s:o}/${l}.${g}`,[e.thumbnail,v,_,e.playlist,s,o,l,g]),b=e.activatedClass||`lyt-activated`,x=e.adNetwork||!1,S=e.aspectHeight||9,C=e.aspectWidth||16,w=e.iframeClass||``,T=e.playerClass||`lty-playbtn`,E=e.wrapperClass||`yt-lite`,D=Y.useCallback(e.onIframeAdded||function(){},[e.onIframeAdded]),O=e.rel?`prefetch`:`preload`,k=e.containerElement||`article`,A=e.noscriptFallback!==!1,j=()=>{n||r(!0)},M=()=>{i||a(!0)};return Y.useEffect(()=>{i&&(D(),e.focusOnLoad&&typeof t==`object`&&t?.current&&t.current.focus())},[i,D,e.focusOnLoad,t]),Y.useEffect(()=>{if(!i||!e.enableJsApi||!(e.onReady||e.onStateChange||e.onError||e.onPlay||e.onPause||e.onEnd||e.onBuffering||e.onPlaybackRateChange||e.onPlaybackQualityChange))return;let n=!1,r=!1,a=r=>{if(r.origin!==`https://www.youtube.com`&&r.origin!==`https://www.youtube-nocookie.com`)return;let i;try{i=typeof r.data==`string`?JSON.parse(r.data):r.data}catch{return}switch(i.event){case`onReady`:n||(n=!0,e.onReady&&e.onReady({videoId:e.id,title:c}));break;case`infoDelivery`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate),i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break;case`onStateChange`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}break;case`onError`:if(i.info&&`errorCode`in i.info){let t=i.info.errorCode;e.onError&&e.onError(t)}break;case`onPlaybackRateChange`:i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate);break;case`onPlaybackQualityChange`:i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break}};window.addEventListener(`message`,a);let s=[],l=()=>{typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"listening","id":"`+o+`"}`,`*`)},u=()=>{r||(r=!0,l(),[100,300,600,1200,2400].forEach(e=>{s.push(setTimeout(l,e))}))};return typeof t==`object`&&t?.current?(t.current.addEventListener(`load`,u),t.current.contentDocument?.readyState===`complete`&&u()):[200,500,1e3,2e3,3e3].forEach(e=>{s.push(setTimeout(l,e))}),()=>{window.removeEventListener(`message`,a),s.forEach(clearTimeout),typeof t==`object`&&t?.current&&t.current.removeEventListener(`load`,u)}},[i,e.enableJsApi,e.onReady,e.onStateChange,e.onError,e.onPlay,e.onPause,e.onEnd,e.onBuffering,e.onPlaybackRateChange,e.onPlaybackQualityChange,e.stopOnEnd,e.id,o,c,t]),(0,X.jsxs)(X.Fragment,{children:[!e.lazyLoad&&(0,X.jsx)(`link`,{rel:O,href:y,as:`image`}),(0,X.jsx)(X.Fragment,{children:n&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`link`,{rel:`preconnect`,href:p}),(0,X.jsx)(`link`,{rel:`preconnect`,href:`https://www.google.com`}),x&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`link`,{rel:`preconnect`,href:`https://static.doubleclick.net`}),(0,X.jsx)(`link`,{rel:`preconnect`,href:`https://googleads.g.doubleclick.net`})]})]})}),e.seo&&!e.playlist&&(0,X.jsx)(`script`,{type:`application/ld+json`,dangerouslySetInnerHTML:{__html:Bj(e.id,c,y,p,e.seo)}}),A&&!e.playlist&&(0,X.jsx)(`noscript`,{children:(0,X.jsxs)(`a`,{href:`https://www.youtube.com/watch?v=${e.id}`,"aria-label":`Watch ${c} on YouTube`,children:[`Watch "`,c,`" on YouTube`]})}),(0,X.jsxs)(k,{onPointerOver:j,onClick:M,className:`${E} ${i?b:``}`,"data-title":c,role:!i&&!e.lazyLoad?`img`:void 0,"aria-label":i?void 0:`${c} - YouTube video preview`,style:{...!e.lazyLoad&&{backgroundImage:`url(${y})`},"--aspect-ratio":`${S/C*100}%`,...e.style||{}},children:[e.lazyLoad&&!i&&(0,X.jsx)(`img`,{src:y,alt:`${c} - YouTube thumbnail`,className:`lty-thumbnail`,loading:`lazy`}),e.playlist&&!i&&(0,X.jsx)(`div`,{className:`lty-playlist-icon`,"aria-hidden":`true`}),!(e.hideButtonOnActivate&&i)&&(0,X.jsx)(`button`,{type:`button`,className:T,"aria-label":`${u} ${c}`,"aria-hidden":i||void 0,tabIndex:i?-1:0,onClick:M,children:(0,X.jsx)(`span`,{className:`lty-visually-hidden`,children:u})}),i&&(0,X.jsx)(`iframe`,{ref:t,className:w,title:c,width:`560`,height:`315`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,src:m,referrerPolicy:e.referrerPolicy||`strict-origin-when-cross-origin`})]})]})}var Hj=Y.forwardRef(Vj);function Uj(e){return e!==!1}function Wj(e,t){let n=[];return t.startSeconds!==null&&n.push(`start=${t.startSeconds}`),e.controls===!1&&n.push(`controls=0`),e.loop===!0&&n.push(`loop=1`,`playlist=${t.id}`),e.playsinline===!0&&n.push(`playsinline=1`),n.length>0?n.join(`&`):void 0}function Gj(e){if(e.width!==void 0)return{width:e.width}}function Kj(e){if(!(e.width===void 0||e.height===void 0))return{aspectRatio:`${e.width} / ${e.height}`}}function qj(e){let t=(0,J.c)(23),n=(0,Y.useRef)(null),r=e.title??`Vimeo video player`,i;t[0]===r?i=t[1]:(i=e=>{let t=e;n.current=t,t.element&&(t.element.title=r)},t[0]=r,t[1]=i);let a=i,o,s;t[2]===r?(o=t[3],s=t[4]):(o=()=>{let e=n.current;e?.element&&(e.element.title=r)},s=[r],t[2]=r,t[3]=o,t[4]=s),(0,Y.useEffect)(o,s);let c;t[5]===e?c=t[6]:(c=Gj(e),t[5]=e,t[6]=c);let l=e.width===void 0,u=e.autoplay===!0,d=e.muted===!0,f=e.muted===!0?0:1,p=e.loop===!0,m=e.controls!==!1,h=e.playsinline!==!1,g;t[7]!==a||t[8]!==e.height||t[9]!==e.src||t[10]!==e.width||t[11]!==h||t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(g=(0,X.jsx)(Lj,{video:e.src,responsive:l,width:e.width,height:e.height,autoplay:u,muted:d,volume:f,loop:p,controls:m,playsInline:h,onReady:a}),t[7]=a,t[8]=e.height,t[9]=e.src,t[10]=e.width,t[11]=h,t[12]=l,t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=g):g=t[18];let _;return t[19]!==e.title||t[20]!==g||t[21]!==c?(_=(0,X.jsx)(`div`,{className:`ok-video ok-video-vimeo`,style:c,title:e.title,children:g}),t[19]=e.title,t[20]=g,t[21]=c,t[22]=_):_=t[22],_}function Jj(e){let t=(0,J.c)(17),n;t[0]===e.src?n=t[1]:(n=se(e.src),t[0]=e.src,t[1]=n);let r=n;if(!r)return null;let i;t[2]!==r.startRaw||t[3]!==e.autoplay||t[4]!==e.muted?(i=[],r.startRaw!==null&&i.push(`t=${r.startRaw}`),e.autoplay===!0&&i.push(`autoplay=true`),e.muted===!0&&i.push(`muted=true`),t[2]=r.startRaw,t[3]=e.autoplay,t[4]=e.muted,t[5]=i):i=t[5];let a=i.length>0?`https://www.loom.com/embed/${r.id}?${i.join(`&`)}`:`https://www.loom.com/embed/${r.id}`,o;t[6]===e?o=t[7]:(o=Gj(e),t[6]=e,t[7]=o);let s=e.title??`Loom video player`,c;t[8]!==a||t[9]!==e.height||t[10]!==e.width||t[11]!==s?(c=(0,X.jsx)(`iframe`,{className:`ok-video-loom-iframe`,src:a,title:s,width:e.width,height:e.height,allow:`autoplay; fullscreen`,referrerPolicy:`strict-origin-when-cross-origin`,allowFullScreen:!0}),t[8]=a,t[9]=e.height,t[10]=e.width,t[11]=s,t[12]=c):c=t[12];let l;return t[13]!==e.title||t[14]!==o||t[15]!==c?(l=(0,X.jsx)(`div`,{className:`ok-video ok-video-loom`,style:o,title:e.title,children:c}),t[13]=e.title,t[14]=o,t[15]=c,t[16]=l):l=t[16],l}function Yj(e){let t=(0,J.c)(29);if(e.src!==void 0&&tt(e.src)){let n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(Jj,{...e,src:e.src}),t[0]=e,t[1]=n),n}if(e.src!==void 0&&Ee(e.src)){let n;return t[2]===e?n=t[3]:(n=(0,X.jsx)(qj,{...e,src:e.src}),t[2]=e,t[3]=n),n}let n;if(t[4]!==e){n=Symbol.for(`react.early_return_sentinel`);bb0:{let r=e.src===void 0?null:L(e.src);if(r!==null){let i=e.autoplay===!0&&e.muted===!0,a=e.width!==void 0&&e.height!==void 0,o=Gj(e),s;t[6]===e.poster?s=t[7]:(s=e.poster===void 0?void 0:Fe(e.poster),t[6]=e.poster,t[7]=s);let c=(0,X.jsx)(Hj,{id:r.id,title:e.title??`YouTube video player`,cookie:!r.noCookie,params:Wj(e,r),muted:e.muted===!0,autoplay:e.autoplay===!0,alwaysLoadIframe:i,thumbnail:s,aspectWidth:a?Number(e.width):void 0,aspectHeight:a?Number(e.height):void 0,style:Kj(e)}),l;t[8]!==o||t[9]!==c?(l=(0,X.jsx)(`div`,{className:`ok-video ok-video-youtube`,style:o,children:c}),t[8]=o,t[9]=c,t[10]=l):l=t[10],n=l;break bb0}}t[4]=e,t[5]=n}else n=t[5];if(n!==Symbol.for(`react.early_return_sentinel`))return n;let r;t[11]===e.src?r=t[12]:(r=e.src===void 0?void 0:Fe(e.src),t[11]=e.src,t[12]=r);let i=e.title,a;t[13]===e.controls?a=t[14]:(a=Uj(e.controls),t[13]=e.controls,t[14]=a);let o;t[15]===e.poster?o=t[16]:(o=e.poster===void 0?void 0:Fe(e.poster),t[15]=e.poster,t[16]=o);let s;return t[17]!==e.autoplay||t[18]!==e.height||t[19]!==e.loop||t[20]!==e.muted||t[21]!==e.playsinline||t[22]!==e.preload||t[23]!==e.title||t[24]!==e.width||t[25]!==r||t[26]!==a||t[27]!==o?(s=(0,X.jsx)(`video`,{className:`ok-video`,src:r,title:i,controls:a,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:o,preload:e.preload,width:e.width,height:e.height}),t[17]=e.autoplay,t[18]=e.height,t[19]=e.loop,t[20]=e.muted,t[21]=e.playsinline,t[22]=e.preload,t[23]=e.title,t[24]=e.width,t[25]=r,t[26]=a,t[27]=o,t[28]=s):s=t[28],s}function Xj(e){let t=(0,J.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,X.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var Zj={Callout:ek,img:Xk,video:Yj,audio:YO,Pdf:AA,File:pk,Embed:dk,Accordion:qO,Tabs:VA,Tab:LA,Math:$k,MermaidFence:nA,Mirror:gA,MirrorSource:_A,"*":Xj};function Qj(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var $j=Pe(),eM=new Map;function tM(e){if(e.surface===`compat`){let t=Zj[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:Qj(e.props)}}let t=Zj[e.name];return t?{Component:t,reactNodePropNames:Qj(e.props)}:null}for(let[e,t]of $j.entries()){let n=tM(t);n&&eM.set(e,n)}function nM(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function rM(e){let t=$j.getOrWildcard(e),n=eM.get(t.name)??eM.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return nM(t,n)}function iM(){let e=[];for(let[t,n]of $j.entries()){if(t===`*`)continue;let r=eM.get(t);r&&e.push(nM(n,r))}return e}var aM=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,oM=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,sM={Callout:{description:{id:`322lyb`},props:{type:`note`,title:`Heads up`},children:`Callouts draw attention to key information.`},Accordion:{description:{id:`mWVJRX`},props:{title:`Click to expand`,defaultOpen:!0},children:`Hidden content goes here.`},img:{description:{id:`VUijjF`},props:{src:aM,alt:`Sample image`}},video:{description:{id:`e1hptq`},props:{controls:!0,poster:oM}},audio:{description:{id:`9jnjV0`},props:{controls:!0}},Math:{description:{id:`Y-Urt2`},props:{formula:`c = \\pm\\sqrt{a^2 + b^2}`}},Embed:{description:{id:`jTLWxh`},render:()=>(0,X.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`https://example.com/embed`})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-2`,children:[(0,X.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1.5 w-full rounded-sm bg-muted-foreground/20`}),(0,X.jsx)(`span`,{className:`h-1.5 w-5/6 rounded-sm bg-muted-foreground/20`}),(0,X.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]})]})},Pdf:{description:{id:`Fqr8BP`},render:()=>(0,X.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-muted/40 px-1.5 py-1`,children:[(0,X.jsxs)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 text-muted-foreground`,"aria-hidden":`true`,children:[(0,X.jsx)(`title`,{children:`Thumbnails`}),(0,X.jsx)(`rect`,{x:`1`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,X.jsx)(`rect`,{x:`7`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,X.jsx)(`rect`,{x:`1`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,X.jsx)(`rect`,{x:`7`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`})]}),(0,X.jsxs)(`span`,{className:`ml-1 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5 font-mono`,children:`2`}),(0,X.jsx)(`span`,{children:`/ 12`})]}),(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] font-mono text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`−`}),(0,X.jsx)(`span`,{children:`100%`}),(0,X.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`+`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 gap-1 p-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex w-6 flex-col gap-0.5`,children:[(0,X.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`}),(0,X.jsx)(`span`,{className:`h-3 rounded-sm border border-foreground/60 bg-background`}),(0,X.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1 rounded-sm bg-background p-1.5`,children:[(0,X.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-sm bg-foreground/50`}),(0,X.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1 w-5/6 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`h-1 w-2/3 rounded-sm bg-muted-foreground/30`})]})]})]})},MermaidFence:{description:{id:`z0a2EA`},render:()=>(0,X.jsxs)(`svg`,{viewBox:`0 0 200 120`,className:`h-full w-full text-foreground`,"aria-hidden":`true`,preserveAspectRatio:`xMidYMid meet`,children:[(0,X.jsx)(`title`,{children:`Mermaid flowchart preview`}),(0,X.jsx)(`defs`,{children:(0,X.jsx)(`marker`,{id:`mermaid-preview-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,X.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),(0,X.jsx)(`rect`,{x:`14`,y:`20`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,X.jsx)(`text`,{x:`42`,y:`38`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Start`}),(0,X.jsx)(`polygon`,{points:`100,18 140,50 100,82 60,50`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,X.jsx)(`text`,{x:`100`,y:`54`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Ready?`}),(0,X.jsx)(`rect`,{x:`130`,y:`84`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,X.jsx)(`text`,{x:`158`,y:`102`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`End`}),(0,X.jsx)(`line`,{x1:`70`,y1:`34`,x2:`80`,y2:`40`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,X.jsx)(`line`,{x1:`124`,y1:`62`,x2:`138`,y2:`82`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,X.jsx)(`text`,{x:`138`,y:`74`,fontSize:`8`,fill:`currentColor`,opacity:`0.6`,children:`yes`})]})},Tabs:{description:{id:`75Y1dk`},render:()=>(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex gap-1 border-b border-border pb-1`,children:[(0,X.jsx)(`span`,{className:`rounded-md bg-foreground/10 px-2 py-0.5 text-xs font-medium text-foreground`,children:`Tab 1`}),(0,X.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs text-muted-foreground`,children:`Tab 2`})]}),(0,X.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:(0,X.jsx)(o,{id:`m6YGpY`})})]})},Mirror:{description:{id:`8TLE9g`},render:()=>(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/40 px-2 py-1.5`,children:[(0,X.jsxs)(`span`,{className:`absolute -top-2 right-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(Yi,{className:`size-2.5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`EL_YRd`,components:{0:(0,X.jsx)(`code`,{className:`font-mono`})}})})]}),(0,X.jsx)(`span`,{className:`block h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`mt-1 block h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]}),(0,X.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,X.jsx)(o,{id:`qNOgUu`})})]})},MirrorSource:{description:{id:`-KCZ6n`},render:()=>(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/50 px-2 py-1.5`,children:[(0,X.jsxs)(`span`,{className:`absolute -top-2 left-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(Ki,{className:`size-2.5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`maDWIB`,components:{0:(0,X.jsx)(`code`,{className:`font-mono`})}})})]}),(0,X.jsx)(`span`,{className:`block h-1.5 w-4/5 rounded-sm bg-muted-foreground/30`}),(0,X.jsx)(`span`,{className:`mt-1 block h-1.5 w-3/5 rounded-sm bg-muted-foreground/20`})]}),(0,X.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,X.jsx)(o,{id:`emgiet`})})]})}};function cM(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function lM(e){let t=rM(e),n=cM(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var uM=new Set;function dM(e){uM.add(e)}function fM(e){if(typeof e==`number`)return uM.delete(e);let t=uM.values().next();return t.done?!1:(uM.delete(t.value),!0)}function pM(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(dM(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren&&e.commands.setTextSelection(t+2)}function mM(e){return t=>{let n=new WeakSet;t.state.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&n.add(t)});let r=lM(e.name);if(e.name===`Tabs`){let e=lM(`Tab`),t=lM(`Tab`),n=e.attrs,i=t.attrs;n.props={...n.props,label:`Tab 1`},i.props={...i.props,label:`Tab 2`},r.content=[e,t]}t.chain().focus().insertContent(r).run();let i=-1;t.state.doc.descendants((t,r)=>{if(i>=0)return!1;t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&!n.has(t)&&(i=r)}),!(i<0)&&pM(t,i,e)}}var hM=new Set([`File`,`Tab`]);function gM(){return[{name:`component-File`,label:B._({id:`J2eKUI`}),icon:ea,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",command:vM,preview:{description:B._({id:`t-JXbf`}),render:()=>(0,X.jsxs)(`div`,{className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5`,children:[(0,X.jsx)(ea,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:`quarterly-report.pdf`}),(0,X.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`1.4 MB`})]})}}]}function _M(){return[...iM().filter(e=>e.surface===`canonical`&&!hM.has(e.name)).map(e=>{let t=sM[e.name],n=e.Component,r=t?{description:B._(t.description),render:t.render??(()=>(0,X.jsx)(n,{...t.props,children:t.children}))}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:UO(e.icon),category:e.category??`content`,command:mM(e),aliases:e.searchTerms,description:e.description,preview:r}}),...gM()]}function vM(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`*/*`,t.style.display=`none`,t.addEventListener(`change`,()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;_O(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function yM(e,t){let n=SO.getState(e.state);if(!n)return null;for(let e of n.byId.values())if(e.markType===`link`&&e.from<=t&&t<e.to)return e.id;return null}function bM(){return[{name:`link`,label:B._({id:`yzF66j`}),icon:_a,category:`insert`,aliases:[`url`,`href`,`external`,`web`,`hyperlink`,`wiki`,`wikilink`,`[[`,`internal`,`page`,`backlink`,`cross-link`],description:`Link to a page or external URL`,preview:{description:B._({id:`5WDhAk`}),render:()=>(0,X.jsx)(`p`,{className:`leading-7 text-sm`,children:(0,X.jsx)(o,{id:`u-9fWA`,components:{0:(0,X.jsx)(`span`,{className:`font-medium text-azure-blue underline underline-offset-2 dark:text-sky-blue`})}})})},command:e=>{let t=e.state.selection.from;e.chain().focus().insertContent({type:`text`,text:`link`,marks:[{type:`link`,attrs:{href:``}}]}).run();let n=yM(e,t);n&&(bO(n),requestAnimationFrame(()=>{VO(e).setActiveNode(n)}))}},{name:`component-Tag`,label:B._({id:`UL8A9w`}),icon:oa,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",preview:{description:B._({id:`5ClEAu`}),render:()=>(0,X.jsx)(`p`,{className:`text-sm leading-7`,children:(0,X.jsx)(o,{id:`KZLdgR`,components:{0:(0,X.jsx)(`a`,{className:`tag pointer-events-none`})}})})},command:e=>{e.chain().insertTag(``).run()}}]}function xM(e,t){e.chain().focus().insertContent({type:`codeBlock`,attrs:{language:`html`,meta:`preview`},content:[{type:`text`,text:t}]}).run()}var SM=`<div style="padding:20px;font-family:system-ui,sans-serif;color:var(--foreground)">
7
7
  <h1 style="margin:0 0 8px;font-size:20px;font-weight:600">Hello, world!</h1>
8
8
  <p style="margin:0;color:var(--muted-foreground)">Edit this HTML — the preview updates live.</p>
9
9
  </div>`,CM={chart:{icon:Li,aliases:[`chart`,`bar`,`graph`,`plot`,`viz`,`data`,`embed`,`preview`],render:()=>(0,X.jsxs)(`div`,{className:`flex h-20 items-end gap-1.5`,children:[(0,X.jsx)(`div`,{className:`h-[45%] flex-1 rounded-t-sm bg-chart-1`}),(0,X.jsx)(`div`,{className:`h-[70%] flex-1 rounded-t-sm bg-chart-2`}),(0,X.jsx)(`div`,{className:`h-[90%] flex-1 rounded-t-sm bg-chart-3`}),(0,X.jsx)(`div`,{className:`h-[60%] flex-1 rounded-t-sm bg-chart-4`}),(0,X.jsx)(`div`,{className:`h-[80%] flex-1 rounded-t-sm bg-chart-5`})]})},"stat-cards":{icon:fa,aliases:[`stat`,`stats`,`metric`,`metrics`,`cards`,`kpi`,`embed`,`preview`],render:()=>(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex-1 rounded-md border border-border bg-card p-2`,children:[(0,X.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Users`}),(0,X.jsx)(`div`,{className:`text-sm font-bold text-card-foreground`,children:`12.4k`}),(0,X.jsx)(`div`,{className:`text-[10px] font-semibold text-chart-2`,children:`+8.2%`})]}),(0,X.jsxs)(`div`,{className:`flex-1 rounded-md border border-border bg-card p-2`,children:[(0,X.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Revenue`}),(0,X.jsx)(`div`,{className:`text-sm font-bold text-card-foreground`,children:`$48k`}),(0,X.jsx)(`div`,{className:`text-[10px] font-semibold text-chart-1`,children:`+3.1%`})]})]})},"custom-svg":{icon:Na,aliases:[`svg`,`vector`,`graphic`,`illustration`,`ring`,`embed`,`preview`],render:()=>(0,X.jsx)(`div`,{className:`flex items-center justify-center text-chart-1`,children:(0,X.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,"aria-hidden":`true`,children:[(0,X.jsx)(`circle`,{cx:`36`,cy:`36`,r:`28`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.15`,strokeWidth:`9`}),(0,X.jsx)(`circle`,{cx:`36`,cy:`36`,r:`28`,fill:`none`,stroke:`currentColor`,strokeWidth:`9`,strokeLinecap:`round`,strokeDasharray:`176`,strokeDashoffset:`53`,transform:`rotate(-90 36 36)`})]})})},"interactive-control":{icon:Fa,aliases:[`interactive`,`slider`,`control`,`widget`,`input`,`embed`,`preview`],render:()=>(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`div`,{className:`text-lg font-bold text-chart-1`,children:`$2,500`}),(0,X.jsxs)(`div`,{className:`relative h-1.5 rounded-full bg-muted`,children:[(0,X.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1/3 rounded-full bg-primary`}),(0,X.jsx)(`div`,{className:`-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/3 size-3 rounded-full bg-primary`})]}),(0,X.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Drag to adjust`})]})}};function wM(){return{name:`embed-starter-html`,label:B._({id:`FBknns`}),icon:Gi,category:`embed`,aliases:[`html`,`embed`,`preview`,`iframe`,`sandbox`,`web`,`snippet`],description:B._({id:`4niEzY`}),command:e=>xM(e,SM),preview:{description:B._({id:`rageVb`}),render:()=>(0,X.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,X.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`sandbox`})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-3`,children:[(0,X.jsx)(`span`,{className:`font-semibold text-foreground text-sm`,children:(0,X.jsx)(o,{id:`3HNlwb`})}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:(0,X.jsx)(o,{id:`bH382I`})})]})]})}}}function TM(){let e=Be.map(e=>{let t=CM[e.id];return{name:`embed-starter-${e.id}`,label:e.title,icon:t.icon,category:`embed`,command:t=>xM(t,e.html),aliases:t.aliases,description:e.description,preview:{description:e.description,render:t.render}}});return[wM(),...e]}function EM(){return[{name:`heading1`,label:B._({id:`lXKZGw`}),icon:sa,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:1}).run(),aliases:[`h1`],preview:{description:B._({id:`3J7d2N`}),render:()=>(0,X.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:(0,X.jsx)(o,{id:`lXKZGw`})})}},{name:`heading2`,label:B._({id:`El7NbA`}),icon:ca,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:2}).run(),aliases:[`h2`],preview:{description:B._({id:`LXdWeS`}),render:()=>(0,X.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:(0,X.jsx)(o,{id:`El7NbA`})})}},{name:`heading3`,label:B._({id:`SFN6dN`}),icon:la,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:3}).run(),aliases:[`h3`],preview:{description:B._({id:`g4XBm0`}),render:()=>(0,X.jsx)(`h3`,{className:`text-base font-semibold tracking-tight`,children:(0,X.jsx)(o,{id:`SFN6dN`})})}},{name:`bulletList`,label:B._({id:`s1c0ja`}),icon:ba,category:`basic`,command:e=>e.chain().focus().toggleBulletList().run(),aliases:[`ul`,`unordered`],preview:{description:B._({id:`fYjgXu`}),render:()=>(0,X.jsxs)(`ul`,{className:`list-disc pl-5 text-sm leading-7`,children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(o,{id:`FCxvG5`})}),(0,X.jsx)(`li`,{children:(0,X.jsx)(o,{id:`saIASg`})})]})}},{name:`orderedList`,label:B._({id:`Uci-Ph`}),icon:va,category:`basic`,command:e=>e.chain().focus().toggleOrderedList().run(),aliases:[`ol`,`numbered`],preview:{description:B._({id:`rXz97P`}),render:()=>(0,X.jsxs)(`ol`,{className:`list-decimal pl-5 text-sm leading-7`,children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(o,{id:`FCxvG5`})}),(0,X.jsx)(`li`,{children:(0,X.jsx)(o,{id:`saIASg`})})]})}},{name:`taskList`,label:B._({id:`G_686w`}),icon:ya,category:`basic`,command:e=>e.chain().focus().toggleTaskList().run(),aliases:[`todo`,`checklist`,`checkbox`],preview:{description:B._({id:`yutJKi`}),render:()=>(0,X.jsxs)(`ul`,{className:`space-y-1.5 text-sm`,children:[(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:!0,readOnly:!0,className:`size-3.5`}),(0,X.jsx)(`span`,{className:`text-muted-foreground line-through`,children:(0,X.jsx)(o,{id:`DPfwMq`})})]}),(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`checkbox`,readOnly:!0,className:`size-3.5`}),(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`rZ9HZq`})})]})]})}},{name:`blockquote`,label:B._({id:`ZhhOwV`}),icon:Aa,category:`basic`,command:e=>e.chain().focus().toggleBlockquote().run(),aliases:[`quote`],preview:{description:B._({id:`w7nm4K`}),render:()=>(0,X.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/40 pl-3 text-sm italic text-muted-foreground`,children:(0,X.jsx)(o,{id:`74-bX-`})})}},{name:`codeBlock`,label:B._({id:`N2eHWq`}),icon:Wi,category:`basic`,command:e=>e.chain().focus().toggleCodeBlock({language:`js`}).run(),aliases:[`code`,`fence`],preview:{description:B._({id:`XpIZmv`}),render:()=>(0,X.jsx)(`pre`,{className:`rounded-md bg-muted px-2.5 py-2 font-mono text-xs leading-5`,children:(0,X.jsx)(`code`,{children:`const greeting = "Hello";
@@ -11,7 +11,7 @@ console.log(greeting);`})})}},{name:`table`,label:B._({id:`4hJhzz`}),icon:Ra,cat
11
11
  `},l]}}var kN=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),AN=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),jN=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),MN=[...AN,...jN],NN=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),PN=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),FN=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),IN=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),LN=PN.concat(FN).sort().reverse();function RN(e){let t=kN(e),n=LN,r=`[\\w-]+`,i=`(`+r+`|@\\{[\\w-]+\\})`,a=[],o=[],s=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},c=function(e,t,n){return{className:e,begin:t,relevance:n}},l={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:NN.join(` `)},u={begin:`\\(`,end:`\\)`,contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s(`'`),s(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,u,c(`variable`,`@@?`+r,10),c(`variable`,`@\\{`+r+`\\}`),c(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:r+`\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let d=o.concat({begin:/\{/,end:/\}/,contains:a}),f={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(o)},p={begin:i+`\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+IN.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:o}}]},m={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:l,returnEnd:!0,contains:o,relevance:0}},h={className:`variable`,variants:[{begin:`@`+r+`\\s*:`,relevance:15},{begin:`@`+r}],starts:{end:`[;}]`,returnEnd:!0,contains:d}},g={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c(`keyword`,`all\\b`),c(`variable`,`@\\{`+r+`\\}`),{begin:`\\b(`+MN.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,c(`selector-tag`,i,0),c(`selector-id`,`#`+i),c(`selector-class`,`\\.`+i,0),c(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+PN.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+FN.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:`!important`},t.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,h,_,p,g,f,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function zN(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!`+t+`)`,`$`),e.COMMENT(`--`+t,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function BN(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function VN(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function HN(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function UN(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function WN(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
12
12
  ]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function GN(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function KN(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function qN(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function JN(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function YN(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function XN(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:[`alias`,`and`,`begin`,`BEGIN`,`break`,`case`,`class`,`defined`,`do`,`else`,`elsif`,`end`,`END`,`ensure`,`for`,`if`,`in`,`module`,`next`,`not`,`or`,`redo`,`require`,`rescue`,`retry`,`return`,`then`,`undef`,`unless`,`until`,`when`,`while`,`yield`,...[`include`,`extend`,`prepend`,`public`,`private`,`protected`,`raise`,`throw`]],built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function ZN(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}var QN=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),$N=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),eP=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),tP=[...$N,...eP],nP=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),rP=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),iP=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),aP=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function oP(e){let t=QN(e),n=iP,r=rP,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+tP.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+aP.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:nP.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function sP(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function cP(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function lP(e){return e?typeof e==`string`?e:e.source:null}function uP(e){return dP(`(?=`,e,`)`)}function dP(...e){return e.map(e=>lP(e)).join(``)}function fP(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function pP(...e){return`(`+(fP(e).capture?``:`?:`)+e.map(e=>lP(e)).join(`|`)+`)`}var mP=e=>dP(/\b/,e,/\w$/.test(e)?/\b/:/\B/),hP=[`Protocol`,`Type`].map(mP),gP=[`init`,`self`].map(mP),_P=[`Any`,`Self`],vP=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],yP=[`false`,`nil`,`true`],bP=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],xP=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],SP=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),CP=pP(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),wP=pP(CP,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),TP=dP(CP,wP,`*`),EP=pP(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),DP=pP(EP,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),OP=dP(EP,DP,`*`),kP=dP(/[A-Z]/,DP,`*`),AP=[`attached`,`autoclosure`,dP(/convention\(/,pP(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,dP(/objc\(/,OP,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],jP=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function MP(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,pP(...hP,...gP)],className:{2:`keyword`}},a={match:dP(/\./,pP(...vP)),relevance:0},o=vP.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:pP(...vP.filter(e=>typeof e!=`string`).concat(_P).map(mP),...gP)}]},c={$pattern:pP(/\b\w+/,/#\w+/),keyword:o.concat(xP),literal:yP},l=[i,a,s],u=[{match:dP(/\./,pP(...SP)),relevance:0},{className:`built_in`,match:dP(/\b/,pP(...SP),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:TP},{match:`\\.(\\.|${wP})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:dP(/\\/,e,/[0\\tnr"']/)},{match:dP(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:dP(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:dP(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:dP(e,/"""/),end:dP(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:dP(e,/"/),end:dP(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=dP(e,/\//),n=dP(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:dP(/`/,OP,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${DP}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:jP,contains:[...f,h,x]}]}},{scope:`keyword`,match:dP(/@/,pP(...AP),uP(pP(/\(/,/\s+/)))},{scope:`meta`,match:dP(/@/,OP)}],k={match:uP(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:dP(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,DP,`+`)},{className:`type`,match:kP,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:dP(/\s+&\s+/,uP(kP)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:dP(OP,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:pP(uP(dP(OP,/\s*:/)),uP(dP(OP,/\s+/,OP,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:OP}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,pP(E.match,OP,TP)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,TP],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,kP],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...bP,...yP],end:/}/},ee={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},R={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},z={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,OP,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:kP},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,ee,R,z,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var NP=`[A-Za-z$_][0-9A-Za-z$_]*`,PP=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),FP=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],IP=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),LP=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],RP=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],zP=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],BP=[].concat(RP,IP,LP);function VP(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=NP,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:NP,keyword:PP,literal:FP,built_in:BP,"variable.language":zP},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...IP,...LP]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...RP,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function HP(e){let t=e.regex,n=VP(e),r=NP,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:NP,keyword:PP.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:FP,built_in:BP.concat(i),"variable.language":zP},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function UP(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function WP(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function GP(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function KP(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var qP={arduino:WM,bash:GM,c:KM,cpp:qM,csharp:JM,css:rN,diff:iN,go:aN,graphql:oN,ini:sN,java:pN,javascript:SN,json:CN,kotlin:ON,less:RN,lua:zN,makefile:BN,markdown:VN,objectivec:HN,perl:UN,php:WN,"php-template":GN,plaintext:KN,python:qN,"python-repl":JN,r:YN,ruby:XN,rust:ZN,scss:oP,shell:sP,sql:cP,swift:MP,typescript:HP,vbnet:UP,wasm:WP,xml:GP,yaml:KP},JP=e(t(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),ee=I(`/\\*`,`\\*/`),R=I(`#`,`$`),z={scope:`number`,begin:D,relevance:0},B={scope:`number`,begin:O,relevance:0},V={scope:`number`,begin:k,relevance:0},H={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},U={scope:`title`,begin:T,relevance:0},te={scope:`title`,begin:E,relevance:0},ne={begin:`\\.\\s*`+E,relevance:0},re=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:V,BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:B,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:ne,NUMBER_MODE:z,NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:H,RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:U,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:te});function ie(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ae(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function W(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ie,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function G(e,t){e.relevance===void 0&&(e.relevance=1)}var ce=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},le=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function de(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,de(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return le.includes(e.toLowerCase())}var me={},he=e=>{console.error(e)},ge=(e,...t)=>{console.log(`WARN: ${e}`,...t)},_e=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},ve=Error();function ye(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function be(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw he(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ve;if(typeof e.beginScope!=`object`||e.beginScope===null)throw he(`beginScope must be object`),ve;ye(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function xe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw he(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ve;if(typeof e.endScope!=`object`||e.endScope===null)throw he(`endScope must be object`),ve;ye(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Se(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ce(e){Se(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),be(e),xe(e)}function we(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ae,se,Ce,ce].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[W,oe,G].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=de(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ee(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Te(e){return e?e.endsWithParent||Te(e.starts):!1}function Ee(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var De=`11.11.1`,Oe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ke=i,Ae=a,je=Symbol(`nomatch`),Me=7,Ne=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(ge(s.replace(`{}`,n[1])),ge(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(_e(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),_e(`10.7.0`,`Please use highlight(code, options) instead.
13
13
  https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};R(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,R(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Me&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(ee=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return je;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==je)return e}if(r.type===`illegal`&&a===``)return P+=`
14
- `,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=we(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,ee=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,ee?ee=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:ke(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:ke(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(R(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Oe(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),R(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ae(l,e)}let E=()=>{k(),_e(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),_e(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function ee(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function R(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function z(e){return _e(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),_e(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:z,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Ae,addPlugin:L,removePlugin:ee}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=De,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in re)typeof re[e]==`object`&&n(re[e]);return Object.assign(e,re),e},Pe=Ne({});Pe.newInstance=()=>Ne({}),t.exports=Pe,Pe.HighlightJS=Pe,Pe.default=Pe}))()).default,YP={},XP=`hljs-`;function ZP(e){let t=JP.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||YP,a=typeof i.prefix==`string`?i.prefix:XP;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:QP,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||YP).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var QP=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},$P=(0,Y.createContext)(null);function eF(){let e=(0,Y.use)($P);if(!e)throw Error(`useConfigContext must be used within <ConfigProvider />`);return e}function tF(e,t,n,r){console.warn(JSON.stringify({event:`ok-${e}-${n}`,docName:t,code:r?.code,reason:r?.reason??void 0}))}function nF(e,t,n,r){let i=new Xm,a=new qE({url:e,name:t,document:i,token:Z4(null,r,null),onDisconnect:({event:e})=>tF(`config-provider`,t,`disconnect`,e),onClose:({event:e})=>tF(`config-provider`,t,`close`,e)}),o=_(a,n);return{binding:o,config:o.current(),cleanup:()=>{o.dispose(),a.destroy(),i.destroy()}}}function rF(e,t){let n=new Xm,r=new qE({url:e,name:gt,document:n,token:Z4(null,t,null),onDisconnect:({event:e})=>tF(`okignore-provider`,gt,`disconnect`,e),onClose:({event:e})=>tF(`okignore-provider`,gt,`close`,e)}),i=Te(r);return{binding:i,provider:r,cleanup:()=>{i.dispose(),r.destroy(),n.destroy()}}}function iF(e){let t=(0,J.c)(27),{children:n}=e,{collabUrl:r}=M3(),i=Ax(),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(null),p,h;t[0]!==r||t[1]!==i?(p=()=>{if(r===null)return;let e=nF(r,hn,`user`,i),t=nF(r,Je,`project`,i),n=nF(r,on,`project-local`,i),a=rF(r,i);o({binding:e.binding,config:e.config,synced:e.binding.hasSynced()}),c({binding:t.binding,config:t.config}),u({binding:n.binding,config:n.config,synced:n.binding.hasSynced()}),f({binding:a.binding,synced:!1});let s=e.binding.subscribe(t=>{o(n=>n?.binding===e.binding?{...n,config:t}:n)}),l=e.binding.subscribeSynced(()=>{o(t=>t?.binding===e.binding?{...t,synced:!0}:t)}),d=t.binding.subscribe(e=>{c(n=>n?.binding===t.binding?{...n,config:e}:n)}),p=n.binding.subscribe(e=>{u(t=>t?.binding===n.binding?{...t,config:e}:t)}),m=n.binding.subscribeSynced(()=>{u(e=>e?.binding===n.binding?{...e,synced:!0}:e)}),h=()=>{f(e=>e?.binding===a.binding?{...e,synced:!0}:e)};return a.provider.on(`synced`,h),()=>{s(),l(),d(),p(),m(),a.provider.off(`synced`,h);for(let r of[e,t,n,a])try{r.cleanup()}catch(e){console.warn(JSON.stringify({event:`ok-config-provider-cleanup-error`,error:String(e)}))}o(t=>t?.binding===e.binding?null:t),c(e=>e?.binding===t.binding?null:e),u(e=>e?.binding===n.binding?null:e),f(e=>e?.binding===a.binding?null:e)}},h=[r,i],t[0]=r,t[1]=i,t[2]=p,t[3]=h):(p=t[2],h=t[3]),(0,Y.useEffect)(p,h);let g;t[4]!==l?.config||t[5]!==s||t[6]!==a?(g=a&&s?m(a.config,s.config,l?.config):null,t[4]=l?.config,t[5]=s,t[6]=a,t[7]=g):g=t[7];let _=g,{setTheme:v}=He(),y=_?.appearance?.theme,b,x;t[8]!==v||t[9]!==y?(b=()=>{(y===`light`||y===`dark`||y===`system`)&&v(y)},x=[y,v],t[8]=v,t[9]=y,t[10]=b,t[11]=x):(b=t[10],x=t[11]),(0,Y.useEffect)(b,x),Ya(typeof window<`u`?window.okDesktop:void 0,y??`system`);let S=a?.binding??null,C=a?.synced??!1,w=s?.binding??null,T=l?.binding??null,E=d?.binding??null,D=d?.synced??!1,O=a?.config??null,k=s?.config??null,A=l?.config??null,j=l?.synced??!1,M;t[12]!==_||t[13]!==E||t[14]!==D||t[15]!==O||t[16]!==k||t[17]!==A||t[18]!==j||t[19]!==S||t[20]!==C||t[21]!==w||t[22]!==T?(M={userBinding:S,userSynced:C,projectBinding:w,projectLocalBinding:T,okignoreBinding:E,okignoreSynced:D,userConfig:O,projectConfig:k,projectLocalConfig:A,projectLocalSynced:j,merged:_},t[12]=_,t[13]=E,t[14]=D,t[15]=O,t[16]=k,t[17]=A,t[18]=j,t[19]=S,t[20]=C,t[21]=w,t[22]=T,t[23]=M):M=t[23];let N=M,P;return t[24]!==n||t[25]!==N?(P=(0,X.jsx)($P,{value:N,children:n}),t[24]=n,t[25]=N,t[26]=P):P=t[26],P}var aF=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1),oF=new Set([`href`,`src`,`srcset`,`poster`,`formaction`,`xlink:href`]),sF=new Set([`aria-label`,`aria-description`,`title`]),cF=/(?:[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s"'<>]+|(?:javascript|vbscript|data|file|chrome-extension|moz-extension):[^\s"'<>]*)/gi,lF=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,uF=/\bexpression\s*\(/i,dF=/(oklch|oklab|lab|lch)\(\s*([^)]+)\s*\)/gi,fF=`data-clipboard-omit`;function pF(e){let t=e.trim();return t===``||Pt.test(t)?!0:xe(t)}function mF(e){let t=e.split(`,`);for(let e of t){let t=e.trim();if(t!==``&&!pF(t.split(/\s+/)[0]??``))return!1}return!0}function hF(e,t){let n=!1,r=e.replace(cF,e=>pF(e)?e:(n=!0,`[blocked]`));return t?.reportNoChange&&!n?null:r}function gF(e){let t=e.toLowerCase();return t.length>=3&&t.startsWith(`on`)}function _F(e){return e.length>1e4||lF.test(e)||uF.test(e)?``:e}function vF(e){let t=e.indexOf(`/`),n=(t===-1?e:e.slice(0,t)).trim(),r=t===-1?null:e.slice(t+1).trim(),i=n.split(/[\s,]+/).filter(e=>e.length>0);if(i.length!==3)return null;let a=yF(i[0],1),o=yF(i[1],1),s=yF(i[2],1);if(Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s))return null;let c=null;if(r!==null){if(c=yF(r,1),Number.isNaN(c))return null;c=Math.max(0,Math.min(1,c))}return[a,o,s,c]}function yF(e,t){return e===`none`?0:e.endsWith(`%`)?Number.parseFloat(e.slice(0,-1))/100*t:Number.parseFloat(e)}function bF(e,t,n){let r=n*Math.PI/180;return[e,t*Math.cos(r),t*Math.sin(r)]}function xF(e,t,n){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r**3,s=i**3,c=a**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]}function SF(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function CF(e){return Number.isFinite(e)?Math.max(0,Math.min(255,Math.round(e*255))):0}function wF(e,t,n,r){let i=e.toLowerCase(),a,o,s;i===`oklch`?[a,o,s]=bF(t,n,r):i===`oklab`?[a,o,s]=[t,n,r]:i===`lch`?[a,o,s]=bF(t/100,n/100,r):[a,o,s]=[t/100,n/100,r/100];let[c,l,u]=xF(a,o,s);return[CF(SF(c)),CF(SF(l)),CF(SF(u))]}function TF(e){if(e.length>1e4)return e;let t=e.toLowerCase();return!t.includes(`oklch`)&&!t.includes(`oklab`)&&!t.includes(`lab`)&&!t.includes(`lch`)?e:e.replace(dF,(e,t,n)=>{let r=vF(n);if(r===null)return e;let[i,a,o,s]=r,[c,l,u]=wF(t,i,a,o);return s===null?`rgb(${c}, ${l}, ${u})`:`rgba(${c}, ${l}, ${u}, ${s})`})}var EF=new Set([`mailto`,`tel`,`sms`,`ftp`,`ftps`]);function DF(e){let t=e.trim();if(t.startsWith(`#`))return{portable:!0};if(xe(t))return t.startsWith(`/`)?{portable:!1,reason:`server-absolute`}:{portable:!1,reason:`relative`};let n=new URL(t),r=n.protocol.slice(0,-1).toLowerCase();if(EF.has(r))return{portable:!0};if(r!==`http`&&r!==`https`)return{portable:!1,reason:`other`};let i=n.hostname.toLowerCase();if(i===``)return{portable:!1,reason:`other`};let a=i.endsWith(`.`)?i.slice(0,-1):i;if(a===`localhost`||a.endsWith(`.localhost`))return{portable:!1,reason:`localhost`};let o=i.startsWith(`[`)&&i.endsWith(`]`)?i.slice(1,-1):i;return aF.IPv4.isValid(o)?aF.IPv4.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:aF.IPv6.isValid(o)?aF.IPv6.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:{portable:!0}}function OF(e){if(!e)return`plaintext`;if(e.types.includes(`vscode-editor-data`))return`vscode`;if(e.types.includes(`text/x-gfm`))return`gfm`;let t=e.getData(`text/html`);return t?/data-pm-slice/i.test(t)?`pm-origin`:/docs-internal-guid-/i.test(t)?`gdocs`:/xmlns:o="urn:schemas-microsoft-com:office/i.test(t)||/<meta[^>]*Generator[^>]*Microsoft Word/i.test(t)?`word`:/class="gmail_|class='gmail_/i.test(t)?`gmail`:/notionvc:/i.test(t)?`notion`:/Cocoa HTML Writer/i.test(t)?`apple`:/c-message_kit__|c-message__|c-compose/i.test(t)?`slack`:/google-sheets-html-origin/i.test(t)?`gsheets`:/data-hovercard-type=/i.test(t)?`github`:`generic`:`plaintext`}var kF=250,AF=100;function jF(e,t){let n=performance.now()-e;n<(t.op===`paste`||t.op===`drop`?kF:AF)||console.warn(JSON.stringify({event:`clipboard-slow-op`,op:t.op,view:t.view,elapsedMs:Math.round(n),branch:t.branch,source:t.source,...t.htmlBytes==null?{}:{htmlBytes:t.htmlBytes}}))}function MF(e){console.warn(JSON.stringify({event:`clipboard-source-detected`,view:e.view,source:e.source,branch:e.branch}))}function NF(e){console.warn(JSON.stringify({event:`clipboard-html-conversion-failed`,view:e.view,stage:e.stage,source:e.source,...e.branch==null?{}:{branch:e.branch},reason:e.reason,...e.errorClass==null?{}:{errorClass:e.errorClass},...e.htmlBytes==null?{}:{htmlBytes:e.htmlBytes}}))}function PF(e){console.warn(JSON.stringify({event:`clipboard-serialize-failed`,view:e.view,kind:e.kind,reason:e.reason}))}function FF(e){console.warn(JSON.stringify({event:`clipboard-walker-fallback-fired`,descriptor:e.descriptor,view:e.view}))}function IF(e){console.warn(JSON.stringify({event:`clipboard-walker-non-portable-render-source-emitted`,descriptor:e.descriptor,view:e.view}))}function LF(e){console.warn(JSON.stringify({event:`clipboard-walker-url-blocked`,view:e.view,attr:e.attr,reason:e.reason}))}function RF(e){console.warn(JSON.stringify({event:`clipboard-walker-url-source-emitted`,view:e.view,tag:e.tag,class:e.class,reason:e.reason}))}function zF(e){console.warn(JSON.stringify({event:`clipboard-walker-url-classifier-failed`,view:e.view,tag:e.tag,phase:e.phase,...e.errorClass==null?{}:{errorClass:e.errorClass}}))}var BF=new Set;function VF(e){BF.has(e.lucideClass)||(BF.add(e.lucideClass),console.warn(JSON.stringify({event:`clipboard-walker-unmapped-lucide-detected`,view:e.view,lucideClass:e.lucideClass})))}function HF(e){console.warn(JSON.stringify({event:`clipboard-chunked-insert-failed`,view:e.view,chunksCompleted:e.chunksCompleted,totalChunks:e.totalChunks,bytesWritten:e.bytesWritten,bytesRemaining:e.bytesRemaining,reason:e.reason}))}function UF(e){if(e instanceof ve)return`HtmlPayloadTooLargeError`;if(e instanceof un)return`ChunkedInsertError`;if(e instanceof Error&&e.name&&e.name!==`Error`)return e.name}var WF=/^```/m,GF=/^#{1,6} /m,KF=/^[-*+] /m,qF=/^\d+[.)] /m,JF=/\[[^\]\n]+\]\([^)\n]+\)/,YF=/^\|.*\|$/m,XF=/^\|?\s*(:?-+:?)(\s*\|\s*:?-+:?)+\s*\|?$/m,ZF=/\$\$[\s\S]+?\$\$/,QF=/^> /m,$F=/`[^`\n]+`/,eI=/\*\*[^*\n]+\*\*/,tI=/__[^_\n]+__/,nI=/~~[^~\n]+~~/,rI=/<[A-Z]\w*[\s/>]/,iI=/<[a-z]+\s+\w+="[^"]*"/,aI=/<[a-z]+>[^<\n]*<\/[a-z]+>/,oI=/^.+\n[=-]+$/m,sI=/(^|\s)\*[^*\s\n][^*\n]*[^*\s\n]\*(\s|$)/m,cI=/(^|\s)_[^_\s\n][^_\n]*[^_\s\n]_(\s|$)/m,lI=/^~~~/m,uI=/\\[\\`*_{}[\]<>()#+\-.!|]/,dI=256*1024,fI=32*1024;function pI(e){return e.length<=dI?e:`${e.slice(0,fI)}\n${e.slice(-fI)}`}function mI(e){if(!e)return!1;let t=pI(e),n=0;WF.test(t)&&n++,GF.test(t)&&n++,KF.test(t)&&n++,qF.test(t)&&n++,JF.test(t)&&n++,YF.test(t)&&XF.test(t)&&n++,ZF.test(t)&&n++,QF.test(t)&&n++,$F.test(t)&&n++,(eI.test(t)||tI.test(t)||nI.test(t))&&n++,rI.test(t)&&n++,iI.test(t)&&n++,aI.test(t)&&n++,oI.test(t)&&n++,sI.test(t)&&n++,cI.test(t)&&n++,lI.test(t)&&n++,uI.test(t)&&n++;let r=t.split(`
14
+ `,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=we(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,ee=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,ee?ee=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:ke(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:ke(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(R(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Oe(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),R(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ae(l,e)}let E=()=>{k(),_e(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),_e(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function ee(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function R(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function z(e){return _e(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),_e(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:z,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Ae,addPlugin:L,removePlugin:ee}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=De,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in re)typeof re[e]==`object`&&n(re[e]);return Object.assign(e,re),e},Pe=Ne({});Pe.newInstance=()=>Ne({}),t.exports=Pe,Pe.HighlightJS=Pe,Pe.default=Pe}))()).default,YP={},XP=`hljs-`;function ZP(e){let t=JP.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||YP,a=typeof i.prefix==`string`?i.prefix:XP;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:QP,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||YP).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var QP=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},$P=(0,Y.createContext)(null);function eF(){let e=(0,Y.use)($P);if(!e)throw Error(`useConfigContext must be used within <ConfigProvider />`);return e}function tF(e,t,n,r){console.warn(JSON.stringify({event:`ok-${e}-${n}`,docName:t,code:r?.code,reason:r?.reason??void 0}))}function nF(e,t,n,r){let i=new Xm,a=new qE({url:e,name:t,document:i,token:e3(null,r,null),onDisconnect:({event:e})=>tF(`config-provider`,t,`disconnect`,e),onClose:({event:e})=>tF(`config-provider`,t,`close`,e)}),o=_(a,n);return{binding:o,config:o.current(),cleanup:()=>{o.dispose(),a.destroy(),i.destroy()}}}function rF(e,t){let n=new Xm,r=new qE({url:e,name:gt,document:n,token:e3(null,t,null),onDisconnect:({event:e})=>tF(`okignore-provider`,gt,`disconnect`,e),onClose:({event:e})=>tF(`okignore-provider`,gt,`close`,e)}),i=Te(r);return{binding:i,provider:r,cleanup:()=>{i.dispose(),r.destroy(),n.destroy()}}}function iF(e){let t=(0,J.c)(27),{children:n}=e,{collabUrl:r}=F3(),i=Ax(),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(null),p,h;t[0]!==r||t[1]!==i?(p=()=>{if(r===null)return;let e=nF(r,hn,`user`,i),t=nF(r,Je,`project`,i),n=nF(r,on,`project-local`,i),a=rF(r,i);o({binding:e.binding,config:e.config,synced:e.binding.hasSynced()}),c({binding:t.binding,config:t.config}),u({binding:n.binding,config:n.config,synced:n.binding.hasSynced()}),f({binding:a.binding,synced:!1});let s=e.binding.subscribe(t=>{o(n=>n?.binding===e.binding?{...n,config:t}:n)}),l=e.binding.subscribeSynced(()=>{o(t=>t?.binding===e.binding?{...t,synced:!0}:t)}),d=t.binding.subscribe(e=>{c(n=>n?.binding===t.binding?{...n,config:e}:n)}),p=n.binding.subscribe(e=>{u(t=>t?.binding===n.binding?{...t,config:e}:t)}),m=n.binding.subscribeSynced(()=>{u(e=>e?.binding===n.binding?{...e,synced:!0}:e)}),h=()=>{f(e=>e?.binding===a.binding?{...e,synced:!0}:e)};return a.provider.on(`synced`,h),()=>{s(),l(),d(),p(),m(),a.provider.off(`synced`,h);for(let r of[e,t,n,a])try{r.cleanup()}catch(e){console.warn(JSON.stringify({event:`ok-config-provider-cleanup-error`,error:String(e)}))}o(t=>t?.binding===e.binding?null:t),c(e=>e?.binding===t.binding?null:e),u(e=>e?.binding===n.binding?null:e),f(e=>e?.binding===a.binding?null:e)}},h=[r,i],t[0]=r,t[1]=i,t[2]=p,t[3]=h):(p=t[2],h=t[3]),(0,Y.useEffect)(p,h);let g;t[4]!==l?.config||t[5]!==s||t[6]!==a?(g=a&&s?m(a.config,s.config,l?.config):null,t[4]=l?.config,t[5]=s,t[6]=a,t[7]=g):g=t[7];let _=g,{setTheme:v}=He(),y=_?.appearance?.theme,b,x;t[8]!==v||t[9]!==y?(b=()=>{(y===`light`||y===`dark`||y===`system`)&&v(y)},x=[y,v],t[8]=v,t[9]=y,t[10]=b,t[11]=x):(b=t[10],x=t[11]),(0,Y.useEffect)(b,x),Ya(typeof window<`u`?window.okDesktop:void 0,y??`system`);let S=a?.binding??null,C=a?.synced??!1,w=s?.binding??null,T=l?.binding??null,E=d?.binding??null,D=d?.synced??!1,O=a?.config??null,k=s?.config??null,A=l?.config??null,j=l?.synced??!1,M;t[12]!==_||t[13]!==E||t[14]!==D||t[15]!==O||t[16]!==k||t[17]!==A||t[18]!==j||t[19]!==S||t[20]!==C||t[21]!==w||t[22]!==T?(M={userBinding:S,userSynced:C,projectBinding:w,projectLocalBinding:T,okignoreBinding:E,okignoreSynced:D,userConfig:O,projectConfig:k,projectLocalConfig:A,projectLocalSynced:j,merged:_},t[12]=_,t[13]=E,t[14]=D,t[15]=O,t[16]=k,t[17]=A,t[18]=j,t[19]=S,t[20]=C,t[21]=w,t[22]=T,t[23]=M):M=t[23];let N=M,P;return t[24]!==n||t[25]!==N?(P=(0,X.jsx)($P,{value:N,children:n}),t[24]=n,t[25]=N,t[26]=P):P=t[26],P}var aF=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1),oF=new Set([`href`,`src`,`srcset`,`poster`,`formaction`,`xlink:href`]),sF=new Set([`aria-label`,`aria-description`,`title`]),cF=/(?:[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s"'<>]+|(?:javascript|vbscript|data|file|chrome-extension|moz-extension):[^\s"'<>]*)/gi,lF=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,uF=/\bexpression\s*\(/i,dF=/(oklch|oklab|lab|lch)\(\s*([^)]+)\s*\)/gi,fF=`data-clipboard-omit`;function pF(e){let t=e.trim();return t===``||Pt.test(t)?!0:xe(t)}function mF(e){let t=e.split(`,`);for(let e of t){let t=e.trim();if(t!==``&&!pF(t.split(/\s+/)[0]??``))return!1}return!0}function hF(e,t){let n=!1,r=e.replace(cF,e=>pF(e)?e:(n=!0,`[blocked]`));return t?.reportNoChange&&!n?null:r}function gF(e){let t=e.toLowerCase();return t.length>=3&&t.startsWith(`on`)}function _F(e){return e.length>1e4||lF.test(e)||uF.test(e)?``:e}function vF(e){let t=e.indexOf(`/`),n=(t===-1?e:e.slice(0,t)).trim(),r=t===-1?null:e.slice(t+1).trim(),i=n.split(/[\s,]+/).filter(e=>e.length>0);if(i.length!==3)return null;let a=yF(i[0],1),o=yF(i[1],1),s=yF(i[2],1);if(Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s))return null;let c=null;if(r!==null){if(c=yF(r,1),Number.isNaN(c))return null;c=Math.max(0,Math.min(1,c))}return[a,o,s,c]}function yF(e,t){return e===`none`?0:e.endsWith(`%`)?Number.parseFloat(e.slice(0,-1))/100*t:Number.parseFloat(e)}function bF(e,t,n){let r=n*Math.PI/180;return[e,t*Math.cos(r),t*Math.sin(r)]}function xF(e,t,n){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r**3,s=i**3,c=a**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]}function SF(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function CF(e){return Number.isFinite(e)?Math.max(0,Math.min(255,Math.round(e*255))):0}function wF(e,t,n,r){let i=e.toLowerCase(),a,o,s;i===`oklch`?[a,o,s]=bF(t,n,r):i===`oklab`?[a,o,s]=[t,n,r]:i===`lch`?[a,o,s]=bF(t/100,n/100,r):[a,o,s]=[t/100,n/100,r/100];let[c,l,u]=xF(a,o,s);return[CF(SF(c)),CF(SF(l)),CF(SF(u))]}function TF(e){if(e.length>1e4)return e;let t=e.toLowerCase();return!t.includes(`oklch`)&&!t.includes(`oklab`)&&!t.includes(`lab`)&&!t.includes(`lch`)?e:e.replace(dF,(e,t,n)=>{let r=vF(n);if(r===null)return e;let[i,a,o,s]=r,[c,l,u]=wF(t,i,a,o);return s===null?`rgb(${c}, ${l}, ${u})`:`rgba(${c}, ${l}, ${u}, ${s})`})}var EF=new Set([`mailto`,`tel`,`sms`,`ftp`,`ftps`]);function DF(e){let t=e.trim();if(t.startsWith(`#`))return{portable:!0};if(xe(t))return t.startsWith(`/`)?{portable:!1,reason:`server-absolute`}:{portable:!1,reason:`relative`};let n=new URL(t),r=n.protocol.slice(0,-1).toLowerCase();if(EF.has(r))return{portable:!0};if(r!==`http`&&r!==`https`)return{portable:!1,reason:`other`};let i=n.hostname.toLowerCase();if(i===``)return{portable:!1,reason:`other`};let a=i.endsWith(`.`)?i.slice(0,-1):i;if(a===`localhost`||a.endsWith(`.localhost`))return{portable:!1,reason:`localhost`};let o=i.startsWith(`[`)&&i.endsWith(`]`)?i.slice(1,-1):i;return aF.IPv4.isValid(o)?aF.IPv4.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:aF.IPv6.isValid(o)?aF.IPv6.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:{portable:!0}}function OF(e){if(!e)return`plaintext`;if(e.types.includes(`vscode-editor-data`))return`vscode`;if(e.types.includes(`text/x-gfm`))return`gfm`;let t=e.getData(`text/html`);return t?/data-pm-slice/i.test(t)?`pm-origin`:/docs-internal-guid-/i.test(t)?`gdocs`:/xmlns:o="urn:schemas-microsoft-com:office/i.test(t)||/<meta[^>]*Generator[^>]*Microsoft Word/i.test(t)?`word`:/class="gmail_|class='gmail_/i.test(t)?`gmail`:/notionvc:/i.test(t)?`notion`:/Cocoa HTML Writer/i.test(t)?`apple`:/c-message_kit__|c-message__|c-compose/i.test(t)?`slack`:/google-sheets-html-origin/i.test(t)?`gsheets`:/data-hovercard-type=/i.test(t)?`github`:`generic`:`plaintext`}var kF=250,AF=100;function jF(e,t){let n=performance.now()-e;n<(t.op===`paste`||t.op===`drop`?kF:AF)||console.warn(JSON.stringify({event:`clipboard-slow-op`,op:t.op,view:t.view,elapsedMs:Math.round(n),branch:t.branch,source:t.source,...t.htmlBytes==null?{}:{htmlBytes:t.htmlBytes}}))}function MF(e){console.warn(JSON.stringify({event:`clipboard-source-detected`,view:e.view,source:e.source,branch:e.branch}))}function NF(e){console.warn(JSON.stringify({event:`clipboard-html-conversion-failed`,view:e.view,stage:e.stage,source:e.source,...e.branch==null?{}:{branch:e.branch},reason:e.reason,...e.errorClass==null?{}:{errorClass:e.errorClass},...e.htmlBytes==null?{}:{htmlBytes:e.htmlBytes}}))}function PF(e){console.warn(JSON.stringify({event:`clipboard-serialize-failed`,view:e.view,kind:e.kind,reason:e.reason}))}function FF(e){console.warn(JSON.stringify({event:`clipboard-walker-fallback-fired`,descriptor:e.descriptor,view:e.view}))}function IF(e){console.warn(JSON.stringify({event:`clipboard-walker-non-portable-render-source-emitted`,descriptor:e.descriptor,view:e.view}))}function LF(e){console.warn(JSON.stringify({event:`clipboard-walker-url-blocked`,view:e.view,attr:e.attr,reason:e.reason}))}function RF(e){console.warn(JSON.stringify({event:`clipboard-walker-url-source-emitted`,view:e.view,tag:e.tag,class:e.class,reason:e.reason}))}function zF(e){console.warn(JSON.stringify({event:`clipboard-walker-url-classifier-failed`,view:e.view,tag:e.tag,phase:e.phase,...e.errorClass==null?{}:{errorClass:e.errorClass}}))}var BF=new Set;function VF(e){BF.has(e.lucideClass)||(BF.add(e.lucideClass),console.warn(JSON.stringify({event:`clipboard-walker-unmapped-lucide-detected`,view:e.view,lucideClass:e.lucideClass})))}function HF(e){console.warn(JSON.stringify({event:`clipboard-chunked-insert-failed`,view:e.view,chunksCompleted:e.chunksCompleted,totalChunks:e.totalChunks,bytesWritten:e.bytesWritten,bytesRemaining:e.bytesRemaining,reason:e.reason}))}function UF(e){if(e instanceof ve)return`HtmlPayloadTooLargeError`;if(e instanceof un)return`ChunkedInsertError`;if(e instanceof Error&&e.name&&e.name!==`Error`)return e.name}var WF=/^```/m,GF=/^#{1,6} /m,KF=/^[-*+] /m,qF=/^\d+[.)] /m,JF=/\[[^\]\n]+\]\([^)\n]+\)/,YF=/^\|.*\|$/m,XF=/^\|?\s*(:?-+:?)(\s*\|\s*:?-+:?)+\s*\|?$/m,ZF=/\$\$[\s\S]+?\$\$/,QF=/^> /m,$F=/`[^`\n]+`/,eI=/\*\*[^*\n]+\*\*/,tI=/__[^_\n]+__/,nI=/~~[^~\n]+~~/,rI=/<[A-Z]\w*[\s/>]/,iI=/<[a-z]+\s+\w+="[^"]*"/,aI=/<[a-z]+>[^<\n]*<\/[a-z]+>/,oI=/^.+\n[=-]+$/m,sI=/(^|\s)\*[^*\s\n][^*\n]*[^*\s\n]\*(\s|$)/m,cI=/(^|\s)_[^_\s\n][^_\n]*[^_\s\n]_(\s|$)/m,lI=/^~~~/m,uI=/\\[\\`*_{}[\]<>()#+\-.!|]/,dI=256*1024,fI=32*1024;function pI(e){return e.length<=dI?e:`${e.slice(0,fI)}\n${e.slice(-fI)}`}function mI(e){if(!e)return!1;let t=pI(e),n=0;WF.test(t)&&n++,GF.test(t)&&n++,KF.test(t)&&n++,qF.test(t)&&n++,JF.test(t)&&n++,YF.test(t)&&XF.test(t)&&n++,ZF.test(t)&&n++,QF.test(t)&&n++,$F.test(t)&&n++,(eI.test(t)||tI.test(t)||nI.test(t))&&n++,rI.test(t)&&n++,iI.test(t)&&n++,aI.test(t)&&n++,oI.test(t)&&n++,sI.test(t)&&n++,cI.test(t)&&n++,lI.test(t)&&n++,uI.test(t)&&n++;let r=t.split(`
15
15
  `).length,i=Math.min(3,Math.floor(r/5));return n>=Math.max(1,i)}var hI=3e3,gI=new Map;function _I(e,t=`Pasted as plain text — some formatting could not be converted.`){let n=Date.now();return n-(gI.get(e)??0)<hI?!1:(gI.set(e,n),nr.error(t),!0)}var vI=!1,yI=!1;function bI(e){vI=e.shiftKey}function xI(e){(e.key===`Shift`||!e.shiftKey)&&(vI=!1)}function SI(){vI=!1}function CI(){yI||typeof window>`u`||(window.addEventListener(`keydown`,bI,!0),window.addEventListener(`keyup`,xI,!0),window.addEventListener(`blur`,SI,!0),yI=!0)}function wI(){CI()}function TI(){return CI(),vI}function EI(e){return TI()?!0:e.shiftKey===!0}function DI(e){return(t,n)=>kI(t,n,`paste`,e)}function OI(e){return(t,n)=>n.dataTransfer?.files&&n.dataTransfer.files.length>0?!1:kI(t,n,`drop`,e)}function kI(e,t,n,r){let i=n===`paste`?t.clipboardData:t.dataTransfer;if(!i||i.types.length===0)return!1;let a=performance.now(),o=OF(i),s=i.getData(`text/plain`),c=i.getData(`text/html`);if(AI(t,n))return s&&MI(e,s),MF({view:`wysiwyg`,branch:`shift`,source:o}),jF(a,{op:n,view:`wysiwyg`,branch:`shift`,source:o}),!0;if(jI(e))return s&&MI(e,s),MF({view:`wysiwyg`,branch:`codeblock`,source:o}),jF(a,{op:n,view:`wysiwyg`,branch:`codeblock`,source:o}),!0;let l=i.getData(`vscode-editor-data`);if(l&&s&&PI(e,l,s,o))return MF({view:`wysiwyg`,branch:`A`,source:o}),jF(a,{op:n,view:`wysiwyg`,branch:`A`,source:o}),!0;let u=i.getData(`text/x-gfm`);return u&&FI(e,u,r,`B`,o)||s&&c&&mI(s)&&FI(e,s,r,`B`,o)?(MF({view:`wysiwyg`,branch:`B`,source:o}),jF(a,{op:n,view:`wysiwyg`,branch:`B`,source:o}),!0):c&&/data-pm-slice/i.test(c)?(MF({view:`wysiwyg`,branch:`C`,source:o}),jF(a,{op:n,view:`wysiwyg`,branch:`C`,source:o}),!1):c&&II(e,c,r,o)?(MF({view:`wysiwyg`,branch:`D`,source:o}),jF(a,{op:n,view:`wysiwyg`,branch:`D`,source:o,htmlBytes:c.length}),!0):s?mI(s)&&FI(e,s,r,`E`,`markdown-text`)?(MF({view:`wysiwyg`,branch:`E`,source:`markdown-text`}),jF(a,{op:n,view:`wysiwyg`,branch:`E`,source:`markdown-text`}),!0):(MI(e,s),MF({view:`wysiwyg`,branch:`E`,source:`plaintext`}),jF(a,{op:n,view:`wysiwyg`,branch:`E`,source:`plaintext`}),!0):!1}function AI(e,t){return t===`paste`?EI(e):e.shiftKey===!0}function jI(e){let{$from:t}=e.state.selection;for(let e=t.depth;e>=0;e--)if(t.node(e).type.name===`codeBlock`)return!0;return!1}function MI(e,t){let{schema:n,tr:r}=e.state;t&&e.dispatch(r.replaceSelectionWith(n.text(t)).scrollIntoView())}var NI=/^[A-Za-z0-9_+-]+$/;function PI(e,t,n,r){try{let r=JSON.parse(t),i=typeof r.mode==`string`?r.mode:``,a=NI.test(i)?i:``,o=e.state.schema.nodes.codeBlock;if(!o)return!1;let s=o.create({language:a},n?e.state.schema.text(n):null);return e.dispatch(e.state.tr.replaceSelectionWith(s).scrollIntoView()),!0}catch(e){return NF({view:`wysiwyg`,stage:`branchA`,source:r,branch:`A`,reason:e?.message??`unknown`,errorClass:UF(e)}),!1}}function FI(e,t,n,r,i){let a;try{a=n.mdManager.parse(t)}catch(e){return NF({view:`wysiwyg`,stage:`mdManagerParse`,source:i,branch:r,reason:e?.message??`unknown`,errorClass:UF(e)}),!1}return LI(e,a,i,r)}function II(e,t,n,r){let i;try{i=Ze(t)}catch(e){return NF({view:`wysiwyg`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:UF(e),htmlBytes:t.length}),_I(`wysiwyg`),!1}let a;try{a=ue(i)}catch(e){return NF({view:`wysiwyg`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:UF(e),htmlBytes:t.length}),_I(`wysiwyg`),!1}let o;try{o=n.mdManager.parse(a)}catch(e){return NF({view:`wysiwyg`,stage:`mdManagerParse`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:UF(e),htmlBytes:t.length}),_I(`wysiwyg`),!1}return LI(e,o,r,`D`,t.length)}function LI(e,t,n,r,i){try{let n=e.state.schema.nodeFromJSON(t);return e.dispatch(e.state.tr.replaceSelection(n.slice(0,n.content.size)).scrollIntoView()),!0}catch(e){return NF({view:`wysiwyg`,stage:`applyJsonSlice`,source:n,branch:r,reason:e?.message??`unknown`,errorClass:UF(e),...i==null?{}:{htmlBytes:i}}),!1}}function RI(e){if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Math`:return{source:`$$\n${typeof n.formula==`string`?n.formula:``}\n$$`};case`MermaidFence`:return{source:`\`\`\`mermaid\n${typeof n.chart==`string`?n.chart:``}\n\`\`\``};default:return null}}function zI(e,t){let n=RI(e);if(!n)return null;let r=t.createElement(`pre`);r.className=`mdx-component`;let i=t.createElement(`code`);return i.textContent=n.source,r.appendChild(i),r}var BI={note:{color:`#0969da`,bg:`#dbeafe`},tip:{color:`#1f883d`,bg:`#dcfce7`},important:{color:`#8250df`,bg:`#f3e8ff`},warning:{color:`#9a6700`,bg:`#fef3c7`},caution:{color:`#cf222e`,bg:`#fee2e2`}};function VI(e){return Object.hasOwn(BI,e)?BI[e]:BI.note}function HI(e){let t=typeof e.type==`string`?e.type:`note`,n=VI(t),r=document.createElement(`aside`);if(r.setAttribute(`class`,`callout callout-${t}`),r.setAttribute(`data-callout-type`,t),r.setAttribute(`style`,`border-left: 3px solid ${n.color}; background-color: ${n.bg}; padding: 0.5rem 0.75rem; border-radius: 0.25rem;`),typeof e.title==`string`&&e.title){let t=document.createElement(`strong`);t.textContent=e.title,r.appendChild(t)}return r}function UI(e){let t=document.createElement(`details`);e.defaultOpen===!0&&t.setAttribute(`open`,``),t.setAttribute(`class`,`accordion`);let n=document.createElement(`summary`);return n.textContent=typeof e.title==`string`?e.title:`Accordion`,t.appendChild(n),t}function WI(e){let t=DF(e);return t.portable?null:t.reason}function GI(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t}function KI(e,t,n){if(e===``)return null;let r;try{r=WI(e)}catch(e){let n=UF(e);return zF({view:`wysiwyg`,tag:t,phase:`classifier-throw`,...n===void 0?{}:{errorClass:n}}),null}return r===null?null:(RF({view:`wysiwyg`,tag:t,class:`mdx-component`,reason:r}),GI(n))}function qI(e){let t=typeof e.alt==`string`?e.alt:``,n=typeof e.src==`string`?e.src:``,r=KI(n,`img`,`![${t}](${n})`);if(r!==null)return r;let i=document.createElement(`img`);return n&&pF(n)&&i.setAttribute(`src`,n),typeof e.alt==`string`&&i.setAttribute(`alt`,e.alt),i}function JI(e,t){let n=document.createElement(e);return n.setAttribute(`src`,t),n.outerHTML}function YI(e){let t=typeof e.src==`string`?e.src:``,n=KI(t,`video`,JI(`video`,t));if(n!==null)return n;let r=document.createElement(`video`);return t&&pF(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function XI(e){let t=typeof e.src==`string`?e.src:``,n=KI(t,`audio`,JI(`audio`,t));if(n!==null)return n;let r=document.createElement(`audio`);return t&&pF(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function ZI(e){if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Callout`:case`GFMCallout`:return HI(n);case`Accordion`:case`HtmlDetailsAccordion`:return UI(n);case`img`:case`CommonMarkImage`:return qI(n);case`video`:return YI(n);case`audio`:return XI(n);case`Math`:case`MermaidFence`:return zI(e,document);default:return null}}var QI=`color.background-color.background-image.border.border-top.border-right.border-bottom.border-left.border-color.border-width.border-style.border-radius.padding.padding-top.padding-right.padding-bottom.padding-left.margin.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.text-decoration.text-align.line-height.list-style.list-style-type.list-style-position.vertical-align.white-space`.split(`.`),$I=new Set([`jsx-component-wrapper`,`selectedCell`,`is-empty`,`ProseMirror-selectednode`,`ProseMirror-trailingBreak`]),eL=new Set([`data-selected`,`data-has-child-selected`,`data-dragging`,`data-range-selected`,`contenteditable`,`data-pm-slice`]),tL={getComputedStyle:e=>window.getComputedStyle(e)};function nL(e,t=QI){let n=``;for(let r of t){let t=e.getPropertyValue(r);t&&(t===`initial`||t===`normal`||(n+=`${r}: ${TF(t)}; `))}return n.trim()}function rL(e,t=$I){return e.split(/\s+/).filter(e=>e.length>0&&!t.has(e)).join(` `)||null}function iL(e,t,n){let r=!1;return e.nodesBetween(t,n,(i,a,o)=>(o===e&&(t>a||n<a+i.nodeSize)&&(r=!0),!1)),r}function aL(e,t,n=tL){let r=document.createDocumentFragment(),{from:i,to:a}=t.state.selection;return i===a||iL(t.state.doc,i,a)||t.state.doc.nodesBetween(i,a,(e,i,a)=>{if(a!==t.state.doc)return!1;let o=t.nodeDOM(i);if(o==null){FF({descriptor:e.type.name,view:`wysiwyg`});let t=ZI(e);return t&&r.appendChild(t),!1}if(!(o instanceof Element)||o.getAttribute(`data-clipboard-omit`)===`true`)return!1;let s=zI(e,document);return s===null?(r.appendChild(oL(o,n)),!1):(r.appendChild(s),IF({view:`wysiwyg`,descriptor:e.attrs.componentName??e.type.name}),!1)}),r}function oL(e,t){let n=e.cloneNode(!0);return fL(e,n,t),pL(n),sL(n),TL(e,n,t),dL(n),n}function sL(e){let t=Array.from(e.querySelectorAll(`[data-component-type="math-inline"]`));for(let n of t){if(!n.parentNode)continue;let t=n.getAttribute(`data-formula`)??``,r=e.ownerDocument.createElement(`span`);r.className=`mdx-inline`,r.textContent=`$$${t}$$`,n.replaceWith(r),IF({view:`wysiwyg`,descriptor:`mathInline`})}let n=Array.from(e.querySelectorAll(`a[data-wiki-embed]`));for(let t of n){if(!t.parentNode)continue;let n=t.getAttribute(`data-target`)??``;if(!n)continue;let r=t.getAttribute(`data-alias`)||null,i=t.getAttribute(`data-anchor`)||null,a=e.ownerDocument.createElement(`span`);a.className=`mdx-inline`,a.textContent=cL(n,i,r),t.replaceWith(a),IF({view:`wysiwyg`,descriptor:`wikiLinkEmbed`})}}function cL(e,t,n){let r=e;return t&&(r+=`#${t}`),n&&(r+=`|${n}`),`![[${r}]]`}var lL={"lucide-chevron-right":`›`,"lucide-chevron-down":`⌄`,"lucide-info":`ℹ`,"lucide-lightbulb":`💡`,"lucide-message-square-warning":`❗`,"lucide-alert-triangle":`⚠`,"lucide-alert-octagon":`⛔`},uL=/(?:^|\s)(lucide-[a-z0-9-]+)(?:\s|$)/;function dL(e){let t=e.querySelectorAll(`svg`);for(let e of Array.from(t)){let t=(e.getAttribute(`class`)??``).match(uL);if(!t)continue;let n=t[1],r=lL[n];if(!r){VF({lucideClass:n,view:`wysiwyg`});continue}let i=e.ownerDocument.createElement(`span`);i.setAttribute(`aria-hidden`,`true`),i.textContent=r,e.replaceWith(i)}}function fL(e,t,n){let r=nL(n.getComputedStyle(e));if(r){let e=t.getAttribute(`style`);t.setAttribute(`style`,e?`${e}; ${r}`:r)}let i=t.getAttribute(`class`);if(i!==null){let e=rL(i);e?t.setAttribute(`class`,e):t.removeAttribute(`class`)}for(let e of Array.from(t.attributes)){if(eL.has(e.name)){t.removeAttribute(e.name);continue}if(gF(e.name)){t.removeAttribute(e.name),LF({attr:`on*`,reason:`event-handler`,view:`wysiwyg`});continue}if(e.name===`style`){let n=_F(e.value);n===``?(t.removeAttribute(`style`),LF({attr:`style`,reason:`unsafe-url-or-expression`,view:`wysiwyg`})):n!==e.value&&t.setAttribute(`style`,n);continue}if(oF.has(e.name)){(e.name===`srcset`?mF(e.value):pF(e.value))||(t.removeAttribute(e.name),LF({attr:e.name,reason:e.name===`srcset`?`srcset-candidate`:`scheme`,view:`wysiwyg`}));continue}if(sF.has(e.name)){let n=hF(e.value,{reportNoChange:!0});n!==null&&(t.setAttribute(e.name,n),LF({attr:e.name,reason:`embedded-url`,view:`wysiwyg`}))}}let a=Array.from(e.children),o=Array.from(t.children),s=Math.min(a.length,o.length);for(let e=0;e<s;e++){let t=a[e],r=o[e];if(t.getAttribute(`data-clipboard-omit`)===`true`){r.remove();continue}fL(t,r,n)}}function pL(e){let t=e.querySelectorAll(`span[data-wiki-link]`);for(let e of Array.from(t)){let t=e.getAttribute(`data-target`)??``;if(!t)continue;let n=re(e.getAttribute(`data-anchor`)),r=re(e.getAttribute(`data-alias`)),i=Ht(t,n),a=e.ownerDocument.createElement(`a`);a.setAttribute(`class`,`wiki-link`),a.setAttribute(`href`,i),a.setAttribute(`data-target`,t),a.setAttribute(`data-anchor`,n??``),a.setAttribute(`data-alias`,r??``),a.textContent=e.textContent??``,e.replaceWith(a)}}var mL=new Set([`img`,`video`,`audio`,`source`,`a`]);function hL(e){return mL.has(e)}function gL(e){return e.closest(`p`)===null?`mdx-component`:`mdx-inline`}function _L(e,t,n){if(t===`mdx-component`){let t=e.createElement(`pre`);t.className=`mdx-component`;let r=e.createElement(`code`);return r.textContent=n,t.appendChild(r),t}let r=e.createElement(`span`);return r.className=`mdx-inline`,r.textContent=n,r}function vL(e){let t=DF(e);return t.portable?null:t.reason}function yL(e){for(let t of e.split(`,`)){let e=t.trim();if(e===``)continue;let n=vL(e.split(/\s+/)[0]??``);if(n!==null)return n}return null}function bL(e,t){switch(t){case`img`:case`source`:{let t=e.getAttribute(`src`);if(t!==null){let e=vL(t);if(e!==null)return e}let n=e.getAttribute(`srcset`);if(n!==null){let e=yL(n);if(e!==null)return e}return null}case`video`:case`audio`:{let t=e.getAttribute(`src`);return t===null?null:vL(t)}case`a`:{let t=e.getAttribute(`href`);return t===null?null:vL(t)}default:return null}}function xL(e){let t=e.querySelectorAll(`source, img`);for(let e of Array.from(t)){let t=e.tagName.toLowerCase();if(!hL(t))continue;let n=bL(e,t);if(n!==null)return n}return null}function SL(e,t,n,r){let i;try{i=bL(n,r)}catch(e){let t=UF(e);return zF({view:`wysiwyg`,tag:r,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return i===null?!1:wL(e,t,n,r,i)}function CL(e,t,n){let r;try{r=xL(n)}catch(e){let t=UF(e);return zF({view:`wysiwyg`,tag:`picture`,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return r===null?!1:wL(e,t,n,`picture`,r)}function wL(e,t,n,r,i){let a=e.serializeElementMarkdown?e.serializeElementMarkdown(t):{kind:`no-correspondence`};switch(a.kind){case`no-correspondence`:return zF({view:`wysiwyg`,tag:r,phase:`serializer-null`}),!1;case`failed`:{let e=a.errorClass;return zF({view:`wysiwyg`,tag:r,phase:`serializer-throw`,...e===void 0?{}:{errorClass:e}}),!1}case`ok`:{let e=gL(n),t=_L(n.ownerDocument,e,a.markdown);return n.replaceWith(t),RF({view:`wysiwyg`,tag:r,class:e,reason:i}),!0}default:return!1}}function TL(e,t,n){if(!n.serializeElementMarkdown)return;let r=t.tagName.toLowerCase();if(r===`picture`&&CL(n,e,t)||hL(r)&&SL(n,e,t,r))return;let i=Array.from(e.children),a=Array.from(t.children),o=[];for(let e of i)e.getAttribute(`data-clipboard-omit`)!==`true`&&o.push(e);let s=Math.min(o.length,a.length);for(let e=0;e<s;e++)TL(o[e],a[e],n)}function EL(e){return(t,n)=>{try{return kL(t,n.state.schema,e.mdManager)}catch(e){return PF({view:`wysiwyg`,kind:`text`,reason:e?.message??`unknown`}),t.content.textBetween(0,t.content.size,`
16
16
 
17
17
  `)}}}var DL=class extends te{mdManager;view=null;constructor(e){super({},{}),this.mdManager=e}setView(e){this.view=e}serializeFragment(e,t,n){let r=this.view;if(r&&r.state.selection.from!==r.state.selection.to)try{let e=aL(r.state.selection.content(),r,jL(r,this.mdManager));if(e.childNodes.length>0){if(n){for(let t of Array.from(e.childNodes))n.appendChild(t);return n}return e}}catch(e){PF({view:`wysiwyg`,kind:`html`,reason:`walker:${e?.message??`unknown`}`})}try{let t=e.firstChild?.type.schema;if(!t)return n??document.createDocumentFragment();let r=PL(ML(e,t,this.mdManager));if(n){for(let e of Array.from(r.childNodes))n.appendChild(e);return n}return r}catch(e){return PF({view:`wysiwyg`,kind:`html`,reason:`markdown:${e?.message??`unknown`}`}),n??document.createDocumentFragment()}}};function OL(e){let t=new DL(e.mdManager);return{serializer:t,setView:e=>t.setView(e)}}function kL(e,t,n){return n.serialize(NL(e,t))}function AL(e){let t=null,n=e;for(;n&&!n.classList.contains(`ProseMirror`);){if(n.hasAttribute(`data-clipboard-inline-leaf`)){n=n.parentElement;continue}(n.classList.contains(`react-renderer`)||n.hasAttribute(`data-node-view-wrapper`)||n.hasAttribute(`data-jsx-component`))&&(t=n),n=n.parentElement}return t}function jL(e,t){return{getComputedStyle:e=>window.getComputedStyle(e),serializeElementMarkdown:n=>{let r=AL(n),i;try{let t=r?.parentElement;if(t&&r){let n=Array.from(t.children).indexOf(r);i=e.posAtDOM(t,n,-1)}else i=e.posAtDOM(n,0)}catch(e){return{kind:`failed`,errorClass:UF(e)}}if(i<0)return{kind:`no-correspondence`};let a=e.state.doc.nodeAt(i);if(!a)return{kind:`no-correspondence`};let o=e.state.doc.slice(i,i+a.nodeSize);try{return{kind:`ok`,markdown:kL(o,e.state.schema,t)}}catch(e){return{kind:`failed`,errorClass:UF(e)}}}}}function ML(e,t,n){return C(kL(new T(e,0,0),t,n))}function NL(e,t){let n=e.content;if(n.firstChild?.isInline){let e=t.nodes.paragraph;if(e){let t=e.createAndFill(null,n);t&&(n=W.from(t))}}let r=t.topNodeType.createAndFill(null,n);if(!r){let e=t.topNodeType.createAndFill();if(!e)throw Error(`[clipboard] schema cannot fill topNodeType`);return e.toJSON()}return r.toJSON()}function PL(e){let t=new DOMParser().parseFromString(e,`text/html`),n=document.createDocumentFragment();for(let e of Array.from(t.body.childNodes))n.appendChild(e);return n}function FL(e){return wI(),Yr.domEventHandlers({copy:(e,t)=>LL(e,t,`copy`),cut:(e,t)=>LL(e,t,`cut`),paste:(t,n)=>RL(t,n,e)})}function IL(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t.outerHTML}function LL(e,t,n){let{from:r,to:i}=t.state.selection.main;if(r===i)return e.preventDefault(),!0;let a=e.clipboardData;if(!a)return!1;let o=performance.now();try{let s=t.state.sliceDoc(r,i);a.setData(`text/plain`,s);try{a.setData(`text/html`,IL(s))}catch(e){PF({view:`source`,kind:`html`,reason:e?.message??`unknown`})}return e.preventDefault(),n===`cut`&&t.dispatch({changes:{from:r,to:i,insert:``}}),jF(o,{op:n,view:`source`,branch:`serialize`,source:`local`}),!0}catch(e){return PF({view:`source`,kind:`text`,reason:e?.message??`unknown`}),!1}}function RL(e,t,n){let r=e.clipboardData;if(!r||r.types.length===0)return!1;let i=performance.now(),a=OF(r),o=r.getData(`text/plain`),s=r.getData(`text/html`),c=r.getData(`vscode-editor-data`);return EI(e)?(MF({view:`source`,branch:`shift`,source:a}),jF(i,{op:`paste`,view:`source`,branch:`shift`,source:a}),!1):c&&o?(MF({view:`source`,branch:`A`,source:a}),jF(i,{op:`paste`,view:`source`,branch:`A`,source:a}),!1):o&&s&&BL(s)?(MF({view:`source`,branch:`B-wrapper`,source:a}),jF(i,{op:`paste`,view:`source`,branch:`B-wrapper`,source:a}),!1):o&&s&&mI(o)?(MF({view:`source`,branch:`B`,source:a}),jF(i,{op:`paste`,view:`source`,branch:`B`,source:a}),!1):s&&/data-pm-slice/i.test(s)?(MF({view:`source`,branch:`C`,source:a}),jF(i,{op:`paste`,view:`source`,branch:`C`,source:a}),!1):s&&VL(t,s,n,a)?(e.preventDefault(),MF({view:`source`,branch:`D`,source:a}),jF(i,{op:`paste`,view:`source`,branch:`D`,source:a,htmlBytes:s.length}),!0):(MF({view:`source`,branch:`E`,source:a}),jF(i,{op:`paste`,view:`source`,branch:`E`,source:a}),!1)}var zL=/<pre\b(?=[^>]*\bclass\s*=\s*["'][^"']*\bmdx-component\b[^"']*["'])[^>]*>\s*<code\b/i;function BL(e){return zL.test(e)}function VL(e,t,n,r){let i;try{i=Ze(t)}catch(e){return NF({view:`source`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:UF(e),htmlBytes:t.length}),!1}let a;try{a=ue(i)}catch(e){return NF({view:`source`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:UF(e),htmlBytes:t.length}),!1}let{from:o,to:s}=e.state.selection.main;if(!(a.length>500*1024))return e.dispatch({changes:{from:o,to:s,insert:a},selection:{anchor:o+a.length}}),!0;let c=o===s?``:e.state.sliceDoc(o,s);o!==s&&e.dispatch({changes:{from:o,to:s,insert:``}});let l=o,u=Rh(n.ytext,l);return ne(n.ydoc,n.ytext,l,a,{resolveOffset:e=>{let t=Bh(u,n.ydoc);return t==null?e:t.index+(e-l)}}).catch(i=>{HL({view:e,source:r,html:t,restoreText:c,anchorIndex:l,anchorRelPos:u,ydoc:n.ydoc,err:i})}),!0}function HL(e){let{view:t,source:n,html:r,restoreText:i,anchorIndex:a,anchorRelPos:o,ydoc:s,err:c}=e,l=`no-restore-needed`;if(c instanceof un&&c.bytesWritten>0){let e=o&&s?Bh(o,s)?.index??a:a,n=Math.min(e+c.bytesWritten,t.state.doc.length);try{t.dispatch({changes:{from:e,to:n,insert:i}}),l=i.length>0?`restored`:`no-restore-needed`}catch(e){console.warn(`[clipboard] partial-chunk rollback dispatch failed`,e),l=i.length>0?`restore-failed`:`no-restore-needed`}}else if(i.length>0)try{t.dispatch({changes:{from:a,to:a,insert:i}}),l=`restored`}catch(e){console.warn(`[clipboard] selection-restore dispatch failed`,e),l=`restore-failed`}let u=l===`restored`?B._({id:`jhtG3I`}):l===`restore-failed`?B._({id:`yCX4jp`}):``;if(c instanceof un){HF({view:`source`,chunksCompleted:c.chunksCompleted,totalChunks:c.totalChunks,bytesWritten:c.bytesWritten,bytesRemaining:c.bytesRemaining,reason:c.message});let e=c.chunksCompleted,t=c.totalChunks;nr.error(B._({id:`xYMPyY`,values:{chunksCompleted:e,totalChunks:t,restoreSuffix:u}}));return}NF({view:`source`,stage:`chunkedYTextInsert`,source:n,branch:`D`,reason:c?.message??`unknown`,errorClass:UF(c),htmlBytes:r.length}),nr.error(B._({id:`eBIT9h`,values:{restoreSuffix:u}}))}var UL=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=JL(e.state,n.from);return r.line?GL(e):r.block?qL(e):!1};function WL(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var GL=WL($L,0),KL=WL(QL,0),qL=WL((e,t)=>QL(e,t,ZL(t)),0);function JL(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var YL=50;function XL(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-YL,r),o=e.sliceDoc(i,i+YL),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*YL?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+YL),d=e.sliceDoc(i-YL,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function ZL(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function QL(e,t,n=t.selection.ranges){let r=n.map(e=>JL(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>XL(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function $L(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=JL(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var eR=yi.define(),tR=yi.define(),nR=Lr.define(),rR=Lr.define({combine(e){return gr(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),iR=wr.define({create(){return CR.empty},update(e,t){let n=t.state.facet(rR),r=t.annotation(eR);if(r){let i=dR.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?fR(o,o.length,n.minDepth,i):vR(o,t.startState.selection),new CR(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(tR);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Mr.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=dR.fromTransaction(t),o=t.annotation(Mr.time),s=t.annotation(Mr.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new CR(e.done.map(dR.fromJSON),e.undone.map(dR.fromJSON))}});function aR(e={}){return[iR,rR.of(e),Yr.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?sR:e.inputType==`historyRedo`?cR:null;return n?(e.preventDefault(),n(t)):!1}})]}function oR(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(iR,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var sR=oR(0,!1),cR=oR(1,!1),lR=oR(0,!0),uR=oR(1,!0),dR=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&vr.fromJSON(t.changes),[],t.mapped&&Hr.fromJSON(t.mapped),t.startSelection&&Sr.fromJSON(t.startSelection),t.selectionsAfter.map(Sr.fromJSON))}static fromTransaction(t,n){let r=gR;for(let e of t.startState.facet(nR)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,gR)}static selection(t){return new e(void 0,gR,void 0,void 0,t)}};function fR(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function pR(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function mR(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function hR(e,t){return e.length?t.length?e.concat(t):e:t}var gR=[],_R=200;function vR(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-_R));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),fR(e,e.length-1,1e9,n.setSelAfter(r)))}else return[dR.selection([t])]}function yR(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function bR(e,t){if(!e.length)return e;let n=e.length,r=gR;for(;n;){let i=xR(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[dR.selection(r)]:gR}function xR(e,t,n){let r=hR(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):gR,n);if(!e.changes)return dR.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new dR(i,zr.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var SR=/^(input\.type|delete)($|\.)/,CR=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||SR.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,pR(s.changes,t.changes))||r==`input.type.compose`)?fR(o,o.length-1,i.minDepth,new dR(t.changes.compose(s.changes),hR(zr.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,gR)):fR(o,o.length,i.minDepth,t),new e(o,gR,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:gR;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&mR(a[a.length-1],t)?this:new e(vR(this.done,t),this.undone,n,r)}addMapping(t){return new e(bR(this.done,t),bR(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:eR.of({side:e,rest:yR(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?gR:r.slice(0,r.length-1);return i.mapped&&(n=bR(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:eR.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};CR.empty=new CR(gR,gR);var wR=[{key:`Mod-z`,run:sR,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:cR,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:cR,preventDefault:!0},{key:`Mod-u`,run:lR,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:uR,preventDefault:!0}];function TR(e,t){return Sr.create(e.ranges.map(t),e.mainIndex)}function ER(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function DR({state:e,dispatch:t},n){let r=TR(e.selection,n);return r.eq(e.selection,!0)?!1:(t(ER(e,r)),!0)}function OR(e,t){return Sr.cursor(t?e.to:e.from)}function kR(e,t){return DR(e,n=>n.empty?e.moveByChar(n,t):OR(n,t))}function AR(e){return e.textDirectionAt(e.state.selection.main.head)==Xr.LTR}var jR=e=>kR(e,!AR(e)),MR=e=>kR(e,AR(e));function NR(e,t){return DR(e,n=>n.empty?e.moveByGroup(n,t):OR(n,t))}var PR=e=>NR(e,!AR(e)),FR=e=>NR(e,AR(e));typeof Intl<`u`&&Intl.Segmenter;function IR(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function LR(e,t,n){let r=Rr(e).resolveInner(t.head),i=n?Kr.closedBy:Kr.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;IR(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?ai(e,r.from,1):ai(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Sr.cursor(s,n?-1:1)}var RR=e=>DR(e,t=>LR(e.state,t,!AR(e))),zR=e=>DR(e,t=>LR(e.state,t,AR(e)));function BR(e,t){return DR(e,n=>{if(!n.empty)return OR(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var VR=e=>BR(e,!1),HR=e=>BR(e,!0);function UR(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Yr.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function WR(e,t){let n=UR(e),{state:r}=e,i=TR(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):OR(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=Yr.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(ER(r,i),{effects:a}),!0}var GR=e=>WR(e,!1),KR=e=>WR(e,!0);function qR(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Sr.cursor(r.from+n))}return i}var JR=e=>DR(e,t=>qR(e,t,!0)),YR=e=>DR(e,t=>qR(e,t,!1)),XR=e=>DR(e,t=>qR(e,t,!AR(e))),ZR=e=>DR(e,t=>qR(e,t,AR(e))),QR=e=>DR(e,t=>Sr.cursor(e.lineBlockAt(t.head).from,1)),$R=e=>DR(e,t=>Sr.cursor(e.lineBlockAt(t.head).to,-1));function ez(e,t,n){let r=!1,i=TR(e.selection,t=>{let i=ai(e,t.head,-1)||ai(e,t.head,1)||t.head>0&&ai(e,t.head-1,1)||t.head<e.doc.length&&ai(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Sr.range(t.anchor,a):Sr.cursor(a)});return r?(t(ER(e,i)),!0):!1}var tz=({state:e,dispatch:t})=>ez(e,t,!1);function nz(e,t){let n=TR(e.state.selection,e=>{let n=t(e);return Sr.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(ER(e.state,n)),!0)}function rz(e,t){return nz(e,n=>e.moveByChar(n,t))}var iz=e=>rz(e,!AR(e)),az=e=>rz(e,AR(e));function oz(e,t){return nz(e,n=>e.moveByGroup(n,t))}var sz=e=>oz(e,!AR(e)),cz=e=>oz(e,AR(e)),lz=e=>nz(e,t=>LR(e.state,t,!AR(e))),uz=e=>nz(e,t=>LR(e.state,t,AR(e)));function dz(e,t){return nz(e,n=>e.moveVertically(n,t))}var fz=e=>dz(e,!1),pz=e=>dz(e,!0);function mz(e,t){return nz(e,n=>e.moveVertically(n,t,UR(e).height))}var hz=e=>mz(e,!1),gz=e=>mz(e,!0),_z=e=>nz(e,t=>qR(e,t,!0)),vz=e=>nz(e,t=>qR(e,t,!1)),yz=e=>nz(e,t=>qR(e,t,!AR(e))),bz=e=>nz(e,t=>qR(e,t,AR(e))),xz=e=>nz(e,t=>Sr.cursor(e.lineBlockAt(t.head).from)),Sz=e=>nz(e,t=>Sr.cursor(e.lineBlockAt(t.head).to)),Cz=({state:e,dispatch:t})=>(t(ER(e,{anchor:0})),!0),wz=({state:e,dispatch:t})=>(t(ER(e,{anchor:e.doc.length})),!0),Tz=({state:e,dispatch:t})=>(t(ER(e,{anchor:e.selection.main.anchor,head:0})),!0),Ez=({state:e,dispatch:t})=>(t(ER(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Dz=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),Oz=({state:e,dispatch:t})=>{let n=qz(e).map(({from:t,to:n})=>Sr.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Sr.create(n),userEvent:`select`})),!0},kz=({state:e,dispatch:t})=>{let n=TR(e.selection,t=>{let n=Rr(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Sr.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(ER(e,n)),!0)};function Az(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(ER(n,Sr.create(i,i.length-1))),!0)}var jz=e=>Az(e,!1),Mz=e=>Az(e,!0),Nz=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Sr.create([n.main]):n.main.empty||(r=Sr.create([Sr.cursor(n.main.head)])),r?(t(ER(e,r)),!0):!1};function Pz(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Fz(e,o,!1)):o>i&&(n=`delete.forward`,o=Fz(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Fz(e,i,!1),a=Fz(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Sr.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?Yr.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Fz(e,t,n){if(e instanceof Yr)for(let r of e.state.facet(Yr.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var Iz=(e,t,n)=>Pz(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=qr(s,a.tabSize)%Vr(a)||Vr(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=Dr(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Dr(o.text,c-o.from,!1,!1)+o.from);return c}),Lz=e=>Iz(e,!1,!0),Rz=e=>Iz(e,!0,!1),zz=(e,t)=>Pz(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=Dr(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Bz=e=>zz(e,!1),Vz=e=>zz(e,!0),Hz=e=>Pz(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Uz=e=>Pz(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Wz=e=>Pz(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Gz=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Or.of([``,``])},range:Sr.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},Kz=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:Dr(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:Dr(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Sr.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function qz(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Jz(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of qz(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Sr.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Sr.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Sr.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Yz=({state:e,dispatch:t})=>Jz(e,t,!1),Xz=({state:e,dispatch:t})=>Jz(e,t,!0);function Zz(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of qz(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Qz=({state:e,dispatch:t})=>Zz(e,t,!1),$z=({state:e,dispatch:t})=>Zz(e,t,!0),eB=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(qz(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=TR(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function tB(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Rr(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Kr.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var nB=iB(!1),rB=iB(!0);function iB(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&tB(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new ci(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=_r(s,r);for(c??=qr(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,yr(t,c)];return o&&l.push(yr(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:Or.of(l)},range:Sr.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function aB(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Sr.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var oB=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new ci(e,{overrideIndentation:e=>n[e]??-1}),i=aB(e,(t,i,a)=>{let o=_r(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=yr(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},sB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(aB(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Ir)})}),{userEvent:`input.indent`})),!0),cB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(aB(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=qr(r,e.tabSize),a=0,o=yr(e,Math.max(0,i-Vr(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),lB=e=>(e.setTabFocusMode(),!0),uB=[{key:`Ctrl-b`,run:jR,shift:iz,preventDefault:!0},{key:`Ctrl-f`,run:MR,shift:az},{key:`Ctrl-p`,run:VR,shift:fz},{key:`Ctrl-n`,run:HR,shift:pz},{key:`Ctrl-a`,run:QR,shift:xz},{key:`Ctrl-e`,run:$R,shift:Sz},{key:`Ctrl-d`,run:Rz},{key:`Ctrl-h`,run:Lz},{key:`Ctrl-k`,run:Hz},{key:`Ctrl-Alt-h`,run:Bz},{key:`Ctrl-o`,run:Gz},{key:`Ctrl-t`,run:Kz},{key:`Ctrl-v`,run:KR}],dB=[{key:`ArrowLeft`,run:jR,shift:iz,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:PR,shift:sz,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:XR,shift:yz,preventDefault:!0},{key:`ArrowRight`,run:MR,shift:az,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:FR,shift:cz,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:ZR,shift:bz,preventDefault:!0},{key:`ArrowUp`,run:VR,shift:fz,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Cz,shift:Tz},{mac:`Ctrl-ArrowUp`,run:GR,shift:hz},{key:`ArrowDown`,run:HR,shift:pz,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:wz,shift:Ez},{mac:`Ctrl-ArrowDown`,run:KR,shift:gz},{key:`PageUp`,run:GR,shift:hz},{key:`PageDown`,run:KR,shift:gz},{key:`Home`,run:YR,shift:vz,preventDefault:!0},{key:`Mod-Home`,run:Cz,shift:Tz},{key:`End`,run:JR,shift:_z,preventDefault:!0},{key:`Mod-End`,run:wz,shift:Ez},{key:`Enter`,run:nB,shift:nB},{key:`Mod-a`,run:Dz},{key:`Backspace`,run:Lz,shift:Lz,preventDefault:!0},{key:`Delete`,run:Rz,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Bz,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Vz,preventDefault:!0},{mac:`Mod-Backspace`,run:Uz,preventDefault:!0},{mac:`Mod-Delete`,run:Wz,preventDefault:!0}].concat(uB.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),fB=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:RR,shift:lz},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:zR,shift:uz},{key:`Alt-ArrowUp`,run:Yz},{key:`Shift-Alt-ArrowUp`,run:Qz},{key:`Alt-ArrowDown`,run:Xz},{key:`Shift-Alt-ArrowDown`,run:$z},{key:`Mod-Alt-ArrowUp`,run:jz},{key:`Mod-Alt-ArrowDown`,run:Mz},{key:`Escape`,run:Nz},{key:`Mod-Enter`,run:rB},{key:`Alt-l`,mac:`Ctrl-l`,run:Oz},{key:`Mod-i`,run:kz,preventDefault:!0},{key:`Mod-[`,run:cB},{key:`Mod-]`,run:sB},{key:`Mod-Alt-\\`,run:oB},{key:`Shift-Mod-k`,run:eB},{key:`Shift-Mod-\\`,run:tz},{key:`Mod-/`,run:UL},{key:`Alt-A`,run:KL},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:lB}].concat(dB),pB={key:`Tab`,run:sB,shift:cB},mB=135,hB=1,gB=136,_B=137,vB=2,yB=138,bB=3,xB=4,SB=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],CB=58,wB=40,TB=95,EB=91,DB=45,OB=46,kB=35,AB=37,jB=38,MB=92,NB=10,PB=42;function FB(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function IB(e){return e>=48&&e<=57}function LB(e){return IB(e)||e>=97&&e<=102||e>=65&&e<=70}var RB=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(FB(c)||c==DB||c==TB||a&&IB(c))!a&&(c!=DB||s>0)&&(a=!0),o===s&&c==DB&&o++,r.advance();else if(c==MB&&r.peek(1)!=NB){if(r.advance(),LB(r.next)){do r.advance();while(LB(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(vB)?t:c==wB?n:e);break}}},zB=new xi(RB(gB,vB,_B),{contextual:!0}),BB=new xi(RB(yB,bB,xB),{contextual:!0}),VB=new xi(e=>{if(SB.includes(e.peek(-1))){let{next:t}=e;(FB(t)||t==TB||t==kB||t==OB||t==PB||t==EB||t==CB&&FB(e.peek(1))||t==DB||t==jB)&&e.acceptToken(mB)}}),HB=new xi(e=>{if(!SB.includes(e.peek(-1))){let{next:t}=e;if(t==AB&&(e.advance(),e.acceptToken(hB)),FB(t)){do e.advance();while(FB(e.next)||IB(e.next));e.acceptToken(hB)}}}),UB=jr({"AtKeyword import charset namespace keyframes media supports font-feature-values":q.definitionKeyword,"from to selector scope MatchFlag":q.keyword,NamespaceName:q.namespace,KeyframeName:q.labelName,KeyframeRangeName:q.operatorKeyword,TagName:q.tagName,ClassName:q.className,PseudoClassName:q.constant(q.className),IdName:q.labelName,"FeatureName PropertyName":q.propertyName,AttributeName:q.attributeName,NumberLiteral:q.number,KeywordQuery:q.keyword,UnaryQueryOp:q.operatorKeyword,"CallTag ValueName FontName":q.atom,VariableName:q.variableName,Callee:q.operatorKeyword,Unit:q.unit,"UniversalSelector NestingSelector":q.definitionOperator,"MatchOp CompareOp":q.compareOperator,"ChildOp SiblingOp, LogicOp":q.logicOperator,BinOp:q.arithmeticOperator,Important:q.modifier,Comment:q.blockComment,ColorLiteral:q.color,"ParenthesizedContent StringLiteral":q.string,":":q.punctuation,"PseudoOp #":q.derefOperator,"; , |":q.separator,"( )":q.paren,"[ ]":q.squareBracket,"{ }":q.brace}),WB={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},GB={__proto__:null,or:104,and:104,not:112,only:112,layer:186},KB={__proto__:null,selector:118,layer:182},qB={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},JB={__proto__:null,to:223},YB=Si.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[UB],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[VB,HB,zB,BB,1,2,3,4,new bi(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>WB[e]||-1},{term:138,get:e=>GB[e]||-1},{term:4,get:e=>KB[e]||-1},{term:28,get:e=>qB[e]||-1},{term:136,get:e=>JB[e]||-1}],tokenPrec:2256}),XB=null;function ZB(){if(!XB&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));XB=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return XB||[]}var QB=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),$B=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),eV=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),tV=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),nV=/^(\w[\w-]*|-\w[\w-]*|)$/,rV=/^-(-[\w-]*)?$/;function iV(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var aV=new Jr,oV=[`Declaration`];function sV(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function cV(e,t,n){if(t.to-t.from>4096){let r=aV.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(hr.IncludeAnonymous);if(o.firstChild())do for(let t of cV(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return aV.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(oV)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var lV=(e=>t=>{let{state:n,pos:r}=t,i=Rr(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:ZB(),validFor:nV};if(i.name==`ValueName`)return{from:i.from,options:$B,validFor:nV};if(i.name==`PseudoClassName`)return{from:i.from,options:QB,validFor:nV};if(e(i)||(t.explicit||a)&&iV(i,n.doc))return{from:e(i)||a?i.from:r,options:cV(n.doc,sV(i),e),validFor:rV};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:ZB(),validFor:nV};return{from:i.from,options:eV,validFor:nV}}if(i.name==`AtKeyword`)return{from:i.from,options:tV,validFor:nV};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:QB,validFor:nV}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:$B,validFor:nV}:o.name==`Block`||o.name==`Styles`?{from:r,options:ZB(),validFor:nV}:null})(e=>e.name==`VariableName`),uV=fi.define({name:`css`,parser:YB.configure({props:[Ur.add({Declaration:ei()}),Qr.add({"Block KeyframeList":_i})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function dV(){return new li(uV,uV.data.of({autocomplete:lV}))}var fV=55,pV=1,mV=56,hV=2,gV=57,_V=3,vV=4,yV=5,bV=6,xV=7,SV=8,CV=9,wV=10,TV=11,EV=12,DV=13,OV=58,kV=14,AV=15,jV=59,MV=21,NV=23,PV=24,FV=25,IV=27,LV=28,RV=29,zV=32,BV=35,VV=37,HV=38,UV=0,WV=1,GV={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},KV={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},qV={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function JV(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var YV=null,XV=null,ZV=0;function QV(e,t){let n=e.pos+t;if(ZV==n&&XV==e)return YV;let r=e.peek(t),i=``;for(;JV(r);)i+=String.fromCharCode(r),r=e.peek(++t);return XV=e,ZV=n,YV=i?i.toLowerCase():r==nH||r==rH?void 0:null}var $V=60,eH=62,tH=47,nH=63,rH=33,iH=45;function aH(e,t){this.name=e,this.parent=t}var oH=[bV,wV,xV,SV,CV],sH=new Ci({start:null,shift(e,t,n,r){return oH.indexOf(t)>-1?new aH(QV(r,1)||``,e):e},reduce(e,t){return t==MV&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==bV||i==VV?new aH(QV(r,1)||``,e):e},strict:!1}),cH=new xi((e,t)=>{if(e.next!=$V){e.next<0&&t.context&&e.acceptToken(OV);return}e.advance();let n=e.next==tH;n&&e.advance();let r=QV(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?AV:kV);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(TV);if(i&&KV[i])return e.acceptToken(OV,-2);if(t.dialectEnabled(UV))return e.acceptToken(EV);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(DV)}else{if(r==`script`)return e.acceptToken(xV);if(r==`style`)return e.acceptToken(SV);if(r==`textarea`)return e.acceptToken(CV);if(GV.hasOwnProperty(r))return e.acceptToken(wV);i&&qV[i]&&qV[i][r]?e.acceptToken(OV,-1):e.acceptToken(bV)}},{contextual:!0}),lH=new xi(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(jV);break}if(e.next==iH)t++;else if(e.next==eH&&t>=2){n>=3&&e.acceptToken(jV,-2);break}else t=0;e.advance()}});function uH(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var dH=new xi((e,t)=>{if(e.next==tH&&e.peek(1)==eH){let n=t.dialectEnabled(WV)||uH(t.context);e.acceptToken(n?yV:vV,2)}else e.next==eH&&e.acceptToken(vV,1)});function fH(e,t,n){let r=2+e.length;return new xi(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==$V||a==1&&i.next==tH||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==eH){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var pH=fH(`script`,fV,pV),mH=fH(`style`,mV,hV),hH=fH(`textarea`,gV,_V),gH=jr({"Text RawText IncompleteTag IncompleteCloseTag":q.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":q.angleBracket,TagName:q.tagName,"MismatchedCloseTag/TagName":[q.tagName,q.invalid],AttributeName:q.attributeName,"AttributeValue UnquotedAttributeValue":q.attributeValue,Is:q.definitionOperator,"EntityReference CharacterReference":q.character,Comment:q.blockComment,ProcessingInst:q.processingInstruction,DoctypeDecl:q.documentMeta}),_H=Si.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:sH,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[gH],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pH,mH,hH,dH,cH,lH,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function vH(e,t){let n=Object.create(null);for(let r of e.getChildren(PV)){let e=r.getChild(FV),i=r.getChild(IV)||r.getChild(LV);e&&(n[t.read(e.from,e.to)]=i?i.type.id==IV?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function yH(e,t){let n=e.getChild(NV);return n?t.read(n.from,n.to):` `}function bH(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=vH(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function xH(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return di((e,t)=>{let s=e.type.id;if(s==RV)return bH(e,t,n);if(s==zV)return bH(e,t,r);if(s==BV)return bH(e,t,i);if(s==MV&&a.length){let n=e.node,r=n.firstChild,i=r&&yH(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=vH(r,t)))){let t=n.lastChild,i=t.type.id==HV?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==PV){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=yH(n.parent,t))continue;let e=n.lastChild;if(e.type.id==IV){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==LV)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var SH=316,CH=317,wH=1,TH=2,EH=3,DH=4,OH=318,kH=320,AH=321,jH=5,MH=6,NH=0,PH=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],FH=125,IH=59,LH=47,RH=42,zH=43,BH=45,VH=60,HH=44,UH=63,WH=46,GH=91,KH=new Ci({start:!1,shift(e,t){return t==jH||t==MH||t==kH?e:t==AH},strict:!1}),qH=new xi((e,t)=>{let{next:n}=e;(n==FH||n==-1||t.context)&&e.acceptToken(OH)},{contextual:!0,fallback:!0}),JH=new xi((e,t)=>{let{next:n}=e,r;PH.indexOf(n)>-1||n==LH&&((r=e.peek(1))==LH||r==RH)||n!=FH&&n!=IH&&n!=-1&&!t.context&&e.acceptToken(SH)},{contextual:!0}),YH=new xi((e,t)=>{e.next==GH&&!t.context&&e.acceptToken(CH)},{contextual:!0}),XH=new xi((e,t)=>{let{next:n}=e;if(n==zH||n==BH){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(wH);e.acceptToken(n?wH:TH)}}else n==UH&&e.peek(1)==WH&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(EH))},{contextual:!0});function ZH(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var QH=new xi((e,t)=>{if(e.next!=VH||!t.dialectEnabled(NH)||(e.advance(),e.next==LH))return;let n=0;for(;PH.indexOf(e.next)>-1;)e.advance(),n++;if(ZH(e.next,!0)){for(e.advance(),n++;ZH(e.next,!1);)e.advance(),n++;for(;PH.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==HH)return;for(let t=0;;t++){if(t==7){if(!ZH(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(DH,-n)}),$H=jr({"get set async static":q.modifier,"for while do if else switch try catch finally return throw break continue default case defer":q.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":q.operatorKeyword,"let var const using function class extends":q.definitionKeyword,"import export from":q.moduleKeyword,"with debugger new":q.keyword,TemplateString:q.special(q.string),super:q.atom,BooleanLiteral:q.bool,this:q.self,null:q.null,Star:q.modifier,VariableName:q.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":q.function(q.variableName),VariableDefinition:q.definition(q.variableName),Label:q.labelName,PropertyName:q.propertyName,PrivatePropertyName:q.special(q.propertyName),"CallExpression/MemberExpression/PropertyName":q.function(q.propertyName),"FunctionDeclaration/VariableDefinition":q.function(q.definition(q.variableName)),"ClassDeclaration/VariableDefinition":q.definition(q.className),"NewExpression/VariableName":q.className,PropertyDefinition:q.definition(q.propertyName),PrivatePropertyDefinition:q.definition(q.special(q.propertyName)),UpdateOp:q.updateOperator,"LineComment Hashbang":q.lineComment,BlockComment:q.blockComment,Number:q.number,String:q.string,Escape:q.escape,ArithOp:q.arithmeticOperator,LogicOp:q.logicOperator,BitOp:q.bitwiseOperator,CompareOp:q.compareOperator,RegExp:q.regexp,Equals:q.definitionOperator,Arrow:q.function(q.punctuation),": Spread":q.punctuation,"( )":q.paren,"[ ]":q.squareBracket,"{ }":q.brace,"InterpolationStart InterpolationEnd":q.special(q.brace),".":q.derefOperator,", ;":q.separator,"@":q.meta,TypeName:q.typeName,TypeDefinition:q.definition(q.typeName),"type enum interface implements namespace module declare":q.definitionKeyword,"abstract global Privacy readonly override":q.modifier,"is keyof unique infer asserts":q.operatorKeyword,JSXAttributeValue:q.attributeValue,JSXText:q.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":q.angleBracket,"JSXIdentifier JSXNameSpacedName":q.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":q.attributeName,"JSXBuiltin/JSXIdentifier":q.standard(q.tagName)}),eU={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},tU={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},nU={__proto__:null,"<":193},rU=Si.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:KH,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[$H],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[JH,YH,XH,QH,2,3,4,5,6,7,8,9,10,11,12,13,14,qH,new bi("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new bi(`j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~`,25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>eU[e]||-1},{term:343,get:e=>tU[e]||-1},{term:95,get:e=>nU[e]||-1}],tokenPrec:15201}),iU=[Ti("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),Ti("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),Ti("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),Ti(`do {
@@ -58,4 +58,4 @@ body{background:var(--background);color:var(--foreground)}
58
58
  </style>`}function qZ(e){return`<script>(function(){var d=document.documentElement;${e===`dark`?`d.classList.add('dark');`:``}addEventListener('message',function(e){if(e.source!==parent)return;var t=e&&e.data&&e.data.${zZ};if(t==='dark'){d.classList.add('dark');}else if(t==='light'){d.classList.remove('dark');}});var raf;function report(){var b=document.body;if(!b)return;var r=b.getBoundingClientRect();var mb=parseFloat(getComputedStyle(b).marginBottom)||0;parent.postMessage({${VZ}:Math.ceil(r.bottom+mb)},'*');}function schedule(){if(raf){cancelAnimationFrame(raf);}raf=requestAnimationFrame(report);}function init(){schedule();addEventListener('load',schedule);if(window.ResizeObserver){try{new ResizeObserver(schedule).observe(document.body);}catch(_e){}}}if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',init);}else{init();}})();<\/script>`}function JZ(e){switch(e){case`cdn-allowlist`:return`script-src 'unsafe-inline' ${UZ.join(` `)}`;case`inline-only`:return`script-src 'unsafe-inline'`;default:throw Error(`Unhandled preview script-src policy: ${JSON.stringify(e)}`)}}function YZ(e,t){return`<meta http-equiv="Content-Security-Policy" content="${`default-src 'none'; ${JZ(e)}; style-src 'unsafe-inline' data:; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'; child-src 'none'; form-action 'none'; base-uri 'none';`}">
59
59
  ${KZ()}
60
60
  ${WZ}
61
- ${qZ(t)}`}var XZ=`plaintext`;function ZZ(){return typeof document<`u`&&document.documentElement.classList.contains(`dark`)?`dark`:`light`}function QZ(e,t){let n=(0,J.c)(4),[r,i]=(0,Y.useState)(!1),a,o;return n[0]!==e||n[1]!==t?(a=()=>{let n=()=>{let n=typeof t==`function`?t():void 0;if(typeof n!=`number`)return;let r=e.state.doc.nodeAt(n);if(!r)return;let{from:a,to:o}=e.state.selection,s=n,c=a<n+r.nodeSize&&o>s;i(e=>e===c?e:c)};return n(),e.on(`selectionUpdate`,n),()=>{e.isDestroyed||e.off(`selectionUpdate`,n)}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Y.useEffect)(a,o),r}function $Z(e){let t=(0,J.c)(172),{node:n,updateAttributes:r,editor:a,getPos:s,selected:c}=e,{_:l}=i(),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(!1),m=(0,Y.useRef)(null),h=(0,Y.useRef)(null),g=(0,Y.useRef)(null),[_,v]=(0,Y.useState)(null),{resolvedTheme:y}=He(),b;t[0]===y?b=t[1]:(b=y===`dark`||y===`light`?y:ZZ(),t[0]=y,t[1]=b);let x=b,[S]=(0,Y.useState)(ZZ),{merged:C}=eF(),w=C?.preview?.scriptSrc??`cdn-allowlist`,T=n.attrs.language??null,E=n.attrs.meta??null,D;t[2]===E?D=t[3]:(D=IZ(E),t[2]=E,t[3]=D);let O=D,[k,A]=(0,Y.useState)(!1),[j,M]=(0,Y.useState)(!1),N=(0,Y.useId)(),P=`${N}-title-input`,F=`${N}-title-help`,I=(0,Y.useRef)(E),L,ee;t[4]===E?(L=t[5],ee=t[6]):(L=()=>{I.current=E},ee=[E],t[4]=E,t[5]=L,t[6]=ee),(0,Y.useEffect)(L,ee);let R,z,B,V,H;if(t[7]!==l||t[8]!==T||t[9]!==E){z=yZ(T),R=T?_Z.find(e=>e.value===z)?.label??T:l({id:`LpB85N`});let e;t[15]===E?e=t[16]:(e=CZ(E,`preview`),t[15]=E,t[16]=e),V=e,B=z?EZ.has(z):!1,H=DZ(z,E),t[7]=l,t[8]=T,t[9]=E,t[10]=R,t[11]=z,t[12]=B,t[13]=V,t[14]=H}else R=t[10],z=t[11],B=t[12],V=t[13],H=t[14];let U=H,te;t[17]!==U||t[18]!==E?(te=U?MZ(E):null,t[17]=U,t[18]=E,t[19]=te):te=t[19];let ne=te,re;t[20]!==U||t[21]!==E?(re=U?NZ(E):null,t[20]=U,t[21]=E,t[22]=re):re=t[22];let ie=re,ae=ne??(_===null?void 0:`${_}px`),W=!U,oe,se;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>()=>{m.current!==null&&window.clearTimeout(m.current)},se=[],t[23]=oe,t[24]=se):(oe=t[23],se=t[24]),(0,Y.useEffect)(oe,se);let G=a.isEditable,ce=QZ(a,s),le,ue;t[25]===x?(le=t[26],ue=t[27]):(le=()=>{g.current?.contentWindow?.postMessage(BZ(x),`*`)},ue=[x],t[25]=x,t[26]=le,t[27]=ue),(0,Y.useEffect)(le,ue);let de,fe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>{let e=function(e){if(e.source!==g.current?.contentWindow)return;let t=HZ(e.data);t!==null&&v(e=>e!==null&&Math.abs(e-t)<=2?e:t)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},fe=[],t[28]=de,t[29]=fe):(de=t[28],fe=t[29]),(0,Y.useEffect)(de,fe);let pe;t[30]===n.textContent?pe=t[31]:(pe=()=>{let e=n.textContent,t=()=>{p(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>p(!1),1200)};try{typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e).then(t,rQ)}catch{}},t[30]=n.textContent,t[31]=pe);let me=pe,he;t[32]!==a||t[33]!==s?(he=()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{a.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[CodeBlockView] delete failed — position race`,t)}},t[32]=a,t[33]=s,t[34]=he):he=t[34];let ge=he,_e;t[35]!==V||t[36]!==E||t[37]!==r?(_e=()=>{r({meta:V?TZ(E,`preview`):wZ(E,`preview`)})},t[35]=V,t[36]=E,t[37]=r,t[38]=_e):_e=t[38];let ve=_e,ye;t[39]!==E||t[40]!==r?(ye=e=>{let t=LZ(E,e.length>0?e:null);t!==E&&r({meta:t})},t[39]=E,t[40]=r,t[41]=ye):ye=t[41];let be=ye,xe;t[42]!==a.state||t[43]!==a.view||t[44]!==s||t[45]!==n.attrs||t[46]!==n.nodeSize||t[47]!==n.type?(xe=e=>{let t=typeof s==`function`?s():void 0;if(typeof t==`number`)try{let{schema:r,tr:i}=a.state,o=n.type.create(n.attrs,e.length>0?r.text(e):null);i.replaceWith(t,t+n.nodeSize,o),a.view.dispatch(i)}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[CodeBlockView] edit-save failed — position race`,t)}},t[42]=a.state,t[43]=a.view,t[44]=s,t[45]=n.attrs,t[46]=n.nodeSize,t[47]=n.type,t[48]=xe):xe=t[48];let Se=xe,Ce;t[49]===r?Ce=t[50]:(Ce=e=>{let t=`${Math.round(e.width)}px`,n=`${Math.round(e.height)}px`;r({meta:jZ(jZ(I.current,`h`,n),`w`,t)})},t[49]=r,t[50]=Ce);let we=Ce,Te=T??void 0,Ee=ce?`true`:void 0,De=c?`true`:void 0,Oe=U?`true`:void 0,ke=W?`true`:`false`,Ae;t[51]!==l||t[52]!==x||t[53]!==S||t[54]!==W||t[55]!==ae||t[56]!==we||t[57]!==n.textContent||t[58]!==U||t[59]!==w||t[60]!==ie?(Ae=U?(0,X.jsxs)(`div`,{ref:h,className:vn(`ok-codeblock-preview`,W?`ok-codeblock-preview--with-code`:`ok-codeblock-preview--solo`),contentEditable:!1,style:{...ae?{height:ae}:{},...ie?{width:ie}:{}},onMouseDown:nQ,children:[(0,X.jsx)(`iframe`,{title:l({id:`G7cMuO`}),ref:g,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,srcDoc:YZ(w,S)+n.textContent,className:`ok-codeblock-preview-frame`,onLoad:()=>{g.current?.contentWindow?.postMessage(BZ(x),`*`)}}),(0,X.jsx)(ak,{targetRef:h,bounds:{minWidth:192,maxWidth:Math.round(window.innerWidth*.9),minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=h.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:we})]}):null,t[51]=l,t[52]=x,t[53]=S,t[54]=W,t[55]=ae,t[56]=we,t[57]=n.textContent,t[58]=U,t[59]=w,t[60]=ie,t[61]=Ae):Ae=t[61];let je;t[62]===O?je=t[63]:(je=O?(0,X.jsx)(`div`,{className:`ok-codeblock-title`,contentEditable:!1,"data-testid":`ok-codeblock-title`,title:O,children:(0,X.jsx)(`span`,{className:`ok-codeblock-title-text`,children:O})}):null,t[62]=O,t[63]=je);let Me=U&&W?`rounded-b-lg`:null,Ne=U?null:`rounded-lg`,Pe;t[64]!==Me||t[65]!==Ne?(Pe=vn(`ok-codeblock-pre m-0 overflow-x-auto px-5 py-4 font-mono text-sm leading-relaxed`,Me,Ne),t[64]=Me,t[65]=Ne,t[66]=Pe):Pe=t[66];let Fe=!W||void 0,Ie=T?`language-${T}`:void 0,Le;t[67]===Ie?Le=t[68]:(Le=vn(`hljs block whitespace-pre bg-transparent p-0`,Ie),t[67]=Ie,t[68]=Le);let Re;t[69]===Le?Re=t[70]:(Re=(0,X.jsx)(Jl,{as:`code`,className:Le}),t[69]=Le,t[70]=Re);let ze;t[71]!==Pe||t[72]!==Fe||t[73]!==Re?(ze=(0,X.jsx)(`pre`,{className:Pe,"aria-hidden":Fe,children:Re}),t[71]=Pe,t[72]=Fe,t[73]=Re,t[74]=ze):ze=t[74];let Be;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Be={[fF]:`true`},t[75]=Be):Be=t[75];let Ve=!G,Ue;t[76]!==l||t[77]!==R?(Ue=l({id:`c5f7sm`,values:{currentLabel:R}}),t[76]=l,t[77]=R,t[78]=Ue):Ue=t[78];let We;t[79]===R?We=t[80]:(We=(0,X.jsx)(`span`,{children:R}),t[79]=R,t[80]=We);let Ge;t[81]===G?Ge=t[82]:(Ge=G?(0,X.jsx)(Ri,{className:`size-3 opacity-60`,"aria-hidden":`true`}):null,t[81]=G,t[82]=Ge);let Ke;t[83]!==Ve||t[84]!==Ue||t[85]!==We||t[86]!==Ge?(Ke=(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,disabled:Ve,className:`ok-codeblock-chrome-btn ok-codeblock-chrome-lang`,"aria-label":Ue,children:[We,Ge]})}),t[83]=Ve,t[84]=Ue,t[85]=We,t[86]=Ge,t[87]=Ke):Ke=t[87];let qe;t[88]===l?qe=t[89]:(qe=l({id:`G_mWXb`}),t[88]=l,t[89]=qe);let Je;t[90]===qe?Je=t[91]:(Je=(0,X.jsx)(lx,{placeholder:qe}),t[90]=qe,t[91]=Je);let Ye;t[92]===l?Ye=t[93]:(Ye=l({id:`ETyvvg`}),t[92]=l,t[93]=Ye);let Xe;t[94]===Ye?Xe=t[95]:(Xe=(0,X.jsx)(dx,{children:Ye}),t[94]=Ye,t[95]=Xe);let Ze;t[96]!==a.commands||t[97]!==z||t[98]!==T||t[99]!==r?(Ze=_Z.map(e=>{let t=e.value===XZ?!T||z===XZ:z===e.value;return(0,X.jsxs)(px,{value:`${e.label} ${e.value} ${e.aliases?.join(` `)??``}`,onSelect:()=>{r({language:e.value===XZ?null:e.value}),d(!1),a.commands.focus()},children:[(0,X.jsx)(`span`,{className:`flex-1`,children:e.label}),t?(0,X.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}):null]},e.value)}),t[96]=a.commands,t[97]=z,t[98]=T,t[99]=r,t[100]=Ze):Ze=t[100];let Qe;t[101]===Ze?Qe=t[102]:(Qe=(0,X.jsx)(fx,{children:Ze}),t[101]=Ze,t[102]=Qe);let $e;t[103]!==Xe||t[104]!==Qe?($e=(0,X.jsxs)(ux,{children:[Xe,Qe]}),t[103]=Xe,t[104]=Qe,t[105]=$e):$e=t[105];let et;t[106]!==Je||t[107]!==$e?(et=(0,X.jsx)(xc,{align:`end`,sideOffset:6,className:`w-56 p-0`,children:(0,X.jsxs)(sx,{filter:eQ,children:[Je,$e]})}),t[106]=Je,t[107]=$e,t[108]=et):et=t[108];let tt;t[109]!==u||t[110]!==Ke||t[111]!==et?(tt=(0,X.jsxs)(yc,{open:u,onOpenChange:d,children:[Ke,et]}),t[109]=u,t[110]=Ke,t[111]=et,t[112]=tt):tt=t[112];let nt;t[113]!==l||t[114]!==G||t[115]!==U?(nt=G&&U?(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"aria-label":l({id:`R3y75Z`}),"data-testid":`ok-codeblock-edit-btn`,onClick:()=>M(!0),children:(0,X.jsx)(Oa,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[113]=l,t[114]=G,t[115]=U,t[116]=nt):nt=t[116];let rt;t[117]!==l||t[118]!==G||t[119]!==ve||t[120]!==B||t[121]!==V?(rt=G&&B?(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"data-active":V?`true`:void 0,"aria-pressed":V,"aria-label":l(V?{id:`xHGM4U`}:{id:`7OwvEL`}),onClick:ve,children:V?(0,X.jsx)(Xi,{className:`size-3.5`}):(0,X.jsx)(Zi,{className:`size-3.5`})}):null,t[117]=l,t[118]=G,t[119]=ve,t[120]=B,t[121]=V,t[122]=rt):rt=t[122];let it;t[123]!==l||t[124]!==G||t[125]!==be||t[126]!==k||t[127]!==O||t[128]!==F||t[129]!==P?(it=G?(0,X.jsxs)(yc,{open:k,onOpenChange:A,children:[(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"data-active":O?`true`:void 0,"aria-label":l({id:`DDTdLl`}),children:(0,X.jsx)(Ma,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,X.jsx)(xc,{align:`end`,sideOffset:6,className:`w-64 p-3`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:P,className:`text-2xs font-mono uppercase tracking-wide text-muted-foreground`,children:(0,X.jsx)(o,{id:`MHrjPM`})}),(0,X.jsx)(ir,{id:P,type:`text`,value:O??``,placeholder:l({id:`mk2poV`}),"data-testid":`ok-codeblock-title-input`,"aria-describedby":F,onChange:e=>be(e.target.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`Escape`)&&(e.preventDefault(),A(!1))},className:`h-8`}),(0,X.jsx)(`p`,{id:F,className:`text-2xs text-muted-foreground`,children:(0,X.jsx)(o,{id:`lond3p`})})]})})]}):null,t[123]=l,t[124]=G,t[125]=be,t[126]=k,t[127]=O,t[128]=F,t[129]=P,t[130]=it):it=t[130];let at;t[131]!==l||t[132]!==f?(at=l(f?{id:`6V3Ea3`}:{id:`NmPNJJ`}),t[131]=l,t[132]=f,t[133]=at):at=t[133];let ot;t[134]===f?ot=t[135]:(ot=f?(0,X.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}):(0,X.jsx)(qi,{className:`size-3.5`,"aria-hidden":`true`}),t[134]=f,t[135]=ot);let st;t[136]!==me||t[137]!==at||t[138]!==ot?(st=(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"aria-label":at,onClick:me,children:ot}),t[136]=me,t[137]=at,t[138]=ot,t[139]=st):st=t[139];let ct;t[140]!==l||t[141]!==G||t[142]!==ge?(ct=G?(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn ok-codeblock-chrome-btn--delete`,"aria-label":l({id:`oBXkm2`}),onClick:ge,children:(0,X.jsx)(Ha,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[140]=l,t[141]=G,t[142]=ge,t[143]=ct):ct=t[143];let lt;t[144]!==tt||t[145]!==nt||t[146]!==rt||t[147]!==it||t[148]!==st||t[149]!==ct?(lt=(0,X.jsxs)(`div`,{className:`ok-codeblock-chrome`,contentEditable:!1,onMouseDown:tQ,...Be,children:[tt,nt,rt,it,st,ct]}),t[144]=tt,t[145]=nt,t[146]=rt,t[147]=it,t[148]=st,t[149]=ct,t[150]=lt):lt=t[150];let ut;t[151]!==l||t[152]!==S||t[153]!==j||t[154]!==G||t[155]!==Se||t[156]!==n.textContent||t[157]!==z||t[158]!==U||t[159]!==w?(ut=G&&U?(0,X.jsx)(gZ,{open:j,onOpenChange:M,initialValue:n.textContent,language:z===`xml`?`html`:`plain`,title:l({id:`R3y75Z`}),renderPreview:e=>(0,X.jsx)(`iframe`,{title:l({id:`G7cMuO`}),sandbox:`allow-scripts`,className:`size-full border-0`,srcDoc:YZ(w,S)+e}),onSave:Se}):null,t[151]=l,t[152]=S,t[153]=j,t[154]=G,t[155]=Se,t[156]=n.textContent,t[157]=z,t[158]=U,t[159]=w,t[160]=ut):ut=t[160];let dt;return t[161]!==Te||t[162]!==Ee||t[163]!==De||t[164]!==Oe||t[165]!==ke||t[166]!==Ae||t[167]!==je||t[168]!==ze||t[169]!==lt||t[170]!==ut?(dt=(0,X.jsxs)(Yl,{className:`ok-codeblock relative my-3`,"data-language":Te,"data-cursor-inside":Ee,"data-selected":De,"data-preview":Oe,"data-code-visible":ke,children:[Ae,je,ze,lt,ut]}),t[161]=Te,t[162]=Ee,t[163]=De,t[164]=Oe,t[165]=ke,t[166]=Ae,t[167]=je,t[168]=ze,t[169]=lt,t[170]=ut,t[171]=dt):dt=t[171],dt}function eQ(e,t){return t?+!!e.toLowerCase().includes(t.toLowerCase()):1}function tQ(e){return e.stopPropagation()}function nQ(e){return e.stopPropagation()}function rQ(){}function iQ(e,t=[]){return e.flatMap(e=>{if(e.type===`text`)return[{text:e.value,classes:t}];let n=[...t,...e.properties?.className??[]];return iQ(e.children,n)})}function aQ(e){let{doc:t,name:n,lowlight:r,defaultLanguage:i}=e,a=[],o=r.listLanguages();return nt(t,e=>e.type.name===n).forEach(e=>{let t=e.pos+1,n=e.node.attrs.language||i;if(!n||!(o.includes(n)||(r.registered?.(n)??!1)))return;let s;try{s=r.highlight(n,e.node.textContent)}catch{return}let c=s.children??[];for(let e of iQ(c)){let n=t+e.text.length;e.classes.length>0&&a.push(ln.inline(t,n,{class:e.classes.join(` `)})),t=n}}),ye.create(t,a)}function oQ(e){let{name:t,lowlight:n,defaultLanguage:r}=e,i=new S({key:new b(`codeBlockLowlight`),state:{init:(e,{doc:i})=>aQ({doc:i,name:t,lowlight:n,defaultLanguage:r}),apply:(e,i,a,o)=>{if(!e.docChanged)return i.map(e.mapping,e.doc);let s=a.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=nt(a.doc,e=>e.type.name===t),u=nt(o.doc,e=>e.type.name===t);return[s,c].includes(t)||u.length!==l.length||e.steps.some(e=>{let t=e;return t.from===void 0||t.to===void 0?!1:l.some(e=>t.from<e.pos+e.node.nodeSize&&t.to>e.pos)})?aQ({doc:e.doc,name:t,lowlight:n,defaultLanguage:r}):i.map(e.mapping,e.doc)}},props:{decorations(e){return i.getState(e)}}});return i}var sQ=ZP(qP),cQ=Se.extend({addNodeView(){return ru($Z)},addProseMirrorPlugins(){return[...this.parent?.()??[],oQ({name:this.name,lowlight:sQ,defaultLanguage:null})]},addInputRules(){return[...this.parent?.()??[],$e({find:/^```$/,type:this.type,getAttributes:()=>({language:`js`})})]}});function lQ(e){return!!e.getMeta(Uv)}function uQ(e,t){let n=Uv.getState(e);return jy(n.doc,n.type,t,n.binding.mapping)||0}function dQ(e,t){let n=Uv.getState(e);return ky(t,n.type,n.binding.mapping)}var fQ=class e extends yt{constructor(e,t){super(e),this.yRelativePosition=t}static fromJSON(t){return new e(t.position,t.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function pQ(e,t){return new fQ(e,dQ(t,e))}function mQ(e,t,n){let r=e instanceof fQ?e.yRelativePosition:null;if(lQ(t)&&r)return{position:new fQ(uQ(n,r),r),mapResult:null};let i=It(e,t),a=i.position.position;return{position:new fQ(a,r??dQ(n,a)),mapResult:i.mapResult}}var hQ=Wt.create({name:`collaboration`,priority:1e3,addOptions(){return{document:null,field:`default`,fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(e=>e.name===`undoRedo`)&&console.warn(`[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".`)},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(e,t)=>mQ(e,t,this.editor.state),this.editor.utils.createMappablePosition=e=>pQ(e,this.editor.state)},addCommands(){return{undo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Wv.getState(t).undoManager.undoStack.length===0?!1:n?zy(t):!0),redo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Wv.getState(t).undoManager.redoStack.length===0?!1:n?By(t):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){let e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),t=Uy(this.options.yUndoOptions),n=t.spec.view;return t.spec.view=e=>{let{undoManager:t}=Wv.getState(e.state);t.restore&&=(t.restore(),()=>{});let r=n?n(e):void 0;return{destroy:()=>{let e=t.trackedOrigins.has(t),n=t._observers;t.restore=()=>{e&&t.trackedOrigins.add(t),t.doc.on(`afterTransaction`,t.afterTransactionHandler),t._observers=n},r?.destroy&&r.destroy()}}},[Qv(e,{...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender}),t,this.editor.options.enableContentCheck&&new S({key:new b(`filterInvalidContent`),filterTransaction:t=>{if(!lQ(t))return!0;if(this.storage.isDisabled)return!1;if(!t.docChanged)return!0;try{return t.doc.check(),!0}catch(t){return this.storage.isDisabled=!0,this.editor.emit(`contentError`,{error:t,editor:this.editor,disableCollaboration:()=>{var t;(t=e.doc)==null||t.destroy()}}),!1}}})].filter(Boolean)}});function gQ(e){if(!e.length)return ye.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push(ln.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),ye.create(n,t)}function _Q(e,t,n){let r=n.isText||n.isAtom?0:1;return{start:e+r,end:e+t-r}}function vQ(e,t,n,r={}){let i=[],a=e.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let s=new de(e,t,n),c=s.depth===0?0:a.resolve(s.start).posAtIndex(0);return s.parent.forEach((n,r)=>{let l=c+r,u=l+n.nodeSize,d=_Q(l,n.nodeSize,n),f=o?t.pos>=d.start&&e.pos<=d.end:t.pos>d.start&&e.pos<d.end;if(l<s.start||l>=s.end||!f)return;let p=new wt(a.resolve(l),a.resolve(u));i.push(p)}),i}var yQ=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new bQ(e.resolve(this.anchor),e.resolve(this.head))}},bQ=class e extends le{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=vQ(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){return new e(t.resolve(n.map(this.anchor)),t.resolve(n.map(this.head)))}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new yQ(this.anchor,this.head)}};bQ.prototype.visible=!1;function xQ(e){return e instanceof bQ}Wt.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!xQ(a)){let e=bQ.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!xQ(a)){let e=bQ.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=bQ.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;xQ(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new S({key:new b(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=bQ.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=xQ(r);if(e=!1,!t)return i?(e=!0,gQ(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=vQ(a,o,this.options.depth);return s.length?(e=!0,gQ(s)):null}}})]}});function SQ(e){let t=``,n=getComputedStyle(e);for(let e=0;e<n.length;e+=1)t+=`${n[e]}:${n.getPropertyValue(n[e])};`;return t}function CQ(e){let t=e.cloneNode(!0),n=[e,...Array.from(e.getElementsByTagName(`*`))],r=[t,...Array.from(t.getElementsByTagName(`*`))];return n.forEach((e,t)=>{r[t].style.cssText=SQ(e)}),t}var wQ=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`tableStructure`,evaluate:({node:e,parent:t})=>[`tableRow`,`tableCell`,`tableHeader`].includes(e.type.name)||t&&t.type.name===`tableHeader`?1e3:0},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],TQ={edges:[`left`,`top`],threshold:12,strength:500};function EQ(e){return e===void 0||e===`left`?{...TQ}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...TQ,...e}}function DQ(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`?r.bottom-e.y<i:!1)}function OQ(e,t,n,r){return!t||n.edges.length===0?0:DQ(e,t,n)?n.strength*r:0}var kQ=1e3;function AQ(e,t,n,r){let i=kQ,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=OQ(r,o,n,e.depth),i<=0?-1:i}function jQ(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function MQ(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...wQ),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!jQ(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=AQ({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null),c=a.nodeAfter;if(c&&c.isAtom&&!c.isInline){let i=r.pos,l=a.depth+1,u=a.parent,d=a.index(),f=u.childCount,p=!0;if(n.allowedContainers&&(p=jQ(a,l,n.allowedContainers)),p){let r=AQ({node:c,pos:i,depth:l,parent:u,index:d,isFirst:d===0,isLast:d===f-1,$pos:a,view:e},o,n.edgeDetection,t);if(r>=0){let t=e.nodeDOM(i);t&&s.push({node:c,pos:i,depth:l,score:r,dom:t})}}}if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let l=s[0];return l.dom?{node:l.node,pos:l.pos,dom:l.dom}:null}function NQ(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;return n?.parentElement===t.dom?n:void 0}function PQ(e){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function FQ(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return null;let s=a.getBoundingClientRect(),c=o.getBoundingClientRect();if(!PQ(s)||!PQ(c))return null;let l=Math.min(Math.max(s.top+r,n),c.bottom-r),u=.5,d=Math.abs(s.left-c.left)<u,f=Math.abs(s.right-c.right)<u,p=s;d&&f&&(p=s);let m=Math.min(Math.max(p.left+r,t),p.right-r);return!Number.isFinite(m)||!Number.isFinite(l)?null:{x:m,y:l}}var IQ=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=FQ(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=MQ(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=NQ(e,a);return t?(d=t,!0):!1}),!d){let e=a.posAtCoords({left:c,top:l});if(e){let t=o.doc.resolve(e.pos),n=Math.min(t.depth,1),r=n>0?t.before(n):t.pos,i=o.doc.nodeAt(r);if(i){let e=a.nodeDOM(r);return{resultElement:e instanceof HTMLElement?e:null,resultNode:i,pos:r}}}return{resultElement:null,resultNode:null,pos:null}}let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function LQ(e,t){let n=null,r=e.nodeDOM(t);if(r instanceof Element)n=r;else{let{node:r,offset:i}=e.domAtPos(t),a=r.childNodes[i];a instanceof Element?n=a:r instanceof Element?n=r:r.nodeType===Node.TEXT_NODE&&r.parentElement&&(n=r.parentElement)}return(n?getComputedStyle(n).direction:getComputedStyle(e.dom).direction)||`ltr`}function RQ(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function zQ(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=IQ({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});if(!a.resultNode||a.pos===null)return[];let o=a.resultNode.isText||a.resultNode.isAtom?0:-1;return vQ(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize+o),0,{extendOnBoundaryOverlap:!1})}function BQ(e,t,n,r){let{view:i}=t;if(!e.dataTransfer)return;let{empty:a,$from:o,$to:s}=i.state.selection,c=zQ(e,t,n,r),l=vQ(o,s,0,{extendOnBoundaryOverlap:!1}),u=l.some(e=>c.find(t=>t.$from===e.$from&&t.$to===e.$to)),d=a||!u?c:l;if(!d.length)return;let{tr:f}=i.state,p=document.createElement(`div`),m=d[0].$from.pos,h=d[d.length-1].$to.pos;p.setAttribute(`dir`,LQ(i,m));let g=n?.enabled&&r?.node,_,v;g?(_=i.state.doc.slice(m,h),v=we.create(i.state.doc,m)):(v=bQ.create(i.state.doc,m,h),_=v.content()),d.forEach(e=>{let t=CQ(i.nodeDOM(e.$from.pos));p.append(t)}),p.style.position=`absolute`,p.style.top=`-10000px`,p.style.contentVisibility=`visible`,document.body.append(p);for(let e of p.querySelectorAll(`*`))e.style&&e.style.contentVisibility===`auto`&&(e.style.contentVisibility=`visible`);e.dataTransfer.clearData();let y=p.getBoundingClientRect(),b=i.nodeDOM(m),x=b&&b.nodeType===1?b.getBoundingClientRect():null,S=x?Math.min(e.clientX-x.left,y.width):Math.max(0,Math.min(e.clientX-y.left,y.width)),C=x?Math.min(Math.max(e.clientY-x.top,0),y.height):0;e.dataTransfer.setDragImage(p,S,C);let w=!1,T=()=>{w||(w=!0,RQ(p),document.removeEventListener(`drop`,T),document.removeEventListener(`dragend`,T))},E=v instanceof we?v:void 0;i.dragging={slice:_,move:!0,node:E},f.setSelection(v),i.dispatch(f),document.addEventListener(`drop`,T),document.addEventListener(`dragend`,T)}var VQ=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},HQ=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a},UQ=(e,t)=>{let n=Uv.getState(e);return n?ky(t,n.type,n.binding.mapping):null},WQ=(e,t)=>{let n=Uv.getState(e);return n?jy(n.doc,n.type,t,n.binding.mapping)||0:-1},GQ=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},KQ=new b(`dragHandle`),qQ=({pluginKey:e=KQ,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c})=>{let l=document.createElement(`div`),u=!1,d=null,f=-1,p,m=null,h=null;function g(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function _(){if(t){if(!n.isEditable){g();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function v(e){Bt(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function y(e){o?.(e),BQ(e,n,c,{node:d,pos:f}),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function x(e){s?.(e),g(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function C(){if(At()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}}return l.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,x),document.removeEventListener(`drop`,C),m&&(cancelAnimationFrame(m),m=null,h=null)},plugin:new S({key:typeof e==`string`?new b(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(u=s),c)return g(),u=!1,d=null,f=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&f!==-1&&t)if(lQ(e)){let e=WQ(o,p);e!==f&&(f=e)}else{let t=e.mapping.map(f);t!==f&&(f=t,p=UQ(o,f))}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(l),l.style.pointerEvents=`none`,l.style.position=`absolute`,l.style.top=`0`,l.style.left=`0`,t.addEventListener(`dragstart`,y),t.addEventListener(`dragend`,x),document.addEventListener(`drop`,C),{update(r,i){if(!t)return;if(!n.isEditable){g();return}if(u?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||f===-1)return;let o=e.nodeDOM(f);if(o=GQ(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=HQ(n.state.doc,s),l=VQ(n.state.doc,s);d=c,f=l,p=UQ(e.state,f),a?.({editor:n,node:d,pos:f}),v(o)},destroy(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,x),document.removeEventListener(`drop`,C),m&&(cancelAnimationFrame(m),m=null,h=null),t&&RQ(l)}}},props:{handleDOMEvents:{keydown(e){return!t||u?!1:e.hasFocus()?(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return u||t.target&&!l.contains(t.relatedTarget)&&(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||u||(h={x:r.clientX,y:r.clientY},m)||(m=requestAnimationFrame(()=>{if(m=null,!h)return;let{x:t,y:r}=h;h=null;let i=IQ({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=GQ(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=HQ(n.state.doc,t),l=VQ(n.state.doc,t)}s!==d&&(d=s,f=l??-1,p=UQ(e.state,f),a?.({editor:n,node:d,pos:f}),v(o),_())})),!1}}}})}};function JQ(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:EQ(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:EQ(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:EQ(e.edgeDetection)}}var YQ={placement:`left-start`,strategy:`absolute`};Wt.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render(),t=JQ(this.options.nested);return[qQ({computePositionConfig:{...YQ,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t}).plugin]}});var XQ=20,ZQ=44,QQ=28;function $Q(e){if(!e)return`Select block`;if(e.type.name===`jsxComponent`){let t=e.attrs.componentName??``;if(t){let e=rM(t),n=e.name===`*`?t:e.displayName??e.name;if(n)return`Select ${n}`}}return`Select ${e.type.name}`}function e$(){let e=document.createElement(`div`);e.className=`ok-block-controls`,e.setAttribute(fF,`true`),e.style.visibility=`hidden`;let t=document.createElement(`button`);t.className=`ok-add-block-btn`,t.setAttribute(`aria-label`,`Add block below`),t.setAttribute(`type`,`button`),t.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,t.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()});let n=document.createElement(`button`);return n.className=`ok-drag-grip`,n.setAttribute(`type`,`button`),n.setAttribute(`aria-label`,`Select block`),n.setAttribute(`tabindex`,`-1`),n.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grip-vertical-icon lucide-grip-vertical"><circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/></svg>`,e.appendChild(t),e.appendChild(n),{container:e,addBtn:t,grip:n}}function t$(e,t,n){let{state:r,view:i}=e;if(n.type.name===`jsxComponent`){let i=n.attrs.componentName??``;if(i){let a=rM(i);if(a.emptyChildName){let i=t+1+n.content.size;if(i>r.doc.content.size)return;let o=a.emptyChildName;e.chain().focus().insertContentAt(i,lM(o)).run(),pM(e,i,rM(o));return}}}let a=t+n.nodeSize;if(a>r.doc.content.size)return;let{tr:o}=r,s=r.schema.nodes.paragraph?.create();if(!s)return;o.insert(a,s);let c=f.near(o.doc.resolve(a+1));o.setSelection(c).scrollIntoView(),i.dispatch(o),i.focus(),e.commands.insertContent(`/`)}var n$=Wt.create({name:`blockDragHandle`,addProseMirrorPlugins(){let e=this.editor,t=null,n=-1,{container:r,addBtn:i,grip:a}=e$();return i.addEventListener(`click`,()=>{t&&n>=0&&t$(e,n,t)}),a.addEventListener(`click`,()=>{if(n<0)return;let r=t,i=r?.type.name??`unknown`;try{e.chain().focus().setNodeSelection(n).run()||(Xt(i),console.warn(JSON.stringify({event:`block-grip-click-select-failed`,nodeType:i,componentName:String(r?.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){if(!(e instanceof RangeError))throw e;Xt(i),console.warn(JSON.stringify({event:`block-grip-click-select-failed`,nodeType:i,componentName:String(r?.attrs.componentName??``).slice(0,200),reason:e.message.slice(0,500)}))}}),[qQ({element:r,editor:e,onNodeChange({node:e,pos:r}){t=e,n=r??-1,a.setAttribute(`aria-label`,$Q(e))},computePositionConfig:{placement:`left-start`,strategy:`absolute`,middleware:[Ve(({rects:e})=>({mainAxis:10,crossAxis:((e.reference.height<=ZQ?e.reference.height:QQ)-XQ)/2}))]},nestedOptions:JQ(!1)}).plugin]}}),r$=/^#fn(?:ref)?-/,i$=Wt.create({name:`footnoteAnchorScroll`,addProseMirrorPlugins(){return[new S({props:{handleDOMEvents:{click(e,t){let n=t.target;if(!(n instanceof Element))return!1;let r=n.closest(`a[href^="#fn"]`);if(!(r instanceof HTMLAnchorElement))return!1;let i=r.getAttribute(`href`)??``;if(!r$.test(i))return!1;let a=i.slice(1);t.preventDefault();let o=e.dom.ownerDocument.getElementById(a);return o&&o.scrollIntoView({behavior:`smooth`,block:`start`}),!0}}}})]}}),a$=Wt.create({name:`formattingShortcuts`,addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}}}),o$=Wt.create({name:`headingAnchors`,addProseMirrorPlugins(){return[new S({props:{decorations(e){let t=[],n=new Map;return e.doc.descendants((e,r)=>{if(e.type.name===`heading`){let i=Qt(e.textContent,n);if(!i)return;t.push(ln.node(r,r+e.nodeSize,{id:i}))}}),ye.create(e.doc,t)}}})]}});function s$(e){let t=(0,J.c)(8),{node:n,editor:r}=e,i=n.attrs.src,a=n.attrs.alt,o=n.attrs.title,s;if(t[0]!==r||t[1]!==i){let e=r?qD(r)??void 0:void 0;s=typeof i==`string`?Fe(Ct(i,e)):void 0,t[0]=r,t[1]=i,t[2]=s}else s=t[2];let c=s,l=typeof a==`string`?a:``,u=typeof o==`string`?o:void 0,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={sizes:void 0},t[3]=d):d=t[3];let f;return t[4]!==l||t[5]!==c||t[6]!==u?(f=(0,X.jsx)(Yl,{as:`span`,"data-image-inline-zoom":!0,"data-clipboard-inline-leaf":`image`,children:(0,X.jsx)(Uk,{wrapElement:`span`,zoomMargin:20,zoomImg:d,children:(0,X.jsx)(`img`,{src:c,alt:l,title:u})})}),t[4]=l,t[5]=c,t[6]=u,t[7]=f):f=t[7],f}var c$=Me.extend({addNodeView(){return ru(s$)}}),l$=new class{byExt=new Map;viewerUnregisterFns=new WeakMap;register(e){let t=this.viewerUnregisterFns.get(e);if(t)return t;for(let t of e.exts){let n=t.toLowerCase(),r=this.byExt.get(n);r&&r!==e&&console.warn(JSON.stringify({event:`asset-viewer-collision`,ext:n,priorExts:r.exts,newExts:e.exts})),this.byExt.set(n,e)}let n=!1,r=()=>{if(!n){n=!0;for(let t of e.exts){let n=t.toLowerCase();this.byExt.get(n)===e&&this.byExt.delete(n)}this.viewerUnregisterFns.delete(e)}};return this.viewerUnregisterFns.set(e,r),r}lookup(e){let t=this.byExt.get(e.toLowerCase());return t?{ok:!0,viewer:t}:{ok:!1}}clearForTests(){this.byExt.clear(),this.viewerUnregisterFns=new WeakMap}get size(){return this.byExt.size}};function u$(e){globalThis.window?.open(e,`_blank`,`noopener,noreferrer`)}async function d$(e,t={}){let n=t.registry??l$,r=`desktopBridge`in t?t.desktopBridge:globalThis.window?.okDesktop,i=t.openUrl??u$;if(!e.forceOsDelegation){let t=n.lookup(e.ext);if(t.ok){t.viewer.render(e);return}}if(r){let t=await r.shell.openAsset(e.projectRelPath);t.ok||console.warn(`[asset-dispatch] openAsset refused:`,t.reason,{projectRelPath:e.projectRelPath,ext:e.ext});return}i(e.url)}function f$(e,t){let n=e;for(;n&&typeof n.hasAttribute==`function`;){if(n.hasAttribute(`data-wiki-embed`)){let e=n.getAttribute(`data-target`)??``;if(!e)return null;let r=_n(e,t);return r?{kind:n.tagName===`IMG`?`image`:`asset`,relPath:r,title:r.split(`/`).pop()??e}:null}if(n.hasAttribute(`data-wiki-link`)){let e=n.getAttribute(`data-target`)??``;return e?{kind:`wiki-link`,relPath:`${e}.md`,title:e}:null}if(n.tagName===`A`&&n.hasAttribute(`href`)){let e=oe(n.getAttribute(`href`)??``,t);if(e?.kind===`asset`){let n=_n(e.url,t);return n?{kind:`asset`,relPath:n,title:n.split(`/`).pop()??e.url}:null}}if(n.tagName===`IMG`){let e=n.getAttribute(`src`)??``;if(e){let n=oe(e,t);if(n?.kind===`asset`){let e=_n(n.url,t);return e?{kind:`image`,relPath:e,title:e.split(`/`).pop()??n.url}:null}}}n=n.parentElement}return null}var p$=new b(`asset-context-menu`);function m$(e){return new S({key:p$,view(t){let n=e.showAssetMenu??(e=>{let t=globalThis.window?.okDesktop;return t?t.shell.showAssetMenu({relPath:e.relPath,title:e.title,kind:e.kind}):Promise.resolve()}),r=t=>{if(!(t.target instanceof Element))return;let r=f$(t.target,e.sourceDocName);r&&(t.preventDefault(),n(r))};return t.dom.addEventListener(`contextmenu`,r),{destroy(){t.dom.removeEventListener(`contextmenu`,r)}}}})}var h$=e=>{let t=(0,J.c)(18),{kind:n,ariaLabel:r,onDeactivate:i,children:a,triggerReference:o,layout:s,className:c,"data-slot":l}=e,u=s===void 0?`standard`:s,d=(0,Y.useRef)(null),f,p;t[0]===o?(f=t[1],p=t[2]):(f=()=>{let e=d.current;if(e)return z(o,e,()=>{let t=o.getBoundingClientRect();e.isConnected&&(e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`)})},p=[o],t[0]=o,t[1]=f,t[2]=p),(0,Y.useLayoutEffect)(f,p);let m;t[3]===i?m=t[4]:(m=e=>{e||i()},t[3]=i,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(Sc,{asChild:!0,children:(0,X.jsx)(`span`,{ref:d,"aria-hidden":`true`,style:{position:`fixed`,pointerEvents:`none`,left:`-9999px`,top:`-9999px`,width:0,height:0}})}),t[5]=h):h=t[5];let g=u===`wide`?`w-[min(720px,calc(100%-1rem))]`:`w-80`,_;t[6]!==c||t[7]!==g?(_=vn(`ok-interaction-prop-panel pointer-events-auto p-3`,g,c),t[6]=c,t[7]=g,t[8]=_):_=t[8];let v;t[9]!==r||t[10]!==a||t[11]!==l||t[12]!==n||t[13]!==_?(v=(0,X.jsx)(xc,{side:`bottom`,align:`start`,sideOffset:8,collisionPadding:8,"aria-label":r,"data-ok-prop-panel":n,"data-slot":l,onOpenAutoFocus:g$,onCloseAutoFocus:_$,onPointerDownOutside:v$,onFocusOutside:y$,onInteractOutside:b$,className:_,children:a}),t[9]=r,t[10]=a,t[11]=l,t[12]=n,t[13]=_,t[14]=v):v=t[14];let y;return t[15]!==m||t[16]!==v?(y=(0,X.jsxs)(yc,{open:!0,onOpenChange:m,children:[h,v]}),t[15]=m,t[16]=v,t[17]=y):y=t[17],y};function g$(e){return e.preventDefault()}function _$(e){return e.preventDefault()}function v$(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function y$(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function b$(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function x$(e){let t=e.trim();return/\.(md|mdx)$/i.test(t)?t:`${t}.md`}function S$(e){let t=e.initialDir.trim().replace(/^\/+|\/+$/g,``),n=x$(e.suggestedName);return t?`${t}/${n}`:n}async function C$(e){let t=await hx(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create page`);if(!t.ok)throw Error(t.title);let n=e.replace(/\.(mdx|md)$/i,``);return{docName:gx(cn,t.body,`create-page`,{docName:n}).docName}}async function w$(e){return C$(S$(e))}async function T$(e,t){let{docName:n}=await w$(e);return t.addPage(n),Ft([`files`,`backlinks`,`graph`]),t.onCreated?.(n),{docName:n}}var E$=8;function D$(e){return e.trim().replace(/^\/+/,``).replace(/\.mdx?$/i,``).replace(/\/+$/g,``)}function O$(e){return k$(e)?D$(e.slice(1)).toLowerCase():null}function k$(e){return e.startsWith(`/`)&&!e.startsWith(`//`)}function A$(e){return e.split(`/`).at(-1)??e}function j$(e,t){if(!t)return 0;let n=e.toLowerCase(),r=A$(e).toLowerCase();return n===t?0:r===t?1:n.startsWith(t)?2:r.startsWith(t)?3:r.includes(t)?4:n.includes(t)?5:null}function M$(e){switch(e){case`page`:return 0;case`folder`:return 1;case`asset`:return 2}}function N$(e){let t=[],n=new Set;function r(e,r){let i=D$(r);if(!i)return;let a=`${e}:${i.toLowerCase()}`;n.has(a)||(n.add(a),t.push({kind:e,path:i}))}for(let t of e.pages)r(`page`,t);for(let t of e.folderPaths??[])r(`folder`,t);if(e.includeAssets)for(let t of e.assetPaths??[])r(`asset`,t);return t}function P$(e){let t=O$(e.value);if(t===null)return[];let n=[];for(let r of N$(e)){let e=j$(r.path,t);e!==null&&n.push({suggestion:r,score:e})}return n.sort((e,t)=>{if(e.score!==t.score)return e.score-t.score;let n=M$(e.suggestion.kind)-M$(t.suggestion.kind);return n===0?e.suggestion.path.localeCompare(t.suggestion.path):n}),n.slice(0,e.limit??E$).map(e=>e.suggestion)}function F$(e){switch(e){case`page`:return(0,X.jsx)($i,{className:`size-3.5 shrink-0`,"aria-hidden":`true`});case`folder`:return(0,X.jsx)(ia,{className:`size-3.5 shrink-0`,"aria-hidden":`true`});case`asset`:return(0,X.jsx)(Da,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})}}function I$(e,t){if(e){if(typeof e==`function`){e(t);return}e.current=t}}function L$(e){let t=(0,J.c)(52),n,r,a,o,s,l,u,d,f,p,m,h,g,_;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14]):({value:_,pages:p,folderPaths:a,assetPaths:n,includeAssets:h,loading:g,onValueChange:f,onKeyDown:u,onSuggestionSelect:d,onFocus:l,onBlur:s,className:r,ref:m,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_);let v=h===void 0?!1:h,y=g===void 0?!1:g,{_:b}=i(),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(0),D=(0,Y.useRef)(null),O=(0,Y.useRef)(null),k=(0,Y.useId)(),A=P$({value:_,pages:p,folderPaths:a,assetPaths:n,includeAssets:v}),j=A.map(H$).join(`\0`),M;t[15]===_?M=t[16]:(M=k$(_),t[15]=_,t[16]=M);let N=M,P=A.length>0,F=x&&!C&&N&&(P||y)||x&&!C&&N&&!y&&!P,I=Math.min(T,Math.max(A.length-1,0)),L=P?`${k}-option-${I}`:void 0,R;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{E(0)},t[17]=R):R=t[17],(0,Y.useEffect)(R,[j]);let B,V;t[18]!==L||t[19]!==F?(B=()=>{!F||!L||document.getElementById(L)?.scrollIntoView?.({block:`nearest`})},V=[L,F],t[18]=L,t[19]=F,t[20]=B,t[21]=V):(B=t[20],V=t[21]),(0,Y.useEffect)(B,V);let H,U;t[22]===F?(H=t[23],U=t[24]):(H=()=>{if(!F)return;let e=D.current,t=O.current;if(!e||!t)return;let n=e,r=t,i=function(){Bt(n,r,{placement:`bottom-start`,strategy:`fixed`,middleware:[Ve(4),ee({padding:8}),me({padding:8}),c({padding:8,apply(e){let{availableHeight:t,availableWidth:n,elements:r}=e;Object.assign(r.floating.style,{width:`${Math.min(480,n)}px`,maxHeight:`${Math.min(208,Math.max(96,t))}px`})}})]}).then(e=>{let{x:t,y:n}=e;r.isConnected&&Object.assign(r.style,{left:`${t}px`,top:`${n}px`})}).catch(e=>{r.isConnected&&console.warn(`[LinkPathSuggestionInput] computePosition failed`,e)})},a=z(n,r,i);return i(),a},U=[F],t[22]=F,t[23]=H,t[24]=U),(0,Y.useLayoutEffect)(H,U);let te;t[25]===m?te=t[26]:(te=function(e){D.current=e,I$(m,e)},t[25]=m,t[26]=te);let ne=te,re=function(e){d?d(e):f(e.path),w(!0),requestAnimationFrame(()=>D.current?.focus())},ie=function(e){if(P){if(e.key===`ArrowDown`){e.preventDefault(),E(e=>Math.min(e+1,A.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),E(V$);return}if(e.key===`Enter`){e.preventDefault();let t=A[I];t&&re(t);return}if(e.key===`Escape`){e.preventDefault(),w(!0);return}}if(F&&e.key===`Escape`){e.preventDefault(),w(!0);return}u?.(e)},ae;t[27]===b?ae=t[28]:(ae=function(e){switch(e){case`page`:return b({id:`6WdDG7`});case`folder`:return b({id:`kNqMMd`});case`asset`:return b({id:`bUUVED`})}},t[27]=b,t[28]=ae);let W=ae,oe=F?(0,X.jsx)(`div`,{ref:O,id:k,role:`listbox`,"aria-label":b({id:`mBltnd`}),className:`fixed z-70 max-h-52 overflow-y-auto overscroll-y-contain rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md subtle-scrollbar`,onWheel:B$,onTouchMove:z$,children:P?A.map((e,t)=>{let n=t===I,r=W(e.kind);return(0,X.jsxs)(Mn,{id:`${k}-option-${t}`,type:`button`,role:`option`,"aria-label":`/${e.path} ${r}`,"aria-selected":n,variant:`ghost`,className:vn(`h-auto w-full justify-start gap-2 rounded-sm px-2 py-1.5 text-left font-normal`,n&&`bg-accent text-accent-foreground`),onMouseDown:R$,onClick:()=>re(e),children:[F$(e.kind),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[`/`,e.path]}),(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:r})]},`${e.kind}:${e.path}`)}):(0,X.jsx)(`div`,{role:`status`,className:`px-2 py-1.5 text-muted-foreground text-sm`,children:b(y?{id:`sxTdZI`}:{id:`_QwkMu`})})}):null,se;t[29]===f?se=t[30]:(se=e=>{w(!1),f(e.target.value)},t[29]=f,t[30]=se);let G;t[31]===l?G=t[32]:(G=e=>{S(!0),l?.(e)},t[31]=l,t[32]=G);let ce;t[33]===s?ce=t[34]:(ce=e=>{S(!1),s?.(e)},t[33]=s,t[34]=ce);let le=F?k:void 0,ue;t[35]!==L||t[36]!==r||t[37]!==ie||t[38]!==o||t[39]!==ne||t[40]!==F||t[41]!==se||t[42]!==G||t[43]!==ce||t[44]!==le||t[45]!==_?(ue=(0,X.jsx)(ir,{...o,ref:ne,value:_,onChange:se,onFocus:G,onBlur:ce,onKeyDown:ie,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":F,"aria-controls":le,"aria-activedescendant":L,autoComplete:`off`,className:r}),t[35]=L,t[36]=r,t[37]=ie,t[38]=o,t[39]=ne,t[40]=F,t[41]=se,t[42]=G,t[43]=ce,t[44]=le,t[45]=_,t[46]=ue):ue=t[46];let de;t[47]===oe?de=t[48]:(de=oe&&typeof document<`u`?(0,Qa.createPortal)(oe,document.body):null,t[47]=oe,t[48]=de);let fe;return t[49]!==ue||t[50]!==de?(fe=(0,X.jsxs)(`div`,{className:`relative`,children:[ue,de]}),t[49]=ue,t[50]=de,t[51]=fe):fe=t[51],fe}function R$(e){return e.preventDefault()}function z$(e){e.stopPropagation()}function B$(e){e.stopPropagation()}function V$(e){return Math.max(e-1,0)}function H$(e){return`${e.kind}:${e.path}`}var U$=1500;function W$(e){let t=(0,J.c)(15),{copyContent:n}=e,[r,i]=(0,Y.useState)(!1),a=(0,Y.useRef)(null),o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{a.current!==null&&clearTimeout(a.current)},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,Y.useEffect)(o,s);let c;t[2]===n?c=t[3]:(c=()=>{try{typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(n).then(()=>{i(!0),a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>i(!1),U$)},G$)}catch{}},t[2]=n,t[3]=c);let l=c,u=r?`Copied!`:`Copy`,d;t[4]===r?d=t[5]:(d=r?(0,X.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}):(0,X.jsx)(qi,{className:`size-3.5`,"aria-hidden":`true`}),t[4]=r,t[5]=d);let f;t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":u,onClick:l,"data-slot":`prop-panel-copy`,children:d})}),t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9];let p=r?`Copied!`:`Copy`,m;t[10]===p?m=t[11]:(m=(0,X.jsx)(F,{children:p}),t[10]=p,t[11]=m);let h;return t[12]!==f||t[13]!==m?(h=(0,X.jsxs)(w,{children:[f,m]}),t[12]=f,t[13]=m,t[14]=h):h=t[14],h}function G$(){}function K$(e,t){return SO.getState(e)?.byId.get(t)??null}function q$(e){let{editor:t,layer:n,renderPropPanel:r,handlePrimary:i}=e;return{onRegister:e=>{n.register({type:e.markType,nodeId:e.id,controls:{propPanel:e=>r({editor:t,nodeId:e.nodeId,deactivate:e.deactivate})},handlePrimary:i?e=>i({editor:t,nodeId:e.nodeId,newTab:e.newTab}):void 0})},onDeregister:e=>{n.deregister(e)}}}function J$(e){let{editor:t,layer:n,markTypes:r,predicate:i,renderPropPanel:a,handlePrimary:o}=e,s=q$({editor:t,layer:n,renderPropPanel:a,handlePrimary:o});return DO({markTypes:[...r],predicate:i,onRegister:s.onRegister,onDeregister:s.onDeregister})}function Y$(e){let t=VO(e.editor);return J$({...e,layer:t})}function X$(e,t){let n=(0,J.c)(4),[r,i]=(0,Y.useState)(null),a,o;return n[0]!==e||n[1]!==t?(a=()=>{if(!t||!e){i(null);return}let n=!1;return i(null),MX(e).then(e=>{n||i(e)}).catch(()=>{n||i([])}),()=>{n=!0}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Y.useEffect)(a,o),r}function Z$(e,t){let n=e.trim();return n?n.startsWith(`#`)?`anchor`:mn(n)?`external`:`doc`:t}function Q$(e){return e?.kind===`doc`?`doc`:e?.kind===`anchor`?`anchor`:`external`}function $$(e){let t=(0,J.c)(84),{open:n,href:r,text:a,pages:s,folderPaths:c,loading:l,onOpenChange:u,onSave:d}=e,[f,p]=(0,Y.useState)(``),[m,h]=(0,Y.useState)(``),[g,_]=(0,Y.useState)(``),[v,y]=(0,Y.useState)(`doc`),b=(0,Y.useId)(),x=(0,Y.useId)(),S=(0,Y.useId)(),C=(0,Y.useId)(),{_:w}=i(),T=(0,Y.useRef)(!1),E=(0,Y.useRef)(``),D,O;t[0]!==r||t[1]!==n||t[2]!==a?(D=()=>{if(!n){T.current=!1;return}if(T.current)return;T.current=!0,E.current=a,_(a);let e=KY(r);if(y(Q$(e)),e?.kind===`doc`){p(e.docName),h(e.anchor??``);return}if(e?.kind===`anchor`){p(`#${e.anchor}`),h(``);return}p(e?.kind===`external`?e.url:r),h(``)},O=[n,r,a],t[0]=r,t[1]=n,t[2]=a,t[3]=D,t[4]=O):(D=t[3],O=t[4]),(0,Y.useEffect)(D,O);let k,A,j;t[5]!==v||t[6]!==f||t[7]!==s?(k=at(f),A=v===`doc`,j=A&&aO(k,s),t[5]=v,t[6]=f,t[7]=s,t[8]=k,t[9]=A,t[10]=j):(k=t[8],A=t[9],j=t[10]);let M=X$(k,j&&n),N=!!M?.length,P;t[11]!==k||t[12]!==A||t[13]!==m||t[14]!==g||t[15]!==f||t[16]!==u||t[17]!==d?(P=function(){let e=f.trim();e&&(d(A?tX(k,m.trim()||null):e,g,g.trim()!==E.current.trim()),u(!1))},t[11]=k,t[12]=A,t[13]=m,t[14]=g,t[15]=f,t[16]=u,t[17]=d,t[18]=P):P=t[18];let F=P,I;t[19]===F?I=t[20]:(I=function(e){e.key===`Enter`&&(e.preventDefault(),F())},t[19]=F,t[20]=I);let L=I,ee;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(e){p(e.path),y(`doc`),h(``)},t[21]=ee):ee=t[21];let R=ee,z;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(Bn,{children:(0,X.jsx)(o,{id:`B11p-O`})}),t[22]=z):z=t[22];let B;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,X.jsxs)(Qn,{children:[z,(0,X.jsx)(Rn,{children:(0,X.jsx)(o,{id:`RobAKV`})})]}),t[23]=B):B=t[23];let V;t[24]===A?V=t[25]:(V=A?(0,X.jsx)(o,{id:`6WdDG7`}):(0,X.jsx)(o,{id:`6vEr3W`}),t[24]=A,t[25]=V);let H;t[26]!==V||t[27]!==b?(H=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:b,children:V}),t[26]=V,t[27]=b,t[28]=H):H=t[28];let U;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{p(e),y(t=>Z$(e,t))},t[29]=U):U=t[29];let te;t[30]===w?te=t[31]:(te=w({id:`Xl-UUg`}),t[30]=w,t[31]=te);let ne;t[32]!==f||t[33]!==c||t[34]!==L||t[35]!==l||t[36]!==s||t[37]!==te||t[38]!==b?(ne=(0,X.jsx)(L$,{id:b,value:f,pages:s,folderPaths:c,loading:l,onValueChange:U,onSuggestionSelect:R,placeholder:te,autoFocus:!0,onKeyDown:L}),t[32]=f,t[33]=c,t[34]=L,t[35]=l,t[36]=s,t[37]=te,t[38]=b,t[39]=ne):ne=t[39];let re;t[40]!==H||t[41]!==ne?(re=(0,X.jsxs)(`div`,{children:[H,ne]}),t[40]=H,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,X.jsx)(o,{id:`QqBQu1`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[43]=ie):ie=t[43];let ae;t[44]===S?ae=t[45]:(ae=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:S,children:ie}),t[44]=S,t[45]=ae);let W;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>_(e.target.value),t[46]=W):W=t[46];let oe;t[47]===w?oe=t[48]:(oe=w({id:`yYR6za`}),t[47]=w,t[48]=oe);let se;t[49]!==g||t[50]!==L||t[51]!==S||t[52]!==oe?(se=(0,X.jsx)(ir,{id:S,value:g,onChange:W,placeholder:oe,onKeyDown:L}),t[49]=g,t[50]=L,t[51]=S,t[52]=oe,t[53]=se):se=t[53];let G;t[54]!==ae||t[55]!==se?(G=(0,X.jsxs)(`div`,{children:[ae,se]}),t[54]=ae,t[55]=se,t[56]=G):G=t[56];let ce;t[57]!==w||t[58]!==x||t[59]!==A||t[60]!==m||t[61]!==L||t[62]!==C||t[63]!==M||t[64]!==N?(ce=A?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:x,children:(0,X.jsx)(o,{id:`Tjc1pH`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}})}),(0,X.jsx)(ir,{id:x,value:m,onChange:e=>h(e.target.value),placeholder:w({id:`W-ntoW`}),onKeyDown:L}),N?(0,X.jsx)(`div`,{id:C,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:M.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":m===e.slug,className:vn(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,m===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>h(m===e.slug?``:e.slug),children:[(0,X.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,X.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.slug}-${e.level}-${e.text}`))}):null]}):null,t[57]=w,t[58]=x,t[59]=A,t[60]=m,t[61]=L,t[62]=C,t[63]=M,t[64]=N,t[65]=ce):ce=t[65];let le;t[66]!==re||t[67]!==G||t[68]!==ce?(le=(0,X.jsx)(Jn,{children:(0,X.jsxs)(`div`,{className:`space-y-6`,children:[re,G,ce]})}),t[66]=re,t[67]=G,t[68]=ce,t[69]=le):le=t[69];let ue;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,X.jsx)(Zn,{asChild:!0,children:(0,X.jsx)(Mn,{variant:`outline`,children:(0,X.jsx)(o,{id:`dEgA5A`})})}),t[70]=ue):ue=t[70];let de;t[71]===f?de=t[72]:(de=f.trim(),t[71]=f,t[72]=de);let fe=!de,pe;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,X.jsx)(o,{id:`tfDRzk`}),t[73]=pe):pe=t[73];let me;t[74]!==F||t[75]!==fe?(me=(0,X.jsxs)(Yn,{children:[ue,(0,X.jsx)(Mn,{onClick:F,disabled:fe,children:pe})]}),t[74]=F,t[75]=fe,t[76]=me):me=t[76];let he;t[77]!==le||t[78]!==me?(he=(0,X.jsxs)(Gn,{className:`sm:max-w-xl`,"data-ok-layer-spawned":``,children:[B,le,me]}),t[77]=le,t[78]=me,t[79]=he):he=t[79];let ge;return t[80]!==u||t[81]!==n||t[82]!==he?(ge=(0,X.jsx)($n,{open:n,onOpenChange:u,children:he}),t[80]=u,t[81]=n,t[82]=he,t[83]=ge):ge=t[83],ge}function e1(e){let t=(0,J.c)(106),{editor:n,nodeId:r,sourceDocName:a,onClose:s,onNavigate:c}=e,l=K$(n.state,r),u=l?.attrs?.href??``,[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(!1),h;t[0]!==r||t[1]!==f?(h=()=>{xO(r)&&f(!0)},t[0]=r,t[1]=f,t[2]=h):h=t[2];let g;t[3]===r?g=t[4]:(g=[r],t[3]=r,t[4]=g),(0,Y.useEffect)(h,g);let{addPage:_,folderPaths:v,pages:y,loading:b}=Ut(),{_:x}=i();if(!l||!u)return null;let S=oe(u,a),C=S?.kind===`doc`?`${S.docName}${S.anchor?`#${S.anchor}`:``}`:S?.kind===`anchor`?`#${S.anchor}`:S?.kind===`external`?S.url:u,T=n.state.doc.textBetween(l.from,l.to),E;t[5]!==n||t[6]!==r?(E=function(e,t,i){let a=K$(n.state,r);if(!a)return;let o=t.trim();if(!i||!o){n.chain().setTextSelection({from:a.from,to:a.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:e}).run();return}let s=n.schema.marks.link;if(!s)return;let c=s.create({href:e}),l=n.schema.text(o,[c]);n.view.dispatch(n.state.tr.replaceWith(a.from,a.to,l))},t[5]=n,t[6]=r,t[7]=E):E=t[7];let D=E,O;t[8]!==n||t[9]!==r||t[10]!==s?(O=function(){let e=K$(n.state,r);e&&(n.chain().focus().setTextSelection({from:e.from,to:e.to}).extendMarkRange(`link`).unsetLink().run(),s())},t[8]=n,t[9]=r,t[10]=s,t[11]=O):O=t[11];let k=O,A=function(e){let t=K$(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:tX(e,S?.kind===`doc`?S.anchor??null:null)}).run()},j,M=!1,N=!1,P=null;if(b){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(xa,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[12]=e):e=t[12],j={icon:e,text:x({id:`yQE2r9`}),className:`text-muted-foreground/80`}}else if(S?.kind===`asset`){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[13]=e):e=t[13],j={icon:e,text:x({id:`yWWThY`}),className:`text-muted-foreground`}}else if(S?.kind===`external`){let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(R,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[14]=e):e=t[14],j={icon:e,text:x({id:`zgSFyG`}),className:`text-muted-foreground`}}else if(S?.kind===`anchor`){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[15]=e):e=t[15],j={icon:e,text:x({id:`dprWmL`}),className:`text-muted-foreground`}}else if(S?.kind===`doc`){let e=LY(S.docName,{pages:y,folderPaths:v});if(N=e.kind===`navigate`&&e.displayState===`folder`,M=e.kind===`create`,P=e.kind===`create`?{initialDir:e.initialDir,suggestedName:e.suggestedName}:null,N){let e;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ia,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[16]=e):e=t[16],j={icon:e,text:x({id:`kNqMMd`}),className:`text-muted-foreground`}}else if(M){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[17]=e):e=t[17],j={icon:e,text:x({id:`8F1i42`}),className:`text-red-700 dark:text-red-300`}}else{let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[18]=e):e=t[18],j={icon:e,text:x({id:`JtD-Br`}),className:`text-muted-foreground`}}}else{let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[19]=e):e=t[19],j={icon:e,text:x({id:`-g6KIS`}),className:`text-muted-foreground/80`}}let I=S?.kind===`external`,L=S?.kind===`doc`?qY({docName:S.docName,anchor:S.anchor}):S?.kind===`anchor`?qY({docName:a,anchor:S.anchor}):S?.kind===`external`&&WY(S.url)?S.url:null,ee=!b&&L!==null&&(S?.kind===`anchor`||S?.kind===`external`||S?.kind===`doc`&&!M&&!N),z;t[20]!==n.state||t[21]!==n.view||t[22]!==r?(z=()=>{let e=K$(n.state,r);if(!e)return new DOMRect;try{return rn(n.view,e.from,e.to)}catch{return new DOMRect}},t[20]=n.state,t[21]=n.view,t[22]=r,t[23]=z):z=t[23];let B;t[24]!==n.view.dom||t[25]!==z?(B={getBoundingClientRect:z,contextElement:n.view.dom},t[24]=n.view.dom,t[25]=z,t[26]=B):B=t[26];let V=B,H;t[27]!==x||t[28]!==_||t[29]!==p||t[30]!==P||t[31]!==s||t[32]!==A?(H=async function(){if(!(!P||p)){m(!0);try{await T$(P,{addPage:_,onCreated(e){A(e),window.location.hash=`#/${e}`,s()}}),m(!1)}catch(e){let t=e;nr.error(t instanceof Error?t.message:x({id:`tfi40B`})),m(!1)}}},t[27]=x,t[28]=_,t[29]=p,t[30]=P,t[31]=s,t[32]=A,t[33]=H):H=t[33];let U=H,te=vn(`flex shrink-0`,j.className),ne;t[34]!==j.icon||t[35]!==te?(ne=(0,X.jsx)(`span`,{className:te,children:j.icon}),t[34]=j.icon,t[35]=te,t[36]=ne):ne=t[36];let re=ne,ie;t[37]!==re||t[38]!==M||t[39]!==j.text?(ie=M?(0,X.jsxs)(w,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(`span`,{className:`flex shrink-0`,"data-slot":`internal-link-prop-panel-icon-trigger`,children:re})}),(0,X.jsx)(F,{children:j.text})]}):re,t[37]=re,t[38]=M,t[39]=j.text,t[40]=ie):ie=t[40];let ae=ie,W=`${j.text}: ${C}`,se;t[41]!==C||t[42]!==I||t[43]!==M||t[44]!==L||t[45]!==ee||t[46]!==s||t[47]!==c?(se=(0,X.jsx)(_e,{asChild:!0,children:ee?(0,X.jsx)(`a`,{href:L??void 0,...I?{target:`_blank`,rel:`noopener noreferrer`}:{},onClick:e=>QY(e,c,s),"data-slot":`internal-link-prop-panel-text`,className:`block truncate text-sm font-medium text-foreground underline-offset-2 hover:underline focus-visible:underline`,children:C}):(0,X.jsx)(`span`,{"data-slot":`internal-link-prop-panel-text`,className:vn(`block truncate text-sm font-medium`,M?`text-muted-foreground`:`text-foreground`),children:C})}),t[41]=C,t[42]=I,t[43]=M,t[44]=L,t[45]=ee,t[46]=s,t[47]=c,t[48]=se):se=t[48];let G;t[49]===C?G=t[50]:(G=(0,X.jsx)(F,{className:`max-w-80 break-all`,children:C}),t[49]=C,t[50]=G);let ce;t[51]!==se||t[52]!==G?(ce=(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,X.jsxs)(w,{children:[se,G]})}),t[51]=se,t[52]=G,t[53]=ce):ce=t[53];let le;t[54]!==U||t[55]!==p||t[56]!==M?(le=M?(0,X.jsxs)(Mn,{type:`button`,size:`sm`,variant:`link`,disabled:p,onClick:()=>void U(),"data-slot":`internal-link-prop-panel-create`,className:`flex items-center text-foreground`,children:[(0,X.jsx)(ka,{className:`size-3.5`,"aria-hidden":`true`}),p?(0,X.jsx)(o,{id:`HM56Bx`}):(0,X.jsx)(o,{id:`XRuL0i`})]}):null,t[54]=U,t[55]=p,t[56]=M,t[57]=le):le=t[57];let ue;t[58]===x?ue=t[59]:(ue=x({id:`ePK91l`}),t[58]=x,t[59]=ue);let de;t[60]===f?de=t[61]:(de=()=>f(!0),t[60]=f,t[61]=de);let fe;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,X.jsx)(Oa,{className:`size-3.5`,"aria-hidden":`true`}),t[62]=fe):fe=t[62];let pe;t[63]!==ue||t[64]!==de?(pe=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":ue,onClick:de,"data-slot":`internal-link-prop-panel-edit`,children:fe})}),t[63]=ue,t[64]=de,t[65]=pe):pe=t[65];let me;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`ePK91l`})}),t[66]=me):me=t[66];let he;t[67]===pe?he=t[68]:(he=(0,X.jsxs)(w,{children:[pe,me]}),t[67]=pe,t[68]=he);let ge;t[69]===u?ge=t[70]:(ge=(0,X.jsx)(W$,{copyContent:u}),t[69]=u,t[70]=ge);let ve;t[71]===x?ve=t[72]:(ve=x({id:`t_YqKh`}),t[71]=x,t[72]=ve);let ye;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,X.jsx)(Ha,{className:`size-3.5`,"aria-hidden":`true`}),t[73]=ye):ye=t[73];let be;t[74]!==k||t[75]!==ve?(be=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":ve,onClick:k,"data-slot":`internal-link-prop-panel-remove`,children:ye})}),t[74]=k,t[75]=ve,t[76]=be):be=t[76];let xe;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`t_YqKh`})}),t[77]=xe):xe=t[77];let Se;t[78]===be?Se=t[79]:(Se=(0,X.jsxs)(w,{children:[be,xe]}),t[78]=be,t[79]=Se);let Ce;t[80]!==le||t[81]!==he||t[82]!==ge||t[83]!==Se?(Ce=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[le,he,ge,Se]}),t[80]=le,t[81]=he,t[82]=ge,t[83]=Se,t[84]=Ce):Ce=t[84];let we;t[85]!==ae||t[86]!==ce||t[87]!==Ce?(we=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ae,ce,Ce]}),t[85]=ae,t[86]=ce,t[87]=Ce,t[88]=we):we=t[88];let Te;t[89]!==s||t[90]!==W||t[91]!==we||t[92]!==V?(Te=(0,X.jsx)(h$,{kind:`internal-link`,ariaLabel:W,onDeactivate:s,triggerReference:V,className:`w-96`,children:we}),t[89]=s,t[90]=W,t[91]=we,t[92]=V,t[93]=Te):Te=t[93];let Ee;t[94]!==d||t[95]!==v||t[96]!==D||t[97]!==u||t[98]!==T||t[99]!==b||t[100]!==y||t[101]!==f?(Ee=(0,X.jsx)($$,{open:d,href:u,text:T,pages:y,folderPaths:v,loading:b,onOpenChange:f,onSave:D}),t[94]=d,t[95]=v,t[96]=D,t[97]=u,t[98]=T,t[99]=b,t[100]=y,t[101]=f,t[102]=Ee):Ee=t[102];let De;return t[103]!==Te||t[104]!==Ee?(De=(0,X.jsxs)(X.Fragment,{children:[Te,Ee]}),t[103]=Te,t[104]=Ee,t[105]=De):De=t[105],De}new b(`markIdentityDecoration`);var t1=`data-mark-id`,n1=new b(`linkResolutionDecoration`);function r1(e,t,n,r,i){if(t.size===0)return null;let a=[];for(let e of t.values()){if(!n.has(e.markType))continue;let t=r(e,i),o={[t1]:e.id};t!==null&&Object.assign(o,t),a.push(ln.inline(e.from,e.to,o))}return a.length===0?null:ye.create(e,a)}function i1(e){let t=new Set(e.markTypes),{computeAttrs:n}=e;return new S({key:n1,state:{init:()=>({version:0}),apply(e,t){let n=e.getMeta(n1);return n&&typeof n==`object`&&n.refresh?{version:t.version+1}:t}},props:{decorations(e){let r=SO.getState(e);if(!r)return null;let i=nn();return r1(e.doc,r.byId,t,n,i)}},view(e){Z(`ok/render/decoration-merge`,{markTypes:Array.from(t).join(`,`)},{startTime:performance.now(),duration:0});let n=dn(()=>{e.dispatch(e.state.tr.setMeta(n1,{refresh:!0}))});return{destroy(){n()}}}})}var a1=ke.extend({addOptions(){return{...this.parent?.(),docName:``}},renderHTML({HTMLAttributes:e}){let t=typeof e.href==`string`?e.href:``;return[`span`,Ge(e,{"data-link":``,role:`link`,tabindex:`0`,"aria-label":t?`Link: ${t}`:`Link`,style:`touch-action: manipulation;`}),0]},addProseMirrorPlugins(){let e=this.options.docName??``,t=({editor:t,nodeId:n,newTab:r})=>{let i=K$(t.state,n),a=i?.attrs?.href;if(typeof a!=`string`||!a)return!1;let o=i?.attrs?.sourceForm,s=oe(a,e),c=Ue(a);if(s?.kind===`asset`||o===`wikiembed`&&c!==null){let t=s?.kind===`asset`?s.url:a,n=s?.kind===`asset`?s.ext:c??``,i=_n(t,e);if(!i)return!1;let o=nn();return o===null||o.assetPaths!==void 0&&!zY(t,e,o.assetPaths)?!1:(d$({url:t,projectRelPath:i,ext:n,title:i.split(`/`).pop()??t,forceOsDelegation:r}),!0)}if(!s)return!1;switch(s.kind){case`doc`:{let e=nn(),t=LY(s.docName,{pages:e?.pages??new Set,folderPaths:e?.folderPaths??new Set});return t.kind===`create`||t.kind===`navigate`&&t.displayState===`folder`?!1:(r?XY({docName:s.docName,anchor:s.anchor}):window.location.assign(qY({docName:s.docName,anchor:s.anchor})),!0)}case`anchor`:return r?XY({docName:e,anchor:s.anchor}):window.location.assign(qY({docName:e,anchor:s.anchor})),!0;case`external`:return WY(s.url)?(JY(s.url),!0):!1;default:return be(s)}};return[Y$({editor:this.editor,markTypes:[`link`],renderPropPanel:({editor:n,nodeId:r,deactivate:i})=>(0,Y.createElement)(e1,{editor:n,nodeId:r,sourceDocName:e,onClose:i,onNavigate:e=>t({editor:n,nodeId:r,newTab:e})}),handlePrimary:t}),i1({markTypes:[`link`],computeAttrs:HY(e)}),m$({sourceDocName:e})]}}),o1=(0,Y.createContext)(null),s1={didCatch:!1,error:null},c1=class extends Y.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=s1}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(s1))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&l1(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(s1))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,Y.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,Y.createElement)(o1.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function l1(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function u1(e){let t=(0,J.c)(23),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({label:i,Icon:n,onClick:a,selected:s,className:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=s?`true`:void 0,l;t[7]===a?l=t[8]:(l=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=l);let u;t[9]===r?u=t[10]:(u=vn(`flex w-full items-center justify-center gap-2 rounded-md border border-dashed border-border bg-transparent px-3 py-2 text-center text-sm text-muted-foreground transition-colors hover:bg-muted/50 cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,r),t[9]=r,t[10]=u);let d;t[11]===n?d=t[12]:(d=(0,X.jsx)(n,{size:16,"aria-hidden":`true`}),t[11]=n,t[12]=d);let f;t[13]===i?f=t[14]:(f=(0,X.jsx)(`span`,{children:i}),t[13]=i,t[14]=f);let p;return t[15]!==a||t[16]!==o||t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==d||t[21]!==f?(p=(0,X.jsxs)(`div`,{...o,role:`button`,tabIndex:-1,contentEditable:!1,"data-descriptor-placeholder":``,"data-selected":c,onClick:a,onMouseDown:d1,onKeyDown:l,className:u,children:[d,f]}),t[15]=a,t[16]=o,t[17]=c,t[18]=l,t[19]=u,t[20]=d,t[21]=f,t[22]=p):p=t[22],p}function d1(e){e.preventDefault(),e.stopPropagation()}function f1(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Gs,{"data-slot":`select`,...n}),t[2]=n,t[3]=r),r}function p1(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(qs,{"data-slot":`select-value`,...n}),t[2]=n,t[3]=r),r}function m1(e){let t=(0,J.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=vn(`flex w-full items-center justify-between gap-2 rounded-lg border border-input bg-background text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=default]:px-2.5 data-[size=sm]:px-2 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(Js,{asChild:!0,children:(0,X.jsx)(Ri,{className:`size-4 opacity-50`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,X.jsxs)(Ks,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function h1(e){let t=(0,J.c)(20),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,position:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`popper`:a,s=o===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,c;t[5]!==r||t[6]!==s?(c=vn(`relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-md outline-hidden duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[align-trigger=true]:animate-none motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,s,r),t[5]=r,t[6]=s,t[7]=c):c=t[7];let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(_1,{}),t[8]=l):l=t[8];let u=o===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`,d;t[9]===u?d=t[10]:(d=vn(`p-1`,u),t[9]=u,t[10]=d);let f;t[11]!==n||t[12]!==d?(f=(0,X.jsx)(Zs,{className:d,children:n}),t[11]=n,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(v1,{}),t[14]=p):p=t[14];let m;return t[15]!==o||t[16]!==i||t[17]!==c||t[18]!==f?(m=(0,X.jsx)(Ys,{children:(0,X.jsxs)(Xs,{"data-slot":`select-content`,"data-ok-layer-spawned":``,position:o,className:c,...i,children:[l,f,p]})}),t[15]=o,t[16]=i,t[17]=c,t[18]=f,t[19]=m):m=t[19],m}function g1(e){let t=(0,J.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=vn(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,X.jsx)(ec,{children:(0,X.jsx)(tr,{className:`size-4`})})}),t[6]=o):o=t[6];let s;t[7]===n?s=t[8]:(s=(0,X.jsx)($s,{children:n}),t[7]=n,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,X.jsxs)(Qs,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function _1(e){let t=(0,J.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=vn(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(zi,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(tc,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function v1(e){let t=(0,J.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=vn(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Ri,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(nc,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function y1(e){let t=(0,J.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=vn(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 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 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(hc,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`}),t[6]=s):s=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==o?(c=(0,X.jsx)(mc,{"data-slot":`switch`,"data-size":a,className:o,...r,children:s}),t[7]=r,t[8]=a,t[9]=o,t[10]=c):c=t[10],c}function b1(e){let t=e.trim();if(/^#[0-9a-fA-F]{6}$/.test(t))return t.toLowerCase();if(/^#[0-9a-fA-F]{3}$/.test(t)){let[,e,n,r]=t.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/)??[];return`#${e}${e}${n}${n}${r}${r}`.toLowerCase()}return`#000000`}function x1(e){let t=(0,J.c)(36),{id:n,value:r,onChange:i,autoFocus:a}=e,o=(0,Y.useRef)(null),s;t[0]===i?s=t[1]:(s=e=>i(e.target.value),t[0]=i,t[1]=s);let c=a?``:void 0,l=r?`pl-7`:void 0,u;t[2]===l?u=t[3]:(u=vn(`h-7 text-sm`,l),t[2]=l,t[3]=u);let d;t[4]!==a||t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==u||t[9]!==r?(d=(0,X.jsx)(ir,{id:n,type:`text`,value:r,placeholder:`#F05032 or rgb(240,80,50)`,onChange:s,autoFocus:a,"data-prop-autofocus":c,className:u,"data-color-picker-input":``}),t[4]=a,t[5]=n,t[6]=s,t[7]=c,t[8]=u,t[9]=r,t[10]=d):d=t[10];let f;t[11]===r?f=t[12]:(f=r&&(0,X.jsx)(`span`,{style:{backgroundColor:r},className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 rounded-sm border border-border`,"aria-hidden":`true`,"data-color-picker-swatch":``}),t[11]=r,t[12]=f);let p;t[13]!==d||t[14]!==f?(p=(0,X.jsxs)(`div`,{className:`relative flex-1`,children:[d,f]}),t[13]=d,t[14]=f,t[15]=p):p=t[15];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>o.current?.click(),t[16]=m):m=t[16];let h=r||`transparent`,g;t[17]===h?g=t[18]:(g=(0,X.jsx)(Mn,{type:`button`,variant:`outline`,size:`xs`,"aria-label":`Choose color`,"data-color-picker-trigger":``,className:`h-7 gap-1 px-2`,onClick:m,children:(0,X.jsx)(`span`,{style:{backgroundColor:h},className:`size-3.5 rounded-sm border border-border`,"aria-hidden":`true`})}),t[17]=h,t[18]=g);let _;t[19]===r?_=t[20]:(_=b1(r),t[19]=r,t[20]=_);let v;t[21]===i?v=t[22]:(v=e=>i(e.target.value),t[21]=i,t[22]=v);let y;t[23]!==_||t[24]!==v?(y=(0,X.jsx)(`input`,{ref:o,type:`color`,value:_,onChange:v,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 size-7 opacity-0`,"data-color-picker-native":``}),t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;t[26]!==g||t[27]!==y?(b=(0,X.jsxs)(`div`,{className:`relative`,children:[g,y]}),t[26]=g,t[27]=y,t[28]=b):b=t[28];let x;t[29]!==i||t[30]!==r?(x=r&&(0,X.jsx)(Mn,{type:`button`,variant:`ghost`,size:`xs`,"aria-label":`Clear color`,"data-color-picker-clear":``,className:`h-7 px-1.5`,onClick:()=>i(``),children:(0,X.jsx)(Ji,{className:`size-3`,"aria-hidden":`true`})}),t[29]=i,t[30]=r,t[31]=x):x=t[31];let S;return t[32]!==b||t[33]!==x||t[34]!==p?(S=(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[p,b,x]}),t[32]=b,t[33]=x,t[34]=p,t[35]=S):S=t[35],S}function S1(e){let t=(0,J.c)(43),{id:n,value:r,onChange:i,autoFocus:a}=e,[o,s]=(0,Y.useState)(!1),c;t[0]===r?c=t[1]:(c=KO(r),t[0]=r,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.startsWith(`lucide:`)?r.slice(7):null,t[2]=r,t[3]=u);let d=u,f;t[4]===i?f=t[5]:(f=e=>i(e.target.value),t[4]=i,t[5]=f);let p=a?``:void 0,m=l?`pl-7`:void 0,h;t[6]===m?h=t[7]:(h=vn(`h-7 text-sm`,m),t[6]=m,t[7]=h);let g;t[8]!==a||t[9]!==n||t[10]!==f||t[11]!==p||t[12]!==h||t[13]!==r?(g=(0,X.jsx)(ir,{id:n,type:`text`,value:r,placeholder:`lucide:Lightbulb or 📘`,onChange:f,autoFocus:a,"data-prop-autofocus":p,className:h,"data-icon-picker-input":``}),t[8]=a,t[9]=n,t[10]=f,t[11]=p,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]===l?_=t[16]:(_=l&&(0,X.jsx)(l,{className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),t[15]=l,t[16]=_);let v;t[17]!==g||t[18]!==_?(v=(0,X.jsxs)(`div`,{className:`relative flex-1`,children:[g,_]}),t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(Ri,{className:`size-3`,"aria-hidden":`true`}),t[20]=y):y=t[20];let b;t[21]===o?b=t[22]:(b=(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,variant:`outline`,size:`xs`,"aria-label":`Choose icon`,"aria-haspopup":`listbox`,"aria-expanded":o,"data-icon-picker-trigger":``,className:`h-7 gap-1 px-2`,children:y})}),t[21]=o,t[22]=b);let x;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsx)(lx,{placeholder:`Search icons...`,className:`h-8 text-sm`}),t[23]=x):x=t[23];let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,X.jsx)(dx,{children:`No icons match.`}),t[24]=S):S=t[24];let C;t[25]!==i||t[26]!==r.length?(C=r.length>0&&(0,X.jsx)(fx,{children:(0,X.jsxs)(px,{value:`__clear__`,onSelect:()=>{i(``),s(!1)},className:`gap-2 text-muted-foreground`,"data-icon-picker-clear":``,children:[(0,X.jsx)(zn,{className:`size-3.5`,"aria-hidden":`true`}),`Clear icon`]})}),t[25]=i,t[26]=r.length,t[27]=C):C=t[27];let w;t[28]!==i||t[29]!==d?(w=GO.map(e=>{let[t,n]=e,r=t===d;return(0,X.jsx)(px,{value:t,onSelect:()=>{i(`lucide:${t}`),s(!1)},title:t,"aria-label":t,"data-icon-picker-item":t,"data-icon-picker-selected":r?``:void 0,className:vn(`flex aspect-square items-center justify-center rounded-md p-0`,r?`bg-foreground/10 text-foreground ring-1 ring-foreground/30`:`text-muted-foreground hover:bg-muted`),children:(0,X.jsx)(n,{className:`size-4`,"aria-hidden":`true`})},t)}),t[28]=i,t[29]=d,t[30]=w):w=t[30];let T;t[31]===w?T=t[32]:(T=(0,X.jsx)(fx,{heading:`Lucide`,children:(0,X.jsx)(Yb.Group,{className:`[&_[cmdk-group-items]]:grid [&_[cmdk-group-items]]:grid-cols-6 [&_[cmdk-group-items]]:gap-1 [&_[cmdk-group-items]]:p-1`,children:w})}),t[31]=w,t[32]=T);let E;t[33]!==C||t[34]!==T?(E=(0,X.jsx)(xc,{align:`end`,className:`z-70 w-72 p-0`,onOpenAutoFocus:C1,children:(0,X.jsxs)(sx,{label:`Icon picker`,children:[x,(0,X.jsxs)(ux,{className:`max-h-64`,children:[S,C,T]})]})}),t[33]=C,t[34]=T,t[35]=E):E=t[35];let D;t[36]!==o||t[37]!==b||t[38]!==E?(D=(0,X.jsxs)(yc,{open:o,onOpenChange:s,children:[b,E]}),t[36]=o,t[37]=b,t[38]=E,t[39]=D):D=t[39];let O;return t[40]!==D||t[41]!==v?(O=(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[v,D]}),t[40]=D,t[41]=v,t[42]=O):O=t[42],O}function C1(e){return e.preventDefault()}function w1(){if(typeof window>`u`)return null;let e=window.location.hash.match(/^#\/([^?#]+)/);return e?decodeURIComponent(e[1]):null}var T1=`/api/upload`;async function E1(e,t,n={}){let r=n.fetch??globalThis.fetch,i=n.docName===void 0?w1():n.docName;if(!i)throw Error(`No document is open`);let a=new FormData;a.append(`file`,e),a.append(`parentDocName`,i);let o;try{o=await r(T1,{method:`POST`,body:a})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Upload failed: ${t}`)}let s;try{s=await o.json()}catch(e){throw new oO(`Upload response is not JSON.`,{cause:e,status:o.status})}if(!o.ok){let e=lt.safeParse(s);throw e.success?Error(e.data.title):new oO(`Upload error response did not match ProblemDetails.`,{cause:e.error,status:o.status})}let c=mt.safeParse(s);if(!c.success)throw new oO(`Upload success response did not match UploadAssetSuccess.`,{cause:c.error,status:o.status});let l=c.data.path??c.data.src;return{url:l.startsWith(`/`)?l:`/${l}`}}var D1=new Intl.PluralRules(`en-US`);function O1(e,t,n){return n<=0?`${e} (empty)`:`${e} with ${n} ${D1.select(n)===`one`?`item`:`items`}`}function k1(e){for(let t of e)if(t.type===`string`&&t.hidden!==!0&&t.advanced!==!0&&t.autoFocus===!0)return t.name;return null}function A1(e){if(!e)return e;let t=e.replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1)}var j1=new Set([`auto`,`inherit`,`initial`,`unset`]),M1=new Set([`px`,`%`,`rem`,`em`,`vh`,`vw`,`ch`,`ex`,`fr`]),N1=/^(-?\d+(?:\.\d+)?)([a-z%]*)$/i;function P1(e){let t=e.trim();if(!t)return{valid:!1,reason:`empty`};if(j1.has(t.toLowerCase()))return{valid:!0};let n=t.match(N1);if(!n)return{valid:!1,reason:`malformed-syntax`};let r=(n[2]??``).toLowerCase();return r===``||M1.has(r)?{valid:!0}:{valid:!1,reason:`unknown-unit`}}function F1(e){if(e.valid)return null;switch(e.reason){case`empty`:return null;case`malformed-syntax`:return`Enter a number (e.g. 100), a number with a CSS unit (e.g. 100px, 50%, 26rem), or one of: auto, inherit, initial, unset.`;case`unknown-unit`:return`Unknown CSS unit. Use px, %, rem, em, vh, vw, ch, ex, or fr.`}}var I1={video:Ke,audio:Qe,image:g},L1={youtube:[`youtube.com`,`youtu.be`,`youtube-nocookie.com`],vimeo:[`vimeo.com`],loom:[`loom.com`]};function R1(e){let t=e.toLowerCase();for(let e of Object.keys(L1)){let n=L1[e];for(let r of n)if(t===r||t.endsWith(`.${r}`))return e}return null}function z1(e){let t=e.lastIndexOf(`/`),n=t>=0?e.slice(t+1):e,r=n.lastIndexOf(`.`);return r>0?n.slice(r+1).toLowerCase():``}var B1=`https://placeholder.invalid`;function V1(e,t){let n=e.trim();if(n.length===0)return{valid:!0};let r,i=!0;try{r=new URL(n)}catch{try{r=new URL(n,B1),i=!1}catch{return{valid:!1,reason:`invalid-url`}}}if(t===`video`&&L(n)!==null||t===`video`&&Ee(n)||t===`video`&&tt(n))return{valid:!0};let a=i?R1(r.hostname):null;if(a!==null)return{valid:!1,reason:`embed-provider`,provider:a};if(r.protocol===`data:`)return{valid:!1,reason:`data-uri`};let o=z1(r.pathname),s=I1[t];return o===``?i?{valid:!0}:{valid:!1,reason:`wrong-extension`,extension:``}:s.has(o)?{valid:!0}:{valid:!1,reason:`wrong-extension`,extension:o}}function H1(e){if(e.length===0)return;let t=e[0]?.toLowerCase()??``;if(t.startsWith(`video/`))return`video`;if(t.startsWith(`audio/`))return`audio`;if(t.startsWith(`image/`))return`image`}function U1(e){return`Direct ${e} file URL — ${Array.from(I1[e]).map(e=>`.${e}`).join(`, `)}`}var W1={youtube:`YouTube`,vimeo:`Vimeo`,loom:`Loom`};function G1(e,t){if(e.valid)return``;if(e.reason===`invalid-url`)return`Not a valid URL.`;if(e.reason===`data-uri`)return`Data URIs are not supported for media fields. Use a hosted file URL.`;if(e.reason===`embed-provider`){let n=W1[e.provider];return t===`video`?`Unrecognized ${n} URL. Paste a valid ${n} share or embed link, or a direct ${t} file URL.`:`${n} URLs are not direct ${t} files. Paste a direct ${t} file URL.`}let n=Array.from(I1[t]).map(e=>`.${e}`).join(`, `);return e.extension===``?`Missing file extension. Accepts: ${n}.`:`Unsupported extension .${e.extension}. Accepts: ${n}.`}function K1(e){return`ok.propPanel.advanced.${e}`}function q1(e){try{return typeof localStorage>`u`?!1:localStorage.getItem(K1(e))===`true`}catch{return!1}}function J1(e,t){try{if(typeof localStorage>`u`)return;localStorage.setItem(K1(e),t?`true`:`false`)}catch{}}function Y1(e,t){let n=0;for(let r of e){let e=t[r.name],i=`defaultValue`in r?r.defaultValue:void 0;e!==void 0&&e!==i&&(n+=1)}return n}async function X1(e,t,n){try{let{url:r}=await E1(e,t);n(r)}catch(e){let t=e instanceof Error?e.message:String(e);nr.error(B._({id:`02P3hL`,values:{message:t}}))}}function Z1(e){let t=(0,J.c)(13),{descriptor:n,values:r,onChange:i}=e,a;t[0]===r?a=t[1]:(a=e=>!(`hidden`in e&&e.hidden)&&e.hideWhen?.(r)!==!0&&e.type!==`reactnode`,t[0]=r,t[1]=a);let s=n.props.filter(a),c=s.filter($1),l=s.filter(Q1),u=Y1(l,r),d;t[2]===n.props?d=t[3]:(d=k1(n.props),t[2]=n.props,t[3]=d);let f=d,p;t[4]===n.name?p=t[5]:(p=()=>q1(n.name),t[4]=n.name,t[5]=p);let[m,h]=(0,Y.useState)(p);if(s.length===0)return null;let g;t[6]!==f||t[7]!==i||t[8]!==r?(g=e=>(0,X.jsx)(t0,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===f},e.name),t[6]=f,t[7]=i,t[8]=r,t[9]=g):g=t[9];let _=c.map(g),v=l.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,X.jsxs)(sr,{open:m,onOpenChange:e=>{h(e),J1(n.name,e)},children:[(0,X.jsxs)(or,{"data-prop-panel-advanced-trigger":``,className:`group flex w-full items-center justify-between rounded px-1 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground uppercase font-mono`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(Ri,{className:`size-3 transition-transform group-data-[state=closed]:-rotate-90`}),(0,X.jsx)(o,{id:`sxkWRg`})]}),u>0&&(0,X.jsx)(vc,{variant:`secondary`,"data-prop-panel-advanced-count":``,children:u})]}),(0,X.jsx)(ar,{className:`flex flex-col gap-4 pt-2`,children:l.map(e=>(0,X.jsx)(t0,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===f},e.name))})]})]}),y;return t[10]!==_||t[11]!==v?(y=(0,X.jsxs)(`div`,{"data-prop-panel":``,className:`flex flex-col gap-4 py-2 text-sm`,children:[_,v]}),t[10]=_,t[11]=v,t[12]=y):y=t[12],y}function Q1(e){return`advanced`in e&&e.advanced}function $1(e){return!(`advanced`in e&&e.advanced)}function e0(e){throw Error(`PropPanel: unhandled PropDef type ${JSON.stringify(e)}`)}function t0(e){let t=(0,J.c)(162),{propDef:n,value:r,onChange:i,isAutoFocused:a}=e;switch(n.type){case`reactnode`:return null;case`string`:{let e=`prop-${n.name}`,o=n.accept,s=o!==void 0&&o.length>0,c=!n.required&&n.defaultValue===void 0;if(n.language){let o=`${e}-label`,s;t[0]===n.name?s=t[1]:(s=A1(n.name),t[0]=n.name,t[1]=s);let l;t[2]!==o||t[3]!==e||t[4]!==s?(l=(0,X.jsx)(`label`,{id:o,htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[2]=o,t[3]=e,t[4]=s,t[5]=l):l=t[5];let u=r??``,d;t[6]!==i||t[7]!==c?(d=e=>{if(e===``&&c){i(void 0);return}i(e)},t[6]=i,t[7]=c,t[8]=d):d=t[8];let f;t[9]!==a||t[10]!==o||t[11]!==n.language||t[12]!==e||t[13]!==u||t[14]!==d?(f=(0,X.jsx)(mZ,{id:e,ariaLabelledBy:o,value:u,language:n.language,onChange:d,autoFocus:a}),t[9]=a,t[10]=o,t[11]=n.language,t[12]=e,t[13]=u,t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==l||t[17]!==f?(p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,f]}),t[16]=l,t[17]=f,t[18]=p):p=t[18],p}if(n.iconPicker){let o=r??``,s;t[19]===n.name?s=t[20]:(s=A1(n.name),t[19]=n.name,t[20]=s);let l;t[21]!==e||t[22]!==s?(l=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[21]=e,t[22]=s,t[23]=l):l=t[23];let u;t[24]!==i||t[25]!==c?(u=e=>{if(e===``&&c){i(void 0);return}i(e)},t[24]=i,t[25]=c,t[26]=u):u=t[26];let d;t[27]!==o||t[28]!==a||t[29]!==e||t[30]!==u?(d=(0,X.jsx)(S1,{id:e,value:o,onChange:u,autoFocus:a}),t[27]=o,t[28]=a,t[29]=e,t[30]=u,t[31]=d):d=t[31];let f;return t[32]!==l||t[33]!==d?(f=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,d]}),t[32]=l,t[33]=d,t[34]=f):f=t[34],f}if(n.colorPicker){let o=r??``,s;t[35]===n.name?s=t[36]:(s=A1(n.name),t[35]=n.name,t[36]=s);let l;t[37]!==e||t[38]!==s?(l=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[37]=e,t[38]=s,t[39]=l):l=t[39];let u;t[40]!==i||t[41]!==c?(u=e=>{if(e===``&&c){i(void 0);return}i(e)},t[40]=i,t[41]=c,t[42]=u):u=t[42];let d;t[43]!==o||t[44]!==a||t[45]!==e||t[46]!==u?(d=(0,X.jsx)(x1,{id:e,value:o,onChange:u,autoFocus:a}),t[43]=o,t[44]=a,t[45]=e,t[46]=u,t[47]=d):d=t[47];let f;return t[48]!==l||t[49]!==d?(f=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,d]}),t[48]=l,t[49]=d,t[50]=f):f=t[50],f}if(n.cssLengthInput){let o=r??``,s;if(t[51]!==o){let e=P1(o);s=e.valid?null:F1(e),t[51]=o,t[52]=s}else s=t[52];let l=s,u;t[53]===n.name?u=t[54]:(u=A1(n.name),t[53]=n.name,t[54]=u);let d;t[55]!==e||t[56]!==u?(d=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:u}),t[55]=e,t[56]=u,t[57]=d):d=t[57];let f;t[58]!==i||t[59]!==c?(f=e=>{let t=e.target.value;if(t===``&&c){i(void 0);return}i(t)},t[58]=i,t[59]=c,t[60]=f):f=t[60];let p=a?``:void 0,m=l===null?void 0:!0,h=l===null?void 0:`${e}-error`,g;t[61]!==o||t[62]!==a||t[63]!==e||t[64]!==f||t[65]!==p||t[66]!==m||t[67]!==h?(g=(0,X.jsx)(ir,{id:e,type:`text`,value:o,placeholder:`100px, 50%, 26rem, auto`,onChange:f,autoFocus:a,"data-prop-autofocus":p,"aria-invalid":m,"aria-describedby":h,className:`h-7 text-sm`,"data-prop-css-length-input":``}),t[61]=o,t[62]=a,t[63]=e,t[64]=f,t[65]=p,t[66]=m,t[67]=h,t[68]=g):g=t[68];let _;t[69]!==l||t[70]!==e?(_=l!==null&&(0,X.jsx)(`p`,{id:`${e}-error`,"data-prop-css-length-error":``,className:`text-xs text-destructive`,"aria-live":`polite`,children:l}),t[69]=l,t[70]=e,t[71]=_):_=t[71];let v;return t[72]!==d||t[73]!==g||t[74]!==_?(v=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[d,g,_]}),t[72]=d,t[73]=g,t[74]=_,t[75]=v):v=t[75],v}let l,u,d;if(t[76]!==o||t[77]!==r){let e=o===void 0?void 0:H1(o);l=r??``;let n=e===void 0?null:V1(l,e);u=n!==null&&!n.valid&&e!==void 0&&l.trim().length>0?G1(n,e):null,d=e===void 0?void 0:U1(e),t[76]=o,t[77]=r,t[78]=l,t[79]=u,t[80]=d}else l=t[78],u=t[79],d=t[80];let f=d,p;t[81]===n.name?p=t[82]:(p=A1(n.name),t[81]=n.name,t[82]=p);let m;t[83]!==e||t[84]!==p?(m=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:p}),t[83]=e,t[84]=p,t[85]=m):m=t[85];let h;t[86]!==i||t[87]!==c?(h=e=>{let t=e.target.value;if(t===``&&c){i(void 0);return}i(t)},t[86]=i,t[87]=c,t[88]=h):h=t[88];let g=a?``:void 0,_=u===null?void 0:!0,v=u===null?void 0:`${e}-error`,y;t[89]!==l||t[90]!==a||t[91]!==f||t[92]!==e||t[93]!==h||t[94]!==g||t[95]!==_||t[96]!==v?(y=(0,X.jsx)(ir,{id:e,type:`text`,value:l,placeholder:f,onChange:h,autoFocus:a,"data-prop-autofocus":g,"aria-invalid":_,"aria-describedby":v,className:`h-7 text-sm`}),t[89]=l,t[90]=a,t[91]=f,t[92]=e,t[93]=h,t[94]=g,t[95]=_,t[96]=v,t[97]=y):y=t[97];let b;t[98]!==o||t[99]!==i||t[100]!==s?(b=s&&(0,X.jsx)(r0,{accept:o,onUploaded:e=>i(e)}),t[98]=o,t[99]=i,t[100]=s,t[101]=b):b=t[101];let x;t[102]!==y||t[103]!==b?(x=(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[y,b]}),t[102]=y,t[103]=b,t[104]=x):x=t[104];let S;t[105]!==u||t[106]!==e?(S=u!==null&&(0,X.jsx)(`p`,{id:`${e}-error`,"data-prop-media-error":``,className:`text-xs text-destructive`,"aria-live":`polite`,children:u}),t[105]=u,t[106]=e,t[107]=S):S=t[107];let C;return t[108]!==x||t[109]!==S||t[110]!==m?(C=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[m,x,S]}),t[108]=x,t[109]=S,t[110]=m,t[111]=C):C=t[111],C}case`boolean`:{let e=`prop-${n.name}`,a;t[112]===n.name?a=t[113]:(a=A1(n.name),t[112]=n.name,t[113]=a);let o=a,s;t[114]!==e||t[115]!==o?(s=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[114]=e,t[115]=o,t[116]=s):s=t[116];let c=!!r,l;t[117]===i?l=t[118]:(l=e=>i(e),t[117]=i,t[118]=l);let u;t[119]!==e||t[120]!==c||t[121]!==l?(u=(0,X.jsx)(y1,{id:e,checked:c,onCheckedChange:l}),t[119]=e,t[120]=c,t[121]=l,t[122]=u):u=t[122];let d;return t[123]!==s||t[124]!==u?(d=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[s,u]}),t[123]=s,t[124]=u,t[125]=d):d=t[125],d}case`enum`:{let e=`prop-${n.name}`,a=r??n.enumValues[0]??``,o;t[126]===n.name?o=t[127]:(o=A1(n.name),t[126]=n.name,t[127]=o);let s;t[128]!==e||t[129]!==o?(s=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[128]=e,t[129]=o,t[130]=s):s=t[130];let c;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(p1,{}),t[131]=c):c=t[131];let l;t[132]===e?l=t[133]:(l=(0,X.jsx)(m1,{id:e,size:`sm`,children:c}),t[132]=e,t[133]=l);let u;t[134]===n.enumValues?u=t[135]:(u=n.enumValues.map(n0),t[134]=n.enumValues,t[135]=u);let d;t[136]===u?d=t[137]:(d=(0,X.jsx)(h1,{className:`z-70`,children:u}),t[136]=u,t[137]=d);let f;t[138]!==a||t[139]!==i||t[140]!==l||t[141]!==d?(f=(0,X.jsxs)(f1,{value:a,onValueChange:i,children:[l,d]}),t[138]=a,t[139]=i,t[140]=l,t[141]=d,t[142]=f):f=t[142];let p;return t[143]!==s||t[144]!==f?(p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,f]}),t[143]=s,t[144]=f,t[145]=p):p=t[145],p}case`number`:{let e=`prop-${n.name}`,a;t[146]===n.name?a=t[147]:(a=A1(n.name),t[146]=n.name,t[147]=a);let o;t[148]!==e||t[149]!==a?(o=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:a}),t[148]=e,t[149]=a,t[150]=o):o=t[150];let s=r==null?``:String(r),c;t[151]===i?c=t[152]:(c=e=>{let t=e.target.value;if(t===``){i(void 0);return}if(t===`-`)return;let n=Number(t);Number.isNaN(n)||i(n)},t[151]=i,t[152]=c);let l;t[153]!==e||t[154]!==s||t[155]!==c?(l=(0,X.jsx)(ir,{id:e,type:`number`,inputMode:`numeric`,value:s,onChange:c,className:`h-7 text-sm`}),t[153]=e,t[154]=s,t[155]=c,t[156]=l):l=t[156];let u;return t[157]!==o||t[158]!==l?(u=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,l]}),t[157]=o,t[158]=l,t[159]=u):u=t[159],u}default:{let e;return t[160]===n?e=t[161]:(e=e0(n),t[160]=n,t[161]=e),e}}}function n0(e){return(0,X.jsx)(g1,{value:e,children:e},e)}function r0(e){let t=(0,J.c)(20),{accept:n,onUploaded:r}=e,{_:a}=i(),[o,s]=(0,Y.useState)(!1),c=(0,Y.useRef)(null),l;t[0]===n?l=t[1]:(l=n.join(`,`),t[0]=n,t[1]=l);let u;t[2]!==n||t[3]!==r?(u=async e=>{let t=e.target.files?.[0];if(t){s(!0);try{await X1(t,n,r)}catch{}s(!1),c.current&&(c.current.value=``)}},t[2]=n,t[3]=r,t[4]=u):u=t[4];let d;t[5]!==l||t[6]!==u?(d=(0,X.jsx)(`input`,{ref:c,type:`file`,accept:l,className:`hidden`,"data-prop-upload-input":``,onChange:u}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=a({id:`2IXDgU`}),t[8]=a,t[9]=f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c.current?.click(),t[10]=p):p=t[10];let m;t[11]===o?m=t[12]:(m=o?(0,X.jsx)(xa,{className:`size-3.5 animate-spin`}):(0,X.jsx)(Ua,{className:`size-3.5`}),t[11]=o,t[12]=m);let h;t[13]!==f||t[14]!==m||t[15]!==o?(h=(0,X.jsx)(Mn,{type:`button`,variant:`outline`,size:`sm`,disabled:o,"aria-label":f,"data-prop-upload-trigger":``,className:`h-7 px-2`,onClick:p,children:m}),t[13]=f,t[14]=m,t[15]=o,t[16]=h):h=t[16];let g;return t[17]!==d||t[18]!==h?(g=(0,X.jsxs)(X.Fragment,{children:[d,h]}),t[17]=d,t[18]=h,t[19]=g):g=t[19],g}var i0=new Set([`img`,`CommonMarkImage`,`video`,`audio`]);function a0(e,t,n){if(!i0.has(e)||!n)return t;let r=t.src;if(typeof r!=`string`)return t;let i=Ct(r,n);return i===r?t:{...t,src:i}}var o0=`selectionStatePlugin/origin`,s0=`selectionStatePlugin/refresh`,c0=new b(`selectionState`),l0=new Set,u0={selectedBlockId:null,ancestorChain:[],selectionOrigin:`programmatic`,isDragging:!1,rangeEncompassedBlockIds:l0};function d0(e){return c0.getState(e.state)??u0}function f0(e,t){let n=[],{$from:r}=t;for(let t=1;t<=r.depth;t++){let i=r.node(t);if(i.type.name!==`jsxComponent`)continue;let a=r.before(t);n.push(p0(e,i,a))}if(t instanceof we){let r=t.node;r.type.name===`jsxComponent`&&n.push(p0(e,r,t.from))}return n}function p0(e,t,n){let r=t.attrs.componentName??`unknown`;return{bridgeId:m0(e,n),componentName:r,pos:n}}function m0(e,t){return MM.getState(e)?.posToId.get(t)??`pos-${t}`}function h0(e,t){if(t instanceof we)return l0;let{from:n,to:r}=t;if(n>=r)return l0;let i=MM.getState(e)?.posToId;if(!i)return l0;let a=null;for(let[t,o]of i){if(t<n)continue;let i=e.doc.nodeAt(t);i&&(t+i.nodeSize>r||(a||=new Set,a.add(o)))}return a??l0}function g0(e,t,n={}){let r=f0(e,e.selection),i=r[r.length-1],a=h0(e,e.selection),o={selectedBlockId:i?.bridgeId??null,ancestorChain:r,selectionOrigin:n.origin??t.selectionOrigin,isDragging:n.isDragging??t.isDragging,rangeEncompassedBlockIds:a};return _0(t,o)?t:o}function _0(e,t){if(e===t)return!0;if(e.selectedBlockId!==t.selectedBlockId||e.selectionOrigin!==t.selectionOrigin||e.isDragging!==t.isDragging||e.ancestorChain.length!==t.ancestorChain.length)return!1;for(let n=0;n<e.ancestorChain.length;n++){let r=e.ancestorChain[n],i=t.ancestorChain[n];if(r.bridgeId!==i.bridgeId||r.componentName!==i.componentName||r.pos!==i.pos)return!1}if(e.rangeEncompassedBlockIds.size!==t.rangeEncompassedBlockIds.size)return!1;for(let n of e.rangeEncompassedBlockIds)if(!t.rangeEncompassedBlockIds.has(n))return!1;return!0}var v0=new WeakMap;function y0(e,t,n,r){let i=r?.isDragging??t.isDragging,a=!!e.getMeta(s0),o=e.selectionSet&&!a,s=e.getMeta(o0),c=o?r?.pendingOrigin??null:null,l=s??c??t.selectionOrigin;return o&&r&&(r.pendingOrigin=null),g0(n,t,{origin:l,isDragging:i})}var b0=Wt.create({name:`selectionStatePlugin`,addProseMirrorPlugins(){let e=this.editor,t=new S({key:c0,state:{init(e,t){return g0(t,u0)},apply(e,n,r,i){return y0(e,n,i,v0.get(t))}},props:{handleDOMEvents:{mousedown:()=>{let e=v0.get(t);return e&&(e.pendingOrigin=`pointer`),!1},pointerdown:()=>{let e=v0.get(t);return e&&(e.pendingOrigin=`pointer`),!1}},handleKeyDown:(e,n)=>{if(x0(n.key)){let e=v0.get(t);e&&(e.pendingOrigin=`keyboard`)}return!1}},view(n){v0.set(t,{pendingOrigin:null,isDragging:!1});let r=n.dom.parentElement??n.dom,i=()=>{let n=v0.get(t);n&&(n.isDragging=!0,S0(e))},a=()=>{let n=v0.get(t);n&&(n.isDragging=!1,S0(e))};return r.addEventListener(`dragstart`,i,!0),r.addEventListener(`dragend`,a,!0),r.addEventListener(`drop`,a,!0),{destroy:()=>{r.removeEventListener(`dragstart`,i,!0),r.removeEventListener(`dragend`,a,!0),r.removeEventListener(`drop`,a,!0),v0.delete(t)}}}});return[t]}});function x0(e){return e===`ArrowUp`||e===`ArrowDown`||e===`ArrowLeft`||e===`ArrowRight`||e===`Tab`||e===`Escape`||e===`Enter`||e===`Home`||e===`End`||e===`PageUp`||e===`PageDown`}function S0(e){queueMicrotask(()=>{if(!e.isDestroyed)try{let t=e.state.tr.setMeta(s0,!0);e.view.dispatch(t)}catch{}})}function C0(e){let t=(0,J.c)(5),n;t[0]===e?n=t[1]:(n=()=>e?d0(e):null,t[0]=e,t[1]=n);let[r,i]=(0,Y.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(!e){i(null);return}i(d0(e));let t=()=>{i(d0(e))};return e.on(`transaction`,t),e.on(`selectionUpdate`,t),()=>{e.off(`transaction`,t),e.off(`selectionUpdate`,t)}},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,Y.useEffect)(a,o),r}function w0(e,t){if(e.hasChildren)return!1;let n=k1(e.props);return n===null?!1:t[n]===``}function T0(e){let t=e.placeholder?.label,n=`Add ${(e.displayName??e.name).toLowerCase()}`;return{label:t??n,Icon:UO(e.placeholder?.icon??e.icon)}}var E0=new Set([`img`,`CommonMarkImage`,`Embed`,`video`]),D0=`img, .ok-embed, .ok-video`,O0=220,k0=`cubic-bezier(0.23, 1, 0.32, 1)`,A0=`ok-image-align-flip`,j0=.5;function M0(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function N0(){return typeof requestAnimationFrame==`function`}function P0(e){return e?e.querySelector(D0):null}function F0(e,t){if(M0()||!N0()){t();return}let n=P0(e);if(!n){t();return}let r=n.getBoundingClientRect().left;t(),requestAnimationFrame(()=>{let t=P0(e);if(!t)return;for(let e of t.getAnimations())e.id===A0&&e.cancel();let n=r-t.getBoundingClientRect().left;if(Math.abs(n)<j0)return;let i=t.animate([{transform:`translateX(${n}px)`},{transform:`translateX(0)`}],{duration:O0,easing:k0,fill:`none`});i.id=A0})}function I0(e){if(!e.attrs.sourceDirty&&e.attrs.sourceRaw)return e.attrs.sourceRaw;let t=aA(),n=e.type.schema.node(`doc`,null,[e]);return t.serialize(n.toJSON()).trim()}var L0=new Set(Xe.map(e=>`${e}:`)),R0=6e4,z0=10,B0=new Map;function V0(e,t){let n=t.toLowerCase();jt(n);let r=Date.now(),i=B0.get(n);if(!i||r-i.windowStart>=R0)B0.set(n,{windowStart:r,count:1});else if(i.count+=1,i.count>z0)return;typeof console<`u`&&typeof console.warn==`function`&&console.warn(JSON.stringify({event:`jsx-prop-dropped`,reason:e,prop:t}))}var H0=new Set([`href`,`src`,`action`,`formaction`,`poster`,`cite`,`data`,`manifest`,`background`,`ping`,`xlinkhref`,`xlinkactuate`,`xlinkrole`,`xlinkarcrole`,`xlinkshow`,`url`,`link`]),U0=new Set([`dangerouslysetinnerhtml`,`ref`,`key`,`defaultvalue`,`defaultchecked`,`__proto__`,`constructor`,`prototype`]),W0=1e4;function G0(e){let t=e.toLowerCase();return!!(U0.has(t)||t.length>=3&&t.startsWith(`on`))}function K0(e){return H0.has(e.toLowerCase())}function q0(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t||t.startsWith(`#`)||t.startsWith(`//`)||xe(t))return e;let n=t.indexOf(`:`),r=t.slice(0,n+1).toLowerCase();return L0.has(r)?e:`#`}function J0(e){if(e.length>W0)return``;let t=e.toLowerCase();return/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/.test(t)||/\bexpression\s*\(/.test(t)?``:e}function Y0(e){if(e==null)return e;if(Array.isArray(e)){let t=!1,n=Array(e.length);for(let r=0;r<e.length;r++){let i=Y0(e[r]);n[r]=i,i!==e[r]&&(t=!0)}return t?n:e}if(typeof e!=`object`)return e;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=e,r=!1,i={};for(let[e,t]of Object.entries(n)){if(G0(e)){V0(`dangerous-prop-name-nested`,e),r=!0;continue}if(K0(e)&&typeof t==`string`){let n=q0(t);n!==t&&(r=!0),i[e]=n}else{let n=Y0(t);n!==t&&(r=!0),i[e]=n}}return r?i:e}function X0(e){let t=!1,n={};for(let[r,i]of Object.entries(e)){if(G0(r)){V0(`dangerous-prop-name`,r),t=!0;continue}if(K0(r)){let e=q0(i);e!==i&&(t=!0),n[r]=e;continue}if(r===`style`){if(typeof i==`string`){let e=J0(i);e!==i&&(t=!0),n[r]=e}else t=!0;continue}let e=Y0(i);e!==i&&(t=!0),n[r]=e}return t?n:e}function Z0(e){let t=(0,J.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`jsx-component-error-fallback`,children:n}),t[0]=n,t[1]=r),r}function Q0(e){let t=(0,J.c)(13),{children:n,resetKey:r,onError:i,descriptorName:a,rawComponentName:o}=e,s;t[0]===r?s=t[1]:(s=[r],t[0]=r,t[1]=s);let c;t[2]!==a||t[3]!==i||t[4]!==o?(c=(e,t)=>{let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:a,rawComponentName:String(o??``).slice(0,200),error:String(n),stack:t.componentStack})),_t(a),i(n)},t[2]=a,t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=e=>(0,X.jsx)(Z0,{...e,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==n||t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,X.jsx)(c1,{resetKeys:s,onError:c,fallbackRender:l,children:n}),t[8]=n,t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function $0(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map($0).join(`,`)}]`;let t=Object.entries(e);return t.sort(([e],[t])=>e<t?-1:+(e>t)),`{${t.map(([e,t])=>`${JSON.stringify(e)}:${$0(t)}`).join(`,`)}}`}function e2(e,t){let n=e.props??{},r={};for(let[e,i]of Object.entries(n))t.has(e)||(r[e]=i);return X0(r)}var t2=3;function n2(e){let t=(0,J.c)(161),{node:n,editor:r,extension:a,getPos:s,selected:c}=e,{_:l}=i(),u=rM(n.attrs.componentName),[d,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),g=(0,Y.useRef)(!1),_=typeof s==`function`?s():void 0,v=!1,y=0,b=1;try{if(_!==void 0){let e=r.state.doc.resolve(_);e.depth>0&&e.parent.type.name===`jsxComponent`&&(v=!0,y=e.index(e.depth),b=e.parent.childCount)}}catch(e){let t=e;if(!(t instanceof RangeError))throw t}let x=v&&y>0,S=v&&y<b-1,C=C0(r),w=typeof _==`number`?m0(r.state,_):null,T=w!==null&&(C?.rangeEncompassedBlockIds.has(w)??!1),E;t[0]===C?.ancestorChain?E=t[1]:(E=C?.ancestorChain.at(-1)?.bridgeId??null,t[0]=C?.ancestorChain,t[1]=E);let D=w!==null&&E===w,O=c&&!T&&D,k=w!==null&&!D&&(C?.ancestorChain.some(e=>e.bridgeId===w)??!1),A=O&&C?C.selectionOrigin:void 0,j=O&&(C?.isDragging??!1),M=u.props.some(c2),N=n.attrs.props??{},P=M&&u.props.some(e=>e.type!==`string`||!e.required||`hidden`in e&&e.hidden?!1:!Object.hasOwn(N,e.name)),F=w0(u,N),I=F?T0(u):null,L=!u.hasChildren||!!u.isSelfClosing,ee=E0.has(u.name),R=u.name===`MermaidFence`?{propName:`chart`,language:`mermaid`}:u.name===`Math`||u.name===`DollarMath`||u.name===`MathFence`?{propName:`formula`,language:`latex`}:null,[z,B]=(0,Y.useState)(!1);(0,Y.useEffect)(()=>{c&&!g.current&&M&&fM(_)&&h(!0),g.current=c},[c,M,_]);let V=e2(n.attrs,u.reactNodePropNames),H=u.surface===`compat`?u.translateProps(V):V,te=a.options.docName,ne=typeof te==`string`&&te?te:qD(r),re=a0(u.name,H,ne),ie=`${u.name}::${$0(V)}`,ae;t[2]!==s||t[3]!==n.content.size?(ae=()=>(typeof s==`function`?s()??0:0)+1+n.content.size,t[2]=s,t[3]=n.content.size,t[4]=ae):ae=t[4];let W=ae,oe=u.name===`*`||d!==null,se=(0,Y.useRef)(!1),G=(0,Y.useRef)(0),[ce,le]=(0,Y.useState)(!1);if((0,Y.useEffect)(()=>{if(!oe||se.current||ce)return;let e=typeof s==`function`?s():void 0;if(typeof e!=`number`)return;let t=I0(n),i=u.name===`*`?`Unregistered component: ${n.attrs.componentName}`:`Render error in <${u.displayName??u.name}>: ${d?.message??`unknown`}`,a=n.type.schema.nodes.rawMdxFallback.create({reason:i},n.type.schema.text(t)),o=!1,c,l=()=>{if(!o)try{r.view.dispatch(r.state.tr.replaceWith(e,e+n.nodeSize,a)),se.current=!0,en(u.name===`*`?`wildcard`:u.name)}catch(e){let t=e,r=u.name===`*`?`wildcard`:u.name;if(console.warn(JSON.stringify({event:`jsx-component-auto-convert-failed`,component:r,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500),retry:G.current})),Ot(r),G.current+=1,G.current<t2){let e=50*(2**G.current-1);c=setTimeout(()=>{o||l()},e)}else o||le(!0)}},f=requestAnimationFrame(l);return()=>{o=!0,cancelAnimationFrame(f),c!==void 0&&clearTimeout(c)}},[oe,n,r,s,u,d,ce]),ce){let e=n.attrs.componentName,i=u.displayName??u.name,a=u.name===`*`?l({id:`Kh1n4a`,values:{componentName:e}}):l({id:`g58Kwy`,values:{descriptorLabel:i}}),o=()=>{try{let e=I0(n);typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e)}catch(e){let t=e;ht(u.name),console.warn(JSON.stringify({event:`jsx-component-stuck-copy-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500)}))}},c=()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{r.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;qe(u.name),console.warn(JSON.stringify({event:`jsx-component-stuck-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={[fF]:`true`},t[5]=d):d=t[5];let f;t[6]===a?f=t[7]:(f=(0,X.jsx)(`span`,{className:`flex-1`,children:a}),t[6]=a,t[7]=f);let p;t[8]===l?p=t[9]:(p=l({id:`E2Mv-X`}),t[8]=l,t[9]=p);let m;t[10]!==o||t[11]!==p?(m=(0,X.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:o,children:p}),t[10]=o,t[11]=p,t[12]=m):m=t[12];let h;t[13]===l?h=t[14]:(h=l({id:`cnGeoo`}),t[13]=l,t[14]=h);let g;t[15]!==c||t[16]!==h?(g=(0,X.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:c,children:h}),t[15]=c,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==m||t[19]!==g||t[20]!==f?(_=(0,X.jsxs)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-2 border border-destructive/40 rounded bg-destructive/5 flex items-center gap-2`,contentEditable:!1,...d,children:[f,m,g]}),t[18]=m,t[19]=g,t[20]=f,t[21]=_):_=t[21];let v;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(Jl,{className:`component-children`}),t[22]=v):v=t[22];let y;return t[23]===_?y=t[24]:(y=(0,X.jsxs)(Yl,{className:`jsx-component-wrapper my-2`,children:[_,v]}),t[23]=_,t[24]=y),y}if(oe){let e=n.attrs.componentName,r=u.displayName??u.name,i=u.name===`*`?l({id:`oJl7eO`,values:{componentName:e}}):l({id:`bcDHUM`,values:{descriptorLabel:r}}),a;t[25]===i?a=t[26]:(a=(0,X.jsx)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-1`,contentEditable:!1,children:i}),t[25]=i,t[26]=a);let o;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(Jl,{className:`component-children`}),t[27]=o):o=t[27];let s;return t[28]===a?s=t[29]:(s=(0,X.jsxs)(Yl,{className:`jsx-component-wrapper my-2`,children:[a,o]}),t[28]=a,t[29]=s),s}let ue=u.Component,de=u.displayName??u.name,fe=u.displayName??u.name,pe=u.displayName??u.name,me=e=>{if(F||!L)return;let t=e.target;if(!e.currentTarget.contains(t)||t.closest(`.jsx-component-chrome`)||t.closest(`.jsx-add-child-pill, .jsx-empty-child-placeholder`)||t.closest(`a[href]`)||typeof _!=`number`)return;let n=r.state.doc.nodeAt(_);if(!n)return;let i=_+n.nodeSize,a=r.state.selection.from;a<_||a>=i||r.chain().focus().setNodeSelection(_).run()},he;t[30]!==r||t[31]!==s?(he=()=>{let e=typeof s==`function`?s():void 0;typeof e==`number`&&(r.chain().focus().setNodeSelection(e).run(),h(!0))},t[30]=r,t[31]=s,t[32]=he):he=t[32];let ge=he,_e=u.displayName??u.name,ve=!!u.emptyChildName,ye=ve?O1(_e,u.emptyChildName,n.childCount):void 0,be=e=>{let t=e.target;if(e.key===`Backspace`||e.key===`Delete`){if(!O||!e.currentTarget.contains(t)||t.matches(`input, textarea`))return;let i=typeof s==`function`?s():void 0;if(typeof i!=`number`)return;e.preventDefault();try{r.chain().focus().setNodeSelection(i).deleteSelection().run()||(ot(u.name),console.warn(JSON.stringify({event:`jsx-component-keyboard-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ot(u.name),console.warn(JSON.stringify({event:`jsx-component-keyboard-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}return}e.key!==`Enter`&&e.key!==` `||c&&M&&(t.closest(`.jsx-component-chrome`)||t.closest(`input, textarea, select, button`)||(e.preventDefault(),h(!0)))},xe=e=>{h(e),!e&&requestAnimationFrame(()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{let t=r.state.doc.nodeAt(e);if(!t)return;let n=e+t.nodeSize,i=r.state.selection.from;if(i<e||i>=n)return;if(L){let e=r.state.doc.resolve(Math.min(n,r.state.doc.content.size)),t=f.near(e,1);r.view.dispatch(r.state.tr.setSelection(t).scrollIntoView())}else r.chain().setNodeSelection(e).run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;Rt(u.name),console.warn(JSON.stringify({event:`jsx-component-popover-close-restore-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}})},Se=yc,Ce=Yl,we;t[33]===u.name?we=t[34]:(we=u.name.toLowerCase(),t[33]=u.name,t[34]=we);let Te;bb0:{let e=N.align;if(e===`left`||e===`right`||e===`center`){Te=e;break bb0}if(ee){Te=`center`;break bb0}Te=void 0}let Ee=O?`true`:void 0,De=k?`true`:void 0,Oe=T?`true`:void 0,ke=j?`true`:void 0,Ae=P?`true`:void 0,je=ve?`group`:void 0,Me=O?0:-1,Ne;t[35]===v?Ne=t[36]:(Ne=v?{draggable:`false`,onDragStart:s2}:{"data-drag-handle":``,draggable:`true`},t[35]=v,t[36]=Ne);let Pe=u.name,Fe=o2,Ie;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ie={[fF]:`true`},t[37]=Ie):Ie=t[37];let Le=ee&&[{value:`left`,label:l({id:`IR6Txi`}),Icon:Va},{value:`center`,label:l({id:`8nOdkO`}),Icon:za},{value:`right`,label:l({id:`pd0UH2`}),Icon:Ba}].map(e=>{let{value:t,label:n,Icon:i}=e,a=typeof N.align==`string`?N.align:`center`,o=(a===`left`||a===`right`||a===`center`?a:`center`)===t;return(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":n,"aria-pressed":o,"data-active":o?`true`:void 0,onClick:e=>{if(typeof _!=`number`)return;let n=r.state.doc.nodeAt(_);if(!n||n.type.name!==`jsxComponent`)return;let i=e.currentTarget.closest(`.jsx-component-wrapper`),a=String(n.attrs.componentName??``);if(!E0.has(a)||n.attrs.kind!==`element`)return;let o=a===`CommonMarkImage`,s={...n.attrs.props,align:t},c=o?{...n.attrs,componentName:`img`,props:s,sourceDirty:!0}:{...n.attrs,props:s,sourceDirty:!0};F0(i,()=>{r.view.dispatch(r.state.tr.setNodeMarkup(_,null,c))})},children:(0,X.jsx)(i,{size:12,"aria-hidden":`true`})},t)}),Re=u.name===`Embed`&&typeof V.src==`string`&&/^https?:\/\//i.test(V.src)&&(0,X.jsx)(`a`,{href:V.src,target:`_blank`,rel:`noopener noreferrer`,className:`jsx-chrome-btn`,"aria-label":l({id:`iOHg1t`}),onMouseDown:a2,children:(0,X.jsx)(Yi,{size:12,"aria-hidden":`true`})}),ze=u.name===`Mirror`&&typeof V.src==`string`&&V.src.length>0&&(()=>{let e=V.src;return(0,X.jsx)(`a`,{href:U(e,typeof V.anchor==`string`&&V.anchor.length>0?V.anchor:null),className:`jsx-chrome-btn`,"aria-label":l({id:`3a_Bd7`,values:{mirrorSrc:e}}),title:l({id:`0kTAXe`,values:{mirrorSrc:e}}),onMouseDown:i2,children:(0,X.jsx)(Yi,{size:12,"aria-hidden":`true`})})})(),Be;t[38]!==l||t[39]!==x||t[40]!==u.name||t[41]!==r||t[42]!==n.attrs.componentName||t[43]!==n.nodeSize||t[44]!==_?(Be=x&&(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`QyioBP`}),onClick:()=>{try{if(typeof _!=`number`)return;let e=r.state.doc.resolve(_),t=e.index(e.depth);if(t===0)return;let i=_-e.node(e.depth).child(t-1).nodeSize,a=_+n.nodeSize,o=r.state.tr,s=r.state.doc.slice(_,_+n.nodeSize),c=r.state.doc.slice(i,_);o.replaceWith(i,a,s.content.append(c.content)),r.view.dispatch(o.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ft(`up`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`up`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,X.jsx)(Ni,{size:12,"aria-hidden":`true`})}),t[38]=l,t[39]=x,t[40]=u.name,t[41]=r,t[42]=n.attrs.componentName,t[43]=n.nodeSize,t[44]=_,t[45]=Be):Be=t[45];let Ve;t[46]!==l||t[47]!==S||t[48]!==u.name||t[49]!==r||t[50]!==n.attrs.componentName||t[51]!==n.nodeSize||t[52]!==_?(Ve=S&&(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`3Ib6FN`}),onClick:()=>{try{if(typeof _!=`number`)return;let e=r.state.doc.resolve(_),t=e.index(e.depth),i=e.node(e.depth);if(t>=i.childCount-1)return;let a=i.child(t+1),o=_,s=_+n.nodeSize+a.nodeSize,c=r.state.tr,l=r.state.doc.slice(_,_+n.nodeSize),u=r.state.doc.slice(_+n.nodeSize,s);c.replaceWith(o,s,u.content.append(l.content)),r.view.dispatch(c.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ft(`down`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`down`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,X.jsx)(Mi,{size:12,"aria-hidden":`true`})}),t[46]=l,t[47]=S,t[48]=u.name,t[49]=r,t[50]=n.attrs.componentName,t[51]=n.nodeSize,t[52]=_,t[53]=Ve):Ve=t[53];let He;t[54]!==l||t[55]!==u.displayName||t[56]!==u.name||t[57]!==R||t[58]!==_||t[59]!==B?(He=R&&typeof _==`number`?(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`ky9Tuc`,values:{0:u.displayName??u.name}}),"data-testid":`jsx-component-edit-btn`,onClick:()=>B(!0),children:(0,X.jsx)(Oa,{size:12,"aria-hidden":`true`})}):null,t[54]=l,t[55]=u.displayName,t[56]=u.name,t[57]=R,t[58]=_,t[59]=B,t[60]=He):He=t[60];let Ue;t[61]!==l||t[62]!==de?(Ue=l({id:`MCjC9A`,values:{deleteDescriptorLabel:de}}),t[61]=l,t[62]=de,t[63]=Ue):Ue=t[63];let We;t[64]!==u.name||t[65]!==r||t[66]!==n.attrs.componentName||t[67]!==_?(We=()=>{if(typeof _==`number`)try{r.chain().focus().setNodeSelection(_).deleteSelection().run()||(ot(u.name),console.warn(JSON.stringify({event:`jsx-component-chrome-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ot(u.name),console.warn(JSON.stringify({event:`jsx-component-chrome-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},t[64]=u.name,t[65]=r,t[66]=n.attrs.componentName,t[67]=_,t[68]=We):We=t[68];let Ge;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,X.jsx)(Ha,{size:12,"aria-hidden":`true`}),t[69]=Ge):Ge=t[69];let Ke;t[70]!==Ue||t[71]!==We?(Ke=(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn jsx-chrome-btn--delete`,"aria-label":Ue,onClick:We,children:Ge}),t[70]=Ue,t[71]=We,t[72]=Ke):Ke=t[72];let Je;t[73]!==l||t[74]!==M||t[75]!==fe?(Je=M&&(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`XPJ0sN`,values:{settingsDescriptorLabel:fe}}),children:(0,X.jsx)(Ma,{size:12,"aria-hidden":`true`})})}),t[73]=l,t[74]=M,t[75]=fe,t[76]=Je):Je=t[76];let Ye;t[77]!==Fe||t[78]!==Ie||t[79]!==Le||t[80]!==Re||t[81]!==ze||t[82]!==Be||t[83]!==Ve||t[84]!==He||t[85]!==Ke||t[86]!==Je?(Ye=(0,X.jsxs)(`div`,{className:`jsx-component-chrome`,contentEditable:!1,onMouseDown:Fe,...Ie,children:[Le,Re,ze,Be,Ve,He,Ke,Je]}),t[77]=Fe,t[78]=Ie,t[79]=Le,t[80]=Re,t[81]=ze,t[82]=Be,t[83]=Ve,t[84]=He,t[85]=Ke,t[86]=Je,t[87]=Ye):Ye=t[87];let Xe;t[88]!==ue||t[89]!==u.emptyChildName||t[90]!==u.hasChildren||t[91]!==u.isSelfClosing||t[92]!==u.name||t[93]!==r||t[94]!==s||t[95]!==W||t[96]!==O||t[97]!==n.attrs.componentName||t[98]!==n.childCount||t[99]!==ge||t[100]!==re||t[101]!==ie||t[102]!==I||t[103]!==p||t[104]!==F?(Xe=F&&I?(0,X.jsx)(Sc,{asChild:!0,children:(0,X.jsx)(u1,{label:I.label,Icon:I.Icon,onClick:ge,selected:O})}):(0,X.jsx)(Q0,{resetKey:ie,onError:p,descriptorName:u.name===`*`?`wildcard`:u.name,rawComponentName:n.attrs.componentName??``,children:(0,X.jsx)(nk,{value:typeof s==`function`?{editor:r,getPos:()=>{let e=s();return typeof e==`number`?e:void 0},addChild:u.emptyChildName?()=>{let e=u.emptyChildName,t=lM(e),n=W();r.chain().focus().insertContentAt(n,t).run(),pM(r,n,rM(e))}:null}:null,children:(0,X.jsx)(ue,{...re,children:(0,X.jsx)(Jl,{className:`component-children ${!u.hasChildren&&n.childCount===0?`min-h-0 m-0 p-0`:``}`,...!u.hasChildren||u.isSelfClosing?{contentEditable:!1}:{}})})})}),t[88]=ue,t[89]=u.emptyChildName,t[90]=u.hasChildren,t[91]=u.isSelfClosing,t[92]=u.name,t[93]=r,t[94]=s,t[95]=W,t[96]=O,t[97]=n.attrs.componentName,t[98]=n.childCount,t[99]=ge,t[100]=re,t[101]=ie,t[102]=I,t[103]=p,t[104]=F,t[105]=Xe):Xe=t[105];let Ze;t[106]!==u.emptyChildName||t[107]!==u.name||t[108]!==r||t[109]!==W||t[110]!==n.childCount?(Ze=u.emptyChildName&&!(u.name===`Tabs`&&n.childCount>0)&&(()=>{let e=u.emptyChildName;return(0,X.jsx)(`button`,{type:`button`,contentEditable:!1,className:n.childCount===0?`jsx-empty-child-placeholder`:`jsx-add-child-pill`,onMouseDown:r2,onClick:()=>{let e=u.emptyChildName,t=lM(e),n=W();r.chain().focus().insertContentAt(n,t).run(),pM(r,n,rM(e))},"data-clipboard-omit":`true`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`7Fkcej`,values:{addChildName:e}})})})})(),t[106]=u.emptyChildName,t[107]=u.name,t[108]=r,t[109]=W,t[110]=n.childCount,t[111]=Ze):Ze=t[111];let Qe;t[112]!==Ce||t[113]!==u.name||t[114]!==ye||t[115]!==me||t[116]!==be||t[117]!==A||t[118]!==we||t[119]!==Te||t[120]!==Ee||t[121]!==De||t[122]!==Oe||t[123]!==ke||t[124]!==Ae||t[125]!==je||t[126]!==Me||t[127]!==Ne||t[128]!==Ye||t[129]!==Xe||t[130]!==Ze?(Qe=(0,X.jsxs)(Ce,{className:`jsx-component-wrapper my-2`,"data-jsx-component":``,"data-component-type":we,"data-align":Te,"data-selected":Ee,"data-has-child-selected":De,"data-range-selected":Oe,"data-selection-origin":A,"data-dragging":ke,"data-needs-config":Ae,role:je,"aria-label":ye,tabIndex:Me,...Ne,"data-component-name":Pe,onClick:me,onKeyDown:be,children:[Ye,Xe,Ze]}),t[112]=Ce,t[113]=u.name,t[114]=ye,t[115]=me,t[116]=be,t[117]=A,t[118]=we,t[119]=Te,t[120]=Ee,t[121]=De,t[122]=Oe,t[123]=ke,t[124]=Ae,t[125]=je,t[126]=Me,t[127]=Ne,t[128]=Ye,t[129]=Xe,t[130]=Ze,t[131]=Qe):Qe=t[131];let $e;t[132]!==l||t[133]!==N||t[134]!==u.Component||t[135]!==u.displayName||t[136]!==u.name||t[137]!==z||t[138]!==R||t[139]!==r||t[140]!==s||t[141]!==_||t[142]!==re||t[143]!==B?($e=R&&typeof _==`number`?(0,X.jsx)(gZ,{open:z,onOpenChange:B,initialValue:typeof N[R.propName]==`string`?N[R.propName]:``,language:R.language,title:l({id:`ky9Tuc`,values:{0:u.displayName??u.name}}),renderPreview:e=>{let t=u.Component;return(0,X.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-4`,children:(0,X.jsx)(t,{...re,[R.propName]:e})})},onSave:e=>{let t=typeof s==`function`?s():void 0;if(typeof t!=`number`)return;let n=r.state.doc.nodeAt(t);if(n&&n.attrs.kind===`element`)try{let i={...n.attrs.props??{},[R.propName]:e},a={...n.attrs,props:i,sourceDirty:!0};r.view.dispatch(r.state.tr.setNodeMarkup(t,null,a))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[JsxComponentView] edit-save failed — position race`,t)}}}):null,t[132]=l,t[133]=N,t[134]=u.Component,t[135]=u.displayName,t[136]=u.name,t[137]=z,t[138]=R,t[139]=r,t[140]=s,t[141]=_,t[142]=re,t[143]=B,t[144]=$e):$e=t[144];let et;t[145]!==u||t[146]!==r||t[147]!==s||t[148]!==M||t[149]!==L||t[150]!==V||t[151]!==pe||t[152]!==F?(et=M&&(0,X.jsxs)(xc,{side:F?`bottom`:`right`,align:F?`center`:`start`,sideOffset:F?-4:8,className:`w-64 p-3 z-[60] overflow-y-auto subtle-scrollbar max-h-[calc(100vh-2rem)] overscroll-contain`,onCloseAutoFocus:L?e=>{e.preventDefault(),r.view.focus()}:void 0,children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:(0,X.jsx)(o,{id:`Mnavhe`,values:{propPanelDescriptorLabel:pe}})}),(0,X.jsx)(Z1,{descriptor:u,values:V,onChange:(e,t)=>{let n=typeof s==`function`?s():void 0;if(typeof n!=`number`)return;let i=r.state.doc.nodeAt(n);if(!i||i.attrs.kind!==`element`)return;let a={...i.attrs.props??{}},o=Array.isArray(i.attrs.attributes)?i.attrs.attributes:[],c=o;t===void 0?(delete a[e],c=o.filter(t=>!(typeof t==`object`&&t&&t.type===`mdxJsxAttribute`&&t.name===e))):a[e]=t,r.view.dispatch(r.state.tr.setNodeMarkup(n,null,{...i.attrs,attributes:c,props:a,sourceDirty:!0}))}})]}),t[145]=u,t[146]=r,t[147]=s,t[148]=M,t[149]=L,t[150]=V,t[151]=pe,t[152]=F,t[153]=et):et=t[153];let tt;return t[154]!==Se||t[155]!==xe||t[156]!==m||t[157]!==Qe||t[158]!==$e||t[159]!==et?(tt=(0,X.jsxs)(Se,{open:m,onOpenChange:xe,children:[Qe,$e,et]}),t[154]=Se,t[155]=xe,t[156]=m,t[157]=Qe,t[158]=$e,t[159]=et,t[160]=tt):tt=t[160],tt}function r2(e){return e.stopPropagation()}function i2(e){return e.stopPropagation()}function a2(e){return e.stopPropagation()}function o2(e){return e.stopPropagation()}function s2(e){return e.preventDefault()}function c2(e){return!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`}var l2=P.extend({addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return ru(n2)}}),u2={name:`InlineMath`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,category:`content`,description:`Inline math`,props:[{name:`formula`,type:`string`,required:!0,autoFocus:!0,description:`LaTeX inline math source`}]},d2=(0,Y.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-DX-tM4Fr.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,J.c)(4),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!1,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;return n[2]===i?a=n[3]:(a=(0,X.jsx)(`span`,{className:`math math-inline`,dangerouslySetInnerHTML:{__html:i}}),n[2]=i,n[3]=a),a}return{default:t}});function f2(){let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`span`,{className:`math math-inline math-placeholder math-placeholder-empty inline-flex items-center gap-1 rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs italic text-muted-foreground hover:bg-muted/60 cursor-pointer`,"data-component-type":`math-inline`,children:`f(x)`}),e[0]=t):t=e[0],t}function p2(e){let t=(0,J.c)(2),n;return t[0]===e.formula?n=t[1]:(n=(0,X.jsx)(`span`,{className:`math math-inline math-placeholder`,"data-component-type":`math-inline`,children:e.formula}),t[0]=e.formula,t[1]=n),n}function m2(e){let t=(0,J.c)(38),{node:n,selected:r,getPos:i,editor:a}=e,s=typeof n.attrs.formula==`string`?n.attrs.formula:``,c=typeof n.attrs.id==`string`?n.attrs.id:void 0,[l,u]=(0,Y.useState)(!1),d=(0,Y.useRef)(!1),f;t[0]!==a.state||t[1]!==i||t[2]!==r?(f=()=>{let e=r&&a.state.selection instanceof we;e&&!d.current?(fM(typeof i==`function`?i()??0:0),u(!0)):!e&&d.current&&u(!1),d.current=e},t[0]=a.state,t[1]=i,t[2]=r,t[3]=f):f=t[3];let p;t[4]!==a||t[5]!==i||t[6]!==r?(p=[r,i,a],t[4]=a,t[5]=i,t[6]=r,t[7]=p):p=t[7],(0,Y.useEffect)(f,p);let m=r?`math-inline-selected`:void 0,h;t[8]===c?h=t[9]:(h=c?{id:c}:{},t[8]=c,t[9]=h);let g;t[10]===s?g=t[11]:(g=s?(0,X.jsx)(c1,{resetKeys:[s],onError:g2,fallbackRender:()=>(0,X.jsx)(`span`,{className:`math math-inline math-error`,children:s}),children:(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(p2,{formula:s}),children:(0,X.jsx)(d2,{formula:s})})}):(0,X.jsx)(f2,{}),t[10]=s,t[11]=g);let _;t[12]!==s||t[13]!==h||t[14]!==g?(_=(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(`span`,{className:`math-inline-trigger`,"data-component-type":`math-inline`,"data-formula":s,...h,children:g})}),t[12]=s,t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]===a.view?v=t[17]:(v=e=>{e.preventDefault(),a.view.focus()},t[16]=a.view,t[17]=v);let y;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground px-3 pt-2`,children:(0,X.jsx)(o,{id:`EOjU5V`})}),t[18]=y):y=t[18];let b;t[19]===s?b=t[20]:(b={formula:s},t[19]=s,t[20]=b);let x;t[21]!==a.state||t[22]!==a.view||t[23]!==i?(x=(e,t)=>{let n=typeof i==`function`?i():void 0;if(typeof n!=`number`)return;let r=a.state.doc.nodeAt(n);if(!r||r.type.name!==`mathInline`)return;let o=a.state.tr.setNodeMarkup(n,null,{...r.attrs,[e]:t??``});o.setSelection(we.create(o.doc,n)),a.view.dispatch(o)},t[21]=a.state,t[22]=a.view,t[23]=i,t[24]=x):x=t[24];let S;t[25]!==x||t[26]!==b?(S=(0,X.jsx)(Z1,{descriptor:u2,values:b,onChange:x}),t[25]=x,t[26]=b,t[27]=S):S=t[27];let C;t[28]!==S||t[29]!==v?(C=(0,X.jsxs)(xc,{className:`z-[60] w-72 p-0`,side:`bottom`,align:`start`,onOpenAutoFocus:h2,onCloseAutoFocus:v,children:[y,S]}),t[28]=S,t[29]=v,t[30]=C):C=t[30];let w;t[31]!==l||t[32]!==C||t[33]!==_?(w=(0,X.jsxs)(yc,{open:l,onOpenChange:u,children:[_,C]}),t[31]=l,t[32]=C,t[33]=_,t[34]=w):w=t[34];let T;return t[35]!==w||t[36]!==m?(T=(0,X.jsx)(Yl,{as:`span`,className:m,children:w}),t[35]=w,t[36]=m,t[37]=T):T=t[37],T}function h2(e){e.preventDefault()}function g2(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`mathInline`,rawComponentName:`mathInline`,error:String(n),stack:t.componentStack})),_t(`mathInline`)}var _2=H.extend({addNodeView(){return ru(m2)}});function v2(e,t){if(!e.selection.empty)return null;let n=t===`up`||t===`left`?-1:1,r=e.selection.$head,i=n>0?r.after():r.before();if(typeof i!=`number`)return null;let a=le.near(e.doc.resolve(i),n);return a.$head?.parent.type.name===`rawMdxFallback`?a:null}function y2(e,t){let{state:n,view:r}=e;if(!r.endOfTextblock(t))return!1;let i=v2(n,t);return i?(r.dispatch(n.tr.setSelection(i)),!0):!1}var b2=Gt.extend({addKeyboardShortcuts(){return{ArrowLeft:({editor:e})=>y2(e,`left`),ArrowRight:({editor:e})=>y2(e,`right`),ArrowUp:({editor:e})=>y2(e,`up`),ArrowDown:({editor:e})=>y2(e,`down`)}},addNodeView(){return ru(lZ,{stopEvent:()=>!0,ignoreMutation:()=>!0})}});function x2(e){let t=(0,J.c)(51),{items:n,selectedIndex:r,categoryLabels:a,onSelect:s,onHoverIndex:c}=e,l=(0,Y.useRef)(null),u=(0,Y.useId)(),{_:d}=i(),f=r>=0&&r<n.length?`${u}-option-${r}`:void 0,p=C2,m,h;if(t[0]===r?(m=t[1],h=t[2]):(m=()=>{let e=l.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(r);t&&t.scrollIntoView({block:`nearest`})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Y.useEffect)(m,h),n.length===0){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{ref:l,role:`status`,"aria-live":`polite`,className:`w-56 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:p,children:(0,X.jsx)(o,{id:`Ev2r9A`})}),t[4]=n):n=t[4],n}let g,_,v,y,b,x,S,C,w,T,E,D,O;if(t[5]!==d||t[6]!==f||t[7]!==a||t[8]!==n||t[9]!==u||t[10]!==c||t[11]!==s||t[12]!==r){let e=[],i=0,o=new Map;for(let t of n){o.set(t,i++);let n=e.find(e=>e.key===t.category);n?n.items.push(t):e.push({key:t.category,items:[t]})}_=r>=0&&r<n.length?n[r]:null;let m;t[26]===n?m=t[27]:(m=n.some(S2),t[26]=n,t[27]=m),g=m,x=`flex items-start gap-2`,S=l,C=`listbox`,t[28]===d?w=t[29]:(w=d({id:`RlCInP`}),t[28]=d,t[29]=w),T=f,E=-1,D=p,O=`w-56 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,t[30]===Symbol.for(`react.memo_cache_sentinel`)?(v={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[30]=v):v=t[30];let h=_?`${_.label}${_.preview?`. ${_.preview.description}`:``}`:``;t[31]===h?y=t[32]:(y=(0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:h}),t[31]=h,t[32]=y),b=e.map(e=>(0,X.jsxs)(`div`,{role:`group`,"aria-labelledby":`${u}-group-${e.key}`,children:[(0,X.jsx)(`div`,{id:`${u}-group-${e.key}`,className:`px-2 py-1.5 text-xs font-semibold text-muted-foreground`,children:a[e.key]??e.key}),e.items.map(e=>{let t=o.get(e)??0,n=t===r,i=e.icon;return(0,X.jsxs)(`button`,{id:`${u}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseEnter:()=>c?.(t),onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,X.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(`div`,{className:`flex flex-col min-w-0`,children:(0,X.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.name)})]},e.key)),t[5]=d,t[6]=f,t[7]=a,t[8]=n,t[9]=u,t[10]=c,t[11]=s,t[12]=r,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S,t[20]=C,t[21]=w,t[22]=T,t[23]=E,t[24]=D,t[25]=O}else g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19],C=t[20],w=t[21],T=t[22],E=t[23],D=t[24],O=t[25];let k;t[33]!==v||t[34]!==y||t[35]!==b||t[36]!==S||t[37]!==C||t[38]!==w||t[39]!==T||t[40]!==E||t[41]!==D||t[42]!==O?(k=(0,X.jsxs)(`div`,{ref:S,role:C,"aria-label":w,"aria-activedescendant":T,tabIndex:E,onMouseDown:D,className:O,style:v,children:[y,b]}),t[33]=v,t[34]=y,t[35]=b,t[36]=S,t[37]=C,t[38]=w,t[39]=T,t[40]=E,t[41]=D,t[42]=O,t[43]=k):k=t[43];let A;t[44]!==g||t[45]!==_?(A=g?(0,X.jsx)(`aside`,{"aria-hidden":`true`,onMouseDown:p,className:`w-64 rounded-lg border bg-popover p-2 shadow-md ${_?.preview?``:`invisible`}`,children:_?.preview?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`mb-2 flex aspect-5/3 items-center justify-center overflow-hidden rounded-md bg-muted/40 p-3 *:max-h-full *:max-w-full [&_img]:size-full [&_img]:rounded-md [&_img]:object-contain`,children:_.preview.render()}),(0,X.jsx)(`p`,{className:`px-1 pb-1 text-xs text-muted-foreground`,children:_.preview.description})]}):null}):null,t[44]=g,t[45]=_,t[46]=A):A=t[46];let j;return t[47]!==x||t[48]!==k||t[49]!==A?(j=(0,X.jsxs)(`div`,{className:x,children:[k,A]}),t[47]=x,t[48]=k,t[49]=A,t[50]=j):j=t[50],j}function S2(e){return e.preview}function C2(e){return e.preventDefault()}var w2=new b(`slashCommand`),T2=Wt.create({name:`slashCommand`,addOptions(){return{itemsSources:[EM],categoryLabels:{basic:`Basic blocks`,insert:`Insert`}}},addProseMirrorPlugins(){let e=this;return[Jy({editor:this.editor,pluginKey:w2,char:`/`,startOfLine:!1,allow:({editor:e})=>!tb(e),items:({query:t})=>{let n=e.options.itemsSources.flatMap(e=>{try{return e()}catch(e){return console.error(`[slash-command] item source threw an error`,e),[]}}),r=Object.keys(e.options.categoryLabels),i=e=>{let t=r.indexOf(e);return t===-1?1/0:t};return DM(n.map((e,t)=>({item:e,i:t})).sort((e,t)=>{let n=i(e.item.category)-i(t.item.category);return n===0?e.i-t.i:n}).map(e=>e.item),t)},command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).run()}catch(e){console.error(`[slash-command] deleteRange failed for "${n.name}"`,e);return}try{n.command(e)}catch(e){console.error(`[slash-command] command "${n.name}" threw an error`,e)}},render:()=>{let t=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=e=>{e!==r&&(r=e,s())},s=()=>{!t||!n||t.updateProps({items:n.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:n.command,onHoverIndex:o})};return{onStart(s){n=s,r=0;let c=nb(()=>n,`slash-command`);i.popup=c.popup,a=c.doPosition,t=new tu(x2,{props:{items:s.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:s.command,onHoverIndex:o},editor:s.editor}),c.popup.appendChild(t.element),i.stopAutoUpdate=c.startAutoUpdate(),c.reveal()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),s(),a?.()},onKeyDown({event:e}){if(!n||n.items.length===0)return!1;let t=n.items;if(e.key===`ArrowDown`)return r=(r+1)%t.length,s(),!0;if(e.key===`ArrowUp`)return r=(r-1+t.length)%t.length,s(),!0;if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e&&n.command(e),!0}return e.key,!1},onExit(){rb(i),a=null,t?.destroy(),t=null,n=null,r=0}}}})]}}),E2=new b(`sourceDirty`),D2=Wt.create({name:`sourceDirtyObserver`,addProseMirrorPlugins(){return[new S({key:E2,appendTransaction(e,t,n){if(!e.some(e=>!e.getMeta(Uv))||!e.some(e=>e.docChanged))return null;let r=new St;for(let t of e)r.appendMapping(t.mapping);let i=r.invert(),a=[];if(n.doc.descendants((e,n)=>{if(e.type.name!==`jsxComponent`||e.attrs.sourceDirty)return;let r=i.map(n),o=t.doc.nodeAt(r),s=!o||o.type.name!==`jsxComponent`,c=typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0;if(s&&c)return;if(!o){(e.content.size>0||Object.keys(e.attrs.props??{}).length>0)&&a.push({pos:n});return}if(o.type.name!==`jsxComponent`){a.push({pos:n});return}let l=!O2(o.attrs.props,e.attrs.props),u=!o.content.eq(e.content);(l||u)&&a.push({pos:n})}),a.length===0)return null;let o=n.tr;for(let{pos:e}of a)o.setNodeAttribute(e,`sourceDirty`,!0);return o}})]}});function O2(e,t){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!O2(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!O2(e[r],t[r]))return!1;return!0}function k2(e,t){let n=e.doc.nodeAt(t);if(!n||n.type.name!==`table`)return null;let r=he.get(n);return{map:r,tableStart:t+1,table:n,left:0,top:0,right:r.width,bottom:r.height}}function A2(e,t){let n=k2(e,t);return n?u(e.tr,n,n.map.width):null}function j2(e,t){let n=k2(e,t);return n?ct(e.tr,n,n.map.height):null}function M2(e,t){if(!e.dom.contains(t))return null;let n;try{n=e.posAtDOM(t,0)}catch{return null}return n<0?null:Zt(e.state.doc.resolve(n))?.pos??null}var N2=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`;function P2(e,t){let n=document.createElement(`button`);return n.type=`button`,n.className=`ok-table-insert-bar ok-table-insert-${e}`,n.setAttribute(`aria-label`,t),n.tabIndex=-1,n.setAttribute(fF,`true`),n.innerHTML=N2,n.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),n}var F2=class{overlays=new Map;mount;lastEditable;constructor(e,t){this.view=e,this.editor=t,this.mount=e.dom.parentElement??e.dom,this.lastEditable=t.isEditable,this.reconcile()}update(e,t){let n=this.editor.isEditable!==this.lastEditable;this.lastEditable=this.editor.isEditable,!(!n&&t.doc.eq(this.view.state.doc))&&this.reconcile()}destroy(){for(let e of this.overlays.keys())this.removeOverlay(e)}reconcile(){if(!this.editor.isEditable){this.destroy();return}let e=new Set(this.view.dom.querySelectorAll(`.tableWrapper`));for(let t of this.overlays.keys())e.has(t)||this.removeOverlay(t);for(let t of e)this.overlays.has(t)||this.addOverlay(t)}addOverlay(e){let t=document.createElement(`div`);t.className=`ok-table-insert-controls`,t.setAttribute(fF,`true`);let n=P2(`column`,`Add column`),r=P2(`row`,`Add row`);n.addEventListener(`click`,()=>this.insert(e,A2)),r.addEventListener(`click`,()=>this.insert(e,j2)),t.append(n,r),this.mount.appendChild(t);let i=z(e,t,()=>{let{width:t,height:i}=e.getBoundingClientRect();Bt(e,n,{strategy:`absolute`,placement:`right-start`}).then(({x:e,y:t})=>{n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.height=`${i}px`}).catch(()=>{}),Bt(e,r,{strategy:`absolute`,placement:`bottom-start`}).then(({x:e,y:n})=>{r.style.left=`${e}px`,r.style.top=`${n}px`,r.style.width=`${t}px`}).catch(()=>{})}),a=e=>{let t=e.target instanceof Element?e.target.closest(`td, th`):null,i=t?.parentElement;n.classList.toggle(`is-active`,!!t&&t===i?.lastElementChild),r.classList.toggle(`is-active`,!!i&&i===i.parentElement?.lastElementChild)},o=()=>{n.classList.remove(`is-active`),r.classList.remove(`is-active`)};e.addEventListener(`pointerover`,a),e.addEventListener(`pointerleave`,o),this.overlays.set(e,{container:t,cleanup:()=>{i(),e.removeEventListener(`pointerover`,a),e.removeEventListener(`pointerleave`,o),t.remove()}})}removeOverlay(e){let t=this.overlays.get(e);t&&(t.cleanup(),this.overlays.delete(e))}insert(e,t){let n=e.querySelector(`table`);if(!n)return;let r=M2(this.view,n);if(r===null)return;let i=t(this.view.state,r);i&&(this.view.dispatch(i),this.view.focus())}},I2=Wt.create({name:`tableInsertControls`,addProseMirrorPlugins(){let e=this.editor;return[new S({key:new b(`tableInsertControls`),view:t=>new F2(t,e)})]}}),L2=`ok:tag-click`;function R2(e){if(typeof document>`u`)return;let t={value:e};document.dispatchEvent(new CustomEvent(L2,{detail:t}))}function z2(e){return e instanceof Element?e.closest(`a[data-tag]`):null}var B2=Wt.create({name:`tagClick`,addProseMirrorPlugins(){return[new S({props:{handleDOMEvents:{click(e,t){let n=z2(t.target);if(!n)return!1;let r=n.getAttribute(`data-tag`);return r?(t.preventDefault(),t.stopPropagation(),R2(r),!0):!1}}}})]}});function V2(e,t,n){if(typeof t!=`number`||!n||!D.test(n))return!1;let{state:r,view:i}=e,a=r.doc.nodeAt(t);if(!a||a.type.name!==`tag`)return!1;let o=r.tr.setNodeMarkup(t,null,{...a.attrs,value:n}),s=t+a.nodeSize;return o.insertText(` `,s),o.setSelection(f.create(o.doc,s+1)),i.dispatch(o),i.focus(),!0}function H2(e,t){if(typeof t!=`number`)return;let{state:n,view:r}=e,i=n.doc.nodeAt(t);if(!i||i.type.name!==`tag`)return;let a=n.tr.delete(t,t+i.nodeSize);r.dispatch(a),r.focus()}function U2(e){let t=(0,J.c)(3),{value:n}=e,r=`#tag/${n}`,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsxs)(`a`,{className:`tag`,"data-tag":n,href:r,children:[`#`,n]}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function W2(e){let t=(0,J.c)(20),{initialDraft:n,onCommit:r,onCancel:a}=e,{_:o}=i(),s=(0,Y.useRef)(null),[c,l]=(0,Y.useState)(n),u=(0,Y.useRef)(!1),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=requestAnimationFrame(()=>{s.current?.focus()});return()=>cancelAnimationFrame(e)},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,Y.useEffect)(d,f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono`,children:`#`}),t[2]=p):p=t[2];let m=Math.max(c.length,8),h;t[3]===o?h=t[4]:(h=o({id:`U2pMtf`}),t[3]=o,t[4]=h);let g;t[5]===o?g=t[6]:(g=o({id:`knjOzA`}),t[5]=o,t[6]=g);let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{let t=e.target.value;(t===``||D.test(t))&&l(t)},t[7]=_):_=t[7];let v,y;t[8]!==c||t[9]!==a||t[10]!==r?(v=e=>{e.key===`Enter`||e.key===` `?(e.preventDefault(),u.current=!0,r(c)||(u.current=!1,a())):(e.key===`Escape`||e.key===`Backspace`&&c===``)&&(e.preventDefault(),a())},y=()=>{if(!u.current){if(c===``){a();return}D.test(c)?r(c):a()}},t[8]=c,t[9]=a,t[10]=r,t[11]=v,t[12]=y):(v=t[11],y=t[12]);let b;return t[13]!==c||t[14]!==m||t[15]!==h||t[16]!==g||t[17]!==v||t[18]!==y?(b=(0,X.jsxs)(`span`,{className:`tag tag-placeholder inline-flex items-center rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs text-muted-foreground`,"data-component-type":`tag-placeholder`,children:[p,(0,X.jsx)(`input`,{ref:s,type:`text`,value:c,size:m,placeholder:h,"aria-label":g,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`,className:`bg-transparent border-0 p-0 outline-none focus:outline-none focus:ring-0 text-inherit font-inherit`,onChange:_,onKeyDown:v,onBlur:y})]}),t[13]=c,t[14]=m,t[15]=h,t[16]=g,t[17]=v,t[18]=y,t[19]=b):b=t[19],b}function G2(e){let t=(0,J.c)(5),{node:n,getPos:r,editor:i}=e,a=typeof n.attrs.value==`string`?n.attrs.value:``;if(a===``){let e;return t[0]!==i||t[1]!==r?(e=(0,X.jsx)(Yl,{as:`span`,children:(0,X.jsx)(W2,{initialDraft:``,onCommit:e=>V2(i,typeof r==`function`?r():void 0,e),onCancel:()=>H2(i,typeof r==`function`?r():void 0)})}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let o;return t[3]===a?o=t[4]:(o=(0,X.jsx)(Yl,{as:`span`,children:(0,X.jsx)(U2,{value:a})}),t[3]=a,t[4]=o),o}var K2=Lt.extend({priority:200,addNodeView(){return ru(G2)},addKeyboardShortcuts(){return{Backspace:()=>{if(ib.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(ib.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[db(this.editor)]}}),q2=2048,J2=24;function Y2(e){if(typeof e!=`string`)return{kind:`unsupported`,value:``};let t=e.trim();if(t===``||t.length>q2)return{kind:`unsupported`,value:``};if(Q2(t))return{kind:`emoji`,value:t};let n=$2(t);return n===`url`?{kind:`url`,value:t}:n===`path`?{kind:`path`,value:Fe(`/api/asset?path=${encodeURIComponent(Z2(t))}`)}:{kind:`unsupported`,value:``}}function X2(e){if(typeof e!=`string`)return{kind:`unsupported`,value:``};let t=e.trim();if(t===``||t.length>q2)return{kind:`unsupported`,value:``};let n=$2(t);return n===`url`?{kind:`url`,value:t}:n===`path`?{kind:`path`,value:Fe(`/api/asset?path=${encodeURIComponent(Z2(t))}`)}:{kind:`unsupported`,value:``}}function Z2(e){return e.startsWith(`/`)?e.slice(1):e}function Q2(e){if(/\p{L}/u.test(e)||e.includes(`/`))return!1;let t=0;for(let n of e)t++;if(t>J2)return!1;let n=e.lastIndexOf(`.`);if(n>-1){let t=e.slice(n+1).toLowerCase();if(g.has(t))return!1}return!0}function $2(e){let t=e4(e);if(!t||!g.has(t))return`unsupported`;let n=e.indexOf(`:`),r=e.indexOf(`/`);return n>-1&&(r===-1||n<r)?v(e)?`url`:`unsupported`:e.startsWith(`//`)||e.includes(`?`)||e.includes(`#`)||e.startsWith(`../`)||e.includes(`/../`)?`unsupported`:`path`}function e4(e){let t=e.lastIndexOf(`/`),n=t>-1?e.slice(t+1):e,r=n.search(/[?#]/),i=r>-1?n.slice(0,r):n,a=i.lastIndexOf(`.`);return a<=0||a===i.length-1?null:i.slice(a+1).toLowerCase()}function t4(e){let t=(0,J.c)(125),{open:n,target:r,alias:a,anchor:s,pages:c,assetPaths:l,loading:u,onOpenChange:d,onSave:f}=e,[p,m]=(0,Y.useState)(r),[h,g]=(0,Y.useState)(a??``),[_,v]=(0,Y.useState)(s??``),y=(0,Y.useId)(),b=(0,Y.useId)(),x=(0,Y.useId)(),S=(0,Y.useId)(),{_:C}=i(),w;t[0]!==l||t[1]!==p?(w=iO(p,l),t[0]=l,t[1]=p,t[2]=w):w=t[2];let T=w,E;t[3]!==l||t[4]!==p||t[5]!==c?(E=aO(p,c,l),t[3]=l,t[4]=p,t[5]=c,t[6]=E):E=t[6];let D=X$(p,E&&!T&&n),O=(0,Y.useRef)(!1),k,A;t[7]!==a||t[8]!==s||t[9]!==n||t[10]!==r?(k=()=>{if(!n){O.current=!1;return}O.current||(O.current=!0,m(r),g(a??``),v(s??``))},A=[n,r,a,s],t[7]=a,t[8]=s,t[9]=n,t[10]=r,t[11]=k,t[12]=A):(k=t[11],A=t[12]),(0,Y.useEffect)(k,A);let j;t[13]!==h||t[14]!==_||t[15]!==p||t[16]!==d||t[17]!==f?(j=function(){let e=p.trim();e&&(f(e,h.trim()||null,_.trim()||null),d(!1))},t[13]=h,t[14]=_,t[15]=p,t[16]=d,t[17]=f,t[18]=j):j=t[18];let M=j,N;t[19]===M?N=t[20]:(N=function(e){e.key===`Enter`&&(e.preventDefault(),M())},t[19]=M,t[20]=N);let P=N,F;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){m(e.path),v(``)},t[21]=F):F=t[21];let I=F,L,ee,R,z,B,V,H,U,te,ne,re,ie,ae,W;if(t[22]!==C||t[23]!==x||t[24]!==b||t[25]!==l||t[26]!==h||t[27]!==_||t[28]!==p||t[29]!==P||t[30]!==S||t[31]!==D||t[32]!==u||t[33]!==d||t[34]!==n||t[35]!==c||t[36]!==y){let e=new Map,r=D?.map(t=>{let n=e.get(t.slug)??0;e.set(t.slug,n+1);let r=n===0?t.slug:`${t.slug}-${n}`;return{...t,reactKey:r}}),i=!!r?.length;R=$n,re=n,ie=d,ee=Gn,U=`sm:max-w-xl`,te=``;let a;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Bn,{children:(0,X.jsx)(o,{id:`xzktOa`})}),t[51]=a):a=t[51],t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,X.jsxs)(Qn,{children:[a,(0,X.jsx)(Rn,{children:(0,X.jsx)(o,{id:`Jhj_lh`})})]}),t[52]=ne):ne=t[52],L=Jn,B=`space-y-6`;let s;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(o,{id:`lGs_bQ`,components:{0:(0,X.jsx)(`span`,{className:`text-red-500`})}}),t[53]=s):s=t[53];let f;t[54]===y?f=t[55]:(f=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:y,children:s}),t[54]=y,t[55]=f);let w;t[56]===C?w=t[57]:(w=C({id:`aM23Wr`}),t[56]=C,t[57]=w);let T;t[58]!==l||t[59]!==p||t[60]!==P||t[61]!==u||t[62]!==c||t[63]!==w||t[64]!==y?(T=(0,X.jsx)(L$,{id:y,value:p,pages:c,assetPaths:l,includeAssets:!0,loading:u,onValueChange:m,onSuggestionSelect:I,placeholder:w,autoFocus:!0,"aria-required":`true`,onKeyDown:P}),t[58]=l,t[59]=p,t[60]=P,t[61]=u,t[62]=c,t[63]=w,t[64]=y,t[65]=T):T=t[65],t[66]!==f||t[67]!==T?(V=(0,X.jsxs)(`div`,{children:[f,T]}),t[66]=f,t[67]=T,t[68]=V):V=t[68];let E;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(o,{id:`OTF92M`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[69]=E):E=t[69];let O;t[70]===x?O=t[71]:(O=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:x,children:E}),t[70]=x,t[71]=O);let k;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>g(e.target.value),t[72]=k):k=t[72];let A;t[73]===C?A=t[74]:(A=C({id:`BH56dn`}),t[73]=C,t[74]=A);let j;t[75]!==x||t[76]!==h||t[77]!==P||t[78]!==A?(j=(0,X.jsx)(ir,{id:x,value:h,onChange:k,placeholder:A,onKeyDown:P}),t[75]=x,t[76]=h,t[77]=P,t[78]=A,t[79]=j):j=t[79],t[80]!==O||t[81]!==j?(H=(0,X.jsxs)(`div`,{children:[O,j]}),t[80]=O,t[81]=j,t[82]=H):H=t[82];let M;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,X.jsx)(o,{id:`Tjc1pH`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[83]=M):M=t[83],t[84]===b?ae=t[85]:(ae=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:b,children:M}),t[84]=b,t[85]=ae);let N;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>v(e.target.value),t[86]=N):N=t[86];let F;t[87]===C?F=t[88]:(F=C({id:`W-ntoW`}),t[87]=C,t[88]=F),t[89]!==b||t[90]!==_||t[91]!==P||t[92]!==F?(W=(0,X.jsx)(ir,{id:b,value:_,onChange:N,placeholder:F,onKeyDown:P}),t[89]=b,t[90]=_,t[91]=P,t[92]=F,t[93]=W):W=t[93],z=i&&(0,X.jsx)(`div`,{id:S,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:r.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":_===e.slug,className:vn(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,_===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>v(_===e.slug?``:e.slug),children:[(0,X.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,X.jsx)(`span`,{className:`truncate`,children:e.text})]},e.reactKey))}),t[22]=C,t[23]=x,t[24]=b,t[25]=l,t[26]=h,t[27]=_,t[28]=p,t[29]=P,t[30]=S,t[31]=D,t[32]=u,t[33]=d,t[34]=n,t[35]=c,t[36]=y,t[37]=L,t[38]=ee,t[39]=R,t[40]=z,t[41]=B,t[42]=V,t[43]=H,t[44]=U,t[45]=te,t[46]=ne,t[47]=re,t[48]=ie,t[49]=ae,t[50]=W}else L=t[37],ee=t[38],R=t[39],z=t[40],B=t[41],V=t[42],H=t[43],U=t[44],te=t[45],ne=t[46],re=t[47],ie=t[48],ae=t[49],W=t[50];let oe;t[94]!==z||t[95]!==ae||t[96]!==W?(oe=(0,X.jsxs)(`div`,{children:[ae,W,z]}),t[94]=z,t[95]=ae,t[96]=W,t[97]=oe):oe=t[97];let se;t[98]!==B||t[99]!==V||t[100]!==H||t[101]!==oe?(se=(0,X.jsxs)(`div`,{className:B,children:[V,H,oe]}),t[98]=B,t[99]=V,t[100]=H,t[101]=oe,t[102]=se):se=t[102];let G;t[103]!==L||t[104]!==se?(G=(0,X.jsx)(L,{children:se}),t[103]=L,t[104]=se,t[105]=G):G=t[105];let ce;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,X.jsx)(Zn,{asChild:!0,children:(0,X.jsx)(Mn,{variant:`outline`,children:(0,X.jsx)(o,{id:`dEgA5A`})})}),t[106]=ce):ce=t[106];let le;t[107]===p?le=t[108]:(le=p.trim(),t[107]=p,t[108]=le);let ue=!le,de;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,X.jsx)(o,{id:`tfDRzk`}),t[109]=de):de=t[109];let fe;t[110]!==M||t[111]!==ue?(fe=(0,X.jsxs)(Yn,{children:[ce,(0,X.jsx)(Mn,{onClick:M,disabled:ue,children:de})]}),t[110]=M,t[111]=ue,t[112]=fe):fe=t[112];let pe;t[113]!==ee||t[114]!==U||t[115]!==te||t[116]!==ne||t[117]!==G||t[118]!==fe?(pe=(0,X.jsxs)(ee,{className:U,"data-ok-layer-spawned":te,children:[ne,G,fe]}),t[113]=ee,t[114]=U,t[115]=te,t[116]=ne,t[117]=G,t[118]=fe,t[119]=pe):pe=t[119];let me;return t[120]!==R||t[121]!==re||t[122]!==ie||t[123]!==pe?(me=(0,X.jsx)(R,{open:re,onOpenChange:ie,children:pe}),t[120]=R,t[121]=re,t[122]=ie,t[123]=pe,t[124]=me):me=t[124],me}function n4(e){let t=(0,J.c)(115),{editor:n,getPos:r,onClose:a,onNavigate:s}=e,c=r(),l=c==null?null:n.state.doc.nodeAt(c),u=String(l?.attrs.target??``),d=re(l?.attrs.alias),f=re(l?.attrs.anchor),p=Kt({target:u,alias:d,anchor:f}),{addPage:m,assetPaths:h,folderPaths:g,pages:_,pagesBySlug:v,pagesByBasename:y,loading:b}=Ut(),x=fe(u,f),S=x?.kind===`external`?x:null,C=x?.kind===`asset`?iO(x.url,h)??x.url.replace(/^\//,``):null,T=C?null:LY(u,{pages:_,folderPaths:g,pagesBySlug:v,pagesByBasename:y,fallbackTargets:eO(u)}),[E,D]=(0,Y.useState)(!1),[O,k]=(0,Y.useState)(!1),{_:A}=i();if(!l)return null;let j;t[0]!==n.state||t[1]!==n.view||t[2]!==r?(j=function(e,t,i){let a=r();a!=null&&n.view.dispatch(n.state.tr.setNodeMarkup(a,void 0,{...n.state.doc.nodeAt(a)?.attrs,target:e,alias:t,anchor:i}))},t[0]=n.state,t[1]=n.view,t[2]=r,t[3]=j):j=t[3];let M=j,N;t[4]!==n.state||t[5]!==n.view||t[6]!==r||t[7]!==a?(N=function(){let e=r();if(e==null)return;let t=n.state.doc.nodeAt(e);t&&(n.view.dispatch(n.state.tr.delete(e,e+t.nodeSize)),a())},t[4]=n.state,t[5]=n.view,t[6]=r,t[7]=a,t[8]=N):N=t[8];let P=N,I=function(e){if(e!==u){let t=r();if(t==null)return;n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...n.state.doc.nodeAt(t)?.attrs,target:e,alias:d??p}))}},L=function(){return T?.kind===`create`?{initialDir:T.initialDir,suggestedName:T.suggestedName}:null},ee=async function(){let e=L();if(!(!e||O)){k(!0);try{await T$(e,{addPage:m,onCreated(e){I(e),window.location.hash=`#/${e}`,a()}}),k(!1)}catch(e){let t=e;nr.error(t instanceof Error?t.message:A({id:`tfi40B`})),k(!1)}}},z=!S&&!b&&C!==null,B=!S&&!b&&T?.kind===`navigate`&&T.displayState===`resolved`,V=!S&&!b&&T?.kind===`navigate`&&T.displayState===`folder`,H=!S&&!b&&!C&&T?.kind===`create`,U=!!S,te=S?WY(S.url)?S.url:null:z&&C?xt(C):B&&T?.kind===`navigate`?qY({docName:T.hashDocName,anchor:f}):null,ne=!b&&te!==null&&(U||z||B),ie,ae,W,oe,se;if(t[9]!==A||t[10]!==d||t[11]!==f||t[12]!==C||t[13]!==n.state||t[14]!==n.view||t[15]!==S||t[16]!==r||t[17]!==z||t[18]!==V||t[19]!==B||t[20]!==H||t[21]!==b||t[22]!==u){if(b){let e;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(xa,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[28]=e):e=t[28],W={icon:e,text:A({id:`yQE2r9`}),className:`text-muted-foreground/80`}}else if(S){let e;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(R,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[29]=e):e=t[29],W={icon:e,text:A({id:`hpDtUm`}),className:`text-muted-foreground`}}else if(z){let e;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Qi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[30]=e):e=t[30],W={icon:e,text:A({id:`bUUVED`}),className:`text-muted-foreground`}}else if(V){let e;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ia,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[31]=e):e=t[31],W={icon:e,text:A({id:`kNqMMd`}),className:`text-muted-foreground`}}else if(H){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[32]=e):e=t[32],W={icon:e,text:A({id:`8F1i42`}),className:`text-red-700 dark:text-red-300`}}else if(B){let e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[33]=e):e=t[33],W={icon:e,text:A({id:`Hrz9NY`}),className:`text-muted-foreground`}}else{let e;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[34]=e):e=t[34],W={icon:e,text:A({id:`DeDYLr`}),className:`text-muted-foreground/80`}}let e;t[35]!==n.state||t[36]!==n.view||t[37]!==r?(e=()=>{let e=r();if(typeof e!=`number`)return new DOMRect;let t=n.state.doc.nodeAt(e);if(!t)return new DOMRect;try{return rn(n.view,e,e+t.nodeSize)}catch{return new DOMRect}},t[35]=n.state,t[36]=n.view,t[37]=r,t[38]=e):e=t[38];let i;t[39]!==n.view.dom||t[40]!==e?(i={getBoundingClientRect:e,contextElement:n.view.dom},t[39]=n.view.dom,t[40]=e,t[41]=i):i=t[41],se=i,ae=C??(S?S.url:`${u}${f?`#${f}`:``}`);let a=f?`${u}#${f}`:u;ie=d?`[[${a}|${d}]]`:`[[${a}]]`,oe=vn(`flex shrink-0`,W.className),t[9]=A,t[10]=d,t[11]=f,t[12]=C,t[13]=n.state,t[14]=n.view,t[15]=S,t[16]=r,t[17]=z,t[18]=V,t[19]=B,t[20]=H,t[21]=b,t[22]=u,t[23]=ie,t[24]=ae,t[25]=W,t[26]=oe,t[27]=se}else ie=t[23],ae=t[24],W=t[25],oe=t[26],se=t[27];let G;t[42]!==W.icon||t[43]!==oe?(G=(0,X.jsx)(`span`,{className:oe,children:W.icon}),t[42]=W.icon,t[43]=oe,t[44]=G):G=t[44];let ce=G,le;t[45]!==ce||t[46]!==H||t[47]!==W.text?(le=H?(0,X.jsxs)(w,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(`span`,{className:`flex shrink-0`,"data-slot":`wiki-link-prop-panel-icon-trigger`,children:ce})}),(0,X.jsx)(F,{children:W.text})]}):ce,t[45]=ce,t[46]=H,t[47]=W.text,t[48]=le):le=t[48];let ue=le,de=`${W.text}: ${ae}`,pe;t[49]!==ae||t[50]!==U||t[51]!==H||t[52]!==te||t[53]!==ne||t[54]!==a||t[55]!==s?(pe=(0,X.jsx)(_e,{asChild:!0,children:ne?(0,X.jsx)(`a`,{href:te??void 0,...U?{target:`_blank`,rel:`noopener noreferrer`}:{},onClick:e=>QY(e,s,a),"data-slot":`wiki-link-prop-panel-text`,className:`block truncate text-sm font-medium text-foreground underline-offset-2 hover:underline focus-visible:underline`,children:ae}):(0,X.jsx)(`span`,{"data-slot":`wiki-link-prop-panel-text`,className:vn(`block truncate text-sm font-medium`,H?`text-muted-foreground`:`text-foreground`),children:ae})}),t[49]=ae,t[50]=U,t[51]=H,t[52]=te,t[53]=ne,t[54]=a,t[55]=s,t[56]=pe):pe=t[56];let me;t[57]===ae?me=t[58]:(me=(0,X.jsx)(F,{className:`max-w-80 break-all`,children:ae}),t[57]=ae,t[58]=me);let he;t[59]!==pe||t[60]!==me?(he=(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,X.jsxs)(w,{children:[pe,me]})}),t[59]=pe,t[60]=me,t[61]=he):he=t[61];let ge;t[62]!==ee||t[63]!==O||t[64]!==H?(ge=H?(0,X.jsxs)(Mn,{type:`button`,size:`sm`,variant:`link`,disabled:O,onClick:()=>void ee(),"data-slot":`wiki-link-prop-panel-create`,className:`flex items-center text-foreground`,children:[(0,X.jsx)(ka,{className:`size-3.5`,"aria-hidden":`true`}),O?(0,X.jsx)(o,{id:`HM56Bx`}):(0,X.jsx)(o,{id:`XRuL0i`})]}):null,t[62]=ee,t[63]=O,t[64]=H,t[65]=ge):ge=t[65];let ve;t[66]===A?ve=t[67]:(ve=A({id:`ePK91l`}),t[66]=A,t[67]=ve);let ye;t[68]===D?ye=t[69]:(ye=()=>D(!0),t[68]=D,t[69]=ye);let be;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,X.jsx)(Oa,{className:`size-3.5`,"aria-hidden":`true`}),t[70]=be):be=t[70];let xe;t[71]!==ve||t[72]!==ye?(xe=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":ve,onClick:ye,"data-slot":`wiki-link-prop-panel-edit`,children:be})}),t[71]=ve,t[72]=ye,t[73]=xe):xe=t[73];let Se;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`ePK91l`})}),t[74]=Se):Se=t[74];let Ce;t[75]===xe?Ce=t[76]:(Ce=(0,X.jsxs)(w,{children:[xe,Se]}),t[75]=xe,t[76]=Ce);let we;t[77]===ie?we=t[78]:(we=(0,X.jsx)(W$,{copyContent:ie}),t[77]=ie,t[78]=we);let Te;t[79]===A?Te=t[80]:(Te=A({id:`t_YqKh`}),t[79]=A,t[80]=Te);let Ee;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,X.jsx)(Ha,{className:`size-3.5`,"aria-hidden":`true`}),t[81]=Ee):Ee=t[81];let De;t[82]!==P||t[83]!==Te?(De=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Te,onClick:P,"data-slot":`wiki-link-prop-panel-remove`,children:Ee})}),t[82]=P,t[83]=Te,t[84]=De):De=t[84];let Oe;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`t_YqKh`})}),t[85]=Oe):Oe=t[85];let ke;t[86]===De?ke=t[87]:(ke=(0,X.jsxs)(w,{children:[De,Oe]}),t[86]=De,t[87]=ke);let Ae;t[88]!==ge||t[89]!==Ce||t[90]!==we||t[91]!==ke?(Ae=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[ge,Ce,we,ke]}),t[88]=ge,t[89]=Ce,t[90]=we,t[91]=ke,t[92]=Ae):Ae=t[92];let je;t[93]!==ue||t[94]!==he||t[95]!==Ae?(je=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ue,he,Ae]}),t[93]=ue,t[94]=he,t[95]=Ae,t[96]=je):je=t[96];let Me;t[97]!==a||t[98]!==je||t[99]!==de||t[100]!==se?(Me=(0,X.jsx)(h$,{kind:`wiki-link`,ariaLabel:de,onDeactivate:a,triggerReference:se,className:`w-96`,children:je}),t[97]=a,t[98]=je,t[99]=de,t[100]=se,t[101]=Me):Me=t[101];let Ne;t[102]!==d||t[103]!==f||t[104]!==h||t[105]!==E||t[106]!==M||t[107]!==b||t[108]!==_||t[109]!==D||t[110]!==u?(Ne=(0,X.jsx)(t4,{open:E,target:u,alias:d,anchor:f,pages:_,assetPaths:h,loading:b,onOpenChange:D,onSave:M}),t[102]=d,t[103]=f,t[104]=h,t[105]=E,t[106]=M,t[107]=b,t[108]=_,t[109]=D,t[110]=u,t[111]=Ne):Ne=t[111];let Pe;return t[112]!==Me||t[113]!==Ne?(Pe=(0,X.jsxs)(X.Fragment,{children:[Me,Ne]}),t[112]=Me,t[113]=Ne,t[114]=Pe):Pe=t[114],Pe}var r4=0;function i4(){return`wiki-link-${++r4}`}function a4(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`span`);n.setAttribute(`data-wiki-link`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Wiki link: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-chip`),n.style.touchAction=`manipulation`;let r=t.createElement(`span`);r.setAttribute(`data-wiki-link-icon`,``),r.setAttribute(`aria-hidden`,`true`),n.appendChild(r);let i=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,a=t.createTextNode(i);return n.appendChild(a),{dom:n,iconSpan:r}}function o4(e,t){if(!t||!e)return null;let n=tO(e,t);if(!n)return null;let r=t.pageIcons?.get(n);if(!r)return null;let i=Y2(r);return i.kind===`unsupported`?null:i}function s4(e,t,n=document){let r=t?.kind??``,i=t?.value??``;if(e.getAttribute(`data-kind`)===r&&e.getAttribute(`data-value`)===i)return;for(e.setAttribute(`data-kind`,r),e.setAttribute(`data-value`,i);e.firstChild;)e.removeChild(e.firstChild);if(!t)return;if(t.kind===`emoji`){e.appendChild(n.createTextNode(t.value));return}let a=n.createElement(`img`);a.setAttribute(`src`,t.value),a.setAttribute(`alt`,``),a.setAttribute(`draggable`,`false`),a.setAttribute(`referrerpolicy`,`no-referrer`),e.appendChild(a)}var c4=pn.extend({priority:200,addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=i4(),{dom:i,iconSpan:a}=a4({nodeId:r,target:String(t.attrs.target??``),alias:t.attrs.alias==null?null:String(t.attrs.alias),anchor:t.attrs.anchor==null?null:String(t.attrs.anchor)}),o=t,s=()=>{s4(a,o4(String(o.attrs.target??``),nn()))};s();let c=dn(s),l=()=>{let e=n();return typeof e==`number`?e:void 0},u=VO(e),d=({newTab:e})=>{let t=o.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=fe(n,typeof t.anchor==`string`?t.anchor:null);if(!r)return!1;if(r.kind===`doc`){let t=nn(),i=LY(n,{pages:t?.pages??new Set,folderPaths:t?.folderPaths??new Set,pagesBySlug:t?.pagesBySlug,pagesByBasename:t?.pagesByBasename,fallbackTargets:eO(n)});if(i.kind===`create`||i.kind===`navigate`&&i.displayState===`folder`)return!1;let a=i.kind===`navigate`?i.hashDocName:r.docName;return e?XY({docName:a,anchor:r.anchor}):window.location.assign(qY({docName:a,anchor:r.anchor})),!0}if(r.kind===`asset`){let t=iO(r.url,nn()?.assetPaths??new Set)??r.url.replace(/^\//,``);return e?JY(xt(t)):window.location.hash=xt(t),!0}return WY(r.url)?(JY(r.url),!0):!1};return u.register({type:`wikiLink`,nodeId:r,getPos:l,controls:{propPanel:t=>(0,Y.createElement)(n4,{editor:e,getPos:l,onClose:t.deactivate,onNavigate:e=>d({newTab:e})})},handlePrimary:d}),{dom:i,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLink`)return!1;o=e;let t=String(e.attrs.target??``),n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor);i.setAttribute(`data-target`,t),i.setAttribute(`data-alias`,n??``),i.setAttribute(`data-anchor`,r??``),i.setAttribute(`aria-label`,`Wiki link: ${t}${r?`#${r}`:``}`);let a=n??`${t}${r?`#${r}`:``}`,c=i.lastChild;return c&&c.nodeType===3?c.nodeValue=a:i.appendChild(i.ownerDocument.createTextNode(a)),s(),!0},destroy:()=>{u.deregister(r),c()}}}},addKeyboardShortcuts(){return{Backspace:()=>{if(vX.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(vX.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[NX(this.editor)]}}),l4=0;function u4(){return`wiki-link-embed-${++l4}`}function d4(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`a`);n.setAttribute(`data-wiki-embed`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`href`,e.href),n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Embed: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-embed-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}function f4(e){let t=(e.doc??(typeof document<`u`?document:{createElement:null})).createElement(`img`);return t.setAttribute(`data-wiki-embed`,``),t.setAttribute(`data-node-id`,e.nodeId),t.setAttribute(`data-target`,e.target),t.setAttribute(`data-alias`,e.alias??``),t.setAttribute(`src`,Fe(e.src)),t.setAttribute(`alt`,e.alias??e.target),{dom:t}}function p4(e){let t=Ue(e);return t!==null&&g.has(t)}var m4=et.extend({addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=u4(),i=t,a=String(t.attrs.target??``),o=t.attrs.alias==null?null:String(t.attrs.alias),s=t.attrs.anchor==null?null:String(t.attrs.anchor),c=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(p4(a)){let{dom:e}=f4({nodeId:r,target:a,alias:o,src:c??a});return{dom:e,ignoreMutation:()=>!0,update:t=>{if(t.type.name!==`wikiLinkEmbed`)return!1;i=t;let n=String(t.attrs.target??``),r=t.attrs.alias==null?null:String(t.attrs.alias),a=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(!p4(n))return!1;let o=a??n;return e.setAttribute(`data-target`,n),e.setAttribute(`data-alias`,r??``),e.setAttribute(`src`,Fe(o)),e.setAttribute(`alt`,r??n),!0}}}let{dom:l}=d4({nodeId:r,target:a,alias:o,anchor:s,href:c??a});l.addEventListener(`click`,e=>{e.preventDefault()});let u=()=>{let e=n();return typeof e==`number`?e:void 0},d=VO(e);return d.register({type:`wikiLinkEmbed`,nodeId:r,getPos:u,controls:{},handlePrimary:({newTab:e})=>{let t=i.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=(typeof t.resolvedSrc==`string`&&t.resolvedSrc.length>0?t.resolvedSrc:null)??n,a=Ue(n);if(a===null)return!1;let o=_n(r,``)??n;return d$({url:r,projectRelPath:o,ext:a,title:o.split(`/`).pop()??r,forceOsDelegation:e}),!0}}),{dom:l,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLinkEmbed`)return!1;i=e;let t=String(e.attrs.target??``);if(p4(t))return!1;let n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor),a=(e.attrs.resolvedSrc==null?null:String(e.attrs.resolvedSrc))??t;return l.setAttribute(`data-target`,t),l.setAttribute(`data-alias`,n??``),l.setAttribute(`data-anchor`,r??``),l.setAttribute(`href`,a),l.setAttribute(`aria-label`,`Embed: ${t}${r?`#${r}`:``}`),l.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{d.deregister(r)}}}}}),h4=[...N.map(e=>{if(e.name===`jsxComponent`)return l2;if(e.name===`image`){let t=e.options??{};return c$.configure({...t,inline:!0})}return e.name===`rawMdxFallback`?b2:e.name===`wikiLink`?c4:e.name===`wikiLinkEmbed`?m4:e.name===`link`?a1:e.name===`mathInline`?_2:e.name===`tag`?K2:e.name===`codeBlock`?cQ:e}),T2.configure({itemsSources:[EM,_M,TM,bM],categoryLabels:{content:`Components`,layout:`Layout`,media:`Media`,data:`Data`,embed:`Embeds`}}),a$,TD.configure({onDrop(e,t,n){for(let r of t)_O(r,e,n)},onPaste(e,t,n){for(let n of t)_O(n,e,e.state.selection.from)}}),o$,WD,B2,i$,n$,jM,I2,D2,OD,IM,b0,Wt.create({name:`chunkWrapperDecoration`,addProseMirrorPlugins(){return[HM()]}})];function g4(e){return e===Yt}function _4(){return Ec(`SYNC_TIMEOUT_MS`,3e4)}var v4=class extends Error{docName;elapsedMs;constructor(e,t){super(`Sync timed out for "${e}" after ${t}ms`),this.name=`SyncTimeoutError`,this.docName=e,this.elapsedMs=t}},y4=class extends Error{docName;constructor(e){super(`Provider disconnected before sync for "${e}"`),this.name=`PreSyncDisconnectError`,this.docName=e}},b4=class extends Error{docName;constructor(e){super(`Document not found: "${e}"`),this.name=`DocumentNotFoundError`,this.docName=e}},x4=class extends Error{docName;cause;constructor(e,t){let n=t instanceof Error?t.message:String(t??`unknown`);super(`Bridge setup failed for "${e}": ${n}`),this.name=`BridgeSetupError`,this.docName=e,this.cause=t}},S4=class extends Error{docName;missingCapability;constructor(e,t){super(`Server is missing capability "${t}" required to open "${e}".`),this.name=`ServerCapabilityMismatchError`,this.docName=e,this.missingCapability=t}},C4=new Map,w4=!1;function T4(){for(let e of C4.values())if(!e.settled)return!0;return!1}function E4(){typeof document>`u`||document.visibilityState===`visible`&&D4(Date.now())}function D4(e){let t=[];for(let[n,r]of C4){if(r.settled)continue;let i=e-r.createdAt;if(i<_4())continue;r.settled=!0;let a=new v4(n,i);j4(r),r.reject(a);let o=lS(n);o!==void 0&&bS(o),t.push({docName:n,elapsedMs:i})}if(t.length>0){let e=t.map(e=>`${e.docName} (${e.elapsedMs}ms)`).join(`, `);console.warn(`[syncPromise] reaped ${t.length} timed-out ${t.length===1?`entry`:`entries`} on visibility restore (tab-sleep recovered): ${e}`)}return T4()||k4(),t.length}function O4(){w4||typeof document>`u`||(document.addEventListener(`visibilitychange`,E4),w4=!0)}function k4(){w4&&(typeof document>`u`||(document.removeEventListener(`visibilitychange`,E4),w4=!1))}var A4=new Map;function j4(e){e.detached||(e.detached=!0,e.timeoutHandle!==null&&clearTimeout(e.timeoutHandle),e.provider.off(`synced`,e.onSynced),e.provider.off(`close`,e.onClose))}function M4(e,t){let n=C4.get(e);if(n)return n.promise;let r=A4.get(e);if(r!==void 0){A4.delete(e);let n=r===`timeout`?new v4(e,0):new y4(e);console.warn(`[syncPromise] ${e} rejected on creation (test hook, armed ${r}): ${n.message}`),Z(`ok/sync/create`,{docName:e,mountId:lS(e),warm:!1,armed:r}),Z(`ok/sync/reject`,{docName:e,mountId:lS(e),reason:`armed-${r}`});let i=P4(n);return C4.set(e,F4(i,t)),i}if(t.synced){console.log(`[syncPromise] ${e} resolved synchronously (warm provider)`);let n=lS(e);Z(`ok/sync/create`,{docName:e,mountId:n,warm:!0}),Z(`ok/sync/resolve`,{docName:e,mountId:n,elapsedMs:0,warm:!0}),Z.histogram(`ok/sync/resolve-elapsed-ms`,n===void 0?{docName:e,warm:!0}:{docName:e,mountId:n,warm:!0},0);let r=Promise.resolve();return C4.set(e,N4(r,t)),r}let i=Date.now(),a=()=>{},o=()=>{},s=new Promise((e,t)=>{a=e,o=t}),c=()=>{let t=C4.get(e);if(!t||t.settled)return;t.settled=!0,t.resolved=!0;let n=Date.now()-t.createdAt;console.log(`[syncPromise] ${e} resolved in ${n}ms`);let r=lS(e);if(Z(`ok/sync/resolve`,{docName:e,mountId:r,elapsedMs:n,warm:!1}),Z.histogram(`ok/sync/resolve-elapsed-ms`,r===void 0?{docName:e}:{docName:e,mountId:r},n),j4(t),T4()||k4(),t.resolve(),r!==void 0){let i=Date.now();yS(r,`ok.sync-promise`,{"doc.name":e,elapsed_ms:n},t.createdAt,i),bS(r,i)}},l=t=>{let n=C4.get(e);if(!n||n.settled)return;n.settled=!0;let r=new y4(e);console.warn(`[syncPromise] ${e} rejected: ${r.message}`);let i=lS(e);Z(`ok/sync/reject`,{docName:e,mountId:i,reason:`pre-sync-disconnect`}),j4(n),T4()||k4(),n.reject(r),i!==void 0&&bS(i)},u=setTimeout(()=>{let t=C4.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt,r=new v4(e,n);console.warn(`[syncPromise] ${e} rejected: ${r.message}`);let i=lS(e);Z(`ok/sync/reject`,{docName:e,mountId:i,reason:`timeout`,elapsedMs:n}),j4(t),T4()||k4(),t.reject(r),i!==void 0&&bS(i)},_4()),d={promise:s,resolve:a,reject:o,createdAt:i,timeoutHandle:u,provider:t,onSynced:c,onClose:l,settled:!1,resolved:!1,detached:!1};return C4.set(e,d),t.on(`synced`,c),t.on(`close`,l),O4(),Z(`ok/sync/create`,{docName:e,mountId:lS(e),warm:!1}),s}function N4(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!0,detached:!0}}function P4(e){let t=Promise.reject(e);t.catch(()=>{});let n=t;return n.status=`rejected`,n.reason=e,n}function F4(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!1,detached:!0}}function I4(e){return C4.get(e)?.resolved===!0}function L4(e){let t=C4.get(e);t&&(t.settled=!0,j4(t),C4.delete(e),T4()||k4())}function R4(e,t){let n=C4.get(e);if(!n||n.settled)return!1;n.settled=!0,console.warn(`[syncPromise] ${e} rejected: ${t.message}`),j4(n),T4()||k4(),n.reject(t);let r=lS(e);return r!==void 0&&bS(r),!0}var z4=Object.freeze({kind:`tab-replay`}),B4=Object.freeze({kind:`idle`});function V4(e,t){return()=>{}}var H4=null;function U4(){return H4??=$t(h4),H4}var W4=4e3,G4=1e4,K4=class extends Error{constructor(e,t){super(`client persistence clearData timed out for ${e} after ${t}ms`),this.docName=e,this.timeoutMs=t,this.name=`ClientPersistenceClearTimeoutError`}},q4=`ok-last-observed-branch`,J4=5e3,Y4=Ec(`MAX_BUFFER_BYTES`,1*1024*1024),X4=Ec(`MAX_POOL`,10);function Z4(e,t,n=null){let r={...Tc()};return e!==null&&(r.principalId=e.principalId,r.tabSessionId=e.tabSessionId),t!==null&&t.length>0&&(r.expectedServerInstanceId=t),n!==null&&n.length>0&&(r.expectedBranch=n),JSON.stringify(r)}var Q4=class{_entries=new Map;get entries(){return this._entries}lruOrder=[];activeDocName=null;maxSize;wsUrl;recycleDebounceMs;clearDataTimeoutMs;onChange=null;tabIdentity=null;serverRestartRecoveryState=B4;cachedServerInstanceId=null;pendingServerInstanceKnown=null;recoveryMismatchStaleClaim;bufferedUpdates=new Map;pendingClears=new Map;clearFailures=new Set;persistenceFactory;storage;constructor(e,t,n){this.maxSize=e,this.wsUrl=t,this.recycleDebounceMs=n?.recycleDebounceMs??W4,this.clearDataTimeoutMs=n?.clearDataTimeoutMs??G4,this.persistenceFactory=n?.persistenceFactory??yD,n?.storage===void 0?this.storage=globalThis.localStorage===void 0?null:globalThis.localStorage:this.storage=n.storage}setTabIdentity(e){this.tabIdentity=e}setExpectedServerInstanceId(e){if(this.cachedServerInstanceId=e,!(e===null||e.length===0)){if(this.pendingServerInstanceKnown!==null){let t=this.pendingServerInstanceKnown;this.pendingServerInstanceKnown=null,t.resolve(e)}this.attachDeferredPersistence(e)}}whenServerInstanceKnown(){if(this.cachedServerInstanceId!==null&&this.cachedServerInstanceId.length>0)return Promise.resolve(this.cachedServerInstanceId);if(this.pendingServerInstanceKnown!==null)return this.pendingServerInstanceKnown.promise;let e,t=new Promise(t=>{e=t});return this.pendingServerInstanceKnown={promise:t,resolve:e},t}buildPersistence(e,t,n){return this.persistenceFactory({branch:this.getOrInitObservedBranch()??`_unknown_`,serverInstanceId:e,docName:t,doc:n})}attachDeferredPersistence(e){let t=!1;for(let n of this._entries.values())if(n.kind===`active`&&n.persistence===null)try{n.persistence=this.buildPersistence(e,n.docName,n.provider.document),t=!0}catch(e){let t=e instanceof Error?e.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(n.docName),errorName:t,errorMessage:e instanceof Error?e.message:String(e)})}t&&this.notify()}getServerRestartRecoveryState(){return this.serverRestartRecoveryState}observeDiskAck(e,t){let n=this.entries.get(e);!n||n.kind!==`active`||(n.lastDiskAckedSV=SD(n.lastDiskAckedSV,t))}observeDiskAckBatch(e){for(let[t,n]of Object.entries(e))this.observeDiskAck(t,n)}lastObservedBranch=null;lastObservedBranchInitialized=!1;getOrInitObservedBranch(){if(this.lastObservedBranchInitialized)return this.lastObservedBranch;this.lastObservedBranchInitialized=!0;try{let e=this.storage?.getItem(q4)??null;e!==null&&e.length>0&&(this.lastObservedBranch=e)}catch{}return this.lastObservedBranch}persistObservedBranch(e){this.lastObservedBranch=e,this.lastObservedBranchInitialized=!0;try{e===null||e.length===0?this.storage?.removeItem(q4):this.storage?.setItem(q4,e)}catch{}}withClearDataTimeout(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(new K4(e,this.clearDataTimeoutMs))},this.clearDataTimeoutMs);t.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e)})})}recoveryTelemetryBase(e,t){let n={docName:e,branch:this.getOrInitObservedBranch()??`_unknown_`},r=t===void 0?this.recoveryMismatchStaleClaim:t;return r!==void 0&&r.length>0&&(n.serverInstanceId=r),n}emitStructuredClientRecoveryEvent(e){console.warn(JSON.stringify(e))}clearRecoveryMismatchStaleClaimIfTerminal(){let e=this.serverRestartRecoveryState.kind;(e===`idle`||e===`failed`)&&(this.recoveryMismatchStaleClaim=void 0)}beginServerRestartRecovery(e,t){this.serverRestartRecoveryState={kind:`recovering`,phase:`clearing-local-cache`,docNames:e,failedDocNames:[],startedAt:t};for(let t of e)L4(t);this.notify()}enterServerRestartReconnect(e,t,n,r){if(e.length===0){this.serverRestartRecoveryState=t.length===0?B4:{kind:`failed`,reason:r,docNames:t,failedDocNames:t,startedAt:n},this.clearRecoveryMismatchStaleClaimIfTerminal(),this.notify();return}this.serverRestartRecoveryState={kind:`recovering`,phase:`reconnecting`,docNames:e,failedDocNames:t,startedAt:n,...t.length>0?{clearFailureReason:r}:{}},this.notify()}markServerRestartRecoverySynced(e){let t=this.serverRestartRecoveryState;if(t.kind!==`recovering`||t.phase!==`reconnecting`||!t.docNames.includes(e))return;let n=t.docNames.filter(t=>t!==e);if(n.length>0){this.serverRestartRecoveryState={...t,docNames:n};return}if(t.failedDocNames.length>0){this.serverRestartRecoveryState={kind:`failed`,reason:t.clearFailureReason??`clear-data-failed`,docNames:t.failedDocNames,failedDocNames:t.failedDocNames,startedAt:t.startedAt},this.clearRecoveryMismatchStaleClaimIfTerminal();return}this.serverRestartRecoveryState=B4,this.clearRecoveryMismatchStaleClaimIfTerminal()}setObservedBranch(e){this.persistObservedBranch(e)}compareAndUpdateObservedBranch(e){let t=this.getOrInitObservedBranch();return this.persistObservedBranch(e),t!==null&&t!==e}onBranchMismatch=null;branchMismatchInFlight=null;mismatchInFlight=null;setOnBranchMismatch(e){if(e===null){this.onBranchMismatch=null;return}this.onBranchMismatch=()=>{if(this.branchMismatchInFlight!==null)return;let t=Promise.resolve().then(e).finally(()=>{this.branchMismatchInFlight===t&&(this.branchMismatchInFlight=null)});this.branchMismatchInFlight=t}}onRenameRedirect=null;onDocDeleted=null;setOnRenameRedirect(e){this.onRenameRedirect=e}setOnDocDeleted(e){this.onDocDeleted=e}setOnChange(e){this.onChange=e}notify(){this.onChange?.()}evictListeners=new Set;onEvict(e){return this.evictListeners.add(e),()=>{this.evictListeners.delete(e)}}fireEvict(e){for(let t of this.evictListeners)try{t(e)}catch(t){console.warn(`[ProviderPool] evict listener threw for ${e}:`,t)}}touch(e){let t=this.lruOrder.indexOf(e);t!==-1&&this.lruOrder.splice(t,1),this.lruOrder.push(e)}open(e){if(g4(e))return null;let t=this.entries.get(e);if(t){let n=t.lastAccessedAt;return t.lastAccessedAt=Date.now(),this.touch(e),this.notify(),Z(`ok/pool/open`,{docName:e,hit:!0,lastAccessedAt:n,poolEventId:t.poolEventId}),Z.count(`ok/pool/open`,{hit:!0}),t}let n=Date.now();this.entries.size>=this.maxSize&&this.evictLru();let r=this.cachedServerInstanceId,i=Z4(this.tabIdentity,r,this.getOrInitObservedBranch()),a=new qE({url:CD(this.wsUrl),name:e,forceSyncInterval:J4,token:i}),o=this.cachedServerInstanceId;this.clearFailures.has(e)&&this.runCloseAndClearPersistence(e);let s=this.pendingClears.get(e),c=o!==null&&o.length>0&&s===void 0?this.buildPersistence(o,e,a.document):null,l=crypto.randomUUID(),u={kind:`active`,provider:a,persistence:c,lastServerSyncedSV:null,lastDiskAckedSV:null,observerCleanup:null,observerFireCounterCleanup:V4(a.document,e),syncState:`connecting`,docName:e,lastAccessedAt:Date.now(),poolEventId:l,hasSynced:!1,pendingRecycleTimer:null,bridgeSetupFailed:!1,serverDrivenCloseReauthInFlight:!1};if(Z(`ok/pool/open`,{docName:e,hit:!1,poolEventId:l}),Z.count(`ok/pool/open`,{hit:!1}),a.on(`status`,({status:t})=>{u.kind!==`active`||this.entries.get(e)!==u||t===`disconnected`&&(u.syncState=`disconnected`,this.notify())}),a.on(`synced`,()=>{if(!(u.kind!==`active`||this.entries.get(e)!==u)&&(u.syncState=`synced`,u.hasSynced=!0,u.lastServerSyncedSV=bD(a.document),u.pendingRecycleTimer&&=(clearTimeout(u.pendingRecycleTimer),null),this.markServerRestartRecoverySynced(e),this.notify(),!u.observerCleanup))try{let t=a.document,n=new j({extensions:h4});u.observerCleanup=vY({doc:t,xmlFragment:t.getXmlFragment(`default`),ytext:t.getText(`source`),mdManager:n,schema:U4(),onSyncError:(t,n)=>{console.warn(`[Sync] ${t} failed for ${e}:`,n.message)}})}catch(t){console.error(`[ProviderPool] setupObservers init failed for ${e}:`,t),u.bridgeSetupFailed=!0,R4(e,new x4(e,t))}}),a.on(`disconnect`,()=>{u.kind!==`active`||this.entries.get(e)!==u||(u.syncState=`disconnected`,this.notify(),u.hasSynced&&a.unsyncedChanges===0&&!u.pendingRecycleTimer&&(u.pendingRecycleTimer=setTimeout(()=>{u.kind===`active`&&(u.pendingRecycleTimer=null,this.entries.get(e)===u&&this.recycleDisconnectedEntry(e))},this.recycleDebounceMs)))}),a.on(`authenticationFailed`,({reason:t})=>{let n=[`server-instance-mismatch`,`branch-mismatch`,`rename-redirect`,`doc-deleted`],i=t.indexOf(`:`),a=i===-1?t:t.slice(0,i);if(!n.includes(a)){console.warn(JSON.stringify({event:`ok-auth-failed-unknown-reason`,reason:t}));return}let o=i===-1?``:t.slice(i+1),s=o.length>0?o:void 0,c=a;if(c===`server-instance-mismatch`){if(r===null||this.cachedServerInstanceId!==r)return;let e=r;this.cachedServerInstanceId=null,this.handleServerInstanceMismatch(e);return}if(c===`branch-mismatch`){this.onBranchMismatch?.();return}if(c===`rename-redirect`){if(s===void 0||s.length===0){console.warn(JSON.stringify({event:`rename-redirect-missing-payload`,fromDocName:e}));return}let t=e,n=s,r=this.entries.get(t),i=r!==void 0&&r.kind===`active`;this.onRenameRedirect?.({fromDocName:t,toDocName:n,hadOpenProvider:i});return}if(c===`doc-deleted`){let t=this.entries.get(e),n=t!==void 0&&t.kind===`active`;this.onDocDeleted?.({docName:e,hadOpenProvider:n});return}}),a.on(`close`,({event:t})=>{if(u.kind!==`active`||this.entries.get(e)!==u||u.serverDrivenCloseReauthInFlight)return;u.serverDrivenCloseReauthInFlight=!0,a.sendToken().catch(t=>{console.warn(JSON.stringify({event:`ok-provider-server-driven-close-reauth-failed`,docName:e,message:t instanceof Error?t.message:String(t)}))}).finally(()=>{u.kind===`active`&&this.entries.get(e)===u&&(u.serverDrivenCloseReauthInFlight=!1)});let n=t?.reason??`<unknown>`;console.info(JSON.stringify({event:`ok-provider-server-driven-close-reauth`,docName:e,reason:n}))}),this.bufferedUpdates.get(e)!==void 0){let t=this.recoveryMismatchStaleClaim,n=()=>{if(a.off(`synced`,n),u.kind!==`active`||this.entries.get(e)!==u)return;let r=this.bufferedUpdates.get(e);if(r!==void 0){this.bufferedUpdates.delete(e);try{fh(a.document,r,z4)}catch(n){let i=n instanceof Error?n.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-failed`,...this.recoveryTelemetryBase(e,t),replayByteLength:r.byteLength,errorName:i,errorMessage:n instanceof Error?n.message:String(n)})}}};a.on(`synced`,n)}if(this._entries.set(e,u),this.touch(e),this.notify(),s!==void 0&&o!==null&&o.length>0){let t=o;s.then(()=>{this.attachDeferredPersistenceForEntry(u,t)},t=>{console.warn(JSON.stringify({event:`ok-pool-deferred-persistence-attach-skipped`,docName:e,reason:`pending-clear-failed`,message:t instanceof Error?t.message:String(t)}))})}let d=lS(e);return d!==void 0&&yS(d,`ok.provider-pool.open`,{"doc.name":e},n,Date.now()),u}attachDeferredPersistenceForEntry(e,t){let n=this._entries.get(e.docName);if(!(n!==e||n.kind!==`active`||n.persistence!==null))try{n.persistence=this.buildPersistence(t,e.docName,n.provider.document),this.notify()}catch(t){let n=t instanceof Error?t.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(e.docName),errorName:n,errorMessage:t instanceof Error?t.message:String(t)})}}handleServerInstanceMismatch(e){this.recoveryMismatchStaleClaim=e.length>0?e:void 0;let t=Array.from(this.entries.entries()),n=Date.now(),r=this.activeDocName,i=r!==null&&t.some(([e,t])=>e===r&&t.kind===`active`)?[r]:[],a=r??t.find(([,e])=>e.kind===`active`)?.[0]??``;a.length>0&&this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-epoch-mismatch`,...this.recoveryTelemetryBase(a)}),this.beginServerRestartRecovery(i,n);for(let[e,n]of t)n.kind===`active`&&!i.includes(e)&&L4(e);for(let[e,n]of t){if(n.kind!==`active`)continue;let t=n.lastDiskAckedSV??n.lastServerSyncedSV;if(t===null){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-skipped-no-baseline`,...this.recoveryTelemetryBase(e),reason:`no-disk-ack-or-server-sync-vector`});continue}let r=xD(n.provider.document,t);if(r.byteLength>Y4){Z(`ok/pool/buffer-overflow`,{docName:e,bytes:r.byteLength});continue}r.byteLength>0&&this.bufferedUpdates.set(e,r)}let o=[];for(let[e,n]of t)n.kind===`active`&&n.persistence!==null&&o.push({docName:e,promise:this.withClearDataTimeout(e,n.persistence.clearData())});let s=Promise.allSettled(o.map(e=>e.promise)).then(e=>{let t=[],i=[],a=!1;e.forEach((e,n)=>{let r=o[n];if(!r)return;let s=r.docName;if(e.status===`rejected`){t.push(s);let n=e.reason instanceof K4;if(n&&(a=!0),n)this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`timeout`});else{let t=e.reason instanceof Error?e.reason.name:`unknown`;this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`rejected`,errorName:t,errorMessage:e.reason instanceof Error?e.reason.message:String(e.reason)})}}else i.push(s)});let s=i.filter(e=>e===r);if(t.length>0){let e=a?`clear-data-timeout`:`clear-data-failed`;console.warn(JSON.stringify({event:`ok-mismatch-recycle-partial-clears-failed`,failedDocs:t,clearedDocs:i})),this.enterServerRestartReconnect(s,t,n,e);for(let e of i)this.recycleDisconnectedEntry(e);return}this.enterServerRestartReconnect(s,[],n,`clear-data-failed`),this.recycleAllEntries()}).finally(()=>{this.mismatchInFlight===s&&(this.mismatchInFlight=null)});this.mismatchInFlight=s}awaitMismatchSettled(){return this.mismatchInFlight??Promise.resolve()}recycleAllEntries(){let e=Array.from(this.entries.keys());for(let t of e)this.recycleDisconnectedEntry(t)}prewarm(e){if(g4(e))return null;let t=this.entries.get(e);if(t)return t;let n=this.open(e);if(!n)return null;let r=this.lruOrder.indexOf(e);return r!==-1&&(this.lruOrder.splice(r,1),this.lruOrder.unshift(e)),n}close(e){let t=this.entries.get(e);t&&(this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),this.bufferedUpdates.delete(e),this.activeDocName===e&&(this.activeDocName=null),this.notify())}async closeAndClearPersistence(e){try{await this.runCloseAndClearPersistence(e)}catch{}}runCloseAndClearPersistence(e){let t=this.pendingClears.get(e);if(t!==void 0)return t;let n=()=>{},r=()=>{},i=new Promise((e,t)=>{n=e,r=t});this.pendingClears.set(e,i);let a=()=>{this.pendingClears.get(e)===i&&this.pendingClears.delete(e)};return i.then(a,a),this.executeCloseAndClearPersistence(e).then(n,r),i}async executeCloseAndClearPersistence(e){this.clearFailures.delete(e);let t=this.entries.get(e);if(t?.kind===`active`&&t.persistence!==null){let n=t.persistence;try{this.close(e)}catch(t){console.warn(`[ProviderPool] close before clearData threw for ${e}:`,t)}try{await this.withClearDataTimeout(e,n.clearData())}catch(t){throw console.warn(`[ProviderPool] clearData on rename failed for ${e}:`,t),this.clearFailures.add(e),t}return}if(t)try{this.close(e)}catch(t){console.warn(`[ProviderPool] close before IDB-by-name delete threw for ${e}:`,t)}let n=this.getOrInitObservedBranch(),r=this.cachedServerInstanceId;if(n===null||r===null)return;let i=`ok-ydoc:${n}:${r}:${e}`;try{await this.withClearDataTimeout(e,new Promise((e,t)=>{let n=indexedDB.deleteDatabase(i);n.onsuccess=()=>e(),n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`[ProviderPool] IDB delete blocked for ${i}`)}}))}catch(t){throw console.warn(`[ProviderPool] IDB delete on rename failed for ${i}:`,t),this.clearFailures.add(e),t}}clearBufferedUpdates(){this.bufferedUpdates.clear()}__test_seedBufferedUpdate(e,t){this.bufferedUpdates.set(e,t)}__test_bufferedUpdatesSize(){return this.bufferedUpdates.size}__test_hasBufferedUpdate(e){return this.bufferedUpdates.has(e)}__test_getBufferedUpdate(e){return this.bufferedUpdates.get(e)}setActive(e){let t=this.entries.get(e);if(!t)throw Error(`[ProviderPool] Cannot setActive — "${e}" is not open`);t.lastAccessedAt=Date.now(),this.touch(e),this.activeDocName=e,this.notify()}clearActive(){this.activeDocName!==null&&(this.activeDocName=null,this.notify())}getActive(){return this.activeDocName?this.entries.get(this.activeDocName)??null:null}getActiveDocName(){return this.activeDocName}has(e){return this.entries.has(e)}peek(e){return this.entries.get(e)??null}recycle(e){this.recycleDisconnectedEntry(e)}dispose(){for(let e of this._entries.values())this.destroyEntry(e);this._entries.clear(),this.lruOrder=[],this.activeDocName=null,this.onChange=null,this.bufferedUpdates.clear(),this.pendingClears.clear(),this.clearFailures.clear(),this.onBranchMismatch=null,this.branchMismatchInFlight=null,this.onRenameRedirect=null,this.onDocDeleted=null,this.evictListeners.clear(),this.serverRestartRecoveryState=B4,this.cachedServerInstanceId=null,this.pendingServerInstanceKnown=null,this.tabIdentity=null,this.recoveryMismatchStaleClaim=void 0}evictLru(){for(let e of this.lruOrder)if(e!==this.activeDocName){Z(`ok/pool/evict-lru`,{docName:e}),this.close(e);return}}destroyEntry(e){if(e.kind===`tearing-down`)return;let t=e.observerCleanup,n=e.observerFireCounterCleanup,r=e.persistence,i=e.pendingRecycleTimer,a=e.docName,o=e;o.kind=`tearing-down`,o.persistence=null,o.observerCleanup=null,o.observerFireCounterCleanup=null,o.pendingRecycleTimer=null,o.serverDrivenCloseReauthInFlight=!1,i&&clearTimeout(i),L4(a),this.fireEvict(a);try{t?.()}catch(e){console.warn(`[ProviderPool] observer cleanup threw for ${a}:`,e)}try{n?.()}catch(e){console.warn(`[ProviderPool] observer-fire-counter cleanup threw for ${a}:`,e)}r!==null&&r.destroy().catch(e=>{console.warn(`[ProviderPool] persistence destroy failed for ${a}:`,e)});try{o.provider.destroy()}catch(e){console.warn(`[ProviderPool] Provider destroy failed for ${a}:`,e)}}recycleDisconnectedEntry(e){let t=this.entries.get(e);if(!t||t.kind!==`active`)return;let n=this.activeDocName===e;if(Z(`ok/pool/recycle-disconnected`,{docName:e,wasActive:n}),this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),n){this.open(e)&&this.setActive(e);return}this.notify()}},$4=crypto.randomUUID(),e3=!1;function t3(e){e3||(e3=!0,console.warn(`[principal-fetch] failed to resolve principal — falling back to random identity.`,e))}var n3=(0,Y.createContext)(null),r3=null;function i3(e){return r3||(r3=new Q4(X4,e),yC(r3)),r3}var a3={activeDocName:null,activeProvider:null,syncState:`connecting`,serverRestartRecovery:{kind:`idle`},poolEntries:[]};function o3(){if(typeof window>`u`)return null;let e=window.okDesktop;return e?.config.mode===`editor`?e:null}function s3(){return typeof window>`u`||window.okDesktop?.config.mode===`editor`?null:cw(window.location.origin)}function c3(){if(typeof window>`u`)return ow(null,X4);let e=s3();return e?lw(window.localStorage===void 0?null:window.localStorage,e,X4):ow(null,X4)}function l3(){return c3().openTabs}function u3(){return c3().pinnedTabIds}function d3(){if(typeof window>`u`||window.location.hash.length>0)return null;let e=c3();return e.activeTabId??(e.activeDocName?OC(e.activeDocName):null)??e.openTabs[0]??null}function f3(e){let t=RC(e);switch(t.kind){case`doc`:return U(t.docName);case`folder`:return ae(t.folderPath);case`asset`:return xt(t.assetPath)}}function p3(e){let t=y(e);if(t)return FC(t);let n=ce(e);if(!n)return null;let r=n.trim();if(/\/+$/.test(r)){let e=r.replace(/\/+$/g,``);return e?PC(e):null}return OC(n)}function m3(e){return{kind:`asset`,target:e,assetPath:e,mediaKind:Tt(e.split(`.`).pop()??``)}}function h3(e,t){return e?LC(e):t?OC(t):null}function g3(e,t,n){return e.some(e=>!n.has(e)&&zC(e)===t)}function _3(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function v3(e){switch(e.kind){case`doc`:return`doc:${e.docName}`;case`folder-index`:return`folder-index:${e.docName}:${e.folderPath}:${e.noteKind}`;case`folder`:return`folder:${e.folderPath}`;case`asset`:return`asset:${e.assetPath}:${e.mediaKind??``}`;case`large-file`:return`large-file:${e.docName}:${e.size}:${e.limit}`;case`missing`:return`missing:${e.target}`}}function y3(e,t){return e===t?!0:!e||!t?!1:v3(e)===v3(t)}function b3(e){let t=e.getActive(),n=[];for(let t of e.entries.values())n.push({docName:t.docName,provider:t.provider,lastAccessedAt:t.lastAccessedAt,poolEventId:t.poolEventId});return n.sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt),{activeDocName:e.getActiveDocName(),activeProvider:t?.provider??null,syncState:t?.syncState??`connecting`,serverRestartRecovery:e.getServerRestartRecoveryState(),poolEntries:n}}function x3(e){let t=(0,J.c)(168),{children:n}=e,[r,i]=(0,Y.useState)(a3),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(d3),[l,u]=(0,Y.useState)(l3),[f,p]=(0,Y.useState)(u3),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[0]=m):m=t[0];let[h,g]=(0,Y.useState)(m),[_,v]=(0,Y.useState)(l),[y,b]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(!1),C=(0,Y.useRef)(s),w=(0,Y.useRef)(l),T=(0,Y.useRef)(f),E=(0,Y.useRef)(y),D=(0,Y.useRef)(h),O=(0,Y.useRef)(_),k=(0,Y.useRef)(1),A=(0,Y.useRef)(!1),[j,M]=(0,Y.useState)(!1),[N,P]=(0,Y.useState)(null),[F,I]=(0,Y.useState)(null),[L,ee]=(0,Y.useState)(`doc`),[R,z]=(0,Y.useState)(null),[B,V]=(0,Y.useState)(0),{collabUrl:H,terminal:te,lastError:ne,retry:re}=Xx(),ie;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(ie=function(e){C.current=e,c(e)},t[1]=ie):ie=t[1];let W=ie,oe;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(oe=function(e){E.current=e,b(e)},t[2]=oe):oe=t[2];let se=oe,G;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(G=function(e){O.current=e,v(t=>_3(t,e)?t:e)},t[3]=G):G=t[3];let le=G,ue;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(ue=function(e){T.current=e,p(t=>_3(t,e)?t:e)},t[4]=ue):ue=t[4];let de=ue,fe;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(fe=function(e,t){let n=VC(t,e);w.current=e,T.current=n,u(t=>_3(t,e)?t:e),p(e=>_3(e,n)?e:n),le(QC(O.current,e,D.current))},t[5]=fe):fe=t[5];let pe=fe,me;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(me=function(e){pe(e,T.current)},t[6]=me):me=t[6];let he=me,ge;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(ge=function(e){he(e(w.current))},t[7]=ge):ge=t[7];let _e=ge,ve;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ve=function(e){D.current=e,g(t=>_3(t,e)?t:e),le(QC(O.current,w.current,e))},t[8]=ve):ve=t[8];let ye=ve,be;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(be=function(e){let t=E.current;if(!t)return;let n=D.current.filter(e=>e!==t);D.current=n,g(e=>_3(e,n)?e:n),se(null);let r=[],i=new Set;for(let n of O.current){let a=n===t?e:n;!a||i.has(a)||(i.add(a),r.push(a))}le(QC(r,w.current,n))},t[9]=be):be=t[9];let xe=be,Se,Ce;t[10]===s?(Se=t[11],Ce=t[12]):(Se=()=>{C.current=s},Ce=[s],t[10]=s,t[11]=Se,t[12]=Ce),(0,Y.useEffect)(Se,Ce);let we,Te;t[13]===l?(we=t[14],Te=t[15]):(we=()=>{w.current=l},Te=[l],t[13]=l,t[14]=we,t[15]=Te),(0,Y.useEffect)(we,Te);let Ee,De;t[16]===f?(Ee=t[17],De=t[18]):(Ee=()=>{T.current=f},De=[f],t[16]=f,t[17]=Ee,t[18]=De),(0,Y.useEffect)(Ee,De);let Oe,ke;t[19]===y?(Oe=t[20],ke=t[21]):(Oe=()=>{E.current=y},ke=[y],t[19]=y,t[20]=Oe,t[21]=ke),(0,Y.useEffect)(Oe,ke);let Ae,je;t[22]===h?(Ae=t[23],je=t[24]):(Ae=()=>{D.current=h},je=[h],t[22]=h,t[23]=Ae,t[24]=je),(0,Y.useEffect)(Ae,je);let Me,Ne;t[25]===_?(Me=t[26],Ne=t[27]):(Me=()=>{O.current=_},Ne=[_],t[25]=_,t[26]=Me,t[27]=Ne),(0,Y.useEffect)(Me,Ne);let Pe=y!==null,Fe,Ie;t[28]!==H||t[29]!==j||t[30]!==x?(Fe=()=>{if(H===null||x||!j)return;let e=!1,t=o3(),n=s3(),r=typeof localStorage<`u`?localStorage:null;return(t?t.project.getSessionState():Promise.resolve(n?lw(r,n,X4):{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null})).then(t=>{if(e)return;let n=ow(t,X4);if(A.current)return;let r=i3(H);for(let e of n.openTabs){let t=zC(e);t&&r.open(t)}let i=[...n.pinnedTabIds,...T.current],a=n.openTabs;for(let e of w.current)a=qC(a,e,X4,i);let o=VC(i,a);w.current=a,T.current=o,u(e=>_3(e,a)?e:a),p(e=>_3(e,o)?e:o);let s=QC(O.current,a,D.current);O.current=s,v(e=>_3(e,s)?e:s);let l=ce(window.location.hash),d=n.activeTabId??(n.activeDocName?OC(n.activeDocName):null)??n.openTabs[0]??null,f=d?f3(d):null;if((l===null&&window.location.hash.length===0||f!==null&&f===window.location.hash)&&d){C.current=d,c(d);let e=f3(d);window.location.hash!==e&&(window.location.hash=e)}}).catch(j3).finally(()=>{e||S(!0)}),()=>{e=!0}},Ie=[H,j,x],t[28]=H,t[29]=j,t[30]=x,t[31]=Fe,t[32]=Ie):(Fe=t[31],Ie=t[32]),(0,Y.useEffect)(Fe,Ie);let Le,Re;t[33]!==s||t[34]!==a||t[35]!==l||t[36]!==f||t[37]!==r.activeDocName||t[38]!==x?(Le=()=>{if(!x)return;let e=sw(l,s??h3(a,r.activeDocName),f),t=o3();if(t){t.project.setSessionState(e).catch(A3);return}let n=s3();n&&uw(typeof localStorage<`u`?localStorage:null,n,e)},Re=[s,a,l,f,r.activeDocName,x],t[33]=s,t[34]=a,t[35]=l,t[36]=f,t[37]=r.activeDocName,t[38]=x,t[39]=Le,t[40]=Re):(Le=t[39],Re=t[40]),(0,Y.useEffect)(Le,Re);let ze;t[41]===x?ze=t[42]:(ze=function(){x||(A.current=!0)},t[41]=x,t[42]=ze);let Be=ze,Ve,He;t[43]===H?(Ve=t[44],He=t[45]):(Ve=()=>{if(H===null)return;let e=!1;M(!1);let t=i3(H);i(b3(t));let n=function(e,t){let n=VC(t,e);w.current=e,T.current=n,u(t=>_3(t,e)?t:e),p(e=>_3(e,n)?e:n);let r=QC(O.current,e,D.current);O.current=r,v(e=>_3(e,r)?e:r)};return t.setOnBranchMismatch(()=>Nx(t)),t.setOnRenameRedirect(e=>{let{fromDocName:r,toDocName:i,hadOpenProvider:a}=e;(async()=>{let e,s=t.getActiveDocName()===r;$S([{fromDocName:r,toDocName:i}]);try{await Promise.all([t.closeAndClearPersistence(r),t.closeAndClearPersistence(i)]),s&&(t.open(i),t.setActive(i));let e=ew(w.current,[{fromDocName:r,toDocName:i}],X4,[],T.current),a=VC(ew(T.current,[{fromDocName:r,toDocName:i}],2**53-1),e);O.current=tw(O.current,[{fromDocName:r,toDocName:i}]),n(e,a),o(e=>e&&(vt(e)===r?{kind:`doc`,target:i,docName:i}:e)),s&&(window.location.hash=U(i))}catch(t){let n=t;e=n,console.warn(JSON.stringify({event:`removal-cleanup-error`,kind:`renamed`,fromDocName:r,toDocName:i,message:String(n instanceof Error?n.message:n)}))}console.info(JSON.stringify({event:`removal.cleanup`,kind:`renamed`,fromDocName:r,toDocName:i,hadOpenProvider:a,hadStaleIdb:!a,source:`auth-rejection`,errored:e!==void 0}))})()}),t.setOnDocDeleted(e=>{let{docName:r,hadOpenProvider:i}=e;(async()=>{let e;try{await t.closeAndClearPersistence(r),n(ZC(w.current,r),T.current),o(e=>e&&(vt(e)===r?null:e)),t.getActiveDocName()===r&&(window.location.hash=``)}catch(t){let n=t;e=n,console.warn(JSON.stringify({event:`removal-cleanup-error`,kind:`deleted`,docName:r,message:String(n instanceof Error?n.message:n)}))}console.info(JSON.stringify({event:`removal.cleanup`,kind:`deleted`,fromDocName:r,hadOpenProvider:i,hadStaleIdb:!i,source:`auth-rejection`,errored:e!==void 0}))})()}),t.setOnChange(()=>i(b3(t))),fetch(`/api/principal`).then(k3).then(n=>{if(e)return;let r=d.safeParse(n);r.success?(t.setTabIdentity({principalId:r.data.id,tabSessionId:$4}),P(r.data)):t3(r.error)}).catch(t=>{e||t3(t)}).finally(()=>{e||M(!0)}),Nx(t),()=>{e=!0,t.setOnChange(null),t.setOnRenameRedirect(null),t.setOnDocDeleted(null)}},He=[H],t[43]=H,t[44]=Ve,t[45]=He),(0,Y.useEffect)(Ve,He);let Ue;t[46]===H?Ue=t[47]:(Ue=e=>{if(Z(`ok/nav/open-document`,{docName:e,transition:!1}),H===null)return;let t=i3(H),n=t.open(e);if(!n)return;Cx(e,n.poolEventId);let r=OC(e);_e(e=>qC(e,r,X4,T.current)),xe(r),W(r),t.setActive(e),o({kind:`doc`,target:e,docName:e})},t[46]=H,t[47]=Ue);let We=Ue,Ge;t[48]===We?Ge=t[49]:(Ge=e=>{Z(`ok/nav/open-document`,{docName:e,transition:!1}),We(e)},t[48]=We,t[49]=Ge);let Ke=Ge,qe;t[50]!==a||t[51]!==H||t[52]!==Be||t[53]!==r.activeDocName?(qe=(e,t)=>{let n=t===void 0?{}:t;if(H===null)return;n.tabBehavior===`replace-active`&&Be();let i=i3(H),s=vt(e),c=E.current,l=c!==null&&n.tabBehavior===`replace-active`,u=c?null:C.current??h3(a,r.activeDocName),d=u!==null&&w.current.includes(u),f=u!==null&&T.current.includes(u),p=n.tabBehavior===`replace-active`&&f||n.tabBehavior===`replace-active`&&!l&&!d?`append`:n.tabBehavior??`append`;if(s&&e.kind!==`large-file`){let e=i.open(s);if(!e)return;Cx(s,e.poolEventId);let t=l?MC(w.current,OC(s)):null,n=l&&!t?AC(w.current,s):null,r=l?t?{activeTabId:t,tabs:w.current}:{activeTabId:n??OC(s),tabs:qC(w.current,n??OC(s),X4,T.current)}:YC(w.current,s,{behavior:p,currentTabId:u,limit:X4,pinnedTabIds:T.current});he(r.tabs),xe(r.activeTabId),W(r.activeTabId),i.setActive(s)}else{i.clearActive();let t=LC(e);if(t){let e=u!==null&&NC(u,t),n=l||e?null:MC(w.current,t),r=n?{tabs:w.current,activeTabId:n}:XC(w.current,t,{behavior:p,currentTabId:u,limit:X4,pinnedTabIds:T.current});he(r.tabs),W(r.activeTabId),xe(r.activeTabId)}else xe(t)}o(t=>y3(t,e)?t:e)},t[50]=a,t[51]=H,t[52]=Be,t[53]=r.activeDocName,t[54]=qe):qe=t[54];let Je=qe,Ye;t[55]===Je?Ye=t[56]:(Ye=(e,t)=>{Je(e,t===void 0?{}:t)},t[55]=Je,t[56]=Ye);let Xe=Ye,Ze;t[57]===Je?Ze=t[58]:(Ze=(e,t)=>{let n=t===void 0?{}:t;Z(`ok/nav/open-target`,{docName:vt(e),kind:e.kind,transition:!1}),Je(e,n)},t[57]=Je,t[58]=Ze);let Qe=Ze,$e;t[59]===H?$e=t[60]:($e=()=>{if(H===null){o(O3),C.current=null,c(D3);return}let e=i3(H);e.getActiveDocName()!==null&&e.clearActive(),o(E3),C.current=null,c(T3)},t[59]=H,t[60]=$e);let et;t[61]!==H||t[62]!==Be?(et=e=>{H!==null&&(Be(),i3(H).close(e),_e(t=>ZC(t,OC(e))),c(t=>{let n=t&&zC(t)===e?null:t;return C.current=n,n}),o(t=>t&&(vt(t)===e?null:t)))},t[61]=H,t[62]=Be,t[63]=et):et=t[63];let tt;t[64]!==s||t[65]!==a||t[66]!==H||t[67]!==Be||t[68]!==r.activeDocName?(tt=e=>{if(T.current.includes(e))return;Be();let t=null,n=zC(e);if(H!==null){let t=i3(H);n&&!g3(w.current,n,new Set([e]))&&t.close(n)}let i=s??h3(a,r.activeDocName);if(_e(n=>(t=iw(n,i,e),ZC(n,e))),i===e){if(t){W(t),window.location.hash=f3(t);return}H!==null&&i3(H).clearActive(),o(null),W(null),window.location.hash=``}},t[64]=s,t[65]=a,t[66]=H,t[67]=Be,t[68]=r.activeDocName,t[69]=tt):tt=t[69];let nt;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(nt=e=>{let t=UC(T.current,e,w.current);_3(T.current,t)||de(t)},t[70]=nt):nt=t[70];let rt;t[71]===Be?rt=t[72]:(rt=e=>{let t=WC(T.current,e);_3(T.current,t)||(Be(),de(t))},t[71]=Be,t[72]=rt);let it;t[73]===H?it=t[74]:(it=e=>{let t=RC(e);if(se(null),W(e),t.kind===`doc`){if(H!==null){let e=i3(H);if(!e.open(t.docName))return;e.setActive(t.docName)}o({kind:`doc`,target:t.docName,docName:t.docName});let e=U(t.docName);window.location.hash!==e&&(window.location.hash=e);return}if(H!==null&&i3(H).clearActive(),t.kind===`asset`){o(m3(t.assetPath));let e=xt(t.assetPath);window.location.hash!==e&&(window.location.hash=e);return}o({kind:`folder`,target:t.folderPath,folderPath:t.folderPath});let n=ae(t.folderPath);window.location.hash!==n&&(window.location.hash=n)},t[73]=H,t[74]=it);let at;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(at=(e,t)=>{let n=new Set(w.current),r=new Set(D.current),i=new Set,a=[],o=[],s=[];for(let t of e)i.has(t)||(n.has(t)?(a.push(t),s.push(t),i.add(t)):r.has(t)&&(o.push(t),s.push(t),i.add(t)));for(let e of w.current)i.has(e)||(a.push(e),s.push(e),i.add(e));for(let e of D.current)i.has(e)||(o.push(e),s.push(e),i.add(e));let c=_3(w.current,a),l=_3(D.current,o),u=_3(O.current,s);c&&l&&u||(O.current=s,l||(D.current=o,g(e=>_3(e,o)?e:o)),pe(a,KC(a,T.current,t)))},t[75]=at):at=t[75];let ot,st;t[76]===H?(ot=t[77],st=t[78]):(ot=()=>{let e=`new-tab:${k.current}`;k.current+=1,ye([...D.current,e]),se(e),H!==null&&i3(H).clearActive(),o(null),W(null),window.location.hash!==``&&(window.location.hash=``)},st=e=>{D.current.includes(e)&&(H!==null&&i3(H).clearActive(),o(null),W(null),se(e),window.location.hash!==``&&(window.location.hash=``))},t[76]=H,t[77]=ot,t[78]=st);let ct;t[79]!==H||t[80]!==Be?(ct=e=>{Be();let t=D.current;if(!t.includes(e))return;let n=t.filter(t=>t!==e);if(ye(n),E.current!==e)return;let r=t.indexOf(e),i=n[r]??n[r-1]??null;if(i){se(i),H!==null&&i3(H).clearActive(),o(null),W(null),window.location.hash!==``&&(window.location.hash=``);return}se(null);let a=w.current[w.current.length-1]??null;if(a){W(a),window.location.hash=f3(a);return}H!==null&&i3(H).clearActive(),o(null),W(null),window.location.hash=``},t[79]=H,t[80]=Be,t[81]=ct):ct=t[81];let lt;t[82]!==s||t[83]!==a||t[84]!==H||t[85]!==Be||t[86]!==r.activeDocName?(lt=(e,t)=>{let n=t===void 0?{}:t,i=e.filter(w3),c=new Set(n.force?i:GC(i,T.current));if(c.size===0)return;if(Be(),H!==null){let e=i3(H),t=new Map;for(let e of c){let n=zC(e);if(!n)continue;let r=t.get(n)??new Set;r.add(e),t.set(n,r)}for(let[n,r]of t)g3(w.current,n,r)||e.close(n)}let l=null,u=s??h3(a,r.activeDocName);if(_e(e=>(l=aw(e,u,c),e.filter(e=>!c.has(e)))),!u||!c.has(u)){u||o(e=>{if(!e)return e;let t=LC(e);return t&&c.has(t)?null:e});return}if(l){W(l),window.location.hash=f3(l);return}H!==null&&i3(H).clearActive(),o(null),W(null),window.location.hash=``},t[82]=s,t[83]=a,t[84]=H,t[85]=Be,t[86]=r.activeDocName,t[87]=lt):lt=t[87];let ut;t[88]!==s||t[89]!==a||t[90]!==H||t[91]!==Be||t[92]!==l||t[93]!==r.activeDocName?(ut=e=>{let{pages:t,folderPaths:n,assetPaths:i}=e,c=$C(l,{pages:t,folderPaths:n,assetPaths:i,keepMissingDocName:a?.kind===`missing`?a.target:null});if(c.length===l.length)return;let u=new Set(c),d=l.filter(e=>!u.has(e)),f=new Set(d);if(Be(),H!==null){let e=i3(H);for(let t of d){let n=zC(t);n&&e.close(n)}}he(c);let p=typeof window<`u`?p3(window.location.hash):null,m=s??h3(a,r.activeDocName),h=p&&f.has(p)?p:m&&f.has(m)?m:null;if(!h){o(e=>{if(!e)return e;let t=LC(e);return t&&f.has(t)?null:e});return}let g=aw(l,h,d);if(g){W(g),window.location.hash=f3(g);return}H!==null&&i3(H).clearActive(),o(null),W(null),window.location.hash=``},t[88]=s,t[89]=a,t[90]=H,t[91]=Be,t[92]=l,t[93]=r.activeDocName,t[94]=ut):ut=t[94];let ft;t[95]!==H||t[96]!==Be?(ft=(e,t,n)=>{let r=t===void 0?[]:t,i=n===void 0?[]:n;Be();let a=ew(w.current,e,X4,r,T.current,i),o=VC(ew(T.current,e,2**53-1,r,[],i),a);if(H!==null){let e=i3(H);for(let t of a){let n=zC(t);n&&e.open(n)}}O.current=tw(O.current,e,r,i),pe(a,o);let s=C.current;if(s){let t=ew([s],e,1,r,[],i)[0];t&&a.includes(t)&&W(t)}},t[95]=H,t[96]=Be,t[97]=ft):ft=t[97];let pt,mt,ht,gt,_t;t[98]===H?(pt=t[99],mt=t[100],ht=t[101],gt=t[102],_t=t[103]):(pt=async e=>{H!==null&&(await i3(H).closeAndClearPersistence(e),o(t=>t&&(vt(t)===e?null:t)))},mt=()=>H===null?null:i3(H).getActiveDocName(),ht=e=>H===null?!1:i3(H).has(e),gt=e=>{H!==null&&i3(H).recycle(e)},_t=e=>H===null?null:i3(H).prewarm(e)?.poolEventId??null,t[98]=H,t[99]=pt,t[100]=mt,t[101]=ht,t[102]=gt,t[103]=_t);let yt,bt,St,Ct,wt;t[104]===H?(yt=t[105],bt=t[106],St=t[107],Ct=t[108],wt=t[109]):(yt=e=>{H!==null&&i3(H).setExpectedServerInstanceId(e)},bt=async e=>{if(H===null)return;let t=i3(H);t.setObservedBranch(e),await wx(t,e),Ft([`files`,`backlinks`,`graph`]),dt(e)},St=async e=>{if(H===null)return;let t=i3(H);t.compareAndUpdateObservedBranch(e)&&(await wx(t,e),Ft([`files`,`backlinks`,`graph`]),dt(e))},Ct=(e,t)=>{H!==null&&i3(H).observeDiskAck(e,t)},wt=async()=>{H!==null&&await Nx(i3(H))},t[104]=H,t[105]=yt,t[106]=bt,t[107]=St,t[108]=Ct,t[109]=wt);let Tt;t[110]!==R||t[111]!==L||t[112]!==r.activeDocName?(Tt=(e,t)=>{if(!r.activeDocName&&t){window.location.hash=U(t),z(e),ee(`agent`),V(C3);return}if(L===`agent`&&R===e){ee(`doc`);return}z(e),ee(`agent`),V(S3)},t[110]=R,t[111]=L,t[112]=r.activeDocName,t[113]=Tt):Tt=t[113];let Et;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>{ee(`doc`),z(null)},t[114]=Et):Et=t[114];let Dt;t[115]!==y||t[116]!==s||t[117]!==a||t[118]!==ne||t[119]!==te||t[120]!==H||t[121]!==R||t[122]!==B||t[123]!==L||t[124]!==Pe||t[125]!==h||t[126]!==We||t[127]!==Ke||t[128]!==l||t[129]!==Xe||t[130]!==Qe||t[131]!==f||t[132]!==N||t[133]!==re||t[134]!==r.activeDocName||t[135]!==r.activeProvider||t[136]!==r.poolEntries||t[137]!==r.serverRestartRecovery||t[138]!==r.syncState||t[139]!==F||t[140]!==$e||t[141]!==et||t[142]!==tt||t[143]!==rt||t[144]!==it||t[145]!==ot||t[146]!==st||t[147]!==ct||t[148]!==lt||t[149]!==ut||t[150]!==ft||t[151]!==pt||t[152]!==mt||t[153]!==ht||t[154]!==gt||t[155]!==_t||t[156]!==yt||t[157]!==bt||t[158]!==St||t[159]!==Ct||t[160]!==wt||t[161]!==Tt||t[162]!==x||t[163]!==_?(Dt={principal:N,activeTarget:a,activeTabId:s,activeDocName:r.activeDocName,activeProvider:r.activeProvider,openTabs:l,pinnedTabIds:f,visibleTabIds:_,tabSessionLoaded:x,syncState:r.syncState,serverRestartRecovery:r.serverRestartRecovery,poolEntries:r.poolEntries,openDocument:We,openDocumentTransition:Ke,openTarget:Xe,openTargetTransition:Qe,clearTarget:$e,closeDocument:et,closeTab:tt,pinTab:nt,unpinTab:rt,activateTab:it,reorderTabs:at,newTabIds:h,activeNewTabId:y,isNewTabActive:Pe,openNewTab:ot,activateNewTab:st,closeNewTab:ct,closeTabs:lt,syncOpenTabsWithKnownTargets:ut,remapTabsForRename:ft,closeAndClearForRename:pt,getPoolActiveDocName:mt,poolHas:ht,recycleDocument:gt,prewarm:_t,systemProvider:F,setSystemProvider:I,updateServerInstanceId:yt,onBranchSwitched:bt,observeBranch:St,observeDiskAck:Ct,refreshServerInfo:wt,collabUrl:H,collabTerminal:te,collabLastError:ne,retryCollab:re,docPanelMode:L,docPanelAgentId:R,docPanelExpandSignal:B,openActivityPanel:Tt,closeActivityPanel:Et},t[115]=y,t[116]=s,t[117]=a,t[118]=ne,t[119]=te,t[120]=H,t[121]=R,t[122]=B,t[123]=L,t[124]=Pe,t[125]=h,t[126]=We,t[127]=Ke,t[128]=l,t[129]=Xe,t[130]=Qe,t[131]=f,t[132]=N,t[133]=re,t[134]=r.activeDocName,t[135]=r.activeProvider,t[136]=r.poolEntries,t[137]=r.serverRestartRecovery,t[138]=r.syncState,t[139]=F,t[140]=$e,t[141]=et,t[142]=tt,t[143]=rt,t[144]=it,t[145]=ot,t[146]=st,t[147]=ct,t[148]=lt,t[149]=ut,t[150]=ft,t[151]=pt,t[152]=mt,t[153]=ht,t[154]=gt,t[155]=_t,t[156]=yt,t[157]=bt,t[158]=St,t[159]=Ct,t[160]=wt,t[161]=Tt,t[162]=x,t[163]=_,t[164]=Dt):Dt=t[164];let Ot=Dt,kt;return t[165]!==n||t[166]!==Ot?(kt=(0,X.jsx)(n3,{value:Ot,children:n}),t[165]=n,t[166]=Ot,t[167]=kt):kt=t[167],kt}function S3(e){return e+1}function C3(e){return e+1}function w3(e){return e.length>0}function T3(e){return e===null?e:null}function E3(e){return e===null?e:null}function D3(e){return e===null?e:null}function O3(e){return e===null?e:null}function k3(e){return e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))}function A3(e){console.warn(`[editor-tabs] failed to persist tab session:`,e)}function j3(e){console.warn(`[editor-tabs] failed to restore tab session:`,e)}function M3(){let e=(0,Y.use)(n3);if(!e)throw Error(`useDocumentContext must be used within <DocumentProvider />`);return e}function N3(){let e=(0,J.c)(3),{openDocumentTransition:t,openTargetTransition:n}=M3(),r;return e[0]!==t||e[1]!==n?(r={openDocumentTransition:t,openTargetTransition:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{OI as $,fa as $n,lx as $t,T$ as A,yc as An,gC as At,yY as B,Ba as Bn,iS as Bt,f1 as C,Rl as Cn,IC as Ct,p1 as D,Z as Dn,cC as Dt,m1 as E,Mc as En,sC as Et,tX as F,gc as Fn,DS as Ft,aR as G,Oa as Gn,jx as Gt,gY as H,ja as Hn,aS as Ht,JY as I,Ya as In,dS as It,sR as J,ba as Jn,gx as Jt,wR as K,Ta as Kn,Sx as Kt,LY as L,Ua as Ln,lS as Lt,nZ as M,xc as Mn,IS as Mt,eZ as N,bc as Nn,FS as Nt,c1 as O,Ec as On,aC as Ot,tZ as P,vc as Pn,PS as Pt,NL as Q,ga as Qn,fx as Qt,AY as R,Ha as Rn,uS as Rt,y1 as S,Bl as Sn,Mi as Sr,LC as St,g1 as T,Ul as Tn,XS as Tt,iK as U,Aa as Un,Hx as Ut,_Y as V,za as Vn,sS as Vt,fB as W,ka as Wn,Px as Wt,OL as X,va as Xn,cx as Xt,FL as Y,ya as Yn,sx as Yt,EL as Z,_a as Zn,dx as Zt,R2 as _,sm as _n,zi as _r,OC as _t,b4 as a,eb as an,aa as ar,aA as at,C0 as b,Eu as bn,Pi as br,RC as bt,v4 as c,Ry as cn,$i as cr,VO as ct,I4 as d,hg as dn,qi as dr,oO as dt,px as en,da as er,DI as et,g4 as f,Vh as fn,Ki as fr,qD as ft,L2 as g,Nh as gn,Bi as gr,FC as gt,Y2 as h,Rh as hn,Vi as hr,qE as ht,x4 as i,cb as in,oa as ir,AA as it,hQ as j,Sc as jn,xS as jt,L$ as k,wc as kn,YS as kt,L4 as l,Av as ln,Xi as lr,zO as lt,X2 as m,Ph as mn,Hi as mr,HD as mt,M3 as n,mx as nn,ca as nr,eF as nt,y4 as o,ny as on,ia as or,Kk as ot,h4 as p,Bh as pn,Gi as pr,KD as pt,pB as q,xa as qn,hx as qt,N3 as r,sb as rn,sa as rr,rM as rt,S4 as s,My as sn,ta as sr,fk as st,x3 as t,ux as tn,la as tr,iF as tt,M4 as u,Xm as un,Yi as ur,lO as ut,F0 as v,cm as vn,Ri as vr,GC as vt,h1 as w,Gl as wn,$S as wt,E1 as x,Tu as xn,Ni as xr,nw as xt,E0 as y,Bf as yn,Fi as yr,PC as yt,DY as z,Va as zn,oS as zt};
61
+ ${qZ(t)}`}var XZ=`plaintext`;function ZZ(){return typeof document<`u`&&document.documentElement.classList.contains(`dark`)?`dark`:`light`}function QZ(e,t){let n=(0,J.c)(4),[r,i]=(0,Y.useState)(!1),a,o;return n[0]!==e||n[1]!==t?(a=()=>{let n=()=>{let n=typeof t==`function`?t():void 0;if(typeof n!=`number`)return;let r=e.state.doc.nodeAt(n);if(!r)return;let{from:a,to:o}=e.state.selection,s=n,c=a<n+r.nodeSize&&o>s;i(e=>e===c?e:c)};return n(),e.on(`selectionUpdate`,n),()=>{e.isDestroyed||e.off(`selectionUpdate`,n)}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Y.useEffect)(a,o),r}function $Z(e){let t=(0,J.c)(172),{node:n,updateAttributes:r,editor:a,getPos:s,selected:c}=e,{_:l}=i(),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(!1),m=(0,Y.useRef)(null),h=(0,Y.useRef)(null),g=(0,Y.useRef)(null),[_,v]=(0,Y.useState)(null),{resolvedTheme:y}=He(),b;t[0]===y?b=t[1]:(b=y===`dark`||y===`light`?y:ZZ(),t[0]=y,t[1]=b);let x=b,[S]=(0,Y.useState)(ZZ),{merged:C}=eF(),w=C?.preview?.scriptSrc??`cdn-allowlist`,T=n.attrs.language??null,E=n.attrs.meta??null,D;t[2]===E?D=t[3]:(D=IZ(E),t[2]=E,t[3]=D);let O=D,[k,A]=(0,Y.useState)(!1),[j,M]=(0,Y.useState)(!1),N=(0,Y.useId)(),P=`${N}-title-input`,F=`${N}-title-help`,I=(0,Y.useRef)(E),L,ee;t[4]===E?(L=t[5],ee=t[6]):(L=()=>{I.current=E},ee=[E],t[4]=E,t[5]=L,t[6]=ee),(0,Y.useEffect)(L,ee);let R,z,B,V,H;if(t[7]!==l||t[8]!==T||t[9]!==E){z=yZ(T),R=T?_Z.find(e=>e.value===z)?.label??T:l({id:`LpB85N`});let e;t[15]===E?e=t[16]:(e=CZ(E,`preview`),t[15]=E,t[16]=e),V=e,B=z?EZ.has(z):!1,H=DZ(z,E),t[7]=l,t[8]=T,t[9]=E,t[10]=R,t[11]=z,t[12]=B,t[13]=V,t[14]=H}else R=t[10],z=t[11],B=t[12],V=t[13],H=t[14];let U=H,te;t[17]!==U||t[18]!==E?(te=U?MZ(E):null,t[17]=U,t[18]=E,t[19]=te):te=t[19];let ne=te,re;t[20]!==U||t[21]!==E?(re=U?NZ(E):null,t[20]=U,t[21]=E,t[22]=re):re=t[22];let ie=re,ae=ne??(_===null?void 0:`${_}px`),W=!U,oe,se;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>()=>{m.current!==null&&window.clearTimeout(m.current)},se=[],t[23]=oe,t[24]=se):(oe=t[23],se=t[24]),(0,Y.useEffect)(oe,se);let G=a.isEditable,ce=QZ(a,s),le,ue;t[25]===x?(le=t[26],ue=t[27]):(le=()=>{g.current?.contentWindow?.postMessage(BZ(x),`*`)},ue=[x],t[25]=x,t[26]=le,t[27]=ue),(0,Y.useEffect)(le,ue);let de,fe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>{let e=function(e){if(e.source!==g.current?.contentWindow)return;let t=HZ(e.data);t!==null&&v(e=>e!==null&&Math.abs(e-t)<=2?e:t)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},fe=[],t[28]=de,t[29]=fe):(de=t[28],fe=t[29]),(0,Y.useEffect)(de,fe);let pe;t[30]===n.textContent?pe=t[31]:(pe=()=>{let e=n.textContent,t=()=>{p(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>p(!1),1200)};try{typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e).then(t,rQ)}catch{}},t[30]=n.textContent,t[31]=pe);let me=pe,he;t[32]!==a||t[33]!==s?(he=()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{a.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[CodeBlockView] delete failed — position race`,t)}},t[32]=a,t[33]=s,t[34]=he):he=t[34];let ge=he,_e;t[35]!==V||t[36]!==E||t[37]!==r?(_e=()=>{r({meta:V?TZ(E,`preview`):wZ(E,`preview`)})},t[35]=V,t[36]=E,t[37]=r,t[38]=_e):_e=t[38];let ve=_e,ye;t[39]!==E||t[40]!==r?(ye=e=>{let t=LZ(E,e.length>0?e:null);t!==E&&r({meta:t})},t[39]=E,t[40]=r,t[41]=ye):ye=t[41];let be=ye,xe;t[42]!==a.state||t[43]!==a.view||t[44]!==s||t[45]!==n.attrs||t[46]!==n.nodeSize||t[47]!==n.type?(xe=e=>{let t=typeof s==`function`?s():void 0;if(typeof t==`number`)try{let{schema:r,tr:i}=a.state,o=n.type.create(n.attrs,e.length>0?r.text(e):null);i.replaceWith(t,t+n.nodeSize,o),a.view.dispatch(i)}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[CodeBlockView] edit-save failed — position race`,t)}},t[42]=a.state,t[43]=a.view,t[44]=s,t[45]=n.attrs,t[46]=n.nodeSize,t[47]=n.type,t[48]=xe):xe=t[48];let Se=xe,Ce;t[49]===r?Ce=t[50]:(Ce=e=>{let t=`${Math.round(e.width)}px`,n=`${Math.round(e.height)}px`;r({meta:jZ(jZ(I.current,`h`,n),`w`,t)})},t[49]=r,t[50]=Ce);let we=Ce,Te=T??void 0,Ee=ce?`true`:void 0,De=c?`true`:void 0,Oe=U?`true`:void 0,ke=W?`true`:`false`,Ae;t[51]!==l||t[52]!==x||t[53]!==S||t[54]!==W||t[55]!==ae||t[56]!==we||t[57]!==n.textContent||t[58]!==U||t[59]!==w||t[60]!==ie?(Ae=U?(0,X.jsxs)(`div`,{ref:h,className:vn(`ok-codeblock-preview`,W?`ok-codeblock-preview--with-code`:`ok-codeblock-preview--solo`),contentEditable:!1,style:{...ae?{height:ae}:{},...ie?{width:ie}:{}},onMouseDown:nQ,children:[(0,X.jsx)(`iframe`,{title:l({id:`G7cMuO`}),ref:g,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,srcDoc:YZ(w,S)+n.textContent,className:`ok-codeblock-preview-frame`,onLoad:()=>{g.current?.contentWindow?.postMessage(BZ(x),`*`)}}),(0,X.jsx)(ak,{targetRef:h,bounds:{minWidth:192,maxWidth:Math.round(window.innerWidth*.9),minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=h.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:we})]}):null,t[51]=l,t[52]=x,t[53]=S,t[54]=W,t[55]=ae,t[56]=we,t[57]=n.textContent,t[58]=U,t[59]=w,t[60]=ie,t[61]=Ae):Ae=t[61];let je;t[62]===O?je=t[63]:(je=O?(0,X.jsx)(`div`,{className:`ok-codeblock-title`,contentEditable:!1,"data-testid":`ok-codeblock-title`,title:O,children:(0,X.jsx)(`span`,{className:`ok-codeblock-title-text`,children:O})}):null,t[62]=O,t[63]=je);let Me=U&&W?`rounded-b-lg`:null,Ne=U?null:`rounded-lg`,Pe;t[64]!==Me||t[65]!==Ne?(Pe=vn(`ok-codeblock-pre m-0 overflow-x-auto px-5 py-4 font-mono text-sm leading-relaxed`,Me,Ne),t[64]=Me,t[65]=Ne,t[66]=Pe):Pe=t[66];let Fe=!W||void 0,Ie=T?`language-${T}`:void 0,Le;t[67]===Ie?Le=t[68]:(Le=vn(`hljs block whitespace-pre bg-transparent p-0`,Ie),t[67]=Ie,t[68]=Le);let Re;t[69]===Le?Re=t[70]:(Re=(0,X.jsx)(Jl,{as:`code`,className:Le}),t[69]=Le,t[70]=Re);let ze;t[71]!==Pe||t[72]!==Fe||t[73]!==Re?(ze=(0,X.jsx)(`pre`,{className:Pe,"aria-hidden":Fe,children:Re}),t[71]=Pe,t[72]=Fe,t[73]=Re,t[74]=ze):ze=t[74];let Be;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Be={[fF]:`true`},t[75]=Be):Be=t[75];let Ve=!G,Ue;t[76]!==l||t[77]!==R?(Ue=l({id:`c5f7sm`,values:{currentLabel:R}}),t[76]=l,t[77]=R,t[78]=Ue):Ue=t[78];let We;t[79]===R?We=t[80]:(We=(0,X.jsx)(`span`,{children:R}),t[79]=R,t[80]=We);let Ge;t[81]===G?Ge=t[82]:(Ge=G?(0,X.jsx)(Ri,{className:`size-3 opacity-60`,"aria-hidden":`true`}):null,t[81]=G,t[82]=Ge);let Ke;t[83]!==Ve||t[84]!==Ue||t[85]!==We||t[86]!==Ge?(Ke=(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,disabled:Ve,className:`ok-codeblock-chrome-btn ok-codeblock-chrome-lang`,"aria-label":Ue,children:[We,Ge]})}),t[83]=Ve,t[84]=Ue,t[85]=We,t[86]=Ge,t[87]=Ke):Ke=t[87];let qe;t[88]===l?qe=t[89]:(qe=l({id:`G_mWXb`}),t[88]=l,t[89]=qe);let Je;t[90]===qe?Je=t[91]:(Je=(0,X.jsx)(lx,{placeholder:qe}),t[90]=qe,t[91]=Je);let Ye;t[92]===l?Ye=t[93]:(Ye=l({id:`ETyvvg`}),t[92]=l,t[93]=Ye);let Xe;t[94]===Ye?Xe=t[95]:(Xe=(0,X.jsx)(dx,{children:Ye}),t[94]=Ye,t[95]=Xe);let Ze;t[96]!==a.commands||t[97]!==z||t[98]!==T||t[99]!==r?(Ze=_Z.map(e=>{let t=e.value===XZ?!T||z===XZ:z===e.value;return(0,X.jsxs)(px,{value:`${e.label} ${e.value} ${e.aliases?.join(` `)??``}`,onSelect:()=>{r({language:e.value===XZ?null:e.value}),d(!1),a.commands.focus()},children:[(0,X.jsx)(`span`,{className:`flex-1`,children:e.label}),t?(0,X.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}):null]},e.value)}),t[96]=a.commands,t[97]=z,t[98]=T,t[99]=r,t[100]=Ze):Ze=t[100];let Qe;t[101]===Ze?Qe=t[102]:(Qe=(0,X.jsx)(fx,{children:Ze}),t[101]=Ze,t[102]=Qe);let $e;t[103]!==Xe||t[104]!==Qe?($e=(0,X.jsxs)(ux,{children:[Xe,Qe]}),t[103]=Xe,t[104]=Qe,t[105]=$e):$e=t[105];let et;t[106]!==Je||t[107]!==$e?(et=(0,X.jsx)(xc,{align:`end`,sideOffset:6,className:`w-56 p-0`,children:(0,X.jsxs)(sx,{filter:eQ,children:[Je,$e]})}),t[106]=Je,t[107]=$e,t[108]=et):et=t[108];let tt;t[109]!==u||t[110]!==Ke||t[111]!==et?(tt=(0,X.jsxs)(yc,{open:u,onOpenChange:d,children:[Ke,et]}),t[109]=u,t[110]=Ke,t[111]=et,t[112]=tt):tt=t[112];let nt;t[113]!==l||t[114]!==G||t[115]!==U?(nt=G&&U?(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"aria-label":l({id:`R3y75Z`}),"data-testid":`ok-codeblock-edit-btn`,onClick:()=>M(!0),children:(0,X.jsx)(Oa,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[113]=l,t[114]=G,t[115]=U,t[116]=nt):nt=t[116];let rt;t[117]!==l||t[118]!==G||t[119]!==ve||t[120]!==B||t[121]!==V?(rt=G&&B?(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"data-active":V?`true`:void 0,"aria-pressed":V,"aria-label":l(V?{id:`xHGM4U`}:{id:`7OwvEL`}),onClick:ve,children:V?(0,X.jsx)(Xi,{className:`size-3.5`}):(0,X.jsx)(Zi,{className:`size-3.5`})}):null,t[117]=l,t[118]=G,t[119]=ve,t[120]=B,t[121]=V,t[122]=rt):rt=t[122];let it;t[123]!==l||t[124]!==G||t[125]!==be||t[126]!==k||t[127]!==O||t[128]!==F||t[129]!==P?(it=G?(0,X.jsxs)(yc,{open:k,onOpenChange:A,children:[(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"data-active":O?`true`:void 0,"aria-label":l({id:`DDTdLl`}),children:(0,X.jsx)(Ma,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,X.jsx)(xc,{align:`end`,sideOffset:6,className:`w-64 p-3`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:P,className:`text-2xs font-mono uppercase tracking-wide text-muted-foreground`,children:(0,X.jsx)(o,{id:`MHrjPM`})}),(0,X.jsx)(ir,{id:P,type:`text`,value:O??``,placeholder:l({id:`mk2poV`}),"data-testid":`ok-codeblock-title-input`,"aria-describedby":F,onChange:e=>be(e.target.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`Escape`)&&(e.preventDefault(),A(!1))},className:`h-8`}),(0,X.jsx)(`p`,{id:F,className:`text-2xs text-muted-foreground`,children:(0,X.jsx)(o,{id:`lond3p`})})]})})]}):null,t[123]=l,t[124]=G,t[125]=be,t[126]=k,t[127]=O,t[128]=F,t[129]=P,t[130]=it):it=t[130];let at;t[131]!==l||t[132]!==f?(at=l(f?{id:`6V3Ea3`}:{id:`NmPNJJ`}),t[131]=l,t[132]=f,t[133]=at):at=t[133];let ot;t[134]===f?ot=t[135]:(ot=f?(0,X.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}):(0,X.jsx)(qi,{className:`size-3.5`,"aria-hidden":`true`}),t[134]=f,t[135]=ot);let st;t[136]!==me||t[137]!==at||t[138]!==ot?(st=(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"aria-label":at,onClick:me,children:ot}),t[136]=me,t[137]=at,t[138]=ot,t[139]=st):st=t[139];let ct;t[140]!==l||t[141]!==G||t[142]!==ge?(ct=G?(0,X.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn ok-codeblock-chrome-btn--delete`,"aria-label":l({id:`oBXkm2`}),onClick:ge,children:(0,X.jsx)(Ha,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[140]=l,t[141]=G,t[142]=ge,t[143]=ct):ct=t[143];let lt;t[144]!==tt||t[145]!==nt||t[146]!==rt||t[147]!==it||t[148]!==st||t[149]!==ct?(lt=(0,X.jsxs)(`div`,{className:`ok-codeblock-chrome`,contentEditable:!1,onMouseDown:tQ,...Be,children:[tt,nt,rt,it,st,ct]}),t[144]=tt,t[145]=nt,t[146]=rt,t[147]=it,t[148]=st,t[149]=ct,t[150]=lt):lt=t[150];let ut;t[151]!==l||t[152]!==S||t[153]!==j||t[154]!==G||t[155]!==Se||t[156]!==n.textContent||t[157]!==z||t[158]!==U||t[159]!==w?(ut=G&&U?(0,X.jsx)(gZ,{open:j,onOpenChange:M,initialValue:n.textContent,language:z===`xml`?`html`:`plain`,title:l({id:`R3y75Z`}),renderPreview:e=>(0,X.jsx)(`iframe`,{title:l({id:`G7cMuO`}),sandbox:`allow-scripts`,className:`size-full border-0`,srcDoc:YZ(w,S)+e}),onSave:Se}):null,t[151]=l,t[152]=S,t[153]=j,t[154]=G,t[155]=Se,t[156]=n.textContent,t[157]=z,t[158]=U,t[159]=w,t[160]=ut):ut=t[160];let dt;return t[161]!==Te||t[162]!==Ee||t[163]!==De||t[164]!==Oe||t[165]!==ke||t[166]!==Ae||t[167]!==je||t[168]!==ze||t[169]!==lt||t[170]!==ut?(dt=(0,X.jsxs)(Yl,{className:`ok-codeblock relative my-3`,"data-language":Te,"data-cursor-inside":Ee,"data-selected":De,"data-preview":Oe,"data-code-visible":ke,children:[Ae,je,ze,lt,ut]}),t[161]=Te,t[162]=Ee,t[163]=De,t[164]=Oe,t[165]=ke,t[166]=Ae,t[167]=je,t[168]=ze,t[169]=lt,t[170]=ut,t[171]=dt):dt=t[171],dt}function eQ(e,t){return t?+!!e.toLowerCase().includes(t.toLowerCase()):1}function tQ(e){return e.stopPropagation()}function nQ(e){return e.stopPropagation()}function rQ(){}function iQ(e,t=[]){return e.flatMap(e=>{if(e.type===`text`)return[{text:e.value,classes:t}];let n=[...t,...e.properties?.className??[]];return iQ(e.children,n)})}function aQ(e){let{doc:t,name:n,lowlight:r,defaultLanguage:i}=e,a=[],o=r.listLanguages();return nt(t,e=>e.type.name===n).forEach(e=>{let t=e.pos+1,n=e.node.attrs.language||i;if(!n||!(o.includes(n)||(r.registered?.(n)??!1)))return;let s;try{s=r.highlight(n,e.node.textContent)}catch{return}let c=s.children??[];for(let e of iQ(c)){let n=t+e.text.length;e.classes.length>0&&a.push(ln.inline(t,n,{class:e.classes.join(` `)})),t=n}}),ye.create(t,a)}function oQ(e){let{name:t,lowlight:n,defaultLanguage:r}=e,i=new S({key:new b(`codeBlockLowlight`),state:{init:(e,{doc:i})=>aQ({doc:i,name:t,lowlight:n,defaultLanguage:r}),apply:(e,i,a,o)=>{if(!e.docChanged)return i.map(e.mapping,e.doc);let s=a.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=nt(a.doc,e=>e.type.name===t),u=nt(o.doc,e=>e.type.name===t);return[s,c].includes(t)||u.length!==l.length||e.steps.some(e=>{let t=e;return t.from===void 0||t.to===void 0?!1:l.some(e=>t.from<e.pos+e.node.nodeSize&&t.to>e.pos)})?aQ({doc:e.doc,name:t,lowlight:n,defaultLanguage:r}):i.map(e.mapping,e.doc)}},props:{decorations(e){return i.getState(e)}}});return i}var sQ=ZP(qP),cQ=Se.extend({addNodeView(){return ru($Z)},addProseMirrorPlugins(){return[...this.parent?.()??[],oQ({name:this.name,lowlight:sQ,defaultLanguage:null})]},addInputRules(){return[...this.parent?.()??[],$e({find:/^```$/,type:this.type,getAttributes:()=>({language:`js`})})]}});function lQ(e){return!!e.getMeta(Uv)}function uQ(e,t){let n=Uv.getState(e);return jy(n.doc,n.type,t,n.binding.mapping)||0}function dQ(e,t){let n=Uv.getState(e);return ky(t,n.type,n.binding.mapping)}var fQ=class e extends yt{constructor(e,t){super(e),this.yRelativePosition=t}static fromJSON(t){return new e(t.position,t.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function pQ(e,t){return new fQ(e,dQ(t,e))}function mQ(e,t,n){let r=e instanceof fQ?e.yRelativePosition:null;if(lQ(t)&&r)return{position:new fQ(uQ(n,r),r),mapResult:null};let i=It(e,t),a=i.position.position;return{position:new fQ(a,r??dQ(n,a)),mapResult:i.mapResult}}var hQ=Wt.create({name:`collaboration`,priority:1e3,addOptions(){return{document:null,field:`default`,fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(e=>e.name===`undoRedo`)&&console.warn(`[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".`)},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(e,t)=>mQ(e,t,this.editor.state),this.editor.utils.createMappablePosition=e=>pQ(e,this.editor.state)},addCommands(){return{undo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Wv.getState(t).undoManager.undoStack.length===0?!1:n?zy(t):!0),redo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Wv.getState(t).undoManager.redoStack.length===0?!1:n?By(t):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){let e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),t=Uy(this.options.yUndoOptions),n=t.spec.view;return t.spec.view=e=>{let{undoManager:t}=Wv.getState(e.state);t.restore&&=(t.restore(),()=>{});let r=n?n(e):void 0;return{destroy:()=>{let e=t.trackedOrigins.has(t),n=t._observers;t.restore=()=>{e&&t.trackedOrigins.add(t),t.doc.on(`afterTransaction`,t.afterTransactionHandler),t._observers=n},r?.destroy&&r.destroy()}}},[Qv(e,{...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender}),t,this.editor.options.enableContentCheck&&new S({key:new b(`filterInvalidContent`),filterTransaction:t=>{if(!lQ(t))return!0;if(this.storage.isDisabled)return!1;if(!t.docChanged)return!0;try{return t.doc.check(),!0}catch(t){return this.storage.isDisabled=!0,this.editor.emit(`contentError`,{error:t,editor:this.editor,disableCollaboration:()=>{var t;(t=e.doc)==null||t.destroy()}}),!1}}})].filter(Boolean)}});function gQ(e){if(!e.length)return ye.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push(ln.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),ye.create(n,t)}function _Q(e,t,n){let r=n.isText||n.isAtom?0:1;return{start:e+r,end:e+t-r}}function vQ(e,t,n,r={}){let i=[],a=e.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let s=new de(e,t,n),c=s.depth===0?0:a.resolve(s.start).posAtIndex(0);return s.parent.forEach((n,r)=>{let l=c+r,u=l+n.nodeSize,d=_Q(l,n.nodeSize,n),f=o?t.pos>=d.start&&e.pos<=d.end:t.pos>d.start&&e.pos<d.end;if(l<s.start||l>=s.end||!f)return;let p=new wt(a.resolve(l),a.resolve(u));i.push(p)}),i}var yQ=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new bQ(e.resolve(this.anchor),e.resolve(this.head))}},bQ=class e extends le{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=vQ(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){return new e(t.resolve(n.map(this.anchor)),t.resolve(n.map(this.head)))}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new yQ(this.anchor,this.head)}};bQ.prototype.visible=!1;function xQ(e){return e instanceof bQ}Wt.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!xQ(a)){let e=bQ.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!xQ(a)){let e=bQ.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=bQ.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;xQ(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new S({key:new b(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=bQ.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=xQ(r);if(e=!1,!t)return i?(e=!0,gQ(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=vQ(a,o,this.options.depth);return s.length?(e=!0,gQ(s)):null}}})]}});function SQ(e){let t=``,n=getComputedStyle(e);for(let e=0;e<n.length;e+=1)t+=`${n[e]}:${n.getPropertyValue(n[e])};`;return t}function CQ(e){let t=e.cloneNode(!0),n=[e,...Array.from(e.getElementsByTagName(`*`))],r=[t,...Array.from(t.getElementsByTagName(`*`))];return n.forEach((e,t)=>{r[t].style.cssText=SQ(e)}),t}var wQ=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`tableStructure`,evaluate:({node:e,parent:t})=>[`tableRow`,`tableCell`,`tableHeader`].includes(e.type.name)||t&&t.type.name===`tableHeader`?1e3:0},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],TQ={edges:[`left`,`top`],threshold:12,strength:500};function EQ(e){return e===void 0||e===`left`?{...TQ}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...TQ,...e}}function DQ(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`?r.bottom-e.y<i:!1)}function OQ(e,t,n,r){return!t||n.edges.length===0?0:DQ(e,t,n)?n.strength*r:0}var kQ=1e3;function AQ(e,t,n,r){let i=kQ,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=OQ(r,o,n,e.depth),i<=0?-1:i}function jQ(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function MQ(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...wQ),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!jQ(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=AQ({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null),c=a.nodeAfter;if(c&&c.isAtom&&!c.isInline){let i=r.pos,l=a.depth+1,u=a.parent,d=a.index(),f=u.childCount,p=!0;if(n.allowedContainers&&(p=jQ(a,l,n.allowedContainers)),p){let r=AQ({node:c,pos:i,depth:l,parent:u,index:d,isFirst:d===0,isLast:d===f-1,$pos:a,view:e},o,n.edgeDetection,t);if(r>=0){let t=e.nodeDOM(i);t&&s.push({node:c,pos:i,depth:l,score:r,dom:t})}}}if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let l=s[0];return l.dom?{node:l.node,pos:l.pos,dom:l.dom}:null}function NQ(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;return n?.parentElement===t.dom?n:void 0}function PQ(e){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function FQ(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return null;let s=a.getBoundingClientRect(),c=o.getBoundingClientRect();if(!PQ(s)||!PQ(c))return null;let l=Math.min(Math.max(s.top+r,n),c.bottom-r),u=.5,d=Math.abs(s.left-c.left)<u,f=Math.abs(s.right-c.right)<u,p=s;d&&f&&(p=s);let m=Math.min(Math.max(p.left+r,t),p.right-r);return!Number.isFinite(m)||!Number.isFinite(l)?null:{x:m,y:l}}var IQ=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=FQ(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=MQ(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=NQ(e,a);return t?(d=t,!0):!1}),!d){let e=a.posAtCoords({left:c,top:l});if(e){let t=o.doc.resolve(e.pos),n=Math.min(t.depth,1),r=n>0?t.before(n):t.pos,i=o.doc.nodeAt(r);if(i){let e=a.nodeDOM(r);return{resultElement:e instanceof HTMLElement?e:null,resultNode:i,pos:r}}}return{resultElement:null,resultNode:null,pos:null}}let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function LQ(e,t){let n=null,r=e.nodeDOM(t);if(r instanceof Element)n=r;else{let{node:r,offset:i}=e.domAtPos(t),a=r.childNodes[i];a instanceof Element?n=a:r instanceof Element?n=r:r.nodeType===Node.TEXT_NODE&&r.parentElement&&(n=r.parentElement)}return(n?getComputedStyle(n).direction:getComputedStyle(e.dom).direction)||`ltr`}function RQ(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function zQ(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=IQ({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});if(!a.resultNode||a.pos===null)return[];let o=a.resultNode.isText||a.resultNode.isAtom?0:-1;return vQ(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize+o),0,{extendOnBoundaryOverlap:!1})}function BQ(e,t,n,r){let{view:i}=t;if(!e.dataTransfer)return;let{empty:a,$from:o,$to:s}=i.state.selection,c=zQ(e,t,n,r),l=vQ(o,s,0,{extendOnBoundaryOverlap:!1}),u=l.some(e=>c.find(t=>t.$from===e.$from&&t.$to===e.$to)),d=a||!u?c:l;if(!d.length)return;let{tr:f}=i.state,p=document.createElement(`div`),m=d[0].$from.pos,h=d[d.length-1].$to.pos;p.setAttribute(`dir`,LQ(i,m));let g=n?.enabled&&r?.node,_,v;g?(_=i.state.doc.slice(m,h),v=we.create(i.state.doc,m)):(v=bQ.create(i.state.doc,m,h),_=v.content()),d.forEach(e=>{let t=CQ(i.nodeDOM(e.$from.pos));p.append(t)}),p.style.position=`absolute`,p.style.top=`-10000px`,p.style.contentVisibility=`visible`,document.body.append(p);for(let e of p.querySelectorAll(`*`))e.style&&e.style.contentVisibility===`auto`&&(e.style.contentVisibility=`visible`);e.dataTransfer.clearData();let y=p.getBoundingClientRect(),b=i.nodeDOM(m),x=b&&b.nodeType===1?b.getBoundingClientRect():null,S=x?Math.min(e.clientX-x.left,y.width):Math.max(0,Math.min(e.clientX-y.left,y.width)),C=x?Math.min(Math.max(e.clientY-x.top,0),y.height):0;e.dataTransfer.setDragImage(p,S,C);let w=!1,T=()=>{w||(w=!0,RQ(p),document.removeEventListener(`drop`,T),document.removeEventListener(`dragend`,T))},E=v instanceof we?v:void 0;i.dragging={slice:_,move:!0,node:E},f.setSelection(v),i.dispatch(f),document.addEventListener(`drop`,T),document.addEventListener(`dragend`,T)}var VQ=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},HQ=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a},UQ=(e,t)=>{let n=Uv.getState(e);return n?ky(t,n.type,n.binding.mapping):null},WQ=(e,t)=>{let n=Uv.getState(e);return n?jy(n.doc,n.type,t,n.binding.mapping)||0:-1},GQ=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},KQ=new b(`dragHandle`),qQ=({pluginKey:e=KQ,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c})=>{let l=document.createElement(`div`),u=!1,d=null,f=-1,p,m=null,h=null;function g(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function _(){if(t){if(!n.isEditable){g();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function v(e){Bt(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function y(e){o?.(e),BQ(e,n,c,{node:d,pos:f}),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function x(e){s?.(e),g(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function C(){if(At()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}}return l.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,x),document.removeEventListener(`drop`,C),m&&(cancelAnimationFrame(m),m=null,h=null)},plugin:new S({key:typeof e==`string`?new b(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(u=s),c)return g(),u=!1,d=null,f=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&f!==-1&&t)if(lQ(e)){let e=WQ(o,p);e!==f&&(f=e)}else{let t=e.mapping.map(f);t!==f&&(f=t,p=UQ(o,f))}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(l),l.style.pointerEvents=`none`,l.style.position=`absolute`,l.style.top=`0`,l.style.left=`0`,t.addEventListener(`dragstart`,y),t.addEventListener(`dragend`,x),document.addEventListener(`drop`,C),{update(r,i){if(!t)return;if(!n.isEditable){g();return}if(u?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||f===-1)return;let o=e.nodeDOM(f);if(o=GQ(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=HQ(n.state.doc,s),l=VQ(n.state.doc,s);d=c,f=l,p=UQ(e.state,f),a?.({editor:n,node:d,pos:f}),v(o)},destroy(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,x),document.removeEventListener(`drop`,C),m&&(cancelAnimationFrame(m),m=null,h=null),t&&RQ(l)}}},props:{handleDOMEvents:{keydown(e){return!t||u?!1:e.hasFocus()?(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return u||t.target&&!l.contains(t.relatedTarget)&&(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||u||(h={x:r.clientX,y:r.clientY},m)||(m=requestAnimationFrame(()=>{if(m=null,!h)return;let{x:t,y:r}=h;h=null;let i=IQ({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=GQ(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=HQ(n.state.doc,t),l=VQ(n.state.doc,t)}s!==d&&(d=s,f=l??-1,p=UQ(e.state,f),a?.({editor:n,node:d,pos:f}),v(o),_())})),!1}}}})}};function JQ(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:EQ(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:EQ(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:EQ(e.edgeDetection)}}var YQ={placement:`left-start`,strategy:`absolute`};Wt.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render(),t=JQ(this.options.nested);return[qQ({computePositionConfig:{...YQ,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t}).plugin]}});var XQ=20,ZQ=44,QQ=28;function $Q(e){if(!e)return`Select block`;if(e.type.name===`jsxComponent`){let t=e.attrs.componentName??``;if(t){let e=rM(t),n=e.name===`*`?t:e.displayName??e.name;if(n)return`Select ${n}`}}return`Select ${e.type.name}`}function e$(){let e=document.createElement(`div`);e.className=`ok-block-controls`,e.setAttribute(fF,`true`),e.style.visibility=`hidden`;let t=document.createElement(`button`);t.className=`ok-add-block-btn`,t.setAttribute(`aria-label`,`Add block below`),t.setAttribute(`type`,`button`),t.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,t.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()});let n=document.createElement(`button`);return n.className=`ok-drag-grip`,n.setAttribute(`type`,`button`),n.setAttribute(`aria-label`,`Select block`),n.setAttribute(`tabindex`,`-1`),n.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grip-vertical-icon lucide-grip-vertical"><circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/></svg>`,e.appendChild(t),e.appendChild(n),{container:e,addBtn:t,grip:n}}function t$(e,t,n){let{state:r,view:i}=e;if(n.type.name===`jsxComponent`){let i=n.attrs.componentName??``;if(i){let a=rM(i);if(a.emptyChildName){let i=t+1+n.content.size;if(i>r.doc.content.size)return;let o=a.emptyChildName;e.chain().focus().insertContentAt(i,lM(o)).run(),pM(e,i,rM(o));return}}}let a=t+n.nodeSize;if(a>r.doc.content.size)return;let{tr:o}=r,s=r.schema.nodes.paragraph?.create();if(!s)return;o.insert(a,s);let c=f.near(o.doc.resolve(a+1));o.setSelection(c).scrollIntoView(),i.dispatch(o),i.focus(),e.commands.insertContent(`/`)}var n$=Wt.create({name:`blockDragHandle`,addProseMirrorPlugins(){let e=this.editor,t=null,n=-1,{container:r,addBtn:i,grip:a}=e$();return i.addEventListener(`click`,()=>{t&&n>=0&&t$(e,n,t)}),a.addEventListener(`click`,()=>{if(n<0)return;let r=t,i=r?.type.name??`unknown`;try{e.chain().focus().setNodeSelection(n).run()||(Xt(i),console.warn(JSON.stringify({event:`block-grip-click-select-failed`,nodeType:i,componentName:String(r?.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){if(!(e instanceof RangeError))throw e;Xt(i),console.warn(JSON.stringify({event:`block-grip-click-select-failed`,nodeType:i,componentName:String(r?.attrs.componentName??``).slice(0,200),reason:e.message.slice(0,500)}))}}),[qQ({element:r,editor:e,onNodeChange({node:e,pos:r}){t=e,n=r??-1,a.setAttribute(`aria-label`,$Q(e))},computePositionConfig:{placement:`left-start`,strategy:`absolute`,middleware:[Ve(({rects:e})=>({mainAxis:10,crossAxis:((e.reference.height<=ZQ?e.reference.height:QQ)-XQ)/2}))]},nestedOptions:JQ(!1)}).plugin]}}),r$=/^#fn(?:ref)?-/,i$=Wt.create({name:`footnoteAnchorScroll`,addProseMirrorPlugins(){return[new S({props:{handleDOMEvents:{click(e,t){let n=t.target;if(!(n instanceof Element))return!1;let r=n.closest(`a[href^="#fn"]`);if(!(r instanceof HTMLAnchorElement))return!1;let i=r.getAttribute(`href`)??``;if(!r$.test(i))return!1;let a=i.slice(1);t.preventDefault();let o=e.dom.ownerDocument.getElementById(a);return o&&o.scrollIntoView({behavior:`smooth`,block:`start`}),!0}}}})]}}),a$=Wt.create({name:`formattingShortcuts`,addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}}}),o$=Wt.create({name:`headingAnchors`,addProseMirrorPlugins(){return[new S({props:{decorations(e){let t=[],n=new Map;return e.doc.descendants((e,r)=>{if(e.type.name===`heading`){let i=Qt(e.textContent,n);if(!i)return;t.push(ln.node(r,r+e.nodeSize,{id:i}))}}),ye.create(e.doc,t)}}})]}});function s$(e){let t=(0,J.c)(8),{node:n,editor:r}=e,i=n.attrs.src,a=n.attrs.alt,o=n.attrs.title,s;if(t[0]!==r||t[1]!==i){let e=r?qD(r)??void 0:void 0;s=typeof i==`string`?Fe(Ct(i,e)):void 0,t[0]=r,t[1]=i,t[2]=s}else s=t[2];let c=s,l=typeof a==`string`?a:``,u=typeof o==`string`?o:void 0,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={sizes:void 0},t[3]=d):d=t[3];let f;return t[4]!==l||t[5]!==c||t[6]!==u?(f=(0,X.jsx)(Yl,{as:`span`,"data-image-inline-zoom":!0,"data-clipboard-inline-leaf":`image`,children:(0,X.jsx)(Uk,{wrapElement:`span`,zoomMargin:20,zoomImg:d,children:(0,X.jsx)(`img`,{src:c,alt:l,title:u})})}),t[4]=l,t[5]=c,t[6]=u,t[7]=f):f=t[7],f}var c$=Me.extend({addNodeView(){return ru(s$)}}),l$=new class{byExt=new Map;viewerUnregisterFns=new WeakMap;register(e){let t=this.viewerUnregisterFns.get(e);if(t)return t;for(let t of e.exts){let n=t.toLowerCase(),r=this.byExt.get(n);r&&r!==e&&console.warn(JSON.stringify({event:`asset-viewer-collision`,ext:n,priorExts:r.exts,newExts:e.exts})),this.byExt.set(n,e)}let n=!1,r=()=>{if(!n){n=!0;for(let t of e.exts){let n=t.toLowerCase();this.byExt.get(n)===e&&this.byExt.delete(n)}this.viewerUnregisterFns.delete(e)}};return this.viewerUnregisterFns.set(e,r),r}lookup(e){let t=this.byExt.get(e.toLowerCase());return t?{ok:!0,viewer:t}:{ok:!1}}clearForTests(){this.byExt.clear(),this.viewerUnregisterFns=new WeakMap}get size(){return this.byExt.size}};function u$(e){globalThis.window?.open(e,`_blank`,`noopener,noreferrer`)}async function d$(e,t={}){let n=t.registry??l$,r=`desktopBridge`in t?t.desktopBridge:globalThis.window?.okDesktop,i=t.openUrl??u$;if(!e.forceOsDelegation){let t=n.lookup(e.ext);if(t.ok){t.viewer.render(e);return}}if(r){let t=await r.shell.openAsset(e.projectRelPath);t.ok||console.warn(`[asset-dispatch] openAsset refused:`,t.reason,{projectRelPath:e.projectRelPath,ext:e.ext});return}i(e.url)}function f$(e,t){let n=e;for(;n&&typeof n.hasAttribute==`function`;){if(n.hasAttribute(`data-wiki-embed`)){let e=n.getAttribute(`data-target`)??``;if(!e)return null;let r=_n(e,t);return r?{kind:n.tagName===`IMG`?`image`:`asset`,relPath:r,title:r.split(`/`).pop()??e}:null}if(n.hasAttribute(`data-wiki-link`)){let e=n.getAttribute(`data-target`)??``;return e?{kind:`wiki-link`,relPath:`${e}.md`,title:e}:null}if(n.tagName===`A`&&n.hasAttribute(`href`)){let e=oe(n.getAttribute(`href`)??``,t);if(e?.kind===`asset`){let n=_n(e.url,t);return n?{kind:`asset`,relPath:n,title:n.split(`/`).pop()??e.url}:null}}if(n.tagName===`IMG`){let e=n.getAttribute(`src`)??``;if(e){let n=oe(e,t);if(n?.kind===`asset`){let e=_n(n.url,t);return e?{kind:`image`,relPath:e,title:e.split(`/`).pop()??n.url}:null}}}n=n.parentElement}return null}var p$=new b(`asset-context-menu`);function m$(e){return new S({key:p$,view(t){let n=e.showAssetMenu??(e=>{let t=globalThis.window?.okDesktop;return t?t.shell.showAssetMenu({relPath:e.relPath,title:e.title,kind:e.kind}):Promise.resolve()}),r=t=>{if(!(t.target instanceof Element))return;let r=f$(t.target,e.sourceDocName);r&&(t.preventDefault(),n(r))};return t.dom.addEventListener(`contextmenu`,r),{destroy(){t.dom.removeEventListener(`contextmenu`,r)}}}})}var h$=e=>{let t=(0,J.c)(18),{kind:n,ariaLabel:r,onDeactivate:i,children:a,triggerReference:o,layout:s,className:c,"data-slot":l}=e,u=s===void 0?`standard`:s,d=(0,Y.useRef)(null),f,p;t[0]===o?(f=t[1],p=t[2]):(f=()=>{let e=d.current;if(e)return z(o,e,()=>{let t=o.getBoundingClientRect();e.isConnected&&(e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`)})},p=[o],t[0]=o,t[1]=f,t[2]=p),(0,Y.useLayoutEffect)(f,p);let m;t[3]===i?m=t[4]:(m=e=>{e||i()},t[3]=i,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(Sc,{asChild:!0,children:(0,X.jsx)(`span`,{ref:d,"aria-hidden":`true`,style:{position:`fixed`,pointerEvents:`none`,left:`-9999px`,top:`-9999px`,width:0,height:0}})}),t[5]=h):h=t[5];let g=u===`wide`?`w-[min(720px,calc(100%-1rem))]`:`w-80`,_;t[6]!==c||t[7]!==g?(_=vn(`ok-interaction-prop-panel pointer-events-auto p-3`,g,c),t[6]=c,t[7]=g,t[8]=_):_=t[8];let v;t[9]!==r||t[10]!==a||t[11]!==l||t[12]!==n||t[13]!==_?(v=(0,X.jsx)(xc,{side:`bottom`,align:`start`,sideOffset:8,collisionPadding:8,"aria-label":r,"data-ok-prop-panel":n,"data-slot":l,onOpenAutoFocus:g$,onCloseAutoFocus:_$,onPointerDownOutside:v$,onFocusOutside:y$,onInteractOutside:b$,className:_,children:a}),t[9]=r,t[10]=a,t[11]=l,t[12]=n,t[13]=_,t[14]=v):v=t[14];let y;return t[15]!==m||t[16]!==v?(y=(0,X.jsxs)(yc,{open:!0,onOpenChange:m,children:[h,v]}),t[15]=m,t[16]=v,t[17]=y):y=t[17],y};function g$(e){return e.preventDefault()}function _$(e){return e.preventDefault()}function v$(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function y$(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function b$(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function x$(e){let t=e.trim();return/\.(md|mdx)$/i.test(t)?t:`${t}.md`}function S$(e){let t=e.initialDir.trim().replace(/^\/+|\/+$/g,``),n=x$(e.suggestedName);return t?`${t}/${n}`:n}async function C$(e){let t=await hx(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create page`);if(!t.ok)throw Error(t.title);let n=e.replace(/\.(mdx|md)$/i,``);return{docName:gx(cn,t.body,`create-page`,{docName:n}).docName}}async function w$(e){return C$(S$(e))}async function T$(e,t){let{docName:n}=await w$(e);return t.addPage(n),Ft([`files`,`backlinks`,`graph`]),t.onCreated?.(n),{docName:n}}var E$=8;function D$(e){return e.trim().replace(/^\/+/,``).replace(/\.mdx?$/i,``).replace(/\/+$/g,``)}function O$(e){return k$(e)?D$(e.slice(1)).toLowerCase():null}function k$(e){return e.startsWith(`/`)&&!e.startsWith(`//`)}function A$(e){return e.split(`/`).at(-1)??e}function j$(e,t){if(!t)return 0;let n=e.toLowerCase(),r=A$(e).toLowerCase();return n===t?0:r===t?1:n.startsWith(t)?2:r.startsWith(t)?3:r.includes(t)?4:n.includes(t)?5:null}function M$(e){switch(e){case`page`:return 0;case`folder`:return 1;case`asset`:return 2}}function N$(e){let t=[],n=new Set;function r(e,r){let i=D$(r);if(!i)return;let a=`${e}:${i.toLowerCase()}`;n.has(a)||(n.add(a),t.push({kind:e,path:i}))}for(let t of e.pages)r(`page`,t);for(let t of e.folderPaths??[])r(`folder`,t);if(e.includeAssets)for(let t of e.assetPaths??[])r(`asset`,t);return t}function P$(e){let t=O$(e.value);if(t===null)return[];let n=[];for(let r of N$(e)){let e=j$(r.path,t);e!==null&&n.push({suggestion:r,score:e})}return n.sort((e,t)=>{if(e.score!==t.score)return e.score-t.score;let n=M$(e.suggestion.kind)-M$(t.suggestion.kind);return n===0?e.suggestion.path.localeCompare(t.suggestion.path):n}),n.slice(0,e.limit??E$).map(e=>e.suggestion)}var F$=`[data-ok-link-path-suggestion-panel]`;function I$(e){return e instanceof Element&&e.closest(F$)!==null}function L$(e){I$(e.target)&&e.preventDefault()}function R$(e){switch(e){case`page`:return(0,X.jsx)($i,{className:`size-3.5 shrink-0`,"aria-hidden":`true`});case`folder`:return(0,X.jsx)(ia,{className:`size-3.5 shrink-0`,"aria-hidden":`true`});case`asset`:return(0,X.jsx)(Da,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})}}function z$(e,t){if(e){if(typeof e==`function`){e(t);return}e.current=t}}function B$(e){let t=(0,J.c)(54),n,r,a,o,s,l,u,d,f,p,m,h,g,_;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14]):({value:_,pages:p,folderPaths:a,assetPaths:n,includeAssets:h,loading:g,onValueChange:f,onKeyDown:u,onSuggestionSelect:d,onFocus:l,onBlur:s,className:r,ref:m,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_);let v=h===void 0?!1:h,y=g===void 0?!1:g,{_:b}=i(),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(0),D=(0,Y.useRef)(null),O=(0,Y.useRef)(null),k=(0,Y.useId)(),A;t[15]===_?A=t[16]:(A=_.trim(),t[15]=_,t[16]=A);let j=A===``,M=P$({value:j?`/`:_,pages:p,folderPaths:a,assetPaths:n,includeAssets:v}),N=M.map(G$).join(`\0`),P;t[17]===_?P=t[18]:(P=k$(_),t[17]=_,t[18]=P);let F=j||P,I=M.length>0,L=x&&!C&&F&&(I||y)||x&&!C&&F&&!y&&!I,R=Math.min(T,Math.max(M.length-1,0)),B=I?`${k}-option-${R}`:void 0,V;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{E(0)},t[19]=V):V=t[19],(0,Y.useEffect)(V,[N]);let H,U;t[20]!==B||t[21]!==L?(H=()=>{!L||!B||document.getElementById(B)?.scrollIntoView?.({block:`nearest`})},U=[B,L],t[20]=B,t[21]=L,t[22]=H,t[23]=U):(H=t[22],U=t[23]),(0,Y.useEffect)(H,U);let te,ne;t[24]===L?(te=t[25],ne=t[26]):(te=()=>{if(!L)return;let e=D.current,t=O.current;if(!e||!t)return;let n=e,r=t,i=function(){Bt(n,r,{placement:`bottom-start`,strategy:`fixed`,middleware:[Ve(4),ee({padding:8}),me({padding:8}),c({padding:8,apply(e){let{availableHeight:t,availableWidth:n,elements:r}=e;Object.assign(r.floating.style,{width:`${Math.min(480,n)}px`,maxHeight:`${Math.min(208,Math.max(96,t))}px`})}})]}).then(e=>{let{x:t,y:n}=e;r.isConnected&&Object.assign(r.style,{left:`${t}px`,top:`${n}px`})}).catch(e=>{r.isConnected&&console.warn(`[LinkPathSuggestionInput] computePosition failed`,e)})},a=z(n,r,i);return i(),a},ne=[L],t[24]=L,t[25]=te,t[26]=ne),(0,Y.useLayoutEffect)(te,ne);let re;t[27]===m?re=t[28]:(re=function(e){D.current=e,z$(m,e)},t[27]=m,t[28]=re);let ie=re,ae=function(e){d?d(e):f(e.path),w(!0),requestAnimationFrame(()=>D.current?.focus())},W=function(e){if(I){if(e.key===`ArrowDown`){e.preventDefault(),E(e=>Math.min(e+1,M.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),E(W$);return}if(e.key===`Enter`){e.preventDefault();let t=M[R];t&&ae(t);return}if(e.key===`Escape`){e.preventDefault(),w(!0);return}}if(L&&e.key===`Escape`){e.preventDefault(),w(!0);return}u?.(e)},oe;t[29]===b?oe=t[30]:(oe=function(e){switch(e){case`page`:return b({id:`6WdDG7`});case`folder`:return b({id:`kNqMMd`});case`asset`:return b({id:`bUUVED`})}},t[29]=b,t[30]=oe);let se=oe,G=L?(0,X.jsx)(`div`,{ref:O,id:k,role:`listbox`,"aria-label":b({id:`mBltnd`}),"data-ok-layer-spawned":``,"data-ok-link-path-suggestion-panel":``,className:`fixed z-70 max-h-52 overflow-y-auto overscroll-y-contain rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md subtle-scrollbar pointer-events-auto`,onWheel:U$,onTouchMove:H$,children:I?M.map((e,t)=>{let n=t===R,r=se(e.kind);return(0,X.jsxs)(Mn,{id:`${k}-option-${t}`,type:`button`,role:`option`,"aria-label":`/${e.path} ${r}`,"aria-selected":n,variant:`ghost`,className:vn(`h-auto w-full justify-start gap-2 rounded-sm px-2 py-1.5 text-left font-normal`,n&&`bg-accent text-accent-foreground`),onMouseDown:V$,onClick:()=>ae(e),children:[R$(e.kind),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[`/`,e.path]}),(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:r})]},`${e.kind}:${e.path}`)}):(0,X.jsx)(`div`,{role:`status`,className:`px-2 py-1.5 text-muted-foreground text-sm`,children:b(y?{id:`sxTdZI`}:{id:`_QwkMu`})})}):null,ce;t[31]===f?ce=t[32]:(ce=e=>{w(!1),f(e.target.value)},t[31]=f,t[32]=ce);let le;t[33]===l?le=t[34]:(le=e=>{S(!0),l?.(e)},t[33]=l,t[34]=le);let ue;t[35]===s?ue=t[36]:(ue=e=>{S(!1),s?.(e)},t[35]=s,t[36]=ue);let de=L?k:void 0,fe;t[37]!==B||t[38]!==r||t[39]!==W||t[40]!==o||t[41]!==ie||t[42]!==L||t[43]!==ce||t[44]!==le||t[45]!==ue||t[46]!==de||t[47]!==_?(fe=(0,X.jsx)(ir,{...o,ref:ie,value:_,onChange:ce,onFocus:le,onBlur:ue,onKeyDown:W,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":L,"aria-controls":de,"aria-activedescendant":B,autoComplete:`off`,className:r}),t[37]=B,t[38]=r,t[39]=W,t[40]=o,t[41]=ie,t[42]=L,t[43]=ce,t[44]=le,t[45]=ue,t[46]=de,t[47]=_,t[48]=fe):fe=t[48];let pe;t[49]===G?pe=t[50]:(pe=G&&(0,Qa.createPortal)(G,document.body),t[49]=G,t[50]=pe);let he;return t[51]!==fe||t[52]!==pe?(he=(0,X.jsxs)(`div`,{className:`relative`,children:[fe,pe]}),t[51]=fe,t[52]=pe,t[53]=he):he=t[53],he}function V$(e){return e.preventDefault()}function H$(e){e.stopPropagation()}function U$(e){e.stopPropagation()}function W$(e){return Math.max(e-1,0)}function G$(e){return`${e.kind}:${e.path}`}var K$=1500;function q$(e){let t=(0,J.c)(15),{copyContent:n}=e,[r,i]=(0,Y.useState)(!1),a=(0,Y.useRef)(null),o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{a.current!==null&&clearTimeout(a.current)},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,Y.useEffect)(o,s);let c;t[2]===n?c=t[3]:(c=()=>{try{typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(n).then(()=>{i(!0),a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>i(!1),K$)},J$)}catch{}},t[2]=n,t[3]=c);let l=c,u=r?`Copied!`:`Copy`,d;t[4]===r?d=t[5]:(d=r?(0,X.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}):(0,X.jsx)(qi,{className:`size-3.5`,"aria-hidden":`true`}),t[4]=r,t[5]=d);let f;t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":u,onClick:l,"data-slot":`prop-panel-copy`,children:d})}),t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9];let p=r?`Copied!`:`Copy`,m;t[10]===p?m=t[11]:(m=(0,X.jsx)(F,{children:p}),t[10]=p,t[11]=m);let h;return t[12]!==f||t[13]!==m?(h=(0,X.jsxs)(w,{children:[f,m]}),t[12]=f,t[13]=m,t[14]=h):h=t[14],h}function J$(){}function Y$(e,t){return SO.getState(e)?.byId.get(t)??null}function X$(e){let{editor:t,layer:n,renderPropPanel:r,handlePrimary:i}=e;return{onRegister:e=>{n.register({type:e.markType,nodeId:e.id,controls:{propPanel:e=>r({editor:t,nodeId:e.nodeId,deactivate:e.deactivate})},handlePrimary:i?e=>i({editor:t,nodeId:e.nodeId,newTab:e.newTab}):void 0})},onDeregister:e=>{n.deregister(e)}}}function Z$(e){let{editor:t,layer:n,markTypes:r,predicate:i,renderPropPanel:a,handlePrimary:o}=e,s=X$({editor:t,layer:n,renderPropPanel:a,handlePrimary:o});return DO({markTypes:[...r],predicate:i,onRegister:s.onRegister,onDeregister:s.onDeregister})}function Q$(e){let t=VO(e.editor);return Z$({...e,layer:t})}function $$(e,t){let n=(0,J.c)(4),[r,i]=(0,Y.useState)(null),a,o;return n[0]!==e||n[1]!==t?(a=()=>{if(!t||!e){i(null);return}let n=!1;return i(null),MX(e).then(e=>{n||i(e)}).catch(()=>{n||i([])}),()=>{n=!0}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Y.useEffect)(a,o),r}function e1(e,t){let n=e.trim();return n?n.startsWith(`#`)?`anchor`:mn(n)?`external`:`doc`:t}function t1(e){return e?.kind===`doc`?`doc`:e?.kind===`anchor`?`anchor`:`external`}function n1(e){let t=(0,J.c)(84),{open:n,href:r,text:a,pages:s,folderPaths:c,loading:l,onOpenChange:u,onSave:d}=e,[f,p]=(0,Y.useState)(``),[m,h]=(0,Y.useState)(``),[g,_]=(0,Y.useState)(``),[v,y]=(0,Y.useState)(`doc`),b=(0,Y.useId)(),x=(0,Y.useId)(),S=(0,Y.useId)(),C=(0,Y.useId)(),{_:w}=i(),T=(0,Y.useRef)(!1),E=(0,Y.useRef)(``),D,O;t[0]!==r||t[1]!==n||t[2]!==a?(D=()=>{if(!n){T.current=!1;return}if(T.current)return;T.current=!0,E.current=a,_(a);let e=KY(r);if(y(t1(e)),e?.kind===`doc`){p(e.docName),h(e.anchor??``);return}if(e?.kind===`anchor`){p(`#${e.anchor}`),h(``);return}p(e?.kind===`external`?e.url:r),h(``)},O=[n,r,a],t[0]=r,t[1]=n,t[2]=a,t[3]=D,t[4]=O):(D=t[3],O=t[4]),(0,Y.useEffect)(D,O);let k,A,j;t[5]!==v||t[6]!==f||t[7]!==s?(k=at(f),A=v===`doc`,j=A&&aO(k,s),t[5]=v,t[6]=f,t[7]=s,t[8]=k,t[9]=A,t[10]=j):(k=t[8],A=t[9],j=t[10]);let M=$$(k,j&&n),N=!!M?.length,P;t[11]!==k||t[12]!==A||t[13]!==m||t[14]!==g||t[15]!==f||t[16]!==u||t[17]!==d?(P=function(){let e=f.trim();e&&(d(A?tX(k,m.trim()||null):e,g,g.trim()!==E.current.trim()),u(!1))},t[11]=k,t[12]=A,t[13]=m,t[14]=g,t[15]=f,t[16]=u,t[17]=d,t[18]=P):P=t[18];let F=P,I;t[19]===F?I=t[20]:(I=function(e){e.key===`Enter`&&(e.preventDefault(),F())},t[19]=F,t[20]=I);let L=I,ee;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(e){p(e.path),y(`doc`),h(``)},t[21]=ee):ee=t[21];let R=ee,z;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(Bn,{children:(0,X.jsx)(o,{id:`B11p-O`})}),t[22]=z):z=t[22];let B;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,X.jsxs)(Qn,{children:[z,(0,X.jsx)(Rn,{children:(0,X.jsx)(o,{id:`RobAKV`})})]}),t[23]=B):B=t[23];let V;t[24]===A?V=t[25]:(V=A?(0,X.jsx)(o,{id:`6WdDG7`}):(0,X.jsx)(o,{id:`6vEr3W`}),t[24]=A,t[25]=V);let H;t[26]!==V||t[27]!==b?(H=(0,X.jsx)(`label`,{className:`mb-1.5 inline-block text-sm font-medium`,htmlFor:b,children:V}),t[26]=V,t[27]=b,t[28]=H):H=t[28];let U;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{p(e),y(t=>e1(e,t))},t[29]=U):U=t[29];let te;t[30]===w?te=t[31]:(te=w({id:`Xl-UUg`}),t[30]=w,t[31]=te);let ne;t[32]!==f||t[33]!==c||t[34]!==L||t[35]!==l||t[36]!==s||t[37]!==te||t[38]!==b?(ne=(0,X.jsx)(B$,{id:b,value:f,pages:s,folderPaths:c,loading:l,onValueChange:U,onSuggestionSelect:R,placeholder:te,autoFocus:!0,onKeyDown:L}),t[32]=f,t[33]=c,t[34]=L,t[35]=l,t[36]=s,t[37]=te,t[38]=b,t[39]=ne):ne=t[39];let re;t[40]!==H||t[41]!==ne?(re=(0,X.jsxs)(`div`,{children:[H,ne]}),t[40]=H,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,X.jsx)(o,{id:`QqBQu1`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[43]=ie):ie=t[43];let ae;t[44]===S?ae=t[45]:(ae=(0,X.jsx)(`label`,{className:`mb-1.5 inline-block text-sm font-medium`,htmlFor:S,children:ie}),t[44]=S,t[45]=ae);let W;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>_(e.target.value),t[46]=W):W=t[46];let oe;t[47]===w?oe=t[48]:(oe=w({id:`yYR6za`}),t[47]=w,t[48]=oe);let se;t[49]!==g||t[50]!==L||t[51]!==S||t[52]!==oe?(se=(0,X.jsx)(ir,{id:S,value:g,onChange:W,placeholder:oe,onKeyDown:L}),t[49]=g,t[50]=L,t[51]=S,t[52]=oe,t[53]=se):se=t[53];let G;t[54]!==ae||t[55]!==se?(G=(0,X.jsxs)(`div`,{children:[ae,se]}),t[54]=ae,t[55]=se,t[56]=G):G=t[56];let ce;t[57]!==w||t[58]!==x||t[59]!==A||t[60]!==m||t[61]!==L||t[62]!==C||t[63]!==M||t[64]!==N?(ce=A?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{className:`mb-1.5 inline-block text-sm font-medium`,htmlFor:x,children:(0,X.jsx)(o,{id:`Tjc1pH`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}})}),(0,X.jsx)(ir,{id:x,value:m,onChange:e=>h(e.target.value),placeholder:w({id:`W-ntoW`}),onKeyDown:L}),N?(0,X.jsx)(`div`,{id:C,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:M.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":m===e.slug,className:vn(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,m===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>h(m===e.slug?``:e.slug),children:[(0,X.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,X.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.slug}-${e.level}-${e.text}`))}):null]}):null,t[57]=w,t[58]=x,t[59]=A,t[60]=m,t[61]=L,t[62]=C,t[63]=M,t[64]=N,t[65]=ce):ce=t[65];let le;t[66]!==re||t[67]!==G||t[68]!==ce?(le=(0,X.jsxs)(Jn,{className:`space-y-6 pb-1`,children:[re,G,ce]}),t[66]=re,t[67]=G,t[68]=ce,t[69]=le):le=t[69];let ue;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,X.jsx)(Zn,{asChild:!0,children:(0,X.jsx)(Mn,{variant:`outline`,children:(0,X.jsx)(o,{id:`dEgA5A`})})}),t[70]=ue):ue=t[70];let de;t[71]===f?de=t[72]:(de=f.trim(),t[71]=f,t[72]=de);let fe=!de,pe;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,X.jsx)(o,{id:`tfDRzk`}),t[73]=pe):pe=t[73];let me;t[74]!==F||t[75]!==fe?(me=(0,X.jsxs)(Yn,{children:[ue,(0,X.jsx)(Mn,{onClick:F,disabled:fe,children:pe})]}),t[74]=F,t[75]=fe,t[76]=me):me=t[76];let he;t[77]!==le||t[78]!==me?(he=(0,X.jsxs)(Gn,{className:`sm:max-w-xl`,"data-ok-layer-spawned":``,onPointerDownOutside:L$,onFocusOutside:L$,onInteractOutside:L$,children:[B,le,me]}),t[77]=le,t[78]=me,t[79]=he):he=t[79];let ge;return t[80]!==u||t[81]!==n||t[82]!==he?(ge=(0,X.jsx)($n,{open:n,onOpenChange:u,children:he}),t[80]=u,t[81]=n,t[82]=he,t[83]=ge):ge=t[83],ge}function r1(e){let t=(0,J.c)(99),{editor:n,nodeId:r,sourceDocName:a,onClose:s,onNavigate:c}=e,l=Y$(n.state,r),u=l?.attrs?.href??``,[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(!1),h;t[0]!==r||t[1]!==f?(h=()=>{xO(r)&&f(!0)},t[0]=r,t[1]=f,t[2]=h):h=t[2];let g;t[3]===r?g=t[4]:(g=[r],t[3]=r,t[4]=g),(0,Y.useEffect)(h,g);let{addPage:_,folderPaths:v,pages:y,loading:b}=Ut(),{_:x}=i();if(!l)return null;let S=n.state.doc.textBetween(l.from,l.to),C=u?oe(u,a):null,T;t[5]!==n||t[6]!==r?(T=function(e,t,i){let a=Y$(n.state,r);if(!a)return;let o=t.trim();if(!i||!o){n.chain().setTextSelection({from:a.from,to:a.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:e}).run();return}let s=n.schema.marks.link;if(!s)return;let c=s.create({href:e}),l=n.schema.text(o,[c]);n.view.dispatch(n.state.tr.replaceWith(a.from,a.to,l))},t[5]=n,t[6]=r,t[7]=T):T=t[7];let E=T,D;t[8]!==n||t[9]!==r||t[10]!==s?(D=function(){let e=Y$(n.state,r);e&&(n.chain().focus().setTextSelection({from:e.from,to:e.to}).extendMarkRange(`link`).unsetLink().run(),s())},t[8]=n,t[9]=r,t[10]=s,t[11]=D):D=t[11];let O=D,k;t[12]!==n||t[13]!==r||t[14]!==s||t[15]!==f?(k=function(e){if(e){f(!0);return}let t=Y$(n.state,r);if(t?.attrs?.href??``){f(!1);return}t&&n.chain().focus().deleteRange({from:t.from,to:t.to}).run(),s()},t[12]=n,t[13]=r,t[14]=s,t[15]=f,t[16]=k):k=t[16];let A=(0,X.jsx)(n1,{open:d,href:u,text:S,pages:y,folderPaths:v,loading:b,onOpenChange:u?f:k,onSave:E});if(!u)return(0,X.jsx)(X.Fragment,{children:A});let j=C?.kind===`doc`?`${C.docName}${C.anchor?`#${C.anchor}`:``}`:C?.kind===`anchor`?`#${C.anchor}`:C?.kind===`external`?C.url:u,M=function(e){let t=Y$(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:tX(e,C?.kind===`doc`?C.anchor??null:null)}).run()},N,P=!1,I=!1,L=null;if(b){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(xa,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[17]=e):e=t[17],N={icon:e,text:x({id:`yQE2r9`}),className:`text-muted-foreground/80`}}else if(C?.kind===`asset`){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[18]=e):e=t[18],N={icon:e,text:x({id:`yWWThY`}),className:`text-muted-foreground`}}else if(C?.kind===`external`){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(R,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[19]=e):e=t[19],N={icon:e,text:x({id:`zgSFyG`}),className:`text-muted-foreground`}}else if(C?.kind===`anchor`){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[20]=e):e=t[20],N={icon:e,text:x({id:`dprWmL`}),className:`text-muted-foreground`}}else if(C?.kind===`doc`){let e=LY(C.docName,{pages:y,folderPaths:v});if(I=e.kind===`navigate`&&e.displayState===`folder`,P=e.kind===`create`,L=e.kind===`create`?{initialDir:e.initialDir,suggestedName:e.suggestedName}:null,I){let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ia,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[21]=e):e=t[21],N={icon:e,text:x({id:`kNqMMd`}),className:`text-muted-foreground`}}else if(P){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[22]=e):e=t[22],N={icon:e,text:x({id:`8F1i42`}),className:`text-red-700 dark:text-red-300`}}else{let e;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[23]=e):e=t[23],N={icon:e,text:x({id:`JtD-Br`}),className:`text-muted-foreground`}}}else{let e;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[24]=e):e=t[24],N={icon:e,text:x({id:`-g6KIS`}),className:`text-muted-foreground/80`}}let ee=C?.kind===`external`,z=C?.kind===`doc`?qY({docName:C.docName,anchor:C.anchor}):C?.kind===`anchor`?qY({docName:a,anchor:C.anchor}):C?.kind===`external`&&WY(C.url)?C.url:null,B=!b&&z!==null&&(C?.kind===`anchor`||C?.kind===`external`||C?.kind===`doc`&&!P&&!I),V;t[25]!==n.state||t[26]!==n.view||t[27]!==r?(V=()=>{let e=Y$(n.state,r);if(!e)return new DOMRect;try{return rn(n.view,e.from,e.to)}catch{return new DOMRect}},t[25]=n.state,t[26]=n.view,t[27]=r,t[28]=V):V=t[28];let H;t[29]!==n.view.dom||t[30]!==V?(H={getBoundingClientRect:V,contextElement:n.view.dom},t[29]=n.view.dom,t[30]=V,t[31]=H):H=t[31];let U=H,te;t[32]!==x||t[33]!==_||t[34]!==p||t[35]!==L||t[36]!==s||t[37]!==M?(te=async function(){if(!(!L||p)){m(!0);try{await T$(L,{addPage:_,onCreated(e){M(e),window.location.hash=`#/${e}`,s()}}),m(!1)}catch(e){let t=e;nr.error(t instanceof Error?t.message:x({id:`tfi40B`})),m(!1)}}},t[32]=x,t[33]=_,t[34]=p,t[35]=L,t[36]=s,t[37]=M,t[38]=te):te=t[38];let ne=te,re=vn(`flex shrink-0`,N.className),ie;t[39]!==N.icon||t[40]!==re?(ie=(0,X.jsx)(`span`,{className:re,children:N.icon}),t[39]=N.icon,t[40]=re,t[41]=ie):ie=t[41];let ae=ie,W;t[42]!==ae||t[43]!==P||t[44]!==N.text?(W=P?(0,X.jsxs)(w,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(`span`,{className:`flex shrink-0`,"data-slot":`internal-link-prop-panel-icon-trigger`,children:ae})}),(0,X.jsx)(F,{children:N.text})]}):ae,t[42]=ae,t[43]=P,t[44]=N.text,t[45]=W):W=t[45];let se=W,G=`${N.text}: ${j}`,ce;t[46]!==j||t[47]!==ee||t[48]!==P||t[49]!==z||t[50]!==B||t[51]!==s||t[52]!==c?(ce=(0,X.jsx)(_e,{asChild:!0,children:B?(0,X.jsx)(`a`,{href:z??void 0,...ee?{target:`_blank`,rel:`noopener noreferrer`}:{},onClick:e=>QY(e,c,s),"data-slot":`internal-link-prop-panel-text`,className:`block truncate text-sm font-medium text-foreground underline-offset-2 hover:underline focus-visible:underline`,children:j}):(0,X.jsx)(`span`,{"data-slot":`internal-link-prop-panel-text`,className:vn(`block truncate text-sm font-medium`,P?`text-muted-foreground`:`text-foreground`),children:j})}),t[46]=j,t[47]=ee,t[48]=P,t[49]=z,t[50]=B,t[51]=s,t[52]=c,t[53]=ce):ce=t[53];let le;t[54]===j?le=t[55]:(le=(0,X.jsx)(F,{className:`max-w-80 break-all`,children:j}),t[54]=j,t[55]=le);let ue;t[56]!==ce||t[57]!==le?(ue=(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,X.jsxs)(w,{children:[ce,le]})}),t[56]=ce,t[57]=le,t[58]=ue):ue=t[58];let de;t[59]!==ne||t[60]!==p||t[61]!==P?(de=P?(0,X.jsxs)(Mn,{type:`button`,size:`sm`,variant:`link`,disabled:p,onClick:()=>void ne(),"data-slot":`internal-link-prop-panel-create`,className:`flex items-center text-foreground`,children:[(0,X.jsx)(ka,{className:`size-3.5`,"aria-hidden":`true`}),p?(0,X.jsx)(o,{id:`HM56Bx`}):(0,X.jsx)(o,{id:`XRuL0i`})]}):null,t[59]=ne,t[60]=p,t[61]=P,t[62]=de):de=t[62];let fe;t[63]===x?fe=t[64]:(fe=x({id:`ePK91l`}),t[63]=x,t[64]=fe);let pe;t[65]===f?pe=t[66]:(pe=()=>f(!0),t[65]=f,t[66]=pe);let me;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,X.jsx)(Oa,{className:`size-3.5`,"aria-hidden":`true`}),t[67]=me):me=t[67];let he;t[68]!==fe||t[69]!==pe?(he=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":fe,onClick:pe,"data-slot":`internal-link-prop-panel-edit`,children:me})}),t[68]=fe,t[69]=pe,t[70]=he):he=t[70];let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`ePK91l`})}),t[71]=ge):ge=t[71];let ve;t[72]===he?ve=t[73]:(ve=(0,X.jsxs)(w,{children:[he,ge]}),t[72]=he,t[73]=ve);let ye;t[74]===u?ye=t[75]:(ye=(0,X.jsx)(q$,{copyContent:u}),t[74]=u,t[75]=ye);let be;t[76]===x?be=t[77]:(be=x({id:`t_YqKh`}),t[76]=x,t[77]=be);let xe;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,X.jsx)(Ha,{className:`size-3.5`,"aria-hidden":`true`}),t[78]=xe):xe=t[78];let Se;t[79]!==O||t[80]!==be?(Se=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":be,onClick:O,"data-slot":`internal-link-prop-panel-remove`,children:xe})}),t[79]=O,t[80]=be,t[81]=Se):Se=t[81];let Ce;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`t_YqKh`})}),t[82]=Ce):Ce=t[82];let we;t[83]===Se?we=t[84]:(we=(0,X.jsxs)(w,{children:[Se,Ce]}),t[83]=Se,t[84]=we);let Te;t[85]!==de||t[86]!==ve||t[87]!==ye||t[88]!==we?(Te=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[de,ve,ye,we]}),t[85]=de,t[86]=ve,t[87]=ye,t[88]=we,t[89]=Te):Te=t[89];let Ee;t[90]!==se||t[91]!==ue||t[92]!==Te?(Ee=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[se,ue,Te]}),t[90]=se,t[91]=ue,t[92]=Te,t[93]=Ee):Ee=t[93];let De;return t[94]!==s||t[95]!==G||t[96]!==Ee||t[97]!==U?(De=(0,X.jsx)(h$,{kind:`internal-link`,ariaLabel:G,onDeactivate:s,triggerReference:U,className:`w-96`,children:Ee}),t[94]=s,t[95]=G,t[96]=Ee,t[97]=U,t[98]=De):De=t[98],(0,X.jsxs)(X.Fragment,{children:[A,De]})}new b(`markIdentityDecoration`);var i1=`data-mark-id`,a1=new b(`linkResolutionDecoration`);function o1(e,t,n,r,i){if(t.size===0)return null;let a=[];for(let e of t.values()){if(!n.has(e.markType))continue;let t=r(e,i),o={[i1]:e.id};t!==null&&Object.assign(o,t),a.push(ln.inline(e.from,e.to,o))}return a.length===0?null:ye.create(e,a)}function s1(e){let t=new Set(e.markTypes),{computeAttrs:n}=e;return new S({key:a1,state:{init:()=>({version:0}),apply(e,t){let n=e.getMeta(a1);return n&&typeof n==`object`&&n.refresh?{version:t.version+1}:t}},props:{decorations(e){let r=SO.getState(e);if(!r)return null;let i=nn();return o1(e.doc,r.byId,t,n,i)}},view(e){Z(`ok/render/decoration-merge`,{markTypes:Array.from(t).join(`,`)},{startTime:performance.now(),duration:0});let n=dn(()=>{e.dispatch(e.state.tr.setMeta(a1,{refresh:!0}))});return{destroy(){n()}}}})}var c1=ke.extend({addOptions(){return{...this.parent?.(),docName:``}},renderHTML({HTMLAttributes:e}){let t=typeof e.href==`string`?e.href:``;return[`span`,Ge(e,{"data-link":``,role:`link`,tabindex:`0`,"aria-label":t?`Link: ${t}`:`Link`,style:`touch-action: manipulation;`}),0]},addProseMirrorPlugins(){let e=this.options.docName??``,t=({editor:t,nodeId:n,newTab:r})=>{let i=Y$(t.state,n),a=i?.attrs?.href;if(typeof a!=`string`||!a)return!1;let o=i?.attrs?.sourceForm,s=oe(a,e),c=Ue(a);if(s?.kind===`asset`||o===`wikiembed`&&c!==null){let t=s?.kind===`asset`?s.url:a,n=s?.kind===`asset`?s.ext:c??``,i=_n(t,e);if(!i)return!1;let o=nn();return o===null||o.assetPaths!==void 0&&!zY(t,e,o.assetPaths)?!1:(d$({url:t,projectRelPath:i,ext:n,title:i.split(`/`).pop()??t,forceOsDelegation:r}),!0)}if(!s)return!1;switch(s.kind){case`doc`:{let e=nn(),t=LY(s.docName,{pages:e?.pages??new Set,folderPaths:e?.folderPaths??new Set});return t.kind===`create`||t.kind===`navigate`&&t.displayState===`folder`?!1:(r?XY({docName:s.docName,anchor:s.anchor}):window.location.assign(qY({docName:s.docName,anchor:s.anchor})),!0)}case`anchor`:return r?XY({docName:e,anchor:s.anchor}):window.location.assign(qY({docName:e,anchor:s.anchor})),!0;case`external`:return WY(s.url)?(JY(s.url),!0):!1;default:return be(s)}};return[Q$({editor:this.editor,markTypes:[`link`],renderPropPanel:({editor:n,nodeId:r,deactivate:i})=>(0,Y.createElement)(r1,{editor:n,nodeId:r,sourceDocName:e,onClose:i,onNavigate:e=>t({editor:n,nodeId:r,newTab:e})}),handlePrimary:t}),s1({markTypes:[`link`],computeAttrs:HY(e)}),m$({sourceDocName:e})]}}),l1=(0,Y.createContext)(null),u1={didCatch:!1,error:null},d1=class extends Y.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=u1}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(u1))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&f1(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(u1))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,Y.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,Y.createElement)(l1.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function f1(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function p1(e){let t=(0,J.c)(23),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({label:i,Icon:n,onClick:a,selected:s,className:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=s?`true`:void 0,l;t[7]===a?l=t[8]:(l=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=l);let u;t[9]===r?u=t[10]:(u=vn(`flex w-full items-center justify-center gap-2 rounded-md border border-dashed border-border bg-transparent px-3 py-2 text-center text-sm text-muted-foreground transition-colors hover:bg-muted/50 cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,r),t[9]=r,t[10]=u);let d;t[11]===n?d=t[12]:(d=(0,X.jsx)(n,{size:16,"aria-hidden":`true`}),t[11]=n,t[12]=d);let f;t[13]===i?f=t[14]:(f=(0,X.jsx)(`span`,{children:i}),t[13]=i,t[14]=f);let p;return t[15]!==a||t[16]!==o||t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==d||t[21]!==f?(p=(0,X.jsxs)(`div`,{...o,role:`button`,tabIndex:-1,contentEditable:!1,"data-descriptor-placeholder":``,"data-selected":c,onClick:a,onMouseDown:m1,onKeyDown:l,className:u,children:[d,f]}),t[15]=a,t[16]=o,t[17]=c,t[18]=l,t[19]=u,t[20]=d,t[21]=f,t[22]=p):p=t[22],p}function m1(e){e.preventDefault(),e.stopPropagation()}function h1(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Gs,{"data-slot":`select`,...n}),t[2]=n,t[3]=r),r}function g1(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(qs,{"data-slot":`select-value`,...n}),t[2]=n,t[3]=r),r}function _1(e){let t=(0,J.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=vn(`flex w-full items-center justify-between gap-2 rounded-lg border border-input bg-background text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=default]:px-2.5 data-[size=sm]:px-2 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(Js,{asChild:!0,children:(0,X.jsx)(Ri,{className:`size-4 opacity-50`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,X.jsxs)(Ks,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function v1(e){let t=(0,J.c)(20),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,position:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`popper`:a,s=o===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,c;t[5]!==r||t[6]!==s?(c=vn(`relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-md outline-hidden duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[align-trigger=true]:animate-none motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,s,r),t[5]=r,t[6]=s,t[7]=c):c=t[7];let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(b1,{}),t[8]=l):l=t[8];let u=o===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`,d;t[9]===u?d=t[10]:(d=vn(`p-1`,u),t[9]=u,t[10]=d);let f;t[11]!==n||t[12]!==d?(f=(0,X.jsx)(Zs,{className:d,children:n}),t[11]=n,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(x1,{}),t[14]=p):p=t[14];let m;return t[15]!==o||t[16]!==i||t[17]!==c||t[18]!==f?(m=(0,X.jsx)(Ys,{children:(0,X.jsxs)(Xs,{"data-slot":`select-content`,"data-ok-layer-spawned":``,position:o,className:c,...i,children:[l,f,p]})}),t[15]=o,t[16]=i,t[17]=c,t[18]=f,t[19]=m):m=t[19],m}function y1(e){let t=(0,J.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=vn(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,X.jsx)(ec,{children:(0,X.jsx)(tr,{className:`size-4`})})}),t[6]=o):o=t[6];let s;t[7]===n?s=t[8]:(s=(0,X.jsx)($s,{children:n}),t[7]=n,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,X.jsxs)(Qs,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function b1(e){let t=(0,J.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=vn(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(zi,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(tc,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function x1(e){let t=(0,J.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=vn(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Ri,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(nc,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function S1(e){let t=(0,J.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=vn(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 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 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(hc,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`}),t[6]=s):s=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==o?(c=(0,X.jsx)(mc,{"data-slot":`switch`,"data-size":a,className:o,...r,children:s}),t[7]=r,t[8]=a,t[9]=o,t[10]=c):c=t[10],c}function C1(e){let t=e.trim();if(/^#[0-9a-fA-F]{6}$/.test(t))return t.toLowerCase();if(/^#[0-9a-fA-F]{3}$/.test(t)){let[,e,n,r]=t.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/)??[];return`#${e}${e}${n}${n}${r}${r}`.toLowerCase()}return`#000000`}function w1(e){let t=(0,J.c)(36),{id:n,value:r,onChange:i,autoFocus:a}=e,o=(0,Y.useRef)(null),s;t[0]===i?s=t[1]:(s=e=>i(e.target.value),t[0]=i,t[1]=s);let c=a?``:void 0,l=r?`pl-7`:void 0,u;t[2]===l?u=t[3]:(u=vn(`h-7 text-sm`,l),t[2]=l,t[3]=u);let d;t[4]!==a||t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==u||t[9]!==r?(d=(0,X.jsx)(ir,{id:n,type:`text`,value:r,placeholder:`#F05032 or rgb(240,80,50)`,onChange:s,autoFocus:a,"data-prop-autofocus":c,className:u,"data-color-picker-input":``}),t[4]=a,t[5]=n,t[6]=s,t[7]=c,t[8]=u,t[9]=r,t[10]=d):d=t[10];let f;t[11]===r?f=t[12]:(f=r&&(0,X.jsx)(`span`,{style:{backgroundColor:r},className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 rounded-sm border border-border`,"aria-hidden":`true`,"data-color-picker-swatch":``}),t[11]=r,t[12]=f);let p;t[13]!==d||t[14]!==f?(p=(0,X.jsxs)(`div`,{className:`relative flex-1`,children:[d,f]}),t[13]=d,t[14]=f,t[15]=p):p=t[15];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>o.current?.click(),t[16]=m):m=t[16];let h=r||`transparent`,g;t[17]===h?g=t[18]:(g=(0,X.jsx)(Mn,{type:`button`,variant:`outline`,size:`xs`,"aria-label":`Choose color`,"data-color-picker-trigger":``,className:`h-7 gap-1 px-2`,onClick:m,children:(0,X.jsx)(`span`,{style:{backgroundColor:h},className:`size-3.5 rounded-sm border border-border`,"aria-hidden":`true`})}),t[17]=h,t[18]=g);let _;t[19]===r?_=t[20]:(_=C1(r),t[19]=r,t[20]=_);let v;t[21]===i?v=t[22]:(v=e=>i(e.target.value),t[21]=i,t[22]=v);let y;t[23]!==_||t[24]!==v?(y=(0,X.jsx)(`input`,{ref:o,type:`color`,value:_,onChange:v,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 size-7 opacity-0`,"data-color-picker-native":``}),t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;t[26]!==g||t[27]!==y?(b=(0,X.jsxs)(`div`,{className:`relative`,children:[g,y]}),t[26]=g,t[27]=y,t[28]=b):b=t[28];let x;t[29]!==i||t[30]!==r?(x=r&&(0,X.jsx)(Mn,{type:`button`,variant:`ghost`,size:`xs`,"aria-label":`Clear color`,"data-color-picker-clear":``,className:`h-7 px-1.5`,onClick:()=>i(``),children:(0,X.jsx)(Ji,{className:`size-3`,"aria-hidden":`true`})}),t[29]=i,t[30]=r,t[31]=x):x=t[31];let S;return t[32]!==b||t[33]!==x||t[34]!==p?(S=(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[p,b,x]}),t[32]=b,t[33]=x,t[34]=p,t[35]=S):S=t[35],S}function T1(e){let t=(0,J.c)(43),{id:n,value:r,onChange:i,autoFocus:a}=e,[o,s]=(0,Y.useState)(!1),c;t[0]===r?c=t[1]:(c=KO(r),t[0]=r,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.startsWith(`lucide:`)?r.slice(7):null,t[2]=r,t[3]=u);let d=u,f;t[4]===i?f=t[5]:(f=e=>i(e.target.value),t[4]=i,t[5]=f);let p=a?``:void 0,m=l?`pl-7`:void 0,h;t[6]===m?h=t[7]:(h=vn(`h-7 text-sm`,m),t[6]=m,t[7]=h);let g;t[8]!==a||t[9]!==n||t[10]!==f||t[11]!==p||t[12]!==h||t[13]!==r?(g=(0,X.jsx)(ir,{id:n,type:`text`,value:r,placeholder:`lucide:Lightbulb or 📘`,onChange:f,autoFocus:a,"data-prop-autofocus":p,className:h,"data-icon-picker-input":``}),t[8]=a,t[9]=n,t[10]=f,t[11]=p,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]===l?_=t[16]:(_=l&&(0,X.jsx)(l,{className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),t[15]=l,t[16]=_);let v;t[17]!==g||t[18]!==_?(v=(0,X.jsxs)(`div`,{className:`relative flex-1`,children:[g,_]}),t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(Ri,{className:`size-3`,"aria-hidden":`true`}),t[20]=y):y=t[20];let b;t[21]===o?b=t[22]:(b=(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,variant:`outline`,size:`xs`,"aria-label":`Choose icon`,"aria-haspopup":`listbox`,"aria-expanded":o,"data-icon-picker-trigger":``,className:`h-7 gap-1 px-2`,children:y})}),t[21]=o,t[22]=b);let x;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsx)(lx,{placeholder:`Search icons...`,className:`h-8 text-sm`}),t[23]=x):x=t[23];let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,X.jsx)(dx,{children:`No icons match.`}),t[24]=S):S=t[24];let C;t[25]!==i||t[26]!==r.length?(C=r.length>0&&(0,X.jsx)(fx,{children:(0,X.jsxs)(px,{value:`__clear__`,onSelect:()=>{i(``),s(!1)},className:`gap-2 text-muted-foreground`,"data-icon-picker-clear":``,children:[(0,X.jsx)(zn,{className:`size-3.5`,"aria-hidden":`true`}),`Clear icon`]})}),t[25]=i,t[26]=r.length,t[27]=C):C=t[27];let w;t[28]!==i||t[29]!==d?(w=GO.map(e=>{let[t,n]=e,r=t===d;return(0,X.jsx)(px,{value:t,onSelect:()=>{i(`lucide:${t}`),s(!1)},title:t,"aria-label":t,"data-icon-picker-item":t,"data-icon-picker-selected":r?``:void 0,className:vn(`flex aspect-square items-center justify-center rounded-md p-0`,r?`bg-foreground/10 text-foreground ring-1 ring-foreground/30`:`text-muted-foreground hover:bg-muted`),children:(0,X.jsx)(n,{className:`size-4`,"aria-hidden":`true`})},t)}),t[28]=i,t[29]=d,t[30]=w):w=t[30];let T;t[31]===w?T=t[32]:(T=(0,X.jsx)(fx,{heading:`Lucide`,children:(0,X.jsx)(Yb.Group,{className:`[&_[cmdk-group-items]]:grid [&_[cmdk-group-items]]:grid-cols-6 [&_[cmdk-group-items]]:gap-1 [&_[cmdk-group-items]]:p-1`,children:w})}),t[31]=w,t[32]=T);let E;t[33]!==C||t[34]!==T?(E=(0,X.jsx)(xc,{align:`end`,className:`z-70 w-72 p-0`,onOpenAutoFocus:E1,children:(0,X.jsxs)(sx,{label:`Icon picker`,children:[x,(0,X.jsxs)(ux,{className:`max-h-64`,children:[S,C,T]})]})}),t[33]=C,t[34]=T,t[35]=E):E=t[35];let D;t[36]!==o||t[37]!==b||t[38]!==E?(D=(0,X.jsxs)(yc,{open:o,onOpenChange:s,children:[b,E]}),t[36]=o,t[37]=b,t[38]=E,t[39]=D):D=t[39];let O;return t[40]!==D||t[41]!==v?(O=(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[v,D]}),t[40]=D,t[41]=v,t[42]=O):O=t[42],O}function E1(e){return e.preventDefault()}function D1(){if(typeof window>`u`)return null;let e=window.location.hash.match(/^#\/([^?#]+)/);return e?decodeURIComponent(e[1]):null}var O1=`/api/upload`;async function k1(e,t,n={}){let r=n.fetch??globalThis.fetch,i=n.docName===void 0?D1():n.docName;if(!i)throw Error(`No document is open`);let a=new FormData;a.append(`file`,e),a.append(`parentDocName`,i);let o;try{o=await r(O1,{method:`POST`,body:a})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Upload failed: ${t}`)}let s;try{s=await o.json()}catch(e){throw new oO(`Upload response is not JSON.`,{cause:e,status:o.status})}if(!o.ok){let e=lt.safeParse(s);throw e.success?Error(e.data.title):new oO(`Upload error response did not match ProblemDetails.`,{cause:e.error,status:o.status})}let c=mt.safeParse(s);if(!c.success)throw new oO(`Upload success response did not match UploadAssetSuccess.`,{cause:c.error,status:o.status});let l=c.data.path??c.data.src;return{url:l.startsWith(`/`)?l:`/${l}`}}var A1=new Intl.PluralRules(`en-US`);function j1(e,t,n){return n<=0?`${e} (empty)`:`${e} with ${n} ${A1.select(n)===`one`?`item`:`items`}`}function M1(e){for(let t of e)if(t.type===`string`&&t.hidden!==!0&&t.advanced!==!0&&t.autoFocus===!0)return t.name;return null}function N1(e){if(!e)return e;let t=e.replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1)}var P1=new Set([`auto`,`inherit`,`initial`,`unset`]),F1=new Set([`px`,`%`,`rem`,`em`,`vh`,`vw`,`ch`,`ex`,`fr`]),I1=/^(-?\d+(?:\.\d+)?)([a-z%]*)$/i;function L1(e){let t=e.trim();if(!t)return{valid:!1,reason:`empty`};if(P1.has(t.toLowerCase()))return{valid:!0};let n=t.match(I1);if(!n)return{valid:!1,reason:`malformed-syntax`};let r=(n[2]??``).toLowerCase();return r===``||F1.has(r)?{valid:!0}:{valid:!1,reason:`unknown-unit`}}function R1(e){if(e.valid)return null;switch(e.reason){case`empty`:return null;case`malformed-syntax`:return`Enter a number (e.g. 100), a number with a CSS unit (e.g. 100px, 50%, 26rem), or one of: auto, inherit, initial, unset.`;case`unknown-unit`:return`Unknown CSS unit. Use px, %, rem, em, vh, vw, ch, ex, or fr.`}}var z1={video:Ke,audio:Qe,image:g},B1={youtube:[`youtube.com`,`youtu.be`,`youtube-nocookie.com`],vimeo:[`vimeo.com`],loom:[`loom.com`]};function V1(e){let t=e.toLowerCase();for(let e of Object.keys(B1)){let n=B1[e];for(let r of n)if(t===r||t.endsWith(`.${r}`))return e}return null}function H1(e){let t=e.lastIndexOf(`/`),n=t>=0?e.slice(t+1):e,r=n.lastIndexOf(`.`);return r>0?n.slice(r+1).toLowerCase():``}var U1=`https://placeholder.invalid`;function W1(e,t){let n=e.trim();if(n.length===0)return{valid:!0};let r,i=!0;try{r=new URL(n)}catch{try{r=new URL(n,U1),i=!1}catch{return{valid:!1,reason:`invalid-url`}}}if(t===`video`&&L(n)!==null||t===`video`&&Ee(n)||t===`video`&&tt(n))return{valid:!0};let a=i?V1(r.hostname):null;if(a!==null)return{valid:!1,reason:`embed-provider`,provider:a};if(r.protocol===`data:`)return{valid:!1,reason:`data-uri`};let o=H1(r.pathname),s=z1[t];return o===``?i?{valid:!0}:{valid:!1,reason:`wrong-extension`,extension:``}:s.has(o)?{valid:!0}:{valid:!1,reason:`wrong-extension`,extension:o}}function G1(e){if(e.length===0)return;let t=e[0]?.toLowerCase()??``;if(t.startsWith(`video/`))return`video`;if(t.startsWith(`audio/`))return`audio`;if(t.startsWith(`image/`))return`image`}function K1(e){return`Direct ${e} file URL — ${Array.from(z1[e]).map(e=>`.${e}`).join(`, `)}`}var q1={youtube:`YouTube`,vimeo:`Vimeo`,loom:`Loom`};function J1(e,t){if(e.valid)return``;if(e.reason===`invalid-url`)return`Not a valid URL.`;if(e.reason===`data-uri`)return`Data URIs are not supported for media fields. Use a hosted file URL.`;if(e.reason===`embed-provider`){let n=q1[e.provider];return t===`video`?`Unrecognized ${n} URL. Paste a valid ${n} share or embed link, or a direct ${t} file URL.`:`${n} URLs are not direct ${t} files. Paste a direct ${t} file URL.`}let n=Array.from(z1[t]).map(e=>`.${e}`).join(`, `);return e.extension===``?`Missing file extension. Accepts: ${n}.`:`Unsupported extension .${e.extension}. Accepts: ${n}.`}function Y1(e){return`ok.propPanel.advanced.${e}`}function X1(e){try{return typeof localStorage>`u`?!1:localStorage.getItem(Y1(e))===`true`}catch{return!1}}function Z1(e,t){try{if(typeof localStorage>`u`)return;localStorage.setItem(Y1(e),t?`true`:`false`)}catch{}}function Q1(e,t){let n=0;for(let r of e){let e=t[r.name],i=`defaultValue`in r?r.defaultValue:void 0;e!==void 0&&e!==i&&(n+=1)}return n}async function $1(e,t,n){try{let{url:r}=await k1(e,t);n(r)}catch(e){let t=e instanceof Error?e.message:String(e);nr.error(B._({id:`02P3hL`,values:{message:t}}))}}function e0(e){let t=(0,J.c)(13),{descriptor:n,values:r,onChange:i}=e,a;t[0]===r?a=t[1]:(a=e=>!(`hidden`in e&&e.hidden)&&e.hideWhen?.(r)!==!0&&e.type!==`reactnode`,t[0]=r,t[1]=a);let s=n.props.filter(a),c=s.filter(n0),l=s.filter(t0),u=Q1(l,r),d;t[2]===n.props?d=t[3]:(d=M1(n.props),t[2]=n.props,t[3]=d);let f=d,p;t[4]===n.name?p=t[5]:(p=()=>X1(n.name),t[4]=n.name,t[5]=p);let[m,h]=(0,Y.useState)(p);if(s.length===0)return null;let g;t[6]!==f||t[7]!==i||t[8]!==r?(g=e=>(0,X.jsx)(i0,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===f},e.name),t[6]=f,t[7]=i,t[8]=r,t[9]=g):g=t[9];let _=c.map(g),v=l.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,X.jsxs)(sr,{open:m,onOpenChange:e=>{h(e),Z1(n.name,e)},children:[(0,X.jsxs)(or,{"data-prop-panel-advanced-trigger":``,className:`group flex w-full items-center justify-between rounded px-1 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground uppercase font-mono`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(Ri,{className:`size-3 transition-transform group-data-[state=closed]:-rotate-90`}),(0,X.jsx)(o,{id:`sxkWRg`})]}),u>0&&(0,X.jsx)(vc,{variant:`secondary`,"data-prop-panel-advanced-count":``,children:u})]}),(0,X.jsx)(ar,{className:`flex flex-col gap-4 pt-2`,children:l.map(e=>(0,X.jsx)(i0,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===f},e.name))})]})]}),y;return t[10]!==_||t[11]!==v?(y=(0,X.jsxs)(`div`,{"data-prop-panel":``,className:`flex flex-col gap-4 py-2 text-sm`,children:[_,v]}),t[10]=_,t[11]=v,t[12]=y):y=t[12],y}function t0(e){return`advanced`in e&&e.advanced}function n0(e){return!(`advanced`in e&&e.advanced)}function r0(e){throw Error(`PropPanel: unhandled PropDef type ${JSON.stringify(e)}`)}function i0(e){let t=(0,J.c)(162),{propDef:n,value:r,onChange:i,isAutoFocused:a}=e;switch(n.type){case`reactnode`:return null;case`string`:{let e=`prop-${n.name}`,o=n.accept,s=o!==void 0&&o.length>0,c=!n.required&&n.defaultValue===void 0;if(n.language){let o=`${e}-label`,s;t[0]===n.name?s=t[1]:(s=N1(n.name),t[0]=n.name,t[1]=s);let l;t[2]!==o||t[3]!==e||t[4]!==s?(l=(0,X.jsx)(`label`,{id:o,htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[2]=o,t[3]=e,t[4]=s,t[5]=l):l=t[5];let u=r??``,d;t[6]!==i||t[7]!==c?(d=e=>{if(e===``&&c){i(void 0);return}i(e)},t[6]=i,t[7]=c,t[8]=d):d=t[8];let f;t[9]!==a||t[10]!==o||t[11]!==n.language||t[12]!==e||t[13]!==u||t[14]!==d?(f=(0,X.jsx)(mZ,{id:e,ariaLabelledBy:o,value:u,language:n.language,onChange:d,autoFocus:a}),t[9]=a,t[10]=o,t[11]=n.language,t[12]=e,t[13]=u,t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==l||t[17]!==f?(p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,f]}),t[16]=l,t[17]=f,t[18]=p):p=t[18],p}if(n.iconPicker){let o=r??``,s;t[19]===n.name?s=t[20]:(s=N1(n.name),t[19]=n.name,t[20]=s);let l;t[21]!==e||t[22]!==s?(l=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[21]=e,t[22]=s,t[23]=l):l=t[23];let u;t[24]!==i||t[25]!==c?(u=e=>{if(e===``&&c){i(void 0);return}i(e)},t[24]=i,t[25]=c,t[26]=u):u=t[26];let d;t[27]!==o||t[28]!==a||t[29]!==e||t[30]!==u?(d=(0,X.jsx)(T1,{id:e,value:o,onChange:u,autoFocus:a}),t[27]=o,t[28]=a,t[29]=e,t[30]=u,t[31]=d):d=t[31];let f;return t[32]!==l||t[33]!==d?(f=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,d]}),t[32]=l,t[33]=d,t[34]=f):f=t[34],f}if(n.colorPicker){let o=r??``,s;t[35]===n.name?s=t[36]:(s=N1(n.name),t[35]=n.name,t[36]=s);let l;t[37]!==e||t[38]!==s?(l=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[37]=e,t[38]=s,t[39]=l):l=t[39];let u;t[40]!==i||t[41]!==c?(u=e=>{if(e===``&&c){i(void 0);return}i(e)},t[40]=i,t[41]=c,t[42]=u):u=t[42];let d;t[43]!==o||t[44]!==a||t[45]!==e||t[46]!==u?(d=(0,X.jsx)(w1,{id:e,value:o,onChange:u,autoFocus:a}),t[43]=o,t[44]=a,t[45]=e,t[46]=u,t[47]=d):d=t[47];let f;return t[48]!==l||t[49]!==d?(f=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,d]}),t[48]=l,t[49]=d,t[50]=f):f=t[50],f}if(n.cssLengthInput){let o=r??``,s;if(t[51]!==o){let e=L1(o);s=e.valid?null:R1(e),t[51]=o,t[52]=s}else s=t[52];let l=s,u;t[53]===n.name?u=t[54]:(u=N1(n.name),t[53]=n.name,t[54]=u);let d;t[55]!==e||t[56]!==u?(d=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:u}),t[55]=e,t[56]=u,t[57]=d):d=t[57];let f;t[58]!==i||t[59]!==c?(f=e=>{let t=e.target.value;if(t===``&&c){i(void 0);return}i(t)},t[58]=i,t[59]=c,t[60]=f):f=t[60];let p=a?``:void 0,m=l===null?void 0:!0,h=l===null?void 0:`${e}-error`,g;t[61]!==o||t[62]!==a||t[63]!==e||t[64]!==f||t[65]!==p||t[66]!==m||t[67]!==h?(g=(0,X.jsx)(ir,{id:e,type:`text`,value:o,placeholder:`100px, 50%, 26rem, auto`,onChange:f,autoFocus:a,"data-prop-autofocus":p,"aria-invalid":m,"aria-describedby":h,className:`h-7 text-sm`,"data-prop-css-length-input":``}),t[61]=o,t[62]=a,t[63]=e,t[64]=f,t[65]=p,t[66]=m,t[67]=h,t[68]=g):g=t[68];let _;t[69]!==l||t[70]!==e?(_=l!==null&&(0,X.jsx)(`p`,{id:`${e}-error`,"data-prop-css-length-error":``,className:`text-xs text-destructive`,"aria-live":`polite`,children:l}),t[69]=l,t[70]=e,t[71]=_):_=t[71];let v;return t[72]!==d||t[73]!==g||t[74]!==_?(v=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[d,g,_]}),t[72]=d,t[73]=g,t[74]=_,t[75]=v):v=t[75],v}let l,u,d;if(t[76]!==o||t[77]!==r){let e=o===void 0?void 0:G1(o);l=r??``;let n=e===void 0?null:W1(l,e);u=n!==null&&!n.valid&&e!==void 0&&l.trim().length>0?J1(n,e):null,d=e===void 0?void 0:K1(e),t[76]=o,t[77]=r,t[78]=l,t[79]=u,t[80]=d}else l=t[78],u=t[79],d=t[80];let f=d,p;t[81]===n.name?p=t[82]:(p=N1(n.name),t[81]=n.name,t[82]=p);let m;t[83]!==e||t[84]!==p?(m=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:p}),t[83]=e,t[84]=p,t[85]=m):m=t[85];let h;t[86]!==i||t[87]!==c?(h=e=>{let t=e.target.value;if(t===``&&c){i(void 0);return}i(t)},t[86]=i,t[87]=c,t[88]=h):h=t[88];let g=a?``:void 0,_=u===null?void 0:!0,v=u===null?void 0:`${e}-error`,y;t[89]!==l||t[90]!==a||t[91]!==f||t[92]!==e||t[93]!==h||t[94]!==g||t[95]!==_||t[96]!==v?(y=(0,X.jsx)(ir,{id:e,type:`text`,value:l,placeholder:f,onChange:h,autoFocus:a,"data-prop-autofocus":g,"aria-invalid":_,"aria-describedby":v,className:`h-7 text-sm`}),t[89]=l,t[90]=a,t[91]=f,t[92]=e,t[93]=h,t[94]=g,t[95]=_,t[96]=v,t[97]=y):y=t[97];let b;t[98]!==o||t[99]!==i||t[100]!==s?(b=s&&(0,X.jsx)(o0,{accept:o,onUploaded:e=>i(e)}),t[98]=o,t[99]=i,t[100]=s,t[101]=b):b=t[101];let x;t[102]!==y||t[103]!==b?(x=(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[y,b]}),t[102]=y,t[103]=b,t[104]=x):x=t[104];let S;t[105]!==u||t[106]!==e?(S=u!==null&&(0,X.jsx)(`p`,{id:`${e}-error`,"data-prop-media-error":``,className:`text-xs text-destructive`,"aria-live":`polite`,children:u}),t[105]=u,t[106]=e,t[107]=S):S=t[107];let C;return t[108]!==x||t[109]!==S||t[110]!==m?(C=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[m,x,S]}),t[108]=x,t[109]=S,t[110]=m,t[111]=C):C=t[111],C}case`boolean`:{let e=`prop-${n.name}`,a;t[112]===n.name?a=t[113]:(a=N1(n.name),t[112]=n.name,t[113]=a);let o=a,s;t[114]!==e||t[115]!==o?(s=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[114]=e,t[115]=o,t[116]=s):s=t[116];let c=!!r,l;t[117]===i?l=t[118]:(l=e=>i(e),t[117]=i,t[118]=l);let u;t[119]!==e||t[120]!==c||t[121]!==l?(u=(0,X.jsx)(S1,{id:e,checked:c,onCheckedChange:l}),t[119]=e,t[120]=c,t[121]=l,t[122]=u):u=t[122];let d;return t[123]!==s||t[124]!==u?(d=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[s,u]}),t[123]=s,t[124]=u,t[125]=d):d=t[125],d}case`enum`:{let e=`prop-${n.name}`,a=r??n.enumValues[0]??``,o;t[126]===n.name?o=t[127]:(o=N1(n.name),t[126]=n.name,t[127]=o);let s;t[128]!==e||t[129]!==o?(s=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[128]=e,t[129]=o,t[130]=s):s=t[130];let c;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(g1,{}),t[131]=c):c=t[131];let l;t[132]===e?l=t[133]:(l=(0,X.jsx)(_1,{id:e,size:`sm`,children:c}),t[132]=e,t[133]=l);let u;t[134]===n.enumValues?u=t[135]:(u=n.enumValues.map(a0),t[134]=n.enumValues,t[135]=u);let d;t[136]===u?d=t[137]:(d=(0,X.jsx)(v1,{className:`z-70`,children:u}),t[136]=u,t[137]=d);let f;t[138]!==a||t[139]!==i||t[140]!==l||t[141]!==d?(f=(0,X.jsxs)(h1,{value:a,onValueChange:i,children:[l,d]}),t[138]=a,t[139]=i,t[140]=l,t[141]=d,t[142]=f):f=t[142];let p;return t[143]!==s||t[144]!==f?(p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,f]}),t[143]=s,t[144]=f,t[145]=p):p=t[145],p}case`number`:{let e=`prop-${n.name}`,a;t[146]===n.name?a=t[147]:(a=N1(n.name),t[146]=n.name,t[147]=a);let o;t[148]!==e||t[149]!==a?(o=(0,X.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:a}),t[148]=e,t[149]=a,t[150]=o):o=t[150];let s=r==null?``:String(r),c;t[151]===i?c=t[152]:(c=e=>{let t=e.target.value;if(t===``){i(void 0);return}if(t===`-`)return;let n=Number(t);Number.isNaN(n)||i(n)},t[151]=i,t[152]=c);let l;t[153]!==e||t[154]!==s||t[155]!==c?(l=(0,X.jsx)(ir,{id:e,type:`number`,inputMode:`numeric`,value:s,onChange:c,className:`h-7 text-sm`}),t[153]=e,t[154]=s,t[155]=c,t[156]=l):l=t[156];let u;return t[157]!==o||t[158]!==l?(u=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,l]}),t[157]=o,t[158]=l,t[159]=u):u=t[159],u}default:{let e;return t[160]===n?e=t[161]:(e=r0(n),t[160]=n,t[161]=e),e}}}function a0(e){return(0,X.jsx)(y1,{value:e,children:e},e)}function o0(e){let t=(0,J.c)(20),{accept:n,onUploaded:r}=e,{_:a}=i(),[o,s]=(0,Y.useState)(!1),c=(0,Y.useRef)(null),l;t[0]===n?l=t[1]:(l=n.join(`,`),t[0]=n,t[1]=l);let u;t[2]!==n||t[3]!==r?(u=async e=>{let t=e.target.files?.[0];if(t){s(!0);try{await $1(t,n,r)}catch{}s(!1),c.current&&(c.current.value=``)}},t[2]=n,t[3]=r,t[4]=u):u=t[4];let d;t[5]!==l||t[6]!==u?(d=(0,X.jsx)(`input`,{ref:c,type:`file`,accept:l,className:`hidden`,"data-prop-upload-input":``,onChange:u}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=a({id:`2IXDgU`}),t[8]=a,t[9]=f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c.current?.click(),t[10]=p):p=t[10];let m;t[11]===o?m=t[12]:(m=o?(0,X.jsx)(xa,{className:`size-3.5 animate-spin`}):(0,X.jsx)(Ua,{className:`size-3.5`}),t[11]=o,t[12]=m);let h;t[13]!==f||t[14]!==m||t[15]!==o?(h=(0,X.jsx)(Mn,{type:`button`,variant:`outline`,size:`sm`,disabled:o,"aria-label":f,"data-prop-upload-trigger":``,className:`h-7 px-2`,onClick:p,children:m}),t[13]=f,t[14]=m,t[15]=o,t[16]=h):h=t[16];let g;return t[17]!==d||t[18]!==h?(g=(0,X.jsxs)(X.Fragment,{children:[d,h]}),t[17]=d,t[18]=h,t[19]=g):g=t[19],g}var s0=new Set([`img`,`CommonMarkImage`,`video`,`audio`]);function c0(e,t,n){if(!s0.has(e)||!n)return t;let r=t.src;if(typeof r!=`string`)return t;let i=Ct(r,n);return i===r?t:{...t,src:i}}var l0=`selectionStatePlugin/origin`,u0=`selectionStatePlugin/refresh`,d0=new b(`selectionState`),f0=new Set,p0={selectedBlockId:null,ancestorChain:[],selectionOrigin:`programmatic`,isDragging:!1,rangeEncompassedBlockIds:f0};function m0(e){return d0.getState(e.state)??p0}function h0(e,t){let n=[],{$from:r}=t;for(let t=1;t<=r.depth;t++){let i=r.node(t);if(i.type.name!==`jsxComponent`)continue;let a=r.before(t);n.push(g0(e,i,a))}if(t instanceof we){let r=t.node;r.type.name===`jsxComponent`&&n.push(g0(e,r,t.from))}return n}function g0(e,t,n){let r=t.attrs.componentName??`unknown`;return{bridgeId:_0(e,n),componentName:r,pos:n}}function _0(e,t){return MM.getState(e)?.posToId.get(t)??`pos-${t}`}function v0(e,t){if(t instanceof we)return f0;let{from:n,to:r}=t;if(n>=r)return f0;let i=MM.getState(e)?.posToId;if(!i)return f0;let a=null;for(let[t,o]of i){if(t<n)continue;let i=e.doc.nodeAt(t);i&&(t+i.nodeSize>r||(a||=new Set,a.add(o)))}return a??f0}function y0(e,t,n={}){let r=h0(e,e.selection),i=r[r.length-1],a=v0(e,e.selection),o={selectedBlockId:i?.bridgeId??null,ancestorChain:r,selectionOrigin:n.origin??t.selectionOrigin,isDragging:n.isDragging??t.isDragging,rangeEncompassedBlockIds:a};return b0(t,o)?t:o}function b0(e,t){if(e===t)return!0;if(e.selectedBlockId!==t.selectedBlockId||e.selectionOrigin!==t.selectionOrigin||e.isDragging!==t.isDragging||e.ancestorChain.length!==t.ancestorChain.length)return!1;for(let n=0;n<e.ancestorChain.length;n++){let r=e.ancestorChain[n],i=t.ancestorChain[n];if(r.bridgeId!==i.bridgeId||r.componentName!==i.componentName||r.pos!==i.pos)return!1}if(e.rangeEncompassedBlockIds.size!==t.rangeEncompassedBlockIds.size)return!1;for(let n of e.rangeEncompassedBlockIds)if(!t.rangeEncompassedBlockIds.has(n))return!1;return!0}var x0=new WeakMap;function S0(e,t,n,r){let i=r?.isDragging??t.isDragging,a=!!e.getMeta(u0),o=e.selectionSet&&!a,s=e.getMeta(l0),c=o?r?.pendingOrigin??null:null,l=s??c??t.selectionOrigin;return o&&r&&(r.pendingOrigin=null),y0(n,t,{origin:l,isDragging:i})}var C0=Wt.create({name:`selectionStatePlugin`,addProseMirrorPlugins(){let e=this.editor,t=new S({key:d0,state:{init(e,t){return y0(t,p0)},apply(e,n,r,i){return S0(e,n,i,x0.get(t))}},props:{handleDOMEvents:{mousedown:()=>{let e=x0.get(t);return e&&(e.pendingOrigin=`pointer`),!1},pointerdown:()=>{let e=x0.get(t);return e&&(e.pendingOrigin=`pointer`),!1}},handleKeyDown:(e,n)=>{if(w0(n.key)){let e=x0.get(t);e&&(e.pendingOrigin=`keyboard`)}return!1}},view(n){x0.set(t,{pendingOrigin:null,isDragging:!1});let r=n.dom.parentElement??n.dom,i=()=>{let n=x0.get(t);n&&(n.isDragging=!0,T0(e))},a=()=>{let n=x0.get(t);n&&(n.isDragging=!1,T0(e))};return r.addEventListener(`dragstart`,i,!0),r.addEventListener(`dragend`,a,!0),r.addEventListener(`drop`,a,!0),{destroy:()=>{r.removeEventListener(`dragstart`,i,!0),r.removeEventListener(`dragend`,a,!0),r.removeEventListener(`drop`,a,!0),x0.delete(t)}}}});return[t]}});function w0(e){return e===`ArrowUp`||e===`ArrowDown`||e===`ArrowLeft`||e===`ArrowRight`||e===`Tab`||e===`Escape`||e===`Enter`||e===`Home`||e===`End`||e===`PageUp`||e===`PageDown`}function T0(e){queueMicrotask(()=>{if(!e.isDestroyed)try{let t=e.state.tr.setMeta(u0,!0);e.view.dispatch(t)}catch{}})}function E0(e){let t=(0,J.c)(5),n;t[0]===e?n=t[1]:(n=()=>e?m0(e):null,t[0]=e,t[1]=n);let[r,i]=(0,Y.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(!e){i(null);return}i(m0(e));let t=()=>{i(m0(e))};return e.on(`transaction`,t),e.on(`selectionUpdate`,t),()=>{e.off(`transaction`,t),e.off(`selectionUpdate`,t)}},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,Y.useEffect)(a,o),r}function D0(e,t){if(e.hasChildren)return!1;let n=M1(e.props);return n===null?!1:t[n]===``}function O0(e){let t=e.placeholder?.label,n=`Add ${(e.displayName??e.name).toLowerCase()}`;return{label:t??n,Icon:UO(e.placeholder?.icon??e.icon)}}var k0=new Set([`img`,`CommonMarkImage`,`Embed`,`video`]),A0=`img, .ok-embed, .ok-video`,j0=220,M0=`cubic-bezier(0.23, 1, 0.32, 1)`,N0=`ok-image-align-flip`,P0=.5;function F0(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function I0(){return typeof requestAnimationFrame==`function`}function L0(e){return e?e.querySelector(A0):null}function R0(e,t){if(F0()||!I0()){t();return}let n=L0(e);if(!n){t();return}let r=n.getBoundingClientRect().left;t(),requestAnimationFrame(()=>{let t=L0(e);if(!t)return;for(let e of t.getAnimations())e.id===N0&&e.cancel();let n=r-t.getBoundingClientRect().left;if(Math.abs(n)<P0)return;let i=t.animate([{transform:`translateX(${n}px)`},{transform:`translateX(0)`}],{duration:j0,easing:M0,fill:`none`});i.id=N0})}function z0(e){if(!e.attrs.sourceDirty&&e.attrs.sourceRaw)return e.attrs.sourceRaw;let t=aA(),n=e.type.schema.node(`doc`,null,[e]);return t.serialize(n.toJSON()).trim()}var B0=new Set(Xe.map(e=>`${e}:`)),V0=6e4,H0=10,U0=new Map;function W0(e,t){let n=t.toLowerCase();jt(n);let r=Date.now(),i=U0.get(n);if(!i||r-i.windowStart>=V0)U0.set(n,{windowStart:r,count:1});else if(i.count+=1,i.count>H0)return;typeof console<`u`&&typeof console.warn==`function`&&console.warn(JSON.stringify({event:`jsx-prop-dropped`,reason:e,prop:t}))}var G0=new Set([`href`,`src`,`action`,`formaction`,`poster`,`cite`,`data`,`manifest`,`background`,`ping`,`xlinkhref`,`xlinkactuate`,`xlinkrole`,`xlinkarcrole`,`xlinkshow`,`url`,`link`]),K0=new Set([`dangerouslysetinnerhtml`,`ref`,`key`,`defaultvalue`,`defaultchecked`,`__proto__`,`constructor`,`prototype`]),q0=1e4;function J0(e){let t=e.toLowerCase();return!!(K0.has(t)||t.length>=3&&t.startsWith(`on`))}function Y0(e){return G0.has(e.toLowerCase())}function X0(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t||t.startsWith(`#`)||t.startsWith(`//`)||xe(t))return e;let n=t.indexOf(`:`),r=t.slice(0,n+1).toLowerCase();return B0.has(r)?e:`#`}function Z0(e){if(e.length>q0)return``;let t=e.toLowerCase();return/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/.test(t)||/\bexpression\s*\(/.test(t)?``:e}function Q0(e){if(e==null)return e;if(Array.isArray(e)){let t=!1,n=Array(e.length);for(let r=0;r<e.length;r++){let i=Q0(e[r]);n[r]=i,i!==e[r]&&(t=!0)}return t?n:e}if(typeof e!=`object`)return e;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=e,r=!1,i={};for(let[e,t]of Object.entries(n)){if(J0(e)){W0(`dangerous-prop-name-nested`,e),r=!0;continue}if(Y0(e)&&typeof t==`string`){let n=X0(t);n!==t&&(r=!0),i[e]=n}else{let n=Q0(t);n!==t&&(r=!0),i[e]=n}}return r?i:e}function $0(e){let t=!1,n={};for(let[r,i]of Object.entries(e)){if(J0(r)){W0(`dangerous-prop-name`,r),t=!0;continue}if(Y0(r)){let e=X0(i);e!==i&&(t=!0),n[r]=e;continue}if(r===`style`){if(typeof i==`string`){let e=Z0(i);e!==i&&(t=!0),n[r]=e}else t=!0;continue}let e=Q0(i);e!==i&&(t=!0),n[r]=e}return t?n:e}function e2(e){let t=(0,J.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`jsx-component-error-fallback`,children:n}),t[0]=n,t[1]=r),r}function t2(e){let t=(0,J.c)(13),{children:n,resetKey:r,onError:i,descriptorName:a,rawComponentName:o}=e,s;t[0]===r?s=t[1]:(s=[r],t[0]=r,t[1]=s);let c;t[2]!==a||t[3]!==i||t[4]!==o?(c=(e,t)=>{let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:a,rawComponentName:String(o??``).slice(0,200),error:String(n),stack:t.componentStack})),_t(a),i(n)},t[2]=a,t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=e=>(0,X.jsx)(e2,{...e,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==n||t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,X.jsx)(d1,{resetKeys:s,onError:c,fallbackRender:l,children:n}),t[8]=n,t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function n2(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(n2).join(`,`)}]`;let t=Object.entries(e);return t.sort(([e],[t])=>e<t?-1:+(e>t)),`{${t.map(([e,t])=>`${JSON.stringify(e)}:${n2(t)}`).join(`,`)}}`}function r2(e,t){let n=e.props??{},r={};for(let[e,i]of Object.entries(n))t.has(e)||(r[e]=i);return $0(r)}var i2=3;function a2(e){let t=(0,J.c)(161),{node:n,editor:r,extension:a,getPos:s,selected:c}=e,{_:l}=i(),u=rM(n.attrs.componentName),[d,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),g=(0,Y.useRef)(!1),_=typeof s==`function`?s():void 0,v=!1,y=0,b=1;try{if(_!==void 0){let e=r.state.doc.resolve(_);e.depth>0&&e.parent.type.name===`jsxComponent`&&(v=!0,y=e.index(e.depth),b=e.parent.childCount)}}catch(e){let t=e;if(!(t instanceof RangeError))throw t}let x=v&&y>0,S=v&&y<b-1,C=E0(r),w=typeof _==`number`?_0(r.state,_):null,T=w!==null&&(C?.rangeEncompassedBlockIds.has(w)??!1),E;t[0]===C?.ancestorChain?E=t[1]:(E=C?.ancestorChain.at(-1)?.bridgeId??null,t[0]=C?.ancestorChain,t[1]=E);let D=w!==null&&E===w,O=c&&!T&&D,k=w!==null&&!D&&(C?.ancestorChain.some(e=>e.bridgeId===w)??!1),A=O&&C?C.selectionOrigin:void 0,j=O&&(C?.isDragging??!1),M=u.props.some(d2),N=n.attrs.props??{},P=M&&u.props.some(e=>e.type!==`string`||!e.required||`hidden`in e&&e.hidden?!1:!Object.hasOwn(N,e.name)),F=D0(u,N),I=F?O0(u):null,L=!u.hasChildren||!!u.isSelfClosing,ee=k0.has(u.name),R=u.name===`MermaidFence`?{propName:`chart`,language:`mermaid`}:u.name===`Math`||u.name===`DollarMath`||u.name===`MathFence`?{propName:`formula`,language:`latex`}:null,[z,B]=(0,Y.useState)(!1);(0,Y.useEffect)(()=>{c&&!g.current&&M&&fM(_)&&h(!0),g.current=c},[c,M,_]);let V=r2(n.attrs,u.reactNodePropNames),H=u.surface===`compat`?u.translateProps(V):V,te=a.options.docName,ne=typeof te==`string`&&te?te:qD(r),re=c0(u.name,H,ne),ie=`${u.name}::${n2(V)}`,ae;t[2]!==s||t[3]!==n.content.size?(ae=()=>(typeof s==`function`?s()??0:0)+1+n.content.size,t[2]=s,t[3]=n.content.size,t[4]=ae):ae=t[4];let W=ae,oe=u.name===`*`||d!==null,se=(0,Y.useRef)(!1),G=(0,Y.useRef)(0),[ce,le]=(0,Y.useState)(!1);if((0,Y.useEffect)(()=>{if(!oe||se.current||ce)return;let e=typeof s==`function`?s():void 0;if(typeof e!=`number`)return;let t=z0(n),i=u.name===`*`?`Unregistered component: ${n.attrs.componentName}`:`Render error in <${u.displayName??u.name}>: ${d?.message??`unknown`}`,a=n.type.schema.nodes.rawMdxFallback.create({reason:i},n.type.schema.text(t)),o=!1,c,l=()=>{if(!o)try{r.view.dispatch(r.state.tr.replaceWith(e,e+n.nodeSize,a)),se.current=!0,en(u.name===`*`?`wildcard`:u.name)}catch(e){let t=e,r=u.name===`*`?`wildcard`:u.name;if(console.warn(JSON.stringify({event:`jsx-component-auto-convert-failed`,component:r,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500),retry:G.current})),Ot(r),G.current+=1,G.current<i2){let e=50*(2**G.current-1);c=setTimeout(()=>{o||l()},e)}else o||le(!0)}},f=requestAnimationFrame(l);return()=>{o=!0,cancelAnimationFrame(f),c!==void 0&&clearTimeout(c)}},[oe,n,r,s,u,d,ce]),ce){let e=n.attrs.componentName,i=u.displayName??u.name,a=u.name===`*`?l({id:`Kh1n4a`,values:{componentName:e}}):l({id:`g58Kwy`,values:{descriptorLabel:i}}),o=()=>{try{let e=z0(n);typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e)}catch(e){let t=e;ht(u.name),console.warn(JSON.stringify({event:`jsx-component-stuck-copy-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500)}))}},c=()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{r.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;qe(u.name),console.warn(JSON.stringify({event:`jsx-component-stuck-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={[fF]:`true`},t[5]=d):d=t[5];let f;t[6]===a?f=t[7]:(f=(0,X.jsx)(`span`,{className:`flex-1`,children:a}),t[6]=a,t[7]=f);let p;t[8]===l?p=t[9]:(p=l({id:`E2Mv-X`}),t[8]=l,t[9]=p);let m;t[10]!==o||t[11]!==p?(m=(0,X.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:o,children:p}),t[10]=o,t[11]=p,t[12]=m):m=t[12];let h;t[13]===l?h=t[14]:(h=l({id:`cnGeoo`}),t[13]=l,t[14]=h);let g;t[15]!==c||t[16]!==h?(g=(0,X.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:c,children:h}),t[15]=c,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==m||t[19]!==g||t[20]!==f?(_=(0,X.jsxs)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-2 border border-destructive/40 rounded bg-destructive/5 flex items-center gap-2`,contentEditable:!1,...d,children:[f,m,g]}),t[18]=m,t[19]=g,t[20]=f,t[21]=_):_=t[21];let v;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(Jl,{className:`component-children`}),t[22]=v):v=t[22];let y;return t[23]===_?y=t[24]:(y=(0,X.jsxs)(Yl,{className:`jsx-component-wrapper my-2`,children:[_,v]}),t[23]=_,t[24]=y),y}if(oe){let e=n.attrs.componentName,r=u.displayName??u.name,i=u.name===`*`?l({id:`oJl7eO`,values:{componentName:e}}):l({id:`bcDHUM`,values:{descriptorLabel:r}}),a;t[25]===i?a=t[26]:(a=(0,X.jsx)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-1`,contentEditable:!1,children:i}),t[25]=i,t[26]=a);let o;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(Jl,{className:`component-children`}),t[27]=o):o=t[27];let s;return t[28]===a?s=t[29]:(s=(0,X.jsxs)(Yl,{className:`jsx-component-wrapper my-2`,children:[a,o]}),t[28]=a,t[29]=s),s}let ue=u.Component,de=u.displayName??u.name,fe=u.displayName??u.name,pe=u.displayName??u.name,me=e=>{if(F||!L)return;let t=e.target;if(!e.currentTarget.contains(t)||t.closest(`.jsx-component-chrome`)||t.closest(`.jsx-add-child-pill, .jsx-empty-child-placeholder`)||t.closest(`a[href]`)||typeof _!=`number`)return;let n=r.state.doc.nodeAt(_);if(!n)return;let i=_+n.nodeSize,a=r.state.selection.from;a<_||a>=i||r.chain().focus().setNodeSelection(_).run()},he;t[30]!==r||t[31]!==s?(he=()=>{let e=typeof s==`function`?s():void 0;typeof e==`number`&&(r.chain().focus().setNodeSelection(e).run(),h(!0))},t[30]=r,t[31]=s,t[32]=he):he=t[32];let ge=he,_e=u.displayName??u.name,ve=!!u.emptyChildName,ye=ve?j1(_e,u.emptyChildName,n.childCount):void 0,be=e=>{let t=e.target;if(e.key===`Backspace`||e.key===`Delete`){if(!O||!e.currentTarget.contains(t)||t.matches(`input, textarea`))return;let i=typeof s==`function`?s():void 0;if(typeof i!=`number`)return;e.preventDefault();try{r.chain().focus().setNodeSelection(i).deleteSelection().run()||(ot(u.name),console.warn(JSON.stringify({event:`jsx-component-keyboard-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ot(u.name),console.warn(JSON.stringify({event:`jsx-component-keyboard-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}return}e.key!==`Enter`&&e.key!==` `||c&&M&&(t.closest(`.jsx-component-chrome`)||t.closest(`input, textarea, select, button`)||(e.preventDefault(),h(!0)))},xe=e=>{h(e),!e&&requestAnimationFrame(()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{let t=r.state.doc.nodeAt(e);if(!t)return;let n=e+t.nodeSize,i=r.state.selection.from;if(i<e||i>=n)return;if(L){let e=r.state.doc.resolve(Math.min(n,r.state.doc.content.size)),t=f.near(e,1);r.view.dispatch(r.state.tr.setSelection(t).scrollIntoView())}else r.chain().setNodeSelection(e).run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;Rt(u.name),console.warn(JSON.stringify({event:`jsx-component-popover-close-restore-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}})},Se=yc,Ce=Yl,we;t[33]===u.name?we=t[34]:(we=u.name.toLowerCase(),t[33]=u.name,t[34]=we);let Te;bb0:{let e=N.align;if(e===`left`||e===`right`||e===`center`){Te=e;break bb0}if(ee){Te=`center`;break bb0}Te=void 0}let Ee=O?`true`:void 0,De=k?`true`:void 0,Oe=T?`true`:void 0,ke=j?`true`:void 0,Ae=P?`true`:void 0,je=ve?`group`:void 0,Me=O?0:-1,Ne;t[35]===v?Ne=t[36]:(Ne=v?{draggable:`false`,onDragStart:u2}:{"data-drag-handle":``,draggable:`true`},t[35]=v,t[36]=Ne);let Pe=u.name,Fe=l2,Ie;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ie={[fF]:`true`},t[37]=Ie):Ie=t[37];let Le=ee&&[{value:`left`,label:l({id:`IR6Txi`}),Icon:Va},{value:`center`,label:l({id:`8nOdkO`}),Icon:za},{value:`right`,label:l({id:`pd0UH2`}),Icon:Ba}].map(e=>{let{value:t,label:n,Icon:i}=e,a=typeof N.align==`string`?N.align:`center`,o=(a===`left`||a===`right`||a===`center`?a:`center`)===t;return(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":n,"aria-pressed":o,"data-active":o?`true`:void 0,onClick:e=>{if(typeof _!=`number`)return;let n=r.state.doc.nodeAt(_);if(!n||n.type.name!==`jsxComponent`)return;let i=e.currentTarget.closest(`.jsx-component-wrapper`),a=String(n.attrs.componentName??``);if(!k0.has(a)||n.attrs.kind!==`element`)return;let o=a===`CommonMarkImage`,s={...n.attrs.props,align:t},c=o?{...n.attrs,componentName:`img`,props:s,sourceDirty:!0}:{...n.attrs,props:s,sourceDirty:!0};R0(i,()=>{r.view.dispatch(r.state.tr.setNodeMarkup(_,null,c))})},children:(0,X.jsx)(i,{size:12,"aria-hidden":`true`})},t)}),Re=u.name===`Embed`&&typeof V.src==`string`&&/^https?:\/\//i.test(V.src)&&(0,X.jsx)(`a`,{href:V.src,target:`_blank`,rel:`noopener noreferrer`,className:`jsx-chrome-btn`,"aria-label":l({id:`iOHg1t`}),onMouseDown:c2,children:(0,X.jsx)(Yi,{size:12,"aria-hidden":`true`})}),ze=u.name===`Mirror`&&typeof V.src==`string`&&V.src.length>0&&(()=>{let e=V.src;return(0,X.jsx)(`a`,{href:U(e,typeof V.anchor==`string`&&V.anchor.length>0?V.anchor:null),className:`jsx-chrome-btn`,"aria-label":l({id:`3a_Bd7`,values:{mirrorSrc:e}}),title:l({id:`0kTAXe`,values:{mirrorSrc:e}}),onMouseDown:s2,children:(0,X.jsx)(Yi,{size:12,"aria-hidden":`true`})})})(),Be;t[38]!==l||t[39]!==x||t[40]!==u.name||t[41]!==r||t[42]!==n.attrs.componentName||t[43]!==n.nodeSize||t[44]!==_?(Be=x&&(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`QyioBP`}),onClick:()=>{try{if(typeof _!=`number`)return;let e=r.state.doc.resolve(_),t=e.index(e.depth);if(t===0)return;let i=_-e.node(e.depth).child(t-1).nodeSize,a=_+n.nodeSize,o=r.state.tr,s=r.state.doc.slice(_,_+n.nodeSize),c=r.state.doc.slice(i,_);o.replaceWith(i,a,s.content.append(c.content)),r.view.dispatch(o.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ft(`up`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`up`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,X.jsx)(Ni,{size:12,"aria-hidden":`true`})}),t[38]=l,t[39]=x,t[40]=u.name,t[41]=r,t[42]=n.attrs.componentName,t[43]=n.nodeSize,t[44]=_,t[45]=Be):Be=t[45];let Ve;t[46]!==l||t[47]!==S||t[48]!==u.name||t[49]!==r||t[50]!==n.attrs.componentName||t[51]!==n.nodeSize||t[52]!==_?(Ve=S&&(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`3Ib6FN`}),onClick:()=>{try{if(typeof _!=`number`)return;let e=r.state.doc.resolve(_),t=e.index(e.depth),i=e.node(e.depth);if(t>=i.childCount-1)return;let a=i.child(t+1),o=_,s=_+n.nodeSize+a.nodeSize,c=r.state.tr,l=r.state.doc.slice(_,_+n.nodeSize),u=r.state.doc.slice(_+n.nodeSize,s);c.replaceWith(o,s,u.content.append(l.content)),r.view.dispatch(c.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ft(`down`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`down`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,X.jsx)(Mi,{size:12,"aria-hidden":`true`})}),t[46]=l,t[47]=S,t[48]=u.name,t[49]=r,t[50]=n.attrs.componentName,t[51]=n.nodeSize,t[52]=_,t[53]=Ve):Ve=t[53];let He;t[54]!==l||t[55]!==u.displayName||t[56]!==u.name||t[57]!==R||t[58]!==_||t[59]!==B?(He=R&&typeof _==`number`?(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`ky9Tuc`,values:{0:u.displayName??u.name}}),"data-testid":`jsx-component-edit-btn`,onClick:()=>B(!0),children:(0,X.jsx)(Oa,{size:12,"aria-hidden":`true`})}):null,t[54]=l,t[55]=u.displayName,t[56]=u.name,t[57]=R,t[58]=_,t[59]=B,t[60]=He):He=t[60];let Ue;t[61]!==l||t[62]!==de?(Ue=l({id:`MCjC9A`,values:{deleteDescriptorLabel:de}}),t[61]=l,t[62]=de,t[63]=Ue):Ue=t[63];let We;t[64]!==u.name||t[65]!==r||t[66]!==n.attrs.componentName||t[67]!==_?(We=()=>{if(typeof _==`number`)try{r.chain().focus().setNodeSelection(_).deleteSelection().run()||(ot(u.name),console.warn(JSON.stringify({event:`jsx-component-chrome-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ot(u.name),console.warn(JSON.stringify({event:`jsx-component-chrome-delete-failed`,component:u.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},t[64]=u.name,t[65]=r,t[66]=n.attrs.componentName,t[67]=_,t[68]=We):We=t[68];let Ge;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,X.jsx)(Ha,{size:12,"aria-hidden":`true`}),t[69]=Ge):Ge=t[69];let Ke;t[70]!==Ue||t[71]!==We?(Ke=(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn jsx-chrome-btn--delete`,"aria-label":Ue,onClick:We,children:Ge}),t[70]=Ue,t[71]=We,t[72]=Ke):Ke=t[72];let Je;t[73]!==l||t[74]!==M||t[75]!==fe?(Je=M&&(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`XPJ0sN`,values:{settingsDescriptorLabel:fe}}),children:(0,X.jsx)(Ma,{size:12,"aria-hidden":`true`})})}),t[73]=l,t[74]=M,t[75]=fe,t[76]=Je):Je=t[76];let Ye;t[77]!==Fe||t[78]!==Ie||t[79]!==Le||t[80]!==Re||t[81]!==ze||t[82]!==Be||t[83]!==Ve||t[84]!==He||t[85]!==Ke||t[86]!==Je?(Ye=(0,X.jsxs)(`div`,{className:`jsx-component-chrome`,contentEditable:!1,onMouseDown:Fe,...Ie,children:[Le,Re,ze,Be,Ve,He,Ke,Je]}),t[77]=Fe,t[78]=Ie,t[79]=Le,t[80]=Re,t[81]=ze,t[82]=Be,t[83]=Ve,t[84]=He,t[85]=Ke,t[86]=Je,t[87]=Ye):Ye=t[87];let Xe;t[88]!==ue||t[89]!==u.emptyChildName||t[90]!==u.hasChildren||t[91]!==u.isSelfClosing||t[92]!==u.name||t[93]!==r||t[94]!==s||t[95]!==W||t[96]!==O||t[97]!==n.attrs.componentName||t[98]!==n.childCount||t[99]!==ge||t[100]!==re||t[101]!==ie||t[102]!==I||t[103]!==p||t[104]!==F?(Xe=F&&I?(0,X.jsx)(Sc,{asChild:!0,children:(0,X.jsx)(p1,{label:I.label,Icon:I.Icon,onClick:ge,selected:O})}):(0,X.jsx)(t2,{resetKey:ie,onError:p,descriptorName:u.name===`*`?`wildcard`:u.name,rawComponentName:n.attrs.componentName??``,children:(0,X.jsx)(nk,{value:typeof s==`function`?{editor:r,getPos:()=>{let e=s();return typeof e==`number`?e:void 0},addChild:u.emptyChildName?()=>{let e=u.emptyChildName,t=lM(e),n=W();r.chain().focus().insertContentAt(n,t).run(),pM(r,n,rM(e))}:null}:null,children:(0,X.jsx)(ue,{...re,children:(0,X.jsx)(Jl,{className:`component-children ${!u.hasChildren&&n.childCount===0?`min-h-0 m-0 p-0`:``}`,...!u.hasChildren||u.isSelfClosing?{contentEditable:!1}:{}})})})}),t[88]=ue,t[89]=u.emptyChildName,t[90]=u.hasChildren,t[91]=u.isSelfClosing,t[92]=u.name,t[93]=r,t[94]=s,t[95]=W,t[96]=O,t[97]=n.attrs.componentName,t[98]=n.childCount,t[99]=ge,t[100]=re,t[101]=ie,t[102]=I,t[103]=p,t[104]=F,t[105]=Xe):Xe=t[105];let Ze;t[106]!==u.emptyChildName||t[107]!==u.name||t[108]!==r||t[109]!==W||t[110]!==n.childCount?(Ze=u.emptyChildName&&!(u.name===`Tabs`&&n.childCount>0)&&(()=>{let e=u.emptyChildName;return(0,X.jsx)(`button`,{type:`button`,contentEditable:!1,className:n.childCount===0?`jsx-empty-child-placeholder`:`jsx-add-child-pill`,onMouseDown:o2,onClick:()=>{let e=u.emptyChildName,t=lM(e),n=W();r.chain().focus().insertContentAt(n,t).run(),pM(r,n,rM(e))},"data-clipboard-omit":`true`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(o,{id:`7Fkcej`,values:{addChildName:e}})})})})(),t[106]=u.emptyChildName,t[107]=u.name,t[108]=r,t[109]=W,t[110]=n.childCount,t[111]=Ze):Ze=t[111];let Qe;t[112]!==Ce||t[113]!==u.name||t[114]!==ye||t[115]!==me||t[116]!==be||t[117]!==A||t[118]!==we||t[119]!==Te||t[120]!==Ee||t[121]!==De||t[122]!==Oe||t[123]!==ke||t[124]!==Ae||t[125]!==je||t[126]!==Me||t[127]!==Ne||t[128]!==Ye||t[129]!==Xe||t[130]!==Ze?(Qe=(0,X.jsxs)(Ce,{className:`jsx-component-wrapper my-2`,"data-jsx-component":``,"data-component-type":we,"data-align":Te,"data-selected":Ee,"data-has-child-selected":De,"data-range-selected":Oe,"data-selection-origin":A,"data-dragging":ke,"data-needs-config":Ae,role:je,"aria-label":ye,tabIndex:Me,...Ne,"data-component-name":Pe,onClick:me,onKeyDown:be,children:[Ye,Xe,Ze]}),t[112]=Ce,t[113]=u.name,t[114]=ye,t[115]=me,t[116]=be,t[117]=A,t[118]=we,t[119]=Te,t[120]=Ee,t[121]=De,t[122]=Oe,t[123]=ke,t[124]=Ae,t[125]=je,t[126]=Me,t[127]=Ne,t[128]=Ye,t[129]=Xe,t[130]=Ze,t[131]=Qe):Qe=t[131];let $e;t[132]!==l||t[133]!==N||t[134]!==u.Component||t[135]!==u.displayName||t[136]!==u.name||t[137]!==z||t[138]!==R||t[139]!==r||t[140]!==s||t[141]!==_||t[142]!==re||t[143]!==B?($e=R&&typeof _==`number`?(0,X.jsx)(gZ,{open:z,onOpenChange:B,initialValue:typeof N[R.propName]==`string`?N[R.propName]:``,language:R.language,title:l({id:`ky9Tuc`,values:{0:u.displayName??u.name}}),renderPreview:e=>{let t=u.Component;return(0,X.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-4`,children:(0,X.jsx)(t,{...re,[R.propName]:e})})},onSave:e=>{let t=typeof s==`function`?s():void 0;if(typeof t!=`number`)return;let n=r.state.doc.nodeAt(t);if(n&&n.attrs.kind===`element`)try{let i={...n.attrs.props??{},[R.propName]:e},a={...n.attrs,props:i,sourceDirty:!0};r.view.dispatch(r.state.tr.setNodeMarkup(t,null,a))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[JsxComponentView] edit-save failed — position race`,t)}}}):null,t[132]=l,t[133]=N,t[134]=u.Component,t[135]=u.displayName,t[136]=u.name,t[137]=z,t[138]=R,t[139]=r,t[140]=s,t[141]=_,t[142]=re,t[143]=B,t[144]=$e):$e=t[144];let et;t[145]!==u||t[146]!==r||t[147]!==s||t[148]!==M||t[149]!==L||t[150]!==V||t[151]!==pe||t[152]!==F?(et=M&&(0,X.jsxs)(xc,{side:F?`bottom`:`right`,align:F?`center`:`start`,sideOffset:F?-4:8,className:`w-64 p-3 z-[60] overflow-y-auto subtle-scrollbar max-h-[calc(100vh-2rem)] overscroll-contain`,onCloseAutoFocus:L?e=>{e.preventDefault(),r.view.focus()}:void 0,children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:(0,X.jsx)(o,{id:`Mnavhe`,values:{propPanelDescriptorLabel:pe}})}),(0,X.jsx)(e0,{descriptor:u,values:V,onChange:(e,t)=>{let n=typeof s==`function`?s():void 0;if(typeof n!=`number`)return;let i=r.state.doc.nodeAt(n);if(!i||i.attrs.kind!==`element`)return;let a={...i.attrs.props??{}},o=Array.isArray(i.attrs.attributes)?i.attrs.attributes:[],c=o;t===void 0?(delete a[e],c=o.filter(t=>!(typeof t==`object`&&t&&t.type===`mdxJsxAttribute`&&t.name===e))):a[e]=t,r.view.dispatch(r.state.tr.setNodeMarkup(n,null,{...i.attrs,attributes:c,props:a,sourceDirty:!0}))}})]}),t[145]=u,t[146]=r,t[147]=s,t[148]=M,t[149]=L,t[150]=V,t[151]=pe,t[152]=F,t[153]=et):et=t[153];let tt;return t[154]!==Se||t[155]!==xe||t[156]!==m||t[157]!==Qe||t[158]!==$e||t[159]!==et?(tt=(0,X.jsxs)(Se,{open:m,onOpenChange:xe,children:[Qe,$e,et]}),t[154]=Se,t[155]=xe,t[156]=m,t[157]=Qe,t[158]=$e,t[159]=et,t[160]=tt):tt=t[160],tt}function o2(e){return e.stopPropagation()}function s2(e){return e.stopPropagation()}function c2(e){return e.stopPropagation()}function l2(e){return e.stopPropagation()}function u2(e){return e.preventDefault()}function d2(e){return!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`}var f2=P.extend({addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return ru(a2)}}),p2={name:`InlineMath`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,category:`content`,description:`Inline math`,props:[{name:`formula`,type:`string`,required:!0,autoFocus:!0,description:`LaTeX inline math source`}]},m2=(0,Y.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-DX-tM4Fr.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,J.c)(4),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!1,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;return n[2]===i?a=n[3]:(a=(0,X.jsx)(`span`,{className:`math math-inline`,dangerouslySetInnerHTML:{__html:i}}),n[2]=i,n[3]=a),a}return{default:t}});function h2(){let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`span`,{className:`math math-inline math-placeholder math-placeholder-empty inline-flex items-center gap-1 rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs italic text-muted-foreground hover:bg-muted/60 cursor-pointer`,"data-component-type":`math-inline`,children:`f(x)`}),e[0]=t):t=e[0],t}function g2(e){let t=(0,J.c)(2),n;return t[0]===e.formula?n=t[1]:(n=(0,X.jsx)(`span`,{className:`math math-inline math-placeholder`,"data-component-type":`math-inline`,children:e.formula}),t[0]=e.formula,t[1]=n),n}function _2(e){let t=(0,J.c)(38),{node:n,selected:r,getPos:i,editor:a}=e,s=typeof n.attrs.formula==`string`?n.attrs.formula:``,c=typeof n.attrs.id==`string`?n.attrs.id:void 0,[l,u]=(0,Y.useState)(!1),d=(0,Y.useRef)(!1),f;t[0]!==a.state||t[1]!==i||t[2]!==r?(f=()=>{let e=r&&a.state.selection instanceof we;e&&!d.current?(fM(typeof i==`function`?i()??0:0),u(!0)):!e&&d.current&&u(!1),d.current=e},t[0]=a.state,t[1]=i,t[2]=r,t[3]=f):f=t[3];let p;t[4]!==a||t[5]!==i||t[6]!==r?(p=[r,i,a],t[4]=a,t[5]=i,t[6]=r,t[7]=p):p=t[7],(0,Y.useEffect)(f,p);let m=r?`math-inline-selected`:void 0,h;t[8]===c?h=t[9]:(h=c?{id:c}:{},t[8]=c,t[9]=h);let g;t[10]===s?g=t[11]:(g=s?(0,X.jsx)(d1,{resetKeys:[s],onError:y2,fallbackRender:()=>(0,X.jsx)(`span`,{className:`math math-inline math-error`,children:s}),children:(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(g2,{formula:s}),children:(0,X.jsx)(m2,{formula:s})})}):(0,X.jsx)(h2,{}),t[10]=s,t[11]=g);let _;t[12]!==s||t[13]!==h||t[14]!==g?(_=(0,X.jsx)(bc,{asChild:!0,children:(0,X.jsx)(`span`,{className:`math-inline-trigger`,"data-component-type":`math-inline`,"data-formula":s,...h,children:g})}),t[12]=s,t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]===a.view?v=t[17]:(v=e=>{e.preventDefault(),a.view.focus()},t[16]=a.view,t[17]=v);let y;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground px-3 pt-2`,children:(0,X.jsx)(o,{id:`EOjU5V`})}),t[18]=y):y=t[18];let b;t[19]===s?b=t[20]:(b={formula:s},t[19]=s,t[20]=b);let x;t[21]!==a.state||t[22]!==a.view||t[23]!==i?(x=(e,t)=>{let n=typeof i==`function`?i():void 0;if(typeof n!=`number`)return;let r=a.state.doc.nodeAt(n);if(!r||r.type.name!==`mathInline`)return;let o=a.state.tr.setNodeMarkup(n,null,{...r.attrs,[e]:t??``});o.setSelection(we.create(o.doc,n)),a.view.dispatch(o)},t[21]=a.state,t[22]=a.view,t[23]=i,t[24]=x):x=t[24];let S;t[25]!==x||t[26]!==b?(S=(0,X.jsx)(e0,{descriptor:p2,values:b,onChange:x}),t[25]=x,t[26]=b,t[27]=S):S=t[27];let C;t[28]!==S||t[29]!==v?(C=(0,X.jsxs)(xc,{className:`z-[60] w-72 p-0`,side:`bottom`,align:`start`,onOpenAutoFocus:v2,onCloseAutoFocus:v,children:[y,S]}),t[28]=S,t[29]=v,t[30]=C):C=t[30];let w;t[31]!==l||t[32]!==C||t[33]!==_?(w=(0,X.jsxs)(yc,{open:l,onOpenChange:u,children:[_,C]}),t[31]=l,t[32]=C,t[33]=_,t[34]=w):w=t[34];let T;return t[35]!==w||t[36]!==m?(T=(0,X.jsx)(Yl,{as:`span`,className:m,children:w}),t[35]=w,t[36]=m,t[37]=T):T=t[37],T}function v2(e){e.preventDefault()}function y2(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`mathInline`,rawComponentName:`mathInline`,error:String(n),stack:t.componentStack})),_t(`mathInline`)}var b2=H.extend({addNodeView(){return ru(_2)}});function x2(e,t){if(!e.selection.empty)return null;let n=t===`up`||t===`left`?-1:1,r=e.selection.$head,i=n>0?r.after():r.before();if(typeof i!=`number`)return null;let a=le.near(e.doc.resolve(i),n);return a.$head?.parent.type.name===`rawMdxFallback`?a:null}function S2(e,t){let{state:n,view:r}=e;if(!r.endOfTextblock(t))return!1;let i=x2(n,t);return i?(r.dispatch(n.tr.setSelection(i)),!0):!1}var C2=Gt.extend({addKeyboardShortcuts(){return{ArrowLeft:({editor:e})=>S2(e,`left`),ArrowRight:({editor:e})=>S2(e,`right`),ArrowUp:({editor:e})=>S2(e,`up`),ArrowDown:({editor:e})=>S2(e,`down`)}},addNodeView(){return ru(lZ,{stopEvent:()=>!0,ignoreMutation:()=>!0})}});function w2(e){let t=(0,J.c)(51),{items:n,selectedIndex:r,categoryLabels:a,onSelect:s,onHoverIndex:c}=e,l=(0,Y.useRef)(null),u=(0,Y.useId)(),{_:d}=i(),f=r>=0&&r<n.length?`${u}-option-${r}`:void 0,p=E2,m,h;if(t[0]===r?(m=t[1],h=t[2]):(m=()=>{let e=l.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(r);t&&t.scrollIntoView({block:`nearest`})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Y.useEffect)(m,h),n.length===0){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{ref:l,role:`status`,"aria-live":`polite`,className:`w-56 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:p,children:(0,X.jsx)(o,{id:`Ev2r9A`})}),t[4]=n):n=t[4],n}let g,_,v,y,b,x,S,C,w,T,E,D,O;if(t[5]!==d||t[6]!==f||t[7]!==a||t[8]!==n||t[9]!==u||t[10]!==c||t[11]!==s||t[12]!==r){let e=[],i=0,o=new Map;for(let t of n){o.set(t,i++);let n=e.find(e=>e.key===t.category);n?n.items.push(t):e.push({key:t.category,items:[t]})}_=r>=0&&r<n.length?n[r]:null;let m;t[26]===n?m=t[27]:(m=n.some(T2),t[26]=n,t[27]=m),g=m,x=`flex items-start gap-2`,S=l,C=`listbox`,t[28]===d?w=t[29]:(w=d({id:`RlCInP`}),t[28]=d,t[29]=w),T=f,E=-1,D=p,O=`w-56 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,t[30]===Symbol.for(`react.memo_cache_sentinel`)?(v={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[30]=v):v=t[30];let h=_?`${_.label}${_.preview?`. ${_.preview.description}`:``}`:``;t[31]===h?y=t[32]:(y=(0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:h}),t[31]=h,t[32]=y),b=e.map(e=>(0,X.jsxs)(`div`,{role:`group`,"aria-labelledby":`${u}-group-${e.key}`,children:[(0,X.jsx)(`div`,{id:`${u}-group-${e.key}`,className:`px-2 py-1.5 text-xs font-semibold text-muted-foreground`,children:a[e.key]??e.key}),e.items.map(e=>{let t=o.get(e)??0,n=t===r,i=e.icon;return(0,X.jsxs)(`button`,{id:`${u}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseEnter:()=>c?.(t),onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,X.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(`div`,{className:`flex flex-col min-w-0`,children:(0,X.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.name)})]},e.key)),t[5]=d,t[6]=f,t[7]=a,t[8]=n,t[9]=u,t[10]=c,t[11]=s,t[12]=r,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S,t[20]=C,t[21]=w,t[22]=T,t[23]=E,t[24]=D,t[25]=O}else g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19],C=t[20],w=t[21],T=t[22],E=t[23],D=t[24],O=t[25];let k;t[33]!==v||t[34]!==y||t[35]!==b||t[36]!==S||t[37]!==C||t[38]!==w||t[39]!==T||t[40]!==E||t[41]!==D||t[42]!==O?(k=(0,X.jsxs)(`div`,{ref:S,role:C,"aria-label":w,"aria-activedescendant":T,tabIndex:E,onMouseDown:D,className:O,style:v,children:[y,b]}),t[33]=v,t[34]=y,t[35]=b,t[36]=S,t[37]=C,t[38]=w,t[39]=T,t[40]=E,t[41]=D,t[42]=O,t[43]=k):k=t[43];let A;t[44]!==g||t[45]!==_?(A=g?(0,X.jsx)(`aside`,{"aria-hidden":`true`,onMouseDown:p,className:`w-64 rounded-lg border bg-popover p-2 shadow-md ${_?.preview?``:`invisible`}`,children:_?.preview?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`mb-2 flex aspect-5/3 items-center justify-center overflow-hidden rounded-md bg-muted/40 p-3 *:max-h-full *:max-w-full [&_img]:size-full [&_img]:rounded-md [&_img]:object-contain`,children:_.preview.render()}),(0,X.jsx)(`p`,{className:`px-1 pb-1 text-xs text-muted-foreground`,children:_.preview.description})]}):null}):null,t[44]=g,t[45]=_,t[46]=A):A=t[46];let j;return t[47]!==x||t[48]!==k||t[49]!==A?(j=(0,X.jsxs)(`div`,{className:x,children:[k,A]}),t[47]=x,t[48]=k,t[49]=A,t[50]=j):j=t[50],j}function T2(e){return e.preview}function E2(e){return e.preventDefault()}var D2=new b(`slashCommand`),O2=Wt.create({name:`slashCommand`,addOptions(){return{itemsSources:[EM],categoryLabels:{basic:`Basic blocks`,insert:`Insert`}}},addProseMirrorPlugins(){let e=this;return[Jy({editor:this.editor,pluginKey:D2,char:`/`,startOfLine:!1,allow:({editor:e})=>!tb(e),items:({query:t})=>{let n=e.options.itemsSources.flatMap(e=>{try{return e()}catch(e){return console.error(`[slash-command] item source threw an error`,e),[]}}),r=Object.keys(e.options.categoryLabels),i=e=>{let t=r.indexOf(e);return t===-1?1/0:t};return DM(n.map((e,t)=>({item:e,i:t})).sort((e,t)=>{let n=i(e.item.category)-i(t.item.category);return n===0?e.i-t.i:n}).map(e=>e.item),t)},command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).run()}catch(e){console.error(`[slash-command] deleteRange failed for "${n.name}"`,e);return}try{n.command(e)}catch(e){console.error(`[slash-command] command "${n.name}" threw an error`,e)}},render:()=>{let t=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=e=>{e!==r&&(r=e,s())},s=()=>{!t||!n||t.updateProps({items:n.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:n.command,onHoverIndex:o})};return{onStart(s){n=s,r=0;let c=nb(()=>n,`slash-command`);i.popup=c.popup,a=c.doPosition,t=new tu(w2,{props:{items:s.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:s.command,onHoverIndex:o},editor:s.editor}),c.popup.appendChild(t.element),i.stopAutoUpdate=c.startAutoUpdate(),c.reveal()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),s(),a?.()},onKeyDown({event:e}){if(!n||n.items.length===0)return!1;let t=n.items;if(e.key===`ArrowDown`)return r=(r+1)%t.length,s(),!0;if(e.key===`ArrowUp`)return r=(r-1+t.length)%t.length,s(),!0;if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e&&n.command(e),!0}return e.key,!1},onExit(){rb(i),a=null,t?.destroy(),t=null,n=null,r=0}}}})]}}),k2=new b(`sourceDirty`),A2=Wt.create({name:`sourceDirtyObserver`,addProseMirrorPlugins(){return[new S({key:k2,appendTransaction(e,t,n){if(!e.some(e=>!e.getMeta(Uv))||!e.some(e=>e.docChanged))return null;let r=new St;for(let t of e)r.appendMapping(t.mapping);let i=r.invert(),a=[];if(n.doc.descendants((e,n)=>{if(e.type.name!==`jsxComponent`||e.attrs.sourceDirty)return;let r=i.map(n),o=t.doc.nodeAt(r),s=!o||o.type.name!==`jsxComponent`,c=typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0;if(s&&c)return;if(!o){(e.content.size>0||Object.keys(e.attrs.props??{}).length>0)&&a.push({pos:n});return}if(o.type.name!==`jsxComponent`){a.push({pos:n});return}let l=!j2(o.attrs.props,e.attrs.props),u=!o.content.eq(e.content);(l||u)&&a.push({pos:n})}),a.length===0)return null;let o=n.tr;for(let{pos:e}of a)o.setNodeAttribute(e,`sourceDirty`,!0);return o}})]}});function j2(e,t){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!j2(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!j2(e[r],t[r]))return!1;return!0}function M2(e,t){let n=e.doc.nodeAt(t);if(!n||n.type.name!==`table`)return null;let r=he.get(n);return{map:r,tableStart:t+1,table:n,left:0,top:0,right:r.width,bottom:r.height}}function N2(e,t){let n=M2(e,t);return n?u(e.tr,n,n.map.width):null}function P2(e,t){let n=M2(e,t);return n?ct(e.tr,n,n.map.height):null}function F2(e,t){if(!e.dom.contains(t))return null;let n;try{n=e.posAtDOM(t,0)}catch{return null}return n<0?null:Zt(e.state.doc.resolve(n))?.pos??null}var I2=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`;function L2(e,t){let n=document.createElement(`button`);return n.type=`button`,n.className=`ok-table-insert-bar ok-table-insert-${e}`,n.setAttribute(`aria-label`,t),n.tabIndex=-1,n.setAttribute(fF,`true`),n.innerHTML=I2,n.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),n}var R2=class{overlays=new Map;mount;lastEditable;constructor(e,t){this.view=e,this.editor=t,this.mount=e.dom.parentElement??e.dom,this.lastEditable=t.isEditable,this.reconcile()}update(e,t){let n=this.editor.isEditable!==this.lastEditable;this.lastEditable=this.editor.isEditable,!(!n&&t.doc.eq(this.view.state.doc))&&this.reconcile()}destroy(){for(let e of this.overlays.keys())this.removeOverlay(e)}reconcile(){if(!this.editor.isEditable){this.destroy();return}let e=new Set(this.view.dom.querySelectorAll(`.tableWrapper`));for(let t of this.overlays.keys())e.has(t)||this.removeOverlay(t);for(let t of e)this.overlays.has(t)||this.addOverlay(t)}addOverlay(e){let t=document.createElement(`div`);t.className=`ok-table-insert-controls`,t.setAttribute(fF,`true`);let n=L2(`column`,`Add column`),r=L2(`row`,`Add row`);n.addEventListener(`click`,()=>this.insert(e,N2)),r.addEventListener(`click`,()=>this.insert(e,P2)),t.append(n,r),this.mount.appendChild(t);let i=z(e,t,()=>{let{width:t,height:i}=e.getBoundingClientRect();Bt(e,n,{strategy:`absolute`,placement:`right-start`}).then(({x:e,y:t})=>{n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.height=`${i}px`}).catch(()=>{}),Bt(e,r,{strategy:`absolute`,placement:`bottom-start`}).then(({x:e,y:n})=>{r.style.left=`${e}px`,r.style.top=`${n}px`,r.style.width=`${t}px`}).catch(()=>{})}),a=e=>{let t=e.target instanceof Element?e.target.closest(`td, th`):null,i=t?.parentElement;n.classList.toggle(`is-active`,!!t&&t===i?.lastElementChild),r.classList.toggle(`is-active`,!!i&&i===i.parentElement?.lastElementChild)},o=()=>{n.classList.remove(`is-active`),r.classList.remove(`is-active`)};e.addEventListener(`pointerover`,a),e.addEventListener(`pointerleave`,o),this.overlays.set(e,{container:t,cleanup:()=>{i(),e.removeEventListener(`pointerover`,a),e.removeEventListener(`pointerleave`,o),t.remove()}})}removeOverlay(e){let t=this.overlays.get(e);t&&(t.cleanup(),this.overlays.delete(e))}insert(e,t){let n=e.querySelector(`table`);if(!n)return;let r=F2(this.view,n);if(r===null)return;let i=t(this.view.state,r);i&&(this.view.dispatch(i),this.view.focus())}},z2=Wt.create({name:`tableInsertControls`,addProseMirrorPlugins(){let e=this.editor;return[new S({key:new b(`tableInsertControls`),view:t=>new R2(t,e)})]}}),B2=`ok:tag-click`;function V2(e){if(typeof document>`u`)return;let t={value:e};document.dispatchEvent(new CustomEvent(B2,{detail:t}))}function H2(e){return e instanceof Element?e.closest(`a[data-tag]`):null}var U2=Wt.create({name:`tagClick`,addProseMirrorPlugins(){return[new S({props:{handleDOMEvents:{click(e,t){let n=H2(t.target);if(!n)return!1;let r=n.getAttribute(`data-tag`);return r?(t.preventDefault(),t.stopPropagation(),V2(r),!0):!1}}}})]}});function W2(e,t,n){if(typeof t!=`number`||!n||!D.test(n))return!1;let{state:r,view:i}=e,a=r.doc.nodeAt(t);if(!a||a.type.name!==`tag`)return!1;let o=r.tr.setNodeMarkup(t,null,{...a.attrs,value:n}),s=t+a.nodeSize;return o.insertText(` `,s),o.setSelection(f.create(o.doc,s+1)),i.dispatch(o),i.focus(),!0}function G2(e,t){if(typeof t!=`number`)return;let{state:n,view:r}=e,i=n.doc.nodeAt(t);if(!i||i.type.name!==`tag`)return;let a=n.tr.delete(t,t+i.nodeSize);r.dispatch(a),r.focus()}function K2(e){let t=(0,J.c)(3),{value:n}=e,r=`#tag/${n}`,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsxs)(`a`,{className:`tag`,"data-tag":n,href:r,children:[`#`,n]}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function q2(e){let t=(0,J.c)(20),{initialDraft:n,onCommit:r,onCancel:a}=e,{_:o}=i(),s=(0,Y.useRef)(null),[c,l]=(0,Y.useState)(n),u=(0,Y.useRef)(!1),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=requestAnimationFrame(()=>{s.current?.focus()});return()=>cancelAnimationFrame(e)},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,Y.useEffect)(d,f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono`,children:`#`}),t[2]=p):p=t[2];let m=Math.max(c.length,8),h;t[3]===o?h=t[4]:(h=o({id:`U2pMtf`}),t[3]=o,t[4]=h);let g;t[5]===o?g=t[6]:(g=o({id:`knjOzA`}),t[5]=o,t[6]=g);let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{let t=e.target.value;(t===``||D.test(t))&&l(t)},t[7]=_):_=t[7];let v,y;t[8]!==c||t[9]!==a||t[10]!==r?(v=e=>{e.key===`Enter`||e.key===` `?(e.preventDefault(),u.current=!0,r(c)||(u.current=!1,a())):(e.key===`Escape`||e.key===`Backspace`&&c===``)&&(e.preventDefault(),a())},y=()=>{if(!u.current){if(c===``){a();return}D.test(c)?r(c):a()}},t[8]=c,t[9]=a,t[10]=r,t[11]=v,t[12]=y):(v=t[11],y=t[12]);let b;return t[13]!==c||t[14]!==m||t[15]!==h||t[16]!==g||t[17]!==v||t[18]!==y?(b=(0,X.jsxs)(`span`,{className:`tag tag-placeholder inline-flex items-center rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs text-muted-foreground`,"data-component-type":`tag-placeholder`,children:[p,(0,X.jsx)(`input`,{ref:s,type:`text`,value:c,size:m,placeholder:h,"aria-label":g,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`,className:`bg-transparent border-0 p-0 outline-none focus:outline-none focus:ring-0 text-inherit font-inherit`,onChange:_,onKeyDown:v,onBlur:y})]}),t[13]=c,t[14]=m,t[15]=h,t[16]=g,t[17]=v,t[18]=y,t[19]=b):b=t[19],b}function J2(e){let t=(0,J.c)(5),{node:n,getPos:r,editor:i}=e,a=typeof n.attrs.value==`string`?n.attrs.value:``;if(a===``){let e;return t[0]!==i||t[1]!==r?(e=(0,X.jsx)(Yl,{as:`span`,children:(0,X.jsx)(q2,{initialDraft:``,onCommit:e=>W2(i,typeof r==`function`?r():void 0,e),onCancel:()=>G2(i,typeof r==`function`?r():void 0)})}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let o;return t[3]===a?o=t[4]:(o=(0,X.jsx)(Yl,{as:`span`,children:(0,X.jsx)(K2,{value:a})}),t[3]=a,t[4]=o),o}var Y2=Lt.extend({priority:200,addNodeView(){return ru(J2)},addKeyboardShortcuts(){return{Backspace:()=>{if(ib.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(ib.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[db(this.editor)]}}),X2=2048,Z2=24;function Q2(e){if(typeof e!=`string`)return{kind:`unsupported`,value:``};let t=e.trim();if(t===``||t.length>X2)return{kind:`unsupported`,value:``};if(t4(t))return{kind:`emoji`,value:t};let n=n4(t);return n===`url`?{kind:`url`,value:t}:n===`path`?{kind:`path`,value:Fe(`/api/asset?path=${encodeURIComponent(e4(t))}`)}:{kind:`unsupported`,value:``}}function $2(e){if(typeof e!=`string`)return{kind:`unsupported`,value:``};let t=e.trim();if(t===``||t.length>X2)return{kind:`unsupported`,value:``};let n=n4(t);return n===`url`?{kind:`url`,value:t}:n===`path`?{kind:`path`,value:Fe(`/api/asset?path=${encodeURIComponent(e4(t))}`)}:{kind:`unsupported`,value:``}}function e4(e){return e.startsWith(`/`)?e.slice(1):e}function t4(e){if(/\p{L}/u.test(e)||e.includes(`/`))return!1;let t=0;for(let n of e)t++;if(t>Z2)return!1;let n=e.lastIndexOf(`.`);if(n>-1){let t=e.slice(n+1).toLowerCase();if(g.has(t))return!1}return!0}function n4(e){let t=r4(e);if(!t||!g.has(t))return`unsupported`;let n=e.indexOf(`:`),r=e.indexOf(`/`);return n>-1&&(r===-1||n<r)?v(e)?`url`:`unsupported`:e.startsWith(`//`)||e.includes(`?`)||e.includes(`#`)||e.startsWith(`../`)||e.includes(`/../`)?`unsupported`:`path`}function r4(e){let t=e.lastIndexOf(`/`),n=t>-1?e.slice(t+1):e,r=n.search(/[?#]/),i=r>-1?n.slice(0,r):n,a=i.lastIndexOf(`.`);return a<=0||a===i.length-1?null:i.slice(a+1).toLowerCase()}function i4(e){let t=(0,J.c)(131),{open:n,target:r,alias:a,anchor:s,pages:c,assetPaths:l,loading:u,onOpenChange:d,onSave:f}=e,[p,m]=(0,Y.useState)(r),[h,g]=(0,Y.useState)(a??``),[_,v]=(0,Y.useState)(s??``),y=(0,Y.useId)(),b=(0,Y.useId)(),x=(0,Y.useId)(),S=(0,Y.useId)(),{_:C}=i(),w;t[0]!==l||t[1]!==p?(w=iO(p,l),t[0]=l,t[1]=p,t[2]=w):w=t[2];let T=w,E;t[3]!==l||t[4]!==p||t[5]!==c?(E=aO(p,c,l),t[3]=l,t[4]=p,t[5]=c,t[6]=E):E=t[6];let D=$$(p,E&&!T&&n),O=(0,Y.useRef)(!1),k,A;t[7]!==a||t[8]!==s||t[9]!==n||t[10]!==r?(k=()=>{if(!n){O.current=!1;return}O.current||(O.current=!0,m(r),g(a??``),v(s??``))},A=[n,r,a,s],t[7]=a,t[8]=s,t[9]=n,t[10]=r,t[11]=k,t[12]=A):(k=t[11],A=t[12]),(0,Y.useEffect)(k,A);let j;t[13]!==h||t[14]!==_||t[15]!==p||t[16]!==d||t[17]!==f?(j=function(){let e=p.trim();e&&(f(e,h.trim()||null,_.trim()||null),d(!1))},t[13]=h,t[14]=_,t[15]=p,t[16]=d,t[17]=f,t[18]=j):j=t[18];let M=j,N;t[19]===M?N=t[20]:(N=function(e){e.key===`Enter`&&(e.preventDefault(),M())},t[19]=M,t[20]=N);let P=N,F;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){m(e.path),v(``)},t[21]=F):F=t[21];let I=F,L,ee,R,z,B,V,H,U,te,ne,re,ie,ae,W,oe,se,G;if(t[22]!==C||t[23]!==x||t[24]!==b||t[25]!==l||t[26]!==h||t[27]!==_||t[28]!==p||t[29]!==P||t[30]!==S||t[31]!==D||t[32]!==u||t[33]!==d||t[34]!==n||t[35]!==c||t[36]!==y){let e=new Map,r=D?.map(t=>{let n=e.get(t.slug)??0;e.set(t.slug,n+1);let r=n===0?t.slug:`${t.slug}-${n}`;return{...t,reactKey:r}}),i=!!r?.length;R=$n,W=n,oe=d,ee=Gn,U=`sm:max-w-xl`,te=``,ne=L$,re=L$,ie=L$;let a;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Bn,{children:(0,X.jsx)(o,{id:`xzktOa`})}),t[54]=a):a=t[54],t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,X.jsxs)(Qn,{children:[a,(0,X.jsx)(Rn,{children:(0,X.jsx)(o,{id:`Jhj_lh`})})]}),t[55]=ae):ae=t[55],L=Jn,B=`space-y-6`;let s;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(o,{id:`lGs_bQ`,components:{0:(0,X.jsx)(`span`,{className:`text-red-500`})}}),t[56]=s):s=t[56];let f;t[57]===y?f=t[58]:(f=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:y,children:s}),t[57]=y,t[58]=f);let w;t[59]===C?w=t[60]:(w=C({id:`aM23Wr`}),t[59]=C,t[60]=w);let T;t[61]!==l||t[62]!==p||t[63]!==P||t[64]!==u||t[65]!==c||t[66]!==w||t[67]!==y?(T=(0,X.jsx)(B$,{id:y,value:p,pages:c,assetPaths:l,includeAssets:!0,loading:u,onValueChange:m,onSuggestionSelect:I,placeholder:w,autoFocus:!0,"aria-required":`true`,onKeyDown:P}),t[61]=l,t[62]=p,t[63]=P,t[64]=u,t[65]=c,t[66]=w,t[67]=y,t[68]=T):T=t[68],t[69]!==f||t[70]!==T?(V=(0,X.jsxs)(`div`,{children:[f,T]}),t[69]=f,t[70]=T,t[71]=V):V=t[71];let E;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(o,{id:`OTF92M`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[72]=E):E=t[72];let O;t[73]===x?O=t[74]:(O=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:x,children:E}),t[73]=x,t[74]=O);let k;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>g(e.target.value),t[75]=k):k=t[75];let A;t[76]===C?A=t[77]:(A=C({id:`BH56dn`}),t[76]=C,t[77]=A);let j;t[78]!==x||t[79]!==h||t[80]!==P||t[81]!==A?(j=(0,X.jsx)(ir,{id:x,value:h,onChange:k,placeholder:A,onKeyDown:P}),t[78]=x,t[79]=h,t[80]=P,t[81]=A,t[82]=j):j=t[82],t[83]!==O||t[84]!==j?(H=(0,X.jsxs)(`div`,{children:[O,j]}),t[83]=O,t[84]=j,t[85]=H):H=t[85];let M;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,X.jsx)(o,{id:`Tjc1pH`,components:{0:(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[86]=M):M=t[86],t[87]===b?se=t[88]:(se=(0,X.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:b,children:M}),t[87]=b,t[88]=se);let N;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>v(e.target.value),t[89]=N):N=t[89];let F;t[90]===C?F=t[91]:(F=C({id:`W-ntoW`}),t[90]=C,t[91]=F),t[92]!==b||t[93]!==_||t[94]!==P||t[95]!==F?(G=(0,X.jsx)(ir,{id:b,value:_,onChange:N,placeholder:F,onKeyDown:P}),t[92]=b,t[93]=_,t[94]=P,t[95]=F,t[96]=G):G=t[96],z=i&&(0,X.jsx)(`div`,{id:S,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:r.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":_===e.slug,className:vn(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,_===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>v(_===e.slug?``:e.slug),children:[(0,X.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,X.jsx)(`span`,{className:`truncate`,children:e.text})]},e.reactKey))}),t[22]=C,t[23]=x,t[24]=b,t[25]=l,t[26]=h,t[27]=_,t[28]=p,t[29]=P,t[30]=S,t[31]=D,t[32]=u,t[33]=d,t[34]=n,t[35]=c,t[36]=y,t[37]=L,t[38]=ee,t[39]=R,t[40]=z,t[41]=B,t[42]=V,t[43]=H,t[44]=U,t[45]=te,t[46]=ne,t[47]=re,t[48]=ie,t[49]=ae,t[50]=W,t[51]=oe,t[52]=se,t[53]=G}else L=t[37],ee=t[38],R=t[39],z=t[40],B=t[41],V=t[42],H=t[43],U=t[44],te=t[45],ne=t[46],re=t[47],ie=t[48],ae=t[49],W=t[50],oe=t[51],se=t[52],G=t[53];let ce;t[97]!==z||t[98]!==se||t[99]!==G?(ce=(0,X.jsxs)(`div`,{children:[se,G,z]}),t[97]=z,t[98]=se,t[99]=G,t[100]=ce):ce=t[100];let le;t[101]!==B||t[102]!==V||t[103]!==H||t[104]!==ce?(le=(0,X.jsxs)(`div`,{className:B,children:[V,H,ce]}),t[101]=B,t[102]=V,t[103]=H,t[104]=ce,t[105]=le):le=t[105];let ue;t[106]!==L||t[107]!==le?(ue=(0,X.jsx)(L,{children:le}),t[106]=L,t[107]=le,t[108]=ue):ue=t[108];let de;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,X.jsx)(Zn,{asChild:!0,children:(0,X.jsx)(Mn,{variant:`outline`,children:(0,X.jsx)(o,{id:`dEgA5A`})})}),t[109]=de):de=t[109];let fe;t[110]===p?fe=t[111]:(fe=p.trim(),t[110]=p,t[111]=fe);let pe=!fe,me;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,X.jsx)(o,{id:`tfDRzk`}),t[112]=me):me=t[112];let he;t[113]!==M||t[114]!==pe?(he=(0,X.jsxs)(Yn,{children:[de,(0,X.jsx)(Mn,{onClick:M,disabled:pe,children:me})]}),t[113]=M,t[114]=pe,t[115]=he):he=t[115];let ge;t[116]!==ee||t[117]!==U||t[118]!==te||t[119]!==ne||t[120]!==re||t[121]!==ie||t[122]!==ae||t[123]!==ue||t[124]!==he?(ge=(0,X.jsxs)(ee,{className:U,"data-ok-layer-spawned":te,onPointerDownOutside:ne,onFocusOutside:re,onInteractOutside:ie,children:[ae,ue,he]}),t[116]=ee,t[117]=U,t[118]=te,t[119]=ne,t[120]=re,t[121]=ie,t[122]=ae,t[123]=ue,t[124]=he,t[125]=ge):ge=t[125];let _e;return t[126]!==R||t[127]!==W||t[128]!==oe||t[129]!==ge?(_e=(0,X.jsx)(R,{open:W,onOpenChange:oe,children:ge}),t[126]=R,t[127]=W,t[128]=oe,t[129]=ge,t[130]=_e):_e=t[130],_e}function a4(e){let t=(0,J.c)(115),{editor:n,getPos:r,onClose:a,onNavigate:s}=e,c=r(),l=c==null?null:n.state.doc.nodeAt(c),u=String(l?.attrs.target??``),d=re(l?.attrs.alias),f=re(l?.attrs.anchor),p=Kt({target:u,alias:d,anchor:f}),{addPage:m,assetPaths:h,folderPaths:g,pages:_,pagesBySlug:v,pagesByBasename:y,loading:b}=Ut(),x=fe(u,f),S=x?.kind===`external`?x:null,C=x?.kind===`asset`?iO(x.url,h)??x.url.replace(/^\//,``):null,T=C?null:LY(u,{pages:_,folderPaths:g,pagesBySlug:v,pagesByBasename:y,fallbackTargets:eO(u)}),[E,D]=(0,Y.useState)(!1),[O,k]=(0,Y.useState)(!1),{_:A}=i();if(!l)return null;let j;t[0]!==n.state||t[1]!==n.view||t[2]!==r?(j=function(e,t,i){let a=r();a!=null&&n.view.dispatch(n.state.tr.setNodeMarkup(a,void 0,{...n.state.doc.nodeAt(a)?.attrs,target:e,alias:t,anchor:i}))},t[0]=n.state,t[1]=n.view,t[2]=r,t[3]=j):j=t[3];let M=j,N;t[4]!==n.state||t[5]!==n.view||t[6]!==r||t[7]!==a?(N=function(){let e=r();if(e==null)return;let t=n.state.doc.nodeAt(e);t&&(n.view.dispatch(n.state.tr.delete(e,e+t.nodeSize)),a())},t[4]=n.state,t[5]=n.view,t[6]=r,t[7]=a,t[8]=N):N=t[8];let P=N,I=function(e){if(e!==u){let t=r();if(t==null)return;n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...n.state.doc.nodeAt(t)?.attrs,target:e,alias:d??p}))}},L=function(){return T?.kind===`create`?{initialDir:T.initialDir,suggestedName:T.suggestedName}:null},ee=async function(){let e=L();if(!(!e||O)){k(!0);try{await T$(e,{addPage:m,onCreated(e){I(e),window.location.hash=`#/${e}`,a()}}),k(!1)}catch(e){let t=e;nr.error(t instanceof Error?t.message:A({id:`tfi40B`})),k(!1)}}},z=!S&&!b&&C!==null,B=!S&&!b&&T?.kind===`navigate`&&T.displayState===`resolved`,V=!S&&!b&&T?.kind===`navigate`&&T.displayState===`folder`,H=!S&&!b&&!C&&T?.kind===`create`,U=!!S,te=S?WY(S.url)?S.url:null:z&&C?xt(C):B&&T?.kind===`navigate`?qY({docName:T.hashDocName,anchor:f}):null,ne=!b&&te!==null&&(U||z||B),ie,ae,W,oe,se;if(t[9]!==A||t[10]!==d||t[11]!==f||t[12]!==C||t[13]!==n.state||t[14]!==n.view||t[15]!==S||t[16]!==r||t[17]!==z||t[18]!==V||t[19]!==B||t[20]!==H||t[21]!==b||t[22]!==u){if(b){let e;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(xa,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[28]=e):e=t[28],W={icon:e,text:A({id:`yQE2r9`}),className:`text-muted-foreground/80`}}else if(S){let e;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(R,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[29]=e):e=t[29],W={icon:e,text:A({id:`hpDtUm`}),className:`text-muted-foreground`}}else if(z){let e;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Qi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[30]=e):e=t[30],W={icon:e,text:A({id:`bUUVED`}),className:`text-muted-foreground`}}else if(V){let e;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ia,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[31]=e):e=t[31],W={icon:e,text:A({id:`kNqMMd`}),className:`text-muted-foreground`}}else if(H){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[32]=e):e=t[32],W={icon:e,text:A({id:`8F1i42`}),className:`text-red-700 dark:text-red-300`}}else if(B){let e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ta,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[33]=e):e=t[33],W={icon:e,text:A({id:`Hrz9NY`}),className:`text-muted-foreground`}}else{let e;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Bi,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[34]=e):e=t[34],W={icon:e,text:A({id:`DeDYLr`}),className:`text-muted-foreground/80`}}let e;t[35]!==n.state||t[36]!==n.view||t[37]!==r?(e=()=>{let e=r();if(typeof e!=`number`)return new DOMRect;let t=n.state.doc.nodeAt(e);if(!t)return new DOMRect;try{return rn(n.view,e,e+t.nodeSize)}catch{return new DOMRect}},t[35]=n.state,t[36]=n.view,t[37]=r,t[38]=e):e=t[38];let i;t[39]!==n.view.dom||t[40]!==e?(i={getBoundingClientRect:e,contextElement:n.view.dom},t[39]=n.view.dom,t[40]=e,t[41]=i):i=t[41],se=i,ae=C??(S?S.url:`${u}${f?`#${f}`:``}`);let a=f?`${u}#${f}`:u;ie=d?`[[${a}|${d}]]`:`[[${a}]]`,oe=vn(`flex shrink-0`,W.className),t[9]=A,t[10]=d,t[11]=f,t[12]=C,t[13]=n.state,t[14]=n.view,t[15]=S,t[16]=r,t[17]=z,t[18]=V,t[19]=B,t[20]=H,t[21]=b,t[22]=u,t[23]=ie,t[24]=ae,t[25]=W,t[26]=oe,t[27]=se}else ie=t[23],ae=t[24],W=t[25],oe=t[26],se=t[27];let G;t[42]!==W.icon||t[43]!==oe?(G=(0,X.jsx)(`span`,{className:oe,children:W.icon}),t[42]=W.icon,t[43]=oe,t[44]=G):G=t[44];let ce=G,le;t[45]!==ce||t[46]!==H||t[47]!==W.text?(le=H?(0,X.jsxs)(w,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(`span`,{className:`flex shrink-0`,"data-slot":`wiki-link-prop-panel-icon-trigger`,children:ce})}),(0,X.jsx)(F,{children:W.text})]}):ce,t[45]=ce,t[46]=H,t[47]=W.text,t[48]=le):le=t[48];let ue=le,de=`${W.text}: ${ae}`,pe;t[49]!==ae||t[50]!==U||t[51]!==H||t[52]!==te||t[53]!==ne||t[54]!==a||t[55]!==s?(pe=(0,X.jsx)(_e,{asChild:!0,children:ne?(0,X.jsx)(`a`,{href:te??void 0,...U?{target:`_blank`,rel:`noopener noreferrer`}:{},onClick:e=>QY(e,s,a),"data-slot":`wiki-link-prop-panel-text`,className:`block truncate text-sm font-medium text-foreground underline-offset-2 hover:underline focus-visible:underline`,children:ae}):(0,X.jsx)(`span`,{"data-slot":`wiki-link-prop-panel-text`,className:vn(`block truncate text-sm font-medium`,H?`text-muted-foreground`:`text-foreground`),children:ae})}),t[49]=ae,t[50]=U,t[51]=H,t[52]=te,t[53]=ne,t[54]=a,t[55]=s,t[56]=pe):pe=t[56];let me;t[57]===ae?me=t[58]:(me=(0,X.jsx)(F,{className:`max-w-80 break-all`,children:ae}),t[57]=ae,t[58]=me);let he;t[59]!==pe||t[60]!==me?(he=(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,X.jsxs)(w,{children:[pe,me]})}),t[59]=pe,t[60]=me,t[61]=he):he=t[61];let ge;t[62]!==ee||t[63]!==O||t[64]!==H?(ge=H?(0,X.jsxs)(Mn,{type:`button`,size:`sm`,variant:`link`,disabled:O,onClick:()=>void ee(),"data-slot":`wiki-link-prop-panel-create`,className:`flex items-center text-foreground`,children:[(0,X.jsx)(ka,{className:`size-3.5`,"aria-hidden":`true`}),O?(0,X.jsx)(o,{id:`HM56Bx`}):(0,X.jsx)(o,{id:`XRuL0i`})]}):null,t[62]=ee,t[63]=O,t[64]=H,t[65]=ge):ge=t[65];let ve;t[66]===A?ve=t[67]:(ve=A({id:`ePK91l`}),t[66]=A,t[67]=ve);let ye;t[68]===D?ye=t[69]:(ye=()=>D(!0),t[68]=D,t[69]=ye);let be;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,X.jsx)(Oa,{className:`size-3.5`,"aria-hidden":`true`}),t[70]=be):be=t[70];let xe;t[71]!==ve||t[72]!==ye?(xe=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":ve,onClick:ye,"data-slot":`wiki-link-prop-panel-edit`,children:be})}),t[71]=ve,t[72]=ye,t[73]=xe):xe=t[73];let Se;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`ePK91l`})}),t[74]=Se):Se=t[74];let Ce;t[75]===xe?Ce=t[76]:(Ce=(0,X.jsxs)(w,{children:[xe,Se]}),t[75]=xe,t[76]=Ce);let we;t[77]===ie?we=t[78]:(we=(0,X.jsx)(q$,{copyContent:ie}),t[77]=ie,t[78]=we);let Te;t[79]===A?Te=t[80]:(Te=A({id:`t_YqKh`}),t[79]=A,t[80]=Te);let Ee;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,X.jsx)(Ha,{className:`size-3.5`,"aria-hidden":`true`}),t[81]=Ee):Ee=t[81];let De;t[82]!==P||t[83]!==Te?(De=(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(Mn,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Te,onClick:P,"data-slot":`wiki-link-prop-panel-remove`,children:Ee})}),t[82]=P,t[83]=Te,t[84]=De):De=t[84];let Oe;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,X.jsx)(F,{children:(0,X.jsx)(o,{id:`t_YqKh`})}),t[85]=Oe):Oe=t[85];let ke;t[86]===De?ke=t[87]:(ke=(0,X.jsxs)(w,{children:[De,Oe]}),t[86]=De,t[87]=ke);let Ae;t[88]!==ge||t[89]!==Ce||t[90]!==we||t[91]!==ke?(Ae=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[ge,Ce,we,ke]}),t[88]=ge,t[89]=Ce,t[90]=we,t[91]=ke,t[92]=Ae):Ae=t[92];let je;t[93]!==ue||t[94]!==he||t[95]!==Ae?(je=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ue,he,Ae]}),t[93]=ue,t[94]=he,t[95]=Ae,t[96]=je):je=t[96];let Me;t[97]!==a||t[98]!==je||t[99]!==de||t[100]!==se?(Me=(0,X.jsx)(h$,{kind:`wiki-link`,ariaLabel:de,onDeactivate:a,triggerReference:se,className:`w-96`,children:je}),t[97]=a,t[98]=je,t[99]=de,t[100]=se,t[101]=Me):Me=t[101];let Ne;t[102]!==d||t[103]!==f||t[104]!==h||t[105]!==E||t[106]!==M||t[107]!==b||t[108]!==_||t[109]!==D||t[110]!==u?(Ne=(0,X.jsx)(i4,{open:E,target:u,alias:d,anchor:f,pages:_,assetPaths:h,loading:b,onOpenChange:D,onSave:M}),t[102]=d,t[103]=f,t[104]=h,t[105]=E,t[106]=M,t[107]=b,t[108]=_,t[109]=D,t[110]=u,t[111]=Ne):Ne=t[111];let Pe;return t[112]!==Me||t[113]!==Ne?(Pe=(0,X.jsxs)(X.Fragment,{children:[Me,Ne]}),t[112]=Me,t[113]=Ne,t[114]=Pe):Pe=t[114],Pe}var o4=0;function s4(){return`wiki-link-${++o4}`}function c4(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`span`);n.setAttribute(`data-wiki-link`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Wiki link: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-chip`),n.style.touchAction=`manipulation`;let r=t.createElement(`span`);r.setAttribute(`data-wiki-link-icon`,``),r.setAttribute(`aria-hidden`,`true`),n.appendChild(r);let i=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,a=t.createTextNode(i);return n.appendChild(a),{dom:n,iconSpan:r}}function l4(e,t){if(!t||!e)return null;let n=tO(e,t);if(!n)return null;let r=t.pageIcons?.get(n);if(!r)return null;let i=Q2(r);return i.kind===`unsupported`?null:i}function u4(e,t,n=document){let r=t?.kind??``,i=t?.value??``;if(e.getAttribute(`data-kind`)===r&&e.getAttribute(`data-value`)===i)return;for(e.setAttribute(`data-kind`,r),e.setAttribute(`data-value`,i);e.firstChild;)e.removeChild(e.firstChild);if(!t)return;if(t.kind===`emoji`){e.appendChild(n.createTextNode(t.value));return}let a=n.createElement(`img`);a.setAttribute(`src`,t.value),a.setAttribute(`alt`,``),a.setAttribute(`draggable`,`false`),a.setAttribute(`referrerpolicy`,`no-referrer`),e.appendChild(a)}var d4=pn.extend({priority:200,addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=s4(),{dom:i,iconSpan:a}=c4({nodeId:r,target:String(t.attrs.target??``),alias:t.attrs.alias==null?null:String(t.attrs.alias),anchor:t.attrs.anchor==null?null:String(t.attrs.anchor)}),o=t,s=()=>{u4(a,l4(String(o.attrs.target??``),nn()))};s();let c=dn(s),l=()=>{let e=n();return typeof e==`number`?e:void 0},u=VO(e),d=({newTab:e})=>{let t=o.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=fe(n,typeof t.anchor==`string`?t.anchor:null);if(!r)return!1;if(r.kind===`doc`){let t=nn(),i=LY(n,{pages:t?.pages??new Set,folderPaths:t?.folderPaths??new Set,pagesBySlug:t?.pagesBySlug,pagesByBasename:t?.pagesByBasename,fallbackTargets:eO(n)});if(i.kind===`create`||i.kind===`navigate`&&i.displayState===`folder`)return!1;let a=i.kind===`navigate`?i.hashDocName:r.docName;return e?XY({docName:a,anchor:r.anchor}):window.location.assign(qY({docName:a,anchor:r.anchor})),!0}if(r.kind===`asset`){let t=iO(r.url,nn()?.assetPaths??new Set)??r.url.replace(/^\//,``);return e?JY(xt(t)):window.location.hash=xt(t),!0}return WY(r.url)?(JY(r.url),!0):!1};return u.register({type:`wikiLink`,nodeId:r,getPos:l,controls:{propPanel:t=>(0,Y.createElement)(a4,{editor:e,getPos:l,onClose:t.deactivate,onNavigate:e=>d({newTab:e})})},handlePrimary:d}),{dom:i,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLink`)return!1;o=e;let t=String(e.attrs.target??``),n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor);i.setAttribute(`data-target`,t),i.setAttribute(`data-alias`,n??``),i.setAttribute(`data-anchor`,r??``),i.setAttribute(`aria-label`,`Wiki link: ${t}${r?`#${r}`:``}`);let a=n??`${t}${r?`#${r}`:``}`,c=i.lastChild;return c&&c.nodeType===3?c.nodeValue=a:i.appendChild(i.ownerDocument.createTextNode(a)),s(),!0},destroy:()=>{u.deregister(r),c()}}}},addKeyboardShortcuts(){return{Backspace:()=>{if(vX.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(vX.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[NX(this.editor)]}}),f4=0;function p4(){return`wiki-link-embed-${++f4}`}function m4(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`a`);n.setAttribute(`data-wiki-embed`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`href`,e.href),n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Embed: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-embed-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}function h4(e){let t=(e.doc??(typeof document<`u`?document:{createElement:null})).createElement(`img`);return t.setAttribute(`data-wiki-embed`,``),t.setAttribute(`data-node-id`,e.nodeId),t.setAttribute(`data-target`,e.target),t.setAttribute(`data-alias`,e.alias??``),t.setAttribute(`src`,Fe(e.src)),t.setAttribute(`alt`,e.alias??e.target),{dom:t}}function g4(e){let t=Ue(e);return t!==null&&g.has(t)}var _4=et.extend({addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=p4(),i=t,a=String(t.attrs.target??``),o=t.attrs.alias==null?null:String(t.attrs.alias),s=t.attrs.anchor==null?null:String(t.attrs.anchor),c=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(g4(a)){let{dom:e}=h4({nodeId:r,target:a,alias:o,src:c??a});return{dom:e,ignoreMutation:()=>!0,update:t=>{if(t.type.name!==`wikiLinkEmbed`)return!1;i=t;let n=String(t.attrs.target??``),r=t.attrs.alias==null?null:String(t.attrs.alias),a=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(!g4(n))return!1;let o=a??n;return e.setAttribute(`data-target`,n),e.setAttribute(`data-alias`,r??``),e.setAttribute(`src`,Fe(o)),e.setAttribute(`alt`,r??n),!0}}}let{dom:l}=m4({nodeId:r,target:a,alias:o,anchor:s,href:c??a});l.addEventListener(`click`,e=>{e.preventDefault()});let u=()=>{let e=n();return typeof e==`number`?e:void 0},d=VO(e);return d.register({type:`wikiLinkEmbed`,nodeId:r,getPos:u,controls:{},handlePrimary:({newTab:e})=>{let t=i.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=(typeof t.resolvedSrc==`string`&&t.resolvedSrc.length>0?t.resolvedSrc:null)??n,a=Ue(n);if(a===null)return!1;let o=_n(r,``)??n;return d$({url:r,projectRelPath:o,ext:a,title:o.split(`/`).pop()??r,forceOsDelegation:e}),!0}}),{dom:l,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLinkEmbed`)return!1;i=e;let t=String(e.attrs.target??``);if(g4(t))return!1;let n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor),a=(e.attrs.resolvedSrc==null?null:String(e.attrs.resolvedSrc))??t;return l.setAttribute(`data-target`,t),l.setAttribute(`data-alias`,n??``),l.setAttribute(`data-anchor`,r??``),l.setAttribute(`href`,a),l.setAttribute(`aria-label`,`Embed: ${t}${r?`#${r}`:``}`),l.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{d.deregister(r)}}}}}),v4=[...N.map(e=>{if(e.name===`jsxComponent`)return f2;if(e.name===`image`){let t=e.options??{};return c$.configure({...t,inline:!0})}return e.name===`rawMdxFallback`?C2:e.name===`wikiLink`?d4:e.name===`wikiLinkEmbed`?_4:e.name===`link`?c1:e.name===`mathInline`?b2:e.name===`tag`?Y2:e.name===`codeBlock`?cQ:e}),O2.configure({itemsSources:[EM,_M,TM,bM],categoryLabels:{content:`Components`,layout:`Layout`,media:`Media`,data:`Data`,embed:`Embeds`}}),a$,TD.configure({onDrop(e,t,n){for(let r of t)_O(r,e,n)},onPaste(e,t,n){for(let n of t)_O(n,e,e.state.selection.from)}}),o$,WD,U2,i$,n$,jM,z2,A2,OD,IM,C0,Wt.create({name:`chunkWrapperDecoration`,addProseMirrorPlugins(){return[HM()]}})];function y4(e){return e===Yt}function b4(){return Ec(`SYNC_TIMEOUT_MS`,3e4)}var x4=class extends Error{docName;elapsedMs;constructor(e,t){super(`Sync timed out for "${e}" after ${t}ms`),this.name=`SyncTimeoutError`,this.docName=e,this.elapsedMs=t}},S4=class extends Error{docName;constructor(e){super(`Provider disconnected before sync for "${e}"`),this.name=`PreSyncDisconnectError`,this.docName=e}},C4=class extends Error{docName;constructor(e){super(`Document not found: "${e}"`),this.name=`DocumentNotFoundError`,this.docName=e}},w4=class extends Error{docName;cause;constructor(e,t){let n=t instanceof Error?t.message:String(t??`unknown`);super(`Bridge setup failed for "${e}": ${n}`),this.name=`BridgeSetupError`,this.docName=e,this.cause=t}},T4=class extends Error{docName;missingCapability;constructor(e,t){super(`Server is missing capability "${t}" required to open "${e}".`),this.name=`ServerCapabilityMismatchError`,this.docName=e,this.missingCapability=t}},E4=new Map,D4=!1;function O4(){for(let e of E4.values())if(!e.settled)return!0;return!1}function k4(){typeof document>`u`||document.visibilityState===`visible`&&A4(Date.now())}function A4(e){let t=[];for(let[n,r]of E4){if(r.settled)continue;let i=e-r.createdAt;if(i<b4())continue;r.settled=!0;let a=new x4(n,i);P4(r),r.reject(a);let o=lS(n);o!==void 0&&bS(o),t.push({docName:n,elapsedMs:i})}if(t.length>0){let e=t.map(e=>`${e.docName} (${e.elapsedMs}ms)`).join(`, `);console.warn(`[syncPromise] reaped ${t.length} timed-out ${t.length===1?`entry`:`entries`} on visibility restore (tab-sleep recovered): ${e}`)}return O4()||M4(),t.length}function j4(){D4||typeof document>`u`||(document.addEventListener(`visibilitychange`,k4),D4=!0)}function M4(){D4&&(typeof document>`u`||(document.removeEventListener(`visibilitychange`,k4),D4=!1))}var N4=new Map;function P4(e){e.detached||(e.detached=!0,e.timeoutHandle!==null&&clearTimeout(e.timeoutHandle),e.provider.off(`synced`,e.onSynced),e.provider.off(`close`,e.onClose))}function F4(e,t){let n=E4.get(e);if(n)return n.promise;let r=N4.get(e);if(r!==void 0){N4.delete(e);let n=r===`timeout`?new x4(e,0):new S4(e);console.warn(`[syncPromise] ${e} rejected on creation (test hook, armed ${r}): ${n.message}`),Z(`ok/sync/create`,{docName:e,mountId:lS(e),warm:!1,armed:r}),Z(`ok/sync/reject`,{docName:e,mountId:lS(e),reason:`armed-${r}`});let i=L4(n);return E4.set(e,R4(i,t)),i}if(t.synced){console.log(`[syncPromise] ${e} resolved synchronously (warm provider)`);let n=lS(e);Z(`ok/sync/create`,{docName:e,mountId:n,warm:!0}),Z(`ok/sync/resolve`,{docName:e,mountId:n,elapsedMs:0,warm:!0}),Z.histogram(`ok/sync/resolve-elapsed-ms`,n===void 0?{docName:e,warm:!0}:{docName:e,mountId:n,warm:!0},0);let r=Promise.resolve();return E4.set(e,I4(r,t)),r}let i=Date.now(),a=()=>{},o=()=>{},s=new Promise((e,t)=>{a=e,o=t}),c=()=>{let t=E4.get(e);if(!t||t.settled)return;t.settled=!0,t.resolved=!0;let n=Date.now()-t.createdAt;console.log(`[syncPromise] ${e} resolved in ${n}ms`);let r=lS(e);if(Z(`ok/sync/resolve`,{docName:e,mountId:r,elapsedMs:n,warm:!1}),Z.histogram(`ok/sync/resolve-elapsed-ms`,r===void 0?{docName:e}:{docName:e,mountId:r},n),P4(t),O4()||M4(),t.resolve(),r!==void 0){let i=Date.now();yS(r,`ok.sync-promise`,{"doc.name":e,elapsed_ms:n},t.createdAt,i),bS(r,i)}},l=t=>{let n=E4.get(e);if(!n||n.settled)return;n.settled=!0;let r=new S4(e);console.warn(`[syncPromise] ${e} rejected: ${r.message}`);let i=lS(e);Z(`ok/sync/reject`,{docName:e,mountId:i,reason:`pre-sync-disconnect`}),P4(n),O4()||M4(),n.reject(r),i!==void 0&&bS(i)},u=setTimeout(()=>{let t=E4.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt,r=new x4(e,n);console.warn(`[syncPromise] ${e} rejected: ${r.message}`);let i=lS(e);Z(`ok/sync/reject`,{docName:e,mountId:i,reason:`timeout`,elapsedMs:n}),P4(t),O4()||M4(),t.reject(r),i!==void 0&&bS(i)},b4()),d={promise:s,resolve:a,reject:o,createdAt:i,timeoutHandle:u,provider:t,onSynced:c,onClose:l,settled:!1,resolved:!1,detached:!1};return E4.set(e,d),t.on(`synced`,c),t.on(`close`,l),j4(),Z(`ok/sync/create`,{docName:e,mountId:lS(e),warm:!1}),s}function I4(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!0,detached:!0}}function L4(e){let t=Promise.reject(e);t.catch(()=>{});let n=t;return n.status=`rejected`,n.reason=e,n}function R4(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!1,detached:!0}}function z4(e){return E4.get(e)?.resolved===!0}function B4(e){let t=E4.get(e);t&&(t.settled=!0,P4(t),E4.delete(e),O4()||M4())}function V4(e,t){let n=E4.get(e);if(!n||n.settled)return!1;n.settled=!0,console.warn(`[syncPromise] ${e} rejected: ${t.message}`),P4(n),O4()||M4(),n.reject(t);let r=lS(e);return r!==void 0&&bS(r),!0}var H4=Object.freeze({kind:`tab-replay`}),U4=Object.freeze({kind:`idle`});function W4(e,t){return()=>{}}var G4=null;function K4(){return G4??=$t(v4),G4}var q4=4e3,J4=1e4,Y4=class extends Error{constructor(e,t){super(`client persistence clearData timed out for ${e} after ${t}ms`),this.docName=e,this.timeoutMs=t,this.name=`ClientPersistenceClearTimeoutError`}},X4=`ok-last-observed-branch`,Z4=5e3,Q4=Ec(`MAX_BUFFER_BYTES`,1*1024*1024),$4=Ec(`MAX_POOL`,10);function e3(e,t,n=null){let r={...Tc()};return e!==null&&(r.principalId=e.principalId,r.tabSessionId=e.tabSessionId),t!==null&&t.length>0&&(r.expectedServerInstanceId=t),n!==null&&n.length>0&&(r.expectedBranch=n),JSON.stringify(r)}var t3=class{_entries=new Map;get entries(){return this._entries}lruOrder=[];activeDocName=null;maxSize;wsUrl;recycleDebounceMs;clearDataTimeoutMs;onChange=null;tabIdentity=null;serverRestartRecoveryState=U4;cachedServerInstanceId=null;pendingServerInstanceKnown=null;recoveryMismatchStaleClaim;bufferedUpdates=new Map;pendingClears=new Map;clearFailures=new Set;persistenceFactory;storage;constructor(e,t,n){this.maxSize=e,this.wsUrl=t,this.recycleDebounceMs=n?.recycleDebounceMs??q4,this.clearDataTimeoutMs=n?.clearDataTimeoutMs??J4,this.persistenceFactory=n?.persistenceFactory??yD,n?.storage===void 0?this.storage=globalThis.localStorage===void 0?null:globalThis.localStorage:this.storage=n.storage}setTabIdentity(e){this.tabIdentity=e}setExpectedServerInstanceId(e){if(this.cachedServerInstanceId=e,!(e===null||e.length===0)){if(this.pendingServerInstanceKnown!==null){let t=this.pendingServerInstanceKnown;this.pendingServerInstanceKnown=null,t.resolve(e)}this.attachDeferredPersistence(e)}}whenServerInstanceKnown(){if(this.cachedServerInstanceId!==null&&this.cachedServerInstanceId.length>0)return Promise.resolve(this.cachedServerInstanceId);if(this.pendingServerInstanceKnown!==null)return this.pendingServerInstanceKnown.promise;let e,t=new Promise(t=>{e=t});return this.pendingServerInstanceKnown={promise:t,resolve:e},t}buildPersistence(e,t,n){return this.persistenceFactory({branch:this.getOrInitObservedBranch()??`_unknown_`,serverInstanceId:e,docName:t,doc:n})}attachDeferredPersistence(e){let t=!1;for(let n of this._entries.values())if(n.kind===`active`&&n.persistence===null)try{n.persistence=this.buildPersistence(e,n.docName,n.provider.document),t=!0}catch(e){let t=e instanceof Error?e.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(n.docName),errorName:t,errorMessage:e instanceof Error?e.message:String(e)})}t&&this.notify()}getServerRestartRecoveryState(){return this.serverRestartRecoveryState}observeDiskAck(e,t){let n=this.entries.get(e);!n||n.kind!==`active`||(n.lastDiskAckedSV=SD(n.lastDiskAckedSV,t))}observeDiskAckBatch(e){for(let[t,n]of Object.entries(e))this.observeDiskAck(t,n)}lastObservedBranch=null;lastObservedBranchInitialized=!1;getOrInitObservedBranch(){if(this.lastObservedBranchInitialized)return this.lastObservedBranch;this.lastObservedBranchInitialized=!0;try{let e=this.storage?.getItem(X4)??null;e!==null&&e.length>0&&(this.lastObservedBranch=e)}catch{}return this.lastObservedBranch}persistObservedBranch(e){this.lastObservedBranch=e,this.lastObservedBranchInitialized=!0;try{e===null||e.length===0?this.storage?.removeItem(X4):this.storage?.setItem(X4,e)}catch{}}withClearDataTimeout(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(new Y4(e,this.clearDataTimeoutMs))},this.clearDataTimeoutMs);t.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e)})})}recoveryTelemetryBase(e,t){let n={docName:e,branch:this.getOrInitObservedBranch()??`_unknown_`},r=t===void 0?this.recoveryMismatchStaleClaim:t;return r!==void 0&&r.length>0&&(n.serverInstanceId=r),n}emitStructuredClientRecoveryEvent(e){console.warn(JSON.stringify(e))}clearRecoveryMismatchStaleClaimIfTerminal(){let e=this.serverRestartRecoveryState.kind;(e===`idle`||e===`failed`)&&(this.recoveryMismatchStaleClaim=void 0)}beginServerRestartRecovery(e,t){this.serverRestartRecoveryState={kind:`recovering`,phase:`clearing-local-cache`,docNames:e,failedDocNames:[],startedAt:t};for(let t of e)B4(t);this.notify()}enterServerRestartReconnect(e,t,n,r){if(e.length===0){this.serverRestartRecoveryState=t.length===0?U4:{kind:`failed`,reason:r,docNames:t,failedDocNames:t,startedAt:n},this.clearRecoveryMismatchStaleClaimIfTerminal(),this.notify();return}this.serverRestartRecoveryState={kind:`recovering`,phase:`reconnecting`,docNames:e,failedDocNames:t,startedAt:n,...t.length>0?{clearFailureReason:r}:{}},this.notify()}markServerRestartRecoverySynced(e){let t=this.serverRestartRecoveryState;if(t.kind!==`recovering`||t.phase!==`reconnecting`||!t.docNames.includes(e))return;let n=t.docNames.filter(t=>t!==e);if(n.length>0){this.serverRestartRecoveryState={...t,docNames:n};return}if(t.failedDocNames.length>0){this.serverRestartRecoveryState={kind:`failed`,reason:t.clearFailureReason??`clear-data-failed`,docNames:t.failedDocNames,failedDocNames:t.failedDocNames,startedAt:t.startedAt},this.clearRecoveryMismatchStaleClaimIfTerminal();return}this.serverRestartRecoveryState=U4,this.clearRecoveryMismatchStaleClaimIfTerminal()}setObservedBranch(e){this.persistObservedBranch(e)}compareAndUpdateObservedBranch(e){let t=this.getOrInitObservedBranch();return this.persistObservedBranch(e),t!==null&&t!==e}onBranchMismatch=null;branchMismatchInFlight=null;mismatchInFlight=null;setOnBranchMismatch(e){if(e===null){this.onBranchMismatch=null;return}this.onBranchMismatch=()=>{if(this.branchMismatchInFlight!==null)return;let t=Promise.resolve().then(e).finally(()=>{this.branchMismatchInFlight===t&&(this.branchMismatchInFlight=null)});this.branchMismatchInFlight=t}}onRenameRedirect=null;onDocDeleted=null;setOnRenameRedirect(e){this.onRenameRedirect=e}setOnDocDeleted(e){this.onDocDeleted=e}setOnChange(e){this.onChange=e}notify(){this.onChange?.()}evictListeners=new Set;onEvict(e){return this.evictListeners.add(e),()=>{this.evictListeners.delete(e)}}fireEvict(e){for(let t of this.evictListeners)try{t(e)}catch(t){console.warn(`[ProviderPool] evict listener threw for ${e}:`,t)}}touch(e){let t=this.lruOrder.indexOf(e);t!==-1&&this.lruOrder.splice(t,1),this.lruOrder.push(e)}open(e){if(y4(e))return null;let t=this.entries.get(e);if(t){let n=t.lastAccessedAt;return t.lastAccessedAt=Date.now(),this.touch(e),this.notify(),Z(`ok/pool/open`,{docName:e,hit:!0,lastAccessedAt:n,poolEventId:t.poolEventId}),Z.count(`ok/pool/open`,{hit:!0}),t}let n=Date.now();this.entries.size>=this.maxSize&&this.evictLru();let r=this.cachedServerInstanceId,i=e3(this.tabIdentity,r,this.getOrInitObservedBranch()),a=new qE({url:CD(this.wsUrl),name:e,forceSyncInterval:Z4,token:i}),o=this.cachedServerInstanceId;this.clearFailures.has(e)&&this.runCloseAndClearPersistence(e);let s=this.pendingClears.get(e),c=o!==null&&o.length>0&&s===void 0?this.buildPersistence(o,e,a.document):null,l=crypto.randomUUID(),u={kind:`active`,provider:a,persistence:c,lastServerSyncedSV:null,lastDiskAckedSV:null,observerCleanup:null,observerFireCounterCleanup:W4(a.document,e),syncState:`connecting`,docName:e,lastAccessedAt:Date.now(),poolEventId:l,hasSynced:!1,pendingRecycleTimer:null,bridgeSetupFailed:!1,serverDrivenCloseReauthInFlight:!1};if(Z(`ok/pool/open`,{docName:e,hit:!1,poolEventId:l}),Z.count(`ok/pool/open`,{hit:!1}),a.on(`status`,({status:t})=>{u.kind!==`active`||this.entries.get(e)!==u||t===`disconnected`&&(u.syncState=`disconnected`,this.notify())}),a.on(`synced`,()=>{if(!(u.kind!==`active`||this.entries.get(e)!==u)&&(u.syncState=`synced`,u.hasSynced=!0,u.lastServerSyncedSV=bD(a.document),u.pendingRecycleTimer&&=(clearTimeout(u.pendingRecycleTimer),null),this.markServerRestartRecoverySynced(e),this.notify(),!u.observerCleanup))try{let t=a.document,n=new j({extensions:v4});u.observerCleanup=vY({doc:t,xmlFragment:t.getXmlFragment(`default`),ytext:t.getText(`source`),mdManager:n,schema:K4(),onSyncError:(t,n)=>{console.warn(`[Sync] ${t} failed for ${e}:`,n.message)}})}catch(t){console.error(`[ProviderPool] setupObservers init failed for ${e}:`,t),u.bridgeSetupFailed=!0,V4(e,new w4(e,t))}}),a.on(`disconnect`,()=>{u.kind!==`active`||this.entries.get(e)!==u||(u.syncState=`disconnected`,this.notify(),u.hasSynced&&a.unsyncedChanges===0&&!u.pendingRecycleTimer&&(u.pendingRecycleTimer=setTimeout(()=>{u.kind===`active`&&(u.pendingRecycleTimer=null,this.entries.get(e)===u&&this.recycleDisconnectedEntry(e))},this.recycleDebounceMs)))}),a.on(`authenticationFailed`,({reason:t})=>{let n=[`server-instance-mismatch`,`branch-mismatch`,`rename-redirect`,`doc-deleted`],i=t.indexOf(`:`),a=i===-1?t:t.slice(0,i);if(!n.includes(a)){console.warn(JSON.stringify({event:`ok-auth-failed-unknown-reason`,reason:t}));return}let o=i===-1?``:t.slice(i+1),s=o.length>0?o:void 0,c=a;if(c===`server-instance-mismatch`){if(r===null||this.cachedServerInstanceId!==r)return;let e=r;this.cachedServerInstanceId=null,this.handleServerInstanceMismatch(e);return}if(c===`branch-mismatch`){this.onBranchMismatch?.();return}if(c===`rename-redirect`){if(s===void 0||s.length===0){console.warn(JSON.stringify({event:`rename-redirect-missing-payload`,fromDocName:e}));return}let t=e,n=s,r=this.entries.get(t),i=r!==void 0&&r.kind===`active`;this.onRenameRedirect?.({fromDocName:t,toDocName:n,hadOpenProvider:i});return}if(c===`doc-deleted`){let t=this.entries.get(e),n=t!==void 0&&t.kind===`active`;this.onDocDeleted?.({docName:e,hadOpenProvider:n});return}}),a.on(`close`,({event:t})=>{if(u.kind!==`active`||this.entries.get(e)!==u||u.serverDrivenCloseReauthInFlight)return;u.serverDrivenCloseReauthInFlight=!0,a.sendToken().catch(t=>{console.warn(JSON.stringify({event:`ok-provider-server-driven-close-reauth-failed`,docName:e,message:t instanceof Error?t.message:String(t)}))}).finally(()=>{u.kind===`active`&&this.entries.get(e)===u&&(u.serverDrivenCloseReauthInFlight=!1)});let n=t?.reason??`<unknown>`;console.info(JSON.stringify({event:`ok-provider-server-driven-close-reauth`,docName:e,reason:n}))}),this.bufferedUpdates.get(e)!==void 0){let t=this.recoveryMismatchStaleClaim,n=()=>{if(a.off(`synced`,n),u.kind!==`active`||this.entries.get(e)!==u)return;let r=this.bufferedUpdates.get(e);if(r!==void 0){this.bufferedUpdates.delete(e);try{fh(a.document,r,H4)}catch(n){let i=n instanceof Error?n.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-failed`,...this.recoveryTelemetryBase(e,t),replayByteLength:r.byteLength,errorName:i,errorMessage:n instanceof Error?n.message:String(n)})}}};a.on(`synced`,n)}if(this._entries.set(e,u),this.touch(e),this.notify(),s!==void 0&&o!==null&&o.length>0){let t=o;s.then(()=>{this.attachDeferredPersistenceForEntry(u,t)},t=>{console.warn(JSON.stringify({event:`ok-pool-deferred-persistence-attach-skipped`,docName:e,reason:`pending-clear-failed`,message:t instanceof Error?t.message:String(t)}))})}let d=lS(e);return d!==void 0&&yS(d,`ok.provider-pool.open`,{"doc.name":e},n,Date.now()),u}attachDeferredPersistenceForEntry(e,t){let n=this._entries.get(e.docName);if(!(n!==e||n.kind!==`active`||n.persistence!==null))try{n.persistence=this.buildPersistence(t,e.docName,n.provider.document),this.notify()}catch(t){let n=t instanceof Error?t.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(e.docName),errorName:n,errorMessage:t instanceof Error?t.message:String(t)})}}handleServerInstanceMismatch(e){this.recoveryMismatchStaleClaim=e.length>0?e:void 0;let t=Array.from(this.entries.entries()),n=Date.now(),r=this.activeDocName,i=r!==null&&t.some(([e,t])=>e===r&&t.kind===`active`)?[r]:[],a=r??t.find(([,e])=>e.kind===`active`)?.[0]??``;a.length>0&&this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-epoch-mismatch`,...this.recoveryTelemetryBase(a)}),this.beginServerRestartRecovery(i,n);for(let[e,n]of t)n.kind===`active`&&!i.includes(e)&&B4(e);for(let[e,n]of t){if(n.kind!==`active`)continue;let t=n.lastDiskAckedSV??n.lastServerSyncedSV;if(t===null){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-skipped-no-baseline`,...this.recoveryTelemetryBase(e),reason:`no-disk-ack-or-server-sync-vector`});continue}let r=xD(n.provider.document,t);if(r.byteLength>Q4){Z(`ok/pool/buffer-overflow`,{docName:e,bytes:r.byteLength});continue}r.byteLength>0&&this.bufferedUpdates.set(e,r)}let o=[];for(let[e,n]of t)n.kind===`active`&&n.persistence!==null&&o.push({docName:e,promise:this.withClearDataTimeout(e,n.persistence.clearData())});let s=Promise.allSettled(o.map(e=>e.promise)).then(e=>{let t=[],i=[],a=!1;e.forEach((e,n)=>{let r=o[n];if(!r)return;let s=r.docName;if(e.status===`rejected`){t.push(s);let n=e.reason instanceof Y4;if(n&&(a=!0),n)this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`timeout`});else{let t=e.reason instanceof Error?e.reason.name:`unknown`;this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`rejected`,errorName:t,errorMessage:e.reason instanceof Error?e.reason.message:String(e.reason)})}}else i.push(s)});let s=i.filter(e=>e===r);if(t.length>0){let e=a?`clear-data-timeout`:`clear-data-failed`;console.warn(JSON.stringify({event:`ok-mismatch-recycle-partial-clears-failed`,failedDocs:t,clearedDocs:i})),this.enterServerRestartReconnect(s,t,n,e);for(let e of i)this.recycleDisconnectedEntry(e);return}this.enterServerRestartReconnect(s,[],n,`clear-data-failed`),this.recycleAllEntries()}).finally(()=>{this.mismatchInFlight===s&&(this.mismatchInFlight=null)});this.mismatchInFlight=s}awaitMismatchSettled(){return this.mismatchInFlight??Promise.resolve()}recycleAllEntries(){let e=Array.from(this.entries.keys());for(let t of e)this.recycleDisconnectedEntry(t)}prewarm(e){if(y4(e))return null;let t=this.entries.get(e);if(t)return t;let n=this.open(e);if(!n)return null;let r=this.lruOrder.indexOf(e);return r!==-1&&(this.lruOrder.splice(r,1),this.lruOrder.unshift(e)),n}close(e){let t=this.entries.get(e);t&&(this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),this.bufferedUpdates.delete(e),this.activeDocName===e&&(this.activeDocName=null),this.notify())}async closeAndClearPersistence(e){try{await this.runCloseAndClearPersistence(e)}catch{}}runCloseAndClearPersistence(e){let t=this.pendingClears.get(e);if(t!==void 0)return t;let n=()=>{},r=()=>{},i=new Promise((e,t)=>{n=e,r=t});this.pendingClears.set(e,i);let a=()=>{this.pendingClears.get(e)===i&&this.pendingClears.delete(e)};return i.then(a,a),this.executeCloseAndClearPersistence(e).then(n,r),i}async executeCloseAndClearPersistence(e){this.clearFailures.delete(e);let t=this.entries.get(e);if(t?.kind===`active`&&t.persistence!==null){let n=t.persistence;try{this.close(e)}catch(t){console.warn(`[ProviderPool] close before clearData threw for ${e}:`,t)}try{await this.withClearDataTimeout(e,n.clearData())}catch(t){throw console.warn(`[ProviderPool] clearData on rename failed for ${e}:`,t),this.clearFailures.add(e),t}return}if(t)try{this.close(e)}catch(t){console.warn(`[ProviderPool] close before IDB-by-name delete threw for ${e}:`,t)}let n=this.getOrInitObservedBranch(),r=this.cachedServerInstanceId;if(n===null||r===null)return;let i=`ok-ydoc:${n}:${r}:${e}`;try{await this.withClearDataTimeout(e,new Promise((e,t)=>{let n=indexedDB.deleteDatabase(i);n.onsuccess=()=>e(),n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`[ProviderPool] IDB delete blocked for ${i}`)}}))}catch(t){throw console.warn(`[ProviderPool] IDB delete on rename failed for ${i}:`,t),this.clearFailures.add(e),t}}clearBufferedUpdates(){this.bufferedUpdates.clear()}__test_seedBufferedUpdate(e,t){this.bufferedUpdates.set(e,t)}__test_bufferedUpdatesSize(){return this.bufferedUpdates.size}__test_hasBufferedUpdate(e){return this.bufferedUpdates.has(e)}__test_getBufferedUpdate(e){return this.bufferedUpdates.get(e)}setActive(e){let t=this.entries.get(e);if(!t)throw Error(`[ProviderPool] Cannot setActive — "${e}" is not open`);t.lastAccessedAt=Date.now(),this.touch(e),this.activeDocName=e,this.notify()}clearActive(){this.activeDocName!==null&&(this.activeDocName=null,this.notify())}getActive(){return this.activeDocName?this.entries.get(this.activeDocName)??null:null}getActiveDocName(){return this.activeDocName}has(e){return this.entries.has(e)}peek(e){return this.entries.get(e)??null}recycle(e){this.recycleDisconnectedEntry(e)}dispose(){for(let e of this._entries.values())this.destroyEntry(e);this._entries.clear(),this.lruOrder=[],this.activeDocName=null,this.onChange=null,this.bufferedUpdates.clear(),this.pendingClears.clear(),this.clearFailures.clear(),this.onBranchMismatch=null,this.branchMismatchInFlight=null,this.onRenameRedirect=null,this.onDocDeleted=null,this.evictListeners.clear(),this.serverRestartRecoveryState=U4,this.cachedServerInstanceId=null,this.pendingServerInstanceKnown=null,this.tabIdentity=null,this.recoveryMismatchStaleClaim=void 0}evictLru(){for(let e of this.lruOrder)if(e!==this.activeDocName){Z(`ok/pool/evict-lru`,{docName:e}),this.close(e);return}}destroyEntry(e){if(e.kind===`tearing-down`)return;let t=e.observerCleanup,n=e.observerFireCounterCleanup,r=e.persistence,i=e.pendingRecycleTimer,a=e.docName,o=e;o.kind=`tearing-down`,o.persistence=null,o.observerCleanup=null,o.observerFireCounterCleanup=null,o.pendingRecycleTimer=null,o.serverDrivenCloseReauthInFlight=!1,i&&clearTimeout(i),B4(a),this.fireEvict(a);try{t?.()}catch(e){console.warn(`[ProviderPool] observer cleanup threw for ${a}:`,e)}try{n?.()}catch(e){console.warn(`[ProviderPool] observer-fire-counter cleanup threw for ${a}:`,e)}r!==null&&r.destroy().catch(e=>{console.warn(`[ProviderPool] persistence destroy failed for ${a}:`,e)});try{o.provider.destroy()}catch(e){console.warn(`[ProviderPool] Provider destroy failed for ${a}:`,e)}}recycleDisconnectedEntry(e){let t=this.entries.get(e);if(!t||t.kind!==`active`)return;let n=this.activeDocName===e;if(Z(`ok/pool/recycle-disconnected`,{docName:e,wasActive:n}),this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),n){this.open(e)&&this.setActive(e);return}this.notify()}},n3=crypto.randomUUID(),r3=!1;function i3(e){r3||(r3=!0,console.warn(`[principal-fetch] failed to resolve principal — falling back to random identity.`,e))}var a3=(0,Y.createContext)(null),o3=null;function s3(e){return o3||(o3=new t3($4,e),yC(o3)),o3}var c3={activeDocName:null,activeProvider:null,syncState:`connecting`,serverRestartRecovery:{kind:`idle`},poolEntries:[]};function l3(){if(typeof window>`u`)return null;let e=window.okDesktop;return e?.config.mode===`editor`?e:null}function u3(){return typeof window>`u`||window.okDesktop?.config.mode===`editor`?null:cw(window.location.origin)}function d3(){if(typeof window>`u`)return ow(null,$4);let e=u3();return e?lw(window.localStorage===void 0?null:window.localStorage,e,$4):ow(null,$4)}function f3(){return d3().openTabs}function p3(){return d3().pinnedTabIds}function m3(){if(typeof window>`u`||window.location.hash.length>0)return null;let e=d3();return e.activeTabId??(e.activeDocName?OC(e.activeDocName):null)??e.openTabs[0]??null}function h3(e){let t=RC(e);switch(t.kind){case`doc`:return U(t.docName);case`folder`:return ae(t.folderPath);case`asset`:return xt(t.assetPath)}}function g3(e){let t=y(e);if(t)return FC(t);let n=ce(e);if(!n)return null;let r=n.trim();if(/\/+$/.test(r)){let e=r.replace(/\/+$/g,``);return e?PC(e):null}return OC(n)}function _3(e){return{kind:`asset`,target:e,assetPath:e,mediaKind:Tt(e.split(`.`).pop()??``)}}function v3(e,t){return e?LC(e):t?OC(t):null}function y3(e,t,n){return e.some(e=>!n.has(e)&&zC(e)===t)}function b3(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function x3(e){switch(e.kind){case`doc`:return`doc:${e.docName}`;case`folder-index`:return`folder-index:${e.docName}:${e.folderPath}:${e.noteKind}`;case`folder`:return`folder:${e.folderPath}`;case`asset`:return`asset:${e.assetPath}:${e.mediaKind??``}`;case`large-file`:return`large-file:${e.docName}:${e.size}:${e.limit}`;case`missing`:return`missing:${e.target}`}}function S3(e,t){return e===t?!0:!e||!t?!1:x3(e)===x3(t)}function C3(e){let t=e.getActive(),n=[];for(let t of e.entries.values())n.push({docName:t.docName,provider:t.provider,lastAccessedAt:t.lastAccessedAt,poolEventId:t.poolEventId});return n.sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt),{activeDocName:e.getActiveDocName(),activeProvider:t?.provider??null,syncState:t?.syncState??`connecting`,serverRestartRecovery:e.getServerRestartRecoveryState(),poolEntries:n}}function w3(e){let t=(0,J.c)(168),{children:n}=e,[r,i]=(0,Y.useState)(c3),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(m3),[l,u]=(0,Y.useState)(f3),[f,p]=(0,Y.useState)(p3),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[0]=m):m=t[0];let[h,g]=(0,Y.useState)(m),[_,v]=(0,Y.useState)(l),[y,b]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(!1),C=(0,Y.useRef)(s),w=(0,Y.useRef)(l),T=(0,Y.useRef)(f),E=(0,Y.useRef)(y),D=(0,Y.useRef)(h),O=(0,Y.useRef)(_),k=(0,Y.useRef)(1),A=(0,Y.useRef)(!1),[j,M]=(0,Y.useState)(!1),[N,P]=(0,Y.useState)(null),[F,I]=(0,Y.useState)(null),[L,ee]=(0,Y.useState)(`doc`),[R,z]=(0,Y.useState)(null),[B,V]=(0,Y.useState)(0),{collabUrl:H,terminal:te,lastError:ne,retry:re}=Xx(),ie;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(ie=function(e){C.current=e,c(e)},t[1]=ie):ie=t[1];let W=ie,oe;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(oe=function(e){E.current=e,b(e)},t[2]=oe):oe=t[2];let se=oe,G;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(G=function(e){O.current=e,v(t=>b3(t,e)?t:e)},t[3]=G):G=t[3];let le=G,ue;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(ue=function(e){T.current=e,p(t=>b3(t,e)?t:e)},t[4]=ue):ue=t[4];let de=ue,fe;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(fe=function(e,t){let n=VC(t,e);w.current=e,T.current=n,u(t=>b3(t,e)?t:e),p(e=>b3(e,n)?e:n),le(QC(O.current,e,D.current))},t[5]=fe):fe=t[5];let pe=fe,me;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(me=function(e){pe(e,T.current)},t[6]=me):me=t[6];let he=me,ge;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(ge=function(e){he(e(w.current))},t[7]=ge):ge=t[7];let _e=ge,ve;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ve=function(e){D.current=e,g(t=>b3(t,e)?t:e),le(QC(O.current,w.current,e))},t[8]=ve):ve=t[8];let ye=ve,be;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(be=function(e){let t=E.current;if(!t)return;let n=D.current.filter(e=>e!==t);D.current=n,g(e=>b3(e,n)?e:n),se(null);let r=[],i=new Set;for(let n of O.current){let a=n===t?e:n;!a||i.has(a)||(i.add(a),r.push(a))}le(QC(r,w.current,n))},t[9]=be):be=t[9];let xe=be,Se,Ce;t[10]===s?(Se=t[11],Ce=t[12]):(Se=()=>{C.current=s},Ce=[s],t[10]=s,t[11]=Se,t[12]=Ce),(0,Y.useEffect)(Se,Ce);let we,Te;t[13]===l?(we=t[14],Te=t[15]):(we=()=>{w.current=l},Te=[l],t[13]=l,t[14]=we,t[15]=Te),(0,Y.useEffect)(we,Te);let Ee,De;t[16]===f?(Ee=t[17],De=t[18]):(Ee=()=>{T.current=f},De=[f],t[16]=f,t[17]=Ee,t[18]=De),(0,Y.useEffect)(Ee,De);let Oe,ke;t[19]===y?(Oe=t[20],ke=t[21]):(Oe=()=>{E.current=y},ke=[y],t[19]=y,t[20]=Oe,t[21]=ke),(0,Y.useEffect)(Oe,ke);let Ae,je;t[22]===h?(Ae=t[23],je=t[24]):(Ae=()=>{D.current=h},je=[h],t[22]=h,t[23]=Ae,t[24]=je),(0,Y.useEffect)(Ae,je);let Me,Ne;t[25]===_?(Me=t[26],Ne=t[27]):(Me=()=>{O.current=_},Ne=[_],t[25]=_,t[26]=Me,t[27]=Ne),(0,Y.useEffect)(Me,Ne);let Pe=y!==null,Fe,Ie;t[28]!==H||t[29]!==j||t[30]!==x?(Fe=()=>{if(H===null||x||!j)return;let e=!1,t=l3(),n=u3(),r=typeof localStorage<`u`?localStorage:null;return(t?t.project.getSessionState():Promise.resolve(n?lw(r,n,$4):{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null})).then(t=>{if(e)return;let n=ow(t,$4);if(A.current)return;let r=s3(H);for(let e of n.openTabs){let t=zC(e);t&&r.open(t)}let i=[...n.pinnedTabIds,...T.current],a=n.openTabs;for(let e of w.current)a=qC(a,e,$4,i);let o=VC(i,a);w.current=a,T.current=o,u(e=>b3(e,a)?e:a),p(e=>b3(e,o)?e:o);let s=QC(O.current,a,D.current);O.current=s,v(e=>b3(e,s)?e:s);let l=ce(window.location.hash),d=n.activeTabId??(n.activeDocName?OC(n.activeDocName):null)??n.openTabs[0]??null,f=d?h3(d):null;if((l===null&&window.location.hash.length===0||f!==null&&f===window.location.hash)&&d){C.current=d,c(d);let e=h3(d);window.location.hash!==e&&(window.location.hash=e)}}).catch(P3).finally(()=>{e||S(!0)}),()=>{e=!0}},Ie=[H,j,x],t[28]=H,t[29]=j,t[30]=x,t[31]=Fe,t[32]=Ie):(Fe=t[31],Ie=t[32]),(0,Y.useEffect)(Fe,Ie);let Le,Re;t[33]!==s||t[34]!==a||t[35]!==l||t[36]!==f||t[37]!==r.activeDocName||t[38]!==x?(Le=()=>{if(!x)return;let e=sw(l,s??v3(a,r.activeDocName),f),t=l3();if(t){t.project.setSessionState(e).catch(N3);return}let n=u3();n&&uw(typeof localStorage<`u`?localStorage:null,n,e)},Re=[s,a,l,f,r.activeDocName,x],t[33]=s,t[34]=a,t[35]=l,t[36]=f,t[37]=r.activeDocName,t[38]=x,t[39]=Le,t[40]=Re):(Le=t[39],Re=t[40]),(0,Y.useEffect)(Le,Re);let ze;t[41]===x?ze=t[42]:(ze=function(){x||(A.current=!0)},t[41]=x,t[42]=ze);let Be=ze,Ve,He;t[43]===H?(Ve=t[44],He=t[45]):(Ve=()=>{if(H===null)return;let e=!1;M(!1);let t=s3(H);i(C3(t));let n=function(e,t){let n=VC(t,e);w.current=e,T.current=n,u(t=>b3(t,e)?t:e),p(e=>b3(e,n)?e:n);let r=QC(O.current,e,D.current);O.current=r,v(e=>b3(e,r)?e:r)};return t.setOnBranchMismatch(()=>Nx(t)),t.setOnRenameRedirect(e=>{let{fromDocName:r,toDocName:i,hadOpenProvider:a}=e;(async()=>{let e,s=t.getActiveDocName()===r;$S([{fromDocName:r,toDocName:i}]);try{await Promise.all([t.closeAndClearPersistence(r),t.closeAndClearPersistence(i)]),s&&(t.open(i),t.setActive(i));let e=ew(w.current,[{fromDocName:r,toDocName:i}],$4,[],T.current),a=VC(ew(T.current,[{fromDocName:r,toDocName:i}],2**53-1),e);O.current=tw(O.current,[{fromDocName:r,toDocName:i}]),n(e,a),o(e=>e&&(vt(e)===r?{kind:`doc`,target:i,docName:i}:e)),s&&(window.location.hash=U(i))}catch(t){let n=t;e=n,console.warn(JSON.stringify({event:`removal-cleanup-error`,kind:`renamed`,fromDocName:r,toDocName:i,message:String(n instanceof Error?n.message:n)}))}console.info(JSON.stringify({event:`removal.cleanup`,kind:`renamed`,fromDocName:r,toDocName:i,hadOpenProvider:a,hadStaleIdb:!a,source:`auth-rejection`,errored:e!==void 0}))})()}),t.setOnDocDeleted(e=>{let{docName:r,hadOpenProvider:i}=e;(async()=>{let e;try{await t.closeAndClearPersistence(r),n(ZC(w.current,r),T.current),o(e=>e&&(vt(e)===r?null:e)),t.getActiveDocName()===r&&(window.location.hash=``)}catch(t){let n=t;e=n,console.warn(JSON.stringify({event:`removal-cleanup-error`,kind:`deleted`,docName:r,message:String(n instanceof Error?n.message:n)}))}console.info(JSON.stringify({event:`removal.cleanup`,kind:`deleted`,fromDocName:r,hadOpenProvider:i,hadStaleIdb:!i,source:`auth-rejection`,errored:e!==void 0}))})()}),t.setOnChange(()=>i(C3(t))),fetch(`/api/principal`).then(M3).then(n=>{if(e)return;let r=d.safeParse(n);r.success?(t.setTabIdentity({principalId:r.data.id,tabSessionId:n3}),P(r.data)):i3(r.error)}).catch(t=>{e||i3(t)}).finally(()=>{e||M(!0)}),Nx(t),()=>{e=!0,t.setOnChange(null),t.setOnRenameRedirect(null),t.setOnDocDeleted(null)}},He=[H],t[43]=H,t[44]=Ve,t[45]=He),(0,Y.useEffect)(Ve,He);let Ue;t[46]===H?Ue=t[47]:(Ue=e=>{if(Z(`ok/nav/open-document`,{docName:e,transition:!1}),H===null)return;let t=s3(H),n=t.open(e);if(!n)return;Cx(e,n.poolEventId);let r=OC(e);_e(e=>qC(e,r,$4,T.current)),xe(r),W(r),t.setActive(e),o({kind:`doc`,target:e,docName:e})},t[46]=H,t[47]=Ue);let We=Ue,Ge;t[48]===We?Ge=t[49]:(Ge=e=>{Z(`ok/nav/open-document`,{docName:e,transition:!1}),We(e)},t[48]=We,t[49]=Ge);let Ke=Ge,qe;t[50]!==a||t[51]!==H||t[52]!==Be||t[53]!==r.activeDocName?(qe=(e,t)=>{let n=t===void 0?{}:t;if(H===null)return;n.tabBehavior===`replace-active`&&Be();let i=s3(H),s=vt(e),c=E.current,l=c!==null&&n.tabBehavior===`replace-active`,u=c?null:C.current??v3(a,r.activeDocName),d=u!==null&&w.current.includes(u),f=u!==null&&T.current.includes(u),p=n.tabBehavior===`replace-active`&&f||n.tabBehavior===`replace-active`&&!l&&!d?`append`:n.tabBehavior??`append`;if(s&&e.kind!==`large-file`){let e=i.open(s);if(!e)return;Cx(s,e.poolEventId);let t=l?MC(w.current,OC(s)):null,n=l&&!t?AC(w.current,s):null,r=l?t?{activeTabId:t,tabs:w.current}:{activeTabId:n??OC(s),tabs:qC(w.current,n??OC(s),$4,T.current)}:YC(w.current,s,{behavior:p,currentTabId:u,limit:$4,pinnedTabIds:T.current});he(r.tabs),xe(r.activeTabId),W(r.activeTabId),i.setActive(s)}else{i.clearActive();let t=LC(e);if(t){let e=u!==null&&NC(u,t),n=l||e?null:MC(w.current,t),r=n?{tabs:w.current,activeTabId:n}:XC(w.current,t,{behavior:p,currentTabId:u,limit:$4,pinnedTabIds:T.current});he(r.tabs),W(r.activeTabId),xe(r.activeTabId)}else xe(t)}o(t=>S3(t,e)?t:e)},t[50]=a,t[51]=H,t[52]=Be,t[53]=r.activeDocName,t[54]=qe):qe=t[54];let Je=qe,Ye;t[55]===Je?Ye=t[56]:(Ye=(e,t)=>{Je(e,t===void 0?{}:t)},t[55]=Je,t[56]=Ye);let Xe=Ye,Ze;t[57]===Je?Ze=t[58]:(Ze=(e,t)=>{let n=t===void 0?{}:t;Z(`ok/nav/open-target`,{docName:vt(e),kind:e.kind,transition:!1}),Je(e,n)},t[57]=Je,t[58]=Ze);let Qe=Ze,$e;t[59]===H?$e=t[60]:($e=()=>{if(H===null){o(j3),C.current=null,c(A3);return}let e=s3(H);e.getActiveDocName()!==null&&e.clearActive(),o(k3),C.current=null,c(O3)},t[59]=H,t[60]=$e);let et;t[61]!==H||t[62]!==Be?(et=e=>{H!==null&&(Be(),s3(H).close(e),_e(t=>ZC(t,OC(e))),c(t=>{let n=t&&zC(t)===e?null:t;return C.current=n,n}),o(t=>t&&(vt(t)===e?null:t)))},t[61]=H,t[62]=Be,t[63]=et):et=t[63];let tt;t[64]!==s||t[65]!==a||t[66]!==H||t[67]!==Be||t[68]!==r.activeDocName?(tt=e=>{if(T.current.includes(e))return;Be();let t=null,n=zC(e);if(H!==null){let t=s3(H);n&&!y3(w.current,n,new Set([e]))&&t.close(n)}let i=s??v3(a,r.activeDocName);if(_e(n=>(t=iw(n,i,e),ZC(n,e))),i===e){if(t){W(t),window.location.hash=h3(t);return}H!==null&&s3(H).clearActive(),o(null),W(null),window.location.hash=``}},t[64]=s,t[65]=a,t[66]=H,t[67]=Be,t[68]=r.activeDocName,t[69]=tt):tt=t[69];let nt;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(nt=e=>{let t=UC(T.current,e,w.current);b3(T.current,t)||de(t)},t[70]=nt):nt=t[70];let rt;t[71]===Be?rt=t[72]:(rt=e=>{let t=WC(T.current,e);b3(T.current,t)||(Be(),de(t))},t[71]=Be,t[72]=rt);let it;t[73]===H?it=t[74]:(it=e=>{let t=RC(e);if(se(null),W(e),t.kind===`doc`){if(H!==null){let e=s3(H);if(!e.open(t.docName))return;e.setActive(t.docName)}o({kind:`doc`,target:t.docName,docName:t.docName});let e=U(t.docName);window.location.hash!==e&&(window.location.hash=e);return}if(H!==null&&s3(H).clearActive(),t.kind===`asset`){o(_3(t.assetPath));let e=xt(t.assetPath);window.location.hash!==e&&(window.location.hash=e);return}o({kind:`folder`,target:t.folderPath,folderPath:t.folderPath});let n=ae(t.folderPath);window.location.hash!==n&&(window.location.hash=n)},t[73]=H,t[74]=it);let at;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(at=(e,t)=>{let n=new Set(w.current),r=new Set(D.current),i=new Set,a=[],o=[],s=[];for(let t of e)i.has(t)||(n.has(t)?(a.push(t),s.push(t),i.add(t)):r.has(t)&&(o.push(t),s.push(t),i.add(t)));for(let e of w.current)i.has(e)||(a.push(e),s.push(e),i.add(e));for(let e of D.current)i.has(e)||(o.push(e),s.push(e),i.add(e));let c=b3(w.current,a),l=b3(D.current,o),u=b3(O.current,s);c&&l&&u||(O.current=s,l||(D.current=o,g(e=>b3(e,o)?e:o)),pe(a,KC(a,T.current,t)))},t[75]=at):at=t[75];let ot,st;t[76]===H?(ot=t[77],st=t[78]):(ot=()=>{let e=`new-tab:${k.current}`;k.current+=1,ye([...D.current,e]),se(e),H!==null&&s3(H).clearActive(),o(null),W(null),window.location.hash!==``&&(window.location.hash=``)},st=e=>{D.current.includes(e)&&(H!==null&&s3(H).clearActive(),o(null),W(null),se(e),window.location.hash!==``&&(window.location.hash=``))},t[76]=H,t[77]=ot,t[78]=st);let ct;t[79]!==H||t[80]!==Be?(ct=e=>{Be();let t=D.current;if(!t.includes(e))return;let n=t.filter(t=>t!==e);if(ye(n),E.current!==e)return;let r=t.indexOf(e),i=n[r]??n[r-1]??null;if(i){se(i),H!==null&&s3(H).clearActive(),o(null),W(null),window.location.hash!==``&&(window.location.hash=``);return}se(null);let a=w.current[w.current.length-1]??null;if(a){W(a),window.location.hash=h3(a);return}H!==null&&s3(H).clearActive(),o(null),W(null),window.location.hash=``},t[79]=H,t[80]=Be,t[81]=ct):ct=t[81];let lt;t[82]!==s||t[83]!==a||t[84]!==H||t[85]!==Be||t[86]!==r.activeDocName?(lt=(e,t)=>{let n=t===void 0?{}:t,i=e.filter(D3),c=new Set(n.force?i:GC(i,T.current));if(c.size===0)return;if(Be(),H!==null){let e=s3(H),t=new Map;for(let e of c){let n=zC(e);if(!n)continue;let r=t.get(n)??new Set;r.add(e),t.set(n,r)}for(let[n,r]of t)y3(w.current,n,r)||e.close(n)}let l=null,u=s??v3(a,r.activeDocName);if(_e(e=>(l=aw(e,u,c),e.filter(e=>!c.has(e)))),!u||!c.has(u)){u||o(e=>{if(!e)return e;let t=LC(e);return t&&c.has(t)?null:e});return}if(l){W(l),window.location.hash=h3(l);return}H!==null&&s3(H).clearActive(),o(null),W(null),window.location.hash=``},t[82]=s,t[83]=a,t[84]=H,t[85]=Be,t[86]=r.activeDocName,t[87]=lt):lt=t[87];let ut;t[88]!==s||t[89]!==a||t[90]!==H||t[91]!==Be||t[92]!==l||t[93]!==r.activeDocName?(ut=e=>{let{pages:t,folderPaths:n,assetPaths:i}=e,c=$C(l,{pages:t,folderPaths:n,assetPaths:i,keepMissingDocName:a?.kind===`missing`?a.target:null});if(c.length===l.length)return;let u=new Set(c),d=l.filter(e=>!u.has(e)),f=new Set(d);if(Be(),H!==null){let e=s3(H);for(let t of d){let n=zC(t);n&&e.close(n)}}he(c);let p=typeof window<`u`?g3(window.location.hash):null,m=s??v3(a,r.activeDocName),h=p&&f.has(p)?p:m&&f.has(m)?m:null;if(!h){o(e=>{if(!e)return e;let t=LC(e);return t&&f.has(t)?null:e});return}let g=aw(l,h,d);if(g){W(g),window.location.hash=h3(g);return}H!==null&&s3(H).clearActive(),o(null),W(null),window.location.hash=``},t[88]=s,t[89]=a,t[90]=H,t[91]=Be,t[92]=l,t[93]=r.activeDocName,t[94]=ut):ut=t[94];let ft;t[95]!==H||t[96]!==Be?(ft=(e,t,n)=>{let r=t===void 0?[]:t,i=n===void 0?[]:n;Be();let a=ew(w.current,e,$4,r,T.current,i),o=VC(ew(T.current,e,2**53-1,r,[],i),a);if(H!==null){let e=s3(H);for(let t of a){let n=zC(t);n&&e.open(n)}}O.current=tw(O.current,e,r,i),pe(a,o);let s=C.current;if(s){let t=ew([s],e,1,r,[],i)[0];t&&a.includes(t)&&W(t)}},t[95]=H,t[96]=Be,t[97]=ft):ft=t[97];let pt,mt,ht,gt,_t;t[98]===H?(pt=t[99],mt=t[100],ht=t[101],gt=t[102],_t=t[103]):(pt=async e=>{H!==null&&(await s3(H).closeAndClearPersistence(e),o(t=>t&&(vt(t)===e?null:t)))},mt=()=>H===null?null:s3(H).getActiveDocName(),ht=e=>H===null?!1:s3(H).has(e),gt=e=>{H!==null&&s3(H).recycle(e)},_t=e=>H===null?null:s3(H).prewarm(e)?.poolEventId??null,t[98]=H,t[99]=pt,t[100]=mt,t[101]=ht,t[102]=gt,t[103]=_t);let yt,bt,St,Ct,wt;t[104]===H?(yt=t[105],bt=t[106],St=t[107],Ct=t[108],wt=t[109]):(yt=e=>{H!==null&&s3(H).setExpectedServerInstanceId(e)},bt=async e=>{if(H===null)return;let t=s3(H);t.setObservedBranch(e),await wx(t,e),Ft([`files`,`backlinks`,`graph`]),dt(e)},St=async e=>{if(H===null)return;let t=s3(H);t.compareAndUpdateObservedBranch(e)&&(await wx(t,e),Ft([`files`,`backlinks`,`graph`]),dt(e))},Ct=(e,t)=>{H!==null&&s3(H).observeDiskAck(e,t)},wt=async()=>{H!==null&&await Nx(s3(H))},t[104]=H,t[105]=yt,t[106]=bt,t[107]=St,t[108]=Ct,t[109]=wt);let Tt;t[110]!==R||t[111]!==L||t[112]!==r.activeDocName?(Tt=(e,t)=>{if(!r.activeDocName&&t){window.location.hash=U(t),z(e),ee(`agent`),V(E3);return}if(L===`agent`&&R===e){ee(`doc`);return}z(e),ee(`agent`),V(T3)},t[110]=R,t[111]=L,t[112]=r.activeDocName,t[113]=Tt):Tt=t[113];let Et;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>{ee(`doc`),z(null)},t[114]=Et):Et=t[114];let Dt;t[115]!==y||t[116]!==s||t[117]!==a||t[118]!==ne||t[119]!==te||t[120]!==H||t[121]!==R||t[122]!==B||t[123]!==L||t[124]!==Pe||t[125]!==h||t[126]!==We||t[127]!==Ke||t[128]!==l||t[129]!==Xe||t[130]!==Qe||t[131]!==f||t[132]!==N||t[133]!==re||t[134]!==r.activeDocName||t[135]!==r.activeProvider||t[136]!==r.poolEntries||t[137]!==r.serverRestartRecovery||t[138]!==r.syncState||t[139]!==F||t[140]!==$e||t[141]!==et||t[142]!==tt||t[143]!==rt||t[144]!==it||t[145]!==ot||t[146]!==st||t[147]!==ct||t[148]!==lt||t[149]!==ut||t[150]!==ft||t[151]!==pt||t[152]!==mt||t[153]!==ht||t[154]!==gt||t[155]!==_t||t[156]!==yt||t[157]!==bt||t[158]!==St||t[159]!==Ct||t[160]!==wt||t[161]!==Tt||t[162]!==x||t[163]!==_?(Dt={principal:N,activeTarget:a,activeTabId:s,activeDocName:r.activeDocName,activeProvider:r.activeProvider,openTabs:l,pinnedTabIds:f,visibleTabIds:_,tabSessionLoaded:x,syncState:r.syncState,serverRestartRecovery:r.serverRestartRecovery,poolEntries:r.poolEntries,openDocument:We,openDocumentTransition:Ke,openTarget:Xe,openTargetTransition:Qe,clearTarget:$e,closeDocument:et,closeTab:tt,pinTab:nt,unpinTab:rt,activateTab:it,reorderTabs:at,newTabIds:h,activeNewTabId:y,isNewTabActive:Pe,openNewTab:ot,activateNewTab:st,closeNewTab:ct,closeTabs:lt,syncOpenTabsWithKnownTargets:ut,remapTabsForRename:ft,closeAndClearForRename:pt,getPoolActiveDocName:mt,poolHas:ht,recycleDocument:gt,prewarm:_t,systemProvider:F,setSystemProvider:I,updateServerInstanceId:yt,onBranchSwitched:bt,observeBranch:St,observeDiskAck:Ct,refreshServerInfo:wt,collabUrl:H,collabTerminal:te,collabLastError:ne,retryCollab:re,docPanelMode:L,docPanelAgentId:R,docPanelExpandSignal:B,openActivityPanel:Tt,closeActivityPanel:Et},t[115]=y,t[116]=s,t[117]=a,t[118]=ne,t[119]=te,t[120]=H,t[121]=R,t[122]=B,t[123]=L,t[124]=Pe,t[125]=h,t[126]=We,t[127]=Ke,t[128]=l,t[129]=Xe,t[130]=Qe,t[131]=f,t[132]=N,t[133]=re,t[134]=r.activeDocName,t[135]=r.activeProvider,t[136]=r.poolEntries,t[137]=r.serverRestartRecovery,t[138]=r.syncState,t[139]=F,t[140]=$e,t[141]=et,t[142]=tt,t[143]=rt,t[144]=it,t[145]=ot,t[146]=st,t[147]=ct,t[148]=lt,t[149]=ut,t[150]=ft,t[151]=pt,t[152]=mt,t[153]=ht,t[154]=gt,t[155]=_t,t[156]=yt,t[157]=bt,t[158]=St,t[159]=Ct,t[160]=wt,t[161]=Tt,t[162]=x,t[163]=_,t[164]=Dt):Dt=t[164];let Ot=Dt,kt;return t[165]!==n||t[166]!==Ot?(kt=(0,X.jsx)(a3,{value:Ot,children:n}),t[165]=n,t[166]=Ot,t[167]=kt):kt=t[167],kt}function T3(e){return e+1}function E3(e){return e+1}function D3(e){return e.length>0}function O3(e){return e===null?e:null}function k3(e){return e===null?e:null}function A3(e){return e===null?e:null}function j3(e){return e===null?e:null}function M3(e){return e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))}function N3(e){console.warn(`[editor-tabs] failed to persist tab session:`,e)}function P3(e){console.warn(`[editor-tabs] failed to restore tab session:`,e)}function F3(){let e=(0,Y.use)(a3);if(!e)throw Error(`useDocumentContext must be used within <DocumentProvider />`);return e}function I3(){let e=(0,J.c)(3),{openDocumentTransition:t,openTargetTransition:n}=F3(),r;return e[0]!==t||e[1]!==n?(r={openDocumentTransition:t,openTargetTransition:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{OI as $,fa as $n,lx as $t,T$ as A,yc as An,gC as At,yY as B,Ba as Bn,iS as Bt,h1 as C,Rl as Cn,IC as Ct,g1 as D,Z as Dn,cC as Dt,_1 as E,Mc as En,sC as Et,tX as F,gc as Fn,DS as Ft,aR as G,Oa as Gn,jx as Gt,gY as H,ja as Hn,aS as Ht,JY as I,Ya as In,dS as It,sR as J,ba as Jn,gx as Jt,wR as K,Ta as Kn,Sx as Kt,LY as L,Ua as Ln,lS as Lt,nZ as M,xc as Mn,IS as Mt,eZ as N,bc as Nn,FS as Nt,d1 as O,Ec as On,aC as Ot,tZ as P,vc as Pn,PS as Pt,NL as Q,ga as Qn,fx as Qt,AY as R,Ha as Rn,uS as Rt,S1 as S,Bl as Sn,Mi as Sr,LC as St,y1 as T,Ul as Tn,XS as Tt,iK as U,Aa as Un,Hx as Ut,_Y as V,za as Vn,sS as Vt,fB as W,ka as Wn,Px as Wt,OL as X,va as Xn,cx as Xt,FL as Y,ya as Yn,sx as Yt,EL as Z,_a as Zn,dx as Zt,V2 as _,sm as _n,zi as _r,OC as _t,C4 as a,eb as an,aa as ar,aA as at,E0 as b,Eu as bn,Pi as br,RC as bt,x4 as c,Ry as cn,$i as cr,VO as ct,z4 as d,hg as dn,qi as dr,oO as dt,px as en,da as er,DI as et,y4 as f,Vh as fn,Ki as fr,qD as ft,B2 as g,Nh as gn,Bi as gr,FC as gt,Q2 as h,Rh as hn,Vi as hr,qE as ht,w4 as i,cb as in,oa as ir,AA as it,hQ as j,Sc as jn,xS as jt,B$ as k,wc as kn,YS as kt,B4 as l,Av as ln,Xi as lr,zO as lt,$2 as m,Ph as mn,Hi as mr,HD as mt,F3 as n,mx as nn,ca as nr,eF as nt,S4 as o,ny as on,ia as or,Kk as ot,v4 as p,Bh as pn,Gi as pr,KD as pt,pB as q,xa as qn,hx as qt,I3 as r,sb as rn,sa as rr,rM as rt,T4 as s,My as sn,ta as sr,fk as st,w3 as t,ux as tn,la as tr,iF as tt,F4 as u,Xm as un,Yi as ur,lO as ut,R0 as v,cm as vn,Ri as vr,GC as vt,v1 as w,Gl as wn,$S as wt,k1 as x,Tu as xn,Ni as xr,nw as xt,k0 as y,Bf as yn,Fi as yr,PC as yt,DY as z,Va as zn,oS as zt};