cortex-react-components 2.22.4 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
- package/dist/{chunk-SCBDVNHG.mjs → chunk-AF3FLXBA.mjs} +1 -1
- package/dist/{chunk-CGR5NBBF.mjs → chunk-AHMDJQZI.mjs} +1 -1
- package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
- package/dist/{chunk-TL2RQFU5.mjs → chunk-B7AXSCTN.mjs} +1 -1
- package/dist/{chunk-RIZ2ODJL.mjs → chunk-GZ7FGBTR.mjs} +1 -1
- package/dist/{chunk-CSZCPO6D.mjs → chunk-IAFKJKBN.mjs} +1 -1
- package/dist/{chunk-GPFPTU7U.mjs → chunk-INBT5E6T.mjs} +1 -1
- package/dist/{chunk-2W4GQ3FI.mjs → chunk-JCWFPKF3.mjs} +1 -1
- package/dist/chunk-JTMIQ7MK.mjs +4 -0
- package/dist/{chunk-WUA65ZZB.mjs → chunk-L3BLBPSR.mjs} +1 -1
- package/dist/{chunk-75WE6ZXB.mjs → chunk-LAQ3QAUW.mjs} +1 -1
- package/dist/chunk-LEUI66J6.mjs +1 -0
- package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
- package/dist/{chunk-S7MFNEEY.mjs → chunk-OWC4BAX6.mjs} +1 -1
- package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
- package/dist/{chunk-D7VHHXGM.mjs → chunk-PZFYJ5FS.mjs} +1 -1
- package/dist/{chunk-F2MJXGRT.mjs → chunk-RS4VD3ML.mjs} +1 -1
- package/dist/chunk-TSFX33PR.mjs +4 -0
- package/dist/{chunk-UTJZH3X5.mjs → chunk-W4OD5UUE.mjs} +1 -1
- package/dist/chunk-WLI2YTOQ.mjs +1 -0
- package/dist/chunk-XJKRA2AE.mjs +4 -0
- package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
- package/dist/components/Foundary/Knowledge/manage-team-context.css +1 -0
- package/dist/components/Foundary/Knowledge/manage-team-context.d.ts +11 -0
- package/dist/components/Foundary/Knowledge/manage-team-context.js +4 -0
- package/dist/components/Foundary/Knowledge/manage-team-context.mjs +1 -0
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/RichText/index.js +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.js +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.d.ts +4 -2
- package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/index.js +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/document-edit.d.ts +1 -1
- package/dist/components/Foundary/document-edit.js +1 -1
- package/dist/components/Foundary/document-edit.mjs +1 -1
- package/dist/components/Foundary/document-preview-examples.js +4 -4
- package/dist/components/Foundary/document-preview-examples.mjs +1 -1
- package/dist/components/Foundary/document-preview.js +1 -1
- package/dist/components/Foundary/document-preview.mjs +1 -1
- package/dist/components/Foundary/index.js +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.js +1 -1
- package/dist/components/Foundary/knowledge-browser.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/index.js +20 -20
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +30 -30
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-HMZKODQJ.mjs +0 -4
- package/dist/chunk-NIGA3VKZ.mjs +0 -4
- package/dist/chunk-U2OXF7PJ.mjs +0 -1
- package/dist/chunk-UOA5RYVR.mjs +0 -1
- package/dist/chunk-YLEBXRJS.mjs +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as z}from"../../chunk-2UNIT7NC.mjs";import{a as u}from"../../chunk-
|
|
1
|
+
import{a as z}from"../../chunk-2UNIT7NC.mjs";import{a as u}from"../../chunk-IAFKJKBN.mjs";import{a as t}from"../../chunk-TSFX33PR.mjs";import{a as p}from"../../chunk-INBT5E6T.mjs";import"../../chunk-I6XKBCH4.mjs";import"../../chunk-WLI2YTOQ.mjs";import"../../chunk-GAU24H4A.mjs";import{a as n}from"../../chunk-M2REXGQW.mjs";import{a as s}from"../../chunk-GZ7FGBTR.mjs";import{a as o}from"../../chunk-CJ6APTVT.mjs";import"../../chunk-I4GYQZGM.mjs";import{a as i}from"../../chunk-HB57GPGK.mjs";import{a as k}from"../../chunk-KKW3FINI.mjs";import{a as j}from"../../chunk-5HT2KC5I.mjs";import{a as l}from"../../chunk-FSCDCSVK.mjs";import{a as r}from"../../chunk-XJKRA2AE.mjs";import{a as q}from"../../chunk-JTMIQ7MK.mjs";import"../../chunk-PZFYJ5FS.mjs";import"../../chunk-LEUI66J6.mjs";import"../../chunk-HFEN3KJC.mjs";import"../../chunk-L2UJOICL.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{a as m}from"../../chunk-NDZ26EG6.mjs";import{a as c}from"../../chunk-CRAFZGCI.mjs";import{a as b}from"../../chunk-JDMIQLAZ.mjs";import{a as e}from"../../chunk-E6NVWHRS.mjs";import{a as d}from"../../chunk-LCSO56PM.mjs";import"../../chunk-SDMPCZ2S.mjs";import{a as f}from"../../chunk-RS4VD3ML.mjs";import{a as g}from"../../chunk-J4QINTHR.mjs";import{a}from"../../chunk-5NIEZE7A.mjs";import"../../chunk-R4SE63GR.mjs";import{a as x}from"../../chunk-UECG3SCG.mjs";import"../../chunk-QOZ2O3FG.mjs";import"../../chunk-L5NPH5RX.mjs";import"../../chunk-KZCIHFTM.mjs";import{a as w}from"../../chunk-2R3MJSQ7.mjs";import{a as y}from"../../chunk-TKCFCYEQ.mjs";import"../../chunk-CDVRH3MC.mjs";import"../../chunk-KPTGYVDM.mjs";import"../../chunk-UM57PWI7.mjs";import"../../chunk-ZHBYZ4HE.mjs";import"../../chunk-AB43AQKL.mjs";import"../../chunk-NGX2VCHS.mjs";import"../../chunk-6PS55VJZ.mjs";import"../../chunk-KG7HG2VO.mjs";import"../../chunk-L3V5YDPH.mjs";import"../../chunk-QC2UWZWL.mjs";import"../../chunk-5RTGHMF3.mjs";import{a as v}from"../../chunk-NAGBKKTZ.mjs";import"../../chunk-JXQRVEQB.mjs";import"../../chunk-DCOFQFVJ.mjs";import"../../chunk-VGWDYD6Z.mjs";import"../../chunk-DXRAJQMA.mjs";import"../../chunk-Z22NSJMF.mjs";import{a as h}from"../../chunk-EZC3YWSQ.mjs";import"../../chunk-YRMNCHFO.mjs";import"../../chunk-EOR2BAI2.mjs";import"../../chunk-Y7H3EUBR.mjs";import"../../chunk-4WA47ZQA.mjs";import"../../chunk-NPVUICIF.mjs";import"../../chunk-6SWKEZN6.mjs";import"../../chunk-DFIXTV2M.mjs";import"../../chunk-VDN4LQSS.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-MU5WPW4N.mjs";import"../../chunk-AZKOVKSK.mjs";import"../../chunk-UVHMI3PU.mjs";import"../../chunk-Q5Q3DJWU.mjs";import"../../chunk-U5PBLRRV.mjs";import"../../chunk-4QRKVSTE.mjs";import"../../chunk-E4TE4NV6.mjs";import"../../chunk-JFFTEK6Z.mjs";import"../../chunk-JHNVX4UB.mjs";import"../../chunk-7BXIU4ZM.mjs";import"../../chunk-YFAZQYK4.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-76M7JE4D.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-OYZDAMCS.mjs";import"../../chunk-5NRGSTPV.mjs";import"../../chunk-ZFUP5NVF.mjs";import"../../chunk-4UIARERB.mjs";import"../../chunk-D4IMQTVU.mjs";import"../../chunk-7GSXNSLD.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-22LHS2J6.mjs";import"../../chunk-IC2ABKAM.mjs";import"../../chunk-FHMQVAKQ.mjs";import"../../chunk-X5KZKO2V.mjs";import"../../chunk-7WIO2CIC.mjs";import"../../chunk-55EX54R7.mjs";import"../../chunk-6C4WESLL.mjs";import"../../chunk-LAQ3QAUW.mjs";import"../../chunk-PDY7JYY3.mjs";import"../../chunk-L3BLBPSR.mjs";import"../../chunk-Q5XT55O3.mjs";import"../../chunk-WISC5QJV.mjs";import"../../chunk-ZDPQXVTF.mjs";import"../../chunk-WISCWNL2.mjs";import"../../chunk-FMJBJ3HN.mjs";import"../../chunk-FVM5SQT2.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-WU3JMLSC.mjs";import"../../chunk-BZAYEKYC.mjs";import"../../chunk-FRWX5YES.mjs";import"../../chunk-CV7PH2KH.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as AppSidebarLeft,i as ColleagueCard,k as ColleagueForm,l as ColleagueTypeSelection,p as ColleaguesView,b as DashboardHeader,u as DashboardPage,m as DigitalColleagueClone,n as DigitalColleagueOptions,q as DocumentEdit,r as DocumentPreview,v as FileView,c as FoundaryLayout,s as KnowledgeBrowser,j as KnowledgeSearch,t as KnowledgeView,e as LandingMenu,d as Login,f as MainPage,g as ManagementSidebar,w as PlanningView,x as ProjectView,y as ProjectsIndexView,h as SearchableSelect,o as TeamForm,z as TeamsIndexView};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use strict";"use client";var Jo=Object.create;var Ue=Object.defineProperty;var qo=Object.getOwnPropertyDescriptor;var Yo=Object.getOwnPropertyNames;var Qo=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty;var tr=(e,t)=>{for(var o in t)Ue(e,o,{get:t[o],enumerable:!0})},Et=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Yo(t))!er.call(e,n)&&n!==o&&Ue(e,n,{get:()=>t[n],enumerable:!(r=qo(t,n))||r.enumerable});return e};var j=(e,t,o)=>(o=e!=null?Jo(Qo(e)):{},Et(t||!e||!e.__esModule?Ue(o,"default",{value:e,enumerable:!0}):o,e)),or=e=>Et(Ue({},"__esModule",{value:!0}),e);var fn={};tr(fn,{KnowledgeBrowser:()=>un});module.exports=or(fn);var Re=require("motion/react"),ce=require("lucide-react"),de=require("react");var Kt=j(require("react"));var Ut=require("clsx");var ot="-",rr=e=>{let t=ar(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{let s=i.split(ot);return s[0]===""&&s.length!==1&&s.shift(),At(s,t)||nr(i)},getConflictingClassGroupIds:(i,s)=>{let f=o[i]||[];return s&&r[i]?[...f,...r[i]]:f}}},At=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),n=r?At(e.slice(1),r):void 0;if(n)return n;if(t.validators.length===0)return;let a=e.join(ot);return t.validators.find(({validator:i})=>i(a))?.classGroupId},Ht=/^\[(.+)\]$/,nr=e=>{if(Ht.test(e)){let t=Ht.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},ar=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return sr(Object.entries(e.classGroups),o).forEach(([a,i])=>{tt(i,r,a,t)}),r},tt=(e,t,o,r)=>{e.forEach(n=>{if(typeof n=="string"){let a=n===""?t:Lt(t,n);a.classGroupId=o;return}if(typeof n=="function"){if(ir(n)){tt(n(r),t,o,r);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([a,i])=>{tt(i,Lt(t,a),o,r)})})},Lt=(e,t)=>{let o=e;return t.split(ot).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},ir=e=>e.isThemeGetter,sr=(e,t)=>t?e.map(([o,r])=>{let n=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,s])=>[t+i,s])):a);return[o,n]}):e,lr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,n=(a,i)=>{o.set(a,i),t++,t>e&&(t=0,r=o,o=new Map)};return{get(a){let i=o.get(a);if(i!==void 0)return i;if((i=r.get(a))!==void 0)return n(a,i),i},set(a,i){o.has(a)?o.set(a,i):n(a,i)}}},Ot="!",dr=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,n=t[0],a=t.length,i=s=>{let f=[],S=0,R=0,g;for(let h=0;h<s.length;h++){let b=s[h];if(S===0){if(b===n&&(r||s.slice(h,h+a)===t)){f.push(s.slice(R,h)),R=h+a;continue}if(b==="/"){g=h;continue}}b==="["?S++:b==="]"&&S--}let I=f.length===0?s:s.substring(R),v=I.startsWith(Ot),x=v?I.substring(1):I,H=g&&g>R?g-R:void 0;return{modifiers:f,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:H}};return o?s=>o({className:s,parseClassName:i}):i},cr=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},mr=e=>({cache:lr(e.cacheSize),parseClassName:dr(e),...rr(e)}),pr=/\s+/,ur=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:n}=t,a=[],i=e.trim().split(pr),s="";for(let f=i.length-1;f>=0;f-=1){let S=i[f],{modifiers:R,hasImportantModifier:g,baseClassName:I,maybePostfixModifierPosition:v}=o(S),x=!!v,H=r(x?I.substring(0,v):I);if(!H){if(!x){s=S+(s.length>0?" "+s:s);continue}if(H=r(I),!H){s=S+(s.length>0?" "+s:s);continue}x=!1}let h=cr(R).join(":"),b=g?h+Ot:h,P=b+H;if(a.includes(P))continue;a.push(P);let F=n(H,x);for(let M=0;M<F.length;++M){let B=F[M];a.push(b+B)}s=S+(s.length>0?" "+s:s)}return s};function fr(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Vt(t))&&(r&&(r+=" "),r+=o);return r}var Vt=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Vt(e[r]))&&(o&&(o+=" "),o+=t);return o};function gr(e,...t){let o,r,n,a=i;function i(f){let S=t.reduce((R,g)=>g(R),e());return o=mr(S),r=o.cache.get,n=o.cache.set,a=s,s(f)}function s(f){let S=r(f);if(S)return S;let R=ur(f,o);return n(f,R),R}return function(){return a(fr.apply(null,arguments))}}var O=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},zt=/^\[(?:([a-ce-]+):)?(.+)\]$/i,hr=/^\$t+\/\$t+$/,br=new Set(["px","full","screen"]),vr=/^(\$t+(\.\$t+)?)?(xs|sm|md|lg|xl)$/,xr=/\$t+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yr=/^(inset_)?-?((\$t+)?\.?(\$t+)[a-ce]+|0)_-?((\$t+)?\.?(\$t+)[a-ce]+|0)/,Cr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ge=e=>De(e)||br.has(e)||hr.test(e),ve=e=>Pe(e,"length",Tr),De=e=>!!e&&!Number.isNaN(Number(e)),et=e=>Pe(e,"number",De),Te=e=>!!e&&Number.isInteger(Number(e)),Nr=e=>e.endsWith("%")&&De(e.slice(0,-1)),N=e=>zt.test(e),xe=e=>vr.test(e),Rr=new Set(["length","size","percentage"]),Dr=e=>Pe(e,Rr,_t),Pr=e=>Pe(e,"position",_t),Sr=new Set(["image","url"]),Mr=e=>Pe(e,Sr,Er),kr=e=>Pe(e,"",Ir),Ie=()=>!0,Pe=(e,t,o)=>{let r=zt.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},Tr=e=>xr.test(e)&&!wr.test(e),_t=()=>!1,Ir=e=>yr.test(e),Er=e=>Cr.test(e);var Hr=()=>{let e=O("colors"),t=O("spacing"),o=O("blur"),r=O("brightness"),n=O("borderColor"),a=O("borderRadius"),i=O("borderSpacing"),s=O("borderWidth"),f=O("contrast"),S=O("grayscale"),R=O("hueRotate"),g=O("invert"),I=O("gap"),v=O("gradientColorStops"),x=O("gradientColorStopPositions"),H=O("inset"),h=O("margin"),b=O("opacity"),P=O("padding"),F=O("saturate"),M=O("scale"),B=O("sepia"),w=O("skew"),C=O("space"),c=O("translate"),A=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto",N,t],E=()=>[N,t],pe=()=>["",ge,ve],me=()=>["auto",De,N],u=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",N],It=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[De,N];return{cacheSize:500,separator:":",theme:{colors:[Ie],spacing:[ge,ve],blur:["none","",xe,N],brightness:fe(),borderColor:[e],borderRadius:["none","","full",xe,N],borderSpacing:E(),borderWidth:pe(),contrast:fe(),grayscale:Q(),hueRotate:fe(),invert:Q(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Nr,ve],inset:Y(),margin:Y(),opacity:fe(),padding:E(),saturate:fe(),scale:fe(),sepia:Q(),skew:fe(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[xe]}],"break-after":[{"break-after":It()}],"break-before":[{"break-before":It()}],"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:[...u(),N]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[H]}],"inset-x":[{"inset-x":[H]}],"inset-y":[{"inset-y":[H]}],start:[{start:[H]}],end:[{end:[H]}],top:[{top:[H]}],right:[{right:[H]}],bottom:[{bottom:[H]}],left:[{left:[H]}],visibility:["visible","invisible","collapse"],ce:[{ce:["auto",Te,N]}],basis:[{basis:Y()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",Te,N]}],"grid-cols":[{"grid-cols":[Ie]}],"col-start-end":[{col:["auto",{span:["full",Te,N]},N]}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":[Ie]}],"row-start-end":[{row:["auto",{span:[Te,N]},N]}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[I]}],"gap-x":[{"gap-x":[I]}],"gap-y":[{"gap-y":[I]}],"justify-content":[{justify:["normal",...ue()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ue(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ue(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],$t:[{$t:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],pt:[{pt:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],$t:[{$t:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[xe]},xe]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xe,ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",et]}],"font-family":[{font:[Ie]}],"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",N]}],"line-clamp":[{"line-clamp":["none",De,et]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ge,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","$t-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ge,ve]}],"underline-offset":[{"underline-offset":["auto",ge,N]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],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",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...u(),Pr]}],"bg-repeat":[{bg:["$t-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","$t","tl"]},Mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-$t":[{"rounded-$t":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-de":[{"rounded-de":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-$t":[{"border-$t":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:_()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-$t":[{"border-$t":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[ge,N]}],"outline-w":[{outline:[ge,ve]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ge,ve]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xe,kr]}],"shadow-color":[{shadow:[Ie]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",xe,N]}],grayscale:[{grayscale:[S]}],"hue-rotate":[{"hue-rotate":[R]}],invert:[{invert:[g]}],saturate:[{saturate:[F]}],sepia:[{sepia:[B]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[S]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[F]}],"backdrop-sepia":[{"backdrop-sepia":[B]}],"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",N]}],duration:[{duration:fe()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:fe()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Te,N]}],"translate-x":[{"translate-x":[c]}],"translate-y":[{"translate-y":[c]}],"skew-x":[{"skew-x":[w]}],"skew-y":[{"skew-y":[w]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],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","$t-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-$t":[{"scroll-$t":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-$t":[{"scroll-$t":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ge,ve,et]}],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"],$t:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],$t:["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-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-$t","rounded-ss","rounded-se","rounded-de","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-de"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-$t":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-$t"],"border-w-x":["border-w-r","border-w-$t"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-$t"],"border-color-x":["border-color-r","border-color-$t"],"border-color-y":["border-color-t","border-color-b"],"scroll-$t":["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-$t":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Bt=gr(Hr);function y(...e){return Bt((0,Ut.clsx)(e))}var $t=require("react/jsx-runtime"),ie=Kt.forwardRef(({className:e,type:t,...o},r)=>(0,$t.jsx)("input",{type:t,className:y("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}));ie.displayName="Input";var rt=j(require("react")),ne=j(require("@radix-ui/react-scroll-area"));var nt=rt.forwardRef(({className:e,children:t,...o},r)=>(0,$t.jsxs)(ne.Root,{ref:r,className:y("relative overflow-hidden",e),...o,children:[(0,$t.jsx)(ne.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,$t.jsx)(Ft,{}),(0,$t.jsx)(ne.Corner,{})]}));nt.displayName=ne.Root.displayName;var Ft=rt.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,$t.jsx)(ne.ScrollAreaScrollbar,{ref:r,orientation:t,className:y("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-$t border-$t-transparent $t-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent $t-[1px]",e),...o,children:(0,$t.jsx)(ne.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Ft.displayName=ne.ScrollAreaScrollbar.displayName;var Wt=require("@radix-ui/react-slot"),jt=require("class-variance-authority"),Gt=j(require("react")),Lr=(0,jt.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"}}}),ae=Gt.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...n},a)=>(0,$t.jsx)(e?Wt.Slot:"button",{className:y(Lr({className:t,size:o,variant:r})),ref:a,...n}));ae.displayName="Button";var Ee=j(require("react")),G=j(require("@radix-ui/react-dialog"));var Ke=G.Root;var at=G.Portal;var $e=Ee.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(G.Overlay,{ref:o,className:y("fixed inset-0 ce-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}));$e.displayName=G.Overlay.displayName;var it=Ee.forwardRef(({className:e,children:t,...o},r)=>(0,$t.jsxs)(at,{children:[(0,$t.jsx)($e,{}),(0,$t.jsxs)(G.Content,{ref:r,className:y("fixed left-[50%] top-[50%] ce-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background $t-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,$t.jsxs)(G.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,$t.jsx)(ce.$t,{className:"h-4 w-4"}),(0,$t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));it.displayName=G.Content.displayName;var st=({className:e,...t})=>(0,$t.jsx)("div",{className:y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});st.displayName="DialogHeader";var Ar=({className:e,...t})=>(0,$t.jsx)("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ar.displayName="DialogFooter";var lt=Ee.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(G.Title,{ref:o,className:y("text-lg font-semibold leading-none tracking-tight",e),...t}));lt.displayName=G.Title.displayName;var Or=Ee.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(G.Description,{ref:o,className:y("text-sm text-muted-foreground",e),...t}));Or.displayName=G.Description.displayName;var Wo=j(require("@radix-ui/react-dialog"));var Jt=j(require("react")),He=Jt.forwardRef(({className:e,...t},o)=>(0,$t.jsx)("textarea",{className:y("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}));He.displayName="Textarea";var k=j(require("@radix-ui/react-select")),ye=j(require("react")),Yt=k.Root;var Qt=k.Value,dt=ye.forwardRef(({children:e,className:t,...o},r)=>(0,$t.jsxs)(k.Trigger,{className:y("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,$t.jsx)(k.Icon,{asChild:!0,children:(0,$t.jsx)(ce.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));dt.displayName=k.Trigger.displayName;var eo=ye.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(k.ScrollUpButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,$t.jsx)(ce.ChevronUp,{className:"h-4 w-4"})}));eo.displayName=k.ScrollUpButton.displayName;var to=ye.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(k.ScrollDownButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,$t.jsx)(ce.ChevronDown,{className:"h-4 w-4"})}));to.displayName=k.ScrollDownButton.displayName;var ct=ye.forwardRef(({children:e,className:t,position:o="popper",...r},n)=>(0,$t.jsx)(k.Portal,{children:(0,$t.jsxs)(k.Content,{className:y("relative ce-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:n,...r,children:[(0,$t.jsx)(eo,{}),(0,$t.jsx)(k.Viewport,{className:y("$t-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,$t.jsx)(to,{})]})}));ct.displayName=k.Content.displayName;var Vr=ye.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(k.Label,{className:y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Vr.displayName=k.Label.displayName;var Fe=ye.forwardRef(({children:e,className:t,...o},r)=>(0,$t.jsxs)(k.Item,{className:y("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,$t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$t.jsx)(k.ItemIndicator,{children:(0,$t.jsx)(ce.Check,{className:"h-4 w-4"})})}),(0,$t.jsx)(k.ItemText,{children:e})]}));Fe.displayName=k.Item.displayName;var zr=ye.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(k.Separator,{className:y("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));zr.displayName=k.Separator.displayName;var oo=j(require("react")),mt=j(require("@radix-ui/react-label"));var _r=(0,jt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pt=oo.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(mt.Root,{ref:o,className:y(_r(),e),...t}));pt.displayName=mt.Root.displayName;var ft=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:n,className:a="",disabled:i=!1})=>{let[s,f]=(0,de.useState)(!1),[S,R]=(0,de.useState)(""),g=()=>{i||(f(!0),R(t))},I=async()=>{S!==t&&await n(e,S),f(!1)},v=x=>{x.key==="Enter"&&!r||x.key==="Enter"&&x.ctrlKey&&r?I():x.key==="Escape"&&(f(!1),R(""))};return(0,$t.jsxs)("div",{className:`space-y-2 ${a}`,children:[(0,$t.jsx)(pt,{children:o}),s?r?(0,$t.jsx)(He,{value:S,onChange:x=>R(x.target.value),onBlur:I,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,$t.jsx)(ie,{value:S,onChange:x=>R(x.target.value),onBlur:I,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,$t.jsxs)("div",{onClick:g,className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 $t-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,$t.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!i&&(0,$t.jsx)(ce.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Ho=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Lo=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Ao=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Oo=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Vo=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),zo=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),_o=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Ye=require("@payloadcms/richtext-lexical/lexical/list"),Bo=require("@payloadcms/richtext-lexical/lexical/rich-text"),Uo=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Io=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Be=require("@payloadcms/richtext-lexical/lexical/utils"),D=require("@payloadcms/richtext-lexical/lexical"),Dt=require("@payloadcms/richtext-lexical/lexical/selection");var bo=require("@radix-ui/react-dialog"),Ze=require("@payloadcms/richtext-lexical/client");var ht=j(require("bson-objectid"));var so=require("@payloadcms/ui");var io=j(require("react")),se=j(require("@radix-ui/react-tooltip"));var We=se.Provider,je=se.Root,Ge=se.Trigger,Le=io.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,$t.jsx)(se.Portal,{children:(0,$t.jsx)(se.Content,{ref:r,sideOffset:t,className:y("ce-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})}));Le.displayName=se.Content.displayName;var Br=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[n]=(0,Io.useLexicalComposerContext)(),[a,i]=(0,de.useState)(""),[s,f]=(0,de.useState)(""),[S,R]=(0,de.useState)(""),g=async h=>{console.log("fetchMedia",h)};(0,de.useEffect)(()=>{typeof o=="string"?o.length===24?g(o):(i(o||""),R(H(x())),f(v()||"")):typeof o=="object"&&(i(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),R(H(o.filesize)),f(o.mimeType?.split("/")[1]||""))},[]);let I=(0,de.useCallback)(()=>{n.update(()=>{(0,D.$getNodeByKey)(r)?.remove()})},[n,r]),v=()=>{let h=e.data.value;return typeof h=="string"?h.split(";base64")[0]?.split("image/")[1]:""},x=()=>{let h=e.data.value;if(typeof h=="string"){let b=h.split(",")[1]?.length||0;return 4*Math.ceil(b/3)*.5624896334383812/1e3}return 0};function H(h){if(h>=1e6){let P=h/1e6;return`${P>=10?Math.round(P).toString():P.toFixed(1)} MB`}return`${Math.floor(h/1e3)} KB`}return(0,$t.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,$t.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,$t.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,$t.jsx)("div",{className:"flex-1",children:e.data.value?(0,$t.jsx)("img",{className:"object-cover $t-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:a}):(0,$t.jsx)(so.File,{})}),(0,$t.jsx)(We,{children:(0,$t.jsxs)(je,{children:[(0,$t.jsxs)(Ge,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,$t.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,$t.jsx)("button",{onClick:h=>{h.preventDefault(),I()},className:"flex-1 flex justify-center items-center",children:(0,$t.jsx)(ce.$t,{width:24,height:24,strokeWidth:1})})]}),(0,$t.jsx)(Le,{children:(0,$t.jsx)("span",{children:"Remove image"})})]})})]}),(0,$t.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,$t.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,$t.jsx)("span",{children:S})]})]})})},po=Br;function Ur(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:Se({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Ae=class extends Ze.UploadNode{static importDOM(){return{img:()=>({conversion:Ur,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new ht.default().toHexString(),t.version=3);let o={id:t.id??new ht.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=Se(o);return r.setFormat?.(t.format),r}decorate(){return(0,$t.jsx)(po,{data:this.__data,nodeKey:this.getKey()})}};function Se(e){return new Ae({data:e})}var Kr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$r=e=>Kr?(e||window).getSelection():null,na=(0,D.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),bt=(0,D.createCommand)("INSERT_UPLOAD_COMMAND");function vo({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,de.useRef)(!1),[n,a]=(0,de.useState)(!0),[i,s]=(0,de.useState)(""),[f,S]=(0,de.useState)(""),[R,g]=(0,de.useState)(!1),[I,v]=(0,de.useState)("left"),x=i==="",H=M=>{g(M.target.checked)},h=M=>{v(M.target.value)},b=M=>{let B=new FileReader;B.onload=function(){return typeof B.result=="string"&&s(B.result),""},M!==null&&M[0]&&B.readAsDataURL(M[0])};(0,de.useEffect)(()=>{r.current=!1;let M=B=>{r.current=B.altKey};return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[e]),(0,de.useEffect)(()=>{n||t()},[n]),(0,de.useEffect)(()=>{a(o)},[o]);let P=({editor:M,relationTo:B,replaceNodeKey:w,value:C})=>{if(w)M.update(()=>{let c=(0,D.$getNodeByKey)(w);c&&c.replace(Se({id:"",fields:{},relationTo:"media",value:C}))});else{let c=M.dispatchCommand(bt,{fields:null,relationTo:"media",value:C})}},F=()=>{P({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:f,src:i,showCaption:R,position:I}.src}),a(!1),t()};return(0,$t.jsx)(Ke,{open:n,onOpenChange:M=>a(M),children:(0,$t.jsxs)(it,{children:[(0,$t.jsxs)(st,{children:[(0,$t.jsx)(lt,{children:"Upload Image"}),(0,$t.jsx)(bo.DialogDescription,{children:"Description"})]}),(0,$t.jsxs)("div",{className:"",children:[(0,$t.jsx)("div",{style:{marginBottom:"1em"},children:(0,$t.jsx)(ie,{type:"file",onChange:M=>b(M.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,$t.jsx)("div",{style:{marginBottom:"1em"},children:(0,$t.jsx)(ie,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:M=>S(M.currentTarget.value),value:f,"data-test-id":"image-modal-alt-text-input"})}),(0,$t.jsx)(ae,{"data-test-id":"image-modal-file-upload-btn",disabled:x,onClick:()=>F(),children:"Confirm"})]})]})})}function vt({captionsEnabled:e}){let[t]=(0,Io.useLexicalComposerContext)();return(0,de.useEffect)(()=>{if(!t.hasNodes([Ze.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Be.mergeRegister)(t.registerCommand(D.DRAGSTART_COMMAND,o=>Fr(o),D.COMMAND_PRIORITY_HIGH),t.registerCommand(D.DRAGOVER_COMMAND,o=>Wr(o),D.COMMAND_PRIORITY_LOW),t.registerCommand(D.DROP_COMMAND,o=>jr(o,t),D.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Fr(e){if(!xt())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function Wr(e){return xt()?(xo(e)||e.preventDefault(),!0):!1}function jr(e,t){let o=xt();if(!o)return!1;if(e.preventDefault(),xo(e)){let r=Gr(e);o.remove();let n=(0,D.$createRangeSelection)();r!=null&&n.applyDOMRange(r),(0,D.$setSelection)(n)}return!0}function xt(){let e=(0,D.$getSelection)();if(!(0,D.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,Ze.$isUploadNode)(o)?o:null}function xo(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 Gr(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,n=$r(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&n!==null)n.collapse(e.rangeParent,e.rangeOffset||0),t=n.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Zr=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),wo=Zr;var Xr=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),yo=Xr;var Jr=()=>(0,$t.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,$t.jsx)("path",{$t:"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,$t.jsx)("path",{$t:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Co=Jr;var qr=()=>(0,$t.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,$t.jsx)("path",{$t:"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,$t.jsx)("path",{$t:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),No=qr;var Yr=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),Ro=Yr;var Qr=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),Do=Qr;var Po=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),So=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),Mo=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),ko=()=>(0,$t.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,$t.jsx)("path",{$t:"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"})}),To=()=>(0,$t.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,$t.jsx)("path",{$t:"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 be=j(require("react")),T=j(require("@radix-ui/react-dropdown-menu")),Me=require("@radix-ui/react-icons");var Xe=T.Root,Je=T.Trigger;var en=be.forwardRef(({className:e,inset:t,children:o,...r},n)=>(0,$t.jsxs)(T.SubTrigger,{ref:n,className:y("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,$t.jsx)(Me.ChevronRightIcon,{className:"ml-auto"})]}));en.displayName=T.SubTrigger.displayName;var tn=be.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(T.SubContent,{ref:o,className:y("ce-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover $t-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}));tn.displayName=T.SubContent.displayName;var ze=be.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,$t.jsx)(T.Portal,{children:(0,$t.jsx)(T.Content,{ref:r,sideOffset:t,className:y("ce-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover $t-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})}));ze.displayName=T.Content.displayName;var _e=be.forwardRef(({className:e,inset:t,...o},r)=>(0,$t.jsx)(T.Item,{ref:r,className:y("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}));_e.displayName=T.Item.displayName;var on=be.forwardRef(({className:e,children:t,checked:o,...r},n)=>(0,$t.jsxs)(T.CheckboxItem,{ref:n,className:y("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,$t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$t.jsx)(T.ItemIndicator,{children:(0,$t.jsx)(Me.CheckIcon,{className:"h-4 w-4"})})}),t]}));on.displayName=T.CheckboxItem.displayName;var rn=be.forwardRef(({className:e,children:t,...o},r)=>(0,$t.jsxs)(T.RadioItem,{ref:r,className:y("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,$t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$t.jsx)(T.ItemIndicator,{children:(0,$t.jsx)(Me.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));rn.displayName=T.RadioItem.displayName;var nn=be.forwardRef(({className:e,inset:t,...o},r)=>(0,$t.jsx)(T.Label,{ref:r,className:y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));nn.displayName=T.Label.displayName;var an=be.forwardRef(({className:e,...t},o)=>(0,$t.jsx)(T.Separator,{ref:o,className:y("-mx-1 my-1 h-px bg-muted",e),...t}));an.displayName=T.Separator.displayName;var sn=({className:e,...t})=>(0,$t.jsx)("span",{className:y("ml-auto text-xs tracking-widest opacity-60",e),...t});sn.displayName="DropdownMenuShortcut";var Rt=1;function ln(){return(0,$t.jsx)("span",{className:"border border-[#222222]"})}function Pt(){let[e]=(0,Io.useLexicalComposerContext)(),t=(0,$.useRef)(null),[o,r]=(0,$.useState)(!1),[n,a]=(0,$.useState)(!1),[i,s]=(0,$.useState)(!1),[f,S]=(0,$.useState)(!1),[R,g]=(0,$.useState)(!1),[I,v]=(0,$.useState)(!1),[x,H]=(0,$.useState)(!1),[h,b]=(0,$.useState)(!1),[P,F]=(0,$.useState)(!1),[M,B]=(0,$.useState)("left"),[w,C]=(0,$.useState)("$t"),c=u=>{e.update(()=>{let _=(0,D.$getSelection)();(0,D.$isRangeSelection)(_)&&(u==="$t"?(0,Dt.$setBlocksType)(_,()=>(0,D.$createParagraphNode)()):(0,Dt.$setBlocksType)(_,()=>(0,Bo.$createHeadingNode)(u)))})},A=(0,$.useCallback)(()=>{let u=(0,D.$getSelection)();if((0,D.$isRangeSelection)(u)){s(u.hasFormat("bold")),S(u.hasFormat("italic")),g(u.hasFormat("underline")),v(u.hasFormat("strikethrough")),H(u.hasFormat("subscript")),b(u.hasFormat("superscript"));let _=u.anchor.getNode(),W=_;for(;W&&!(0,D.$isParagraphNode)(W)&&W!==(0,D.$getRoot)();){let Q=W.getParent();Q&&(W=Q)}if(W){let Q=W.getFormatType();B(Q||"left")}let ue=_.getTopLevelElement()?.__tag;C(ue||"$t")}},[]);(0,$.useEffect)(()=>(0,Be.mergeRegister)(e.registerUpdateListener(({editorState:u})=>{u.read(()=>{A()})}),e.registerCommand(D.SELECTION_CHANGE_COMMAND,(u,_)=>(A(),!1),Rt),e.registerCommand(D.CAN_UNDO_COMMAND,u=>(r(u),!1),Rt),e.registerCommand(D.CAN_REDO_COMMAND,u=>(a(u),!1),Rt),(0,Be.mergeRegister)(e.registerCommand(bt,u=>(e.update(()=>{let _=(0,D.$getSelection)()||(0,D.$getPreviousSelection)();if((0,D.$isRangeSelection)(_)){let W=Se({id:u.id,fields:u.fields,relationTo:u.relationTo,value:u.value}),{focus:ue}=_,Q=ue.getNode();(0,Be.$insertNodeToNearestRoot)(W),(0,D.$isParagraphNode)(Q)&&!Q.__first&&Q.remove()}}),!0),D.COMMAND_PRIORITY_EDITOR))),[e,A]);let L=[[{label:"Undo",icon:(0,$t.jsx)(ce.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(D.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,$t.jsx)(ce.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(D.UNDO_COMMAND,void 0)},disabled:!n}],[{label:"Bold",icon:(0,$t.jsx)(wo,{}),onClick:()=>{e.dispatchCommand(D.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:i},{label:"Italic",icon:(0,$t.jsx)(yo,{}),onClick:()=>{e.dispatchCommand(D.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:f},{label:"Underline",icon:(0,$t.jsx)(Co,{}),onClick:()=>{e.dispatchCommand(D.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:R},{label:"Strikethrough",icon:(0,$t.jsx)(No,{}),onClick:()=>{e.dispatchCommand(D.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:I},{label:"Subscript",icon:(0,$t.jsx)(Ro,{}),onClick:()=>{e.dispatchCommand(D.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:x},{label:"Superscript",icon:(0,$t.jsx)(Do,{}),onClick:()=>{e.dispatchCommand(D.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:h}]],Y=[{label:"Left Align",direction:"left",icon:(0,$t.jsx)(ce.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(D.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,$t.jsx)(ce.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(D.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,$t.jsx)(ce.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(D.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,$t.jsx)(ce.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(D.FORMAT_ELEMENT_COMMAND,"justify")}}],pe=[{label:"Normal Text",value:"$t",icon:(0,$t.jsx)(Po,{}),onClick:()=>c("$t")},{label:"Heading 1",value:"h1",icon:(0,$t.jsx)(So,{}),onClick:()=>c("h1")},{label:"Heading 2",value:"h2",icon:(0,$t.jsx)(Mo,{}),onClick:()=>c("h2")},{label:"Heading 3",value:"h3",icon:(0,$t.jsx)(ko,{}),onClick:()=>c("h3")},{label:"Heading 4",value:"h4",icon:(0,$t.jsx)(To,{}),onClick:()=>c("h4")},...[{label:"Unordered List",value:"ul",icon:(0,$t.jsx)(ce.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ye.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,$t.jsx)(ce.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ye.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],me=[{label:"Insert Image",icon:(0,$t.jsx)(ce.ImageUp,{width:15,height:15}),onClick:()=>{F(!0)},disabled:!1}];return(0,$t.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,$t.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[L.map((u,_)=>(0,$t.jsxs)($.Fragment,{children:[(0,$t.jsx)("div",{className:"flex items-center gap-2",children:u.map((W,ue)=>(0,$t.jsx)("div",{role:"button","aria-disabled":W.disabled||!1,onClick:W.onClick,className:y("$t-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]",W.active&&"bg-[#3c3c3c]"),"aria-label":W.label,children:(0,$t.jsx)(We,{children:(0,$t.jsxs)(je,{children:[(0,$t.jsx)(Ge,{className:"text-[#b5b5b5]",children:W.icon}),(0,$t.jsx)(Le,{children:(0,$t.jsx)("$t",{children:W.label})})]})})},ue))}),(0,$t.jsx)(ln,{})]},`toolbar-option-${u.length}-${_}`)),(0,$t.jsxs)(Xe,{children:[(0,$t.jsxs)(Je,{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:[Y.find(u=>u.direction===M)?.icon,Y.find(u=>u.direction===M)?.label,(0,$t.jsx)(ce.ChevronDown,{width:15,height:15})]}),(0,$t.jsx)(ze,{className:"bg-black hover:bg-black",children:Y.map((u,_)=>(0,$t.jsxs)(_e,{onClick:u.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,$t.jsx)("span",{children:u.icon}),(0,$t.jsx)("span",{children:u.label})]},`${u.label}-${_}`))})]}),(0,$t.jsxs)(Xe,{children:[(0,$t.jsxs)(Je,{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:[pe.find(u=>u.value===w)?.icon,pe.find(u=>u.value===w)?.label,(0,$t.jsx)(ce.ChevronDown,{width:15,height:15})]}),(0,$t.jsx)(ze,{className:"bg-black hover:bg-black",children:pe.map((u,_)=>(0,$t.jsxs)(_e,{onClick:u.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,$t.jsx)("span",{children:u.icon}),(0,$t.jsx)("span",{children:u.label})]},`heading-option-${u.label}-${_}`))})]}),(0,$t.jsxs)(Xe,{children:[(0,$t.jsxs)(Je,{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,$t.jsx)(ce.Plus,{width:15,height:15}),(0,$t.jsx)(ce.ChevronDown,{width:15,height:15})]}),(0,$t.jsx)(ze,{className:"bg-black hover:bg-black",children:me.map((u,_)=>(0,$t.jsxs)(_e,{onClick:u.onClick,disabled:u.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,$t.jsx)("span",{children:u.icon}),(0,$t.jsx)("span",{children:u.label})]},_))})]}),P&&(0,$t.jsx)(vo,{activeEditor:e,onClose:()=>{F(!1)},isOpen:P})]})})}var dn=({setValue:e,value:t,name:o,editable:r=!0})=>{let[n]=(0,Io.useLexicalComposerContext)(),a=i=>{i.read(()=>{let s=i.toJSON();e?.(()=>s)})};return(0,de.useEffect)(()=>{n.setEditable(r)},[r]),(0,de.useEffect)(()=>{t&&n.update(()=>{n.setEditorState(n.parseEditorState(t))})},[]),(0,$t.jsx)("div",{className:"w-full",children:(0,$t.jsxs)("div",{className:" ",children:[r&&(0,$t.jsx)(Pt,{}),(0,$t.jsxs)("div",{className:"px-4 my-4 border-$t border-[#222222]",children:[(0,$t.jsx)(zo.RichTextPlugin,{contentEditable:(0,$t.jsx)(Ao.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Oo.LexicalErrorBoundary}),r&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(Vo.HistoryPlugin,{}),(0,$t.jsx)(Ho.AutoFocusPlugin,{}),(0,$t.jsx)(_o.ListPlugin,{}),(0,$t.jsx)(Uo.OnChangePlugin,{onChange:a}),(0,$t.jsx)(vt,{})]})]})]})})},cn=({setValue:e,value:t,name:o,editable:r=!0})=>(0,$t.jsx)(Lo.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Ye.ListNode,Ye.ListItemNode,Bo.HeadingNode,Ae],onError(a){throw console.error("Lexical error:",a),a},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,$t.jsx)(dn,{value:t,setValue:e,name:o,editable:r})}),Qe=cn;function $o({document:e,onSave:t,mode:o="edit",onCancel:r,availableDocuments:n=[],knowledgeContexts:a=[]}){let[i,s]=(0,de.useState)({...e,updatedAt:new Date}),[f,S]=(0,de.useState)(!1),[R,g]=(0,de.useState)(i.richTextContent);(0,de.useEffect)(()=>{s(e)},[e]);let I=w=>{switch(w){case"markdown":case"mdx":return(0,$t.jsx)(ce.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,$t.jsx)(ce.File,{className:"h-6 w-6 text-success"});case"text":return(0,$t.jsx)(ce.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,$t.jsx)(ce.File,{className:"h-6 w-6 text-muted-foreground"})}},v=w=>{switch(w){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"}},x=()=>{let w=new Set,C=new Set;return a.forEach(c=>{c.menuConfig.groupBy.forEach(A=>w.add(A))}),n.forEach(c=>{c.metadata&&Object.keys(c.metadata).forEach(A=>C.add(A))}),{contextKeys:Array.from(w).sort(),documentKeys:Array.from(C).sort(),allKeys:Array.from(new Set([...w,...C])).sort()}},H=w=>{let C=new Set;return n.forEach(c=>{c.metadata?.[w]&&C.add(String(c.metadata[w]))}),Array.from(C).sort()},h=x(),b=()=>{t({...i,richTextContent:R})},P=(w,C)=>{s(c=>({...c,metadata:{...c.metadata,[w]:C}}))},F=(w,C)=>{C==="__custom__"?P(w,""):P(w,C)},M=()=>{P("","")},B=w=>{s(C=>{let c={...C.metadata};return delete c[w],{...C,metadata:c}})};return(0,$t.jsxs)(Re.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,$t.jsxs)("div",{className:"border-b border-border bg-card $t-8 pb-6",children:[(0,$t.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,$t.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,$t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$t.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,$t.jsx)("div",{className:"flex-1 min-w-0",children:(0,$t.jsx)(ft,{fieldName:"title",value:i.title,label:"",onSave:(w,C)=>s(c=>({...c,title:C})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:$t-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,$t.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${v(i.format)} flex-shrink-0 mt-1`,children:i.format.toUpperCase()})]}),(0,$t.jsx)("div",{className:"mt-2",children:(0,$t.jsx)(ft,{fieldName:"description",value:i.description||"Click to add description...",label:"",multiline:!0,onSave:(w,C)=>s(c=>({...c,description:C})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:$t-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,$t.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,$t.jsxs)(ae,{variant:"ghost",size:"sm",onClick:()=>S(!f),className:"gap-2",children:[(0,$t.jsx)(ce.Info,{className:"h-4 w-4"}),"Metadata",i.metadata&&Object.keys(i.metadata).length>0&&(0,$t.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,$t.jsx)(ce.ChevronDown,{className:"h-4 w-4"}):(0,$t.jsx)(ce.ChevronRight,{className:"h-4 w-4"})]}),(0,$t.jsxs)(ae,{variant:"outline",size:"sm",onClick:r,className:"gap-2",children:[(0,$t.jsx)(ce.$t,{className:"h-4 w-4"}),"Cancel"]}),(0,$t.jsxs)(ae,{size:"sm",onClick:b,className:"gap-2",children:[(0,$t.jsx)(ce.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,$t.jsx)(Re.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,$t.jsxs)("div",{className:"pt-4 border-t border-border mt-4 h-screen max-h-full flex",children:[(0,$t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$t.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,$t.jsx)(ce.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,$t.jsxs)(ae,{type:"button",variant:"outline",size:"sm",onClick:M,className:"gap-1 h-8",children:[(0,$t.jsx)(ce.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,$t.jsx)("div",{className:"bg-muted rounded-lg $t-4 border border-border",children:i.metadata&&Object.keys(i.metadata).length>0?(0,$t.jsx)("div",{className:"space-y-2",children:Object.entries(i.metadata).map(([w,C],c)=>{let A=H(w);return(0,$t.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,$t.jsx)(ie,{value:w,onChange:L=>{let Y=L.target.value||"",E=i.metadata?.[w];s(pe=>{let me={...pe.metadata};return delete me[w],Y&&(me[Y]=E||""),{...pe,metadata:me}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${w}`}),(0,$t.jsx)("datalist",{id:`metadata-keys-${w}`,children:h.allKeys.map(L=>(0,$t.jsx)("option",{value:L},L))}),(0,$t.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),A.length>0?(0,$t.jsxs)(Yt,{value:String(C||""),onValueChange:L=>F(w,L),children:[(0,$t.jsx)(dt,{className:"flex-1 h-8 text-sm",children:(0,$t.jsx)(Qt,{placeholder:"Value"})}),(0,$t.jsxs)(ct,{children:[A.map(L=>(0,$t.jsx)(Fe,{value:L,children:L},L)),(0,$t.jsx)(Fe,{value:"__custom__",children:(0,$t.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,$t.jsx)(ie,{value:String(C||""),onChange:L=>P(w,L.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,$t.jsx)(ae,{type:"button",variant:"ghost",size:"sm",onClick:()=>B(w),className:"h-8 w-8 $t-0 text-muted-foreground hover:text-destructive",children:(0,$t.jsx)(ce.$t,{className:"h-3 w-3"})})]},`metadata-key-${c}`)})}):(0,$t.jsxs)("div",{className:"text-center py-4",children:[(0,$t.jsx)("$t",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,$t.jsx)("$t",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})})]})})]}),(0,$t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,$t.jsx)("div",{className:"$t-8 h-full max-h-full overflow-auto",children:i.format==="richText"?(0,$t.jsx)(Qe,{setValue:g,value:R,name:"richTextContent"}):(0,$t.jsx)(He,{value:i.content||"",onChange:w=>s(C=>({...C,content:w.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var jo=j(require("react-markdown")),Go=j(require("remark-gfm"));var Zo=e=>(0,$t.jsx)(jo.default,{remarkPlugins:[Go.default],components:{h1:({children:t})=>(0,$t.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,$t.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,$t.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,$t.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,$t.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,$t.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,$t.jsx)("li",{className:"ml-4",children:t}),$t:({children:t})=>(0,$t.jsx)("$t",{className:"mb-4",children:t}),a:({children:t,href:o})=>(0,$t.jsx)("a",{href:o,className:"text-blue-500",children:t}),img:({src:t,alt:o})=>(0,$t.jsx)("img",{src:t,alt:o,className:"mb-4"}),blockquote:({children:t})=>(0,$t.jsx)("blockquote",{className:"border-$t-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),Fo=e=>(0,$t.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),mn=e=>(0,$t.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,$t.jsx)(Qe,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),pn=e=>(0,$t.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,$t.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg $t-4 mb-4",children:(0,$t.jsxs)("$t",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,$t.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Zo(e)]});function Xo({document:e,onDocumentUpdate:t,editable:o=!0,mode:r="view",renderers:n,availableDocuments:a=[],knowledgeContexts:i=[]}){let[s,f]=(0,de.useState)(!1),[S,R]=(0,de.useState)(!1),[g,I]=(0,de.useState)(e),[v,x]=(0,de.useState)(!1),H=(0,de.useRef)(null),h=g.format==="richText"?g.richTextContent:g.content,b=(0,de.useMemo)(()=>`${g.format}:${JSON.stringify(h)}`,[g.format,h]);(0,de.useEffect)(()=>{I(e)},[e]);let P=c=>{switch(c){case"markdown":case"mdx":return(0,$t.jsx)(ce.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,$t.jsx)(ce.File,{className:"h-6 w-6 text-success"});case"text":return(0,$t.jsx)(ce.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,$t.jsx)(ce.File,{className:"h-6 w-6 text-muted-foreground"})}},F=c=>{switch(c){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"}},M=(c,A)=>{let L={markdown:Zo,mdx:pn,text:Fo},Y=n?.[A]||L[A];if(A==="richText"&&typeof c=="object")return mn(c);if(Y&&typeof c=="string")return Y(c);if(typeof c=="string")return Fo(c)},B=async c=>{x(!0),H.current=g,(0,de.startTransition)(()=>{I({...c,richTextContent:c.richTextContent?structuredClone(c.richTextContent):void 0})});try{let A=await t?.(c);if(x(!1),!A)throw new Error("save failed");f(!1)}catch{H.current&&(0,de.startTransition)(()=>I(H.current))}},w=()=>{f(!1)};return(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(Ke,{open:s||r==="create",onOpenChange:c=>!c&&w(),children:(0,$t.jsxs)(at,{children:[(0,$t.jsx)($e,{}),(0,$t.jsxs)(Wo.Content,{className:y("fixed inset-0 ce-50 bg-background $t-0 $t-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:[v&&(0,$t.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,$t.jsx)(ce.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,$t.jsx)($o,{mode:r==="create"?"create":"edit",document:g,onSave:B,onCancel:w,availableDocuments:a,knowledgeContexts:i})]})]})}),(0,$t.jsxs)(Re.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,$t.jsxs)("div",{className:"border-b border-border bg-card $t-8 pb-6",children:[(0,$t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,$t.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,$t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$t.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[g.title,(0,$t.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${F(g.format)}`,children:g.format.toUpperCase()})]}),g.description&&(0,$t.jsx)("$t",{className:"text-muted-foreground text-lg leading-relaxed",children:g.description})]})}),(0,$t.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[g.metadata&&Object.keys(g.metadata).length>0&&(0,$t.jsxs)(ae,{variant:"ghost",size:"sm",onClick:()=>R(!S),className:"gap-2",children:[(0,$t.jsx)(ce.Info,{className:"h-4 w-4"}),"Metadata",S?(0,$t.jsx)(ce.ChevronDown,{className:"h-4 w-4"}):(0,$t.jsx)(ce.ChevronRight,{className:"h-4 w-4"})]}),o&&(0,$t.jsxs)(ae,{variant:"outline",size:"sm",onClick:()=>f(!0),className:"gap-2",children:[(0,$t.jsx)(ce.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),g.metadata&&Object.keys(g.metadata).length>0&&(0,$t.jsx)(Re.motion.div,{initial:!1,animate:{height:S?"auto":0,opacity:S?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,$t.jsxs)("div",{className:"pt-4 border-t border-border mt-4",children:[(0,$t.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,$t.jsx)(ce.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,$t.jsx)("div",{className:"bg-muted rounded-lg $t-4 border border-border",children:(0,$t.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(g.metadata).map(([c,A])=>(0,$t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,$t.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:c.replace(/([A-$t])/g," $1").trim()}),(0,$t.jsx)("span",{className:"text-foreground font-medium",children:String(A)})]},c))})})]})})]}),(0,$t.jsx)("div",{className:"flex-1 ",children:(0,$t.jsx)("div",{className:"py-4 h-full",children:(0,$t.jsx)("div",{className:"space-y-4",children:g.content||g.richTextContent?(0,$t.jsx)("div",{className:"relative",children:(0,$t.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:M(g.format==="richText"?g.richTextContent:g.content,g.format)})},b):(0,$t.jsxs)("div",{className:"text-center $t-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,$t.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,$t.jsx)(ce.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,$t.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,$t.jsx)("$t",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function Tt({label:e,documents:t,children:o,level:r,onDocumentClick:n,selectedDocumentId:a,showDocumentCount:i=!0}){let[s,f]=(0,de.useState)(r===0),S=o&&Object.keys(o).length>0,R=t.length+(o?Object.values(o).reduce((v,x)=>v+x.documents.length,0):0),g=v=>{switch(v){case"markdown":case"mdx":return(0,$t.jsx)(ce.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,$t.jsx)(ce.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,$t.jsx)(ce.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},I=v=>{let x=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return x[v%x.length]};return(0,$t.jsxs)("div",{className:"space-y-1",children:[(S||t.length>0)&&(0,$t.jsxs)(Re.motion.div,{className:`group flex items-center gap-3 $t-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${r*20}px`},onClick:()=>f(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,$t.jsx)("div",{className:`w-1 h-6 rounded-full ${I(r)}`}),(0,$t.jsx)(Re.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,$t.jsx)(ce.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,$t.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,$t.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,$t.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),i&&R>0&&(0,$t.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,$t.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:R})})]})]}),(0,$t.jsx)(Re.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,$t.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,x)=>(0,$t.jsxs)(Re.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:x*.05,duration:.2},className:`group flex items-center gap-3 $t-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${a===v.id?"bg-primary/10 border-$t-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${r*20+20}px`},onClick:()=>n?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,$t.jsx)("div",{className:"flex-shrink-0",children:g(v.format)}),(0,$t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$t.jsx)("$t",{className:`text-sm truncate transition-colors ${a===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,$t.jsx)("$t",{className:"text-xs text-muted-foreground truncate mt-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,$t.jsx)("div",{className:"flex-shrink-0",children:(0,$t.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.id)),o&&Object.entries(o).map(([v,x])=>(0,$t.jsx)(Tt,{label:v,documents:x.documents,children:x.children,level:r+1,onDocumentClick:n,selectedDocumentId:a,showDocumentCount:i},v))]})})]})}function un({documents:e,menuConfig:t,onDocumentClick:o,onDocumentShare:r,onDocumentUpdate:n,selectedDocumentId:a,className:i,editable:s=!0}){let[f,S]=(0,de.useState)(""),[R,g]=(0,de.useState)(null),[I,v]=(0,de.useState)(e);(0,de.useEffect)(()=>{v(e)},[e]),(0,de.useEffect)(()=>{if(R?.id){let b=I.find(P=>P.id===R.id);b&&g(b)}},[I]);let x=(0,de.useMemo)(()=>f?I.filter(b=>b.title.toLowerCase().includes(f.toLowerCase())||b.description?.toLowerCase().includes(f.toLowerCase())||b.tags?.some(P=>P.toLowerCase().includes(f.toLowerCase()))||Object.values(b.metadata||{}).some(P=>String(P).toLowerCase().includes(f.toLowerCase()))):I,[I,f]),H=(0,de.useMemo)(()=>{let b=(P,F)=>{if(F.length===0)return{};let[M,...B]=F;return P.reduce((C,c)=>{let A=c.metadata?.[M]||"Uncategorized",L=String(A);if(C[L]||(C[L]={documents:[],children:{}}),B.length===0)C[L].documents.push(c);else{let Y=b([c],B),E=Object.keys(Y)[0];E&&(C[L].children||(C[L].children={}),C[L].children[E]?C[L].children[E].documents.push(...Y[E].documents):C[L].children[E]=Y[E])}return C},{})};return b(x,t.groupBy)},[x,t.groupBy]),h=b=>{g(b),o?.(b)};return(0,$t.jsxs)("div",{className:`flex h-full ${i||""}`,children:[(0,$t.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,$t.jsx)("div",{className:"$t-6 border-b border-border",children:(0,$t.jsxs)("div",{className:"relative",children:[(0,$t.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,$t.jsx)(ce.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,$t.jsx)(ie,{placeholder:"Search knowledge base...",value:f,onChange:b=>S(b.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,$t.jsx)(nt,{className:"h-[calc(100%-100px)]",children:(0,$t.jsx)("div",{className:"$t-4 space-y-3",children:t.groupBy.length===0?(0,$t.jsx)($t.Fragment,{children:(0,$t.jsx)(Tt,{label:"Document",documents:x,level:0,onDocumentClick:h,selectedDocumentId:a,showDocumentCount:t.showDocumentCount},"Document")}):(0,$t.jsxs)($t.Fragment,{children:[Object.entries(H).map(([b,P])=>(0,$t.jsx)(Tt,{label:b,documents:P.documents,children:P.children,level:0,onDocumentClick:h,selectedDocumentId:a,showDocumentCount:t.showDocumentCount},b)),Object.keys(H).length===0&&(0,$t.jsxs)(Re.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,$t.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,$t.jsx)(ce.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,$t.jsx)("$t",{className:"text-sm font-medium",children:"No documents found"}),(0,$t.jsx)("$t",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,$t.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:R?(0,$t.jsx)(Xo,{document:R,onDocumentUpdate:n,editable:s}):(0,$t.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,$t.jsxs)(Re.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,$t.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,$t.jsx)(ce.FileText,{className:"h-10 w-10 text-primary"})}),(0,$t.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,$t.jsx)("$t",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}0&&(module.exports={KnowledgeBrowser});
|
|
4
|
+
"use strict";"use client";var or=Object.create;var Ge=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var nr=Object.getOwnPropertyNames;var ar=Object.getPrototypeOf,ir=Object.prototype.hasOwnProperty;var sr=(e,t)=>{for(var o in t)Ge(e,o,{get:t[o],enumerable:!0})},zt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of nr(t))!ir.call(e,a)&&a!==o&&Ge(e,a,{get:()=>t[a],enumerable:!(r=rr(t,a))||r.enumerable});return e};var X=(e,t,o)=>(o=e!=null?or(ar(e)):{},zt(t||!e||!e.__esModule?Ge(o,"default",{value:e,enumerable:!0}):o,e)),lr=e=>zt(Ge({},"__esModule",{value:!0}),e);var wn={};sr(wn,{KnowledgeBrowser:()=>xn});module.exports=lr(wn);var Te=require("motion/react"),he=require("lucide-react"),ge=require("react");var Zt=X(require("react"));var Gt=require("clsx");var ct="-",cr=e=>{let t=mr(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let s=n.split(ct);return s[0]===""&&s.length!==1&&s.shift(),Ut(s,t)||dr(n)},getConflictingClassGroupIds:(n,s)=>{let f=o[n]||[];return s&&r[n]?[...f,...r[n]]:f}}},Ut=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?Ut(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let i=e.join(ct);return t.validators.find(({validator:n})=>n(i))?.classGroupId},_t=/^\[(.+)\]$/,dr=e=>{if(_t.test(e)){let t=_t.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},mr=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return pr(Object.entries(e.classGroups),o).forEach(([i,n])=>{lt(n,r,i,t)}),r},lt=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let i=a===""?t:Bt(t,a);i.classGroupId=o;return}if(typeof a=="function"){if(ur(a)){lt(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([i,n])=>{lt(n,Bt(t,i),o,r)})})},Bt=(e,t)=>{let o=e;return t.split(ct).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},ur=e=>e.isThemeGetter,pr=(e,t)=>t?e.map(([o,r])=>{let a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([n,s])=>[t+n,s])):i);return[o,a]}):e,fr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(i,n)=>{o.set(i,n),t++,t>e&&(t=0,r=o,o=new Map)};return{get(i){let n=o.get(i);if(n!==void 0)return n;if((n=r.get(i))!==void 0)return a(i,n),n},set(i,n){o.has(i)?o.set(i,n):a(i,n)}}},Kt="!",gr=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,a=t[0],i=t.length,n=s=>{let f=[],T=0,x=0,g;for(let b=0;b<s.length;b++){let h=s[b];if(T===0){if(h===a&&(r||s.slice(b,b+i)===t)){f.push(s.slice(x,b)),x=b+i;continue}if(h==="/"){g=b;continue}}h==="["?T++:h==="]"&&T--}let D=f.length===0?s:s.substring(x),v=D.startsWith(Kt),y=v?D.substring(1):D,L=g&&g>x?g-x:void 0;return{modifiers:f,hasImportantModifier:v,baseClassName:y,maybePostfixModifierPosition:L}};return o?s=>o({className:s,parseClassName:n}):n},hr=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},br=e=>({cache:fr(e.cacheSize),parseClassName:gr(e),...cr(e)}),vr=/\s+/,xr=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],n=e.trim().split(vr),s="";for(let f=n.length-1;f>=0;f-=1){let T=n[f],{modifiers:x,hasImportantModifier:g,baseClassName:D,maybePostfixModifierPosition:v}=o(T),y=!!v,L=r(y?D.substring(0,v):D);if(!L){if(!y){s=T+(s.length>0?" "+s:s);continue}if(L=r(D),!L){s=T+(s.length>0?" "+s:s);continue}y=!1}let b=hr(x).join(":"),h=g?b+Kt:b,k=h+L;if(i.includes(k))continue;i.push(k);let _=a(L,y);for(let S=0;S<_.length;++S){let K=_[S];i.push(h+K)}s=T+(s.length>0?" "+s:s)}return s};function wr(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=$t(t))&&(r&&(r+=" "),r+=o);return r}var $t=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=$t(e[r]))&&(o&&(o+=" "),o+=t);return o};function yr(e,...t){let o,r,a,i=n;function n(f){let T=t.reduce((x,g)=>g(x),e());return o=br(T),r=o.cache.get,a=o.cache.set,i=s,s(f)}function s(f){let T=r(f);if(T)return T;let x=xr(f,o);return a(f,x),x}return function(){return i(wr.apply(null,arguments))}}var O=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ft=/^\[(?:([a-he-]+):)?(.+)\]$/i,Cr=/^\Jt+\/\Jt+$/,Nr=new Set(["px","full","screen"]),Rr=/^(\Jt+(\.\Jt+)?)?(xs|sm|md|lg|xl)$/,Dr=/\Jt+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Pr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Sr=/^(inset_)?-?((\Jt+)?\.?(\Jt+)[a-he]+|0)_-?((\Jt+)?\.?(\Jt+)[a-he]+|0)/,Mr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,be=e=>ke(e)||Nr.has(e)||Cr.test(e),Ce=e=>Ie(e,"length",Or),ke=e=>!!e&&!Number.isNaN(Number(e)),st=e=>Ie(e,"number",ke),Ae=e=>!!e&&Number.isInteger(Number(e)),Tr=e=>e.endsWith("%")&&ke(e.slice(0,-1)),R=e=>Ft.test(e),Ne=e=>Rr.test(e),kr=new Set(["length","size","percentage"]),Ir=e=>Ie(e,kr,Wt),Er=e=>Ie(e,"position",Wt),Lr=new Set(["image","url"]),Hr=e=>Ie(e,Lr,zr),Ar=e=>Ie(e,"",Vr),Oe=()=>!0,Ie=(e,t,o)=>{let r=Ft.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},Or=e=>Dr.test(e)&&!Pr.test(e),Wt=()=>!1,Vr=e=>Sr.test(e),zr=e=>Mr.test(e);var _r=()=>{let e=O("colors"),t=O("spacing"),o=O("blur"),r=O("brightness"),a=O("borderColor"),i=O("borderRadius"),n=O("borderSpacing"),s=O("borderWidth"),f=O("contrast"),T=O("grayscale"),x=O("hueRotate"),g=O("invert"),D=O("gap"),v=O("gradientColorStops"),y=O("gradientColorStopPositions"),L=O("inset"),b=O("margin"),h=O("opacity"),k=O("padding"),_=O("saturate"),S=O("scale"),K=O("sepia"),ne=O("skew"),$=O("space"),M=O("translate"),Z=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],oe=()=>["auto",R,t],H=()=>[R,t],we=()=>["",be,Ce],ye=()=>["auto",ke,R],m=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>["start","end","center","between","around","evenly","stretch"],c=()=>["","0",R],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>[ke,R];return{cacheSize:500,separator:":",theme:{colors:[Oe],spacing:[be,Ce],blur:["none","",Ne,R],brightness:C(),borderColor:[e],borderRadius:["none","","full",Ne,R],borderSpacing:H(),borderWidth:we(),contrast:C(),grayscale:c(),hueRotate:C(),invert:c(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[Tr,Ce],inset:oe(),margin:oe(),opacity:C(),padding:H(),saturate:C(),scale:C(),sepia:c(),skew:C(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[Ne]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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(),R]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],he:[{he:["auto",Ae,R]}],basis:[{basis:oe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:c()}],shrink:[{shrink:c()}],order:[{order:["first","last","none",Ae,R]}],"grid-cols":[{"grid-cols":[Oe]}],"col-start-end":[{col:["auto",{span:["full",Ae,R]},R]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[Oe]}],"row-start-end":[{row:["auto",{span:[Ae,R]},R]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[D]}],"gap-x":[{"gap-x":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Jt:[{Jt:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,t]}],"min-w":[{"min-w":[R,t,"min","max","fit"]}],"max-w":[{"max-w":[R,t,"none","full","min","max","fit","prose",{screen:[Ne]},Ne]}],h:[{h:[R,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ne,Ce]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",st]}],"font-family":[{font:[Oe]}],"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",R]}],"line-clamp":[{"line-clamp":["none",ke,st]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",be,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",be,Ce]}],"underline-offset":[{"underline-offset":["auto",be,R]}],"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:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],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",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...m(),Er]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ir]}],"bg-image":[{bg:["none",{"gradient-he":["t","tr","r","br","b","bl","Jt","tl"]},Hr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-he-pos":[{he:[y]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-he":[{he:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-Jt":[{"rounded-Jt":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Jt":[{"rounded-Jt":[i]}],"rounded-he":[{"rounded-he":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-Jt":[{"border-Jt":[s]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:A()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[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-Jt":[{"border-Jt":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[be,R]}],"outline-w":[{outline:[be,Ce]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[be,Ce]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ne,Ar]}],"shadow-color":[{shadow:[Oe]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Ne,R]}],grayscale:[{grayscale:[T]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[g]}],saturate:[{saturate:[_]}],sepia:[{sepia:[K]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[T]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:C()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:C()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ae,R]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[ne]}],"skew-y":[{"skew-y":[ne]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],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","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","Jt-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",R]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-Jt":[{"scroll-Jt":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",R]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[be,Ce,st]}],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"],Jt:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","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-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-Jt","rounded-ss","rounded-Jt","rounded-he","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Jt","rounded-he"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-Jt":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-Jt"],"border-w-x":["border-w-r","border-w-Jt"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-Jt"],"border-color-x":["border-color-r","border-color-Jt"],"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-Jt":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var jt=yr(_r);function w(...e){return jt((0,Gt.clsx)(e))}var Jt=require("react/jsx-runtime"),ue=Zt.forwardRef(({className:e,type:t,...o},r)=>(0,Jt.jsx)("input",{type:t,className:w("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}));ue.displayName="Input";var dt=X(require("react")),ce=X(require("@radix-ui/react-scroll-area"));var mt=dt.forwardRef(({className:e,children:t,...o},r)=>(0,Jt.jsxs)(ce.Root,{ref:r,className:w("relative overflow-hidden",e),...o,children:[(0,Jt.jsx)(ce.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Jt.jsx)(Xt,{}),(0,Jt.jsx)(ce.Corner,{})]}));mt.displayName=ce.Root.displayName;var Xt=dt.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,Jt.jsx)(ce.ScrollAreaScrollbar,{ref:r,orientation:t,className:w("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-Jt border-Jt-transparent Jt-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent Jt-[1px]",e),...o,children:(0,Jt.jsx)(ce.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Xt.displayName=ce.ScrollAreaScrollbar.displayName;var qt=require("@radix-ui/react-slot"),Yt=require("class-variance-authority"),Qt=X(require("react")),Br=(0,Yt.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"}}}),de=Qt.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...a},i)=>(0,Jt.jsx)(e?qt.Slot:"button",{className:w(Br({className:t,size:o,variant:r})),ref:i,...a}));de.displayName="Button";var Ve=X(require("react")),q=X(require("@radix-ui/react-dialog"));var Ze=q.Root;var ut=q.Portal;var Je=Ve.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(q.Overlay,{ref:o,className:w("fixed inset-0 he-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}));Je.displayName=q.Overlay.displayName;var pt=Ve.forwardRef(({className:e,children:t,...o},r)=>(0,Jt.jsxs)(ut,{children:[(0,Jt.jsx)(Je,{}),(0,Jt.jsxs)(q.Content,{ref:r,className:w("fixed left-[50%] top-[50%] he-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background Jt-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-he-left-1/2 data-[state=closed]:slide-out-he-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,Jt.jsxs)(q.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,Jt.jsx)(he.X,{className:"h-4 w-4"}),(0,Jt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));pt.displayName=q.Content.displayName;var ft=({className:e,...t})=>(0,Jt.jsx)("div",{className:w("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ft.displayName="DialogHeader";var Ur=({className:e,...t})=>(0,Jt.jsx)("div",{className:w("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ur.displayName="DialogFooter";var gt=Ve.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(q.Title,{ref:o,className:w("text-lg font-semibold leading-none tracking-tight",e),...t}));gt.displayName=q.Title.displayName;var Kr=Ve.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(q.Description,{ref:o,className:w("text-sm text-muted-foreground",e),...t}));Kr.displayName=q.Description.displayName;var qo=X(require("@radix-ui/react-dialog"));var oo=X(require("react")),ze=oo.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)("textarea",{className:w("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}));ze.displayName="Textarea";var I=X(require("@radix-ui/react-select")),De=X(require("react")),no=I.Root;var ao=I.Value,ht=De.forwardRef(({children:e,className:t,...o},r)=>(0,Jt.jsxs)(I.Trigger,{className:w("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,Jt.jsx)(I.Icon,{asChild:!0,children:(0,Jt.jsx)(he.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ht.displayName=I.Trigger.displayName;var io=De.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(I.ScrollUpButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Jt.jsx)(he.ChevronUp,{className:"h-4 w-4"})}));io.displayName=I.ScrollUpButton.displayName;var so=De.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(I.ScrollDownButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Jt.jsx)(he.ChevronDown,{className:"h-4 w-4"})}));so.displayName=I.ScrollDownButton.displayName;var bt=De.forwardRef(({children:e,className:t,position:o="popper",...r},a)=>(0,Jt.jsx)(I.Portal,{children:(0,Jt.jsxs)(I.Content,{className:w("relative he-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,Jt.jsx)(io,{}),(0,Jt.jsx)(I.Viewport,{className:w("Jt-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Jt.jsx)(so,{})]})}));bt.displayName=I.Content.displayName;var $r=De.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(I.Label,{className:w("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));$r.displayName=I.Label.displayName;var Xe=De.forwardRef(({children:e,className:t,...o},r)=>(0,Jt.jsxs)(I.Item,{className:w("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,Jt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Jt.jsx)(I.ItemIndicator,{children:(0,Jt.jsx)(he.Check,{className:"h-4 w-4"})})}),(0,Jt.jsx)(I.ItemText,{children:e})]}));Xe.displayName=I.Item.displayName;var Fr=De.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(I.Separator,{className:w("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Fr.displayName=I.Separator.displayName;var lo=X(require("react")),vt=X(require("@radix-ui/react-label"));var Wr=(0,Yt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=lo.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(vt.Root,{ref:o,className:w(Wr(),e),...t}));xt.displayName=vt.Root.displayName;var yt=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:a,className:i="",disabled:n=!1})=>{let[s,f]=(0,ge.useState)(!1),[T,x]=(0,ge.useState)(""),g=()=>{n||(f(!0),x(t))},D=async()=>{T!==t&&await a(e,T),f(!1)},v=y=>{y.key==="Enter"&&!r||y.key==="Enter"&&y.ctrlKey&&r?D():y.key==="Escape"&&(f(!1),x(""))};return(0,Jt.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Jt.jsx)(xt,{children:o}),s?r?(0,Jt.jsx)(ze,{value:T,onChange:y=>x(y.target.value),onBlur:D,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,Jt.jsx)(ue,{value:T,onChange:y=>x(y.target.value),onBlur:D,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,Jt.jsxs)("div",{onClick:g,className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 Jt-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,Jt.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click he edit..."}),!n&&(0,Jt.jsx)(he.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var _o=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Bo=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Uo=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Ko=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),$o=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Fo=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),Wo=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),nt=require("@payloadcms/richtext-lexical/lexical/list"),jo=require("@payloadcms/richtext-lexical/lexical/rich-text"),Go=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Vo=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),We=require("@payloadcms/richtext-lexical/lexical/utils"),P=require("@payloadcms/richtext-lexical/lexical"),Et=require("@payloadcms/richtext-lexical/lexical/selection");var No=require("@radix-ui/react-dialog"),et=require("@payloadcms/richtext-lexical/client");var Nt=X(require("bson-objectid"));var fo=require("@payloadcms/ui");var po=X(require("react")),pe=X(require("@radix-ui/react-tooltip"));var qe=pe.Provider,Ye=pe.Root,Qe=pe.Trigger,_e=po.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Jt.jsx)(pe.Portal,{children:(0,Jt.jsx)(pe.Content,{ref:r,sideOffset:t,className:w("he-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})}));_e.displayName=pe.Content.displayName;var jr=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[a]=(0,Vo.useLexicalComposerContext)(),[i,n]=(0,ge.useState)(""),[s,f]=(0,ge.useState)(""),[T,x]=(0,ge.useState)(""),g=async b=>{console.log("fetchMedia",b)};(0,ge.useEffect)(()=>{typeof o=="string"?o.length===24?g(o):(n(o||""),x(L(y())),f(v()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),x(L(o.filesize)),f(o.mimeType?.split("/")[1]||""))},[]);let D=(0,ge.useCallback)(()=>{a.update(()=>{(0,P.$getNodeByKey)(r)?.remove()})},[a,r]),v=()=>{let b=e.data.value;return typeof b=="string"?b.split(";base64")[0]?.split("image/")[1]:""},y=()=>{let b=e.data.value;if(typeof b=="string"){let h=b.split(",")[1]?.length||0;return 4*Math.ceil(h/3)*.5624896334383812/1e3}return 0};function L(b){if(b>=1e6){let k=b/1e6;return`${k>=10?Math.round(k).toString():k.toFixed(1)} MB`}return`${Math.floor(b/1e3)} KB`}return(0,Jt.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Jt.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Jt.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Jt.jsx)("div",{className:"flex-1",children:e.data.value?(0,Jt.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-he":t,src:i}):(0,Jt.jsx)(fo.File,{})}),(0,Jt.jsx)(qe,{children:(0,Jt.jsxs)(Ye,{children:[(0,Jt.jsxs)(Qe,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Jt.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Jt.jsx)("button",{onClick:b=>{b.preventDefault(),D()},className:"flex-1 flex justify-center items-center",children:(0,Jt.jsx)(he.X,{width:24,height:24,strokeWidth:1})})]}),(0,Jt.jsx)(_e,{children:(0,Jt.jsx)("span",{children:"Remove image"})})]})})]}),(0,Jt.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Jt.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,Jt.jsx)("span",{children:T})]})]})})},vo=jr;function Gr(e){if(e.hasAttribute("data-lexical-upload-relation-he")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:Ee({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Be=class extends et.UploadNode{static importDOM(){return{img:()=>({conversion:Gr,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Nt.default().toHexString(),t.version=3);let o={id:t.id??new Nt.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=Ee(o);return r.setFormat?.(t.format),r}decorate(){return(0,Jt.jsx)(vo,{data:this.__data,nodeKey:this.getKey()})}};function Ee(e){return new Be({data:e})}var Zr=typeof window<"Jt"&&typeof window.document<"Jt"&&typeof window.document.createElement<"Jt",Jr=e=>Zr?(e||window).getSelection():null,da=(0,P.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),Rt=(0,P.createCommand)("INSERT_UPLOAD_COMMAND");function Ro({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,ge.useRef)(!1),[a,i]=(0,ge.useState)(!0),[n,s]=(0,ge.useState)(""),[f,T]=(0,ge.useState)(""),[x,g]=(0,ge.useState)(!1),[D,v]=(0,ge.useState)("left"),y=n==="",L=S=>{g(S.target.checked)},b=S=>{v(S.target.value)},h=S=>{let K=new FileReader;K.onload=function(){return typeof K.result=="string"&&s(K.result),""},S!==null&&S[0]&&K.readAsDataURL(S[0])};(0,ge.useEffect)(()=>{r.current=!1;let S=K=>{r.current=K.altKey};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[e]),(0,ge.useEffect)(()=>{a||t()},[a]),(0,ge.useEffect)(()=>{i(o)},[o]);let k=({editor:S,relationTo:K,replaceNodeKey:ne,value:$})=>{if(ne)S.update(()=>{let M=(0,P.$getNodeByKey)(ne);M&&M.replace(Ee({id:"",fields:{},relationTo:"media",value:$}))});else{let M=S.dispatchCommand(Rt,{fields:null,relationTo:"media",value:$})}},_=()=>{k({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:f,src:n,showCaption:x,position:D}.src}),i(!1),t()};return(0,Jt.jsx)(Ze,{open:a,onOpenChange:S=>i(S),children:(0,Jt.jsxs)(pt,{children:[(0,Jt.jsxs)(ft,{children:[(0,Jt.jsx)(gt,{children:"Upload Image"}),(0,Jt.jsx)(No.DialogDescription,{children:"Description"})]}),(0,Jt.jsxs)("div",{className:"",children:[(0,Jt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Jt.jsx)(ue,{type:"file",onChange:S=>h(S.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Jt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Jt.jsx)(ue,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:S=>T(S.currentTarget.value),value:f,"data-test-id":"image-modal-alt-text-input"})}),(0,Jt.jsx)(de,{"data-test-id":"image-modal-file-upload-btn",disabled:y,onClick:()=>_(),children:"Confirm"})]})]})})}function Dt({captionsEnabled:e}){let[t]=(0,Vo.useLexicalComposerContext)();return(0,ge.useEffect)(()=>{if(!t.hasNodes([et.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,We.mergeRegister)(t.registerCommand(P.DRAGSTART_COMMAND,o=>Xr(o),P.COMMAND_PRIORITY_HIGH),t.registerCommand(P.DRAGOVER_COMMAND,o=>qr(o),P.COMMAND_PRIORITY_LOW),t.registerCommand(P.DROP_COMMAND,o=>Yr(o,t),P.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Xr(e){if(!Pt())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function qr(e){return Pt()?(Do(e)||e.preventDefault(),!0):!1}function Yr(e,t){let o=Pt();if(!o)return!1;if(e.preventDefault(),Do(e)){let r=Qr(e);o.remove();let a=(0,P.$createRangeSelection)();r!=null&&a.applyDOMRange(r),(0,P.$setSelection)(a)}return!0}function Pt(){let e=(0,P.$getSelection)();if(!(0,P.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,et.$isUploadNode)(o)?o:null}function Do(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 Qr(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,a=Jr(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 en=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),Po=en;var tn=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),So=tn;var on=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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,Jt.jsx)("path",{Jt:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Mo=on;var rn=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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,Jt.jsx)("path",{Jt:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),To=rn;var nn=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),ko=nn;var an=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),Io=an;var Eo=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),Lo=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),Ho=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),Ao=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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"})}),Oo=()=>(0,Jt.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,Jt.jsx)("path",{Jt:"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 xe=X(require("react")),E=X(require("@radix-ui/react-dropdown-menu")),Le=require("@radix-ui/react-icons");var tt=E.Root,ot=E.Trigger;var sn=xe.forwardRef(({className:e,inset:t,children:o,...r},a)=>(0,Jt.jsxs)(E.SubTrigger,{ref:a,className:w("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,Jt.jsx)(Le.ChevronRightIcon,{className:"ml-auto"})]}));sn.displayName=E.SubTrigger.displayName;var ln=xe.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(E.SubContent,{ref:o,className:w("he-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Jt-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}));ln.displayName=E.SubContent.displayName;var $e=xe.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Jt.jsx)(E.Portal,{children:(0,Jt.jsx)(E.Content,{ref:r,sideOffset:t,className:w("he-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Jt-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})}));$e.displayName=E.Content.displayName;var Fe=xe.forwardRef(({className:e,inset:t,...o},r)=>(0,Jt.jsx)(E.Item,{ref:r,className:w("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}));Fe.displayName=E.Item.displayName;var cn=xe.forwardRef(({className:e,children:t,checked:o,...r},a)=>(0,Jt.jsxs)(E.CheckboxItem,{ref:a,className:w("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,Jt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Jt.jsx)(E.ItemIndicator,{children:(0,Jt.jsx)(Le.CheckIcon,{className:"h-4 w-4"})})}),t]}));cn.displayName=E.CheckboxItem.displayName;var dn=xe.forwardRef(({className:e,children:t,...o},r)=>(0,Jt.jsxs)(E.RadioItem,{ref:r,className:w("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,Jt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Jt.jsx)(E.ItemIndicator,{children:(0,Jt.jsx)(Le.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));dn.displayName=E.RadioItem.displayName;var mn=xe.forwardRef(({className:e,inset:t,...o},r)=>(0,Jt.jsx)(E.Label,{ref:r,className:w("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));mn.displayName=E.Label.displayName;var un=xe.forwardRef(({className:e,...t},o)=>(0,Jt.jsx)(E.Separator,{ref:o,className:w("-mx-1 my-1 h-px bg-muted",e),...t}));un.displayName=E.Separator.displayName;var pn=({className:e,...t})=>(0,Jt.jsx)("span",{className:w("ml-auto text-xs tracking-widest opacity-60",e),...t});pn.displayName="DropdownMenuShortcut";var It=1;function fn(){return(0,Jt.jsx)("span",{className:"border border-[#222222]"})}function Lt(){let[e]=(0,Vo.useLexicalComposerContext)(),t=(0,ge.useRef)(null),[o,r]=(0,ge.useState)(!1),[a,i]=(0,ge.useState)(!1),[n,s]=(0,ge.useState)(!1),[f,T]=(0,ge.useState)(!1),[x,g]=(0,ge.useState)(!1),[D,v]=(0,ge.useState)(!1),[y,L]=(0,ge.useState)(!1),[b,h]=(0,ge.useState)(!1),[k,_]=(0,ge.useState)(!1),[S,K]=(0,ge.useState)("left"),[ne,$]=(0,ge.useState)("Jt"),M=m=>{e.update(()=>{let A=(0,P.$getSelection)();(0,P.$isRangeSelection)(A)&&(m==="Jt"?(0,Et.$setBlocksType)(A,()=>(0,P.$createParagraphNode)()):(0,Et.$setBlocksType)(A,()=>(0,jo.$createHeadingNode)(m)))})},Z=(0,ge.useCallback)(()=>{let m=(0,P.$getSelection)();if((0,P.$isRangeSelection)(m)){s(m.hasFormat("bold")),T(m.hasFormat("italic")),g(m.hasFormat("underline")),v(m.hasFormat("strikethrough")),L(m.hasFormat("subscript")),h(m.hasFormat("superscript"));let A=m.anchor.getNode(),W=A;for(;W&&!(0,P.$isParagraphNode)(W)&&W!==(0,P.$getRoot)();){let c=W.getParent();c&&(W=c)}if(W){let c=W.getFormatType();K(c||"left")}let me=A.getTopLevelElement()?.__tag;$(me||"Jt")}},[]);(0,ge.useEffect)(()=>(0,We.mergeRegister)(e.registerUpdateListener(({editorState:m})=>{m.read(()=>{Z()})}),e.registerCommand(P.SELECTION_CHANGE_COMMAND,(m,A)=>(Z(),!1),It),e.registerCommand(P.CAN_UNDO_COMMAND,m=>(r(m),!1),It),e.registerCommand(P.CAN_REDO_COMMAND,m=>(i(m),!1),It),(0,We.mergeRegister)(e.registerCommand(Rt,m=>(e.update(()=>{let A=(0,P.$getSelection)()||(0,P.$getPreviousSelection)();if((0,P.$isRangeSelection)(A)){let W=Ee({id:m.id,fields:m.fields,relationTo:m.relationTo,value:m.value}),{focus:me}=A,c=me.getNode();(0,We.$insertNodeToNearestRoot)(W),(0,P.$isParagraphNode)(c)&&!c.__first&&c.remove()}}),!0),P.COMMAND_PRIORITY_EDITOR))),[e,Z]);let F=[[{label:"Undo",icon:(0,Jt.jsx)(he.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Jt.jsx)(he.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.UNDO_COMMAND,void 0)},disabled:!a}],[{label:"Bold",icon:(0,Jt.jsx)(Po,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Jt.jsx)(So,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:f},{label:"Underline",icon:(0,Jt.jsx)(Mo,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:x},{label:"Strikethrough",icon:(0,Jt.jsx)(To,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:D},{label:"Subscript",icon:(0,Jt.jsx)(ko,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:y},{label:"Superscript",icon:(0,Jt.jsx)(Io,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:b}]],oe=[{label:"Left Align",direction:"left",icon:(0,Jt.jsx)(he.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Jt.jsx)(he.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Jt.jsx)(he.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Jt.jsx)(he.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"justify")}}],we=[{label:"Normal Text",value:"Jt",icon:(0,Jt.jsx)(Eo,{}),onClick:()=>M("Jt")},{label:"Heading 1",value:"h1",icon:(0,Jt.jsx)(Lo,{}),onClick:()=>M("h1")},{label:"Heading 2",value:"h2",icon:(0,Jt.jsx)(Ho,{}),onClick:()=>M("h2")},{label:"Heading 3",value:"h3",icon:(0,Jt.jsx)(Ao,{}),onClick:()=>M("h3")},{label:"Heading 4",value:"h4",icon:(0,Jt.jsx)(Oo,{}),onClick:()=>M("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Jt.jsx)(he.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(nt.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Jt.jsx)(he.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(nt.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ye=[{label:"Insert Image",icon:(0,Jt.jsx)(he.ImageUp,{width:15,height:15}),onClick:()=>{_(!0)},disabled:!1}];return(0,Jt.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black he-50",children:(0,Jt.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[F.map((m,A)=>(0,Jt.jsxs)(ge.Fragment,{children:[(0,Jt.jsx)("div",{className:"flex items-center gap-2",children:m.map((W,me)=>(0,Jt.jsx)("div",{role:"button","aria-disabled":W.disabled||!1,onClick:W.onClick,className:w("Jt-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]",W.active&&"bg-[#3c3c3c]"),"aria-label":W.label,children:(0,Jt.jsx)(qe,{children:(0,Jt.jsxs)(Ye,{children:[(0,Jt.jsx)(Qe,{className:"text-[#b5b5b5]",children:W.icon}),(0,Jt.jsx)(_e,{children:(0,Jt.jsx)("Jt",{children:W.label})})]})})},me))}),(0,Jt.jsx)(fn,{})]},`toolbar-option-${m.length}-${A}`)),(0,Jt.jsxs)(tt,{children:[(0,Jt.jsxs)(ot,{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:[oe.find(m=>m.direction===S)?.icon,oe.find(m=>m.direction===S)?.label,(0,Jt.jsx)(he.ChevronDown,{width:15,height:15})]}),(0,Jt.jsx)($e,{className:"bg-black hover:bg-black",children:oe.map((m,A)=>(0,Jt.jsxs)(Fe,{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,Jt.jsx)("span",{children:m.icon}),(0,Jt.jsx)("span",{children:m.label})]},`${m.label}-${A}`))})]}),(0,Jt.jsxs)(tt,{children:[(0,Jt.jsxs)(ot,{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:[we.find(m=>m.value===ne)?.icon,we.find(m=>m.value===ne)?.label,(0,Jt.jsx)(he.ChevronDown,{width:15,height:15})]}),(0,Jt.jsx)($e,{className:"bg-black hover:bg-black",children:we.map((m,A)=>(0,Jt.jsxs)(Fe,{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,Jt.jsx)("span",{children:m.icon}),(0,Jt.jsx)("span",{children:m.label})]},`heading-option-${m.label}-${A}`))})]}),(0,Jt.jsxs)(tt,{children:[(0,Jt.jsxs)(ot,{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,Jt.jsx)(he.Plus,{width:15,height:15}),(0,Jt.jsx)(he.ChevronDown,{width:15,height:15})]}),(0,Jt.jsx)($e,{className:"bg-black hover:bg-black",children:ye.map((m,A)=>(0,Jt.jsxs)(Fe,{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,Jt.jsx)("span",{children:m.icon}),(0,Jt.jsx)("span",{children:m.label})]},A))})]}),k&&(0,Jt.jsx)(Ro,{activeEditor:e,onClose:()=>{_(!1)},isOpen:k})]})})}var gn=({setValue:e,value:t,name:o,editable:r=!0})=>{let[a]=(0,Vo.useLexicalComposerContext)(),i=n=>{n.read(()=>{let s=n.toJSON();e?.(()=>s)})};return(0,ge.useEffect)(()=>{a.setEditable(r)},[r]),(0,ge.useEffect)(()=>{t&&a.update(()=>{a.setEditorState(a.parseEditorState(t))})},[]),(0,Jt.jsx)("div",{className:"w-full",children:(0,Jt.jsxs)("div",{className:" ",children:[r&&(0,Jt.jsx)(Lt,{}),(0,Jt.jsxs)("div",{className:"px-4 my-4 border-Jt border-[#222222]",children:[(0,Jt.jsx)(Fo.RichTextPlugin,{contentEditable:(0,Jt.jsx)(Uo.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Ko.LexicalErrorBoundary}),r&&(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsx)($o.HistoryPlugin,{}),(0,Jt.jsx)(_o.AutoFocusPlugin,{}),(0,Jt.jsx)(Wo.ListPlugin,{}),(0,Jt.jsx)(Go.OnChangePlugin,{onChange:i}),(0,Jt.jsx)(Dt,{})]})]})]})})},hn=({setValue:e,value:t,name:o,editable:r=!0})=>(0,Jt.jsx)(Bo.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[nt.ListNode,nt.ListItemNode,jo.HeadingNode,Be],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",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,Jt.jsx)(gn,{value:t,setValue:e,name:o,editable:r})}),at=hn;function Jo({document:e,onSave:t,mode:o="edit",onCancel:r,availableDocuments:a=[],knowledgeContexts:i=[]}){let[n,s]=(0,ge.useState)({...e,updatedAt:new Date}),[f,T]=(0,ge.useState)(!1),[x,g]=(0,ge.useState)(n.richTextContent),[D,v]=(0,ge.useState)(!1),y=(0,ge.useRef)(null),L=(0,ge.useRef)(""),b=(0,ge.useRef)(null),h=(0,ge.useRef)(null),k=c=>{let N=new WeakSet,C=B=>B&&typeof B=="object"?N.has(B)?null:(N.add(B),Array.isArray(B)?B.map(C):Object.keys(B).sort().reduce((J,Se)=>(J[Se]=C(B[Se]),J),{})):B;return JSON.stringify(C(c))},_=c=>c?c.replace(/\s+/g," ").trim():"",S=()=>n.format==="richText"?k(x):_(n.content),K=()=>{let c={title:_(n.title),description:_(n.description),format:n.format,content:S()},N=k(c),C=5381;for(let B=0;B<N.length;B++)C=C*33^N.charCodeAt(B);return(C>>>0).toString(16)},ne=(c,N)=>{if(c===N)return!1;if(n.format!=="richText"){let C=M(c),B=S();if(C==null)return!0;let J=C.length,Se=B.length,He=Math.abs(Se-J),je=J===0?1:He/J;return _(C)===_(B)&&He<3?!1:He>=10||je>=.02}return!0},$=(0,ge.useRef)(new Map),M=c=>{let N=$.current.get(c);return N==null?null:"x".repeat(N)};(0,ge.useEffect)(()=>(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{let c=K(),N=L.current;if(ne(N,c)&&(v(!0),t({...n,richTextContent:x},"autosave"),L.current=c,n.format!=="richText")){let C=S();$.current.set(c,C.length)}},800),()=>{h.current&&clearTimeout(h.current)}),[n.title,n.description,n.format,n.content,n.metadata,x]),(0,ge.useEffect)(()=>{let c=()=>{let N=K();N!==L.current&&(t({...n,richTextContent:x},"autosave"),L.current=N)};return window.addEventListener("pagehide",c),window.addEventListener("beforeunload",c),()=>{window.removeEventListener("pagehide",c),window.removeEventListener("beforeunload",c)}},[n,x]),(0,ge.useEffect)(()=>(D&&(b.current=setTimeout(()=>{v(!1)},2e3)),()=>{b.current&&clearTimeout(b.current)}),[D]),(0,ge.useEffect)(()=>{s(e)},[e]);let Z=c=>{switch(c){case"markdown":case"mdx":return(0,Jt.jsx)(he.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Jt.jsx)(he.File,{className:"h-6 w-6 text-success"});case"text":return(0,Jt.jsx)(he.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Jt.jsx)(he.File,{className:"h-6 w-6 text-muted-foreground"})}},F=c=>{switch(c){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"}},oe=()=>{let c=new Set,N=new Set;return i.forEach(C=>{C.menuConfig.groupBy.forEach(B=>c.add(B))}),a.forEach(C=>{C.metadata&&Object.keys(C.metadata).forEach(B=>N.add(B))}),{contextKeys:Array.from(c).sort(),documentKeys:Array.from(N).sort(),allKeys:Array.from(new Set([...c,...N])).sort()}},H=c=>{let N=new Set;return a.forEach(C=>{C.metadata?.[c]&&N.add(String(C.metadata[c]))}),Array.from(N).sort()},we=oe(),ye=()=>{t({...n,richTextContent:x},"autosave")},m=(c,N)=>{s(C=>({...C,metadata:{...C.metadata,[c]:N}}))},A=(c,N)=>{N==="__custom__"?m(c,""):m(c,N)},W=()=>{m("","")},me=c=>{s(N=>{let C={...N.metadata};return delete C[c],{...N,metadata:C}})};return(0,Jt.jsxs)(Te.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Jt.jsxs)("div",{className:"border-b border-border bg-card Jt-8 pb-6",children:[(0,Jt.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Jt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Jt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Jt.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Jt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Jt.jsx)(yt,{fieldName:"title",value:n.title,label:"",onSave:(c,N)=>s(C=>({...C,title:N})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:Jt-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Jt.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${F(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]}),(0,Jt.jsx)("div",{className:"mt-2",children:(0,Jt.jsx)(yt,{fieldName:"description",value:n.description||"Click he add description...",label:"",multiline:!0,onSave:(c,N)=>s(C=>({...C,description:N})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:Jt-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Jt.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Jt.jsxs)(de,{variant:"ghost",size:"sm",onClick:()=>T(!f),className:"gap-2",children:[(0,Jt.jsx)(he.Info,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&(0,Jt.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(n.metadata).length}),f?(0,Jt.jsx)(he.ChevronDown,{className:"h-4 w-4"}):(0,Jt.jsx)(he.ChevronRight,{className:"h-4 w-4"})]}),(0,Jt.jsxs)(de,{variant:"outline",size:"sm",onClick:r,className:"gap-2",children:[(0,Jt.jsx)(he.X,{className:"h-4 w-4"}),"Close"]}),(0,Jt.jsxs)(de,{size:"sm",onClick:ye,className:"gap-2",disabled:D,children:[D?(0,Jt.jsx)(he.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Jt.jsx)(he.Save,{className:"h-4 w-4"}),D?"Auto-saving...":"Save"]})]})]}),(0,Jt.jsx)(Te.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,Jt.jsxs)("div",{className:"pt-4 border-t border-border mt-4 max-h-full flex gap-2",children:[(0,Jt.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,Jt.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Jt.jsx)(he.Info,{className:"h-4 w-4"}),"Document Metadata"]})}),(0,Jt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Jt.jsx)("div",{className:"bg-muted rounded-lg Jt-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?(0,Jt.jsx)("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([c,N],C)=>{let B=H(c);return(0,Jt.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Jt.jsx)(ue,{value:c,onChange:J=>{let Se=J.target.value||"",He=n.metadata?.[c];s(je=>{let it={...je.metadata};return delete it[c],Se&&(it[Se]=He||""),{...je,metadata:it}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${c}`}),(0,Jt.jsx)("datalist",{id:`metadata-keys-${c}`,children:we.allKeys.map(J=>(0,Jt.jsx)("option",{value:J},J))}),(0,Jt.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),B.length>0?(0,Jt.jsxs)(no,{value:String(N||""),onValueChange:J=>A(c,J),children:[(0,Jt.jsx)(ht,{className:"flex-1 h-8 text-sm",children:(0,Jt.jsx)(ao,{placeholder:"Value"})}),(0,Jt.jsxs)(bt,{children:[B.map(J=>(0,Jt.jsx)(Xe,{value:J,children:J},J)),(0,Jt.jsx)(Xe,{value:"__custom__",children:(0,Jt.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Jt.jsx)(ue,{value:String(N||""),onChange:J=>m(c,J.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Jt.jsx)(de,{type:"button",variant:"ghost",size:"sm",onClick:()=>me(c),className:"h-8 w-8 Jt-0 text-muted-foreground hover:text-destructive",children:(0,Jt.jsx)(he.X,{className:"h-3 w-3"})})]},`metadata-key-${C}`)})}):(0,Jt.jsxs)("div",{className:"text-center py-4",children:[(0,Jt.jsx)("Jt",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Jt.jsx)("Jt",{className:"text-xs text-muted-foreground",children:'Click "Add Field" he create metadata'})]})}),(0,Jt.jsxs)(de,{type:"button",variant:"outline",size:"sm",onClick:W,className:"gap-1 h-8",children:[(0,Jt.jsx)(he.Plus,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),(0,Jt.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Jt.jsx)("div",{className:"Jt-8 pt-0 h-full max-h-full overflow-auto",children:n.format==="richText"?(0,Jt.jsx)(at,{setValue:g,value:x,name:"richTextContent"}):(0,Jt.jsx)(ze,{value:n.content||"",onChange:c=>s(N=>({...N,content:c.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var Yo=X(require("react-markdown")),Qo=X(require("remark-gfm"));var er=e=>(0,Jt.jsx)(Yo.default,{remarkPlugins:[Qo.default],components:{h1:({children:t})=>(0,Jt.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,Jt.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,Jt.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,Jt.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,Jt.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,Jt.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,Jt.jsx)("li",{className:"ml-4",children:t}),Jt:({children:t})=>(0,Jt.jsx)("Jt",{className:"mb-4",children:t}),a:({children:t,href:o})=>(0,Jt.jsx)("a",{href:o,className:"text-blue-500",children:t}),img:({src:t,alt:o})=>(0,Jt.jsx)("img",{src:t,alt:o,className:"mb-4"}),blockquote:({children:t})=>(0,Jt.jsx)("blockquote",{className:"border-Jt-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),Xo=e=>(0,Jt.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),bn=e=>(0,Jt.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,Jt.jsx)(at,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),vn=e=>(0,Jt.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Jt.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg Jt-4 mb-4",children:(0,Jt.jsxs)("Jt",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Jt.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),er(e)]});function tr({document:e,onDocumentUpdate:t,editable:o=!0,mode:r="view",renderers:a,availableDocuments:i=[],knowledgeContexts:n=[]}){let[s,f]=(0,ge.useState)(!1),[T,x]=(0,ge.useState)(!1),[g,D]=(0,ge.useState)(e),[v,y]=(0,ge.useState)(!1),L=(0,ge.useRef)(null),b=g.format==="richText"?g.richTextContent:g.content,h=(0,ge.useMemo)(()=>`${g.format}:${JSON.stringify(b)}`,[g.format,b]);(0,ge.useEffect)(()=>{D(e)},[e]);let k=M=>{switch(M){case"markdown":case"mdx":return(0,Jt.jsx)(he.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Jt.jsx)(he.File,{className:"h-6 w-6 text-success"});case"text":return(0,Jt.jsx)(he.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Jt.jsx)(he.File,{className:"h-6 w-6 text-muted-foreground"})}},_=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"}},S=(M,Z)=>{let F={markdown:er,mdx:vn,text:Xo},oe=a?.[Z]||F[Z];if(Z==="richText"&&typeof M=="object")return bn(M);if(oe&&typeof M=="string")return oe(M);if(typeof M=="string")return Xo(M)},K=async(M,Z="save")=>{Z==="save"&&y(!0),L.current=g,(0,ge.startTransition)(()=>{D({...M,richTextContent:M.richTextContent?structuredClone(M.richTextContent):void 0})});try{let F=await t?.(M);if(Z==="save"&&y(!1),!F)throw new Error("save failed")}catch{L.current&&(0,ge.startTransition)(()=>D(L.current))}},ne=()=>{f(!1)};return(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsx)(Ze,{open:s||r==="create",onOpenChange:M=>!M&&ne(),children:(0,Jt.jsxs)(ut,{children:[(0,Jt.jsx)(Je,{}),(0,Jt.jsxs)(qo.Content,{className:w("fixed inset-0 he-50 bg-background Jt-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:[v&&(0,Jt.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,Jt.jsx)(he.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,Jt.jsx)(Jo,{mode:r==="create"?"create":"edit",document:g,onSave:K,onCancel:ne,availableDocuments:i,knowledgeContexts:n})]})]})}),(0,Jt.jsxs)(Te.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Jt.jsxs)("div",{className:"border-b border-border bg-card Jt-8 pb-6",children:[(0,Jt.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Jt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Jt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Jt.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[g.title,(0,Jt.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${_(g.format)}`,children:g.format.toUpperCase()})]}),g.description&&(0,Jt.jsx)("Jt",{className:"text-muted-foreground text-lg leading-relaxed",children:g.description})]})}),(0,Jt.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[g.metadata&&Object.keys(g.metadata).length>0&&(0,Jt.jsxs)(de,{variant:"ghost",size:"sm",onClick:()=>x(!T),className:"gap-2",children:[(0,Jt.jsx)(he.Info,{className:"h-4 w-4"}),"Metadata",T?(0,Jt.jsx)(he.ChevronDown,{className:"h-4 w-4"}):(0,Jt.jsx)(he.ChevronRight,{className:"h-4 w-4"})]}),o&&(0,Jt.jsxs)(de,{variant:"outline",size:"sm",onClick:()=>f(!0),className:"gap-2",children:[(0,Jt.jsx)(he.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),g.metadata&&Object.keys(g.metadata).length>0&&(0,Jt.jsx)(Te.motion.div,{initial:!1,animate:{height:T?"auto":0,opacity:T?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Jt.jsxs)("div",{className:"pt-4 border-t border-border mt-4",children:[(0,Jt.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,Jt.jsx)(he.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Jt.jsx)("div",{className:"bg-muted rounded-lg Jt-4 border border-border",children:(0,Jt.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(g.metadata).map(([M,Z])=>(0,Jt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Jt.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:M.replace(/([A-Z])/g," $1").trim()}),(0,Jt.jsx)("span",{className:"text-foreground font-medium",children:String(Z)})]},M))})})]})})]}),(0,Jt.jsx)("div",{className:"flex-1 ",children:(0,Jt.jsx)("div",{className:"py-4 h-full",children:(0,Jt.jsx)("div",{className:"space-y-4",children:g.content||g.richTextContent?(0,Jt.jsx)("div",{className:"relative",children:(0,Jt.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:S(g.format==="richText"?g.richTextContent:g.content,g.format)})},h):(0,Jt.jsxs)("div",{className:"text-center Jt-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Jt.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Jt.jsx)(he.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Jt.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Jt.jsx)("Jt",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function Vt({label:e,documents:t,children:o,level:r,onDocumentClick:a,selectedDocumentId:i,showDocumentCount:n=!0}){let[s,f]=(0,ge.useState)(r===0),T=o&&Object.keys(o).length>0,x=t.length+(o?Object.values(o).reduce((v,y)=>v+y.documents.length,0):0),g=v=>{switch(v){case"markdown":case"mdx":return(0,Jt.jsx)(he.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,Jt.jsx)(he.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Jt.jsx)(he.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},D=v=>{let y=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return y[v%y.length]};return(0,Jt.jsxs)("div",{className:"space-y-1",children:[(T||t.length>0)&&(0,Jt.jsxs)(Te.motion.div,{className:`group flex items-center gap-3 Jt-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${r*20}px`},onClick:()=>f(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Jt.jsx)("div",{className:`w-1 h-6 rounded-full ${D(r)}`}),(0,Jt.jsx)(Te.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Jt.jsx)(he.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Jt.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Jt.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Jt.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&x>0&&(0,Jt.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Jt.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:x})})]})]}),(0,Jt.jsx)(Te.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Jt.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,y)=>(0,Jt.jsxs)(Te.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:y*.05,duration:.2},className:`group flex items-center gap-3 Jt-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${i===v.id?"bg-primary/10 border-Jt-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${r*20+20}px`},onClick:()=>a?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Jt.jsx)("div",{className:"flex-shrink-0",children:g(v.format)}),(0,Jt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Jt.jsx)("Jt",{className:`text-sm truncate transition-colors ${i===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,Jt.jsx)("Jt",{className:"text-xs text-muted-foreground truncate mt-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,Jt.jsx)("div",{className:"flex-shrink-0",children:(0,Jt.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.id)),o&&Object.entries(o).map(([v,y])=>(0,Jt.jsx)(Vt,{label:v,documents:y.documents,children:y.children,level:r+1,onDocumentClick:a,selectedDocumentId:i,showDocumentCount:n},v))]})})]})}function xn({documents:e,menuConfig:t,onDocumentClick:o,onDocumentShare:r,onDocumentUpdate:a,selectedDocumentId:i,className:n,editable:s=!0}){let[f,T]=(0,ge.useState)(""),[x,g]=(0,ge.useState)(null),[D,v]=(0,ge.useState)(e);(0,ge.useEffect)(()=>{v(e)},[e]),(0,ge.useEffect)(()=>{if(x?.id){let h=D.find(k=>k.id===x.id);h&&g(h)}},[D]);let y=(0,ge.useMemo)(()=>f?D.filter(h=>h.title.toLowerCase().includes(f.toLowerCase())||h.description?.toLowerCase().includes(f.toLowerCase())||h.tags?.some(k=>k.toLowerCase().includes(f.toLowerCase()))||Object.values(h.metadata||{}).some(k=>String(k).toLowerCase().includes(f.toLowerCase()))):D,[D,f]),L=(0,ge.useMemo)(()=>{let h=(k,_)=>{if(_.length===0)return{};let[S,...K]=_;return k.reduce(($,M)=>{let Z=M.metadata?.[S]||"Uncategorized",F=String(Z);if($[F]||($[F]={documents:[],children:{}}),K.length===0)$[F].documents.push(M);else{let oe=h([M],K),H=Object.keys(oe)[0];H&&($[F].children||($[F].children={}),$[F].children[H]?$[F].children[H].documents.push(...oe[H].documents):$[F].children[H]=oe[H])}return $},{})};return h(y,t.groupBy)},[y,t.groupBy]),b=h=>{g(h),o?.(h)};return(0,Jt.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,Jt.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Jt.jsx)("div",{className:"Jt-6 border-b border-border",children:(0,Jt.jsxs)("div",{className:"relative",children:[(0,Jt.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Jt.jsx)(he.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Jt.jsx)(ue,{placeholder:"Search knowledge base...",value:f,onChange:h=>T(h.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Jt.jsx)(mt,{className:"h-[calc(100%-100px)]",children:(0,Jt.jsx)("div",{className:"Jt-4 space-y-3",children:t.groupBy.length===0?(0,Jt.jsx)(Jt.Fragment,{children:(0,Jt.jsx)(Vt,{label:"Document",documents:y,level:0,onDocumentClick:b,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},"Document")}):(0,Jt.jsxs)(Jt.Fragment,{children:[Object.entries(L).map(([h,k])=>(0,Jt.jsx)(Vt,{label:h,documents:k.documents,children:k.children,level:0,onDocumentClick:b,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},h)),Object.keys(L).length===0&&(0,Jt.jsxs)(Te.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Jt.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Jt.jsx)(he.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Jt.jsx)("Jt",{className:"text-sm font-medium",children:"No documents found"}),(0,Jt.jsx)("Jt",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,Jt.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:x?(0,Jt.jsx)(tr,{document:x,onDocumentUpdate:a,editable:s}):(0,Jt.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Jt.jsxs)(Te.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Jt.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Jt.jsx)(he.FileText,{className:"h-10 w-10 text-primary"})}),(0,Jt.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Jt.jsx)("Jt",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base he view its content and details"})]})})})]})}0&&(module.exports={KnowledgeBrowser});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-GZ7FGBTR.mjs";import"../../chunk-XJKRA2AE.mjs";import"../../chunk-JTMIQ7MK.mjs";import"../../chunk-PZFYJ5FS.mjs";import"../../chunk-LEUI66J6.mjs";import"../../chunk-HFEN3KJC.mjs";import"../../chunk-L2UJOICL.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-DFIXTV2M.mjs";import"../../chunk-YFAZQYK4.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as KnowledgeBrowser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-LAQ3QAUW.mjs";import"../../chunk-PDY7JYY3.mjs";import"../../chunk-L3BLBPSR.mjs";import"../../chunk-Q5XT55O3.mjs";import"../../chunk-WISC5QJV.mjs";import"../../chunk-WISCWNL2.mjs";import"../../chunk-FVM5SQT2.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as Header};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-L3BLBPSR.mjs";import"../../chunk-Q5XT55O3.mjs";import"../../chunk-WISC5QJV.mjs";import"../../chunk-WISCWNL2.mjs";import"../../chunk-FVM5SQT2.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as HeaderDesktop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-M7NV6EFH.mjs";import"../../chunk-N3B3XNV3.mjs";import"../../chunk-O5BAW5XQ.mjs";import"../../chunk-2QZUKVBA.mjs";import"../../chunk-SRUG246N.mjs";import"../../chunk-4CU7D3X2.mjs";import"../../chunk-JYL3XIJX.mjs";import"../../chunk-LVK4QE5D.mjs";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-M7NV6EFH.mjs";import"../../chunk-N3B3XNV3.mjs";import"../../chunk-O5BAW5XQ.mjs";import"../../chunk-2QZUKVBA.mjs";import"../../chunk-SRUG246N.mjs";import"../../chunk-4CU7D3X2.mjs";import"../../chunk-JYL3XIJX.mjs";import"../../chunk-LVK4QE5D.mjs";import"../../chunk-LKGCU7H6.mjs";import"../../chunk-5WV5ZFEP.mjs";import"../../chunk-KX2NCNCS.mjs";import"../../chunk-LEC6GEWS.mjs";import"../../chunk-NSMXJCXE.mjs";import"../../chunk-XGIYNUGC.mjs";import"../../chunk-X3JZSN3W.mjs";import"../../chunk-2BR55L74.mjs";import"../../chunk-TEB67NCD.mjs";import"../../chunk-KFCSVEI6.mjs";import"../../chunk-LXZAOORS.mjs";import"../../chunk-MGYV46AJ.mjs";import"../../chunk-CGDLOY7W.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-BVFUCOCP.mjs";import"../../chunk-BG7QXNV5.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-WISCWNL2.mjs";import"../../chunk-FVM5SQT2.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as SectionHeading};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{a as h}from"../../chunk-22LHS2J6.mjs";import{a}from"../../chunk-IC2ABKAM.mjs";import{a as b}from"../../chunk-FHMQVAKQ.mjs";import"../../chunk-X5KZKO2V.mjs";import"../../chunk-7WIO2CIC.mjs";import"../../chunk-55EX54R7.mjs";import{a as f}from"../../chunk-6C4WESLL.mjs";import{a as g}from"../../chunk-LAQ3QAUW.mjs";import{a as e}from"../../chunk-PDY7JYY3.mjs";import{a as d}from"../../chunk-L3BLBPSR.mjs";import{a as c}from"../../chunk-Q5XT55O3.mjs";import"../../chunk-WISC5QJV.mjs";import"../../chunk-ZDPQXVTF.mjs";import"../../chunk-WISCWNL2.mjs";import"../../chunk-FMJBJ3HN.mjs";import"../../chunk-FVM5SQT2.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{c as BrandLogo,f as Footer,g as Header,d as HeaderDesktop,e as HeaderMobile,h as RelatedPagesMenu,a as SimpleHeader,b as VideoHeader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../../chunk-255P6K5W.mjs";import"../../../chunk-N3B3XNV3.mjs";import"../../../chunk-O5BAW5XQ.mjs";import"../../../chunk-2QZUKVBA.mjs";import"../../../chunk-SRUG246N.mjs";import"../../../chunk-4CU7D3X2.mjs";import"../../../chunk-JYL3XIJX.mjs";import"../../../chunk-LVK4QE5D.mjs";import"../../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../../chunk-255P6K5W.mjs";import"../../../chunk-N3B3XNV3.mjs";import"../../../chunk-O5BAW5XQ.mjs";import"../../../chunk-2QZUKVBA.mjs";import"../../../chunk-SRUG246N.mjs";import"../../../chunk-4CU7D3X2.mjs";import"../../../chunk-JYL3XIJX.mjs";import"../../../chunk-LVK4QE5D.mjs";import"../../../chunk-LKGCU7H6.mjs";import"../../../chunk-5WV5ZFEP.mjs";import"../../../chunk-KX2NCNCS.mjs";import"../../../chunk-LEC6GEWS.mjs";import"../../../chunk-NSMXJCXE.mjs";import"../../../chunk-XGIYNUGC.mjs";import"../../../chunk-X3JZSN3W.mjs";import"../../../chunk-2BR55L74.mjs";import"../../../chunk-TEB67NCD.mjs";import"../../../chunk-KFCSVEI6.mjs";import"../../../chunk-LXZAOORS.mjs";import"../../../chunk-MGYV46AJ.mjs";import"../../../chunk-CGDLOY7W.mjs";import"../../../chunk-3UMMMQEH.mjs";import"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-BVFUCOCP.mjs";import"../../../chunk-BG7QXNV5.mjs";import"../../../chunk-SOLZ4VQH.mjs";import"../../../chunk-CSBGSBEU.mjs";import"../../../chunk-YO3GQYRJ.mjs";import"../../../chunk-WISCWNL2.mjs";import"../../../chunk-FVM5SQT2.mjs";import"../../../chunk-QTW33JYG.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as HighImpactHero};
|