@inkeep/open-knowledge 0.27.0 → 0.27.1-beta.0
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.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/assets/skills/write-skill/SKILL.md +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/constants-BlKCNHOf.mjs +2 -0
- package/dist/{dist-CdVqgoPq.mjs → dist-BoFX-ULL.mjs} +3 -3
- package/dist/{dist-CZ4COUHS.mjs → dist-Dqzx7uaJ.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-BwsVFj6d.mjs → init-DW8jCg_E.mjs} +4 -4
- package/dist/init-WUzV5BJL.mjs +1 -0
- package/dist/{loader-BAIfIvBS.mjs → loader-B6OJwBrh.mjs} +2 -2
- package/dist/loader-psgN_GI-.mjs +1 -0
- package/dist/preview-Bhty7JDI.mjs +1 -0
- package/dist/{preview-CeZQltbU.mjs → preview-CAaqjWbz.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-Bu-aPWfE.js → ActivityModeContent-cj1HT4VE.js} +1 -1
- package/dist/public/assets/{DocumentContext-BNan6rEA.js → DocumentContext-D1jVxe4_.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DLAmAtNx.js → EnableSyncConfirmDialog-Cbfu4v5H.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DCf7FSvm.js → ManagedArtifactProperties-B0nHWo57.js} +1 -1
- package/dist/public/assets/{PropertyPanel-CLRxrKmQ.js → PropertyPanel-DXZGg3WW.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-CsI1gUUv.js → SettingsDialogBody-DHIfEll5.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BIUsfWwx.js → ShareReceiveMissDialog-CrZeiuZr.js} +1 -1
- package/dist/public/assets/{SourceEditor-Dqc-ofa3.js → SourceEditor-CCtjGfSZ.js} +1 -1
- package/dist/public/assets/{auth-state-cache-jpL1ktd3.js → auth-state-cache-CdsC2cRT.js} +1 -1
- package/dist/public/assets/{config-provider-Do7HkFaK.js → config-provider-BXTM5j4b.js} +1 -1
- package/dist/public/assets/{index-BFz0okIV.js → index-C9eqBwsG.js} +98 -98
- package/dist/public/assets/index-CgoVvMy1.css +1 -0
- package/dist/public/assets/{pending-receive-nav-store-OU-qfx40.js → pending-receive-nav-store-DVvKuc7o.js} +1 -1
- package/dist/public/assets/{selection-context-Br-4VUmJ.js → selection-context-3sebzqEf.js} +1 -1
- package/dist/public/assets/{telemetry-impl-CWMvXlku.js → telemetry-impl-DbDKK1Kj.js} +1 -1
- package/dist/public/assets/{telemetry-startup-C7RfeonD.js → telemetry-startup-ChBVT3Gs.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-ClZLBemU.js → typing-burst-detector-eM1j8UCL.js} +1 -1
- package/dist/public/index.html +10 -10
- package/dist/{repair-launch-json-jEfxfrXs.mjs → repair-launch-json-DEp7Z40_.mjs} +2 -2
- package/dist/{repair-mcp-configs-Dtldp8WO.mjs → repair-mcp-configs--ItZj8AU.mjs} +2 -2
- package/dist/{repair-skills-D7TJAZll.mjs → repair-skills-B9vf1LVl.mjs} +2 -2
- package/dist/repair-skills-rGTpTOuw.mjs +1 -0
- package/dist/{src-DPiL5xHq.mjs → src-BKpE2E8m.mjs} +2 -2
- package/dist/start-DtehMg_D.mjs +1 -0
- package/dist/{start-B0I0cewI.mjs → start-UmvANkCP.mjs} +2 -2
- package/dist/{write-project-skill-BEzL3S1a.mjs → write-project-skill-DVYnPUfx.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-CVwzJpO0.mjs +0 -2
- package/dist/init-Cy4VefHD.mjs +0 -1
- package/dist/loader-B001Pjdw.mjs +0 -1
- package/dist/preview-BZSWO0Y0.mjs +0 -1
- package/dist/public/assets/index-CwH3jLSk.css +0 -1
- package/dist/repair-skills-DCZqW9al.mjs +0 -1
- package/dist/start-tOskjO8p.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-Cam_8F7g.js","./preload-helper-2ej06EnG.js","./chunk-U2HBQHQK-mRJ3fq4T.js","./src-28IIV2Sn.js","./chunk-CFjPhJqf.js","./src-cx4Sgc5-.js","./chunk-5PVQY5BW-CEeElQgj.js","./dist-VYgKuZZh.js","./chunk-ICPOFSXX-1RLN41rn.js","./_baseFor-CyNhGcoH.js","./isObjectLike-B-XBvMIZ.js","./isEmpty-n3rjfMgT.js","./chunk-336JU56O-CcZCge2-.js","./chunk-5FUZZQ4R-BrmoYnYM.js","./chunk-X2U36JSP-BIFgIXrZ.js","./chunk-ZZ45TVLE-DseNoBkl.js","./rough.esm-CNnrul_b.js","./chunk-ENJZ2VHE-BNy6Rh-1.js","./line-C2FdpsKU.js","./path-DAmnUwYX.js","./array-C2ARTgCj.js","./chunk-BSJP7CBP-CkhFUxRl.js","./chunk-426QAEUC-CAVhttwb.js","./chunk-XPW4576I-DG64u9p6.js","./pdf-PfDliStv.js","./dist-B9f86446.js","./dist-DLLyJf3c.js","./w3c-keyname-CHcJEDvG.js","./dist-DG-zKHrl.js","./dist-BUqH6ZNg.js","./dist-DQJENePL.js","./dist-C75OCMT0.js","./dist-C71DLMde.js","./stex-AIAzjJoG.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{n as r,r as i,t as a}from"./compiler-runtime-CVnuRdak.js";import{n as o,r as s}from"./dist-CQw2y-s3.js";import{n as c}from"./dist-BVOt51sU.js";import{t as l}from"./react-dom-C-oc-P2K.js";import{$ as u,$n as d,$r as f,Ai as p,An as m,At as h,B as g,Bi as _,Br as v,En as y,Et as b,F as x,Fn as S,G as C,Gn as w,Gr as T,H as E,Hi as D,Hr as O,Ht as k,Ii as A,In as j,Ir as M,J as N,Jn as P,Jr as F,K as I,Kr as L,Kt as R,L as z,Ln as B,Lr as V,Mn as ee,Nn as H,Oi as U,On as W,Or as te,Pn as G,Pt as ne,Q as K,Qn as re,Rn as ie,Rr as ae,S as oe,Si as q,Sn as se,Tn as ce,Tr as le,U as ue,Un as de,Ur as fe,V as pe,Vi as me,Vn as he,Vr as ge,Wn as _e,Wt as ve,Xn as ye,Xr as be,Xt as xe,Yr as Se,_i as Ce,_n as we,ai as Te,b as Ee,bi as De,c as Oe,ci as ke,cn as Ae,cr as je,ct as Me,d as Ne,di as Pe,dr as Fe,dt as Ie,ei as Le,er as Re,f as ze,fi as Be,ft as Ve,gi as He,gr as Ue,hi as We,hn as Ge,hr as Ke,ht as qe,ii as Je,ir as Ye,it as Xe,j as Ze,ji as Qe,jn as $e,jt as et,ki as tt,kn as nt,kt as rt,l as it,li as at,ln as ot,mi as st,mn as ct,mt as lt,nr as ut,nt as dt,o as ft,oi as pt,or as mt,pi as ht,pn as gt,q as _t,qn as vt,qr as yt,qt as bt,ri as xt,rr as St,rt as Ct,s as wt,tt as Tt,u as Et,un as Dt,ut as Ot,vi as kt,vn as At,vr as jt,wi as Mt,wn as Nt,wr as Pt,xi as Ft,y as It,yi as Lt,yr as Rt,z as zt,zr as Bt}from"./dist-IJIMi_KI.js";import{t as Vt}from"./trace-api-D6fqC5Nw.js";import{n as Ht,t as Ut}from"./propagation-api-BHhJitgG.js";import{a as Wt,c as Gt,i as Kt,l as qt,o as Jt,r as Yt,t as Xt,u as J}from"./button-cneJOVxD.js";import{t as Zt}from"./check-Dqb-7gfx.js";import{t as Qt}from"./chevron-down-D3nis7uo.js";import{t as $t}from"./chevron-right-BfmqRYl8.js";import{a as en,c as tn,i as nn,l as rn,o as an,r as on,s as sn}from"./prop-types-Cak_LhNF.js";import{c as cn,l as ln,n as un,o as dn,s as fn}from"./skill-scope-Bt2TwqtA.js";import{$ as pn,A as mn,C as hn,D as gn,E as _n,F as vn,G as yn,I as bn,J as xn,K as Sn,L as Cn,M as wn,N as Tn,O as En,Q as Dn,R as On,S as kn,T as An,U as jn,W as Mn,X as Nn,Y as Pn,Z as Fn,_ as In,a as Ln,at as Rn,b as zn,c as Bn,d as Vn,et as Hn,f as Un,g as Wn,h as Gn,it as Kn,j as qn,k as Jn,l as Yn,m as Xn,nt as Zn,o as Qn,ot as $n,p as er,q as tr,r as nr,rt as rr,s as ir,st as ar,tt as or,u as sr,v as cr,w as lr,x as ur,y as dr,z as fr}from"./config-provider-Do7HkFaK.js";import{n as pr,r as mr}from"./config-context-CVpOcWSZ.js";import{t as hr}from"./git-branch-DtntyZcb.js";import{t as gr}from"./info-B_9IOYHV.js";import{t as _r}from"./loader-circle-CiIO3Fk-.js";import{t as vr}from"./triangle-alert-r1Ou0VrE.js";import{n as yr,r as br}from"./dist-IEs1iCqd.js";import{a as xr,c as Sr,d as Cr,i as wr,n as Tr,o as Er,r as Dr,s as Or,t as kr,u as Ar}from"./dist-D9WIglau.js";import{a as jr,i as Mr,n as Nr,t as Pr}from"./tooltip-C-qXynAd.js";import{n as Fr,t as Ir}from"./dist-BEjpPm3y.js";import{n as Lr,r as Rr,t as zr}from"./collapsible-iVWLn36m.js";import{a as Br,c as Vr,d as Hr,f as Ur,g as Wr,h as Gr,i as Kr,l as qr,m as Jr,n as Yr,o as Xr,p as Zr,r as Qr,s as $r,t as ei,u as ti}from"./dialog-BiB39Lhy.js";import{t as ni}from"./dist-CbgmYSt6.js";import{a as ri,c as ii,g as ai,h as oi,i as si,l as ci,m as li,n as ui,p as di,r as fi,t as pi,u as mi}from"./dist-C_vWk3jN.js";import{t as hi}from"./input-D0MSkqYi.js";import{n as gi,t as _i}from"./dist-0Zj_lz7j.js";import{t as vi}from"./file-tree-rename-validation-BkATWpiZ.js";import{a as yi,n as bi}from"./navigation-targets-CSLWdrg5.js";import{n as xi,t as Si}from"./documents-events-5sCrqLAB.js";import{a as Y,o as Ci,t as wi}from"./startup-marks-DdMtjWR-.js";import{c as Ti,f as Ei,h as Di,l as Oi,n as ki,o as Ai,p as ji,r as Mi,s as Ni}from"./doc-hash-B9qR3wab.js";import{Bt as Pi,C as Fi,Ct as Ii,D as Li,Dt as Ri,E as zi,Et as Bi,F as Vi,Ft as Hi,Ht as Ui,It as Wi,J as Gi,L as Ki,Lt as qi,Mt as Ji,N as Yi,O as Xi,Ot as Zi,P as Qi,Pt as $i,Q as ea,R as X,S as ta,St as na,Tt as ra,V as ia,Vt as aa,X as oa,Y as sa,a as ca,c as la,dt as ua,f as da,j as fa,l as pa,n as ma,o as ha,q as ga,r as _a,t as va,ut as ya,xt as ba}from"./dist-DLLyJf3c.js";import{n as xa,r as Sa,t as Ca}from"./dist-DG-zKHrl.js";import{t as wa}from"./dist-CiFyjhkz.js";import{n as Ta}from"./dist-DsZfUH3j.js";import{n as Ea}from"./dist-BuALIrNm.js";import{n as Da}from"./dist-B9f86446.js";import{i as Oa,n as ka,r as Aa}from"./dist-jwOy5oFW.js";import{n as ja}from"./dist-BUqH6ZNg.js";import{t as Ma}from"./stex-AIAzjJoG.js";var Z=i();(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 Na=J(`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`}]]),Pa=J(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Fa=J(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Ia=J(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),La=J(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Ra=J(`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`}]]),za=J(`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`}]]),Ba=J(`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`}]]),Va=J(`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`}]]),Ha=J(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ua=J(`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`}]]),Wa=J(`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`}]]),Ga=J(`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`}]]),Ka=J(`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`}]]),qa=J(`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`}]]),Ja=J(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ya=J(`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`}]]),Xa=J(`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`}]]),Za=J(`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`}]]),Qa=J(`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`}]]),$a=J(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),eo=J(`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`}]]),to=J(`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`}]]),no=J(`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`}]]),ro=J(`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`}]]),io=J(`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`}]]),ao=J(`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`}]]),oo=J(`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`}]]),so=J(`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`}]]),co=J(`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`}]]),lo=J(`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`}]]),uo=J(`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`}]]),fo=J(`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`}]]),po=J(`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`}]]),mo=J(`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`}]]),ho=[[`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`}]],go=J(`link-2`,ho),_o=J(`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`}]]),vo=J(`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`}]]),yo=J(`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`}]]),bo=J(`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`}]]),xo=J(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),So=J(`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`}]]),Co=J(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),wo=J(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),To=J(`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`}]]),Eo=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Do=J(`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`}]]),Oo=J(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),ko=J(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ao=J(`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`}]]),jo=J(`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`}]]),Mo=J(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),No=J(`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`}]]),Po=J(`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`}]]),Fo=J(`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`}]]),Io=J(`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`}]]),Lo=J(`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`}]]),Ro=J(`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`}]]),zo=J(`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`}]]),Bo=J(`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`}]]),Vo=J(`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`}]]),Ho=J(`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`}]]),Uo=J(`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`}]]),Wo=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})),Go=t(((e,t)=>{t.exports=Wo()})),Q=e(r(),1),Ko=e(l(),1);function qo(e,[t,n]){return Math.min(n,Math.max(t,e))}var Jo=`Popover`,[Yo,Xo]=Ar(Jo,[ri]),Zo=ri(),[Qo,$o]=Yo(Jo),es=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Zo(t),c=Q.useRef(null),[l,u]=Q.useState(!1),[d,f]=Er({prop:r,defaultProp:i??!1,onChange:a,caller:Jo});return(0,Z.jsx)(si,{...s,children:(0,Z.jsx)(Qo,{scope:t,contentId:wr(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:Q.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:Q.useCallback(()=>u(!0),[]),onCustomAnchorRemove:Q.useCallback(()=>u(!1),[]),modal:o,children:n})})};es.displayName=Jo;var ts=`PopoverAnchor`,ns=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$o(ts,n),a=Zo(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return Q.useEffect(()=>(o(),()=>s()),[o,s]),(0,Z.jsx)(pi,{...a,...r,ref:t})});ns.displayName=ts;var rs=`PopoverTrigger`,is=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$o(rs,n),a=Zo(n),o=qt(t,i.triggerRef),s=(0,Z.jsx)(Cr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ys(i.open),...r,ref:o,onClick:Sr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,Z.jsx)(pi,{asChild:!0,...a,children:s})});is.displayName=rs;var as=`PopoverPortal`,[os,ss]=Yo(as,{forceMount:void 0}),cs=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=$o(as,t);return(0,Z.jsx)(os,{scope:t,forceMount:n,children:(0,Z.jsx)(xr,{present:n||a.open,children:(0,Z.jsx)(kr,{asChild:!0,container:i,children:r})})})};cs.displayName=as;var ls=`PopoverContent`,us=Q.forwardRef((e,t)=>{let n=ss(ls,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=$o(ls,e.__scopePopover);return(0,Z.jsx)(xr,{present:r||a.open,children:a.modal?(0,Z.jsx)(fs,{...i,ref:t}):(0,Z.jsx)(ps,{...i,ref:t})})});us.displayName=ls;var ds=Jt(`PopoverContent.RemoveScroll`),fs=Q.forwardRef((e,t)=>{let n=$o(ls,e.__scopePopover),r=Q.useRef(null),i=qt(t,r),a=Q.useRef(!1);return Q.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,Z.jsx)(Jr,{as:ds,allowPinchZoom:!0,children:(0,Z.jsx)(ms,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sr(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Sr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Sr(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ps=Q.forwardRef((e,t)=>{let n=$o(ls,e.__scopePopover),r=Q.useRef(!1),i=Q.useRef(!1);return(0,Z.jsx)(ms,{...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()}})}),ms=Q.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=$o(ls,n),p=Zo(n);return Gr(),(0,Z.jsx)(Wr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Z.jsx)(Tr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,Z.jsx)(fi,{"data-state":ys(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)`}})})})}),hs=`PopoverClose`,gs=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$o(hs,n);return(0,Z.jsx)(Cr.button,{type:`button`,...r,ref:t,onClick:Sr(e.onClick,()=>i.onOpenChange(!1))})});gs.displayName=hs;var _s=`PopoverArrow`,vs=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zo(n);return(0,Z.jsx)(ui,{...i,...r,ref:t})});vs.displayName=_s;function ys(e){return e?`open`:`closed`}var bs=es,xs=ns,Ss=is,Cs=cs,ws=us,Ts=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Es=[` `,`Enter`],Ds=`Select`,[Os,ks,As]=Fr(Ds),[js,Ms]=Ar(Ds,[As,ri]),Ns=ri(),[Ps,Fs]=js(Ds),[Is,Ls]=js(Ds),Rs=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=Ns(t),[g,_]=Q.useState(null),[v,y]=Q.useState(null),[b,x]=Q.useState(!1),S=Ir(l),[C,w]=Er({prop:r,defaultProp:i??!1,onChange:a,caller:Ds}),[T,E]=Er({prop:o,defaultProp:s,onChange:c,caller:Ds}),D=Q.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=Q.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,Z.jsx)(si,{...h,children:(0,Z.jsxs)(Ps,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:wr(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,Z.jsx)(Os.Provider,{scope:t,children:(0,Z.jsx)(Is,{scope:e.__scopeSelect,onNativeOptionAdd:Q.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:Q.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,Z.jsxs)(Nc,{"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,Z.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};Rs.displayName=Ds;var zs=`SelectTrigger`,Bs=Q.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Ns(n),o=Fs(zs,n),s=o.disabled||r,c=qt(t,o.onTriggerChange),l=ks(n),u=Q.useRef(`touch`),[d,f,p]=Fc(e=>{let t=l().filter(e=>!e.disabled),n=Ic(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,Z.jsx)(pi,{asChild:!0,...a,children:(0,Z.jsx)(Cr.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":Pc(o.value)?``:void 0,...i,ref:c,onClick:Sr(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Sr(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:Sr(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Ts.includes(e.key)&&(m(),e.preventDefault())})})})});Bs.displayName=zs;var Vs=`SelectValue`,Hs=Q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Fs(Vs,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=qt(t,c.onValueNodeChange);return Or(()=>{l(u)},[l,u]),(0,Z.jsx)(Cr.span,{...s,ref:d,style:{pointerEvents:`none`},children:Pc(c.value)?(0,Z.jsx)(Z.Fragment,{children:o}):a})});Hs.displayName=Vs;var Us=`SelectIcon`,Ws=Q.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,Z.jsx)(Cr.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Ws.displayName=Us;var Gs=`SelectPortal`,Ks=e=>(0,Z.jsx)(kr,{asChild:!0,...e});Ks.displayName=Gs;var qs=`SelectContent`,Js=Q.forwardRef((e,t)=>{let n=Fs(qs,e.__scopeSelect),[r,i]=Q.useState();if(Or(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Ko.createPortal((0,Z.jsx)(Xs,{scope:e.__scopeSelect,children:(0,Z.jsx)(Os.Slot,{scope:e.__scopeSelect,children:(0,Z.jsx)(`div`,{children:e.children})})}),t):null}return(0,Z.jsx)(ec,{...e,ref:t})});Js.displayName=qs;var Ys=10,[Xs,Zs]=js(qs),Qs=`SelectContentImpl`,$s=Jt(`SelectContent.RemoveScroll`),ec=Q.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=Fs(qs,n),[y,b]=Q.useState(null),[x,S]=Q.useState(null),C=qt(t,e=>b(e)),[w,T]=Q.useState(null),[E,D]=Q.useState(null),O=ks(n),[k,A]=Q.useState(!1),j=Q.useRef(!1);Q.useEffect(()=>{if(y)return Zr(y)},[y]),Gr();let M=Q.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=Q.useCallback(()=>M([w,y]),[M,w,y]);Q.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;Q.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]),Q.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]=Fc(e=>{let t=O().filter(e=>!e.disabled),n=Ic(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),R=Q.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]),z=Q.useCallback(()=>y?.focus(),[y]),B=Q.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),V=r===`popper`?ic:nc,ee=V===ic?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,Z.jsx)(Xs,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:R,selectedItem:w,onItemLeave:z,itemTextRefCallback:B,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:I,children:(0,Z.jsx)(Jr,{as:$s,allowPinchZoom:!0,children:(0,Z.jsx)(Wr,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Sr(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,Z.jsx)(Tr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,Z.jsx)(V,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ee,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Sr(_.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()}})})})})})})});ec.displayName=Qs;var tc=`SelectItemAlignedPosition`,nc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Fs(qs,n),o=Zs(qs,n),[s,c]=Q.useState(null),[l,u]=Q.useState(null),d=qt(t,e=>u(e)),f=ks(n),p=Q.useRef(!1),m=Q.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=Q.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-Ys,d=qo(a,[Ys,Math.max(Ys,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-Ys,d=qo(a,[Ys,Math.max(Ys,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Ys*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-Ys,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=`${Ys}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]);Or(()=>y(),[y]);let[b,x]=Q.useState();return Or(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,Z.jsx)(ac,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:Q.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,Z.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,Z.jsx)(Cr.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});nc.displayName=tc;var rc=`SelectPopperPosition`,ic=Q.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Ys,...a}=e,o=Ns(n);return(0,Z.jsx)(fi,{...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)`}})});ic.displayName=rc;var[ac,oc]=js(qs,{}),sc=`SelectViewport`,cc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Zs(sc,n),o=oc(sc,n),s=qt(t,a.onViewportChange),c=Q.useRef(0);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.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,Z.jsx)(Os.Slot,{scope:n,children:(0,Z.jsx)(Cr.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Sr(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-Ys*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})})})]})});cc.displayName=sc;var lc=`SelectGroup`,[uc,dc]=js(lc),fc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=wr();return(0,Z.jsx)(uc,{scope:n,id:i,children:(0,Z.jsx)(Cr.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});fc.displayName=lc;var pc=`SelectLabel`,mc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=dc(pc,n);return(0,Z.jsx)(Cr.div,{id:i.id,...r,ref:t})});mc.displayName=pc;var hc=`SelectItem`,[gc,_c]=js(hc),vc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Fs(hc,n),c=Zs(hc,n),l=s.value===r,[u,d]=Q.useState(a??``),[f,p]=Q.useState(!1),m=qt(t,e=>c.itemRefCallback?.(e,r,i)),h=wr(),g=Q.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,Z.jsx)(gc,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:Q.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,Z.jsx)(Os.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,Z.jsx)(Cr.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:Sr(o.onFocus,()=>p(!0)),onBlur:Sr(o.onBlur,()=>p(!1)),onClick:Sr(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Sr(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Sr(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Sr(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Sr(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Sr(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Es.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});vc.displayName=hc;var yc=`SelectItemText`,bc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Fs(yc,n),s=Zs(yc,n),c=_c(yc,n),l=Ls(yc,n),[u,d]=Q.useState(null),f=qt(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=Q.useMemo(()=>(0,Z.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Or(()=>(h(m),()=>g(m)),[h,g,m]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Cr.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ko.createPortal(a.children,o.valueNode):null]})});bc.displayName=yc;var xc=`SelectItemIndicator`,Sc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return _c(xc,n).isSelected?(0,Z.jsx)(Cr.span,{"aria-hidden":!0,...r,ref:t}):null});Sc.displayName=xc;var Cc=`SelectScrollUpButton`,wc=Q.forwardRef((e,t)=>{let n=Zs(Cc,e.__scopeSelect),r=oc(Cc,e.__scopeSelect),[i,a]=Q.useState(!1),o=qt(t,r.onScrollButtonChange);return Or(()=>{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,Z.jsx)(Dc,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});wc.displayName=Cc;var Tc=`SelectScrollDownButton`,Ec=Q.forwardRef((e,t)=>{let n=Zs(Tc,e.__scopeSelect),r=oc(Tc,e.__scopeSelect),[i,a]=Q.useState(!1),o=qt(t,r.onScrollButtonChange);return Or(()=>{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,Z.jsx)(Dc,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Ec.displayName=Tc;var Dc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Zs(`SelectScrollButton`,n),o=Q.useRef(null),s=ks(n),c=Q.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return Q.useEffect(()=>()=>c(),[c]),Or(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,Z.jsx)(Cr.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Sr(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Sr(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Sr(i.onPointerLeave,()=>{c()})})}),Oc=`SelectSeparator`,kc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,Z.jsx)(Cr.div,{"aria-hidden":!0,...r,ref:t})});kc.displayName=Oc;var Ac=`SelectArrow`,jc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ns(n),a=Fs(Ac,n),o=Zs(Ac,n);return a.open&&o.position===`popper`?(0,Z.jsx)(ui,{...i,...r,ref:t}):null});jc.displayName=Ac;var Mc=`SelectBubbleInput`,Nc=Q.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=Q.useRef(null),a=qt(r,i),o=ni(t);return Q.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,Z.jsx)(Cr.select,{...n,style:{...jr,...n.style},ref:a,defaultValue:t})});Nc.displayName=Mc;function Pc(e){return e===``||e===void 0}function Fc(e){let t=Dr(e),n=Q.useRef(``),r=Q.useRef(0),i=Q.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=Q.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return Q.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ic(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=Lc(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 Lc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Rc=Rs,zc=Bs,Bc=Hs,Vc=Ws,Hc=Ks,Uc=Js,Wc=cc,Gc=vc,Kc=bc,qc=Sc,Jc=wc,Yc=Ec,Xc=`Switch`,[Zc,Qc]=Ar(Xc),[$c,el]=Zc(Xc),tl=Q.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]=Q.useState(null),m=qt(t,e=>p(e)),h=Q.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=Er({prop:i,defaultProp:a??!1,onChange:l,caller:Xc});return(0,Z.jsxs)($c,{scope:n,checked:_,disabled:s,children:[(0,Z.jsx)(Cr.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":ol(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:Sr(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,Z.jsx)(al,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});tl.displayName=Xc;var nl=`SwitchThumb`,rl=Q.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=el(nl,n);return(0,Z.jsx)(Cr.span,{"data-state":ol(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});rl.displayName=nl;var il=`SwitchBubbleInput`,al=Q.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=Q.useRef(null),s=qt(o,a),c=ni(n),l=ai(t);return Q.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,Z.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}})});al.displayName=il;function ol(e){return e?`checked`:`unchecked`}var sl=tl,cl=rl,$=a(),ll=Go(),{getOwnPropertyNames:ul,getOwnPropertySymbols:dl}=Object,{hasOwnProperty:fl}=Object.prototype;function pl(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function ml(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 hl(e){return e?.[Symbol.toStringTag]}function gl(e){return ul(e).concat(dl(e))}var _l=Object.hasOwn||((e,t)=>fl.call(e,t));function vl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var yl=`__v`,bl=`__o`,xl=`_owner`,{getOwnPropertyDescriptor:Sl,keys:Cl}=Object;function wl(e,t){return e.byteLength===t.byteLength&&Ll(new Uint8Array(e),new Uint8Array(t))}function Tl(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 El(e,t){return e.byteLength===t.byteLength&&Ll(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Dl(e,t){return vl(e.getTime(),t.getTime())}function Ol(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kl(e,t){return e===t}function Al(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 jl=vl;function Ml(e,t,n){let r=Cl(e),i=r.length;if(Cl(t).length!==i)return!1;for(;i-- >0;)if(!zl(e,t,n,r[i]))return!1;return!0}function Nl(e,t,n){let r=gl(e),i=r.length;if(gl(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!zl(e,t,n,a)||(o=Sl(e,a),s=Sl(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Pl(e,t){return vl(e.valueOf(),t.valueOf())}function Fl(e,t){return e.source===t.source&&e.flags===t.flags}function Il(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 Ll(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 Rl(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 zl(e,t,n,r){return(r===xl||r===bl||r===yl)&&(e.$$typeof||t.$$typeof)?!0:_l(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Bl=`[object ArrayBuffer]`,Vl=`[object Arguments]`,Hl=`[object Boolean]`,Ul=`[object DataView]`,Wl=`[object Date]`,Gl=`[object Error]`,Kl=`[object Map]`,ql=`[object Number]`,Jl=`[object Object]`,Yl=`[object RegExp]`,Xl=`[object Set]`,Zl=`[object String]`,Ql={"[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},$l=`[object URL]`,eu=Object.prototype.toString;function tu({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=eu.call(h);if(b===Wl)return r(h,g,_);if(b===Yl)return u(h,g,_);if(b===Kl)return o(h,g,_);if(b===Xl)return d(h,g,_);if(b===Jl)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===$l)return p(h,g,_);if(b===Gl)return i(h,g,_);if(b===Vl)return c(h,g,_);if(Ql[b])return f(h,g,_);if(b===Bl)return e(h,g,_);if(b===Ul)return n(h,g,_);if(b===Hl||b===ql||b===Zl)return l(h,g,_);if(m){let e=m[b];if(!e){let t=hl(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function nu({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:wl,areArraysEqual:n?Nl:Tl,areDataViewsEqual:El,areDatesEqual:Dl,areErrorsEqual:Ol,areFunctionsEqual:kl,areMapsEqual:n?pl(Al,Nl):Al,areNumbersEqual:jl,areObjectsEqual:n?Nl:Ml,arePrimitiveWrappersEqual:Pl,areRegExpsEqual:Fl,areSetsEqual:n?pl(Il,Nl):Il,areTypedArraysEqual:n?pl(Ll,Nl):Ll,areUrlsEqual:Rl,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=ml(r.areArraysEqual),t=ml(r.areMapsEqual),n=ml(r.areObjectsEqual),i=ml(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function ru(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function iu({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 au=ou();ou({strict:!0}),ou({circular:!0}),ou({circular:!0,strict:!0}),ou({createInternalComparator:()=>vl}),ou({strict:!0,createInternalComparator:()=>vl}),ou({circular:!0,createInternalComparator:()=>vl}),ou({circular:!0,createInternalComparator:()=>vl,strict:!0});function ou(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=tu(nu(e));return iu({circular:t,comparator:a,createState:r,equals:n?n(a):ru(a),strict:i})}var su=t((e=>{var t=r(),n=Go();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}})),cu=t(((e,t)=>{t.exports=su()}))(),lu=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},uu=({contentComponent:e})=>{let t=(0,ll.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Z.jsx)(Z.Fragment,{children:Object.values(t)})};function du(){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]:Ko.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 fu=class extends Q.Component{constructor(e){super(e),this.editorContentRef=Q.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=du(),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,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:lu(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Z.jsx)(uu,{contentComponent:e.contentComponent})]})}},pu=(0,Q.forwardRef)((e,t)=>{let n=Q.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Q.createElement(fu,{key:n,innerRef:t,...e})}),mu=Q.memo(pu),hu=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,gu=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 _u(e){let[t]=(0,Q.useState)(()=>new gu(e.editor)),n=(0,cu.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??au);return hu(()=>t.watch(e.editor),[e.editor,t]),(0,Q.useDebugValue)(n),n}var vu=!1,yu=typeof window>`u`,bu=yu||!!(typeof window<`u`&&window.next),xu=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(yu||bu){if(vu)throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&yu&&vu)throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){return new ge({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Su(e={},t=[]){let n=(0,Q.useRef)(e);n.current=e;let[r]=(0,Q.useState)(()=>new xu(n)),i=(0,ll.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,Q.useDebugValue)(i),(0,Q.useEffect)(r.onRender(t)),_u({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Cu=(0,Q.createContext)({editor:null});Cu.Consumer;var wu=()=>(0,Q.useContext)(Cu),Tu=(0,Q.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Eu=()=>(0,Q.useContext)(Tu);function Du({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=Eu();return(0,Z.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var Ou=Q.forwardRef((e,t)=>{let{onDragStart:n}=Eu();return(0,Z.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function ku(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function Au(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function ju(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function Mu(e){if(ku(e)||Au(e))return!0;if(ju(e)){let t=e.type;if(t)return ku(t)||Au(t)}return!1}function Nu(){try{if(Q.version)return parseInt(Q.version.split(`.`)[0],10)>=19}catch{}return!1}var Pu=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,Ko.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=Nu(),a=Mu(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,Z.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])})}};Q.createContext({markViewContentRef:()=>{}});var Fu=class extends T{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,Q.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,Q.memo)(e=>(0,Z.jsx)(Tu.Provider,{value:t,children:(0,Q.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 Pu(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())},Te(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&&=(L(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=Se(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Iu(e,t){return n=>n.editor.contentComponent?new Fu(e,n,t):{}}var Lu=(0,Q.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Lu.displayName=`TiptapContext`;var Ru=()=>(0,Q.useContext)(Lu);function zu({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,Q.useMemo)(()=>({editor:r}),[r]),a=(0,Q.useMemo)(()=>({editor:r}),[r]);return(0,Z.jsx)(Cu.Provider,{value:a,children:(0,Z.jsx)(Lu.Provider,{value:i,children:n})})}zu.displayName=`Tiptap`;function Bu({...e}){let{editor:t}=Ru();return(0,Z.jsx)(mu,{editor:t,...e})}Bu.displayName=`Tiptap.Content`,Object.assign(zu,{Content:Bu});function Vu(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=yt(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 Hu(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,`
|
|
2
|
+
import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{n as r,r as i,t as a}from"./compiler-runtime-CVnuRdak.js";import{n as o,r as s}from"./dist-CQw2y-s3.js";import{n as c}from"./dist-BVOt51sU.js";import{t as l}from"./react-dom-C-oc-P2K.js";import{$ as u,$n as d,$r as f,Ai as p,An as m,At as h,B as g,Bi as _,Br as v,En as y,Et as b,F as x,Fn as S,G as C,Gn as w,Gr as T,H as E,Hi as D,Hr as O,Ht as k,Ii as A,In as j,Ir as M,J as N,Jn as P,Jr as F,K as I,Kr as L,Kt as R,L as z,Ln as B,Lr as V,Mn as ee,Nn as H,Oi as U,On as W,Or as te,Pn as G,Pt as ne,Q as K,Qn as re,Rn as ie,Rr as ae,S as oe,Si as q,Sn as se,Tn as ce,Tr as le,U as ue,Un as de,Ur as fe,V as pe,Vi as me,Vn as he,Vr as ge,Wn as _e,Wt as ve,Xn as ye,Xr as be,Xt as xe,Yr as Se,_i as Ce,_n as we,ai as Te,b as Ee,bi as De,c as Oe,ci as ke,cn as Ae,cr as je,ct as Me,d as Ne,di as Pe,dr as Fe,dt as Ie,ei as Le,er as Re,f as ze,fi as Be,ft as Ve,gi as He,gr as Ue,hi as We,hn as Ge,hr as Ke,ht as qe,ii as Je,ir as Ye,it as Xe,j as Ze,ji as Qe,jn as $e,jt as et,ki as tt,kn as nt,kt as rt,l as it,li as at,ln as ot,mi as st,mn as ct,mt as lt,nr as ut,nt as dt,o as ft,oi as pt,or as mt,pi as ht,pn as gt,q as _t,qn as vt,qr as yt,qt as bt,ri as xt,rr as St,rt as Ct,s as wt,tt as Tt,u as Et,un as Dt,ut as Ot,vi as kt,vn as At,vr as jt,wi as Mt,wn as Nt,wr as Pt,xi as Ft,y as It,yi as Lt,yr as Rt,z as zt,zr as Bt}from"./dist-IJIMi_KI.js";import{t as Vt}from"./trace-api-D6fqC5Nw.js";import{n as Ht,t as Ut}from"./propagation-api-BHhJitgG.js";import{a as Wt,c as Gt,i as Kt,l as qt,o as Jt,r as Yt,t as Xt,u as J}from"./button-cneJOVxD.js";import{t as Zt}from"./check-Dqb-7gfx.js";import{t as Qt}from"./chevron-down-D3nis7uo.js";import{t as $t}from"./chevron-right-BfmqRYl8.js";import{a as en,c as tn,i as nn,l as rn,o as an,r as on,s as sn}from"./prop-types-Cak_LhNF.js";import{c as cn,l as ln,n as un,o as dn,s as fn}from"./skill-scope-Bt2TwqtA.js";import{$ as pn,A as mn,C as hn,D as gn,E as _n,F as vn,G as yn,I as bn,J as xn,K as Sn,L as Cn,M as wn,N as Tn,O as En,Q as Dn,R as On,S as kn,T as An,U as jn,W as Mn,X as Nn,Y as Pn,Z as Fn,_ as In,a as Ln,at as Rn,b as zn,c as Bn,d as Vn,et as Hn,f as Un,g as Wn,h as Gn,it as Kn,j as qn,k as Jn,l as Yn,m as Xn,nt as Zn,o as Qn,ot as $n,p as er,q as tr,r as nr,rt as rr,s as ir,st as ar,tt as or,u as sr,v as cr,w as lr,x as ur,y as dr,z as fr}from"./config-provider-BXTM5j4b.js";import{n as pr,r as mr}from"./config-context-CVpOcWSZ.js";import{t as hr}from"./git-branch-DtntyZcb.js";import{t as gr}from"./info-B_9IOYHV.js";import{t as _r}from"./loader-circle-CiIO3Fk-.js";import{t as vr}from"./triangle-alert-r1Ou0VrE.js";import{n as yr,r as br}from"./dist-IEs1iCqd.js";import{a as xr,c as Sr,d as Cr,i as wr,n as Tr,o as Er,r as Dr,s as Or,t as kr,u as Ar}from"./dist-D9WIglau.js";import{a as jr,i as Mr,n as Nr,t as Pr}from"./tooltip-C-qXynAd.js";import{n as Fr,t as Ir}from"./dist-BEjpPm3y.js";import{n as Lr,r as Rr,t as zr}from"./collapsible-iVWLn36m.js";import{a as Br,c as Vr,d as Hr,f as Ur,g as Wr,h as Gr,i as Kr,l as qr,m as Jr,n as Yr,o as Xr,p as Zr,r as Qr,s as $r,t as ei,u as ti}from"./dialog-BiB39Lhy.js";import{t as ni}from"./dist-CbgmYSt6.js";import{a as ri,c as ii,g as ai,h as oi,i as si,l as ci,m as li,n as ui,p as di,r as fi,t as pi,u as mi}from"./dist-C_vWk3jN.js";import{t as hi}from"./input-D0MSkqYi.js";import{n as gi,t as _i}from"./dist-0Zj_lz7j.js";import{t as vi}from"./file-tree-rename-validation-BkATWpiZ.js";import{a as yi,n as bi}from"./navigation-targets-CSLWdrg5.js";import{n as xi,t as Si}from"./documents-events-5sCrqLAB.js";import{a as Y,o as Ci,t as wi}from"./startup-marks-DdMtjWR-.js";import{c as Ti,f as Ei,h as Di,l as Oi,n as ki,o as Ai,p as ji,r as Mi,s as Ni}from"./doc-hash-B9qR3wab.js";import{Bt as Pi,C as Fi,Ct as Ii,D as Li,Dt as Ri,E as zi,Et as Bi,F as Vi,Ft as Hi,Ht as Ui,It as Wi,J as Gi,L as Ki,Lt as qi,Mt as Ji,N as Yi,O as Xi,Ot as Zi,P as Qi,Pt as $i,Q as ea,R as X,S as ta,St as na,Tt as ra,V as ia,Vt as aa,X as oa,Y as sa,a as ca,c as la,dt as ua,f as da,j as fa,l as pa,n as ma,o as ha,q as ga,r as _a,t as va,ut as ya,xt as ba}from"./dist-DLLyJf3c.js";import{n as xa,r as Sa,t as Ca}from"./dist-DG-zKHrl.js";import{t as wa}from"./dist-CiFyjhkz.js";import{n as Ta}from"./dist-DsZfUH3j.js";import{n as Ea}from"./dist-BuALIrNm.js";import{n as Da}from"./dist-B9f86446.js";import{i as Oa,n as ka,r as Aa}from"./dist-jwOy5oFW.js";import{n as ja}from"./dist-BUqH6ZNg.js";import{t as Ma}from"./stex-AIAzjJoG.js";var Z=i();(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 Na=J(`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`}]]),Pa=J(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Fa=J(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Ia=J(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),La=J(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Ra=J(`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`}]]),za=J(`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`}]]),Ba=J(`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`}]]),Va=J(`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`}]]),Ha=J(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ua=J(`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`}]]),Wa=J(`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`}]]),Ga=J(`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`}]]),Ka=J(`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`}]]),qa=J(`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`}]]),Ja=J(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ya=J(`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`}]]),Xa=J(`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`}]]),Za=J(`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`}]]),Qa=J(`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`}]]),$a=J(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),eo=J(`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`}]]),to=J(`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`}]]),no=J(`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`}]]),ro=J(`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`}]]),io=J(`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`}]]),ao=J(`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`}]]),oo=J(`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`}]]),so=J(`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`}]]),co=J(`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`}]]),lo=J(`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`}]]),uo=J(`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`}]]),fo=J(`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`}]]),po=J(`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`}]]),mo=J(`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`}]]),ho=[[`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`}]],go=J(`link-2`,ho),_o=J(`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`}]]),vo=J(`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`}]]),yo=J(`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`}]]),bo=J(`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`}]]),xo=J(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),So=J(`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`}]]),Co=J(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),wo=J(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),To=J(`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`}]]),Eo=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Do=J(`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`}]]),Oo=J(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),ko=J(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ao=J(`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`}]]),jo=J(`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`}]]),Mo=J(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),No=J(`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`}]]),Po=J(`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`}]]),Fo=J(`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`}]]),Io=J(`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`}]]),Lo=J(`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`}]]),Ro=J(`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`}]]),zo=J(`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`}]]),Bo=J(`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`}]]),Vo=J(`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`}]]),Ho=J(`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`}]]),Uo=J(`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`}]]),Wo=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})),Go=t(((e,t)=>{t.exports=Wo()})),Q=e(r(),1),Ko=e(l(),1);function qo(e,[t,n]){return Math.min(n,Math.max(t,e))}var Jo=`Popover`,[Yo,Xo]=Ar(Jo,[ri]),Zo=ri(),[Qo,$o]=Yo(Jo),es=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Zo(t),c=Q.useRef(null),[l,u]=Q.useState(!1),[d,f]=Er({prop:r,defaultProp:i??!1,onChange:a,caller:Jo});return(0,Z.jsx)(si,{...s,children:(0,Z.jsx)(Qo,{scope:t,contentId:wr(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:Q.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:Q.useCallback(()=>u(!0),[]),onCustomAnchorRemove:Q.useCallback(()=>u(!1),[]),modal:o,children:n})})};es.displayName=Jo;var ts=`PopoverAnchor`,ns=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$o(ts,n),a=Zo(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return Q.useEffect(()=>(o(),()=>s()),[o,s]),(0,Z.jsx)(pi,{...a,...r,ref:t})});ns.displayName=ts;var rs=`PopoverTrigger`,is=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$o(rs,n),a=Zo(n),o=qt(t,i.triggerRef),s=(0,Z.jsx)(Cr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ys(i.open),...r,ref:o,onClick:Sr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,Z.jsx)(pi,{asChild:!0,...a,children:s})});is.displayName=rs;var as=`PopoverPortal`,[os,ss]=Yo(as,{forceMount:void 0}),cs=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=$o(as,t);return(0,Z.jsx)(os,{scope:t,forceMount:n,children:(0,Z.jsx)(xr,{present:n||a.open,children:(0,Z.jsx)(kr,{asChild:!0,container:i,children:r})})})};cs.displayName=as;var ls=`PopoverContent`,us=Q.forwardRef((e,t)=>{let n=ss(ls,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=$o(ls,e.__scopePopover);return(0,Z.jsx)(xr,{present:r||a.open,children:a.modal?(0,Z.jsx)(fs,{...i,ref:t}):(0,Z.jsx)(ps,{...i,ref:t})})});us.displayName=ls;var ds=Jt(`PopoverContent.RemoveScroll`),fs=Q.forwardRef((e,t)=>{let n=$o(ls,e.__scopePopover),r=Q.useRef(null),i=qt(t,r),a=Q.useRef(!1);return Q.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,Z.jsx)(Jr,{as:ds,allowPinchZoom:!0,children:(0,Z.jsx)(ms,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sr(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Sr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Sr(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ps=Q.forwardRef((e,t)=>{let n=$o(ls,e.__scopePopover),r=Q.useRef(!1),i=Q.useRef(!1);return(0,Z.jsx)(ms,{...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()}})}),ms=Q.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=$o(ls,n),p=Zo(n);return Gr(),(0,Z.jsx)(Wr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Z.jsx)(Tr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,Z.jsx)(fi,{"data-state":ys(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)`}})})})}),hs=`PopoverClose`,gs=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$o(hs,n);return(0,Z.jsx)(Cr.button,{type:`button`,...r,ref:t,onClick:Sr(e.onClick,()=>i.onOpenChange(!1))})});gs.displayName=hs;var _s=`PopoverArrow`,vs=Q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zo(n);return(0,Z.jsx)(ui,{...i,...r,ref:t})});vs.displayName=_s;function ys(e){return e?`open`:`closed`}var bs=es,xs=ns,Ss=is,Cs=cs,ws=us,Ts=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Es=[` `,`Enter`],Ds=`Select`,[Os,ks,As]=Fr(Ds),[js,Ms]=Ar(Ds,[As,ri]),Ns=ri(),[Ps,Fs]=js(Ds),[Is,Ls]=js(Ds),Rs=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=Ns(t),[g,_]=Q.useState(null),[v,y]=Q.useState(null),[b,x]=Q.useState(!1),S=Ir(l),[C,w]=Er({prop:r,defaultProp:i??!1,onChange:a,caller:Ds}),[T,E]=Er({prop:o,defaultProp:s,onChange:c,caller:Ds}),D=Q.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=Q.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,Z.jsx)(si,{...h,children:(0,Z.jsxs)(Ps,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:wr(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,Z.jsx)(Os.Provider,{scope:t,children:(0,Z.jsx)(Is,{scope:e.__scopeSelect,onNativeOptionAdd:Q.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:Q.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,Z.jsxs)(Nc,{"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,Z.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};Rs.displayName=Ds;var zs=`SelectTrigger`,Bs=Q.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Ns(n),o=Fs(zs,n),s=o.disabled||r,c=qt(t,o.onTriggerChange),l=ks(n),u=Q.useRef(`touch`),[d,f,p]=Fc(e=>{let t=l().filter(e=>!e.disabled),n=Ic(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,Z.jsx)(pi,{asChild:!0,...a,children:(0,Z.jsx)(Cr.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":Pc(o.value)?``:void 0,...i,ref:c,onClick:Sr(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Sr(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:Sr(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Ts.includes(e.key)&&(m(),e.preventDefault())})})})});Bs.displayName=zs;var Vs=`SelectValue`,Hs=Q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Fs(Vs,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=qt(t,c.onValueNodeChange);return Or(()=>{l(u)},[l,u]),(0,Z.jsx)(Cr.span,{...s,ref:d,style:{pointerEvents:`none`},children:Pc(c.value)?(0,Z.jsx)(Z.Fragment,{children:o}):a})});Hs.displayName=Vs;var Us=`SelectIcon`,Ws=Q.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,Z.jsx)(Cr.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Ws.displayName=Us;var Gs=`SelectPortal`,Ks=e=>(0,Z.jsx)(kr,{asChild:!0,...e});Ks.displayName=Gs;var qs=`SelectContent`,Js=Q.forwardRef((e,t)=>{let n=Fs(qs,e.__scopeSelect),[r,i]=Q.useState();if(Or(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Ko.createPortal((0,Z.jsx)(Xs,{scope:e.__scopeSelect,children:(0,Z.jsx)(Os.Slot,{scope:e.__scopeSelect,children:(0,Z.jsx)(`div`,{children:e.children})})}),t):null}return(0,Z.jsx)(ec,{...e,ref:t})});Js.displayName=qs;var Ys=10,[Xs,Zs]=js(qs),Qs=`SelectContentImpl`,$s=Jt(`SelectContent.RemoveScroll`),ec=Q.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=Fs(qs,n),[y,b]=Q.useState(null),[x,S]=Q.useState(null),C=qt(t,e=>b(e)),[w,T]=Q.useState(null),[E,D]=Q.useState(null),O=ks(n),[k,A]=Q.useState(!1),j=Q.useRef(!1);Q.useEffect(()=>{if(y)return Zr(y)},[y]),Gr();let M=Q.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=Q.useCallback(()=>M([w,y]),[M,w,y]);Q.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;Q.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]),Q.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]=Fc(e=>{let t=O().filter(e=>!e.disabled),n=Ic(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),R=Q.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]),z=Q.useCallback(()=>y?.focus(),[y]),B=Q.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),V=r===`popper`?ic:nc,ee=V===ic?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,Z.jsx)(Xs,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:R,selectedItem:w,onItemLeave:z,itemTextRefCallback:B,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:I,children:(0,Z.jsx)(Jr,{as:$s,allowPinchZoom:!0,children:(0,Z.jsx)(Wr,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Sr(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,Z.jsx)(Tr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,Z.jsx)(V,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ee,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Sr(_.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()}})})})})})})});ec.displayName=Qs;var tc=`SelectItemAlignedPosition`,nc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Fs(qs,n),o=Zs(qs,n),[s,c]=Q.useState(null),[l,u]=Q.useState(null),d=qt(t,e=>u(e)),f=ks(n),p=Q.useRef(!1),m=Q.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=Q.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-Ys,d=qo(a,[Ys,Math.max(Ys,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-Ys,d=qo(a,[Ys,Math.max(Ys,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Ys*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-Ys,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=`${Ys}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]);Or(()=>y(),[y]);let[b,x]=Q.useState();return Or(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,Z.jsx)(ac,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:Q.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,Z.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,Z.jsx)(Cr.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});nc.displayName=tc;var rc=`SelectPopperPosition`,ic=Q.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Ys,...a}=e,o=Ns(n);return(0,Z.jsx)(fi,{...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)`}})});ic.displayName=rc;var[ac,oc]=js(qs,{}),sc=`SelectViewport`,cc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Zs(sc,n),o=oc(sc,n),s=qt(t,a.onViewportChange),c=Q.useRef(0);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.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,Z.jsx)(Os.Slot,{scope:n,children:(0,Z.jsx)(Cr.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Sr(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-Ys*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})})})]})});cc.displayName=sc;var lc=`SelectGroup`,[uc,dc]=js(lc),fc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=wr();return(0,Z.jsx)(uc,{scope:n,id:i,children:(0,Z.jsx)(Cr.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});fc.displayName=lc;var pc=`SelectLabel`,mc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=dc(pc,n);return(0,Z.jsx)(Cr.div,{id:i.id,...r,ref:t})});mc.displayName=pc;var hc=`SelectItem`,[gc,_c]=js(hc),vc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Fs(hc,n),c=Zs(hc,n),l=s.value===r,[u,d]=Q.useState(a??``),[f,p]=Q.useState(!1),m=qt(t,e=>c.itemRefCallback?.(e,r,i)),h=wr(),g=Q.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,Z.jsx)(gc,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:Q.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,Z.jsx)(Os.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,Z.jsx)(Cr.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:Sr(o.onFocus,()=>p(!0)),onBlur:Sr(o.onBlur,()=>p(!1)),onClick:Sr(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Sr(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Sr(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Sr(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Sr(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Sr(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Es.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});vc.displayName=hc;var yc=`SelectItemText`,bc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Fs(yc,n),s=Zs(yc,n),c=_c(yc,n),l=Ls(yc,n),[u,d]=Q.useState(null),f=qt(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=Q.useMemo(()=>(0,Z.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Or(()=>(h(m),()=>g(m)),[h,g,m]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Cr.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ko.createPortal(a.children,o.valueNode):null]})});bc.displayName=yc;var xc=`SelectItemIndicator`,Sc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return _c(xc,n).isSelected?(0,Z.jsx)(Cr.span,{"aria-hidden":!0,...r,ref:t}):null});Sc.displayName=xc;var Cc=`SelectScrollUpButton`,wc=Q.forwardRef((e,t)=>{let n=Zs(Cc,e.__scopeSelect),r=oc(Cc,e.__scopeSelect),[i,a]=Q.useState(!1),o=qt(t,r.onScrollButtonChange);return Or(()=>{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,Z.jsx)(Dc,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});wc.displayName=Cc;var Tc=`SelectScrollDownButton`,Ec=Q.forwardRef((e,t)=>{let n=Zs(Tc,e.__scopeSelect),r=oc(Tc,e.__scopeSelect),[i,a]=Q.useState(!1),o=qt(t,r.onScrollButtonChange);return Or(()=>{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,Z.jsx)(Dc,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Ec.displayName=Tc;var Dc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Zs(`SelectScrollButton`,n),o=Q.useRef(null),s=ks(n),c=Q.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return Q.useEffect(()=>()=>c(),[c]),Or(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,Z.jsx)(Cr.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Sr(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Sr(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Sr(i.onPointerLeave,()=>{c()})})}),Oc=`SelectSeparator`,kc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,Z.jsx)(Cr.div,{"aria-hidden":!0,...r,ref:t})});kc.displayName=Oc;var Ac=`SelectArrow`,jc=Q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ns(n),a=Fs(Ac,n),o=Zs(Ac,n);return a.open&&o.position===`popper`?(0,Z.jsx)(ui,{...i,...r,ref:t}):null});jc.displayName=Ac;var Mc=`SelectBubbleInput`,Nc=Q.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=Q.useRef(null),a=qt(r,i),o=ni(t);return Q.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,Z.jsx)(Cr.select,{...n,style:{...jr,...n.style},ref:a,defaultValue:t})});Nc.displayName=Mc;function Pc(e){return e===``||e===void 0}function Fc(e){let t=Dr(e),n=Q.useRef(``),r=Q.useRef(0),i=Q.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=Q.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return Q.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ic(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=Lc(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 Lc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Rc=Rs,zc=Bs,Bc=Hs,Vc=Ws,Hc=Ks,Uc=Js,Wc=cc,Gc=vc,Kc=bc,qc=Sc,Jc=wc,Yc=Ec,Xc=`Switch`,[Zc,Qc]=Ar(Xc),[$c,el]=Zc(Xc),tl=Q.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]=Q.useState(null),m=qt(t,e=>p(e)),h=Q.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=Er({prop:i,defaultProp:a??!1,onChange:l,caller:Xc});return(0,Z.jsxs)($c,{scope:n,checked:_,disabled:s,children:[(0,Z.jsx)(Cr.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":ol(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:Sr(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,Z.jsx)(al,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});tl.displayName=Xc;var nl=`SwitchThumb`,rl=Q.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=el(nl,n);return(0,Z.jsx)(Cr.span,{"data-state":ol(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});rl.displayName=nl;var il=`SwitchBubbleInput`,al=Q.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=Q.useRef(null),s=qt(o,a),c=ni(n),l=ai(t);return Q.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,Z.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}})});al.displayName=il;function ol(e){return e?`checked`:`unchecked`}var sl=tl,cl=rl,$=a(),ll=Go(),{getOwnPropertyNames:ul,getOwnPropertySymbols:dl}=Object,{hasOwnProperty:fl}=Object.prototype;function pl(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function ml(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 hl(e){return e?.[Symbol.toStringTag]}function gl(e){return ul(e).concat(dl(e))}var _l=Object.hasOwn||((e,t)=>fl.call(e,t));function vl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var yl=`__v`,bl=`__o`,xl=`_owner`,{getOwnPropertyDescriptor:Sl,keys:Cl}=Object;function wl(e,t){return e.byteLength===t.byteLength&&Ll(new Uint8Array(e),new Uint8Array(t))}function Tl(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 El(e,t){return e.byteLength===t.byteLength&&Ll(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Dl(e,t){return vl(e.getTime(),t.getTime())}function Ol(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kl(e,t){return e===t}function Al(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 jl=vl;function Ml(e,t,n){let r=Cl(e),i=r.length;if(Cl(t).length!==i)return!1;for(;i-- >0;)if(!zl(e,t,n,r[i]))return!1;return!0}function Nl(e,t,n){let r=gl(e),i=r.length;if(gl(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!zl(e,t,n,a)||(o=Sl(e,a),s=Sl(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Pl(e,t){return vl(e.valueOf(),t.valueOf())}function Fl(e,t){return e.source===t.source&&e.flags===t.flags}function Il(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 Ll(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 Rl(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 zl(e,t,n,r){return(r===xl||r===bl||r===yl)&&(e.$$typeof||t.$$typeof)?!0:_l(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Bl=`[object ArrayBuffer]`,Vl=`[object Arguments]`,Hl=`[object Boolean]`,Ul=`[object DataView]`,Wl=`[object Date]`,Gl=`[object Error]`,Kl=`[object Map]`,ql=`[object Number]`,Jl=`[object Object]`,Yl=`[object RegExp]`,Xl=`[object Set]`,Zl=`[object String]`,Ql={"[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},$l=`[object URL]`,eu=Object.prototype.toString;function tu({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=eu.call(h);if(b===Wl)return r(h,g,_);if(b===Yl)return u(h,g,_);if(b===Kl)return o(h,g,_);if(b===Xl)return d(h,g,_);if(b===Jl)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===$l)return p(h,g,_);if(b===Gl)return i(h,g,_);if(b===Vl)return c(h,g,_);if(Ql[b])return f(h,g,_);if(b===Bl)return e(h,g,_);if(b===Ul)return n(h,g,_);if(b===Hl||b===ql||b===Zl)return l(h,g,_);if(m){let e=m[b];if(!e){let t=hl(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function nu({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:wl,areArraysEqual:n?Nl:Tl,areDataViewsEqual:El,areDatesEqual:Dl,areErrorsEqual:Ol,areFunctionsEqual:kl,areMapsEqual:n?pl(Al,Nl):Al,areNumbersEqual:jl,areObjectsEqual:n?Nl:Ml,arePrimitiveWrappersEqual:Pl,areRegExpsEqual:Fl,areSetsEqual:n?pl(Il,Nl):Il,areTypedArraysEqual:n?pl(Ll,Nl):Ll,areUrlsEqual:Rl,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=ml(r.areArraysEqual),t=ml(r.areMapsEqual),n=ml(r.areObjectsEqual),i=ml(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function ru(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function iu({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 au=ou();ou({strict:!0}),ou({circular:!0}),ou({circular:!0,strict:!0}),ou({createInternalComparator:()=>vl}),ou({strict:!0,createInternalComparator:()=>vl}),ou({circular:!0,createInternalComparator:()=>vl}),ou({circular:!0,createInternalComparator:()=>vl,strict:!0});function ou(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=tu(nu(e));return iu({circular:t,comparator:a,createState:r,equals:n?n(a):ru(a),strict:i})}var su=t((e=>{var t=r(),n=Go();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}})),cu=t(((e,t)=>{t.exports=su()}))(),lu=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},uu=({contentComponent:e})=>{let t=(0,ll.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Z.jsx)(Z.Fragment,{children:Object.values(t)})};function du(){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]:Ko.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 fu=class extends Q.Component{constructor(e){super(e),this.editorContentRef=Q.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=du(),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,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:lu(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Z.jsx)(uu,{contentComponent:e.contentComponent})]})}},pu=(0,Q.forwardRef)((e,t)=>{let n=Q.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Q.createElement(fu,{key:n,innerRef:t,...e})}),mu=Q.memo(pu),hu=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,gu=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 _u(e){let[t]=(0,Q.useState)(()=>new gu(e.editor)),n=(0,cu.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??au);return hu(()=>t.watch(e.editor),[e.editor,t]),(0,Q.useDebugValue)(n),n}var vu=!1,yu=typeof window>`u`,bu=yu||!!(typeof window<`u`&&window.next),xu=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(yu||bu){if(vu)throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&yu&&vu)throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){return new ge({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Su(e={},t=[]){let n=(0,Q.useRef)(e);n.current=e;let[r]=(0,Q.useState)(()=>new xu(n)),i=(0,ll.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,Q.useDebugValue)(i),(0,Q.useEffect)(r.onRender(t)),_u({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Cu=(0,Q.createContext)({editor:null});Cu.Consumer;var wu=()=>(0,Q.useContext)(Cu),Tu=(0,Q.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Eu=()=>(0,Q.useContext)(Tu);function Du({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=Eu();return(0,Z.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var Ou=Q.forwardRef((e,t)=>{let{onDragStart:n}=Eu();return(0,Z.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function ku(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function Au(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function ju(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function Mu(e){if(ku(e)||Au(e))return!0;if(ju(e)){let t=e.type;if(t)return ku(t)||Au(t)}return!1}function Nu(){try{if(Q.version)return parseInt(Q.version.split(`.`)[0],10)>=19}catch{}return!1}var Pu=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,Ko.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=Nu(),a=Mu(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,Z.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])})}};Q.createContext({markViewContentRef:()=>{}});var Fu=class extends T{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,Q.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,Q.memo)(e=>(0,Z.jsx)(Tu.Provider,{value:t,children:(0,Q.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 Pu(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())},Te(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&&=(L(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=Se(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Iu(e,t){return n=>n.editor.contentComponent?new Fu(e,n,t):{}}var Lu=(0,Q.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Lu.displayName=`TiptapContext`;var Ru=()=>(0,Q.useContext)(Lu);function zu({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,Q.useMemo)(()=>({editor:r}),[r]),a=(0,Q.useMemo)(()=>({editor:r}),[r]);return(0,Z.jsx)(Cu.Provider,{value:a,children:(0,Z.jsx)(Lu.Provider,{value:i,children:n})})}zu.displayName=`Tiptap`;function Bu({...e}){let{editor:t}=Ru();return(0,Z.jsx)(mu,{editor:t,...e})}Bu.displayName=`Tiptap.Content`,Object.assign(zu,{Content:Bu});function Vu(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=yt(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 Hu(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,`
|
|
3
3
|
`);return/\s/.test(n)}):!1}var Uu=new st(`suggestion`);function Wu({pluginKey:e=Uu,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=Vu,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}},S=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:x,C=({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&&!Hu(i);function w(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:S(n,a)};(i=y?.onExit)==null||i.call(y,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let T=new ht({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,C=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:C,clientRect:S(e,C)},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&&!C({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}=T.getState(t.state);if(!i)return!1;if(n.key===`Escape`||n.key===`Esc`){let i=T.getState(t.state);return(r=y?.onKeyDown)==null||r.call(y,{view:t,event:n,range:i.range}),w(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}=T.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),at.create(e.doc,[ke.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return T}var Gu=Wu;function Ku(e){return e.kind===`create`?`create:${e.value}`:`tag:${e.value}`}function qu(e){if(e.kind===`create`){let t=e.value;return _i._({id:`XPqe3B`,values:{tagValue:t}})}let t=_i._({id:`pckX1A`,values:{0:e.count}}),n=e.value;return _i._({id:`m2T1Xj`,values:{tagValue:n,uses:t}})}function Ju(e){let t=(0,$.c)(38),{items:n,query:r,selectedIndex:i,onSelect:a,onHover:c,loading:l,error:u}=e,d=l===void 0?!1:l,f=u===void 0?null:u,{_:p}=s(),m=(0,Q.useRef)(null),h=(0,Q.useId)(),g=i>=0&&i<n.length?`${h}-option-${i}`:void 0,_,v;t[0]===i?(_=t[1],v=t[2]):(_=()=>{let e=m.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},v=[i],t[0]=i,t[1]=_,t[2]=v),(0,Q.useEffect)(_,v);let y=Yu;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,Z.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,Z.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,Z.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=i>=0&&i<n.length?n[i]: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?qu(b):``,t[15]=b,t[16]=C);let w;t[17]===C?w=t[18]:(w=(0,Z.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,Z.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]!==a||t[25]!==i){let e;t[27]!==h||t[28]!==c||t[29]!==a||t[30]!==i?(e=(e,t)=>{let n=t===i,r=Ku(e),s=e.kind===`create`;return(0,Z.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,"data-testid":s?`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(),a(e)},onPointerMove:c?()=>c(t):void 0,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-xs text-muted-foreground`,children:`#`}),(0,Z.jsx)(`span`,{className:`truncate font-medium flex-1`,children:e.value}),s?(0,Z.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,Z.jsx)(o,{id:`isRobC`})}):(0,Z.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:e.count})]},r)},t[27]=h,t[28]=c,t[29]=a,t[30]=i,t[31]=e):e=t[31],E=n.map(e),t[21]=n,t[22]=h,t[23]=c,t[24]=a,t[25]=i,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,Z.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 Yu(e){return e.preventDefault()}var Xu=new WeakMap;function Zu(e,t){Xu.set(e,t)}function Qu(e){return Xu.get(e)??!1}function $u(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`),ci(r,n,{placement:`bottom-start`,middleware:[di(4),mi(),li({padding:8}),oi({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:()=>ii(r,n,o),reveal:()=>{a||(i=!0,o())}}}function ed(e){e.stopAutoUpdate?.(),e.stopAutoUpdate=null,e.popup?.remove(),e.popup=null}var td=new st(`tagSuggestion`),nd=8,rd=/^[a-zA-Z][\w/-]*$/;async function id(){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 ad(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 od(e,t){let n=ad(e,t).slice(0,nd).map(e=>({kind:`tag`,value:e.name,count:e.count,isLeaf:e.isLeaf})),r=t.trim();return r&&rd.test(r)&&!e.some(e=>e.name===r)&&n.push({kind:`create`,value:r}),n}function sd(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 cd(e){let t=[],n=!1,r=null,i=null;return Gu({editor:e,pluginKey:td,char:`#`,allowedPrefixes:null,findSuggestionMatch:sd,allow:({editor:e})=>!Qu(e),items:async({query:e})=>{if(!n){r||=id();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 od(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=n.value;if(!r||!rd.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=$u(()=>a,`tag-suggestion`);s.popup=n.popup,c=n.doPosition,l=n.reveal,e=new Pu(Ju,{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&&rd.test(n)?(a.command({kind:`create`,value:n}),!0):!1}return e.key,!1},onExit(){ed(s),c=null,l=null,e?.destroy(),e=null,a=null,o=0,t=[],i=null,n=!1,r=null}}}})}var ld=new Map([[mr,`<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"/>`],[eo,`<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"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>`],[lo,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[lo,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[no,`<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"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/>`],[ro,`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M7 3v18"/><path d="M3 7.5h4"/><path d="M3 12h18"/><path d="M3 16.5h4"/><path d="M17 3v18"/><path d="M17 7.5h4"/><path d="M17 16.5h4"/>`],[zo,`<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"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/>`],[br,`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`]]),ud=new Map;function dd(e){let t=ud.get(e);if(t!==void 0)return t;let n=`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ld.get(e)??ld.get(eo)}</svg>`;return ud.set(e,n),n}var fd=`0 0 32 32`,pd=`M26.7075 10.2925L19.7075 3.2925C19.6146 3.19967 19.5042 3.12605 19.3829 3.07586C19.2615 3.02568 19.1314 2.9999 19 3H7C6.46957 3 5.96086 3.21071 5.58579 3.58579C5.21071 3.96086 5 4.46957 5 5V14C5 14.2652 5.10536 14.5196 5.29289 14.7071C5.48043 14.8946 5.73478 15 6 15C6.26522 15 6.51957 14.8946 6.70711 14.7071C6.89464 14.5196 7 14.2652 7 14V5H18V11C18 11.2652 18.1054 11.5196 18.2929 11.7071C18.4804 11.8946 18.7348 12 19 12H25V28C25 28.2652 25.1054 28.5196 25.2929 28.7071C25.4804 28.8946 25.7348 29 26 29C26.2652 29 26.5196 28.8946 26.7071 28.7071C26.8946 28.5196 27 28.2652 27 28V11C27.0001 10.8686 26.9743 10.7385 26.9241 10.6172C26.8739 10.4958 26.8003 10.3854 26.7075 10.2925ZM20 6.41375L23.5863 10H20V6.41375ZM18 18H16C15.7348 18 15.4804 18.1054 15.2929 18.2929C15.1054 18.4804 15 18.7348 15 19V26C15 26.2652 15.1054 26.5196 15.2929 26.7071C15.4804 26.8946 15.7348 27 16 27H18C19.1935 27 20.3381 26.5259 21.182 25.682C22.0259 24.8381 22.5 23.6935 22.5 22.5C22.5 21.3065 22.0259 20.1619 21.182 19.318C20.3381 18.4741 19.1935 18 18 18ZM18 25H17V20H18C18.663 20 19.2989 20.2634 19.7678 20.7322C20.2366 21.2011 20.5 21.837 20.5 22.5C20.5 23.163 20.2366 23.7989 19.7678 24.2678C19.2989 24.7366 18.663 25 18 25ZM13 19V26C13 26.2652 12.8946 26.5196 12.7071 26.7071C12.5196 26.8946 12.2652 27 12 27C11.7348 27 11.4804 26.8946 11.2929 26.7071C11.1054 26.5196 11 26.2652 11 26V22.1725L9.31875 24.5737C9.22652 24.7053 9.10396 24.8126 8.96144 24.8868C8.81892 24.9609 8.66064 24.9996 8.5 24.9996C8.33936 24.9996 8.18108 24.9609 8.03856 24.8868C7.89604 24.8126 7.77348 24.7053 7.68125 24.5737L6 22.1725V26C6 26.2652 5.89464 26.5196 5.70711 26.7071C5.51957 26.8946 5.26522 27 5 27C4.73478 27 4.48043 26.8946 4.29289 26.7071C4.10536 26.5196 4 26.2652 4 26V19C4.00009 18.7874 4.06791 18.5804 4.19363 18.409C4.31935 18.2376 4.49642 18.1107 4.69915 18.0467C4.90188 17.9828 5.11971 17.9851 5.32104 18.0533C5.52236 18.1216 5.6967 18.2522 5.81875 18.4263L8.5 22.2563L11.1812 18.4263C11.3033 18.2522 11.4776 18.1216 11.679 18.0533C11.8803 17.9851 12.0981 17.9828 12.3008 18.0467C12.5036 18.1107 12.6807 18.2376 12.8064 18.409C12.9321 18.5804 12.9999 18.7874 13 19Z`;function md(e){return e===`.md`||e===`.mdx`}function hd(e){switch(A(e)){case`image`:return dd(lo);case`video`:return dd(ro);case`audio`:return dd(zo);default:return dd(no)}}function gd(e){let t=(0,$.c)(7),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,Z.jsx)(`path`,{d:pd}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,className:n,fill:`currentColor`,viewBox:fd,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function _d(e){let t=vi(e).toLowerCase();return t?md(t)?{kind:`file`,path:e}:{kind:`file`,path:e,bodyIndexed:!1}:{kind:`folder`,path:e}}function vd(e){let t=(0,$.c)(6),{path:n,className:r,showExtensionBadge:i}=e,a;t[0]===n?a=t[1]:(a=_d(n),t[0]=n,t[1]=a);let o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,Z.jsx)(bd,{...a,className:r,showExtensionBadge:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function yd(e){let{kind:t,bodyIndexed:n}=_d(e);if(t===`folder`)return dd(mr);let r=(n===!1?vi(e):vi(e)||`.md`).toLowerCase();return md(r)?`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="${fd}" fill="currentColor" aria-hidden="true"><path d="${pd}"/></svg>`:hd(r)}function bd(e){let t=(0,$.c)(25),{kind:n,path:r,docExt:i,bodyIndexed:a,className:o,showExtensionBadge:s}=e,c=s===void 0?!0:s;if(n===`folder`){let e;t[0]===o?e=t[1]:(e=Kt(`shrink-0`,o),t[0]=o,t[1]=e);let n;return t[2]===e?n=t[3]:(n=(0,Z.jsx)(mr,{"aria-hidden":`true`,className:e,"data-file-entry-icon":`folder`}),t[2]=e,t[3]=n),n}let l;t[4]!==a||t[5]!==i||t[6]!==r?(l=a===!1?vi(r):i??(vi(r)||`.md`),t[4]=a,t[5]=i,t[6]=r,t[7]=l):l=t[7];let u=l,d,f,p,m;if(t[8]!==o||t[9]!==u||t[10]!==c){let e=u.toLowerCase(),n=A(e);d=c&&u&&e!==`.md`?u.slice(1).toUpperCase():null;let r=n===`image`&&`text-rose-500`,i;t[15]!==o||t[16]!==r?(i=Kt(o,r),t[15]=o,t[16]=r,t[17]=i):i=t[17];let a=i;f=`relative inline-flex shrink-0`,p=e||`file`,m=md(e)?(0,Z.jsx)(gd,{className:a,"data-testid":`file-entry-icon-markdown`}):n===`image`?(0,Z.jsx)(lo,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-image`}):n===`video`?(0,Z.jsx)(ro,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-video`}):n===`audio`?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-audio`}):(0,Z.jsx)(no,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-file`}),t[8]=o,t[9]=u,t[10]=c,t[11]=d,t[12]=f,t[13]=p,t[14]=m}else d=t[11],f=t[12],p=t[13],m=t[14];let h;t[18]===d?h=t[19]:(h=d?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`-right-1 -bottom-1 absolute rounded-sm bg-background px-0.5 font-medium text-[0.5rem] text-muted-foreground leading-none`,"data-testid":`file-entry-extension-badge`,children:d}):null,t[18]=d,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==h?(g=(0,Z.jsxs)(`span`,{className:f,"data-file-entry-icon":p,children:[m,h]}),t[20]=f,t[21]=p,t[22]=m,t[23]=h,t[24]=g):g=t[24],g}var xd=Yt(`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 Sd(e){let t=(0,$.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?Wt:`span`,c;t[5]!==n||t[6]!==o?(c=Kt(xd({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,Z.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}var Cd=1,wd=.9,Td=.8,Ed=.17,Dd=.1,Od=.999,kd=.9999,Ad=.99,jd=/[\\\/_+.#"@\[\(\{&]/,Md=/[\\\/_+.#"@\[\(\{&]/g,Nd=/[\s-]/,Pd=/[\s-]/g;function Fd(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Cd:Ad;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=Fd(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Cd:jd.test(e.charAt(l-1))?(d*=Td,p=e.slice(i,l-1).match(Md),p&&i>0&&(d*=Od**+p.length)):Nd.test(e.charAt(l-1))?(d*=wd,m=e.slice(i,l-1).match(Pd),m&&i>0&&(d*=Od**+m.length)):(d*=Ed,i>0&&(d*=Od**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=kd)),(d<Dd&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Fd(e,t,n,r,l+1,a+2,o),f*Dd>d&&(d=f*Dd)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Id(e){return e.toLowerCase().replace(Pd,` `)}function Ld(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Fd(e,t,Id(e),Id(t),0,0,{})}var Rd=`[cmdk-group=""]`,zd=`[cmdk-group-items=""]`,Bd=`[cmdk-group-heading=""]`,Vd=`[cmdk-item=""]`,Hd=`${Vd}:not([aria-disabled="true"])`,Ud=`cmdk-item-select`,Wd=`data-value`,Gd=(e,t,n)=>Ld(e,t,n),Kd=Q.createContext(void 0),qd=()=>Q.useContext(Kd),Jd=Q.createContext(void 0),Yd=()=>Q.useContext(Jd),Xd=Q.createContext(void 0),Zd=Q.forwardRef((e,t)=>{let n=ff(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ff(()=>new Set),i=ff(()=>new Map),a=ff(()=>new Map),o=ff(()=>new Set),s=uf(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=wr(),y=wr(),b=wr(),x=Q.useRef(null),S=hf();df(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),df(()=>{S(6,k)},[]);let C=Q.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=Q.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??Gd;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(zd);t?t.appendChild(e.parentElement===t?e:e.closest(`${zd} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${zd} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Rd}[${Wd}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Wd);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(Rd)?.querySelector(Bd))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Vd}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(Hd)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(Wd))}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(Wd))}function P(e){let t=A()?.closest(Rd),n;for(;t&&!n;)t=e>0?cf(t,Rd):lf(t,Rd),n=t?.querySelector(Hd);n?C.setState(`value`,n.getAttribute(Wd)):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 Q.createElement(Cr.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(Ud);t.dispatchEvent(e)}}}}},Q.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:vf},c),_f(e,e=>Q.createElement(Jd.Provider,{value:C},Q.createElement(Kd.Provider,{value:w},e))))}),Qd=Q.forwardRef((e,t)=>{let n=wr(),r=Q.useRef(null),i=Q.useContext(Xd),a=qd(),o=uf(e),s=o.current?.forceMount??i?.forceMount;df(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=mf(n,r,[e.value,e.children,r],e.keywords),l=Yd(),u=pf(e=>e.value&&e.value===c.current),d=pf(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Q.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Ud,f),()=>t.removeEventListener(Ud,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 Q.createElement(Cr.div,{ref:Gt(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)}),$d=Q.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=wr(),s=Q.useRef(null),c=Q.useRef(null),l=wr(),u=qd(),d=pf(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);df(()=>u.group(o),[]),mf(o,s,[e.value,e.heading,c]);let f=Q.useMemo(()=>({id:o,forceMount:i}),[i]);return Q.createElement(Cr.div,{ref:Gt(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Q.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),_f(e,e=>Q.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Q.createElement(Xd.Provider,{value:f},e))))}),ef=Q.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Q.useRef(null),a=pf(e=>!e.search);return!n&&!a?null:Q.createElement(Cr.div,{ref:Gt(i,t),...r,"cmdk-separator":``,role:`separator`})}),tf=Q.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Yd(),o=pf(e=>e.search),s=pf(e=>e.selectedItemId),c=qd();return Q.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Q.createElement(Cr.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)}})}),nf=Q.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Q.useRef(null),o=Q.useRef(null),s=pf(e=>e.selectedItemId),c=qd();return Q.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)}}},[]),Q.createElement(Cr.div,{ref:Gt(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},_f(e,e=>Q.createElement(`div`,{ref:Gt(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),rf=Q.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Q.createElement(Ur,{open:n,onOpenChange:r},Q.createElement(Hr,{container:o},Q.createElement(ti,{"cmdk-overlay":``,className:i}),Q.createElement(qr,{"aria-label":e.label,"cmdk-dialog":``,className:a},Q.createElement(Zd,{ref:t,...s}))))}),af=Q.forwardRef((e,t)=>pf(e=>e.filtered.count===0)?Q.createElement(Cr.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),of=Q.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Q.createElement(Cr.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},_f(e,e=>Q.createElement(`div`,{"aria-hidden":!0},e)))}),sf=Object.assign(Zd,{List:nf,Item:Qd,Input:tf,Group:$d,Separator:ef,Dialog:rf,Empty:af,Loading:of});function cf(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lf(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uf(e){let t=Q.useRef(e);return df(()=>{t.current=e}),t}var df=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function ff(e){let t=Q.useRef();return t.current===void 0&&(t.current=e()),t}function pf(e){let t=Yd(),n=()=>e(t.snapshot());return Q.useSyncExternalStore(t.subscribe,n,n)}function mf(e,t,n,r=[]){let i=Q.useRef(),a=qd();return df(()=>{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(Wd,s),i.current=s}),i}var hf=()=>{let[e,t]=Q.useState(),n=ff(()=>new Map);return df(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function gf(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function _f({asChild:e,children:t},n){return e&&Q.isValidElement(t)?Q.cloneElement(gf(t),{ref:t.ref},n(t.props.children)):n(t)}var vf={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function yf(e){let t=(0,$.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=Kt(`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,Z.jsx)(sf,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bf(e){let t=(0,$.c)(36),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({title:s,description:c,children:n,className:r,showCloseButton:l,commandProps:i,onEscapeKeyDown:a,...o}=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,t[8]=l);let u=s===void 0?`Command Palette`:s,d=c===void 0?`Search for a command to run`:c,f=l===void 0?!0:l,p;t[9]===i?p=t[10]:(p=i??{},t[9]=i,t[10]=p);let m,h;t[11]===p?(m=t[12],h=t[13]):({className:m,...h}=p,t[11]=p,t[12]=m,t[13]=h);let g;t[14]===r?g=t[15]:(g=Kt(`top-[12vh] translate-y-0 overflow-hidden p-0`,r),t[14]=r,t[15]=g);let _;t[16]===u?_=t[17]:(_=(0,Z.jsx)(Vr,{className:`sr-only`,children:u}),t[16]=u,t[17]=_);let v;t[18]===d?v=t[19]:(v=(0,Z.jsx)(Br,{className:`sr-only`,children:d}),t[18]=d,t[19]=v);let y;t[20]===m?y=t[21]:(y=Kt(`[&_[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`,m),t[20]=m,t[21]=y);let b;t[22]!==n||t[23]!==h||t[24]!==y?(b=(0,Z.jsx)(yf,{className:y,...h,children:n}),t[22]=n,t[23]=h,t[24]=y,t[25]=b):b=t[25];let x;t[26]!==a||t[27]!==f||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==b?(x=(0,Z.jsxs)(Kr,{className:g,showCloseButton:f,onEscapeKeyDown:a,children:[_,v,b]}),t[26]=a,t[27]=f,t[28]=g,t[29]=_,t[30]=v,t[31]=b,t[32]=x):x=t[32];let S;return t[33]!==o||t[34]!==x?(S=(0,Z.jsx)(ei,{...o,children:x}),t[33]=o,t[34]=x,t[35]=S):S=t[35],S}function xf(e){let t=(0,$.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,Z.jsx)(ko,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=Kt(`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,Z.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,Z.jsx)(sf.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function Sf(e){let t=(0,$.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=Kt(`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,Z.jsx)(sf.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Cf(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(sf.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function wf(e){let t=(0,$.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=Kt(`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,Z.jsx)(sf.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Tf(e){let t=(0,$.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=Kt(`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,Z.jsx)(sf.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ef(e){let t=(0,$.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=Kt(`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,Z.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Df(e){let t=(0,$.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,Z.jsx)(bs,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function Of(e){let t=(0,$.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,Z.jsx)(Ss,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function kf(e){let t=(0,$.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=Kt(`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,Z.jsx)(Cs,{children:(0,Z.jsx)(ws,{"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 Af(e){let t=(0,$.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,Z.jsx)(xs,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}async function jf(e,t){let n=null,r;try{n=await e.json()}catch(e){r=e}if(r instanceof Error&&r.name===`AbortError`)throw r;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:gi(n)??t}}function Mf(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 Nf=new Map,Pf=null;function Ff(){return Ci(`PREWARM_CORRELATION_WINDOW_MS`,5e3)}function If(){if(Pf!==null)return;let e=Math.max(50,Math.floor(Ff()/2));Pf=setTimeout(()=>{Pf=null,Lf(Date.now()),Nf.size>0&&If()},e)}function Lf(e){let t=Ff();for(let[n,r]of Nf)e-r.emittedAt>=t&&(Nf.delete(n),Y.count(`ok/sidebar/prewarm`,{hit:!1}))}function Rf(e,t,n=Date.now()){Nf.has(e)&&Y.count(`ok/sidebar/prewarm`,{hit:!1}),Nf.set(e,{poolEventId:t,emittedAt:n}),If()}function zf(e,t,n=Date.now()){let r=Nf.get(e);return!r||r.poolEventId!==t||n-r.emittedAt>=Ff()?!1:(Nf.delete(e),Y(`ok/sidebar/prewarm-clicked`,{docName:e,t:n,poolEventId:t}),Y.count(`ok/sidebar/prewarm`,{hit:!0}),!0)}me({event:_(`ok-branch-switched-clear-failed`),branch:D(),docName:D(),reason:D()});async function Bf(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()}function Vf(e){let t=!1;return()=>{t?e():t=!0}}function Hf(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 Uf(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=qe.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),$n(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&(Bf(e,i.data.currentBranch),Si(i.data.currentBranch)),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Hf(n)}catch{}e.observeDiskAckBatch(t)}}async function Wf(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,singleFile:r.singleFile===!0}}}function Gf(e){return $f(e,Et)}function Kf(e){return $f(e,ze)}function qf(e){return $f(e,wt)}function Jf(e){return $f(e,it)}function Yf(e){return $f(e,Oe)}function Xf(e){let t=$f(e,Ne);if(!t)return null;try{return{docName:t.docName,sv:Zf(t.sv)}}catch{return null}}function Zf(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 Qf(e,t){let n=Kf(e);if(n){t.onServerInfo?.(n);return}let r=qf(e);if(r){t.onBranchSwitched?.(r);return}let i=Xf(e);if(i){t.onDiskAck?.(i);return}let a=Gf(e);if(a){t.onDerivedView?.(a);return}let o=Jf(e);if(o){t.onConfigValidationRejected?.(o);return}let s=Yf(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function $f(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function ep(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function tp(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function np(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var rp=2e3,ip=15e3;function ap(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??rp,r=e.maxDelayMs??ip,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 op(){let e=(0,$.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,Q.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,Q.useRef)(i),[o,s]=(0,Q.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=tp(window);if(t){r(np(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(np(t))});return()=>{n()}}let n=ap({fetchConfig:Wf,fallbackUrl:ep,now:Date.now,setTimeout:up,clearTimeout:lp,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,Q.useEffect)(c,l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a.current.token=a.current.token+1,r(cp),s(sp)},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 sp(e){return e+1}function cp(e){return{...e,terminal:!1,lastError:null}}function lp(e){return globalThis.clearTimeout(e)}function up(e,t){return globalThis.setTimeout(e,t)}var dp=new Map,fp=new Set;function pp(){for(let e of fp)e()}function mp(e,t){dp.set(e,t),pp()}function hp(e,t){dp.get(e)===t&&(dp.delete(e),pp())}function gp(e){return dp.get(e)??null}function _p(e){return fp.add(e),()=>fp.delete(e)}var vp=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},yp=/[\uD800-\uDBFF]/,bp=/[\uDC00-\uDFFF]/,xp=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&yp.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&&bp.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Sp=(e,t)=>e>>>t|e<<32-t,Cp=e=>Sp(e,2)^Sp(e,13)^Sp(e,22),wp=e=>Sp(e,6)^Sp(e,11)^Sp(e,25),Tp=e=>Sp(e,7)^Sp(e,18)^e>>>3,Ep=e=>Sp(e,17)^Sp(e,19)^e>>>10,Dp=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]),Op=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),kp=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Op),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=Ep(t[e-2])+t[e-7]+Tp(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+wp(o)+(o&s^~o&c)+Dp[e]+t[e]>>>0,d=Cp(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/pn,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}},Ap=e=>new kp().digest(e),jp=new st(`y-sync`),Mp=new st(`y-undo`),Np=new st(`yjs-cursor`),Pp=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},Fp=e=>Mn(Pp(Ap(jn(e)))),Ip=()=>({mapping:new Map,isOMark:new Map}),Lp=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!qn(t.ds,e.id),Rp=[{light:`#ecd44433`,dark:`#ecd444`}],zp=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=rr();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Pn(t))}return e.get(n)},Bp=(e,{colors:t=Rp,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new Wp(e,a),c=new ht({props:{editable:e=>{let t=jp.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:jp,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(jp);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)&&On(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=Mp.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)},jp)})}},destroy:()=>{s.destroy()}})});return c},Vp=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new Pe(e.doc));else if(t.type===`node`){let r=ym(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Hp(e,r))}else{let r=ym(n.doc,n.type,t.anchor,n.mapping),i=ym(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(Ce.between(e.doc.resolve(r),e.doc.resolve(i)))}},Hp=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Be.create(e.doc,t):Ce.near(n)},Up=(e,t)=>({type:t.selection.jsonID,anchor:_m(t.selection.anchor,e.type,e.mapping),head:_m(t.selection.head,e.type,e.mapping)}),Wp=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=vp(),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=Up(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()?(yn&&this._domSelectionInView===null&&(On(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=fr.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||=An(ur(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(jp,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Kp(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new q(De.from(e),0,0));t.setMeta(jp,{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=>Kp(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new q(De.from(t),0,0));if(e){let t=or(Hn(e.anchor,0),n.doc.content.size),r=or(Hn(e.head,0),n.doc.content.size);n.setSelection(Ce.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(jp,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=vn(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Dn(),r=new Yn({gc:!1}),cr(r,t),t=vn(r),cr(r,e),e=vn(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[Jn(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Tn(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:zp(n.colorMapping,n.colors,r)}},s=Cn(i,new Un(t.ds,e.sv)).map(n=>!n._item.deleted||Lp(n._item,e)||Lp(n._item,t)?Kp(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 q(De.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(jp,{isChangeOrigin:!0}))},jp)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=jp.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);Tn(t,t.deleteSet,e=>{if(e.constructor===sr){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=>Gp(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new q(De.from(n),0,0));Vp(r,this.beforeTransactionSelection,this),r=r.setMeta(jp,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof er}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{um(this.doc,this.type,e,this),this.beforeTransactionSelection=Up(this,this.prosemirrorView.state)},jp)}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))}},Gp=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof Gn)return Kp(e,t,n,r,i,a);throw Fn()}return o},Kp=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof Gn){let s=Gp(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Xn&&!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=qp(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):Cn(e,new Un(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(Lp(e._item,r)?Lp(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}},qp=(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,cm(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},Jp=(e,t)=>{let n=new Wn,r=e.map(e=>({insert:e.text,attributes:lm(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},Yp=(e,t)=>{let n=new Gn(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,$p(e).map(e=>Xp(e,t))),t.mapping.set(n,e),n},Xp=(e,t)=>e instanceof Array?Jp(e,t):Yp(e,t),Zp=e=>typeof e==`object`&&!!e,Qp=(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||Zp(o)&&Zp(s)&&Qp(o,s)}return r},$p=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},em=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&tr(e.attributes||{}).length===t[n].marks.length&&Sn(e.attributes,(e,r)=>{let i=sm(r),a=t[n].marks;return a.find(e=>e.type.name===i)?Qp(e,a.find(e=>e.type.name===i)?.attrs):!1}))},tm=(e,t)=>{if(e instanceof Gn&&!(t instanceof Array)&&dm(e,t)){let n=$p(t);return e._length===n.length&&Qp(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>tm(e,n[t]))}return e instanceof Wn&&t instanceof Array&&em(e,t)},nm=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),rm=(e,t,n)=>{let r=e.toArray(),i=$p(t),a=i.length,o=r.length,s=or(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(nm(n.mapping.get(e),t))u=!0;else if(!tm(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(nm(n.mapping.get(e),t))u=!0;else if(!tm(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},im=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof ir?t+=n.content.str:n.content instanceof Qn&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},am=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=im(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,lm(e.marks,n))})),{insert:o,remove:s,index:c}=xp(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})))},om=/(.*)(--[a-zA-Z0-9+/=]{8})$/,sm=e=>om.exec(e)?.[1]??e,cm=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(sm(r),e[r]));return n},lm=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=Rn(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${Fp(e.toJSON())}`:e.type.name]=e.attrs}}),n},um=(e,t,n,r)=>{if(t instanceof Gn&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof Gn){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=$p(n),a=i.length,o=t.toArray(),s=o.length,c=or(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!nm(r.mapping.get(e),t))if(tm(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(!nm(r.mapping.get(e),t))if(tm(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 Wn&&c instanceof Array)em(n,c)||am(n,c,r),l+=1;else{let i=n instanceof Gn&&dm(n,c),a=d instanceof Gn&&dm(d,f);if(i&&a){let e=rm(n,c,r),t=rm(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(um(e,n,c,r),l+=1):a?(um(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[Xp(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Wn?(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(Xp(i[t],r));t.insert(l,e)}},jp)},dm=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,fm=null,pm=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=jp.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)}}},mm=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=fm;fm=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new pm(t,r,e))})}),new e(n)}},hm=(e=mm.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()||On(0,()=>hm(e,!0));return}throw r}n=!1,e.dequeueFirst()}},gm=(e,t,n)=>{fm||(fm=new Map,On(0,hm)),Rn(fm,e,Kn).set(t,n)},_m=(e,t,n)=>{if(e===0)return lr(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Wn){if(r._length>=e)return lr(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 Vn(r._item===null?null:r._item.id,r._item===null?mn(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 Vn(r._item===null?null:r._item.id,r._item===null?mn(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 Dn();if(e===0&&r.constructor!==Wn&&r!==t)return vm(r._item.parent,r._item)}return lr(t,t._length,-1)},vm=(e,t)=>{let n=null,r=null;return e._item===null?r=mn(e):n=kn(e._item.id.client,e._item.id.clock),new Vn(n,r,t.id)},ym=(e,t,n,r)=>{let i=zn(n,e);if(i===null||i.type!==t&&!wn(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Wn)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 Wn?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 Wn?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},bm=(e,t)=>{let n=Ip(),r=e.toArray().map(e=>Kp(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,De.fromArray(r)),meta:n,mapping:n.mapping}},xm=(e,t,n)=>e!==t,Sm=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},Cm=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),wm=/^#[0-9a-fA-F]{6}$/,Tm=(e,t,n,r,i)=>{let a=jp.getState(e);if(a==null||a.doc==null||a.binding==null)return at.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?at.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`:wm.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=ym(o,a.type,hn(t.cursor.anchor),a.binding.mapping),u=ym(o,a.type,hn(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Hn(e.doc.content.size-1,0);l=or(l,t),u=or(u,t),s.push(ke.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=or(l,u),o=Hn(l,u);s.push(ke.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),at.create(e.doc,s))},Em=(e,{awarenessStateFilter:t=xm,cursorBuilder:n=Sm,selectionBuilder:r=Cm,getSelection:i=e=>e.selection}={},a=`cursor`)=>new ht({key:Np,state:{init(i,a){return Tm(a,e,t,n,r)},apply(i,a,o,s){let c=jp.getState(s),l=i.getMeta(Np);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?Tm(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>Np.getState(e)},view:t=>{let n=()=>{t.docView&&gm(t,Np,{awarenessUpdated:!0})},r=()=>{let n=jp.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=_m(o.anchor,n.type,n.binding.mapping),c=_m(o.head,n.type,n.binding.mapping);(r.cursor==null||!dr(hn(r.cursor.anchor),s)||!dr(hn(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&ym(n.doc,n.type,hn(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)}}}}),Dm=e=>{let t=Mp.getState(e).undoManager;if(t!=null)return t.undo(),!0},Om=e=>{let t=Mp.getState(e).undoManager;if(t!=null)return t.redo(),!0},km=new Set([`paragraph`]),Am=(e,t)=>!(e instanceof sr)||!(e.content instanceof Bn)||!(e.content.type instanceof Xn||e.content.type instanceof Gn&&t.has(e.content.type.nodeName))||e.content.type._length===0,jm=({protectedNodes:e=km,trackedOrigins:t=[],undoManager:n=null}={})=>new ht({key:Mp,state:{init:(r,i)=>{let a=jp.getState(i),o=n||new er(a.type,{trackedOrigins:new Set([jp].concat(t)),deleteFilter:t=>Am(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=jp.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Up(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=jp.getState(e.state),n=Mp.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Mp.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()}}}}),Mm=new Map;function Nm(e){return Mm.get(e)}function Pm(e,t){Mm.set(e,t)}function Fm(e){Mm.delete(e)}var Im=`open-knowledge-app`,Lm=new Map,Rm=new Set,zm=1024,Bm=1024;function Vm(){return Vt.getTracer(Im)}function Hm(e,t,n){if(Rm.has(e))return null;let r=Lm.get(e);if(r)return r;if(Lm.size>=Bm){let e=Lm.keys().next().value;if(e!==void 0){let t=Lm.get(e);Lm.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:Vm().startSpan(`ok.cold-mount`,{attributes:{"mount.id":e,...t},startTime:n}),startTimeMs:n};return Lm.set(e,i),i}function Um(e,t,n,r,i){try{let a=Hm(e,n,r),o=a?Vt.setSpan(Ht.active(),a.span):Ht.active();Vm().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 Wm(e,t){try{let n=Lm.get(e);if(n&&(Lm.delete(e),n.span.end(t??Date.now())),!Rm.has(e)){if(Rm.size>=zm){let e=Rm.values().next().value;e!==void 0&&Rm.delete(e)}Rm.add(e)}}catch(e){console.warn(`[otel-spans] finalizeColdMountSpan failed:`,e instanceof Error?e:String(e))}}var Gm=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}};function Km(){return Ci(`MOUNT_STALLED_THRESHOLD_MS`,1e4)}function qm(e){e.stalledHandle!==null&&(clearTimeout(e.stalledHandle),e.stalledHandle=null)}function Jm(e,t,n){if(e.stalledMarkEmitted)return;e.stalledMarkEmitted=!0;let r=n-e.createdAt;Y(`ok/mount/stalled`,{docName:t,mountId:e.mountId,elapsedMs:r})}var Ym=new Map,Xm=new Set;function Zm(e){Xm.add(e);for(let[t,n]of Ym)if(n.stalledMarkEmitted&&!n.settled)try{e(t,n.mountId)}catch{}return()=>{Xm.delete(e)}}function Qm(e,t){for(let n of Xm)try{n(e,t.mountId)}catch{}}var $m=!1;function eh(){typeof document>`u`||document.visibilityState===`visible`&&rh(Date.now())}function th(){$m||typeof document>`u`||typeof document.addEventListener==`function`&&(document.addEventListener(`visibilitychange`,eh),$m=!0)}function nh(){$m&&(typeof document>`u`||typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,eh),$m=!1))}function rh(e){let t=Km();for(let[n,r]of Ym)r.settled||r.stalledMarkEmitted||e-r.createdAt<t||(Jm(r,n,e),Qm(n,r))}function ih(e){let{docName:t,mountId:n,construct:r,sizeStats:i}=e,a=Ym.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||(Jm(d,t,Date.now()),Qm(t,d))},Km()),o.signal.addEventListener(`abort`,()=>{d.settled||(d.settled=!0,qm(d),d.preMountEditor&&=(ch(t,d.preMountEditor,`aborted`),null),Ym.delete(t),Ym.size===0&&nh(),Y(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`aborted`}),l(new Gm(t)),Wm(d.mountId))}),Ym.set(t,d),th(),Y(`ok/mount/create`,{docName:t,mountId:d.mountId}),lh({docName:t,construct:r,sizeStats:i,entry:d,resolveFn:c,rejectFn:l}).catch(e=>{if(d.preMountEditor&&=(ch(t,d.preMountEditor,`backstop`),null),d.settled){Y(`ok/mount/post-settle-throw`,{docName:t,mountId:d.mountId,message:e instanceof Error?e.message:String(e)});return}d.settled=!0,qm(d);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`unhandled-body-throw`,message:n.message}),l(n),Wm(d.mountId)}),u}function ah(e){return Ym.get(e)?.resolved===!0}function oh(e){return Ym.get(e)?.controller??null}function sh(e){let t=Ym.get(e);t&&(t.settled=!0,qm(t),t.preMountEditor&&=(ch(e,t.preMountEditor,`aborted`),null),Ym.delete(e),Ym.size===0&&nh(),Y(`ok/mount/invalidate`,{docName:e,mountId:t.mountId}),Wm(t.mountId),t.controller.abort())}function ch(e,t,n){let r=uh(t);try{t.destroy()}catch(t){Y(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function lh(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(Wh(t)!==void 0){let e=Oh({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,qm(i),a(e);return}if(await scheduler.yield(),i.controller.signal.aborted)return;let c=null;try{c=n()}catch(e){i.settled=!0,qm(i);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`construct-failed`,message:n.message}),o(n),Wm(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){ch(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,qm(i);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`mount-failed`,message:n.message}),o(n),Wm(i.mountId);return}let l;try{l=Oh({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){ch(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,qm(i);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`v2-register-failed`,message:n.message}),o(n),Wm(i.mountId);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,qm(i);let u=Date.now()-i.createdAt;Y(`ok/mount/resolve`,{docName:t,mountId:i.mountId,elapsedMs:u}),Y.histogram(`ok/mount/resolve-elapsed-ms`,{docName:t,mountId:i.mountId},u),a(l);let d=Date.now();Um(i.mountId,`ok.mount-promise`,{"doc.name":t,elapsed_ms:u},i.createdAt,d),Wm(i.mountId,d)}function uh(e){try{let t=e.state;return Mp.getState(t)?.undoManager??null}catch(e){return Y(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var dh=Ci(`MAX_CACHE`,10),fh=Ci(`VIEW_COUNT_CACHE_THRESHOLD`,50),ph=Ci(`BYTES_CACHE_THRESHOLD`,8e6);function mh(e){return!(e.viewCount>0&&e.viewCount>=fh||e.bytes>ph)}var hh=new Map,gh=new Map,_h=new Map;function vh(e,t){if(_h.size>=dh){let e=_h.keys().next().value;e!==void 0&&_h.delete(e)}_h.set(e,t),Y(`ok/cache/snapshot-stored`,{toDocName:e,htmlBytes:t.html.length,hasScroll:t.scrollTop>0,hasSelection:t.selection!==null})}function yh(e){return _h.get(e)??null}function bh(e){if(!_h.has(e))return;let t=_h.get(e)??null;_h.delete(e),Y(`ok/cache/snapshot-consumed`,{docName:e,hit:t!==null,hasScroll:t!==null&&t.scrollTop>0,hasSelection:t!==null&&t.selection!==null})}function xh(){try{return typeof document>`u`?0:document.querySelector(`[data-testid="editor-scroll-container"]`)?.scrollTop??0}catch(e){return Y(`ok/cache/snapshot-scroll-read-failed`,{message:e instanceof Error?e.message:String(e)}),0}}function Sh(e){try{let t=e.state.selection;return t instanceof Ce?{type:`text`,anchor:t.anchor,head:t.head}:t instanceof Be?{type:`node`,from:t.from}:null}catch(e){return Y(`ok/cache/snapshot-selection-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}function Ch(e){for(let t of e)try{let e=Wh(t.fromDocName);if(e&&!e.editor.isDestroyed){if(e.ytext.length===0){Y(`ok/cache/snapshot-skipped-empty`,{fromDocName:t.fromDocName});continue}vh(t.toDocName,{html:e.editor.getHTML(),scrollTop:xh(),selection:Sh(e.editor)})}else Y(`ok/cache/snapshot-skipped`,{fromDocName:t.fromDocName})}catch(e){Y(`ok/cache/snapshot-capture-failed`,{fromDocName:t.fromDocName,message:e instanceof Error?e.message:String(e)})}}var wh=[],Th=[],Eh=new Set;function Dh(){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 Oh(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!mh(i)){let e=r(n);return Y(`ok/cache/miss`,{docName:t,mountId:Nm(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=hh.get(t);if(a){if(Y(`ok/cache/reparent-start`,{docName:t,mountId:Nm(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Ih(a,n),a.activeMountKey=t,Rh(wh,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return Y(`ok/cache/reparent-end`,{docName:t,mountId:Nm(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Y(`ok/cache/hit`,{docName:t,mountId:Nm(t),kind:`tiptap`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,mountId:Nm(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;hh.size>=dh;){let e=zh(wh,t);if(!e)break;Ah(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 hh.set(t,s),Rh(wh,t),Y(`ok/cache/miss`,{docName:t,mountId:Nm(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,mountId:Nm(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function kh(e){let t=e.activeMountKey;if(e.__uncached){t&&sh(t);let n=uh(e.editor);try{e.editor.destroy()}catch(e){Y(`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=Ph(e.editor);if(n){e.hadFocus=Fh(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||=Dh(),e.parkingNode&&e.parkingNode.appendChild(n.dom)}e.activeMountKey=null}function Ah(e){sh(e);let t=hh.get(e);if(!t)return!1;let n=uh(t.editor);try{t.editor.destroy()}catch(t){Y(`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){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}hh.delete(e);let r=wh.indexOf(e);return r!==-1&&wh.splice(r,1),Y(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function jh(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!mh(i)){let e=r(n);return Y(`ok/cache/miss`,{docName:t,mountId:Nm(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,themeCompartment:e.themeCompartment,wordWrapCompartment:e.wordWrapCompartment,placeholderCompartment:e.placeholderCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=gh.get(t);if(a){if(Y(`ok/cache/reparent-start`,{docName:t,mountId:Nm(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Lh(a,n),a.activeMountKey=t,Rh(Th,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return Y(`ok/cache/reparent-end`,{docName:t,mountId:Nm(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Y(`ok/cache/hit`,{docName:t,mountId:Nm(t),kind:`cm`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,mountId:Nm(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;gh.size>=dh;){let e=zh(Th,t);if(!e)break;Nh(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,themeCompartment:o.themeCompartment,wordWrapCompartment:o.wordWrapCompartment,placeholderCompartment:o.placeholderCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return gh.set(t,s),Rh(Th,t),Y(`ok/cache/miss`,{docName:t,mountId:Nm(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,mountId:Nm(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function Mh(e){if(e.__uncached){try{e.view.destroy()}catch(t){Y(`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=Fh(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t),e.parkingNode||=Dh(),e.parkingNode&&e.parkingNode.appendChild(t),e.activeMountKey=null}function Nh(e){let t=gh.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}gh.delete(e);let n=Th.indexOf(e);return n!==-1&&Th.splice(n,1),Y(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function Ph(e){return e.editorView??null}function Fh(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function Ih(e,t){let n=Ph(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 Lh(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function Rh(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function zh(e,t){for(let n of e)if(n!==t&&!Eh.has(n))return n;Y(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:Eh.size});for(let n of e)if(n!==t)return n;return null}function Bh(e){let t=Eh,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=Hh(e);if(t)try{t.disconnect(),Y(`ok/cache/disconnect`,{docName:e})}catch(t){Y(`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=Hh(e);if(!n)continue;let r=t=>{Y(`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(()=>Y(`ok/cache/connect`,{docName:e}),e=>r(e)):Y(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}Eh=n}var Vh=null;function Hh(e){let t=hh.get(e);if(t)return t.provider;let n=gh.get(e);if(n)return n.provider;if(Vh){let t=Vh.entries.get(e);if(t)return t.provider}return null}function Uh(e){Vh=e;let t=e.onEvict(e=>{Ah(e),Nh(e)});return()=>{t(),Vh===e&&(Vh=null)}}function Wh(e){return hh.get(e)}function Gh(e,t){let n=e.replace(/^\/+|\/+$/g,``);return`${C}${n?`${n}/`:``}${t}`}function Kh(e,t){return`${Ve}/${e}/${t}`}function qh(e){let t=`${Ve}/`;if(!e.startsWith(t)||!e.endsWith(`/SKILL`))return null;let n=e.slice(t.length,e.length-6);return n&&!n.includes(`/`)?n:null}function Jh(e){return I.includes(e)}var Yh=`ok-editor-tabs-v1:`,Xh=`\0folder:`,Zh=`\0asset:`,Qh=`\0skill-file:`,$h=`\0doc-tab:`,eg=/\.(md|mdx)$/i;function tg(e){let t=e.lastIndexOf($h);return t<0?{baseTabId:e,instanceSuffix:``}:{baseTabId:e.slice(0,t),instanceSuffix:e.slice(t)}}function ng(e){return tg(e).baseTabId}function rg(e){return eg.test(e)?e.replace(eg,``):null}function ig(e){if(typeof e!=`string`||e.length===0)return!1;let t=ng(e);return t.startsWith(Xh)?t.length>8:t.startsWith(Zh)?t.length>7:t.startsWith(Qh)?og(t)!==null:!0}function ag(e){return`${Qh}${e.scope}/${e.name}/${e.path}`}function og(e){if(!e.startsWith(Qh))return null;let t=e.slice(12).split(`/`);if(t.length<3)return null;let[n,r,...i]=t,a=i.join(`/`);return!n||!r||!a||!Jh(n)?null:{scope:n,name:r,path:a}}function sg(e){return e}function cg(e){return`${Xh}${e}`}function lg(e){return`${Zh}${e}`}function ug(e,t){let n=qh(e);if(n){let e=un(n);return{baseName:e,extension:``,label:e,prefix:``}}let r=e.lastIndexOf(`/`),i=r<0?e:e.slice(r+1),a=eg.test(t)&&eg.test(i)?``:t,o=`${i}${a}`;return r<0?{baseName:i,extension:a,label:o,prefix:``}:{baseName:i,extension:a,label:o,prefix:`${e.slice(0,r)}/`}}function dg(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return sg(e.docName);case`folder`:return cg(e.folderPath);case`missing`:return sg(e.target);case`asset`:return lg(e.assetPath);case`skill-file`:return ag(e)}}function fg(e){let t=ng(e);if(t.startsWith(Xh))return{kind:`folder`,folderPath:t.slice(8)};if(t.startsWith(Zh))return{kind:`asset`,assetPath:t.slice(7)};let n=og(t);return n?{kind:`skill-file`,...n}:{kind:`doc`,docName:t}}function pg(e){let t=fg(e);return t.kind===`doc`?t.docName:null}function mg(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(ig(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function hg(e,t){let n=new Set(mg(t,2**53-1));return mg(e,2**53-1).filter(e=>n.has(e))}function gg(e,t,n){if(t<=0)return[];let r=new Set(mg(n,2**53-1)),i=mg(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 _g(e,t,n){let r=hg(e,n);return!mg(n,2**53-1).includes(t)||r.includes(t)?r:[...r,t]}function vg(e,t){return mg(e,2**53-1).filter(e=>e!==t)}function yg(e,t){let n=new Set(mg(t,2**53-1));return mg(e,2**53-1).filter(e=>!n.has(e))}function bg(e,t,n){let r=mg(e,2**53-1),i=hg(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?_g(i,n,r):vg(i,n)}function xg(e,t,n,r=[]){let i=gg(e,n,r);return!ig(t)||i.includes(t)?i:gg([...i,t],n,r)}function Sg(e,t,n,r,i=[]){let a=gg(e,r,i);if(!ig(n))return a;if(!t||t===n)return xg(a,n,r,i);let o=a.filter(e=>e!==n),s=o.indexOf(t);if(s<0)return xg(o,n,r,i);let c=[...o];return c[s]=n,gg(c,r,i)}function Cg(e,t,n){return wg(e,sg(t),n)}function wg(e,t,{behavior:n,currentTabId:r,limit:i,pinnedTabIds:a=[]}){let o=gg(e,i,a),s=ng(t);if(r&&o.includes(r)&&ng(r)===s)return{tabs:o,activeTabId:r};let c=o.find(e=>ng(e)===s);return c?{tabs:o,activeTabId:c}:n===`replace-active`?{tabs:Sg(o,r,s,i,a),activeTabId:s}:{tabs:xg(o,s,i,a),activeTabId:s}}function Tg(e,t){return e.filter(e=>e!==t)}function Eg(e,t,n){let r=mg(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 Dg(e,{pages:t,folderPaths:n,assetPaths:r,filePaths:i,keepMissingDocName:a=null,keepHashDocName:o=null}){return mg(e,2**53-1).filter(e=>{let s=fg(e);if(s.kind===`folder`)return n.has(s.folderPath);if(s.kind===`asset`)return r.has(s.assetPath)||i?.has(s.assetPath)===!0;if(s.kind===`skill-file`)return!0;let c=rg(s.docName);return t.has(s.docName)||c!==null&&t.has(c)||w(s.docName)||s.docName===a||s.docName===o})}function Og(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return mg(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=new Map(a.flatMap(e=>{let t=rg(e.fromPath);return t?[[t,e.toPath]]:[]})),c=new Map(a.flatMap(e=>{let t=rg(e.toPath);return t?[[e.fromPath,t]]:[]})),l=e=>jg(Ag(e,r),a),u=(e,t)=>{let n=o.get(e);if(n)return n;let r=s.get(e);return r?lg(r):t},d=e=>{let t=c.get(e);return t?sg(t):lg(l(e))},f=[],p=new Set;for(let t of e){let{instanceSuffix:e}=tg(t),a=fg(t),o=`${a.kind===`doc`?u(a.docName,ng(t)):a.kind===`folder`?cg(Ag(a.folderPath,r)):a.kind===`asset`?d(a.assetPath):ng(t)}${e}`;if(!p.has(o)&&(p.add(o),f.push(o),i.length===0&&f.length>=n))break}return i.length===0?f:gg(f,n,i.map(e=>{let t=fg(e);return t.kind===`doc`?u(t.docName,e):t.kind===`folder`?cg(Ag(t.folderPath,r)):t.kind===`asset`?d(t.assetPath):ng(e)}))}function kg(e,t,n=[],r=[]){return Og(e,t,2**53-1,n,[],r)}function Ag(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 jg(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function Mg(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 Ng(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 Pg(e,t){if(typeof e!=`object`||!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};let n=e,r=mg(n.openTabs,2**53-1),i=hg(n.pinnedTabIds,r),a=i.length===0?mg(n.openTabs,t):gg(r,t,i),o=hg(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?fg(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 Fg(e,t,n=[],r=()=>new Date){let i=mg(e,2**53-1),a=t&&i.includes(t)?t:null,o=a?fg(a):null;return{openTabs:i,pinnedTabIds:hg(n,i),activeDocName:o?.kind===`doc`?o.docName:null,activeTabId:a,updatedAt:r().toISOString()}}function Ig(e){return`${Yh}${e}`}function Lg(e,t,n){if(!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};try{let r=e.getItem(t);return r?Pg(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 Rg(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 zg=e=>xn((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),Bg=(e,t)=>xn((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(Nn(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),Vg=e=>zg(indexedDB.deleteDatabase(e)),Hg=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),Ug=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>e_(r,e))},Wg=(e,t)=>zg(e.count(t)),Gg=(e,t)=>zg(e.get(t)),Kg=(e,t)=>zg(e.delete(t)),qg=(e,t,n)=>zg(e.put(t,n)),Jg=(e,t)=>zg(e.add(t)),Yg=(e,t,n)=>zg(e.getAll(t,n)),Xg=(e,t,n)=>{let r=null;return $g(e,t,e=>(r=e,!1),n).then(()=>r)},Zg=(e,t=null)=>Xg(e,t,`prev`),Qg=(e,t)=>xn((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()}}),$g=(e,t,n,r=`next`)=>Qg(e.openKeyCursor(t,r),e=>n(e.key)),e_=(e,t)=>e.objectStore(t),t_=(e,t)=>IDBKeyRange.upperBound(e,t),n_=(e,t)=>IDBKeyRange.lowerBound(e,t),r_=`custom`,i_=`updates`,a_=(e,t=()=>{},n=()=>{})=>{let[r]=Ug(e.db,[i_]);return Yg(r,n_(e._dbref,!1)).then(i=>{e._destroyed||(t(r),bn(e.doc,()=>{i.forEach(t=>In(e.doc,t))},e,!1),n(r))}).then(()=>Zg(r).then(t=>{e._dbref=t+1})).then(()=>Wg(r).then(t=>{e._dbsize=t})).then(()=>r)},o_=(e,t=!0)=>a_(e).then(n=>{(t||e._dbsize>=500)&&Jg(n,gn(e.doc)).then(()=>Kg(n,t_(e._dbref,!0))).then(()=>Wg(n).then(t=>{e._dbsize=t}))}),s_=class extends Zn{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=Bg(e,e=>Hg(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=xn(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,a_(this,async e=>{await Wg(e)>0&&Jg(e,gn(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]=Ug(this.db,[i_]);Jg(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(()=>{o_(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(()=>{Vg(this.name)})}get(e){return this._db.then(t=>{let[n]=Ug(t,[r_],`readonly`);return Gg(n,e)})}set(e,t){return this._db.then(n=>{let[r]=Ug(n,[r_]);return qg(r,t,e)})}del(e){return this._db.then(t=>{let[n]=Ug(t,[r_]);return Kg(n,e)})}},c_=`updates`,l_=`custom`;function u_(){return!0}var d_=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=u_()?0:performance.now();this._idb=new s_(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!u_()){let e=performance.now();Y(`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=u_()?0:performance.now();try{await this._idb.destroy()}finally{if(!u_()){let t=performance.now();Y(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async flushFullState(){this._idb.db===null&&await this.whenSynced;let e=this._idb.db;if(e===null)return;let t=this._idb;await new Promise((n,r)=>{let i=e.transaction(c_,`readwrite`),a=i.objectStore(c_),o=a.getAll();o.onerror=()=>r(o.error??Error(`flushFullState getAll failed`)),o.onsuccess=()=>{try{bn(t.doc,()=>{for(let e of o.result)In(t.doc,e)},t,!1);let e=a.add(gn(t.doc));e.onerror=()=>r(e.error??Error(`flushFullState add failed`)),e.onsuccess=()=>{a.delete(IDBKeyRange.upperBound(e.result,!0))}}catch(e){r(e instanceof Error?e:Error(String(e)));try{i.abort()}catch{}}},i.oncomplete=()=>n(),i.onabort=()=>r(i.error??Error(`flushFullState transaction aborted`))})}async clearData(){let e=u_()?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(!u_()){let t=performance.now();Y(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function f_(e){return new d_(e)}async function p_(e){if(typeof indexedDB>`u`)return null;let t=`ok-ydoc:${e.branch}:${e.serverInstanceId}:${e.docName}`;if(typeof indexedDB.databases==`function`&&!(await indexedDB.databases()).some(e=>e.name===t))return null;let n=await new Promise((e,n)=>{let r=indexedDB.open(t);r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(c_)||e.createObjectStore(c_,{autoIncrement:!0}),e.objectStoreNames.contains(l_)||e.createObjectStore(l_)},r.onsuccess=()=>e(r.result),r.onerror=()=>n(r.error)});try{if(!n.objectStoreNames.contains(c_))return null;let e=await new Promise((e,t)=>{let r=n.transaction(c_,`readonly`).objectStore(c_).getAll();r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)});if(e.length===0)return null;let t=new Yn;try{bn(t,()=>{for(let n of e)In(t,n)});let n=t.getMap(`lifecycle`).get(E);return typeof n==`string`&&n.length>0?n:null}finally{t.destroy()}}finally{n.close()}}function m_(e){return En(e)}function h_(e,t){return t===null?gn(e):gn(e,t)}function g_(e,t){if(e===null)return t;if(t===null)return e;let n=_n(e),r=_n(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 En(i)}function __(e){let t={};if(Ut.inject(Ht.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 v_=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new ht({key:e||new st(`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))}}}),y_=O.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[v_({key:new st(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function b_(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||!Be.isSelectable(o))return!1;try{let t=Be.create(n.doc,s);return e.view.dispatch(n.tr.setSelection(t).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L0`,reason:e.message.slice(0,500)})),!0}}function x_(e){let{state:t,view:n}=e;if(!(t.selection instanceof Ce)||!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=We.findFrom(n,-1,!0);return!r||!(r instanceof Ce)?!1:(e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return nt(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2c`,reason:e.message.slice(0,500)})),!0}}function S_(e,t){let{state:n,view:r}=e;if(!(n.selection instanceof Ce)||!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)return!1;let c=s+o.nodeSize;try{let t=a?s+1:c-1,r=We.findFrom(n.doc.resolve(t),a?1:-1,!0);return!r||!(r instanceof Ce)||r.$head.pos<=s||r.$head.pos>=c?!1:(e.view.dispatch(n.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return nt(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L2d`,reason:e.message.slice(0,500)})),!0}}var C_=O.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof Be){if(t.selection.$from.depth===0)return e.commands.blur(),!0;let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=Ce.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof Ce?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{if(b_(e,`up`)||x_(e)||S_(e,`up`))return!0;let{state:t}=e;if(!(t.selection instanceof Be))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=Be.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 nt(`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(b_(e,`down`)||S_(e,`down`))return!0;let{state:t}=e;if(!(t.selection instanceof Be))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=Be.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(`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})=>b_(e,`left`)||S_(e,`left`),ArrowRight:({editor:e})=>b_(e,`right`)||S_(e,`right`),Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof Ce)||!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 f=u+1;return s.setSelection(Ce.create(s.doc,f)),e.view.dispatch(s.scrollIntoView()),!0}}}}),w_={query:``,options:{caseSensitive:!1,wholeWord:!1},activeIndex:0,matches:[]},T_=/[A-Za-z0-9_]/;function E_(e){return e!==void 0&&T_.test(e)}function D_(e,t,n){return!E_(e[t-1])&&!E_(e[n])}function O_(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||D_(e,t,s))&&a.push({start:t,end:s,text:e.slice(t,s)}),o=s}return a}function k_(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 O_(e.text,t,n))r.push({from:i+a.start,to:i+a.end,text:a.text})}),r}var A_=new st(`findReplace`);function j_(e,t){return t<=0||!Number.isFinite(e)?0:Math.min(Math.max(Math.trunc(e),0),t-1)}function M_(e,t,n,r){let i=k_(e.doc,t,n);return{query:t,options:n,activeIndex:j_(r,i.length),matches:i}}function N_(e,t,n){return t<=0?0:(j_(e,t)+n+t)%t}function P_(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 F_(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=k_(r.doc,t.query,t.options),a=j_(0,i.length),o=i[a];return r.setMeta(A_,{type:`setActiveIndex`,activeIndex:a}),o&&r.setSelection(Ce.create(r.doc,o.from,o.to)),r.scrollIntoView()}function I_(e,t){let n=A_.getState(e)?.matches[t];return n?e.tr.setMeta(A_,{type:`setActiveIndex`,activeIndex:t}).setSelection(Ce.create(e.doc,n.from,n.to)).scrollIntoView():null}function L_(e){return A_.getState(e)??w_}function R_(){return new ht({key:A_,state:{init:()=>w_,apply(e,t,n,r){let i=e.getMeta(A_);if(i?.type===`clear`)return w_;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:[]}:M_(r,a,o,s)}},props:{decorations(e){let t=A_.getState(e);return!t||t.matches.length===0?null:at.create(e.doc,t.matches.map((e,n)=>ke.inline(e.from,e.to,{class:n===t.activeIndex?`ok-find-match ok-find-match-active`:`ok-find-match`})))}}})}var z_=O.create({name:`findReplace`,addCommands(){return{setFindQuery:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(A_,{type:`setQuery`,query:e,options:t?.options,activeIndex:t?.activeIndex})),!0),setFindOptions:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(A_,{type:`setOptions`,options:e,activeIndex:t})),!0),setActiveFindIndex:e=>({state:t,dispatch:n})=>(n&&n(t.tr.setMeta(A_,{type:`setActiveIndex`,activeIndex:e})),!0),selectNextFindMatch:()=>({state:e,dispatch:t})=>{let n=L_(e),r=I_(e,N_(n.activeIndex,n.matches.length,1));return r?(t?.(r),!0):!1},selectPreviousFindMatch:()=>({state:e,dispatch:t})=>{let n=L_(e),r=I_(e,N_(n.activeIndex,n.matches.length,-1));return r?(t?.(r),!0):!1},replaceCurrentFindMatch:e=>({state:t,dispatch:n})=>{let r=L_(t),i=r.matches[r.activeIndex];if(!i||!n)return!1;let a=t.tr.insertText(e,i.from,i.to),o=k_(a.doc,r.query,r.options),s=P_(o,i.from,e.length),c=o[s];return a.setMeta(A_,{type:`setActiveIndex`,activeIndex:s}),c&&a.setSelection(Ce.create(a.doc,c.from,c.to)),a.scrollIntoView(),n(a),!0},replaceAllFindMatches:e=>({state:t,dispatch:n})=>{let r=L_(t);if(!n)return!1;let i=F_(t,r,e);return i?(n(i),!0):!1},clearFindMatches:()=>({state:e,dispatch:t})=>(t&&t(e.tr.setMeta(A_,{type:`clear`})),!0)}},addProseMirrorPlugins(){return[R_()]}}),B_=new WeakMap;function V_(e,t){if(t===null){B_.delete(e);return}B_.set(e,t)}function H_(e){return B_.get(e)??null}function U_(e){return`pagesBySlug`in e}function W_(e){return U_(e)?e.pages:e}function G_(e,t){return U_(e)?e.assetPaths??new Set:t??new Set}function K_(e,t){return U_(e)?e.filePaths??new Set:t??new Set}function q_(e,t){let n=le(e);if(n){if(U_(t))return t.pagesBySlug.get(n);for(let e of t)if(le(e)===n)return e}}function J_(e,t){if(e.includes(`/`))return;let n=le(e);if(!n)return;if(U_(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);le(t===-1?e:e.slice(t+1))===n&&(r===void 0||e.localeCompare(r)<0)&&(r=e)}return r}function Y_(e){let t=e.trim();if(!t)return null;let n=le(t);return n?{target:n,alias:n===t?null:t,anchor:null}:null}function X_(e){let t=e.trim();if(!t)return[];let n=le(t);return n.length>0&&n!==t?[n]:[]}function Z_(e,t){let n=e.trim();if(!n)return;let r=W_(t);if(r.has(n))return n;let i=q_(n,t);if(i)return i;for(let e of X_(n))if(r.has(e))return e;return Q_(n,r)||J_(n,t)}function Q_(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 $_(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function ev(e,t,n){let r=$_(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort((e,t)=>e.localeCompare(t))[0]??null}function tv(e,t,n,r){let i=e.trim();if(!i)return!1;if(ev(i,G_(t,n),K_(t,r)))return!0;let a=W_(t);return a.has(i)||X_(i).some(e=>a.has(e))||q_(i,t)!==void 0||Q_(i,a)?!0:J_(i,t)!==void 0}var nv=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}},rv=new st(`imageUpload`);function iv(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?_i._({id:`KDuPiY`,values:{fileName:n}}):_i._({id:`bGa3Fk`})),t}var av=new ht({key:rv,state:{init(){return{decorations:at.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(rv);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=ke.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 rv.getState(e)?.decorations??at.empty}}});function ov(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function sv(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function cv(e){return e.split(`/`).filter(e=>e!==``)}function lv(e,t){let n=ov(e),r=ov(t),i=sv(e);if(n===r)return i;let a=cv(r),o=cv(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 uv(e){return H_(e)}function dv(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 fv(e){let t=ct(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:tt.has(t)?{kind:`jsx-img`,ext:t}:p.has(t)?{kind:`jsx-video`,ext:t}:Mt.has(t)?{kind:`jsx-audio`,ext:t}:U.has(t)?{kind:`jsx-file`,ext:t}:Qe.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function pv(e,t,n){let r=uv(t),i=r?`${r}.md`:``;if(!i){yr.error(_i._({id:`z5pqI8`}));return}let a=crypto.randomUUID(),o=iv(e);t.view.dispatch(t.state.tr.setMeta(rv,{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),mv(t,a);return}let l;try{l=await c.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),mv(t,a);return}if(!c.ok){let e=Xe.safeParse(l);if(!e.success){let n=new nv(`Upload response did not match ProblemDetails.`,{cause:e.error,status:c.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),mv(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),mv(t,a,e.data.title);return}let u=rt.safeParse(l);if(!u.success){let e=new nv(`Upload success response did not match UploadAssetSuccess.`,{cause:u.error,status:c.status});console.error(`[uploadAndInsert] Response missing src:`,e),mv(t,a);return}let d=u.data,f=d.src,p=d.deduped===!0,m=ov(i),h=typeof d.path==`string`&&d.path.length>0?d.path:m?`${m}/${f}`:f;p&&yr.info(_i._({id:`VbqhBI`,values:{assetContentPath:h}}));let g=fv(e.name),{state:_}=t,v=rv.getState(_)?.uploads.get(a)??n,y=_.tr.setMeta(rv,{type:`remove`,id:a}),b=lv(h,i),x=`/${h}`;if(g.kind===`jsx-file`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),mv(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:x,target:f,alias:null,anchor:null,size:At(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(rv,{type:`remove`,id:a}),!0)).focus().insertContentAt(v,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(v);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(Be.create(e.doc,n)),!0}).run();return}if(g.kind===`jsx-img`||g.kind===`jsx-video`||g.kind===`jsx-audio`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),mv(t,a);return}let e=dv(g.kind,x);t.chain().command(({tr:e})=>(e.setMeta(rv,{type:`remove`,id:a}),!0)).focus().insertContentAt(v,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(v);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(Be.create(e.doc,n)),!0}).run();return}if(g.kind===`wikiembed`){let e=_.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),mv(t,a);return}y.insert(v,e.create({target:f,alias:null,anchor:null,resolvedSrc:x}))}else if(g.kind===`wiki-link`){let n=_.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),mv(t,a);return}let r=Y_(e.name.replace(/\.(md|mdx)$/i,``));r?y.insert(v,n.create(r)):y.insert(v,_.schema.text(e.name))}else{let t=_.schema.marks.link;if(t){let n=_.schema.text(e.name,[t.create({href:b})]);y.insert(v,n)}else y.insert(v,_.schema.text(e.name))}t.view.dispatch(y)}function mv(e,t,n){e.view.dispatch(e.state.tr.setMeta(rv,{type:`remove`,id:t})),yr.error(n??_i._({id:`b3Thhd`}))}var hv=new Set;function gv(e){hv.add(e)}function _v(e){return hv.delete(e)}var vv=new st(`markIdentity`);function yv(){return{byId:new Map,counter:0}}function bv(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&&xv(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 xv(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&&xv(n,i)))return!1}return!0}function Sv(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 Cv(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new ht({key:vv,state:{init(e,t){return bv(t.doc,yv(),a,n)},apply(e,t,r,i){return e.docChanged?bv(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=vv.getState(t.state);n&&(e=Sv(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}var wv=300,Tv=150,Ev=500,Dv=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 Ov(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 kv(e){return e?e.closest(`[data-ok-prop-panel]`)!==null:!1}function Av(){return typeof document>`u`?!1:document.querySelector(`[data-ok-layer-spawned]`)!==null}var jv=e=>{let t=(0,$.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,Q.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,Q.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,Z.jsxs)(Z.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function Mv(e){return e.editorView?.dom??null}function Nv(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 Pv(e){let{editor:t}=e,n=new Dv,r=Mv(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)},wv))},m=()=>{n.getActiveNode()!==null&&o===null&&(o=setTimeout(()=>{o=null,!Av()&&n.setActiveNode(null)},Tv))},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&&Nv(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??Mv(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=Ov(e.target,n);if(t===null)return;f(),c=setTimeout(()=>{c=null,l=t,n.setActiveNode(t)},Ev);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=Ov(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=Ov(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=Ov(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(kv(r)){d();return}let i=Ov(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=Ov(r,n);if(o!==null){if(a&&kv(a)){d();return}if(a&&Ov(a,n)===o)return;s===o&&u(),m();return}if(kv(r)){if(a&&kv(a))return;let e=n.getActiveNode();if(e!==null&&a&&Ov(a,n)===e)return;m()}},E=e=>{if(g)return;let t=e.target;if(!(t instanceof Element))return;let r=Ov(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&&kv(i)||i&&Ov(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=Mv(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 Fv=e=>{let t=(0,$.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,Z.jsx)(jv,{store:n})}),t[0]=n,t[1]=r),r},Iv=new WeakMap;function Lv(e){let t=Iv.get(e);if(t)return t;let n=Pv({editor:e});return Iv.set(e,n),e.on(`destroy`,()=>{n.destroy(),Iv.delete(e)}),n}var Rv={AppWindow:Na,ChevronRight:$t,CopyPlus:ln,FileText:eo,Film:ro,GitBranch:hr,Image:lo,LayoutPanelTop:fo,MessageSquareWarning:bo,PanelTop:wo,Paperclip:To,Sigma:No,SquarePlay:Fo,Volume2:zo,Workflow:Bo,ZoomIn:Ho};function zv(e){return e&&Object.hasOwn(Rv,e)?Rv[e]:za}var Bv={Info:gr,Lightbulb:po,MessageSquareWarning:bo,AlertTriangle:vr,AlertOctagon:So,ClipboardList:Ka,BookOpen:Ra,ListTodo:vo,CircleCheck:rn,CircleHelp:Wa,CircleX:Ga,Zap:Vo,Bug:Ba,FlaskConical:io,Quote:Do,ChevronRight:$t},Vv=Object.entries(Bv).sort(([e],[t])=>e.localeCompare(t));function Hv(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(Bv,t)?Bv[t]??null:null}function Uv(e){let t=(0,$.c)(24),n;t[0]===e.icon?n=t[1]:(n=Hv(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,Z.jsx)($t,{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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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,Z.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 Wv(e){return e!==!1}function Gv(e){let t=(0,$.c)(12),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:Pt(e.src),t[0]=e.src,t[1]=n);let r=e.title,i;t[2]===e.controls?i=t[3]:(i=Wv(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,Z.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 Kv={note:gr,tip:po,important:bo,warning:vr,caution:So,abstract:Ka,info:Ra,todo:vo,success:rn,question:Wa,failure:Ga,danger:Vo,bug:Ba,example:io,quote:Do};function qv(e,t){return Hv(e)??Kv[t]}var Jv=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function Yv(e){return typeof e==`string`&&Jv.has(e)?e:`note`}function Xv(e){let t=(0,$.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=Yv(e.type),n=qv(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,Z.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,Z.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,Z.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,Z.jsx)(`span`,{className:`callout-title`,children:(0,Z.jsx)(o,{id:`URmyfc`})}),t[9]=l,t[10]=i);let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Qt,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=a):a=t[11];let c;t[12]===i?c=t[13]:(c=(0,Z.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,Z.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,Z.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,Z.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,Z.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 Zv=(0,Q.createContext)(null);function Qv(e){let t=(0,$.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsx)(Zv.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function $v(){return(0,Q.use)(Zv)}var ey=[{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 ty(e){let t=(0,$.c)(7),{targetRef:n,onResize:r,onResizeEnd:i,bounds:a}=e,{_:o}=s(),c=(0,Q.useRef)(null),l;t[0]!==a?.maxHeight||t[1]!==a?.maxWidth||t[2]!==a?.minHeight||t[3]!==a?.minWidth?(l=function(e,t){let n=t===`w`?a?.minWidth??64:a?.minHeight??64,r=t===`w`?a?.maxWidth??1/0:a?.maxHeight??1/0;return Math.max(n,Math.min(r,e))},t[0]=a?.maxHeight,t[1]=a?.maxWidth,t[2]=a?.minHeight,t[3]=a?.minWidth,t[4]=l):l=t[4];let u=l,d=function(e,t){let a=n.current;if(!a)return;e.preventDefault(),e.stopPropagation();let o=a.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};let s=e.currentTarget;try{s.setPointerCapture(e.pointerId)}catch{}document.body.style.setProperty(`cursor`,t.cursor),document.body.style.setProperty(`user-select`,`none`);let l=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 d(){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`,l),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d),n&&i?.(t)}window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},f=ey.map(e=>{let t=e.key;return(0,Z.jsx)(`button`,{type:`button`,className:Kt(e.className),"aria-label":o({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,Z.jsx)(`div`,{className:`ok-resize-overlay`,contentEditable:!1,"aria-hidden":`true`,children:f}),t[5]=f,t[6]=p),p}var ny=`26rem`,ry=`Embedded content`,iy=/^https?:\/\//i;function ay(e){try{return new URL(e).origin!==window.location.origin}catch{return!1}}function oy(e){return!(typeof e!=`string`||!iy.test(e)||!ay(e))}function sy(e){let t=(0,$.c)(24),{src:n,title:r,width:i,height:a}=e,o=(0,Q.useRef)(null),s=$v(),c=i||void 0,l=a||ny,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||ny)},p=[i,a],t[3]=a,t[4]=i,t[5]=f,t[6]=p):(f=t[5],p=t[6]),(0,Q.useEffect)(f,p),!oy(n)){let e=`Embed a URL`;typeof n==`string`&&n.length>0&&(e=iy.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,Z.jsx)(`div`,{className:`ok-embed ok-embed--placeholder`,contentEditable:!1,children:(0,Z.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;t[11]===n?g=t[12]:(g=Ue(n),t[11]=n,t[12]=g);let _=g,v=_===n?`no-referrer`:`strict-origin-when-cross-origin`,y=r||ry,b;t[13]!==_||t[14]!==v||t[15]!==y?(b=(0,Z.jsx)(`iframe`,{title:y,src:_,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation`,referrerPolicy:v,loading:`lazy`,className:`ok-embed-frame`}),t[13]=_,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==s||t[18]!==h?(x=s?(0,Z.jsx)(ty,{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[17]=s,t[18]=h,t[19]=x):x=t[19];let S;return t[20]!==d||t[21]!==x||t[22]!==b?(S=(0,Z.jsxs)(`div`,{className:`ok-embed`,style:d,ref:o,contentEditable:!1,children:[b,x]}),t[20]=d,t[21]=x,t[22]=b,t[23]=S):S=t[23],S}function cy(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 ly(e){let t=(0,$.c)(18),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||cy(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?Pt(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,Z.jsx)(to,{className:`ok-file-icon`,"aria-hidden":`true`}),t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,Z.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,Z.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,Z.jsxs)(`a`,{href:o,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:uy,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 uy(e){return e.stopPropagation()}function dy(){return Q.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`},Q.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 fy(){return Q.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`},Q.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 py(e){return typeof Element>`u`?!1:e instanceof Element}var my=(e,t)=>py(t)&&t.tagName.toUpperCase()===e,hy=e=>my(`DIV`,e)||my(`SPAN`,e),gy=e=>my(`IMG`,e),_y=e=>e.complete&&e.naturalHeight!==0,vy=e=>my(`SVG`,e),yy=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),by=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=yy({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},xy=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?by({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):yy({height:e,offset:r,width:t}),Sy=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,Cy=e=>{if(e!==null){if(gy(e))return e.currentSrc===``?void 0:e.currentSrc;if(hy(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return Sy.exec(t)?.[1]}}},wy=e=>{if(e!==null)return gy(e)?e.alt:e.getAttribute(`aria-label`)??void 0},Ty=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=xy({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})`}},Ey=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},Dy=({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=Ey({position:p,relativeNum:r-l*f}),g=Ey({position:m,relativeNum:e-c*f}),_=xy({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=Ey({position:a,relativeNum:r-l}),f=Ey({position:u,relativeNum:e-c}),p=xy({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=xy({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{}},Oy=({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=Ey({position:p,relativeNum:a-l*f}),g=Ey({position:m,relativeNum:n-c*f}),_=xy({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=Ey({position:t,relativeNum:a-l}),f=Ey({position:u,relativeNum:n-c}),p=xy({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=Ey({position:u,relativeNum:a}),p=Ey({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=Ey({position:_,relativeNum:a-l*g}),b=Ey({position:v,relativeNum:n-c*g}),x=xy({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})`}}},ky=/\.svg$/i,Ay=({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&&ky.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&hy(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=Ty({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?Dy({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?Oy({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},jy=e=>{if(e==null)return{};if(vy(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}},My=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}`)}})})},Ny=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Py={overflow:``,width:``};function Fy(){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 Iy(e){e.preventDefault()}function Ly(e){return Q.createElement(Ry,{...e})}var Ry=class extends Q.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=Q.createRef(),this.refDialog=Q.createRef(),this.refModalContent=Q.createRef(),this.refModalImg=Q.createRef(),this.refWrap=Q.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Py,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(Ny),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:jy(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:jy(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=Cy(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(gy(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:jy(this.imgEl)})};t.decode().then(r).catch(()=>{if(_y(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||vy(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=Py},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(_y(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(vy(e)){let r=e.cloneNode(!0);My(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=hy(a),j=gy(a),M=vy(a),N=wy(a),P=Cy(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,R=h?.src!==void 0&&h.src!==``,z=this.hasImage(),B=N!==void 0&&N!==``?`${s}: ${N}`:s,V=T===`LOADING`||T===`LOADED`,ee=z?`found`:`not-found`,H=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,U={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=z&&a!==null?Ay({hasZoomImg:R,imgSrc:P,isSvg:M,isZoomed:f&&V,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let W=null;if(z){let t=j||A?Q.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?Q.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=Q.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},Q.createElement(u,null));W=m==null?Q.createElement(Q.Fragment,null,t,n):Q.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return Q.createElement(p,{"aria-owns":z?O:void 0,"data-rmiz":``,ref:x},Q.createElement(p,{"data-rmiz-content":ee,ref:_,style:U},c),z&&Q.createElement(p,{"data-rmiz-ghost":``,style:D},Q.createElement(`button`,{"aria-label":B,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},Q.createElement(d,null))),z&&Ko.createPortal(Q.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:Iy,ref:v,role:`dialog`},Q.createElement(`div`,{"data-rmiz-modal-overlay":H}),Q.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},W)),Fy()))}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)}};Ry.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:dy,IconZoom:fy,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function zy({onZoomChange:e,...t}){let[n,r]=Q.useState(!1),i=Q.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return Q.createElement(Ly,{...t,isZoomed:n,onZoomChange:i})}function By(e,t){return typeof e==`number`&&typeof t==`number`&&e>0&&t>0}function Vy(e,t,n){return By(e,t)?{...n,width:`${e}px`,aspectRatio:`${e} / ${t}`}:n}function Hy(e){let t=(0,$.c)(52),n,r,i,a,o,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=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:o,onError:a,src:l,style:u,alt:p,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,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}=s(),y=(0,Q.useRef)(null),[b,x]=(0,Q.useState)(!1),S;t[13]!==r||t[14]!==m?(S=By(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=Vy(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,Q.useLayoutEffect)(E,D);let O=!C&&!b&&`aspect-[16/9] w-full max-w-full`,k;t[23]!==c||t[24]!==O?(k=Kt(`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,Z.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=Kt(`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]===o?N=t[34]:(N=e=>{x(!0),o?.(e)},t[33]=o,t[34]=N);let P;t[35]===a?P=t[36]:(P=e=>{x(!0),a?.(e)},t[35]=a,t[36]=P);let F;t[37]!==_||t[38]!==r||t[39]!==i||t[40]!==l||t[41]!==M||t[42]!==N||t[43]!==P||t[44]!==m?(F=(0,Z.jsx)(`img`,{...i,ref:y,src:l,alt:_,width:m,height:r,className:M,onLoad:N,onError:P}),t[37]=_,t[38]=r,t[39]=i,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,Z.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 Uy(e){return e??`lazy`}function Wy(e){if(typeof e!=`string`)return e;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function Gy(e){let t=(0,$.c)(21),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:Pt(e.src),t[0]=e.src,t[1]=n);let r=e.alt??``,i;t[2]===e.width?i=t[3]:(i=Wy(e.width),t[2]=e.width,t[3]=i);let a;t[4]===e.height?a=t[5]:(a=Wy(e.height),t[4]=e.height,t[5]=a);let o=e.title,s;t[6]===e.loading?s=t[7]:(s=Uy(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,Z.jsx)(Hy,{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 Ky(e){let t=(0,$.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,Z.jsx)(zy,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,Z.jsx)(Gy,{...e})}),t[1]=e,t[2]=r),r}var qy=(0,Q.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-BunQWEOH.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,$.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,Z.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 Jy(e){let t=(0,$.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,Z.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 Yy(e){let t=(0,$.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,Z.jsx)(Jy,{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,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(Jy,{formula:n,id:e.id}),children:(0,Z.jsx)(qy,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}var Xy=.5,Zy=4,Qy=.25,$y=48,eb={type:`button`,size:`icon-sm`,variant:`secondary`,className:`border-border`},tb=null;function nb(){return tb||=n(()=>import(`./mermaid.core-Cam_8F7g.js`).then(e=>e.default),__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 tb=null,e}),tb}function rb(){if(typeof document<`u`){let e=document.documentElement.classList;if(e.contains(`dark`))return`dark`;if(e.contains(`light`))return`light`}return typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var ib={fontFamily:`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`,background:`#0b0b0d`,primaryColor:`#1c1c1f`,primaryTextColor:`#f5f5f7`,primaryBorderColor:`#2a2a2e`,secondaryColor:`#242427`,secondaryTextColor:`#f5f5f7`,secondaryBorderColor:`#2a2a2e`,tertiaryColor:`#2c2c30`,tertiaryTextColor:`#f5f5f7`,tertiaryBorderColor:`#2a2a2e`,mainBkg:`#1c1c1f`,lineColor:`#5a5a63`,textColor:`#f5f5f7`,actorBkg:`#1c1c1f`,actorBorder:`#2a2a2e`,actorTextColor:`#f5f5f7`,actorLineColor:`#4a4a52`,signalColor:`#8b8b93`,signalTextColor:`#a1a1a9`,labelBoxBkgColor:`#1c1c1f`,labelBoxBorderColor:`#4a4a52`,labelTextColor:`#a1a1a9`,loopTextColor:`#a1a1a9`,nodeBorder:`#1c1c1f`,clusterBkg:`#141416`,clusterBorder:`#2a2a2e`,defaultLinkColor:`#5a5a63`,edgeLabelBackground:`#0b0b0d`,titleColor:`#a1a1a9`,noteBkgColor:`#c88a1e`,noteTextColor:`#ffffff`,noteBorderColor:`#c88a1e`,activationBkgColor:`#2c2c30`,activationBorderColor:`#3a3a40`};function ab(e,t){e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:t===`dark`?`dark`:`default`,themeVariables:t===`dark`?ib:void 0,suppressErrorRendering:!0})}var ob=null;function sb(){return ob||=n(()=>import(`./panzoom.es-BcYSRiVh.js`).then(e=>e.default),[],import.meta.url).catch(e=>{throw ob=null,e}),ob}var cb=[{open:`[[`,close:`]]`},{open:`[(`,close:`)]`},{open:`((`,close:`))`},{open:`{{`,close:`}}`},{open:`[/`,close:`/]`},{open:`[\\`,close:`\\]`},{open:`[/`,close:`\\]`},{open:`[\\`,close:`/]`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`{`,close:`}`},{open:`>`,close:`]`}];function lb(e,t,n){for(let{open:r,close:i}of cb)for(let a of[!0,!1]){let o=a?`"${n}"`:n,s=`${t}${r}${o}${i}`,c=e.indexOf(s);if(c<0)continue;let l=c===0?``:e.charAt(c-1);if(l&&/\w/.test(l))continue;let u=c+t.length+r.length;return{start:u,end:u+o.length,wasQuoted:a,open:r,close:i}}return null}function ub(e){return/[[\](){}|;#<>&\n"]/.test(e)}function db(e,t,n){let r=t.wasQuoted||t.open!==``&&ub(n),i=n.replace(/"/g,`#quot;`),a=r?`"${i}"`:n;return e.slice(0,t.start)+a+e.slice(t.end)}function fb(e){let t=/flowchart-(.+)-\d+$/.exec(e);return t?t[1]:null}function pb(e){let t=/^L_(.+)_(\d+)$/.exec(e);if(!t)return null;let n=t[1],r=Number(t[2]),i=n.lastIndexOf(`_`);return i<0?null:{from:n.slice(0,i),to:n.slice(i+1),index:r}}function mb(e,t,n,r,i){let a=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),o=a(t),s=a(n),c=a(i),l=`(?:-->|==>|-\\.->|~~~>|<--)`,u=`(?:--|==|-\\.|~~~)`,d=[{re:RegExp(`${o}\\s*${u}[->=]*\\s*\\|\\s*("${c}")\\s*\\|\\s*${s}`,`gd`),quoted:!0,groupIndex:1},{re:RegExp(`${o}\\s*${u}[->=]*\\s*\\|\\s*(${c})\\s*\\|\\s*${s}`,`gd`),quoted:!1,groupIndex:1},{re:RegExp(`${o}\\s*${u}\\s*("${c}")\\s*${l}\\s*${s}`,`gd`),quoted:!0,groupIndex:1},{re:RegExp(`${o}\\s*${u}\\s*(${c})\\s*${l}\\s*${s}`,`gd`),quoted:!1,groupIndex:1}],f=[];for(let{re:t,quoted:n,groupIndex:r}of d){t.lastIndex=0;let i=t.exec(e);for(;i;){let a=i.indices?.[r];a&&f.push({start:a[0],end:a[1],wasQuoted:n}),i=t.exec(e)}}f.sort((e,t)=>e.start-t.start);let p=f[r];return p?{start:p.start,end:p.end,wasQuoted:p.wasQuoted,open:``,close:``}:null}function hb(e,t,n=0){let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`:[ \\t]+(${r})[ \\t]*(?=\\r?\\n|$)`,`gmd`),a=0,o=i.exec(e);for(;o;){if(a===n){let e=o.indices?.[1];if(!e)return null;let[t,n]=e;return{start:t,end:n,wasQuoted:!1,open:``,close:``}}a+=1,o=i.exec(e)}return null}function gb(e,t,n,r=0){let i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),a=n.replace(/"/g,`#quot;`),o=(t,n)=>{let i=0;t.lastIndex=0;let a=t.exec(e);for(;a;){if(i===r)return{range:[a.index,a.index+a[0].length],replacement:n(a)};i+=1,a=t.exec(e)}return null},s=`(?:participant|actor)`,c=o(RegExp(`^([ \\t]*${s}[ \\t]+\\S+[ \\t]+as[ \\t]+")${i}(")`,`gm`),e=>`${e[1]}${a}${e[2]}`);if(c)return e.slice(0,c.range[0])+c.replacement+e.slice(c.range[1]);let l=o(RegExp(`^([ \\t]*${s}[ \\t]+\\S+[ \\t]+as[ \\t]+)${i}([ \\t]*)$`,`gm`),e=>{let t=/[\s"#|;<>&]/.test(n)?`"${a}"`:n;return`${e[1]}${t}${e[2]}`});if(l)return e.slice(0,l.range[0])+l.replacement+e.slice(l.range[1]);let u=o(RegExp(`^([ \\t]*${s}[ \\t]+)${i}([ \\t]*)$`,`gm`),e=>{let r=/[^\w]/.test(n)?`"${a}"`:n;return`${e[1]}${t}${e[2]} as ${r}`});return u?e.slice(0,u.range[0])+u.replacement+e.slice(u.range[1]):null}function _b(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=RegExp(`(?<![\\w])${n}(?![\\w[({<>@:])`,`gd`).exec(e);if(!r)return null;let i=r.indices?.[0];return i?{start:i[0],end:i[1],wasQuoted:!1,open:``,close:``}:null}function vb(e,t,n){let r=n.replace(/"/g,`#quot;`),i=ub(n)?`["${r}"]`:`[${n}]`;return e.slice(0,t.end)+i+e.slice(t.end)}function yb(e,t,n=0){let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`^[ \\t]*Note[ \\t]+(?:over|left of|right of)[ \\t]+[^:\\n]+:[ \\t]+(${r})[ \\t]*(?=\\r?\\n|$)`,`gmd`),a=0,o=i.exec(e);for(;o;){if(a===n){let e=o.indices?.[1];return e?{start:e[0],end:e[1],wasQuoted:!1,open:``,close:``}:null}a+=1,o=i.exec(e)}return null}function bb(e,t,n=0){let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`^([ \\t]*(?:alt|else|opt|loop|par|par_and|critical|option|and|break|rect)[ \\t]+)(${r})[ \\t]*(?=\\r?\\n|$)`,`gmd`),a=0,o=i.exec(e);for(;o;){if(a===n){let e=o.indices?.[2];return e?{start:e[0],end:e[1],wasQuoted:!1,open:``,close:``}:null}a+=1,o=i.exec(e)}return null}function xb(e){let t=(0,$.c)(37),{chart:n,className:r}=e,i=n===void 0?``:n,a=(0,Q.useId)(),s;t[0]===a?s=t[1]:(s=a.replaceAll(`:`,`_`),t[0]=a,t[1]=s);let c=`mermaid-${s}`,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l={status:`idle`,svg:``,error:``},t[2]=l):l=t[2];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(wb),m,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{if(typeof document>`u`)return;let e=document.documentElement,t=()=>{let e=rb();p(t=>t===e?t:e)};t();let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>n.disconnect()},h=[],t[3]=m,t[4]=h):(m=t[3],h=t[4]),(0,Q.useEffect)(m,h);let g=$v(),_=g?.editor.isEditable??!1,v=(0,Q.useRef)(null),y=(0,Q.useRef)(g),b,x;t[5]===g?(b=t[6],x=t[7]):(b=()=>{y.current=g},x=[g],t[5]=g,t[6]=b,t[7]=x),(0,Q.useLayoutEffect)(b,x);let S=(0,Q.useRef)(null),C,w;t[8]!==i||t[9]!==f||t[10]!==c?(C=()=>{if(!i.trim()){d({status:`idle`,svg:``,error:``});return}let e=!1;return d(Cb),sb().catch(Sb),nb().then(async t=>{ab(t,f);let n=await t.render(c,i);e||d({status:`ready`,svg:n.svg,error:``})}).catch(t=>{e||d({status:`error`,svg:``,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},w=[i,c,f],t[8]=i,t[9]=f,t[10]=c,t[11]=C,t[12]=w):(C=t[11],w=t[12]),(0,Q.useEffect)(C,w);let T,E;if(t[13]!==_||t[14]!==u.status?(T=()=>{if(u.status!==`ready`||!_)return;let e=v.current;if(!e)return;for(let t of e.querySelectorAll(`.nodeLabel, .edgeLabel`))t.style.cursor=`text`;let t=function(e,t){let n=y.current;if(!n)return;let r=n.getPos();if(typeof r!=`number`)return;let i=n.editor.state.doc.nodeAt(r);if(!i||i.type.name!==`jsxComponent`)return;let a=i.attrs.props??{},o=a.chart??``,s=null;if(e.applyRewrite)s=e.applyRewrite(o,t);else if(e.locate){let n=e.locate(o);n&&(s=db(o,n,t))}if(s!==null)try{n.editor.view.dispatch(n.editor.state.tr.setNodeMarkup(r,null,{...i.attrs,props:{...a,chart:s},sourceDirty:!0}))}catch(e){let t=e;if(!(t instanceof RangeError))throw t}},n=function(e,n){let{labelSpan:r,outlineShape:i}=e,a=y.current;if(!a)return!1;let o=a.getPos();if(typeof o!=`number`)return!1;let s=a.editor.state.doc.nodeAt(o);if(!s||s.type.name!==`jsxComponent`)return!1;let c=s.attrs.props?.chart??``,l=e.sourceLabel??(r.textContent??``).trim();if(!l)return!1;let u=e.applyRewrite?.(c,l);if(!e.locate?.(c)&&u==null)return!1;n.preventDefault(),n.stopPropagation();let d=r.querySelector(`p`)??r,f=window.getComputedStyle(d),p=d instanceof SVGGraphicsElement?d.querySelector(`tspan`)??d:d,m=window.getComputedStyle(p),h=(()=>{if(!(d instanceof SVGGraphicsElement))return null;let e=m.fill;return e&&e!==`none`?e:null})()??f.color,g=i,_=g?.getAttribute(`stroke`)??null,v=g?.getAttribute(`stroke-width`)??null,b=document.createElement(`input`);b.type=`text`,b.value=l,b.setAttribute(`data-mermaid-editing`,`true`),b.setAttribute(`spellcheck`,`true`),Object.assign(b.style,{position:`fixed`,margin:`0`,padding:`0`,fontFamily:m.fontFamily,fontSize:m.fontSize,fontWeight:m.fontWeight,fontStyle:m.fontStyle,fontFeatureSettings:m.fontFeatureSettings,letterSpacing:m.letterSpacing,color:h,textAlign:`center`,border:`none`,outline:`none`,boxShadow:`none`,boxSizing:`border-box`,colorScheme:`light`,appearance:`none`,WebkitAppearance:`none`,caretColor:h,zIndex:`2147483647`}),b.style.setProperty(`background`,`transparent`,`important`),b.style.setProperty(`background-color`,`transparent`,`important`),g&&(g.setAttribute(`stroke`,`var(--ring, #3b82f6)`),g.setAttribute(`stroke-width`,`2`));let x=d.style.visibility;d.style.visibility=`hidden`,document.body.appendChild(b);let C=e.positionAnchor??d,w=Math.max(l.length+4,8),T=parseFloat(m.fontSize)||16,E=function(){if(C instanceof SVGGraphicsElement)try{let e=C.getBBox();if(e.height>0)return C.getBoundingClientRect().height/e.height}catch{}let e=(d instanceof SVGElement?d.ownerSVGElement:null)??(d instanceof Element?d.closest(`svg`):null);if(e instanceof SVGSVGElement){let t=e.viewBox.baseVal;if(t.width>0&&t.height>0){let n=e.getBoundingClientRect();return Math.min(n.width/t.width,n.height/t.height)}}return 1},D=function(){let e=C.getBoundingClientRect();b.style.top=`${e.top}px`,b.style.width=`${e.width}px`,b.style.minWidth=`${w}ch`,b.style.height=`${e.height}px`,b.style.lineHeight=`${e.height}px`;let t=E();b.style.fontSize=`${T*t}px`,b.style.left=`${e.left}px`;let n=b.getBoundingClientRect(),r=e.left+e.width/2-n.width/2;b.style.left=`${r}px`};D();let O=requestAnimationFrame(()=>{b.focus(),b.select()});window.addEventListener(`scroll`,D,!0),window.addEventListener(`resize`,D);let k=!1,A=function(){cancelAnimationFrame(O),window.removeEventListener(`scroll`,D,!0),window.removeEventListener(`resize`,D),b.removeEventListener(`keydown`,N),b.removeEventListener(`blur`,P),b.remove(),d.style.visibility=x,g&&(_===null?g.removeAttribute(`stroke`):g.setAttribute(`stroke`,_),v===null?g.removeAttribute(`stroke-width`):g.setAttribute(`stroke-width`,v)),S.current=null},j=function(){if(k)return;k=!0;let n=b.value.trim();A(),!(!n||n===l)&&t(e,n)},M=function(){k||(k=!0,A())};function N(e){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),M();return}if(e.key===`Enter`&&!e.shiftKey){e.preventDefault(),e.stopPropagation(),j();return}e.stopPropagation()}function P(){j()}return b.addEventListener(`keydown`,N),b.addEventListener(`blur`,P),S.current={cleanup:()=>{k||M()}},!0},r=function(e){if(S.current)return;let t=e.target;if(!(t instanceof Element))return;let r=t.closest(`.nodeLabel`);if(r){let i=t.closest(`.node[id]`);if(!i)return;let a=fb(i.id);if(!a)return;let o=a,s=(r.textContent??``).trim();if(!s)return;let c=function(e){let t=lb(e,o,s);if(t)return{match:t,splice:db};if(s!==o)return null;let n=_b(e,o);return n?{match:n,splice:vb}:null};n({labelSpan:r,outlineShape:i.querySelector(`rect, polygon, path, circle, ellipse`),locate:e=>c(e)?.match??null,applyRewrite:(e,t)=>{let n=c(e);return n?n.splice(e,n.match,t):null}},e);return}let i=t.closest(`text.actor`);if(i){let t=(i.textContent??``).trim();if(!t)return;let r=i.ownerSVGElement,a=0;if(r){let e=Array.from(r.querySelectorAll(`text.actor`)),n=0;for(let r of e){if(r===i){a=Math.floor(n/2);break}(r.textContent??``).trim()===t&&(n+=1)}}let o=i.parentElement?.querySelector(`rect.actor`);n({labelSpan:i,outlineShape:null,positionAnchor:o??void 0,applyRewrite:(e,n)=>gb(e,t,n,a)},e);return}let a=t.closest(`text.messageText`);if(a){let t=(a.textContent??``).trim();if(!t)return;let r=a.ownerSVGElement,i=0;if(r){let e=Array.from(r.querySelectorAll(`text.messageText`));for(let n of e){if(n===a)break;(n.textContent??``).trim()===t&&(i+=1)}}n({labelSpan:a,outlineShape:null,locate:e=>hb(e,t,i)},e);return}let o=t.closest(`.edgeLabel`);if(o){let t=o.closest(`g[data-id^="L_"]`)?.getAttribute(`data-id`);if(!t)return;let r=pb(t);if(!r)return;let i=(o.textContent??``).trim();if(!i)return;n({labelSpan:o,outlineShape:null,locate:e=>mb(e,r.from,r.to,r.index,i)},e);return}let s=t.closest(`rect.note`),c=t.closest(`text.noteText`)??s?.parentElement?.querySelector(`text.noteText`)??null;if(c){let t=(c.textContent??``).trim();if(!t)return;let r=c.ownerSVGElement,i=0;if(r){let e=Array.from(r.querySelectorAll(`text.noteText`));for(let n of e){if(n===c)break;(n.textContent??``).trim()===t&&(i+=1)}}n({labelSpan:c,outlineShape:null,positionAnchor:c.parentElement?.querySelector(`rect.note`)??(c.previousElementSibling instanceof SVGGraphicsElement?c.previousElementSibling:null)??void 0,locate:e=>yb(e,t,i)},e);return}let l=t.closest(`text.loopText`);if(l){let t=(l.textContent??``).trim(),r=t.startsWith(`[`)&&t.endsWith(`]`)?t.slice(1,-1).trim():t;if(!r)return;let i=l.ownerSVGElement,a=0;if(i){let e=Array.from(i.querySelectorAll(`text.loopText`));for(let t of e){if(t===l)break;let e=(t.textContent??``).trim();(e.startsWith(`[`)&&e.endsWith(`]`)?e.slice(1,-1).trim():e)===r&&(a+=1)}}n({labelSpan:l,outlineShape:null,sourceLabel:r,locate:e=>bb(e,r,a)},e)}},i=function(e){let t=e.target;t instanceof Element&&t.closest(`.nodeLabel, .edgeLabel, text.messageText, text.actor, text.noteText, text.loopText, rect.note`)&&e.stopPropagation()},a=function(e){let t=e.target;t instanceof Element&&t.closest(`.nodeLabel, .edgeLabel, text.messageText, text.actor, text.noteText, text.loopText, rect.note`)&&(e.stopPropagation(),r(e))};for(let t of e.querySelectorAll(`text.actor, text.messageText, text.noteText, text.loopText, rect.note`))t.style.pointerEvents=`all`,t.style.cursor=`text`;return e.addEventListener(`mousedown`,i,{capture:!0}),e.addEventListener(`click`,a,{capture:!0}),()=>{e.removeEventListener(`mousedown`,i,{capture:!0}),e.removeEventListener(`click`,a,{capture:!0}),S.current?.cleanup(),S.current=null}},E=[u.status,_],t[13]=_,t[14]=u.status,t[15]=T,t[16]=E):(T=t[15],E=t[16]),(0,Q.useEffect)(T,E),!i.trim()){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`mermaid mermaid-placeholder`,"data-component-type":`mermaid`,children:(0,Z.jsx)(`span`,{className:`mermaid-empty`,children:` `})}),t[17]=e):e=t[17],e}if(u.status===`error`){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(vr,{className:`size-3.5 shrink-0 mt-0.5`,"aria-hidden":!0}),t[18]=e):e=t[18];let n;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`div`,{className:`font-medium`,children:(0,Z.jsx)(o,{id:`OLBz-_`})}),t[19]=n):n=t[19];let r;t[20]===u.error?r=t[21]:(r=(0,Z.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,Z.jsxs)(`div`,{className:`min-w-0`,children:[n,(0,Z.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words font-mono text-[11px] opacity-90`,children:u.error})]})]}),t[20]=u.error,t[21]=r);let a;t[22]===i?a=t[23]:(a=(0,Z.jsx)(`pre`,{className:`mermaid-error-source`,children:i}),t[22]=i,t[23]=a);let s;return t[24]!==u.error||t[25]!==r||t[26]!==a?(s=(0,Z.jsxs)(`div`,{className:`mermaid mermaid-error`,"data-component-type":`mermaid`,title:u.error,children:[r,a]}),t[24]=u.error,t[25]=r,t[26]=a,t[27]=s):s=t[27],s}if(u.status===`ready`){let e;t[28]===r?e=t[29]:(e=Kt(`mermaid mermaid-ready flex h-full min-h-64 w-full overflow-hidden rounded-md border border-border/60 bg-background`,r),t[28]=r,t[29]=e);let n;t[30]===u.svg?n=t[31]:(n=(0,Z.jsx)(Tb,{svg:u.svg}),t[30]=u.svg,t[31]=n);let i;return t[32]!==e||t[33]!==n?(i=(0,Z.jsx)(`div`,{ref:v,className:e,"data-component-type":`mermaid`,children:n}),t[32]=e,t[33]=n,t[34]=i):i=t[34],i}let D=`mermaid mermaid-${u.status}`,O;return t[35]===D?O=t[36]:(O=(0,Z.jsx)(`div`,{ref:v,className:D,"data-component-type":`mermaid`}),t[35]=D,t[36]=O),O}function Sb(){}function Cb(e){return{...e,status:`rendering`}}function wb(){return rb()}function Tb(e){let t=(0,$.c)(73),{svg:n}=e,{_:r}=s(),i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o;t[0]===r?o=t[1]:(o=r({id:`AWOSPo`}),t[0]=r,t[1]=o);let c;t[2]===r?c=t[3]:(c=r({id:`FjkaiT`}),t[2]=r,t[3]=c);let l;t[4]===r?l=t[5]:(l=r({id:`0BfhAj`}),t[4]=r,t[5]=l);let u;t[6]===r?u=t[7]:(u=r({id:`PrhzDE`}),t[6]=r,t[7]=u);let d;t[8]===r?d=t[9]:(d=r({id:`NcurBF`}),t[8]=r,t[9]=d);let f;t[10]===r?f=t[11]:(f=r({id:`UhpfxY`}),t[10]=r,t[11]=f);let p;t[12]===r?p=t[13]:(p=r({id:`glzsS_`}),t[12]=r,t[13]=p);let m;t[14]===r?m=t[15]:(m=r({id:`toyw51`}),t[14]=r,t[15]=m);let h;t[16]!==o||t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==d||t[21]!==f||t[22]!==p||t[23]!==m?(h={zoomIn:o,zoomOut:c,reset:l,panUp:u,panDown:d,panLeft:f,panRight:p,toolbar:m},t[16]=o,t[17]=c,t[18]=l,t[19]=u,t[20]=d,t[21]=f,t[22]=p,t[23]=m,t[24]=h):h=t[24];let g=h,_,v;t[25]===n?(_=t[26],v=t[27]):(_=()=>{if(!n.trim())return;let e=i.current?.querySelector(`svg`);if(e?.namespaceURI!==`http://www.w3.org/2000/svg`)return;let t=!1,r=null;return sb().then(n=>{t||(r=n(e,{canvas:!0,cursor:`default`,maxScale:Zy,minScale:Xy,noBind:!0,step:Qy,touchAction:`auto`}),a.current=r)}).catch(e=>{console.warn(`[Mermaid] panzoom setup failed:`,e),a.current===r&&(a.current=null)}),()=>{t=!0,a.current===r&&(a.current=null),r?.destroy()}},v=[n],t[25]=n,t[26]=_,t[27]=v),(0,Q.useEffect)(_,v);let y;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(y=(e,t)=>{a.current?.pan(e,t,{relative:!0})},t[28]=y):y=t[28];let b=y,x;t[29]===n?x=t[30]:(x=(0,Z.jsx)(`div`,{ref:i,className:`ok-mermaid-svg flex min-h-0 flex-1 items-center justify-center [&>svg]:size-full [&>svg]:select-none`,dangerouslySetInnerHTML:{__html:n}}),t[29]=n,t[30]=x);let S;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(`span`,{"aria-hidden":`true`}),t[31]=S):S=t[31];let C,w;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>b(0,-$y),w=(0,Z.jsx)(La,{className:`size-4`,"aria-hidden":`true`}),t[32]=C,t[33]=w):(C=t[32],w=t[33]);let T;t[34]===g.panUp?T=t[35]:(T=(0,Z.jsx)(Xt,{...eb,title:g.panUp,"aria-label":g.panUp,onClick:C,children:w}),t[34]=g.panUp,t[35]=T);let E,D;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>a.current?.zoomIn(),D=(0,Z.jsx)(Ho,{className:`size-4`,"aria-hidden":`true`}),t[36]=E,t[37]=D):(E=t[36],D=t[37]);let O;t[38]===g.zoomIn?O=t[39]:(O=(0,Z.jsx)(Xt,{...eb,title:g.zoomIn,"aria-label":g.zoomIn,onClick:E,children:D}),t[38]=g.zoomIn,t[39]=O);let k,A;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>b(-$y,0),A=(0,Z.jsx)(Fa,{className:`size-4`,"aria-hidden":`true`}),t[40]=k,t[41]=A):(k=t[40],A=t[41]);let j;t[42]===g.panLeft?j=t[43]:(j=(0,Z.jsx)(Xt,{...eb,title:g.panLeft,"aria-label":g.panLeft,onClick:k,children:A}),t[42]=g.panLeft,t[43]=j);let M,N;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>a.current?.reset(),N=(0,Z.jsx)(Oo,{className:`size-4`,"aria-hidden":`true`}),t[44]=M,t[45]=N):(M=t[44],N=t[45]);let P;t[46]===g.reset?P=t[47]:(P=(0,Z.jsx)(Xt,{...eb,title:g.reset,"aria-label":g.reset,onClick:M,children:N}),t[46]=g.reset,t[47]=P);let F,I;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>b($y,0),I=(0,Z.jsx)(Ia,{className:`size-4`,"aria-hidden":`true`}),t[48]=F,t[49]=I):(F=t[48],I=t[49]);let L;t[50]===g.panRight?L=t[51]:(L=(0,Z.jsx)(Xt,{...eb,title:g.panRight,"aria-label":g.panRight,onClick:F,children:I}),t[50]=g.panRight,t[51]=L);let R;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(`span`,{"aria-hidden":`true`}),t[52]=R):R=t[52];let z,B;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>b(0,$y),B=(0,Z.jsx)(Pa,{className:`size-4`,"aria-hidden":`true`}),t[53]=z,t[54]=B):(z=t[53],B=t[54]);let V;t[55]===g.panDown?V=t[56]:(V=(0,Z.jsx)(Xt,{...eb,title:g.panDown,"aria-label":g.panDown,onClick:z,children:B}),t[55]=g.panDown,t[56]=V);let ee,H;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>a.current?.zoomOut(),H=(0,Z.jsx)(Uo,{className:`size-4`,"aria-hidden":`true`}),t[57]=ee,t[58]=H):(ee=t[57],H=t[58]);let U;t[59]===g.zoomOut?U=t[60]:(U=(0,Z.jsx)(Xt,{...eb,title:g.zoomOut,"aria-label":g.zoomOut,onClick:ee,children:H}),t[59]=g.zoomOut,t[60]=U);let W;t[61]!==g.toolbar||t[62]!==T||t[63]!==O||t[64]!==j||t[65]!==P||t[66]!==L||t[67]!==V||t[68]!==U?(W=(0,Z.jsxs)(`div`,{className:`absolute right-3 bottom-3 grid grid-cols-3 gap-1`,"data-testid":`mermaid-actions`,role:`toolbar`,"aria-label":g.toolbar,children:[S,T,O,j,P,L,R,V,U]}),t[61]=g.toolbar,t[62]=T,t[63]=O,t[64]=j,t[65]=P,t[66]=L,t[67]=V,t[68]=U,t[69]=W):W=t[69];let te;return t[70]!==x||t[71]!==W?(te=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 overflow-hidden bg-muted/20`,contentEditable:!1,children:[x,W]}),t[70]=x,t[71]=W,t[72]=te):te=t[72],te}var Eb=null;function Db(){return Eb||=new _t({extensions:Rt}),Eb}function Ob(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=Ob(e,t);if(n)return n}return null}function kb(e){return d({type:`root`,children:e.children??[]})}var Ab=new Map,jb=30,Mb=150,Nb=1e4;function Pb(e,t){let n=`${e}|${t}`,r=Ab.get(n);if(r)return r.refcount+=1,r;let i=new Yn,a=new Ln({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()}),Ab.set(n,s),Ab.size>jb&&console.warn(`[Mirror] provider pool exceeded ${jb} entries (current=${Ab.size}). Many Mirrors pointing at distinct source docs — investigate if this is a runaway pattern.`),s}function Fb(e,t){let n=`${e}|${t}`,r=Ab.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})}Ab.delete(n)}}function Ib(e,t){let n=(0,$.c)(8),{collabUrl:r}=op(),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={kind:`loading`},n[0]=i):i=n[0];let[a,o]=(0,Q.useState)(i),s=(0,Q.useRef)(t),c=(0,Q.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=Pb(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=Db().parseToMdast(r)}catch(t){console.warn(`[Mirror] parseToMdast failed`,{src:e,anchor:n,err:t}),o({kind:`source-removed`});return}let a=Ob(i,n);if(!a){o({kind:`anchor-not-found`});return}let c;try{c=kb(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()},Mb)},onSynced:()=>{i&&=(clearTimeout(i),null),n()}};t.subscribers.add(a),c.current=n;let l=setTimeout(()=>{t.synced||o({kind:`source-removed`})},Nb);return n(),()=>{clearTimeout(l),i&&clearTimeout(i),t.subscribers.delete(a),c.current=null,Fb(r,e)}},u=[r,e],n[1]=r,n[2]=e,n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,Q.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,Q.useEffect)(d,f),a}function Lb(e){let t=(0,$.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,Z.jsx)(mo,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}):(0,Z.jsx)(go,{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,Z.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,Z.jsxs)(`div`,{className:n,children:[r,i]}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rb(e){let t=(0,$.c)(30),n=e.src??``,r=e.anchor??``,i=Ib(n,r);if(i.kind===`empty-props`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Lb,{tone:`placeholder`,children:(0,Z.jsx)(o,{id:`3SDfZl`,components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`code`,{}),2:(0,Z.jsx)(`code`,{}),3:(0,Z.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,Z.jsx)(`code`,{})},t[3]=a):a=t[3];let s;return t[4]===i?s=t[5]:(s=(0,Z.jsx)(Lb,{tone:`placeholder`,children:(0,Z.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,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`code`,{})},t[8]=r):r=t[8];let i;return t[9]===e?i=t[10]:(i=(0,Z.jsx)(Lb,{tone:`error`,children:(0,Z.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,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`code`,{}),2:(0,Z.jsx)(`code`,{})},t[14]=a):a=t[14];let s;return t[15]===i?s=t[16]:(s=(0,Z.jsx)(Lb,{tone:`error`,children:(0,Z.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,Z.jsx)(cn,{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,Z.jsx)(`code`,{className:`font-mono`})},t[20]=c):c=t[20];let l;t[21]===s?l=t[22]:(l=(0,Z.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,Z.jsx)(`span`,{children:(0,Z.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,Z.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,Z.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 zb(e){let t=(0,$.c)(15),{_:n}=s(),r=e.id??``,i;t[0]!==n||t[1]!==r?(i=r||n({id:`12F9WL`}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a=i,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(ln,{className:`size-3`,"aria-hidden":`true`}),t[3]=c):c=t[3];let l;t[4]===a?l=t[5]:(l={label:a},t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={0:(0,Z.jsx)(`code`,{className:`font-mono`})},t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,Z.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,Z.jsx)(`span`,{children:(0,Z.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,Z.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,Z.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 Bb=24,Vb=24,Hb=12,Ub=.1;function Wb(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(Ub,(n-Bb)/t.naturalWidth);case`fit-height`:return Math.max(Ub,(r-Vb)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(Ub,((n-Bb)/2-Hb)/t.naturalWidth)}}var Gb=600,Kb=.5,qb=3,Jb=.25,Yb=null;function Xb(){return Yb||(Yb=(async()=>{let e=await n(()=>import(`./pdf-PfDliStv.js`),__vite__mapDeps([24,1]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-rrxcKZlR.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),Yb.catch(()=>{Yb=null})),Yb}function Zb(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function Qb(e){let t=(0,$.c)(96),n,r;if(t[0]!==e.anchor||t[1]!==e.fillContainer){let{height:i,viewerFragment:a}=je(e.anchor);n=i===null?e.fillContainer?`100%`:`${Gb}px`:`${i}px`,r=ix(a),t[0]=e.anchor,t[1]=e.fillContainer,t[2]=n,t[3]=r}else n=t[2],r=t[3];let i=r,a=(0,Q.useRef)(null),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,Q.useRef)(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[5]=u):u=t[5];let d=(0,Q.useRef)(u),f=(0,Q.useRef)(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[6]=p):p=t[6];let[m,h]=(0,Q.useState)(p),[g,_]=(0,Q.useState)(!0),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(i??1),[S,C]=(0,Q.useState)(String(i??1)),[w,T]=(0,Q.useState)(1),[E,D]=(0,Q.useState)(`fit-width`),[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(0),[P,F]=(0,Q.useState)(0),{_:I}=s(),L=m.length,R,z;t[7]!==I||t[8]!==e.src?(R=()=>{if(!e.src){_(!1);return}let t=Pt(e.src),n=!1,r=null;return _(!0),y(null),(async()=>{try{let e=await(await Xb()).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}},z=[e.src,I],t[7]=I,t[8]=e.src,t[9]=R,t[10]=z):(R=t[9],z=t[10]),(0,Q.useEffect)(R,z);let B,V;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{let e=a.current;if(!e)return;let t=()=>{N(e.clientWidth),F(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},V=[],t[11]=B,t[12]=V):(B=t[11],V=t[12]),(0,Q.useEffect)(B,V);let ee,H;t[13]!==I||t[14]!==P||t[15]!==M||t[16]!==E||t[17]!==m||t[18]!==w?(ee=()=>{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=Wb(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||Zb(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]=ee,t[20]=H):(ee=t[19],H=t[20]),(0,Q.useEffect)(ee,H);let U,W;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;Zb(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},W=[O,m],t[21]=m,t[22]=O,t[23]=U,t[24]=W):(U=t[23],W=t[24]),(0,Q.useEffect)(U,W);let te,G;t[25]!==g||t[26]!==i?(te=()=>{if(g||!i)return;let e=a.current,t=l.current[i-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},G=[g,i],t[25]=g,t[26]=i,t[27]=te,t[28]=G):(te=t[27],G=t[28]),(0,Q.useEffect)(te,G);let ne,K;t[29]===m?(ne=t[30],K=t[31]):(ne=()=>{let e=a.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)},K=[m],t[29]=m,t[30]=ne,t[31]=K),(0,Q.useEffect)(ne,K);let re,ie;t[32]===A?(re=t[33],ie=t[34]):(re=()=>{if(!A)return;let e=e=>{let t=e.target,n=a.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)},ie=[A],t[32]=A,t[33]=re,t[34]=ie),(0,Q.useEffect)(re,ie);let ae;t[35]===L?ae=t[36]:(ae=e=>{let t=Math.max(1,Math.min(L||1,e));x(t),C(String(t));let n=a.current,r=l.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[35]=L,t[36]=ae);let oe=ae,q;t[37]!==b||t[38]!==oe||t[39]!==S?(q=()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)){C(String(b));return}oe(e)},t[37]=b,t[38]=oe,t[39]=S,t[40]=q):q=t[40];let se=q,ce;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>T(nx),t[41]=ce):ce=t[41];let le=ce,ue;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>T(tx),t[42]=ue):ue=t[42];let de=ue,fe;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{D(e),j(!1),T(1)},t[43]=fe):fe=t[43];let pe=fe,me;t[44]===n?me=t[45]:(me={height:n},t[44]=n,t[45]=me);let he;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(he=()=>k(ex),t[46]=he):he=t[46];let ge;t[47]!==I||t[48]!==O?(ge=I(O?{id:`JK-Ave`}:{id:`iEYxO4`}),t[47]=I,t[48]=O,t[49]=ge):ge=t[49];let _e;t[50]===I?_e=t[51]:(_e=I({id:`zo3Dl7`}),t[50]=I,t[51]=_e);let ve;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(Co,{size:14,"aria-hidden":`true`}),t[52]=ve):ve=t[52];let ye;t[53]!==O||t[54]!==ge||t[55]!==_e?(ye=(0,Z.jsx)(`button`,{type:`button`,onClick:he,"aria-label":ge,"aria-pressed":O,className:`ok-pdf-btn`,title:_e,children:ve}),t[53]=O,t[54]=ge,t[55]=_e,t[56]=ye):ye=t[56];let be=e.title??`PDF`,xe;t[57]===be?xe=t[58]:(xe=(0,Z.jsx)(`span`,{className:`ok-pdf-title`,children:be}),t[57]=be,t[58]=xe);let Se;t[59]!==I||t[60]!==A||t[61]!==E||t[62]!==S||t[63]!==se||t[64]!==L||t[65]!==w?(Se=L>0&&(0,Z.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,Z.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),se()},children:(0,Z.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:se,"aria-label":I({id:`xsZhu-`})})}),(0,Z.jsx)(`span`,{className:`ok-pdf-page-of`,children:(0,Z.jsx)(o,{id:`1GhYxC`,values:{totalPages:L}})}),(0,Z.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,Z.jsx)(`button`,{type:`button`,onClick:de,disabled:w<=Kb,"aria-label":I({id:`FjkaiT`}),className:`ok-pdf-btn`,title:I({id:`FjkaiT`}),children:(0,Z.jsx)(Uo,{size:14,"aria-hidden":`true`})}),(0,Z.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(w*100),`%`]}),(0,Z.jsx)(`button`,{type:`button`,onClick:le,disabled:w>=qb,"aria-label":I({id:`AWOSPo`}),className:`ok-pdf-btn`,title:I({id:`AWOSPo`}),children:(0,Z.jsx)(Ho,{size:14,"aria-hidden":`true`})}),(0,Z.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>j($b),"aria-label":I({id:`GQDSBN`}),"aria-haspopup":`menu`,"aria-expanded":A,className:`ok-pdf-btn`,title:I({id:`rdU729`}),children:(0,Z.jsx)(Qt,{size:14,"aria-hidden":`true`})}),A&&(0,Z.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,Z.jsx)(rx,{label:I({id:`vIxrEk`}),active:E===`fit-width`,onSelect:()=>pe(`fit-width`)}),(0,Z.jsx)(rx,{label:I({id:`YlDuro`}),active:E===`fit-height`,onSelect:()=>pe(`fit-height`)}),(0,Z.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,Z.jsx)(rx,{label:I({id:`BGHHtQ`}),active:E===`single`,onSelect:()=>pe(`single`)}),(0,Z.jsx)(rx,{label:I({id:`xK291b`}),active:E===`two-odd`,onSelect:()=>pe(`two-odd`)}),(0,Z.jsx)(rx,{label:I({id:`NSnIUP`}),active:E===`two-even`,onSelect:()=>pe(`two-even`)})]})]})]}),t[59]=I,t[60]=A,t[61]=E,t[62]=S,t[63]=se,t[64]=L,t[65]=w,t[66]=Se):Se=t[66];let Ce;t[67]!==ye||t[68]!==xe||t[69]!==Se?(Ce=(0,Z.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[ye,xe,Se]}),t[67]=ye,t[68]=xe,t[69]=Se,t[70]=Ce):Ce=t[70];let we;t[71]!==I||t[72]!==b||t[73]!==oe||t[74]!==m||t[75]!==O?(we=O&&(0,Z.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":I({id:`nzaV6Q`}),children:m.map((e,t)=>{let{pageNumber:n}=e;return(0,Z.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":b===n||void 0,onClick:()=>oe(n),"aria-label":I({id:`qioCwA`,values:{pageNumber:n}}),children:[(0,Z.jsx)(`canvas`,{ref:e=>{d.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,Z.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:n})]},n)})}),t[71]=I,t[72]=b,t[73]=oe,t[74]=m,t[75]=O,t[76]=we):we=t[76];let Te;t[77]===g?Te=t[78]:(Te=g&&(0,Z.jsx)(`div`,{className:`ok-pdf-loading`,children:(0,Z.jsx)(o,{id:`T-654M`})}),t[77]=g,t[78]=Te);let Ee;t[79]===v?Ee=t[80]:(Ee=v&&(0,Z.jsx)(`div`,{className:`ok-pdf-error`,children:(0,Z.jsx)(o,{id:`WamGNs`,values:{error:v}})}),t[79]=v,t[80]=Ee);let De;t[81]!==I||t[82]!==L?(De=Array.from({length:L},(e,t)=>{let n=t+1;return(0,Z.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]=De):De=t[83];let Oe;t[84]!==E||t[85]!==Te||t[86]!==Ee||t[87]!==De?(Oe=(0,Z.jsxs)(`div`,{className:`ok-pdf-pages`,ref:a,"data-layout":E,children:[Te,Ee,De]}),t[84]=E,t[85]=Te,t[86]=Ee,t[87]=De,t[88]=Oe):Oe=t[88];let ke;t[89]!==we||t[90]!==Oe?(ke=(0,Z.jsxs)(`div`,{className:`ok-pdf-body`,children:[we,Oe]}),t[89]=we,t[90]=Oe,t[91]=ke):ke=t[91];let Ae;return t[92]!==me||t[93]!==Ce||t[94]!==ke?(Ae=(0,Z.jsxs)(`div`,{className:`ok-pdf`,style:me,children:[Ce,ke]}),t[92]=me,t[93]=Ce,t[94]=ke,t[95]=Ae):Ae=t[95],Ae}function $b(e){return!e}function ex(e){return!e}function tx(e){return Math.max(Kb,+(e-Jb).toFixed(2))}function nx(e){return Math.min(qb,+(e+Jb).toFixed(2))}function rx(e){let t=(0,$.c)(10),n=e.active||void 0,r;t[0]===e.active?r=t[1]:(r=e.active&&(0,Z.jsx)(Zt,{size:14}),t[0]=e.active,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,Z.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,Z.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 ix(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 ax(e){let t=(0,$.c)(10),{label:n,id:r,children:i}=e,a=(0,Q.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,Z.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 ox=`:scope > .component-children > [data-node-view-content-react] > .react-renderer`;function sx(e){return Array.from(e.querySelectorAll(ox)).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 cx(e,t){let n=Array.from(e.querySelectorAll(ox))[t];return n?n.querySelector(`[data-jsx-gear]`):null}function lx(e){let t=(0,$.c)(31),{id:n,children:r}=e,[i,a]=(0,Q.useState)(0),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],t[0]=o):o=t[0];let[c,l]=(0,Q.useState)(o),u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),f=(0,Q.useRef)(0),p=$v(),m=p?.addChild!=null,{_:h}=s(),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=u.current;if(!e)return;let t=sx(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,Q.useLayoutEffect)(g);let _,v;t[2]===c.length?(_=t[3],v=t[4]):(_=()=>{c.length>f.current&&c.length>0&&a(c.length-1),f.current=c.length},v=[c.length],t[2]=c.length,t[3]=_,t[4]=v),(0,Q.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){a(0);return}let t=u.current;if(!t)return;let r=sx(t).findIndex(t=>t.panelId===e);r<0||(a(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,Q.useLayoutEffect)(y);let b=c.length===0?0:Math.min(Math.max(i,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(),a(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;t[10]!==c||t[11]!==b?(w=c.map(e=>(0,Z.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:dx,onClick:()=>{if(e.index!==b){a(e.index);return}let t=u.current;t&&cx(t,e.index)?.click()},children:e.label},e.index)),t[10]=c,t[11]=b,t[12]=w):w=t[12];let T;t[13]!==S||t[14]!==C||t[15]!==w?(T=(0,Z.jsx)(`div`,{ref:d,role:`tablist`,"aria-label":C,className:`tabs-tablist`,onKeyDown:S,children:w}),t[13]=S,t[14]=C,t[15]=w,t[16]=T):T=t[16];let E;t[17]!==h||t[18]!==m||t[19]!==p?(E=m&&(0,Z.jsx)(`button`,{type:`button`,className:`tabs-strip-add`,"aria-label":h({id:`hjO0Mq`}),title:h({id:`hjO0Mq`}),onMouseDown:ux,onClick:()=>p?.addChild?.(),"data-tabs-strip-add":``,children:`+`}),t[17]=h,t[18]=m,t[19]=p,t[20]=E):E=t[20];let D;t[21]!==E||t[22]!==T?(D=(0,Z.jsxs)(`div`,{className:`tabs-strip`,contentEditable:!1,children:[T,E]}),t[21]=E,t[22]=T,t[23]=D):D=t[23];let O;t[24]!==r||t[25]!==b?(O=(0,Z.jsx)(`div`,{ref:u,className:`tabs-content`,"data-active-index":b,children:r}),t[24]=r,t[25]=b,t[26]=O):O=t[26];let k;return t[27]!==n||t[28]!==D||t[29]!==O?(k=(0,Z.jsxs)(`div`,{className:`tabs`,id:n,children:[D,O]}),t[27]=n,t[28]=D,t[29]=O,t[30]=k):k=t[30],k}function ux(e){return e.preventDefault()}function dx(e){return e.preventDefault()}var fx=typeof global<`u`&&{}.toString.call(global)===`[object global]`,px=typeof Bun<`u`,mx=typeof Deno<`u`,hx=typeof WebSocketPair==`function`&&caches?.default!==void 0,gx=fx||px||mx||hx;function _x(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function vx(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function yx(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function bx(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function xx(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function Sx(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 Cx(){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(yx(r))return`https://vimeo.com/${r}`;if(bx(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}var wx=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 Tx(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 Ex=Array.prototype.indexOf!==void 0,Dx=typeof window<`u`&&window.postMessage!==void 0;if(!gx&&(!Ex||!Dx))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var Ox=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function kx(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:Ox);var Ax=kx(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,Ox,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})}),jx=new WeakMap;function Mx(e,t,n){let r=jx.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),jx.set(e.element,r)}function Nx(e,t){return(jx.get(e.element)||{})[t]||[]}function Px(e,t,n){let r=jx.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],jx.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),jx.set(e.element,r),r[t]&&r[t].length===0}function Fx(e,t){let n=Nx(e,t);if(n.length<1)return!1;let r=n.shift();return Px(e,t,r),r}function Ix(e,t){let n=jx.get(e);jx.set(t,n),jx.delete(e)}function Lx(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function Rx(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 zx(e,t){t=Lx(t);let n=[],r;if(t.event)t.event===`error`&&Nx(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),Px(e,t.data.method,n)}),n=Nx(e,`event:${t.event}`),r=t.data;else if(t.method){let i=Fx(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 Bx=`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 Vx(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Bx.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function Hx(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 Ux(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(!bx(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${Sx(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){Hx(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 Wx(){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=Vx(e);Ux(Cx(t),t,e).then(t=>Hx(t,e)).catch(n)}catch(e){n(e)}})}function Gx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!bx(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?Tx(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function Kx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!bx(t.origin))return;let n=Lx(t.data);if(!n||n.event!==`ready`)return;let r=t.source?Tx(t.source,e):null;r&&xx(r.src)&&new tS(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function qx(){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(!bx(n.origin))return;let r=Lx(n.data);if(!r||r.event!==`ready`)return;let i=n.source?Tx(n.source,e):null;if(i&&xx(i.src)){let e=new tS(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 Jx(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!bx(e.origin))return;let t=Lx(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?Tx(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 Yx(){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 Xx={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},Zx=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,{...Xx,...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=wx(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=wx(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()})}},Qx=new WeakMap,$x=new WeakMap,eS={},tS=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)),!vx(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`&&!bx(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if(Qx.has(e))return Qx.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new Ax((n,r)=>{if(this._onMessage=e=>{if(!bx(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=Lx(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}zx(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=Vx(e,t);Ux(Cx(n),n,e).then(t=>{let n=Hx(t,e);return this.element=n,this._originalElement=e,Ix(e,n),Qx.set(this.element,this),t}).catch(r)}});if($x.set(this,n),Qx.set(this.element,this),this.element.nodeName===`IFRAME`&&Rx(this,`ping`),eS.isEnabled){let e=()=>eS.exit();this.fullscreenchangeHandler=()=>{eS.isFullscreen?Mx(this,`event:exitFullscreen`,e):Px(this,`event:exitFullscreen`,e),this.ready().then(()=>{Rx(this,`fullscreenchange`,eS.isFullscreen)})},eS.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return bx(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new Ax((n,r)=>this.ready().then(()=>{Mx(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),Rx(this,e,t)}).catch(r))}get(e){return new Ax((t,n)=>(e=_x(e,`get`),this.ready().then(()=>{Mx(this,e,{resolve:t,reject:n}),Rx(this,e)}).catch(n)))}set(e,t){return new Ax((n,r)=>{if(e=_x(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{Mx(this,e,{resolve:n,reject:r}),Rx(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.`);Nx(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),Mx(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.`);Px(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=$x.get(this)||new Ax((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return Ax.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 eS.isEnabled?eS.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return eS.isEnabled?eS.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return eS.isEnabled?Ax.resolve(eS.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 Ax(e=>{if($x.delete(this),Qx.delete(this.element),this._originalElement&&(Qx.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),eS.isEnabled&&eS.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 Ax.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 Ax((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new Ax(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 Ax.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 Zx(this,e,t);return Rx(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>Rx(this,`notifyTimingObjectDisconnect`)),n}};gx||(eS=Yx(),Wx(),Gx(),Kx(),qx(),Jx());function nS(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rS(e,t)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rS(e,t)}var iS={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`},aS=function(e){function t(t){var n=e.call(this,t)||this;return n.refContainer=n.refContainer.bind(n),n}nS(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 tS(this.container,this.getInitialOptions()),Object.keys(iS).forEach(function(t){var n=iS[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 Q.createElement(`div`,{id:t,className:n,style:r,ref:this.refContainer})},t}(Q.Component);aS.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 oS={default:120,mqdefault:320,hqdefault:480,sddefault:640,maxresdefault:1280},sS=(e,t,n,r=`maxresdefault`)=>{let[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{let i=`https://img.youtube.com/${t}/${e}/${r}.${n}`,o=`https://img.youtube.com/${t}/${e}/hqdefault.${n}`,s=oS[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 cS(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 lS(e,t){let[n,r]=Q.useState(!1),[i,a]=Q.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=Q.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=Q.useMemo(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`,[e.cookie]),m=Q.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?sS(e.id,_,g,l):null,y=Q.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=Q.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 Q.useEffect(()=>{i&&(D(),e.focusOnLoad&&typeof t==`object`&&t?.current&&t.current.focus())},[i,D,e.focusOnLoad,t]),Q.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,Z.jsxs)(Z.Fragment,{children:[!e.lazyLoad&&(0,Z.jsx)(`link`,{rel:O,href:y,as:`image`}),(0,Z.jsx)(Z.Fragment,{children:n&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`link`,{rel:`preconnect`,href:p}),(0,Z.jsx)(`link`,{rel:`preconnect`,href:`https://www.google.com`}),x&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`link`,{rel:`preconnect`,href:`https://static.doubleclick.net`}),(0,Z.jsx)(`link`,{rel:`preconnect`,href:`https://googleads.g.doubleclick.net`})]})]})}),e.seo&&!e.playlist&&(0,Z.jsx)(`script`,{type:`application/ld+json`,dangerouslySetInnerHTML:{__html:cS(e.id,c,y,p,e.seo)}}),A&&!e.playlist&&(0,Z.jsx)(`noscript`,{children:(0,Z.jsxs)(`a`,{href:`https://www.youtube.com/watch?v=${e.id}`,"aria-label":`Watch ${c} on YouTube`,children:[`Watch "`,c,`" on YouTube`]})}),(0,Z.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,Z.jsx)(`img`,{src:y,alt:`${c} - YouTube thumbnail`,className:`lty-thumbnail`,loading:`lazy`}),e.playlist&&!i&&(0,Z.jsx)(`div`,{className:`lty-playlist-icon`,"aria-hidden":`true`}),!(e.hideButtonOnActivate&&i)&&(0,Z.jsx)(`button`,{type:`button`,className:T,"aria-label":`${u} ${c}`,"aria-hidden":i||void 0,tabIndex:i?-1:0,onClick:M,children:(0,Z.jsx)(`span`,{className:`lty-visually-hidden`,children:u})}),i&&(0,Z.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 uS=Q.forwardRef(lS);function dS(e){return e!==!1}function fS(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 pS(e){if(e.width!==void 0)return{width:e.width}}function mS(e){if(!(e.width===void 0||e.height===void 0))return{aspectRatio:`${e.width} / ${e.height}`}}function hS(e){let t=(0,$.c)(23),n=(0,Q.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,Q.useEffect)(o,s);let c;t[5]===e?c=t[6]:(c=pS(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,Z.jsx)(aS,{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,Z.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 gS(e){let t=(0,$.c)(17),n;t[0]===e.src?n=t[1]:(n=mt(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=pS(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,Z.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,Z.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 _S(e){let t=(0,$.c)(29);if(e.src!==void 0&&_e(e.src)){let n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(gS,{...e,src:e.src}),t[0]=e,t[1]=n),n}if(e.src!==void 0&&ye(e.src)){let n;return t[2]===e?n=t[3]:(n=(0,Z.jsx)(hS,{...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:Fe(e.src);if(r!==null){let i=e.autoplay===!0&&e.muted===!0,a=e.width!==void 0&&e.height!==void 0,o=pS(e),s;t[6]===e.poster?s=t[7]:(s=e.poster===void 0?void 0:Pt(e.poster),t[6]=e.poster,t[7]=s);let c=(0,Z.jsx)(uS,{id:r.id,title:e.title??`YouTube video player`,cookie:!r.noCookie,params:fS(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:mS(e)}),l;t[8]!==o||t[9]!==c?(l=(0,Z.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:Pt(e.src),t[11]=e.src,t[12]=r);let i=e.title,a;t[13]===e.controls?a=t[14]:(a=dS(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:Pt(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,Z.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 vS(e){let t=(0,$.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,Z.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var yS={Callout:Xv,img:Ky,video:_S,audio:Gv,Pdf:Qb,File:ly,Embed:sy,Accordion:Uv,Tabs:lx,Tab:ax,Math:Yy,MermaidFence:xb,Mirror:Rb,MirrorSource:zb,"*":vS};function bS(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var xS=Ae(),SS=new Map;function CS(e){if(e.surface===`compat`){let t=yS[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:bS(e.props)}}let t=yS[e.name];return t?{Component:t,reactNodePropNames:bS(e.props)}:null}for(let[e,t]of xS.entries()){let n=CS(t);n&&SS.set(e,n)}function wS(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function TS(e){let t=xS.getOrWildcard(e),n=SS.get(t.name)??SS.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return wS(t,n)}function ES(){let e=[];for(let[t,n]of xS.entries()){if(t===`*`)continue;let r=SS.get(t);r&&e.push(wS(n,r))}return e}var DS=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,OS=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,kS={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:DS,alt:`Sample image`}},video:{description:{id:`e1hptq`},props:{controls:!0,poster:OS}},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,Z.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.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,Z.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-full rounded-sm bg-muted-foreground/20`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-5/6 rounded-sm bg-muted-foreground/20`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]})]})},Pdf:{description:{id:`Fqr8BP`},render:()=>(0,Z.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-muted/40 px-1.5 py-1`,children:[(0,Z.jsxs)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 text-muted-foreground`,"aria-hidden":`true`,children:[(0,Z.jsx)(`title`,{children:`Thumbnails`}),(0,Z.jsx)(`rect`,{x:`1`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,Z.jsx)(`rect`,{x:`7`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,Z.jsx)(`rect`,{x:`1`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,Z.jsx)(`rect`,{x:`7`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`})]}),(0,Z.jsxs)(`span`,{className:`ml-1 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5 font-mono`,children:`2`}),(0,Z.jsx)(`span`,{children:`/ 12`})]}),(0,Z.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] font-mono text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`−`}),(0,Z.jsx)(`span`,{children:`100%`}),(0,Z.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`+`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1 gap-1 p-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex w-6 flex-col gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`}),(0,Z.jsx)(`span`,{className:`h-3 rounded-sm border border-foreground/60 bg-background`}),(0,Z.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1 rounded-sm bg-background p-1.5`,children:[(0,Z.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-sm bg-foreground/50`}),(0,Z.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1 w-5/6 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1 w-2/3 rounded-sm bg-muted-foreground/30`})]})]})]})},MermaidFence:{description:{id:`z0a2EA`},render:()=>(0,Z.jsxs)(`svg`,{viewBox:`0 0 200 120`,className:`h-full w-full text-foreground`,"aria-hidden":`true`,preserveAspectRatio:`xMidYMid meet`,children:[(0,Z.jsx)(`title`,{children:`Mermaid flowchart preview`}),(0,Z.jsx)(`defs`,{children:(0,Z.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,Z.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),(0,Z.jsx)(`rect`,{x:`14`,y:`20`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,Z.jsx)(`text`,{x:`42`,y:`38`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Start`}),(0,Z.jsx)(`polygon`,{points:`100,18 140,50 100,82 60,50`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,Z.jsx)(`text`,{x:`100`,y:`54`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Ready?`}),(0,Z.jsx)(`rect`,{x:`130`,y:`84`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,Z.jsx)(`text`,{x:`158`,y:`102`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`End`}),(0,Z.jsx)(`line`,{x1:`70`,y1:`34`,x2:`80`,y2:`40`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,Z.jsx)(`line`,{x1:`124`,y1:`62`,x2:`138`,y2:`82`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,Z.jsx)(`text`,{x:`138`,y:`74`,fontSize:`8`,fill:`currentColor`,opacity:`0.6`,children:`yes`})]})},Tabs:{description:{id:`75Y1dk`},render:()=>(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex gap-1 border-b border-border pb-1`,children:[(0,Z.jsx)(`span`,{className:`rounded-md bg-foreground/10 px-2 py-0.5 text-xs font-medium text-foreground`,children:`Tab 1`}),(0,Z.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs text-muted-foreground`,children:`Tab 2`})]}),(0,Z.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:(0,Z.jsx)(o,{id:`m6YGpY`})})]})},Mirror:{description:{id:`_WPP7e`},render:()=>(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/40 px-2 py-1.5`,children:[(0,Z.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,Z.jsx)(Xa,{className:`size-2.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(o,{id:`EL_YRd`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}),(0,Z.jsx)(`span`,{className:`block h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`mt-1 block h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]}),(0,Z.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,Z.jsx)(o,{id:`qNOgUu`})})]})},MirrorSource:{description:{id:`epuNYK`},render:()=>(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/50 px-2 py-1.5`,children:[(0,Z.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,Z.jsx)(ln,{className:`size-2.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(o,{id:`maDWIB`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}),(0,Z.jsx)(`span`,{className:`block h-1.5 w-4/5 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`mt-1 block h-1.5 w-3/5 rounded-sm bg-muted-foreground/20`})]}),(0,Z.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,Z.jsx)(o,{id:`emgiet`})})]})}};function AS(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 jS(e){let t=TS(e),n=AS(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var MS=new Set;function NS(e){MS.add(e)}function PS(e){if(typeof e==`number`)return MS.delete(e);let t=MS.values().next();return t.done?!1:(MS.delete(t.value),!0)}function FS(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(NS(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren&&e.commands.setTextSelection(t+2)}function IS(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=jS(e.name);if(e.name===`Tabs`){let e=jS(`Tab`),t=jS(`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)&&FS(t,i,e)}}var LS=new Set([`File`,`Tab`]);function RS(){return[{name:`component-File`,label:_i._({id:`J2eKUI`}),icon:to,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",command:BS,preview:{description:_i._({id:`t-JXbf`}),render:()=>(0,Z.jsxs)(`div`,{className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5`,children:[(0,Z.jsx)(to,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:`quarterly-report.pdf`}),(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`1.4 MB`})]})}}]}function zS(){return[...ES().filter(e=>e.surface===`canonical`&&!LS.has(e.name)).map(e=>{let t=kS[e.name],n=e.Component,r=t?{description:_i._(t.description),render:t.render??(()=>(0,Z.jsx)(n,{...t.props,children:t.children}))}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:zv(e.icon),category:e.category??`content`,command:IS(e),aliases:e.searchTerms,description:e.description,preview:r}}),...RS()]}function BS(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;pv(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function VS(e,t){let n=vv.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 HS(){return[{name:`link`,label:_i._({id:`yzF66j`}),icon:go,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:_i._({id:`5WDhAk`}),render:()=>(0,Z.jsx)(`p`,{className:`leading-7 text-sm`,children:(0,Z.jsx)(o,{id:`u-9fWA`,components:{0:(0,Z.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=VS(e,t);n&&(gv(n),requestAnimationFrame(()=>{Lv(e).setActiveNode(n)}))}},{name:`component-Tag`,label:_i._({id:`UL8A9w`}),icon:ao,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",preview:{description:_i._({id:`5ClEAu`}),render:()=>(0,Z.jsx)(`p`,{className:`text-sm leading-7`,children:(0,Z.jsx)(o,{id:`KZLdgR`,components:{0:(0,Z.jsx)(`a`,{className:`tag pointer-events-none`})}})})},command:e=>{e.chain().insertTag(``).run()}}]}function US(e,t){e.chain().focus().insertContent({type:`codeBlock`,attrs:{language:`html`,meta:`preview`},content:[{type:`text`,text:t}]}).run()}var WS=`<div style="padding:20px;font-family:system-ui,sans-serif;color:var(--foreground)">
|
|
4
4
|
<h1 style="margin:0 0 8px;font-size:20px;font-weight:600">Hello, world!</h1>
|
|
5
5
|
<p style="margin:0;color:var(--muted-foreground)">Edit this HTML — the preview updates live.</p>
|