cortex-react-components 2.20.1 → 2.22.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 (173) hide show
  1. package/dist/{chunk-MGSTQLZC.mjs → chunk-255P6K5W.mjs} +1 -1
  2. package/dist/{chunk-6FHRZHAJ.mjs → chunk-2HWSTGAP.mjs} +1 -1
  3. package/dist/{chunk-R33MOMFK.mjs → chunk-2RQDJ5XT.mjs} +1 -1
  4. package/dist/{chunk-UPRS7OYQ.mjs → chunk-2UNIT7NC.mjs} +1 -1
  5. package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
  6. package/dist/{chunk-CTC6WSB6.mjs → chunk-5SHZBJ5R.mjs} +1 -1
  7. package/dist/{chunk-CCJJAUGB.mjs → chunk-5WVFEIMC.mjs} +1 -1
  8. package/dist/{chunk-QZIJTAPO.mjs → chunk-62A35O55.mjs} +1 -1
  9. package/dist/{chunk-HLTP3ZQN.mjs → chunk-67QPOSVV.mjs} +1 -1
  10. package/dist/{chunk-VDFRWGXR.mjs → chunk-6PS55VJZ.mjs} +1 -1
  11. package/dist/{chunk-3EGSOIRH.mjs → chunk-7GMAMIHM.mjs} +1 -1
  12. package/dist/chunk-ADA43MGG.mjs +4 -0
  13. package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  14. package/dist/chunk-BIZO7KML.mjs +4 -0
  15. package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
  16. package/dist/{chunk-MAZGVZJN.mjs → chunk-DMCFEJ2C.mjs} +1 -1
  17. package/dist/{chunk-ANCSWAD7.mjs → chunk-ERJXTG6X.mjs} +1 -1
  18. package/dist/{chunk-GO42W2BM.mjs → chunk-FKU4VQR6.mjs} +1 -1
  19. package/dist/{chunk-D3YJZROI.mjs → chunk-FSCQ7GK7.mjs} +1 -1
  20. package/dist/{chunk-YPSUDHCJ.mjs → chunk-H3CJOE6S.mjs} +1 -1
  21. package/dist/{chunk-6EKGV4I2.mjs → chunk-HKGW6JI2.mjs} +1 -1
  22. package/dist/{chunk-DX3G3FKT.mjs → chunk-I2GNNRFH.mjs} +1 -1
  23. package/dist/{chunk-W2LPR7SX.mjs → chunk-I6XKBCH4.mjs} +1 -1
  24. package/dist/{chunk-JNJJAJPI.mjs → chunk-IF3425JX.mjs} +1 -1
  25. package/dist/{chunk-G27V7B6H.mjs → chunk-INBT5E6T.mjs} +1 -1
  26. package/dist/{chunk-M456UF2N.mjs → chunk-K7NZWTGP.mjs} +1 -1
  27. package/dist/{chunk-MSFBSDB3.mjs → chunk-KYUPRUH5.mjs} +1 -1
  28. package/dist/chunk-LG4P3APU.mjs +4 -0
  29. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  30. package/dist/{chunk-RMZLEIRP.mjs → chunk-LJQPLE4S.mjs} +1 -1
  31. package/dist/{chunk-QILFMWE5.mjs → chunk-M7NV6EFH.mjs} +1 -1
  32. package/dist/{chunk-33CHGT4N.mjs → chunk-MXCW6SOT.mjs} +1 -1
  33. package/dist/{chunk-MFUZNS7C.mjs → chunk-N3B3XNV3.mjs} +1 -1
  34. package/dist/{chunk-MEVSHOG4.mjs → chunk-NWISIJFD.mjs} +1 -1
  35. package/dist/{chunk-5PJLI46T.mjs → chunk-OLIYPWO3.mjs} +1 -1
  36. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  37. package/dist/{chunk-YWRU7OE3.mjs → chunk-PK3OBSCB.mjs} +1 -1
  38. package/dist/{chunk-LLP4EFT4.mjs → chunk-PO3XUUWY.mjs} +1 -1
  39. package/dist/{chunk-CQAMS7RZ.mjs → chunk-Q2QAFOWG.mjs} +1 -1
  40. package/dist/{chunk-D6K6RO5P.mjs → chunk-R5P4ZICA.mjs} +1 -1
  41. package/dist/{chunk-N6CZEXLZ.mjs → chunk-S4PW6SKD.mjs} +1 -1
  42. package/dist/{chunk-TZCRIKIJ.mjs → chunk-VLVR5VHG.mjs} +1 -1
  43. package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
  44. package/dist/chunk-X4MQSO2K.mjs +4 -0
  45. package/dist/{chunk-OXKN6X62.mjs → chunk-XKGBG5FX.mjs} +1 -1
  46. package/dist/{chunk-VQBOJHZF.mjs → chunk-YKG4FNS4.mjs} +1 -1
  47. package/dist/{chunk-XYJ4S67W.mjs → chunk-ZEPEWKBV.mjs} +1 -1
  48. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  49. package/dist/components/Blocks/Banner.mjs +1 -1
  50. package/dist/components/Blocks/CallToAction.mjs +1 -1
  51. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  52. package/dist/components/Blocks/Content.mjs +1 -1
  53. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  54. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  55. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  56. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  57. package/dist/components/Blocks/index.mjs +1 -1
  58. package/dist/components/Cards/ContentCard.mjs +1 -1
  59. package/dist/components/Cards/FeatureCard.mjs +1 -1
  60. package/dist/components/Cards/index.mjs +1 -1
  61. package/dist/components/Chat/ChatInterface.mjs +1 -1
  62. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  63. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  64. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  65. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  66. package/dist/components/Chat/demo-tests.mjs +1 -1
  67. package/dist/components/Chat/demo.mjs +1 -1
  68. package/dist/components/Chat/example-usage.mjs +1 -1
  69. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  70. package/dist/components/Chat/index.mjs +1 -1
  71. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  72. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  73. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  74. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  75. package/dist/components/DigitalColleagues/document-edit.d.ts +2 -2
  76. package/dist/components/DigitalColleagues/document-edit.js +0 -1
  77. package/dist/components/DigitalColleagues/index.mjs +1 -1
  78. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  79. package/dist/components/Foundary/Knowledge/add-knowledge-modal.js +1 -1
  80. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  81. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  82. package/dist/components/Foundary/Login.css +1 -0
  83. package/dist/components/Foundary/Login.d.ts +61 -0
  84. package/dist/components/Foundary/Login.js +4 -0
  85. package/dist/components/Foundary/Login.mjs +2 -0
  86. package/dist/components/Foundary/MainPage.mjs +1 -1
  87. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  88. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  89. package/dist/components/Foundary/RichText/index.mjs +1 -1
  90. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  91. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  92. package/dist/components/Foundary/Views/KnowledgeView.d.ts +1 -1
  93. package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
  94. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  95. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  96. package/dist/components/Foundary/Views/index.js +1 -1
  97. package/dist/components/Foundary/Views/index.mjs +1 -1
  98. package/dist/components/Foundary/document-edit.mjs +1 -1
  99. package/dist/components/Foundary/document-preview-examples.js +3 -3
  100. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  101. package/dist/components/Foundary/document-preview.d.ts +1 -1
  102. package/dist/components/Foundary/document-preview.js +1 -1
  103. package/dist/components/Foundary/document-preview.mjs +1 -1
  104. package/dist/components/Foundary/index.d.ts +1 -0
  105. package/dist/components/Foundary/index.js +1 -1
  106. package/dist/components/Foundary/index.mjs +1 -1
  107. package/dist/components/Foundary/knowledge-browser.d.ts +1 -1
  108. package/dist/components/Foundary/knowledge-browser.js +1 -1
  109. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  110. package/dist/components/HeaderFooter/Header.mjs +1 -1
  111. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  112. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  113. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  114. package/dist/components/HeaderFooter/index.mjs +1 -1
  115. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  116. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  117. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  118. package/dist/components/Heros/PostHero/index.mjs +1 -1
  119. package/dist/components/Heros/RenderHero.mjs +1 -1
  120. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  121. package/dist/components/Heros/index.mjs +1 -1
  122. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  123. package/dist/components/Holidays/index.mjs +1 -1
  124. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  125. package/dist/components/Layouts/Print.mjs +1 -1
  126. package/dist/components/Layouts/SlideShow.mjs +1 -1
  127. package/dist/components/Layouts/index.mjs +1 -1
  128. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  129. package/dist/components/Menus/SidebarRight.mjs +1 -1
  130. package/dist/components/Menus/index.mjs +1 -1
  131. package/dist/components/Other/index.mjs +1 -1
  132. package/dist/components/Payload/RichText/index.mjs +1 -1
  133. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  134. package/dist/components/Payload/index.mjs +1 -1
  135. package/dist/components/Projects/EpicsView.mjs +1 -1
  136. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  137. package/dist/components/Projects/ProjectPage.mjs +1 -1
  138. package/dist/components/Projects/ProjectView.mjs +1 -1
  139. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  140. package/dist/components/Projects/index.mjs +1 -1
  141. package/dist/components/dc-temp/index.mjs +1 -1
  142. package/dist/components/index.js +20 -20
  143. package/dist/components/index.mjs +1 -1
  144. package/dist/components/ui/index.mjs +1 -1
  145. package/dist/components/ui/sidebar.mjs +1 -1
  146. package/dist/globals.css +1 -1
  147. package/dist/index.js +25 -25
  148. package/dist/index.mjs +1 -1
  149. package/dist/metafile-cjs.json +1 -1
  150. package/dist/metafile-esm.json +1 -1
  151. package/dist/pages/Blog.mjs +1 -1
  152. package/dist/pages/Documentation.mjs +1 -1
  153. package/dist/pages/IndexPage.mjs +1 -1
  154. package/dist/pages/Intranet.mjs +1 -1
  155. package/dist/pages/LandingPage.mjs +1 -1
  156. package/dist/pages/Page.mjs +1 -1
  157. package/dist/pages/Publish.mjs +1 -1
  158. package/dist/pages/Website.mjs +1 -1
  159. package/dist/sections/AboutSection.mjs +1 -1
  160. package/dist/sections/BlogDetail.mjs +1 -1
  161. package/dist/sections/BlogList.mjs +1 -1
  162. package/dist/sections/BlogListSection.mjs +1 -1
  163. package/dist/sections/ContactSection.mjs +1 -1
  164. package/dist/sections/PageSections.mjs +1 -1
  165. package/dist/sections/PricingSection.mjs +1 -1
  166. package/dist/sections/ServiceDetail.mjs +1 -1
  167. package/dist/sections/ServiceDetailSection.mjs +1 -1
  168. package/dist/sections/ServiceSection.mjs +1 -1
  169. package/dist/sections/index.mjs +1 -1
  170. package/package.json +1 -1
  171. package/dist/chunk-4CHIFK3W.mjs +0 -4
  172. package/dist/chunk-PE5L5LZL.mjs +0 -4
  173. package/dist/chunk-V4W2JDQB.mjs +0 -4
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";"use client";var _o=Object.create;var Ae=Object.defineProperty;var Uo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty;var Ko=(e,t)=>{for(var o in t)Ae(e,o,{get:t[o],enumerable:!0})},Nt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Bo(t))!$o.call(e,a)&&a!==o&&Ae(e,a,{get:()=>t[a],enumerable:!(r=Uo(t,a))||r.enumerable});return e};var Z=(e,t,o)=>(o=e!=null?_o(Fo(e)):{},Nt(t||!e||!e.__esModule?Ae(o,"default",{value:e,enumerable:!0}):o,e)),Wo=e=>Nt(Ae({},"__esModule",{value:!0}),e);var oa={};Ko(oa,{DocumentPreview:()=>ta});module.exports=Wo(oa);var yt=require("motion/react"),X=require("lucide-react"),Ne=require("react");var Et=require("clsx");var qe="-",Go=e=>{let t=Zo(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{let l=i.split(qe);return l[0]===""&&l.length!==1&&l.shift(),Dt(l,t)||jo(i)},getConflictingClassGroupIds:(i,l)=>{let f=o[i]||[];return l&&r[i]?[...f,...r[i]]:f}}},Dt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?Dt(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(qe);return t.validators.find(({validator:i})=>i(n))?.classGroupId},Rt=/^\[(.+)\]$/,jo=e=>{if(Rt.test(e)){let t=Rt.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Zo=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return qo(Object.entries(e.classGroups),o).forEach(([n,i])=>{Xe(i,r,n,t)}),r},Xe=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:Pt(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Xo(a)){Xe(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,i])=>{Xe(i,Pt(t,n),o,r)})})},Pt=(e,t)=>{let o=e;return t.split(qe).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Xo=e=>e.isThemeGetter,qo=(e,t)=>t?e.map(([o,r])=>{let a=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,l])=>[t+i,l])):n);return[o,a]}):e,Jo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(n,i)=>{o.set(n,i),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let i=o.get(n);if(i!==void 0)return i;if((i=r.get(n))!==void 0)return a(n,i),i},set(n,i){o.has(n)?o.set(n,i):a(n,i)}}},St="!",Yo=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,a=t[0],n=t.length,i=l=>{let f=[],C=0,R=0,v;for(let u=0;u<l.length;u++){let M=l[u];if(C===0){if(M===a&&(r||l.slice(u,u+n)===t)){f.push(l.slice(R,u)),R=u+n;continue}if(M==="/"){v=u;continue}}M==="["?C++:M==="]"&&C--}let E=f.length===0?l:l.substring(R),O=E.startsWith(St),S=O?E.substring(1):E,k=v&&v>R?v-R:void 0;return{modifiers:f,hasImportantModifier:O,baseClassName:S,maybePostfixModifierPosition:k}};return o?l=>o({className:l,parseClassName:i}):i},Qo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},er=e=>({cache:Jo(e.cacheSize),parseClassName:Yo(e),...Go(e)}),tr=/\Vt+/,or=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a}=t,n=[],i=e.trim().split(tr),l="";for(let f=i.length-1;f>=0;f-=1){let C=i[f],{modifiers:R,hasImportantModifier:v,baseClassName:E,maybePostfixModifierPosition:O}=o(C),S=!!O,k=r(S?E.substring(0,O):E);if(!k){if(!S){l=C+(l.length>0?" "+l:l);continue}if(k=r(E),!k){l=C+(l.length>0?" "+l:l);continue}S=!1}let u=Qo(R).join(":"),M=v?u+St:u,T=M+k;if(n.includes(T))continue;n.push(T);let N=a(k,S);for(let x=0;x<N.length;++x){let W=N[x];n.push(M+W)}l=C+(l.length>0?" "+l:l)}return l};function rr(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Mt(t))&&(r&&(r+=" "),r+=o);return r}var Mt=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Mt(e[r]))&&(o&&(o+=" "),o+=t);return o};function ar(e,...t){let o,r,a,n=i;function i(f){let C=t.reduce((R,v)=>v(R),e());return o=er(C),r=o.cache.get,a=o.cache.set,n=l,l(f)}function l(f){let C=r(f);if(C)return C;let R=or(f,o);return a(f,R),R}return function(){return n(rr.apply(null,arguments))}}var H=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Tt=/^\[(?:([a-Vt-]+):)?(.+)\]$/i,nr=/^\Vt+\/\Vt+$/,ir=new Set(["px","full","screen"]),sr=/^(\Vt+(\.\Vt+)?)?(xs|sm|md|lg|xl)$/,lr=/\Vt+(%|px|r?em|[sdl]?v([hwib]|min|max)|Vt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cr=/^(inset_)?-?((\Vt+)?\.?(\Vt+)[a-Vt]+|0)X-?((\Vt+)?\.?(\Vt+)[a-Vt]+|0)/,mr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,de=e=>ve(e)||ir.has(e)||nr.test(e),ue=e=>xe(e,"length",xr),ve=e=>!!e&&!Number.isNaN(Number(e)),Ze=e=>xe(e,"number",ve),Re=e=>!!e&&Number.isInteger(Number(e)),pr=e=>e.endsWith("%")&&ve(e.slice(0,-1)),g=e=>Tt.test(e),fe=e=>sr.test(e),ur=new Set(["length","size","percentage"]),fr=e=>xe(e,ur,kt),gr=e=>xe(e,"position",kt),br=new Set(["image","url"]),hr=e=>xe(e,br,yr),vr=e=>xe(e,"",wr),Pe=()=>!0,xe=(e,t,o)=>{let r=Tt.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},xr=e=>lr.test(e)&&!dr.test(e),kt=()=>!1,wr=e=>cr.test(e),yr=e=>mr.test(e);var Cr=()=>{let e=H("colors"),t=H("spacing"),o=H("blur"),r=H("brightness"),a=H("borderColor"),n=H("borderRadius"),i=H("borderSpacing"),l=H("borderWidth"),f=H("contrast"),C=H("grayscale"),R=H("hueRotate"),v=H("invert"),E=H("gap"),O=H("gradientColorStops"),S=H("gradientColorStopPositions"),k=H("inset"),u=H("margin"),M=H("opacity"),T=H("padding"),N=H("saturate"),x=H("scale"),W=H("sepia"),p=H("skew"),D=H("space"),P=H("translate"),q=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto",g,t],I=()=>[g,t],ie=()=>["",de,ue],ne=()=>["auto",ve,g],m=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",g],Ct=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[ve,g];return{cacheSize:500,separator:":",theme:{colors:[Pe],spacing:[de,ue],blur:["none","",fe,g],brightness:le(),borderColor:[e],borderRadius:["none","","full",fe,g],borderSpacing:I(),borderWidth:ie(),contrast:le(),grayscale:J(),hueRotate:le(),invert:J(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[pr,ue],inset:ae(),margin:ae(),opacity:le(),padding:I(),saturate:le(),scale:le(),sepia:J(),skew:le(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[fe]}],"break-after":[{"break-after":Ct()}],"break-before":[{"break-before":Ct()}],"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"],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:[...m(),g]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],Vt:[{Vt:["auto",Re,g]}],basis:[{basis:ae()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",Re,g]}],"grid-cols":[{"grid-cols":[Pe]}],"col-start-end":[{col:["auto",{span:["full",Re,g]},g]}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":[Pe]}],"row-start-end":[{row:["auto",{span:[Re,g]},g]}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[E]}],"gap-x":[{"gap-x":[E]}],"gap-y":[{"gap-y":[E]}],"justify-content":[{justify:["normal",...se()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...se(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...se(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],Vt:[{Vt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],Vt:[{Vt:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,t]}],"min-w":[{"min-w":[g,t,"min","max","fit"]}],"max-w":[{"max-w":[g,t,"none","full","min","max","fit","prose",{screen:[fe]},fe]}],h:[{h:[g,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ze]}],"font-family":[{font:[Pe]}],"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:["tighter","tight","normal","wide","wider","widest",g]}],"line-clamp":[{"line-clamp":["none",ve,Ze]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",de,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[M]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[M]}],"text-decoration":["underline","overline","line-through","Le-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",de,ue]}],"underline-offset":[{"underline-offset":["auto",de,g]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[M]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...m(),gr]}],"bg-repeat":[{bg:["Le-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[O]}],"gradient-via":[{via:[O]}],"gradient-to":[{to:[O]}],rounded:[{rounded:[n]}],"rounded-Vt":[{"rounded-Vt":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-Ne":[{"rounded-Ne":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-Vt":[{"border-Vt":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[M]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[M]}],"divide-style":[{divide:V()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-Vt":[{"border-Vt":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[de,g]}],"outline-w":[{outline:[de,ue]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[M]}],"ring-offset-w":[{"ring-offset":[de,ue]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fe,vr]}],"shadow-color":[{shadow:[Pe]}],opacity:[{opacity:[M]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",fe,g]}],grayscale:[{grayscale:[C]}],"hue-rotate":[{"hue-rotate":[R]}],invert:[{invert:[v]}],saturate:[{saturate:[N]}],sepia:[{sepia:[W]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[C]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[M]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",g]}],duration:[{duration:le()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:le()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Re,g]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[p]}],"skew-y":[{"skew-y":[p]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","Le-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","Vt-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-Vt":[{"scroll-Vt":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-Vt":[{"scroll-Vt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",g]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[de,ue,Ze]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","Vt","pr","pb","pl"],px:["pr","pl"],py:["Vt","pb"],m:["mx","my","ms","Vt","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-Vt","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-Ne","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-Vt":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-Ne"],"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-Vt","border-w-e","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-Vt","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-Vt","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-Vt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-Vt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var It=ar(Cr);function b(...e){return It((0,Et.clsx)(e))}var Ht=require("@radix-ui/react-slot"),Lt=require("class-variance-authority"),At=Z(require("react")),Vt=require("react/jsx-runtime"),Nr=(0,Lt.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),te=At.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...a},n)=>(0,Vt.jsx)(e?Ht.Slot:"button",{className:b(Nr({className:t,size:o,variant:r})),ref:n,...a}));te.displayName="Button";var De=Z(require("react")),F=Z(require("@radix-ui/react-dialog"));var Ve=F.Root;var Je=F.Portal;var Oe=De.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(F.Overlay,{ref:o,className:b("fixed inset-0 Vt-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Oe.displayName=F.Overlay.displayName;var Ye=De.forwardRef(({className:e,children:t,...o},r)=>(0,Vt.jsxs)(Je,{children:[(0,Vt.jsx)(Oe,{}),(0,Vt.jsxs)(F.Content,{ref:r,className:b("fixed left-[50%] top-[50%] Vt-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Vt.jsxs)(F.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Vt.jsx)(X.X,{className:"h-4 w-4"}),(0,Vt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ye.displayName=F.Content.displayName;var Qe=({className:e,...t})=>(0,Vt.jsx)("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qe.displayName="DialogHeader";var Rr=({className:e,...t})=>(0,Vt.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rr.displayName="DialogFooter";var et=De.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(F.Title,{ref:o,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));et.displayName=F.Title.displayName;var Pr=De.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(F.Description,{ref:o,className:b("text-sm text-muted-foreground",e),...t}));Pr.displayName=F.Description.displayName;var Ao=Z(require("@radix-ui/react-dialog"));var zt=Z(require("react")),Se=zt.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)("textarea",{className:b("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Se.displayName="Textarea";var Ut=Z(require("react"));var ce=Ut.forwardRef(({className:e,type:t,...o},r)=>(0,Vt.jsx)("input",{type:t,className:b("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));ce.displayName="Input";var w=Z(require("@radix-ui/react-select")),ge=Z(require("react")),Ft=w.Root;var $t=w.Value,tt=ge.forwardRef(({children:e,className:t,...o},r)=>(0,Vt.jsxs)(w.Trigger,{className:b("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:r,...o,children:[e,(0,Vt.jsx)(w.Icon,{asChild:!0,children:(0,Vt.jsx)(X.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));tt.displayName=w.Trigger.displayName;var Kt=ge.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Vt.jsx)(X.ChevronUp,{className:"h-4 w-4"})}));Kt.displayName=w.ScrollUpButton.displayName;var Wt=ge.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Vt.jsx)(X.ChevronDown,{className:"h-4 w-4"})}));Wt.displayName=w.ScrollDownButton.displayName;var ot=ge.forwardRef(({children:e,className:t,position:o="popper",...r},a)=>(0,Vt.jsx)(w.Portal,{children:(0,Vt.jsxs)(w.Content,{className:b("relative Vt-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:a,...r,children:[(0,Vt.jsx)(Kt,{}),(0,Vt.jsx)(w.Viewport,{className:b("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Vt.jsx)(Wt,{})]})}));ot.displayName=w.Content.displayName;var Dr=ge.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Dr.displayName=w.Label.displayName;var ze=ge.forwardRef(({children:e,className:t,...o},r)=>(0,Vt.jsxs)(w.Item,{className:b("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,Vt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Vt.jsx)(w.ItemIndicator,{children:(0,Vt.jsx)(X.Check,{className:"h-4 w-4"})})}),(0,Vt.jsx)(w.ItemText,{children:e})]}));ze.displayName=w.Item.displayName;var Sr=ge.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Sr.displayName=w.Separator.displayName;var Gt=Z(require("react")),rt=Z(require("@radix-ui/react-label"));var Mr=(0,Lt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),at=Gt.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(rt.Root,{ref:o,className:b(Mr(),e),...t}));at.displayName=rt.Root.displayName;var it=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:a,className:n="",disabled:i=!1})=>{let[l,f]=(0,Ne.useState)(!1),[C,R]=(0,Ne.useState)(""),v=()=>{i||(f(!0),R(t))},E=async()=>{C!==t&&await a(e,C),f(!1)},O=S=>{S.key==="Enter"&&!r||S.key==="Enter"&&S.ctrlKey&&r?E():S.key==="Escape"&&(f(!1),R(""))};return(0,Vt.jsxs)("div",{className:`space-y-2 ${n}`,children:[(0,Vt.jsx)(at,{children:o}),l?r?(0,Vt.jsx)(Se,{value:C,onChange:S=>R(S.target.value),onBlur:E,onKeyDown:O,autoFocus:!0,rows:4,className:"resize-none"}):(0,Vt.jsx)(ce,{value:C,onChange:S=>R(S.target.value),onBlur:E,onKeyPress:O,autoFocus:!0,className:"text-lg font-medium"}):(0,Vt.jsxs)("div",{onClick:v,className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${r?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Vt.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!i&&(0,Vt.jsx)(X.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var No=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Ro=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Po=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Do=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),So=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Mo=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),To=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Ge=require("@payloadcms/richtext-lexical/lexical/list"),ko=require("@payloadcms/richtext-lexical/lexical/rich-text"),Io=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var yo=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Le=require("@payloadcms/richtext-lexical/lexical/utils"),h=require("@payloadcms/richtext-lexical/lexical"),ht=require("@payloadcms/richtext-lexical/lexical/selection");var io=require("@radix-ui/react-dialog"),Fe=require("@payloadcms/richtext-lexical/client");var lt=Z(require("bson-objectid"));var Jt=require("@payloadcms/ui");var qt=Z(require("react")),oe=Z(require("@radix-ui/react-tooltip"));var _e=oe.Provider,Ue=oe.Root,Be=oe.Trigger,Me=qt.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Vt.jsx)(oe.Portal,{children:(0,Vt.jsx)(oe.Content,{ref:r,sideOffset:t,className:b("Vt-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Me.displayName=oe.Content.displayName;var Tr=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[a]=(0,yo.useLexicalComposerContext)(),[n,i]=(0,Ne.useState)(""),[l,f]=(0,Ne.useState)(""),[C,R]=(0,Ne.useState)(""),v=async u=>{console.log("fetchMedia",u)};(0,Ne.useEffect)(()=>{typeof o=="string"?o.length===24?v(o):(i(o||""),R(k(S())),f(O()||"")):typeof o=="object"&&(i(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),R(k(o.filesize)),f(o.mimeType?.split("/")[1]||""))},[]);let E=(0,Ne.useCallback)(()=>{a.update(()=>{(0,h.$getNodeByKey)(r)?.remove()})},[a,r]),O=()=>{let u=e.data.value;return typeof u=="string"?u.split(";base64")[0]?.split("image/")[1]:""},S=()=>{let u=e.data.value;if(typeof u=="string"){let M=u.split(",")[1]?.length||0;return 4*Math.ceil(M/3)*.5624896334383812/1e3}return 0};function k(u){if(u>=1e6){let T=u/1e6;return`${T>=10?Math.round(T).toString():T.toFixed(1)} MB`}return`${Math.floor(u/1e3)} KB`}return(0,$.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,$.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,$.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,$.jsx)("div",{className:"flex-1",children:e.data.value?(0,$.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:n}):(0,$.jsx)(Jt.File,{})}),(0,$.jsx)(_e,{children:(0,$.jsxs)(Ue,{children:[(0,$.jsxs)(Be,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,$.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,$.jsx)("button",{onClick:u=>{u.preventDefault(),E()},className:"flex-1 flex justify-center items-center",children:(0,$.jsx)(X.X,{width:24,height:24,strokeWidth:1})})]}),(0,$.jsx)(Me,{children:(0,$.jsx)("span",{children:"Remove image"})})]})})]}),(0,$.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,$.jsx)("span",{className:"",children:l?.toLocaleUpperCase()}),(0,$.jsx)("span",{children:C})]})]})})},to=Tr;function kr(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:we({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Te=class extends Fe.UploadNode{static importDOM(){return{img:()=>({conversion:kr,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new lt.default().toHexString(),t.version=3);let o={id:t.id??new lt.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=we(o);return r.setFormat?.(t.format),r}decorate(){return(0,Vt.jsx)(to,{data:this.__data,nodeKey:this.getKey()})}};function we(e){return new Te({data:e})}var Ir=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Er=e=>Ir?(e||window).getSelection():null,Ka=(0,h.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),dt=(0,h.createCommand)("INSERT_UPLOAD_COMMAND");function so({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,Ne.useRef)(!1),[a,n]=(0,Ne.useState)(!0),[i,l]=(0,Ne.useState)(""),[f,C]=(0,Ne.useState)(""),[R,v]=(0,Ne.useState)(!1),[E,O]=(0,Ne.useState)("left"),S=i==="",k=x=>{v(x.target.checked)},u=x=>{O(x.target.value)},M=x=>{let W=new FileReader;W.onload=function(){return typeof W.result=="string"&&l(W.result),""},x!==null&&x[0]&&W.readAsDataURL(x[0])};(0,Ne.useEffect)(()=>{r.current=!1;let x=W=>{r.current=W.altKey};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[e]),(0,Ne.useEffect)(()=>{a||t()},[a]),(0,Ne.useEffect)(()=>{n(o)},[o]);let T=({editor:x,relationTo:W,replaceNodeKey:p,value:D})=>{if(p)x.update(()=>{let P=(0,h.$getNodeByKey)(p);P&&P.replace(we({id:"",fields:{},relationTo:"media",value:D}))});else{let P=x.dispatchCommand(dt,{fields:null,relationTo:"media",value:D})}},N=()=>{T({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:f,src:i,showCaption:R,position:E}.src}),n(!1),t()};return(0,Vt.jsx)(Ve,{open:a,onOpenChange:x=>n(x),children:(0,Vt.jsxs)(Ye,{children:[(0,Vt.jsxs)(Qe,{children:[(0,Vt.jsx)(et,{children:"Upload Image"}),(0,Vt.jsx)(io.DialogDescription,{children:"Description"})]}),(0,Vt.jsxs)("div",{className:"",children:[(0,Vt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Vt.jsx)(ce,{type:"file",onChange:x=>M(x.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Vt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Vt.jsx)(ce,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:x=>C(x.currentTarget.value),value:f,"data-test-id":"image-modal-alt-text-input"})}),(0,Vt.jsx)(te,{"data-test-id":"image-modal-file-upload-btn",disabled:S,onClick:()=>N(),children:"Confirm"})]})]})})}function ct({captionsEnabled:e}){let[t]=(0,yo.useLexicalComposerContext)();return(0,Ne.useEffect)(()=>{if(!t.hasNodes([Fe.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Le.mergeRegister)(t.registerCommand(h.DRAGSTART_COMMAND,o=>Hr(o),h.COMMAND_PRIORITY_HIGH),t.registerCommand(h.DRAGOVER_COMMAND,o=>Lr(o),h.COMMAND_PRIORITY_LOW),t.registerCommand(h.DROP_COMMAND,o=>Ar(o,t),h.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Hr(e){if(!mt())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","X"),!0):!1}function Lr(e){return mt()?(lo(e)||e.preventDefault(),!0):!1}function Ar(e,t){let o=mt();if(!o)return!1;if(e.preventDefault(),lo(e)){let r=Vr(e);o.remove();let a=(0,h.$createRangeSelection)();r!=null&&a.applyDOMRange(r),(0,h.$setSelection)(a)}return!0}function mt(){let e=(0,h.$getSelection)();if(!(0,h.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,Fe.$isUploadNode)(o)?o:null}function lo(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function Vr(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,a=Er(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&a!==null)a.collapse(e.rangeParent,e.rangeOffset||0),t=a.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Or=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),co=Or;var zr=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),mo=zr;var _r=()=>(0,Vt.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{Vt:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Vt.jsx)("path",{Vt:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),po=_r;var Ur=()=>(0,Vt.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{Vt:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Vt.jsx)("path",{Vt:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),uo=Ur;var Br=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),fo=Br;var Fr=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),go=Fr;var bo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),ho=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),vo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),xo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),wo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var pe=Z(require("react")),y=Z(require("@radix-ui/react-dropdown-menu")),ye=require("@radix-ui/react-icons");var $e=y.Root,Ke=y.Trigger;var $r=pe.forwardRef(({className:e,inset:t,children:o,...r},a)=>(0,Vt.jsxs)(y.SubTrigger,{ref:a,className:b("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[o,(0,Vt.jsx)(ye.ChevronRightIcon,{className:"ml-auto"})]}));$r.displayName=y.SubTrigger.displayName;var Kr=pe.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(y.SubContent,{ref:o,className:b("Vt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Kr.displayName=y.SubContent.displayName;var Ee=pe.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Vt.jsx)(y.Portal,{children:(0,Vt.jsx)(y.Content,{ref:r,sideOffset:t,className:b("Vt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Ee.displayName=y.Content.displayName;var He=pe.forwardRef(({className:e,inset:t,...o},r)=>(0,Vt.jsx)(y.Item,{ref:r,className:b("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));He.displayName=y.Item.displayName;var Wr=pe.forwardRef(({className:e,children:t,checked:o,...r},a)=>(0,Vt.jsxs)(y.CheckboxItem,{ref:a,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[(0,Vt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Vt.jsx)(y.ItemIndicator,{children:(0,Vt.jsx)(ye.CheckIcon,{className:"h-4 w-4"})})}),t]}));Wr.displayName=y.CheckboxItem.displayName;var Gr=pe.forwardRef(({className:e,children:t,...o},r)=>(0,Vt.jsxs)(y.RadioItem,{ref:r,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,Vt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Vt.jsx)(y.ItemIndicator,{children:(0,Vt.jsx)(ye.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Gr.displayName=y.RadioItem.displayName;var jr=pe.forwardRef(({className:e,inset:t,...o},r)=>(0,Vt.jsx)(y.Label,{ref:r,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));jr.displayName=y.Label.displayName;var Zr=pe.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(y.Separator,{ref:o,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Zr.displayName=y.Separator.displayName;var Xr=({className:e,...t})=>(0,Vt.jsx)("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});Xr.displayName="DropdownMenuShortcut";var bt=1;function qr(){return(0,Vt.jsx)("span",{className:"border border-[#222222]"})}function vt(){let[e]=(0,yo.useLexicalComposerContext)(),t=(0,Ne.useRef)(null),[o,r]=(0,Ne.useState)(!1),[a,n]=(0,Ne.useState)(!1),[i,l]=(0,Ne.useState)(!1),[f,C]=(0,Ne.useState)(!1),[R,v]=(0,Ne.useState)(!1),[E,O]=(0,Ne.useState)(!1),[S,k]=(0,Ne.useState)(!1),[u,M]=(0,Ne.useState)(!1),[T,N]=(0,Ne.useState)(!1),[x,W]=(0,Ne.useState)("left"),[p,D]=(0,Ne.useState)("p"),P=m=>{e.update(()=>{let V=(0,h.$getSelection)();(0,h.$isRangeSelection)(V)&&(m==="p"?(0,ht.$setBlocksType)(V,()=>(0,h.$createParagraphNode)()):(0,ht.$setBlocksType)(V,()=>(0,ko.$createHeadingNode)(m)))})},q=(0,Ne.useCallback)(()=>{let m=(0,h.$getSelection)();if((0,h.$isRangeSelection)(m)){l(m.hasFormat("bold")),C(m.hasFormat("italic")),v(m.hasFormat("underline")),O(m.hasFormat("strikethrough")),k(m.hasFormat("subscript")),M(m.hasFormat("superscript"));let V=m.anchor.getNode(),B=V;for(;B&&!(0,h.$isParagraphNode)(B)&&B!==(0,h.$getRoot)();){let J=B.getParent();J&&(B=J)}if(B){let J=B.getFormatType();W(J||"left")}let se=V.getTopLevelElement()?.__tag;D(se||"p")}},[]);(0,Ne.useEffect)(()=>(0,Le.mergeRegister)(e.registerUpdateListener(({editorState:m})=>{m.read(()=>{q()})}),e.registerCommand(h.SELECTION_CHANGE_COMMAND,(m,V)=>(q(),!1),bt),e.registerCommand(h.CAN_UNDO_COMMAND,m=>(r(m),!1),bt),e.registerCommand(h.CAN_REDO_COMMAND,m=>(n(m),!1),bt),(0,Le.mergeRegister)(e.registerCommand(dt,m=>(e.update(()=>{let V=(0,h.$getSelection)()||(0,h.$getPreviousSelection)();if((0,h.$isRangeSelection)(V)){let B=we({id:m.id,fields:m.fields,relationTo:m.relationTo,value:m.value}),{focus:se}=V,J=se.getNode();(0,Le.$insertNodeToNearestRoot)(B),(0,h.$isParagraphNode)(J)&&!J.__first&&J.remove()}}),!0),h.COMMAND_PRIORITY_EDITOR))),[e,q]);let G=[[{label:"Undo",icon:(0,Vt.jsx)(X.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Vt.jsx)(X.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.UNDO_COMMAND,void 0)},disabled:!a}],[{label:"Bold",icon:(0,Vt.jsx)(co,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:i},{label:"Italic",icon:(0,Vt.jsx)(mo,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:f},{label:"Underline",icon:(0,Vt.jsx)(po,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:R},{label:"Strikethrough",icon:(0,Vt.jsx)(uo,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:E},{label:"Subscript",icon:(0,Vt.jsx)(fo,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:S},{label:"Superscript",icon:(0,Vt.jsx)(go,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:u}]],ae=[{label:"Left Align",direction:"left",icon:(0,Vt.jsx)(X.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Vt.jsx)(X.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Vt.jsx)(X.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Vt.jsx)(X.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"justify")}}],ie=[{label:"Normal Text",value:"p",icon:(0,Vt.jsx)(bo,{}),onClick:()=>P("p")},{label:"Heading 1",value:"h1",icon:(0,Vt.jsx)(ho,{}),onClick:()=>P("h1")},{label:"Heading 2",value:"h2",icon:(0,Vt.jsx)(vo,{}),onClick:()=>P("h2")},{label:"Heading 3",value:"h3",icon:(0,Vt.jsx)(xo,{}),onClick:()=>P("h3")},{label:"Heading 4",value:"h4",icon:(0,Vt.jsx)(wo,{}),onClick:()=>P("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Vt.jsx)(X.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ge.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Vt.jsx)(X.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ge.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ne=[{label:"Insert Image",icon:(0,Vt.jsx)(X.ImageUp,{width:15,height:15}),onClick:()=>{N(!0)},disabled:!1}];return(0,Vt.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,Vt.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[G.map((m,V)=>(0,Vt.jsxs)(Ne.Fragment,{children:[(0,Vt.jsx)("div",{className:"flex items-center gap-2",children:m.map((B,se)=>(0,Vt.jsx)("div",{role:"button","aria-disabled":B.disabled||!1,onClick:B.onClick,className:b("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",B.active&&"bg-[#3c3c3c]"),"aria-label":B.label,children:(0,Vt.jsx)(_e,{children:(0,Vt.jsxs)(Ue,{children:[(0,Vt.jsx)(Be,{className:"text-[#b5b5b5]",children:B.icon}),(0,Vt.jsx)(Me,{children:(0,Vt.jsx)("p",{children:B.label})})]})})},se))}),(0,Vt.jsx)(qr,{})]},`toolbar-option-${m.length}-${V}`)),(0,Vt.jsxs)($e,{children:[(0,Vt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[ae.find(m=>m.direction===x)?.icon,ae.find(m=>m.direction===x)?.label,(0,Vt.jsx)(X.ChevronDown,{width:15,height:15})]}),(0,Vt.jsx)(Ee,{className:"bg-black hover:bg-black",children:ae.map((m,V)=>(0,Vt.jsxs)(He,{onClick:m.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Vt.jsx)("span",{children:m.icon}),(0,Vt.jsx)("span",{children:m.label})]},`${m.label}-${V}`))})]}),(0,Vt.jsxs)($e,{children:[(0,Vt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[ie.find(m=>m.value===p)?.icon,ie.find(m=>m.value===p)?.label,(0,Vt.jsx)(X.ChevronDown,{width:15,height:15})]}),(0,Vt.jsx)(Ee,{className:"bg-black hover:bg-black",children:ie.map((m,V)=>(0,Vt.jsxs)(He,{onClick:m.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Vt.jsx)("span",{children:m.icon}),(0,Vt.jsx)("span",{children:m.label})]},`heading-option-${m.label}-${V}`))})]}),(0,Vt.jsxs)($e,{children:[(0,Vt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Vt.jsx)(X.Plus,{width:15,height:15}),(0,Vt.jsx)(X.ChevronDown,{width:15,height:15})]}),(0,Vt.jsx)(Ee,{className:"bg-black hover:bg-black",children:ne.map((m,V)=>(0,Vt.jsxs)(He,{onClick:m.onClick,disabled:m.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Vt.jsx)("span",{children:m.icon}),(0,Vt.jsx)("span",{children:m.label})]},V))})]}),T&&(0,Vt.jsx)(so,{activeEditor:e,onClose:()=>{N(!1)},isOpen:T})]})})}var Jr=({setValue:e,value:t,name:o,editable:r=!0})=>{let[a]=(0,yo.useLexicalComposerContext)(),n=i=>{i.read(()=>{let l=i.toJSON();e?.(()=>l)})};return(0,Ne.useEffect)(()=>{a.setEditable(r)},[r]),(0,Ne.useEffect)(()=>{t&&a.update(()=>{a.setEditorState(a.parseEditorState(t))})},[]),(0,Vt.jsx)("div",{className:"w-full",children:(0,Vt.jsxs)("div",{className:" ",children:[r&&(0,Vt.jsx)(vt,{}),(0,Vt.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Vt.jsx)(Mo.RichTextPlugin,{contentEditable:(0,Vt.jsx)(Po.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Do.LexicalErrorBoundary}),r&&(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(So.HistoryPlugin,{}),(0,Vt.jsx)(No.AutoFocusPlugin,{}),(0,Vt.jsx)(To.ListPlugin,{}),(0,Vt.jsx)(Io.OnChangePlugin,{onChange:n}),(0,Vt.jsx)(ct,{})]})]})]})})},Yr=({setValue:e,value:t,name:o,editable:r=!0})=>(0,Vt.jsx)(Ro.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Ge.ListNode,Ge.ListItemNode,ko.HeadingNode,Te],onError(n){throw console.error("Lexical error:",n),n},theme:{code:"editor-code",heading:{h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Vt.jsx)(Jr,{value:t,setValue:e,name:o,editable:r})}),je=Yr;function Ho({document:e,onSave:t,mode:o="edit",onCancel:r,availableDocuments:a=[],knowledgeContexts:n=[]}){let[i,l]=(0,Ne.useState)({...e,updatedAt:new Date}),[f,C]=(0,Ne.useState)(!1),[R,v]=(0,Ne.useState)(i.richTextContent);(0,Ne.useEffect)(()=>{l(e)},[e]);let E=p=>{switch(p){case"markdown":case"mdx":return(0,Vt.jsx)(X.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Vt.jsx)(X.File,{className:"h-6 w-6 text-success"});case"text":return(0,Vt.jsx)(X.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Vt.jsx)(X.File,{className:"h-6 w-6 text-muted-foreground"})}},O=p=>{switch(p){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},S=()=>{let p=new Set,D=new Set;return n.forEach(P=>{P.menuConfig.groupBy.forEach(q=>p.add(q))}),a.forEach(P=>{P.metadata&&Object.keys(P.metadata).forEach(q=>D.add(q))}),{contextKeys:Array.from(p).sort(),documentKeys:Array.from(D).sort(),allKeys:Array.from(new Set([...p,...D])).sort()}},k=p=>{let D=new Set;return a.forEach(P=>{P.metadata?.[p]&&D.add(String(P.metadata[p]))}),Array.from(D).sort()},u=S(),M=()=>{t({...i,richTextContent:R})},T=(p,D)=>{l(P=>({...P,metadata:{...P.metadata,[p]:D}}))},N=(p,D)=>{D==="__custom__"?T(p,""):T(p,D)},x=()=>{T("","")},W=p=>{l(D=>{let P={...D.metadata};return delete P[p],{...D,metadata:P}})};return(0,Vt.jsxs)(yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Vt.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,Vt.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Vt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Vt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Vt.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Vt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Vt.jsx)(it,{fieldName:"title",value:i.title,label:"",onSave:(p,D)=>l(P=>({...P,title:D})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Vt.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${O(i.format)} flex-shrink-0 mt-1`,children:i.format.toUpperCase()})]}),(0,Vt.jsx)("div",{className:"mt-2",children:(0,Vt.jsx)(it,{fieldName:"description",value:i.description||"Click to add description...",label:"",multiline:!0,onSave:(p,D)=>l(P=>({...P,description:D})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Vt.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Vt.jsxs)(te,{variant:"ghost",size:"sm",onClick:()=>C(!f),className:"gap-2",children:[(0,Vt.jsx)(X.Info,{className:"h-4 w-4"}),"Metadata",i.metadata&&Object.keys(i.metadata).length>0&&(0,Vt.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(i.metadata).length}),f?(0,Vt.jsx)(X.ChevronDown,{className:"h-4 w-4"}):(0,Vt.jsx)(X.ChevronRight,{className:"h-4 w-4"})]}),(0,Vt.jsxs)(te,{variant:"outline",size:"sm",onClick:r,className:"gap-2",children:[(0,Vt.jsx)(X.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Vt.jsxs)(te,{size:"sm",onClick:M,className:"gap-2",children:[(0,Vt.jsx)(X.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,Vt.jsx)(yt.motion.div,{initial:!1,animate:{height:f?"auto":0,opacity:f?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Vt.jsxs)("div",{className:"Vt-4 border-t border-border mt-4 h-screen max-h-full flex",children:[(0,Vt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Vt.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Vt.jsx)(X.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Vt.jsxs)(te,{type:"button",variant:"outline",size:"sm",onClick:x,className:"gap-1 h-8",children:[(0,Vt.jsx)(X.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,Vt.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:i.metadata&&Object.keys(i.metadata).length>0?(0,Vt.jsx)("div",{className:"space-y-2",children:Object.entries(i.metadata).map(([p,D],P)=>{let q=k(p);return(0,Vt.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Vt.jsx)(ce,{value:p,onChange:G=>{let ae=G.target.value||"",I=i.metadata?.[p];l(ie=>{let ne={...ie.metadata};return delete ne[p],ae&&(ne[ae]=I||""),{...ie,metadata:ne}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${p}`}),(0,Vt.jsx)("datalist",{id:`metadata-keys-${p}`,children:u.allKeys.map(G=>(0,Vt.jsx)("option",{value:G},G))}),(0,Vt.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),q.length>0?(0,Vt.jsxs)(Ft,{value:String(D||""),onValueChange:G=>N(p,G),children:[(0,Vt.jsx)(tt,{className:"flex-1 h-8 text-sm",children:(0,Vt.jsx)($t,{placeholder:"Value"})}),(0,Vt.jsxs)(ot,{children:[q.map(G=>(0,Vt.jsx)(ze,{value:G,children:G},G)),(0,Vt.jsx)(ze,{value:"__custom__",children:(0,Vt.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Vt.jsx)(ce,{value:String(D||""),onChange:G=>T(p,G.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Vt.jsx)(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>W(p),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Vt.jsx)(X.X,{className:"h-3 w-3"})})]},`metadata-key-${P}`)})}):(0,Vt.jsxs)("div",{className:"text-center py-4",children:[(0,Vt.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Vt.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})})]})})]}),(0,Vt.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Vt.jsx)("div",{className:"p-8 h-full max-h-full overflow-auto",children:i.format==="richText"?(0,Vt.jsx)(je,{setValue:v,value:R,name:"richTextContent"}):(0,Vt.jsx)(Se,{value:i.content||"",onChange:p=>l(D=>({...D,content:p.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var Vo=Z(require("react-markdown")),Oo=Z(require("remark-gfm"));var zo=e=>(0,Vt.jsx)(Vo.default,{remarkPlugins:[Oo.default],components:{h1:({children:t})=>(0,Vt.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,Vt.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,Vt.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,Vt.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,Vt.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,Vt.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,Vt.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,Vt.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:o})=>(0,Vt.jsx)("a",{href:o,className:"text-blue-500",children:t}),img:({src:t,alt:o})=>(0,Vt.jsx)("img",{src:t,alt:o,className:"mb-4"}),blockquote:({children:t})=>(0,Vt.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),Lo=e=>(0,Vt.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Qr=e=>(0,Vt.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,Vt.jsx)(je,{value:JSON.stringify(e),editable:!1,name:"richTextContent"})}),ea=e=>(0,Vt.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Vt.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,Vt.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Vt.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),zo(e)]});function ta({document:e,onDocumentUpdate:t,editable:o=!0,mode:r="view",renderers:a,availableDocuments:n=[],knowledgeContexts:i=[]}){let[l,f]=(0,Ne.useState)(!1),[C,R]=(0,Ne.useState)(!1),[v,E]=(0,Ne.useState)(e);(0,Ne.useEffect)(()=>{E(e)},[e]);let O=N=>{switch(N){case"markdown":case"mdx":return(0,Vt.jsx)(X.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Vt.jsx)(X.File,{className:"h-6 w-6 text-success"});case"text":return(0,Vt.jsx)(X.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Vt.jsx)(X.File,{className:"h-6 w-6 text-muted-foreground"})}},S=N=>{switch(N){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},k=(N,x)=>{let W={markdown:zo,mdx:ea,text:Lo},p=a?.[x]||W[x];if(x==="richText"&&typeof N=="object")return Qr(N);if(p&&typeof N=="string")return p(N);if(typeof N=="string")return Lo(N)},u=N=>{f(!1),t?.(N),E(N)},M=()=>{f(!1)};return(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(Ve,{open:l||r==="create",onOpenChange:N=>!N&&M(),children:(0,Vt.jsxs)(Je,{children:[(0,Vt.jsx)(Oe,{}),(0,Vt.jsx)(Ao.Content,{className:b("fixed inset-0 Vt-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:(0,Vt.jsx)(Ho,{mode:r==="create"?"create":"edit",document:v,onSave:u,onCancel:M,availableDocuments:n,knowledgeContexts:i})})]})}),(0,Vt.jsxs)(yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Vt.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,Vt.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Vt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Vt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Vt.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[v.title,(0,Vt.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${S(v.format)}`,children:v.format.toUpperCase()})]}),v.description&&(0,Vt.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:v.description})]})}),(0,Vt.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[v.metadata&&Object.keys(v.metadata).length>0&&(0,Vt.jsxs)(te,{variant:"ghost",size:"sm",onClick:()=>R(!C),className:"gap-2",children:[(0,Vt.jsx)(X.Info,{className:"h-4 w-4"}),"Metadata",C?(0,Vt.jsx)(X.ChevronDown,{className:"h-4 w-4"}):(0,Vt.jsx)(X.ChevronRight,{className:"h-4 w-4"})]}),o&&(0,Vt.jsxs)(te,{variant:"outline",size:"sm",onClick:()=>f(!0),className:"gap-2",children:[(0,Vt.jsx)(X.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),v.metadata&&Object.keys(v.metadata).length>0&&(0,Vt.jsx)(yt.motion.div,{initial:!1,animate:{height:C?"auto":0,opacity:C?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Vt.jsxs)("div",{className:"Vt-4 border-t border-border mt-4",children:[(0,Vt.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,Vt.jsx)(X.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Vt.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,Vt.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(v.metadata).map(([N,x])=>(0,Vt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Vt.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:N.replace(/([X-Z])/g," $1").trim()}),(0,Vt.jsx)("span",{className:"text-foreground font-medium",children:String(x)})]},N))})})]})})]}),(0,Vt.jsx)("div",{className:"flex-1 ",children:(0,Vt.jsx)("div",{className:"py-4 h-full",children:(0,Vt.jsx)("div",{className:"space-y-4",children:v.content||v.richTextContent?(0,Vt.jsx)("div",{className:"relative",children:(0,Vt.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:k(v.format==="richText"?v.richTextContent:v.content,v.format)})}):(0,Vt.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Vt.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Vt.jsx)(X.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Vt.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Vt.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}0&&(module.exports={DocumentPreview});
4
+ "use strict";"use client";var _o=Object.create;var Ae=Object.defineProperty;var Uo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty;var Ko=(e,t)=>{for(var o in t)Ae(e,o,{get:t[o],enumerable:!0})},Nt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Bo(t))!$o.call(e,a)&&a!==o&&Ae(e,a,{get:()=>t[a],enumerable:!(r=Uo(t,a))||r.enumerable});return e};var X=(e,t,o)=>(o=e!=null?_o(Fo(e)):{},Nt(t||!e||!e.__esModule?Ae(o,"default",{value:e,enumerable:!0}):o,e)),Wo=e=>Nt(Ae({},"__esModule",{value:!0}),e);var oa={};Ko(oa,{DocumentPreview:()=>ta});module.exports=Wo(oa);var yt=require("motion/react"),G=require("lucide-react"),Y=require("react");var Et=require("clsx");var Je="-",Go=e=>{let t=Zo(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{let l=i.split(Je);return l[0]===""&&l.length!==1&&l.shift(),Dt(l,t)||jo(i)},getConflictingClassGroupIds:(i,l)=>{let b=o[i]||[];return l&&r[i]?[...b,...r[i]]:b}}},Dt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?Dt(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(Je);return t.validators.find(({validator:i})=>i(n))?.classGroupId},Rt=/^\[(.+)\]$/,jo=e=>{if(Rt.test(e)){let t=Rt.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Zo=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Jo(Object.entries(e.classGroups),o).forEach(([n,i])=>{Xe(i,r,n,t)}),r},Xe=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:Pt(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Xo(a)){Xe(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,i])=>{Xe(i,Pt(t,n),o,r)})})},Pt=(e,t)=>{let o=e;return t.split(Je).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Xo=e=>e.isThemeGetter,Jo=(e,t)=>t?e.map(([o,r])=>{let a=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,l])=>[t+i,l])):n);return[o,a]}):e,qo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(n,i)=>{o.set(n,i),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let i=o.get(n);if(i!==void 0)return i;if((i=r.get(n))!==void 0)return a(n,i),i},set(n,i){o.has(n)?o.set(n,i):a(n,i)}}},St="!",Yo=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,a=t[0],n=t.length,i=l=>{let b=[],N=0,R=0,u;for(let f=0;f<l.length;f++){let k=l[f];if(N===0){if(k===a&&(r||l.slice(f,f+n)===t)){b.push(l.slice(R,f)),R=f+n;continue}if(k==="/"){u=f;continue}}k==="["?N++:k==="]"&&N--}let T=b.length===0?l:l.substring(R),O=T.startsWith(St),D=O?T.substring(1):T,S=u&&u>R?u-R:void 0;return{modifiers:b,hasImportantModifier:O,baseClassName:D,maybePostfixModifierPosition:S}};return o?l=>o({className:l,parseClassName:i}):i},Qo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},er=e=>({cache:qo(e.cacheSize),parseClassName:Yo(e),...Go(e)}),tr=/\Vt+/,or=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a}=t,n=[],i=e.trim().split(tr),l="";for(let b=i.length-1;b>=0;b-=1){let N=i[b],{modifiers:R,hasImportantModifier:u,baseClassName:T,maybePostfixModifierPosition:O}=o(N),D=!!O,S=r(D?T.substring(0,O):T);if(!S){if(!D){l=N+(l.length>0?" "+l:l);continue}if(S=r(T),!S){l=N+(l.length>0?" "+l:l);continue}D=!1}let f=Qo(R).join(":"),k=u?f+St:f,M=k+S;if(n.includes(M))continue;n.push(M);let J=a(S,D);for(let C=0;C<J.length;++C){let j=J[C];n.push(k+j)}l=N+(l.length>0?" "+l:l)}return l};function rr(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Mt(t))&&(r&&(r+=" "),r+=o);return r}var Mt=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Mt(e[r]))&&(o&&(o+=" "),o+=t);return o};function ar(e,...t){let o,r,a,n=i;function i(b){let N=t.reduce((R,u)=>u(R),e());return o=er(N),r=o.cache.get,a=o.cache.set,n=l,l(b)}function l(b){let N=r(b);if(N)return N;let R=or(b,o);return a(b,R),R}return function(){return n(rr.apply(null,arguments))}}var E=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Tt=/^\[(?:([a-Vt-]+):)?(.+)\]$/i,nr=/^\Vt+\/\Vt+$/,ir=new Set(["px","full","screen"]),sr=/^(\Vt+(\.\Vt+)?)?(xs|sm|md|lg|xl)$/,lr=/\Vt+(%|px|r?em|[sdl]?v([hwib]|min|max)|Vt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cr=/^(inset_)?-?((\Vt+)?\.?(\Vt+)[a-Vt]+|0)G-?((\Vt+)?\.?(\Vt+)[a-Vt]+|0)/,mr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ce=e=>xe(e)||ir.has(e)||nr.test(e),fe=e=>we(e,"length",xr),xe=e=>!!e&&!Number.isNaN(Number(e)),Ze=e=>we(e,"number",xe),Re=e=>!!e&&Number.isInteger(Number(e)),pr=e=>e.endsWith("%")&&xe(e.slice(0,-1)),h=e=>Tt.test(e),ge=e=>sr.test(e),ur=new Set(["length","size","percentage"]),fr=e=>we(e,ur,kt),gr=e=>we(e,"position",kt),br=new Set(["image","url"]),hr=e=>we(e,br,yr),vr=e=>we(e,"",wr),Pe=()=>!0,we=(e,t,o)=>{let r=Tt.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},xr=e=>lr.test(e)&&!dr.test(e),kt=()=>!1,wr=e=>cr.test(e),yr=e=>mr.test(e);var Cr=()=>{let e=E("colors"),t=E("spacing"),o=E("blur"),r=E("brightness"),a=E("borderColor"),n=E("borderRadius"),i=E("borderSpacing"),l=E("borderWidth"),b=E("contrast"),N=E("grayscale"),R=E("hueRotate"),u=E("invert"),T=E("gap"),O=E("gradientColorStops"),D=E("gradientColorStopPositions"),S=E("inset"),f=E("margin"),k=E("opacity"),M=E("padding"),J=E("saturate"),C=E("scale"),j=E("sepia"),g=E("skew"),P=E("space"),m=E("translate"),A=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",h,t],I=()=>[h,t],se=()=>["",ce,fe],ie=()=>["auto",xe,h],p=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",h],Ct=()=>["auto","avoid","all","avoid-page","page","left","right","column"],de=()=>[xe,h];return{cacheSize:500,separator:":",theme:{colors:[Pe],spacing:[ce,fe],blur:["none","",ge,h],brightness:de(),borderColor:[e],borderRadius:["none","","full",ge,h],borderSpacing:I(),borderWidth:se(),contrast:de(),grayscale:q(),hueRotate:de(),invert:q(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[pr,fe],inset:Q(),margin:Q(),opacity:de(),padding:I(),saturate:de(),scale:de(),sepia:q(),skew:de(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[ge]}],"break-after":[{"break-after":Ct()}],"break-before":[{"break-before":Ct()}],"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"],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:[...p(),h]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],Vt:[{Vt:["auto",Re,h]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Re,h]}],"grid-cols":[{"grid-cols":[Pe]}],"col-start-end":[{col:["auto",{span:["full",Re,h]},h]}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":[Pe]}],"row-start-end":[{row:["auto",{span:[Re,h]},h]}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[T]}],"gap-x":[{"gap-x":[T]}],"gap-y":[{"gap-y":[T]}],"justify-content":[{justify:["normal",...le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],Vt:[{Vt:[M]}],Vt:[{Vt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[ge]},ge]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ge,fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ze]}],"font-family":[{font:[Pe]}],"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:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",xe,Ze]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ce,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","Le-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ce,fe]}],"underline-offset":[{"underline-offset":["auto",ce,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...p(),gr]}],"bg-repeat":[{bg:["Le-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[O]}],"gradient-via":[{via:[O]}],"gradient-to":[{to:[O]}],rounded:[{rounded:[n]}],"rounded-Vt":[{"rounded-Vt":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-Vt":[{"rounded-Vt":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-Vt":[{"border-Vt":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:V()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-Vt":[{"border-Vt":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[ce,h]}],"outline-w":[{outline:[ce,fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ce,fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ge,vr]}],"shadow-color":[{shadow:[Pe]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",ge,h]}],grayscale:[{grayscale:[N]}],"hue-rotate":[{"hue-rotate":[R]}],invert:[{invert:[u]}],saturate:[{saturate:[J]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[J]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:de()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:de()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Re,h]}],"translate-x":[{"translate-x":[m]}],"translate-y":[{"translate-y":[m]}],"skew-x":[{"skew-x":[g]}],"skew-y":[{"skew-y":[g]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","Le-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","Vt-resize","w-resize","Vt-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-Vt":[{"scroll-Vt":I()}],"scroll-Vt":[{"scroll-Vt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ce,fe,Ze]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","Vt","Vt","pr","pb","pl"],px:["pr","pl"],py:["Vt","pb"],m:["mx","my","ms","me","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-Vt","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-Vt","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-Vt":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-Vt"],"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-Vt","border-w-e","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-Vt","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-Vt","scroll-Vt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-Vt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var It=ar(Cr);function v(...e){return It((0,Et.clsx)(e))}var Ht=require("@radix-ui/react-slot"),Lt=require("class-variance-authority"),At=X(require("react")),Vt=require("react/jsx-runtime"),Nr=(0,Lt.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),re=At.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...a},n)=>(0,Vt.jsx)(e?Ht.Slot:"button",{className:v(Nr({className:t,size:o,variant:r})),ref:n,...a}));re.displayName="Button";var De=X(require("react")),$=X(require("@radix-ui/react-dialog"));var Ve=$.Root;var qe=$.Portal;var Oe=De.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)($.Overlay,{ref:o,className:v("fixed inset-0 Vt-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Oe.displayName=$.Overlay.displayName;var Ye=De.forwardRef(({className:e,children:t,...o},r)=>(0,Vt.jsxs)(qe,{children:[(0,Vt.jsx)(Oe,{}),(0,Vt.jsxs)($.Content,{ref:r,className:v("fixed left-[50%] top-[50%] Vt-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Vt.jsxs)($.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Vt.jsx)(G.X,{className:"h-4 w-4"}),(0,Vt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ye.displayName=$.Content.displayName;var Qe=({className:e,...t})=>(0,Vt.jsx)("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qe.displayName="DialogHeader";var Rr=({className:e,...t})=>(0,Vt.jsx)("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rr.displayName="DialogFooter";var et=De.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)($.Title,{ref:o,className:v("text-lg font-semibold leading-none tracking-tight",e),...t}));et.displayName=$.Title.displayName;var Pr=De.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)($.Description,{ref:o,className:v("text-sm text-muted-foreground",e),...t}));Pr.displayName=$.Description.displayName;var Ao=X(require("@radix-ui/react-dialog"));var zt=X(require("react")),Se=zt.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)("textarea",{className:v("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Se.displayName="Textarea";var Ut=X(require("react"));var me=Ut.forwardRef(({className:e,type:t,...o},r)=>(0,Vt.jsx)("input",{type:t,className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));me.displayName="Input";var w=X(require("@radix-ui/react-select")),be=X(require("react")),Ft=w.Root;var $t=w.Value,tt=be.forwardRef(({children:e,className:t,...o},r)=>(0,Vt.jsxs)(w.Trigger,{className:v("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:r,...o,children:[e,(0,Vt.jsx)(w.Icon,{asChild:!0,children:(0,Vt.jsx)(G.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));tt.displayName=w.Trigger.displayName;var Kt=be.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.ScrollUpButton,{className:v("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Vt.jsx)(G.ChevronUp,{className:"h-4 w-4"})}));Kt.displayName=w.ScrollUpButton.displayName;var Wt=be.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.ScrollDownButton,{className:v("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Vt.jsx)(G.ChevronDown,{className:"h-4 w-4"})}));Wt.displayName=w.ScrollDownButton.displayName;var ot=be.forwardRef(({children:e,className:t,position:o="popper",...r},a)=>(0,Vt.jsx)(w.Portal,{children:(0,Vt.jsxs)(w.Content,{className:v("relative Vt-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:a,...r,children:[(0,Vt.jsx)(Kt,{}),(0,Vt.jsx)(w.Viewport,{className:v("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Vt.jsx)(Wt,{})]})}));ot.displayName=w.Content.displayName;var Dr=be.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.Label,{className:v("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Dr.displayName=w.Label.displayName;var ze=be.forwardRef(({children:e,className:t,...o},r)=>(0,Vt.jsxs)(w.Item,{className:v("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,Vt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Vt.jsx)(w.ItemIndicator,{children:(0,Vt.jsx)(G.Check,{className:"h-4 w-4"})})}),(0,Vt.jsx)(w.ItemText,{children:e})]}));ze.displayName=w.Item.displayName;var Sr=be.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(w.Separator,{className:v("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Sr.displayName=w.Separator.displayName;var Gt=X(require("react")),rt=X(require("@radix-ui/react-label"));var Mr=(0,Lt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),at=Gt.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(rt.Root,{ref:o,className:v(Mr(),e),...t}));at.displayName=rt.Root.displayName;var it=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:a,className:n="",disabled:i=!1})=>{let[l,b]=(0,Y.useState)(!1),[N,R]=(0,Y.useState)(""),u=()=>{i||(b(!0),R(t))},T=async()=>{N!==t&&await a(e,N),b(!1)},O=D=>{D.key==="Enter"&&!r||D.key==="Enter"&&D.ctrlKey&&r?T():D.key==="Escape"&&(b(!1),R(""))};return(0,Vt.jsxs)("div",{className:`space-y-2 ${n}`,children:[(0,Vt.jsx)(at,{children:o}),l?r?(0,Vt.jsx)(Se,{value:N,onChange:D=>R(D.target.value),onBlur:T,onKeyDown:O,autoFocus:!0,rows:4,className:"resize-none"}):(0,Vt.jsx)(me,{value:N,onChange:D=>R(D.target.value),onBlur:T,onKeyPress:O,autoFocus:!0,className:"text-lg font-medium"}):(0,Vt.jsxs)("div",{onClick:u,className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${r?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Vt.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!i&&(0,Vt.jsx)(G.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var No=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Ro=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Po=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Do=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),So=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Mo=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),To=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Ge=require("@payloadcms/richtext-lexical/lexical/list"),ko=require("@payloadcms/richtext-lexical/lexical/rich-text"),Io=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var yo=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Le=require("@payloadcms/richtext-lexical/lexical/utils"),x=require("@payloadcms/richtext-lexical/lexical"),ht=require("@payloadcms/richtext-lexical/lexical/selection");var io=require("@radix-ui/react-dialog"),Fe=require("@payloadcms/richtext-lexical/client");var lt=X(require("bson-objectid"));var qt=require("@payloadcms/ui");var Jt=X(require("react")),ae=X(require("@radix-ui/react-tooltip"));var _e=ae.Provider,Ue=ae.Root,Be=ae.Trigger,Me=Jt.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Vt.jsx)(ae.Portal,{children:(0,Vt.jsx)(ae.Content,{ref:r,sideOffset:t,className:v("Vt-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Me.displayName=ae.Content.displayName;var Tr=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[a]=(0,yo.useLexicalComposerContext)(),[n,i]=(0,Y.useState)(""),[l,b]=(0,Y.useState)(""),[N,R]=(0,Y.useState)(""),u=async f=>{console.log("fetchMedia",f)};(0,Y.useEffect)(()=>{typeof o=="string"?o.length===24?u(o):(i(o||""),R(S(D())),b(O()||"")):typeof o=="object"&&(i(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),R(S(o.filesize)),b(o.mimeType?.split("/")[1]||""))},[]);let T=(0,Y.useCallback)(()=>{a.update(()=>{(0,x.$getNodeByKey)(r)?.remove()})},[a,r]),O=()=>{let f=e.data.value;return typeof f=="string"?f.split(";base64")[0]?.split("image/")[1]:""},D=()=>{let f=e.data.value;if(typeof f=="string"){let k=f.split(",")[1]?.length||0;return 4*Math.ceil(k/3)*.5624896334383812/1e3}return 0};function S(f){if(f>=1e6){let M=f/1e6;return`${M>=10?Math.round(M).toString():M.toFixed(1)} MB`}return`${Math.floor(f/1e3)} KB`}return(0,Vt.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Vt.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Vt.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Vt.jsx)("div",{className:"flex-1",children:e.data.value?(0,Vt.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:n}):(0,Vt.jsx)(qt.File,{})}),(0,Vt.jsx)(_e,{children:(0,Vt.jsxs)(Ue,{children:[(0,Vt.jsxs)(Be,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Vt.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Vt.jsx)("button",{onClick:f=>{f.preventDefault(),T()},className:"flex-1 flex justify-center items-center",children:(0,Vt.jsx)(G.X,{width:24,height:24,strokeWidth:1})})]}),(0,Vt.jsx)(Me,{children:(0,Vt.jsx)("span",{children:"Remove image"})})]})})]}),(0,Vt.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Vt.jsx)("span",{className:"",children:l?.toLocaleUpperCase()}),(0,Vt.jsx)("span",{children:N})]})]})})},to=Tr;function kr(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:ye({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Te=class extends Fe.UploadNode{static importDOM(){return{img:()=>({conversion:kr,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new lt.default().toHexString(),t.version=3);let o={id:t.id??new lt.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=ye(o);return r.setFormat?.(t.format),r}decorate(){return(0,Vt.jsx)(to,{data:this.__data,nodeKey:this.getKey()})}};function ye(e){return new Te({data:e})}var Ir=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Er=e=>Ir?(e||window).getSelection():null,Ka=(0,x.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),dt=(0,x.createCommand)("INSERT_UPLOAD_COMMAND");function so({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,Y.useRef)(!1),[a,n]=(0,Y.useState)(!0),[i,l]=(0,Y.useState)(""),[b,N]=(0,Y.useState)(""),[R,u]=(0,Y.useState)(!1),[T,O]=(0,Y.useState)("left"),D=i==="",S=C=>{u(C.target.checked)},f=C=>{O(C.target.value)},k=C=>{let j=new FileReader;j.onload=function(){return typeof j.result=="string"&&l(j.result),""},C!==null&&C[0]&&j.readAsDataURL(C[0])};(0,Y.useEffect)(()=>{r.current=!1;let C=j=>{r.current=j.altKey};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}},[e]),(0,Y.useEffect)(()=>{a||t()},[a]),(0,Y.useEffect)(()=>{n(o)},[o]);let M=({editor:C,relationTo:j,replaceNodeKey:g,value:P})=>{if(g)C.update(()=>{let m=(0,x.$getNodeByKey)(g);m&&m.replace(ye({id:"",fields:{},relationTo:"media",value:P}))});else{let m=C.dispatchCommand(dt,{fields:null,relationTo:"media",value:P})}},J=()=>{M({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:b,src:i,showCaption:R,position:T}.src}),n(!1),t()};return(0,Vt.jsx)(Ve,{open:a,onOpenChange:C=>n(C),children:(0,Vt.jsxs)(Ye,{children:[(0,Vt.jsxs)(Qe,{children:[(0,Vt.jsx)(et,{children:"Upload Image"}),(0,Vt.jsx)(io.DialogDescription,{children:"Description"})]}),(0,Vt.jsxs)("div",{className:"",children:[(0,Vt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Vt.jsx)(me,{type:"file",onChange:C=>k(C.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Vt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Vt.jsx)(me,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:C=>N(C.currentTarget.value),value:b,"data-test-id":"image-modal-alt-text-input"})}),(0,Vt.jsx)(re,{"data-test-id":"image-modal-file-upload-btn",disabled:D,onClick:()=>J(),children:"Confirm"})]})]})})}function ct({captionsEnabled:e}){let[t]=(0,yo.useLexicalComposerContext)();return(0,Y.useEffect)(()=>{if(!t.hasNodes([Fe.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Le.mergeRegister)(t.registerCommand(x.DRAGSTART_COMMAND,o=>Hr(o),x.COMMAND_PRIORITY_HIGH),t.registerCommand(x.DRAGOVER_COMMAND,o=>Lr(o),x.COMMAND_PRIORITY_LOW),t.registerCommand(x.DROP_COMMAND,o=>Ar(o,t),x.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Hr(e){if(!mt())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","G"),!0):!1}function Lr(e){return mt()?(lo(e)||e.preventDefault(),!0):!1}function Ar(e,t){let o=mt();if(!o)return!1;if(e.preventDefault(),lo(e)){let r=Vr(e);o.remove();let a=(0,x.$createRangeSelection)();r!=null&&a.applyDOMRange(r),(0,x.$setSelection)(a)}return!0}function mt(){let e=(0,x.$getSelection)();if(!(0,x.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,Fe.$isUploadNode)(o)?o:null}function lo(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function Vr(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,a=Er(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&a!==null)a.collapse(e.rangeParent,e.rangeOffset||0),t=a.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Or=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),co=Or;var zr=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),mo=zr;var _r=()=>(0,Vt.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{Vt:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Vt.jsx)("path",{Vt:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),po=_r;var Ur=()=>(0,Vt.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{Vt:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Vt.jsx)("path",{Vt:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),uo=Ur;var Br=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),fo=Br;var Fr=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),go=Fr;var bo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),ho=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),vo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),xo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),wo=()=>(0,Vt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{Vt:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var ue=X(require("react")),y=X(require("@radix-ui/react-dropdown-menu")),Ce=require("@radix-ui/react-icons");var $e=y.Root,Ke=y.Trigger;var $r=ue.forwardRef(({className:e,inset:t,children:o,...r},a)=>(0,Vt.jsxs)(y.SubTrigger,{ref:a,className:v("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[o,(0,Vt.jsx)(Ce.ChevronRightIcon,{className:"ml-auto"})]}));$r.displayName=y.SubTrigger.displayName;var Kr=ue.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(y.SubContent,{ref:o,className:v("Vt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Kr.displayName=y.SubContent.displayName;var Ee=ue.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Vt.jsx)(y.Portal,{children:(0,Vt.jsx)(y.Content,{ref:r,sideOffset:t,className:v("Vt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Ee.displayName=y.Content.displayName;var He=ue.forwardRef(({className:e,inset:t,...o},r)=>(0,Vt.jsx)(y.Item,{ref:r,className:v("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));He.displayName=y.Item.displayName;var Wr=ue.forwardRef(({className:e,children:t,checked:o,...r},a)=>(0,Vt.jsxs)(y.CheckboxItem,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[(0,Vt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Vt.jsx)(y.ItemIndicator,{children:(0,Vt.jsx)(Ce.CheckIcon,{className:"h-4 w-4"})})}),t]}));Wr.displayName=y.CheckboxItem.displayName;var Gr=ue.forwardRef(({className:e,children:t,...o},r)=>(0,Vt.jsxs)(y.RadioItem,{ref:r,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,Vt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Vt.jsx)(y.ItemIndicator,{children:(0,Vt.jsx)(Ce.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Gr.displayName=y.RadioItem.displayName;var jr=ue.forwardRef(({className:e,inset:t,...o},r)=>(0,Vt.jsx)(y.Label,{ref:r,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));jr.displayName=y.Label.displayName;var Zr=ue.forwardRef(({className:e,...t},o)=>(0,Vt.jsx)(y.Separator,{ref:o,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Zr.displayName=y.Separator.displayName;var Xr=({className:e,...t})=>(0,Vt.jsx)("span",{className:v("ml-auto text-xs tracking-widest opacity-60",e),...t});Xr.displayName="DropdownMenuShortcut";var bt=1;function Jr(){return(0,Vt.jsx)("span",{className:"border border-[#222222]"})}function vt(){let[e]=(0,yo.useLexicalComposerContext)(),t=(0,Y.useRef)(null),[o,r]=(0,Y.useState)(!1),[a,n]=(0,Y.useState)(!1),[i,l]=(0,Y.useState)(!1),[b,N]=(0,Y.useState)(!1),[R,u]=(0,Y.useState)(!1),[T,O]=(0,Y.useState)(!1),[D,S]=(0,Y.useState)(!1),[f,k]=(0,Y.useState)(!1),[M,J]=(0,Y.useState)(!1),[C,j]=(0,Y.useState)("left"),[g,P]=(0,Y.useState)("p"),m=p=>{e.update(()=>{let V=(0,x.$getSelection)();(0,x.$isRangeSelection)(V)&&(p==="p"?(0,ht.$setBlocksType)(V,()=>(0,x.$createParagraphNode)()):(0,ht.$setBlocksType)(V,()=>(0,ko.$createHeadingNode)(p)))})},A=(0,Y.useCallback)(()=>{let p=(0,x.$getSelection)();if((0,x.$isRangeSelection)(p)){l(p.hasFormat("bold")),N(p.hasFormat("italic")),u(p.hasFormat("underline")),O(p.hasFormat("strikethrough")),S(p.hasFormat("subscript")),k(p.hasFormat("superscript"));let V=p.anchor.getNode(),F=V;for(;F&&!(0,x.$isParagraphNode)(F)&&F!==(0,x.$getRoot)();){let q=F.getParent();q&&(F=q)}if(F){let q=F.getFormatType();j(q||"left")}let le=V.getTopLevelElement()?.__tag;P(le||"p")}},[]);(0,Y.useEffect)(()=>(0,Le.mergeRegister)(e.registerUpdateListener(({editorState:p})=>{p.read(()=>{A()})}),e.registerCommand(x.SELECTION_CHANGE_COMMAND,(p,V)=>(A(),!1),bt),e.registerCommand(x.CAN_UNDO_COMMAND,p=>(r(p),!1),bt),e.registerCommand(x.CAN_REDO_COMMAND,p=>(n(p),!1),bt),(0,Le.mergeRegister)(e.registerCommand(dt,p=>(e.update(()=>{let V=(0,x.$getSelection)()||(0,x.$getPreviousSelection)();if((0,x.$isRangeSelection)(V)){let F=ye({id:p.id,fields:p.fields,relationTo:p.relationTo,value:p.value}),{focus:le}=V,q=le.getNode();(0,Le.$insertNodeToNearestRoot)(F),(0,x.$isParagraphNode)(q)&&!q.__first&&q.remove()}}),!0),x.COMMAND_PRIORITY_EDITOR))),[e,A]);let U=[[{label:"Undo",icon:(0,Vt.jsx)(G.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(x.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Vt.jsx)(G.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(x.UNDO_COMMAND,void 0)},disabled:!a}],[{label:"Bold",icon:(0,Vt.jsx)(co,{}),onClick:()=>{e.dispatchCommand(x.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:i},{label:"Italic",icon:(0,Vt.jsx)(mo,{}),onClick:()=>{e.dispatchCommand(x.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:b},{label:"Underline",icon:(0,Vt.jsx)(po,{}),onClick:()=>{e.dispatchCommand(x.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:R},{label:"Strikethrough",icon:(0,Vt.jsx)(uo,{}),onClick:()=>{e.dispatchCommand(x.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:T},{label:"Subscript",icon:(0,Vt.jsx)(fo,{}),onClick:()=>{e.dispatchCommand(x.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:D},{label:"Superscript",icon:(0,Vt.jsx)(go,{}),onClick:()=>{e.dispatchCommand(x.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:f}]],Q=[{label:"Left Align",direction:"left",icon:(0,Vt.jsx)(G.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(x.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Vt.jsx)(G.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(x.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Vt.jsx)(G.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(x.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Vt.jsx)(G.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(x.FORMAT_ELEMENT_COMMAND,"justify")}}],se=[{label:"Normal Text",value:"p",icon:(0,Vt.jsx)(bo,{}),onClick:()=>m("p")},{label:"Heading 1",value:"h1",icon:(0,Vt.jsx)(ho,{}),onClick:()=>m("h1")},{label:"Heading 2",value:"h2",icon:(0,Vt.jsx)(vo,{}),onClick:()=>m("h2")},{label:"Heading 3",value:"h3",icon:(0,Vt.jsx)(xo,{}),onClick:()=>m("h3")},{label:"Heading 4",value:"h4",icon:(0,Vt.jsx)(wo,{}),onClick:()=>m("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Vt.jsx)(G.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ge.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Vt.jsx)(G.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ge.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ie=[{label:"Insert Image",icon:(0,Vt.jsx)(G.ImageUp,{width:15,height:15}),onClick:()=>{J(!0)},disabled:!1}];return(0,Vt.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,Vt.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[U.map((p,V)=>(0,Vt.jsxs)(Y.Fragment,{children:[(0,Vt.jsx)("div",{className:"flex items-center gap-2",children:p.map((F,le)=>(0,Vt.jsx)("div",{role:"button","aria-disabled":F.disabled||!1,onClick:F.onClick,className:v("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",F.active&&"bg-[#3c3c3c]"),"aria-label":F.label,children:(0,Vt.jsx)(_e,{children:(0,Vt.jsxs)(Ue,{children:[(0,Vt.jsx)(Be,{className:"text-[#b5b5b5]",children:F.icon}),(0,Vt.jsx)(Me,{children:(0,Vt.jsx)("p",{children:F.label})})]})})},le))}),(0,Vt.jsx)(Jr,{})]},`toolbar-option-${p.length}-${V}`)),(0,Vt.jsxs)($e,{children:[(0,Vt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[Q.find(p=>p.direction===C)?.icon,Q.find(p=>p.direction===C)?.label,(0,Vt.jsx)(G.ChevronDown,{width:15,height:15})]}),(0,Vt.jsx)(Ee,{className:"bg-black hover:bg-black",children:Q.map((p,V)=>(0,Vt.jsxs)(He,{onClick:p.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Vt.jsx)("span",{children:p.icon}),(0,Vt.jsx)("span",{children:p.label})]},`${p.label}-${V}`))})]}),(0,Vt.jsxs)($e,{children:[(0,Vt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[se.find(p=>p.value===g)?.icon,se.find(p=>p.value===g)?.label,(0,Vt.jsx)(G.ChevronDown,{width:15,height:15})]}),(0,Vt.jsx)(Ee,{className:"bg-black hover:bg-black",children:se.map((p,V)=>(0,Vt.jsxs)(He,{onClick:p.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Vt.jsx)("span",{children:p.icon}),(0,Vt.jsx)("span",{children:p.label})]},`heading-option-${p.label}-${V}`))})]}),(0,Vt.jsxs)($e,{children:[(0,Vt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Vt.jsx)(G.Plus,{width:15,height:15}),(0,Vt.jsx)(G.ChevronDown,{width:15,height:15})]}),(0,Vt.jsx)(Ee,{className:"bg-black hover:bg-black",children:ie.map((p,V)=>(0,Vt.jsxs)(He,{onClick:p.onClick,disabled:p.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Vt.jsx)("span",{children:p.icon}),(0,Vt.jsx)("span",{children:p.label})]},V))})]}),M&&(0,Vt.jsx)(so,{activeEditor:e,onClose:()=>{J(!1)},isOpen:M})]})})}var qr=({setValue:e,value:t,name:o,editable:r=!0})=>{let[a]=(0,yo.useLexicalComposerContext)(),n=i=>{i.read(()=>{let l=i.toJSON();e?.(()=>l)})};return(0,Y.useEffect)(()=>{a.setEditable(r)},[r]),(0,Y.useEffect)(()=>{t&&a.update(()=>{a.setEditorState(a.parseEditorState(t))})},[]),(0,Vt.jsx)("div",{className:"w-full",children:(0,Vt.jsxs)("div",{className:" ",children:[r&&(0,Vt.jsx)(vt,{}),(0,Vt.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Vt.jsx)(Mo.RichTextPlugin,{contentEditable:(0,Vt.jsx)(Po.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Do.LexicalErrorBoundary}),r&&(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(So.HistoryPlugin,{}),(0,Vt.jsx)(No.AutoFocusPlugin,{}),(0,Vt.jsx)(To.ListPlugin,{}),(0,Vt.jsx)(Io.OnChangePlugin,{onChange:n}),(0,Vt.jsx)(ct,{})]})]})]})})},Yr=({setValue:e,value:t,name:o,editable:r=!0})=>(0,Vt.jsx)(Ro.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Ge.ListNode,Ge.ListItemNode,ko.HeadingNode,Te],onError(n){throw console.error("Lexical error:",n),n},theme:{code:"editor-code",heading:{h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Vt.jsx)(qr,{value:t,setValue:e,name:o,editable:r})}),je=Yr;function Ho({document:e,onSave:t,mode:o="edit",onCancel:r,availableDocuments:a=[],knowledgeContexts:n=[]}){let[i,l]=(0,Y.useState)({...e,updatedAt:new Date}),[b,N]=(0,Y.useState)(!1),[R,u]=(0,Y.useState)(i.richTextContent);(0,Y.useEffect)(()=>{l(e)},[e]);let T=g=>{switch(g){case"markdown":case"mdx":return(0,Vt.jsx)(G.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Vt.jsx)(G.File,{className:"h-6 w-6 text-success"});case"text":return(0,Vt.jsx)(G.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Vt.jsx)(G.File,{className:"h-6 w-6 text-muted-foreground"})}},O=g=>{switch(g){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},D=()=>{let g=new Set,P=new Set;return n.forEach(m=>{m.menuConfig.groupBy.forEach(A=>g.add(A))}),a.forEach(m=>{m.metadata&&Object.keys(m.metadata).forEach(A=>P.add(A))}),{contextKeys:Array.from(g).sort(),documentKeys:Array.from(P).sort(),allKeys:Array.from(new Set([...g,...P])).sort()}},S=g=>{let P=new Set;return a.forEach(m=>{m.metadata?.[g]&&P.add(String(m.metadata[g]))}),Array.from(P).sort()},f=D(),k=()=>{t({...i,richTextContent:R})},M=(g,P)=>{l(m=>({...m,metadata:{...m.metadata,[g]:P}}))},J=(g,P)=>{P==="__custom__"?M(g,""):M(g,P)},C=()=>{M("","")},j=g=>{l(P=>{let m={...P.metadata};return delete m[g],{...P,metadata:m}})};return(0,Vt.jsxs)(yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Vt.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,Vt.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Vt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Vt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Vt.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Vt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Vt.jsx)(it,{fieldName:"title",value:i.title,label:"",onSave:(g,P)=>l(m=>({...m,title:P})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Vt.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${O(i.format)} flex-shrink-0 mt-1`,children:i.format.toUpperCase()})]}),(0,Vt.jsx)("div",{className:"mt-2",children:(0,Vt.jsx)(it,{fieldName:"description",value:i.description||"Click to add description...",label:"",multiline:!0,onSave:(g,P)=>l(m=>({...m,description:P})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Vt.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Vt.jsxs)(re,{variant:"ghost",size:"sm",onClick:()=>N(!b),className:"gap-2",children:[(0,Vt.jsx)(G.Info,{className:"h-4 w-4"}),"Metadata",i.metadata&&Object.keys(i.metadata).length>0&&(0,Vt.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(i.metadata).length}),b?(0,Vt.jsx)(G.ChevronDown,{className:"h-4 w-4"}):(0,Vt.jsx)(G.ChevronRight,{className:"h-4 w-4"})]}),(0,Vt.jsxs)(re,{variant:"outline",size:"sm",onClick:r,className:"gap-2",children:[(0,Vt.jsx)(G.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Vt.jsxs)(re,{size:"sm",onClick:k,className:"gap-2",children:[(0,Vt.jsx)(G.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,Vt.jsx)(yt.motion.div,{initial:!1,animate:{height:b?"auto":0,opacity:b?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Vt.jsxs)("div",{className:"Vt-4 border-t border-border mt-4 h-screen max-h-full flex",children:[(0,Vt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Vt.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Vt.jsx)(G.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Vt.jsxs)(re,{type:"button",variant:"outline",size:"sm",onClick:C,className:"gap-1 h-8",children:[(0,Vt.jsx)(G.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,Vt.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:i.metadata&&Object.keys(i.metadata).length>0?(0,Vt.jsx)("div",{className:"space-y-2",children:Object.entries(i.metadata).map(([g,P],m)=>{let A=S(g);return(0,Vt.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Vt.jsx)(me,{value:g,onChange:U=>{let Q=U.target.value||"",I=i.metadata?.[g];l(se=>{let ie={...se.metadata};return delete ie[g],Q&&(ie[Q]=I||""),{...se,metadata:ie}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${g}`}),(0,Vt.jsx)("datalist",{id:`metadata-keys-${g}`,children:f.allKeys.map(U=>(0,Vt.jsx)("option",{value:U},U))}),(0,Vt.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),A.length>0?(0,Vt.jsxs)(Ft,{value:String(P||""),onValueChange:U=>J(g,U),children:[(0,Vt.jsx)(tt,{className:"flex-1 h-8 text-sm",children:(0,Vt.jsx)($t,{placeholder:"Value"})}),(0,Vt.jsxs)(ot,{children:[A.map(U=>(0,Vt.jsx)(ze,{value:U,children:U},U)),(0,Vt.jsx)(ze,{value:"__custom__",children:(0,Vt.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Vt.jsx)(me,{value:String(P||""),onChange:U=>M(g,U.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Vt.jsx)(re,{type:"button",variant:"ghost",size:"sm",onClick:()=>j(g),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Vt.jsx)(G.X,{className:"h-3 w-3"})})]},`metadata-key-${m}`)})}):(0,Vt.jsxs)("div",{className:"text-center py-4",children:[(0,Vt.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Vt.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})})]})})]}),(0,Vt.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Vt.jsx)("div",{className:"p-8 h-full max-h-full overflow-auto",children:i.format==="richText"?(0,Vt.jsx)(je,{setValue:u,value:R,name:"richTextContent"}):(0,Vt.jsx)(Se,{value:i.content||"",onChange:g=>l(P=>({...P,content:g.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var Vo=X(require("react-markdown")),Oo=X(require("remark-gfm"));var zo=e=>(0,Vt.jsx)(Vo.default,{remarkPlugins:[Oo.default],components:{h1:({children:t})=>(0,Vt.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,Vt.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,Vt.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,Vt.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,Vt.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,Vt.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,Vt.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,Vt.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:o})=>(0,Vt.jsx)("a",{href:o,className:"text-blue-500",children:t}),img:({src:t,alt:o})=>(0,Vt.jsx)("img",{src:t,alt:o,className:"mb-4"}),blockquote:({children:t})=>(0,Vt.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),Lo=e=>(0,Vt.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Qr=e=>(0,Vt.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,Vt.jsx)(je,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),ea=e=>(0,Vt.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Vt.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,Vt.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Vt.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),zo(e)]});function ta({document:e,onDocumentUpdate:t,editable:o=!0,mode:r="view",renderers:a,availableDocuments:n=[],knowledgeContexts:i=[]}){let[l,b]=(0,Y.useState)(!1),[N,R]=(0,Y.useState)(!1),[u,T]=(0,Y.useState)(e),[O,D]=(0,Y.useState)(!1),S=(0,Y.useRef)(null),f=u.format==="richText"?u.richTextContent:u.content,k=(0,Y.useMemo)(()=>`${u.format}:${JSON.stringify(f)}`,[u.format,f]);(0,Y.useEffect)(()=>{T(e)},[e]);let M=m=>{switch(m){case"markdown":case"mdx":return(0,Vt.jsx)(G.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Vt.jsx)(G.File,{className:"h-6 w-6 text-success"});case"text":return(0,Vt.jsx)(G.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Vt.jsx)(G.File,{className:"h-6 w-6 text-muted-foreground"})}},J=m=>{switch(m){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},C=(m,A)=>{let U={markdown:zo,mdx:ea,text:Lo},Q=a?.[A]||U[A];if(A==="richText"&&typeof m=="object")return Qr(m);if(Q&&typeof m=="string")return Q(m);if(typeof m=="string")return Lo(m)},j=async m=>{D(!0),S.current=u,(0,Y.startTransition)(()=>{T({...m,richTextContent:m.richTextContent?structuredClone(m.richTextContent):void 0})});try{let A=await t?.(m);if(D(!1),!A)throw new Error("save failed");b(!1)}catch{S.current&&(0,Y.startTransition)(()=>T(S.current))}},g=()=>{b(!1)};return(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(Ve,{open:l||r==="create",onOpenChange:m=>!m&&g(),children:(0,Vt.jsxs)(qe,{children:[(0,Vt.jsx)(Oe,{}),(0,Vt.jsxs)(Ao.Content,{className:v("fixed inset-0 Vt-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[O&&(0,Vt.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,Vt.jsx)(G.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,Vt.jsx)(Ho,{mode:r==="create"?"create":"edit",document:u,onSave:j,onCancel:g,availableDocuments:n,knowledgeContexts:i})]})]})}),(0,Vt.jsxs)(yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Vt.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,Vt.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Vt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Vt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Vt.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[u.title,(0,Vt.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${J(u.format)}`,children:u.format.toUpperCase()})]}),u.description&&(0,Vt.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:u.description})]})}),(0,Vt.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[u.metadata&&Object.keys(u.metadata).length>0&&(0,Vt.jsxs)(re,{variant:"ghost",size:"sm",onClick:()=>R(!N),className:"gap-2",children:[(0,Vt.jsx)(G.Info,{className:"h-4 w-4"}),"Metadata",N?(0,Vt.jsx)(G.ChevronDown,{className:"h-4 w-4"}):(0,Vt.jsx)(G.ChevronRight,{className:"h-4 w-4"})]}),o&&(0,Vt.jsxs)(re,{variant:"outline",size:"sm",onClick:()=>b(!0),className:"gap-2",children:[(0,Vt.jsx)(G.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),u.metadata&&Object.keys(u.metadata).length>0&&(0,Vt.jsx)(yt.motion.div,{initial:!1,animate:{height:N?"auto":0,opacity:N?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Vt.jsxs)("div",{className:"Vt-4 border-t border-border mt-4",children:[(0,Vt.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,Vt.jsx)(G.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Vt.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,Vt.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(u.metadata).map(([m,A])=>(0,Vt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Vt.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:m.replace(/([A-Vt])/g," $1").trim()}),(0,Vt.jsx)("span",{className:"text-foreground font-medium",children:String(A)})]},m))})})]})})]}),(0,Vt.jsx)("div",{className:"flex-1 ",children:(0,Vt.jsx)("div",{className:"py-4 h-full",children:(0,Vt.jsx)("div",{className:"space-y-4",children:u.content||u.richTextContent?(0,Vt.jsx)("div",{className:"relative",children:(0,Vt.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:C(u.format==="richText"?u.richTextContent:u.content,u.format)})},k):(0,Vt.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Vt.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Vt.jsx)(G.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Vt.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Vt.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}0&&(module.exports={DocumentPreview});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a}from"../../chunk-V4W2JDQB.mjs";import"../../chunk-TZCRIKIJ.mjs";import"../../chunk-N6CZEXLZ.mjs";import"../../chunk-M456UF2N.mjs";import"../../chunk-UP67R64J.mjs";import"../../chunk-6QERRKM4.mjs";import"../../chunk-VSU7LYXZ.mjs";import"../../chunk-RKS7CWAP.mjs";import"../../chunk-BZEGLKRZ.mjs";import"../../chunk-K7N3FRGH.mjs";import"../../chunk-IPRG56MW.mjs";import"../../chunk-HFEN3KJC.mjs";import"../../chunk-L2UJOICL.mjs";import"../../chunk-T3F3RQIC.mjs";import"../../chunk-DFIXTV2M.mjs";import"../../chunk-YFAZQYK4.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as DocumentPreview};
2
+ "use strict";import{a}from"../../chunk-ADA43MGG.mjs";import"../../chunk-VLVR5VHG.mjs";import"../../chunk-S4PW6SKD.mjs";import"../../chunk-K7NZWTGP.mjs";import"../../chunk-T3F3RQIC.mjs";import"../../chunk-UP67R64J.mjs";import"../../chunk-6QERRKM4.mjs";import"../../chunk-VSU7LYXZ.mjs";import"../../chunk-RKS7CWAP.mjs";import"../../chunk-BZEGLKRZ.mjs";import"../../chunk-K7N3FRGH.mjs";import"../../chunk-IPRG56MW.mjs";import"../../chunk-HFEN3KJC.mjs";import"../../chunk-L2UJOICL.mjs";import"../../chunk-DFIXTV2M.mjs";import"../../chunk-YFAZQYK4.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as DocumentPreview};
@@ -1,6 +1,7 @@
1
1
  export { AppSidebarLeft } from './AppSidebarLeft';
2
2
  export { DashboardHeader } from './DashboardHeader';
3
3
  export { FoundaryLayout } from './foundary-layout';
4
+ export { Login } from './Login';
4
5
  export { default as MainPage } from './MainPage';
5
6
  export { ManagementSidebar } from './ManagementSidebar';
6
7
  export { SearchableSelect } from './SearchableSelect';