decaframe 0.1.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.
Files changed (145) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +55 -0
  3. package/dist/archetype.js +1 -0
  4. package/dist/blocks.css +2822 -0
  5. package/dist/blocks.js +6 -0
  6. package/dist/brand.js +1 -0
  7. package/dist/chart.js +3 -0
  8. package/dist/chartView.js +1 -0
  9. package/dist/cli.js +22 -0
  10. package/dist/colour.js +1 -0
  11. package/dist/commands.js +1 -0
  12. package/dist/design.js +1 -0
  13. package/dist/diagram.js +99 -0
  14. package/dist/diagramRender.js +1 -0
  15. package/dist/diagramTheme.js +1 -0
  16. package/dist/diagramView.js +1 -0
  17. package/dist/diagramZoom.js +2 -0
  18. package/dist/export/assets.js +1 -0
  19. package/dist/export/html.js +6 -0
  20. package/dist/export/spec.js +1 -0
  21. package/dist/export/viewer.js +1112 -0
  22. package/dist/extensions.js +1 -0
  23. package/dist/figure.js +1 -0
  24. package/dist/filename.js +1 -0
  25. package/dist/fit.js +6 -0
  26. package/dist/fitLoop.js +1 -0
  27. package/dist/furniture.js +1 -0
  28. package/dist/icons.js +1 -0
  29. package/dist/id.js +1 -0
  30. package/dist/index.js +1 -0
  31. package/dist/item.js +1 -0
  32. package/dist/layout.js +1 -0
  33. package/dist/lint.js +1 -0
  34. package/dist/markdown.js +32 -0
  35. package/dist/mcp/browser.js +81 -0
  36. package/dist/mcp/channel.js +7 -0
  37. package/dist/mcp/export.js +1 -0
  38. package/dist/mcp/exportCli.js +11 -0
  39. package/dist/mcp/fit.js +1 -0
  40. package/dist/mcp/open.js +1 -0
  41. package/dist/mcp/openCli.js +1 -0
  42. package/dist/mcp/read.js +1 -0
  43. package/dist/mcp/server.js +31 -0
  44. package/dist/mcp/session.js +2 -0
  45. package/dist/mcp/stdio.js +2 -0
  46. package/dist/media.js +1 -0
  47. package/dist/notes.js +1 -0
  48. package/dist/page.js +1 -0
  49. package/dist/placeholder.js +1 -0
  50. package/dist/present/constants.js +1 -0
  51. package/dist/prose.js +1 -0
  52. package/dist/registry.js +1 -0
  53. package/dist/sizePreview.js +1 -0
  54. package/dist/slotMarkdown.js +3 -0
  55. package/dist/table.js +2 -0
  56. package/dist/template/catalogue.json +1 -0
  57. package/dist/template/index.js +1 -0
  58. package/dist/template/look.js +1 -0
  59. package/dist/text.js +8 -0
  60. package/dist/theme/atelier.json +1 -0
  61. package/dist/theme/aurora.json +1 -0
  62. package/dist/theme/boardroom.json +1 -0
  63. package/dist/theme/decaframe.json +1 -0
  64. package/dist/theme/editorial.json +1 -0
  65. package/dist/theme/emit.js +19 -0
  66. package/dist/theme/fonts.js +1 -0
  67. package/dist/theme/foundry.json +1 -0
  68. package/dist/theme/index.js +1 -0
  69. package/dist/theme/meadow.json +1 -0
  70. package/dist/theme/signal.json +1 -0
  71. package/dist/theme/tokens.json +1 -0
  72. package/dist/videoPlay.js +1 -0
  73. package/editor/assets/App-BvOGZ4cc.js +56 -0
  74. package/editor/assets/PresenterView-Barr5wsl.js +1 -0
  75. package/editor/assets/Shell-Dvc8Yvly.js +413 -0
  76. package/editor/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  77. package/editor/assets/abnfDiagram-N423BO3Z-DMNuYXhv.js +1 -0
  78. package/editor/assets/arc-DOR9Dhm9.js +1 -0
  79. package/editor/assets/architectureDiagram-T3A2C74G-CpcCHDGw.js +36 -0
  80. package/editor/assets/blockDiagram-VBNYF7ZC-CbCqcHim.js +132 -0
  81. package/editor/assets/c4Diagram-5PPSVZJV-DouVYESX.js +10 -0
  82. package/editor/assets/channel-Dt7MgGxB.js +1 -0
  83. package/editor/assets/chunk-2GRJ4B5K-DCJz-Q3N.js +1 -0
  84. package/editor/assets/chunk-2Q5K7J3B-D5q9RvV7.js +1 -0
  85. package/editor/assets/chunk-5RXB4S5H-DnaXL-Vg.js +231 -0
  86. package/editor/assets/chunk-5VM5RSS4-Dsc890tp.js +15 -0
  87. package/editor/assets/chunk-6Q2QTUOP-B5F620Er.js +88 -0
  88. package/editor/assets/chunk-GF5L2VYU-D6F2cocl.js +206 -0
  89. package/editor/assets/chunk-JWPE2WC7-bRknM2iE.js +1 -0
  90. package/editor/assets/chunk-KBJHAD2P-DOPClpqF.js +1 -0
  91. package/editor/assets/chunk-RYQCIY6F-CvMFFqLU.js +1 -0
  92. package/editor/assets/chunk-XXDRQBXY-1qxA3khf.js +1 -0
  93. package/editor/assets/classDiagram-JCYQIIEL-DCQKoo1F.js +1 -0
  94. package/editor/assets/classDiagram-v2-OCEON4UE-DCQKoo1F.js +1 -0
  95. package/editor/assets/cose-bilkent-JH36ORCC-ClwDXN93.js +1 -0
  96. package/editor/assets/cynefin-VYW2F7L2-D_3oIqit.js +178 -0
  97. package/editor/assets/cynefinDiagram-MW4NZA55-5VKykgH3.js +62 -0
  98. package/editor/assets/cytoscape.esm-BjAbmLdb.js +331 -0
  99. package/editor/assets/dagre-VZM6K2ZE-DcheWwdS.js +4 -0
  100. package/editor/assets/defaultLocale-DX6XiGOO.js +1 -0
  101. package/editor/assets/diagram-7IWD3JNH-BKU8hufg.js +30 -0
  102. package/editor/assets/diagram-B4RE2ZJO-C6NwNXMM.js +3 -0
  103. package/editor/assets/diagram-LBJQPF4R-D5l8kaaB.js +24 -0
  104. package/editor/assets/diagram-Q27KOJAE-B839mp_E.js +24 -0
  105. package/editor/assets/diagram-UB23O5K3-BEJ8nrHN.js +41 -0
  106. package/editor/assets/ebnfDiagram-BXEA7PRR-Clexv7zP.js +1 -0
  107. package/editor/assets/erDiagram-JOGREHBK-CQiS9gcI.js +85 -0
  108. package/editor/assets/flowDiagram-UKHOOZJN-CKnVd1JX.js +156 -0
  109. package/editor/assets/ganttDiagram-PKOTCBZU-B2_YsT7P.js +292 -0
  110. package/editor/assets/gitGraphDiagram-DS77QQ5N-woKMsCpe.js +106 -0
  111. package/editor/assets/graph-C9eacEi8.js +1 -0
  112. package/editor/assets/index-CBRsrwap.css +1 -0
  113. package/editor/assets/index-CnMC8Z9d.js +9167 -0
  114. package/editor/assets/index-CzJ1nSGZ.js +61 -0
  115. package/editor/assets/infoDiagram-6WML65LV-DQBHUzYs.js +2 -0
  116. package/editor/assets/init-Gi6I4Gst.js +1 -0
  117. package/editor/assets/ishikawaDiagram-WSZJBQD7-B0ECJjey.js +70 -0
  118. package/editor/assets/journeyDiagram-NVQOT4AX-C6IoE7ds.js +139 -0
  119. package/editor/assets/kanban-definition-27J2QSJJ-BsRx6-QA.js +89 -0
  120. package/editor/assets/katex-C5jXJg4s.js +257 -0
  121. package/editor/assets/layout-DEXfKzaS.js +1 -0
  122. package/editor/assets/linear-CZdkbpsZ.js +1 -0
  123. package/editor/assets/map-Czzmt4hB.js +1 -0
  124. package/editor/assets/mermaid.core-BD7SxJD7.js +314 -0
  125. package/editor/assets/mindmap-definition-FAOFIHXS-zQTmawZC.js +96 -0
  126. package/editor/assets/ordinal-Cboi1Yqb.js +1 -0
  127. package/editor/assets/pegDiagram-VL7TDLO6-DwfoSDjb.js +1 -0
  128. package/editor/assets/pieDiagram-7S7Q4E2Y-CFju-NFP.js +39 -0
  129. package/editor/assets/quadrantDiagram-CIZ2JOQS-BD6kYPyE.js +7 -0
  130. package/editor/assets/railroadDiagram-AXF67PYL-RqQwm-lL.js +1 -0
  131. package/editor/assets/requirementDiagram-LRYGKXZP-piqHrBVs.js +84 -0
  132. package/editor/assets/sankeyDiagram-W5VNT64P-CiALLT6P.js +40 -0
  133. package/editor/assets/sequenceDiagram-SI44F4Z6-CjpaYPxa.js +162 -0
  134. package/editor/assets/sizeCapture-X5ZJPWSS-DG9i3uEZ.js +1 -0
  135. package/editor/assets/stateDiagram-OKZ733FA-BgfrUiLR.js +1 -0
  136. package/editor/assets/stateDiagram-v2-UEYNNEHI-OBUiw3fk.js +1 -0
  137. package/editor/assets/swimlanes-SLNWSIFB-edAhP15G.js +2 -0
  138. package/editor/assets/swimlanesDiagram-ULZ7WXOC-BvcKTcG0.js +8 -0
  139. package/editor/assets/timeline-definition-Z64GVDOM-CLCag48V.js +120 -0
  140. package/editor/assets/vennDiagram-T6HMQDX7-CNuGpJHG.js +34 -0
  141. package/editor/assets/wardleyDiagram-T6FBY63Y-D-NVpbtn.js +78 -0
  142. package/editor/assets/xychartDiagram-ELKLHX3M-CmO8305Y.js +7 -0
  143. package/editor/favicon.ico +0 -0
  144. package/editor/index.html +15 -0
  145. package/package.json +61 -0
@@ -0,0 +1,413 @@
1
+ var Qu=Object.defineProperty;var Ju=(e,t,n)=>t in e?Qu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ie=(e,t,n)=>Ju(e,typeof t!="symbol"?t+"":t,n);import{bf as ed,a9 as td,bg as Kr,bh as nd,aj as od,j as k,ar as Qe,al as Xr,bi as rd,af as Pe,bj as Ra,bk as sd,bl as id,bm as Ea,bn as si,aT as ad,aU as cd,bo as ld,bp as ud,bq as dd,br as Ca,as as Wn,bb as fd,bs as pd,bt as Ta,bu as Ma,bv as hd,bw as gd,bx as md,by as Pa,bz as Oa,bA as Ia,bB as bd,bC as Zr,bD as yd,bE as xd,b2 as vd,bF as wd,bG as kd,bH as Sd,bI as Rd,t as Qr,bJ as Aa,bK as Ed,b6 as $a,bL as Cd,bM as Td,bN as Md,aW as Pd,bO as Od,bP as Na,bQ as Id,bR as Ad,bS as $d,bT as Nd,bU as Dd,bV as Ld,bW as Da,ap as ii,aS as jd,bX as La,bY as Fd,bZ as _d,au as Bd,b_ as zd,ao as ai,b$ as Hd,c0 as ci,c1 as Vd,c2 as Wd,c3 as Gd,c4 as qd}from"./index-CnMC8Z9d.js";import{g as ja}from"./_commonjsHelpers-CqkleIqs.js";function Ud(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(o,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Yd="0 0 80 45",Kd="M5 0H75A5 5 0 0 1 80 5V40A5 5 0 0 1 75 45H5A5 5 0 0 1 0 40V5A5 5 0 0 1 5 0ZM11 12.5H51V20.5H11Z",Fw=()=>[td.configure({blockquote:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,link:!1,strike:!1,underline:!1}),ed],Xd=2600,Zd=["ArrowRight","PageDown"," ","Enter","n","j"],Qd=["ArrowLeft","PageUp","Backspace","p","k"];var d=Kr();const jt=ja(d),Jd=Ud({__proto__:null,default:jt},[d]);var pt=nd();const ef=ja(pt);var ur={exports:{}},dr={};/**
2
+ * @license React
3
+ * use-sync-external-store-shim.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var li;function tf(){if(li)return dr;li=1;var e=Kr();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var g=p(),h=o({inst:{value:g,getSnapshot:p}}),w=h[0].inst,m=h[1];return s(function(){w.value=g,w.getSnapshot=p,c(w)&&m({inst:w})},[f,g,p]),r(function(){return c(w)&&m({inst:w}),f(function(){c(w)&&m({inst:w})})},[f]),i(g),g}function c(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return dr.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,dr}var ui;function Fa(){return ui||(ui=1,ur.exports=tf()),ur.exports}var _o=Fa();const{getOwnPropertyNames:nf,getOwnPropertySymbols:of}=Object,{hasOwnProperty:rf}=Object.prototype;function fr(e,t){return function(o,r,s){return e(o,r,s)&&t(o,r,s)}}function eo(e){return function(n,o,r){if(!n||!o||typeof n!="object"||typeof o!="object")return e(n,o,r);const{cache:s}=r,i=s.get(n),a=s.get(o);if(i&&a)return i===o&&a===n;s.set(n,o),s.set(o,n);const c=e(n,o,r);return s.delete(n),s.delete(o),c}}function sf(e){return e!=null?e[Symbol.toStringTag]:void 0}function di(e){return nf(e).concat(of(e))}const af=Object.hasOwn||((e,t)=>rf.call(e,t));function tn(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const cf="__v",lf="__o",uf="_owner",{getOwnPropertyDescriptor:fi,keys:pi}=Object;function df(e,t){return e.byteLength===t.byteLength&&vo(new Uint8Array(e),new Uint8Array(t))}function ff(e,t,n){let o=e.length;if(t.length!==o)return!1;for(;o-- >0;)if(!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function pf(e,t){return e.byteLength===t.byteLength&&vo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function hf(e,t){return tn(e.getTime(),t.getTime())}function gf(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function mf(e,t){return e===t}function hi(e,t,n){const o=e.size;if(o!==t.size)return!1;if(!o)return!0;const r=new Array(o),s=e.entries();let i,a,c=0;for(;(i=s.next())&&!i.done;){const l=t.entries();let u=!1,f=0;for(;(a=l.next())&&!a.done;){if(r[f]){f++;continue}const p=i.value,g=a.value;if(n.equals(p[0],g[0],c,f,e,t,n)&&n.equals(p[1],g[1],p[0],g[0],e,t,n)){u=r[f]=!0;break}f++}if(!u)return!1;c++}return!0}const bf=tn;function yf(e,t,n){const o=pi(e);let r=o.length;if(pi(t).length!==r)return!1;for(;r-- >0;)if(!_a(e,t,n,o[r]))return!1;return!0}function Rn(e,t,n){const o=di(e);let r=o.length;if(di(t).length!==r)return!1;let s,i,a;for(;r-- >0;)if(s=o[r],!_a(e,t,n,s)||(i=fi(e,s),a=fi(t,s),(i||a)&&(!i||!a||i.configurable!==a.configurable||i.enumerable!==a.enumerable||i.writable!==a.writable)))return!1;return!0}function xf(e,t){return tn(e.valueOf(),t.valueOf())}function vf(e,t){return e.source===t.source&&e.flags===t.flags}function gi(e,t,n){const o=e.size;if(o!==t.size)return!1;if(!o)return!0;const r=new Array(o),s=e.values();let i,a;for(;(i=s.next())&&!i.done;){const c=t.values();let l=!1,u=0;for(;(a=c.next())&&!a.done;){if(!r[u]&&n.equals(i.value,a.value,i.value,a.value,e,t,n)){l=r[u]=!0;break}u++}if(!l)return!1}return!0}function vo(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 wf(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 _a(e,t,n,o){return(o===uf||o===lf||o===cf)&&(e.$$typeof||t.$$typeof)?!0:af(t,o)&&n.equals(e[o],t[o],o,o,e,t,n)}const kf="[object ArrayBuffer]",Sf="[object Arguments]",Rf="[object Boolean]",Ef="[object DataView]",Cf="[object Date]",Tf="[object Error]",Mf="[object Map]",Pf="[object Number]",Of="[object Object]",If="[object RegExp]",Af="[object Set]",$f="[object String]",Nf={"[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},Df="[object URL]",Lf=Object.prototype.toString;function jf({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:o,areErrorsEqual:r,areFunctionsEqual:s,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:f,areTypedArraysEqual:p,areUrlsEqual:g,unknownTagComparators:h}){return function(m,b,x){if(m===b)return!0;if(m==null||b==null)return!1;const S=typeof m;if(S!==typeof b)return!1;if(S!=="object")return S==="number"?a(m,b,x):S==="function"?s(m,b,x):!1;const v=m.constructor;if(v!==b.constructor)return!1;if(v===Object)return c(m,b,x);if(Array.isArray(m))return t(m,b,x);if(v===Date)return o(m,b,x);if(v===RegExp)return u(m,b,x);if(v===Map)return i(m,b,x);if(v===Set)return f(m,b,x);const E=Lf.call(m);if(E===Cf)return o(m,b,x);if(E===If)return u(m,b,x);if(E===Mf)return i(m,b,x);if(E===Af)return f(m,b,x);if(E===Of)return typeof m.then!="function"&&typeof b.then!="function"&&c(m,b,x);if(E===Df)return g(m,b,x);if(E===Tf)return r(m,b,x);if(E===Sf)return c(m,b,x);if(Nf[E])return p(m,b,x);if(E===kf)return e(m,b,x);if(E===Ef)return n(m,b,x);if(E===Rf||E===Pf||E===$f)return l(m,b,x);if(h){let y=h[E];if(!y){const C=sf(m);C&&(y=h[C])}if(y)return y(m,b,x)}return!1}}function Ff({circular:e,createCustomConfig:t,strict:n}){let o={areArrayBuffersEqual:df,areArraysEqual:n?Rn:ff,areDataViewsEqual:pf,areDatesEqual:hf,areErrorsEqual:gf,areFunctionsEqual:mf,areMapsEqual:n?fr(hi,Rn):hi,areNumbersEqual:bf,areObjectsEqual:n?Rn:yf,arePrimitiveWrappersEqual:xf,areRegExpsEqual:vf,areSetsEqual:n?fr(gi,Rn):gi,areTypedArraysEqual:n?fr(vo,Rn):vo,areUrlsEqual:wf,unknownTagComparators:void 0};if(t&&(o=Object.assign({},o,t(o))),e){const r=eo(o.areArraysEqual),s=eo(o.areMapsEqual),i=eo(o.areObjectsEqual),a=eo(o.areSetsEqual);o=Object.assign({},o,{areArraysEqual:r,areMapsEqual:s,areObjectsEqual:i,areSetsEqual:a})}return o}function _f(e){return function(t,n,o,r,s,i,a){return e(t,n,a)}}function Bf({circular:e,comparator:t,createState:n,equals:o,strict:r}){if(n)return function(a,c){const{cache:l=e?new WeakMap:void 0,meta:u}=n();return t(a,c,{cache:l,equals:o,meta:u,strict:r})};if(e)return function(a,c){return t(a,c,{cache:new WeakMap,equals:o,meta:void 0,strict:r})};const s={cache:void 0,equals:o,meta:void 0,strict:r};return function(a,c){return t(a,c,s)}}const zf=zt();zt({strict:!0});zt({circular:!0});zt({circular:!0,strict:!0});zt({createInternalComparator:()=>tn});zt({strict:!0,createInternalComparator:()=>tn});zt({circular:!0,createInternalComparator:()=>tn});zt({circular:!0,createInternalComparator:()=>tn,strict:!0});function zt(e={}){const{circular:t=!1,createInternalComparator:n,createState:o,strict:r=!1}=e,s=Ff(e),i=jf(s),a=n?n(i):_f(i);return Bf({circular:t,comparator:i,createState:o,equals:a,strict:r})}var pr={exports:{}},hr={};/**
10
+ * @license React
11
+ * use-sync-external-store-shim/with-selector.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var mi;function Hf(){if(mi)return hr;mi=1;var e=Kr(),t=Fa();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return hr.useSyncExternalStoreWithSelector=function(l,u,f,p,g){var h=s(null);if(h.current===null){var w={hasValue:!1,value:null};h.current=w}else w=h.current;h=a(function(){function b(y){if(!x){if(x=!0,S=y,y=p(y),g!==void 0&&w.hasValue){var C=w.value;if(g(C,y))return v=C}return v=y}if(C=v,o(S,y))return C;var R=p(y);return g!==void 0&&g(C,R)?(S=y,C):(S=y,v=R)}var x=!1,S,v,E=f===void 0?null:f;return[function(){return b(u())},E===null?void 0:function(){return b(E())}]},[u,f,p,g]);var m=r(l,h[0],h[1]);return i(function(){w.hasValue=!0,w.value=m},[m]),c(m),m},hr}var bi;function Vf(){return bi||(bi=1,pr.exports=Hf()),pr.exports}var Ba=Vf();const Wf=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Gf=({contentComponent:e})=>{const t=_o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return k.jsx(k.Fragment,{children:Object.values(t)})};function qf(){const e=new Set;let t={},n=!1;const o=()=>{n||!e.size||(n=!0,queueMicrotask(()=>{n=!1,e.forEach(r=>r())}))};return{subscribe(r){return e.add(r),()=>{e.delete(r)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(r,s){t={...t,[r]:ef.createPortal(s.reactElement,s.element,r)},o()},removeRenderer(r){const s={...t};delete s[r],t=s,o()}}}var Uf=class extends jt.Component{constructor(e){super(e),this.editorContentRef=jt.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&(!((e=t.view.dom)===null||e===void 0)&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=qf(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{var t;if(!(!((t=e.view.dom)===null||t===void 0)&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return k.jsxs(k.Fragment,{children:[k.jsx("div",{ref:Wf(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&k.jsx(Gf,{contentComponent:e.contentComponent})]})}};const Yf=d.forwardRef((e,t)=>{const n=jt.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return jt.createElement(Uf,{key:n,innerRef:t,...e})}),Kf=jt.memo(Yf),Xf=typeof window<"u"?d.useLayoutEffect:d.useEffect;var Zf=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 t;const n=r=>{(r==null?void 0:r.transaction)!==void 0&&r.transaction===t||(t=r==null?void 0:r.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},o=this.editor;return o.on("transaction",n),o.on("update",n),()=>{o.off("transaction",n),o.off("update",n)}}}};function Qf(e){var t;const[n]=d.useState(()=>new Zf(e.editor)),o=Ba.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:zf);return Xf(()=>n.watch(e.editor),[e.editor,n]),d.useDebugValue(o),o}const Jf=!1,za=typeof window>"u",ep=za||!!(typeof window<"u"&&window.next);var tp=class Ha{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const t=this.options.current.immediatelyRender;let n=t??!0;return za?(n&&Jf&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):ep&&t===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...n)=>{var o,r;return(o=(r=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(r,...n)},onBlur:(...n)=>{var o,r;return(o=(r=this.options.current).onBlur)===null||o===void 0?void 0:o.call(r,...n)},onCreate:(...n)=>{var o,r;return(o=(r=this.options.current).onCreate)===null||o===void 0?void 0:o.call(r,...n)},onDestroy:(...n)=>{var o,r;return(o=(r=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(r,...n)},onFocus:(...n)=>{var o,r;return(o=(r=this.options.current).onFocus)===null||o===void 0?void 0:o.call(r,...n)},onSelectionUpdate:(...n)=>{var o,r;return(o=(r=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(r,...n)},onTransaction:(...n)=>{var o,r;return(o=(r=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(r,...n)},onUpdate:(...n)=>{var o,r;return(o=(r=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(r,...n)},onContentError:(...n)=>{var o,r;return(o=(r=this.options.current).onContentError)===null||o===void 0?void 0:o.call(r,...n)},onDrop:(...n)=>{var o,r;return(o=(r=this.options.current).onDrop)===null||o===void 0?void 0:o.call(r,...n)},onPaste:(...n)=>{var o,r;return(o=(r=this.options.current).onPaste)===null||o===void 0?void 0:o.call(r,...n)},onDelete:(...n)=>{var o,r;return(o=(r=this.options.current).onDelete)===null||o===void 0?void 0:o.call(r,...n)},onMount:(...n)=>{var o,r;return(o=(r=this.options.current).onMount)===null||o===void 0?void 0:o.call(r,...n)},onUnmount:(...n)=>{var o,r;return(o=(r=this.options.current).onUnmount)===null||o===void 0?void 0:o.call(r,...n)}};return new od(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(o=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(o)?!0:o==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((r,s)=>{var i;return r===((i=n.extensions)===null||i===void 0?void 0:i[s])}):t[o]===n[o])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?Ha.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(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((n,o)=>n===t[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function _w(e={},t=[]){const n=d.useRef(e);n.current=e;const[o]=d.useState(()=>new tp(n)),r=_o.useSyncExternalStore(o.subscribe,o.getEditor,o.getServerSnapshot);return d.useDebugValue(r),d.useEffect(o.onRender(t)),Qf({editor:r,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),r}const Va=d.createContext({editor:null});Va.Consumer;const np=d.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),op=()=>d.useContext(np);jt.forwardRef((e,t)=>{const{onDragStart:n}=op(),o=e.as||"div";return k.jsx(o,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});jt.createContext({markViewContentRef:()=>{}});const Jr=d.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Jr.displayName="TiptapContext";const rp=()=>d.useContext(Jr);function Wa({children:e,...t}){const n="editor"in t?t.editor:t.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=d.useMemo(()=>({editor:n}),[n]),r=d.useMemo(()=>({editor:n}),[n]);return k.jsx(Va.Provider,{value:r,children:k.jsx(Jr.Provider,{value:o,children:e})})}Wa.displayName="Tiptap";function Ga({...e}){const{editor:t}=rp();return k.jsx(Kf,{editor:t,...e})}Ga.displayName="Tiptap.Content";Object.assign(Wa,{Content:Ga});function Bo(){return typeof window<"u"}function Ke(e){return es(e)?(e.nodeName||"").toLowerCase():"#document"}function Fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(es(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function es(e){return Bo()?e instanceof Node||e instanceof Fe(e).Node:!1}function Ee(e){return Bo()?e instanceof Element||e instanceof Fe(e).Element:!1}function Ne(e){return Bo()?e instanceof HTMLElement||e instanceof Fe(e).HTMLElement:!1}function hn(e){return!Bo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fe(e).ShadowRoot}function nn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=at(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function sp(e){return/^(table|td|th)$/.test(Ke(e))}function zo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ip=/transform|translate|scale|rotate|perspective|filter/,ap=/paint|layout|strict|content/,Yt=e=>!!e&&e!=="none";let gr;function ts(e){const t=Ee(e)?at(e):e;return Yt(t.transform)||Yt(t.translate)||Yt(t.scale)||Yt(t.rotate)||Yt(t.perspective)||!ns()&&(Yt(t.backdropFilter)||Yt(t.filter))||ip.test(t.willChange||"")||ap.test(t.contain||"")}function cp(e){let t=Ot(e);for(;Ne(t)&&!Tt(t);){if(ts(t))return t;if(zo(t))return null;t=Ot(t)}return null}function ns(){return gr==null&&(gr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gr}function Tt(e){return/^(html|body|#document)$/.test(Ke(e))}function at(e){return Fe(e).getComputedStyle(e)}function Ho(e){return Ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ot(e){if(Ke(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hn(e)&&e.host||At(e);return hn(t)?t.host:t}function qa(e){const t=Ot(e);return Tt(t)?(e.ownerDocument||e).body:Ne(t)&&nn(t)?t:qa(t)}function _n(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=qa(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=Fe(r);if(s){const a=Pr(i);return t.concat(i,i.visualViewport||[],nn(r)?r:[],a&&n?_n(a):[])}else return t.concat(r,_n(r,[],n))}function Pr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const os={...Jd},yi={};function et(e,t){const n=d.useRef(yi);return n.current===yi&&(n.current=e(t)),n}const mr=os.useInsertionEffect,lp=mr&&mr!==os.useLayoutEffect?mr:e=>e();function de(e){const t=et(up).current;return t.next=e,lp(t.effect),t.trampoline}function up(){const e={next:void 0,callback:dp,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function dp(){}const fp=()=>{},Q=typeof document<"u"?d.useLayoutEffect:fp;function Or(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const rs={};function ut(e,t,n,o,r){if(!n&&!o&&!r&&!e)return wo(t);let s=wo(e);return t&&(s=Mn(s,t)),n&&(s=Mn(s,n)),o&&(s=Mn(s,o)),r&&(s=Mn(s,r)),s}function pp(e){if(e.length===0)return rs;if(e.length===1)return wo(e[0]);let t=wo(e[0]);for(let n=1;n<e.length;n+=1)t=Mn(t,e[n]);return t}function wo(e){return ss(e)?{...Ya(e,rs)}:hp(e)}function Mn(e,t){return ss(t)?Ya(t,e):gp(e,t)}function hp(e){const t={...e};for(const n in t){const o=t[n];Ua(n,o)&&(t[n]=Ka(o))}return t}function gp(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Or(e.style,o);break}case"className":{e[n]=Xa(e.className,o);break}default:Ua(n,o)?e[n]=mp(e[n],o):e[n]=o}}return e}function Ua(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function ss(e){return typeof e=="function"}function Ya(e,t){return ss(e)?e(t):e??rs}function mp(e,t){return t?e?(...n)=>{const o=n[0];if(Za(o)){const s=o;ko(s);const i=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),i}const r=t(...n);return e==null||e(...n),r}:Ka(t):e}function Ka(e){return e&&((...t)=>{const n=t[0];return Za(n)&&ko(n),e(...t)})}function ko(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Xa(e,t){return t?e?t+" "+e:t:e}function Za(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function bp(e,t){return function(o,...r){const s=new URL(e);return s.searchParams.set("code",o.toString()),r.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${o}; visit ${s} for the full message.`}}const We=bp("https://base-ui.com/production-error","Base UI"),Qa=d.createContext(void 0);function is(e=!1){const t=d.useContext(Qa);if(t===void 0&&!e)throw new Error(We(16));return t}function yp(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,a=o&&t===!1;return{props:d.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||a)&&(l.disabled=n),l},[o,n,t,i,a,s,r])}}function vn(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0,composite:s}=e,i=d.useRef(null),a=is(!0),c=s??a!==void 0,{props:l}=yp({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:o,isNativeButton:r}),u=d.useCallback(()=>{const g=i.current;br(g)&&c&&t&&l.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,l.disabled,c]);Q(u,[u]);const f=d.useCallback((g={})=>{const{onClick:h,onMouseDown:w,onKeyUp:m,onKeyDown:b,onPointerDown:x,...S}=g;return ut({onClick(v){if(t){v.preventDefault();return}h==null||h(v)},onMouseDown(v){t||w==null||w(v)},onKeyDown(v){if(t||(ko(v),b==null||b(v),v.baseUIHandlerPrevented))return;const E=v.target===v.currentTarget,y=v.currentTarget,C=br(y),R=!r&&xp(y),O=E&&(r?C:!R),P=v.key==="Enter",j=v.key===" ",L=y.getAttribute("role"),$=(L==null?void 0:L.startsWith("menuitem"))||L==="option"||L==="gridcell";if(E&&c&&j){if(v.defaultPrevented&&$)return;v.preventDefault(),R||r&&C?(y.click(),v.preventBaseUIHandler()):O&&(h==null||h(v),v.preventBaseUIHandler());return}O&&(!r&&(j||P)&&v.preventDefault(),!r&&P&&(h==null||h(v)))},onKeyUp(v){if(!t){if(ko(v),m==null||m(v),v.target===v.currentTarget&&r&&c&&br(v.currentTarget)&&v.key===" "){v.preventDefault();return}v.baseUIHandlerPrevented||v.target===v.currentTarget&&!r&&!c&&v.key===" "&&(h==null||h(v))}},onPointerDown(v){if(t){v.preventDefault();return}x==null||x(v)}},r?{type:"button"}:{role:"button"},l,S)},[t,l,c,r]),p=de(g=>{i.current=g,u()});return{getButtonProps:f,buttonRef:p}}function br(e){return Ne(e)&&e.tagName==="BUTTON"}function xp(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}function Ft(e,t,n,o){const r=et(Ja).current;return wp(r,e,t,n,o)&&ec(r,[e,t,n,o]),r.callback}function vp(e){const t=et(Ja).current;return kp(t,e)&&ec(t,e),t.callback}function Ja(){return{callback:null,cleanup:null,refs:[]}}function wp(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function kp(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function ec(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Sp=parseInt(d.version,10);function as(e){return Sp>=e}function xi(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(as(19)?n==null?void 0:n.ref:t.ref)??null}function qe(){}const Qt=Object.freeze([]),De=Object.freeze({});function Rp(e,t){const n={};for(const o in e){const r=e[o];if(t!=null&&t.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function Ep(e,t){return typeof e=="function"?e(t):e}function Cp(e,t){return typeof e=="function"?e(t):e}function Le(e,t,n={}){const o=t.render,r=Tp(t,n);if(n.enabled===!1)return null;const s=n.state??De;return Op(e,o,r,s)}function Tp(e,t={}){const{className:n,style:o,render:r}=e,{state:s=De,ref:i,props:a,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Ep(n,s):void 0,f=l?Cp(o,s):void 0,p=l?Rp(s,c):De,g=l&&a?Mp(a):void 0,h=l?Or(p,g)??{}:De;return typeof document<"u"&&(l?Array.isArray(i)?h.ref=vp([h.ref,xi(r),...i]):h.ref=Ft(h.ref,xi(r),i):Ft(null,null)),l?(u!==void 0&&(h.className=Xa(h.className,u)),f!==void 0&&(h.style=Or(h.style,f)),h):De}function Mp(e){return Array.isArray(e)?pp(e):ut(void 0,e)}const Pp=Symbol.for("react.lazy");function Op(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=ut(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Pp&&(s=d.Children.toArray(t)[0]),d.cloneElement(s,r)}if(e&&typeof e=="string")return Ip(e,n);throw new Error(We(8))}function Ip(e,t){return e==="button"?d.createElement("button",{type:"button",...t,key:t.key}):e==="img"?d.createElement("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}const Ap=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,focusableWhenDisabled:i=!1,nativeButton:a=!0,style:c,...l}=t,{getButtonProps:u,buttonRef:f}=vn({disabled:s,focusableWhenDisabled:i,native:a});return Le("button",t,{state:{disabled:s},ref:[n,f],props:[l,u]})});function tc(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=tc(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function nc(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=tc(e))&&(o&&(o+=" "),o+=t);return o}const vi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wi=nc,oc=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return wi(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(l=>{const u=n==null?void 0:n[l],f=s==null?void 0:s[l];if(u===null)return null;const p=vi(u)||vi(f);return r[l][p]}),a=n&&Object.entries(n).reduce((l,u)=>{let[f,p]=u;return p===void 0||(l[f]=p),l},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((l,u)=>{let{class:f,className:p,...g}=u;return Object.entries(g).every(h=>{let[w,m]=h;return Array.isArray(m)?m.includes({...s,...a}[w]):{...s,...a}[w]===m})?[...l,f,p]:l},[]);return wi(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},$p=(e,t)=>{const n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},Np=(e,t)=>({classGroupId:e,validator:t}),rc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),So="-",ki=[],Dp="arbitrary..",Lp=e=>{const t=Fp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return jp(i);const a=i.split(So),c=a[0]===""&&a.length>1?1:0;return sc(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=o[i],l=n[i];return c?l?$p(l,c):c:l||ki}return n[i]||ki}}},sc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const l=sc(e,t+1,s);if(l)return l}const i=n.validators;if(i===null)return;const a=t===0?e.join(So):e.slice(t).join(So),c=i.length;for(let l=0;l<c;l++){const u=i[l];if(u.validator(a))return u.classGroupId}},jp=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?Dp+o:void 0})(),Fp=e=>{const{theme:t,classGroups:n}=e;return _p(n,t)},_p=(e,t)=>{const n=rc();for(const o in e){const r=e[o];cs(r,n,o,t)}return n},cs=(e,t,n,o)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];Bp(i,t,n,o)}},Bp=(e,t,n,o)=>{if(typeof e=="string"){zp(e,t,n);return}if(typeof e=="function"){Hp(e,t,n,o);return}Vp(e,t,n,o)},zp=(e,t,n)=>{const o=e===""?t:ic(t,e);o.classGroupId=n},Hp=(e,t,n,o)=>{if(Wp(e)){cs(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Np(n,e))},Vp=(e,t,n,o)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[a,c]=r[i];cs(c,ic(t,a),n,o)}},ic=(e,t)=>{let n=e;const o=t.split(So),r=o.length;for(let s=0;s<r;s++){const i=o[s];let a=n.nextPart.get(i);a||(a=rc(),n.nextPart.set(i,a)),n=a}return n},Wp=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null);const r=(s,i)=>{n[s]=i,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=o[s])!==void 0)return r(s,i),i},set(s,i){s in n?n[s]=i:r(s,i)}}},Ir="!",Si=":",qp=[],Ri=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),Up=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const s=[];let i=0,a=0,c=0,l;const u=r.length;for(let w=0;w<u;w++){const m=r[w];if(i===0&&a===0){if(m===Si){s.push(r.slice(c,w)),c=w+1;continue}if(m==="/"){l=w;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const f=s.length===0?r:r.slice(c);let p=f,g=!1;f.endsWith(Ir)?(p=f.slice(0,-1),g=!0):f.startsWith(Ir)&&(p=f.slice(1),g=!0);const h=l&&l>c?l-c:void 0;return Ri(s,g,p,h)};if(t){const r=t+Si,s=o;o=i=>i.startsWith(r)?s(i.slice(r.length)):Ri(qp,!1,i,void 0,!0)}if(n){const r=o;o=s=>n({className:s,parseClassName:r})}return o},Yp=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{const o=[];let r=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",c=t.has(i);a||c?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(i)):r.push(i)}return r.length>0&&(r.sort(),o.push(...r)),o}},Kp=e=>({cache:Gp(e.cacheSize),parseClassName:Up(e),sortModifiers:Yp(e),postfixLookupClassGroupIds:Xp(e),...Lp(e)}),Xp=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let o=0;o<n.length;o++)t[n[o]]=!0;return t},Zp=/\s+/,Qp=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:s,postfixLookupClassGroupIds:i}=t,a=[],c=e.trim().split(Zp);let l="";for(let u=c.length-1;u>=0;u-=1){const f=c[u],{isExternal:p,modifiers:g,hasImportantModifier:h,baseClassName:w,maybePostfixModifierPosition:m}=n(f);if(p){l=f+(l.length>0?" "+l:l);continue}let b=!!m,x;if(b){const C=w.substring(0,m);x=o(C);const R=x&&i[x]?o(w):void 0;R&&R!==x&&(x=R,b=!1)}else x=o(w);if(!x){if(!b){l=f+(l.length>0?" "+l:l);continue}if(x=o(w),!x){l=f+(l.length>0?" "+l:l);continue}b=!1}const S=g.length===0?"":g.length===1?g[0]:s(g).join(":"),v=h?S+Ir:S,E=v+x;if(a.indexOf(E)>-1)continue;a.push(E);const y=r(x,b);for(let C=0;C<y.length;++C){const R=y[C];a.push(v+R)}l=f+(l.length>0?" "+l:l)}return l},Jp=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=ac(n))&&(r&&(r+=" "),r+=o);return r},ac=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=ac(e[o]))&&(n&&(n+=" "),n+=t);return n},eh=(e,...t)=>{let n,o,r,s;const i=c=>{const l=t.reduce((u,f)=>f(u),e());return n=Kp(l),o=n.cache.get,r=n.cache.set,s=a,a(c)},a=c=>{const l=o(c);if(l)return l;const u=Qp(c,n);return r(c,u),u};return s=i,(...c)=>s(Jp(...c))},th=[],He=e=>{const t=n=>n[e]||th;return t.isThemeGetter=!0,t},cc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,oh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ih=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ah=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nt=e=>nh.test(e),Re=e=>!!e&&!Number.isNaN(Number(e)),bt=e=>!!e&&Number.isInteger(Number(e)),yr=e=>e.endsWith("%")&&Re(e.slice(0,-1)),St=e=>oh.test(e),uc=()=>!0,ch=e=>rh.test(e)&&!sh.test(e),ls=()=>!1,lh=e=>ih.test(e),uh=e=>ah.test(e),dh=e=>!ne(e)&&!oe(e),fh=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),ph=e=>Ht(e,pc,ls),ne=e=>cc.test(e),Kt=e=>Ht(e,hc,ch),Ei=e=>Ht(e,wh,Re),hh=e=>Ht(e,mc,uc),gh=e=>Ht(e,gc,ls),Ci=e=>Ht(e,dc,ls),mh=e=>Ht(e,fc,uh),to=e=>Ht(e,bc,lh),oe=e=>lc.test(e),En=e=>on(e,hc),bh=e=>on(e,gc),Ti=e=>on(e,dc),yh=e=>on(e,pc),xh=e=>on(e,fc),no=e=>on(e,bc,!0),vh=e=>on(e,mc,!0),Ht=(e,t,n)=>{const o=cc.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},on=(e,t,n=!1)=>{const o=lc.exec(e);return o?o[1]?t(o[1]):n:!1},dc=e=>e==="position"||e==="percentage",fc=e=>e==="image"||e==="url",pc=e=>e==="length"||e==="size"||e==="bg-size",hc=e=>e==="length",wh=e=>e==="number",gc=e=>e==="family-name",mc=e=>e==="number"||e==="weight",bc=e=>e==="shadow",kh=()=>{const e=He("color"),t=He("font"),n=He("text"),o=He("font-weight"),r=He("tracking"),s=He("leading"),i=He("breakpoint"),a=He("container"),c=He("spacing"),l=He("radius"),u=He("shadow"),f=He("inset-shadow"),p=He("text-shadow"),g=He("drop-shadow"),h=He("blur"),w=He("perspective"),m=He("aspect"),b=He("ease"),x=He("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...v(),oe,ne],y=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],R=()=>[oe,ne,c],O=()=>[Nt,"full","auto",...R()],P=()=>[bt,"none","subgrid",oe,ne],j=()=>["auto",{span:["full",bt,oe,ne]},bt,oe,ne],L=()=>[bt,"auto",oe,ne],$=()=>["auto","min","max","fr",oe,ne],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...R()],D=()=>[Nt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],A=()=>[Nt,"screen","full","dvw","lvw","svw","min","max","fit",...R()],F=()=>[Nt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],I=()=>[e,oe,ne],B=()=>[...v(),Ti,Ci,{position:[oe,ne]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",yh,ph,{size:[oe,ne]}],se=()=>[yr,En,Kt],G=()=>["","none","full",l,oe,ne],W=()=>["",Re,En,Kt],ae=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[Re,yr,Ti,Ci],ye=()=>["","none",h,oe,ne],ke=()=>["none",Re,oe,ne],H=()=>["none",Re,oe,ne],te=()=>[Re,oe,ne],Y=()=>[Nt,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[St],breakpoint:[St],color:[uc],container:[St],"drop-shadow":[St],ease:["in","out","in-out"],font:[dh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[St],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[St],shadow:[St],spacing:["px",Re],text:[St],"text-shadow":[St],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nt,ne,oe,m]}],container:["container"],"container-type":[{"@container":["","normal","size",oe,ne]}],"container-named":[fh],columns:[{columns:[Re,ne,oe,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:y()}],"overflow-x":[{"overflow-x":y()}],"overflow-y":[{"overflow-y":y()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[bt,"auto",oe,ne]}],basis:[{basis:[Nt,"full","auto",a,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,Nt,"auto","initial","none",ne]}],grow:[{grow:["",Re,oe,ne]}],shrink:[{shrink:["",Re,oe,ne]}],order:[{order:[bt,"first","last","none",oe,ne]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...A()]}],"min-inline-size":[{"min-inline":["auto",...A()]}],"max-inline-size":[{"max-inline":["none",...A()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[a,"screen",...D()]}],"min-w":[{"min-w":[a,"screen","none",...D()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",n,En,Kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,vh,hh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yr,ne]}],"font-family":[{font:[bh,gh,t]}],"font-features":[{"font-features":[ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,oe,ne]}],"line-clamp":[{"line-clamp":[Re,"none",oe,Ei]}],leading:[{leading:[s,...R()]}],"list-image":[{"list-image":["none",oe,ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",oe,ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",oe,Kt]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Re,"auto",oe,ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[bt,oe,ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe,ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe,ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bt,oe,ne],radial:["",oe,ne],conic:[bt,oe,ne]},xh,mh]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Re,oe,ne]}],"outline-w":[{outline:["",Re,En,Kt]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",u,no,to]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",f,no,to]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Re,Kt]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",p,no,to]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Re,oe,ne]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Re]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[oe,ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",oe,ne]}],filter:[{filter:["","none",oe,ne]}],blur:[{blur:ye()}],brightness:[{brightness:[Re,oe,ne]}],contrast:[{contrast:[Re,oe,ne]}],"drop-shadow":[{"drop-shadow":["","none",g,no,to]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",Re,oe,ne]}],"hue-rotate":[{"hue-rotate":[Re,oe,ne]}],invert:[{invert:["",Re,oe,ne]}],saturate:[{saturate:[Re,oe,ne]}],sepia:[{sepia:["",Re,oe,ne]}],"backdrop-filter":[{"backdrop-filter":["","none",oe,ne]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[Re,oe,ne]}],"backdrop-contrast":[{"backdrop-contrast":[Re,oe,ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,oe,ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,oe,ne]}],"backdrop-invert":[{"backdrop-invert":["",Re,oe,ne]}],"backdrop-opacity":[{"backdrop-opacity":[Re,oe,ne]}],"backdrop-saturate":[{"backdrop-saturate":[Re,oe,ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,oe,ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",oe,ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Re,"initial",oe,ne]}],ease:[{ease:["linear","initial",b,oe,ne]}],delay:[{delay:[Re,oe,ne]}],animate:[{animate:["none",x,oe,ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,oe,ne]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[oe,ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],zoom:[{zoom:[bt,oe,ne]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe,ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",oe,ne]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Re,En,Kt,Ei]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Sh=eh(kh);function je(...e){return Sh(nc(e))}const Rh=oc("group/button inline-flex shrink-0 items-center justify-center rounded-2xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",xs:"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",lg:"h-9 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}}),st=d.forwardRef(function({className:t,variant:n="default",size:o="default",...r},s){return k.jsx(Ap,{ref:s,"data-slot":"button",className:je(Rh({variant:n,size:o,className:t})),...r})});/**
18
+ * @license lucide-react v1.27.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */const yc=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
23
+ * @license lucide-react v1.27.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */const Eh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
28
+ * @license lucide-react v1.27.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */const Ch=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase());/**
33
+ * @license lucide-react v1.27.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */const Mi=e=>{const t=Ch(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
38
+ * @license lucide-react v1.27.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */var xr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
43
+ * @license lucide-react v1.27.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */const Th=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Mh=d.createContext({}),Ph=()=>d.useContext(Mh),Oh=d.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:o,className:r="",children:s,iconNode:i,...a},c)=>{const{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:p="currentColor",className:g=""}=Ph()??{},h=o??f?Number(n??u)*24/Number(t??l):n??u;return d.createElement("svg",{ref:c,...xr,width:t??l??xr.width,height:t??l??xr.height,stroke:e??p,strokeWidth:h,className:yc("lucide",g,r),...!s&&!Th(a)&&{"aria-hidden":"true"},...a},[...i.map(([w,m])=>d.createElement(w,m)),...Array.isArray(s)?s:[s]])});/**
48
+ * @license lucide-react v1.27.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */const J=(e,t)=>{const n=d.forwardRef(({className:o,...r},s)=>d.createElement(Oh,{ref:s,iconNode:t,className:yc(`lucide-${Eh(Mi(e))}`,`lucide-${e}`,o),...r}));return n.displayName=Mi(e),n};/**
53
+ * @license lucide-react v1.27.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const Ih=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Ah=J("arrow-down-to-line",Ih);/**
58
+ * @license lucide-react v1.27.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const $h=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Nh=J("arrow-down",$h);/**
63
+ * @license lucide-react v1.27.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const Dh=[["path",{d:"M3 19V5",key:"rwsyhb"}],["path",{d:"m13 6-6 6 6 6",key:"1yhaz7"}],["path",{d:"M7 12h14",key:"uoisry"}]],Lh=J("arrow-left-to-line",Dh);/**
68
+ * @license lucide-react v1.27.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const jh=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Fh=J("arrow-left",jh);/**
73
+ * @license lucide-react v1.27.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const _h=[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]],Bh=J("arrow-right-to-line",_h);/**
78
+ * @license lucide-react v1.27.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const zh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Hh=J("arrow-right",zh);/**
83
+ * @license lucide-react v1.27.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const Vh=[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]],Wh=J("arrow-up-to-line",Vh);/**
88
+ * @license lucide-react v1.27.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const Gh=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],qh=J("arrow-up",Gh);/**
93
+ * @license lucide-react v1.27.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const Uh=[["path",{d:"M4 20h16",key:"14thso"}],["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Yh=J("baseline",Uh);/**
98
+ * @license lucide-react v1.27.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const Kh=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],Xh=J("blocks",Kh);/**
103
+ * @license lucide-react v1.27.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const Zh=[["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"}]],Qh=J("chart-column",Zh);/**
108
+ * @license lucide-react v1.27.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const Jh=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],eg=J("chart-no-axes-column",Jh);/**
113
+ * @license lucide-react v1.27.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const tg=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ng=J("chevron-down",tg);/**
118
+ * @license lucide-react v1.27.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const og=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],rg=J("chevron-left",og);/**
123
+ * @license lucide-react v1.27.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const sg=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],us=J("chevron-right",sg);/**
128
+ * @license lucide-react v1.27.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const ig=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],ag=J("chevrons-left",ig);/**
133
+ * @license lucide-react v1.27.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const cg=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],lg=J("chevrons-right",cg);/**
138
+ * @license lucide-react v1.27.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const ug=[["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"}]],dg=J("circle-question-mark",ug);/**
143
+ * @license lucide-react v1.27.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const fg=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],pg=J("code",fg);/**
148
+ * @license lucide-react v1.27.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const hg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],gg=J("columns-3",hg);/**
153
+ * @license lucide-react v1.27.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const mg=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],bg=J("copy",mg);/**
158
+ * @license lucide-react v1.27.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const yg=[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]],xg=J("crop",yg);/**
163
+ * @license lucide-react v1.27.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const vg=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],wg=J("ellipsis-vertical",vg);/**
168
+ * @license lucide-react v1.27.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const kg=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Sg=J("ellipsis",kg);/**
173
+ * @license lucide-react v1.27.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const Rg=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Eg=J("file-output",Rg);/**
178
+ * @license lucide-react v1.27.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const Cg=[["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"}]],Tg=J("film",Cg);/**
183
+ * @license lucide-react v1.27.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const Mg=[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]],Pg=J("git-commit-vertical",Mg);/**
188
+ * @license lucide-react v1.27.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const Og=[["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"}]],Ig=J("hash",Og);/**
193
+ * @license lucide-react v1.27.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const Ag=[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]],$g=J("heading",Ag);/**
198
+ * @license lucide-react v1.27.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const Ng=[["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"}]],Dg=J("image",Ng);/**
203
+ * @license lucide-react v1.27.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const Lg=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],jg=J("images",Lg);/**
208
+ * @license lucide-react v1.27.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const Fg=[["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"}]],_g=J("layout-grid",Fg);/**
213
+ * @license lucide-react v1.27.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const Bg=[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["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"}]],zg=J("layout-panel-left",Bg);/**
218
+ * @license lucide-react v1.27.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const Hg=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Vg=J("link",Hg);/**
223
+ * @license lucide-react v1.27.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const Wg=[["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"}]],Gg=J("list-ordered",Wg);/**
228
+ * @license lucide-react v1.27.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const qg=[["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"}]],Ug=J("list-todo",qg);/**
233
+ * @license lucide-react v1.27.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const Yg=[["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"}]],Kg=J("list",Yg);/**
238
+ * @license lucide-react v1.27.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const Xg=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Zg=J("menu",Xg);/**
243
+ * @license lucide-react v1.27.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const Qg=[["path",{d:"M5 12h14",key:"1ays0h"}]],Jg=J("minus",Qg);/**
248
+ * @license lucide-react v1.27.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const em=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],tm=J("moon",em);/**
253
+ * @license lucide-react v1.27.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const nm=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],om=J("palette",nm);/**
258
+ * @license lucide-react v1.27.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const rm=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],sm=J("pause",rm);/**
263
+ * @license lucide-react v1.27.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const im=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],am=J("pencil",im);/**
268
+ * @license lucide-react v1.27.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const cm=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],lm=J("play",cm);/**
273
+ * @license lucide-react v1.27.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const um=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],dm=J("plus",um);/**
278
+ * @license lucide-react v1.27.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const fm=[["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"}]],pm=J("quote",fm);/**
283
+ * @license lucide-react v1.27.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const hm=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],gm=J("redo-2",hm);/**
288
+ * @license lucide-react v1.27.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const mm=[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]],bm=J("remove-formatting",mm);/**
293
+ * @license lucide-react v1.27.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const ym=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xm=J("rotate-ccw",ym);/**
298
+ * @license lucide-react v1.27.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const vm=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],wm=J("route",vm);/**
303
+ * @license lucide-react v1.27.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const km=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],Sm=J("rows-3",km);/**
308
+ * @license lucide-react v1.27.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const Rm=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Em=J("search",Rm);/**
313
+ * @license lucide-react v1.27.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const Cm=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Tm=J("share-2",Cm);/**
318
+ * @license lucide-react v1.27.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const Mm=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],Pm=J("shuffle",Mm);/**
323
+ * @license lucide-react v1.27.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const Om=[["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"}]],Im=J("sliders-horizontal",Om);/**
328
+ * @license lucide-react v1.27.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const Am=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],$m=J("sparkles",Am);/**
333
+ * @license lucide-react v1.27.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const Nm=[["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"}]],Dm=J("square-play",Nm);/**
338
+ * @license lucide-react v1.27.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const Lm=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],jm=J("star",Lm);/**
343
+ * @license lucide-react v1.27.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const Fm=[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]],_m=J("sticky-note",Fm);/**
348
+ * @license lucide-react v1.27.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const Bm=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],zm=J("sun",Bm);/**
353
+ * @license lucide-react v1.27.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const Hm=[["path",{d:"M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z",key:"1ldrpk"}],["path",{d:"M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7",key:"11i5po"}],["path",{d:"M 7 17h.01",key:"1euzgo"}],["path",{d:"m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8",key:"o2gii7"}]],Vm=J("swatch-book",Hm);/**
358
+ * @license lucide-react v1.27.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const Wm=[["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"}]],Gm=J("table-2",Wm);/**
363
+ * @license lucide-react v1.27.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const qm=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],Um=J("text-align-center",qm);/**
368
+ * @license lucide-react v1.27.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const Ym=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],Km=J("text-align-end",Ym);/**
373
+ * @license lucide-react v1.27.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const Xm=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],Zm=J("text-align-start",Xm);/**
378
+ * @license lucide-react v1.27.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const Qm=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Jm=J("trash-2",Qm);/**
383
+ * @license lucide-react v1.27.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const eb=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],tb=J("type",eb);/**
388
+ * @license lucide-react v1.27.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const nb=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],ob=J("undo-2",nb);/**
393
+ * @license lucide-react v1.27.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const rb=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],sb=J("user",rb);/**
398
+ * @license lucide-react v1.27.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const ib=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ab=J("users",ib);/**
403
+ * @license lucide-react v1.27.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const cb=[["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"}]],lb=J("workflow",cb);/**
408
+ * @license lucide-react v1.27.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const ub=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xc=J("x",ub),db={AlignCenter:Um,AlignLeft:Zm,AlignRight:Km,ArrowDown:Nh,ArrowDownToLine:Ah,ArrowLeft:Fh,ArrowLeftToLine:Lh,ArrowRight:Hh,ArrowRightToLine:Bh,ArrowUp:qh,ArrowUpToLine:Wh,ChartColumn:Qh,ChartNoAxesColumn:eg,ChevronDown:ng,ChevronRight:us,ChevronsLeft:ag,ChevronsRight:lg,CircleHelp:dg,Columns3:gg,Copy:bg,Crop:xg,FileOutput:Eg,Film:Tg,GitCommitVertical:Pg,Hash:Ig,Heading:$g,Image:Dg,Images:jg,LayoutGrid:_g,LayoutPanelLeft:zg,Link:Vg,List:Kg,ListOrdered:Gg,Menu:Zg,MoreHorizontal:Sg,MoreVertical:wg,Pause:sm,Play:lm,Plus:dm,Quote:pm,Redo2:gm,RemoveFormatting:bm,RotateCcw:xm,Search:Em,Share2:Tm,Shuffle:Pm,SlidersHorizontal:Im,Sparkles:$m,Star:jm,Table2:Gm,Trash2:Jm,Type:tb,Undo2:ob,Baseline:Yh,ChevronLeft:rg,ListTodo:Ug,Rows3:Sm,Users:ab,Workflow:lb,Palette:om,Route:wm,Minus:Jg,Code:pg,SquarePlay:Dm,Blocks:Xh,StickyNote:_m,SwatchBook:Vm,Sun:zm,Moon:tm,User:sb,Pencil:am};function Ye({name:e,size:t=15}){const n=db[e];return k.jsx(n,{size:t,strokeWidth:1.8,"aria-hidden":"true",focusable:"false"})}function Bw(e){const{view:t,state:n}=e,o=[],r=window.scrollX,s=window.scrollY,i=c=>new DOMRect(c.x+r,c.y+s,c.width,c.height),a=c=>{const l=t.nodeDOM(c);return!l||!(l instanceof HTMLElement)?null:i(l.getBoundingClientRect())};return n.doc.forEach((c,l,u)=>{if(c.type.name!=="page")return;const f=c.attrs.id;if(!f)return;const p=t.nodeDOM(l);if(p instanceof HTMLElement){const h=p.getBoundingClientRect();let w=0;c.forEach(m=>{(Qe(m.type.name)||m.type.name==="layout")&&w++}),o.push({kind:"page",id:f,pageId:f,index:u,overflow:rd(p,h),frameH:Xr(getComputedStyle(p).aspectRatio,h),blocks:w,rect:i(h)})}const g=(h,w,m)=>{let b=0;const x=m?a(w):null,S=x?x.left:void 0;h.forEach((v,E)=>{if(v.type.name==="layout"){const L=v.attrs.id,$=w+1+E,T=L?a($):null;T&&o.push({kind:"block",id:L,pageId:f,index:b,type:"layout",archetype:"layout",rect:T}),b++,v.forEach((M,N,D)=>{const A=M.attrs.id;if(!A)return;const F=$+1+N,I=a(F);I&&o.push({kind:"region",id:A,pageId:f,blockId:L,index:D,rect:I}),g(M,F,A)});return}const y=Qe(v.type.name);if(!y)return;const C=v.attrs.id;if(!C)return;const R=w+1+E,O=a(R);O&&o.push({kind:"block",id:C,pageId:f,containerId:m,gutterLeft:S,index:b,type:y.type,archetype:y.archetype,rect:O}),b++;let P=0;const j=(L,$)=>{L.forEach((T,M)=>{var F;const N=$+1+M,D=(F=T.attrs)==null?void 0:F.id;if(!D)return j(T,N);const A=a(N);A&&o.push({kind:"item",id:D,pageId:f,blockId:C,index:P++,rect:A})})};j(v,R)})};g(c,l)}),o}const Ro=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,fb=(e,t)=>{if(e.kind!=="block"||!t)return e.rect;const n=e.gutterLeft??t.rect.left,o=Math.max(n,e.rect.left-pb);return o<e.rect.left?{left:o,right:e.rect.right,top:e.rect.top,bottom:e.rect.bottom}:e.rect},pb=61;function zw(e,t,n){const o=e.find(i=>i.kind==="page"&&Ro(i.rect,t,n)),r=o?e.filter(i=>i.pageId===o.id):e,s=["item","block","page"];for(const i of s){const a=r.filter(c=>c.kind===i&&Ro(fb(c,o),t,n));if(a.length)return a.reduce((c,l)=>Eo(c.rect)<=Eo(l.rect)?c:l)}return null}const Eo=e=>e.width*e.height,Dt=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function Ar(e,t,n,o){if(!e.length)return null;const r=[];for(let s=0;s<=e.length;s++){const i=e[s-1],a=e[s];if(i&&a){const f=Dt(i),p=Dt(a),g=o==="column"?!1:Math.abs(p.x-f.x)>Math.abs(p.y-f.y);r.push({index:s,x:g?(i.right+a.left)/2:(f.x+p.x)/2,y:g?(f.y+p.y)/2:(i.bottom+a.top)/2,orientation:g?"vertical":"horizontal",length:g?Math.max(i.height,a.height):Math.max(i.width,a.width)});continue}const c=i??a,l=i?e[s-2]:e[1],u=o!=="column"&&l?Math.abs(Dt(l).x-Dt(c).x)>Math.abs(Dt(l).y-Dt(c).y):!1;r.push({index:s,x:u?i?c.right:c.left:Dt(c).x,y:u?Dt(c).y:i?c.bottom:c.top,orientation:u?"vertical":"horizontal",length:u?c.height:c.width})}return r.reduce((s,i)=>Math.hypot(i.x-t,i.y-n)<Math.hypot(s.x-t,s.y-n)?i:s)}function hb(e,t,n,o,r){const s=Ar(e,o,r,"column");return s?{index:s.index,order:Ea(t,n,s.index),y:s.y}:null}const Co=e=>e.containerId??e.pageId;function gb(e,t){if(t.kind==="item")return e.filter(o=>o.kind==="item"&&o.blockId===t.blockId);if(t.kind!=="block")return[];const n=Co(t);return e.filter(o=>o.kind==="block"&&Co(o)===n)}function Hw(e,t,n,o){if(t.kind==="item"){if(!t.blockId)return null;const c=Ar(gb(e,t).map(l=>l.rect),n,o);return c?{containerId:t.blockId,index:c.index,seam:c}:null}if(t.kind!=="block")return null;const r=mb(e,t,n,o),s=e.filter(c=>c.kind==="block"&&Co(c)===r),i=Ar(s.map(c=>c.rect),n,o,"column");if(i)return{containerId:r,index:i.index,seam:i};const a=e.find(c=>c.id===r);return a?{containerId:r,index:0,seam:{index:0,x:a.rect.left+a.rect.width/2,y:a.rect.top,orientation:"horizontal",length:a.rect.width}}:null}function mb(e,t,n,o){const r=Co(t),s=e.find(i=>i.kind==="page"&&Ro(i.rect,n,o));if(!s)return r;if(t.type!=="layout"){const i=e.filter(a=>a.kind==="region"&&a.pageId===s.id&&Ro(a.rect,n,o));if(i.length)return i.reduce((a,c)=>Eo(a.rect)<=Eo(c.rect)?a:c).id}return s.id}const Pi=26;function Vw(e,t,n){var s;const o=e.filter(i=>i.kind==="page");if(!o.length||!o.find(i=>t>=i.rect.left&&t<=i.rect.right))return null;for(let i=0;i<o.length;i++){const a=o[i],c=a.rect.bottom;if(i===0&&n<a.rect.top&&n>=a.rect.top-Pi)return{before:a.id,x:(a.rect.left+a.rect.right)/2,y:a.rect.top};if(n>c&&n<=c+Pi)return{before:(s=o[i+1])==null?void 0:s.id,x:(a.rect.left+a.rect.right)/2,y:c}}return null}function Ww(e,t){const n=Pe(e.state.doc,t);if(!n||!Ra(n.node.type.spec))return null;const o=sd(n.node);if(o.length<2)return null;const r=e.view.dom.querySelector(`[data-id="${t}"]`);if(!(r instanceof HTMLElement))return null;const s=r.getBoundingClientRect(),i=getComputedStyle(r),a=(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.paddingLeft)||0),c=(parseFloat(i.borderRightWidth)||0)+(parseFloat(i.paddingRight)||0),l=s.left+a+window.scrollX,u=s.right-c+window.scrollX,f=u-l,p=[];let g=0;for(let h=0;h<o.length-1;h++)g+=o[h],p.push(l+g/100*f);return{left:l,right:u,top:s.top+window.scrollY,bottom:s.bottom+window.scrollY,widths:o,xs:p,floor:id(o.length)}}function Gw(e,t,n){const o=e.right-e.left;if(o<=0)return e.widths;const r=e.widths.slice(0,t).reduce((l,u)=>l+u,0),s=e.widths[t]+e.widths[t+1],i=(n-e.left)/o*100-r,a=Math.min(Math.max(i,e.floor),s-e.floor),c=[...e.widths];return c[t]=a,c[t+1]=s-a,c}function vc({editor:e,pageId:t,width:n}){const o=d.useRef(null);return d.useEffect(()=>{const r=o.current;if(!r)return;const s=()=>{let a=null,c=0;if(e.state.doc.forEach((g,h,w)=>{g.attrs.id===t&&(a=h,c=w)}),a===null)return;const l=e.view.nodeDOM(a);if(!l||l.nodeType!==1)return;const u=l,f=n/u.offsetWidth,p=u.cloneNode(!0);p.removeAttribute("contenteditable"),p.querySelectorAll("[contenteditable]").forEach(g=>g.removeAttribute("contenteditable")),p.querySelectorAll("[data-chrome]").forEach(g=>g.remove()),p.style.transform=`scale(${f})`,p.style.transformOrigin="top left",p.style.boxShadow="none",r.style.height=`${Xr(getComputedStyle(u).aspectRatio,u.getBoundingClientRect())*f}px`,p.style.setProperty("counter-reset",`dfx-page ${c}`),r.replaceChildren(p)};s(),e.on("transaction",s),window.addEventListener(si,s);const i=new MutationObserver(s);return i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-format"]}),()=>{e.off("transaction",s),window.removeEventListener(si,s),i.disconnect(),r.replaceChildren()}},[e,t,n]),k.jsx("div",{className:"df-thumb",ref:o,"aria-hidden":"true"})}let Oi=0;function bb(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(Oi+=1,o(`${t}-${Oi}`))},[n,t]),r}const Ii=os.useId;function _t(e,t){if(Ii!==void 0){const n=Ii();return e??(t?`${t}-${n}`:n)}return bb(e,t)}const wc=d.createContext(void 0);function Gn(e=!0){const t=d.useContext(wc);if(t===void 0&&!e)throw new Error(We(25));return t}const kc=d.createContext(void 0);function ds(e){const t=d.useContext(kc);if(t===void 0&&!e)throw new Error(We(33));return t}const fs=d.createContext(void 0);function vt(e){const t=d.useContext(fs);if(t===void 0&&!e)throw new Error(We(36));return t}let Bn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const yb={[Bn.startingStyle]:""},xb={[Bn.endingStyle]:""},Vo={transitionStatus(e){return e==="starting"?yb:e==="ending"?xb:null}};let Zt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Bn.startingStyle]="startingStyle",e[e.endingStyle=Bn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),To=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const vb={[To.popupOpen]:""},wb={[To.popupOpen]:"",[To.pressed]:""},kb={[Zt.open]:""},Sb={[Zt.closed]:""},Rb={[Zt.anchorHidden]:""},Sc={open(e){return e?vb:null}},$r={open(e){return e?wb:null}},wn={open(e){return e?kb:Sb},anchorHidden(e){return e?Rb:null}},kn="none",rn="trigger-press",Ue="trigger-hover",dn="trigger-focus",ps="outside-press",Rc="item-press",Eb="close-press",gn="focus-out",Wo="escape-key",Nr="list-navigation",Ec="cancel-open",Pn="sibling-open",Cb="disabled",hs="imperative-action";function Go({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=d.useRef(e!==void 0),[s,i]=d.useState(t),a=r?e:s,c=d.useCallback(l=>{r||i(l)},[]);return[a,c]}function Tb(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Mb,platform:Pb,maxTouchPoints:Ob}=Tb(),qo=Mb.toLowerCase(),zn=Pb.toLowerCase(),Uo=/^i(os$|p)/.test(zn)||zn==="macintel"&&Ob>1,Ai="android",Dr=zn===Ai||qo.includes(Ai),gs=!Uo&&zn.startsWith("mac");zn.startsWith("win");const Ib=gs||Uo;var Sa;const sn=typeof CSS<"u"&&!!((Sa=CSS.supports)!=null&&Sa.call(CSS,"-webkit-backdrop-filter:none"));!sn&&qo.includes("firefox");!sn&&qo.includes("chrom");const Ab=Ib,ms=/jsdom|happydom/.test(qo);function $b(e){const{closeOnClick:t,highlighted:n,id:o,nodeId:r,store:s,typingRef:i,itemRef:a,itemMetadata:c}=e,{events:l}=s.useState("floatingTreeRoot"),u=s.useState("open"),f=Gn(!0),p=f!==void 0;return d.useMemo(()=>({id:o,role:"menuitem",tabIndex:u&&n?0:-1,onKeyDown(g){g.key===" "&&(i!=null&&i.current)&&g.preventDefault()},onMouseMove(g){r&&l.emit("itemhover",{nodeId:r,target:g.currentTarget})},onClick(g){t&&l.emit("close",{domEvent:g,reason:Rc})},onMouseUp(g){if(f){const h=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,p&&h&&Math.abs(g.clientX-h.x)<=1&&Math.abs(g.clientY-h.y)<=1||p&&!gs&&g.button===2)return}a.current&&s.context.allowMouseUpTriggerRef.current&&(!p||g.button===2)&&(!c||c.type==="regular-item")&&a.current.click()}}),[t,n,o,l,r,u,s,i,a,f,p,c])}const Nb={type:"regular-item"};function Cc(e){const{closeOnClick:t,disabled:n=!1,highlighted:o,id:r,store:s,typingRef:i=s.context.typingRef,nativeButton:a,itemMetadata:c,nodeId:l}=e,u=s.useState("disabled"),f=n||u,p=d.useRef(null),{getButtonProps:g,buttonRef:h}=vn({disabled:f,focusableWhenDisabled:!0,native:a,composite:!0}),w=$b({closeOnClick:t,highlighted:o,id:r,nodeId:l,store:s,typingRef:i,itemRef:p,itemMetadata:c}),m=d.useCallback(x=>ut(w,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()}},x,g),[w,g,c]),b=Ft(p,h);return d.useMemo(()=>({getItemProps:m,itemRef:b}),[m,b])}const Tc=d.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Db(){return d.useContext(Tc)}let Lb=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function bs(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:f}=Db(),p=d.useRef(-1),[g,h]=d.useState(s??(r===Lb.GuessFromOrder?()=>{if(p.current===-1){const b=f.current;f.current+=1,p.current=b}return p.current}:-1)),w=d.useRef(null),m=d.useCallback(b=>{var x;if(w.current=b,g!==-1&&b!==null&&(l.current[g]=b,u)){const S=t!==void 0;u.current[g]=S?t:((x=o==null?void 0:o.current)==null?void 0:x.textContent)??b.textContent}},[g,l,u,t,o]);return Q(()=>{if(s!=null)return;const b=w.current;if(b)return i(b,n),()=>{a(b)}},[s,i,a,n]),Q(()=>{if(s==null)return c(b=>{var S;const x=w.current?(S=b.get(w.current))==null?void 0:S.index:null;x!=null&&h(x)})},[s,c,h]),{ref:m,index:g}}function gt(e){return _t(e,"base-ui")}function we(e,t,n,o){let r=!1,s=!1;const i=De;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}const jb=[];function ys(e){d.useEffect(e,jb)}const oo=null;class Fb{constructor(){Ie(this,"callbacks",[]);Ie(this,"callbacksCount",0);Ie(this,"nextId",1);Ie(this,"startId",1);Ie(this,"isScheduled",!1);Ie(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let s=0;s<n.length;s+=1)(r=n[s])==null||r.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const ro=new Fb;class yt{constructor(){Ie(this,"currentId",oo);Ie(this,"cancel",()=>{this.currentId!==oo&&(ro.cancel(this.currentId),this.currentId=oo)});Ie(this,"disposeEffect",()=>this.cancel)}static create(){return new yt}static request(t){return ro.request(t)}static cancel(t){return ro.cancel(t)}request(t){this.cancel(),this.currentId=ro.request(()=>{this.currentId=oo,t()})}}function Hn(){const e=et(yt.create).current;return ys(e.disposeEffect),e}function _b(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),Q(()=>{if(!e&&s&&o!=="ending"&&n){const a=yt.request(()=>{r("ending")});return()=>{yt.cancel(a)}}},[e,s,o,n]),Q(()=>{if(!e||t)return;const a=yt.request(()=>{r(void 0)});return()=>{yt.cancel(a)}},[t,e]),Q(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=yt.request(()=>{r("idle")});return()=>{yt.cancel(a)}},[t,e,s,o]),{mounted:s,setMounted:i,transitionStatus:o}}function Rt(e){return e==null?e:"current"in e?e.current:e}function Mc(e,t=!1,n=!0){const o=Hn();return de((r,s=null)=>{o.cancel();const i=Rt(e);if(i==null)return;const a=i,c=()=>{pt.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function l(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{s!=null&&s.aborted||c()}).catch(()=>{if(n){s!=null&&s.aborted||c();return}const u=a.getAnimations();!(s!=null&&s.aborted)&&u.length>0&&u.some(f=>f.pending||f.playState!=="finished")&&l()})}if(t){const u=Bn.startingStyle;if(!a.hasAttribute(u)){o.request(l);return}const f=new MutationObserver(()=>{a.hasAttribute(u)||(f.disconnect(),l())});f.observe(a,{attributes:!0,attributeFilter:[u]}),s==null||s.addEventListener("abort",()=>f.disconnect(),{once:!0});return}o.request(l)})}function Yo(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=de(r),i=Mc(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}const Pc=d.createContext(void 0);function Bb(){const e=d.useContext(Pc);if(e===void 0)throw new Error(We(31));return e}const Oc=d.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,[a,c]=d.useState(void 0),l=Le("div",t,{ref:n,props:{role:"group","aria-labelledby":a,...i}});return k.jsx(Pc.Provider,{value:c,children:l})}),zb=d.forwardRef(function(t,n){const{render:o,className:r,style:s,id:i,...a}=t,c=gt(i),l=Bb();return Q(()=>(l(c),()=>{l(void 0)}),[l,c]),Le("div",t,{ref:n,props:{id:c,role:"presentation",...a}})}),Ic=d.forwardRef(function(t,n){const{render:o,className:r,id:s,label:i,nativeButton:a=!1,disabled:c=!1,closeOnClick:l=!0,style:u,...f}=t,p=bs({label:i}),g=ds(!0),h=gt(s),{store:w}=vt(),m=w.useState("isActive",p.index),b=w.useState("itemProps"),{getItemProps:x,itemRef:S}=Cc({closeOnClick:l,disabled:c,highlighted:m,id:h,store:w,nativeButton:a,nodeId:g==null?void 0:g.context.nodeId,itemMetadata:Nb});return Le("div",t,{state:{disabled:c,highlighted:m},props:[b,f,x],ref:[S,n,p.ref]})}),Cn=0;class ht{constructor(){Ie(this,"currentId",Cn);Ie(this,"clear",()=>{this.currentId!==Cn&&(clearTimeout(this.currentId),this.currentId=Cn)});Ie(this,"disposeEffect",()=>this.clear)}static create(){return new ht}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Cn,n()},t)}isStarted(){return this.currentId!==Cn}}function Xe(){const e=et(ht.create).current;return ys(e.disposeEffect),e}function ft(e){e.preventDefault(),e.stopPropagation()}function Hb(e){return"nativeEvent"in e}function Ac(e){return e.pointerType===""&&e.isTrusted?!0:Dr&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $c(e){return ms?!1:!Dr&&e.width===0&&e.height===0||Dr&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Jt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Vb(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Lr="data-base-ui-focusable",Nc="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ko="ArrowLeft",Xo="ArrowRight",Dc="ArrowUp",xs="ArrowDown";function Je(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ue(e,t){var o;if(!e||!t)return!1;const n=(o=t.getRootNode)==null?void 0:o.call(t);if(e.contains(t))return!0;if(n&&hn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ve(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Mo(e,t){if(!Ee(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,o]of t.entries())if(ue(o,n))return!o.hasAttribute("data-trigger-disabled");return!1}function vr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Wb(e){return e.matches("html,body")}function Zo(e){return Ne(e)&&e.matches(Nc)}function Gb(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Nc}`))!=null}function jr(e){return e?e.getAttribute("role")==="combobox"&&Zo(e):!1}function qb(e){if(!e||ms)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Fr(e){return e?e.hasAttribute(Lr)?e:e.querySelector(`[${Lr}]`)||e:null}function Ub(e,t){return t!=null&&!Jt(t)?0:typeof e=="function"?e():e}function mn(e,t,n){const o=Ub(e,n);return typeof o=="number"?o:o==null?void 0:o[t]}function $i(e){return typeof e=="function"?e():e}function Lc(e,t){return t||e==="click"||e==="mousedown"}function Yb(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const jc=d.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ht,currentIdRef:{current:null},currentContextRef:{current:null}});function Kb(e,t){e.current=t.current}function Xb(e){const{children:t,delay:n,timeoutMs:o=0}=e,r=d.useRef(n),s=d.useRef(n),i=d.useRef(null),a=d.useRef(null),c=Xe();return Q(()=>{if(s.current=n,!i.current){r.current=n;return}r.current={open:mn(r.current,"open"),close:mn(n,"close")}},[n,i,r,s]),k.jsx(jc.Provider,{value:d.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:s,currentIdRef:i,timeoutMs:o,currentContextRef:a,timeout:c}),[o,c]),children:t})}function Zb(e,t={open:!1}){const{open:n}=t,o="rootStore"in e?e.rootStore:e,r=o.useState("floatingId"),s=d.useContext(jc),{currentIdRef:i,delayRef:a,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:f,timeout:p}=s,[g,h]=d.useState(!1),w=d.useRef(n),m=d.useRef(!1);return Q(()=>{w.current=n},[n]),Q(()=>()=>{m.current=!0},[]),Q(()=>{function b(){var x;m.current||h(!1),(x=u.current)==null||x.setIsInstantPhase(!1),i.current=null,u.current=null,a.current=l.current,p.clear()}if(i.current&&!n&&i.current===r){if(h(!1),c){const x=r;return p.start(c,()=>{o.select("open")||i.current&&i.current!==x||b()}),()=>{(w.current||i.current!==x)&&p.clear()}}b()}},[n,r,i,a,c,l,u,p,o]),Q(()=>{if(!n)return;const b=u.current,x=i.current;p.clear(),u.current={onOpenChange:o.setOpen,setIsInstantPhase:h},i.current=r,a.current={open:0,close:mn(l.current,"close")},x!==null&&x!==r?(h(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,we(kn))):(h(!1),b==null||b.setIsInstantPhase(!1))},[n,r,o,i,a,l,u,p]),Q(()=>()=>{if(i.current===r){if(u.current=null,!w.current)return;i.current=null,Kb(a,l),p.clear()}},[u,i,a,r,l,p]),d.useMemo(()=>({hasProvider:f,delayRef:a,isInstantPhase:g}),[f,a,g])}function Se(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function xt(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Be(e){const t=et(Qb,e).current;return t.next=e,Q(t.effect),t}function Qb(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Me(e){return(e==null?void 0:e.ownerDocument)||document}const Fc={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},_c={...Fc,position:"fixed",top:0,left:0},Jb={...Fc,position:"absolute"},bn=d.forwardRef(function(t,n){const[o,r]=d.useState();Q(()=>{Ab&&sn&&r("button")},[]);const s={tabIndex:0,role:o};return k.jsx("span",{...t,ref:n,style:_c,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})}),ey=["top","right","bottom","left"],yn=Math.min,Mt=Math.max,Po=Math.round,so=Math.floor,Pt=e=>({x:e,y:e}),ty={left:"right",right:"left",bottom:"top",top:"bottom"};function Bc(e,t,n){return Mt(e,yn(t,n))}function It(e,t){return typeof e=="function"?e(t):e}function it(e){return e.split("-")[0]}function Vt(e){return e.split("-")[1]}function vs(e){return e==="x"?"y":"x"}function ws(e){return e==="y"?"height":"width"}function lt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ks(e){return vs(lt(e))}function ny(e,t,n){n===void 0&&(n=!1);const o=Vt(e),r=ks(e),s=ws(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Oo(i)),[i,Oo(i)]}function oy(e){const t=Oo(e);return[_r(e),t,_r(t)]}function _r(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ni=["left","right"],Di=["right","left"],ry=["top","bottom"],sy=["bottom","top"];function iy(e,t,n){switch(e){case"top":case"bottom":return n?t?Di:Ni:t?Ni:Di;case"left":case"right":return t?ry:sy;default:return[]}}function ay(e,t,n,o){const r=Vt(e);let s=iy(it(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(_r)))),s}function Oo(e){const t=it(e);return ty[t]+e.slice(t.length)}function cy(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function zc(e){return typeof e!="number"?cy(e):{top:e,right:e,bottom:e,left:e}}function Io(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function An(e,t){return t<0||t>=e.length}function go(e,t){return Ct(e.current,{disabledIndices:t})}function Br(e,t){return Ct(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ct(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.length-1&&Ao(e,s,o));return s}function Ao(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const r=e[t];return r?Qo(r)?!n&&(r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"):!0:!1}function ly(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Qo(e,t=e?at(e):null){return!e||!e.isConnected||!t||ly(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const uy='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function dy(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return hn(n)?n.host:null}function zr(e){for(const t of Array.from(e.children))if(Ke(t)==="summary")return t;return null}function fy(e,t){const n=zr(t);return!!n&&(e===n||ue(n,e))}function Hc(e){const t=e?Ke(e):"";return e!=null&&e.matches(uy)&&(t!=="summary"||e.parentElement!=null&&Ke(e.parentElement)==="details"&&zr(e.parentElement)===e)&&(t!=="details"||zr(e)==null)&&(t!=="input"||e.type!=="hidden")}function Vc(e){if(!Hc(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=dy(t)){const n=t!==e,o=Ke(t)==="slot";if(t.hasAttribute("inert")||n&&Ke(t)==="details"&&!t.open&&!fy(e,t)||t.hasAttribute("hidden")||!o&&!py(t,n))return!1}return!0}function py(e,t){const n=at(e);return t?n.display!=="none":Qo(e,n)}function Wc(e){const t=e.tabIndex;if(t<0){const n=Ke(e);if(n==="details"||n==="audio"||n==="video"||Ne(e)&&e.isContentEditable)return 0}return t}function wr(e){if(Ke(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function hy(e,t){const n=wr(e);if(!n)return!0;const o=t.find(r=>{const s=wr(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return o?o===n:t.find(r=>{const s=wr(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function Gc(e){if(Ne(e)&&Ke(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ne(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function qc(e,t){Gc(e).forEach(n=>{Hc(n)&&t.push(n),qc(n,t)})}function Uc(e,t,n){Gc(e).forEach(o=>{Ne(o)&&o.matches(t)&&n.push(o),Uc(o,t,n)})}function Ss(e){return Vc(e)&&Wc(e)>=0}function Yc(e){const t=[];return qc(e,t),t.filter(Vc)}function qn(e){const t=Yc(e);return t.filter(n=>Wc(n)>=0&&hy(n,t))}function Kc(e,t){const n=qn(e),o=n.length;if(o===0)return;const r=Je(Me(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Rs(e){return Kc(Me(e).body,1)||e}function Xc(e){return Kc(Me(e).body,-1)||e}function Zc(e,t){if(!e)return null;const n=qn(Me(e).body),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function gy(e){return Zc(e,1)}function my(e){return Zc(e,-1)}function fn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!ue(n,o)}function by(e){qn(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Li(e){const t=[];Uc(e,"[data-tabindex]",t),t.forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function Bt(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Bt(e,r.id,n)]})}function ji(e,t){var r;let n=[],o=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function Vn(e){return`data-base-ui-${e}`}let io=0;function mo(e,t={}){const{preventScroll:n=!1,sync:o=!1,shouldFocus:r}=t;cancelAnimationFrame(io);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(o)return s(),qe;const i=requestAnimationFrame(s);return io=i,()=>{io===i&&(cancelAnimationFrame(i),io=0)}}const kr={inert:new WeakMap,"aria-hidden":new WeakMap},Fi="data-base-ui-inert",Hr={inert:new WeakSet,"aria-hidden":new WeakSet};let Tn=new WeakMap,Sr=0;function yy(e){return Hr[e]}function Qc(e){return e?hn(e)?e.host:Qc(e.parentNode):null}const _i=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Qc(n);return e.contains(o)?o:null}).filter(n=>n!=null),Bi=e=>{const t=new Set;return e.forEach(n=>{let o=n;for(;o&&!t.has(o);)t.add(o),o=o.parentNode}),t},zi=(e,t,n)=>{const o=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{Ke(i)!=="script"&&(t.has(i)?r(i):o.push(i))})};return r(e),o};function xy(e,t,n,o,{mark:r=!0}){let s=null;o?s="inert":n&&(s="aria-hidden");let i=null,a=null;const c=_i(t,e),l=r?zi(t,Bi(c),new Set(c)):[],u=[],f=[];if(s){const p=kr[s],g=yy(s);a=g,i=p;const h=_i(t,Array.from(t.querySelectorAll("[aria-live]"))),w=c.concat(h);zi(t,Bi(w),new Set(w)).forEach(b=>{const x=b.getAttribute(s),S=x!==null&&x!=="false",v=(p.get(b)||0)+1;p.set(b,v),u.push(b),v===1&&S&&g.add(b),S||b.setAttribute(s,s==="inert"?"":"true")})}return r&&l.forEach(p=>{const g=(Tn.get(p)||0)+1;Tn.set(p,g),f.push(p),g===1&&p.setAttribute(Fi,"")}),Sr+=1,()=>{i&&u.forEach(p=>{const h=(i.get(p)||0)-1;i.set(p,h),h||(!(a!=null&&a.has(p))&&s&&p.removeAttribute(s),a==null||a.delete(p))}),r&&f.forEach(p=>{const g=(Tn.get(p)||0)-1;Tn.set(p,g),g||p.removeAttribute(Fi)}),Sr-=1,Sr||(kr.inert=new WeakMap,kr["aria-hidden"]=new WeakMap,Hr.inert=new WeakSet,Hr["aria-hidden"]=new WeakSet,Tn=new WeakMap)}}function Hi(e,t={}){const{ariaHidden:n=!1,inert:o=!1,mark:r=!0}=t,s=Me(e[0]).body;return xy(e,s,n,o,{mark:r})}const vy=500,wy=500,ky={style:{transition:"none"}},Sy="data-base-ui-click-trigger",Ry={fallbackAxisSide:"none"},Jc={fallbackAxisSide:"end"},Ey={clipPath:"inset(50%)",position:"fixed",top:0,left:0},el=d.createContext(null),tl=()=>d.useContext(el),Cy=Vn("portal");function nl(e={}){const{ref:t,container:n,componentProps:o=De,elementProps:r}=e,s=_t(),i=tl(),a=i==null?void 0:i.portalNode,[c,l]=d.useState(null),[u,f]=d.useState(null),p=de(m=>{m!==null&&f(m)}),g=d.useRef(null);Q(()=>{if(n===null){g.current&&(g.current=null,f(null),l(null));return}if(s==null)return;const m=(n&&(es(n)?n:n.current))??a??document.body;if(m==null){g.current&&(g.current=null,f(null),l(null));return}g.current!==m&&(g.current=m,f(null),l(m))},[n,a,s]);const h=Le("div",o,{ref:[t,p],props:[{id:s,[Cy]:""},r]});return{portalNode:u,portalSubtree:c&&h?pt.createPortal(h,c):null}}const ol=d.forwardRef(function(t,n){const{render:o,className:r,style:s,children:i,container:a,renderGuards:c,...l}=t,{portalNode:u,portalSubtree:f}=nl({container:a,ref:n,componentProps:t,elementProps:l}),p=d.useRef(null),g=d.useRef(null),h=d.useRef(null),w=d.useRef(null),[m,b]=d.useState(null),x=d.useRef(!1),S=m==null?void 0:m.modal,v=m==null?void 0:m.open,E=typeof c=="boolean"?c:!!m&&!m.modal&&m.open&&!!u;d.useEffect(()=>{if(!u||S)return;function C(R){u&&R.relatedTarget&&fn(R)&&(R.type==="focusin"?x.current&&(Li(u),x.current=!1):(by(u),x.current=!0))}return xt(Se(u,"focusin",C,!0),Se(u,"focusout",C,!0))},[u,S]),Q(()=>{!u||v!==!0||!x.current||(Li(u),x.current=!1)},[v,u]);const y=d.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:g,beforeInsideRef:h,afterInsideRef:w,portalNode:u,setFocusManagerState:b}),[u]);return k.jsxs(d.Fragment,{children:[f,k.jsxs(el.Provider,{value:y,children:[E&&u&&k.jsx(bn,{"data-type":"outside",ref:p,onFocus:C=>{var R;if(fn(C,u))(R=h.current)==null||R.focus();else{const O=m?m.domReference:null,P=Xc(O);P==null||P.focus()}}}),E&&u&&k.jsx("span",{"aria-owns":u.id,style:Ey}),u&&pt.createPortal(i,u),E&&u&&k.jsx(bn,{"data-type":"outside",ref:g,onFocus:C=>{var R;if(fn(C,u))(R=w.current)==null||R.focus();else{const O=m?m.domReference:null,P=Rs(O);P==null||P.focus(),m!=null&&m.closeOnFocusOut&&(m==null||m.onOpenChange(!1,we(gn,C.nativeEvent)))}}})]})]})});function rl(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}class Es{constructor(){Ie(this,"nodesRef",{current:[]});Ie(this,"events",rl())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const sl=d.createContext(null),il=d.createContext(null),Wt=()=>{var e;return((e=d.useContext(sl))==null?void 0:e.id)||null},Gt=e=>{const t=d.useContext(il);return e??t};function al(e){const t=_t(),n=Gt(e),o=Wt();return Q(()=>{if(!t)return;const r={id:t,parentId:o};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,o]),t}function Ty(e){const{children:t,id:n}=e,o=Wt();return k.jsx(sl.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function My(e){const{children:t,externalTree:n}=e,o=et(()=>n??new Es).current;return k.jsx(il.Provider,{value:o,children:t})}function Py(e,t){const n=Fe(Ve(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Vi=20;let Lt=[];function Cs(){Lt=Lt.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Wi(e){Cs(),e&&Ke(e)!=="body"&&(Lt.push(new WeakRef(e)),Lt.length>Vi&&(Lt=Lt.slice(-Vi)))}function Gi(){var e;return Cs(),(e=Lt[Lt.length-1])==null?void 0:e.deref()}function Oy(e){return e?Ss(e)?e:qn(e)[0]||e:null}function qi(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=Yc(e).filter(s=>{const i=s.getAttribute("data-tabindex")||"";return Ss(s)||s.hasAttribute("data-tabindex")&&!i.startsWith("-")}),o=e.getAttribute("tabindex");n.length===0?o!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function cl(e){const{context:t,children:n,disabled:o=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:l="",nextFocusableElement:u,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:g,getInsideElements:h}=e,w="rootStore"in t?t.rootStore:t,m=w.useState("open"),b=w.useState("domReferenceElement"),x=w.useState("floatingElement"),{events:S,dataRef:v}=w.context,E=de(()=>{var H;return(H=v.current.floatingContext)==null?void 0:H.nodeId}),y=r===!1,C=jr(b)&&y,R=Be(r),O=Be(s),P=Be(l),j=Be(m),L=Gt(g),$=tl(),T=d.useRef(!1),M=d.useRef(!1),N=d.useRef(!1),D=d.useRef(null),A=d.useRef(""),F=d.useRef(""),I=d.useRef(null),B=d.useRef(null),V=Ft(I,p,$==null?void 0:$.beforeInsideRef),re=Ft(B,$==null?void 0:$.afterInsideRef),se=Xe(),G=Xe(),W=Hn(),ae=$!=null,U=Fr(x),ee=de((H=U)=>H?qn(H):[]),ye=de(()=>(h==null?void 0:h().filter(H=>H!=null))??[]);d.useEffect(()=>{if(o||!a)return;function H(Y){Y.key==="Tab"&&ue(U,Je(Me(U)))&&ee().length===0&&!C&&ft(Y)}const te=Me(U);return Se(te,"keydown",H)},[o,U,a,C,ee]),d.useEffect(()=>{if(o||!m)return;const H=Me(U);function te(){N.current=!1}function Y(xe){const ce=Ve(xe),pe=ye(),Z=ue(x,ce)||ue(b,ce)||ue($==null?void 0:$.portalNode,ce)||pe.some(Ce=>Ce===ce||ue(Ce,ce));N.current=!Z,F.current=xe.pointerType||"keyboard",ce!=null&&ce.closest(`[${Sy}]`)&&(M.current=!0,G.start(0,()=>{M.current=!1}))}function he(){F.current="keyboard"}return xt(Se(H,"pointerdown",Y,!0),Se(H,"pointerup",te,!0),Se(H,"pointercancel",te,!0),Se(H,"keydown",he,!0),te)},[o,x,b,U,m,$,G,ye]),d.useEffect(()=>{if(o||!c)return;const H=Me(U);function te(){M.current=!0,G.start(0,()=>{M.current=!1})}function Y(pe){const Z=Ve(pe);Ss(Z)&&(D.current=Z)}function he(pe){const Z=pe.relatedTarget,Ce=pe.currentTarget,fe=Ve(pe);a&&Z==null&&fe!=null&&ue(x,fe)&&Wi(fe),queueMicrotask(()=>{const le=E(),Oe=w.context.triggerElements,_=ye(),z=(Z==null?void 0:Z.hasAttribute(Vn("focus-guard")))&&[I.current,B.current,$==null?void 0:$.beforeInsideRef.current,$==null?void 0:$.afterInsideRef.current,$==null?void 0:$.beforeOutsideRef.current,$==null?void 0:$.afterOutsideRef.current,Rt(f),Rt(u)].includes(Z),be=!(ue(b,Z)||ue(x,Z)||ue(Z,x)||ue($==null?void 0:$.portalNode,Z)||_.some(K=>K===Z||ue(K,Z))||Z!=null&&Oe.hasElement(Z)||Oe.hasMatchingElement(K=>ue(K,Z))||z||L&&(Bt(L.nodesRef.current,le).find(K=>{var q,ve;return ue((q=K.context)==null?void 0:q.elements.floating,Z)||ue((ve=K.context)==null?void 0:ve.elements.domReference,Z)})||ji(L.nodesRef.current,le).find(K=>{var q,ve,Te;return[(q=K.context)==null?void 0:q.elements.floating,Fr((ve=K.context)==null?void 0:ve.elements.floating)].includes(Z)||((Te=K.context)==null?void 0:Te.elements.domReference)===Z})));if(Ce===b&&U&&qi(U),i&&Ce!==b&&!Qo(fe)&&Je(H)===H.body){if(Ne(U)&&(U.focus(),i==="popup")){W.request(()=>{U.focus()});return}const K=ee(),q=D.current,ve=(q&&K.includes(q)?q:null)||K[K.length-1]||U;Ne(ve)&&ve.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(C||!a)&&Z&&be&&!M.current&&(C||Z!==Gi())&&(T.current=!0,w.setOpen(!1,we(gn,pe)))})}function xe(){N.current||(v.current.insideReactTree=!0,se.start(0,()=>{v.current.insideReactTree=!1}))}const ce=Ne(b)?b:null;if(!(!x&&!ce))return xt(ce&&Se(ce,"focusout",he),ce&&Se(ce,"pointerdown",te),x&&Se(x,"focusin",Y),x&&Se(x,"focusout",he),x&&$&&Se(x,"focusout",xe,!0))},[o,b,x,U,a,L,$,w,c,i,ee,C,E,v,se,G,W,u,f,ye]),d.useEffect(()=>{var Ce,fe,le;if(o||!x||!m)return;const H=Array.from(((Ce=$==null?void 0:$.portalNode)==null?void 0:Ce.querySelectorAll(`[${Vn("portal")}]`))||[]),Y=(le=(fe=(L?ji(L.nodesRef.current,E()):[]).find(Oe=>{var _;return jr(((_=Oe.context)==null?void 0:_.elements.domReference)||null)}))==null?void 0:fe.context)==null?void 0:le.elements.domReference,xe=[...[x,...H,I.current,B.current,$==null?void 0:$.beforeOutsideRef.current,$==null?void 0:$.afterOutsideRef.current,...ye()],Y,Rt(f),Rt(u),C?b:null].filter(Oe=>Oe!=null),ce=Hi(xe,{ariaHidden:a||C,mark:!1}),pe=[x,...H].filter(Oe=>Oe!=null),Z=Hi(pe);return()=>{Z(),ce()}},[m,o,b,x,a,$,C,L,E,u,f,ye]),Q(()=>{if(!m||o||!Ne(U))return;const H=Me(U),te=Je(H);queueMicrotask(()=>{const Y=R.current,he=typeof Y=="function"?Y(P.current||""):Y;if(he===void 0||he===!1||ue(U,te))return;let ce=null;const pe=()=>(ce==null&&(ce=ee(U)),ce[0]||U);let Z;he===!0||he===null?Z=pe():Z=Rt(he),Z=Z||pe();const Ce=ue(U,Je(H));mo(Z,{preventScroll:Z===U,shouldFocus(){if(!j.current)return!1;if(Ce)return!0;const fe=Je(H);return!(fe!==Z&&ue(U,fe))}})})},[o,m,U,ee,R,P,j]),Q(()=>{if(o||!U)return;const H=Me(U),te=Je(H),Y=P.current==null;Wi(te);function he(ce){if(ce.open||(A.current=Py(ce.nativeEvent,F.current)),ce.reason===Ue&&ce.nativeEvent.type==="mouseleave"&&(T.current=!0),ce.reason===ps)if(ce.nested)T.current=!1;else if(Ac(ce.nativeEvent)||$c(ce.nativeEvent))T.current=!1;else{let pe=!1;Me(U).createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?T.current=!1:T.current=!0}}S.on("openchange",he);function xe(){const ce=O.current;let pe=typeof ce=="function"?ce(A.current):ce;if(pe===void 0||pe===!1)return null;pe===null&&(pe=!0);const Z=b!=null&&b.isConnected?b:null,Ce=te!=null&&te.isConnected&&Ke(te)!=="body"?te:null;let fe=Y?Ce||Z:Z||Ce;return fe||(fe=Gi()||null),typeof pe=="boolean"?fe:Rt(pe)||fe||null}return()=>{S.off("openchange",he);const ce=Je(H),pe=ye(),Z=ue(x,ce)||pe.some(le=>le===ce||ue(le,ce))||L&&Bt(L.nodesRef.current,E(),!1).some(le=>{var Oe;return ue((Oe=le.context)==null?void 0:Oe.elements.floating,ce)}),Ce=O.current,fe=xe();queueMicrotask(()=>{const le=Oy(fe),Oe=typeof Ce!="boolean";Ce&&!T.current&&Ne(le)&&(!(!Oe&&le!==ce&&ce!==H.body)||Z)&&le.focus({preventScroll:!0}),T.current=!1})}},[o,x,U,O,P,S,L,b,E,ye]),Q(()=>{if(!sn||m||!x)return;const H=Je(Me(x));!Ne(H)||!Zo(H)||ue(x,H)&&H.blur()},[m,x]),Q(()=>{if(!(o||!$))return $.setFocusManagerState({modal:a,closeOnFocusOut:c,open:m,onOpenChange:w.setOpen,domReference:b}),()=>{$.setFocusManagerState(null)}},[o,$,a,m,w,c,b]),Q(()=>{if(!(o||!U))return qi(U),()=>{queueMicrotask(Cs)}},[o,U]);const ke=!o&&(a?!C:!0)&&(ae||a);return k.jsxs(d.Fragment,{children:[ke&&k.jsx(bn,{"data-type":"inside",ref:V,onFocus:H=>{var te;if(a){const Y=ee();mo(Y[Y.length-1])}else if($!=null&&$.portalNode)if(T.current=!1,fn(H,$.portalNode)){const Y=Rs(b);Y==null||Y.focus()}else(te=Rt(f??$.beforeOutsideRef))==null||te.focus()}}),n,ke&&k.jsx(bn,{"data-type":"inside",ref:re,onFocus:H=>{var te;if(a)mo(ee()[0]);else if($!=null&&$.portalNode)if(c&&(T.current=!0),fn(H,$.portalNode)){const Y=Xc(b);Y==null||Y.focus()}else(te=Rt(u??$.afterOutsideRef))==null||te.focus()}})]})}function ll(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:i=!0,touchOpenDelay:a=0,reason:c=rn}=t,l="rootStore"in e?e.rootStore:e,u=l.context.dataRef,f=d.useRef(void 0),p=Hn(),g=Xe(),h=d.useMemo(()=>{function w(b,x,S,v){const E=we(c,x,S);b&&v==="touch"&&a>0?g.start(a,()=>{l.setOpen(!0,E)}):l.setOpen(b,E)}function m(b,x,S){const v=u.current.openEvent,E=l.select("domReferenceElement")!==x;return b&&E||!b||!r?!0:v&&i?!S(v.type):!1}return{onPointerDown(b){f.current=b.pointerType},onMouseDown(b){const x=f.current,S=b.nativeEvent,v=l.select("open");if(b.button!==0||o==="click"||Jt(x,!0)&&s)return;const E=m(v,b.currentTarget,R=>R==="click"||R==="mousedown"),y=Ve(S);if(Zo(y)){w(E,S,y,x);return}const C=b.currentTarget;p.request(()=>{w(E,S,C,x)})},onClick(b){if(o==="mousedown-only")return;const x=f.current;if(o==="mousedown"&&x){f.current=void 0;return}if(Jt(x,!0)&&s)return;const S=l.select("open"),v=m(S,b.currentTarget,E=>E==="click"||E==="mousedown"||E==="keydown"||E==="keyup");w(v,b.nativeEvent,b.currentTarget,x)},onKeyDown(){f.current=void 0}}},[u,o,s,c,l,i,r,p,g,a]);return d.useMemo(()=>n?{reference:h}:De,[n,h])}function Iy(e,t){let n=null,o=null,r=!1;return{contextElement:e||void 0,getBoundingClientRect(){var g;const s=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(((g=t.dataRef.current.openEvent)==null?void 0:g.type)||"")&&t.pointerType!=="touch";let l=s.width,u=s.height,f=s.x,p=s.y;return n==null&&t.x&&i&&(n=s.x-t.x),o==null&&t.y&&a&&(o=s.y-t.y),f-=n||0,p-=o||0,l=0,u=0,!r||c?(l=t.axis==="y"?s.width:0,u=t.axis==="x"?s.height:0,f=i&&t.x!=null?t.x:f,p=a&&t.y!=null?t.y:p):r&&!c&&(u=t.axis==="x"?s.height:u,l=t.axis==="y"?s.width:l),r=!0,{width:l,height:u,x:f,y:p,top:p,right:f+l,bottom:p+u,left:f}}}}function Ui(e){return e!=null&&e.clientX!=null}function Ay(e,t={}){const{enabled:n=!0,axis:o="both"}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("open"),i=r.useState("floatingElement"),a=r.useState("domReferenceElement"),c=r.context.dataRef,l=d.useRef(!1),u=d.useRef(null),[f,p]=d.useState(),[g,h]=d.useState([]),w=de(v=>{r.set("positionReference",v)}),m=de((v,E,y)=>{l.current||c.current.openEvent&&!Ui(c.current.openEvent)||r.set("positionReference",Iy(y??a,{x:v,y:E,axis:o,dataRef:c,pointerType:f}))}),b=de(v=>{s?u.current||(m(v.clientX,v.clientY,v.currentTarget),h([])):m(v.clientX,v.clientY,v.currentTarget)}),x=Jt(f)?i:s;d.useEffect(()=>{if(!n){w(a);return}if(!x)return;function v(){var C;(C=u.current)==null||C.call(u),u.current=null}const E=Fe(i);function y(C){const R=Ve(C);ue(i,R)?v():m(C.clientX,C.clientY)}return!c.current.openEvent||Ui(c.current.openEvent)?u.current=Se(E,"mousemove",y):w(a),v},[x,n,i,c,a,r,m,w,g]),d.useEffect(()=>()=>{r.set("positionReference",null)},[r]),d.useEffect(()=>{n&&!i&&(l.current=!1)},[n,i]),d.useEffect(()=>{!n&&s&&(l.current=!0)},[n,s]);const S=d.useMemo(()=>{function v(E){p(E.pointerType)}return{onPointerDown:v,onPointerEnter:v,onMouseMove:b,onMouseEnter:b}},[b]);return d.useMemo(()=>n?{reference:S,trigger:S}:{},[n,S])}function $y(){return!1}function Ny(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Ts(e,t={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:i=$y,bubbles:a,externalTree:c}=t,l="rootStore"in e?e.rootStore:e,u=l.useState("open"),f=l.useState("floatingElement"),{dataRef:p}=l.context,g=Gt(c),h=de(typeof r=="function"?r:()=>!1),w=typeof r=="function"?h:r,m=w!==!1,b=de(()=>s),{escapeKey:x,outsidePress:S}=Ny(a),v=d.useRef(!1),E=d.useRef(!1),y=d.useRef(!1),C=d.useRef(!1),R=d.useRef(""),O=d.useRef(null),P=Xe(),j=Xe(),L=de(()=>{j.clear(),p.current.insideReactTree=!1}),$=de(V=>{var G;const re=(G=p.current.floatingContext)==null?void 0:G.nodeId;return(g?Bt(g.nodesRef.current,re):[]).some(W=>{var ae;return((ae=W.context)==null?void 0:ae.open)&&!W.context.dataRef.current[V]})}),T=de(V=>vr(V,l.select("floatingElement"))||vr(V,l.select("domReferenceElement"))),M=de(V=>{i()&&l.setOpen(!1,we(rn,V.nativeEvent))}),N=de(V=>{if(!u||!n||!o||V.key!=="Escape"||C.current||!x&&$("__escapeKeyBubbles"))return;const re=Hb(V)?V.nativeEvent:V,se=we(Wo,re);l.setOpen(!1,se),se.isCanceled||V.preventDefault(),!x&&!se.isPropagationAllowed&&V.stopPropagation()}),D=de(()=>{p.current.insideReactTree=!0,j.start(0,L)}),A=de(V=>{if(!u||!n||V.button!==0)return;const re=Ve(V.nativeEvent);ue(l.select("floatingElement"),re)&&(v.current||(v.current=!0,E.current=!1))}),F=de(V=>{!u||!n||(V.defaultPrevented||V.nativeEvent.defaultPrevented)&&v.current&&(E.current=!0)});d.useEffect(()=>{if(!u||!n)return;p.current.__escapeKeyBubbles=x,p.current.__outsidePressBubbles=S;const V=new ht,re=new ht;function se(){V.clear(),C.current=!0}function G(){V.start(sn?5:0,()=>{C.current=!1})}function W(){y.current=!0,re.start(0,()=>{y.current=!1})}function ae(){v.current=!1,E.current=!1}function U(){const _=R.current,z=_==="pen"||!_?"mouse":_,be=b(),K=typeof be=="function"?be():be;return typeof K=="string"?K:K[z]}function ee(_){const z=U();return z==="intentional"&&_.type!=="click"||z==="sloppy"&&_.type==="click"}function ye(_){var K;const z=(K=p.current.floatingContext)==null?void 0:K.nodeId,be=g&&Bt(g.nodesRef.current,z).some(q=>{var ve;return vr(_,(ve=q.context)==null?void 0:ve.elements.floating)});return T(_)||be}function ke(_){if(ee(_)){_.type!=="click"&&!T(_)&&(re.clear(),y.current=!1),L();return}if(p.current.insideReactTree){L();return}const z=Ve(_),be=`[${Vn("inert")}]`,K=Ee(z)?z.getRootNode():null,q=Array.from((hn(K)?K:Me(l.select("floatingElement"))).querySelectorAll(be)),ve=l.context.triggerElements;if(z&&(ve.hasElement(z)||ve.hasMatchingElement(Ge=>ue(Ge,z))))return;let Te=Ee(z)?z:null;for(;Te&&!Tt(Te);){const Ge=Ot(Te);if(Tt(Ge)||!Ee(Ge))break;Te=Ge}if(!(q.length&&Ee(z)&&!Wb(z)&&!ue(z,l.select("floatingElement"))&&q.every(Ge=>!ue(Te,Ge)))){if(Ne(z)&&!("touches"in _)){const Ge=Tt(z),ze=at(z),nt=/auto|scroll/,cn=Ge||nt.test(ze.overflowX),qt=Ge||nt.test(ze.overflowY),Kn=cn&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,Xn=qt&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,Zn=ze.direction==="rtl",Qn=Xn&&(Zn?_.offsetX<=z.offsetWidth-z.clientWidth:_.offsetX>z.clientWidth),Jn=Kn&&_.offsetY>z.clientHeight;if(Qn||Jn)return}if(!ye(_)){if(U()==="intentional"&&y.current){re.clear(),y.current=!1;return}typeof w=="function"&&!w(_)||$("__outsidePressBubbles")||(l.setOpen(!1,we(ps,_)),L())}}}function H(_){U()!=="sloppy"||_.pointerType==="touch"||!l.select("open")||!n||T(_)||ke(_)}function te(_){if(U()!=="sloppy"||!l.select("open")||!n||T(_))return;const z=_.touches[0];z&&(O.current={startTime:Date.now(),startX:z.clientX,startY:z.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function Y(_,z){const be=Ve(_);if(!be)return;const K=Se(be,_.type,()=>{z(_),K()})}function he(_){R.current="touch",Y(_,te)}function xe(_){P.clear(),_.type==="pointerdown"&&(R.current=_.pointerType),!(_.type==="mousedown"&&O.current&&!O.current.dismissOnMouseDown)&&Y(_,z=>{z.type==="pointerdown"?H(z):ke(z)})}function ce(_){if(!v.current)return;const z=E.current;if(ae(),U()==="intentional"){if(_.type==="pointercancel"){z&&W();return}if(!ye(_)){if(z){W();return}typeof w=="function"&&!w(_)||(re.clear(),y.current=!0,L())}}}function pe(_){if(U()!=="sloppy"||!O.current||T(_))return;const z=_.touches[0];if(!z)return;const be=Math.abs(z.clientX-O.current.startX),K=Math.abs(z.clientY-O.current.startY),q=Math.sqrt(be*be+K*K);q>5&&(O.current.dismissOnTouchEnd=!0),q>10&&(ke(_),P.clear(),O.current=null)}function Z(_){Y(_,pe)}function Ce(_){U()!=="sloppy"||!O.current||T(_)||(O.current.dismissOnTouchEnd&&ke(_),P.clear(),O.current=null)}function fe(_){Y(_,Ce)}const le=Me(f),Oe=xt(o&&xt(Se(le,"keydown",N),Se(le,"compositionstart",se),Se(le,"compositionend",G)),m&&xt(Se(le,"click",xe,!0),Se(le,"pointerdown",xe,!0),Se(le,"pointerup",ce,!0),Se(le,"pointercancel",ce,!0),Se(le,"mousedown",xe,!0),Se(le,"mouseup",ce,!0),Se(le,"touchstart",he,!0),Se(le,"touchmove",Z,!0),Se(le,"touchend",fe,!0)));return()=>{Oe(),V.clear(),re.clear(),ae(),y.current=!1}},[p,f,o,m,w,u,n,x,S,N,L,b,$,T,g,l,P]),d.useEffect(L,[w,L]);const I=d.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),B=d.useMemo(()=>({onKeyDown:N,onPointerDown:F,onMouseDown:F,onClickCapture:D,onMouseDownCapture(V){D(),A(V)},onPointerDownCapture(V){D(),A(V)},onMouseUpCapture:D,onTouchEndCapture:D,onTouchMoveCapture:D}),[N,D,A,F]);return d.useMemo(()=>n?{reference:I,floating:B,trigger:I}:{},[n,I,B])}function Yi(e,t,n){let{reference:o,floating:r}=e;const s=lt(t),i=ks(t),a=ws(i),c=it(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let g;switch(c){case"top":g={x:u,y:o.y-r.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-r.width,y:f};break;default:g={x:o.x,y:o.y}}const h=Vt(t);return h&&(g[i]+=p*(h==="end"?1:-1)*(n&&l?-1:1)),g}async function Dy(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=It(t,e),h=zc(g),m=a[p?f==="floating"?"reference":"floating":f],b=Io(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),x=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),v=await(s.isElement==null?void 0:s.isElement(S))&&await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1},E=Io(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:S,strategy:c}):x);return{top:(b.top-E.top+h.top)/v.y,bottom:(E.bottom-b.bottom+h.bottom)/v.y,left:(b.left-E.left+h.left)/v.x,right:(E.right-b.right+h.right)/v.x}}const Ly=50,jy=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Dy},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Yi(l,o,c),p=o,g=0;const h={};for(let w=0;w<s.length;w++){const m=s[w];if(!m)continue;const{name:b,fn:x}=m,{x:S,y:v,data:E,reset:y}=await x({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});u=S??u,f=v??f,h[b]={...h[b],...E},y&&g<Ly&&(g++,typeof y=="object"&&(y.placement&&(p=y.placement),y.rects&&(l=y.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):y.rects),{x:u,y:f}=Yi(l,p,c)),w=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:h}},Fy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:w=!0,...m}=It(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=it(r),x=lt(a),S=it(a)===a,v=await(c.isRTL==null?void 0:c.isRTL(l.floating)),E=p||(S||!w?[Oo(a)]:oy(a)),y=h!=="none";!p&&y&&E.push(...ay(a,w,h,v));const C=[a,...E],R=await c.detectOverflow(t,m),O=[];let P=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&O.push(R[b]),f){const T=ny(r,i,v);O.push(R[T[0]],R[T[1]])}if(P=[...P,{placement:r,overflows:O}],!O.every(T=>T<=0)){var j,L;const T=(((j=s.flip)==null?void 0:j.index)||0)+1,M=C[T];if(M&&(!(f==="alignment"?x!==lt(M):!1)||P.every(A=>lt(A.placement)===x?A.overflows[0]>0:!0)))return{data:{index:T,overflows:P},reset:{placement:M}};let N=(L=P.filter(D=>D.overflows[0]<=0).sort((D,A)=>D.overflows[1]-A.overflows[1])[0])==null?void 0:L.placement;if(!N)switch(g){case"bestFit":{var $;const D=($=P.filter(A=>{if(y){const F=lt(A.placement);return F===x||F==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(F=>F>0).reduce((F,I)=>F+I,0)]).sort((A,F)=>A[1]-F[1])[0])==null?void 0:$[0];D&&(N=D);break}case"initialPlacement":N=a;break}if(r!==N)return{reset:{placement:N}}}return{}}}};function Ki(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xi(e){return ey.some(t=>e[t]>=0)}const _y=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=It(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=Ki(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Xi(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=Ki(i,n.floating);return{data:{escapedOffsets:a,escaped:Xi(a)}}}default:return{}}}}},ul=new Set(["left","top"]);async function By(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=it(n),a=Vt(n),c=lt(n)==="y",l=ul.has(i)?-1:1,u=s&&c?-1:1,f=It(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),c?{x:g*u,y:p*l}:{x:p*l,y:g*u}}const zy=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await By(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},Hy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:S,y:v}=x;return{x:S,y:v}}},...l}=It(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=lt(r),g=vs(p);let h=u[g],w=u[p];const m=(x,S)=>Bc(S+f[x==="y"?"top":"left"],S,S-f[x==="y"?"bottom":"right"]);i&&(h=m(g,h)),a&&(w=m(p,w));const b=c.fn({...t,[g]:h,[p]:w});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[g]:i,[p]:a}}}}}},Vy=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:s,placement:i,rects:a,middlewareData:c}=t,{offset:l=0,mainAxis:u=!0,crossAxis:f=!0}=It(e,t),p={x:r,y:s},g=lt(i),h=vs(g);let w=p[h],m=p[g];const b=It(l,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(o=b.crossAxis)!=null?o:0};if(u){const E=h==="y"?"height":"width",y=a.reference[h]-a.floating[E]+x.mainAxis,C=a.reference[h]+a.reference[E]-x.mainAxis;w<y?w=y:w>C&&(w=C)}if(f){var S,v;const E=h==="y"?"width":"height",y=ul.has(it(i)),C=a.reference[g]-a.floating[E]+(y&&((S=c.offset)==null?void 0:S[g])||0)+(y?0:x.crossAxis),R=a.reference[g]+a.reference[E]+(y?0:((v=c.offset)==null?void 0:v[g])||0)-(y?x.crossAxis:0);m<C?m=C:m>R&&(m=R)}return{[h]:w,[g]:m}}}},Wy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:s}=t,{apply:i=()=>{},...a}=It(e,t),c=await r.detectOverflow(t,a),l=it(n),u=Vt(n),f=lt(n)==="y",{width:p,height:g}=o.floating;let h,w;l==="top"||l==="bottom"?(h=l,w=u===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(w=l,h=u==="end"?"top":"bottom");const m=g-c.top-c.bottom,b=p-c.left-c.right,x=yn(g-c[h],m),S=yn(p-c[w],b),v=t.middlewareData.shift,E=!v;let y=x,C=S;v!=null&&v.enabled.x&&(C=b),v!=null&&v.enabled.y&&(y=m),E&&!u&&(f?C=p-2*Mt(c.left,c.right):y=g-2*Mt(c.top,c.bottom)),await i({...t,availableWidth:C,availableHeight:y});const R=await r.getDimensions(s.floating);return p!==R.width||g!==R.height?{reset:{rects:!0}}:{}}}};function dl(e){const t=at(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ne(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=Po(n)!==s||Po(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Ms(e){return Ee(e)?e:e.contextElement}function pn(e){const t=Ms(e);if(!Ne(t))return Pt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=dl(t);let i=(s?Po(n.width):n.width)/o,a=(s?Po(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Gy=Pt(0);function fl(e){const t=Fe(e);return!ns()||!t.visualViewport?Gy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qy(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Fe(e)}function en(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Ms(e);let i=Pt(1);t&&(o?Ee(o)&&(i=pn(o)):i=pn(e));const a=qy(s,n,o)?fl(s):Pt(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s&&o){const p=Fe(s),g=Ee(o)?Fe(o):o;let h=p,w=Pr(h);for(;w&&g!==h;){const m=pn(w),b=w.getBoundingClientRect(),x=at(w),S=b.left+(w.clientLeft+parseFloat(x.paddingLeft))*m.x,v=b.top+(w.clientTop+parseFloat(x.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,f*=m.y,c+=S,l+=v,h=Fe(w),w=Pr(h)}}return Io({width:u,height:f,x:c,y:l})}function Jo(e,t){const n=Ho(e).scrollLeft;return t?t.left+n:en(At(e)).left+n}function pl(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Uy(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=At(o),a=t?zo(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Pt(1);const u=Pt(0),f=Ne(o);if((f||!s)&&((Ke(o)!=="body"||nn(i))&&(c=Ho(o)),f)){const g=en(o);l=pn(o),u.x=g.x+o.clientLeft,u.y=g.y+o.clientTop}const p=i&&!f&&!s?pl(i,c):Pt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function Yy(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ky(e){const t=Ho(e),n=e.ownerDocument.body,o=Mt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Mt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+Jo(e);const i=-t.scrollTop;return at(n).direction==="rtl"&&(s+=Mt(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:i}}const Xy=25;function Zy(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=Fe(e),s=At(e),i=r.visualViewport;let a=s.clientWidth,c=s.clientHeight,l=0,u=0;if(i){const p=!ns()||t==="fixed";o?p||(l=-i.offsetLeft,u=-i.offsetTop):(a=i.width,c=i.height,p&&(l=i.offsetLeft,u=i.offsetTop))}if(Jo(s)<=0){const p=s.ownerDocument,g=p.body,h=getComputedStyle(g),w=p.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(s.clientWidth-g.clientWidth-w),b=getComputedStyle(s).scrollbarGutter==="stable both-edges"?m/2:m;b<=Xy&&(a-=b)}return{width:a,height:c,x:l,y:u}}function Qy(e,t){const n=en(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=pn(e),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function Zi(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Zy(e,n,t);else if(t==="document")o=Ky(At(e));else if(Ee(t))o=Qy(t,n);else{const r=fl(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Io(o)}function Jy(e,t){const n=t.get(e);if(n)return n;let o=_n(e,[],!1).filter(a=>Ee(a)&&Ke(a)!=="body"),r=null;const s=at(e).position==="fixed";let i=s?Ot(e):e;for(;Ee(i)&&!Tt(i);){const a=at(i),c=ts(i),l=r?r.position:s?"fixed":"";!c&&(l==="fixed"||l==="absolute"&&a.position==="static")?o=o.filter(f=>f!==i):r=a,i=Ot(i)}return t.set(e,o),o}function ex(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?zo(t)?[]:Jy(t,this._c):[].concat(n),o],a=Zi(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const g=Zi(t,i[p],r);c=Mt(g.top,c),l=yn(g.right,l),u=yn(g.bottom,u),f=Mt(g.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function tx(e){const{width:t,height:n}=dl(e);return{width:t,height:n}}function nx(e,t,n){const o=Ne(t),r=At(t),s=n==="fixed",i=en(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Pt(0);if((o||!s)&&((Ke(t)!=="body"||nn(r))&&(a=Ho(t)),o)){const p=en(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}!o&&r&&(c.x=Jo(r));const l=r&&!o&&!s?pl(r,a):Pt(0),u=i.left+a.scrollLeft-c.x-l.x,f=i.top+a.scrollTop-c.y-l.y;return{x:u,y:f,width:i.width,height:i.height}}function Rr(e){return at(e).position==="static"}function Qi(e,t){if(!Ne(e)||at(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function hl(e,t){const n=Fe(e);if(zo(e))return n;if(!Ne(e)){let r=Ot(e);for(;r&&!Tt(r);){if(Ee(r)&&!Rr(r))return r;r=Ot(r)}return n}let o=Qi(e,t);for(;o&&sp(o)&&Rr(o);)o=Qi(o,t);return o&&Tt(o)&&Rr(o)&&!ts(o)?n:o||cp(e)||n}const ox=async function(e){const t=this.getOffsetParent||hl,n=this.getDimensions,o=await n(e.floating);return{reference:nx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rx(e){return at(e).direction==="rtl"}const sx={convertOffsetParentRelativeRectToViewportRelativeRect:Uy,getDocumentElement:At,getClippingRect:ex,getOffsetParent:hl,getElementRects:ox,getClientRects:Yy,getDimensions:tx,getScale:pn,isElement:Ee,isRTL:rx};function gl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ix(e,t,n){let o=null,r;const s=At(e);function i(){var u;clearTimeout(r),(u=o)==null||u.disconnect(),o=null}function a(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const p=e.getBoundingClientRect(),{left:g,top:h,width:w,height:m}=p;if(u||t(),!w||!m)return;const b=so(h),x=so(s.clientWidth-(g+w)),S=so(s.clientHeight-(h+m)),v=so(g),y={rootMargin:-b+"px "+-x+"px "+-S+"px "+-v+"px",threshold:Mt(0,yn(1,f))||1};let C=!0;function R(O){const P=O[0].intersectionRatio;if(!gl(p,e.getBoundingClientRect()))return a();if(P!==f){if(!C)return a();P?a(!1,P):r=setTimeout(()=>{a(!1,1e-7)},1e3)}C=!1}try{o=new IntersectionObserver(R,{...y,root:s.ownerDocument})}catch{o=new IntersectionObserver(R,y)}o.observe(e)}const c=Fe(e),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),i()}}function Vr(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Ms(e),u=r||s?[...l?_n(l):[],...t?_n(t):[]]:[];u.forEach(b=>{r&&b.addEventListener("scroll",n),s&&b.addEventListener("resize",n)});const f=l&&a?ix(l,n,s):null;let p=-1,g=null;i&&(g=new ResizeObserver(b=>{let[x]=b;x&&x.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let h,w=c?en(e):null;c&&m();function m(){const b=en(e);w&&!gl(w,b)&&n(),w=b,h=requestAnimationFrame(m)}return n(),()=>{var b;u.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(b=g)==null||b.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const ml=zy,ax=Hy,bl=Fy,cx=Wy,lx=_y,ux=Vy,yl=(e,t,n)=>{const o=new Map,r=n??{},s={...sx,...r.platform,_c:o};return jy(e,t,{...r,platform:s})};var dx=typeof document<"u",fx=function(){},bo=dx?d.useLayoutEffect:fx;function $o(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!$o(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!$o(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ji(e,t){const n=xl(e);return Math.round(t*n)/n}function Er(e){const t=d.useRef(e);return bo(()=>{t.current=e}),t}function px(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=d.useState(o);$o(p,o)||g(o);const[h,w]=d.useState(null),[m,b]=d.useState(null),x=d.useCallback(A=>{A!==y.current&&(y.current=A,w(A))},[]),S=d.useCallback(A=>{A!==C.current&&(C.current=A,b(A))},[]),v=s||h,E=i||m,y=d.useRef(null),C=d.useRef(null),R=d.useRef(u),O=c!=null,P=Er(c),j=Er(r),L=Er(l),$=d.useCallback(()=>{if(!y.current||!C.current)return;const A={placement:t,strategy:n,middleware:p};j.current&&(A.platform=j.current),yl(y.current,C.current,A).then(F=>{const I={...F,isPositioned:L.current!==!1};T.current&&!$o(R.current,I)&&(R.current=I,pt.flushSync(()=>{f(I)}))})},[p,t,n,j,L]);bo(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[l]);const T=d.useRef(!1);bo(()=>(T.current=!0,()=>{T.current=!1}),[]),bo(()=>{if(v&&(y.current=v),E&&(C.current=E),v&&E){if(P.current)return P.current(v,E,$);$()}},[v,E,$,P,O]);const M=d.useMemo(()=>({reference:y,floating:C,setReference:x,setFloating:S}),[x,S]),N=d.useMemo(()=>({reference:v,floating:E}),[v,E]),D=d.useMemo(()=>{const A={position:n,left:0,top:0};if(!N.floating)return A;const F=Ji(N.floating,u.x),I=Ji(N.floating,u.y);return a?{...A,transform:"translate("+F+"px, "+I+"px)",...xl(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:I}},[n,a,N.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:$,refs:M,elements:N,floatingStyles:D}),[u,$,M,N,D])}const hx=(e,t)=>{const n=ml(e);return{name:n.name,fn:n.fn,options:[e,t]}},gx=(e,t)=>{const n=ax(e);return{name:n.name,fn:n.fn,options:[e,t]}},mx=(e,t)=>({fn:ux(e).fn,options:[e,t]}),bx=(e,t)=>{const n=bl(e);return{name:n.name,fn:n.fn,options:[e,t]}},yx=(e,t)=>{const n=cx(e);return{name:n.name,fn:n.fn,options:[e,t]}},xx=(e,t)=>{const n=lx(e);return{name:n.name,fn:n.fn,options:[e,t]}};function vl(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}const ie=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(We(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a},Wr=[];let Gr;function vx(){return Gr}function wx(e){Wr.push(e)}function Ps(e){const t=(n,o)=>{const r=et(kx).current;let s;try{Gr=r;for(const i of Wr)i.before(r);s=e(n,o);for(const i of Wr)i.after(r);r.didInitialize=!0}finally{Gr=void 0}return s};return t.displayName=e.displayName||e.name,t}function wl(e){return d.forwardRef(Ps(e))}function kx(){return{didInitialize:!1}}const Sx=as(19),Rx=Sx?Cx:Tx;function kl(e,t,n,o,r){return Rx(e,t,n,o,r)}function Ex(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return _o.useSyncExternalStore(e.subscribe,s,s)}wx({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const o=e.syncHooks[n],r=o.selector(o.store.state,o.a1,o.a2,o.a3);Object.is(o.value,r)||(t=!0,o.value=r)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const r of e.syncHooks)n.add(r.store);const o=[];for(const r of n)o.push(r.subscribe(t));return()=>{for(const r of o)r()}}),_o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Cx(e,t,n,o,r){const s=vx();if(!s)return Ex(e,t,n,o,r);const i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,o)||!Object.is(a.a3,r))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=o,a.a3=r,a.value=t(e.getSnapshot(),n,o,r))):(a={store:e,selector:t,a1:n,a2:o,a3:r,value:t(e.getSnapshot(),n,o,r)},s.syncHooks.push(a)),a.value}function Tx(e,t,n,o,r){return Ba.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class Mx{constructor(t){Ie(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ie(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,o,r){return kl(this,t,n,o,r)}}class er extends Mx{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}useSyncedValue(t,n){d.useDebugValue(t);const o=this;Q(()=>{o.state[t]!==n&&o.set(t,n)},[o,t,n])}useSyncedValueWithCleanup(t,n){const o=this;Q(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);Q(()=>{n.update(t)},[n,...o])}useControlledProp(t,n){d.useDebugValue(t);const o=this,r=n!==void 0;Q(()=>{r&&!Object.is(o.state[t],n)&&o.setState({...o.state,[t]:n})},[o,t,n,r])}select(t,n,o,r){const s=this.selectors[t];return s(this.state,n,o,r)}useState(t,n,o,r){return d.useDebugValue(t),kl(this,this.selectors[t],n,o,r)}useContextCallback(t,n){d.useDebugValue(t);const o=de(n??qe);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const Px={open:ie(e=>e.open),transitionStatus:ie(e=>e.transitionStatus),domReferenceElement:ie(e=>e.domReferenceElement),referenceElement:ie(e=>e.positionReference??e.referenceElement),floatingElement:ie(e=>e.floatingElement),floatingId:ie(e=>e.floatingId)};class tr extends er{constructor(n){const{syncOnly:o,nested:r,onOpenChange:s,triggerElements:i,...a}=n;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:rl(),nested:r,triggerElements:i},Px);Ie(this,"syncOpenEvent",(n,o)=>{(!n||!this.state.open||o!=null&&Vb(o))&&(this.context.dataRef.current.openEvent=n?o:void 0)});Ie(this,"dispatchOpenChange",(n,o)=>{this.syncOpenEvent(n,o.event);const r={open:n,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",r)});Ie(this,"setOpen",(n,o)=>{var r,s,i,a;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,o);return}this.dispatchOpenChange(n,o),(a=(i=this.context).onOpenChange)==null||a.call(i,n,o)});this.syncOnly=o}}function Sl(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:o,floatingId:r,nested:s,onOpenChange:i}=e,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,f=i,p=d.useRef(null);o===void 0&&p.current===null&&(p.current=new tr({open:a,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const g=o??p.current;return t.useSyncedValue("floatingId",r),Q(()=>{const h={open:a,floatingId:r,referenceElement:c,floatingElement:l};Ee(c)&&(h.domReferenceElement=c),g.state.positionReference===g.state.referenceElement&&(h.positionReference=c),g.update(h)},[a,r,c,l,g]),g.context.onOpenChange=f,g.context.nested=s,g}const Os={tabIndex:-1,[Lr]:""};function Ox(e){return t=>t==="touch"?e.current:!0}function Rl(e,t,n=!1){const o=_t(),r=Wt()!=null,s=d.useRef(null);e===void 0&&s.current===null&&(s.current=t(o,r));const i=e??s.current;return Sl({popupStore:i,treatPopupAsFloatingElement:n,floatingRootContext:i.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:i.setOpen}),{store:i,internalStore:s.current}}function El(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const i=n.current,a=o.current,c=t.context.triggerElements.getById(i);a&&c===a&&(t.context.triggerElements.delete(i),s=!0),n.current=null,o.current=null}if(r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r),s=!0),s){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Is(e,t,n,o=!1){t?e.preventUnmountingOnClose=!1:o&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function Cl(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ix(e,t,n,o={}){var u,f,p;const r=n.reason,s=r===Ue,i=t&&r===dn,a=!t&&(r===rn||r===Wo),c=Cl(n);if((f=(u=e.context).onOpenChange)==null||f.call(u,t,n),n.isCanceled)return;(p=o.onBeforeDispatch)==null||p.call(o),e.state.floatingRootContext.dispatchOpenChange(t,n);const l=()=>{const g={...o.extraState,open:t};i?g.instantType="focus":a?g.instantType="dismiss":s&&(g.instantType=void 0),Is(g,t,n.trigger,c()),e.update(g)};s?pt.flushSync(l):l()}function Tl(e,t,n,o){vl(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:o,preventUnmountingOnClose:!1})})}function Ml(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=El(e,n),i=de(a=>{if(s(a),!a)return;const c=n.select("open"),l=n.select("activeTriggerId");if(l===e){n.update({activeTriggerElement:a,...c?o:null});return}l==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return Q(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function As(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,o=e.useState("open"),r=e.useState("triggerCount");Q(()=>{if(!o){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const s=e.context.triggerElements.size,i={};e.state.triggerCount!==s&&(i.triggerCount=s);const a=e.select("activeTriggerId");let c=null;if(a){const l=e.context.triggerElements.getById(a);l?l!==e.state.activeTriggerElement&&(i.activeTriggerElement=l):c=a}if(!c&&!a&&s===1){const l=e.context.triggerElements.entries().next();if(!l.done){const[u,f]=l.value;i.activeTriggerId=u,i.activeTriggerElement=f}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),c&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===c&&!e.context.triggerElements.getById(c)){const l=we(kn);e.setOpen(!1,l),l.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,r,n])}function $s(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=_b(e),i=t.useState("preventUnmountingOnClose"),a=e?!1:i;t.useSyncedValues({mounted:o,transitionStatus:s,preventUnmountingOnClose:a});const c=de(()=>{var l,u;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(u=(l=t.context).onOpenChangeComplete)==null||u.call(l,!1)});return Yo({enabled:o&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function Ns(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:De,inactiveTriggerProps:De,popupProps:De})},[e])}function Ax(e,t){Q(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Q(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Un{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function $x(){return new tr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Un,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Ds(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:$x(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:De,inactiveTriggerProps:De,popupProps:De}}function Pl(e,t,n=!1){return new tr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const $n=ie(e=>e.triggerIdProp??e.activeTriggerId),Ls=ie(e=>e.openProp??e.open),ea=ie(e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0});function Ol(e,t){return t!==void 0&&Ls(e)&&$n(e)===t}function Nx(e,t){return Ol(e,t)?!0:t!==void 0&&Ls(e)&&$n(e)==null&&e.triggerCount===1}const js={open:Ls,mounted:ie(e=>e.mounted),transitionStatus:ie(e=>e.transitionStatus),floatingRootContext:ie(e=>e.floatingRootContext),triggerCount:ie(e=>e.triggerCount),preventUnmountingOnClose:ie(e=>e.preventUnmountingOnClose),payload:ie(e=>e.payload),activeTriggerId:$n,activeTriggerElement:ie(e=>e.mounted?e.activeTriggerElement:null),popupId:ea,isTriggerActive:ie((e,t)=>t!==void 0&&$n(e)===t),isOpenedByTrigger:ie((e,t)=>Ol(e,t)),isMountedByTrigger:ie((e,t)=>t!==void 0&&$n(e)===t&&e.mounted),triggerProps:ie((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:ie((e,t)=>Nx(e,t)?ea(e):void 0),popupProps:ie(e=>e.popupProps),popupElement:ie(e=>e.popupElement),positionerElement:ie(e=>e.positionerElement)};function Dx(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=_t(),s=Wt()!=null,i=et(()=>new tr({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new Un,floatingId:r,syncOnly:!1,nested:s})).current;return Q(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=Ee(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function Lx(e={}){const{nodeId:t,externalTree:n}=e,o=Dx(e),r=e.rootContext||o,s=r.useState("referenceElement"),i=r.useState("floatingElement"),a=r.useState("domReferenceElement"),c=r.useState("open"),l=r.useState("floatingId"),[u,f]=d.useState(null),[p,g]=d.useState(void 0),[h,w]=d.useState(void 0),m=d.useRef(null),b=Gt(n),x=d.useMemo(()=>({reference:s,floating:i,domReference:a}),[s,i,a]),S=px({...e,elements:{...x,...u&&{reference:u}}}),v=Ee(p)?p:null,E=h===void 0?r.state.floatingElement:h;r.useSyncedValue("referenceElement",p??null),r.useSyncedValue("domReferenceElement",p===void 0?a:v),r.useSyncedValue("floatingElement",E);const y=d.useCallback(L=>{const $=Ee(L)?{getBoundingClientRect:()=>L.getBoundingClientRect(),getClientRects:()=>L.getClientRects(),contextElement:L}:L;f($),S.refs.setReference($)},[S.refs]),C=d.useCallback(L=>{(Ee(L)||L===null)&&(m.current=L,g(L)),(Ee(S.refs.reference.current)||S.refs.reference.current===null||L!==null&&!Ee(L))&&S.refs.setReference(L)},[S.refs,g]),R=d.useCallback(L=>{w(L),S.refs.setFloating(L)},[S.refs]),O=d.useMemo(()=>({...S.refs,setReference:C,setFloating:R,setPositionReference:y,domReference:m}),[S.refs,C,R,y]),P=d.useMemo(()=>({...S.elements,domReference:a}),[S.elements,a]),j=d.useMemo(()=>({...S,dataRef:r.context.dataRef,open:c,onOpenChange:r.setOpen,events:r.context.events,floatingId:l,refs:O,elements:P,nodeId:t,rootStore:r}),[S,O,P,t,r,c,l]);return Q(()=>{a&&(m.current=a)},[a]),Q(()=>{r.context.dataRef.current.floatingContext=j;const L=b==null?void 0:b.nodesRef.current.find($=>$.id===t);L&&(L.context=j)}),d.useMemo(()=>({...S,context:j,refs:O,elements:P,rootStore:r}),[S,O,P,j,r])}const Cr=gs&&sn;function Il(e,t={}){const{enabled:n=!0,delay:o}=t,r="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=r.context,a=d.useRef(!1),c=d.useRef(null),l=d.useRef(!0),u=Xe();d.useEffect(()=>{const p=r.select("domReferenceElement");if(!n)return;const g=Fe(p);function h(){const b=r.select("domReferenceElement");!r.select("open")&&Ne(b)&&b===Je(Me(b))&&(a.current=!0)}function w(){l.current=!0}function m(){l.current=!1}return xt(Se(g,"blur",h),Cr&&Se(g,"keydown",w,!0),Cr&&Se(g,"pointerdown",m,!0))},[r,n]),d.useEffect(()=>{if(!n)return;function p(g){if(g.reason===rn||g.reason===Wo){const h=r.select("domReferenceElement");Ee(h)&&(c.current=h,a.current=!0)}}return s.on("openchange",p),()=>{s.off("openchange",p)}},[s,n,r]);const f=d.useMemo(()=>{function p(){a.current=!1,c.current=null}return{onMouseLeave(){p()},onFocus(g){const h=g.currentTarget;if(a.current){if(c.current===h)return;p()}const w=Ve(g.nativeEvent);if(Ee(w)){if(Cr&&!g.relatedTarget){if(!l.current&&!Zo(w))return}else if(!qb(w))return}const m=Mo(g.relatedTarget,r.context.triggerElements),{nativeEvent:b,currentTarget:x}=g,S=typeof o=="function"?o():o;if(r.select("open")&&m||S===0||S===void 0){r.setOpen(!0,we(dn,b,x));return}u.start(S,()=>{a.current||r.setOpen(!0,we(dn,b,x))})},onBlur(g){p();const h=g.relatedTarget,w=g.nativeEvent,m=Ee(h)&&h.hasAttribute(Vn("focus-guard"))&&h.getAttribute("data-type")==="outside";u.start(0,()=>{var v;const b=r.select("domReferenceElement"),x=Je(Me(b));!h&&x===b||ue((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,x)||ue(b,x)||m||Mo(h??x,r.context.triggerElements)||r.setOpen(!1,we(dn,w))})}}},[i,o,r,u]);return d.useMemo(()=>n?{reference:f,trigger:f}:{},[n,f])}class Fs{constructor(){Ie(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Ie(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ht,this.restTimeout=new ht,this.handleCloseOptions=void 0}static create(){return new Fs}}const No=new WeakMap;function Do(e){var n,o,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&No.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(o=e.pointerEventsReferenceElement)==null||o.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),No.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Al(e,t){const{scopeElement:n,referenceElement:o,floatingElement:r}=t,s=No.get(n);s&&s!==e&&Do(s),Do(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=o,e.pointerEventsFloatingElement=r,No.set(n,e),n.style.pointerEvents="none",o.style.pointerEvents="auto",r.style.pointerEvents="auto"}function _s(e){const t=e.context.dataRef.current,n=et(()=>t.hoverInteractionState??Fs.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),ys(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function $l(e,t={}){const{enabled:n=!0,closeDelay:o=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:l}=s.context,u=Gt(),f=Wt(),p=_s(s),g=Xe(),h=de(()=>{var b;return Lc((b=l.current.openEvent)==null?void 0:b.type,p.interactedInside)}),w=de(()=>{var b;return Yb((b=l.current.openEvent)==null?void 0:b.type)}),m=de(()=>{Do(p)});Q(()=>{i||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,m())},[i,p,m]),d.useEffect(()=>m,[m]),Q(()=>{var b,x,S,v,E;if(n&&i&&(b=p.handleCloseOptions)!=null&&b.blockPointerEvents&&w()&&Ee(c)&&a){const y=c,C=a,R=Me(a),O=(S=(x=u==null?void 0:u.nodesRef.current.find($=>$.id===f))==null?void 0:x.context)==null?void 0:S.elements.floating;O&&(O.style.pointerEvents="");const P=p.pointerEventsScopeElement!==C?p.pointerEventsScopeElement:null,j=O!==C?O:null,L=((E=(v=p.handleCloseOptions)==null?void 0:v.getScope)==null?void 0:E.call(v))??P??j??y.closest("[data-rootownerid]")??R.body;return Al(p,{scopeElement:L,referenceElement:y,floatingElement:C}),()=>{m()}}},[n,i,c,a,p,w,u,f,m]),d.useEffect(()=>{if(!n)return;function b(){return!!(u&&f&&Bt(u.nodesRef.current,f).length>0)}function x(R){const O=mn(o,"close",p.pointerType),P=()=>{s.setOpen(!1,we(Ue,R)),u==null||u.events.emit("floating.closed",R)};O?p.openChangeTimeout.start(O,P):(p.openChangeTimeout.clear(),P())}function S(R){const O=Ve(R);if(!Gb(O)){p.interactedInside=!1;return}p.interactedInside=(O==null?void 0:O.closest("[aria-haspopup]"))!=null}function v(){p.openChangeTimeout.clear(),g.clear(),u==null||u.events.off("floating.closed",y),m()}function E(R){var L;if(b()&&u){u.events.on("floating.closed",y);return}if(Mo(R.relatedTarget,s.context.triggerElements))return;const O=((L=l.current.floatingContext)==null?void 0:L.nodeId)??r,P=R.relatedTarget;if(!(u&&O&&Ee(P)&&Bt(u.nodesRef.current,O,!1).some($=>{var T;return ue((T=$.context)==null?void 0:T.elements.floating,P)}))){if(p.handler){p.handler(R);return}m(),w()&&!h()&&x(R)}}function y(R){!u||!f||b()||g.start(0,()=>{u.events.off("floating.closed",y),s.setOpen(!1,we(Ue,R)),u.events.emit("floating.closed",R)})}const C=a;return xt(C&&Se(C,"mouseenter",v),C&&Se(C,"mouseleave",E),C&&Se(C,"pointerdown",S,!0),()=>{u==null||u.events.off("floating.closed",y)})},[n,a,s,l,o,r,w,h,m,p,u,f,g])}const jx={current:null};function Bs(e,t={}){var M;const{enabled:n=!0,delay:o=0,handleClose:r=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:c=jx,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:f,isClosing:p,shouldOpen:g}=t,h="rootStore"in e?e.rootStore:e,{dataRef:w,events:m}=h.context,b=Gt(l),x=_s(h),S=d.useRef(!1),v=Be(r),E=Be(o),y=Be(i),C=Be(n),R=Be(g),O=Be(p),P=de(()=>{var N;return Lc((N=w.current.openEvent)==null?void 0:N.type,x.interactedInside)}),j=de(()=>{var N;return((N=R.current)==null?void 0:N.call(R))!==!1}),L=de((N,D,A)=>{const F=h.context.triggerElements;if(F.hasElement(D))return!N||!ue(N,D);if(!Ee(A))return!1;const I=A;return F.hasMatchingElement(B=>ue(B,I))&&(!N||!ue(N,I))}),$=de(()=>{if(!x.handler)return;Me(h.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),T=de(()=>{Do(x)});return u&&(x.handleCloseOptions=(M=v.current)==null?void 0:M.__options),d.useEffect(()=>$,[$]),d.useEffect(()=>{if(!n)return;function N(D){D.open?S.current=!1:(S.current=D.reason===Ue,$(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return m.on("openchange",N),()=>{m.off("openchange",N)}},[n,m,x,$]),d.useEffect(()=>{if(!n)return;function N(I,B=!0){const V=mn(E.current,"close",x.pointerType);V?x.openChangeTimeout.start(V,()=>{h.setOpen(!1,we(Ue,I)),b==null||b.events.emit("floating.closed",I)}):B&&(x.openChangeTimeout.clear(),h.setOpen(!1,we(Ue,I)),b==null||b.events.emit("floating.closed",I))}const D=c.current??(u?h.select("domReferenceElement"):null);if(!Ee(D))return;function A(I){var he;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!Jt(x.pointerType))return;const B=$i(y.current),V=mn(E.current,"open",x.pointerType),re=Ve(I),se=I.currentTarget??null,G=h.select("domReferenceElement");let W=se;if(Ee(re)&&!h.context.triggerElements.hasElement(re)){for(const xe of h.context.triggerElements.elements())if(ue(xe,re)){W=xe;break}}Ee(se)&&Ee(G)&&!h.context.triggerElements.hasElement(se)&&ue(se,G)&&(W=G);const ae=W==null?!1:L(G,W,re),U=h.select("open"),ee=((he=O.current)==null?void 0:he.call(O))??h.select("transitionStatus")==="ending",ye=!U&&ee&&S.current,ke=!ae&&Ee(W)&&Ee(G)&&ue(G,W)&&ye,H=B>0&&!V,te=ae&&(U||ye)||ke,Y=!U||ae;if(te){j()&&h.setOpen(!0,we(Ue,I,W));return}H||(V?x.openChangeTimeout.start(V,()=>{Y&&j()&&h.setOpen(!0,we(Ue,I,W))}):Y&&j()&&h.setOpen(!0,we(Ue,I,W)))}function F(I){if(P()){T();return}$();const B=h.select("domReferenceElement"),V=Me(B);x.restTimeout.clear(),x.restTimeoutPending=!1;const re=w.current.floatingContext??(f==null?void 0:f());if(Mo(I.relatedTarget,h.context.triggerElements))return;if(v.current&&re){h.select("open")||x.openChangeTimeout.clear();const G=c.current;x.handler=v.current({...re,tree:b,x:I.clientX,y:I.clientY,onClose(){T(),$(),C.current&&!P()&&G===h.select("domReferenceElement")&&N(I,!0)}}),V.addEventListener("mousemove",x.handler),x.handler(I);return}(x.pointerType==="touch"?!ue(h.select("floatingElement"),I.relatedTarget):!0)&&N(I)}return a?xt(Se(D,"mousemove",A,{once:!0}),Se(D,"mouseenter",A),Se(D,"mouseleave",F)):xt(Se(D,"mouseenter",A),Se(D,"mouseleave",F))},[$,T,w,E,h,n,v,x,u,L,P,s,a,y,c,b,C,f,O,j]),d.useMemo(()=>{if(!n)return;function N(D){x.pointerType=D.pointerType}return{onPointerDown:N,onPointerEnter:N,onMouseMove(D){var G,W,ae;const{nativeEvent:A}=D,F=D.currentTarget,I=h.select("domReferenceElement"),B=h.select("open"),V=L(I,F,D.target);if(s&&!Jt(x.pointerType))return;if(B&&V&&((G=x.handleCloseOptions)!=null&&G.blockPointerEvents)){const U=h.select("floatingElement");if(U){const ee=((ae=(W=x.handleCloseOptions)==null?void 0:W.getScope)==null?void 0:ae.call(W))??F.ownerDocument.body;Al(x,{scopeElement:ee,referenceElement:F,floatingElement:U})}}const re=$i(y.current);if(B&&!V||re===0||!V&&x.restTimeoutPending&&D.movementX**2+D.movementY**2<2)return;x.restTimeout.clear();function se(){if(x.restTimeoutPending=!1,P())return;const U=h.select("open");!x.blockMouseMove&&(!U||V)&&j()&&h.setOpen(!0,we(Ue,A,F))}x.pointerType==="touch"?pt.flushSync(()=>{se()}):V&&B?se():(x.restTimeoutPending=!0,x.restTimeout.start(re,se))}}},[n,x,P,L,s,h,y,j])}const Fx="Escape";function nr(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ao(e,t){return nr(t,e===Dc||e===xs,e===Ko||e===Xo)}function Tr(e,t,n){return nr(t,e===xs,n?e===Ko:e===Xo)||e==="Enter"||e===" "||e===""}function _x(e,t,n){return nr(t,n?e===Ko:e===Xo,e===xs)}function Bx(e,t,n,o){const r=n?e===Xo:e===Ko,s=e===Dc;return t==="both"||t==="horizontal"&&o?e===Fx:nr(t,r,s)}function zx(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:s=!0,selectedIndex:i=null,allowEscape:a=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:f=!1,focusItemOnOpen:p="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:h=!0,disabledIndices:w=void 0,orientation:m="vertical",parentOrientation:b,id:x,resetOnPointerLeave:S=!0,externalTree:v,grid:E}=t,y=E!=null,C="rootStore"in e?e.rootStore:e,R=C.useState("open"),O=C.useState("floatingElement"),P=C.useState("domReferenceElement"),j=C.context.dataRef,L=Fr(O),$=jr(P),T=Be(L),M=Wt(),N=Gt(v),D=d.useRef(p),A=d.useRef(i??-1),F=d.useRef(null),I=d.useRef(!0),B=de(_=>{r(A.current===-1?null:A.current,_)}),V=d.useRef(!!O),re=d.useRef(R),se=d.useRef(!1),G=d.useRef(!1),W=d.useRef(null),ae=Be(w),U=Be(R),ee=Be(i),ye=Be(S),ke=Hn(),H=Hn(),te=de(()=>{function _(q){f?N==null||N.events.emit("virtualfocus",q):W.current=mo(q,{sync:se.current,preventScroll:!0})}const z=n.current[A.current],be=G.current;z&&_(z),(se.current?q=>q():q=>ke.request(q))(()=>{var Te;const q=n.current[A.current]||z;if(!q)return;z||_(q),Z&&(be||!I.current)&&((Te=q.scrollIntoView)==null||Te.call(q,{block:"nearest",inline:"nearest"}))})});Q(()=>{j.current.orientation=m},[j,m]),Q(()=>{s&&(R&&O?(A.current=i??-1,D.current&&i!=null&&(G.current=!0,B())):V.current&&(A.current=-1,B()))},[s,R,O,i,B]),Q(()=>{if(s){if(!R){se.current=!1;return}if(O)if(o==null){if(se.current=!1,ee.current!=null)return;if(V.current&&(A.current=-1,te()),(!re.current||!V.current)&&D.current&&(F.current!=null||D.current===!0&&F.current==null)){let _=0;const z=()=>{n.current[0]==null?(_<2&&(_?K=>H.request(K):queueMicrotask)(z),_+=1):(A.current=F.current==null||Tr(F.current,m,u)||l?go(n):Br(n),F.current=null,B())};z()}}else An(n.current,o)||(A.current=o,te(),G.current=!1)}},[s,R,O,o,ee,l,n,m,u,B,te,H]),Q(()=>{var q,ve;if(!s||O||!N||f||!V.current)return;const _=N.nodesRef.current,z=(ve=(q=_.find(Te=>Te.id===M))==null?void 0:q.context)==null?void 0:ve.elements.floating,be=Je(Me(P??z??null)),K=_.some(Te=>Te.context&&ue(Te.context.elements.floating,be));z&&!K&&I.current&&z.focus({preventScroll:!0})},[s,O,P,N,M,f]),Q(()=>{re.current=R,V.current=!!O}),Q(()=>{R||(F.current=null,D.current=p)},[R,p]);const Y=o!=null,he=de(_=>{if(!U.current)return;const z=n.current.indexOf(_.currentTarget);z!==-1&&(A.current!==z||o!==z)&&(A.current=z,B(_))}),xe=de(()=>{var _,z,be;return b??((be=(z=(_=N==null?void 0:N.nodesRef.current.find(K=>K.id===M))==null?void 0:_.context)==null?void 0:z.dataRef)==null?void 0:be.current.orientation)}),ce=de(()=>go(n,ae.current)),pe=de(_=>{if(I.current=!1,se.current=!0,_.which===229||!U.current&&_.currentTarget===T.current)return;if(l&&Bx(_.key,m,u,y)){ao(_.key,xe())||ft(_),C.setOpen(!1,we(Nr,_.nativeEvent)),Ne(P)&&(f?N==null||N.events.emit("virtualfocus",P):P.focus());return}const z=A.current,be=go(n,w),K=Br(n,w);if($||(_.key==="Home"&&(ft(_),A.current=be,B(_)),_.key==="End"&&(ft(_),A.current=K,B(_))),E!=null){const q=E(_,A.current,n,m,c,u,w,be,K);if(q!=null&&(A.current=q,B(_)),m==="both")return}if(ao(_.key,m)){if(ft(_),R&&!f&&Je(_.currentTarget.ownerDocument)===_.currentTarget){A.current=Tr(_.key,m,u)?be:K,B(_);return}Tr(_.key,m,u)?c?z>=K?a&&z!==n.current.length?A.current=-1:(se.current=!1,A.current=be):A.current=Ct(n.current,{startingIndex:z,disabledIndices:w}):A.current=Math.min(K,Ct(n.current,{startingIndex:z,disabledIndices:w})):c?z<=be?a&&z!==-1?A.current=n.current.length:(se.current=!1,A.current=K):A.current=Ct(n.current,{startingIndex:z,decrement:!0,disabledIndices:w}):A.current=Math.max(be,Ct(n.current,{startingIndex:z,decrement:!0,disabledIndices:w})),An(n.current,A.current)&&(A.current=-1),B(_)}}),Z=d.useMemo(()=>({onFocus(z){se.current=!0,he(z)},onClick:({currentTarget:z})=>z.focus({preventScroll:!0}),onMouseMove(z){se.current=!0,G.current=!1,g&&he(z)},onPointerLeave(z){var K;if(!U.current||!I.current||z.pointerType==="touch")return;se.current=!0;const be=z.relatedTarget;if(!(!g||n.current.includes(be))&&ye.current&&((K=W.current)==null||K.call(W),W.current=null,A.current=-1,B(z),!f)){const q=T.current,ve=Je(Me(q));q&&ue(q,ve)&&q.focus({preventScroll:!0})}}}),[he,U,T,g,n,B,ye,f]),Ce=d.useMemo(()=>f&&R&&Y&&{"aria-activedescendant":`${x}-${o}`},[f,R,Y,x,o]),fe=d.useMemo(()=>({"aria-orientation":m==="both"?void 0:m,...$?{}:Ce,onKeyDown(_){if(_.key==="Tab"&&_.shiftKey&&R&&!f){const z=Ve(_.nativeEvent);if(z&&!ue(T.current,z))return;ft(_),C.setOpen(!1,we(gn,_.nativeEvent)),Ne(P)&&P.focus();return}pe(_)},onPointerMove(){I.current=!0}}),[Ce,pe,T,m,$,C,R,f,P]),le=d.useMemo(()=>{function _(K){C.setOpen(!0,we(Nr,K.nativeEvent,K.currentTarget))}function z(K){p==="auto"&&Ac(K.nativeEvent)&&(D.current=!f)}function be(K){D.current=p,p==="auto"&&$c(K.nativeEvent)&&(D.current=!0)}return{onKeyDown(K){const q=C.select("open");I.current=!1;const ve=K.key.startsWith("Arrow"),Te=_x(K.key,xe(),u),Ge=ao(K.key,m),ze=(l?Te:Ge)||K.key==="Enter"||K.key.trim()==="";if(f&&q)return pe(K);if(!(!q&&!h&&ve)){if(ze){const nt=ao(K.key,xe());F.current=l&&nt?null:K.key}if(l){Te&&(ft(K),q?(A.current=ce(),B(K)):_(K));return}Ge&&(ee.current!=null&&(A.current=ee.current),ft(K),!q&&h?_(K):pe(K),q&&B(K))}},onFocus(K){C.select("open")&&!f&&(A.current=-1,B(K))},onPointerDown:be,onPointerEnter:be,onMouseDown:z,onClick:z}},[pe,p,ce,l,B,C,h,m,xe,u,ee,f]),Oe=d.useMemo(()=>({...Ce,...le}),[Ce,le]);return d.useMemo(()=>s?{reference:Oe,floating:fe,item:Z,trigger:le}:{},[s,Oe,fe,le,Z])}function Hx(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:s,disabledIndices:i,onTyping:a,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,f="rootStore"in e?e.rootStore:e,p=f.useState("open"),g=Xe(),h=d.useRef(""),w=d.useRef(u??r??-1),m=d.useRef(null),b=de(v=>{function E(T){const M=o==null?void 0:o.current[T];return!M||Qo(M)}function y(T){return E(T)?i==null||!Ao(Qt,T,i):!1}function C(T,M,N=0){if(T.length===0)return-1;const D=(N%T.length+T.length)%T.length,A=M.toLowerCase();for(let F=0;F<T.length;F+=1){const I=(D+F)%T.length,B=T[I];if(!(!(B!=null&&B.toLowerCase().startsWith(A))||!y(I)))return I}return-1}const R=n.current;if(h.current.length>0&&v.key===" "&&(ft(v),a==null||a(!0)),h.current.length>0&&h.current[0]!==" "&&C(R,h.current)===-1&&v.key!==" "&&(a==null||a(!1)),R==null||v.key.length!==1||v.ctrlKey||v.metaKey||v.altKey)return;p&&v.key!==" "&&(ft(v),a==null||a(!0));const O=h.current==="";O&&(w.current=u??r??-1),R.every((T,M)=>{var N,D;return T&&y(M)?((N=T[0])==null?void 0:N.toLowerCase())!==((D=T[1])==null?void 0:D.toLowerCase()):!0})&&h.current===v.key&&(h.current="",w.current=m.current),h.current+=v.key,g.start(l,()=>{h.current="",w.current=m.current,a==null||a(!1)});const L=((O?u??r??-1:w.current)??0)+1,$=C(R,h.current,L);$!==-1?(s==null||s($),m.current=$):v.key!==" "&&(h.current="",a==null||a(!1))}),x=de(v=>{const E=v.relatedTarget,y=f.select("domReferenceElement"),C=f.select("floatingElement");ue(y,E)||ue(C,E)||(g.clear(),h.current="",w.current=m.current,a==null||a(!1))});Q(()=>{!p&&u!==null||(g.clear(),m.current=null,h.current!==""&&(h.current=""))},[p,u,g]),Q(()=>{p&&h.current===""&&(w.current=u??r??-1)},[p,u,r]);const S=d.useMemo(()=>({onKeyDown:b,onBlur:x}),[b,x]);return d.useMemo(()=>c?{reference:S,floating:S}:{},[c,S])}const ta=.1,Vx=ta*ta,$e=.5;function co(e,t,n,o,r,s){return o>=t!=s>=t&&e<=(r-n)*(t-o)/(s-o)+n}function lo(e,t,n,o,r,s,i,a,c,l){let u=!1;return co(e,t,n,o,r,s)&&(u=!u),co(e,t,r,s,i,a)&&(u=!u),co(e,t,i,a,c,l)&&(u=!u),co(e,t,c,l,n,o)&&(u=!u),u}function Wx(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function uo(e,t,n,o,r,s){const i=Math.min(n,r),a=Math.max(n,r),c=Math.min(o,s),l=Math.max(o,s);return e>=i&&e<=a&&t>=c&&t<=l}function zs(e={}){const{blockPointerEvents:t=!1}=e,n=new ht,o=({x:r,y:s,placement:i,elements:a,onClose:c,nodeId:l,tree:u})=>{const f=i==null?void 0:i.split("-")[0];let p=!1,g=null,h=null,w=typeof performance<"u"?performance.now():0;function m(x,S){const v=performance.now(),E=v-w;if(g===null||h===null||E===0)return g=x,h=S,w=v,!1;const y=x-g,C=S-h,R=y*y+C*C,O=E*E*Vx;return g=x,h=S,w=v,R<O}function b(){n.clear(),c()}return function(S){n.clear();const v=a.domReference,E=a.floating;if(!v||!E||f==null||r==null||s==null)return;const{clientX:y,clientY:C}=S,R=Ve(S),O=S.type==="mouseleave",P=ue(E,R),j=ue(v,R);if(P&&(p=!0,!O))return;if(j&&(p=!1,!O)){p=!0;return}if(O&&Ee(S.relatedTarget)&&ue(E,S.relatedTarget))return;function L(){return!!(u&&Bt(u.nodesRef.current,l).length>0)}function $(){L()||b()}if(L())return;const T=v.getBoundingClientRect(),M=E.getBoundingClientRect(),N=r>M.right-M.width/2,D=s>M.bottom-M.height/2,A=M.width>T.width,F=M.height>T.height,I=(A?T:M).left,B=(A?T:M).right,V=(F?T:M).top,re=(F?T:M).bottom;if(f==="top"&&s>=T.bottom-1||f==="bottom"&&s<=T.top+1||f==="left"&&r>=T.right-1||f==="right"&&r<=T.left+1){$();return}let se=!1;switch(f){case"top":se=uo(y,C,I,T.top+1,B,M.bottom-1);break;case"bottom":se=uo(y,C,I,M.top+1,B,T.bottom-1);break;case"left":se=uo(y,C,M.right-1,re,T.left+1,V);break;case"right":se=uo(y,C,T.right-1,re,M.left+1,V);break}if(se)return;if(p&&!Wx(y,C,T)){$();return}if(!O&&m(y,C)){$();return}let G=!1;switch(f){case"top":{const W=A?$e/2:$e*4,ae=A||N?r+W:r-W,U=A?r-W:N?r+W:r-W,ee=s+$e+1,ye=N||A?M.bottom-$e:M.top,ke=N?A?M.bottom-$e:M.top:M.bottom-$e;G=lo(y,C,ae,ee,U,ee,M.left,ye,M.right,ke);break}case"bottom":{const W=A?$e/2:$e*4,ae=A||N?r+W:r-W,U=A?r-W:N?r+W:r-W,ee=s-$e,ye=N||A?M.top+$e:M.bottom,ke=N?A?M.top+$e:M.bottom:M.top+$e;G=lo(y,C,ae,ee,U,ee,M.left,ye,M.right,ke);break}case"left":{const W=F?$e/2:$e*4,ae=F||D?s+W:s-W,U=F?s-W:D?s+W:s-W,ee=r+$e+1,ye=D||F?M.right-$e:M.left,ke=D?F?M.right-$e:M.left:M.right-$e;G=lo(y,C,ye,M.top,ke,M.bottom,ee,ae,ee,U);break}case"right":{const W=F?$e/2:$e*4,ae=F||D?s+W:s-W,U=F?s-W:D?s+W:s-W,ee=r-$e,ye=D||F?M.left+$e:M.right,ke=D?F?M.left+$e:M.right:M.left+$e;G=lo(y,C,ee,ae,ee,U,ye,M.top,ke,M.bottom);break}}G?p||n.start(40,$):$()}};return o.__options={...e,blockPointerEvents:t},o}const Gx=d.createContext(void 0);function Nl(e){return d.useContext(Gx)}const Nn="ArrowUp",Dn="ArrowDown",Lo="ArrowLeft",jo="ArrowRight",or="Home",rr="End",Dl=new Set([Lo,jo]),qx=new Set([Lo,jo,or,rr]),Ll=new Set([Nn,Dn]),Ux=new Set([Nn,Dn,or,rr]),jl=new Set([...Dl,...Ll]),Hs=new Set([...jl,or,rr]),Yx="Shift",Kx="Control",Xx="Alt",Zx="Meta",Qx=new Set([Yx,Kx,Xx,Zx]);function Jx(e){return Ne(e)&&e.tagName==="INPUT"}function na(e){return!!(Jx(e)&&e.selectionStart!=null||Ne(e)&&e.tagName==="TEXTAREA")}function oa(e,t,n,o){if(!e||!t||!t.scrollTo)return;let r=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(i&&o!=="vertical"){const c=ra(e,t,"left"),l=fo(e),u=fo(t);n==="ltr"&&(c+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-l.scrollPaddingRight?r=c+t.offsetWidth+u.scrollMarginRight-e.clientWidth+l.scrollPaddingRight:c-u.scrollMarginLeft<e.scrollLeft+l.scrollPaddingLeft&&(r=c-u.scrollMarginLeft-l.scrollPaddingLeft)),n==="rtl"&&(c-u.scrollMarginRight<e.scrollLeft+l.scrollPaddingLeft?r=c-u.scrollMarginLeft-l.scrollPaddingLeft:c+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-l.scrollPaddingRight&&(r=c+t.offsetWidth+u.scrollMarginRight-e.clientWidth+l.scrollPaddingRight))}if(a&&o!=="horizontal"){const c=ra(e,t,"top"),l=fo(e),u=fo(t);c-u.scrollMarginTop<e.scrollTop+l.scrollPaddingTop?s=c-u.scrollMarginTop-l.scrollPaddingTop:c+t.offsetHeight+u.scrollMarginBottom>e.scrollTop+e.clientHeight-l.scrollPaddingBottom&&(s=c+t.offsetHeight+u.scrollMarginBottom-e.clientHeight+l.scrollPaddingBottom)}e.scrollTo({left:r,top:s,behavior:"auto"})}function ra(e,t,n){const o=n==="left"?"offsetLeft":"offsetTop";let r=0;for(;t.offsetParent&&(r+=t[o],t.offsetParent!==e);)t=t.offsetParent;return r}function fo(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Vs(e){return e==="starting"?ky:De}const e1={...wn,...Vo},Fl=d.forwardRef(function(t,n){const{render:o,className:r,style:s,finalFocus:i,...a}=t,{store:c}=vt(),{side:l,align:u}=ds(),f=Nl()!=null,p=c.useState("open"),g=c.useState("transitionStatus"),h=c.useState("popupProps"),w=c.useState("mounted"),m=c.useState("instantType"),b=c.useState("activeTriggerElement"),x=c.useState("parent"),S=c.useState("lastOpenChangeReason"),v=c.useState("rootId"),E=c.useState("floatingRootContext"),y=c.useState("floatingTreeRoot"),C=c.useState("closeDelay"),R=c.useState("activeTriggerElement"),O=c.useState("hoverEnabled"),P=c.useState("disabled"),j=c.useState("openMethod"),L=x.type==="context-menu";Yo({open:p,ref:c.context.popupRef,onComplete(){var D,A;p&&((A=(D=c.context).onOpenChangeComplete)==null||A.call(D,!0))}}),d.useEffect(()=>{function D(A){c.setOpen(!1,we(A.reason,A.domEvent))}return y.events.on("close",D),()=>{y.events.off("close",D)}},[y.events,c]),$l(E,{enabled:O&&!P&&!L&&x.type!=="menubar",closeDelay:C});const $=d.useCallback(D=>{c.set("popupElement",D)},[c]),T={transitionStatus:g,side:l,align:u,open:p,nested:x.type==="menu",instant:m},M=Le("div",t,{state:T,ref:[n,c.context.popupRef,$],stateAttributesMapping:e1,props:[h,{onKeyDown(D){f&&Hs.has(D.key)&&D.stopPropagation()}},Vs(g),a,{"data-rootownerid":v}]});let N=x.type===void 0||L;return(b||x.type==="menubar"&&S!==ps)&&(N=!0),k.jsx(cl,{context:E,openInteractionType:j,modal:L,disabled:!w,returnFocus:i===void 0?N:i,initialFocus:x.type!=="menu",restoreFocus:!0,externalTree:x.type!=="menubar"?y:void 0,previousFocusableElement:R,nextFocusableElement:x.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:x.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:M})}),_l=d.createContext(void 0);function t1(){const e=d.useContext(_l);if(e===void 0)throw new Error(We(32));return e}const Bl=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=vt();return s.useState("mounted")||o?k.jsx(_l.Provider,{value:o,children:k.jsx(ol,{ref:n,...r})}):null});function zl(e){return as(19)?e:e?"true":void 0}const n1=d.createContext(void 0);function Ws(){const e=d.useContext(n1);return(e==null?void 0:e.direction)??"ltr"}const o1=e=>({name:"arrow",options:e,async fn(t){var F,I;const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=It(e,t)||{};if(l==null)return{};const p=zc(u),g={x:n,y:o},h=ks(r),w=ws(h),m=await i.getDimensions(l),b=h==="y",x=b?"top":"left",S=b?"bottom":"right",v=b?"clientHeight":"clientWidth",E=s.reference[w]+s.reference[h]-g[h]-s.floating[w],y=g[h]-s.reference[h],C=f==="real"?await((F=i.getOffsetParent)==null?void 0:F.call(i,l)):a.floating;let R=a.floating[v]||s.floating[w];(!R||!await((I=i.isElement)==null?void 0:I.call(i,C)))&&(R=a.floating[v]||s.floating[w]);const O=E/2-y/2,P=R/2-m[w]/2-1,j=Math.min(p[x],P),L=Math.min(p[S],P),$=j,T=R-m[w]-L,M=R/2-m[w]/2+O,N=Bc($,M,T),D=!c.arrow&&Vt(r)!=null&&M!==N&&s.reference[w]/2-(M<$?j:L)-m[w]/2<0,A=D?M<$?M-$:M-T:0;return{[h]:g[h]+A,data:{[h]:N,centerOffset:M-N-A,...D&&{alignmentOffset:A}},reset:D}}}),r1=(e,t)=>({...o1(e),options:[e,t]}),s1=xx().fn,i1={name:"hide",async fn(e){var a;const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:((a=(await s1(e)).data)==null?void 0:a.referenceHidden)||s}}}},yo={sideX:"left",sideY:"top"},Hl={name:"adaptiveOrigin",async fn(e){var x,S;const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=Fe(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:yo};const f=await((x=s.getOffsetParent)==null?void 0:x.call(s,r));let p={width:0,height:0};if(i==="fixed"&&(c!=null&&c.visualViewport))p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const v=Me(r);p={width:v.documentElement.clientWidth,height:v.documentElement.clientHeight}}else await((S=s.isElement)==null?void 0:S.call(s,f))&&(p=await s.getDimensions(f));const g=it(a);let h=t,w=n;g==="left"&&(h=p.width-(t+o.width)),g==="top"&&(w=p.height-(n+o.height));const m=g==="left"?"right":yo.sideX,b=g==="top"?"bottom":yo.sideY;return{x:h,y:w,data:{sideX:m,sideY:b}}}};function Vl(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function sa(e,t,n){const{rects:o,placement:r}=e;return{side:Vl(t,it(r),n),align:Vt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Wl(e){var Qn,Jn;const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,inline:p,keepMounted:g=!1,floatingRootContext:h,mounted:w,collisionAvoidance:m,shiftCrossAxis:b=!1,nodeId:x,adaptiveOrigin:S,lazyFlip:v=!1,externalTree:E}=e,[y,C]=d.useState(null);!w&&y!==null&&C(null);const R=m.side||"flip",O=m.align||"flip",P=m.fallbackAxisSide||"end",j=typeof t=="function"?t:void 0,L=de(j),$=j?L:t,T=Be(t),M=Be(w),D=Ws()==="rtl",A=y||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":D?"left":"right","inline-start":D?"right":"left"}[o],F=s==="center"?A:`${A}-${s}`;let I=c;const B=1,V=o==="bottom"?B:0,re=o==="top"?B:0,se=o==="right"?B:0,G=o==="left"?B:0;typeof I=="number"?I={top:I+V,right:I+G,bottom:I+re,left:I+se}:I&&(I={top:(I.top||0)+V,right:(I.right||0)+G,bottom:(I.bottom||0)+re,left:(I.left||0)+se});const W={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:I},ae=d.useRef(null),U=Be(r),ee=Be(i),ye=typeof r!="function"?r:0,ke=typeof i!="function"?i:0,H=[];p&&H.push(p),H.push(hx(Ae=>{const Ze=sa(Ae,o,D),mt=typeof U.current=="function"?U.current(Ze):U.current,ct=typeof ee.current=="function"?ee.current(Ze):ee.current;return{mainAxis:mt,crossAxis:ct,alignmentAxis:ct}},[ye,ke,D,o]));const te=O==="none"&&R!=="shift",Y=!te&&(l||b||R==="shift"),he=R==="none"?null:bx({...W,padding:{top:I.top+B,right:I.right+B,bottom:I.bottom+B,left:I.left+B},mainAxis:!b&&R==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),xe=te?null:gx(Ae=>{const Ze=Me(Ae.elements.floating).documentElement;return{...W,rootBoundary:b?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:O!=="none",crossAxis:Y,limiter:l||b?void 0:mx(mt=>{if(!ae.current)return{};const{width:ct,height:kt}=ae.current.getBoundingClientRect(),dt=lt(it(mt.placement)),Ut=dt==="y"?ct:kt,ln=dt==="y"?I.left+I.right:I.top+I.bottom;return{offset:Ut/2+ln/2}})}},[W,l,b,I,O]);R==="shift"||O==="shift"||s==="center"?H.push(xe,he):H.push(he,xe),H.push(yx({...W,apply({elements:{floating:Ae},availableWidth:Ze,availableHeight:mt,rects:ct}){if(!M.current)return;const kt=Ae.style;kt.setProperty("--available-width",`${Ze}px`),kt.setProperty("--available-height",`${mt}px`);const dt=Fe(Ae).devicePixelRatio||1,{x:Ut,y:ln,width:$t,height:ir}=ct.reference,ar=(Math.round((Ut+$t)*dt)-Math.round(Ut*dt))/dt,cr=(Math.round((ln+ir)*dt)-Math.round(ln*dt))/dt;kt.setProperty("--anchor-width",`${ar}px`),kt.setProperty("--anchor-height",`${cr}px`)}}),r1(Ae=>({element:ae.current||Me(Ae.elements.floating).createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(Ae){var ni,oi,ri;const{elements:Ze,middlewareData:mt,placement:ct,rects:kt,y:dt}=Ae,Ut=it(ct),ln=lt(Ut),$t=ae.current,ir=((ni=mt.arrow)==null?void 0:ni.x)||0,ar=((oi=mt.arrow)==null?void 0:oi.y)||0,cr=($t==null?void 0:$t.clientWidth)||0,qu=($t==null?void 0:$t.clientHeight)||0,lr=ir+cr/2,ti=ar+qu/2,Uu=Math.abs(((ri=mt.shift)==null?void 0:ri.y)||0),Yu=kt.reference.height/2,Sn=typeof r=="function"?r(sa(Ae,o,D)):r,Ku=Uu>Sn,Xu={top:`${lr}px calc(100% + ${Sn}px)`,bottom:`${lr}px ${-Sn}px`,left:`calc(100% + ${Sn}px) ${ti}px`,right:`${-Sn}px ${ti}px`}[Ut],Zu=`${lr}px ${kt.reference.y+Yu-dt}px`;return Ze.floating.style.setProperty("--transform-origin",Y&&ln==="y"&&Ku?Zu:Xu),{}}},i1,S),Q(()=>{!w&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,h]);const ce=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:pe,elements:Z,x:Ce,y:fe,middlewareData:le,update:Oe,placement:_,context:z,isPositioned:be,floatingStyles:K}=Lx({rootContext:h,open:g?w:void 0,placement:F,middleware:H,strategy:n,whileElementsMounted:g?void 0:(...Ae)=>Vr(...Ae,ce),nodeId:x,externalTree:E}),{sideX:q,sideY:ve}=le.adaptiveOrigin||yo,Te=be?n:"fixed",Ge=d.useMemo(()=>{const Ae=S?{position:Te,[q]:Ce,[ve]:fe}:{position:Te,...K};return be||(Ae.opacity=0),Ae},[S,Te,q,Ce,ve,fe,K,be]),ze=d.useRef(null);Q(()=>{if(!w)return;const Ae=T.current,Ze=typeof Ae=="function"?Ae():Ae,ct=(ia(Ze)?Ze.current:Ze)||null||null;ct!==ze.current&&(pe.setPositionReference(ct),ze.current=ct)},[w,pe,$,T]),d.useEffect(()=>{if(!w)return;const Ae=T.current;typeof Ae!="function"&&ia(Ae)&&Ae.current!==ze.current&&(pe.setPositionReference(Ae.current),ze.current=Ae.current)},[w,pe,$,T]),d.useEffect(()=>{if(g&&w&&Z.reference&&Z.floating)return Vr(Z.reference,Z.floating,Oe,ce)},[g,w,Z,Oe,ce]);const nt=it(_),cn=Vl(o,nt,D),qt=Vt(_)||"center",Kn=!!((Qn=le.hide)!=null&&Qn.referenceHidden);Q(()=>{v&&w&&be&&C(nt)},[v,w,be,nt]);const Xn=d.useMemo(()=>{var Ae,Ze;return{position:"absolute",top:(Ae=le.arrow)==null?void 0:Ae.y,left:(Ze=le.arrow)==null?void 0:Ze.x}},[le.arrow]),Zn=((Jn=le.arrow)==null?void 0:Jn.centerOffset)!==0;return d.useMemo(()=>({positionerStyles:Ge,arrowStyles:Xn,arrowRef:ae,arrowUncentered:Zn,side:cn,align:qt,physicalSide:nt,anchorHidden:Kn,refs:pe,context:z,isPositioned:be,update:Oe}),[Ge,Xn,ae,Zn,cn,qt,nt,Kn,pe,z,be,Oe])}function ia(e){return e!=null&&"current"in e}function Gl(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=de(r),i=d.useRef(0),a=et(c1).current,c=et(a1).current,[l,u]=d.useState(0),f=d.useRef(l),p=de((b,x)=>{c.set(b,x??null),f.current+=1,u(f.current)}),g=de(b=>{c.delete(b),f.current+=1,u(f.current)}),h=d.useMemo(()=>{const b=new Map;return Array.from(c.keys()).filter(S=>S.isConnected).sort(l1).forEach((S,v)=>{const E=c.get(S)??{};b.set(S,{...E,index:v})}),b},[c,l]);Q(()=>{if(typeof MutationObserver!="function"||h.size===0)return;const b=new MutationObserver(x=>{const S=new Set,v=E=>S.has(E)?S.delete(E):S.add(E);x.forEach(E=>{E.removedNodes.forEach(v),E.addedNodes.forEach(v)}),S.size===0&&(f.current+=1,u(f.current))});return h.forEach((x,S)=>{S.parentElement&&b.observe(S.parentElement,{childList:!0})}),()=>{b.disconnect()}},[h]),Q(()=>{f.current===l&&(n.current.length!==h.size&&(n.current.length=h.size),o&&o.current.length!==h.size&&(o.current.length=h.size),i.current=h.size),s(h)},[s,h,n,o,l]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{o&&(o.current=[])},[o]);const w=de(b=>(a.add(b),()=>{a.delete(b)}));Q(()=>{a.forEach(b=>b(h))},[a,h]);const m=d.useMemo(()=>({register:p,unregister:g,subscribeMapChange:w,elementsRef:n,labelsRef:o,nextIndexRef:i}),[p,g,w,n,o,i]);return k.jsx(Tc.Provider,{value:m,children:t})}function a1(){return new Map}function c1(){return new Set}function l1(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const ql=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return k.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function Ul(e,t,{styles:n,transitionStatus:o,props:r,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),Le("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},Vs(o),r],stateAttributesMapping:wn})}let aa={},ca={},la="";function u1(e){if(typeof document>"u")return!1;const t=Me(e);return Fe(t).innerWidth-t.documentElement.clientWidth>0}function d1(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Me(e),o=n.documentElement,r=n.body,s=nn(o)?o:r,i=s.style.overflowY,a=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,o.style.scrollbarGutter=a,c===l}function f1(e){const t=Me(e),n=t.documentElement,o=t.body,r=nn(n)?n:o,s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function p1(e){var g;const t=Me(e),n=t.documentElement,o=t.body,r=Fe(n);let s=0,i=0,a=!1;const c=yt.create();if(sn&&(((g=r.visualViewport)==null?void 0:g.scale)??1)!==1)return()=>{};function l(){const h=r.getComputedStyle(n),w=r.getComputedStyle(o),x=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,aa={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},la=n.style.scrollBehavior,ca={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const S=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,E=h.overflowY==="scroll"||w.overflowY==="scroll",y=h.overflowX==="scroll"||w.overflowX==="scroll",C=Math.max(0,r.innerWidth-o.clientWidth),R=Math.max(0,r.innerHeight-o.clientHeight),O=parseFloat(w.marginTop)+parseFloat(w.marginBottom),P=parseFloat(w.marginLeft)+parseFloat(w.marginRight),j=nn(n)?n:o;if(a=d1(e),a){n.style.scrollbarGutter=x,j.style.overflowY="hidden",j.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:x,overflowY:"hidden",overflowX:"hidden"}),(S||E)&&(n.style.overflowY="scroll"),(v||y)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:O||R?`calc(100dvh - ${O+R}px)`:"100dvh",width:P||C?`calc(100vw - ${P+C}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,aa),Object.assign(o.style,ca),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=la)}function f(){u(),c.request(l)}l();const p=Se(r,"resize",f);return()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&p()}}class h1{constructor(){Ie(this,"lockCount",0);Ie(this,"restore",null);Ie(this,"timeoutLock",ht.create());Ie(this,"timeoutUnlock",ht.create());Ie(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Ie(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Me(t).documentElement,r=Fe(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=qe;return}const s=Uo||!u1(t);this.restore=s?f1(t):p1(t)}}const g1=new h1;function Yl(e=!0,t=null){Q(()=>{if(e)return g1.acquire(t)},[e,t])}const m1=20;function b1(e,t,n,o){const[r,s]=d.useState(!1);Q(()=>{if(!e||!t||n==null){s(!1);return}const i=Me(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-m1)},[e,t,n]),Yl(e&&(!t||r),o)}const Kl=d.forwardRef(function(t,n){var Ce;const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:a,align:c,sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:g=5,sticky:h=!1,disableAnchorTracking:w=!1,collisionAvoidance:m=Ry,style:b,...x}=t,{store:S}=vt(),v=t1(),E=Gn(!0),y=S.useState("parent"),C=S.useState("floatingRootContext"),R=S.useState("floatingTreeRoot"),O=S.useState("mounted"),P=S.useState("open"),j=S.useState("modal"),L=S.useState("openMethod"),$=S.useState("activeTriggerElement"),T=S.useState("transitionStatus"),M=S.useState("positionerElement"),N=S.useState("instantType"),D=S.useState("hasViewport"),A=S.useState("lastOpenChangeReason"),F=S.useState("floatingNodeId"),I=S.useState("floatingParentNodeId"),B=C.useState("domReferenceElement"),V=d.useRef(null),re=Mc(M,!1,!1);let se=o,G=l,W=u,ae=c,U=m;y.type==="context-menu"&&(se=o??((Ce=y.context)==null?void 0:Ce.anchor),ae=ae??"start",!a&&ae!=="center"&&(W=t.alignOffset??2,G=t.sideOffset??-5));let ee=a,ye=ae;y.type==="menu"?(ee=ee??"inline-end",ye=ye??"start",U=t.collisionAvoidance??Jc):y.type==="menubar"&&(ee=ee??(y.context.orientation==="vertical"?"inline-end":"bottom"),ye=ye??"start");const ke=y.type==="context-menu",H=Wl({anchor:se,floatingRootContext:C,positionMethod:E?"fixed":r,mounted:O,side:ee,sideOffset:G,align:ye,alignOffset:W,arrowPadding:ke?0:g,collisionBoundary:f,collisionPadding:p,sticky:h,nodeId:F,keepMounted:v,disableAnchorTracking:w,collisionAvoidance:U,shiftCrossAxis:ke&&!("side"in U&&U.side==="flip"),externalTree:R,adaptiveOrigin:D?Hl:void 0});d.useEffect(()=>{function fe(le){le.open&&(le.parentNodeId===F&&S.set("hoverEnabled",!1),le.nodeId!==F&&le.parentNodeId===S.select("floatingParentNodeId")&&S.setOpen(!1,we(Pn)))}return R.events.on("menuopenchange",fe),()=>{R.events.off("menuopenchange",fe)}},[S,R.events,F]),d.useEffect(()=>{if(S.select("floatingParentNodeId")==null)return;function fe(le){if(le.open||le.nodeId!==S.select("floatingParentNodeId"))return;const Oe=le.reason??Pn;S.setOpen(!1,we(Oe))}return R.events.on("menuopenchange",fe),()=>{R.events.off("menuopenchange",fe)}},[R.events,S]);const te=Xe();d.useEffect(()=>{P||te.clear()},[P,te]),d.useEffect(()=>{function fe(le){if(!(!P||le.nodeId!==S.select("floatingParentNodeId")))if(le.target&&$&&$!==le.target){const Oe=S.select("closeDelay");Oe>0?te.isStarted()||te.start(Oe,()=>{S.setOpen(!1,we(Pn))}):S.setOpen(!1,we(Pn))}else te.clear()}return R.events.on("itemhover",fe),()=>{R.events.off("itemhover",fe)}},[R.events,P,$,S,te]),d.useEffect(()=>{const fe={open:P,nodeId:F,parentNodeId:I,reason:S.select("lastOpenChangeReason")};R.events.emit("menuopenchange",fe)},[R.events,P,S,F,I]),Q(()=>{const fe=B,le=V.current;if(fe&&(V.current=fe),le&&fe&&fe!==le){S.set("instantType",void 0);const Oe=new AbortController;return re(()=>{S.set("instantType","trigger-change")},Oe.signal),()=>{Oe.abort()}}},[B,re,S]);const Y={open:P,side:H.side,align:H.align,anchorHidden:H.anchorHidden,nested:y.type==="menu",instant:N},he=y.type==="menubar"&&y.context.modal;b1(P&&(he||j&&A!==Ue),L==="touch",M,$);const ce=Ul(t,Y,{styles:H.positionerStyles,transitionStatus:T,props:x,refs:[n,S.useStateSetter("positionerElement")],hidden:!O,inert:!P}),pe=O&&y.type!=="menu"&&(y.type!=="menubar"&&j&&A!==Ue||y.type==="menubar"&&y.context.modal);let Z=null;return y.type==="menubar"?Z=y.context.contentElement:y.type===void 0&&(Z=$),k.jsxs(kc.Provider,{value:H,children:[pe&&k.jsx(ql,{ref:y.type==="context-menu"||y.type==="nested-context-menu"?y.context.internalBackdropRef:null,inert:zl(!P),cutout:Z}),k.jsx(Ty,{id:F,children:k.jsx(Gl,{elementsRef:S.context.itemDomElements,labelsRef:S.context.itemLabels,children:ce})})]})}),y1=d.createContext(null);function Xl(e){return d.useContext(y1)}function x1(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Zl(e,t){const n=d.useRef(e),o=de(t);Q(()=>{n.current!==e&&o(n.current)},[e,o]),Q(()=>{n.current=e},[e])}function v1(e,t){const n=de((s,i)=>{(typeof e=="function"?e():e)||t(i||(Uo?"touch":""))}),{onClick:o,onPointerDown:r}=x1(n);return d.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function w1(e){const[t,n]=d.useState(null),o=v1(e,n);return Zl(e,r=>{r&&!e&&n(null)}),d.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const k1={...js,disabled:ie(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:ie(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:ie(e=>e.openMethod),allowMouseEnter:ie(e=>e.allowMouseEnter),highlightItemOnHover:ie(e=>e.highlightItemOnHover),stickIfOpen:ie(e=>e.stickIfOpen),parent:ie(e=>e.parent),rootId:ie(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:ie(e=>e.activeIndex),isActive:ie((e,t)=>e.activeIndex===t),hoverEnabled:ie(e=>e.hoverEnabled),instantType:ie(e=>e.instantType),lastOpenChangeReason:ie(e=>e.openChangeReason),floatingTreeRoot:ie(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:ie(e=>e.floatingNodeId),floatingParentNodeId:ie(e=>e.floatingParentNodeId),itemProps:ie(e=>e.itemProps),closeDelay:ie(e=>e.closeDelay),hasViewport:ie(e=>e.hasViewport),keyboardEventRelay:ie(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Gs extends er{constructor(n){super({...S1(),...n},{positionerRef:d.createRef(),popupRef:d.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),onOpenChangeComplete:void 0,triggerElements:new Un},k1);Ie(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",o=>{var r;if((r=this.unsubscribeParentListener)==null||r.call(this),o.type==="menu"){let s=o.store.select("rootId"),i=o.store.select("floatingTreeRoot"),a=o.store.select("keyboardEventRelay");this.unsubscribeParentListener=o.store.subscribe(()=>{const c=o.store.select("rootId"),l=o.store.select("floatingTreeRoot"),u=o.store.select("keyboardEventRelay");s===c&&i===l&&a===u||(s=c,i=l,a=u,this.notifyAll())}),this.context.allowMouseUpTriggerRef=o.store.context.allowMouseUpTriggerRef;return}o.type!==void 0&&(this.context.allowMouseUpTriggerRef=o.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,o){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:o})}static useStore(n,o){const r=et(()=>new Gs(o)).current;return n??r}}function S1(){return{...Ds(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Es,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:De,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const Ql=d.createContext(void 0);function Jl(){return d.useContext(Ql)}const qs=Ps(function(t){const{children:n,open:o,onOpenChange:r,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:a=!1,modal:c,loopFocus:l=!0,orientation:u="vertical",actionsRef:f,closeParentOnEsc:p=!1,handle:g,triggerId:h,defaultTriggerId:w=null,highlightItemOnHover:m=!0}=t,b=Gn(!0),x=vt(!0),S=Xl(!0),v=Jl(),E=d.useMemo(()=>v&&x?{type:"menu",store:x.store}:S?{type:"menubar",context:S}:b&&!x?{type:"context-menu",context:b}:{type:void 0},[b,x,S,v]),y=Gs.useStore(g==null?void 0:g.store,{open:i,openProp:o,activeTriggerId:w,triggerIdProp:h,parent:E});Tl(y,o,i,w),y.useControlledProp("openProp",o),y.useControlledProp("triggerIdProp",h),y.useContextCallback("onOpenChangeComplete",s);const C=_t(),R=_t(),O=y.useState("floatingTreeRoot"),P=al(O),j=Wt(),L=y.useState("open"),$=y.useState("activeTriggerElement"),T=y.useState("positionerElement"),M=y.useState("hoverEnabled"),N=y.useState("disabled"),D=y.useState("lastOpenChangeReason"),A=y.useState("parent"),F=y.useState("activeIndex"),I=y.useState("payload"),B=y.useState("floatingParentNodeId"),V=d.useRef(null),re=d.useRef(A.type!=="context-menu"),se=Xe(),G=d.useRef(!0),W=Xe(),ae=B!=null,{openMethod:U,triggerProps:ee}=w1(L);y.useSyncedValues({disabled:a,highlightItemOnHover:m,modal:A.type===void 0?c:void 0,openMethod:U,rootId:C}),As(y);const{forceUnmount:ye}=$s(L,y,()=>{y.update({allowMouseEnter:!1,stickIfOpen:!0})});Q(()=>{b&&!x?y.update({parent:{type:"context-menu",context:b},floatingNodeId:P,floatingParentNodeId:j}):x&&y.update({floatingNodeId:P,floatingParentNodeId:j})},[b,x,P,j,y]),d.useEffect(()=>{if(L||(V.current=null),A.type==="context-menu"){if(!L){se.clear(),re.current=!1;return}se.start(500,()=>{re.current=!0})}},[se,L,A.type]),Q(()=>{!L&&!M&&y.set("hoverEnabled",!0)},[L,M,y]);const ke=de((q,ve)=>{const Te=ve.reason;if(L===q&&ve.trigger===$&&D===Te)return;const Ge=Cl(ve);if(!q&&ve.trigger==null&&(ve.trigger=$??void 0),r==null||r(q,ve),ve.isCanceled)return;y.state.floatingRootContext.dispatchOpenChange(q,ve);const ze=ve.event;if(q===!1&&(ze==null?void 0:ze.type)==="click"&&ze.pointerType==="touch"&&!G.current)return;q&&Te===dn?(G.current=!1,W.start(300,()=>{G.current=!0})):(G.current=!0,W.clear());const nt=(Te===rn||Te===Rc)&&ze.detail===0&&(ze==null?void 0:ze.isTrusted),cn=!q&&(Te===Wo||Te==null),qt={open:q,openChangeReason:Te};V.current=ve.event??null,Is(qt,q,ve.trigger,Ge()),y.update(qt),A.type==="menubar"&&(Te===dn||Te===gn||Te===Ue||Te===Nr||Te===Pn)?y.set("instantType","group"):nt||cn?y.set("instantType",nt?"click":"dismiss"):y.set("instantType",void 0)}),H=Sl({popupStore:y,floatingId:R,nested:j!=null,onOpenChange:ke}),te=H.context.events;d.useEffect(()=>{const q=({open:ve,eventDetails:Te})=>ke(ve,Te);return te.on("setOpen",q),()=>{te==null||te.off("setOpen",q)}},[te,ke]);const Y=d.useCallback(()=>{y.setOpen(!1,we(hs))},[y]);d.useImperativeHandle(f,()=>({unmount:ye,close:Y}),[ye,Y]);let he;A.type==="context-menu"&&(he=A.context),d.useImperativeHandle(he==null?void 0:he.positionerRef,()=>T,[T]),d.useImperativeHandle(he==null?void 0:he.actionsRef,()=>({setOpen:ke}),[ke]);const xe=Ts(H,{enabled:!N,bubbles:{escapeKey:p&&A.type==="menu"},outsidePress(){var q;return A.type!=="context-menu"||((q=V.current)==null?void 0:q.type)==="contextmenu"?!0:re.current},externalTree:ae?O:void 0}),ce=Ws(),pe=d.useCallback(q=>{y.select("activeIndex")!==q&&y.set("activeIndex",q)},[y]),Z=zx(H,{enabled:!N,listRef:y.context.itemDomElements,activeIndex:F,nested:A.type!==void 0,loopFocus:l,orientation:u,parentOrientation:A.type==="menubar"?A.context.orientation:void 0,rtl:ce==="rtl",disabledIndices:Qt,onNavigate:pe,openOnArrowKeyDown:A.type!=="context-menu",externalTree:ae?O:void 0,focusItemOnHover:m}),Ce=d.useCallback(q=>{y.context.typingRef.current=q},[y]),fe=Hx(H,{enabled:!N,listRef:y.context.itemLabels,elementsRef:y.context.itemDomElements,activeIndex:F,resetMs:vy,onMatch:q=>{L&&q!==F&&y.set("activeIndex",q)},onTyping:Ce}),le=d.useMemo(()=>{const q=ut(fe.reference,Z.reference,xe.reference,{onMouseMove(){y.set("allowMouseEnter",!0)}},ee);return q["aria-haspopup"]="menu",q["aria-expanded"]=L,q},[y,fe.reference,Z.reference,xe.reference,ee,L]),Oe=d.useMemo(()=>{const q=ut(Z.trigger,xe.trigger,ee);return q["aria-haspopup"]="menu",q["aria-expanded"]=!1,q},[Z.trigger,xe.trigger,ee]),_=d.useMemo(()=>ut(Os,{id:R,role:"menu","aria-labelledby":$==null?void 0:$.id,onMouseMove(){y.set("allowMouseEnter",!0),A.type==="menu"&&y.set("hoverEnabled",!1)},onClick(){y.select("hoverEnabled")&&y.set("hoverEnabled",!1)},onKeyDown(q){const ve=y.select("keyboardEventRelay");ve&&!q.isPropagationStopped()&&ve(q)}},fe.floating,Z.floating,xe.floating),[$,R,A.type,y,fe.floating,Z.floating,xe.floating]),z=Z.item??De;Ns(y,{floatingRootContext:H,activeTriggerProps:le,inactiveTriggerProps:Oe,popupProps:_,itemProps:z});const be=d.useMemo(()=>({store:y,parent:E}),[y,E]),K=k.jsx(fs.Provider,{value:be,children:typeof n=="function"?n({payload:I}):n});return A.type===void 0||A.type==="context-menu"?k.jsx(My,{externalTree:O,children:K}):K});function eu(e){const t=vt().store,n=d.useMemo(()=>({parentMenu:t}),[t]);return k.jsx(Ql.Provider,{value:n,children:k.jsx(qs,{...e})})}function R1(e){const t=e.getBoundingClientRect(),n=Fe(e);if(ms)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const i=parseFloat(o.width)||0,a=parseFloat(o.height)||0,c=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,c),f=Math.max(t.height,a,l),p=u-t.width,g=f-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-g/2,bottom:t.bottom+g/2}}function E1(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:o}=is(),{ref:r,index:s}=bs(e),i=n===s,a=d.useRef(null),c=Ft(r,a);return{compositeProps:{tabIndex:i?0:-1,onFocus(){o(s)},onMouseMove(){const u=a.current;if(!t||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!f&&u.focus()}},compositeRef:c,index:s}}function tu(e){const{render:t,className:n,style:o,state:r=De,props:s=Qt,refs:i=Qt,metadata:a,stateAttributesMapping:c,tag:l="div",...u}=e,{compositeProps:f,compositeRef:p}=E1({metadata:a});return Le(l,e,{state:r,ref:[...i,p],props:[f,...s,u],stateAttributesMapping:c})}function Us(e){if(Ne(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Tt(e))return Us(Ot(e))}function C1(e,t){const n=d.useRef(null);function o(s){pt.flushSync(()=>{e.setOpen(!1,we(gn,s.nativeEvent,s.currentTarget))});const i=my(n.current);i==null||i.focus()}function r(s){var a;const i=e.select("positionerElement");if(i&&fn(s,i))(a=e.context.beforeContentFocusGuardRef.current)==null||a.focus();else{pt.flushSync(()=>{e.setOpen(!1,we(gn,s.nativeEvent,s.currentTarget))});let c=gy(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ue(i,c);){const l=c;if(c=Rs(c),c===l)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:o,handleFocusTargetFocus:r}}function T1(e){const{enabled:t=!0,mouseDownAction:n,open:o}=e,r=d.useRef(!1);return d.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!o||n==="close"&&o)&&(r.current=!0,Me(s.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:s=>{r.current&&(r.current=!1,s.preventBaseUIHandler())}}:De,[t,n,o])}const po=2,M1=wl(function(t,n){const{render:o,className:r,style:s,disabled:i=!1,nativeButton:a=!0,id:c,openOnHover:l,delay:u=100,closeDelay:f=0,handle:p,payload:g,...h}=t,w=vt(!0),m=(p==null?void 0:p.store)??(w==null?void 0:w.store);if(!m)throw new Error(We(85));const b=gt(c),x=m.useState("isTriggerActive",b),S=m.useState("floatingRootContext"),v=m.useState("isOpenedByTrigger",b),E=m.useState("triggerPopupId",b),y=d.useRef(null),C=O1(),R=is(!0),O=Gt(),P=d.useMemo(()=>O??new Es,[O]),j=al(P),L=Wt(),{registerTrigger:$,isMountedByThisTrigger:T}=Ml(b,y,m,{payload:g,closeDelay:f,parent:C,floatingTreeRoot:P,floatingNodeId:j,floatingParentNodeId:L,keyboardEventRelay:R==null?void 0:R.relayKeyboardEvent}),M=C.type==="menubar",N=m.useState("disabled"),D=i||N||M&&C.context.disabled,{getButtonProps:A,buttonRef:F}=vn({disabled:D,native:a});d.useEffect(()=>{!v&&C.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,v,C.type]);const I=d.useRef(null),B=Xe(),V=de(Z=>{if(!I.current)return;B.clear(),m.context.allowMouseUpTriggerRef.current=!1;const Ce=Z.target;if(ue(I.current,Ce)||ue(m.select("positionerElement"),Ce)||Ce===I.current||Ce!=null&&Us(Ce)===m.select("rootId"))return;const fe=R1(I.current);Z.clientX>=fe.left-po&&Z.clientX<=fe.right+po&&Z.clientY>=fe.top-po&&Z.clientY<=fe.bottom+po||P.events.emit("close",{domEvent:Z,reason:Ec})});d.useEffect(()=>{v&&m.select("lastOpenChangeReason")===Ue&&Me(I.current).addEventListener("mouseup",V,{once:!0})},[v,V,m]);const re=M&&C.context.hasSubmenuOpen,G=Bs(S,{enabled:(l??re)&&!D&&C.type!=="context-menu"&&(!M||re&&!T),handleClose:zs({blockPointerEvents:!M}),mouseOnly:!0,move:!1,restMs:C.type===void 0?u:void 0,delay:{close:f},triggerElementRef:y,externalTree:P,isActiveTrigger:x,isClosing:()=>m.select("transitionStatus")==="ending"}),W=P1(v,m.select("lastOpenChangeReason")),ae=ll(S,{enabled:!D&&C.type!=="context-menu",event:v&&M?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?W:!1}),U=Il(S,{enabled:!D&&re}),ee=T1({open:v,enabled:M,mouseDownAction:"open"}),ye=d.useMemo(()=>ut(U.reference,ae.reference),[U.reference,ae.reference]),ke=m.useState("triggerProps",T),{preFocusGuardRef:H,handlePreFocusGuardFocus:te,handleFocusTargetFocus:Y}=C1(m,y),he={disabled:D,open:v},xe=[I,n,F,$,y],ce=[ye,G??De,ke,{"aria-haspopup":"menu","aria-controls":E,id:b,onMouseDown:Z=>{if(m.select("open"))return;B.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),Me(Z.currentTarget).addEventListener("mouseup",V,{once:!0})}},M?{role:"menuitem"}:{},ee,h,A],pe=Le("button",t,{enabled:!M,stateAttributesMapping:$r,state:he,ref:xe,props:ce});return M?k.jsx(tu,{tag:"button",render:o,className:r,style:s,state:he,refs:xe,props:ce,stateAttributesMapping:$r}):v?k.jsxs(d.Fragment,{children:[k.jsx(bn,{ref:H,onFocus:te},`${b}-pre-focus-guard`),k.jsx(d.Fragment,{children:pe},b),k.jsx(bn,{ref:m.context.triggerFocusTargetRef,onFocus:Y},`${b}-post-focus-guard`)]}):k.jsx(d.Fragment,{children:pe},b)});function P1(e,t){const n=Xe(),[o,r]=d.useState(!1);return Q(()=>{e&&t==="trigger-hover"?(r(!0),n.start(wy,()=>{r(!1)})):e||(n.clear(),r(!1))},[e,t,n]),o}function O1(){const e=Gn(!0),t=vt(!0),n=Xl();return d.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const nu=d.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",style:i,...a}=t;return Le("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},a]})});function I1(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const ou=d.forwardRef(function(t,n){const{render:o,className:r,style:s,label:i,id:a,nativeButton:c=!1,openOnHover:l=!0,delay:u=100,closeDelay:f=0,disabled:p=!1,...g}=t,h=bs({label:i}),w=ds(),{store:m}=vt(),b=gt(a),x=m.useState("open"),S=m.useState("floatingRootContext"),v=m.useState("floatingTreeRoot"),E=m.useState("triggerPopupId",b),y=El(b,m),C=d.useCallback(ae=>{const U=y(ae);return ae!==null&&m.select("open")&&m.select("activeTriggerId")==null&&m.update({activeTriggerId:b,activeTriggerElement:ae,closeDelay:f}),U},[y,f,m,b]),R=d.useRef(null),O=d.useCallback(ae=>{R.current=ae,m.set("activeTriggerElement",ae)},[m]),P=Jl();if(!(P!=null&&P.parentMenu))throw new Error(We(37));m.useSyncedValue("closeDelay",f);const j=P.parentMenu,L=m.useState("disabled"),$=j.useState("disabled"),T=p||L||$,M=j.useState("itemProps"),N=j.useState("isActive",h.index),D=d.useMemo(()=>({type:"submenu-trigger",setActive(){j.select("highlightItemOnHover")&&j.set("activeIndex",h.index)}}),[j,h.index]),{getItemProps:A,itemRef:F}=Cc({closeOnClick:!1,disabled:T,highlighted:N,id:b,store:m,typingRef:j.context.typingRef,nativeButton:c,itemMetadata:D,nodeId:w==null?void 0:w.context.nodeId}),I=m.useState("hoverEnabled"),B=Bs(S,{enabled:I&&l&&!T,handleClose:zs({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:{open:u,close:f},shouldOpen:u>0?()=>j.select("allowMouseEnter"):void 0,triggerElementRef:R,externalTree:v,isClosing:()=>m.select("transitionStatus")==="ending"}),re=ll(S,{enabled:!T,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}).reference??De,se=m.useState("triggerProps",!0);return delete se.id,Le("div",t,{state:{disabled:T,highlighted:N,open:x},stateAttributesMapping:Sc,props:[re,B,se,M,{"aria-controls":E,tabIndex:x||N?0:-1,onBlur(){N&&j.set("activeIndex",null)}},g,A],ref:[n,h.ref,F,C,O]})});function A1(e){const[t,n]=d.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),o=d.useRef(null),r=d.useRef(null),s=d.useRef(null),i=d.useRef(null),a=d.useRef(!0),c=d.useRef(null),l=_t(),u=d.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:s,backdropRef:o,internalBackdropRef:r,positionerRef:i,allowMouseUpTriggerRef:a,initialCursorPointRef:c,rootId:l}),[t,l]);return k.jsx(wc.Provider,{value:u,children:k.jsx(fs.Provider,{value:void 0,children:k.jsx(qs,{...e})})})}const ua=500,$1=d.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{setAnchor:a,actionsRef:c,internalBackdropRef:l,backdropRef:u,positionerRef:f,allowMouseUpTriggerRef:p,initialCursorPointRef:g,rootId:h}=Gn(!1),{store:w}=vt(!1),m=w.useState("open"),b=w.useState("disabled"),x=d.useRef(null),S=d.useRef(null),v=Xe(),E=Xe(),y=d.useRef(!1);function C(T,M,N){var A;const D=N.type.startsWith("touch");g.current={x:T,y:M},a({getBoundingClientRect(){return DOMRect.fromRect({width:D?10:0,height:D?10:0,x:T,y:M})}}),y.current=!1,(A=c.current)==null||A.setOpen(!0,we(rn,N)),E.start(ua,()=>{y.current=!0})}function R(T){if(b)return;p.current=!0,ft(T),C(T.clientX,T.clientY,T.nativeEvent);const M=Me(x.current);Se(M,"mouseup",N=>{var A;if(p.current=!1,!y.current)return;E.clear(),y.current=!1;const D=Ve(N);ue(f.current,D)||h&&D&&Us(D)===h||(A=c.current)==null||A.setOpen(!1,we(Ec,N))},{once:!0})}function O(T){if(!b&&(p.current=!1,T.touches.length===1)){T.stopPropagation();const M=T.touches[0];S.current={x:M.clientX,y:M.clientY},v.start(ua,()=>{S.current&&C(S.current.x,S.current.y,T.nativeEvent)})}}function P(T){if(v.isStarted()&&S.current&&T.touches.length===1){const M=T.touches[0],N=10,D=Math.abs(M.clientX-S.current.x),A=Math.abs(M.clientY-S.current.y);(D>N||A>N)&&v.clear()}}function j(){v.clear(),S.current=null}return d.useEffect(()=>{function T(N){if(b)return;const A=Ve(N);(ue(x.current,A)||ue(l.current,A)||ue(u.current,A))&&N.preventDefault()}const M=Me(x.current);return Se(M,"contextmenu",T)},[u,b,l]),Le("div",t,{state:{open:m},ref:[x,n],props:[{onContextMenu:R,onTouchStart:O,onTouchMove:P,onTouchEnd:j,onTouchCancel:j,style:{WebkitTouchCallout:"none"}},i],stateAttributesMapping:$r})});function N1({...e}){return k.jsx(A1,{"data-slot":"context-menu",...e})}function D1({className:e,...t}){return k.jsx($1,{"data-slot":"context-menu-trigger",className:je("select-none",e),...t})}function ru({className:e,align:t="start",alignOffset:n=4,side:o="right",sideOffset:r=0,...s}){return k.jsx(Bl,{children:k.jsx(Kl,{className:"isolate z-50 outline-none",align:t,alignOffset:n,side:o,sideOffset:r,children:k.jsx(Fl,{"data-slot":"context-menu-content",className:je("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/5 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 dark:ring-foreground/10 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 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...s})})})}function L1({...e}){return k.jsx(Oc,{"data-slot":"context-menu-group",...e})}function j1({className:e,inset:t,variant:n="default",...o}){return k.jsx(Ic,{"data-slot":"context-menu-item","data-inset":t,"data-variant":n,className:je("group/context-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",e),...o})}function F1({...e}){return k.jsx(eu,{"data-slot":"context-menu-sub",...e})}function _1({className:e,inset:t,children:n,...o}){return k.jsxs(ou,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:je("flex min-h-7 cursor-default items-center rounded-xl px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[n,k.jsx(us,{className:"ml-auto"})]})}function B1({...e}){return k.jsx(ru,{"data-slot":"context-menu-sub-content",className:"shadow-lg animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",side:"right",...e})}function z1({className:e,...t}){return k.jsx(nu,{"data-slot":"context-menu-separator",className:je("-mx-1 my-1 h-px bg-border/50",e),...t})}function H1({...e}){return k.jsx(qs,{"data-slot":"dropdown-menu",...e})}function V1({...e}){return k.jsx(M1,{"data-slot":"dropdown-menu-trigger",...e})}function su({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:o=4,className:r,container:s,...i}){return k.jsx(Bl,{container:s,children:k.jsx(Kl,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:o,children:k.jsx(Fl,{"data-slot":"dropdown-menu-content",className:je("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/5 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",r),...i})})})}function W1({...e}){return k.jsx(Oc,{"data-slot":"dropdown-menu-group",...e})}function G1({className:e,inset:t,...n}){return k.jsx(zb,{"data-slot":"dropdown-menu-label","data-inset":t,className:je("px-2 py-1 text-xs text-muted-foreground data-inset:pl-7",e),...n})}function q1({className:e,inset:t,variant:n="default",...o}){return k.jsx(Ic,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:je("group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...o})}function U1({...e}){return k.jsx(eu,{"data-slot":"dropdown-menu-sub",...e})}function Y1({className:e,inset:t,children:n,...o}){return k.jsxs(ou,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:je("flex min-h-7 cursor-default items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[n,k.jsx(us,{className:"ml-auto"})]})}function K1({align:e="start",alignOffset:t=-3,side:n="right",sideOffset:o=0,className:r,...s}){return k.jsx(su,{"data-slot":"dropdown-menu-sub-content",className:je("w-auto min-w-[96px] rounded-2xl p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/5 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 dark:ring-foreground/10 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 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",r),align:e,alignOffset:t,side:n,sideOffset:o,...s})}function X1({className:e,...t}){return k.jsx(nu,{"data-slot":"dropdown-menu-separator",className:je("-mx-1 my-1 h-px bg-border/50",e),...t})}const iu=d.createContext(!1),au=d.createContext(void 0);function an(e){const t=d.useContext(au);if(e===!1&&t===void 0)throw new Error(We(27));return t}const Z1={...wn,...Vo},cu=d.forwardRef(function(t,n){const{render:o,className:r,style:s,forceRender:i=!1,...a}=t,{store:c}=an(),l=c.useState("open"),u=c.useState("nested"),f=c.useState("mounted"),p=c.useState("transitionStatus");return Le("div",t,{state:{open:l,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:Z1,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!u})}),sr=d.forwardRef(function(t,n){const{render:o,className:r,style:s,disabled:i=!1,nativeButton:a=!0,...c}=t,{store:l}=an(),u=l.useState("open"),{getButtonProps:f,buttonRef:p}=vn({disabled:i,native:a}),g={disabled:i};function h(w){u&&l.setOpen(!1,we(Eb,w.nativeEvent))}return Le("button",t,{state:g,ref:[n,p],props:[{onClick:h},c,f]})}),Q1=d.forwardRef(function(t,n){const{render:o,className:r,style:s,id:i,...a}=t,{store:c}=an(),l=gt(i);return c.useSyncedValueWithCleanup("descriptionElementId",l),Le("p",t,{ref:n,props:[{id:l},a]})});let J1=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),ev=(function(e){return e[e.open=Zt.open]="open",e[e.closed=Zt.closed]="closed",e[e.startingStyle=Zt.startingStyle]="startingStyle",e[e.endingStyle=Zt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const lu=d.createContext(void 0);function tv(){const e=d.useContext(lu);if(e===void 0)throw new Error(We(26));return e}const nv={...wn,...Vo,nestedDialogOpen(e){return e?{[ev.nestedDialogOpen]:""}:null}},uu=d.forwardRef(function(t,n){const{render:o,className:r,style:s,finalFocus:i,initialFocus:a,...c}=t,{store:l}=an(),u=l.useState("descriptionElementId"),f=l.useState("disablePointerDismissal"),p=l.useState("floatingRootContext"),g=l.useState("popupProps"),h=l.useState("modal"),w=l.useState("mounted"),m=l.useState("nested"),b=l.useState("nestedOpenDialogCount"),x=l.useState("open"),S=l.useState("openMethod"),v=l.useState("titleElementId"),E=l.useState("transitionStatus"),y=l.useState("role"),C=p.useState("floatingId"),R=c.id??C;tv(),Yo({open:x,ref:l.context.popupRef,onComplete(){var T,M;x&&((M=(T=l.context).onOpenChangeComplete)==null||M.call(T,!0))}});const O=a===void 0?Ox(l.context.popupRef):a,P=b>0,j=l.useStateSetter("popupElement"),$=Le("div",t,{state:{open:x,nested:m,transitionStatus:E,nestedDialogOpen:P},props:[g,{id:R,"aria-labelledby":v??void 0,"aria-describedby":u??void 0,role:y,...Os,hidden:!w,onKeyDown(T){Hs.has(T.key)&&T.stopPropagation()},style:{[J1.nestedDialogs]:b}},c],ref:[n,l.context.popupRef,j],stateAttributesMapping:nv});return k.jsx(cl,{context:p,openInteractionType:S,disabled:!w,closeOnFocusOut:!f,initialFocus:O,returnFocus:i,modal:h!==!1,restoreFocus:"popup",children:$})}),du=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=an(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||o?k.jsx(lu.Provider,{value:o,children:k.jsxs(ol,{ref:n,...r,children:[i&&a===!0&&k.jsx(ql,{ref:s.context.internalBackdropRef,inert:zl(!c)}),t.children]})}):null});function ov(e){const{store:t,actionsRef:n}=e,o=t.useState("open");Ax(t,o),As(t);const{forceUnmount:r}=$s(o,t),s=d.useCallback(()=>{t.setOpen(!1,we(hs))},[t]);d.useImperativeHandle(n,()=>({unmount:r,close:s}),[r,s])}function rv({store:e,parentContext:t,isDrawer:n}){const o=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),a=e.useState("floatingRootContext"),[c,l]=d.useState(0),[u,f]=d.useState(0),p=c===0,g=Ts(a,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!e.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0||"touches"in b&&b.touches.length!==1)return!1;const x=Ve(b);return p&&!r?s&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===x||e.context.backdropRef.current===x||ue(x,i)&&!(x!=null&&x.hasAttribute("data-base-ui-portal")):!0:!1},escapeKey:p});Yl(o&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(b,x)=>{l(b),f(x)}),e.useContextCallback("onNestedDialogClose",()=>{l(0),f(0)}),d.useEffect(()=>(t!=null&&t.onNestedDialogOpen&&o&&t.onNestedDialogOpen(c+1,u+(n?1:0)),t!=null&&t.onNestedDialogClose&&!o&&t.onNestedDialogClose(),()=>{t!=null&&t.onNestedDialogClose&&o&&t.onNestedDialogClose()}),[n,o,c,u,t]);const h=g.reference??De,w=g.trigger??De,m=g.floating??De;return Ns(e,{activeTriggerProps:h,inactiveTriggerProps:w,popupProps:m,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}const sv={...js,modal:ie(e=>e.modal),nested:ie(e=>e.nested),nestedOpenDialogCount:ie(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:ie(e=>e.nestedOpenDrawerCount),disablePointerDismissal:ie(e=>e.disablePointerDismissal),openMethod:ie(e=>e.openMethod),descriptionElementId:ie(e=>e.descriptionElementId),titleElementId:ie(e=>e.titleElementId),viewportElement:ie(e=>e.viewportElement),role:ie(e=>e.role)};class Ys extends er{constructor(n,o,r=!1){const s=new Un,i=iv(n);i.floatingRootContext=Pl(s,o,r);super(i,{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:s,onOpenChange:void 0,onOpenChangeComplete:void 0},sv);Ie(this,"setOpen",(n,o)=>{var s,i;if(o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),(i=(s=this.context).onOpenChange)==null||i.call(s,n,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,o);const r={open:n};Is(r,n,o.trigger),this.update(r)})}static useStore(n,o){return Rl(n,(s,i)=>new Ys(o,s,i),!0).store}}function iv(e={}){return{...Ds(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function av(e,t="dialog"){const{children:n,open:o,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:i,disablePointerDismissal:a=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:f,defaultTriggerId:p=null}=e,g=t==="drawer",h=t==="alert-dialog",w=h?!0:c,m=h||a,b=h?"alertdialog":"dialog",x=an(!0),v={modal:w,disablePointerDismissal:m,nested:!!x,role:b},E=Ys.useStore(u==null?void 0:u.store,{open:r,openProp:o,activeTriggerId:p,triggerIdProp:f,...v});vl(()=>{const j=o===void 0&&E.state.open===!1&&r===!0?{open:!0,activeTriggerId:p}:null;h?E.update(j?{...v,...j}:v):j&&E.update(j)}),E.useControlledProp("openProp",o),E.useControlledProp("triggerIdProp",f),E.useSyncedValues(v),E.useContextCallback("onOpenChange",s),E.useContextCallback("onOpenChangeComplete",i);const y=E.useState("open"),C=E.useState("mounted"),R=E.useState("payload");ov({store:E,actionsRef:l});const O=y||C,P=d.useMemo(()=>({store:E}),[E]);return k.jsx(iu.Provider,{value:!1,children:k.jsxs(au.Provider,{value:P,children:[O&&k.jsx(rv,{store:E,parentContext:x==null?void 0:x.store.context,isDrawer:g}),typeof n=="function"?n({payload:R}):n]})})}function fu(e){const t=d.useContext(iu)?"drawer":"dialog";return av(e,t)}const pu=d.forwardRef(function(t,n){const{render:o,className:r,style:s,id:i,...a}=t,{store:c}=an(),l=gt(i);return c.useSyncedValueWithCleanup("titleElementId",l),Le("h2",t,{ref:n,props:[{id:l},a]})});function cv({...e}){return k.jsx(fu,{"data-slot":"sheet",...e})}function lv({...e}){return k.jsx(sr,{"data-slot":"sheet-close",...e})}function uv({...e}){return k.jsx(du,{"data-slot":"sheet-portal",...e})}function dv({className:e,...t}){return k.jsx(cu,{"data-slot":"sheet-overlay",className:je("fixed inset-0 z-50 bg-black/30 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-sm",e),...t})}function fv({className:e,children:t,side:n="right",showCloseButton:o=!0,showOverlay:r=!0,...s}){return k.jsxs(uv,{children:[r&&k.jsx(dv,{}),k.jsxs(uu,{"data-slot":"sheet-content","data-side":n,className:je("fixed z-50 flex flex-col bg-popover bg-clip-padding text-sm text-popover-foreground shadow-xl transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...s,children:[t,o&&k.jsxs(sr,{"data-slot":"sheet-close",render:k.jsx(st,{variant:"ghost",className:"absolute top-4 right-4 bg-secondary",size:"icon-sm"}),children:[k.jsx(xc,{}),k.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function pv({className:e,...t}){return k.jsx(pu,{"data-slot":"sheet-title",className:je("font-heading text-base font-medium text-foreground",e),...t})}let da=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const hv={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},On={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},gv={disabled:!1,...On},hu={valid(e){return e===null?null:e?{[da.valid]:""}:{[da.invalid]:""}}},mv={invalid:void 0,name:void 0,validityData:{state:hv,errors:[],error:"",value:"",initialValue:null},setValidityData:qe,disabled:void 0,touched:On.touched,setTouched:qe,dirty:On.dirty,setDirty:qe,filled:On.filled,setFilled:qe,focused:On.focused,setFocused:qe,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:gv,markedDirtyRef:{current:!1},registerFieldControl:qe,validation:{getValidationProps:(e,t=De)=>t,inputRef:{current:null},registerInput:qe,commit:async()=>{},change:qe}},bv=d.createContext(mv);function Ks(e=!0){const t=d.useContext(bv);if(t.setValidityData===qe&&!e)throw new Error(We(28));return t}const yv=d.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:qe,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function gu(){return d.useContext(yv)}const xv=d.createContext({controlId:void 0,registerControlId:qe,labelId:void 0,setLabelId:qe,messageIds:[],setMessageIds:qe,getDescriptionProps:e=>e});function Xs(){return d.useContext(xv)}function vv(e,t,n,o=!0,r){const[s,i]=d.useState(),a=gt(r?`${r}-label`:void 0),c=e??t??s;return Q(()=>{const l=e||t||!o?void 0:wv(n.current,a);s!==l&&i(l)}),c}function wv(e,t){const n=kv(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function kv(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const r=e.nextElementSibling;if(r&&r.htmlFor===n)return r}const o=e.labels;return o&&o[0]}function mu(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,registerControlId:s}=Xs(),i=gt(t),a=n?r:void 0,c=et(()=>Symbol("labelable-control")),l=d.useRef(!1),u=d.useRef(t!=null),f=de(()=>{!l.current||s===qe||(l.current=!1,s(c.current,void 0))});return Q(()=>{if(s===qe)return;let p;if(n){const g=o==null?void 0:o.current;Ee(g)&&g.closest("label")!=null?p=t??null:p=a??i}else if(t!=null)u.current=!0,p=t;else if(u.current)p=i;else{f();return}if(p===void 0){f();return}l.current=!0,s(c.current,p)},[t,o,a,s,n,i,c,f]),d.useEffect(()=>f,[f]),r??i}function bu(e,t,n,o,r=!0,s){const{registerFieldControl:i}=Ks(),a=d.useRef(null);a.current||(a.current=Symbol()),Q(()=>{const c=a.current;return!c||!r?void 0:(i(c,{controlRef:e,getValue:o,id:t,name:s,value:n}),()=>{i(c,void 0)})},[e,r,o,t,s,i,n])}const Sv=d.forwardRef(function(t,n){const{render:o,className:r,id:s,name:i,value:a,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:f=!1,style:p,...g}=t,{state:h,name:w,disabled:m,setTouched:b,setDirty:x,validityData:S,setFocused:v,setFilled:E,validationMode:y,validation:C}=Ks(),{clearErrors:R}=gu(),O=m||c,P=w??i,j={...h,disabled:O},{labelId:L}=Xs(),$=mu({id:s});Q(()=>{var B;const I=a!=null;(B=C.inputRef.current)!=null&&B.value||I&&a!==""?E(!0):I&&a===""&&E(!1)},[C.inputRef,E,a]);const T=d.useRef(null);Q(()=>{f&&T.current===Je(Me(T.current))&&v(!0)},[f,v]);const[M]=Go({controlled:a,default:u,name:"FieldControl",state:"value"}),N=a!==void 0,D=N?M:void 0,A=de(()=>{var I;return(I=C.inputRef.current)==null?void 0:I.value});return bu(C.inputRef,$,D,A,!O,i),Le("input",t,{ref:[n,T],state:j,props:[{id:$,disabled:O,name:P,ref:C.inputRef,"aria-labelledby":L,autoFocus:f,...N?{value:D}:{defaultValue:u},onChange(I){const B=I.currentTarget.value;l==null||l(B,we(kn,I.nativeEvent)),x(B!==S.initialValue),E(B!==""),I.nativeEvent.defaultPrevented||(R(P),C.change(B))},onFocus(){v(!0)},onBlur(I){b(!0),v(!1),y==="onBlur"&&C.commit(I.currentTarget.value)},onKeyDown(I){I.currentTarget.tagName==="INPUT"&&I.key==="Enter"&&(b(!0),C.commit(I.currentTarget.value))}},g,I=>C.getValidationProps(O,I)],stateAttributesMapping:hu})}),Rv=d.forwardRef(function(t,n){return k.jsx(Sv,{ref:n,...t})});function Ev({className:e,type:t,...n}){return k.jsx(Rv,{type:t,"data-slot":"input",className:je("h-8 w-full min-w-0 rounded-2xl border border-transparent bg-input/50 px-2.5 py-1 text-base transition-[color,box-shadow] duration-200 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}const yu=d.createContext(void 0);function Yn(e){const t=d.useContext(yu);if(t===void 0&&!e)throw new Error(We(72));return t}const Cv={...js,disabled:ie(e=>e.disabled),instantType:ie(e=>e.instantType),isInstantPhase:ie(e=>e.isInstantPhase),trackCursorAxis:ie(e=>e.trackCursorAxis),disableHoverablePopup:ie(e=>e.disableHoverablePopup),lastOpenChangeReason:ie(e=>e.openChangeReason),closeOnClick:ie(e=>e.closeOnClick),closeDelay:ie(e=>e.closeDelay),hasViewport:ie(e=>e.hasViewport)};class Zs extends er{constructor(n,o,r=!1){const s=new Un,i={...Tv(),...n};i.floatingRootContext=Pl(s,o,r);super(i,{popupRef:d.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:s},Cv);Ie(this,"setOpen",(n,o)=>{Ix(this,n,o,{extraState:{openChangeReason:o.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,we(rn,n))}static useStore(n,o){return Rl(n,(s,i)=>new Zs(o,s,i)).store}}function Tv(){return{...Ds(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const Mv=Ps(function(t){const{disabled:n=!1,defaultOpen:o=!1,open:r,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:c,onOpenChangeComplete:l,handle:u,triggerId:f,defaultTriggerId:p=null,children:g}=t,h=Zs.useStore(u==null?void 0:u.store,{open:o,openProp:r,activeTriggerId:p,triggerIdProp:f});Tl(h,r,o,p),h.useControlledProp("openProp",r),h.useControlledProp("triggerIdProp",f),h.useContextCallback("onOpenChange",c),h.useContextCallback("onOpenChangeComplete",l);const w=h.useState("open"),m=!n&&w,b=h.useState("activeTriggerId"),x=h.useState("mounted"),S=h.useState("payload");h.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s}),h.useSyncedValue("disabled",n),As(h,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:v,transitionStatus:E}=$s(m,h),y=h.useState("isInstantPhase"),C=h.useState("instantType"),R=h.useState("lastOpenChangeReason"),O=d.useRef(null);Q(()=>{w&&n&&h.setOpen(!1,we(Cb))},[w,n,h]),Q(()=>{E==="ending"&&R===kn||E!=="ending"&&y?(C!=="delay"&&(O.current=C),h.set("instantType","delay")):O.current!==null&&(h.set("instantType",O.current),O.current=null)},[E,y,R,C,h]),Q(()=>{m&&b==null&&h.set("payload",void 0)},[h,b,m]);const P=d.useCallback(()=>{h.setOpen(!1,we(hs))},[h]);d.useImperativeHandle(a,()=>({unmount:v,close:P}),[v,P]);const j=m||x||!n&&i!=="none";return k.jsxs(yu.Provider,{value:h,children:[j&&k.jsx(Pv,{store:h,disabled:n,trackCursorAxis:i}),typeof g=="function"?g({payload:S}):g]})});function Pv({store:e,disabled:t,trackCursorAxis:n}){const o=e.useState("floatingRootContext"),r=Ts(o,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=Ay(o,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=d.useMemo(()=>ut(s.reference,r.reference),[s.reference,r.reference]),a=d.useMemo(()=>ut(s.trigger,r.trigger),[s.trigger,r.trigger]),c=d.useMemo(()=>ut(Os,s.floating,r.floating),[s.floating,r.floating]);return Ns(e,{activeTriggerProps:i,inactiveTriggerProps:a,popupProps:c}),null}const xu=d.createContext(void 0);function Ov(){return d.useContext(xu)}let Iv=(function(e){return e[e.popupOpen=To.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const Av=600,vu="data-base-ui-tooltip-trigger";function fa(e){if("composedPath"in e){const n=e.composedPath();for(let o=0;o<n.length;o+=1){const r=n[o];if(Ee(r))return r}}const t=e.target;return Ee(t)?t:null}function $v(e){let t=e;for(;t;){if(t.hasAttribute(vu))return t;const n=t.parentElement;if(n){t=n;continue}const o=t.getRootNode();t="host"in o&&Ee(o.host)?o.host:null}return null}const Nv=wl(function(t,n){const{render:o,className:r,style:s,handle:i,payload:a,disabled:c,delay:l,closeOnClick:u=!0,closeDelay:f,id:p,...g}=t,h=Yn(!0),w=(i==null?void 0:i.store)??h;if(!w)throw new Error(We(82));const m=gt(p),b=w.useState("isTriggerActive",m),x=w.useState("isOpenedByTrigger",m),S=w.useState("floatingRootContext"),v=d.useRef(null),E=l??Av,y=f??0,{registerTrigger:C,isMountedByThisTrigger:R}=Ml(m,v,w,{payload:a,closeOnClick:u,closeDelay:y}),O=Ov(),{delayRef:P,isInstantPhase:j,hasProvider:L}=Zb(S,{open:x}),$=_s(S);w.useSyncedValue("isInstantPhase",j);const T=w.useState("disabled"),M=c??T,N=Be(M),D=w.useState("trackCursorAxis"),A=w.useState("disableHoverablePopup"),F=d.useRef(!1),I=Xe(),B=d.useRef(void 0);function V(){const H=O==null?void 0:O.delay,te=typeof P.current=="object"?P.current.open:void 0;let Y=E;return L&&(te!==0?Y=l??H??E:Y=0),Y}function re(H){const te=v.current;if(!te||!H)return!1;const Y=$v(H);return Y!==null&&Y!==te&&ue(te,Y)}function se(H){const te=re(H);return F.current=te,te&&($.openChangeTimeout.clear(),$.restTimeout.clear(),$.restTimeoutPending=!1,I.clear()),te}const G=Bs(S,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!A&&D!=="both"?zs():null,restMs:V,delay(){const H=typeof P.current=="object"?P.current.close:void 0;let te=y;return f==null&&L&&(te=H),{close:te}},triggerElementRef:v,isActiveTrigger:b,isClosing:()=>w.select("transitionStatus")==="ending",shouldOpen(){return!F.current}}),W=Il(S,{enabled:!M}).reference,ae=H=>{const te=F.current,Y=fa(H),he=se(Y),xe=v.current,ce=xe&&Y&&ue(xe,Y);if(he&&w.select("open")&&w.select("lastOpenChangeReason")===Ue){w.setOpen(!1,we(Ue,H));return}if(te&&!he&&ce&&!N.current&&!w.select("open")&&xe&&Jt(B.current)){const pe=()=>{!F.current&&!N.current&&!w.select("open")&&w.setOpen(!0,we(Ue,H,xe))},Z=V();Z===0?(I.clear(),pe()):I.start(Z,pe)}},U=w.useState("triggerProps",R);return Le("button",t,{state:{open:x},ref:[n,C,v],props:[G,W,R||D!=="none"?U:void 0,{onMouseOver(H){ae(H.nativeEvent)},onFocus(H){re(fa(H.nativeEvent))&&H.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),B.current=void 0},onPointerEnter(H){B.current=H.pointerType},onPointerDown(H){B.current=H.pointerType,w.set("closeOnClick",u),u&&!w.select("open")&&w.cancelPendingOpen(H.nativeEvent)},onClick(H){u&&!w.select("open")&&w.cancelPendingOpen(H.nativeEvent)},id:m,[Iv.triggerDisabled]:M?"":void 0,[vu]:M?void 0:""},g],stateAttributesMapping:Sc})}),wu=d.createContext(void 0);function Dv(){const e=d.useContext(wu);if(e===void 0)throw new Error(We(70));return e}const Lv=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,style:a,...c}=t,{portalNode:l,portalSubtree:u}=nl({container:r,ref:n,componentProps:t,elementProps:c});return!u&&!l?null:k.jsxs(d.Fragment,{children:[u,l&&pt.createPortal(o,l)]})}),jv=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t;return Yn().useState("mounted")||o?k.jsx(wu.Provider,{value:o,children:k.jsx(Lv,{ref:n,...r})}):null}),ku=d.createContext(void 0);function Su(){const e=d.useContext(ku);if(e===void 0)throw new Error(We(71));return e}const Fv=d.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:a="top",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:g=5,sticky:h=!1,disableAnchorTracking:w=!1,collisionAvoidance:m=Jc,style:b,...x}=t,S=Yn(),v=Dv(),E=S.useState("open"),y=S.useState("mounted"),C=S.useState("trackCursorAxis"),R=S.useState("disableHoverablePopup"),O=S.useState("floatingRootContext"),P=S.useState("instantType"),j=S.useState("transitionStatus"),L=S.useState("hasViewport"),$=Wl({anchor:s,positionMethod:i,floatingRootContext:O,mounted:y,side:a,sideOffset:l,align:c,alignOffset:u,collisionBoundary:f,collisionPadding:p,sticky:h,arrowPadding:g,disableAnchorTracking:w,keepMounted:v,collisionAvoidance:m,adaptiveOrigin:L?Hl:void 0}),T=d.useMemo(()=>({open:E,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:C!=="none"?"tracking-cursor":P}),[E,$.side,$.align,$.anchorHidden,C,P]),M=Ul(t,T,{styles:$.positionerStyles,transitionStatus:j,props:x,refs:[n,S.useStateSetter("positionerElement")],hidden:!y,inert:!E||C==="both"||R});return k.jsx(ku.Provider,{value:$,children:M})}),_v={...wn,...Vo},Bv=d.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,a=Yn(),{side:c,align:l}=Su(),u=a.useState("open"),f=a.useState("instantType"),p=a.useState("transitionStatus"),g=a.useState("popupProps"),h=a.useState("floatingRootContext"),w=a.useState("disabled"),m=a.useState("closeDelay");Yo({open:u,ref:a.context.popupRef,onComplete(){var v,E;u&&((E=(v=a.context).onOpenChangeComplete)==null||E.call(v,!0))}}),$l(h,{enabled:!w,closeDelay:m});const b=a.useStateSetter("popupElement");return Le("div",t,{state:{open:u,side:c,align:l,instant:f,transitionStatus:p},ref:[n,a.context.popupRef,b],props:[g,Vs(p),i],stateAttributesMapping:_v})}),zv=d.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,a=Yn(),{arrowRef:c,side:l,align:u,arrowUncentered:f,arrowStyles:p}=Su(),g=a.useState("open"),h=a.useState("instantType");return Le("div",t,{state:{open:g,side:l,align:u,uncentered:f,instant:h},ref:[n,c],props:[{style:p,"aria-hidden":!0},i],stateAttributesMapping:wn})}),Hv=function(t){const{delay:n,closeDelay:o,timeout:r=400}=t,s=d.useMemo(()=>({delay:n,closeDelay:o}),[n,o]),i=d.useMemo(()=>({open:n,close:o}),[n,o]);return k.jsx(xu.Provider,{value:s,children:k.jsx(Xb,{delay:i,timeoutMs:r,children:t.children})})};function Vv({delay:e=0,...t}){return k.jsx(Hv,{"data-slot":"tooltip-provider",delay:e,...t})}function Wv({...e}){return k.jsx(Mv,{"data-slot":"tooltip",...e})}function Gv({...e}){return k.jsx(Nv,{"data-slot":"tooltip-trigger",...e})}function qv({className:e,side:t="top",sideOffset:n=4,align:o="center",alignOffset:r=0,children:s,...i}){return k.jsx(jv,{children:k.jsx(Fv,{align:o,alignOffset:r,side:t,sideOffset:n,className:"isolate z-50",children:k.jsxs(Bv,{"data-slot":"tooltip-content",className:je("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-xl bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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",e),...i,children:[s,k.jsx(zv,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:translate-x-[1.5px] data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:translate-x-[-1.5px] data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:translate-x-[-1.5px] data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:translate-x-[1.5px] data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Ru={Text:"Type",Blocks:"Blocks",Boxes:"LayoutGrid",Sequence:"Workflow",Steps:"Workflow",Timeline:"GitCommitVertical",Numbers:"Hash",Media:"Image",Table:"Table2",Charts:"ChartColumn",Diagrams:"Workflow",Figures:"Route",Layout:"Columns3"},Uv={text:"AlignLeft",heading:"Heading",bullets:"List",numbered:"ListOrdered",checklist:"ListTodo",quote:"Quote",box:"LayoutGrid",steps:"Workflow",timeline:"GitCommitVertical","stat-row":"ChartNoAxesColumn",image:"Image","image-grid":"Images","image-with-text":"LayoutPanelLeft",people:"Users",youtube:"SquarePlay",separator:"Minus",code:"Code"},qw=(e,t)=>Uv[e]??Ru[t]??"LayoutGrid",Yv=e=>Ru[e]??"LayoutGrid";function Qs(e,t,n){const{Item:o,Sep:r,Group:s,Label:i,Sub:a,SubTrigger:c,SubContent:l}=t,u=[...new Set(e.map(g=>g.group).filter(Boolean))],f=u.length>1&&e.length>6,p=(g,h)=>g.items?k.jsxs(a,{children:[k.jsxs(c,{className:"df-menu-shelf",children:[g.icon&&k.jsx(Ye,{name:g.icon,size:15}),g.label]}),k.jsx(l,{className:"w-auto min-w-44",children:Qs(g.items,t)})]},`${g.label}-${h}`):k.jsxs(d.Fragment,{children:[g.separatorBefore&&k.jsx(r,{}),k.jsxs(o,{onClick:g.onSelect,disabled:g.disabled,variant:g.danger?"destructive":"default",className:"cursor-pointer","data-active":g.active||void 0,children:[g.active?k.jsx("span",{className:"df-menu-tick",children:"✓ "}):"",g.mark?k.jsx("span",{className:"df-menu-mark","aria-hidden":"true",dangerouslySetInnerHTML:{__html:g.mark}}):g.icon&&k.jsx(Ye,{name:g.icon,size:15}),g.label]})]},`${g.label}-${h}`);return f?u.map(g=>k.jsxs(a,{children:[k.jsxs(c,{className:"df-menu-shelf",children:[k.jsx(Ye,{name:Yv(g),size:15}),g]}),k.jsx(l,{className:"w-auto min-w-44",children:k.jsx(s,{children:e.filter(h=>h.group===g).map(p)})})]},g)):k.jsxs(s,{children:[n&&i?k.jsx(i,{children:n}):null,e.map(p)]})}function Fo({trigger:e,items:t,label:n,heading:o,className:r,align:s="start",open:i,onOpenChange:a}){return k.jsxs(H1,{modal:!1,open:i,onOpenChange:a,children:[k.jsx(V1,{render:d.cloneElement(e,{"aria-label":e.props["aria-label"]??n})}),k.jsx(su,{align:s,sideOffset:8,className:r?`w-auto min-w-40 ${r}`:"w-auto min-w-40",children:Qs(t,{Item:q1,Sep:X1,Group:W1,Label:G1,Sub:U1,SubTrigger:Y1,SubContent:K1},o)})]})}function Kv({children:e,items:t,label:n}){return k.jsxs(N1,{children:[k.jsx(D1,{render:d.cloneElement(e,{"aria-label":e.props["aria-label"]??n})}),k.jsx(ru,{className:"w-auto min-w-40",children:Qs(t,{Item:j1,Sep:z1,Group:L1,Sub:F1,SubTrigger:_1,SubContent:B1})})]})}function Eu({open:e,onClose:t,title:n,badge:o,closeLabel:r,className:s,dismissOnOutsidePress:i=!1,children:a}){return k.jsx(cv,{open:e,onOpenChange:c=>{c||t()},modal:!1,disablePointerDismissal:!i,children:k.jsxs(fv,{side:"right",showOverlay:!1,showCloseButton:!1,initialFocus:!1,finalFocus:!1,className:`df-panel ${s??""}`,children:[k.jsxs("header",{className:"df-panel-head",children:[k.jsx(pv,{children:n}),o!==void 0&&k.jsx("span",{className:"df-count",children:o}),k.jsx(lv,{render:k.jsx(st,{variant:"ghost",size:"icon-sm",className:"df-icon-btn","aria-label":r}),children:"›"})]}),a]})})}const Ln=({label:e,aside:t,children:n})=>k.jsxs("section",{className:"df-group",children:[e?k.jsxs("h3",{className:"df-group-head",children:[k.jsx("span",{children:e}),t]}):null,k.jsx("div",{className:"df-group-body",children:n})]}),rt=({label:e,stack:t,children:n})=>k.jsxs("label",{className:t?"df-row df-row-stack":"df-row",children:[k.jsx("span",{className:"df-row-label",children:e}),n]}),qr=({className:e,...t})=>k.jsx(Ev,{className:e?`df-input ${e}`:"df-input",...t}),Uw=({children:e})=>k.jsx(Vv,{delay:400,closeDelay:100,children:e});function Xv({label:e,children:t,side:n="top"}){return k.jsxs(Wv,{children:[k.jsx(Gv,{render:t}),k.jsx(qv,{side:n,children:e})]})}const Zv=Xd,Qv=208;function pa(e,t){let n=0,o=0;for(let r=e;r&&r!==t;r=r.offsetParent)n+=r.offsetLeft,o+=r.offsetTop;return{x:n,y:o}}function Jv(e){const t=e.querySelector(":scope > .page");if(!t)return;const n=Math.min(1,window.innerWidth/t.offsetWidth);document.documentElement.style.setProperty("--fluid-floor",`${window.innerHeight/n}px`)}function e0(e,t,n){const o=pa(e,t);return[...n.querySelectorAll(":scope > .page")].map(r=>{const s=pa(r,t),i=getComputedStyle(r).aspectRatio,a=r.offsetWidth,c=Xr(i,{width:a,height:r.offsetHeight}),[l,u]=i.split("/").map(f=>parseFloat(f));return{ox:s.x-o.x,oy:s.y-o.y,stageX:o.x,stageY:o.y,frameW:a,frameH:c,fixed:!!(l&&u&&Number.isFinite(l)&&Number.isFinite(u)),clipped:r.scrollHeight>r.clientHeight+1}})}function t0(e,t,n,o){const r=e.fixed?Math.min(t/e.frameW,n/e.frameH):Math.min(1,t/e.frameW),s=(t-e.frameW*r)/2-e.ox*r-e.stageX,i=(e.fixed?(n-e.frameH*r)/2:0)-e.oy*r-e.stageY-o;return{k:r,css:`translate(${s}px, ${i}px) scale(${r})`}}const Cu="decaframe-presenter";function Tu(e){const t=window.open(`${location.origin}${location.pathname}?present=1&at=${e}`,Cu,"width=1100,height=700");t==null||t.focus()}function Yw({editor:e,pages:t,start:n,onExit:o,landing:r}){const[s,i]=d.useState(()=>Math.max(0,Math.min(t.length-1,n.at))),[a,c]=d.useState([]),[l,u]=d.useState(!1),[f,p]=d.useState(!1),[g,h]=d.useState(0),w=d.useRef(void 0),m=d.useRef(0),b=()=>document.querySelector(".df-present-stage"),x=()=>document.querySelector(".df-doc[data-presenting]"),S=a[s];d.useLayoutEffect(()=>{var M;const T=()=>{const N=b(),D=x();!N||!D||(Jv(e.view.dom),c(e0(N,D,e.view.dom)))};return T(),window.addEventListener("resize",T),e.on("transaction",T),(M=document.fonts)!=null&&M.ready&&document.fonts.ready.then(T),()=>{window.removeEventListener("resize",T),e.off("transaction",T),document.documentElement.style.removeProperty("--fluid-floor")}},[e]),d.useEffect(()=>{h(0)},[s]),d.useEffect(()=>{r&&(r.current=s)},[s,r]);const v=d.useCallback(()=>{p(T=>T&&!1),clearTimeout(w.current),w.current=setTimeout(()=>p(!0),Zv)},[]),E=d.useCallback(T=>{i(M=>{const N=Math.max(0,Math.min(t.length-1,T));return N===M?M:N}),v()},[t.length,v]),y=d.useMemo(()=>new BroadcastChannel(Cu),[]);d.useEffect(()=>{y.postMessage({at:s})},[s,y]),d.useEffect(()=>(y.onmessage=T=>{const M=T.data;typeof M.go=="number"&&E(M.go)},()=>{y.close()}),[y,E]);const C=d.useRef(o);C.current=o;const R=d.useRef(!1);d.useEffect(()=>{var M,N;n.fullscreen&&!document.fullscreenElement&&((N=(M=document.documentElement).requestFullscreen)==null||N.call(M).catch(()=>{}));const T=()=>{R.current&&!document.fullscreenElement&&C.current(),R.current=!!document.fullscreenElement};return document.addEventListener("fullscreenchange",T),()=>{var D;document.removeEventListener("fullscreenchange",T),document.fullscreenElement&&((D=document.exitFullscreen)==null||D.call(document).catch(()=>{}))}},[n.fullscreen]),d.useEffect(()=>{const T=M=>{if(M.metaKey||M.ctrlKey||M.altKey)return;const N=m.current>0,D=A=>{E(s+A),M.preventDefault()};if(l){M.key==="Escape"&&(u(!1),M.preventDefault());return}if(Zd.includes(M.key))return D(1);if(Qd.includes(M.key))return D(-1);switch(M.key){case"ArrowDown":N&&(h(A=>Math.min(m.current,A+80)),v()),M.preventDefault();return;case"ArrowUp":N&&(h(A=>Math.max(0,A-80)),v()),M.preventDefault();return;case"Home":return D(-s);case"End":return D(t.length-1-s);case"Escape":o(),M.preventDefault();return}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[s,S,l,E,o,t.length,v]);const O={x:260,y:170};d.useEffect(()=>{const T=D=>{D.clientX>window.innerWidth-O.x&&D.clientY>window.innerHeight-O.y&&v()},M=D=>{const A=D.target;A!=null&&A.closest("a, .df-present-hud, .df-present-grid")||String(getSelection())||E(s+1)};v(),window.addEventListener("mousemove",T);const N=setTimeout(()=>window.addEventListener("click",M),0);return()=>{clearTimeout(N),window.removeEventListener("mousemove",T),window.removeEventListener("click",M),clearTimeout(w.current)}},[s,E,v]),d.useEffect(()=>{if(!S||S.fixed)return;const T=M=>{m.current<=0||(h(N=>Math.min(m.current,Math.max(0,N+M.deltaY))),v())};return window.addEventListener("wheel",T,{passive:!0}),()=>window.removeEventListener("wheel",T)},[S,v]);const P=window.innerWidth,j=window.innerHeight,L=S?t0(S,P,j,g):null,$=S&&!S.fixed&&L?Math.max(0,S.frameH*L.k-j):0;return m.current=$,d.useEffect(()=>{h(T=>Math.min(T,$))},[$]),d.useLayoutEffect(()=>{const T=b();return T&&L&&T.style.setProperty("--df-present-t",L.css),()=>{T==null||T.style.removeProperty("--df-present-t")}},[L==null?void 0:L.css]),k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"df-present-hud","data-idle":f&&!l?"true":"false",children:[k.jsx(st,{variant:"ghost",size:"icon-sm",className:"df-present-btn","aria-label":"Previous page",disabled:s===0,onClick:()=>E(s-1),children:k.jsx(Ye,{name:"ChevronLeft",size:16})}),k.jsx("button",{className:"df-present-at","aria-label":`Page ${s+1} of ${t.length}. Choose a page`,"aria-expanded":l,onClick:()=>{u(T=>!T),v()},children:s+1}),k.jsx(st,{variant:"ghost",size:"icon-sm",className:"df-present-btn","aria-label":"Next page",disabled:s===t.length-1,onClick:()=>E(s+1),children:k.jsx(Ye,{name:"ChevronRight",size:16})}),k.jsx(Fo,{label:"Presenting options",align:"end",trigger:k.jsx(st,{variant:"ghost",size:"icon-sm",className:"df-present-btn","aria-label":"More",children:k.jsx(Ye,{name:"MoreVertical",size:16})}),items:[{label:"Start from beginning",onSelect:()=>E(0)},{label:"Exit presenting",separatorBefore:!0,onSelect:o}]})]}),l&&k.jsx("div",{className:"df-present-grid",role:"dialog","aria-label":"Pages","aria-modal":"true",children:k.jsx("div",{className:"df-present-grid-inner",children:t.map((T,M)=>{var N;return k.jsxs("button",{className:"df-present-tile","aria-current":M===s?"true":void 0,onClick:()=>{E(M),u(!1)},children:[k.jsx(vc,{editor:e,pageId:T.id,width:Qv}),k.jsxs("span",{className:"df-present-tile-foot",children:[k.jsx("span",{className:"df-present-tile-n",children:M+1}),k.jsx("span",{className:"df-present-tile-title",children:T.title||"Untitled"})]}),((N=a[M])==null?void 0:N.clipped)&&k.jsx("span",{className:"df-present-tile-warn",children:"Too long — will be cut"})]},T.id)})})})]})}function Kw({editor:e,active:t,at:n,onPresent:o}){d.useEffect(()=>{if(!t)return;const r=s=>{var a;if(s.key!=="Enter"||s.isComposing||!(s.metaKey||s.ctrlKey)||s.altKey)return;const i=s.target;if(!((a=i==null?void 0:i.closest)!=null&&a.call(i,"input, textarea, .cm-editor"))&&!e.can().exitCode()){if(s.preventDefault(),s.stopPropagation(),s.shiftKey){o({at:n,fullscreen:!1}),Tu(n);return}o({at:n,fullscreen:!0})}};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[e,t,n,o])}const n0=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl+",Mu=d.createContext(void 0);function o0(){const e=d.useContext(Mu);if(e===void 0)throw new Error(We(63));return e}let ha=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Pu={...hu,checked(e){return e?{[ha.checked]:""}:{[ha.unchecked]:""}}},r0=d.forwardRef(function(t,n){const{checked:o,className:r,defaultChecked:s,"aria-labelledby":i,form:a,id:c,inputRef:l,name:u,nativeButton:f=!1,onCheckedChange:p,readOnly:g=!1,required:h=!1,disabled:w=!1,render:m,uncheckedValue:b,value:x,style:S,...v}=t,{clearErrors:E}=gu(),{state:y,setTouched:C,setDirty:R,validityData:O,setFilled:P,setFocused:j,validationMode:L,disabled:$,name:T,validation:M}=Ks(),{labelId:N}=Xs(),D=$||w,A=T??u,F=d.useRef(null),I=Ft(F,l,M.inputRef),B=d.useRef(null),V=gt(),re=mu({id:c,implicit:!1,controlRef:B}),se=f?void 0:re,[G,W]=Go({controlled:o,default:!!s,name:"Switch",state:"checked"});bu(B,V,G,void 0,!D,u),Q(()=>{F.current&&P(F.current.checked)},[F,P]),Zl(G,()=>{E(A),R(G!==O.initialValue),P(G),M.change(G)});const{getButtonProps:ae,buttonRef:U}=vn({disabled:D,native:f}),ee=vv(i,N,F,!f,se),ye={id:f?re:V,role:"switch","aria-checked":G,"aria-readonly":g||void 0,"aria-required":h||void 0,"aria-labelledby":ee,onFocus(){D||j(!0)},onBlur(){const Y=F.current;!Y||D||(C(!0),j(!1),L==="onBlur"&&M.commit(Y.checked))},onClick(Y){if(g||D)return;Y.preventDefault();const he=F.current;he&&he.dispatchEvent(new(Fe(he)).PointerEvent("click",{bubbles:!0,shiftKey:Y.shiftKey,ctrlKey:Y.ctrlKey,altKey:Y.altKey,metaKey:Y.metaKey}))}},ke=ut({checked:G,disabled:D,form:a,id:se,name:A,required:h,style:A?Jb:_c,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:I,onChange(Y){if(Y.nativeEvent.defaultPrevented)return;if(g){Y.preventDefault();return}const he=Y.currentTarget.checked,xe=we(kn,Y.nativeEvent);p==null||p(he,xe),!xe.isCanceled&&W(he)},onFocus(){var Y;(Y=B.current)==null||Y.focus()}},Y=>M.getValidationProps(D,Y),x!==void 0?{value:x}:De),H=d.useMemo(()=>({...y,checked:G,disabled:D,readOnly:g,required:h}),[y,G,D,g,h]),te=Le("span",t,{state:H,ref:[n,B,U],props:[ye,v,ae,Y=>M.getValidationProps(D,Y)],stateAttributesMapping:Pu});return k.jsxs(Mu.Provider,{value:H,children:[te,!G&&A&&b!==void 0&&k.jsx("input",{type:"hidden",form:a,name:A,value:b,disabled:D}),k.jsx("input",{...ke,suppressHydrationWarning:!0})]})}),s0=d.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,a=o0();return Le("span",t,{state:a,ref:n,stateAttributesMapping:Pu,props:i})});function Ur({className:e,size:t="default",...n}){return k.jsx(r0,{"data-slot":"switch","data-size":t,className:je("peer group/switch relative inline-flex shrink-0 items-center rounded-2xl border-2 transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-5 data-[size=default]:w-8 data-[size=sm]:h-4 data-[size=sm]:w-6 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-unchecked:border-transparent data-unchecked:bg-input/90 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:k.jsx(s0,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-2xl bg-background shadow-sm ring-0 transition-transform not-dark:bg-clip-padding group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-checked:translate-x-[calc(100%-4px)] dark:data-checked:bg-primary-foreground data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}const Ou=d.createContext(void 0);function i0(e=!0){const t=d.useContext(Ou);if(t===void 0&&!e)throw new Error(We(7));return t}const a0=d.forwardRef(function(t,n){const{className:o,defaultPressed:r=!1,disabled:s=!1,form:i,onPressedChange:a,pressed:c,render:l,type:u,value:f,nativeButton:p=!0,style:g,...h}=t,w=gt(f||void 0),m=i0(),b=(m==null?void 0:m.value)??[],x=m?void 0:r,S=(s||(m==null?void 0:m.disabled))??!1,[v,E]=Go({controlled:m?w!==void 0&&b.indexOf(w)>-1:c,default:x,name:"Toggle",state:"pressed"}),{getButtonProps:y,buttonRef:C}=vn({disabled:S,native:p}),R={disabled:S,pressed:v},O=[C,n],P=[{"aria-pressed":v,onClick($){var N;const T=!v,M=we(kn,$.nativeEvent);a==null||a(T,M),!M.isCanceled&&(w&&((N=m==null?void 0:m.setGroupValue)==null||N.call(m,w,T,M)),!M.isCanceled&&E(T))}},h,y],j=Le("button",t,{enabled:!m,state:R,ref:O,props:P}),L=d.useMemo(()=>({disabled:S,focusableWhenDisabled:!1}),[S]);return m?k.jsx(tu,{tag:"button",render:l,className:o,style:g,metadata:L,state:R,refs:O,props:P}):j}),c0="data-composite-item-active",l0=[];function u0(e){const{loopFocus:t=!0,orientation:n="both",grid:o,onLoop:r,direction:s,highlightedIndex:i,onHighlightedIndexChange:a,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u=!1,disabledIndices:f,modifierKeys:p=l0}=e,[g,h]=d.useState(0),w=o!=null,m=d.useRef(null),b=Ft(m,c),x=d.useRef([]),S=d.useRef(!1),v=i??g,E=de((P,j=!1)=>{if((a??h)(P),j){const L=x.current[P];oa(m.current,L,s,n)}}),y=de(P=>{if(P.size===0||S.current)return;S.current=!0;const j=Array.from(P.keys()),L=j.find(T=>T==null?void 0:T.hasAttribute(c0))??null,$=L?j.indexOf(L):-1;if($!==-1)E($);else if(Ao(j,v,f)){const T=Ct(j,{disabledIndices:f});An(j,T)||E(T)}oa(m.current,L,s,n)});Q(()=>{if(f==null||i!=null||!S.current)return;const P=x.current;if(Ao(P,v,f)){const j=Ct(P,{disabledIndices:f});An(P,j)||E(j)}},[f,i,v,x,E]);const C=de((P,j,L)=>r?r(P,j,L,x):L),R=de(P=>{const j=l?Hs:jl;if(!j.has(P.key)||d0(P,p)||!m.current)return;const $=s==="rtl",T=$?Lo:jo,M={horizontal:T,vertical:Dn,both:T}[n],N=$?jo:Lo,D={horizontal:N,vertical:Nn,both:N}[n],A=Ve(P.nativeEvent);if(A!=null&&na(A)&&!I1(A)){const G=A.selectionStart,W=A.selectionEnd,ae=A.value??"";if(G==null||P.shiftKey||G!==W||P.key!==D&&G<ae.length||P.key!==M&&G>0)return}let F=v;const I=go(x,f),B=Br(x,f);o!=null&&(F=o({disabledIndices:f,elementsRef:x,event:P,highlightedIndex:v,loopFocus:t,maxIndex:B,minIndex:I,onLoop:C,orientation:n,rtl:$}));const V={horizontal:[T],vertical:[Dn],both:[T,Dn]}[n],re={horizontal:[N],vertical:[Nn],both:[N,Nn]}[n],se=w?j:{horizontal:l?qx:Dl,vertical:l?Ux:Ll,both:j}[n];l&&(P.key===or?F=I:P.key===rr&&(F=B)),F===v&&(V.includes(P.key)||re.includes(P.key))&&(t&&F===B&&V.includes(P.key)?(F=I,r&&(F=r(P,v,F,x))):t&&F===I&&re.includes(P.key)?(F=B,r&&(F=r(P,v,F,x))):F=Ct(x.current,{startingIndex:F,decrement:re.includes(P.key),disabledIndices:f})),F!==v&&!An(x.current,F)&&(u&&P.stopPropagation(),se.has(P.key)&&P.preventDefault(),E(F,!0),queueMicrotask(()=>{var G;(G=x.current[F])==null||G.focus()}))});return{props:{ref:b,onFocus(P){const j=m.current,L=Ve(P.nativeEvent);!j||L==null||!na(L)||L.setSelectionRange(0,L.value.length??0)},onKeyDown:R},highlightedIndex:v,onHighlightedIndexChange:E,elementsRef:x,disabledIndices:f,onMapChange:y,relayKeyboardEvent:R}}function d0(e,t){for(const n of Qx.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function f0(e){const{render:t,className:n,style:o,refs:r=Qt,props:s=Qt,state:i=De,stateAttributesMapping:a,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:f,loopFocus:p,onLoop:g,enableHomeAndEndKeys:h,onMapChange:w,stopEventPropagation:m=!0,rootRef:b,disabledIndices:x,modifierKeys:S,highlightItemOnHover:v=!1,tag:E="div",...y}=e,C=Ws(),{props:R,highlightedIndex:O,onHighlightedIndexChange:P,elementsRef:j,onMapChange:L,relayKeyboardEvent:$}=u0({grid:f,loopFocus:p,onLoop:g,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:b,stopEventPropagation:m,enableHomeAndEndKeys:h,direction:C,disabledIndices:x,modifierKeys:S}),T=Le(E,e,{state:i,ref:r,props:[R,...s,y],stateAttributesMapping:a}),M=d.useMemo(()=>({highlightedIndex:O,onHighlightedIndexChange:P,highlightItemOnHover:v,relayKeyboardEvent:$}),[O,P,v,$]);return k.jsx(Qa.Provider,{value:M,children:k.jsx(Gl,{elementsRef:j,onMapChange:N=>{w==null||w(N),L(N)},children:T})})}const p0=d.createContext(void 0);function h0(e){return d.useContext(p0)}let g0=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const ga={multiple(e){return e?{[g0.multiple]:""}:null}},m0=d.forwardRef(function(t,n){const{defaultValue:o,disabled:r=!1,loopFocus:s=!0,onValueChange:i,orientation:a="horizontal",multiple:c=!1,value:l,className:u,render:f,style:p,...g}=t,h=Nl(),w=h0(),m=d.useMemo(()=>l!==void 0||o!==void 0,[l,o]),b=((h==null?void 0:h.disabled)??!1)||((w==null?void 0:w.disabled)??!1)||r,[x,S]=Go({controlled:l,default:l===void 0?o??Qt:void 0,name:"ToggleGroup",state:"value"}),v=de((O,P,j)=>{let L;c?(L=x.slice(),P?L.push(O):L.splice(x.indexOf(O),1)):L=P?[O]:[],i==null||i(L,j),!j.isCanceled&&S(L)}),E={disabled:b,multiple:c,orientation:a},y=d.useMemo(()=>({disabled:b,orientation:a,setGroupValue:v,value:x,isValueInitialized:m}),[b,a,v,x,m]),C={role:"group"},R=Le("div",t,{enabled:!!h,state:E,ref:n,props:[C,g],stateAttributesMapping:ga});return k.jsx(Ou.Provider,{value:y,children:h?R:k.jsx(f0,{render:f,className:u,style:p,state:E,refs:[n],props:[C,g],stateAttributesMapping:ga,loopFocus:s,enableHomeAndEndKeys:!0,orientation:a})})}),b0=oc("group/toggle inline-flex items-center justify-center gap-1 rounded-2xl text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),Iu=d.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function y0({className:e,variant:t,size:n,spacing:o=2,orientation:r="horizontal",children:s,...i}){return k.jsx(m0,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":o,"data-orientation":r,style:{"--gap":o},className:je("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[spacing=0]:data-[variant=outline]:rounded-2xl data-vertical:flex-col data-vertical:items-stretch",e),...i,children:k.jsx(Iu.Provider,{value:{variant:t,size:n,spacing:o,orientation:r},children:s})})}function x0({className:e,children:t,variant:n="default",size:o="default",...r}){const s=d.useContext(Iu);return k.jsx(a0,{"data-slot":"toggle-group-item","data-variant":s.variant||n,"data-size":s.size||o,"data-spacing":s.spacing,className:je("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-2xl group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-2xl group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-2xl group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-2xl data-[state=on]:bg-muted group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",b0({variant:s.variant||n,size:s.size||o}),e),...r,children:t})}function v0({...e}){return k.jsx(fu,{"data-slot":"dialog",...e})}function w0({...e}){return k.jsx(du,{"data-slot":"dialog-portal",...e})}function k0({className:e,...t}){return k.jsx(cu,{"data-slot":"dialog-overlay",className:je("fixed inset-0 isolate z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function S0({className:e,children:t,showCloseButton:n=!0,...o}){return k.jsxs(w0,{children:[k.jsx(k0,{}),k.jsxs(uu,{"data-slot":"dialog-content",className:je("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-[min(var(--radius-4xl),24px)] bg-popover p-6 text-sm text-popover-foreground shadow-xl ring-1 ring-foreground/5 duration-100 outline-none sm:max-w-md dark:ring-foreground/10 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",e),...o,children:[t,n&&k.jsxs(sr,{"data-slot":"dialog-close",render:k.jsx(st,{variant:"ghost",className:"absolute top-4 right-4 bg-secondary",size:"icon-sm"}),children:[k.jsx(xc,{}),k.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function R0({className:e,...t}){return k.jsx("div",{"data-slot":"dialog-header",className:je("flex flex-col gap-1.5",e),...t})}function E0({className:e,showCloseButton:t=!1,children:n,...o}){return k.jsxs("div",{"data-slot":"dialog-footer",className:je("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...o,children:[n,t&&k.jsx(sr,{render:k.jsx(st,{variant:"outline"}),children:"Close"})]})}function C0({className:e,...t}){return k.jsx(pu,{"data-slot":"dialog-title",className:je("font-heading text-base leading-none font-medium",e),...t})}function T0({className:e,...t}){return k.jsx(Q1,{"data-slot":"dialog-description",className:je("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const un=14;function M0(e,t,n,o=1){const r=(i,a)=>{const c=e.offsetWidth*o,l=e.offsetHeight*o,u=i+c+un*2>window.innerWidth?-(c+un):un,f=a+l+un*2>window.innerHeight?-(l+un):un;e.style.transform=`translate3d(${Math.round(i+u)}px, ${Math.round(a+f)}px, 0) rotate(-1deg) scale(${o})`};r(t,n);const s=i=>r(i.clientX,i.clientY);return window.addEventListener("pointermove",s),()=>window.removeEventListener("pointermove",s)}function P0(e){var t;const{char:n,allowSpaces:o,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,$position:a}=e,c=o&&!r,l=dd(n),u=new RegExp(`\\s${l}$`),f=i?"^":"",p=r?"":l,g=c?new RegExp(`${f}${l}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${f}(?:^)?${l}[^\\s${p}]*`,"gm"),h=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!h)return null;const w=a.pos-h.length,m=Array.from(h.matchAll(g)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const b=m.input.slice(Math.max(0,m.index-1),m.index),x=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(b);if(s!==null&&!x)return null;const S=w+m.index;let v=S+m[0].length;return c&&u.test(h.slice(v-1,v+1))&&(m[0]+=" ",v+=1),S<a.pos&&v>=a.pos?{range:{from:S,to:v},query:m[0].slice(n.length),text:m[0]}:null}function O0(e){return e.docChanged?e.steps.some(t=>{const n=t.slice;if(!(n!=null&&n.content))return!1;const o=n.content.textBetween(0,n.content.size,`
413
+ `);return/\s/.test(o)}):!1}function I0(e){return()=>{const t=e.state.selection.$anchor.pos,{top:n,right:o,bottom:r,left:s}=e.view.coordsAtPos(t);try{return new DOMRect(s,n,o-s,r-n)}catch{return null}}}function A0(e,t,n,o){return n?()=>{const r=o.getState(e.state),s=r==null?void 0:r.decorationId,i=t.dom.querySelector(`[data-decoration-id="${s}"]`);return(i==null?void 0:i.getBoundingClientRect())||null}:I0(e)}function $0({match:e,dismissedRange:t,state:n,transaction:o,editor:r,shouldResetDismissed:s,effectiveAllowSpaces:i}){return s!=null&&s({editor:r,state:n,range:t,match:e,transaction:o,allowSpaces:i})?!1:i?e.range.from===t.from:e.range.from===t.from&&!O0(o)}function N0({view:e,pluginKeyRef:t}){const n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function D0({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:o,decorationEmptyClass:r,renderer:s,dispatchExit:i}){return{handleKeyDown(a,c){var l;const u=e.getState(a.state);if(!u.active)return!1;if(c.key==="Escape"||c.key==="Esc"){var f;return s==null||(f=s.onKeyDown)===null||f===void 0||f.call(s,{view:a,event:c,range:u.range}),i(a),!0}return(s==null||(l=s.onKeyDown)===null||l===void 0?void 0:l.call(s,{view:a,event:c,range:u.range}))||!1},decorations(a){const{active:c,range:l,decorationId:u,query:f}=e.getState(a);if(!c)return null;const p=!(f!=null&&f.length),g=[n];return p&&g.push(r),ld.create(a.doc,[ud.inline(l.from,l.to,{nodeName:t,class:g.join(" "),"data-decoration-id":u||void 0,"data-decoration-content":o})])}}}function L0({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,findSuggestionMatch:i,allow:a,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(f,p,g,h){const{isEditable:w}=e,{composing:m}=e.view,{selection:b}=f,{empty:x,from:S}=b,v={...p},E=f.getMeta(u);if(E&&E.exit)return v.active=!1,v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null,v.dismissedRange=p.active?{...p.range}:p.dismissedRange,v;if(v.composing=m,f.docChanged&&v.dismissedRange!==null&&(v.dismissedRange={from:f.mapping.map(v.dismissedRange.from),to:f.mapping.map(v.dismissedRange.to)}),w&&(x||e.view.composing)){(S<p.range.from||S>p.range.to)&&!m&&!p.composing&&(v.active=!1);const y=i({char:t,allowSpaces:n,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,$position:b.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;y&&a({editor:e,state:h,range:y.range,isActive:p.active})&&(!c||c({editor:e,range:y.range,query:y.query,text:y.text,transaction:f}))?(v.dismissedRange!==null&&!l({match:y,dismissedRange:v.dismissedRange,state:h,transaction:f})&&(v.dismissedRange=null),v.dismissedRange===null?(v.active=!0,v.decorationId=p.decorationId||C,v.range=y.range,v.query=y.query,v.text=y.text):v.active=!1):(y||(v.dismissedRange=null),v.active=!1)}else v.active=!1;return v.active||(v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null),v}}}function j0({editor:e,items:t}){let n=null,o=null,r=null;const s=()=>{o!==null&&(clearTimeout(o),o=null),r==null||r(),r=null},i=l=>new Promise(u=>{r=u,o=setTimeout(()=>{o=null;const f=r;r=null,f==null||f()},l)}),a=()=>{n==null||n.abort(),s(),n=null};return{abort:a,fetch:async(l,u)=>{a(),n=new AbortController;const f=n;if(u>0&&await i(u),n!==f||f.signal.aborted)return{status:"aborted"};try{const p=await t({editor:e,query:l,signal:f.signal});return n!==f||f.signal.aborted?{status:"aborted"}:{status:"resolved",items:p}}catch{return n!==f||f.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function F0({placement:e,offset:t,flip:n,floatingUi:o}){var r,s,i,a;const c=[ml({mainAxis:(r=t.mainAxis)!==null&&r!==void 0?r:4,crossAxis:(s=t.crossAxis)!==null&&s!==void 0?s:0})];return n&&c.push(bl()),!(o==null||(i=o.middleware)===null||i===void 0)&&i.length&&c.push(...o.middleware),{placement:e,strategy:(a=o==null?void 0:o.strategy)!==null&&a!==void 0?a:"absolute",middleware:c}}function _0(e){if(e instanceof HTMLElement)return e;if(typeof e=="string")try{const t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function B0({getReferenceRect:e,contextElement:t,config:n,container:o,dismissOnOutsideClick:r,dismiss:s}){return(i,a={})=>{const c={getBoundingClientRect:()=>{var h;return(h=e())!==null&&h!==void 0?h:new DOMRect},contextElement:t};let l=!1;const u=!i.isConnected;u&&_0(o).appendChild(i),a.onPosition||(i.style.visibility="hidden",i.style.width="max-content");const p=Vr(c,i,()=>{yl(c,i,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:h,y:w,placement:m,strategy:b})=>{if(a.onPosition){a.onPosition({x:h,y:w,placement:m,strategy:b});return}Object.assign(i.style,{position:b,left:`${h}px`,top:`${w}px`}),l||(l=!0,i.style.visibility="")})},a.autoUpdate);let g;return r&&(g=h=>{const w=h.target;!(w instanceof Node)||i.contains(w)||t.contains(w)||s()},document.addEventListener("pointerdown",g,!0)),()=>{p(),g&&document.removeEventListener("pointerdown",g,!0),u&&i.remove()}}}function z0({editor:e,pluginKey:t,items:n,renderer:o,minQueryLength:r,debounce:s,initialItems:i,placement:a,offset:c,container:l,flip:u,floatingUi:f,dismissOnOutsideClick:p,command:g,clientRectFor:h,dispatchExit:w}){let m;const b=j0({editor:e,items:n}),x=F0({placement:a,offset:c,flip:u,floatingUi:f});function S(v,E){switch(v){case"started":var y;o==null||(y=o.onStart)===null||y===void 0||y.call(o,E);break;case"updated":var C;o==null||(C=o.onUpdate)===null||C===void 0||C.call(o,E);break;case"stopped":var R;o==null||(R=o.onExit)===null||R===void 0||R.call(o,E)}}return{update:async(v,E)=>{var y,C;const R=t.getState(E),O=t.getState(v.state);if(!R||!O)return;let P=null;const j=R.query!==O.query,L=R.text!==O.text,$=R.range.from!==O.range.from||R.range.to!==O.range.to,T=j||L||$;if(!R.active&&O.active)P="started";else if(R.active&&!O.active)P="stopped";else if(O.active&&T)P="updated";else return;const M=P==="stopped"?R:O,N=v.dom.querySelector(`[data-decoration-id="${M.decorationId}"]`),D=h(v,N),A=r===0||(M.query?M.query.length>=r:!1),F=(P==="started"||P==="updated")&&A;if(m={editor:e,range:M.range,query:M.query||"",text:M.text||"",items:i??[],command:V=>g({editor:e,range:M.range,props:V}),decorationNode:N,clientRect:D,loading:F,placement:a,offset:{mainAxis:(y=c.mainAxis)!==null&&y!==void 0?y:4,crossAxis:(C=c.crossAxis)!==null&&C!==void 0?C:0},container:l,flip:u,floatingUi:x,mount:B0({getReferenceRect:D,contextElement:v.dom,config:x,container:l,dismissOnOutsideClick:p,dismiss:()=>w(e.view)})},P==="started"){var I;o==null||(I=o.onBeforeStart)===null||I===void 0||I.call(o,m)}if(P==="updated"){var B;o==null||(B=o.onBeforeUpdate)===null||B===void 0||B.call(o,m)}if(P==="started"&&S(P,m),P==="started"||P==="updated")if(!F)b.abort(),m={...m,items:i??[],loading:!1};else{m={...m,items:i??[],loading:!0},P="updated",S(P,m);const V=await b.fetch(M.query||"",s);if(V.status==="aborted")return;const re=t.getState(v.state);if(!(re!=null&&re.active)){b.abort();return}m=V.status==="resolved"?{...m,items:V.items,loading:!1}:{...m,loading:!1}}if(P==="stopped"){b.abort(),S(P,m),m=void 0;return}P==="updated"&&S(P,m)},destroy:()=>{var v;b.abort(),m&&(o==null||(v=o.onExit)===null||v===void 0||v.call(o,m))}}}const H0=new cd("suggestion");function V0({pluginKey:e=H0,editor:t,char:n="@",allowSpaces:o=!1,allowToIncludeChar:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:a="span",decorationClass:c="suggestion",decorationContent:l="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:p=()=>[],minQueryLength:g=0,debounce:h=0,initialItems:w,placement:m="bottom-start",offset:b={},container:x,flip:S=!0,floatingUi:v,dismissOnOutsideClick:E=!0,render:y=()=>({}),allow:C=()=>!0,findSuggestionMatch:R=P0,shouldShow:O,shouldResetDismissed:P}){const j=y==null?void 0:y(),L=o&&!r,$=(N,D)=>A0(t,N,D,e);function T(N){return $0({...N,editor:t,shouldResetDismissed:P,effectiveAllowSpaces:L})}const M=N=>N0({view:N,pluginKeyRef:e});return new ad({key:e,view:()=>z0({editor:t,pluginKey:e,items:p,renderer:j,minQueryLength:g,debounce:h,initialItems:w,placement:m,offset:b,container:x,flip:S,floatingUi:v,dismissOnOutsideClick:E,command:f,clientRectFor:$,dispatchExit:M}),state:L0({editor:t,char:n,effectiveAllowSpaces:L,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,findSuggestionMatch:R,allow:C,shouldShow:O,shouldKeepDismissed:T,pluginKey:e}),props:D0({pluginKey:e,decorationTag:a,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:j,dispatchExit:M})})}var W0=V0;function tt(e,t){var i;const n=Pe(e.state.doc,t);if(!n||((i=Qe(n.node.type.name))==null?void 0:i.archetype)==="table")return null;const o=Object.entries(fd(n.node))[0];if(!o)return null;const[r,s]=o;return{key:r,entries:s??[]}}const wt=(e,t,n,o)=>e.commands.updateBlock(t,{[n]:o});function Xw(e,t,n,o){return e.commands.moveBlockTo(n,t,o)}function Zw(e,t,n,o){const r=tt(e,t);if(!r)return!1;const s=r.entries.map(c=>c.id).filter(Boolean),i=Ea(s,n,o);if(i.every((c,l)=>c===s[l]))return!1;const a=new Map(r.entries.map(c=>[c.id,c]));return wt(e,t,r.key,i.map(c=>a.get(c)))}const Qw=(e,t)=>{var n;return!!((n=Pe(e.state.doc,t))!=null&&n.node.attrs.emphasis)};function Jw(e,t,n,o){const r=tt(e,t);return!r||r.key!=="items"?!1:wt(e,t,r.key,r.entries.map(s=>s.id===n?{...s,emphasis:o}:s))}const ek=(e,t)=>{const n=Pe(e.state.doc,t),o=n&&Qe(n.node.type.name);if(!o)return[];const r=Rd(o.variantSlots,Qr(e.state.doc.attrs.theme).theme);return r.length>1?r:[]},Au=(e,t)=>{var n;return((n=Pe(e.state.doc,t))==null?void 0:n.node.attrs[Ed])||Aa},G0=(e,t,n)=>e.commands.setVariant(t,n===Aa?null:n),ma={"on-fill:bg":"Reversed","on-fill:fg":"Default",bg:"Page","bg-subtle":"Subtle","bg-muted":"Muted",accent:"Accent",fg:"Default","fg-muted":"Muted",rule:"Rule","rule-strong":"Strong","border-sm":"Hairline","border-md":"Medium","border-lg":"Thick","corner-sm":"Small","corner-md":"Medium","corner-lg":"Large","shadow-box":"Lifted"},tk=(e,t)=>ma[`${e}:${t}`]??ma[t]??t,q0=(e,t)=>{const n=Pe(e.state.doc,t),o=n&&Qe(n.node.type.name);return o?pd.filter(r=>o.variantSlots.includes(r)):[]},nk=(e,t)=>q0(e,t).length>0||!!J0(e,t)||U0(e,t),U0=(e,t)=>Du(e,t).length>1||Js(e,t).length>1||K0(e,t).length>1||X0(e,t),$u=(e,t)=>{var n;return((n=Pe(e.state.doc,t))==null?void 0:n.node.attrs[Od])??{}},ok=(e,t,n)=>{var s,i;const o=$u(e,t)[n];if(o)return o===$a?null:o;const r=Qr(e.state.doc.attrs.theme).theme;return((i=(s=r==null?void 0:r.variants)==null?void 0:s[Au(e,t)])==null?void 0:i[n])??null};function rk(e,t,n,o){var c,l,u;const r={...$u(e,t)},s=Qr(e.state.doc.attrs.theme).theme,i=((l=(c=s==null?void 0:s.variants)==null?void 0:c[Au(e,t)])==null?void 0:l[n])??null;o===null||o===i||o===$a&&i===null?delete r[n]:r[n]=o;const a=Qe(((u=Pe(e.state.doc,t))==null?void 0:u.node.type.name)??"");return!a||Cd(r,a.variantSlots)?!1:e.commands.setDesign(t,r)}const sk=(e,t,n)=>G0(e,t,n)&&e.commands.setDesign(t,null),Nu=(e,t)=>{const n=Pe(e.state.doc,t),o=n&&Qe(n.node.type.name);return(o==null?void 0:o.arrangements)??[]},Du=(e,t)=>{const n=Pe(e.state.doc,t),o=n&&Qe(n.node.type.name);if(!o||!n)return[];const r=n.node.childCount;return[...o.arrangements.map(s=>({name:s.name,label:s.label,isFigure:!1,disabled:null})),...(o.figures??[]).map(s=>({name:s.name,label:s.label,isFigure:!0,disabled:Pa({attrs:{figure:s.name}},r)}))]},ik=(e,t)=>{var o;return((o=Pe(e.state.doc,t))==null?void 0:o.node.attrs[wd])||Lu(e,t)},ak=(e,t,n)=>{const o=Du(e,t).find(r=>r.name===n);return!o||o.disabled?!1:o.isFigure?e.commands.setFigure(t,n):Y0(e,t,n)},Lu=(e,t)=>{var o,r;return((o=Pe(e.state.doc,t))==null?void 0:o.node.attrs[Ia])||(((r=Nu(e,t)[0])==null?void 0:r.name)??"")},Y0=(e,t,n)=>{var o;return e.commands.setArrangement(t,n===(((o=Nu(e,t)[0])==null?void 0:o.name)??"")?null:n)},ck=(e,t,n)=>e.commands.updateBlock(t,{chart:n}),lk=(e,t,n)=>e.commands.updateBlock(t,{diagram:{source:n}}),K0=(e,t)=>{var r;const n=(r=Pe(e.state.doc,t))==null?void 0:r.node;if(!n||!(Oa in(n.type.spec.attrs??{})))return[];const o=n.attrs[Ia]??bd[0];return yd.includes(o)?Zr:[]},uk=(e,t)=>{var o;return((o=Pe(e.state.doc,t))==null?void 0:o.node.attrs[Oa])||Zr[0]},dk=(e,t,n)=>e.commands.setStack(t,n===Zr[0]?null:n),X0=(e,t)=>{const n=Pe(e.state.doc,t),o=n&&Qe(n.node.type.name);return!!(o!=null&&o.slots.includes("icon")&&!o.marks.includes("icon"))},Js=(e,t)=>{var o;const n=Pe(e.state.doc,t);return(n&&((o=Qe(n.node.type.name))==null?void 0:o.marks))??[]},fk=(e,t)=>{var o;return((o=Pe(e.state.doc,t))==null?void 0:o.node.attrs[Sd])||(Js(e,t)[0]??"")},pk=(e,t,n)=>e.commands.setBlockMark(t,n===(Js(e,t)[0]??"")?null:n),Z0="eyebrow",Q0=(e,t)=>{const n=Pe(e.state.doc,t),o=n&&Qe(n.node.type.name);if(!o||o.archetype!=="items"||!o.slots.includes("meta"))return null;const r=tt(e,t);return r?r.entries.every(s=>typeof s.meta=="string"):null},hk=(e,t,n)=>{if(Q0(e,t)===null)return!1;const o=tt(e,t);return wt(e,t,o.key,o.entries.map(r=>{const{meta:s,...i}=r;return n?{...i,meta:typeof s=="string"?s:""}:i}))},gk=(e,t)=>{var n;return((n=Pe(e.state.doc,t))==null?void 0:n.node.attrs[kd])||ju(e,t)},ju=(e,t)=>Lu(e,t)==="list"?"lead":"top",mk=(e,t,n)=>e.commands.setIconPosition(t,n===ju(e,t)?null:n),bk=(e,t)=>{const n=Pe(e.state.doc,t);return!!n&&Ta(n.node.type.spec)&&!Td(n.node)},J0=(e,t)=>{const n=Pe(e.state.doc,t);return!!n&&Ta(n.node.type.spec)},yk=(e,t)=>{var o;return((o=Pe(e.state.doc,t))==null?void 0:o.node.attrs[xd])||vd[0]},xk=(e,t)=>{var o;return((o=Pe(e.state.doc,t))==null?void 0:o.node.attrs[Md])??Pd},vk=(e,t,n,o)=>e.commands.setBlockSize(t,n,o),wk=(e,t,n)=>$d(e,n===null?null:{id:t,share:n});function kk(e,t,n,o){const r=tt(e,t);return!r||r.key!=="items"?!1:wt(e,t,r.key,r.entries.map(s=>s.id===n?{...s,icon:o}:s))}function Sk(e,t,n,o,r){const s=tt(e,t);return!s||s.key!=="media"?!1:wt(e,t,s.key,s.entries.map(i=>i.id===n?{...i,src:o}:i))}function Rk(e,t,n,o){const r=tt(e,t);if(!r||r.key!=="media")return!1;const s=o===null?{focusX:null,focusY:null,zoom:null}:o;return wt(e,t,r.key,r.entries.map(i=>i.id===n?{...i,...s}:i))}function ew(e,t,n){const o=Pe(e.state.doc,t),r=o&&Qe(o.node.type.name);if(!r||!Ad(r.archetype))return[];const s=tt(e,t),i=s==null?void 0:s.entries.find(a=>a.id===n);return i?r.slots.filter(a=>!tw.has(a)).filter(a=>typeof i[a]!="string"):[]}const tw=new Set(["icon","src","alt"]);function Ek(e,t,n,o){const r=tt(e,t);return!r||!ew(e,t,n).includes(o)?!1:wt(e,t,r.key,r.entries.map(s=>s.id===n?{...s,[o]:""}:s))}function Ck(e,t,n){const o=tt(e,t);return!o||o.entries.length<=1?!1:ei(e,()=>wt(e,t,o.key,o.entries.filter(r=>r.id!==n)))}function Mr(e){for(let t=e.depth;t>=0;t--)if(e.node(t).type.name==="page")return e.node(t).attrs.id??null;return null}function ei(e,t){const n=Mr(e.state.selection.$from),o=t();if(!o||!n)return o;const{doc:r}=e.state;if(Mr(e.state.selection.$from)===n)return o;const s=Pe(r,n);if(!s)return o;const i=Da.findFrom(r.resolve(s.pos+s.node.nodeSize-1),-1,!0);return i&&Mr(i.$from)===n&&e.commands.setTextSelection(i.from),o}function Tk(e,t){return ei(e,()=>e.commands.removeBlock(t))}function Mk(e,t,n){const o=tt(e,t);if(!o)return!1;const r=[];for(const s of o.entries)if(r.push(s),s.id===n){const{id:i,...a}=s;r.push(a)}return wt(e,t,o.key,r)}const Fu=(e,t,n)=>{const o=Pe(e.state.doc,t);return o?Pa(o.node,n)===null&&Ld(o.node,n)===null:!0},Pk=(e,t)=>{const n=tt(e,t);return!!n&&Fu(e,t,n.entries.length+1)},Ok=(e,t)=>{const n=tt(e,t);return!!n&&Fu(e,t,n.entries.length-1)};function Ik(e,t,n){const o=tt(e,t);if(!o)return!1;const r=Pe(e.state.doc,t),s=r&&Qe(r.node.type.name);if(!s)return!1;const i=Math.min(n,o.entries.length),a=[...o.entries];return a.splice(i,0,In(s)),wt(e,t,o.key,a)}function In(e){const t=e.slots.filter(o=>{var r;return!((r=e.optional)!=null&&r.includes(o))}),n=(o,r)=>t.includes(o)?{[o]:r}:{};return e.archetype==="prose"?e.slots.length?{text:""}:{}:e.archetype==="stats"?{...n("value",""),...n("label",""),...n("note","")}:e.archetype==="media"?{alt:"",...n("title",""),...n("body",""),...n("caption","")}:{...n("title",""),...n("body",""),...n("meta",""),...n("icon","zap")}}function _u(e,t,n,o){const r=Wn(e),s=t?r.arrangements.find(g=>g.name===t):void 0,i=n?gd[n]:void 0,[a,c]=i?[i.min,i.max]:s?s.countRange:r.countRange,l=Math.min(c,Math.max(a,3)),u=Ca(r.archetype),f=g=>({[u]:g});if(r.archetype==="table"){const h=()=>Array.from({length:3},()=>"");return{table:{headers:h(),rows:[h(),h()]}}}return r.archetype==="chart"?{chart:{categories:["Q1","Q2","Q3"],series:[{name:"Revenue",values:[12,19,27]}]}}:r.archetype==="diagram"?{diagram:{source:md(o)}}:r.archetype==="stats"?f(Array.from({length:l},()=>In(r))):r.archetype==="media"?f(Array.from({length:l},()=>In(r))):f(Array.from({length:l},()=>o===Z0&&r.slots.includes("meta")?{...In(r),meta:""}:In(r)))}function Ak(e,t,n){const o=Ca(Wn("image").archetype);return e.commands.addBlock(t,"image",{[o]:[{src:n,alt:""}]})}function nw(e,t,n,o,r){return e.commands.addBlock(t,n,_u(n,null,null,r),o)}function Bu(e){var a;const t=e.type?Wn(e.type):void 0,n=e.arrangement===((a=t==null?void 0:t.arrangements[0])==null?void 0:a.name)?null:e.arrangement??null,o=e.mark===(t==null?void 0:t.marks[0])?null:e.mark??null,r=e.variant??null,s=e.iconPosition??null,i=e.figure??null;return{variant:r,arrangement:n,figure:i,mark:o,iconPosition:s,any:!!(r||n||i||o||s)}}function ow(e,t,n,o){if(n.layout)return e.commands.addLayout(t,n.layout,o);const r=n.type;if(!r||!Wn(r))return!1;const{variant:s,arrangement:i,figure:a,mark:c,iconPosition:l,any:u}=Bu(n),f=n.starter??null;if(!u)return nw(e,t,r,o,f);const p=new Set(jn(e,t));return e.chain().addBlock(t,r,_u(r,i,a,f),o).command(({state:g,chain:h})=>{const w=zu(g.doc,t).find(b=>!p.has(b));if(!w)return!1;let m=h();return s&&(m=m.setVariant(w,s)),i&&(m=m.setArrangement(w,i)),a&&(m=m.setFigure(w,a)),c&&(m=m.setBlockMark(w,c)),l&&(m=m.setIconPosition(w,l)),m.run()}).run()}const $k=(e,t)=>Ma.filter(n=>n.archetype===e&&n.type!==t);function zu(e,t){const n=Pe(e,t),o=[];return n==null||n.node.forEach(r=>{var i;const s=(i=r.attrs)==null?void 0:i.id;s&&Qe(r.type.name)&&o.push(s)}),o}const jn=(e,t)=>zu(e.state.doc,t);function Hu(e,t,n){const o=jn(e,t),r=n??o[o.length-1];r&&ba(e,r);const s=new Set(jn(e,t));if(!e.commands.addBlock(t,"text",{content:[{text:""}]},n))return!1;const i=jn(e,t).find(a=>!s.has(a));return i?ba(e,i):!1}function ba(e,t){const n=Pe(e.state.doc,t);return n?e.chain().focus().setTextSelection(n.pos+1).run():!1}function Nk(e,t){return Hu(e,t)}function Dk(e,t,n){const o=jn(e,t),r=o.indexOf(n);return r<0?!1:Hu(e,t,o[r+1])}function Lk(e,t){const n=Pe(e.state.doc,t);return!!n&&n.node.type.name==="paragraph"&&n.node.content.size===0}function jk(e){const{$from:t}=e.state.selection;for(let n=t.depth;n>0;n--){const o=t.node(n-1),r=o.type.spec.group==="slot"&&!o.type.inlineContent;if(o.type.name!=="page"&&!r)continue;const s=t.node(n),i=Qe(s.type.name);if((i==null?void 0:i.archetype)!=="prose")return null;const a=s.attrs.id;if(!a)return null;const c=r?Ma.filter(l=>l.archetype==="prose"&&!!o.type.contentMatch.matchType(s.type.schema.nodes[l.node])).map(l=>l.type):null;return{id:a,kind:i.type,..."level"in(s.type.spec.attrs??{})?{level:s.attrs.level}:{},..."language"in(s.type.spec.attrs??{})?{language:s.attrs.language??null}:{},arrangement:s.attrs.arrangement??null,...c?{holds:c}:{}}}return null}function rw(e,t){var o;const{$from:n}=e.state.selection;for(let r=n.depth;r>=0;r--)if(((o=n.node(r).attrs)==null?void 0:o.id)===t)return!0;return!1}function sw(e,t){var o;const n=Pe(e.state.doc,t);return!n||!((o=n.node.firstChild)!=null&&o.firstChild)?!1:e.commands.setTextSelection(n.pos+3)}function iw(e,t){var r;const n=Pe(e.state.doc,t);if(!n||((r=Qe(n.node.type.name))==null?void 0:r.archetype)!=="table")return null;const o=rw(e,t);return{inCell:o,canMerge:o&&e.can().mergeCells(),canSplit:o&&e.can().splitCell(),hasHeaderRow:(Id(n.node).headers??[]).length>0,rows:n.node.childCount,cols:Na(n.node)}}function aw(e,t,n,o,r){if(!n||!o)return;const s=Pe(e.state.doc,t);if(!s)return;const i=Na(s.node);if(i===n.length)return;const a=100/n.length,c=r==="addColumnAfter"?o.right:o.left,l=i>n.length?[...n.slice(0,c),a,...n.slice(c)]:[...n.slice(0,o.left),...n.slice(o.right)];e.commands.setColumnWidths(t,l)}function Fk(e,t,n){const o=iw(e,t);if(!o||!o.inCell&&!sw(e,t))return!1;const r=Pe(e.state.doc,t),s=r&&Ra(r.node.type.spec)?Nd(r.node):null,i=s?Dd(e.state):null;return ei(e,()=>{const a=e.commands,c=(()=>{switch(n){case"addRowBefore":return a.addRowBefore();case"addRowAfter":return a.addRowAfter();case"deleteRow":return a.deleteRow();case"addColumnBefore":return a.addColumnBefore();case"addColumnAfter":return a.addColumnAfter();case"deleteColumn":return a.deleteColumn();case"mergeCells":return a.mergeCells();case"splitCell":return a.splitCell();case"toggleHeaderRow":return a.toggleHeaderRow()}})();return aw(e,t,s,i,n),c})}const _k=(e,t,n)=>e.commands.setColumnWidths(t,n);function Bk(e,t){var o;const n=Pe(e.state.doc,t);return n?((o=hd(n.node)[0])==null?void 0:o.text)??"":""}const cw={"Text · Normal text":"Text",Heading:"Heading",Bullets:"Bulleted list",Numbered:"Numbered list",Checklist:"Checklist",Quote:"Quote",Code:"Code block",Separator:"Separator","Box · Grid":"Boxes","Box · Grid · Side line":"Side line boxes","Box · Grid · Filled":"Filled boxes","Box · Grid · Outline":"Outline boxes","Box · Grid · Top line":"Top line boxes","Box · Grid · Accent":"Accent boxes","Box · Grid · Leaf":"Leaf boxes","Box · Grid · no icons":"Boxes without icons","Box · Grid · Eyebrow":"Boxes with eyebrows","Box · Grid · Accent header · no icons":"Accent header boxes","Box · Grid · Eyebrow · Accent header":"Filled header boxes","Box · List":"Box rows","Box · List · Side line":"Side line rows","Box · List · Filled":"Filled rows","Box · List · no icons":"Box rows without icons","Steps · Across":"Steps","Steps · Across · with icons":"Steps with icons","Steps · Across · Side line":"Side line steps","Steps · Across · Filled":"Filled steps","Steps · Across · Outline":"Outline steps","Steps · Across · Top line":"Top line steps","Steps · Across · Accent":"Accent steps","Steps · Across · Marked":"Solid numerals","Steps · List":"Step rows","Steps · Staircase":"Staircase","Steps · Staircase · with icons":"Staircase with icons","Steps · Funnel":"Funnel","Steps · Funnel · with icons":"Funnel with icons","Steps · Pyramid":"Pyramid","Steps · Pyramid · with icons":"Pyramid with icons","Steps · Ring":"Ring","Steps · Road":"Roadmap","Steps · Road · with icons":"Roadmap with icons","Steps · Climb":"Climb","Steps · Climb · with icons":"Climb with icons","Steps · Core":"Core","Steps · Core · with icons":"Core with icons","Steps · Ring · with icons":"Ring with icons",Timeline:"Timeline","Timeline · with icons":"Timeline with icons","Timeline · Filled":"Filled timeline","Timeline · Outline":"Outline timeline","Timeline · Accent":"Accent timeline","Timeline · Marked":"Solid dots","Stat row":"Stats","Stat row · Side line":"Side line stats","Stat row · Filled":"Filled stats","Stat row · Outline":"Outline stats","Stat row · Top line":"Top line stats","Stat row · Accent":"Accent stats",Table:"Table","Diagram · Flowchart":"Flowchart","Diagram · Org chart":"Org chart","Diagram · Sequence":"Sequence","Diagram · States":"States","Diagram · Mind map":"Mind map","Diagram · Entities":"Entities","Diagram · Kanban":"Kanban","Diagram · Blocks":"Blocks","Diagram · Quadrant":"Quadrant","Diagram · Timeline":"Timeline","Diagram · Venn":"Venn","Diagram · Gantt":"Gantt","Diagram · Swimlanes":"Swimlanes","Diagram · Tree view":"Tree view","Diagram · Cynefin":"Cynefin","Diagram · Architecture":"Architecture","Chart · Column":"Column chart","Chart · Bar":"Bar chart","Chart · Line":"Line chart","Chart · Area":"Area chart","Chart · Pie":"Pie chart","Chart · Donut":"Donut chart","Chart · Waterfall":"Waterfall chart","Chart · Heatmap":"Heatmap","Table · Banded":"Banded table","Table · Header band":"Table with header",Image:"Image","Image grid":"Image grid","Image with text":"Image with text","Image with text · Filled":"Image card",People:"People","People · Filled":"Filled people","People · Outline":"Outline people","People · Raised card":"People cards","People · Leaf":"Leaf people",YouTube:"YouTube","Two columns":"Two columns","Three columns":"Three columns","Four columns":"Four columns","Five columns":"Five columns"},me="var(--m-accent)",X="var(--m-line)",ge="var(--m-fill)";function ot(e,t,n,o,r,s=1.5){const i=(a="")=>`<rect x="${e}" y="${t}" width="${n}" height="${o}" rx="${s}" ${a}/>`;switch(r){case"soft-fill":return i(`fill="${ge}" stroke="none"`);case"solid-accent":return i(`fill="${me}" stroke="none"`);case"outlined":return i(`fill="none" stroke="${X}" stroke-width="1.4"`);case"raised-card":return`<rect x="${e+1.2}" y="${t+1.6}" width="${n}" height="${o}" rx="${s}" fill="${ge}" stroke="none"/>`+i(`fill="var(--m-card)" stroke="${X}" stroke-width="1.4"`);case"leaf-corner":{const a=Math.min(n,o)/2;return`<path d="M${e} ${t} H${e+n-a} a${a} ${a} 0 0 1 ${a} ${a} V${t+o-a} a${a} ${a} 0 0 1 ${-a} ${a} H${e+a} a${a} ${a} 0 0 1 ${-a} ${-a} Z" fill="${ge}" stroke="none"/>`}case"accent-header":{const a=o*.59;return i(`fill="none" stroke="${X}" stroke-width="1.4"`)+`<path d="M${e} ${t+s} a${s} ${s} 0 0 1 ${s} ${-s} H${e+n-s} a${s} ${s} 0 0 1 ${s} ${s} V${t+a} H${e} Z" fill="${me}" stroke="none"/>`}case"top-rule":return`<path d="M${e} ${t+.8} H${e+n}" stroke="${me}" stroke-width="2.4" stroke-linecap="round"/>`;case"accent-bar":return`<path d="M${e+.8} ${t} V${t+o}" stroke="${me}" stroke-width="2.4" stroke-linecap="round"/>`;default:return""}}function Xt(e,t,n,o,{look:r,markKind:s,icons:i,kind:a,i:c=1,lead:l=!1,eyebrow:u=!1}){const f=r==="solid-accent"?"var(--m-on)":X,p=r==="accent-header"?"var(--m-on)":f,g=2.4,h=[],w=(E,y)=>a==="people"?`<circle cx="${E}" cy="${y}" r="2.7" fill="${me}" stroke="none"/>`:Et(E,y,{look:r,markKind:s,kind:a,n:c},f);if(a==="stat")return _e(e+g,t+o/2-1.9,e+n-g-1,me,3.4)+_e(e+g,t+o/2+2.9,e+n-g-3,f,1.2);if(l){const E=i===!1?0:5.2,y=e+g+E;E&&h.push(w(e+g+1.4,t+o/2));const C=u?1.5:0;return u&&h.push(_e(y,t+o/2-1.1-C-2.6,y+(e+n-g-y)*.45,me,1)),h.push(_e(y,t+o/2-1.1+C,e+n-g,f,1.6)),h.push(_e(y,t+o/2+1.9+C,y+(e+n-g-y)*.52,f,1.2)),h.join("")}const m=i===!1?4:3,b=i===!1?0:7,x=u?2.8:0,S=t+(o-(b+x+(m-1)*3.4))/2+b+x;b&&h.push(w(e+g+2.2,S-x-b/2-.4)),x&&h.push(_e(e+g,S-x+.2,e+g+(n-2*g)*.5,p===f?me:p,1));const v=[0,2.6,1.2,3.8];for(let E=0;E<m;E+=1)h.push(_e(e+g,S+E*3.4,e+n-g-v[E],E===0?p:f,E===0?1.6:1.2));return h.join("")}const Et=(e,t,{look:n,markKind:o,kind:r,n:s=1,size:i=6.6},a=X)=>{const c=i*.45,l=`<path d="M${e} ${t-c} L${e+c*.38} ${t-c*.38} L${e+c} ${t} L${e+c*.38} ${t+c*.38} L${e} ${t+c} L${e-c*.38} ${t+c*.38} L${e-c} ${t} L${e-c*.38} ${t-c*.38} Z" fill="${me}" stroke="none"/>`;if(o==="icon"||r==="box")return n==="accent-header"?l.replace(`fill="${me}"`,'fill="var(--m-on)"'):l;if(r==="step"){const f=n==="marked";return(f?`<circle cx="${e}" cy="${t}" r="${i*.58}" fill="${me}" stroke="none"/>`:"")+`<text x="${e}" y="${t+i*.34}" font-size="${i}" font-weight="700" text-anchor="middle" fill="${f?"var(--m-on)":me}">${s}</text>`}const u=r==="node"||n==="marked";return`<circle cx="${e}" cy="${t}" r="${c}" fill="${u?me:"var(--m-card)"}" stroke="${u?"none":a}" stroke-width="1.4"/>`},_e=(e,t,n,o=X,r=1.4)=>{if(typeof o!="string")throw new Error(`line() colour must be a string, got ${o}`);return`<path d="M${e} ${t} H${n}" stroke="${o}" stroke-width="${r}" stroke-linecap="round"/>`};function lw({drawing:e,look:t,markKind:n,icons:o}){const r=i=>`<svg viewBox="0 0 24 24" width="26" height="26" aria-hidden="true">${i}</svg>`,s=i=>t?"":`<path d="${i}" stroke="${X}" stroke-width="1" opacity=".7"/>`;switch(e){case"box-grid":{const i=a=>ot(1.5+a*11,4,10,16,t)+Xt(1.5+a*11,4,10,16,{look:t,markKind:n,icons:o,kind:"box"});return r(s("M12 4.5 V19.5")+i(0)+i(1))}case"box-grid-eyebrow":{const i=a=>ot(1.5+a*11,4,10,16,t)+Xt(1.5+a*11,4,10,16,{look:t,markKind:n,icons:o,kind:"box",eyebrow:!0});return r(s("M12 4.5 V19.5")+i(0)+i(1))}case"box-rows":{const i=c=>2.4+c*7.2,a=c=>ot(1.5,i(c),21,5.4,t)+Xt(1.5,i(c),21,5.4,{look:t,markKind:n,icons:o,kind:"box",lead:!0});return r(s([1,2].map(c=>`M1.5 ${i(c)-.9} H22.5`).join(" "))+a(0)+a(1)+a(2))}case"steps-across":{const i=a=>ot(1.5+a*11,4,10,16,t)+Xt(1.5+a*11,4,10,16,{look:t,markKind:n,icons:o,kind:"step",i:a+1});return r(s("M9.6 8.2 H14.4")+i(0)+i(1))}case"steps-list":{const i=c=>2.4+c*7.2,a=c=>ot(1.5,i(c),21,5.4,t)+Xt(1.5,i(c),21,5.4,{look:t,markKind:n,icons:o,kind:"step",i:c+1,lead:!0});return r(s([1,2].map(c=>`M1.5 ${i(c)-.9} H22.5`).join(" "))+a(0)+a(1)+a(2))}case"staircase":return r([0,1,2].map(i=>ot(1+i*5,2.5+i*6.6,13,5.4,t||"outlined",1.5)+(o===!1?"":Et(4.8+i*5,5.2+i*6.6,{look:t,markKind:n,kind:"step",n:i+1,size:4.8}))).join(""));case"funnel":return r([0,1,2].map(i=>ot(2+i*3.6,2.5+i*6.6,20-i*7.2,5.4,t||"outlined",1.5)+(o===!1?"":Et(12,5.2+i*6.6,{look:t,markKind:n,kind:"step",n:i+1,size:4.8}))).join(""));case"pyramid":return r([0,1,2].map(i=>ot(8.4-i*3.6,2.5+i*6.6,7.2+i*7.2,5.4,t||"outlined",1.5)+(o===!1?"":Et(12,5.2+i*6.6,{look:t,markKind:n,kind:"step",n:i+1,size:4.8}))).join(""));case"ring":return r(`<circle cx="12" cy="12" r="8" fill="none" stroke="${X}" stroke-width="1.4"/>`+[[12,4],[18.9,16],[5.1,16]].map(([i,a])=>Et(i,a,{look:t,markKind:n,kind:"node",size:5.6})).join(""));case"road":{const i="M1.5 15 C 5 15 5 9 8.5 9 S 12 15 15.5 15 S 19 9 22.5 9";return r(`<path d="${i}" fill="none" stroke="${ge}" stroke-width="4.4" stroke-linecap="round"/><path d="${i}" fill="none" stroke="${X}" stroke-width="0.9" stroke-linecap="round" stroke-dasharray="1.6 1.6"/>`+[[8.5,9],[15.5,15],[22.5,9]].map(([a,c])=>Et(a,c,{look:t,markKind:n,kind:"node",size:5.2})).join(""))}case"climb":{const i="M2 19.5 L22 5.5";return r(`<path d="${i} L22 20 L2 20 Z" fill="${ge}" stroke="none"/><path d="${i}" fill="none" stroke="${X}" stroke-width="1.6" stroke-linecap="round"/>`+[[6.2,16.56],[12,12.5],[17.8,8.44]].map(([a,c])=>Et(a,c,{look:t,markKind:n,kind:"node",size:5.2})).join(""))}case"core":{const i=(a,c,l)=>`<path d="M ${12-a} 20.5 A ${a} ${c} 0 0 1 ${12+a} 20.5 Z" fill="${l}" stroke="${X}" stroke-width="1.1"/>`;return r(i(11,13.8,"none")+i(7.6,9.3,ge)+i(4.2,5,ge)+(o===!1?"":Et(12,18,{look:t,markKind:n,kind:"node",size:4.4})))}case"timeline":{const i=a=>2.6+a*7.4;return r(`<path d="M4 2.6 V21.4" stroke="${X}" stroke-width="1.4" stroke-linecap="round"/>`+[0,1,2].map(a=>Et(4,i(a)+2.5,{look:t,markKind:n,kind:"event",size:5.4})+ot(9,i(a),13.4,5,t,1.5)+_e(10.4,i(a)+2.5,20.6,t==="solid-accent"?"var(--m-on)":X,1.4)).join(""))}case"stats":{const i=a=>ot(1.5+a*11,5,10,14,t)+Xt(1.5+a*11,5,10,14,{look:t,markKind:n,icons:o,kind:"stat"});return r(s("M12 5.5 V18.5")+i(0)+i(1))}case"diagram-flow":return r(`<rect x="1.5" y="9" width="6" height="6" rx="1.4" fill="${ge}" stroke="${X}" stroke-width="1.3"/><rect x="9.5" y="9" width="5" height="6" rx="1.4" fill="${ge}" stroke="${X}" stroke-width="1.3"/><rect x="16.5" y="9" width="6" height="6" rx="1.4" fill="${me}" stroke="none"/>`+_e(7.5,12,9.5)+_e(14.5,12,16.5));case"diagram-org":return r(`<rect x="8.5" y="2.5" width="7" height="5" rx="1.4" fill="${me}" stroke="none"/><path d="M12 7.5 V11 M4.5 15.5 V13 a2 2 0 0 1 2 -2 H17.5 a2 2 0 0 1 2 2 V15.5 M12 11 V15.5" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/><rect x="1.5" y="15.5" width="6" height="5" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.3"/><rect x="9" y="15.5" width="6" height="5" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.3"/><rect x="16.5" y="15.5" width="6" height="5" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.3"/>`);case"diagram-sequence":return r(`<rect x="2" y="2.5" width="6" height="3.6" rx="1.2" fill="${ge}" stroke="${X}" stroke-width="1.3"/><rect x="16" y="2.5" width="6" height="3.6" rx="1.2" fill="${ge}" stroke="${X}" stroke-width="1.3"/><path d="M5 6.5 V21 M19 6.5 V21" fill="none" stroke="${X}" stroke-width="1.1" stroke-dasharray="2 2" stroke-linecap="round"/><path d="M5.5 11 H18" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round"/><path d="M16.2 9.6 L18.6 11 L16.2 12.4 Z" fill="${X}" stroke="none"/><path d="M18.5 16 H6" fill="none" stroke="${me}" stroke-width="1.4" stroke-linecap="round"/><path d="M7.8 14.6 L5.4 16 L7.8 17.4 Z" fill="${me}" stroke="none"/>`);case"diagram-state":return r(`<rect x="1.5" y="8.5" width="8" height="7" rx="3.5" fill="${ge}" stroke="${X}" stroke-width="1.3"/><rect x="14.5" y="8.5" width="8" height="7" rx="3.5" fill="${me}" stroke="none"/><path d="M9.5 10.6 H14.5" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round"/><path d="M12.9 9.3 L15 10.6 L12.9 11.9 Z" fill="${X}" stroke="none"/><path d="M14.5 13.6 H9.5" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round"/><path d="M11.1 12.3 L9 13.6 L11.1 14.9 Z" fill="${X}" stroke="none"/>`);case"diagram-mindmap":return r(`<circle cx="7" cy="12" r="3.6" fill="${me}" stroke="none"/><path d="M10.6 12 H13 M13 12 a2 2 0 0 0 2 -2 V7.6 M13 12 a2 2 0 0 1 2 2 V16.4" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/><rect x="15" y="5.4" width="7" height="4.4" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.2"/><rect x="15" y="14.2" width="7" height="4.4" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.2"/>`);case"diagram-entity":return r(`<rect x="1.5" y="4" width="7.5" height="7" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.3"/><path d="M1.5 6.6 H9" fill="none" stroke="${X}" stroke-width="1.1"/><rect x="15" y="13" width="7.5" height="7" rx="1.3" fill="${me}" stroke="none"/><path d="M9 9.4 a5 5 0 0 1 5 5 V15" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.6 15.6 L14 13.4 L16.4 15.6" fill="none" stroke="${X}" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>`);case"diagram-kanban":return r(`<rect x="1.5" y="4" width="6.4" height="16" rx="1.4" fill="none" stroke="${X}" stroke-width="1.2"/><rect x="8.8" y="4" width="6.4" height="16" rx="1.4" fill="none" stroke="${X}" stroke-width="1.2"/><rect x="16.1" y="4" width="6.4" height="16" rx="1.4" fill="none" stroke="${X}" stroke-width="1.2"/><rect x="2.9" y="6" width="3.6" height="3" rx="0.8" fill="${ge}" stroke="none"/><rect x="2.9" y="10" width="3.6" height="3" rx="0.8" fill="${ge}" stroke="none"/><rect x="10.2" y="6" width="3.6" height="3" rx="0.8" fill="${ge}" stroke="none"/><rect x="17.5" y="6" width="3.6" height="3" rx="0.8" fill="${me}" stroke="none"/>`);case"diagram-blocks":return r(`<rect x="2" y="4.5" width="6" height="6" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.2"/><rect x="9" y="4.5" width="6" height="6" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.2"/><rect x="16" y="4.5" width="6" height="6" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.2"/><rect x="2" y="12.5" width="20" height="6" rx="1.3" fill="${me}" stroke="none"/>`);case"diagram-quadrant":return r(`<path d="M3 3 V21 H21" fill="none" stroke="${X}" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 3.5 V20.5 M3.5 12 H20.5" fill="none" stroke="${X}" stroke-width="1" stroke-dasharray="2 2"/><circle cx="16.5" cy="7.5" r="2.4" fill="${me}" stroke="none"/><circle cx="7.5" cy="16" r="1.7" fill="${ge}" stroke="${X}" stroke-width="1.1"/>`);case"diagram-timeline":return r(`<path d="M2.5 12 H21.5" fill="none" stroke="${X}" stroke-width="1.4" stroke-linecap="round"/><rect x="3.5" y="4.6" width="6" height="4" rx="1.2" fill="${ge}" stroke="${X}" stroke-width="1.2"/><rect x="14.5" y="4.6" width="6" height="4" rx="1.2" fill="${me}" stroke="none"/><rect x="9" y="15.4" width="6" height="4" rx="1.2" fill="${ge}" stroke="${X}" stroke-width="1.2"/><path d="M6.5 8.6 V12 M17.5 8.6 V12 M12 12 V15.4" fill="none" stroke="${X}" stroke-width="1.2"/><circle cx="6.5" cy="12" r="1.5" fill="${X}" stroke="none"/><circle cx="17.5" cy="12" r="1.5" fill="${X}" stroke="none"/><circle cx="12" cy="12" r="1.5" fill="${X}" stroke="none"/>`);case"diagram-venn":return r(`<circle cx="9" cy="12" r="6.2" fill="none" stroke="${X}" stroke-width="1.3"/><circle cx="15" cy="12" r="6.2" fill="none" stroke="${X}" stroke-width="1.3"/><path d="M12 6.4 a6.2 6.2 0 0 0 0 11.2 a6.2 6.2 0 0 0 0 -11.2 Z" fill="${me}" stroke="none"/>`);case"diagram-swimlanes":return r(`<path d="M2 4.5 H22 M2 12 H22 M2 19.5 H22" fill="none" stroke="${X}" stroke-width="1.1"/><rect x="3.5" y="5.6" width="7" height="5" rx="1.3" fill="${ge}" stroke="${X}" stroke-width="1.2"/><rect x="13.5" y="13.1" width="7" height="5" rx="1.3" fill="${me}" stroke="none"/><path d="M10.5 8.1 H14 a2 2 0 0 1 2 2 V12.4" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.7 11.3 L16 13.6 L17.3 11.3 Z" fill="${X}" stroke="none"/>`);case"diagram-treeview":return r(`<path d="M4.5 4 V10 H9 M4.5 10 V16.5 H9 M11.5 10 V13.5 H16 M11.5 13.5 V19 H16" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/><rect x="9.5" y="2.2" width="9" height="3.6" rx="1.1" fill="${me}" stroke="none"/><rect x="9.5" y="8.2" width="7" height="3.6" rx="1.1" fill="${ge}" stroke="none"/><rect x="16.5" y="11.7" width="5.5" height="3.6" rx="1.1" fill="${ge}" stroke="none"/><rect x="16.5" y="17.2" width="5.5" height="3.6" rx="1.1" fill="${ge}" stroke="none"/>`);case"diagram-cynefin":return r(`<rect x="2.5" y="2.5" width="9" height="9" rx="1.2" fill="${ge}" stroke="none" opacity="0.7"/><rect x="12.5" y="2.5" width="9" height="9" rx="1.2" fill="${ge}" stroke="none" opacity="0.9"/><rect x="2.5" y="12.5" width="9" height="9" rx="1.2" fill="${ge}" stroke="none"/><rect x="12.5" y="12.5" width="9" height="9" rx="1.2" fill="${ge}" stroke="none" opacity="0.55"/><circle cx="12" cy="12" r="3.4" fill="${me}" stroke="none"/>`);case"diagram-architecture":return r(`<rect x="1.8" y="4" width="20.4" height="16" rx="2" fill="none" stroke="${X}" stroke-width="1.2" stroke-dasharray="2.5 2"/><rect x="4" y="9.5" width="5" height="5" rx="1.2" fill="${ge}" stroke="${X}" stroke-width="1.2"/><rect x="15" y="9.5" width="5" height="5" rx="1.2" fill="${me}" stroke="none"/><rect x="9.5" y="15" width="5" height="3.4" rx="1" fill="${ge}" stroke="${X}" stroke-width="1.2"/><path d="M9 12 H15 M12 12 V15" fill="none" stroke="${X}" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>`);case"diagram-gantt":return r(`<path d="M2.5 5.5 H21.5" fill="none" stroke="${X}" stroke-width="1.2"/><rect x="3" y="8" width="10" height="3.2" rx="1.2" fill="${ge}" stroke="none"/><rect x="7" y="13" width="9" height="3.2" rx="1.2" fill="${ge}" stroke="none"/><rect x="12" y="18" width="9" height="3.2" rx="1.2" fill="${me}" stroke="none"/><path d="M7 3.8 V5.5 M13 3.8 V5.5 M19 3.8 V5.5" fill="none" stroke="${X}" stroke-width="1.1" stroke-linecap="round"/>`);case"chart-column":return r(`<path d="M3 4 V20 H21" fill="none" stroke="${X}" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>`+[[6,13.5],[11,9.5],[16,6]].map(([i,a],c)=>`<rect x="${i}" y="${a}" width="3.8" height="${19-a}" rx="1" fill="${c===2?me:ge}" stroke="none"/>`).join(""));case"chart-bar":return r(`<path d="M4 4 V20 H21" fill="none" stroke="${X}" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>`+[[6.4,7],[11,11.5],[15.5,16]].map(([i,a],c)=>`<rect x="5" y="${i}" width="${a}" height="3.8" rx="1" fill="${c===2?me:ge}" stroke="none"/>`).join(""));case"chart-line":return r(`<path d="M3 4 V20 H21" fill="none" stroke="${X}" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M5.6 16.4 L10 11.6 L13.6 14 L18.6 6.8" fill="none" stroke="${ge}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><circle cx="18.6" cy="6.8" r="2.1" fill="${me}" stroke="none"/>`);case"chart-area":return r(`<path d="M3 4 V20 H21" fill="none" stroke="${X}" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M5.2 15.8 L9.8 11 L14.2 13.2 L19.4 6.4 V19 H5.2 Z" fill="${me}" stroke="none"/><path d="M5.2 15.8 L9.8 11 L14.2 13.2 L19.4 6.4" fill="none" stroke="${ge}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`);case"chart-pie":return r(`<path d="M12 3.4 A8.6 8.6 0 1 1 11.99 3.4 Z" fill="${ge}" stroke="none"/><path d="M12.9 3.45 A8.6 8.6 0 0 1 20.4 13.6 L12.9 12.05 Z" fill="${me}" stroke="none"/>`);case"chart-donut":{const i=(a,c)=>`<path d="${a}" fill="none" stroke="${c}" stroke-width="4"/>`;return r(i("M12.5 4.82 A7.2 7.2 0 0 1 17.67 16.44",me)+i("M16.23 17.83 A7.2 7.2 0 0 1 5.33 14.7",ge)+i("M4.84 12.76 A7.2 7.2 0 0 1 11.5 4.82",ge))}case"chart-waterfall":return r(`<path d="M3 4 V20 H21" fill="none" stroke="${X}" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>`+[[5.2,12,7],[9.3,9,3],[13.4,6.5,2.5],[17.5,6.5,4.5]].map(([i,a,c],l)=>`<rect x="${i}" y="${a}" width="3.2" height="${c}" rx="1" fill="${l===3?me:ge}" stroke="none"/>`).join(""));case"chart-heatmap":return r([[.26,.54,1],[.16,.84,.44],[.42,.22,.66]].map((l,u)=>l.map((f,p)=>`<rect x="${(2.5+p*(5.47+1.3)).toFixed(2)}" y="${(4+u*(4.47+1.3)).toFixed(2)}" width="${5.47}" height="${4.47}" rx="1" fill="${me}" opacity="${f}" stroke="none"/>`).join("")).join(""));case"table":return r(`<rect x="2" y="4" width="20" height="16" rx="2" fill="none" stroke="${X}" stroke-width="1.4"/>`+(t==="header-band"?`<path d="M2 5.5 h20 v3 h-20 z" fill="${me}" stroke="none"/>`:"")+(t==="banded"?`<path d="M2 9.3 h20 v3.6 h-20 z M2 16.4 h20 v3.6 h-20 z" fill="${ge}" stroke="none"/>`:"")+`<path d="M2 9.3 H22 M2 14.6 H22 M8.6 4 V20 M15.3 4 V20" stroke="${X}" stroke-width="1" opacity=".7"/>`);case"image":return r(`<rect x="2" y="4" width="20" height="16" rx="2" fill="none" stroke="${X}" stroke-width="1.4"/><circle cx="8" cy="9.5" r="1.7" fill="${me}" stroke="none"/><path d="M3.4 18 L9.5 12 L14 15.6 L17.6 12.6 L22 16.4 V18 Z" fill="${X}" stroke="none"/>`);case"image-grid":return r([[2,4],[12.6,4],[2,13.4],[12.6,13.4]].map(([i,a])=>`<rect x="${i}" y="${a}" width="9.4" height="7.6" rx="2" fill="${ge}" stroke="none"/>`).join(""));case"image-text":return r(ot(2,5,10,14,t,2)+`<circle cx="5.6" cy="9" r="1.3" fill="${me}" stroke="none"/><path d="M3 17.6 L6.4 13.6 L9 16 L11.4 14 V17.6 Z" fill="${X}" stroke="none"/>`+[0,1,2].map(i=>_e(14.4,8.4+i*3.6,22)).join(""));case"people":{const i=a=>ot(1.5+a*11,3.5,10,17,t)+Xt(1.5+a*11,3.5,10,17,{look:t,markKind:n,icons:o,kind:"people"});return r(s("M12 4 V20")+i(0)+i(1))}case"youtube":return r(`<rect x="2" y="4.5" width="20" height="15" rx="2.5" fill="none" stroke="${X}" stroke-width="1.4"/><path d="M10 8.6 L16.4 12 L10 15.4 Z" fill="${me}" stroke="none"/>`);default:{const i=/^cols-(\d+)$/.exec(e);if(!i)break;const a=Number(i[1]),c=a>4?1.2:2,l=(20-c*(a-1))/a;return r(Array.from({length:a},(u,f)=>ot(2+f*(l+c),4,l,16,"outlined",Math.min(2,l/2))).join(""))}case"text":return r([0,1,2].map(i=>_e(3,6+i*5.4,i===2?16:21)).join(""));case"heading":return r(_e(3,8,17,X,3.4)+_e(3,15,21)+_e(3,19,14));case"bullets":return r([0,1,2].map(i=>`<circle cx="4.4" cy="${6.6+i*5.4}" r="1.5" fill="${me}"/>`+_e(8.4,6.6+i*5.4,21)).join(""));case"numbered":return r([0,1,2].map(i=>`<text x="2.2" y="${9+i*5.4}" font-size="5.4" fill="${me}">${i+1}</text>`+_e(8.4,6.6+i*5.4,21)).join(""));case"checklist":return r([0,1,2].map(i=>`<path d="M2.6 ${6.6+i*5.4} l1.6 1.6 l2.8-3" fill="none" stroke="${me}" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>`+_e(9.4,6.6+i*5.4,21)).join(""));case"quote":return r(`<path d="M3 4 V20" stroke="${me}" stroke-width="2.4" stroke-linecap="round"/>`+[0,1,2].map(i=>_e(7.6,7+i*5,i===2?16:21)).join(""));case"code":return r(`<path d="M8.6 8.4 L4.4 12 L8.6 15.6 M15.4 8.4 L19.6 12 L15.4 15.6" fill="none" stroke="${X}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>`);case"separator":return r(_e(3,7,21)+_e(3,12,21,me,2)+_e(3,17,21))}throw new Error(`no drawing for ${e}`)}const uw={"Text · Normal text":"text",Heading:"heading",Bullets:"bullets",Numbered:"numbered",Checklist:"checklist",Quote:"quote",Code:"code",Separator:"separator","Box · Grid":"box-grid","Box · List":"box-rows","Box · Grid · Eyebrow":"box-grid-eyebrow","Steps · Across":"steps-across","Steps · List":"steps-list","Steps · Staircase":"staircase","Steps · Funnel":"funnel","Steps · Pyramid":"pyramid","Steps · Ring":"ring","Steps · Road":"road","Steps · Climb":"climb","Steps · Core":"core",Timeline:"timeline","Stat row":"stats",Table:"table","Diagram · Flowchart":"diagram-flow","Diagram · Org chart":"diagram-org","Diagram · Sequence":"diagram-sequence","Diagram · States":"diagram-state","Diagram · Mind map":"diagram-mindmap","Diagram · Entities":"diagram-entity","Diagram · Kanban":"diagram-kanban","Diagram · Blocks":"diagram-blocks","Diagram · Quadrant":"diagram-quadrant","Diagram · Timeline":"diagram-timeline","Diagram · Venn":"diagram-venn","Diagram · Gantt":"diagram-gantt","Diagram · Swimlanes":"diagram-swimlanes","Diagram · Tree view":"diagram-treeview","Diagram · Cynefin":"diagram-cynefin","Diagram · Architecture":"diagram-architecture","Chart · Column":"chart-column","Chart · Bar":"chart-bar","Chart · Line":"chart-line","Chart · Area":"chart-area","Chart · Pie":"chart-pie","Chart · Donut":"chart-donut","Chart · Waterfall":"chart-waterfall","Chart · Heatmap":"chart-heatmap",Image:"image","Image grid":"image-grid","Image with text":"image-text",People:"people",YouTube:"youtube","Two columns":"cols-2","Three columns":"cols-3","Four columns":"cols-4","Five columns":"cols-5"},ya={"Side line":"accent-bar",Filled:"soft-fill",Outline:"outlined","Top line":"top-rule",Accent:"solid-accent",Leaf:"leaf-corner","Raised card":"raised-card","Filled side line":"side-rule","Gradient card":"gradient-card",Marked:"marked",Banded:"banded","Header band":"header-band","Accent header":"accent-header"};function Vu(e){const t=e.split(" · ");let n=null,o=null,r=null;const s=[];for(const i of t)ya[i]?n=ya[i]:i==="with icons"?o="icon":i==="no icons"?r=!1:s.push(i);return{base:s.join(" · "),look:n,markKind:o,icons:r}}function dw(e){const{base:t,look:n,markKind:o,icons:r}=Vu(e),s=uw[t];if(!s)throw new Error(`no drawing for base ${t} (from ${e})`);return{drawing:s,look:n,markKind:o,icons:r}}const Wu=[["Text",[["Text",["Text · Normal text","Heading"]],["Lists",["Bullets","Numbered","Checklist"]],["Other",["Quote","Code","Separator"]]]],["Blocks",[["Boxes",["Box · Grid","Box · Grid · Side line","Box · Grid · Filled","Box · Grid · Outline","Box · Grid · Top line","Box · Grid · Accent","Box · Grid · Leaf","Box · Grid · no icons","Box · Grid · Eyebrow","Box · Grid · Accent header · no icons","Box · Grid · Eyebrow · Accent header","Box · List","Box · List · Side line","Box · List · Filled","Box · List · no icons"]],["Steps",["Steps · Across","Steps · Across · with icons","Steps · Across · Side line","Steps · Across · Filled","Steps · Across · Outline","Steps · Across · Top line","Steps · Across · Accent","Steps · Across · Marked","Steps · List","Steps · Staircase","Steps · Staircase · with icons","Steps · Funnel","Steps · Funnel · with icons","Steps · Pyramid","Steps · Pyramid · with icons","Steps · Ring","Steps · Ring · with icons"]],["Timeline",["Timeline","Timeline · with icons","Timeline · Filled","Timeline · Outline","Timeline · Accent","Timeline · Marked"]],["Numbers",["Stat row","Stat row · Side line","Stat row · Filled","Stat row · Outline","Stat row · Top line","Stat row · Accent"]],["Table",["Table","Table · Banded","Table · Header band"]]]],["Charts",[["Charts",["Chart · Column","Chart · Bar","Chart · Line","Chart · Area","Chart · Pie","Chart · Donut","Chart · Waterfall","Chart · Heatmap"]]]],["Diagrams",[["Diagrams",["Diagram · Blocks","Diagram · Flowchart","Diagram · Org chart","Diagram · Kanban","Diagram · Timeline","Diagram · Quadrant","Diagram · Venn","Diagram · Gantt","Diagram · Mind map","Diagram · Swimlanes","Diagram · Tree view","Diagram · Cynefin","Diagram · Architecture","Diagram · Sequence","Diagram · Entities","Diagram · States"]]]],["Figures",[["Journey",["Steps · Road","Steps · Road · with icons"]],["Ascent",["Steps · Climb","Steps · Climb · with icons"]],["Layers",["Steps · Core","Steps · Core · with icons"]]]],["Media",[["Images",["Image","Image grid","Image with text","Image with text · Filled"]],["People",["People","People · Filled","People · Outline","People · Raised card","People · Leaf"]],["YouTube",["YouTube"]]]],["Layout",[["Columns",["Two columns","Three columns","Four columns","Five columns"]]]]],fw=["Text · Normal text","Heading","Bullets","Numbered","Checklist","Quote","Code","Separator","Box · Grid","Steps · Across","Timeline","Stat row","Table","Chart · Column","Diagram · Blocks","Image","Image grid","Image with text","People","YouTube"],pw={"Text · Normal text":{type:"text",arrangement:"md"},Heading:{type:"heading"},Bullets:{type:"bullets"},Numbered:{type:"numbered"},Checklist:{type:"checklist"},Quote:{type:"quote"},Code:{type:"code"},Separator:{type:"separator"},"Box · Grid":{type:"box",arrangement:"grid"},"Box · List":{type:"box",arrangement:"list"},"Box · Grid · Eyebrow":{type:"box",arrangement:"grid",starter:"eyebrow",iconPosition:"lead"},"Steps · Across":{type:"steps",arrangement:"across"},"Steps · List":{type:"steps",arrangement:"list"},"Steps · Staircase":{type:"steps",arrangement:"staircase"},"Steps · Funnel":{type:"steps",arrangement:"funnel"},"Steps · Pyramid":{type:"steps",arrangement:"pyramid"},"Steps · Ring":{type:"steps",arrangement:"ring"},"Steps · Road":{type:"steps",figure:"road"},"Steps · Climb":{type:"steps",figure:"climb"},"Steps · Core":{type:"steps",figure:"core"},Timeline:{type:"timeline"},"Stat row":{type:"stat-row"},Table:{type:"table"},"Diagram · Flowchart":{type:"diagram",starter:"flowchart"},"Diagram · Org chart":{type:"diagram",starter:"orgchart"},"Diagram · Sequence":{type:"diagram",starter:"sequence"},"Diagram · States":{type:"diagram",starter:"state"},"Diagram · Mind map":{type:"diagram",starter:"mindmap"},"Diagram · Entities":{type:"diagram",starter:"entity"},"Diagram · Kanban":{type:"diagram",starter:"kanban"},"Diagram · Blocks":{type:"diagram",starter:"block"},"Diagram · Quadrant":{type:"diagram",starter:"quadrant"},"Diagram · Timeline":{type:"diagram",starter:"timeline"},"Diagram · Venn":{type:"diagram",starter:"venn"},"Diagram · Gantt":{type:"diagram",starter:"gantt"},"Diagram · Swimlanes":{type:"diagram",starter:"swimlanes"},"Diagram · Tree view":{type:"diagram",starter:"treeview"},"Diagram · Cynefin":{type:"diagram",starter:"cynefin"},"Diagram · Architecture":{type:"diagram",starter:"architecture"},"Chart · Column":{type:"chart",arrangement:"column"},"Chart · Bar":{type:"chart",arrangement:"bar"},"Chart · Line":{type:"chart",arrangement:"line"},"Chart · Area":{type:"chart",arrangement:"area"},"Chart · Pie":{type:"chart",arrangement:"pie"},"Chart · Donut":{type:"chart",arrangement:"donut"},"Chart · Waterfall":{type:"chart",arrangement:"waterfall"},"Chart · Heatmap":{type:"chart",arrangement:"heatmap"},Image:{type:"image"},"Image grid":{type:"image-grid"},"Image with text":{type:"image-with-text"},People:{type:"people"},YouTube:{type:"youtube"},"Two columns":{layout:"two-cols"},"Three columns":{layout:"three-cols"},"Four columns":{layout:"four-cols"},"Five columns":{layout:"five-cols"}};function hw(e){const{base:t,look:n,markKind:o,icons:r}=Vu(e),s=pw[t];if(!s)throw new Error(`no block for base ${t} (from ${e})`);return{...s,variant:n,mark:o,iconPosition:s.iconPosition??(r===!1?"none":null)}}const xn=Wu.flatMap(([e,t])=>t.flatMap(([n,o])=>o.map(r=>{var l,u;const s=hw(r),i=s.type?Wn(s.type):void 0,a=cw[r],c=`${a} ${r} ${s.type??s.layout}`.toLowerCase();return{key:r,kind:s.layout?"layout":Bu(s).any?"preset":"block",shelf:e,section:n,group:"",label:a,svg:lw(dw(r)),name:c,hint:((i==null?void 0:i.description)??((l=ii.find(f=>f.name===s.layout))==null?void 0:l.whenToUse)??"").replace(/\.$/,""),search:`${c} ${(i==null?void 0:i.description)??((u=ii.find(f=>f.name===s.layout))==null?void 0:u.whenToUse)??""}`.toLowerCase(),core:fw.includes(r),insert:s}}))),gw=10,mw=Wu.flatMap(([e,t])=>{const n=t.reduce((r,[,s])=>r+s.length,0),o=r=>r.map(s=>xn.find(i=>i.key===s));return n>gw?t.map(([r,s])=>({group:r,tiles:o(s)})):[{group:e,tiles:t.flatMap(([,r])=>o(r))}]});for(const{group:e,tiles:t}of mw)for(const n of t)n.group=e;const bw=xn.filter(e=>e.core);function yw(e){const t=e.trim().toLowerCase();return t?xn.filter(n=>n.search.includes(t)):xn}function xw(e){const t=e.trim().toLowerCase();if(!t)return xn;const n=xn.filter(o=>o.name.includes(t));return n.length?n:yw(t)}const ho={open:!1,items:[],active:0,rect:null,query:"",run:()=>{}};function Gu(e){const{$from:t}=e.state.selection;for(let n=t.depth;n>=0;n--){const o=t.node(n);if(o.type.name==="page")return o.attrs.id??null}return null}function vw(e){const{$from:t}=e.state.selection;for(let n=t.depth;n>=0;n--){const o=t.node(n);if(o.type.name==="layoutRegion"||o.type.name==="page")return o.attrs.id??null}return null}function ww(e,t){var o;const{$from:n}=e.state.selection;for(let r=n.depth;r>0;r--){const s=n.node(r-1);if(((o=s.attrs)==null?void 0:o.id)!==t)continue;const i=n.index(r-1);let a;return s.forEach((c,l,u)=>{var f;u===i+1&&!a&&(a=((f=c.attrs)==null?void 0:f.id)??void 0)}),a}}function kw(e,t){return t.layout?Gu(e):vw(e)}const Sw=e=>{const t=e.trim();return(t?xw(t):bw).map(o=>({pick:o,group:o.group,hint:t?"":o.hint}))};function zk(){let e=ho;const t=new Set,n=r=>{e=r,t.forEach(s=>s(r))};return{extension:jd.create({name:"decaframeSlash",addProseMirrorPlugins(){const r=this.editor;return[W0({editor:r,char:"/",startOfLine:!1,items:({query:s})=>Sw(s),command:({editor:s,range:i,props:a})=>{const c=kw(s,a.pick.insert);if(!c)return;const l=ww(s,c);s.chain().focus().deleteRange(i).run(),ow(s,c,a.pick.insert,l)},render:()=>({onStart:s=>{var i;n({open:!0,items:s.items,active:0,rect:((i=s.clientRect)==null?void 0:i.call(s))??null,query:s.query,run:a=>s.command(a)})},onUpdate:s=>{var i;n({open:!0,items:s.items,active:0,rect:((i=s.clientRect)==null?void 0:i.call(s))??null,query:s.query,run:a=>s.command(a)})},onKeyDown:({event:s})=>{if(!e.open)return!1;if(s.key==="Escape")return n(ho),!0;if(s.key==="ArrowDown"||s.key==="ArrowUp"){const i=e.items.length;if(!i)return!1;const a=s.key==="ArrowDown"?1:-1;return n({...e,active:(e.active+a+i)%i}),!0}if(s.key==="Enter"){const i=e.items[e.active];return i?(e.run(i),n(ho),!0):!1}return!1},onExit:()=>n(ho)})})]}}),get:()=>e,subscribe(r){return t.add(r),r(e),()=>t.delete(r)}}}const Rw=112;function Hk(e){var l;const t=d.useCallback(()=>{const u=[];return e.state.doc.forEach((f,p,g)=>{var h,w,m;f.type.name==="page"&&u.push({id:f.attrs.id,title:((h=La(f).title)==null?void 0:h.trim())||"Untitled page",index:g,mode:f.attrs.mode??null,accent:f.attrs.accent??null,surface:f.attrs.surface??null,accentSrc:((w=f.firstChild)==null?void 0:w.type.name)==="pageAccent"?f.firstChild.attrs.src??null:null,accentId:((m=f.firstChild)==null?void 0:m.type.name)==="pageAccent"?f.firstChild.attrs.id??null:null,notes:f.attrs.notes??null,footer:f.attrs.footer??null,furniture:f.attrs.furniture??null})}),u},[e]),n=d.useCallback(()=>{const u=e.state.doc.attrs;return{title:u.title??"",format:u.format??"16:9",align:u.align??"middle",autoFit:u.autoFit!==!1,theme:u.theme??"decaframe",mode:u.mode??"light",footer:u.footer??"",footerLogo:u.footerLogo??"",footerLogoWide:!!u.footerLogoWide,footerNumbers:!!u.footerNumbers}},[e]),[o,r]=d.useState(t),[s,i]=d.useState(n),[a,c]=d.useState(null);return d.useEffect(()=>{const u=()=>{r(t()),i(n()),c(Gu(e))};return u(),e.on("transaction",u),e.on("selectionUpdate",u),()=>{e.off("transaction",u),e.off("selectionUpdate",u)}},[e,t,n]),{pages:o,doc:s,current:a??((l=o[0])==null?void 0:l.id)??null}}function Vk(e,t){const[n,o]=d.useState(null);return d.useEffect(()=>{if(!t)return;let r=0;const s=()=>{r=0;const a=window.innerHeight;let c=null,l=0;e.state.doc.forEach((u,f)=>{if(u.type.name!=="page")return;const p=u.attrs.id,g=p?e.view.nodeDOM(f):null;if(!p||!(g instanceof HTMLElement))return;const h=g.getBoundingClientRect(),w=Math.min(h.bottom,a)-Math.max(h.top,0);w>l&&(l=w,c=p)}),l>0&&o(u=>u===c?u:c)},i=()=>{r||(r=requestAnimationFrame(s))};return s(),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i),e.on("transaction",i),()=>{r&&cancelAnimationFrame(r),window.removeEventListener("scroll",i),window.removeEventListener("resize",i),e.off("transaction",i)}},[e,t]),n}function Ew({onSelect:e}){const[t,n]=d.useState(!1),o=d.useRef(!1);return k.jsx(Fo,{label:"Add a page from…",align:"end",open:t,onOpenChange:r=>{n(r),!r&&o.current&&(o.current=!1,e())},items:[{label:"From template…",icon:"LayoutPanelLeft",onSelect:()=>{o.current=!0}}],trigger:k.jsx("button",{className:"df-rail-new-more","aria-label":"Add a page from…",onClick:()=>n(!0),children:k.jsx(Ye,{name:"ChevronDown",size:13})})})}function xa(e,t){const n=new Set;if(e.state.doc.forEach(r=>{r.attrs.id&&n.add(r.attrs.id)}),!t())return;let o=null;e.state.doc.forEach(r=>{const s=r.attrs.id;s&&!n.has(s)&&(o=s)}),o&&xo(e,o)}const va=(e,t)=>{var o;const n=e.findIndex(r=>r.id===t);return n<0||(o=e[n+1])==null?void 0:o.id},xo=(e,t,n)=>{let o=null,r=0;if(e.state.doc.forEach((a,c)=>{a.attrs.id===t&&(o=c,r=a.nodeSize)}),o===null)return;const s=Da.near(e.state.doc.resolve(o+1),1);s.from>o&&s.from<o+r&&((n==null?void 0:n.focus)===!1?e.commands.setTextSelection(s.from):e.chain().focus(s.from,{scrollIntoView:!1}).run());const i=e.view.nodeDOM(o);i instanceof HTMLElement&&i.scrollIntoView({block:"center",behavior:"smooth"})},Cw=(e,t,n)=>[{label:"Add page after",onSelect:()=>{var o;return e.commands.addPage({before:(o=t[n.index+1])==null?void 0:o.id,title:"New page"})}},{label:"Move up",disabled:n.index===0,onSelect:()=>ka(e,t,n.index,n.index-1)},{label:"Move down",disabled:n.index===t.length-1,onSelect:()=>ka(e,t,n.index,n.index+1)},{label:"Delete page",separatorBefore:!0,danger:!0,disabled:t.length<=1,onSelect:()=>e.commands.removePage(n.id)}],Tw=4,wa=30,Mw=10;function Wk({editor:e,pages:t,current:n,viewing:o,closing:r,onHide:s,onTemplates:i}){const a=d.useRef(null),[c,l]=d.useState(null),[u,f]=d.useState(null),[p,g]=d.useState(null),h=d.useRef(!1),w=d.useRef(null),m=()=>{var y;return Array.from(((y=a.current)==null?void 0:y.querySelectorAll(".df-rail-item"))??[])},b=y=>{var R;const C=t[y];C&&((R=m()[y])==null||R.focus(),l(C.id),xo(e,C.id,{focus:!1}))},x=y=>{const C=t[y];!C||t.length<=1||(w.current=Math.min(y,t.length-2),e.commands.removePage(C.id))};d.useEffect(()=>{var R,O;const y=w.current;if(y===null)return;w.current=null;const C=t[y];C&&((O=(R=a.current)==null?void 0:R.querySelectorAll(".df-rail-item")[y])==null||O.focus(),l(C.id),xo(e,C.id,{focus:!1}))},[t,e]),d.useEffect(()=>{n&&l(n)},[n]),d.useEffect(()=>{if(!c)return;if(o===c){l(null);return}const y=()=>l(null),C=["scrollend","wheel","touchmove"];for(const R of C)window.addEventListener(R,y,{passive:!0,once:!0});return()=>{for(const R of C)window.removeEventListener(R,y)}},[c,o]);const S=y=>{const C=y.target.closest(".df-rail-item");if(!C)return;const R=Number(C.dataset.index);Number.isInteger(R)&&(y.key==="ArrowDown"||y.key==="ArrowUp"?(y.preventDefault(),b(R+(y.key==="ArrowDown"?1:-1))):y.key==="Home"||y.key==="End"?(y.preventDefault(),b(y.key==="Home"?0:t.length-1)):(y.key==="Delete"||y.key==="Backspace")&&(y.preventDefault(),x(R)))},v=y=>{if(y.button!==0)return;const C=y.target;if(C.closest(".df-rail-seam"))return;const R=C.closest(".df-rail-item"),O=a.current,P=R==null?void 0:R.dataset.pageId;if(!R||!O||!P)return;const j=y.clientY;let L=!1,$=y.clientX,T=y.clientY,M=0;const N=()=>hb(m().map(B=>B.getBoundingClientRect()),t.map(B=>B.id),P,$,T),D=()=>{const B=N();f(B?B.y-O.getBoundingClientRect().top+O.scrollTop:null)},A=()=>{const B=O.getBoundingClientRect(),V=T<B.top+wa?-1:T>B.bottom-wa?1:0;V&&(O.scrollTop+=V*Mw,D()),M=requestAnimationFrame(A)},F=B=>{if($=B.clientX,T=B.clientY,!L){if(Math.abs(T-j)<Tw)return;L=!0,h.current=!0,g({id:P,x:B.clientX,y:B.clientY}),M=requestAnimationFrame(A)}D()},I=B=>{if(window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",I),M&&cancelAnimationFrame(M),g(null),f(null),!L)return;$=B.clientX,T=B.clientY;const V=N();V&&V.order.some((re,se)=>{var G;return re!==((G=t[se])==null?void 0:G.id)})&&e.commands.reorderPages(V.order),setTimeout(()=>{h.current=!1})};window.addEventListener("pointermove",F),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",I)},E=c??o??n;return d.useEffect(()=>{const y=a.current,C=t.findIndex(L=>L.id===E),R=C<0?null:y==null?void 0:y.querySelectorAll(".df-rail-item")[C];if(!y||!R)return;const O=y.getBoundingClientRect(),P=R.getBoundingClientRect(),j=8;P.top<O.top+j?y.scrollTop-=O.top+j-P.top:P.bottom>O.bottom-j&&(y.scrollTop+=P.bottom-(O.bottom-j))},[E,t]),k.jsxs("aside",{className:"df-panel df-rail","data-closing":r||void 0,"aria-hidden":r||void 0,"aria-label":"Pages",children:[k.jsxs("header",{className:"df-panel-head",children:[k.jsx("button",{className:"df-rail-toggle","aria-label":"Hide the page list","aria-expanded":"true",onClick:s,children:k.jsx(Ye,{name:"Film",size:15})}),k.jsx("span",{children:"Pages"}),k.jsx("span",{className:"df-count",children:t.length})]}),k.jsxs("div",{className:"df-rail-new",children:[k.jsxs("button",{className:"df-rail-new-main",onClick:()=>xa(e,()=>e.commands.addPage({before:va(t,n),title:"New page"})),children:[k.jsx(Ye,{name:"Plus",size:14}),k.jsx("span",{children:"New page"})]}),k.jsx(Ew,{onSelect:()=>i(va(t,n))})]}),k.jsxs("div",{className:"df-rail-list",ref:a,role:"listbox","aria-label":"Pages","aria-orientation":"vertical","data-dragging":(p==null?void 0:p.id)||void 0,onPointerDown:v,onKeyDown:S,children:[t.map(y=>{var C;return k.jsxs("div",{className:"df-rail-row",children:[k.jsx(Kv,{label:`Page ${y.index+1} options`,items:Cw(e,t,y),children:k.jsxs("button",{className:"df-rail-item",role:"option","aria-selected":y.id===E,"data-current":y.id===E||void 0,"data-carried":y.id===(p==null?void 0:p.id)||void 0,"data-index":y.index,"data-page-id":y.id,tabIndex:y.id===(E??((C=t[0])==null?void 0:C.id))?0:-1,onClick:R=>{h.current||(l(y.id),xo(e,y.id,{focus:!1}),R.currentTarget.focus())},children:[k.jsx(vc,{editor:e,pageId:y.id,width:Rw}),k.jsx("span",{className:"df-rail-num",children:String(y.index+1).padStart(2,"0")})]})}),k.jsxs("div",{className:"df-rail-seam",children:[k.jsx("button",{className:"df-rail-seam-btn","aria-label":`Insert a blank page after ${y.index+1}`,onClick:()=>xa(e,()=>{var R;return e.commands.addPage({before:(R=t[y.index+1])==null?void 0:R.id,title:"New page"})}),children:k.jsx(Ye,{name:"Plus",size:11})}),k.jsx("button",{className:"df-rail-seam-btn","aria-label":`Insert a page from a template after ${y.index+1}`,onClick:()=>{var R;return i((R=t[y.index+1])==null?void 0:R.id)},children:k.jsx(Ye,{name:"LayoutPanelLeft",size:11})})]})]},y.id)}),u!==null&&k.jsx("div",{className:"df-rail-drop",style:{top:u},"aria-hidden":"true"})]}),p&&pt.createPortal(k.jsx(Pw,{id:p.id,x:p.x,y:p.y}),document.body)]})}function Pw({id:e,x:t,y:n}){const o=d.useRef(null);return d.useLayoutEffect(()=>{const r=o.current,s=document.querySelector(`.df-rail-item[data-page-id="${e}"]`);if(!r||!s)return;const i=s.cloneNode(!0);return i.removeAttribute("data-carried"),i.removeAttribute("tabindex"),i.style.width=`${s.offsetWidth}px`,r.style.width=`${s.offsetWidth}px`,r.replaceChildren(i),()=>r.replaceChildren()},[e]),d.useLayoutEffect(()=>{const r=o.current;if(r)return M0(r,t,n)},[t,n]),k.jsx("div",{className:"df-preview df-rail-ghost",ref:o,"aria-hidden":"true"})}function ka(e,t,n,o){const r=t.map(i=>i.id),[s]=r.splice(n,1);r.splice(o,0,s),e.commands.reorderPages(r)}const Gk=({onShow:e})=>k.jsx(Xv,{label:"Show the page list",side:"right",children:k.jsx("button",{className:"df-rail-show","aria-label":"Show the page list","aria-expanded":"false",onClick:e,children:k.jsx(Ye,{name:"Film",size:15})})}),Ow=["none","top","lead","trail","full"],Iw=["default","subtle","muted","accent"],Aw=["document","custom","hidden"];function qk({editor:e,page:t,open:n,onClose:o,onFrameAccent:r}){const[s,i]=d.useState(null);return k.jsx(Eu,{open:n,onClose:o,title:"Page",badge:t?String(t.index+1).padStart(2,"0"):"—",closeLabel:"Hide page settings",className:"df-drawer df-page-panel",children:t?k.jsxs("div",{className:"df-fields",children:[k.jsxs(Ln,{label:"Accent",children:[k.jsx(rt,{label:"Position",stack:!0,children:k.jsx(Fn,{value:t.accent??"none",options:Ow,onChange:a=>e.commands.setAccent(t.id,{position:a==="none"?null:a})})}),t.accent?k.jsxs(rt,{label:"Image",stack:!0,children:[k.jsx(qr,{type:"url",placeholder:"https://…","aria-label":"The accent picture's address",defaultValue:t.accentSrc??"",onBlur:a=>{const c=a.target.value.trim(),l=c?Bd(c,"image"):null;i(l),l||e.commands.setAccent(t.id,{src:c||null})}},`${t.id}:${t.accentSrc??""}`),s?k.jsx("p",{className:"df-empty",children:s}):null]}):null,t.accent&&t.accentSrc&&t.accentId?k.jsx(rt,{label:"Framing",stack:!0,children:k.jsx(st,{variant:"outline",size:"sm",onClick:()=>r(t.accentId),children:"Move and zoom"})}):null,k.jsx(rt,{label:"Plane",stack:!0,children:k.jsx(Fn,{value:t.surface??"default",options:Iw,onChange:a=>e.commands.setPage(t.id,{surface:a==="default"?null:a})})})]}),k.jsx(Ln,{label:"Heading",children:Yr.map(a=>k.jsx(rt,{label:a.label,children:k.jsx($w,{editor:e,page:t,slot:a.name})},a.name))}),k.jsxs(Ln,{label:"Footer",children:[k.jsx(rt,{label:"This page",stack:!0,children:k.jsx(Fn,{value:t.furniture==="off"?"hidden":t.footer===null?"document":"custom",options:Aw,onChange:a=>e.commands.setPage(t.id,{furniture:a==="hidden"?"off":null,footer:a==="custom"?t.footer??"":null})})}),t.furniture!=="off"&&t.footer!==null?k.jsx(rt,{label:"Words",stack:!0,children:k.jsx(qr,{value:t.footer,placeholder:"What this page says",onChange:a=>e.commands.setPage(t.id,{footer:a.target.value}),"aria-label":"This page's footer words"})}):null]})]}):k.jsx("p",{className:"df-empty",children:"Click into a page to edit its frame."})})}function Fn({value:e,options:t,onChange:n}){return k.jsx(y0,{size:"sm",variant:"outline",spacing:0,value:[e],onValueChange:o=>{const r=o[0];r&&n(r)},className:"df-segment",children:t.map(o=>k.jsx(x0,{value:o,"aria-label":o,"data-active":e===o||void 0,children:o},o))})}const Yr=[{name:"eyebrow",label:"Eyebrow",seed:"Eyebrow"},{name:"title",label:"Title",seed:"Page title"},{name:"subtitle",label:"Subtitle",seed:"Subtitle"}];function $w({editor:e,page:t,slot:n}){const o=(()=>{let r=!1;return e.state.doc.forEach(s=>{s.attrs.id===t.id&&(r=La(s)[n]!==void 0)}),r})();return k.jsx(Ur,{className:"df-toggle",checked:o,onCheckedChange:r=>e.commands.setPage(t.id,{[n]:r?Yr.find(s=>s.name===n).seed:""}),"aria-label":Yr.find(r=>r.name===n).label})}function Nw({editor:e,title:t}){const[n,o]=d.useState(null),r=d.useRef(null),s=d.useRef(!1),i=d.useRef(!1);d.useEffect(()=>{var l;n===null&&i.current&&(i.current=!1,(l=r.current)==null||l.focus())},[n]);const a=()=>{if(s.current){s.current=!1,o(null);return}const l=(n??"").trim();l!==t&&e.commands.setDocument({title:l}),o(null)};if(n!==null)return k.jsx("input",{className:"df-doc-title-input",value:n,autoFocus:!0,"aria-label":"The document's name",placeholder:ai().name??zd,onChange:l=>o(l.target.value),onBlur:a,onFocus:l=>l.currentTarget.select(),onKeyDown:l=>{l.key==="Enter"?(l.preventDefault(),i.current=!0,a()):l.key==="Escape"&&(l.preventDefault(),i.current=!0,s.current=!0,o(null))}});const c=Hd(t,ai().name);return k.jsxs("button",{ref:r,type:"button",className:"df-doc-title",title:c,"aria-label":`Rename document — ${c}`,onClick:()=>{s.current=!1,o(t)},children:[k.jsx("span",{className:"df-doc-title-text",children:c}),k.jsx("span",{className:"df-doc-title-pencil",children:k.jsx(Ye,{name:"Pencil",size:12})})]})}function Uk({editor:e,doc:t,onDocument:n,onThemes:o,onPresent:r,onExport:s,currentIndex:i}){return k.jsxs("div",{className:"df-toolbar",children:[k.jsx("span",{className:"df-brand","aria-hidden":"true",children:k.jsx("svg",{viewBox:Yd,width:"28",height:"15.75",fill:"currentColor",children:k.jsx("path",{fillRule:"evenodd",d:Kd})})}),k.jsx(Fo,{label:"Document menu",align:"start",trigger:k.jsx(st,{variant:"ghost",size:"icon-sm",className:"df-icon-btn df-burger",children:k.jsx(Ye,{name:"Menu",size:15})}),items:[{label:"Document properties",onSelect:n}]}),k.jsx(Nw,{editor:e,title:t.title}),k.jsx("span",{className:"df-spacer"}),k.jsxs("span",{className:"df-actions",children:[k.jsx("button",{className:"df-toolbar-btn df-theme-btn","aria-label":"Theme",title:"Theme",onClick:o,children:k.jsx(Ye,{name:"SwatchBook",size:16})}),k.jsxs("span",{className:"df-split",children:[k.jsxs(st,{variant:"outline",size:"sm",className:"df-pill df-split-main","aria-label":"Present",title:`Present (${n0}⏎)`,onClick:()=>r({at:i,fullscreen:!0}),children:[k.jsx(Ye,{name:"Play",size:14}),"Present"]}),k.jsx(Fo,{label:"Presenting options",align:"end",trigger:k.jsx(st,{variant:"outline",size:"sm",className:"df-pill df-split-caret","aria-label":"Presenting options",children:k.jsx(Ye,{name:"ChevronDown",size:14})}),items:[{label:"Presenter view",onSelect:()=>{r({at:i,fullscreen:!1}),Tu(i)}},{label:"Start from beginning",separatorBefore:!0,onSelect:()=>r({at:0,fullscreen:!0})}]})]}),k.jsx("button",{className:"df-toolbar-btn df-export-btn","aria-label":"Export",title:s?"Export":"Export needs the MCP channel running (pnpm loop)",disabled:!s,onClick:s,children:k.jsx(Ye,{name:"Share2",size:16})})]})]})}function Yk({editor:e,doc:t,open:n,onClose:o}){const[r,s]=d.useState(null),i=d.useRef(null),a=c=>{if(!c)return;const l=new FileReader;l.onload=()=>{const u=String(l.result??""),f=ci(u);if(f){s(f);return}const p=new Image;p.onload=()=>{const g=Vd(p.naturalWidth,p.naturalHeight);if(g){s(g);return}const h=Wd(p.naturalWidth,p.naturalHeight);if(!Gd(u.length)){s(null),e.commands.setDocument({footerLogo:u,footerLogoWide:h});return}const w=qd(p.naturalWidth,p.naturalHeight),m=document.createElement("canvas");m.width=w.w,m.height=w.h;const b=m.getContext("2d");if(!b){s("That picture could not be resized to fit the footer.");return}b.drawImage(p,0,0,w.w,w.h);const x=m.toDataURL("image/png"),S=ci(x);s(S),S||e.commands.setDocument({footerLogo:x,footerLogoWide:h})},p.onerror=()=>s("That file could not be read as a picture."),p.src=u},l.onerror=()=>s("That file could not be opened."),l.readAsDataURL(c)};return k.jsx(Eu,{open:n,onClose:o,title:"Document",closeLabel:"Hide document properties",className:"df-drawer df-doc-panel",children:k.jsxs("div",{className:"df-fields",children:[k.jsxs(Ln,{label:"Frame",children:[k.jsx(rt,{label:"Shape",children:k.jsx(Fn,{value:t.format,options:Fd,onChange:c=>e.commands.setDocument({format:c})})}),k.jsx(rt,{label:"Content",children:k.jsx(Fn,{value:t.align,options:_d,onChange:c=>e.commands.setDocument({align:c})})}),k.jsx(rt,{label:"Scale to fit",children:k.jsx(Ur,{className:"df-toggle",checked:t.autoFit,onCheckedChange:c=>e.commands.setDocument({autoFit:c}),"aria-label":"Scale a page's content down until it fits the frame"})})]}),k.jsxs(Ln,{label:"Footer",children:[k.jsx(rt,{label:"Words",stack:!0,children:k.jsx(qr,{value:t.footer,placeholder:"Acme · Confidential",onChange:c=>e.commands.setDocument({footer:c.target.value}),"aria-label":"The footer's words"})}),k.jsx(rt,{label:"Mark",stack:!0,children:k.jsxs("div",{className:"df-mark-row",children:[t.footerLogo?k.jsx("span",{className:"df-mark-preview",children:k.jsx("img",{src:t.footerLogo,alt:""})}):null,k.jsxs("span",{className:"df-mark-actions",children:[k.jsx(st,{variant:"outline",size:"sm",onClick:()=>{var c;return(c=i.current)==null?void 0:c.click()},children:t.footerLogo?"Replace":"Choose a picture"}),t.footerLogo?k.jsx(st,{variant:"ghost",size:"sm",onClick:()=>{s(null),e.commands.setDocument({footerLogo:"",footerLogoWide:!1})},children:"Remove"}):null]}),k.jsx("input",{ref:i,className:"df-visually-hidden",type:"file",accept:"image/png,image/jpeg,image/gif,image/webp,image/avif,image/svg+xml",onChange:c=>{var l;return a((l=c.target.files)==null?void 0:l[0])},"aria-label":"The footer's mark"})]})}),k.jsx(rt,{label:"Page numbers",children:k.jsx(Ur,{className:"df-toggle",checked:t.footerNumbers,onCheckedChange:c=>e.commands.setDocument({footerNumbers:c}),"aria-label":"Number the pages"})})]}),r?k.jsx("p",{className:"df-empty",children:r}):null]})})}function Kk({outcome:e,onOpenChange:t}){return k.jsx(v0,{open:e!==null,onOpenChange:t,children:k.jsxs(S0,{className:"sm:max-w-md",children:[k.jsxs(R0,{children:[k.jsx(C0,{children:e!=null&&e.error?"Export failed":"Exported, with a warning"}),k.jsx(T0,{children:e!=null&&e.error?e.error:"The file downloaded. Not everything in it resolved:"})]}),!(e!=null&&e.error)&&k.jsxs("div",{className:"flex flex-col gap-2 text-sm text-foreground",children:[(e==null?void 0:e.themeFallback)&&k.jsxs("p",{children:["Theme ‘",e.themeFallback,"’ did not resolve — exported with the default."]}),e!==null&&e.missingImages.length>0&&k.jsxs("div",{children:[k.jsxs("p",{children:[e.missingImages.length," picture(s) missing, shown as a placeholder in the file:"]}),k.jsx("ul",{className:"list-disc pl-5",children:e.missingImages.map((n,o)=>k.jsx("li",{children:n},o))})]})]}),k.jsx(E0,{showCloseButton:!0})]})})}export{zw as $,Jw as A,st as B,Ek as C,v0 as D,Kf as E,Ck as F,Ye as G,Sk as H,pt as I,je as J,Ev as K,oc as L,Fo as M,kk as N,ck as O,Cu as P,lk as Q,Jd as R,Em as S,qr as T,Ak as U,Nk as V,mw as W,ow as X,Yv as Y,Bw as Z,Vw as _,_w as a,Yw as a$,gb as a0,xa as a1,bk as a2,Co as a3,Ar as a4,Lk as a5,ba as a6,Hu as a7,Hw as a8,Xw as a9,K0 as aA,Q0 as aB,ik as aC,uk as aD,gk as aE,fk as aF,ak as aG,dk as aH,pk as aI,Ur as aJ,hk as aK,mk as aL,ek as aM,Au as aN,sk as aO,ok as aP,rk as aQ,tk as aR,zk as aS,Uw as aT,xo as aU,Vk as aV,Kw as aW,Uk as aX,Kk as aY,Wk as aZ,Gk as a_,xk as aa,Ww as ab,Xv as ac,Dk as ad,wk as ae,vk as af,Gw as ag,_k as ah,yw as ai,xn as aj,ww as ak,Eu as al,Ru as am,kw as an,Wu as ao,jk as ap,Bk as aq,q0 as ar,J0 as as,U0 as at,Ln as au,yk as av,rt as aw,Du as ax,X0 as ay,Js as az,vc as b,Yk as b0,qk as b1,J as c,S0 as d,R0 as e,C0 as f,T0 as g,E0 as h,M0 as i,$k as j,nk as k,Pk as l,qw as m,Fw as n,Qw as o,ew as p,Ok as q,d as r,Rk as s,iw as t,Hk as u,Fk as v,Ik as w,Mk as x,Zw as y,Tk as z};