cortex-react-components 2.13.13 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/{chunk-GETYSIZV.mjs → chunk-255P6K5W.mjs} +1 -1
  2. package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
  3. package/dist/{chunk-6FHRZHAJ.mjs → chunk-2HWSTGAP.mjs} +1 -1
  4. package/dist/{chunk-P6OSMPUQ.mjs → chunk-2RQDJ5XT.mjs} +1 -1
  5. package/dist/{chunk-UPRS7OYQ.mjs → chunk-2UNIT7NC.mjs} +1 -1
  6. package/dist/{chunk-3AZ2XX4O.mjs → chunk-2Z5N6HIX.mjs} +1 -1
  7. package/dist/chunk-3BG2SCNC.mjs +1 -0
  8. package/dist/chunk-4RGIPI27.mjs +1 -0
  9. package/dist/{chunk-XX4GSGRP.mjs → chunk-5NIEZE7A.mjs} +1 -1
  10. package/dist/{chunk-BQQ4V4PX.mjs → chunk-5SHZBJ5R.mjs} +1 -1
  11. package/dist/{chunk-R6AYIVIR.mjs → chunk-5WVFEIMC.mjs} +1 -1
  12. package/dist/{chunk-QQFIVSBW.mjs → chunk-62A35O55.mjs} +1 -1
  13. package/dist/{chunk-GAZHKHGB.mjs → chunk-67QPOSVV.mjs} +1 -1
  14. package/dist/chunk-6OT5PQXV.mjs +13 -0
  15. package/dist/{chunk-7OMPPFGG.mjs → chunk-7GMAMIHM.mjs} +1 -1
  16. package/dist/{chunk-M527EJIX.mjs → chunk-AMVJPDM3.mjs} +1 -1
  17. package/dist/{chunk-KBEXWUKI.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  18. package/dist/{chunk-DKRRVTCV.mjs → chunk-CJDUN6R4.mjs} +1 -1
  19. package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
  20. package/dist/{chunk-DXE6AGJX.mjs → chunk-D2H36ZLW.mjs} +1 -1
  21. package/dist/{chunk-MAZGVZJN.mjs → chunk-DMCFEJ2C.mjs} +1 -1
  22. package/dist/{chunk-2GM2LPLB.mjs → chunk-ERJXTG6X.mjs} +1 -1
  23. package/dist/{chunk-TO7SVJIU.mjs → chunk-F2Y3ELUO.mjs} +1 -1
  24. package/dist/{chunk-HDKHF3EA.mjs → chunk-FKU4VQR6.mjs} +1 -1
  25. package/dist/{chunk-RRME4EHD.mjs → chunk-GSOFCLPO.mjs} +1 -1
  26. package/dist/{chunk-F64CA5CH.mjs → chunk-H3CJOE6S.mjs} +1 -1
  27. package/dist/{chunk-U3FYDDE2.mjs → chunk-HKGW6JI2.mjs} +1 -1
  28. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  29. package/dist/{chunk-KZAYLEFB.mjs → chunk-I2GNNRFH.mjs} +1 -1
  30. package/dist/{chunk-PNUBVBSR.mjs → chunk-IF3425JX.mjs} +1 -1
  31. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  32. package/dist/{chunk-PTZT4QJW.mjs → chunk-LJQPLE4S.mjs} +1 -1
  33. package/dist/{chunk-2OOJ4ZFB.mjs → chunk-M7NV6EFH.mjs} +1 -1
  34. package/dist/{chunk-ESPA7NWT.mjs → chunk-MDBYZZXI.mjs} +1 -1
  35. package/dist/{chunk-BDDEMCAH.mjs → chunk-MFCVMJBO.mjs} +1 -1
  36. package/dist/{chunk-4SRUEQTP.mjs → chunk-MXCW6SOT.mjs} +1 -1
  37. package/dist/{chunk-FYQBRCQM.mjs → chunk-N3B3XNV3.mjs} +1 -1
  38. package/dist/{chunk-FEWOSBUJ.mjs → chunk-NWISIJFD.mjs} +1 -1
  39. package/dist/{chunk-UPDEVKI7.mjs → chunk-OLIYPWO3.mjs} +1 -1
  40. package/dist/{chunk-RIRZRO6U.mjs → chunk-P55W6AFU.mjs} +1 -1
  41. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  42. package/dist/{chunk-MO4HRQEL.mjs → chunk-PK3OBSCB.mjs} +1 -1
  43. package/dist/{chunk-L5NPH5RX.mjs → chunk-PO3XUUWY.mjs} +1 -1
  44. package/dist/{chunk-W2UVMIWN.mjs → chunk-R5SXUWYU.mjs} +1 -1
  45. package/dist/{chunk-T5HJS6OF.mjs → chunk-RSDUFAIB.mjs} +1 -1
  46. package/dist/chunk-SDMPCZ2S.mjs +1 -0
  47. package/dist/{chunk-RZET5RXO.mjs → chunk-TILPSVAP.mjs} +1 -1
  48. package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
  49. package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
  50. package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
  51. package/dist/{chunk-OQCMTGML.mjs → chunk-XKGBG5FX.mjs} +1 -1
  52. package/dist/{chunk-HKMNAXLM.mjs → chunk-YKG4FNS4.mjs} +1 -1
  53. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  54. package/dist/components/Blocks/Banner.mjs +1 -1
  55. package/dist/components/Blocks/CallToAction.mjs +1 -1
  56. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  57. package/dist/components/Blocks/Content.mjs +1 -1
  58. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  59. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  60. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  61. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  62. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  63. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  64. package/dist/components/Blocks/index.mjs +1 -1
  65. package/dist/components/CRM/CogeBoard.mjs +1 -1
  66. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  67. package/dist/components/CRM/index.mjs +1 -1
  68. package/dist/components/Cards/ContentCard.mjs +1 -1
  69. package/dist/components/Cards/FeatureCard.mjs +1 -1
  70. package/dist/components/Cards/index.mjs +1 -1
  71. package/dist/components/Chat/ChatInterface.js +12 -3
  72. package/dist/components/Chat/ChatInterface.mjs +1 -1
  73. package/dist/components/Chat/Components/ApprovalRequest.d.ts +12 -0
  74. package/dist/components/Chat/Components/ApprovalRequest.js +13 -0
  75. package/dist/components/Chat/Components/ApprovalRequest.mjs +2 -0
  76. package/dist/components/Chat/CopilotInterface.js +12 -3
  77. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  78. package/dist/components/Chat/PartTypes/PartApprovalTool.d.ts +15 -0
  79. package/dist/components/Chat/PartTypes/PartApprovalTool.js +13 -0
  80. package/dist/components/Chat/PartTypes/PartApprovalTool.mjs +1 -0
  81. package/dist/components/Chat/PartTypes/index.d.ts +1 -0
  82. package/dist/components/Chat/PartTypes/index.js +13 -4
  83. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  84. package/dist/components/Chat/demo-long-messages.js +23 -14
  85. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  86. package/dist/components/Chat/demo-tests.js +38 -29
  87. package/dist/components/Chat/demo-tests.mjs +1 -1
  88. package/dist/components/Chat/demo.js +12 -3
  89. package/dist/components/Chat/demo.mjs +1 -1
  90. package/dist/components/Chat/example-usage.js +12 -3
  91. package/dist/components/Chat/example-usage.mjs +1 -1
  92. package/dist/components/Chat/example-with-vercel-ai.js +12 -3
  93. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  94. package/dist/components/Chat/index.d.ts +2 -0
  95. package/dist/components/Chat/index.js +13 -4
  96. package/dist/components/Chat/index.mjs +1 -1
  97. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  98. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  99. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  100. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  101. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  102. package/dist/components/DigitalColleagues/index.mjs +1 -1
  103. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  104. package/dist/components/Foundary/MainPage.mjs +1 -1
  105. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  106. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  107. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  108. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  109. package/dist/components/Foundary/Views/index.mjs +1 -1
  110. package/dist/components/Foundary/index.mjs +1 -1
  111. package/dist/components/HeaderFooter/Header.mjs +1 -1
  112. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  113. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  114. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  115. package/dist/components/HeaderFooter/index.mjs +1 -1
  116. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  117. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  118. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  119. package/dist/components/Heros/PostHero/index.mjs +1 -1
  120. package/dist/components/Heros/RenderHero.mjs +1 -1
  121. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  122. package/dist/components/Heros/index.mjs +1 -1
  123. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  124. package/dist/components/Layouts/Print.mjs +1 -1
  125. package/dist/components/Layouts/SlideShow.mjs +1 -1
  126. package/dist/components/Layouts/index.mjs +1 -1
  127. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  128. package/dist/components/Menus/SidebarRight.mjs +1 -1
  129. package/dist/components/Menus/index.mjs +1 -1
  130. package/dist/components/Other/index.mjs +1 -1
  131. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  132. package/dist/components/Payload/Logo/index.d.ts +2 -0
  133. package/dist/components/Payload/Logo/index.js +1 -1
  134. package/dist/components/Payload/Logo/index.mjs +1 -1
  135. package/dist/components/Payload/Media/index.mjs +1 -1
  136. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  137. package/dist/components/Payload/RichText/index.mjs +1 -1
  138. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  139. package/dist/components/Payload/index.js +1 -1
  140. package/dist/components/Payload/index.mjs +1 -1
  141. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  142. package/dist/components/Projects/ProjectPage.mjs +1 -1
  143. package/dist/components/Projects/ProjectView.mjs +1 -1
  144. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  145. package/dist/components/Projects/index.mjs +1 -1
  146. package/dist/components/dc-temp/index.mjs +1 -1
  147. package/dist/components/index.js +22 -13
  148. package/dist/components/index.mjs +1 -1
  149. package/dist/components/ui/index.mjs +1 -1
  150. package/dist/components/ui/sidebar.mjs +1 -1
  151. package/dist/globals.css +1 -1
  152. package/dist/index.js +28 -19
  153. package/dist/index.mjs +1 -1
  154. package/dist/metafile-cjs.json +1 -1
  155. package/dist/metafile-esm.json +1 -1
  156. package/dist/pages/Blog.mjs +1 -1
  157. package/dist/pages/Documentation.mjs +1 -1
  158. package/dist/pages/IndexPage.mjs +1 -1
  159. package/dist/pages/Intranet.mjs +1 -1
  160. package/dist/pages/LandingPage.mjs +1 -1
  161. package/dist/pages/Page.mjs +1 -1
  162. package/dist/pages/Publish.mjs +1 -1
  163. package/dist/pages/Website.mjs +1 -1
  164. package/dist/sections/AboutSection.mjs +1 -1
  165. package/dist/sections/BlogDetail.mjs +1 -1
  166. package/dist/sections/BlogList.mjs +1 -1
  167. package/dist/sections/BlogListSection.mjs +1 -1
  168. package/dist/sections/ContactSection.mjs +1 -1
  169. package/dist/sections/PageSections.mjs +1 -1
  170. package/dist/sections/PricingSection.mjs +1 -1
  171. package/dist/sections/ServiceDetail.mjs +1 -1
  172. package/dist/sections/ServiceDetailSection.mjs +1 -1
  173. package/dist/sections/ServiceSection.mjs +1 -1
  174. package/dist/sections/index.mjs +1 -1
  175. package/package.json +1 -1
  176. package/dist/chunk-AUBKJ4XO.mjs +0 -1
  177. package/dist/chunk-FDRX3CL2.mjs +0 -1
@@ -2,13 +2,22 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var Do=Object.create;var ht=Object.defineProperty;var To=Object.getOwnPropertyDescriptor;var Ro=Object.getOwnPropertyNames;var So=Object.getPrototypeOf,Ao=Object.prototype.hasOwnProperty;var Mo=(e,t)=>{for(var a in t)ht(e,a,{get:t[a],enumerable:!0})},da=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ro(t))!Ao.call(e,s)&&s!==a&&ht(e,s,{get:()=>t[s],enumerable:!(o=To(t,s))||o.enumerable});return e};var $=(e,t,a)=>(a=e!=null?Do(So(e)):{},da(t||!e||!e.__esModule?ht(a,"default",{value:e,enumerable:!0}):a,e)),Io=e=>da(ht({},"__esModule",{value:!0}),e);var $i={};Mo($i,{CapabilityMenu:()=>ia,ChatCardArtefact:()=>$t,ChatCardTask:()=>dt,ChatInterface:()=>Et,ChatInterfaceMessages:()=>bi,ChatMessage:()=>Vt,CopilotInterface:()=>zi,defaultColorScheme:()=>Wt,findCapabilityByPath:()=>vi,getAllCapabilities:()=>yi,getCapabilityByTeam:()=>hi,getContextualActions:()=>Nt,getDataPart:()=>Wi,getFileParts:()=>Vi,getTextContent:()=>Fi,getToolPart:()=>Hi,hasDataPart:()=>Gi,hasFilePart:()=>Oi,hasToolPart:()=>ji,testCapabilities:()=>Ct});module.exports=Io($i);var Pa=$(require("react"));var yt=$(require("react")),Ie=$(require("@radix-ui/react-avatar"));var ya=require("clsx");var Ht="-",Bo=e=>{let t=Eo(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let i=l.split(Ht);return i[0]===""&&i.length!==1&&i.shift(),ua(i,t)||Lo(l)},getConflictingClassGroupIds:(l,i)=>{let m=a[l]||[];return i&&o[l]?[...m,...o[l]]:m}}},ua=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),s=o?ua(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;let r=e.join(Ht);return t.validators.find(({validator:l})=>l(r))?.classGroupId},ma=/^\[(.+)\]$/,Lo=e=>{if(ma.test(e)){let t=ma.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Eo=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return zo(Object.entries(e.classGroups),a).forEach(([r,l])=>{jt(l,o,r,t)}),o},jt=(e,t,a,o)=>{e.forEach(s=>{if(typeof s=="string"){let r=s===""?t:pa(t,s);r.classGroupId=a;return}if(typeof s=="function"){if(Uo(s)){jt(s(o),t,a,o);return}t.validators.push({validator:s,classGroupId:a});return}Object.entries(s).forEach(([r,l])=>{jt(l,pa(t,r),a,o)})})},pa=(e,t)=>{let a=e;return t.split(Ht).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Uo=e=>e.isThemeGetter,zo=(e,t)=>t?e.map(([a,o])=>{let s=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([l,i])=>[t+l,i])):r);return[a,s]}):e,Fo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,s=(r,l)=>{a.set(r,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let l=a.get(r);if(l!==void 0)return l;if((l=o.get(r))!==void 0)return s(r,l),l},set(r,l){a.has(r)?a.set(r,l):s(r,l)}}},ga="!",jo=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,s=t[0],r=t.length,l=i=>{let m=[],u=0,P=0,f;for(let x=0;x<i.length;x++){let S=i[x];if(u===0){if(S===s&&(o||i.slice(x,x+r)===t)){m.push(i.slice(P,x)),P=x+r;continue}if(S==="/"){f=x;continue}}S==="["?u++:S==="]"&&u--}let y=m.length===0?i:i.substring(P),T=y.startsWith(ga),z=T?y.substring(1):y,R=f&&f>P?f-P:void 0;return{modifiers:m,hasImportantModifier:T,baseClassName:z,maybePostfixModifierPosition:R}};return a?i=>a({className:i,parseClassName:l}):l},Ho=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},Oo=e=>({cache:Fo(e.cacheSize),parseClassName:jo(e),...Bo(e)}),Vo=/\s+/,Go=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:s}=t,r=[],l=e.trim().split(Vo),i="";for(let m=l.length-1;m>=0;m-=1){let u=l[m],{modifiers:P,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:T}=a(u),z=!!T,R=o(z?y.substring(0,T):y);if(!R){if(!z){i=u+(i.length>0?" "+i:i);continue}if(R=o(y),!R){i=u+(i.length>0?" "+i:i);continue}z=!1}let x=Ho(P).join(":"),S=f?x+ga:x,F=S+R;if(r.includes(F))continue;r.push(F);let w=s(R,z);for(let E=0;E<w.length;++E){let Z=w[E];r.push(S+Z)}i=u+(i.length>0?" "+i:i)}return i};function Wo(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=fa(t))&&(o&&(o+=" "),o+=a);return o}var fa=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=fa(e[o]))&&(a&&(a+=" "),a+=t);return a};function $o(e,...t){let a,o,s,r=l;function l(m){let u=t.reduce((P,f)=>f(P),e());return a=Oo(u),o=a.cache.get,s=a.cache.set,r=i,i(m)}function i(m){let u=o(m);if(u)return u;let P=Go(m,a);return s(m,P),P}return function(){return r(Wo.apply(null,arguments))}}var O=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},ba=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ko=/^\d+\/\d+$/,_o=new Set(["px","full","screen"]),qo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jo=/\d+(%|px|r?em|[sdl]?xt([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|xt|min|max))|\xt(calc|min|max|clamp)\(.+\)|^0$/,Xo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Qo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Me=e=>Ye(e)||_o.has(e)||Ko.test(e),Fe=e=>Ze(e,"length",ni),Ye=e=>!!e&&!Number.isNaN(Number(e)),Ft=e=>Ze(e,"number",Ye),st=e=>!!e&&Number.isInteger(Number(e)),Zo=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),h=e=>ba.test(e),je=e=>qo.test(e),ei=new Set(["length","size","percentage"]),ti=e=>Ze(e,ei,va),ai=e=>Ze(e,"position",va),oi=new Set(["image","url"]),ii=e=>Ze(e,oi,li),ri=e=>Ze(e,"",si),lt=()=>!0,Ze=(e,t,a)=>{let o=ba.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},ni=e=>Jo.test(e)&&!Xo.test(e),va=()=>!1,si=e=>Qo.test(e),li=e=>Yo.test(e);var ci=()=>{let e=O("colors"),t=O("spacing"),a=O("blur"),o=O("brightness"),s=O("borderColor"),r=O("borderRadius"),l=O("borderSpacing"),i=O("borderWidth"),m=O("contrast"),u=O("grayscale"),P=O("hueRotate"),f=O("invert"),y=O("gap"),T=O("gradientColorStops"),z=O("gradientColorStopPositions"),R=O("inset"),x=O("margin"),S=O("opacity"),F=O("padding"),w=O("saturate"),E=O("scale"),Z=O("sepia"),ee=O("skew"),te=O("space"),Y=O("translate"),K=()=>["auto","contain","none"],oe=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",h,t],A=()=>[h,t],Se=()=>["",Me,Fe],d=()=>["auto",Ye,h],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],p=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",h],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[Ye,h];return{cacheSize:500,separator:":",theme:{colors:[lt],spacing:[Me,Fe],blur:["none","",je,h],brightness:L(),borderColor:[e],borderRadius:["none","","full",je,h],borderSpacing:A(),borderWidth:Se(),contrast:L(),grayscale:j(),hueRotate:L(),invert:j(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[Zo,Fe],inset:le(),margin:le(),opacity:L(),padding:A(),saturate:L(),scale:L(),sepia:j(),skew:L(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[je]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"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:[...B(),h]}],overflow:[{overflow:oe()}],"overflow-x":[{"overflow-x":oe()}],"overflow-y":[{"overflow-y":oe()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",st,h]}],basis:[{basis:le()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",st,h]}],"grid-cols":[{"grid-cols":[lt]}],"col-start-end":[{col:["auto",{span:["full",st,h]},h]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[lt]}],"row-start-end":[{row:["auto",{span:[st,h]},h]}],"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",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...p()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...p(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...p(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],xt:[{xt:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[te]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[te]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[je]},je]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",je,Fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ft]}],"font-family":[{font:[lt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",Ye,Ft]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Me,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Me,Fe]}],"underline-offset":[{"underline-offset":["auto",Me,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),ai]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ti]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","xt","bl","l","tl"]},ii]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[z]}],"gradient-via-pos":[{via:[z]}],"gradient-to-pos":[{to:[z]}],"gradient-from":[{from:[T]}],"gradient-via":[{via:[T]}],"gradient-to":[{to:[T]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-xt":[{"rounded-xt":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-xt":[{"rounded-xt":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-xt":[{"border-xt":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:M()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-xt":[{"border-xt":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[Me,h]}],"outline-w":[{outline:[Me,Fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Me,Fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",je,ri]}],"shadow-color":[{shadow:[lt]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",je,h]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[P]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[P]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[st,h]}],"translate-x":[{"translate-x":[Y]}],"translate-y":[{"translate-y":[Y]}],"skew-x":[{"skew-x":[ee]}],"skew-y":[{"skew-y":[ee]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","xt-resize","e-resize","s-resize","w-resize","Na-resize","nw-resize","xt-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-xt":[{"scroll-xt":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Me,Fe,Ft]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","xt","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-xt","rounded-l","rounded-ss","rounded-xt","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-xt","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-xt":["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-xt","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-xt"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-xt","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-xt"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-xt","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 ha=$o(ci);function c(...e){return ha((0,ya.clsx)(e))}var xt=require("react/jsx-runtime"),ue=yt.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(Ie.Root,{ref:a,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ue.displayName=Ie.Root.displayName;var He=yt.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(Ie.Image,{ref:a,className:c("aspect-square h-full w-full",e),...t}));He.displayName=Ie.Image.displayName;var ge=yt.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(Ie.Fallback,{ref:a,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ge.displayName=Ie.Fallback.displayName;var Ke=$(require("react"));var fe=Ke.forwardRef(({className:e,...t},a)=>(0,xt.jsx)("div",{ref:a,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));fe.displayName="Card";var Be=Ke.forwardRef(({className:e,...t},a)=>(0,xt.jsx)("div",{ref:a,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Be.displayName="CardHeader";var Le=Ke.forwardRef(({className:e,...t},a)=>(0,xt.jsx)("div",{ref:a,className:c("font-semibold leading-none tracking-tight",e),...t}));Le.displayName="CardTitle";var Ot=Ke.forwardRef(({className:e,...t},a)=>(0,xt.jsx)("div",{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Ot.displayName="CardDescription";var ke=Ke.forwardRef(({className:e,...t},a)=>(0,xt.jsx)("div",{ref:a,className:c("p-6 pt-0",e),...t}));ke.displayName="CardContent";var ct=Ke.forwardRef(({className:e,...t},a)=>(0,xt.jsx)("div",{ref:a,className:c("flex items-center p-6 pt-0",e),...t}));ct.displayName="CardFooter";var xa=require("class-variance-authority");var di=(0,xa.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 me({className:e,variant:t,...a}){return(0,xt.jsx)("div",{className:c(di({variant:t}),e),...a})}var Na=require("lucide-react"),ka=require("date-fns");var et=require("react");function Ca({taskId:e,polling:t=!0,system:a="payload"}){let[o,s]=(0,et.useState)(null),[r,l]=(0,et.useState)(!1),[i,m]=(0,et.useState)(null),u=async(f=!0)=>{if(e){f&&l(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let T=await y.json();s(T)}catch(y){console.error("Error fetching task:",y),m(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&l(!1)}}},P=()=>u(!1);return(0,et.useEffect)(()=>{e&&u(!0);let f=null;return e&&t&&(f=setInterval(P,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:r,error:i}}var mi=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"}},pi=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function dt({data:e}){let{id:t,system:a,fetchLatest:o,taskData:s,error:r}=e||{};if(!t)return null;let l=null,i=!0,m=r,u=o!==void 0?o:!0;if(l=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:u,taskData:l,error:m}),u){let{task:T,loading:z,error:R}=Ca({taskId:t,system:a});l=T,i=z,m=R}else i=!1;let P=mi(l?.status||"todo"),f=pi(l?.status||"todo"),y=l?.dateLogged||new Date().toISOString();try{let T=new Date(l?.dateLogged||"");isNaN(T.getTime())||(y=(0,ka.formatDistanceToNow)(T,{addSuffix:!0}))}catch{}return(0,xt.jsxs)(fe,{className:c("w-full max-w-md shadow-md",m&&"border border-destructive"),children:[(0,xt.jsxs)(Be,{className:"pb-2",children:[(0,xt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,xt.jsx)(Le,{className:"text-lg font-semibold",children:i?"Loading...":l?.name||"Task"}),(0,xt.jsx)(me,{className:`${P}`,children:f})]}),l?.project&&(0,xt.jsxs)(Ot,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,xt.jsx)(ke,{className:"pb-2",children:i?(0,xt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):m?(0,xt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,xt.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,xt.jsx)(ct,{className:"pt-2 flex items-center justify-between",children:(0,xt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,xt.jsx)(Na.Clock,{className:"h-3 w-3 mr-1"}),(0,xt.jsxs)("span",{children:["Created ",y]}),(0,xt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,xt.jsxs)("span",{children:["Task #",t]})]})})]})}var ui={task:dt},gi=`
5
+ "use strict";var Io=Object.create;var xt=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Eo=Object.getPrototypeOf,Uo=Object.prototype.hasOwnProperty;var zo=(e,t)=>{for(var a in t)xt(e,a,{get:t[a],enumerable:!0})},ba=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Bo(t))!Uo.call(e,l)&&l!==a&&xt(e,l,{get:()=>t[l],enumerable:!(o=Lo(t,l))||o.enumerable});return e};var $=(e,t,a)=>(a=e!=null?Io(Eo(e)):{},ba(t||!e||!e.__esModule?xt(a,"default",{value:e,enumerable:!0}):a,e)),Fo=e=>ba(xt({},"__esModule",{value:!0}),e);var Qi={};zo(Qi,{ApprovalRequestModal:()=>ma,CapabilityMenu:()=>na,ChatCardArtefact:()=>Kt,ChatCardTask:()=>mt,ChatInterface:()=>zt,ChatInterfaceMessages:()=>Ci,ChatMessage:()=>Wt,CopilotInterface:()=>$i,OAuthModal:()=>la,defaultColorScheme:()=>qt,findCapabilityByPath:()=>Ni,getAllCapabilities:()=>Pi,getCapabilityByTeam:()=>ki,getContextualActions:()=>Pt,getDataPart:()=>Xi,getFileParts:()=>_i,getTextContent:()=>Wi,getToolPart:()=>qi,hasDataPart:()=>Ji,hasFilePart:()=>Ki,hasToolPart:()=>Gi,testCapabilities:()=>kt});module.exports=Fo(Qi);var Ma=$(require("react"));var wt=$(require("react")),Le=$(require("@radix-ui/react-avatar"));var Pa=require("clsx");var Vt="-",jo=e=>{let t=Oo(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:n=>{let i=n.split(Vt);return i[0]===""&&i.length!==1&&i.shift(),ya(i,t)||Ho(n)},getConflictingClassGroupIds:(n,i)=>{let p=a[n]||[];return i&&o[n]?[...p,...o[n]]:p}}},ya=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),l=o?ya(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;let r=e.join(Vt);return t.validators.find(({validator:n})=>n(r))?.classGroupId},va=/^\[(.+)\]$/,Ho=e=>{if(va.test(e)){let t=va.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Oo=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return $o(Object.entries(e.classGroups),a).forEach(([r,n])=>{Ot(n,o,r,t)}),o},Ot=(e,t,a,o)=>{e.forEach(l=>{if(typeof l=="string"){let r=l===""?t:ha(t,l);r.classGroupId=a;return}if(typeof l=="function"){if(Vo(l)){Ot(l(o),t,a,o);return}t.validators.push({validator:l,classGroupId:a});return}Object.entries(l).forEach(([r,n])=>{Ot(n,ha(t,r),a,o)})})},ha=(e,t)=>{let a=e;return t.split(Vt).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Vo=e=>e.isThemeGetter,$o=(e,t)=>t?e.map(([a,o])=>{let l=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([n,i])=>[t+n,i])):r);return[a,l]}):e,Wo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,l=(r,n)=>{a.set(r,n),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let n=a.get(r);if(n!==void 0)return n;if((n=o.get(r))!==void 0)return l(r,n),n},set(r,n){a.has(r)?a.set(r,n):l(r,n)}}},xa="!",Go=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,l=t[0],r=t.length,n=i=>{let p=[],m=0,k=0,f;for(let x=0;x<i.length;x++){let A=i[x];if(m===0){if(A===l&&(o||i.slice(x,x+r)===t)){p.push(i.slice(k,x)),k=x+r;continue}if(A==="/"){f=x;continue}}A==="["?m++:A==="]"&&m--}let y=p.length===0?i:i.substring(k),T=y.startsWith(xa),z=T?y.substring(1):y,R=f&&f>k?f-k:void 0;return{modifiers:p,hasImportantModifier:T,baseClassName:z,maybePostfixModifierPosition:R}};return a?i=>a({className:i,parseClassName:n}):n},qo=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},Ko=e=>({cache:Wo(e.cacheSize),parseClassName:Go(e),...jo(e)}),_o=/\Ct+/,Jo=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l}=t,r=[],n=e.trim().split(_o),i="";for(let p=n.length-1;p>=0;p-=1){let m=n[p],{modifiers:k,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:T}=a(m),z=!!T,R=o(z?y.substring(0,T):y);if(!R){if(!z){i=m+(i.length>0?" "+i:i);continue}if(R=o(y),!R){i=m+(i.length>0?" "+i:i);continue}z=!1}let x=qo(k).join(":"),A=f?x+xa:x,F=A+R;if(r.includes(F))continue;r.push(F);let w=l(R,z);for(let E=0;E<w.length;++E){let ee=w[E];r.push(A+ee)}i=m+(i.length>0?" "+i:i)}return i};function Xo(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=wa(t))&&(o&&(o+=" "),o+=a);return o}var wa=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=wa(e[o]))&&(a&&(a+=" "),a+=t);return a};function Qo(e,...t){let a,o,l,r=n;function n(p){let m=t.reduce((k,f)=>f(k),e());return a=Ko(m),o=a.cache.get,l=a.cache.set,r=i,i(p)}function i(p){let m=o(p);if(m)return m;let k=Jo(p,a);return l(p,k),k}return function(){return r(Xo.apply(null,arguments))}}var O=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ca=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yo=/^\d+\/\d+$/,Zo=new Set(["px","full","screen"]),ei=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ti=/\d+(%|px|r?em|[sdl]?Ct([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|Ct|min|max))|\Ct(calc|min|max|clamp)\(.+\)|^0$/,ai=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,oi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ii=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ie=e=>et(e)||Zo.has(e)||Yo.test(e),He=e=>tt(e,"length",mi),et=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>tt(e,"number",et),ct=e=>!!e&&Number.isInteger(Number(e)),ri=e=>e.endsWith("%")&&et(e.slice(0,-1)),h=e=>Ca.test(e),Oe=e=>ei.test(e),ni=new Set(["length","size","percentage"]),si=e=>tt(e,ni,Na),li=e=>tt(e,"position",Na),ci=new Set(["image","url"]),di=e=>tt(e,ci,gi),pi=e=>tt(e,"",ui),dt=()=>!0,tt=(e,t,a)=>{let o=Ca.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},mi=e=>ti.test(e)&&!ai.test(e),Na=()=>!1,ui=e=>oi.test(e),gi=e=>ii.test(e);var fi=()=>{let e=O("colors"),t=O("spacing"),a=O("blur"),o=O("brightness"),l=O("borderColor"),r=O("borderRadius"),n=O("borderSpacing"),i=O("borderWidth"),p=O("contrast"),m=O("grayscale"),k=O("hueRotate"),f=O("invert"),y=O("gap"),T=O("gradientColorStops"),z=O("gradientColorStopPositions"),R=O("inset"),x=O("margin"),A=O("opacity"),F=O("padding"),w=O("saturate"),E=O("scale"),ee=O("sepia"),te=O("skew"),ae=O("space"),Z=O("translate"),q=()=>["auto","contain","none"],re=()=>["auto","hidden","clip","visible","scroll"],ce=()=>["auto",h,t],M=()=>[h,t],Se=()=>["",Ie,He],d=()=>["auto",et,h],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],u=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",h],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>[et,h];return{cacheSize:500,separator:":",theme:{colors:[dt],spacing:[Ie,He],blur:["none","",Oe,h],brightness:S(),borderColor:[e],borderRadius:["none","","full",Oe,h],borderSpacing:M(),borderWidth:Se(),contrast:S(),grayscale:j(),hueRotate:S(),invert:j(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[ri,He],inset:ce(),margin:ce(),opacity:S(),padding:M(),saturate:S(),scale:S(),sepia:j(),skew:S(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[Oe]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:[...B(),h]}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ct,h]}],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",h]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",ct,h]}],"grid-cols":[{"grid-cols":[dt]}],"col-start-end":[{col:["auto",{span:["full",ct,h]},h]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[dt]}],"row-start-end":[{row:["auto",{span:[ct,h]},h]}],"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",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...u()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...u(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...u(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[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:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[ae]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ae]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[Oe]},Oe]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Oe,He]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ht]}],"font-family":[{font:[dt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",et,Ht]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ie,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ie,He]}],"underline-offset":[{"underline-offset":["auto",Ie,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),li]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",si]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Ct","bl","l","tl"]},di]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[z]}],"gradient-via-pos":[{via:[z]}],"gradient-to-pos":[{to:[z]}],"gradient-from":[{from:[T]}],"gradient-via":[{via:[T]}],"gradient-to":[{to:[T]}],rounded:[{rounded:[r]}],"rounded-Ct":[{"rounded-Ct":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-Ct":[{"rounded-Ct":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-Aa":[{"rounded-Aa":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-Ct":[{"border-Ct":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-Ct":[{"border-Ct":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:I()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-Ct":[{"border-Ct":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-Ct":[{"border-Ct":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Ie,h]}],"outline-w":[{outline:[Ie,He]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[Ie,He]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Oe,pi]}],"shadow-color":[{shadow:[dt]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Oe,h]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[k]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[ee]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[k]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:S()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:S()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[ct,h]}],"translate-x":[{"translate-x":[Z]}],"translate-y":[{"translate-y":[Z]}],"skew-x":[{"skew-x":[te]}],"skew-y":[{"skew-y":[te]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","Ct-resize","w-resize","ne-resize","nw-resize","Aa-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ie,He,Ht]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-Ct","rounded-e","rounded-t","rounded-r","rounded-Ct","rounded-l","rounded-ss","rounded-Aa","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-Ct":["rounded-ss","rounded-es"],"rounded-e":["rounded-Aa","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Ct":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-Ct","border-w-e","border-w-t","border-w-r","border-w-Ct","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Ct"],"border-color":["border-color-Ct","border-color-e","border-color-t","border-color-r","border-color-Ct","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Ct"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-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 ka=Qo(fi);function c(...e){return ka((0,Pa.clsx)(e))}var Ct=require("react/jsx-runtime"),ge=wt.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(Le.Root,{ref:a,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ge.displayName=Le.Root.displayName;var Ve=wt.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(Le.Image,{ref:a,className:c("aspect-square h-full w-full",e),...t}));Ve.displayName=Le.Image.displayName;var fe=wt.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(Le.Fallback,{ref:a,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));fe.displayName=Le.Fallback.displayName;var _e=$(require("react"));var be=_e.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)("div",{ref:a,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));be.displayName="Card";var Be=_e.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)("div",{ref:a,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Be.displayName="CardHeader";var Ee=_e.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)("div",{ref:a,className:c("font-semibold leading-none tracking-tight",e),...t}));Ee.displayName="CardTitle";var $t=_e.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)("div",{ref:a,className:c("text-sm text-muted-foreground",e),...t}));$t.displayName="CardDescription";var Pe=_e.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)("div",{ref:a,className:c("p-6 pt-0",e),...t}));Pe.displayName="CardContent";var pt=_e.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)("div",{ref:a,className:c("flex items-center p-6 pt-0",e),...t}));pt.displayName="CardFooter";var Da=require("class-variance-authority");var bi=(0,Da.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 me({className:e,variant:t,...a}){return(0,Ct.jsx)("div",{className:c(bi({variant:t}),e),...a})}var Aa=require("lucide-react"),Sa=require("date-fns");var at=require("react");function Ra({taskId:e,polling:t=!0,system:a="payload"}){let[o,l]=(0,at.useState)(null),[r,n]=(0,at.useState)(!1),[i,p]=(0,at.useState)(null),m=async(f=!0)=>{if(e){f&&n(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let T=await y.json();l(T)}catch(y){console.error("Error fetching task:",y),p(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&n(!1)}}},k=()=>m(!1);return(0,at.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(k,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:r,error:i}}var vi=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"}},hi=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function mt({data:e}){let{id:t,system:a,fetchLatest:o,taskData:l,error:r}=e||{};if(!t)return null;let n=null,i=!0,p=r,m=o!==void 0?o:!0;if(n=l||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:n,error:p}),m){let{task:T,loading:z,error:R}=Ra({taskId:t,system:a});n=T,i=z,p=R}else i=!1;let k=vi(n?.status||"todo"),f=hi(n?.status||"todo"),y=n?.dateLogged||new Date().toISOString();try{let T=new Date(n?.dateLogged||"");isNaN(T.getTime())||(y=(0,Sa.formatDistanceToNow)(T,{addSuffix:!0}))}catch{}return(0,Ct.jsxs)(be,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,Ct.jsxs)(Be,{className:"pb-2",children:[(0,Ct.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Ct.jsx)(Ee,{className:"text-lg font-semibold",children:i?"Loading...":n?.name||"Task"}),(0,Ct.jsx)(me,{className:`${k}`,children:f})]}),n?.project&&(0,Ct.jsxs)($t,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,Ct.jsx)(Pe,{className:"pb-2",children:i?(0,Ct.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,Ct.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Ct.jsx)("p",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,Ct.jsx)(pt,{className:"pt-2 flex items-center justify-between",children:(0,Ct.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ct.jsx)(Aa.Clock,{className:"h-3 w-3 mr-1"}),(0,Ct.jsxs)("span",{children:["Created ",y]}),(0,Ct.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Ct.jsxs)("span",{children:["Task #",t]})]})})]})}var yi={task:mt},xi=`
6
6
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
7
7
  <path d="M327.5 85.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 128l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 128l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 64 426.8 7.5C425.1 3 420.8 0 416 0s-9.1 3-10.8 7.5L384 64 327.5 85.2zM205.1 73.3c-2.6-5.7-8.3-9.3-14.5-9.3s-11.9 3.6-14.5 9.3L123.3 187.3 9.3 240C3.6 242.6 0 248.3 0 254.6s3.6 11.9 9.3 14.5l114.1 52.7L176 435.8c2.6 5.7 8.3 9.3 14.5 9.3s11.9-3.6 14.5-9.3l52.7-114.1 114.1-52.7c5.7-2.6 9.3-8.3 9.3-14.5s-3.6-11.9-9.3-14.5L257.8 187.4 205.1 73.3zM384 384l-56.5 21.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 448l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 448l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 384l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L384 384z"/>
8
- </svg>`,fi=`data:image/svg+xml;utf8,${encodeURIComponent(gi)}`,Vt=Pa.default.memo(function(t){let{id:a,message:o,currentUser:s,role:r}=t,l=r==="user",i=l?s?.name||"You":s?.name||"AI Assistant",m=l?s?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,xt.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${l?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,xt.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[l?(0,xt.jsxs)(ue,{children:[(0,xt.jsx)(He,{src:m,alt:i}),(0,xt.jsx)(ge,{children:i.substring(0,2).toUpperCase()})]}):(0,xt.jsx)("img",{src:fi,alt:"AI Assistant",className:"w-10 h-10"}),(0,xt.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,xt.jsx)("div",{className:"flex items-center gap-2",children:(0,xt.jsx)("span",{className:"font-medium",children:i})}),(0,xt.jsx)("div",{className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,xt.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[(0,xt.jsxs)(ue,{className:l?"":"ai-border",children:[(0,xt.jsx)(He,{src:m,alt:i}),(0,xt.jsx)(ge,{children:i.substring(0,2).toUpperCase()})]}),(0,xt.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,xt.jsx)("div",{className:"flex items-center gap-2",children:(0,xt.jsx)("span",{className:"font-medium",children:i})}),(0,xt.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let u=ui[o.data.tool];return u?(0,xt.jsx)("div",{className:"mt-2",children:(0,xt.jsx)(u,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,xt.jsx)("div",{className:"mt-2",children:"......"}))}}});var Gt=$(require("react")),be=$(require("@radix-ui/react-scroll-area"));var ve=Gt.forwardRef(({className:e,children:t,...a},o)=>(0,xt.jsxs)(be.Root,{ref:o,className:c("relative overflow-hidden",e),...a,children:[(0,xt.jsx)(be.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,xt.jsx)(Da,{}),(0,xt.jsx)(be.Corner,{})]}));ve.displayName=be.Root.displayName;var Da=Gt.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,xt.jsx)(be.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,xt.jsx)(be.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Da.displayName=be.ScrollAreaScrollbar.displayName;function bi({messages:e,isLoading:t}){let a=(0,et.useRef)(null);return(0,et.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,xt.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,xt.jsxs)(ve,{className:"container flex-1 p-4",children:[(0,xt.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,xt.jsx)("div",{className:"flex items-center justify-center h-full pt-60",children:(0,xt.jsxs)("div",{className:"text-center max-w-md",children:[(0,xt.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,xt.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question to a business function directly using the toolbar below."})]})}),t&&(0,xt.jsxs)("div",{className:"flex items-start gap-3",children:[(0,xt.jsxs)(ue,{className:"ai-border",children:[(0,xt.jsx)(He,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,xt.jsx)(ge,{children:"AI"})]}),(0,xt.jsxs)("div",{className:"grid gap-1.5",children:[(0,xt.jsx)("div",{className:"flex items-center gap-2",children:(0,xt.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,xt.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,xt.jsxs)("div",{className:"flex space-x-2",children:[(0,xt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,xt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,xt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,s)=>(0,xt.jsx)(Vt,{...o},s))]}),(0,xt.jsx)("div",{ref:a})]})})}var Wt={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"]},Ct=[{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 vi(e){let t=Ct,a=null;for(let o of e){if(a=t.find(s=>s.id===o||s.name===o)||null,!a)return null;t=a.children||[]}return a}function Nt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function hi(e){return Ct.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function yi(){return Ct}function $t({artefact:e,taskId:t,taskData:a,loading:o=!1,error:s=null}){let r=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=r.dateLogged;try{let i=new Date(r.dateLogged);isNaN(i.getTime())||(l=(0,ka.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,xt.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,xt.jsx)(Be,{className:"pb-2",children:(0,xt.jsx)("div",{className:"flex justify-between items-start",children:(0,xt.jsx)(Le,{className:"text-lg font-semibold",children:o?"Loading...":r.name})})}),(0,xt.jsx)(ke,{className:"pb-2",children:o?(0,xt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,xt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,xt.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,xt.jsx)(ct,{className:"pt-2 flex items-center justify-between",children:(0,xt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,xt.jsx)(Na.Clock,{className:"h-3 w-3 mr-1"}),(0,xt.jsxs)("span",{children:["Created ",l]}),(0,xt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,xt.jsxs)("span",{children:["Task #",r.id]})]})})]})}var po=require("@ai-sdk/react"),Ut=require("motion/react");var Mt=$(require("react")),Qt=$(require("next/link"));var Sa=require("@radix-ui/react-slot"),Ma=$(require("react")),xi=(0,xa.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),D=Ma.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...s},r)=>(0,xt.jsx)(e?Sa.Slot:"button",{className:c(xi({className:t,size:a,variant:o})),ref:r,...s}));D.displayName="Button";var Ba=$(require("react"));var mt=Ba.forwardRef(({className:e,type:t,...a},o)=>(0,xt.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));mt.displayName="Input";var pt=$(require("react")),J=$(require("@radix-ui/react-dialog"));var Ua=J.Root;var wi=J.Portal;var za=pt.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(J.Overlay,{ref:a,className:c("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}));za.displayName=J.Overlay.displayName;var Kt=pt.forwardRef(({className:e,children:t,...a},o)=>(0,xt.jsxs)(wi,{children:[(0,xt.jsx)(za,{}),(0,xt.jsxs)(J.Content,{ref:o,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,xt.jsxs)(J.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,xt.jsx)(Na.xt,{className:"h-4 w-4"}),(0,xt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Kt.displayName=J.Content.displayName;var _t=({className:e,...t})=>(0,xt.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_t.displayName="DialogHeader";var Ci=({className:e,...t})=>(0,xt.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ci.displayName="DialogFooter";var qt=pt.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(J.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));qt.displayName=J.Title.displayName;var Ni=pt.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(J.Description,{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Ni.displayName=J.Description.displayName;var ut=$(require("@radix-ui/react-checkbox")),ja=$(require("react")),Jt=ja.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(ut.Root,{className:c("peer h-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:a,...t,children:(0,xt.jsx)(ut.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,xt.jsx)(Na.Check,{className:"h-4 w-4"})})}));Jt.displayName=ut.Root.displayName;var Pe=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Oa=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,xt.jsx)(Na.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,xt.jsx)(Na.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,xt.jsx)(Na.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,xt.jsx)(Na.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,xt.jsx)(Na.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,xt.jsx)(Na.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,xt.jsx)(Na.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,xt.jsx)(Na.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,xt.jsx)(Na.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,xt.jsx)(Na.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Tt=[{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 Xt=[{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}],Pt=[{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}],St=[{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")}],ki=[...St,{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")}],Pi=[...Tt,{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}],Dt={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:[]},Ha={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:St.filter(e=>e.epicId==="1")};var Or={empty:{initialProjects:Dt.projects,initialEpics:Dt.epics,initialSprints:Dt.sprints,initialTasks:Dt.tasks},default:{initialProjects:Tt,initialEpics:Xt,initialSprints:Pt,initialTasks:St},highDensity:{initialProjects:Tt,initialEpics:Xt,initialSprints:Pt,initialTasks:ki},singleEpic:{initialProjects:Tt,initialEpics:Ha.epics,initialSprints:Pt,initialTasks:Ha.tasks},multipleProjects:{initialProjects:Pi,initialEpics:Xt,initialSprints:Pt,initialTasks:St}},Rt=[{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(Pe),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Pe),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(Pe),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Pe),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(Pe),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Pe),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(Pe),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Pe),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(Pe),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Pe),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Vr=[{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:Rt.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:Rt.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:Rt.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 Gr=Rt.filter(e=>e.type==="digital");function Va(e,t){let[a,o]=(0,et.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),s=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,et.useEffect)(()=>{s(a)},[]),[a,s]}function Yt({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:s=Oa[0],onBusinessUnitChange:r,onSearch:l,className:i,logo:m="/headerlogo.png",appName:u="Nuvia",tagline:P="Collaboration Platform"}){let[f,y]=Mt.useState({}),[T,z]=Va("sidebar-favorites",{}),[R,x]=Mt.useState(null),[S,F]=Mt.useState(""),w=d=>{y(B=>({...B,[d]:!B[d]}))},E=d=>{r?.(d)},Z=()=>{S.trim()&&l?.(S.trim())},ee=d=>{d.key==="Enter"&&(d.preventDefault(),Z())},te=(d,B)=>{let M=T[d]||[],_=M.includes(B)?M.filter(p=>p!==B):M.concat(B);z({...T,[d]:_})},Y=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let B=T[d.id]||[],M=d.items.filter(p=>B.includes(p.id)),_=d.items.filter(p=>!B.includes(p.id));return[...M,..._].slice(0,d.maxItems)},K=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,oe=e,le=d=>{let B=K(d),M=Y(d),_=(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,xt.jsx)("span",{children:d.title})]}),d.badge&&(0,xt.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,xt.jsx)(Na.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),p=c("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,xt.jsx)(Qt.default,{href:d.url,className:p,onClick:a?o:void 0,children:_}):(0,xt.jsx)("button",{className:p,onClick:()=>d.items&&w(d.title),children:_})},A=()=>{let d=e.find(M=>M.id===R);if(!d||!d.items||!d.maxItems)return null;let B=T[d.id]||[];return(0,xt.jsx)(Ua,{open:!!R,onOpenChange:M=>!M&&x(null),children:(0,xt.jsxs)(Kt,{className:"sm:max-w-md",children:[(0,xt.jsxs)(_t,{children:[(0,xt.jsxs)(qt,{children:["Manage ",d.title," Favorites"]}),(0,xt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,xt.jsx)(ve,{className:"max-h-96 pr-4",children:(0,xt.jsx)("div",{className:"space-y-4",children:d.items.map(M=>(0,xt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,xt.jsx)(Jt,{id:M.id,checked:B.includes(M.id),onCheckedChange:()=>te(d.id,M.id),disabled:!B.includes(M.id)&&B.length>=(d.maxItems||0)}),(0,xt.jsxs)("label",{htmlFor:M.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:[M.title,M.badge&&(0,xt.jsx)(me,{variant:"outline",className:"text-xs",children:M.badge})]})]},M.id))})})]})})},Se=(0,xt.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,xt.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,xt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,xt.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,xt.jsx)("img",{src:m,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,xt.jsxs)("div",{children:[(0,xt.jsx)("h2",{className:"font-semibold",children:u}),(0,xt.jsx)("p",{className:"text-xs text-muted-foreground",children:P})]})]}),a&&(0,xt.jsx)(D,{variant:"ghost",size:"icon",onClick:o,children:(0,xt.jsx)(Na.xt,{className:"h-5 w-5"})})]}),(0,xt.jsx)("div",{className:"px-3 py-2",children:(0,xt.jsxs)("div",{className:"relative",children:[(0,xt.jsx)(Na.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,xt.jsx)(mt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:S,onChange:d=>F(d.target.value),onKeyPress:ee})]})}),(0,xt.jsx)(ve,{className:"flex-1 px-3 py-2",children:(0,xt.jsx)("div",{className:"space-y-1",children:oe.map(d=>(0,xt.jsxs)("div",{className:"mb-1",children:[le(d),d.items&&f[d.title]&&(0,xt.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[Y(d).map(B=>(0,xt.jsxs)(Qt.default,{href:B.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[B.title,B.badge&&(0,xt.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:B.badge})]},B.id)),K(d)&&d.items&&d.items.length>Y(d).length&&(0,xt.jsxs)("button",{onClick:()=>x(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-Y(d).length," more available"]})]})]},d.id))})}),(0,xt.jsx)("div",{className:"p-3",children:(0,xt.jsx)("div",{className:"space-y-1",children:(0,xt.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,xt.jsx)(Na.Settings,{className:"h-5 w-5"}),(0,xt.jsx)("span",{children:"Settings"})]})})}),(0,xt.jsx)(A,{})]});return a?(0,xt.jsx)("div",{className:c("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",i),children:Se}):(0,xt.jsx)("div",{className:c("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",i),children:Se})}var Ga=$(require("react")),xe=$(require("@radix-ui/react-tooltip"));var tt=xe.Provider,at=xe.Root,ot=xe.Trigger,qe=Ga.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,xt.jsx)(xe.Portal,{children:(0,xt.jsx)(xe.Content,{ref:o,sideOffset:t,className:c("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),...a})}));qe.displayName=xe.Content.displayName;var Wa=require("next-themes");function $a(){let{setTheme:e,theme:t}=(0,Wa.useTheme)();return(0,xt.jsx)(tt,{children:(0,xt.jsxs)(at,{children:[(0,xt.jsx)(ot,{asChild:!0,children:(0,xt.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,xt.jsx)(Na.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,xt.jsx)(Na.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,xt.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,xt.jsx)(qe,{children:"Toggle theme"})]})})}function Ka({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:s,className:r}){let l=e.filter(u=>!u.read),i=l.length,m=u=>{switch(u){case"info":return(0,xt.jsx)(Na.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,xt.jsx)(Na.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,xt.jsx)(Na.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,xt.jsx)(Na.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,xt.jsx)(Ut.AnimatePresence,{children:t&&(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)(Ut.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:a}),(0,xt.jsx)(Ut.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,xt.jsxs)("div",{className:"flex h-full flex-col",children:[(0,xt.jsxs)("div",{className:"flex items-center justify-between border-xt p-4",children:[(0,xt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,xt.jsx)(Na.Bell,{className:"h-5 w-5"}),(0,xt.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,xt.jsxs)(me,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,xt.jsxs)(D,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,xt.jsx)(Na.xt,{className:"h-5 w-5"}),(0,xt.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,xt.jsxs)("div",{className:"flex items-center justify-between border-xt p-2",children:[(0,xt.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,xt.jsx)(D,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,xt.jsx)(ve,{className:"flex-1",children:(0,xt.jsx)("div",{className:"divide-y",children:l.map(u=>(0,xt.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,xt.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:m(u.type)}),(0,xt.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,xt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,xt.jsx)("p",{className:"font-medium",children:u.title}),(0,xt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,xt.jsx)("p",{className:"text-xs text-muted-foreground",children:u.time}),(0,xt.jsx)(D,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(u.id),title:"Dismiss",children:(0,xt.jsx)(Na.Check,{className:"h-3 w-3"})})]})]}),(0,xt.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}),u.actionLabel&&(0,xt.jsxs)(D,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:u.onAction,children:[u.actionLabel,(0,xt.jsx)(Na.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},u.id))})}):(0,xt.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,xt.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,xt.jsx)(Na.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,xt.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,xt.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Je=$(require("@radix-ui/react-tabs"));function _a({className:e,...t}){return(0,xt.jsx)(Je.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function qa({className:e,...t}){return(0,xt.jsx)(Je.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Ja({className:e,...t}){return(0,xt.jsx)(Je.Trigger,{"data-slot":"tabs-trigger",className:c("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 h-[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 Ee=$(require("react")),N=$(require("@radix-ui/react-dropdown-menu")),it=require("@radix-ui/react-icons");var Xa=N.Root,Qa=N.Trigger;var Di=Ee.forwardRef(({className:e,inset:t,children:a,...o},s)=>(0,xt.jsxs)(N.SubTrigger,{ref:s,className:c("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),...o,children:[a,(0,xt.jsx)(it.ChevronRightIcon,{className:"ml-auto"})]}));Di.displayName=N.SubTrigger.displayName;var Ti=Ee.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(N.SubContent,{ref:a,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ti.displayName=N.SubContent.displayName;var ea=Ee.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,xt.jsx)(N.Portal,{children:(0,xt.jsx)(N.Content,{ref:o,sideOffset:t,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));ea.displayName=N.Content.displayName;var ta=Ee.forwardRef(({className:e,inset:t,...a},o)=>(0,xt.jsx)(N.Item,{ref:o,className:c("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),...a}));ta.displayName=N.Item.displayName;var Ri=Ee.forwardRef(({className:e,children:t,checked:a,...o},s)=>(0,xt.jsxs)(N.CheckboxItem,{ref:s,className:c("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:a,...o,children:[(0,xt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,xt.jsx)(N.ItemIndicator,{children:(0,xt.jsx)(it.CheckIcon,{className:"h-4 w-4"})})}),t]}));Ri.displayName=N.CheckboxItem.displayName;var Si=Ee.forwardRef(({className:e,children:t,...a},o)=>(0,xt.jsxs)(N.RadioItem,{ref:o,className:c("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),...a,children:[(0,xt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,xt.jsx)(N.ItemIndicator,{children:(0,xt.jsx)(it.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Si.displayName=N.RadioItem.displayName;var Ai=Ee.forwardRef(({className:e,inset:t,...a},o)=>(0,xt.jsx)(N.Label,{ref:o,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Ai.displayName=N.Label.displayName;var Mi=Ee.forwardRef(({className:e,...t},a)=>(0,xt.jsx)(N.Separator,{ref:a,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));Mi.displayName=N.Separator.displayName;var Ii=({className:e,...t})=>(0,xt.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});Ii.displayName="DropdownMenuShortcut";function Za({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:r=6}){let l=a.find(i=>i.value===e);return(0,xt.jsxs)(Ut.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,xt.jsx)("div",{className:"hidden lg:block",children:(0,xt.jsx)(_a,{value:e,onValueChange:t,children:(0,xt.jsx)(qa,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,xt.jsx)(Ut.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,xt.jsx)(Ja,{value:i.value,className:"w-full h-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:i.label})},i.value))})})}),(0,xt.jsx)("div",{className:"lg:hidden",children:(0,xt.jsxs)(Xa,{children:[(0,xt.jsx)(Qa,{asChild:!0,children:(0,xt.jsxs)(D,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,xt.jsx)(Na.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,xt.jsx)(ea,{align:"center",className:"w-[180px]",children:a.map(i=>(0,xt.jsx)(ta,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function eo({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:s=!0,className:r,activeTab:l="assistant",onTabChange:i,showTabs:m=!0,tabOptions:u=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:P,actionIcon:f=(0,xt.jsx)(Na.Bot,{className:"mr-2 h-4 w-4"}),actionText:y="Action",onNotificationRemove:T,onRemoveAll:z,logo:R="/headerlogo.png",appName:x="Nuvia",tagline:S="Collaboration Platform"}){let[F,w]=(0,et.useState)(!1),[E,Z]=(0,et.useState)(t),ee=E.filter(K=>!K.read).length,te=K=>{Z(oe=>oe.filter(le=>le.id!==K)),T?.(K)},Y=()=>{Z(K=>K.filter(oe=>oe.read)),z?.()};return(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,xt.jsx)(D,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,xt.jsx)(Na.Menu,{className:"h-5 w-5"})}),(0,xt.jsx)(D,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,xt.jsx)(Na.PanelLeft,{className:"h-5 w-5"})}),!s&&(0,xt.jsxs)(Ut.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,xt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,xt.jsx)("img",{src:R,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,xt.jsxs)("div",{children:[(0,xt.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,xt.jsx)("p",{className:"text-xs text-muted-foreground",children:S})]})]}),(0,xt.jsxs)("div",{className:"flex flex-1 items-center",children:[m&&(0,xt.jsx)(Za,{activeTab:l,onTabChange:i,tabOptions:u}),(0,xt.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,xt.jsx)(Ut.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,xt.jsx)(Ut.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,xt.jsxs)(D,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:P,children:[f,y]})})}),(0,xt.jsx)($a,{}),(0,xt.jsx)(tt,{children:(0,xt.jsxs)(at,{children:[(0,xt.jsx)(ot,{asChild:!0,children:(0,xt.jsx)(Ut.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,xt.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>w(!0),children:[(0,xt.jsx)(Ut.motion.div,{animate:ee>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:ee>0?1/0:0,repeatDelay:3},children:(0,xt.jsx)(Na.Bell,{className:"h-5 w-5"})}),ee>0&&(0,xt.jsx)(Ut.motion.span,{className:"absolute -right-1 -top-1 flex h-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:ee})]})})}),(0,xt.jsx)(qe,{children:"Notifications"})]})}),(0,xt.jsx)(Ut.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,xt.jsxs)(ue,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,xt.jsx)(He,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,xt.jsx)(ge,{})]})})]})]})]}),(0,xt.jsx)(Ka,{notifications:E,open:F,onClose:()=>w(!1),onNotificationRemove:te,onRemoveAll:Y})]})}var to=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,xt.jsx)(Na.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function oo({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:s=to[0],onBusinessUnitChange:r,onSearch:l,businessUnits:i=to,activeTab:m,onTabChange:u,showTabs:P=!1,onActionClick:f,actionIcon:y,actionText:T="Action",onNotificationRemove:z,onRemoveAll:R,logo:x="/headerlogo.png",appName:S="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:w=!1}){let[E,Z]=(0,et.useState)(!w),[ee,te]=(0,et.useState)(!1),[Y,K]=(0,et.useState)(s),oe=le=>{K(le),r?.(le)};return(0,xt.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[ee&&(0,xt.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>te(!1)}),(0,xt.jsx)("div",{className:"md:hidden",children:(0,xt.jsx)(Yt,{items:e,isOpen:ee,isMobile:!0,onClose:()=>te(!1),currentBusinessUnit:Y,onBusinessUnitChange:oe,onSearch:l,logo:x,appName:S,tagline:F})}),(0,xt.jsx)("div",{className:"hidden md:block",children:(0,xt.jsx)(Yt,{items:e,isOpen:E,isMobile:!1,currentBusinessUnit:Y,onBusinessUnitChange:oe,onSearch:l,logo:x,appName:S,tagline:F})}),(0,xt.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",E?"md:pl-64":"md:pl-0"),children:[(0,xt.jsx)(eo,{title:a,notifications:o,onToggleSidebar:()=>Z(!E),onToggleMobileMenu:()=>te(!0),sidebarOpen:E,activeTab:m,onTabChange:u,showTabs:P,onActionClick:f,actionIcon:y,actionText:T,onNotificationRemove:z,onRemoveAll:R,logo:x,appName:S,tagline:F}),(0,xt.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function io({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:s,onSessionEdit:r,onSessionDelete:l,className:i}){return(0,xt.jsx)(tt,{children:(0,xt.jsx)("div",{className:`space-y-4 h-full ${i||""}`,children:(0,xt.jsxs)(fe,{className:"shadow-sm h-full",children:[(0,xt.jsx)("div",{className:"p-4 border-xt",children:(0,xt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,xt.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,xt.jsx)($e.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,xt.jsxs)(D,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,xt.jsx)($e.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,xt.jsx)(ve,{className:"h-[600px]",children:(0,xt.jsx)("div",{className:"p-2",children:e.length===0?(0,xt.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(m=>(0,xt.jsxs)(at,{children:[(0,xt.jsx)(ot,{asChild:!0,children:(0,xt.jsx)("div",{className:c("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===m.id&&"bg-muted border"),onClick:()=>s(m),children:(0,xt.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,xt.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,xt.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:m.title}),(0,xt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:m.lastMessage})]}),(0,xt.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,xt.jsx)(D,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),r(m.id)},children:(0,xt.jsx)($e.Edit3,{className:"h-3 w-3"})}),l&&(0,xt.jsx)(D,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),l(m.id)},children:(0,xt.jsx)($e.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,xt.jsx)(qe,{side:"right",className:"max-w-xs",children:(0,xt.jsxs)("div",{className:"space-y-1",children:[(0,xt.jsx)("p",{className:"font-medium text-sm",children:m.title}),(0,xt.jsx)("p",{className:"text-xs",children:m.lastMessage})]})})]},m.id))})})]})})})}var Qe=$(require("motion/react-client"));function ia({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:s,colorScheme:r=Wt,className:l}){let[i,m]=(0,et.useState)([]),[u,P]=(0,et.useState)([]),f=i[i.length-1],y=f?.children||e,T=(w,E)=>{switch(w.type){case"category":return r.categories[E%r.categories.length];case"list":return r.lists[E%r.lists.length];case"item":return r.items[E%r.items.length];default:return r.primary}},z=(0,et.useMemo)(()=>({path:i,selectedItems:u,filters:{}}),[i,u]);(0,et.useEffect)(()=>{s&&s(z)},[z,s]);let R=w=>{w.type==="category"||w.type==="list"?m([...i,w]):w.type==="item"&&P([...u,w])},x=()=>{m(i.slice(0,-1))},S=w=>{m(i.slice(0,w+1))},F=()=>f?.actions?f.actions:[];return t?(0,xt.jsxs)("div",{className:c("w-full",l),children:[(0,xt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,xt.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,xt.jsx)(Ut.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:x,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,xt.jsx)(Na.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,xt.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,xt.jsx)(Ut.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:a,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,xt.jsx)(Na.xt,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,xt.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,xt.jsx)(Ut.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>m([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,xt.jsxs)("span",{className:"relative",children:["Capabilities",(0,xt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((w,E)=>(0,xt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,xt.jsx)(Na.ChevronRight,{className:"h-2 w-2"}),(0,xt.jsx)(Ut.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>S(E),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,xt.jsxs)("span",{className:"relative",children:[w.name,(0,xt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},w.id))]}),(0,xt.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,xt.jsx)(Ut.AnimatePresence,{mode:"wait",children:(0,xt.jsx)(Ut.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,xt.jsx)(Ei,{data:f.data,onItemSelect:w=>P([...u,w]),colorScheme:r}):(0,xt.jsx)(Bi,{capabilities:y,onSelect:R,colorScheme:r})},f?.id||"root")})})]}):(0,xt.jsxs)(D,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,xt.jsx)(Na.Menu,{className:"h-4 w-4"}),(0,xt.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Bi({capabilities:e,onSelect:t,colorScheme:a}){return(0,xt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,xt.jsx)(Li,{capability:o,onClick:()=>t(o),color:a.categories[s%a.categories.length]},o.id))})}function Li({capability:e,onClick:t,selected:a,color:o}){return(0,xt.jsxs)(Ut.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:c("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",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,xt.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,xt.jsxs)("span",{className:"truncate relative",children:[e.name,(0,xt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-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,xt.jsx)(Na.ChevronRight,{className:c("h-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,xt.jsx)(me,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Ei({data:e,onItemSelect:t,colorScheme:a}){return(0,xt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,xt.jsxs)(Ut.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:c("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(o),children:[(0,xt.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[s%a.items.length])}),(0,xt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,xt.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,xt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,xt.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,xt.jsx)(me,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}var no=$(require("react"));var ro=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:s="This endpoint requires authentication to sync functions."})=>{let[r,l]=(0,et.useState)(!1),[i,m]=(0,et.useState)(""),u=()=>{if(!t){m("No authentication URL provided");return}l(!0),m("");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){m("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let y=setInterval(()=>{try{f.closed&&(clearInterval(y),l(!1),o(),a())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(y),l(!1),m("Authentication timed out. Please try again."))},6e5)}catch{m("Failed to open authentication window"),l(!1)}},P=async()=>{try{await navigator.clipboard.writeText(t),m("")}catch{m("Failed to copy URL to clipboard")}};return e?(0,xt.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,xt.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,xt.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,xt.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),i&&(0,xt.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,xt.jsxs)("div",{className:"flex gap-2",children:[(0,xt.jsx)("button",{onClick:u,disabled:r||!t,className:`
8
+ </svg>`,wi=`data:image/svg+xml;utf8,${encodeURIComponent(xi)}`,Wt=Ma.default.memo(function(t){let{id:a,message:o,currentUser:l,role:r}=t,n=r==="user",i=n?l?.name||"You":l?.name||"AI Assistant",p=n?l?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Ct.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${n?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,Ct.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[n?(0,Ct.jsxs)(ge,{children:[(0,Ct.jsx)(Ve,{src:p,alt:i}),(0,Ct.jsx)(fe,{children:i.substring(0,2).toUpperCase()})]}):(0,Ct.jsx)("img",{src:wi,alt:"AI Assistant",className:"w-10 h-10"}),(0,Ct.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Ct.jsx)("div",{className:"flex items-center gap-2",children:(0,Ct.jsx)("span",{className:"font-medium",children:i})}),(0,Ct.jsx)("div",{className:`rounded-lg p-3 text-sm ${n?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,Ct.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[(0,Ct.jsxs)(ge,{className:n?"":"ai-border",children:[(0,Ct.jsx)(Ve,{src:p,alt:i}),(0,Ct.jsx)(fe,{children:i.substring(0,2).toUpperCase()})]}),(0,Ct.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Ct.jsx)("div",{className:"flex items-center gap-2",children:(0,Ct.jsx)("span",{className:"font-medium",children:i})}),(0,Ct.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${n?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let m=yi[o.data.tool];return m?(0,Ct.jsx)("div",{className:"mt-2",children:(0,Ct.jsx)(m,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,Ct.jsx)("div",{className:"mt-2",children:"......"}))}}});var Gt=$(require("react")),ve=$(require("@radix-ui/react-scroll-area"));var he=Gt.forwardRef(({className:e,children:t,...a},o)=>(0,$e.jsxs)(ve.Root,{ref:o,className:c("relative overflow-hidden",e),...a,children:[(0,$e.jsx)(ve.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,$e.jsx)(Ia,{}),(0,$e.jsx)(ve.Corner,{})]}));he.displayName=ve.Root.displayName;var Ia=Gt.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,$e.jsx)(ve.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,$e.jsx)(ve.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Ia.displayName=ve.ScrollAreaScrollbar.displayName;function Ci({messages:e,isLoading:t}){let a=(0,at.useRef)(null);return(0,at.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Ct.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,Ct.jsxs)(he,{className:"container flex-1 p-4",children:[(0,Ct.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,Ct.jsx)("div",{className:"flex items-center justify-center h-full pt-60",children:(0,Ct.jsxs)("div",{className:"text-center max-w-md",children:[(0,Ct.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,Ct.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question to a business function directly using the toolbar below."})]})}),t&&(0,Ct.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Ct.jsxs)(ge,{className:"ai-border",children:[(0,Ct.jsx)(Ve,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Ct.jsx)(fe,{children:"AI"})]}),(0,Ct.jsxs)("div",{className:"grid gap-1.5",children:[(0,Ct.jsx)("div",{className:"flex items-center gap-2",children:(0,Ct.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Ct.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,Ct.jsxs)("div",{className:"flex space-x-2",children:[(0,Ct.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,Ct.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Ct.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,l)=>(0,Ct.jsx)(Wt,{...o},l))]}),(0,Ct.jsx)("div",{ref:a})]})})}var qt={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"]},kt=[{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 Ni(e){let t=kt,a=null;for(let o of e){if(a=t.find(l=>l.id===o||l.name===o)||null,!a)return null;t=a.children||[]}return a}function Pt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function ki(e){return kt.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function Pi(){return kt}function Kt({artefact:e,taskId:t,taskData:a,loading:o=!1,error:l=null}){let r=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=r.dateLogged;try{let i=new Date(r.dateLogged);isNaN(i.getTime())||(n=(0,Sa.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,Ct.jsxs)(be,{className:"w-full max-w-md shadow-md",children:[(0,Ct.jsx)(Be,{className:"pb-2",children:(0,Ct.jsx)("div",{className:"flex justify-between items-start",children:(0,Ct.jsx)(Ee,{className:"text-lg font-semibold",children:o?"Loading...":r.name})})}),(0,Ct.jsx)(Pe,{className:"pb-2",children:o?(0,Ct.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,Ct.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Ct.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Ct.jsx)(pt,{className:"pt-2 flex items-center justify-between",children:(0,Ct.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ct.jsx)(Aa.Clock,{className:"h-3 w-3 mr-1"}),(0,Ct.jsxs)("span",{children:["Created ",n]}),(0,Ct.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Ct.jsxs)("span",{children:["Task #",r.id]})]})})]})}var ho=require("@ai-sdk/react"),Ft=require("motion/react");var Lt=$(require("react")),Zt=$(require("next/link"));var Ea=require("@radix-ui/react-slot"),za=$(require("react")),Di=(0,Da.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),D=za.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...l},r)=>(0,Ct.jsx)(e?Ea.Slot:"button",{className:c(Di({className:t,size:a,variant:o})),ref:r,...l}));D.displayName="Button";var ja=$(require("react"));var ut=ja.forwardRef(({className:e,type:t,...a},o)=>(0,Ct.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));ut.displayName="Input";var gt=$(require("react")),X=$(require("@radix-ui/react-dialog"));var Va=X.Root;var Ti=X.Portal;var $a=gt.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(X.Overlay,{ref:a,className:c("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}));$a.displayName=X.Overlay.displayName;var _t=gt.forwardRef(({className:e,children:t,...a},o)=>(0,Ct.jsxs)(Ti,{children:[(0,Ct.jsx)($a,{}),(0,Ct.jsxs)(X.Content,{ref:o,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,Ct.jsxs)(X.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,Ct.jsx)(Aa.X,{className:"h-4 w-4"}),(0,Ct.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));_t.displayName=X.Content.displayName;var Jt=({className:e,...t})=>(0,Ct.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Jt.displayName="DialogHeader";var Ri=({className:e,...t})=>(0,Ct.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ri.displayName="DialogFooter";var Xt=gt.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(X.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));Xt.displayName=X.Title.displayName;var Ai=gt.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(X.Description,{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Ai.displayName=X.Description.displayName;var ft=$(require("@radix-ui/react-checkbox")),Ga=$(require("react")),Qt=Ga.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(ft.Root,{className:c("peer h-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:a,...t,children:(0,Ct.jsx)(ft.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,Ct.jsx)(Aa.Check,{className:"h-4 w-4"})})}));Qt.displayName=ft.Root.displayName;var De=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Ka=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Ct.jsx)(Aa.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Ct.jsx)(Aa.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Ct.jsx)(Aa.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Ct.jsx)(Aa.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Ct.jsx)(Aa.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Ct.jsx)(Aa.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Ct.jsx)(Aa.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Ct.jsx)(Aa.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Ct.jsx)(Aa.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Ct.jsx)(Aa.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],At=[{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 Yt=[{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}],Tt=[{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}],Mt=[{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")}],Si=[...Mt,{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")}],Mi=[...At,{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}],Rt={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:[]},qa={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:Mt.filter(e=>e.epicId==="1")};var Kr={empty:{initialProjects:Rt.projects,initialEpics:Rt.epics,initialSprints:Rt.sprints,initialTasks:Rt.tasks},default:{initialProjects:At,initialEpics:Yt,initialSprints:Tt,initialTasks:Mt},highDensity:{initialProjects:At,initialEpics:Yt,initialSprints:Tt,initialTasks:Si},singleEpic:{initialProjects:At,initialEpics:qa.epics,initialSprints:Tt,initialTasks:qa.tasks},multipleProjects:{initialProjects:Mi,initialEpics:Yt,initialSprints:Tt,initialTasks:Mt}},St=[{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(De),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(De),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(De),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(De),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(De),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(De),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(De),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(De),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(De),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(De),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],_r=[{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:St.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:St.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:St.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 Jr=St.filter(e=>e.type==="digital");function _a(e,t){let[a,o]=(0,at.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),l=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,at.useEffect)(()=>{l(a)},[]),[a,l]}function ea({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:l=Ka[0],onBusinessUnitChange:r,onSearch:n,className:i,logo:p="/headerlogo.png",appName:m="Nuvia",tagline:k="Collaboration Platform"}){let[f,y]=Lt.useState({}),[T,z]=_a("sidebar-favorites",{}),[R,x]=Lt.useState(null),[A,F]=Lt.useState(""),w=d=>{y(B=>({...B,[d]:!B[d]}))},E=d=>{r?.(d)},ee=()=>{A.trim()&&n?.(A.trim())},te=d=>{d.key==="Enter"&&(d.preventDefault(),ee())},ae=(d,B)=>{let I=T[d]||[],K=I.includes(B)?I.filter(u=>u!==B):I.concat(B);z({...T,[d]:K})},Z=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let B=T[d.id]||[],I=d.items.filter(u=>B.includes(u.id)),K=d.items.filter(u=>!B.includes(u.id));return[...I,...K].slice(0,d.maxItems)},q=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,re=e,ce=d=>{let B=q(d),I=Z(d),K=(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Ct.jsx)("span",{children:d.title})]}),d.badge&&(0,Ct.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Ct.jsx)(Aa.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),u=c("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,Ct.jsx)(Zt.default,{href:d.url,className:u,onClick:a?o:void 0,children:K}):(0,Ct.jsx)("button",{className:u,onClick:()=>d.items&&w(d.title),children:K})},M=()=>{let d=e.find(I=>I.id===R);if(!d||!d.items||!d.maxItems)return null;let B=T[d.id]||[];return(0,Ct.jsx)(Va,{open:!!R,onOpenChange:I=>!I&&x(null),children:(0,Ct.jsxs)(_t,{className:"sm:max-w-md",children:[(0,Ct.jsxs)(Jt,{children:[(0,Ct.jsxs)(Xt,{children:["Manage ",d.title," Favorites"]}),(0,Ct.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,Ct.jsx)(he,{className:"max-h-96 pr-4",children:(0,Ct.jsx)("div",{className:"space-y-4",children:d.items.map(I=>(0,Ct.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ct.jsx)(Qt,{id:I.id,checked:B.includes(I.id),onCheckedChange:()=>ae(d.id,I.id),disabled:!B.includes(I.id)&&B.length>=(d.maxItems||0)}),(0,Ct.jsxs)("label",{htmlFor:I.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:[I.title,I.badge&&(0,Ct.jsx)(me,{variant:"outline",className:"text-xs",children:I.badge})]})]},I.id))})})]})})},Se=(0,Ct.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Ct.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Ct.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ct.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Ct.jsx)("img",{src:p,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Ct.jsxs)("div",{children:[(0,Ct.jsx)("h2",{className:"font-semibold",children:m}),(0,Ct.jsx)("p",{className:"text-xs text-muted-foreground",children:k})]})]}),a&&(0,Ct.jsx)(D,{variant:"ghost",size:"icon",onClick:o,children:(0,Ct.jsx)(Aa.X,{className:"h-5 w-5"})})]}),(0,Ct.jsx)("div",{className:"px-3 py-2",children:(0,Ct.jsxs)("div",{className:"relative",children:[(0,Ct.jsx)(Aa.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Ct.jsx)(ut,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:A,onChange:d=>F(d.target.value),onKeyPress:te})]})}),(0,Ct.jsx)(he,{className:"flex-1 px-3 py-2",children:(0,Ct.jsx)("div",{className:"space-y-1",children:re.map(d=>(0,Ct.jsxs)("div",{className:"mb-1",children:[ce(d),d.items&&f[d.title]&&(0,Ct.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[Z(d).map(B=>(0,Ct.jsxs)(Zt.default,{href:B.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[B.title,B.badge&&(0,Ct.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:B.badge})]},B.id)),q(d)&&d.items&&d.items.length>Z(d).length&&(0,Ct.jsxs)("button",{onClick:()=>x(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-Z(d).length," more available"]})]})]},d.id))})}),(0,Ct.jsx)("div",{className:"p-3",children:(0,Ct.jsx)("div",{className:"space-y-1",children:(0,Ct.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,Ct.jsx)(Aa.Settings,{className:"h-5 w-5"}),(0,Ct.jsx)("span",{children:"Settings"})]})})}),(0,Ct.jsx)(M,{})]});return a?(0,Ct.jsx)("div",{className:c("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",i),children:Se}):(0,Ct.jsx)("div",{className:c("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",i),children:Se})}var Ja=$(require("react")),we=$(require("@radix-ui/react-tooltip"));var ot=we.Provider,it=we.Root,rt=we.Trigger,Xe=Ja.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Ct.jsx)(we.Portal,{children:(0,Ct.jsx)(we.Content,{ref:o,sideOffset:t,className:c("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),...a})}));Xe.displayName=we.Content.displayName;var Xa=require("next-themes");function Qa(){let{setTheme:e,theme:t}=(0,Xa.useTheme)();return(0,Ct.jsx)(ot,{children:(0,Ct.jsxs)(it,{children:[(0,Ct.jsx)(rt,{asChild:!0,children:(0,Ct.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Ct.jsx)(Aa.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Ct.jsx)(Aa.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Ct.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Ct.jsx)(Xe,{children:"Toggle theme"})]})})}function Ya({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:l,className:r}){let n=e.filter(m=>!m.read),i=n.length,p=m=>{switch(m){case"info":return(0,Ct.jsx)(Aa.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Ct.jsx)(Aa.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Ct.jsx)(Aa.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Ct.jsx)(Aa.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Ct.jsx)(Ft.AnimatePresence,{children:t&&(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(Ft.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:a}),(0,Ct.jsx)(Ft.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Ct.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Ct.jsxs)("div",{className:"flex items-center justify-between border-Ct p-4",children:[(0,Ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ct.jsx)(Aa.Bell,{className:"h-5 w-5"}),(0,Ct.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,Ct.jsxs)(me,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,Ct.jsxs)(D,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Ct.jsx)(Aa.X,{className:"h-5 w-5"}),(0,Ct.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,Ct.jsxs)("div",{className:"flex items-center justify-between border-Ct p-2",children:[(0,Ct.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"Ct":""]}),(0,Ct.jsx)(D,{variant:"ghost",size:"sm",onClick:l,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,Ct.jsx)(he,{className:"flex-1",children:(0,Ct.jsx)("div",{className:"divide-y",children:n.map(m=>(0,Ct.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Ct.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:p(m.type)}),(0,Ct.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ct.jsx)("p",{className:"font-medium",children:m.title}),(0,Ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ct.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,Ct.jsx)(D,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,Ct.jsx)(Aa.Check,{className:"h-3 w-3"})})]})]}),(0,Ct.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Ct.jsxs)(D,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Ct.jsx)(Aa.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,Ct.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Ct.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Ct.jsx)(Aa.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Ct.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Ct.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Qe=$(require("@radix-ui/react-tabs"));function Za({className:e,...t}){return(0,Ct.jsx)(Qe.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function eo({className:e,...t}){return(0,Ct.jsx)(Qe.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function to({className:e,...t}){return(0,Ct.jsx)(Qe.Trigger,{"data-slot":"tabs-trigger",className:c("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 h-[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 Ue=$(require("react")),P=$(require("@radix-ui/react-dropdown-menu")),nt=require("@radix-ui/react-icons");var ao=P.Root,oo=P.Trigger;var Ii=Ue.forwardRef(({className:e,inset:t,children:a,...o},l)=>(0,Ct.jsxs)(P.SubTrigger,{ref:l,className:c("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),...o,children:[a,(0,Ct.jsx)(nt.ChevronRightIcon,{className:"ml-auto"})]}));Ii.displayName=P.SubTrigger.displayName;var Li=Ue.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(P.SubContent,{ref:a,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Li.displayName=P.SubContent.displayName;var aa=Ue.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Ct.jsx)(P.Portal,{children:(0,Ct.jsx)(P.Content,{ref:o,sideOffset:t,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));aa.displayName=P.Content.displayName;var oa=Ue.forwardRef(({className:e,inset:t,...a},o)=>(0,Ct.jsx)(P.Item,{ref:o,className:c("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),...a}));oa.displayName=P.Item.displayName;var Bi=Ue.forwardRef(({className:e,children:t,checked:a,...o},l)=>(0,Ct.jsxs)(P.CheckboxItem,{ref:l,className:c("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:a,...o,children:[(0,Ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Ct.jsx)(P.ItemIndicator,{children:(0,Ct.jsx)(nt.CheckIcon,{className:"h-4 w-4"})})}),t]}));Bi.displayName=P.CheckboxItem.displayName;var Ei=Ue.forwardRef(({className:e,children:t,...a},o)=>(0,Ct.jsxs)(P.RadioItem,{ref:o,className:c("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),...a,children:[(0,Ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Ct.jsx)(P.ItemIndicator,{children:(0,Ct.jsx)(nt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ei.displayName=P.RadioItem.displayName;var Ui=Ue.forwardRef(({className:e,inset:t,...a},o)=>(0,Ct.jsx)(P.Label,{ref:o,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Ui.displayName=P.Label.displayName;var zi=Ue.forwardRef(({className:e,...t},a)=>(0,Ct.jsx)(P.Separator,{ref:a,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));zi.displayName=P.Separator.displayName;var Fi=({className:e,...t})=>(0,Ct.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});Fi.displayName="DropdownMenuShortcut";function ro({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:l="700px",gridCols:r=6}){let n=a.find(i=>i.value===e);return(0,Ct.jsxs)(Ft.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Ct.jsx)("div",{className:"hidden lg:block",children:(0,Ct.jsx)(Za,{value:e,onValueChange:t,children:(0,Ct.jsx)(eo,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:l,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,Ct.jsx)(Ft.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Ct.jsx)(to,{value:i.value,className:"w-full h-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:i.label})},i.value))})})}),(0,Ct.jsx)("div",{className:"lg:hidden",children:(0,Ct.jsxs)(ao,{children:[(0,Ct.jsx)(oo,{asChild:!0,children:(0,Ct.jsxs)(D,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,Ct.jsx)(Aa.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Ct.jsx)(aa,{align:"center",className:"w-[180px]",children:a.map(i=>(0,Ct.jsx)(oa,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function no({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:l=!0,className:r,activeTab:n="assistant",onTabChange:i,showTabs:p=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:k,actionIcon:f=(0,Ct.jsx)(Aa.Bot,{className:"mr-2 h-4 w-4"}),actionText:y="Action",onNotificationRemove:T,onRemoveAll:z,logo:R="/headerlogo.png",appName:x="Nuvia",tagline:A="Collaboration Platform"}){let[F,w]=(0,at.useState)(!1),[E,ee]=(0,at.useState)(t),te=E.filter(q=>!q.read).length,ae=q=>{ee(re=>re.filter(ce=>ce.id!==q)),T?.(q)},Z=()=>{ee(q=>q.filter(re=>re.read)),z?.()};return(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,Ct.jsx)(D,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Ct.jsx)(Aa.Menu,{className:"h-5 w-5"})}),(0,Ct.jsx)(D,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Ct.jsx)(Aa.PanelLeft,{className:"h-5 w-5"})}),!l&&(0,Ct.jsxs)(Ft.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Ct.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Ct.jsx)("img",{src:R,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Ct.jsxs)("div",{children:[(0,Ct.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,Ct.jsx)("p",{className:"text-xs text-muted-foreground",children:A})]})]}),(0,Ct.jsxs)("div",{className:"flex flex-1 items-center",children:[p&&(0,Ct.jsx)(ro,{activeTab:n,onTabChange:i,tabOptions:m}),(0,Ct.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Ct.jsx)(Ft.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,Ct.jsx)(Ft.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ct.jsxs)(D,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:k,children:[f,y]})})}),(0,Ct.jsx)(Qa,{}),(0,Ct.jsx)(ot,{children:(0,Ct.jsxs)(it,{children:[(0,Ct.jsx)(rt,{asChild:!0,children:(0,Ct.jsx)(Ft.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ct.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>w(!0),children:[(0,Ct.jsx)(Ft.motion.div,{animate:te>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:te>0?1/0:0,repeatDelay:3},children:(0,Ct.jsx)(Aa.Bell,{className:"h-5 w-5"})}),te>0&&(0,Ct.jsx)(Ft.motion.span,{className:"absolute -right-1 -top-1 flex h-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:te})]})})}),(0,Ct.jsx)(Xe,{children:"Notifications"})]})}),(0,Ct.jsx)(Ft.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ct.jsxs)(ge,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Ct.jsx)(Ve,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Ct.jsx)(fe,{})]})})]})]})]}),(0,Ct.jsx)(Ya,{notifications:E,open:F,onClose:()=>w(!1),onNotificationRemove:ae,onRemoveAll:Z})]})}var so=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Ct.jsx)(Aa.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function co({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:l=so[0],onBusinessUnitChange:r,onSearch:n,businessUnits:i=so,activeTab:p,onTabChange:m,showTabs:k=!1,onActionClick:f,actionIcon:y,actionText:T="Action",onNotificationRemove:z,onRemoveAll:R,logo:x="/headerlogo.png",appName:A="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:w=!1}){let[E,ee]=(0,at.useState)(!w),[te,ae]=(0,at.useState)(!1),[Z,q]=(0,at.useState)(l),re=ce=>{q(ce),r?.(ce)};return(0,Ct.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[te&&(0,Ct.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>ae(!1)}),(0,Ct.jsx)("div",{className:"md:hidden",children:(0,Ct.jsx)(ea,{items:e,isOpen:te,isMobile:!0,onClose:()=>ae(!1),currentBusinessUnit:Z,onBusinessUnitChange:re,onSearch:n,logo:x,appName:A,tagline:F})}),(0,Ct.jsx)("div",{className:"hidden md:block",children:(0,Ct.jsx)(ea,{items:e,isOpen:E,isMobile:!1,currentBusinessUnit:Z,onBusinessUnitChange:re,onSearch:n,logo:x,appName:A,tagline:F})}),(0,Ct.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",E?"md:pl-64":"md:pl-0"),children:[(0,Ct.jsx)(no,{title:a,notifications:o,onToggleSidebar:()=>ee(!E),onToggleMobileMenu:()=>ae(!0),sidebarOpen:E,activeTab:p,onTabChange:m,showTabs:k,onActionClick:f,actionIcon:y,actionText:T,onNotificationRemove:z,onRemoveAll:R,logo:x,appName:A,tagline:F}),(0,Ct.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function po({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:l,onSessionEdit:r,onSessionDelete:n,className:i}){return(0,Ct.jsx)(ot,{children:(0,Ct.jsx)("div",{className:`space-y-4 h-full ${i||""}`,children:(0,Ct.jsxs)(be,{className:"shadow-sm h-full",children:[(0,Ct.jsx)("div",{className:"p-4 border-Ct",children:(0,Ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ct.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Ct.jsx)(Aa.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Ct.jsxs)(D,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,Ct.jsx)(Aa.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Ct.jsx)(he,{className:"h-[600px]",children:(0,Ct.jsx)("div",{className:"p-2",children:e.length===0?(0,Ct.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(p=>(0,Ct.jsxs)(it,{children:[(0,Ct.jsx)(rt,{asChild:!0,children:(0,Ct.jsx)("div",{className:c("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===p.id&&"bg-muted border"),onClick:()=>l(p),children:(0,Ct.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Ct.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Ct.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:p.title}),(0,Ct.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:p.lastMessage})]}),(0,Ct.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,Ct.jsx)(D,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),r(p.id)},children:(0,Ct.jsx)(Aa.Edit3,{className:"h-3 w-3"})}),n&&(0,Ct.jsx)(D,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),n(p.id)},children:(0,Ct.jsx)(Aa.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,Ct.jsx)(Xe,{side:"right",className:"max-w-xs",children:(0,Ct.jsxs)("div",{className:"space-y-1",children:[(0,Ct.jsx)("p",{className:"font-medium text-sm",children:p.title}),(0,Ct.jsx)("p",{className:"text-xs",children:p.lastMessage})]})})]},p.id))})})]})})})}var Ze=$(require("motion/react-client"));function na({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:l,colorScheme:r=qt,className:n}){let[i,p]=(0,at.useState)([]),[m,k]=(0,at.useState)([]),f=i[i.length-1],y=f?.children||e,T=(w,E)=>{switch(w.type){case"category":return r.categories[E%r.categories.length];case"list":return r.lists[E%r.lists.length];case"item":return r.items[E%r.items.length];default:return r.primary}},z=(0,at.useMemo)(()=>({path:i,selectedItems:m,filters:{}}),[i,m]);(0,at.useEffect)(()=>{l&&l(z)},[z,l]);let R=w=>{w.type==="category"||w.type==="list"?p([...i,w]):w.type==="item"&&k([...m,w])},x=()=>{p(i.slice(0,-1))},A=w=>{p(i.slice(0,w+1))},F=()=>f?.actions?f.actions:[];return t?(0,Ct.jsxs)("div",{className:c("w-full",n),children:[(0,Ct.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Ct.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,Ct.jsx)(Ft.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:x,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Ct.jsx)(Aa.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Ct.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,Ct.jsx)(Ft.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:a,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Ct.jsx)(Aa.X,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,Ct.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Ct.jsx)(Ft.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>p([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Ct.jsxs)("span",{className:"relative",children:["Capabilities",(0,Ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((w,E)=>(0,Ct.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Ct.jsx)(Aa.ChevronRight,{className:"h-2 w-2"}),(0,Ct.jsx)(Ft.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>A(E),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Ct.jsxs)("span",{className:"relative",children:[w.name,(0,Ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},w.id))]}),(0,Ct.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Ct.jsx)(Ft.AnimatePresence,{mode:"wait",children:(0,Ct.jsx)(Ft.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,Ct.jsx)(Oi,{data:f.data,onItemSelect:w=>k([...m,w]),colorScheme:r}):(0,Ct.jsx)(ji,{capabilities:y,onSelect:R,colorScheme:r})},f?.id||"root")})})]}):(0,Ct.jsxs)(D,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Ct.jsx)(Aa.Menu,{className:"h-4 w-4"}),(0,Ct.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function ji({capabilities:e,onSelect:t,colorScheme:a}){return(0,Ct.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,Ct.jsx)(Hi,{capability:o,onClick:()=>t(o),color:a.categories[l%a.categories.length]},o.id))})}function Hi({capability:e,onClick:t,selected:a,color:o}){return(0,Ct.jsxs)(Ft.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:c("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",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Ct.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Ct.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-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,Ct.jsx)(Aa.ChevronRight,{className:c("h-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,Ct.jsx)(me,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Oi({data:e,onItemSelect:t,colorScheme:a}){return(0,Ct.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,Ct.jsxs)(Ft.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:c("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(o),children:[(0,Ct.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[l%a.items.length])}),(0,Ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ct.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,Ct.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,Ct.jsx)(me,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}var mo=$(require("react"));var la=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:l="This endpoint requires authentication to sync functions."})=>{let[r,n]=(0,at.useState)(!1),[i,p]=(0,at.useState)(""),m=()=>{if(!t){p("No authentication URL provided");return}n(!0),p("");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){p("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let y=setInterval(()=>{try{f.closed&&(clearInterval(y),n(!1),o(),a())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(y),n(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),n(!1)}},k=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,Ct.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Ct.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Ct.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Ct.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l}),i&&(0,Ct.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,Ct.jsxs)("div",{className:"flex gap-2",children:[(0,Ct.jsx)("button",{onClick:m,disabled:r||!t,className:`
9
9
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
10
10
  ${r||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
11
- `,children:r?"Authenticating...":"Authenticate"}),(0,xt.jsx)("button",{onClick:P,disabled:!t,className:`
11
+ `,children:r?"Authenticating...":"Authenticate"}),(0,Ct.jsx)("button",{onClick:k,disabled:!t,className:`
12
12
  px-4 py-2 text-white border-none rounded text-sm
13
13
  ${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
14
- `,children:"Copy URL"}),(0,xt.jsx)("button",{onClick:a,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var so=({toolPart:e,index:t,addToolResult:a})=>{let[o,s]=no.default.useState(!0),r=()=>{a(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,xt.jsxs)("div",{className:"mb-2",children:[(0,xt.jsx)(ro,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:r,description:e.output?.reason||e.input?.reason}),!o&&(0,xt.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,xt.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,xt.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,xt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,xt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var lo=require("marked"),co=$(require("react-markdown"));function Ui(e){return lo.marked.lexer(e).map(a=>a.raw)}var mo=(0,et.memo)(({content:e})=>(0,xt.jsx)(co.default,{children:e}),(e,t)=>e.content===t.content);mo.displayName="MemoizedMarkdownBlock";var na=(0,et.memo)(({content:e,id:t})=>(0,et.useMemo)(()=>Ui(e),[e]).map((o,s)=>(0,xt.jsx)(mo,{content:o},`${t}-block_${s}`)));na.displayName="PartText";function Et({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:s,fileUploads:r,isDragOver:l,enableFileUpload:i,onInputChange:m,addToolResult:u,onSendMessage:P,onKeyPress:f,onFileUpload:y,onRemoveFile:T,onDragOver:z,className:R}){let x=(0,et.useRef)(null),S=(0,et.useRef)(null),F=(0,et.useRef)(null),[w,E]=(0,et.useState)(!1),[Z,ee]=(0,et.useState)({path:[],selectedItems:[],filters:{}});(0,et.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,et.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let te=()=>Nt(Z),Y=()=>{let p=[];return s.forEach(j=>{j.actions&&j.actions.forEach(q=>{p.push({label:q.label,action:()=>K(q.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(q=>{q.type==="list"&&q.data&&p.push({label:`View ${q.name}`,action:()=>E(!0)})})}),p.slice(0,5)},K=(p,j)=>{console.log("Capability action:",p,j);let q=`Executing ${p} with context: ${JSON.stringify(j.path.map(L=>L.name))}`;E(!1)},oe=Nt({path:[],selectedItems:[],filters:{}}),le=p=>{y(p.target.files),p.target.files&&(p.target.value="")},A=p=>{p.preventDefault(),z(!0)},Se=p=>{p.preventDefault(),z(!1)},d=p=>{p.preventDefault(),z(!1),y(p.dataTransfer.files)},B=p=>{if(p===0)return"0 Bytes";let j=1024,q=["Bytes","KB","MB","GB"],L=Math.floor(Math.log(p)/Math.log(j));return parseFloat((p/Math.pow(j,L)).toFixed(2))+" "+q[L]},M=p=>p.startsWith("image/")?(0,xt.jsx)(Na.Image,{className:"h-4 w-4"}):p.startsWith("text/")?(0,xt.jsx)(Na.FileText,{className:"h-4 w-4"}):(0,xt.jsx)(Na.File,{className:"h-4 w-4"}),_=p=>{let j=p.role==="assistant",q=p.role==="user";return(0,xt.jsxs)("div",{className:c("flex items-start gap-3",q?"flex-row-reverse":""),children:[(0,xt.jsx)(ue,{className:"h-8 w-8 shrink-0",children:(0,xt.jsx)(ge,{className:c(q?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:q?(0,xt.jsx)(Na.User,{className:"h-4 w-4"}):(0,xt.jsx)(Na.Bot,{className:"h-4 w-4"})})}),(0,xt.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",q?"bg-primary text-primary-foreground":"bg-muted"),children:p.parts.map((L,ie)=>{if(L.type==="text")return(0,xt.jsx)(na,{id:p.id,content:L.text},`${p.id}-text`);if(L.type==="file"){let k=L;return(0,xt.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,xt.jsxs)("div",{className:"flex items-center gap-2",children:[M(k.mediaType||"application/octet-stream"),(0,xt.jsx)("div",{className:"flex-1 min-w-0",children:(0,xt.jsx)("p",{className:"text-sm font-medium truncate",children:k.filename||k.url?.split("/").pop()||"File"})}),k.url&&(0,xt.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(k.url,"_blank"),className:"h-8 w-8 p-0",children:(0,xt.jsx)(Na.Download,{className:"h-4 w-4"})})]})},ie)}if(L.type.startsWith("tool-")){let k=L,Ne=L.type.replace("tool-","");if(Ne==="task")switch(k.state){case"input-available":return(0,xt.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},ie);case"output-available":return(0,xt.jsx)("div",{className:"mb-2",children:(0,xt.jsx)(dt,{data:{id:k.output?.id||k.input?.id,fetchLatest:!1,taskData:k.output||k.input}})},ie);case"output-error":return(0,xt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},ie);default:return null}if(L.type==="tool-requestEndpointLogin")return(0,xt.jsx)("div",{className:"mb-2",children:(0,xt.jsx)(so,{toolPart:k,index:ie,addToolResult:u??(()=>{})})},ie);if(Ne==="artefact")switch(k.state){case"input-available":return(0,xt.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},ie);case"output-available":return(0,xt.jsx)("div",{className:"mb-2",children:(0,xt.jsx)($t,{artefact:k.output?.description||"",taskId:k.output?.id||k.input?.id,taskData:k.output||k.input})},ie);case"output-error":return(0,xt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},ie);default:return null}return(0,xt.jsx)("div",{className:"mb-2",children:(0,xt.jsxs)(fe,{className:"w-full max-w-md",children:[(0,xt.jsx)(Be,{children:(0,xt.jsx)(Le,{className:"text-lg",children:Ne})}),(0,xt.jsxs)(ke,{children:[k.state==="input-available"&&(0,xt.jsxs)("p",{className:"text-sm",children:["Processing ",Ne,"..."]}),k.state==="output-available"&&(0,xt.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.output,null,2)}),k.state==="output-error"&&(0,xt.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",k.errorText]})]})]})},ie)}if(L.type.startsWith("data-")){let k=L,Ne=L.type.replace("data-","");return Ne==="reference"?(0,xt.jsx)("div",{className:"mb-2",children:(0,xt.jsx)(fe,{className:"w-full",children:(0,xt.jsx)(ke,{className:"p-4",children:(0,xt.jsx)("div",{className:"space-y-2",children:k.data?.references?.map((ce,Ae)=>(0,xt.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,xt.jsx)(me,{variant:"outline",children:ce.type||"link"}),(0,xt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,xt.jsx)("p",{className:"text-sm font-medium truncate",children:ce.title}),ce.description&&(0,xt.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:ce.description})]}),ce.url&&(0,xt.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(ce.url,"_blank"),className:"h-8 w-8 p-0",children:(0,xt.jsx)(Na.ExternalLink,{className:"h-4 w-4"})})]},Ae))})})})},ie):Ne==="menu"?(0,xt.jsx)("div",{className:"mb-2",children:(0,xt.jsxs)(fe,{className:"w-full",children:[(0,xt.jsx)(Be,{children:(0,xt.jsx)(Le,{className:"text-lg",children:k.data?.title})}),(0,xt.jsx)(ke,{children:(0,xt.jsx)("div",{className:"space-y-2",children:k.data?.items?.map((ce,Ae)=>(0,xt.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:ce.action,children:(0,xt.jsxs)("div",{className:"text-left",children:[(0,xt.jsx)("p",{className:"font-medium",children:ce.label}),ce.description&&(0,xt.jsx)("p",{className:"text-xs text-muted-foreground",children:ce.description})]})},Ae))})})]})},ie):(0,xt.jsx)("div",{className:"mb-2",children:(0,xt.jsxs)(fe,{className:"w-full max-w-md",children:[(0,xt.jsx)(Be,{children:(0,xt.jsx)(Le,{className:"text-lg",children:Ne})}),(0,xt.jsx)(ke,{children:(0,xt.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.data,null,2)})})]})},ie)}return null})})]})};return(0,xt.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${R||""}`,children:[(0,xt.jsxs)(ve,{ref:S,className:"flex-1 p-4 bg-background border-0",onDragOver:A,onDragLeave:Se,onDrop:d,children:[(0,xt.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,xt.jsx)(Qe.animate,{children:e.map(p=>(0,xt.jsx)(Qe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",p.role==="user"?"flex-row-reverse":"flex-row"),children:_(p)},p.id))}),w&&(0,xt.jsxs)(Qe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,xt.jsx)(ue,{className:"h-8 w-8",children:(0,xt.jsx)(ge,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,xt.jsx)(Na.Bot,{className:"h-4 w-4"})})}),(0,xt.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,xt.jsx)(ia,{capabilities:s,isOpen:w,onToggle:()=>E(!w),onActionSelect:K,className:"w-full"})})]}),a&&(0,xt.jsxs)(Qe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,xt.jsx)(ue,{className:"h-8 w-8",children:(0,xt.jsx)(ge,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,xt.jsx)(Na.Bot,{className:"h-4 w-4"})})}),(0,xt.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,xt.jsxs)("div",{className:"flex space-x-1",children:[(0,xt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,xt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,xt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,xt.jsx)("div",{ref:x})]}),r.length>0&&(0,xt.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,xt.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(p=>(0,xt.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[M(p.file.type),(0,xt.jsx)("span",{className:"text-sm font-medium",children:p.file.name}),(0,xt.jsx)("span",{className:"text-xs text-muted-foreground",children:B(p.file.size)}),(0,xt.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>T(p.id),className:"h-6 w-6 p-0",children:(0,xt.jsx)(Na.xt,{className:"h-4 w-4"})})]},p.id))})}),(0,xt.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,xt.jsxs)("div",{className:"flex gap-3",children:[(0,xt.jsx)(mt,{value:t,onChange:p=>m(p.target.value),onKeyPress:f,placeholder:"How can xt help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,xt.jsx)(D,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,xt.jsx)(Na.Paperclip,{className:"h-4 w-4"})}),(0,xt.jsx)(D,{onClick:P,disabled:!t.trim()&&r.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,xt.jsx)(Na.Send,{className:"h-4 w-4"})})]}),(0,xt.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,xt.jsxs)(D,{onClick:()=>E(!w),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,xt.jsx)(Na.Menu,{className:"h-3 w-3 mr-1"}),w?"Hide":"Show"," Capabilities"]}),(0,xt.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[te().map((p,j)=>(0,xt.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>K(p.id,Z),children:p.label},`context-${p.id}`)),te().length===0&&Y().map((p,j)=>(0,xt.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:p.action,children:p.label},`suggestion-${j}`))]})]}),i&&(0,xt.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:le,className:"hidden"})]})]})}function zi({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:s=[],capabilities:r=[],sidebarItems:l=[],notifications:i=[],sessions:m=[],onNewChat:u,onSessionSelect:P,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:T=()=>{},onNotificationRemove:z=()=>{},onRemoveAll:R=()=>{},onActionClick:x=()=>{},onSearch:S=B=>console.log("Search query:",B),initialTeam:F="design",currentSession:w=null,showCapabilities:E=!0,title:Z="Digital Colleagues",enableFileUpload:ee=!0,maxFileSize:te=10,allowedFileTypes:Y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:K="/headerlogo.png",appName:oe="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:A=(0,xt.jsx)(Na.Users,{className:"mr-2 h-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let B={...e,onError:H=>{_?.setMessages(de=>[...de,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:H.message}]}]),console.error("Error in CopilotInterface:",H)}},M=(0,po.useChat)(B||{}),_=a?t||M:null,[p,j]=(0,et.useState)(""),[q,L]=(0,et.useState)(!1),ie=_?.messages||o,k=p,Ne=_?.status==="submitted"||q,ce=_?.addToolResult?(H,de,re)=>{_.addToolResult({tool:de,toolCallId:H,output:re}),_.sendMessage()}:()=>{},Ae=s||[],go={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"},[fo,bo]=(0,et.useState)(()=>Ae.length===0?go:Ae.find(H=>H.id===F)||Ae[0]),[nt,bt]=(0,et.useState)([]),[vo,ho]=(0,et.useState)(!1),yo=H=>{if(!H||!ee)return;let de=[];Array.from(H).forEach(re=>{if(re.size>te*1024*1024){alert(`File ${re.name} is too large. Maximum size is ${te}MB.`);return}if(Y.length>0&&!Y.some(vt=>re.type.match(vt))){alert(`File type ${re.type} is not allowed.`);return}let ca={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:re,status:"pending",progress:0};if(re.type.startsWith("image/")){let vt=new FileReader;vt.onload=ko=>{bt(Po=>Po.map(zt=>zt.id===ca.id?{...zt,preview:ko.target?.result}:zt))},vt.readAsDataURL(re)}de.push(ca)}),bt(re=>[...re,...de])},xo=H=>{bt(de=>de.filter(re=>re.id!==H))},la=()=>{if(!(!k.trim()&&nt.length===0)){if(_){let H=nt.length>0?wo(nt.map(de=>de.file)):void 0;_.sendMessage({text:k,files:H},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",k),console.log("Files to upload:",nt),j(""),L(!0),setTimeout(()=>{L(!1)},1500);bt([])}},wo=H=>{let de=new DataTransfer;return H.forEach(re=>de.items.add(re)),de.files},Co=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),la())},No=H=>{j(H)};return(0,xt.jsx)(oo,{sidebarItems:l||[],title:Z,notifications:i||[],businessUnits:Ae,currentBusinessUnit:fo,onBusinessUnitChange:H=>{H&&(bo(H),T?.(H))},onSearch:S,showTabs:!1,onActionClick:x,actionIcon:A,actionText:Se,onNotificationRemove:z,onRemoveAll:R,logo:K,appName:oe,tagline:le,sidebarInitiallyClosed:d,children:(0,xt.jsx)(Ut.AnimatePresence,{mode:"wait",children:(0,xt.jsx)(Ut.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,xt.jsxs)("div",{className:"h-full flex",children:[(0,xt.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,xt.jsx)(io,{sessions:m||[],currentSession:w,teams:Ae,onNewChat:u,onSessionSelect:P,onSessionEdit:y,onSessionDelete:f})}),(0,xt.jsx)("div",{className:"flex-1 h-full p-2",children:(0,xt.jsx)(Et,{messages:ie||[],input:k,isTyping:Ne,currentSessionTitle:w?.title,capabilities:r||[],onInputChange:No,addToolResult:ce,onSendMessage:la,onKeyPress:Co,fileUploads:nt,isDragOver:vo,enableFileUpload:ee,onFileUpload:yo,onRemoveFile:xo,onDragOver:ho})})]})},"chat-interface")})})}function Fi(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function ji(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function Hi(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function Oi(e){return e.parts.some(t=>t.type==="file")}function Vi(e){return e.parts.filter(t=>t.type==="file")}function Gi(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function Wi(e,t){return e.parts.find(a=>a.type===`data-${t}`)}0&&(module.exports={CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,CopilotInterface,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities});
14
+ `,children:"Copy URL"}),(0,Ct.jsx)("button",{onClick:a,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var ca=({toolPart:e,index:t,addToolResult:a})=>{let[o,l]=mo.default.useState(!0),r=()=>{a(e.input?.toolCallId,e.input?.tool,"Authentication completed"),l(!1)};switch(e.state){case"input-available":return(0,Ct.jsxs)("div",{className:"mb-2",children:[(0,Ct.jsx)(la,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>l(!1),onSuccess:r,description:e.output?.reason||e.input?.reason}),!o&&(0,Ct.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ct.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,Ct.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ct.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Ct.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var uo=require("marked"),go=$(require("react-markdown"));function Vi(e){return uo.marked.lexer(e).map(a=>a.raw)}var fo=(0,at.memo)(({content:e})=>(0,Ct.jsx)(go.default,{children:e}),(e,t)=>e.content===t.content);fo.displayName="MemoizedMarkdownBlock";var da=(0,at.memo)(({content:e,id:t})=>(0,at.useMemo)(()=>Vi(e),[e]).map((o,l)=>(0,Ct.jsx)(fo,{content:o},`${t}-block_${l}`)));da.displayName="PartText";var ua=$(require("react"));var ma=({isOpen:e=!0,reason:t,onClose:a,onApprove:o,onDeny:l,title:r="Approval Required"})=>{let[n,i]=(0,at.useState)(!1),p=()=>{i(!0),o(),a()},m=()=>{i(!0),l(),a()},k=()=>{i(!0),l(),a()};return e?(0,Ct.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,Ct.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:r}),(0,Ct.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Ct.jsxs)("div",{className:"flex gap-2",children:[(0,Ct.jsx)("button",{onClick:p,disabled:n,className:`
15
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
16
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
17
+ `,children:n?"Processing...":"Approve"}),(0,Ct.jsx)("button",{onClick:m,disabled:n,className:`
18
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
19
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
20
+ `,children:n?"Processing...":"Deny"}),(0,Ct.jsx)("button",{onClick:k,disabled:n,className:`
21
+ px-4 py-2 text-white border-none rounded text-sm
22
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
23
+ `,children:"Cancel"})]})]}):null};var vo=({toolPart:e,index:t,addToolResult:a})=>{let[o,l]=ua.default.useState(!0),[r,n]=ua.default.useState(null),i=()=>{a(e.input?.toolCallId,e.input?.tool,"Approved"),l(!1),n("approve")},p=()=>{a(e.input?.toolCallId,e.input?.tool,"Denied"),l(!1),n("deny")};switch(e.state){case"input-available":return(0,Ct.jsxs)("div",{className:"mb-2",children:[(0,Ct.jsx)(ma,{isOpen:o,onApprove:i,onDeny:p,onClose:()=>l(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,Ct.jsxs)(Ct.Fragment,{children:[r==="approve"&&(0,Ct.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ct.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,Ct.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ct.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),r==="deny"&&(0,Ct.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ct.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,Ct.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ct.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Ct.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};function zt({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:l,fileUploads:r,isDragOver:n,enableFileUpload:i,onInputChange:p,addToolResult:m,onSendMessage:k,onKeyPress:f,onFileUpload:y,onRemoveFile:T,onDragOver:z,className:R}){let x=(0,at.useRef)(null),A=(0,at.useRef)(null),F=(0,at.useRef)(null),[w,E]=(0,at.useState)(!1),[ee,te]=(0,at.useState)({path:[],selectedItems:[],filters:{}});(0,at.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,at.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let ae=()=>Pt(ee),Z=()=>{let u=[];return l.forEach(j=>{j.actions&&j.actions.forEach(_=>{u.push({label:_.label,action:()=>q(_.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(_=>{_.type==="list"&&_.data&&u.push({label:`View ${_.name}`,action:()=>E(!0)})})}),u.slice(0,5)},q=(u,j)=>{console.log("Capability action:",u,j);let _=`Executing ${u} with context: ${JSON.stringify(j.path.map(S=>S.name))}`;E(!1)},re=Pt({path:[],selectedItems:[],filters:{}}),ce=u=>{y(u.target.files),u.target.files&&(u.target.value="")},M=u=>{u.preventDefault(),z(!0)},Se=u=>{u.preventDefault(),z(!1)},d=u=>{u.preventDefault(),z(!1),y(u.dataTransfer.files)},B=u=>{if(u===0)return"0 Bytes";let j=1024,_=["Bytes","KB","MB","GB"],S=Math.floor(Math.log(u)/Math.log(j));return parseFloat((u/Math.pow(j,S)).toFixed(2))+" "+_[S]},I=u=>u.startsWith("image/")?(0,Ct.jsx)(Aa.Image,{className:"h-4 w-4"}):u.startsWith("text/")?(0,Ct.jsx)(Aa.FileText,{className:"h-4 w-4"}):(0,Ct.jsx)(Aa.File,{className:"h-4 w-4"}),K=u=>{let j=u.role==="assistant",_=u.role==="user";return(0,Ct.jsxs)("div",{className:c("flex my-2 items-start gap-3",_?"flex-row-reverse":""),children:[(0,Ct.jsx)(ge,{className:"h-8 w-8 shrink-0",children:(0,Ct.jsx)(fe,{className:c(_?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:_?(0,Ct.jsx)(Aa.User,{className:"h-4 w-4"}):(0,Ct.jsx)(Aa.Bot,{className:"h-4 w-4"})})}),(0,Ct.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",_?"bg-primary text-primary-foreground":"bg-muted"),children:u.parts.map((S,J)=>{if(S.type==="text")return(0,Ct.jsx)(da,{id:u.id,content:S.text},`${u.id}-text`);if(S.type==="file"){let N=S;return(0,Ct.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Ct.jsxs)("div",{className:"flex items-center gap-2",children:[I(N.mediaType||"application/octet-stream"),(0,Ct.jsx)("div",{className:"flex-1 min-w-0",children:(0,Ct.jsx)("p",{className:"text-sm font-medium truncate",children:N.filename||N.url?.split("/").pop()||"File"})}),N.url&&(0,Ct.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(N.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Ct.jsx)(Aa.Download,{className:"h-4 w-4"})})]})},J)}if(S.type.startsWith("tool-")){let N=S,ke=S.type.replace("tool-","");if(ke==="task")switch(N.state){case"input-available":return(0,Ct.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},J);case"output-available":return(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsx)(mt,{data:{id:N.output?.id||N.input?.id,fetchLatest:!1,taskData:N.output||N.input}})},J);case"output-error":return(0,Ct.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},J);default:return null}if(S.type==="tool-requestEndpointLogin")return(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsx)(ca,{toolPart:N,index:J,addToolResult:m??(()=>{})})},J);if(S.type==="tool-authenticate")return(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsx)(ca,{toolPart:N,index:J,addToolResult:m??(()=>{})})},J);if(S.type==="tool-requestApproval")return(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsx)(vo,{toolPart:N,index:J,addToolResult:m??(()=>{})})},J);if(ke==="artefact")switch(N.state){case"input-available":return(0,Ct.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},J);case"output-available":return(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsx)(Kt,{artefact:N.output?.description||"",taskId:N.output?.id||N.input?.id,taskData:N.output||N.input})},J);case"output-error":return(0,Ct.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},J);default:return null}return(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsxs)(be,{className:"w-full max-w-md",children:[(0,Ct.jsx)(Be,{children:(0,Ct.jsx)(Ee,{className:"text-lg",children:ke})}),(0,Ct.jsxs)(Pe,{children:[N.state==="input-available"&&(0,Ct.jsxs)("p",{className:"text-sm",children:["Processing ",ke,"..."]}),N.state==="output-available"&&(0,Ct.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.output,null,2)}),N.state==="output-error"&&(0,Ct.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",N.errorText]})]})]})},J)}if(S.type.startsWith("data-")){let N=S,ke=S.type.replace("data-","");return ke==="reference"?(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsx)(be,{className:"w-full",children:(0,Ct.jsx)(Pe,{className:"p-4",children:(0,Ct.jsx)("div",{className:"space-y-2",children:N.data?.references?.map((de,Me)=>(0,Ct.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Ct.jsx)(me,{variant:"outline",children:de.type||"link"}),(0,Ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ct.jsx)("p",{className:"text-sm font-medium truncate",children:de.title}),de.description&&(0,Ct.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:de.description})]}),de.url&&(0,Ct.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(de.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Ct.jsx)(Aa.ExternalLink,{className:"h-4 w-4"})})]},Me))})})})},J):ke==="menu"?(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsxs)(be,{className:"w-full",children:[(0,Ct.jsx)(Be,{children:(0,Ct.jsx)(Ee,{className:"text-lg",children:N.data?.title})}),(0,Ct.jsx)(Pe,{children:(0,Ct.jsx)("div",{className:"space-y-2",children:N.data?.items?.map((de,Me)=>(0,Ct.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:de.action,children:(0,Ct.jsxs)("div",{className:"text-left",children:[(0,Ct.jsx)("p",{className:"font-medium",children:de.label}),de.description&&(0,Ct.jsx)("p",{className:"text-xs text-muted-foreground",children:de.description})]})},Me))})})]})},J):(0,Ct.jsx)("div",{className:"mb-2",children:(0,Ct.jsxs)(be,{className:"w-full max-w-md",children:[(0,Ct.jsx)(Be,{children:(0,Ct.jsx)(Ee,{className:"text-lg",children:ke})}),(0,Ct.jsx)(Pe,{children:(0,Ct.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.data,null,2)})})]})},J)}return null})})]})};return(0,Ct.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${R||""}`,children:[(0,Ct.jsxs)(he,{ref:A,className:"flex-1 p-4 bg-background border-0",onDragOver:M,onDragLeave:Se,onDrop:d,children:[(0,Ct.jsxs)("div",{className:c("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Ct.jsx)(Ze.animate,{children:e.map(u=>(0,Ct.jsx)(Ze.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",u.role==="user"?"flex-row-reverse":"flex-row"),children:K(u)},u.id))}),w&&(0,Ct.jsxs)(Ze.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Ct.jsx)(ge,{className:"h-8 w-8",children:(0,Ct.jsx)(fe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Ct.jsx)(Aa.Bot,{className:"h-4 w-4"})})}),(0,Ct.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Ct.jsx)(na,{capabilities:l,isOpen:w,onToggle:()=>E(!w),onActionSelect:q,className:"w-full"})})]}),a&&(0,Ct.jsxs)(Ze.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Ct.jsx)(ge,{className:"h-8 w-8",children:(0,Ct.jsx)(fe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Ct.jsx)(Aa.Bot,{className:"h-4 w-4"})})}),(0,Ct.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Ct.jsxs)("div",{className:"flex space-x-1",children:[(0,Ct.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Ct.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Ct.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Ct.jsx)("div",{ref:x})]}),r.length>0&&(0,Ct.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Ct.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(u=>(0,Ct.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[I(u.file.type),(0,Ct.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Ct.jsx)("span",{className:"text-xs text-muted-foreground",children:B(u.file.size)}),(0,Ct.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>T(u.id),className:"h-6 w-6 p-0",children:(0,Ct.jsx)(Aa.X,{className:"h-4 w-4"})})]},u.id))})}),(0,Ct.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Ct.jsxs)("div",{className:"flex gap-3",children:[(0,Ct.jsx)(ut,{value:t,onChange:u=>p(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,Ct.jsx)(D,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Ct.jsx)(Aa.Paperclip,{className:"h-4 w-4"})}),(0,Ct.jsx)(D,{onClick:k,disabled:!t.trim()&&r.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Ct.jsx)(Aa.Send,{className:"h-4 w-4"})})]}),(0,Ct.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Ct.jsxs)(D,{onClick:()=>E(!w),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Ct.jsx)(Aa.Menu,{className:"h-3 w-3 mr-1"}),w?"Hide":"Show"," Capabilities"]}),(0,Ct.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ae().map((u,j)=>(0,Ct.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>q(u.id,ee),children:u.label},`context-${u.id}`)),ae().length===0&&Z().map((u,j)=>(0,Ct.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${j}`))]})]}),i&&(0,Ct.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:ce,className:"hidden"})]})]})}function $i({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:l=[],capabilities:r=[],sidebarItems:n=[],notifications:i=[],sessions:p=[],onNewChat:m,onSessionSelect:k,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:T=()=>{},onNotificationRemove:z=()=>{},onRemoveAll:R=()=>{},onActionClick:x=()=>{},onSearch:A=B=>console.log("Search query:",B),initialTeam:F="design",currentSession:w=null,showCapabilities:E=!0,title:ee="Digital Colleagues",enableFileUpload:te=!0,maxFileSize:ae=10,allowedFileTypes:Z=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:q="/headerlogo.png",appName:re="Nuvia",tagline:ce="AI-Powered Workspace",actionIcon:M=(0,Ct.jsx)(Aa.Users,{className:"mr-2 h-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let B={...e,onError:H=>{K?.setMessages(pe=>[...pe,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:H.message}]}]),console.error("Error in CopilotInterface:",H)}},I=(0,ho.useChat)(B||{}),K=a?t||I:null,[u,j]=(0,at.useState)(""),[_,S]=(0,at.useState)(!1),J=K?.messages||o,N=u,ke=K?.status==="submitted"||_,de=K?.addToolResult?(H,pe,ne)=>{K.addToolResult({tool:pe,toolCallId:H,output:ne}),K.sendMessage()}:()=>{},Me=l||[],xo={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"},[wo,Co]=(0,at.useState)(()=>Me.length===0?xo:Me.find(H=>H.id===F)||Me[0]),[lt,ht]=(0,at.useState)([]),[No,ko]=(0,at.useState)(!1),Po=H=>{if(!H||!te)return;let pe=[];Array.from(H).forEach(ne=>{if(ne.size>ae*1024*1024){alert(`File ${ne.name} is too large. Maximum size is ${ae}MB.`);return}if(Z.length>0&&!Z.some(yt=>ne.type.match(yt))){alert(`File type ${ne.type} is not allowed.`);return}let fa={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ne,status:"pending",progress:0};if(ne.type.startsWith("image/")){let yt=new FileReader;yt.onload=So=>{ht(Mo=>Mo.map(jt=>jt.id===fa.id?{...jt,preview:So.target?.result}:jt))},yt.readAsDataURL(ne)}pe.push(fa)}),ht(ne=>[...ne,...pe])},Do=H=>{ht(pe=>pe.filter(ne=>ne.id!==H))},ga=()=>{if(!(!N.trim()&&lt.length===0)){if(K){let H=lt.length>0?To(lt.map(pe=>pe.file)):void 0;K.sendMessage({text:N,files:H},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",N),console.log("Files to upload:",lt),j(""),S(!0),setTimeout(()=>{S(!1)},1500);ht([])}},To=H=>{let pe=new DataTransfer;return H.forEach(ne=>pe.items.add(ne)),pe.files},Ro=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),ga())},Ao=H=>{j(H)};return(0,Ct.jsx)(co,{sidebarItems:n||[],title:ee,notifications:i||[],businessUnits:Me,currentBusinessUnit:wo,onBusinessUnitChange:H=>{H&&(Co(H),T?.(H))},onSearch:A,showTabs:!1,onActionClick:x,actionIcon:M,actionText:Se,onNotificationRemove:z,onRemoveAll:R,logo:q,appName:re,tagline:ce,sidebarInitiallyClosed:d,children:(0,Ct.jsx)(Ft.AnimatePresence,{mode:"wait",children:(0,Ct.jsx)(Ft.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Ct.jsxs)("div",{className:"h-full flex",children:[(0,Ct.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Ct.jsx)(po,{sessions:p||[],currentSession:w,teams:Me,onNewChat:m,onSessionSelect:k,onSessionEdit:y,onSessionDelete:f})}),(0,Ct.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Ct.jsx)(zt,{messages:J||[],input:N,isTyping:ke,currentSessionTitle:w?.title,capabilities:r||[],onInputChange:Ao,addToolResult:de,onSendMessage:ga,onKeyPress:Ro,fileUploads:lt,isDragOver:No,enableFileUpload:te,onFileUpload:Po,onRemoveFile:Do,onDragOver:ko})})]})},"chat-interface")})})}function Wi(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function Gi(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function qi(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function Ki(e){return e.parts.some(t=>t.type==="file")}function _i(e){return e.parts.filter(t=>t.type==="file")}function Ji(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function Xi(e,t){return e.parts.find(a=>a.type===`data-${t}`)}0&&(module.exports={ApprovalRequestModal,CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,CopilotInterface,OAuthModal,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities});