cortex-react-components 2.18.3 → 2.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/{chunk-275W7H4O.mjs → chunk-2SMCWU5D.mjs} +1 -1
  2. package/dist/{chunk-PAEL4O5F.mjs → chunk-32V5QT3S.mjs} +1 -1
  3. package/dist/{chunk-CH3CCSBB.mjs → chunk-3QSJWNSG.mjs} +1 -1
  4. package/dist/chunk-4KQPMKRD.mjs +4 -0
  5. package/dist/{chunk-XX4GSGRP.mjs → chunk-5NIEZE7A.mjs} +1 -1
  6. package/dist/{chunk-KBEXWUKI.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  7. package/dist/{chunk-IFU7M7BO.mjs → chunk-CEAEO2FN.mjs} +1 -1
  8. package/dist/{chunk-DX3G3FKT.mjs → chunk-H5VFV6Q4.mjs} +1 -1
  9. package/dist/{chunk-AXPE5U2T.mjs → chunk-IYJOABIM.mjs} +1 -1
  10. package/dist/{chunk-JK2VAKPT.mjs → chunk-JCWFPKF3.mjs} +1 -1
  11. package/dist/{chunk-ITJH72Z2.mjs → chunk-LAQ3QAUW.mjs} +1 -1
  12. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  13. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  14. package/dist/{chunk-5PZT7ZV2.mjs → chunk-RS4VD3ML.mjs} +1 -1
  15. package/dist/{chunk-XYJ4S67W.mjs → chunk-UG72MXTU.mjs} +1 -1
  16. package/dist/{chunk-OXKN6X62.mjs → chunk-UTRR5NUU.mjs} +1 -1
  17. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  18. package/dist/components/Chat/ChatInterface.mjs +1 -1
  19. package/dist/components/Chat/CopilotInterface.js +2 -2
  20. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  21. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  22. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  23. package/dist/components/Chat/demo-long-messages.js +2 -2
  24. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  25. package/dist/components/Chat/demo-tests.js +2 -2
  26. package/dist/components/Chat/demo-tests.mjs +1 -1
  27. package/dist/components/Chat/demo.js +2 -2
  28. package/dist/components/Chat/demo.mjs +1 -1
  29. package/dist/components/Chat/example-usage.js +2 -2
  30. package/dist/components/Chat/example-usage.mjs +1 -1
  31. package/dist/components/Chat/example-with-vercel-ai.js +2 -2
  32. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  33. package/dist/components/Chat/index.js +3 -3
  34. package/dist/components/Chat/index.mjs +1 -1
  35. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  36. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  37. package/dist/components/DigitalColleagues/index.mjs +1 -1
  38. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  39. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  40. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  41. package/dist/components/Foundary/MainPage.mjs +1 -1
  42. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  43. package/dist/components/Foundary/RichText/index.mjs +1 -1
  44. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  45. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  46. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  47. package/dist/components/Foundary/Views/index.mjs +1 -1
  48. package/dist/components/Foundary/document-edit.mjs +1 -1
  49. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  50. package/dist/components/Foundary/document-preview.mjs +1 -1
  51. package/dist/components/Foundary/index.mjs +1 -1
  52. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  53. package/dist/components/HeaderFooter/Header.mjs +1 -1
  54. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  55. package/dist/components/HeaderFooter/index.mjs +1 -1
  56. package/dist/components/Heros/PostHero/index.mjs +1 -1
  57. package/dist/components/Heros/RenderHero.mjs +1 -1
  58. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  59. package/dist/components/Heros/index.mjs +1 -1
  60. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  61. package/dist/components/Menus/SidebarRight.mjs +1 -1
  62. package/dist/components/Menus/index.mjs +1 -1
  63. package/dist/components/Other/index.mjs +1 -1
  64. package/dist/components/index.js +6 -6
  65. package/dist/components/index.mjs +1 -1
  66. package/dist/components/ui/index.mjs +1 -1
  67. package/dist/components/ui/sidebar.mjs +1 -1
  68. package/dist/index.js +6 -6
  69. package/dist/index.mjs +1 -1
  70. package/dist/metafile-cjs.json +1 -1
  71. package/dist/metafile-esm.json +1 -1
  72. package/dist/pages/Blog.mjs +1 -1
  73. package/dist/pages/Documentation.mjs +1 -1
  74. package/dist/pages/IndexPage.mjs +1 -1
  75. package/dist/pages/Intranet.mjs +1 -1
  76. package/dist/pages/LandingPage.mjs +1 -1
  77. package/dist/pages/Page.mjs +1 -1
  78. package/dist/pages/Publish.mjs +1 -1
  79. package/dist/pages/Website.mjs +1 -1
  80. package/dist/sections/AboutSection.mjs +1 -1
  81. package/dist/sections/BlogDetail.mjs +1 -1
  82. package/dist/sections/BlogList.mjs +1 -1
  83. package/dist/sections/BlogListSection.mjs +1 -1
  84. package/dist/sections/PageSections.mjs +1 -1
  85. package/dist/sections/PricingSection.mjs +1 -1
  86. package/dist/sections/ServiceSection.mjs +1 -1
  87. package/dist/sections/index.mjs +1 -1
  88. package/package.json +1 -1
  89. package/dist/chunk-XRW62PGB.mjs +0 -4
@@ -3,7 +3,7 @@
3
3
  'use client'
4
4
  'use client';
5
5
 
6
- "use strict";"use client";var ci=Object.create;var St=Object.defineProperty;var di=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var mi=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var gi=(e,t)=>{for(var o in t)St(e,o,{get:t[o],enumerable:!0})},Ao=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pi(t))!ui.call(e,n)&&n!==o&&St(e,n,{get:()=>t[n],enumerable:!(a=di(t,n))||a.enumerable});return e};var V=(e,t,o)=>(o=e!=null?ci(mi(e)):{},Ao(t||!e||!e.__esModule?St(o,"default",{value:e,enumerable:!0}):o,e)),fi=e=>Ao(St({},"__esModule",{value:!0}),e);var Tr={};gi(Tr,{AdvancedAICopilot:()=>Nr,CustomAICopilot:()=>wr,DemoCopilot:()=>Cr,FileUploadAICopilot:()=>Pr,FocusedChatCopilot:()=>kr,SimpleAICopilot:()=>xr});module.exports=fi(Tr);var Do=require("@ai-sdk/react");var ft=require("react"),Qt=require("motion/react"),_a=require("lucide-react");var Ho=require("clsx");var to="-",bi=e=>{let t=hi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:r=>{let s=r.split(to);return s[0]===""&&s.length!==1&&s.shift(),Bo(s,t)||vi(r)},getConflictingClassGroupIds:(r,s)=>{let c=o[r]||[];return s&&a[r]?[...c,...a[r]]:c}}},Bo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?Bo(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(to);return t.validators.find(({validator:r})=>r(i))?.classGroupId},Io=/^\[(.+)\]$/,vi=e=>{if(Io.test(e)){let t=Io.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},hi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return xi(Object.entries(e.classGroups),o).forEach(([i,r])=>{eo(r,a,i,t)}),a},eo=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Mo(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(yi(n)){eo(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,r])=>{eo(r,Mo(t,i),o,a)})})},Mo=(e,t)=>{let o=e;return t.split(to).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},yi=e=>e.isThemeGetter,xi=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[t+r,s])):i);return[o,n]}):e,wi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,r)=>{o.set(i,r),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let r=o.get(i);if(r!==void 0)return r;if((r=a.get(i))!==void 0)return n(i,r),r},set(i,r){o.has(i)?o.set(i,r):n(i,r)}}},Lo="!",Ci=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,r=s=>{let c=[],m=0,w=0,f;for(let C=0;C<s.length;C++){let N=s[C];if(m===0){if(N===n&&(a||s.slice(C,C+i)===t)){c.push(s.slice(w,C)),w=C+i;continue}if(N==="/"){f=C;continue}}N==="["?m++:N==="]"&&m--}let y=c.length===0?s:s.substring(w),R=y.startsWith(Lo),I=R?y.substring(1):y,T=f&&f>w?f-w:void 0;return{modifiers:c,hasImportantModifier:R,baseClassName:I,maybePostfixModifierPosition:T}};return o?s=>o({className:s,parseClassName:r}):r},Ni=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},ki=e=>({cache:wi(e.cacheSize),parseClassName:Ci(e),...bi(e)}),Pi=/\s+/,Ti=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],r=e.trim().split(Pi),s="";for(let c=r.length-1;c>=0;c-=1){let m=r[c],{modifiers:w,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:R}=o(m),I=!!R,T=a(I?y.substring(0,R):y);if(!T){if(!I){s=m+(s.length>0?" "+s:s);continue}if(T=a(y),!T){s=m+(s.length>0?" "+s:s);continue}I=!1}let C=Ni(w).join(":"),N=f?C+Lo:C,F=N+T;if(i.includes(F))continue;i.push(F);let S=n(T,I);for(let M=0;M<S.length;++M){let _=S[M];i.push(N+_)}s=m+(s.length>0?" "+s:s)}return s};function Di(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Eo(t))&&(a&&(a+=" "),a+=o);return a}var Eo=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Eo(e[a]))&&(o&&(o+=" "),o+=t);return o};function Ri(e,...t){let o,a,n,i=r;function r(c){let m=t.reduce((w,f)=>f(w),e());return o=ki(m),a=o.cache.get,n=o.cache.set,i=s,s(c)}function s(c){let m=a(c);if(m)return m;let w=Ti(c,o);return n(c,w),w}return function(){return i(Di.apply(null,arguments))}}var j=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},zo=/^\[(?:([a-z-]+):)?(.+)\]$/i,Si=/^\d+\/\d+$/,Ai=new Set(["px","full","screen"]),Ii=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mi=/\d+(%|px|r?em|[sdl]?Oo([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Oo|i|Oo|min|max))|\Oo(calc|min|max|clamp)\(.+\)|^0$/,Bi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Li=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ei=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ie=e=>it(e)||Ai.has(e)||Si.test(e),je=e=>rt(e,"length",Wi),it=e=>!!e&&!Number.isNaN(Number(e)),Zt=e=>rt(e,"number",it),yt=e=>!!e&&Number.isInteger(Number(e)),zi=e=>e.endsWith("%")&&it(e.slice(0,-1)),x=e=>zo.test(e),Oe=e=>Ii.test(e),Ui=new Set(["length","size","percentage"]),Fi=e=>rt(e,Ui,Uo),Hi=e=>rt(e,"position",Uo),ji=new Set(["image","url"]),Oi=e=>rt(e,ji,$i),Vi=e=>rt(e,"",Gi),xt=()=>!0,rt=(e,t,o)=>{let a=zo.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Wi=e=>Mi.test(e)&&!Bi.test(e),Uo=()=>!1,Gi=e=>Li.test(e),$i=e=>Ei.test(e);var qi=()=>{let e=j("colors"),t=j("spacing"),o=j("blur"),a=j("brightness"),n=j("borderColor"),i=j("borderRadius"),r=j("borderSpacing"),s=j("borderWidth"),c=j("contrast"),m=j("grayscale"),w=j("hueRotate"),f=j("invert"),y=j("gap"),R=j("gradientColorStops"),I=j("gradientColorStopPositions"),T=j("inset"),C=j("margin"),N=j("opacity"),F=j("padding"),S=j("saturate"),M=j("scale"),_=j("sepia"),$=j("skew"),le=j("space"),J=j("translate"),W=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],ce=()=>["auto",x,t],B=()=>[x,t],Se=()=>["",Ie,je],d=()=>["auto",it,x],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],ve=()=>["","0",x],u=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[it,x];return{cacheSize:500,separator:":",theme:{colors:[xt],spacing:[Ie,je],blur:["none","",Oe,x],brightness:U(),borderColor:[e],borderRadius:["none","","full",Oe,x],borderSpacing:B(),borderWidth:Se(),contrast:U(),grayscale:ve(),hueRotate:U(),invert:ve(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[zi,je],inset:ce(),margin:ce(),opacity:U(),padding:B(),saturate:U(),scale:U(),sepia:ve(),skew:U(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",x]}],container:["container"],columns:[{columns:[Oe]}],"break-after":[{"break-after":u()}],"break-before":[{"break-before":u()}],"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:[...E(),x]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yt,x]}],basis:[{basis:ce()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",x]}],grow:[{grow:ve()}],shrink:[{shrink:ve()}],order:[{order:["first","last","none",yt,x]}],"grid-cols":[{"grid-cols":[xt]}],"col-start-end":[{col:["auto",{span:["full",yt,x]},x]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[xt]}],"row-start-end":[{row:["auto",{span:[yt,x]},x]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",x]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",x]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Oo:[{Oo:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],pe:[{pe:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],Oo:[{Oo:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[le]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[le]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",x,t]}],"min-w":[{"min-w":[x,t,"min","max","fit"]}],"max-w":[{"max-w":[x,t,"none","full","min","max","fit","prose",{screen:[Oe]},Oe]}],Oo:[{Oo:[x,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Oo":[{"min-Oo":[x,t,"min","max","fit","svh","lvh","dvh"]}],"max-Oo":[{"max-Oo":[x,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[x,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Oe,je]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zt]}],"font-family":[{font:[xt]}],"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",x]}],"line-clamp":[{"line-clamp":["none",it,Zt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ie,x]}],"list-image":[{"list-image":["none",x]}],"list-style-type":[{list:["none","disc","decimal",x]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ie,je]}],"underline-offset":[{"underline-offset":["auto",Ie,x]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",x]}],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",x]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),Hi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Fi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Oo","bl","l","tl"]},Oi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-Oo":[{"rounded-Oo":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Oo":[{"rounded-Oo":[i]}],"rounded-Oo":[{"rounded-Oo":[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-Oo":[{"border-Oo":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...z(),"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":[N]}],"divide-style":[{divide:z()}],"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-Oo":[{"border-Oo":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Ie,x]}],"outline-w":[{outline:[Ie,je]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Ie,je]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Oe,Vi]}],"shadow-color":[{shadow:[xt]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Oe,x]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[r]}],"border-spacing-x":[{"border-spacing-x":[r]}],"border-spacing-y":[{"border-spacing-y":[r]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",x]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",x]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",x]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[yt,x]}],"translate-x":[{"translate-x":[J]}],"translate-y":[{"translate-y":[J]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",x]}],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","Oo-resize","nw-resize","Oo-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",x]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-Oo":[{"scroll-Oo":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-Oo":[{"scroll-Oo":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",x]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ie,je,Zt]}],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"],Oo:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","Oo","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","Oo"],"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-Oo","rounded-l","rounded-ss","rounded-Oo","rounded-Oo","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Oo","rounded-Oo"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Oo":["rounded-br","rounded-bl"],"rounded-l":["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-Oo","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Oo"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Oo","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Oo"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-Oo","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-Oo":["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 Fo=Ri(qi);function l(...e){return Fo((0,Ho.clsx)(e))}var Ut=V(require("react")),lo=V(require("next/link"));var jo=require("class-variance-authority");var Oo=require("react/jsx-runtime"),Ki=(0,jo.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ie({className:e,variant:t,...o}){return(0,Oo.jsx)("div",{className:l(Ki({variant:t}),e),...o})}var Vo=require("@radix-ui/react-slot"),Go=V(require("react")),_i=(0,jo.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:"Oo-10 px-4 py-2",icon:"Oo-10 w-10",lg:"Oo-11 rounded px-8",sm:"Oo-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"}}}),D=Go.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,$o.jsx)(e?Vo.Slot:"button",{className:l(_i({className:t,size:o,variant:a})),ref:i,...n}));D.displayName="Button";var qo=V(require("react"));var wt=qo.forwardRef(({className:e,type:t,...o},a)=>(0,Oo.jsx)("input",{type:t,className:l("flex Oo-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:a,...o}));wt.displayName="Input";var oo=V(require("react")),ue=V(require("@radix-ui/react-scroll-area"));var Ce=oo.forwardRef(({className:e,children:t,...o},a)=>(0,Oo.jsxs)(ue.Root,{ref:a,className:l("relative overflow-hidden",e),...o,children:[(0,Oo.jsx)(ue.Viewport,{className:"Oo-full w-full rounded-[inherit]",children:t}),(0,Oo.jsx)(_o,{}),(0,Oo.jsx)(ue.Corner,{})]}));Ce.displayName=ue.Root.displayName;var _o=oo.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Oo.jsx)(ue.ScrollAreaScrollbar,{ref:a,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"Oo-full w-2.5 border-l border-l-transparent Oo-[1px]",t==="horizontal"&&"Oo-2.5 flex-col border-t border-t-transparent Oo-[1px]",e),...o,children:(0,Oo.jsx)(ue.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));_o.displayName=ue.ScrollAreaScrollbar.displayName;var Ct=V(require("react")),q=V(require("@radix-ui/react-dialog"));var Xo=q.Root;var Ji=q.Portal;var Qo=Ct.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(q.Overlay,{ref:o,className:l("fixed inset-0 z-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}));Qo.displayName=q.Overlay.displayName;var ao=Ct.forwardRef(({className:e,children:t,...o},a)=>(0,Oo.jsxs)(Ji,{children:[(0,Oo.jsx)(Qo,{}),(0,Oo.jsxs)(q.Content,{ref:a,className:l("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background Oo-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,Oo.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,Oo.jsx)(_a.X,{className:"Oo-4 w-4"}),(0,Oo.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));ao.displayName=q.Content.displayName;var io=({className:e,...t})=>(0,Oo.jsx)("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});io.displayName="DialogHeader";var Xi=({className:e,...t})=>(0,Oo.jsx)("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xi.displayName="DialogFooter";var ro=Ct.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(q.Title,{ref:o,className:l("text-lg font-semibold leading-none tracking-tight",e),...t}));ro.displayName=q.Title.displayName;var Qi=Ct.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(q.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));Qi.displayName=q.Description.displayName;var Nt=V(require("@radix-ui/react-checkbox")),Zo=V(require("react")),no=Zo.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Nt.Root,{className:l("peer Oo-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,Oo.jsx)(Nt.Indicator,{className:l("flex items-center justify-center text-current"),children:(0,Oo.jsx)(_a.Check,{className:"Oo-4 w-4"})})}));no.displayName=Nt.Root.displayName;var Ne=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),_e=[{id:"home",title:"Home",icon:(0,Oo.jsx)(_a.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Oo.jsx)(_a.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Oo.jsx)(_a.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Me",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Oo.jsx)(_a.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Oo.jsx)(_a.FileText,{}),url:"/knowledge"}],Je=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated to version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"_a new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],Me=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Oo.jsx)(_a.Palette,{className:"Oo-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Oo.jsx)(_a.Code,{className:"Oo-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Oo.jsx)(_a.TrendingUp,{className:"Oo-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Oo.jsx)(_a.DollarSign,{className:"Oo-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Oo.jsx)(_a.Users,{className:"Oo-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Oo.jsx)(_a.Wrench,{className:"Oo-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Oo.jsx)(_a.Scale,{className:"Oo-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Oo.jsx)(_a.Package,{className:"Oo-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Oo.jsx)(_a.Zap,{className:"Oo-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Oo.jsx)(_a.Building2,{className:"Oo-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Bt=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var so=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],It=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Et=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Yi=[...Et,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Zi=[...Bt,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Mt={projects:[{id:"1",name:"Empty Project",description:"_a project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},ea={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Et.filter(e=>e.epicId==="1")};var Jr={empty:{initialProjects:Mt.projects,initialEpics:Mt.epics,initialSprints:Mt.sprints,initialTasks:Mt.tasks},default:{initialProjects:Bt,initialEpics:so,initialSprints:It,initialTasks:Et},highDensity:{initialProjects:Bt,initialEpics:so,initialSprints:It,initialTasks:Yi},singleEpic:{initialProjects:Bt,initialEpics:ea.epics,initialSprints:It,initialTasks:ea.tasks},multipleProjects:{initialProjects:Zi,initialEpics:so,initialSprints:It,initialTasks:Et}},Lt=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Ne),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ne),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Ne),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ne),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Ne),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ne),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Ne),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ne),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Ne),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ne),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Xr=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Lt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Lt.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Lt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var Qr=Lt.filter(e=>e.type==="digital");function ta(e,t){let[o,a]=(0,ft.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),n=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,ft.useEffect)(()=>{n(o)},[]),[o,n]}function co({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:n=Me[0],onBusinessUnitChange:i,onSearch:r,className:s,logo:c="/headerlogo.png",appName:m="Nuvia",tagline:w="Collaboration Platform"}){let[f,y]=Ut.useState({}),[R,I]=ta("sidebar-favorites",{}),[T,C]=Ut.useState(null),[N,F]=Ut.useState(""),S=d=>{y(E=>({...E,[d]:!E[d]}))},M=d=>{i?.(d)},_=()=>{N.trim()&&r?.(N.trim())},$=d=>{d.key==="Enter"&&(d.preventDefault(),_())},le=(d,E)=>{let z=R[d]||[],G=z.includes(E)?z.filter(Z=>Z!==E):z.concat(E);I({...R,[d]:G})},J=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let E=R[d.id]||[],z=d.items.filter(Z=>E.includes(Z.id)),G=d.items.filter(Z=>!E.includes(Z.id));return[...z,...G].slice(0,d.maxItems)},W=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,X=e,ce=d=>{let E=W(d),z=J(d),G=(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Oo.jsx)("span",{children:d.title})]}),d.badge&&(0,Oo.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Oo.jsx)(_a.ChevronDown,{className:l("ml-2 Oo-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),Z=l("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,Oo.jsx)(lo.default,{href:d.url,className:Z,onClick:o?a:void 0,children:G}):(0,Oo.jsx)("button",{className:Z,onClick:()=>d.items&&S(d.title),children:G})},B=()=>{let d=e.find(z=>z.id===T);if(!d||!d.items||!d.maxItems)return null;let E=R[d.id]||[];return(0,Oo.jsx)(Xo,{open:!!T,onOpenChange:z=>!z&&C(null),children:(0,Oo.jsxs)(ao,{className:"sm:max-w-md",children:[(0,Oo.jsxs)(io,{children:[(0,Oo.jsxs)(ro,{children:["Manage ",d.title," Favorites"]}),(0,Oo.jsxs)("Oo",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,Oo.jsx)(Ce,{className:"max-Oo-96 pr-4",children:(0,Oo.jsx)("div",{className:"space-y-4",children:d.items.map(z=>(0,Oo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Oo.jsx)(no,{id:z.id,checked:E.includes(z.id),onCheckedChange:()=>le(d.id,z.id),disabled:!E.includes(z.id)&&E.length>=(d.maxItems||0)}),(0,Oo.jsxs)("label",{htmlFor:z.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[z.title,z.badge&&(0,Oo.jsx)(ie,{variant:"outline",className:"text-xs",children:z.badge})]})]},z.id))})})]})})},Se=(0,Oo.jsxs)("div",{className:"flex Oo-full flex-col bg-background",children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between Oo-4",children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Oo.jsx)("div",{className:"flex Oo-14 w-14 items-center justify-center",children:(0,Oo.jsx)("img",{src:c,alt:"Header Logo",className:"Oo-14 w-14 object-contain"})}),(0,Oo.jsxs)("div",{children:[(0,Oo.jsx)("h2",{className:"font-semibold",children:m}),(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:w})]})]}),o&&(0,Oo.jsx)(D,{variant:"ghost",size:"icon",onClick:a,children:(0,Oo.jsx)(_a.X,{className:"Oo-5 w-5"})})]}),(0,Oo.jsx)("div",{className:"px-3 py-2",children:(0,Oo.jsxs)("div",{className:"relative",children:[(0,Oo.jsx)(_a.Search,{className:"absolute left-3 top-3 Oo-4 w-4 text-muted-foreground"}),(0,Oo.jsx)(wt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:N,onChange:d=>F(d.target.value),onKeyPress:$})]})}),(0,Oo.jsx)(Ce,{className:"flex-1 px-3 py-2",children:(0,Oo.jsx)("div",{className:"space-y-1",children:X.map(d=>(0,Oo.jsxs)("div",{className:"mb-1",children:[ce(d),d.items&&f[d.title]&&(0,Oo.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[J(d).map(E=>(0,Oo.jsxs)(lo.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[E.title,E.badge&&(0,Oo.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),W(d)&&d.items&&d.items.length>J(d).length&&(0,Oo.jsxs)("button",{onClick:()=>C(d.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-J(d).length," more available"]})]})]},d.id))})}),(0,Oo.jsx)("div",{className:"Oo-3",children:(0,Oo.jsx)("div",{className:"space-y-1",children:(0,Oo.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Oo.jsx)(_a.Settings,{className:"Oo-5 w-5"}),(0,Oo.jsx)("span",{children:"Settings"})]})})}),(0,Oo.jsx)(B,{})]});return o?(0,Oo.jsx)("div",{className:l("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Se}):(0,Oo.jsx)("div",{className:l("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Se})}var Ft=V(require("react")),Be=V(require("@radix-ui/react-avatar"));var nt=Ft.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Be.Root,{ref:o,className:l("relative flex Oo-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));nt.displayName=Be.Root.displayName;var po=Ft.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Be.Image,{ref:o,className:l("aspect-square Oo-full w-full",e),...t}));po.displayName=Be.Image.displayName;var st=Ft.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Be.Fallback,{ref:o,className:l("flex Oo-full w-full items-center justify-center rounded-full bg-muted",e),...t}));st.displayName=Be.Fallback.displayName;var oa=V(require("react")),ye=V(require("@radix-ui/react-tooltip"));var lt=ye.Provider,ct=ye.Root,dt=ye.Trigger,Xe=oa.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Oo.jsx)(ye.Portal,{children:(0,Oo.jsx)(ye.Content,{ref:a,sideOffset:t,className:l("z-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})}));Xe.displayName=ye.Content.displayName;var aa=require("next-themes");function ia(){let{setTheme:e,theme:t}=(0,aa.useTheme)();return(0,Oo.jsx)(lt,{children:(0,Oo.jsxs)(ct,{children:[(0,Oo.jsx)(dt,{asChild:!0,children:(0,Oo.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Oo.jsx)(_a.Sun,{className:"Oo-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Oo.jsx)(_a.Moon,{className:"absolute Oo-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Oo.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Oo.jsx)(Xe,{children:"Toggle theme"})]})})}function ra({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:n,className:i}){let r=e.filter(m=>!m.read),s=r.length,c=m=>{switch(m){case"info":return(0,Oo.jsx)(_a.Info,{className:"Oo-5 w-5 text-blue-500"});case"success":return(0,Oo.jsx)(_a.Check,{className:"Oo-5 w-5 text-green-500"});case"warning":return(0,Oo.jsx)(_a.AlertTriangle,{className:"Oo-5 w-5 text-amber-500"});case"error":return(0,Oo.jsx)(_a.AlertTriangle,{className:"Oo-5 w-5 text-red-500"})}};return(0,Oo.jsx)(Qt.AnimatePresence,{children:t&&(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(Qt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,Oo.jsx)(Qt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,Oo.jsxs)("div",{className:"flex Oo-full flex-col",children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between border-Oo Oo-4",children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oo.jsx)(_a.Bell,{className:"Oo-5 w-5"}),(0,Oo.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Oo.jsxs)(ie,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Oo.jsxs)(D,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,Oo.jsx)(_a.X,{className:"Oo-5 w-5"}),(0,Oo.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,Oo.jsxs)("div",{className:"flex items-center justify-between border-Oo Oo-2",children:[(0,Oo.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:n,className:"text-sm",children:"Dismiss all"})]}),r.length>0?(0,Oo.jsx)(Ce,{className:"flex-1",children:(0,Oo.jsx)("div",{className:"divide-y",children:r.map(m=>(0,Oo.jsxs)("div",{className:l("flex gap-3 Oo-4 transition-colors bg-muted/50"),children:[(0,Oo.jsx)("div",{className:"flex Oo-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(m.type)}),(0,Oo.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Oo.jsx)("Oo",{className:"font-medium",children:m.title}),(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:m.time}),(0,Oo.jsx)(D,{variant:"ghost",size:"sm",className:"Oo-6 w-6 Oo-0",onClick:()=>a?.(m.id),title:"Dismiss",children:(0,Oo.jsx)(_a.Check,{className:"Oo-3 w-3"})})]})]}),(0,Oo.jsx)("Oo",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Oo.jsxs)(D,{variant:"link",size:"sm",className:"Oo-auto Oo-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Oo.jsx)(_a.ChevronRight,{className:"ml-1 Oo-3 w-3"})]})]})]},m.id))})}):(0,Oo.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center Oo-8 text-center",children:[(0,Oo.jsx)("div",{className:"flex Oo-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Oo.jsx)(_a.Bell,{className:"Oo-8 w-8 text-muted-foreground"})}),(0,Oo.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Oo.jsx)("Oo",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Qe=V(require("@radix-ui/react-tabs"));function na({className:e,...t}){return(0,Oo.jsx)(Qe.Root,{"data-slot":"tabs",className:l("flex flex-col gap-2",e),...t})}function sa({className:e,...t}){return(0,Oo.jsx)(Qe.List,{"data-slot":"tabs-list",className:l("bg-muted text-muted-foreground inline-flex Oo-9 w-fit items-center justify-center rounded-lg Oo-[3px]",e),...t})}function la({className:e,...t}){return(0,Oo.jsx)(Qe.Trigger,{"data-slot":"tabs-trigger",className:l("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex Oo-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Le=V(require("react")),P=V(require("@radix-ui/react-dropdown-menu")),pt=require("@radix-ui/react-icons");var ca=P.Root,da=P.Trigger;var er=Le.forwardRef(({className:e,inset:t,children:o,...a},n)=>(0,Oo.jsxs)(P.SubTrigger,{ref:n,className:l("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),...a,children:[o,(0,Oo.jsx)(pt.ChevronRightIcon,{className:"ml-auto"})]}));er.displayName=P.SubTrigger.displayName;var tr=Le.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(P.SubContent,{ref:o,className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Oo-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}));tr.displayName=P.SubContent.displayName;var uo=Le.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Oo.jsx)(P.Portal,{children:(0,Oo.jsx)(P.Content,{ref:a,sideOffset:t,className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Oo-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})}));uo.displayName=P.Content.displayName;var go=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,Oo.jsx)(P.Item,{ref:a,className:l("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}));go.displayName=P.Item.displayName;var or=Le.forwardRef(({className:e,children:t,checked:o,...a},n)=>(0,Oo.jsxs)(P.CheckboxItem,{ref:n,className:l("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,...a,children:[(0,Oo.jsx)("span",{className:"absolute left-2 flex Oo-3.5 w-3.5 items-center justify-center",children:(0,Oo.jsx)(P.ItemIndicator,{children:(0,Oo.jsx)(pt.CheckIcon,{className:"Oo-4 w-4"})})}),t]}));or.displayName=P.CheckboxItem.displayName;var ar=Le.forwardRef(({className:e,children:t,...o},a)=>(0,Oo.jsxs)(P.RadioItem,{ref:a,className:l("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,Oo.jsx)("span",{className:"absolute left-2 flex Oo-3.5 w-3.5 items-center justify-center",children:(0,Oo.jsx)(P.ItemIndicator,{children:(0,Oo.jsx)(pt.DotFilledIcon,{className:"Oo-4 w-4 fill-current"})})}),t]}));ar.displayName=P.RadioItem.displayName;var ir=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,Oo.jsx)(P.Label,{ref:a,className:l("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));ir.displayName=P.Label.displayName;var rr=Le.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(P.Separator,{ref:o,className:l("-mx-1 my-1 Oo-px bg-muted",e),...t}));rr.displayName=P.Separator.displayName;var nr=({className:e,...t})=>(0,Oo.jsx)("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});nr.displayName="DropdownMenuShortcut";function ma({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:n="700px",gridCols:i=6}){let r=o.find(s=>s.value===e);return(0,Oo.jsxs)(Qt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Oo.jsx)("div",{className:"hidden lg:block",children:(0,Oo.jsx)(na,{value:e,onValueChange:t,children:(0,Oo.jsx)(sa,{className:"grid w-full rounded-2xl Oo-0 Oo-10",style:{maxWidth:n,gridTemplateColumns:`repeat(${Math.min(i,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Oo.jsx)(la,{value:s.value,className:"w-full Oo-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Oo.jsx)("div",{className:"lg:hidden",children:(0,Oo.jsxs)(ca,{children:[(0,Oo.jsx)(da,{asChild:!0,children:(0,Oo.jsxs)(D,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[r?.label||"Select",(0,Oo.jsx)(_a.ChevronDown,{className:"Oo-4 w-4 ml-2"})]})}),(0,Oo.jsx)(uo,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Oo.jsx)(go,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function ua({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:n=!0,className:i,activeTab:r="assistant",onTabChange:s,showTabs:c=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:w,actionIcon:f=(0,Oo.jsx)($e.Bot,{className:"mr-2 Oo-4 w-4"}),actionText:y="Action",onNotificationRemove:R,onRemoveAll:I,logo:T="/headerlogo.png",appName:C="Nuvia",tagline:N="Collaboration Platform"}){let[F,S]=(0,ft.useState)(!1),[M,_]=(0,ft.useState)(t),$=M.filter(W=>!W.read).length,le=W=>{_(X=>X.filter(ce=>ce.id!==W)),R?.(W)},J=()=>{_(W=>W.filter(X=>X.read)),I?.()};return(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsxs)("header",{className:`sticky top-0 z-10 flex Oo-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${i||""}`,children:[(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Oo.jsx)($e.Menu,{className:"Oo-5 w-5"})}),(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,Oo.jsx)($e.PanelLeft,{className:"Oo-5 w-5"})}),!n&&(0,Oo.jsxs)(Qt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Oo.jsx)("div",{className:"flex Oo-10 w-10 items-center justify-center",children:(0,Oo.jsx)("img",{src:T,alt:"Logo",className:"Oo-10 w-10 object-contain"})}),(0,Oo.jsxs)("div",{children:[(0,Oo.jsx)("h2",{className:"font-semibold text-sm",children:C}),(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:N})]})]}),(0,Oo.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Oo.jsx)(ma,{activeTab:r,onTabChange:s,tabOptions:m}),(0,Oo.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Oo.jsx)(Qt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Oo.jsxs)(D,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:w,children:[f,y]})})}),(0,Oo.jsx)(ia,{}),(0,Oo.jsx)(lt,{children:(0,Oo.jsxs)(ct,{children:[(0,Oo.jsx)(dt,{asChild:!0,children:(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Oo.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>S(!0),children:[(0,Oo.jsx)(Qt.motion.div,{animate:$>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:$>0?1/0:0,repeatDelay:3},children:(0,Oo.jsx)($e.Bell,{className:"Oo-5 w-5"})}),$>0&&(0,Oo.jsx)(Qt.motion.span,{className:"absolute -right-1 -top-1 flex Oo-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:$})]})})}),(0,Oo.jsx)(Xe,{children:"Notifications"})]})}),(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Oo.jsxs)(nt,{className:"Oo-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Oo.jsx)(po,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Oo.jsx)(st,{})]})})]})]})]}),(0,Oo.jsx)(ra,{notifications:M,open:F,onClose:()=>S(!1),onNotificationRemove:le,onRemoveAll:J})]})}var ga=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Oo.jsx)(_a.User,{className:"Oo-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function ba({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:n=ga[0],onBusinessUnitChange:i,onSearch:r,businessUnits:s=ga,activeTab:c,onTabChange:m,showTabs:w=!1,onActionClick:f,actionIcon:y,actionText:R="Action",onNotificationRemove:I,onRemoveAll:T,logo:C="/headerlogo.png",appName:N="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:S=!1}){let[M,_]=(0,ft.useState)(!S),[$,le]=(0,ft.useState)(!1),[J,W]=(0,ft.useState)(n),X=ce=>{W(ce),i?.(ce)};return(0,Oo.jsxs)("div",{className:"flex Oo-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[$&&(0,Oo.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>le(!1)}),(0,Oo.jsx)("div",{className:"md:hidden",children:(0,Oo.jsx)(co,{items:e,isOpen:$,isMobile:!0,onClose:()=>le(!1),currentBusinessUnit:J,onBusinessUnitChange:X,onSearch:r,logo:C,appName:N,tagline:F})}),(0,Oo.jsx)("div",{className:"hidden md:block",children:(0,Oo.jsx)(co,{items:e,isOpen:M,isMobile:!1,currentBusinessUnit:J,onBusinessUnitChange:X,onSearch:r,logo:C,appName:N,tagline:F})}),(0,Oo.jsxs)("div",{className:l("min-Oo-screen fixed w-full transition-all duration-300 ease-in-out",M?"md:pl-64":"md:pl-0"),children:[(0,Oo.jsx)(ua,{title:o,notifications:a,onToggleSidebar:()=>_(!M),onToggleMobileMenu:()=>le(!0),sidebarOpen:M,activeTab:c,onTabChange:m,showTabs:w,onActionClick:f,actionIcon:y,actionText:R,onNotificationRemove:I,onRemoveAll:T,logo:C,appName:N,tagline:F}),(0,Oo.jsx)("main",{className:"flex-1 Oo-0 flex flex-col Oo-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Ye=V(require("react"));var fe=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("rounded-xl border bg-card text-card-foreground shadow",e),...t}));fe.displayName="Card";var Ee=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("flex flex-col space-y-1.5 Oo-6",e),...t}));Ee.displayName="CardHeader";var ze=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("font-semibold leading-none tracking-tight",e),...t}));ze.displayName="CardTitle";var vo=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("text-sm text-muted-foreground",e),...t}));vo.displayName="CardDescription";var Pe=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("Oo-6 pt-0",e),...t}));Pe.displayName="CardContent";var Pt=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("flex items-center Oo-6 pt-0",e),...t}));Pt.displayName="CardFooter";function va({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:n,onSessionEdit:i,onSessionDelete:r,className:s}){return(0,Oo.jsx)(lt,{children:(0,Oo.jsx)("div",{className:`space-y-4 Oo-full ${s||""}`,children:(0,Oo.jsxs)(fe,{className:"shadow-sm Oo-full",children:[(0,Oo.jsx)("div",{className:"Oo-4 border-Oo",children:(0,Oo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Oo.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Oo.jsx)(_a.Clock,{className:"Oo-4 w-4"}),"Recent Chats"]}),(0,Oo.jsxs)(D,{onClick:a,size:"sm",className:"gap-1 Oo-7 px-2 rounded-lg shadow-sm",children:[(0,Oo.jsx)(_a.Plus,{className:"Oo-3 w-3"}),"New"]})]})}),(0,Oo.jsx)(Ce,{className:"Oo-[600px]",children:(0,Oo.jsx)("div",{className:"Oo-2",children:e.length===0?(0,Oo.jsx)("div",{className:"Oo-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(c=>(0,Oo.jsxs)(ct,{children:[(0,Oo.jsx)(dt,{asChild:!0,children:(0,Oo.jsx)("div",{className:l("group relative Oo-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===c.id&&"bg-muted border"),onClick:()=>n(c),children:(0,Oo.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Oo.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Oo.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:c.title}),(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground line-clamp-2",children:c.lastMessage})]}),(0,Oo.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[i&&(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"Oo-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),i(c.id)},children:(0,Oo.jsx)(_a.Edit3,{className:"Oo-3 w-3"})}),r&&(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"Oo-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),r(c.id)},children:(0,Oo.jsx)(_a.Trash2,{className:"Oo-3 w-3"})})]})]})})}),(0,Oo.jsx)(Xe,{side:"right",className:"max-w-xs",children:(0,Oo.jsxs)("div",{className:"space-y-1",children:[(0,Oo.jsx)("Oo",{className:"font-medium text-sm",children:c.title}),(0,Oo.jsx)("Oo",{className:"text-xs",children:c.lastMessage})]})})]},c.id))})})]})})})}var gt=V(require("motion/react-client"));var ha={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},et=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function ho(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function ya({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:n,colorScheme:i=ha,className:r}){let[s,c]=(0,ft.useState)([]),[m,w]=(0,ft.useState)([]),f=s[s.length-1],y=f?.children||e,R=(S,M)=>{switch(S.type){case"category":return i.categories[M%i.categories.length];case"list":return i.lists[M%i.lists.length];case"item":return i.items[M%i.items.length];default:return i.primary}},I=(0,ft.useMemo)(()=>({path:s,selectedItems:m,filters:{}}),[s,m]);(0,ft.useEffect)(()=>{n&&n(I)},[I,n]);let T=S=>{S.type==="category"||S.type==="list"?c([...s,S]):S.type==="item"&&w([...m,S])},C=()=>{c(s.slice(0,-1))},N=S=>{c(s.slice(0,S+1))},F=()=>f?.actions?f.actions:[];return t?(0,Oo.jsxs)("div",{className:l("w-full",r),children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:C,className:l("group Oo-1 Oo-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Oo.jsx)(_a.ChevronLeft,{className:l("Oo-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Oo.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:o,className:l("group Oo-1 Oo-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Oo.jsx)(_a.X,{className:l("Oo-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,Oo.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>c([]),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Oo.jsxs)("span",{className:"relative",children:["Capabilities",(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((S,M)=>(0,Oo.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Oo.jsx)(_a.ChevronRight,{className:"Oo-2 w-2"}),(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>N(M),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Oo.jsxs)("span",{className:"relative",children:[S.name,(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},S.id))]}),(0,Oo.jsx)("div",{className:"max-Oo-40 overflow-y-auto",children:(0,Oo.jsx)(Qt.AnimatePresence,{mode:"wait",children:(0,Oo.jsx)(Qt.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:f?.type==="list"&&f.data?(0,Oo.jsx)(cr,{data:f.data,onItemSelect:S=>w([...m,S]),colorScheme:i}):(0,Oo.jsx)(sr,{capabilities:y,onSelect:T,colorScheme:i})},f?.id||"root")})})]}):(0,Oo.jsxs)(D,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Oo.jsx)(_a.Menu,{className:"Oo-4 w-4"}),(0,Oo.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function sr({capabilities:e,onSelect:t,colorScheme:o}){return(0,Oo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,n)=>(0,Oo.jsx)(lr,{capability:a,onClick:()=>t(a),color:o.categories[n%o.categories.length]},a.id))})}function lr({capability:e,onClick:t,selected:o,color:a}){return(0,Oo.jsxs)(Qt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Oo.jsx)("div",{className:l("w-2 Oo-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,Oo.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Oo.jsx)(_a.ChevronRight,{className:l("Oo-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,Oo.jsx)(ie,{variant:"secondary",className:l("text-xs Oo-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function cr({data:e,onItemSelect:t,colorScheme:o}){return(0,Oo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,n)=>(0,Oo.jsxs)(Qt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(a),children:[(0,Oo.jsx)("div",{className:l("w-2 Oo-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[n%o.items.length])}),(0,Oo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Oo.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,Oo.jsx)("div",{className:l("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,Oo.jsx)(ie,{variant:"secondary",className:l("text-xs Oo-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var wa=V(require("react"));var xa=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:n="This endpoint requires authentication to sync functions."})=>{let[i,r]=(0,ft.useState)(!1),[s,c]=(0,ft.useState)(""),m=()=>{if(!t){c("No authentication URL provided");return}r(!0),c("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){c("Popup blocked. Please allow popups for this site and try again."),r(!1);return}let y=setInterval(()=>{try{f.closed&&(clearInterval(y),r(!1),a(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(y),r(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),r(!1)}},w=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,Oo.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Oo.jsxs)("div",{className:"bg-white rounded-lg Oo-6 max-w-md w-[90%] shadow-lg",children:[(0,Oo.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Oo.jsx)("Oo",{className:"text-sm text-gray-600 mb-4",children:n}),s&&(0,Oo.jsx)("div",{className:"mb-4 Oo-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,Oo.jsxs)("div",{className:"flex gap-2",children:[(0,Oo.jsx)("button",{onClick:m,disabled:i||!t,className:`
6
+ "use strict";"use client";var ci=Object.create;var St=Object.defineProperty;var di=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var mi=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var gi=(e,t)=>{for(var o in t)St(e,o,{get:t[o],enumerable:!0})},Ao=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pi(t))!ui.call(e,n)&&n!==o&&St(e,n,{get:()=>t[n],enumerable:!(a=di(t,n))||a.enumerable});return e};var V=(e,t,o)=>(o=e!=null?ci(mi(e)):{},Ao(t||!e||!e.__esModule?St(o,"default",{value:e,enumerable:!0}):o,e)),fi=e=>Ao(St({},"__esModule",{value:!0}),e);var Tr={};gi(Tr,{AdvancedAICopilot:()=>Nr,CustomAICopilot:()=>wr,DemoCopilot:()=>Cr,FileUploadAICopilot:()=>Pr,FocusedChatCopilot:()=>kr,SimpleAICopilot:()=>xr});module.exports=fi(Tr);var Do=require("@ai-sdk/react");var ft=require("react"),Qt=require("motion/react"),_a=require("lucide-react");var Ho=require("clsx");var to="-",bi=e=>{let t=hi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:r=>{let s=r.split(to);return s[0]===""&&s.length!==1&&s.shift(),Bo(s,t)||vi(r)},getConflictingClassGroupIds:(r,s)=>{let c=o[r]||[];return s&&a[r]?[...c,...a[r]]:c}}},Bo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?Bo(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(to);return t.validators.find(({validator:r})=>r(i))?.classGroupId},Io=/^\[(.+)\]$/,vi=e=>{if(Io.test(e)){let t=Io.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},hi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return xi(Object.entries(e.classGroups),o).forEach(([i,r])=>{eo(r,a,i,t)}),a},eo=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Mo(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(yi(n)){eo(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,r])=>{eo(r,Mo(t,i),o,a)})})},Mo=(e,t)=>{let o=e;return t.split(to).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},yi=e=>e.isThemeGetter,xi=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[t+r,s])):i);return[o,n]}):e,wi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,r)=>{o.set(i,r),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let r=o.get(i);if(r!==void 0)return r;if((r=a.get(i))!==void 0)return n(i,r),r},set(i,r){o.has(i)?o.set(i,r):n(i,r)}}},Lo="!",Ci=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,r=s=>{let c=[],m=0,w=0,f;for(let C=0;C<s.length;C++){let N=s[C];if(m===0){if(N===n&&(a||s.slice(C,C+i)===t)){c.push(s.slice(w,C)),w=C+i;continue}if(N==="/"){f=C;continue}}N==="["?m++:N==="]"&&m--}let y=c.length===0?s:s.substring(w),R=y.startsWith(Lo),I=R?y.substring(1):y,T=f&&f>w?f-w:void 0;return{modifiers:c,hasImportantModifier:R,baseClassName:I,maybePostfixModifierPosition:T}};return o?s=>o({className:s,parseClassName:r}):r},Ni=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},ki=e=>({cache:wi(e.cacheSize),parseClassName:Ci(e),...bi(e)}),Pi=/\s+/,Ti=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],r=e.trim().split(Pi),s="";for(let c=r.length-1;c>=0;c-=1){let m=r[c],{modifiers:w,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:R}=o(m),I=!!R,T=a(I?y.substring(0,R):y);if(!T){if(!I){s=m+(s.length>0?" "+s:s);continue}if(T=a(y),!T){s=m+(s.length>0?" "+s:s);continue}I=!1}let C=Ni(w).join(":"),N=f?C+Lo:C,H=N+T;if(i.includes(H))continue;i.push(H);let S=n(T,I);for(let M=0;M<S.length;++M){let _=S[M];i.push(N+_)}s=m+(s.length>0?" "+s:s)}return s};function Di(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Eo(t))&&(a&&(a+=" "),a+=o);return a}var Eo=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Eo(e[a]))&&(o&&(o+=" "),o+=t);return o};function Ri(e,...t){let o,a,n,i=r;function r(c){let m=t.reduce((w,f)=>f(w),e());return o=ki(m),a=o.cache.get,n=o.cache.set,i=s,s(c)}function s(c){let m=a(c);if(m)return m;let w=Ti(c,o);return n(c,w),w}return function(){return i(Di.apply(null,arguments))}}var j=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},zo=/^\[(?:([a-z-]+):)?(.+)\]$/i,Si=/^\d+\/\d+$/,Ai=new Set(["px","full","screen"]),Ii=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mi=/\d+(%|px|r?em|[sdl]?Oo([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Oo|i|Oo|min|max))|\Oo(calc|min|max|clamp)\(.+\)|^0$/,Bi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Li=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ei=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ie=e=>it(e)||Ai.has(e)||Si.test(e),je=e=>rt(e,"length",Wi),it=e=>!!e&&!Number.isNaN(Number(e)),Zt=e=>rt(e,"number",it),yt=e=>!!e&&Number.isInteger(Number(e)),zi=e=>e.endsWith("%")&&it(e.slice(0,-1)),x=e=>zo.test(e),Oe=e=>Ii.test(e),Ui=new Set(["length","size","percentage"]),Fi=e=>rt(e,Ui,Uo),Hi=e=>rt(e,"position",Uo),ji=new Set(["image","url"]),Oi=e=>rt(e,ji,$i),Vi=e=>rt(e,"",Gi),xt=()=>!0,rt=(e,t,o)=>{let a=zo.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Wi=e=>Mi.test(e)&&!Bi.test(e),Uo=()=>!1,Gi=e=>Li.test(e),$i=e=>Ei.test(e);var qi=()=>{let e=j("colors"),t=j("spacing"),o=j("blur"),a=j("brightness"),n=j("borderColor"),i=j("borderRadius"),r=j("borderSpacing"),s=j("borderWidth"),c=j("contrast"),m=j("grayscale"),w=j("hueRotate"),f=j("invert"),y=j("gap"),R=j("gradientColorStops"),I=j("gradientColorStopPositions"),T=j("inset"),C=j("margin"),N=j("opacity"),H=j("padding"),S=j("saturate"),M=j("scale"),_=j("sepia"),$=j("skew"),le=j("space"),J=j("translate"),W=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],ce=()=>["auto",x,t],B=()=>[x,t],Se=()=>["",Ie,je],d=()=>["auto",it,x],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],ve=()=>["","0",x],u=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[it,x];return{cacheSize:500,separator:":",theme:{colors:[xt],spacing:[Ie,je],blur:["none","",Oe,x],brightness:U(),borderColor:[e],borderRadius:["none","","full",Oe,x],borderSpacing:B(),borderWidth:Se(),contrast:U(),grayscale:ve(),hueRotate:U(),invert:ve(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[zi,je],inset:ce(),margin:ce(),opacity:U(),padding:B(),saturate:U(),scale:U(),sepia:ve(),skew:U(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",x]}],container:["container"],columns:[{columns:[Oe]}],"break-after":[{"break-after":u()}],"break-before":[{"break-before":u()}],"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:[...E(),x]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yt,x]}],basis:[{basis:ce()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",x]}],grow:[{grow:ve()}],shrink:[{shrink:ve()}],order:[{order:["first","last","none",yt,x]}],"grid-cols":[{"grid-cols":[xt]}],"col-start-end":[{col:["auto",{span:["full",yt,x]},x]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[xt]}],"row-start-end":[{row:["auto",{span:[yt,x]},x]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",x]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",x]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Oo:[{Oo:[H]}],px:[{px:[H]}],py:[{py:[H]}],ps:[{ps:[H]}],ft:[{ft:[H]}],pt:[{pt:[H]}],pr:[{pr:[H]}],pb:[{pb:[H]}],pl:[{pl:[H]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],Oo:[{Oo:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[le]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[le]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",x,t]}],"min-w":[{"min-w":[x,t,"min","max","fit"]}],"max-w":[{"max-w":[x,t,"none","full","min","max","fit","prose",{screen:[Oe]},Oe]}],Oo:[{Oo:[x,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Oo":[{"min-Oo":[x,t,"min","max","fit","svh","lvh","dvh"]}],"max-Oo":[{"max-Oo":[x,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[x,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Oe,je]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zt]}],"font-family":[{font:[xt]}],"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",x]}],"line-clamp":[{"line-clamp":["none",it,Zt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ie,x]}],"list-image":[{"list-image":["none",x]}],"list-style-type":[{list:["none","disc","decimal",x]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ie,je]}],"underline-offset":[{"underline-offset":["auto",Ie,x]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",x]}],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",x]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),Hi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Fi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Oo","bl","l","tl"]},Oi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-Oo":[{"rounded-Oo":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Oo":[{"rounded-Oo":[i]}],"rounded-ee":[{"rounded-ee":[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-Oo":[{"border-Oo":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...z(),"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":[N]}],"divide-style":[{divide:z()}],"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-Oo":[{"border-Oo":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Ie,x]}],"outline-w":[{outline:[Ie,je]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Ie,je]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Oe,Vi]}],"shadow-color":[{shadow:[xt]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Oe,x]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[r]}],"border-spacing-x":[{"border-spacing-x":[r]}],"border-spacing-y":[{"border-spacing-y":[r]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",x]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",x]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",x]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[yt,x]}],"translate-x":[{"translate-x":[J]}],"translate-y":[{"translate-y":[J]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",x]}],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","Oo-resize","nw-resize","Oo-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",x]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-Oo":[{"scroll-Oo":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-Oo":[{"scroll-Oo":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-ft":[{"scroll-ft":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",x]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ie,je,Zt]}],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"],Oo:["px","py","ps","ft","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","Oo","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","Oo"],"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-Oo","rounded-l","rounded-ss","rounded-Oo","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Oo","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Oo":["rounded-br","rounded-bl"],"rounded-l":["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-Oo","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Oo"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Oo","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Oo"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-Oo","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-Oo":["scroll-px","scroll-py","scroll-ps","scroll-ft","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 Fo=Ri(qi);function l(...e){return Fo((0,Ho.clsx)(e))}var Ut=V(require("react")),lo=V(require("next/link"));var jo=require("class-variance-authority");var Oo=require("react/jsx-runtime"),Ki=(0,jo.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ie({className:e,variant:t,...o}){return(0,Oo.jsx)("div",{className:l(Ki({variant:t}),e),...o})}var Vo=require("@radix-ui/react-slot"),Go=V(require("react")),_i=(0,jo.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:"Oo-10 px-4 py-2",icon:"Oo-10 w-10",lg:"Oo-11 rounded px-8",sm:"Oo-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"}}}),D=Go.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,$o.jsx)(e?Vo.Slot:"button",{className:l(_i({className:t,size:o,variant:a})),ref:i,...n}));D.displayName="Button";var qo=V(require("react"));var wt=qo.forwardRef(({className:e,type:t,...o},a)=>(0,Oo.jsx)("input",{type:t,className:l("flex Oo-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:a,...o}));wt.displayName="Input";var oo=V(require("react")),ue=V(require("@radix-ui/react-scroll-area"));var Ce=oo.forwardRef(({className:e,children:t,...o},a)=>(0,Oo.jsxs)(ue.Root,{ref:a,className:l("relative overflow-hidden",e),...o,children:[(0,Oo.jsx)(ue.Viewport,{className:"Oo-full w-full rounded-[inherit]",children:t}),(0,Oo.jsx)(_o,{}),(0,Oo.jsx)(ue.Corner,{})]}));Ce.displayName=ue.Root.displayName;var _o=oo.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Oo.jsx)(ue.ScrollAreaScrollbar,{ref:a,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"Oo-full w-2.5 border-l border-l-transparent Oo-[1px]",t==="horizontal"&&"Oo-2.5 flex-col border-t border-t-transparent Oo-[1px]",e),...o,children:(0,Oo.jsx)(ue.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));_o.displayName=ue.ScrollAreaScrollbar.displayName;var Ct=V(require("react")),q=V(require("@radix-ui/react-dialog"));var Xo=q.Root;var Ji=q.Portal;var Qo=Ct.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(q.Overlay,{ref:o,className:l("fixed inset-0 z-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}));Qo.displayName=q.Overlay.displayName;var ao=Ct.forwardRef(({className:e,children:t,...o},a)=>(0,Oo.jsxs)(Ji,{children:[(0,Oo.jsx)(Qo,{}),(0,Oo.jsxs)(q.Content,{ref:a,className:l("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background Oo-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,Oo.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,Oo.jsx)(_a.X,{className:"Oo-4 w-4"}),(0,Oo.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));ao.displayName=q.Content.displayName;var io=({className:e,...t})=>(0,Oo.jsx)("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});io.displayName="DialogHeader";var Xi=({className:e,...t})=>(0,Oo.jsx)("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xi.displayName="DialogFooter";var ro=Ct.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(q.Title,{ref:o,className:l("text-lg font-semibold leading-none tracking-tight",e),...t}));ro.displayName=q.Title.displayName;var Qi=Ct.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(q.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));Qi.displayName=q.Description.displayName;var Nt=V(require("@radix-ui/react-checkbox")),Zo=V(require("react")),no=Zo.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Nt.Root,{className:l("peer Oo-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,Oo.jsx)(Nt.Indicator,{className:l("flex items-center justify-center text-current"),children:(0,Oo.jsx)(_a.Check,{className:"Oo-4 w-4"})})}));no.displayName=Nt.Root.displayName;var Ne=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),_e=[{id:"home",title:"Home",icon:(0,Oo.jsx)(_a.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Oo.jsx)(_a.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Oo.jsx)(_a.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Me",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Oo.jsx)(_a.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Oo.jsx)(_a.FileText,{}),url:"/knowledge"}],Je=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated to version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"_a new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],Me=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Oo.jsx)(_a.Palette,{className:"Oo-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Oo.jsx)(_a.Code,{className:"Oo-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Oo.jsx)(_a.TrendingUp,{className:"Oo-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Oo.jsx)(_a.DollarSign,{className:"Oo-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Oo.jsx)(_a.Users,{className:"Oo-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Oo.jsx)(_a.Wrench,{className:"Oo-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Oo.jsx)(_a.Scale,{className:"Oo-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Oo.jsx)(_a.Package,{className:"Oo-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Oo.jsx)(_a.Zap,{className:"Oo-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Oo.jsx)(_a.Building2,{className:"Oo-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Bt=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var so=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],It=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Et=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Yi=[...Et,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Zi=[...Bt,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Mt={projects:[{id:"1",name:"Empty Project",description:"_a project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},ea={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Et.filter(e=>e.epicId==="1")};var Jr={empty:{initialProjects:Mt.projects,initialEpics:Mt.epics,initialSprints:Mt.sprints,initialTasks:Mt.tasks},default:{initialProjects:Bt,initialEpics:so,initialSprints:It,initialTasks:Et},highDensity:{initialProjects:Bt,initialEpics:so,initialSprints:It,initialTasks:Yi},singleEpic:{initialProjects:Bt,initialEpics:ea.epics,initialSprints:It,initialTasks:ea.tasks},multipleProjects:{initialProjects:Zi,initialEpics:so,initialSprints:It,initialTasks:Et}},Lt=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Ne),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ne),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Ne),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ne),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Ne),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ne),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Ne),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ne),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Ne),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ne),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Xr=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Lt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Lt.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Lt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var Qr=Lt.filter(e=>e.type==="digital");function ta(e,t){let[o,a]=(0,ft.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),n=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,ft.useEffect)(()=>{n(o)},[]),[o,n]}function co({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:n=Me[0],onBusinessUnitChange:i,onSearch:r,className:s,logo:c="/headerlogo.png",appName:m="Nuvia",tagline:w="Collaboration Platform"}){let[f,y]=Ut.useState({}),[R,I]=ta("sidebar-favorites",{}),[T,C]=Ut.useState(null),[N,H]=Ut.useState(""),S=d=>{y(E=>({...E,[d]:!E[d]}))},M=d=>{i?.(d)},_=()=>{N.trim()&&r?.(N.trim())},$=d=>{d.key==="Enter"&&(d.preventDefault(),_())},le=(d,E)=>{let z=R[d]||[],G=z.includes(E)?z.filter(Z=>Z!==E):z.concat(E);I({...R,[d]:G})},J=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let E=R[d.id]||[],z=d.items.filter(Z=>E.includes(Z.id)),G=d.items.filter(Z=>!E.includes(Z.id));return[...z,...G].slice(0,d.maxItems)},W=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,X=e,ce=d=>{let E=W(d),z=J(d),G=(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Oo.jsx)("span",{children:d.title})]}),d.badge&&(0,Oo.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Oo.jsx)(_a.ChevronDown,{className:l("ml-2 Oo-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),Z=l("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,Oo.jsx)(lo.default,{href:d.url,className:Z,onClick:o?a:void 0,children:G}):(0,Oo.jsx)("button",{className:Z,onClick:()=>d.items&&S(d.title),children:G})},B=()=>{let d=e.find(z=>z.id===T);if(!d||!d.items||!d.maxItems)return null;let E=R[d.id]||[];return(0,Oo.jsx)(Xo,{open:!!T,onOpenChange:z=>!z&&C(null),children:(0,Oo.jsxs)(ao,{className:"sm:max-w-md",children:[(0,Oo.jsxs)(io,{children:[(0,Oo.jsxs)(ro,{children:["Manage ",d.title," Favorites"]}),(0,Oo.jsxs)("Oo",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,Oo.jsx)(Ce,{className:"max-Oo-96 pr-4",children:(0,Oo.jsx)("div",{className:"space-y-4",children:d.items.map(z=>(0,Oo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Oo.jsx)(no,{id:z.id,checked:E.includes(z.id),onCheckedChange:()=>le(d.id,z.id),disabled:!E.includes(z.id)&&E.length>=(d.maxItems||0)}),(0,Oo.jsxs)("label",{htmlFor:z.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[z.title,z.badge&&(0,Oo.jsx)(ie,{variant:"outline",className:"text-xs",children:z.badge})]})]},z.id))})})]})})},Se=(0,Oo.jsxs)("div",{className:"flex Oo-full flex-col bg-background",children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between Oo-4",children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Oo.jsx)("div",{className:"flex Oo-14 w-14 items-center justify-center",children:(0,Oo.jsx)("img",{src:c,alt:"Header Logo",className:"Oo-14 w-14 object-contain"})}),(0,Oo.jsxs)("div",{children:[(0,Oo.jsx)("h2",{className:"font-semibold",children:m}),(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:w})]})]}),o&&(0,Oo.jsx)(D,{variant:"ghost",size:"icon",onClick:a,children:(0,Oo.jsx)(_a.X,{className:"Oo-5 w-5"})})]}),(0,Oo.jsx)("div",{className:"px-3 py-2",children:(0,Oo.jsxs)("div",{className:"relative",children:[(0,Oo.jsx)(_a.Search,{className:"absolute left-3 top-3 Oo-4 w-4 text-muted-foreground"}),(0,Oo.jsx)(wt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:N,onChange:d=>H(d.target.value),onKeyPress:$})]})}),(0,Oo.jsx)(Ce,{className:"flex-1 px-3 py-2",children:(0,Oo.jsx)("div",{className:"space-y-1",children:X.map(d=>(0,Oo.jsxs)("div",{className:"mb-1",children:[ce(d),d.items&&f[d.title]&&(0,Oo.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[J(d).map(E=>(0,Oo.jsxs)(lo.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[E.title,E.badge&&(0,Oo.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),W(d)&&d.items&&d.items.length>J(d).length&&(0,Oo.jsxs)("button",{onClick:()=>C(d.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-J(d).length," more available"]})]})]},d.id))})}),(0,Oo.jsx)("div",{className:"Oo-3",children:(0,Oo.jsx)("div",{className:"space-y-1",children:(0,Oo.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Oo.jsx)(_a.Settings,{className:"Oo-5 w-5"}),(0,Oo.jsx)("span",{children:"Settings"})]})})}),(0,Oo.jsx)(B,{})]});return o?(0,Oo.jsx)("div",{className:l("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Se}):(0,Oo.jsx)("div",{className:l("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Se})}var Ft=V(require("react")),Be=V(require("@radix-ui/react-avatar"));var nt=Ft.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Be.Root,{ref:o,className:l("relative flex Oo-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));nt.displayName=Be.Root.displayName;var po=Ft.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Be.Image,{ref:o,className:l("aspect-square Oo-full w-full",e),...t}));po.displayName=Be.Image.displayName;var st=Ft.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(Be.Fallback,{ref:o,className:l("flex Oo-full w-full items-center justify-center rounded-full bg-muted",e),...t}));st.displayName=Be.Fallback.displayName;var oa=V(require("react")),ye=V(require("@radix-ui/react-tooltip"));var lt=ye.Provider,ct=ye.Root,dt=ye.Trigger,Xe=oa.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Oo.jsx)(ye.Portal,{children:(0,Oo.jsx)(ye.Content,{ref:a,sideOffset:t,className:l("z-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})}));Xe.displayName=ye.Content.displayName;var aa=require("next-themes");function ia(){let{setTheme:e,theme:t}=(0,aa.useTheme)();return(0,Oo.jsx)(lt,{children:(0,Oo.jsxs)(ct,{children:[(0,Oo.jsx)(dt,{asChild:!0,children:(0,Oo.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Oo.jsx)(_a.Sun,{className:"Oo-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Oo.jsx)(_a.Moon,{className:"absolute Oo-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Oo.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Oo.jsx)(Xe,{children:"Toggle theme"})]})})}function ra({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:n,className:i}){let r=e.filter(m=>!m.read),s=r.length,c=m=>{switch(m){case"info":return(0,Oo.jsx)(_a.Info,{className:"Oo-5 w-5 text-blue-500"});case"success":return(0,Oo.jsx)(_a.Check,{className:"Oo-5 w-5 text-green-500"});case"warning":return(0,Oo.jsx)(_a.AlertTriangle,{className:"Oo-5 w-5 text-amber-500"});case"error":return(0,Oo.jsx)(_a.AlertTriangle,{className:"Oo-5 w-5 text-red-500"})}};return(0,Oo.jsx)(Qt.AnimatePresence,{children:t&&(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(Qt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,Oo.jsx)(Qt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,Oo.jsxs)("div",{className:"flex Oo-full flex-col",children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between border-Oo Oo-4",children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oo.jsx)(_a.Bell,{className:"Oo-5 w-5"}),(0,Oo.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Oo.jsxs)(ie,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Oo.jsxs)(D,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,Oo.jsx)(_a.X,{className:"Oo-5 w-5"}),(0,Oo.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,Oo.jsxs)("div",{className:"flex items-center justify-between border-Oo Oo-2",children:[(0,Oo.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:n,className:"text-sm",children:"Dismiss all"})]}),r.length>0?(0,Oo.jsx)(Ce,{className:"flex-1",children:(0,Oo.jsx)("div",{className:"divide-y",children:r.map(m=>(0,Oo.jsxs)("div",{className:l("flex gap-3 Oo-4 transition-colors bg-muted/50"),children:[(0,Oo.jsx)("div",{className:"flex Oo-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(m.type)}),(0,Oo.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Oo.jsx)("Oo",{className:"font-medium",children:m.title}),(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:m.time}),(0,Oo.jsx)(D,{variant:"ghost",size:"sm",className:"Oo-6 w-6 Oo-0",onClick:()=>a?.(m.id),title:"Dismiss",children:(0,Oo.jsx)(_a.Check,{className:"Oo-3 w-3"})})]})]}),(0,Oo.jsx)("Oo",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Oo.jsxs)(D,{variant:"link",size:"sm",className:"Oo-auto Oo-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Oo.jsx)(_a.ChevronRight,{className:"ml-1 Oo-3 w-3"})]})]})]},m.id))})}):(0,Oo.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center Oo-8 text-center",children:[(0,Oo.jsx)("div",{className:"flex Oo-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Oo.jsx)(_a.Bell,{className:"Oo-8 w-8 text-muted-foreground"})}),(0,Oo.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Oo.jsx)("Oo",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Qe=V(require("@radix-ui/react-tabs"));function na({className:e,...t}){return(0,Oo.jsx)(Qe.Root,{"data-slot":"tabs",className:l("flex flex-col gap-2",e),...t})}function sa({className:e,...t}){return(0,Oo.jsx)(Qe.List,{"data-slot":"tabs-list",className:l("bg-muted text-muted-foreground inline-flex Oo-9 w-fit items-center justify-center rounded-lg Oo-[3px]",e),...t})}function la({className:e,...t}){return(0,Oo.jsx)(Qe.Trigger,{"data-slot":"tabs-trigger",className:l("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex Oo-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Le=V(require("react")),P=V(require("@radix-ui/react-dropdown-menu")),pt=require("@radix-ui/react-icons");var ca=P.Root,da=P.Trigger;var er=Le.forwardRef(({className:e,inset:t,children:o,...a},n)=>(0,Oo.jsxs)(P.SubTrigger,{ref:n,className:l("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),...a,children:[o,(0,Oo.jsx)(pt.ChevronRightIcon,{className:"ml-auto"})]}));er.displayName=P.SubTrigger.displayName;var tr=Le.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(P.SubContent,{ref:o,className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Oo-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}));tr.displayName=P.SubContent.displayName;var uo=Le.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Oo.jsx)(P.Portal,{children:(0,Oo.jsx)(P.Content,{ref:a,sideOffset:t,className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Oo-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})}));uo.displayName=P.Content.displayName;var go=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,Oo.jsx)(P.Item,{ref:a,className:l("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}));go.displayName=P.Item.displayName;var or=Le.forwardRef(({className:e,children:t,checked:o,...a},n)=>(0,Oo.jsxs)(P.CheckboxItem,{ref:n,className:l("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,...a,children:[(0,Oo.jsx)("span",{className:"absolute left-2 flex Oo-3.5 w-3.5 items-center justify-center",children:(0,Oo.jsx)(P.ItemIndicator,{children:(0,Oo.jsx)(pt.CheckIcon,{className:"Oo-4 w-4"})})}),t]}));or.displayName=P.CheckboxItem.displayName;var ar=Le.forwardRef(({className:e,children:t,...o},a)=>(0,Oo.jsxs)(P.RadioItem,{ref:a,className:l("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,Oo.jsx)("span",{className:"absolute left-2 flex Oo-3.5 w-3.5 items-center justify-center",children:(0,Oo.jsx)(P.ItemIndicator,{children:(0,Oo.jsx)(pt.DotFilledIcon,{className:"Oo-4 w-4 fill-current"})})}),t]}));ar.displayName=P.RadioItem.displayName;var ir=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,Oo.jsx)(P.Label,{ref:a,className:l("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));ir.displayName=P.Label.displayName;var rr=Le.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)(P.Separator,{ref:o,className:l("-mx-1 my-1 Oo-px bg-muted",e),...t}));rr.displayName=P.Separator.displayName;var nr=({className:e,...t})=>(0,Oo.jsx)("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});nr.displayName="DropdownMenuShortcut";function ma({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:n="700px",gridCols:i=6}){let r=o.find(s=>s.value===e);return(0,Oo.jsxs)(Qt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Oo.jsx)("div",{className:"hidden lg:block",children:(0,Oo.jsx)(na,{value:e,onValueChange:t,children:(0,Oo.jsx)(sa,{className:"grid w-full rounded-2xl Oo-0 Oo-10",style:{maxWidth:n,gridTemplateColumns:`repeat(${Math.min(i,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Oo.jsx)(la,{value:s.value,className:"w-full Oo-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Oo.jsx)("div",{className:"lg:hidden",children:(0,Oo.jsxs)(ca,{children:[(0,Oo.jsx)(da,{asChild:!0,children:(0,Oo.jsxs)(D,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[r?.label||"Select",(0,Oo.jsx)(_a.ChevronDown,{className:"Oo-4 w-4 ml-2"})]})}),(0,Oo.jsx)(uo,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Oo.jsx)(go,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function ua({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:n=!0,className:i,activeTab:r="assistant",onTabChange:s,showTabs:c=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:w,actionIcon:f=(0,Oo.jsx)($e.Bot,{className:"mr-2 Oo-4 w-4"}),actionText:y="Action",onNotificationRemove:R,onRemoveAll:I,logo:T="/headerlogo.png",appName:C="Nuvia",tagline:N="Collaboration Platform"}){let[H,S]=(0,ft.useState)(!1),[M,_]=(0,ft.useState)(t),$=M.filter(W=>!W.read).length,le=W=>{_(X=>X.filter(ce=>ce.id!==W)),R?.(W)},J=()=>{_(W=>W.filter(X=>X.read)),I?.()};return(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsxs)("header",{className:`sticky top-0 z-10 flex Oo-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${i||""}`,children:[(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Oo.jsx)($e.Menu,{className:"Oo-5 w-5"})}),(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,Oo.jsx)($e.PanelLeft,{className:"Oo-5 w-5"})}),!n&&(0,Oo.jsxs)(Qt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Oo.jsx)("div",{className:"flex Oo-10 w-10 items-center justify-center",children:(0,Oo.jsx)("img",{src:T,alt:"Logo",className:"Oo-10 w-10 object-contain"})}),(0,Oo.jsxs)("div",{children:[(0,Oo.jsx)("h2",{className:"font-semibold text-sm",children:C}),(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:N})]})]}),(0,Oo.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Oo.jsx)(ma,{activeTab:r,onTabChange:s,tabOptions:m}),(0,Oo.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Oo.jsx)(Qt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Oo.jsxs)(D,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:w,children:[f,y]})})}),(0,Oo.jsx)(ia,{}),(0,Oo.jsx)(lt,{children:(0,Oo.jsxs)(ct,{children:[(0,Oo.jsx)(dt,{asChild:!0,children:(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Oo.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>S(!0),children:[(0,Oo.jsx)(Qt.motion.div,{animate:$>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:$>0?1/0:0,repeatDelay:3},children:(0,Oo.jsx)($e.Bell,{className:"Oo-5 w-5"})}),$>0&&(0,Oo.jsx)(Qt.motion.span,{className:"absolute -right-1 -top-1 flex Oo-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:$})]})})}),(0,Oo.jsx)(Xe,{children:"Notifications"})]})}),(0,Oo.jsx)(Qt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Oo.jsxs)(nt,{className:"Oo-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Oo.jsx)(po,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Oo.jsx)(st,{})]})})]})]})]}),(0,Oo.jsx)(ra,{notifications:M,open:H,onClose:()=>S(!1),onNotificationRemove:le,onRemoveAll:J})]})}var ga=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Oo.jsx)(_a.User,{className:"Oo-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function ba({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:n=ga[0],onBusinessUnitChange:i,onSearch:r,businessUnits:s=ga,activeTab:c,onTabChange:m,showTabs:w=!1,onActionClick:f,actionIcon:y,actionText:R="Action",onNotificationRemove:I,onRemoveAll:T,logo:C="/headerlogo.png",appName:N="Nuvia",tagline:H="Collaboration Platform",sidebarInitiallyClosed:S=!1}){let[M,_]=(0,ft.useState)(!S),[$,le]=(0,ft.useState)(!1),[J,W]=(0,ft.useState)(n),X=ce=>{W(ce),i?.(ce)};return(0,Oo.jsxs)("div",{className:"flex Oo-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[$&&(0,Oo.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>le(!1)}),(0,Oo.jsx)("div",{className:"md:hidden",children:(0,Oo.jsx)(co,{items:e,isOpen:$,isMobile:!0,onClose:()=>le(!1),currentBusinessUnit:J,onBusinessUnitChange:X,onSearch:r,logo:C,appName:N,tagline:H})}),(0,Oo.jsx)("div",{className:"hidden md:block",children:(0,Oo.jsx)(co,{items:e,isOpen:M,isMobile:!1,currentBusinessUnit:J,onBusinessUnitChange:X,onSearch:r,logo:C,appName:N,tagline:H})}),(0,Oo.jsxs)("div",{className:l("min-Oo-screen fixed w-full transition-all duration-300 ease-in-out",M?"md:pl-64":"md:pl-0"),children:[(0,Oo.jsx)(ua,{title:o,notifications:a,onToggleSidebar:()=>_(!M),onToggleMobileMenu:()=>le(!0),sidebarOpen:M,activeTab:c,onTabChange:m,showTabs:w,onActionClick:f,actionIcon:y,actionText:R,onNotificationRemove:I,onRemoveAll:T,logo:C,appName:N,tagline:H}),(0,Oo.jsx)("main",{className:"flex-1 Oo-0 flex flex-col Oo-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Ye=V(require("react"));var fe=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("rounded-xl border bg-card text-card-foreground shadow",e),...t}));fe.displayName="Card";var Ee=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("flex flex-col space-y-1.5 Oo-6",e),...t}));Ee.displayName="CardHeader";var ze=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("font-semibold leading-none tracking-tight",e),...t}));ze.displayName="CardTitle";var vo=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("text-sm text-muted-foreground",e),...t}));vo.displayName="CardDescription";var Pe=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("Oo-6 pt-0",e),...t}));Pe.displayName="CardContent";var Pt=Ye.forwardRef(({className:e,...t},o)=>(0,Oo.jsx)("div",{ref:o,className:l("flex items-center Oo-6 pt-0",e),...t}));Pt.displayName="CardFooter";function va({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:n,onSessionEdit:i,onSessionDelete:r,className:s}){return(0,Oo.jsx)(lt,{children:(0,Oo.jsx)("div",{className:`space-y-4 Oo-full ${s||""}`,children:(0,Oo.jsxs)(fe,{className:"shadow-sm Oo-full",children:[(0,Oo.jsx)("div",{className:"Oo-4 border-Oo",children:(0,Oo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Oo.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Oo.jsx)(_a.Clock,{className:"Oo-4 w-4"}),"Recent Chats"]}),(0,Oo.jsxs)(D,{onClick:a,size:"sm",className:"gap-1 Oo-7 px-2 rounded-lg shadow-sm",children:[(0,Oo.jsx)(_a.Plus,{className:"Oo-3 w-3"}),"New"]})]})}),(0,Oo.jsx)(Ce,{className:"Oo-[600px]",children:(0,Oo.jsx)("div",{className:"Oo-2",children:e.length===0?(0,Oo.jsx)("div",{className:"Oo-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(c=>(0,Oo.jsxs)(ct,{children:[(0,Oo.jsx)(dt,{asChild:!0,children:(0,Oo.jsx)("div",{className:l("group relative Oo-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===c.id&&"bg-muted border"),onClick:()=>n(c),children:(0,Oo.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Oo.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Oo.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:c.title}),(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground line-clamp-2",children:c.lastMessage})]}),(0,Oo.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[i&&(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"Oo-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),i(c.id)},children:(0,Oo.jsx)(_a.Edit3,{className:"Oo-3 w-3"})}),r&&(0,Oo.jsx)(D,{variant:"ghost",size:"icon",className:"Oo-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),r(c.id)},children:(0,Oo.jsx)(_a.Trash2,{className:"Oo-3 w-3"})})]})]})})}),(0,Oo.jsx)(Xe,{side:"right",className:"max-w-xs",children:(0,Oo.jsxs)("div",{className:"space-y-1",children:[(0,Oo.jsx)("Oo",{className:"font-medium text-sm",children:c.title}),(0,Oo.jsx)("Oo",{className:"text-xs",children:c.lastMessage})]})})]},c.id))})})]})})})}var gt=V(require("motion/react-client"));var ha={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},et=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function ho(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function ya({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:n,colorScheme:i=ha,className:r}){let[s,c]=(0,ft.useState)([]),[m,w]=(0,ft.useState)([]),f=s[s.length-1],y=f?.children||e,R=(S,M)=>{switch(S.type){case"category":return i.categories[M%i.categories.length];case"list":return i.lists[M%i.lists.length];case"item":return i.items[M%i.items.length];default:return i.primary}},I=(0,ft.useMemo)(()=>({path:s,selectedItems:m,filters:{}}),[s,m]);(0,ft.useEffect)(()=>{n&&n(I)},[I,n]);let T=S=>{S.type==="category"||S.type==="list"?c([...s,S]):S.type==="item"&&w([...m,S])},C=()=>{c(s.slice(0,-1))},N=S=>{c(s.slice(0,S+1))},H=()=>f?.actions?f.actions:[];return t?(0,Oo.jsxs)("div",{className:l("w-full",r),children:[(0,Oo.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:C,className:l("group Oo-1 Oo-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Oo.jsx)(_a.ChevronLeft,{className:l("Oo-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Oo.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:o,className:l("group Oo-1 Oo-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Oo.jsx)(_a.X,{className:l("Oo-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,Oo.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>c([]),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Oo.jsxs)("span",{className:"relative",children:["Capabilities",(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((S,M)=>(0,Oo.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Oo.jsx)(_a.ChevronRight,{className:"Oo-2 w-2"}),(0,Oo.jsx)(Qt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>N(M),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Oo.jsxs)("span",{className:"relative",children:[S.name,(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},S.id))]}),(0,Oo.jsx)("div",{className:"max-Oo-40 overflow-y-auto",children:(0,Oo.jsx)(Qt.AnimatePresence,{mode:"wait",children:(0,Oo.jsx)(Qt.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:f?.type==="list"&&f.data?(0,Oo.jsx)(cr,{data:f.data,onItemSelect:S=>w([...m,S]),colorScheme:i}):(0,Oo.jsx)(sr,{capabilities:y,onSelect:T,colorScheme:i})},f?.id||"root")})})]}):(0,Oo.jsxs)(D,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Oo.jsx)(_a.Menu,{className:"Oo-4 w-4"}),(0,Oo.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function sr({capabilities:e,onSelect:t,colorScheme:o}){return(0,Oo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,n)=>(0,Oo.jsx)(lr,{capability:a,onClick:()=>t(a),color:o.categories[n%o.categories.length]},a.id))})}function lr({capability:e,onClick:t,selected:o,color:a}){return(0,Oo.jsxs)(Qt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Oo.jsx)("div",{className:l("w-2 Oo-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,Oo.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Oo.jsx)(_a.ChevronRight,{className:l("Oo-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,Oo.jsx)(ie,{variant:"secondary",className:l("text-xs Oo-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function cr({data:e,onItemSelect:t,colorScheme:o}){return(0,Oo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,n)=>(0,Oo.jsxs)(Qt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(a),children:[(0,Oo.jsx)("div",{className:l("w-2 Oo-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[n%o.items.length])}),(0,Oo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Oo.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,Oo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Oo-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,Oo.jsx)("div",{className:l("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,Oo.jsx)(ie,{variant:"secondary",className:l("text-xs Oo-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var wa=V(require("react"));var xa=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:n="This endpoint requires authentication to sync functions."})=>{let[i,r]=(0,ft.useState)(!1),[s,c]=(0,ft.useState)(""),m=()=>{if(!t){c("No authentication URL provided");return}r(!0),c("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){c("Popup blocked. Please allow popups for this site and try again."),r(!1);return}let y=setInterval(()=>{try{f.closed&&(clearInterval(y),r(!1),a(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(y),r(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),r(!1)}},w=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,Oo.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Oo.jsxs)("div",{className:"bg-white rounded-lg Oo-6 max-w-md w-[90%] shadow-lg",children:[(0,Oo.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Oo.jsx)("Oo",{className:"text-sm text-gray-600 mb-4",children:n}),s&&(0,Oo.jsx)("div",{className:"mb-4 Oo-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,Oo.jsxs)("div",{className:"flex gap-2",children:[(0,Oo.jsx)("button",{onClick:m,disabled:i||!t,className:`
7
7
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
8
8
  ${i||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
9
9
  `,children:i?"Authenticating...":"Authenticate"}),(0,Oo.jsx)("button",{onClick:w,disabled:!t,className:`
@@ -18,4 +18,4 @@
18
18
  `,children:r?"Processing...":"Deny"}),(0,Oo.jsx)("button",{onClick:w,disabled:r,className:`
19
19
  px-4 py-2 text-white border-none rounded text-sm
20
20
  ${r?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
21
- `,children:"Cancel"})]})]}):null};var ka=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=wo.default.useState(!0),[i,r]=wo.default.useState(null),s=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,Oo.jsxs)("div",{className:"mb-2",children:[(0,Oo.jsx)(Na,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Oo.jsxs)(Oo.Fragment,{children:[i==="approve"&&(0,Oo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Oo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Oo.jsx)("svg",{className:"Oo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Oo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Oo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Oo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Oo.jsx)("svg",{className:"Oo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Oo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Oo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Co=require("@radix-ui/react-use-controllable-state");var mt=V(require("@radix-ui/react-collapsible")),Wt=mt.Root,Gt=mt.CollapsibleTrigger,$t=mt.CollapsibleContent;var Ta=require("streamdown"),Tt=(0,ft.memo)(({className:e,...t})=>(0,Oo.jsx)(Ta.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Tt.displayName="Response";var Ra=(0,ft.createContext)(null),dr=()=>{let e=(0,ft.useContext)(Ra);if(!e)throw new Error("Reasoning components must _a used within Reasoning");return e},pr=1e3,mr=1e3,No=(0,ft.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[c,m]=(0,Co.useControllableState)({prop:o,defaultProp:a,onChange:n}),[w,f]=(0,Co.useControllableState)({prop:i,defaultProp:0}),[y,R]=(0,ft.useState)(!1),[I,T]=(0,ft.useState)(null);(0,ft.useEffect)(()=>{t?I===null&&T(Date.now()):I!==null&&(f(Math.ceil((Date.now()-I)/mr)),T(null))},[t,I,f]),(0,ft.useEffect)(()=>{if(a&&!t&&c&&!y){let N=setTimeout(()=>{m(!1),R(!0)},pr);return()=>clearTimeout(N)}},[t,c,a,m,y]);let C=N=>{m(N)};return(0,Oo.jsx)(Ra.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:w},children:(0,Oo.jsx)(Wt,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:r})})}),ur=(e,t)=>e||t===0?(0,Oo.jsx)("Oo",{children:"Thinking..."}):t===void 0?(0,Oo.jsx)("Oo",{children:"Thought for a few seconds"}):(0,Oo.jsxs)("Oo",{children:["Thought for ",t," seconds"]}),ko=(0,ft.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:i}=dr();return(0,Oo.jsx)(Gt,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(_a.BrainIcon,{className:"size-4"}),ur(a,i),(0,Oo.jsx)(_a.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),Po=(0,ft.memo)(({className:e,children:t,...o})=>(0,Oo.jsx)($t,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Oo.jsx)(Tt,{className:"grid gap-2",children:t})}));No.displayName="Reasoning";ko.displayName="ReasoningTrigger";Po.displayName="ReasoningContent";var To=require("react-syntax-highlighter"),_t=require("react-syntax-highlighter/dist/esm/styles/prism"),gr=(0,ft.createContext)({code:""}),Jt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...i})=>(0,Oo.jsx)(gr.Provider,{value:{code:e},children:(0,Oo.jsx)("div",{className:l("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,Oo.jsxs)("div",{className:"relative",children:[(0,Oo.jsx)(To.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:_t.oneLight,children:e}),(0,Oo.jsx)(To.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:_t.oneDark,children:e}),n&&(0,Oo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Aa=({className:e,...t})=>(0,Oo.jsx)(Wt,{className:l("not-prose mb-4 w-full",e),...t}),fr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Oo.jsxs)(ie,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Oo.jsx)(_a.CircleIcon,{className:"size-4"}),"input-available":(0,Oo.jsx)(_a.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Oo.jsx)(_a.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Oo.jsx)(_a.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Ia=({className:e,type:t,state:o,...a})=>(0,Oo.jsxs)(Gt,{className:l("flex w-full items-center justify-between gap-4 Oo-3 pl-0 w-2xl",e),...a,children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oo.jsx)(_a.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Oo.jsx)("span",{className:"font-medium text-sm",children:t}),fr(o)]}),(0,Oo.jsx)(_a.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Ma=({className:e,...t})=>(0,Oo.jsx)($t,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ba=({className:e,input:t,...o})=>(0,Oo.jsxs)("div",{className:l("space-y-2 overflow-hidden Oo-4",e),...o,children:[(0,Oo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Oo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Oo.jsx)(Jt,{code:JSON.stringify(t,null,2),language:"json"})})]}),La=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Oo.jsx)("div",{children:t});return typeof t=="object"?n=(0,Oo.jsx)(Jt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Oo.jsx)(Jt,{code:t,language:"json"})),(0,Oo.jsxs)("div",{className:l("space-y-2 Oo-4",e),...a,children:[(0,Oo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Oo.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Oo.jsx)("div",{children:o}),n]})]})};var Ua=require("date-fns");function Ea({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,ft.useState)(null),[i,r]=(0,ft.useState)(!1),[s,c]=(0,ft.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let R=await y.json();n(R)}catch(y){console.error("Error fetching task:",y),c(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,ft.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:s}}var br=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},vr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Fa({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,c=i,m=a!==void 0?a:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:m,taskData:r,error:c}),m){let{task:R,loading:I,error:T}=Ea({taskId:t,system:o});r=R,s=I,c=T}else s=!1;let w=br(r?.status||"todo"),f=vr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let R=new Date(r?.dateLogged||"");isNaN(R.getTime())||(y=(0,Ua.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Oo.jsxs)(fe,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Oo.jsxs)(Ee,{className:"pb-2",children:[(0,Oo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Oo.jsx)(ze,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,Oo.jsx)(ie,{className:`${w}`,children:f})]}),r?.project&&(0,Oo.jsxs)(vo,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,Oo.jsx)(Pe,{className:"pb-2",children:s?(0,Oo.jsx)("div",{className:"animate-pulse Oo-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Oo.jsx)("Oo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Oo.jsx)("Oo",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,Oo.jsx)(Pt,{className:"pt-2 flex items-center justify-between",children:(0,Oo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Oo.jsx)(_a.Clock,{className:"Oo-3 w-3 mr-1"}),(0,Oo.jsxs)("span",{children:["Created ",y]}),(0,Oo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Oo.jsxs)("span",{children:["Task #",t]})]})})]})}function Oa({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Ua.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Oo.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,Oo.jsx)(Ee,{className:"pb-2",children:(0,Oo.jsx)("div",{className:"flex justify-between items-start",children:(0,Oo.jsx)(ze,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Oo.jsx)(Pe,{className:"pb-2",children:a?(0,Oo.jsx)("div",{className:"animate-pulse Oo-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Oo.jsx)("Oo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Oo.jsx)("Oo",{className:"text-sm text-foreground",children:e})}),(0,Oo.jsx)(Pt,{className:"pt-2 flex items-center justify-between",children:(0,Oo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Oo.jsx)(_a.Clock,{className:"Oo-3 w-3 mr-1"}),(0,Oo.jsxs)("span",{children:["Created ",r]}),(0,Oo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Oo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var hr=e=>e.startsWith("image/")?(0,Oo.jsx)(_a.Image,{className:"Oo-4 w-4"}):e.startsWith("text/")?(0,Oo.jsx)(_a.FileText,{className:"Oo-4 w-4"}):(0,Oo.jsx)(_a.File,{className:"Oo-4 w-4"}),Va=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,Oo.jsx)(Tt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,Oo.jsx)("div",{className:"mb-2 Oo-2 bg-background/50 rounded-lg",children:(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[hr(r.mediaType||"application/octet-stream"),(0,Oo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Oo.jsx)("Oo",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"Oo-8 w-8 Oo-0",children:(0,Oo.jsx)(_a.Download,{className:"Oo-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,Oo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(Fa,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,Oo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(xo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(xo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(ka,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,Oo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(Oa,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,Oo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Oo.jsx)(Ee,{children:(0,Oo.jsx)(ze,{className:"text-lg",children:s})}),(0,Oo.jsxs)(Pe,{children:[r.state==="input-available"&&(0,Oo.jsxs)("Oo",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,Oo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,Oo.jsxs)("Oo",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(fe,{className:"w-full",children:(0,Oo.jsx)(Pe,{className:"Oo-4",children:(0,Oo.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((c,m)=>(0,Oo.jsxs)("div",{className:"flex items-center gap-2 Oo-2 rounded-md bg-muted/50",children:[(0,Oo.jsx)(ie,{variant:"outline",children:c.type||"link"}),(0,Oo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Oo.jsx)("Oo",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Oo-8 w-8 Oo-0",children:(0,Oo.jsx)(_a.ExternalLink,{className:"Oo-4 w-4"})})]},m))})})})},i):s==="menu"?(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsxs)(fe,{className:"w-full",children:[(0,Oo.jsx)(Ee,{children:(0,Oo.jsx)(ze,{className:"text-lg",children:r.data?.title})}),(0,Oo.jsx)(Pe,{children:(0,Oo.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((c,m)=>(0,Oo.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Oo.jsxs)("div",{className:"text-left",children:[(0,Oo.jsx)("Oo",{className:"font-medium",children:c.label}),c.description&&(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:c.description})]})},m))})})]})},i):(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Oo.jsx)(Ee,{children:(0,Oo.jsx)(ze,{className:"text-lg",children:s})}),(0,Oo.jsx)(Pe,{children:(0,Oo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}if(n.type==="reasoning")return(0,Oo.jsxs)(No,{className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.Oo(-1)?.id,children:[(0,Oo.jsx)(ko,{}),(0,Oo.jsx)(Po,{children:n.text})]},`${i}`);if(n.type==="dynamic-tool")return(0,Oo.jsxs)(Aa,{defaultOpen:n.state!=="output-available",children:[(0,Oo.jsx)(Ia,{type:`tool-${n.toolName}`,state:n.state}),(0,Oo.jsxs)(Ma,{children:[(0,Oo.jsx)(Ba,{input:n.input}),(0,Oo.jsx)(La,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`)});var Ga=({className:e,from:t,...o})=>(0,Oo.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),yr=(0,jo.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),$a=({children:e,className:t,variant:o,...a})=>(0,Oo.jsx)("div",{className:l(yr({variant:o,className:t})),...a,children:e});function qa({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:c,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:R,onDragOver:I,className:T,status:C="ready"}){let N=(0,ft.useRef)(null),F=(0,ft.useRef)(null),S=(0,ft.useRef)(null),[M,_]=(0,ft.useState)(!1),[$,le]=(0,ft.useState)({path:[],selectedItems:[],filters:{}});(0,ft.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ft.useEffect)(()=>{M&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let J=()=>ho($),W=()=>{let u=[];return n.forEach(U=>{U.actions&&U.actions.forEach(he=>{u.push({label:he.label,action:()=>X(he.id,{path:[U],selectedItems:[],filters:{}})})}),U.children&&U.children.forEach(he=>{he.type==="list"&&he.data&&u.push({label:`View ${he.name}`,action:()=>_(!0)})})}),u.slice(0,5)},X=(u,U)=>{console.log("Capability action:",u,U);let he=`Executing ${u} with context: ${JSON.stringify(U.path.map(Ae=>Ae.name))}`;_(!1)},ce=ho({path:[],selectedItems:[],filters:{}}),B=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Se=u=>{u.preventDefault(),I(!0)},d=u=>{u.preventDefault(),I(!1)},E=u=>{u.preventDefault(),I(!1),y(u.dataTransfer.files)},z=u=>{if(u===0)return"0 Bytes";let U=1024,he=["Bytes","KB","MB","GB"],Ae=Math.floor(Math.log(u)/Math.log(U));return parseFloat((u/Math.pow(U,Ae)).toFixed(2))+" "+he[Ae]},G=u=>u.startsWith("image/")?(0,Oo.jsx)(_a.Image,{className:"Oo-4 w-4"}):u.startsWith("text/")?(0,Oo.jsx)(_a.FileText,{className:"Oo-4 w-4"}):(0,Oo.jsx)(_a.File,{className:"Oo-4 w-4"}),Z={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:$,contextualActions:ce,getQuickSuggestions:W().map(u=>u.label)},ve=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,Oo.jsxs)("div",{className:`Oo-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Oo.jsxs)(Ce,{ref:F,className:"flex-1 Oo-4 bg-background border-0",onDragOver:Se,onDragLeave:d,onDrop:E,children:[(0,Oo.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Oo.jsx)(gt.animate,{children:e.map(u=>(0,Oo.jsx)(gt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Oo.jsx)(Ga,{from:u.role,children:(0,Oo.jsx)($a,{variant:"flat",children:Va({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),M&&(0,Oo.jsxs)(gt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Oo.jsx)(nt,{className:"Oo-8 w-8",children:(0,Oo.jsx)(st,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Oo.jsx)(_a.Bot,{className:"Oo-4 w-4"})})}),(0,Oo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Oo.jsx)(ya,{capabilities:n,isOpen:M,onToggle:()=>_(!M),onActionSelect:X,className:"w-full"})})]}),o&&(0,Oo.jsxs)(gt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Oo.jsx)(nt,{className:"Oo-8 w-8",children:(0,Oo.jsx)(st,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Oo.jsx)(_a.Bot,{className:"Oo-4 w-4"})})}),(0,Oo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Oo.jsxs)("div",{className:"flex space-x-1",children:[(0,Oo.jsx)("div",{className:"w-2 Oo-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Oo.jsx)("div",{className:"w-2 Oo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Oo.jsx)("div",{className:"w-2 Oo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Oo.jsx)("div",{ref:N})]}),i.length>0&&(0,Oo.jsx)("div",{className:"Oo-4 border-t bg-muted/10",children:(0,Oo.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,Oo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Oo-2 border",children:[G(u.file.type),(0,Oo.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Oo.jsx)("span",{className:"text-xs text-muted-foreground",children:z(u.file.size)}),(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"Oo-6 w-6 Oo-0",children:(0,Oo.jsx)(_a.X,{className:"Oo-4 w-4"})})]},u.id))})}),(0,Oo.jsxs)("div",{className:"border rounded-2xl Oo-4 bg-muted/20",children:[(0,Oo.jsxs)("div",{className:"flex gap-3",children:[(0,Oo.jsx)(wt,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Oo.jsx)(D,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl Oo-10 w-10 shadow-sm",children:(0,Oo.jsx)(_a.Paperclip,{className:"Oo-4 w-4"})}),(0,Oo.jsx)(D,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl Oo-10 w-10 shadow-sm",children:(0,Oo.jsx)(_a.Send,{className:"Oo-4 w-4"})})]}),(0,Oo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Oo.jsxs)(D,{onClick:()=>_(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Oo.jsx)(_a.Menu,{className:"Oo-3 w-3 mr-1"}),M?"Hide":"Show"," Capabilities"]}),(0,Oo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,U)=>(0,Oo.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(u.id,$),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,U)=>(0,Oo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${U}`)),(0,Oo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:ve,children:"Debug"})]})]}),s&&(0,Oo.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:B,className:"hidden"})]})]})}function ot({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:c=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:I=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=E=>console.log("Search query:",E),initialTeam:F="design",currentSession:S=null,showCapabilities:M=!0,title:_="Digital Colleagues",enableFileUpload:$=!0,maxFileSize:le=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:X="Nuvia",tagline:ce="AI-Powered Workspace",actionIcon:B=(0,Oo.jsx)(_a.Users,{className:"mr-2 Oo-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let E={...e,onError:H=>{G?.setMessages(pe=>[...pe,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:H.message}]}]),console.error("Error in CopilotInterface:",H)}},z=(0,Do.useChat)(E||{}),G=o?t||z:null,[Z,ve]=(0,ft.useState)(""),[u,U]=(0,ft.useState)(!1),he=G?.messages||a,Ae=Z,Ja=G?.status==="submitted"||u,Xa=G?.addToolResult?(H,pe,ae)=>{G.addToolResult({tool:pe,toolCallId:H,output:ae}),G.sendMessage()}:()=>{console.log("addToolResult not available")},vt=n||[],Qa={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Ya,Za]=(0,ft.useState)(()=>vt.length===0?Qa:vt.find(H=>H.id===F)||vt[0]),[ht,Dt]=(0,ft.useState)([]),[ei,ti]=(0,ft.useState)(!1),oi=H=>{if(!H||!$)return;let pe=[];Array.from(H).forEach(ae=>{if(ae.size>le*1024*1024){alert(`File ${ae.name} is too large. Maximum size is ${le}MB.`);return}if(J.length>0&&!J.some(Rt=>ae.type.match(Rt))){alert(`File type ${ae.type} is not allowed.`);return}let So={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ae,status:"pending",progress:0};if(ae.type.startsWith("image/")){let Rt=new FileReader;Rt.onload=si=>{Dt(li=>li.map(Yt=>Yt.id===So.id?{...Yt,preview:si.target?.result}:Yt))},Rt.readAsDataURL(ae)}pe.push(So)}),Dt(ae=>[...ae,...pe])},ai=H=>{Dt(pe=>pe.filter(ae=>ae.id!==H))},Ro=()=>{if(!(!Ae.trim()&&ht.length===0)){if(G){let H=ht.length>0?ii(ht.map(pe=>pe.file)):void 0;G.sendMessage({text:Ae,files:H},{body:{timestamp:Date.now()}}),ve("")}else console.log("Message to send:",Ae),console.log("Files to upload:",ht),ve(""),U(!0),setTimeout(()=>{U(!1)},1500);Dt([])}},ii=H=>{let pe=new DataTransfer;return H.forEach(ae=>pe.items.add(ae)),pe.files},ri=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),Ro())},ni=H=>{ve(H)};return(0,Oo.jsx)(ba,{sidebarItems:r||[],title:_,notifications:s||[],businessUnits:vt,currentBusinessUnit:Ya,onBusinessUnitChange:H=>{H&&(Za(H),R?.(H))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:B,actionText:Se,onNotificationRemove:I,onRemoveAll:T,logo:W,appName:X,tagline:ce,sidebarInitiallyClosed:d,children:(0,Oo.jsx)(Qt.AnimatePresence,{mode:"wait",children:(0,Oo.jsx)(Qt.motion.div,{className:"flex-1 Oo-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Oo.jsxs)("div",{className:"Oo-full flex",children:[(0,Oo.jsx)("div",{className:"w-80 flex-shrink-0 Oo-full Oo-2",children:(0,Oo.jsx)(va,{sessions:c||[],currentSession:S,teams:vt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,Oo.jsx)("div",{className:"flex-1 Oo-full Oo-2",children:(0,Oo.jsx)(qa,{messages:he||[],input:Ae,isTyping:Ja,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:ni,addToolResult:Xa,onSendMessage:Ro,onKeyPress:ri,fileUploads:ht,isDragOver:ei,enableFileUpload:$,onFileUpload:oi,onRemoveFile:ai,onDragOver:ti})})]})},"chat-interface")})})}var bt=[{id:"1",title:"AI Assistant Chat",lastMessage:"How can I help you today?"}];function xr(){return(0,Oo.jsx)(ot,{businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),title:"AI-Powered Copilot"})}function wr(){return(0,Oo.jsx)(ot,{aiConfig:{onError:e=>console.error("Chat error:",e)},businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),title:"Custom AI Copilot"})}function Cr(){return(0,Oo.jsx)(ot,{enableAI:!1,messages:[{id:"1",role:"assistant",parts:[{type:"text",text:"This is demo mode - no AI involved!"}]}],businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:t=>console.log("Session selected:",t),onSessionDelete:t=>console.log("Session deleted:",t),title:"Demo Copilot"})}function Nr(){let e=(0,Do.useChat)({onError:t=>console.error("Custom chat error:",t)});return(0,Oo.jsx)(ot,{useCustomChat:e,businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>{e.setMessages([]),console.log("New chat started - messages cleared")},onSessionSelect:t=>console.log("Session selected:",t),onSessionDelete:t=>console.log("Session deleted:",t),title:"Advanced AI Copilot"})}function kr(){return(0,Oo.jsx)(ot,{sidebarInitiallyClosed:!0,businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),title:"Focused AI Chat"})}function Pr(){let e=(0,Do.useChat)({onError:t=>console.error("File upload chat error:",t),onFinish:t=>console.log("Message with files completed:",t)});return(0,Oo.jsx)(ot,{useCustomChat:e,enableAI:!0,enableFileUpload:!0,maxFileSize:10,allowedFileTypes:["image/*","text/*","application/pdf"],businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>{e.setMessages([]),console.log("New file upload chat started - messages cleared")},onSessionSelect:t=>console.log("Session selected:",t),onSessionDelete:t=>console.log("Session deleted:",t),title:"AI Copilot with File Uploads"})}0&&(module.exports={AdvancedAICopilot,CustomAICopilot,DemoCopilot,FileUploadAICopilot,FocusedChatCopilot,SimpleAICopilot});
21
+ `,children:"Cancel"})]})]}):null};var ka=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=wo.default.useState(!0),[i,r]=wo.default.useState(null),s=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,Oo.jsxs)("div",{className:"mb-2",children:[(0,Oo.jsx)(Na,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Oo.jsxs)(Oo.Fragment,{children:[i==="approve"&&(0,Oo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Oo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Oo.jsx)("svg",{className:"Oo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Oo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Oo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Oo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Oo.jsx)("svg",{className:"Oo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Oo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Oo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Co=require("@radix-ui/react-use-controllable-state");var mt=V(require("@radix-ui/react-collapsible")),Wt=mt.Root,Gt=mt.CollapsibleTrigger,$t=mt.CollapsibleContent;var Ta=require("streamdown"),Tt=(0,ft.memo)(({className:e,...t})=>(0,Oo.jsx)(Ta.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Tt.displayName="Response";var Ra=(0,ft.createContext)(null),dr=()=>{let e=(0,ft.useContext)(Ra);if(!e)throw new Error("Reasoning components must _a used within Reasoning");return e},pr=1e3,mr=1e3,No=(0,ft.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[c,m]=(0,Co.useControllableState)({prop:o,defaultProp:a,onChange:n}),[w,f]=(0,Co.useControllableState)({prop:i,defaultProp:0}),[y,R]=(0,ft.useState)(!1),[I,T]=(0,ft.useState)(null);(0,ft.useEffect)(()=>{t?I===null&&T(Date.now()):I!==null&&(f(Math.ceil((Date.now()-I)/mr)),T(null))},[t,I,f]),(0,ft.useEffect)(()=>{if(a&&!t&&c&&!y){let N=setTimeout(()=>{m(!1),R(!0)},pr);return()=>clearTimeout(N)}},[t,c,a,m,y]);let C=N=>{m(N)};return(0,Oo.jsx)(Ra.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:w},children:(0,Oo.jsx)(Wt,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:r})})}),ur=(e,t)=>e||t===0?(0,Oo.jsx)("Oo",{children:"Thinking..."}):t===void 0?(0,Oo.jsx)("Oo",{children:"Thought for a few seconds"}):(0,Oo.jsxs)("Oo",{children:["Thought for ",t," seconds"]}),ko=(0,ft.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:i}=dr();return(0,Oo.jsx)(Gt,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(_a.BrainIcon,{className:"size-4"}),ur(a,i),(0,Oo.jsx)(_a.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),Po=(0,ft.memo)(({className:e,children:t,...o})=>(0,Oo.jsx)($t,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Oo.jsx)(Tt,{className:"grid gap-2",children:t})}));No.displayName="Reasoning";ko.displayName="ReasoningTrigger";Po.displayName="ReasoningContent";var To=require("react-syntax-highlighter"),_t=require("react-syntax-highlighter/dist/esm/styles/prism"),gr=(0,ft.createContext)({code:""}),Jt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...i})=>(0,Oo.jsx)(gr.Provider,{value:{code:e},children:(0,Oo.jsx)("div",{className:l("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,Oo.jsxs)("div",{className:"relative",children:[(0,Oo.jsx)(To.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:_t.oneLight,children:e}),(0,Oo.jsx)(To.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:_t.oneDark,children:e}),n&&(0,Oo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Aa=({className:e,...t})=>(0,Oo.jsx)(Wt,{className:l("not-prose mb-4 w-full",e),...t}),fr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Oo.jsxs)(ie,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Oo.jsx)(_a.CircleIcon,{className:"size-4"}),"input-available":(0,Oo.jsx)(_a.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Oo.jsx)(_a.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Oo.jsx)(_a.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Ia=({className:e,type:t,state:o,...a})=>(0,Oo.jsxs)(Gt,{className:l("flex w-full items-center justify-between gap-4 Oo-3 pl-0 w-2xl",e),...a,children:[(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oo.jsx)(_a.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Oo.jsx)("span",{className:"font-medium text-sm",children:t}),fr(o)]}),(0,Oo.jsx)(_a.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Ma=({className:e,...t})=>(0,Oo.jsx)($t,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ba=({className:e,input:t,...o})=>(0,Oo.jsxs)("div",{className:l("space-y-2 overflow-hidden Oo-4",e),...o,children:[(0,Oo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Oo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Oo.jsx)(Jt,{code:JSON.stringify(t,null,2),language:"json"})})]}),La=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Oo.jsx)("div",{children:t});return typeof t=="object"?n=(0,Oo.jsx)(Jt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Oo.jsx)(Jt,{code:t,language:"json"})),(0,Oo.jsxs)("div",{className:l("space-y-2 Oo-4",e),...a,children:[(0,Oo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Oo.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Oo.jsx)("div",{children:o}),n]})]})};var Ua=require("date-fns");function Ea({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,ft.useState)(null),[i,r]=(0,ft.useState)(!1),[s,c]=(0,ft.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let R=await y.json();n(R)}catch(y){console.error("Error fetching task:",y),c(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,ft.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:s}}var br=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},vr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Fa({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,c=i,m=a!==void 0?a:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:m,taskData:r,error:c}),m){let{task:R,loading:I,error:T}=Ea({taskId:t,system:o});r=R,s=I,c=T}else s=!1;let w=br(r?.status||"todo"),f=vr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let R=new Date(r?.dateLogged||"");isNaN(R.getTime())||(y=(0,Ua.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Oo.jsxs)(fe,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Oo.jsxs)(Ee,{className:"pb-2",children:[(0,Oo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Oo.jsx)(ze,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,Oo.jsx)(ie,{className:`${w}`,children:f})]}),r?.project&&(0,Oo.jsxs)(vo,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,Oo.jsx)(Pe,{className:"pb-2",children:s?(0,Oo.jsx)("div",{className:"animate-pulse Oo-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Oo.jsx)("Oo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Oo.jsx)("Oo",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,Oo.jsx)(Pt,{className:"pt-2 flex items-center justify-between",children:(0,Oo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Oo.jsx)(_a.Clock,{className:"Oo-3 w-3 mr-1"}),(0,Oo.jsxs)("span",{children:["Created ",y]}),(0,Oo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Oo.jsxs)("span",{children:["Task #",t]})]})})]})}function Oa({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Ua.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Oo.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,Oo.jsx)(Ee,{className:"pb-2",children:(0,Oo.jsx)("div",{className:"flex justify-between items-start",children:(0,Oo.jsx)(ze,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Oo.jsx)(Pe,{className:"pb-2",children:a?(0,Oo.jsx)("div",{className:"animate-pulse Oo-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Oo.jsx)("Oo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Oo.jsx)("Oo",{className:"text-sm text-foreground",children:e})}),(0,Oo.jsx)(Pt,{className:"pt-2 flex items-center justify-between",children:(0,Oo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Oo.jsx)(_a.Clock,{className:"Oo-3 w-3 mr-1"}),(0,Oo.jsxs)("span",{children:["Created ",r]}),(0,Oo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Oo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var hr=e=>e.startsWith("image/")?(0,Oo.jsx)(_a.Image,{className:"Oo-4 w-4"}):e.startsWith("text/")?(0,Oo.jsx)(_a.FileText,{className:"Oo-4 w-4"}):(0,Oo.jsx)(_a.File,{className:"Oo-4 w-4"}),Va=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,Oo.jsx)(Tt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,Oo.jsx)("div",{className:"mb-2 Oo-2 bg-background/50 rounded-lg",children:(0,Oo.jsxs)("div",{className:"flex items-center gap-2",children:[hr(r.mediaType||"application/octet-stream"),(0,Oo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Oo.jsx)("Oo",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"Oo-8 w-8 Oo-0",children:(0,Oo.jsx)(_a.Download,{className:"Oo-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,Oo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(Fa,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,Oo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(xo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(xo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(ka,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,Oo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(Oa,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,Oo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Oo.jsx)(Ee,{children:(0,Oo.jsx)(ze,{className:"text-lg",children:s})}),(0,Oo.jsxs)(Pe,{children:[r.state==="input-available"&&(0,Oo.jsxs)("Oo",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,Oo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,Oo.jsxs)("Oo",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsx)(fe,{className:"w-full",children:(0,Oo.jsx)(Pe,{className:"Oo-4",children:(0,Oo.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((c,m)=>(0,Oo.jsxs)("div",{className:"flex items-center gap-2 Oo-2 rounded-md bg-muted/50",children:[(0,Oo.jsx)(ie,{variant:"outline",children:c.type||"link"}),(0,Oo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Oo.jsx)("Oo",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Oo-8 w-8 Oo-0",children:(0,Oo.jsx)(_a.ExternalLink,{className:"Oo-4 w-4"})})]},m))})})})},i):s==="menu"?(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsxs)(fe,{className:"w-full",children:[(0,Oo.jsx)(Ee,{children:(0,Oo.jsx)(ze,{className:"text-lg",children:r.data?.title})}),(0,Oo.jsx)(Pe,{children:(0,Oo.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((c,m)=>(0,Oo.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Oo.jsxs)("div",{className:"text-left",children:[(0,Oo.jsx)("Oo",{className:"font-medium",children:c.label}),c.description&&(0,Oo.jsx)("Oo",{className:"text-xs text-muted-foreground",children:c.description})]})},m))})})]})},i):(0,Oo.jsx)("div",{className:"mb-2",children:(0,Oo.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Oo.jsx)(Ee,{children:(0,Oo.jsx)(ze,{className:"text-lg",children:s})}),(0,Oo.jsx)(Pe,{children:(0,Oo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}if(n.type==="reasoning")return(0,Oo.jsxs)(No,{className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.Oo(-1)?.id,children:[(0,Oo.jsx)(ko,{}),(0,Oo.jsx)(Po,{children:n.text})]},`${i}`);if(n.type==="dynamic-tool")return(0,Oo.jsxs)(Aa,{defaultOpen:n.state!=="output-available",children:[(0,Oo.jsx)(Ia,{type:`tool-${n.toolName}`,state:n.state}),(0,Oo.jsxs)(Ma,{children:[(0,Oo.jsx)(Ba,{input:n.input}),(0,Oo.jsx)(La,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`)});var Ga=({className:e,from:t,...o})=>(0,Oo.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),yr=(0,jo.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),$a=({children:e,className:t,variant:o,...a})=>(0,Oo.jsx)("div",{className:l(yr({variant:o,className:t})),...a,children:e});function qa({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:c,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:R,onDragOver:I,className:T,status:C="ready"}){let N=(0,ft.useRef)(null),H=(0,ft.useRef)(null),S=(0,ft.useRef)(null),[M,_]=(0,ft.useState)(!1),[$,le]=(0,ft.useState)({path:[],selectedItems:[],filters:{}});(0,ft.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ft.useEffect)(()=>{M&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let J=()=>ho($),W=()=>{let u=[];return n.forEach(U=>{U.actions&&U.actions.forEach(he=>{u.push({label:he.label,action:()=>X(he.id,{path:[U],selectedItems:[],filters:{}})})}),U.children&&U.children.forEach(he=>{he.type==="list"&&he.data&&u.push({label:`View ${he.name}`,action:()=>_(!0)})})}),u.slice(0,5)},X=(u,U)=>{console.log("Capability action:",u,U);let he=`Executing ${u} with context: ${JSON.stringify(U.path.map(Ae=>Ae.name))}`;_(!1)},ce=ho({path:[],selectedItems:[],filters:{}}),B=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Se=u=>{u.preventDefault(),I(!0)},d=u=>{u.preventDefault(),I(!1)},E=u=>{u.preventDefault(),I(!1),y(u.dataTransfer.files)},z=u=>{if(u===0)return"0 Bytes";let U=1024,he=["Bytes","KB","MB","GB"],Ae=Math.floor(Math.log(u)/Math.log(U));return parseFloat((u/Math.pow(U,Ae)).toFixed(2))+" "+he[Ae]},G=u=>u.startsWith("image/")?(0,Oo.jsx)(_a.Image,{className:"Oo-4 w-4"}):u.startsWith("text/")?(0,Oo.jsx)(_a.FileText,{className:"Oo-4 w-4"}):(0,Oo.jsx)(_a.File,{className:"Oo-4 w-4"}),Z={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:$,contextualActions:ce,getQuickSuggestions:W().map(u=>u.label)},ve=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,Oo.jsxs)("div",{className:`Oo-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Oo.jsxs)(Ce,{ref:H,className:"flex-1 Oo-4 bg-background border-0",onDragOver:Se,onDragLeave:d,onDrop:E,children:[(0,Oo.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Oo.jsx)(gt.animate,{children:e.map(u=>(0,Oo.jsx)(gt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Oo.jsx)(Ga,{from:u.role,children:(0,Oo.jsx)($a,{variant:"flat",children:Va({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),M&&(0,Oo.jsxs)(gt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Oo.jsx)(nt,{className:"Oo-8 w-8",children:(0,Oo.jsx)(st,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Oo.jsx)(_a.Bot,{className:"Oo-4 w-4"})})}),(0,Oo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Oo.jsx)(ya,{capabilities:n,isOpen:M,onToggle:()=>_(!M),onActionSelect:X,className:"w-full"})})]}),o&&(0,Oo.jsxs)(gt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Oo.jsx)(nt,{className:"Oo-8 w-8",children:(0,Oo.jsx)(st,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Oo.jsx)(_a.Bot,{className:"Oo-4 w-4"})})}),(0,Oo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Oo.jsxs)("div",{className:"flex space-x-1",children:[(0,Oo.jsx)("div",{className:"w-2 Oo-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Oo.jsx)("div",{className:"w-2 Oo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Oo.jsx)("div",{className:"w-2 Oo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Oo.jsx)("div",{ref:N})]}),i.length>0&&(0,Oo.jsx)("div",{className:"Oo-4 border-t bg-muted/10",children:(0,Oo.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,Oo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Oo-2 border",children:[G(u.file.type),(0,Oo.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Oo.jsx)("span",{className:"text-xs text-muted-foreground",children:z(u.file.size)}),(0,Oo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"Oo-6 w-6 Oo-0",children:(0,Oo.jsx)(_a.X,{className:"Oo-4 w-4"})})]},u.id))})}),(0,Oo.jsxs)("div",{className:"border rounded-2xl Oo-4 bg-muted/20",children:[(0,Oo.jsxs)("div",{className:"flex gap-3",children:[(0,Oo.jsx)(wt,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Oo.jsx)(D,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl Oo-10 w-10 shadow-sm",children:(0,Oo.jsx)(_a.Paperclip,{className:"Oo-4 w-4"})}),(0,Oo.jsx)(D,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl Oo-10 w-10 shadow-sm",children:(0,Oo.jsx)(_a.Send,{className:"Oo-4 w-4"})})]}),(0,Oo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Oo.jsxs)(D,{onClick:()=>_(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Oo.jsx)(_a.Menu,{className:"Oo-3 w-3 mr-1"}),M?"Hide":"Show"," Capabilities"]}),(0,Oo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,U)=>(0,Oo.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(u.id,$),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,U)=>(0,Oo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${U}`)),(0,Oo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:ve,children:"Debug"})]})]}),s&&(0,Oo.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:B,className:"hidden"})]})]})}function ot({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:c=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:I=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=E=>console.log("Search query:",E),initialTeam:H="design",currentSession:S=null,showCapabilities:M=!0,title:_="Digital Colleagues",enableFileUpload:$=!0,maxFileSize:le=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:X="Nuvia",tagline:ce="AI-Powered Workspace",actionIcon:B=(0,Oo.jsx)(_a.Users,{className:"mr-2 Oo-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let E={...e,onError:F=>{G?.setMessages(de=>[...de,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:F.message}]}]),console.error("Error in CopilotInterface:",F)}},z=(0,Do.useChat)(E||{}),G=o?t||z:null,[Z,ve]=(0,ft.useState)(""),[u,U]=(0,ft.useState)(!1),he=G?.messages||a,Ae=Z,Ja=G?.status==="submitted"||u,Xa=G?.addToolResult?(F,de,ee)=>{G.addToolResult({tool:de,toolCallId:F,output:ee}),console.log("Tool result added:",{toolCallId:F,tool:de,output:ee}),G.sendMessage()}:()=>{console.log("addToolResult not available")},vt=n||[],Qa={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Ya,Za]=(0,ft.useState)(()=>vt.length===0?Qa:vt.find(F=>F.id===H)||vt[0]),[ht,Dt]=(0,ft.useState)([]),[ei,ti]=(0,ft.useState)(!1),oi=F=>{if(!F||!$)return;let de=[];Array.from(F).forEach(ee=>{if(ee.size>le*1024*1024){alert(`File ${ee.name} is too large. Maximum size is ${le}MB.`);return}if(J.length>0&&!J.some(Rt=>ee.type.match(Rt))){alert(`File type ${ee.type} is not allowed.`);return}let So={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ee,status:"pending",progress:0};if(ee.type.startsWith("image/")){let Rt=new FileReader;Rt.onload=si=>{Dt(li=>li.map(Yt=>Yt.id===So.id?{...Yt,preview:si.target?.result}:Yt))},Rt.readAsDataURL(ee)}de.push(So)}),Dt(ee=>[...ee,...de])},ai=F=>{Dt(de=>de.filter(ee=>ee.id!==F))},Ro=()=>{if(!(!Ae.trim()&&ht.length===0)){if(G){let F=ht.length>0?ii(ht.map(de=>de.file)):void 0;G.sendMessage({text:Ae,files:F},{body:{timestamp:Date.now()}}),ve("")}else console.log("Message to send:",Ae),console.log("Files to upload:",ht),ve(""),U(!0),setTimeout(()=>{U(!1)},1500);Dt([])}},ii=F=>{let de=new DataTransfer;return F.forEach(ee=>de.items.add(ee)),de.files},ri=F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),Ro())},ni=F=>{ve(F)};return(0,Oo.jsx)(ba,{sidebarItems:r||[],title:_,notifications:s||[],businessUnits:vt,currentBusinessUnit:Ya,onBusinessUnitChange:F=>{F&&(Za(F),R?.(F))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:B,actionText:Se,onNotificationRemove:I,onRemoveAll:T,logo:W,appName:X,tagline:ce,sidebarInitiallyClosed:d,children:(0,Oo.jsx)(Qt.AnimatePresence,{mode:"wait",children:(0,Oo.jsx)(Qt.motion.div,{className:"flex-1 Oo-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Oo.jsxs)("div",{className:"Oo-full flex",children:[(0,Oo.jsx)("div",{className:"w-80 flex-shrink-0 Oo-full Oo-2",children:(0,Oo.jsx)(va,{sessions:c||[],currentSession:S,teams:vt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,Oo.jsx)("div",{className:"flex-1 Oo-full Oo-2",children:(0,Oo.jsx)(qa,{messages:he||[],input:Ae,isTyping:Ja,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:ni,addToolResult:Xa,onSendMessage:Ro,onKeyPress:ri,fileUploads:ht,isDragOver:ei,enableFileUpload:$,onFileUpload:oi,onRemoveFile:ai,onDragOver:ti})})]})},"chat-interface")})})}var bt=[{id:"1",title:"AI Assistant Chat",lastMessage:"How can I help you today?"}];function xr(){return(0,Oo.jsx)(ot,{businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),title:"AI-Powered Copilot"})}function wr(){return(0,Oo.jsx)(ot,{aiConfig:{onError:e=>console.error("Chat error:",e)},businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),title:"Custom AI Copilot"})}function Cr(){return(0,Oo.jsx)(ot,{enableAI:!1,messages:[{id:"1",role:"assistant",parts:[{type:"text",text:"This is demo mode - no AI involved!"}]}],businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:t=>console.log("Session selected:",t),onSessionDelete:t=>console.log("Session deleted:",t),title:"Demo Copilot"})}function Nr(){let e=(0,Do.useChat)({onError:t=>console.error("Custom chat error:",t)});return(0,Oo.jsx)(ot,{useCustomChat:e,businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>{e.setMessages([]),console.log("New chat started - messages cleared")},onSessionSelect:t=>console.log("Session selected:",t),onSessionDelete:t=>console.log("Session deleted:",t),title:"Advanced AI Copilot"})}function kr(){return(0,Oo.jsx)(ot,{sidebarInitiallyClosed:!0,businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),title:"Focused AI Chat"})}function Pr(){let e=(0,Do.useChat)({onError:t=>console.error("File upload chat error:",t),onFinish:t=>console.log("Message with files completed:",t)});return(0,Oo.jsx)(ot,{useCustomChat:e,enableAI:!0,enableFileUpload:!0,maxFileSize:10,allowedFileTypes:["image/*","text/*","application/pdf"],businessUnits:Me,capabilities:et,sidebarItems:_e,notifications:Je,sessions:bt,onNewChat:()=>{e.setMessages([]),console.log("New file upload chat started - messages cleared")},onSessionSelect:t=>console.log("Session selected:",t),onSessionDelete:t=>console.log("Session deleted:",t),title:"AI Copilot with File Uploads"})}0&&(module.exports={AdvancedAICopilot,CustomAICopilot,DemoCopilot,FileUploadAICopilot,FocusedChatCopilot,SimpleAICopilot});