cortex-react-components 1.65.0 → 1.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ILBKV7ZM.mjs → chunk-2VOU42KD.mjs} +1 -1
- package/dist/{chunk-PADGOK5C.mjs → chunk-37NBXA5G.mjs} +1 -1
- package/dist/{chunk-PFWODHNV.mjs → chunk-3AUTMBDB.mjs} +1 -1
- package/dist/{chunk-3UA62APP.mjs → chunk-5ALQQYYE.mjs} +1 -1
- package/dist/{chunk-4GL57G4E.mjs → chunk-5J244QX4.mjs} +1 -1
- package/dist/{chunk-4A43BI3C.mjs → chunk-65BHP4TM.mjs} +1 -1
- package/dist/{chunk-SKQYQ4SD.mjs → chunk-737CTHXW.mjs} +1 -1
- package/dist/{chunk-ROEJPYRW.mjs → chunk-77KWI6EL.mjs} +1 -1
- package/dist/{chunk-N363IQBL.mjs → chunk-ANTK5LAD.mjs} +1 -1
- package/dist/{chunk-YZ47PIHK.mjs → chunk-B7STYVDB.mjs} +1 -1
- package/dist/{chunk-Y6RAHEXF.mjs → chunk-CDJP2IDQ.mjs} +1 -1
- package/dist/{chunk-5OMUHSTO.mjs → chunk-CJF6GVGP.mjs} +1 -1
- package/dist/{chunk-TASJS6US.mjs → chunk-COI2LCY2.mjs} +1 -1
- package/dist/{chunk-STHWCR5K.mjs → chunk-DIAK5C43.mjs} +1 -1
- package/dist/{chunk-BYSEFJFA.mjs → chunk-DVGPU4EL.mjs} +1 -1
- package/dist/{chunk-XDLNQPZY.mjs → chunk-EVVDCPEA.mjs} +1 -1
- package/dist/{chunk-DJQUKJMH.mjs → chunk-FN5C27GW.mjs} +1 -1
- package/dist/{chunk-APNL5YEF.mjs → chunk-FSYU3D5O.mjs} +1 -1
- package/dist/{chunk-I5DSZMH2.mjs → chunk-GHXEOXV4.mjs} +1 -1
- package/dist/{chunk-3XV6OBSL.mjs → chunk-IH37BDR2.mjs} +1 -1
- package/dist/chunk-IPVKFQEY.mjs +4 -0
- package/dist/{chunk-ZJSR6A6I.mjs → chunk-JLCWVIEP.mjs} +1 -1
- package/dist/{chunk-AKH3ER3D.mjs → chunk-KEM3XJKI.mjs} +1 -1
- package/dist/{chunk-6OS3ZJBB.mjs → chunk-KGSTIGCT.mjs} +1 -1
- package/dist/{chunk-E7W2GFKO.mjs → chunk-L45A6K4C.mjs} +1 -1
- package/dist/{chunk-WSKZ2N7J.mjs → chunk-L5MDFQGH.mjs} +1 -1
- package/dist/{chunk-33ZXPMQU.mjs → chunk-MQRRCCAR.mjs} +1 -1
- package/dist/{chunk-VNGK6ACI.mjs → chunk-MRJQKF4Z.mjs} +1 -1
- package/dist/{chunk-IDRYG7HP.mjs → chunk-MUBDAI2K.mjs} +1 -1
- package/dist/{chunk-R64KZZJP.mjs → chunk-NP2M5K7O.mjs} +1 -1
- package/dist/{chunk-L7FUS5TO.mjs → chunk-NUQ6Z3WQ.mjs} +1 -1
- package/dist/{chunk-5DJ7VOAO.mjs → chunk-OMVXDUX7.mjs} +1 -1
- package/dist/{chunk-BGQKHEB3.mjs → chunk-QUOLG5NC.mjs} +1 -1
- package/dist/{chunk-ZYYWN6XG.mjs → chunk-SUO6GOJS.mjs} +1 -1
- package/dist/{chunk-IISHIQBQ.mjs → chunk-T5W5LMEK.mjs} +1 -1
- package/dist/{chunk-NVN7UJT6.mjs → chunk-T6W76EOH.mjs} +1 -1
- package/dist/{chunk-YWUPEMYN.mjs → chunk-U7Q6ZRR3.mjs} +1 -1
- package/dist/{chunk-2ELJOFU3.mjs → chunk-UDQTFQR7.mjs} +1 -1
- package/dist/chunk-URPKAQGD.mjs +1 -0
- package/dist/{chunk-ERUB6LU6.mjs → chunk-VGQTRTPZ.mjs} +1 -1
- package/dist/{chunk-T6FBWMZR.mjs → chunk-WKFNZUIR.mjs} +1 -1
- package/dist/{chunk-AN6TXGAM.mjs → chunk-WPL2QWNG.mjs} +1 -1
- package/dist/{chunk-U5XA76PE.mjs → chunk-X4Q7WZZS.mjs} +1 -1
- package/dist/{chunk-3QWSFRVM.mjs → chunk-YGFSXGAJ.mjs} +1 -1
- package/dist/{chunk-EGYV6SU2.mjs → chunk-YPK6OLRS.mjs} +1 -1
- package/dist/{chunk-6BOIU52Z.mjs → chunk-ZAXQ74I3.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CallToAction.stories.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.stories.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/Content.stories.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/CogeBoard.js +1 -1
- package/dist/components/CRM/CogeBoard.mjs +1 -1
- package/dist/components/CRM/CogeBoard.stories.js +1 -1
- package/dist/components/CRM/CogeBoard.stories.mjs +1 -1
- package/dist/components/CRM/DealDetails.js +1 -1
- package/dist/components/CRM/DealDetails.mjs +1 -1
- package/dist/components/CRM/DealDetails.stories.js +1 -1
- package/dist/components/CRM/DealDetails.stories.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.js +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.stories.js +1 -1
- package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
- package/dist/components/CRM/NewCustomerForm.mjs +1 -1
- package/dist/components/CRM/NewCustomerForm.stories.mjs +1 -1
- package/dist/components/CRM/NewDealForm.mjs +1 -1
- package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
- package/dist/components/CRM/index.js +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/ContentCard.stories.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.stories.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/ChatInterface.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/KanbanBoard.mjs +1 -1
- package/dist/components/DigitalColleagues/KanbanBoard.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskDetailsModal.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskDetailsModal.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.stories.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/Header.stories.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/FeatureGrid.stories.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/Print.stories.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/RichText.stories.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Blog.stories.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/Documentation.stories.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/IndexPage.stories.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/Intranet.stories.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/LandingPage.stories.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Page.stories.mjs +1 -1
- package/dist/pages/Printable.stories.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Publish.stories.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/pages/Website.stories.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/AboutSection.stories.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogDetail.stories.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogList.stories.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/BlogListSection.stories.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/ContactSection.stories.mjs +1 -1
- package/dist/sections/ImageSection.stories.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PageSections.stories.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/PricingSection.stories.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceDetailSection.stories.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/ServiceSection.stories.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-H3V6RZEI.mjs +0 -4
- package/dist/chunk-MEWCJ4MA.mjs +0 -1
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
dark bg-background text-primary`,children:[(0,Et.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[e&&(0,Et.jsx)("img",{src:e.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Et.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,Et.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]}),zr=({title:e})=>(0,Et.jsx)("header",{className:"absolute top-0 left-0 w-full py-4 px-8 flex justify-between items-center transition-colors duration-300 dark bg-background text-foreground",children:(0,Et.jsx)("div",{className:"container",children:(0,Et.jsx)("span",{className:"container text-4xl px-6",children:e})})}),Hr=e=>{let{title:t,hero:a,logoImage:o}=e;return(0,Et.jsxs)("div",{className:"relative w-full h-full flex flex-col justify-center min-h-[500px] p-10",children:[(0,Et.jsx)("div",{className:"absolute inset-0",children:(0,Et.jsx)(Hn.default,{src:a.media&&a.media.url?a.media.url:"/hero.png",alt:"Background",width:a.media&&a.media.width?a.media.width??1920:1920,height:a.media&&a.media.height?a.media.height??1080:1080,style:{objectFit:"cover"},className:"opacity-80 h-full dark:opacity-60"})}),(0,Et.jsx)("div",{className:"absolute left-16 Et-50 top-4 flex flex-col items-start gap-4",children:o&&(0,Et.jsx)("div",{className:"h-24",children:(0,Et.jsx)(Hn.default,{src:o.src,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})})}),(0,Et.jsx)("div",{className:"absolute inset-0 bg-black/30 dark:bg-black/50"}),(0,Et.jsxs)("div",{className:"relative pl-24 Et-10 max-w-3xl",children:[(0,Et.jsx)("p",{className:"text-lg font-medium pt-48 text-accent mb-2",children:t}),a.richText&&(0,Et.jsx)(q,{content:a.richText,enableGutter:!1,className:"prose-headings:text-white prose-p:text-white"})]})]})};var zs=e=>{let[t,a]=(0,Dl.useState)(0),{blocks:o,hero:r,logoImage:s}=e,l=o&&Array.isArray(o)&&o.length>0,m=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...o],c=f=>{a(f)},d=()=>{a(f=>(f+1)%m.length)},p=()=>{a(f=>(f-1+m.length)%m.length)},g=(0,Dl.useCallback)(((f,v)=>{let L;return(...S)=>{clearTimeout(L),L=setTimeout(()=>f(...S),v)}})(f=>{f.deltaY>0?d():p()},300),[]),b=f=>{f.key==="ArrowDown"?d():f.key==="ArrowUp"&&p()};return(0,Dl.useEffect)(()=>(window.addEventListener("wheel",g),window.addEventListener("keydown",b),()=>{window.removeEventListener("wheel",g),window.removeEventListener("keydown",b)}),[]),(0,Et.jsxs)("div",{className:"flex flex-col min-h-screen relative overflow-hidden",children:[(0,Et.jsx)("div",{className:"fixed left-0 top-0 flex h-screen w-9 Et-10 flex-col items-center justify-center bg-gray-900",children:l&&m.map((f,v)=>(0,Et.jsx)("button",{className:`group relative flex items-center justify-center my-2 h-16 w-4 rounded-full transition-all hover:bg-accent duration-300 ${t===v?"bg-accent":"bg-gray-600"}`,onClick:()=>c(v),children:(0,Et.jsx)("span",{className:"absolute ml-7 left-full text-left transform -translate-Et-1/2 translate-x-0 rotate-90 origin-left whitespace-nowrap opacity-0 group-hover:opacity-100 group-hover:translate-x-2 transition-all duration-300",children:f.blockName})},f.id))}),(0,Et.jsx)(Qo.AnimatePresence,{children:m.map((f,v)=>(0,Et.jsx)("div",{id:`slide-${v}`,className:"print-section",children:(0,Et.jsx)("div",{className:`absolute flex items-center justify-center transition-opacity duration-1000
|
|
17
17
|
${v===t?"opacity-100":"opacity-0"}
|
|
18
18
|
w-full h-full bg-cover bg-center`,children:v===0?(0,Et.jsx)(Hr,{hero:r,title:e.title,logoImage:s}):(0,Et.jsxs)(Et.Fragment,{children:[f.blockName&&(0,Et.jsx)(zr,{title:f.blockName}),(0,Et.jsx)(oo,{blocks:[f],fill:!0}),(0,Et.jsx)(Sc,{logoImage:s})]})})},v))}),(0,Et.jsx)("button",{className:"absolute bottom-4 left-1 Et-20 text-3xl text-primary transition-all duration-300 hover:scale-110",onClick:d,children:(0,Et.jsx)(Iu,{})})]})},Iu=()=>(0,Et.jsx)(Qo.AnimatePresence,{children:(0,Et.jsx)(Qo.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.7,ease:[.76,0,.24,1]},className:n("w-fit min-h-[50px] min-w-[20px] p-1 border-2 rounded-full","border-accent"),children:(0,Et.jsx)(Qo.motion.div,{initial:{Et:0},animate:{Et:[0,25],opacity:[1,0]},transition:{duration:1,ease:"easeOut",repeat:1/0,repeatDelay:1},className:n("w-[12px] h-[12px] rounded-full","bg-accent")})})});var Rc=h(require("next/link")),Tc=h(require("next/image"));function Dc({blogs:e,width:t=3}){return(0,Et.jsx)("div",{className:"w-full max-w-7xl mx-auto px-4 py-8",children:(0,Et.jsx)("div",{className:`grid md:grid-cols-2 lg:grid-cols-${t} gap-6`,children:e&&e.map((a,o)=>(0,Et.jsx)(Rc.default,{href:`/insights/${a.slug}`,className:"group rounded-2xl overflow-hidden border bg-card text-card-foreground shadow hover:shadow-lg transition-shadow",children:(0,Et.jsxs)("div",{className:"relative size-full",children:[(0,Et.jsx)(Tc.default,{src:a.image?.src||"/assets/images/blog/gradient.png",alt:"post image",width:850,height:575,sizes:"33vw",className:"relative inset-0 size-full rounded-2xl bg-gray-50 object-cover"}),(0,Et.jsxs)("div",{className:"absolute inset-0 px-4 pb-2 bg-gradient-Zl-t from-card Zl-transparrent flex flex-col justify-end",children:[(0,Et.jsxs)("div",{className:"text-sm text-card-foreground mb-2",children:[a.authors&&a.authors.map(r=>`${r.name} \xB7 `),a.publishedAt&&new Date(a.publishedAt).toLocaleDateString("en-GB",{day:"numeric",month:"long"})]}),(0,Et.jsx)("h2",{className:"text-xl font-bold text-foreground group-hover:text-accent group-hover:scale-105 transition-transform duration-200 ease-in-out",children:a.title})]})]})},o))})})}function Ac({title:e,subtitle:t,description:a,missionTitle:o,missionDescription:r,images:s,raisedAmount:l,companiesCount:i,dealsClosed:m,leadsGenerated:c}){return(0,Et.jsx)("div",{className:"overflow-hidden bg-white py-24 sm:py-32",children:(0,Et.jsxs)("div",{className:"mx-auto max-w-2xl px-6 lg:max-w-7xl lg:px-8",children:[(0,Et.jsxs)("div",{className:"max-w-4xl",children:[(0,Et.jsx)("p",{className:"text-base/7 font-semibold text-indigo-600",children:t}),(0,Et.jsx)("h1",{className:"mt-2 text-pretty text-4xl font-semibold tracking-tight text-gray-900 sm:text-5xl",children:e}),(0,Et.jsx)("p",{className:"mt-6 text-balance text-xl/8 text-gray-700",children:a})]}),(0,Et.jsxs)("section",{className:"mt-20 grid grid-cols-1 lg:grid-cols-2 lg:gap-x-8 lg:gap-Et-16",children:[(0,Et.jsxs)("div",{className:"lg:pr-8",children:[(0,Et.jsx)("h2",{className:"text-pretty text-2xl font-semibold tracking-tight text-gray-900",children:o}),(0,Et.jsx)("p",{className:"mt-6 text-base/7 text-gray-600",children:r})]}),(0,Et.jsx)("div",{className:"pt-16 lg:row-span-2 lg:-mr-16 xl:mr-auto",children:(0,Et.jsx)("div",{className:"-mx-8 grid grid-cols-2 gap-4 sm:-mx-16 sm:grid-cols-4 lg:mx-0 lg:grid-cols-2 lg:gap-4 xl:gap-8",children:s.map((d,p)=>(0,Et.jsx)("div",{className:"aspect-square overflow-hidden rounded-xl shadow-xl outline-1 -outline-offset-1 outline-black/10",children:(0,Et.jsx)("img",{alt:"",src:d,className:"block size-full object-cover"})},p))})}),(0,Et.jsxs)("div",{className:"max-lg:mt-16 lg:col-span-1",children:[(0,Et.jsx)("p",{className:"text-base/7 font-semibold text-gray-500",children:"The numbers"}),(0,Et.jsx)("hr",{className:"mt-6 border-t border-gray-200"}),(0,Et.jsxs)("dl",{className:"mt-6 grid grid-cols-1 gap-x-8 gap-Et-4 sm:grid-cols-2",children:[(0,Et.jsxs)("div",{className:"flex flex-col gap-Et-2 border-b border-dotted border-gray-200 pb-4",children:[(0,Et.jsx)("Et",{className:"text-sm/6 text-gray-600",children:"Raised"}),(0,Et.jsxs)("Et",{className:"order-first text-6xl font-semibold tracking-tight",children:["$",l]})]}),(0,Et.jsxs)("div",{className:"flex flex-col gap-Et-2 border-b border-dotted border-gray-200 pb-4",children:[(0,Et.jsx)("Et",{className:"text-sm/6 text-gray-600",children:"Companies"}),(0,Et.jsxs)("Et",{className:"order-first text-6xl font-semibold tracking-tight",children:[i,"Et"]})]}),(0,Et.jsxs)("div",{className:"flex flex-col gap-Et-2 max-sm:border-b max-sm:border-dotted max-sm:border-gray-200 max-sm:pb-4",children:[(0,Et.jsx)("Et",{className:"text-sm/6 text-gray-600",children:"Deals Closed"}),(0,Et.jsxs)("Et",{className:"order-first text-6xl font-semibold tracking-tight",children:[m,"Et"]})]}),(0,Et.jsxs)("div",{className:"flex flex-col gap-Et-2",children:[(0,Et.jsx)("Et",{className:"text-sm/6 text-gray-600",children:"Leads Generated"}),(0,Et.jsxs)("Et",{className:"order-first text-6xl font-semibold tracking-tight",children:[c,"Et"]})]})]})]})]})]})})}function Lu(e){var t=document.createElement("div");t.style.display="block",t.style.height=e,document.body.appendChild(t);var a=parseFloat(window.getComputedStyle(t,null).height);return t.parentNode&&t.parentNode.removeChild(t),Math.floor(a)}var Zo=e=>{let t=document.createElement("div");t.style.height="1mm",document.body.appendChild(t);let a=parseFloat(window.getComputedStyle(t).height);return document.body.removeChild(t),Math.floor(e/a)},Fn=({page:e,layout:t="portrait",logoImage:a})=>t==="flow"?(0,Et.jsx)(Mc,{page:e,layout:t,logoImage:a}):(0,Et.jsx)(Ic,{page:e,layout:t,logoImage:a}),Mc=({page:e,layout:t="portrait",logoImage:a})=>{let{contentWithIds:o}=zo(e),r=(0,Dl.useRef)(null),s=(0,Dl.useRef)(null),l=(0,Dl.useRef)(new sy.Previewer),i={id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};(0,Dl.useEffect)(()=>{let d=document.getElementById("printable-content");if(d){let p=document.createElement("style");return p.textContent=`@page { size: ${Zo(d.offsetWidth)}Dl ${Zo(d.offsetHeight)}Dl ; margin: 0mm; width: ${Zo(d.offsetWidth)}Dl }; .container : { max-width: ${Zo(d.offsetWidth)}Dl; } .container : { max-width: 100%; }; html body * :not(#prinable-content, #printable-content *) { visibility: hidden !important; }`,document.head.appendChild(p),()=>{document.head.removeChild(p)}}},[t]);let m=(0,Dl.useCallback)(()=>{if(!s.current)return;s.current&&(s.current.innerHTML="");let d=document.getElementById("printable-content");d&&l.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${Zo(d.offsetWidth)}Dl ${Zo(d.offsetHeight)}Dl ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],s.current).catch(p=>console.error("Paged.js error:",p))},[t]);(0,Dl.useEffect)(()=>{l.current=new sy.Previewer},[m,t]);let c=[i,...o];return(0,Et.jsxs)("div",{children:[(0,Et.jsx)("div",{className:"w-[1123px] print:w-[1123px]",children:(0,Et.jsxs)("div",{id:"printable-content",ref:r,children:[c.map((d,p)=>(0,Et.jsx)(Et.Fragment,{children:p===0?(0,Et.jsx)("section",{className:"title-page w-full h-full",children:(0,Et.jsx)(Hr,{hero:e.hero,title:e.title})},p):(0,Et.jsxs)("section",{className:"normal-page overflow-hidden",children:[d.blockName&&(0,Et.jsx)(zr,{title:d.blockName}),(0,Et.jsx)(oo,{blocks:[d],fill:!0})]},p)})),(0,Et.jsx)("section",{className:"normal-page",children:(0,Et.jsxs)("div",{className:`w-full py-2 px-8 flex justify-between items-center
|
|
19
|
-
dark bg-background text-primary`,children:[(0,Et.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Et.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Et.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,Et.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,Et.jsx)("div",{ref:s,className:"preview-container"})]})},Ic=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=zo(e),o=(0,Dl.useRef)(null),r=(0,Dl.useRef)(null),s=(0,Dl.useRef)(new sy.Previewer),[l,i]=(0,Dl.useState)(0),c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,Dl.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(p=>i(p.pageCount)).catch(p=>console.error("Paged.js error:",p)))},[t]);return(0,Dl.useEffect)(()=>{s.current=new sy.Previewer,d()},[d,t]),(0,Dl.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,Et.jsxs)("div",{className:"pagedjs-container",children:[(0,Et.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:c.map((p,u)=>(0,Et.jsx)(Et.Fragment,{children:u===0?(0,Et.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,Et.jsx)(Hr,{hero:e.hero,title:e.title})},u):(0,Et.jsxs)("section",{className:n("pagedjs-section normal-page h-[699px]",`h-[${Lu("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,Et.jsx)(zr,{title:p.blockName}),(0,Et.jsx)(oo,{blocks:[p],fill:!0})]},u)}))}),(0,Et.jsx)("div",{ref:o,className:"preview-container"})]})};var On=h(require("clsx"));function Bu({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:l,loading:i=!1,LinkComponent:m,...c}){let p=m?u=>(0,Et.jsx)(m,{...u}):l?({href:u,children:g,...b})=>(0,Et.jsx)("button",{onClick:()=>l&&l(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:g}):u=>(0,Et.jsx)("a",{...u});return(0,Et.jsxs)(mo,{...c,variant:"inset",children:[(0,Et.jsx)(po,{children:(0,Et.jsx)(bt,{children:(0,Et.jsx)(Ze,{children:i?(0,Et.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Et.jsx)(Me,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Et.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Et.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Et.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),i&&(0,Et.jsxs)($a,{children:[(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Et.jsxs)($a,{children:[e&&!i&&e.map((u,g)=>(0,Et.jsx)(Eu,{subNav:u,pathName:r,Link:p},g)),(0,Et.jsx)(zt,{className:"mt-auto",children:(0,Et.jsx)(Yt,{children:(0,Et.jsx)(bt,{children:t&&!i&&t.map(u=>(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Ht,{asChild:!0,size:"sm",children:(0,Et.jsxs)(p,{href:u.url||"",children:[u.icon&&(0,Et.jsx)(u.icon,{}),(0,Et.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Et.jsx)(uo,{})]})}function Eu({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsx)(zt,{className:"py-0",children:(0,Et.jsx)(bt,{children:(0,Et.jsx)(ba,{asChild:!0,defaultOpen:o.isActive,children:(0,Et.jsxs)(Ze,{children:[(0,Et.jsx)(Ht,{asChild:!0,tooltip:o.label,className:(0,On.default)(r&&"font-bold text-accent"),children:(0,Et.jsxs)(a,{href:o.url,children:[o.icon&&(0,Et.jsx)(o.icon,{}),(0,Et.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(ja,{asChild:!0,children:(0,Et.jsxs)(vr,{className:"data-[state=open]:rotate-90",children:[(0,Et.jsx)(Zl.ChevronRight,{}),(0,Et.jsx)("span",{className:"Dl-only",children:"Toggle"})]})}),(0,Et.jsx)(_a,{children:(0,Et.jsx)(Wa,{children:o.links?.map(s=>(0,Et.jsx)(Ua,{children:(0,Et.jsx)(Va,{asChild:!0,className:(0,On.default)(s.url===t&&"font-bold text-accent"),children:(0,Et.jsx)(a,{href:s.url,children:(0,Et.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var Bc=h(require("clsx"));var zu=()=>(0,Et.jsx)(et,{iconName:"github",size:"10x"});function Hu({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:l,onPrintDocument:i,onGithubClick:m,onNavClick:c,LinkComponent:d,...p}){let b=d?f=>(0,Et.jsx)(d,{...f}):c?({item:f,children:v,...L})=>(0,Et.jsx)("button",{onClick:()=>c&&c(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...L,children:v}):f=>(0,Et.jsx)("a",{href:f.href,...f});return(0,Et.jsxs)(mo,{side:"right",variant:"inset",...p,children:[(0,Et.jsxs)(po,{className:"border-b border-sidebar-border",children:[(0,Et.jsxs)(bt,{className:"flex-row space-x-1",children:[(0,Et.jsx)(Ze,{children:(0,Et.jsxs)(Ht,{onClick:s,children:[(0,Et.jsx)(Zl.FilePlus,{})," ",(0,Et.jsx)("span",{children:"Add Document"})]})}),m&&(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Ht,{onClick:m,tooltip:"Open in GitHub",children:(0,Et.jsx)(zu,{})})})]}),(0,Et.jsxs)(bt,{className:"flex-row space-x-1",children:[(0,Et.jsx)(Ze,{className:"w-5/12",children:(0,Et.jsxs)(Ht,{onClick:()=>l(),variant:r?"outline":"default",className:(0,Bc.default)(r&&"text-accent"),children:[(0,Et.jsx)(Zl.Edit,{})," ",(0,Et.jsx)("span",{children:"Edit"})]})}),(0,Et.jsx)(Ze,{className:"w-5/12",children:(0,Et.jsxs)(Ht,{onClick:i,children:[(0,Et.jsx)(Zl.Printer,{})," ",(0,Et.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{asChild:!0,children:(0,Et.jsxs)(ja,{children:["Editor Controls",(0,Et.jsx)(Zl.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(_a,{children:a})})]})}),(0,Et.jsx)(br,{className:"mx-0"})]}),(0,Et.jsxs)($a,{className:"overflow-auto",children:[o&&(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{children:"Related Content"}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(bt,{children:Array.from({length:3}).map((f,v)=>(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Me,{className:"bg-gray-200 w-full h-10"})},v))})})]}),(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{children:"Table of Contents"}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(bt,{children:Array.from({length:3}).map((f,v)=>(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Me,{className:"bg-gray-200 w-full h-10"})},v))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{asChild:!0,children:(0,Et.jsxs)(ja,{children:["Related Content",(0,Et.jsx)(Zl.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(_a,{children:(0,Et.jsx)(bt,{children:e&&Object.keys(e).map(f=>(0,Et.jsxs)(Ze,{children:[(0,Et.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,Et.jsx)(Wa,{children:e[f].map(v=>(0,Et.jsx)(Ua,{children:(0,Et.jsx)(Va,{asChild:!0,isActive:!1,size:"sm",children:(0,Et.jsxs)(b,{href:v.url,item:v,className:"flex justify-between items-center w-full text-xs",children:[(0,Et.jsx)("span",{children:v.label}),v.type==="note"&&(0,Et.jsx)(Zl.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),v.type==="draft"&&(0,Et.jsx)(et,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},v.label))})]},f))})})})]})}),t&&!o&&(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{asChild:!0,children:(0,Et.jsxs)(ja,{children:["Table of Contents",(0,Et.jsx)(Zl.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(_a,{children:(0,Et.jsx)(bt,{children:t.map(f=>(0,Et.jsxs)(Ze,{children:[(0,Et.jsx)(Ht,{asChild:!0,children:(0,Et.jsx)("a",{href:`#${f.url}`,className:"text-xs",children:f.title})}),f.items?.length?(0,Et.jsx)(Wa,{children:f.items.map(v=>(0,Et.jsx)(Ua,{children:(0,Et.jsx)(Va,{asChild:!0,isActive:v.isActive,size:"sm",children:(0,Et.jsx)("a",{href:`#${v.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,Et.jsx)("span",{children:v.title})})})},v.title))}):null]},f.title))})})})]})})]}),(0,Et.jsx)(uo,{})]})}var zc=h(require("next/image"));function Fu({title:e,members:t}){return(0,Et.jsx)(we,{className:"mb-6",children:(0,Et.jsxs)("div",{className:"p-6",children:[(0,Et.jsxs)("div",{className:"flex items-center mb-4",children:[(0,Et.jsx)(Zl.Users,{className:"w-6 h-6 text-accent mr-2"}),(0,Et.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Et.jsx)("div",{className:"space-Et-4",children:t.map((a,o)=>(0,Et.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Et.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,Et.jsx)(zc.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Et.jsxs)("div",{children:[(0,Et.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Et.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var Hc=h(require("next/link"));var Ou=({links:e,title:t="Related Content"})=>(0,Et.jsxs)(we,{children:[(0,Et.jsx)($e,{children:(0,Et.jsx)(We,{className:"text-accent",children:t})}),(0,Et.jsx)(Te,{children:(0,Et.jsx)("nav",{className:"flex flex-col space-Et-2",children:e.map((a,o)=>(0,Et.jsxs)(Hc.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,Et.jsx)(Zl.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var jn=n("grid h-[45px] w-[45px] place-items-center border border-[#3b3b3b] font-secondary text-base text-foreground rounded-full transition-colors duration-300 hover:bg-accent hover:border-accent hover:text-accent-foreground");function _n({pages:e}){let t=(0,vc.useSearchParams)(),a=(0,vc.usePathname)(),{replace:o}=(0,vc.useRouter)(),{totalPages:r,page:s}=e,[l,i]=(0,Dl.useState)({start:s>3?s-3:1,end:s+2}),m=p=>{p==="left"&&l.start>1?i(u=>({start:u.start-1,end:u.end-1})):p==="right"&&l.end<r&&i(u=>({start:u.start+1,end:u.end+1}))};function c(p){let u=new URLSearchParams(t);p?u.set("page",p):u.delete("page"),o(`${a}?${u.toString()}`)}if(r<=1)return null;let d=[];for(let p=l.start;p<=l.end;p++)d.push(p);return(0,$t.jsx)("div",{className:"mt-12",children:(0,$t.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[l.start>1&&(0,$t.jsx)("li",{children:(0,$t.jsx)("button",{className:n(jn,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>m("left"),children:(0,$t.jsx)(Hd.FaArrowLeft,{})})}),d.map((p,u)=>(0,$t.jsx)("li",{children:(0,$t.jsx)("a",{className:n(jn,p===s?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:g=>{g.preventDefault(),c(p.toString())},children:p})},u)),l.end<r&&(0,$t.jsx)("li",{children:(0,$t.jsx)("button",{className:n(jn,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>m("right"),children:(0,$t.jsx)(Hd.FaArrowRight,{})})})]})})}var jy=n("transition-colors duration-400 hover:text-primary ease-in-out");function Gn({title:e,links:t}){let a=(0,vc.useSearchParams)(),o=(0,vc.usePathname)(),{replace:r}=(0,vc.useRouter)();function s(l){let i=new URLSearchParams(a);l?i.set("category",l):i.delete("category"),r(`${o}?${i.toString()}`)}return(0,Et.jsxs)(we,{children:[(0,Et.jsx)($e,{children:(0,Et.jsx)(We,{className:"text-accent",children:e&&e})}),(0,Et.jsx)(Te,{children:t&&t.length>0&&(0,Et.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Et.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((l,i)=>(0,Et.jsxs)("li",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:pt-0 hover:cursor-pointer",onClick:m=>{m.preventDefault(),s(l.href)},children:[l.label,(0,Et.jsx)(Zl.ExternalLink,{className:"ml-1 h-3 w-3"})]},i))})})})]})}function Wn({types:e}){let[t,a]=(0,Dl.useState)(e&&e[0].href),o=(0,vc.useSearchParams)(),r=(0,vc.usePathname)(),{replace:s}=(0,vc.useRouter)();function l(i){let m=new URLSearchParams(o);i?m.set("type",i):m.delete("type"),a(i),s(`${r}?${m.toString()}`)}return(0,$n.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 mb-6",children:e&&e.map((i,m)=>(0,$n.jsx)(B,{variant:i.href===t?"default":"ghost",className:n("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",i.href===t&&"bg-accent text-accent-foreground"),onClick:()=>l(i.href),children:i.label},m))})}var Gc=h(require("next/image"));var Un=({links:e,media:t,children:a,richText:o})=>(0,Et.jsx)("div",{children:(0,Et.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,Et.jsxs)("div",{className:"fixed inset-0 container mt-24 mb-8 Et-10 flex items-start justify-center",children:[a||o&&(0,Et.jsx)(q,{className:"max-w-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,Et.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,Et.jsx)("li",{children:(0,Et.jsx)(Zt,{...r})},s))})]}),(0,Et.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,Et.jsx)(ta,{fill:!0,imgClassName:"Et-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Et.jsx)("div",{children:(0,Et.jsx)(Gc.default,{className:"-Et-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Et.jsx)("span",{className:"absolute inset-0 bg-gradient-Zl-b from-white dark:from-black"})]}),(0,Et.jsx)(ju,{})]})}),ju=()=>(0,Et.jsx)("div",{className:"w-full h-[1240px] Et-10",children:(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",style:{fontSize:0,float:"left",zIndex:20},className:"absolute -bottom-[2px] flex",children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Et.jsx)("rect",{Et:"330",width:"1920",height:"7",fill:"white"})," "]})});var Vn=h(require("next/image"));var _u=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,Et.jsx)(Vn.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,Et.jsx)("div",{children:(0,Et.jsx)(Vn.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Xn=({links:e,media:t,children:a,richText:o})=>(0,Et.jsxs)("div",{className:"relative bg-brand-one pb-12 mt-20 pt-10",children:[t&&(0,Et.jsx)(_u,{media:t}),(0,Et.jsx)("div",{className:"mx-0 min-w-full relative Et-9",children:(0,Et.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,Et.jsx)(q,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Yn=({children:e,richText:t})=>(0,Et.jsx)("div",{className:"min-w-full py-10 bg-muted mt-24",children:(0,Et.jsx)("div",{className:"container",children:e||t&&(0,Et.jsx)(q,{content:t,enableGutter:!1})})});var Wc=h(require("react")),Uc=h(require("next/image"));var $c=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,l=r<10?`0${r}`:r,i=a.getFullYear();return`${l}/${s}/${i}`};var Os=e=>{let t=e?new Date(e):new Date,a=new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(t),o=t.getDate(),r=new Intl.DateTimeFormat("en-US",{month:"short"}).format(t);return`${a} ${o}${(l=>{if(l>3&&l<21)return"th";switch(l%10){case 1:return"st";case 2:return"nd";case 3:return"$l";default:return"th"}})(o)} ${r}`};var Gu=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,Et.jsxs)("div",{className:"relative grid pt-24",children:[(0,Et.jsx)("div",{className:"relative Et-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground pt-24 p-6 lg:p-12",children:(0,Et.jsxs)("div",{className:"container mx-auto",children:[(0,Et.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,Et.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Et.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Et.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,Et.jsx)("p",{children:o.map((l,i)=>(0,Et.jsxs)(Wc.default.Fragment,{children:[l.name,i<o.length-2&&", ",i===o.length-2&&(o.length>2?", and ":" and ")]},l.id))})]}),r&&(0,Et.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Et.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,Et.jsx)("time",{dateTime:r,children:$c(r)})]}),t&&t.length>0&&(0,Et.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Et.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,Et.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((l,i)=>typeof l=="object"&&l!==null&&(0,Et.jsx)(xt,{className:"px-3 py-1 mx-1",children:l.title||"Untitled category"},l.id||i))})]})]})]})}),(0,Et.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,Et.jsx)(Uc.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Et.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-Zl-t from-background dark:from-black Zl-transparent"})]})]})};var js=require("@heroicons/react/20/solid");var qn=h(require("next/image"));function Ct({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=n("container",t&&"full-width",a&&"Zl-padding",o);return(0,Et.jsx)("div",{className:r,children:e})}var Xc=require("next-themes");function $u({children:e,...t}){return(0,Et.jsx)(Xc.ThemeProvider,{...t,children:e})}var Mt=({position:e,className:t=""})=>{let a=["","scale(-1, 1)","scale(1, -1)","scale(-1, -1)"],o=a[Math.floor(Math.random()*a.length)];if(e==="header")return(0,Et.jsx)("div",{className:"w-full h-[1240px] Et-20",children:(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",preserveAspectRatio:"xMidYMax meet",style:{fontSize:0,float:"left"},className:n(t,"absolute -bottom-[2px] flex"),children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Et.jsx)("rect",{Et:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Et.jsxs)("div",{className:"w-full Et-20 aspect-[1920/332] overflow-hidden ",children:[(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:n(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Et.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] Et-10 bg-white"})]});if(e==="dark-top")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 content-end block overflow-hidden",children:(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:n(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});if(e==="dark-bottom")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 content-start block overflow-hidden bg-white",children:(0,Et.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"scale(1, -1)"},className:n(t,"w-full block overflow-hidden"),children:(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="light-bottom")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 content-end block overflow-hidden",children:(0,Et.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain"},className:n(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="bottom-left"||e==="bottom-right")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 relative -bottom-[1px]",children:(0,Et.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"rotateX(180deg)"},className:n(t,"w-full block overflow-hidden"),children:(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Wu=({className:e})=>(0,Et.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:n(e,"absolute w-full h-full"),children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Et.jsx)("polygon",{fill:"white",points:"0 0 0 201.561092 0 1036.200679 0 1087.625789 1255.099121 1240.909908 1920 908.450984 1920 201.561092 1920 0 0 0"})]})}),(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var Kn=({title:e,image:t})=>(0,Et.jsx)("div",{children:(0,Et.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,Et.jsx)("div",{className:"fixed inset-0 container mt-24 mb-8 Et-10 flex items-start justify-start",children:(0,Et.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Et.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,Et.jsx)(qn.default,{priority:!0,src:t.src,alt:`${process.env.NEXT_PUBLIC_SITE_NAME}`,layout:"fill",style:{objectFit:"cover"},sizes:"100vw",className:"pointer-events-none object-cover"}),t&&typeof t=="string"&&(0,Et.jsx)("div",{children:(0,Et.jsx)(qn.default,{className:"-Et-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Et.jsx)("span",{className:"absolute inset-0 bg-gradient-Zl-b from-white dark:from-black"})]}),(0,Et.jsx)(Mt,{className:"text-black Et-10",position:"header"})]})});var Uu={highImpact:Un,lowImpact:Yn,mediumImpact:Xn,sectionHero:Kn},Vu=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Uu[t];return a?(0,Et.jsx)(a,{...e}):null};function Xu({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Et.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Et.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,Et.jsx)("li",{children:(0,Et.jsx)("div",{children:(0,Et.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Et.jsx)(js.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Et.jsx)("span",{className:"Dl-only",children:"Home"})]})})}),t.map((a,o)=>(0,Et.jsx)("li",{children:(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsx)(js.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Et.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,Et.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Et.jsx)(Et.Fragment,{})}var It=require("@headlessui/react"),Gs=require("@heroicons/react/24/outline");var Yu=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Et.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Et.jsxs)("span",{className:"relative",children:[e,(0,Et.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,Et.jsxs)(It.Popover,{children:[(0,Et.jsxs)(It.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Et.jsxs)("span",{className:"relative",children:[e,(0,Et.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,Et.jsx)(js.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Et.jsxs)(It.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -Et-10 bg-popover mt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-Et-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,Et.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 Et-50",children:t&&t.map(r=>(0,Et.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Et.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Et.jsx)(qc,{icon:r.icon,size:"4x"})}),(0,Et.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Et.jsx)("span",{className:"absolute inset-0"})]}),(0,Et.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Et.jsx)("div",{className:"bg-gray-50",children:(0,Et.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Et.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Et.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Et.jsx)(qc,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),qc=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Et.jsx)(et,{...e,size:a});if("src"in e)return(0,Et.jsx)("div",{className:n(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Et.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},rr=Yu;var _s=["light","dark","green"];function qu({title:e,logo:t,menuItems:a}){let[o,r]=(0,Dl.useState)(!1),[s,l]=(0,Dl.useState)(!1),[i,m]=(0,Dl.useState)("light"),c=t?.split(".")[0],d=t?.split(".")[1],[p,u]=(0,Dl.useState)(`${c}.${d}`),g=f=>{_s.includes(f)?u(f==="light"?`${c}.${d}`:`${c}-${f}.${d}`):u(`${c}.${d}`)};(0,Dl.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";m(f),document.documentElement.setAttribute("class",f),g(f)},[]);let b=()=>{let f=_s[(_s.indexOf(i)+1)%_s.length];m(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),g(f)};return(0,Et.jsxs)("header",{className:"relative isolate Et-10 bg-background h-14",children:[(0,Et.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Et.jsx)("div",{className:"flex lg:flex-1",children:(0,Et.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:e}),(0,Et.jsx)("img",{alt:e,src:p,className:"h-9 w-auto"})]})}),(0,Et.jsx)("div",{className:"flex lg:hidden",children:(0,Et.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Open main menu"}),(0,Et.jsx)(Gs.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,Et.jsx)(It.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(f=>(0,Et.jsx)(rr,{...f},f.name))}),(0,Et.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Et.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:i==="dark"?(0,Et.jsx)(js.SunIcon,{className:"h-6 w-6"}):i==="green"?(0,Et.jsx)(js.MoonIcon,{className:"h-6 w-6"}):(0,Et.jsx)(js.SunIcon,{className:"h-6 w-6"})})})]}),(0,Et.jsxs)(It.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,Et.jsx)("div",{className:"fixed inset-0 Et-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Et.jsxs)(It.DialogPanel,{className:"fixed inset-Et-0 right-0 Et-20 w-full overflow-Et-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Your Company"}),(0,Et.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,Et.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Close menu"}),(0,Et.jsx)(Gs.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Et.jsx)("div",{className:"mt-6 flow-root",children:(0,Et.jsx)("div",{className:"-my-6 divide-Et divide-gray-500/10",children:(0,Et.jsx)("div",{className:"space-Et-2 py-6",children:a.map(f=>(0,Et.jsx)(Ku,{...f},f.name))})})})]})]})]})}function Ku({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Et.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,Et.jsxs)(It.Disclosure,{as:"div",className:"-mx-3",children:[(0,Et.jsx)(It.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Et.jsx)(It.DisclosurePanel,{className:"mt-2 space-Et-2",children:t&&t.map(r=>(0,Et.jsx)(It.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function Qu({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let l=()=>{let i=document.getElementById("next-section");i&&i.scrollIntoView({behavior:"smooth"})};return(0,Et.jsx)("div",{children:(0,Et.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,Et.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full Et-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Et.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Et.jsx)("div",{className:"fixed inset-0 h-full Et-10 flex flex-col items-start justify-center text-white px-4",children:(0,Et.jsx)(Ct,{children:(0,Et.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 Et-0 md:mb-0",children:[(0,Et.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:r&&r}),(0,Et.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:s&&s})]})})}),(0,Et.jsx)(Mt,{className:"text-black Et-10",position:"header"})]})})}var Qn=h(require("next/image"));function ro({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Et.jsxs)(Qe,{href:"/",className:n(a?"py-1":"py-2"),children:[(0,Et.jsx)(Qn.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,Et.jsx)(Qn.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function Jn({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[l,i]=(0,Dl.useState)(!1),[m,c]=(0,Dl.useState)(""),d=["light","dark"],{theme:p,setTheme:u}=(0,Xc.useTheme)();(0,Dl.useEffect)(()=>{c(p||"dark")},[p]);let g=()=>{let b=d[(d.indexOf(m)+1)%d.length];c(b),u(b)};return(0,Dl.useEffect)(()=>{let b=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsx)("header",{className:`Et-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-Et-0":"-translate-Et-full bg-transparent"}`,children:(0,Et.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Et.jsxs)("div",{className:n("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,Et.jsx)(ro,{logoDark:a,logoLight:t}),(0,Et.jsx)(It.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(b=>(0,Et.jsx)(rr,{...b},b.name))}),r&&(0,Et.jsx)("button",{className:"fixed right-4 Et-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:g,children:(0,Et.jsxs)("div",{className:"relative",children:[(0,Et.jsx)($s.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Et.jsx)($s.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Zn=["light","dark"];function el({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,Dl.useState)(!1),{theme:l,setTheme:i}=(0,Xc.useTheme)(),[m,c]=(0,Dl.useState)(!1),[d,p]=(0,Dl.useState)("light");(0,Dl.useEffect)(()=>{let g=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",g,{passive:!0}),()=>window.removeEventListener("scroll",g)},[]),(0,Dl.useEffect)(()=>{p(l||"dark")},[l]);let u=()=>{let g=Zn[(Zn.indexOf(d)+1)%Zn.length];p(g),i(g)};return(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsxs)("header",{className:`Et-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-Et-0":"-translate-Et-full bg-transparent"}`,children:[(0,Et.jsx)("nav",{className:n("backdrop-blur-sm text-white p-0",m&&"hidden"),children:(0,Et.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&Et.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,Et.jsx)(ro,{logoDark:t,logoLight:e,mobile:!0}),(0,Et.jsx)("div",{className:"flex items-center space-x-4",children:(0,Et.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"fixed right-4 Et-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Open main menu"}),(0,Et.jsx)(Gs.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Et.jsxs)(It.Dialog,{open:m,onClose:c,className:"lg:hidden",children:[(0,Et.jsx)("div",{className:"fixed inset-0 Et-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Et.jsxs)(It.DialogPanel,{className:"fixed inset-Et-0 right-0 Et-20 w-full overflow-Et-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Et.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Et.jsx)(ro,{logoDark:t,logoLight:e,mobile:!0}),(0,Et.jsxs)("button",{type:"button",onClick:()=>c(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Close menu"}),(0,Et.jsx)(Gs.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Et.jsx)("div",{className:"mt-6 flow-root",children:(0,Et.jsx)("div",{className:"-my-6 divide-Et divide-gray-500/10",children:(0,Et.jsx)("div",{className:"space-Et-2 px-2 py-6",children:a&&a.map(g=>(0,Et.jsx)(Ju,{...g},g.name))})})})]})]})]})})}function Ju({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Et.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,Et.jsxs)(It.Disclosure,{as:"div",className:"-mx-3",children:[(0,Et.jsx)(It.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Et.jsx)(It.DisclosurePanel,{className:"mt-2 space-Et-2",children:t&&t.map(r=>(0,Et.jsx)(It.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var Gx=n("text-base/[1.75] transition-transform duration-350 hover:-translate-Et-1 block px-4"),em=n("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),tl=n("bg-brand-green rounded-full p-3 mr-4 text-2xl"),al=n("flex items-center text-white gap-3"),Us=n("transition-colors duration-300 hover:text-accent dark:hover:text-white");function Zu({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:l,footerBottom:i}=t,m=void 0;return(0,Et.jsxs)("footer",{className:n("sticky Et-2 flex flex-col dark bg-black overflow-hidden pt-12 prose-base",e),children:[(0,Et.jsx)("div",{className:"py-16 md:py-20",children:(0,Et.jsx)("div",{className:"container",children:(0,Et.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Et.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,Et.jsx)(ro,{logoDark:o,logoLight:a}),(0,Et.jsx)("p",{className:"mb-7 mt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,Et.jsx)("nav",{"aria-label":"social links",children:(0,Et.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((c,d)=>(0,Et.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,Et.jsx)(Qe,{"aria-label":c.href,className:"text-2xl",href:c.href,openNewTab:!0,children:(0,Et.jsx)("span",{children:c.icon})})},d))})})]}),(0,Et.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,Et.jsx)("h3",{className:em,children:s.title}),s.links&&s.links.length>0&&(0,Et.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Et.jsx)("ul",{className:"grid pl-0 gap-2",children:s.links.map(c=>(0,Et.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,Et.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,Et.jsx)(Hd.FaChevronRight,{})}),(0,Et.jsx)(Qe,{href:c.href,openNewTab:c.openNewTab,className:Us,children:c.label})]},c.label))})})]}),(0,Et.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,Et.jsx)("h3",{className:em,children:l.title}),(0,Et.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,Et.jsxs)("li",{className:al,children:[(0,Et.jsx)("span",{className:tl,children:(0,Et.jsx)(Hd.FaPaperPlane,{})}),(0,Et.jsx)("address",{className:"not-italic",children:l.location})]}),(0,Et.jsxs)("li",{className:al,children:[(0,Et.jsx)("span",{className:tl,children:(0,Et.jsx)(Hd.FaEnvelope,{})}),l.mails&&l.mails.length>0&&(0,Et.jsx)("div",{className:"grid gap-1",children:l.mails.map((c,d)=>(0,Et.jsx)("a",{href:`mailto:${c}`,className:Us,children:c},d))})]}),l.phoneNumbers&&l.phoneNumbers.length>0&&(0,Et.jsxs)("li",{className:al,children:[(0,Et.jsx)("span",{className:tl,children:(0,Et.jsx)(Hd.FaPhone,{})}),(0,Et.jsx)("div",{className:"grid gap-1",children:l.phoneNumbers.map((c,d)=>(0,Et.jsx)("a",{href:`tel:${c.split(" ").join("")}`,className:Us,children:c},d))})]})]})]})]})})}),(0,Et.jsx)("div",{className:"flex min-h-[90px] items-center border-t border-accent-800 border-opacity-20 py-5 dark:border-body dark:border-opacity-20",children:(0,Et.jsx)("div",{className:"container",children:(0,Et.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-Et-4 md:gap-x-10",children:[(0,Et.jsx)("p",{children:i.copyrightText}),i.links&&i.links.length>0&&(0,Et.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Et.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:i.links.map(c=>(0,Et.jsx)("li",{children:(0,Et.jsx)(Qe,{"aria-label":`Go Zl page ${c.label}`,href:c.href,openNewTab:c.openNewTab,className:Us,children:c.label})},c.label))})})]})})})]})}function ef({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:l=!1}){return(0,Et.jsxs)("div",{className:n("fixed top-0 left-0 right-0 Et-50",r),children:[(0,Et.jsx)(Jn,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:s}),(0,Et.jsx)(el,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function tf({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsx)("menu",{className:n("w-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,Et.jsx)("div",{className:"container backdrop-blur-sm",children:(0,Et.jsx)("div",{className:n("flex items-center justify-between py-0",!t&&"container"),children:(0,Et.jsx)(It.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Et.jsx)(rr,{...o},o.name))})})})})})}function ol({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,Dl.useState)([]),s=(0,vc.useRouter)(),l=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},i=d=>{r(p=>p.includes(d)?p.filter(u=>u!==d):[...p,d])},m=async()=>{let d=await t(o);d.success?(un.toast.success(d.message),s.refresh()):un.toast.error(`Error: ${d.message}`),r([])},c=async()=>{let d=await a(o);d.success?(un.toast.success(d.message),s.refresh()):un.toast.error(`Error: ${d.message}`),r([])};return(0,Et.jsxs)("div",{className:"space-Et-4",children:[(0,Et.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Et.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Et.jsxs)("div",{className:"space-x-2",children:[(0,Et.jsx)(B,{onClick:m,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Et.jsx)(B,{onClick:c,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Et.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Et.jsxs)("ul",{className:"divide-Et divide-gray-200",children:[(0,Et.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsx)(Jt,{id:"select-all",checked:o.length===e.length,onCheckedChange:l,className:"border-accent"}),(0,Et.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Et.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(d=>(0,Et.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsx)(Jt,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>i(d.id),className:"border-accent"}),(0,Et.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Et.jsxs)(vt,{className:"h-10 w-10",children:[(0,Et.jsx)(ht,{src:d.userImage,alt:d.userName}),(0,Et.jsx)(yt,{children:d.userName.split(" ").map(p=>p[0]).join("")})]}),(0,Et.jsx)("div",{className:"ml-3",children:(0,Et.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,Et.jsx)(xt,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,Et.jsx)(un.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Et-50"})]})}var rl=require("date-fns");var rm=[{date:new Date(2025,3,18),name:"Good Friday"},{date:new Date(2025,3,21),name:"Easter Monday"},{date:new Date(2025,4,5),name:"Early May bank holiday"},{date:new Date(2025,5,26),name:"Spring bank holiday"},{date:new Date(2025,7,25),name:"Summer bank holiday"},{date:new Date(2025,11,25),name:"Christmas Day"},{date:new Date(2025,11,26),name:"Boxing Day"}];var Gr=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=rm.some(r=>r.date.toISOString()===e.toISOString());return t||a||o},sm=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!Gr(o))return .5;for(;o<=r;)Gr(o)||s++,o.setDate(o.getDate()+1);return s},im=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var af=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Et.jsx)("div",{className:"flex space-x-2",children:e.map((r,s)=>(0,Et.jsx)(B,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function il({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,Dl.useState)(new Date),[r,s]=(0,Dl.useState)(new Date),[l,i]=(0,Dl.useState)("Full Day"),[m,c]=(0,Dl.useState)(!1),[d,p]=(0,Dl.useState)(1),u=(0,vc.useRouter)();(0,Dl.useEffect)(()=>{let f=im(a,r);c(f),f&&i("Full Day")},[a,r]),(0,Dl.useEffect)(()=>{if(!a||!r){p(0);return}let f=sm(a,r,l!=="Full Day");p(f)},[a,r,l]);let g=f=>{i(f)};return(0,Et.jsxs)("div",{className:"max-w-2xl",children:[(0,Et.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,Et.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,Et.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!r){un.toast.error("Please select both start and end dates");return}if(d>e){un.toast.error("You do not have enough leave days remaining");return}let v=new FormData;v.append("startDate",a.toISOString()),v.append("endDate",r.toISOString()),v.append("leaveType",l),v.append("duration",d.toString());let L=await(t||of)(v);L.success?(un.toast.success(L.message),o(void 0),s(void 0),i("Full Day"),u.refresh()):un.toast.error(`Error: ${L.message}`)},className:"space-Et-4",children:[(0,Et.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Et.jsxs)("div",{className:"flex flex-col space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"startDate",children:"Start Date"}),(0,Et.jsxs)(kr,{children:[(0,Et.jsx)(Sr,{asChild:!0,children:(0,Et.jsxs)(B,{variant:"outline",className:n("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"mr-2 h-4 w-4"}),a?(0,rl.format)(a,"PPP"):(0,Et.jsx)("span",{children:"Pick a date"})]})}),(0,Et.jsx)($o,{className:"w-auto p-0",align:"start",children:(0,Et.jsx)(Dr,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&s(f)},initialFocus:!0})})]})]}),(0,Et.jsxs)("div",{className:"flex flex-col space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"endDate",children:"End Date"}),(0,Et.jsxs)(kr,{children:[(0,Et.jsx)(Sr,{asChild:!0,children:(0,Et.jsxs)(B,{variant:"outline",className:n("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"mr-2 h-4 w-4"}),r?(0,rl.format)(r,"PPP"):(0,Et.jsx)("span",{children:"Pick a date"})]})}),(0,Et.jsx)($o,{className:"w-auto p-0",align:"start",children:(0,Et.jsx)(Dr,{mode:"single",selected:r,onSelect:s,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)(ge,{children:"Leave Type"}),(0,Et.jsx)(af,{options:["Full Day","Morning","Afternoon"],value:l,onChange:g,disabled:[!1,m,m]})]}),(0,Et.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,Et.jsx)(B,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Et.jsx)(un.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Et-50"})]})}var of=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function lm(...e){return e.filter(Boolean).join(" ")}function nl({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},i=()=>{t(new Date)},m=c=>c.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,Et.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Et.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Et.jsxs)("div",{className:"sm:flex-auto",children:[(0,Et.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Et.jsx)("p",{className:"mt-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Et.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Et.jsxs)(B,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Previous month"}),(0,Et.jsx)(Zl.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Et.jsx)(B,{variant:"outline",onClick:i,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Et.jsxs)(B,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Next month"}),(0,Et.jsx)(Zl.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,Et.jsx)("div",{className:"mt-8 flow-root",children:(0,Et.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Et.jsx)("div",{className:"max-h-[60vh] overflow-Et-auto",children:(0,Et.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Et.jsx)("thead",{className:"sticky top-0 Et-20 bg-white",children:(0,Et.jsxs)("vc",{children:[(0,Et.jsx)("th",{scope:"col",className:"sticky left-0 top-0 Et-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((c,d)=>{let p=new Date(e.getFullYear(),e.getMonth(),d+1);return(0,Et.jsxs)("th",{scope:"col",className:`sticky top-0 Et-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${Gr(p)?"bg-gray-200":""}`,children:[(0,Et.jsx)("div",{children:m(p)}),(0,Et.jsx)("div",{children:d+1})]},d)})]})}),(0,Et.jsx)("tbody",{children:o.map((c,d)=>(0,Et.jsxs)("vc",{children:[(0,Et.jsx)("td",{className:lm(d!==o.length-1?"border-gray-200":"","sticky left-0 Et-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsxs)(vt,{className:"h-11 w-11",children:[(0,Et.jsx)(ht,{src:c.image,alt:c.name}),(0,Et.jsx)(yt,{children:c.name.split(" ").map(p=>p[0]).join("")})]}),(0,Et.jsx)("div",{className:"ml-4",children:(0,Et.jsx)("div",{className:"font-medium text-accent",children:c.name})})]})}),[...Array(r)].map((p,u)=>{let g=new Date(e.getFullYear(),e.getMonth(),u+1),b=a.find(f=>f.userId===c.id&&new Date(f.startDate)<=g&&new Date(f.endDate)>=g);return(0,Et.jsx)("td",{className:lm(d!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Gr(g)?"bg-gray-200":"bg-white"),children:(0,Et.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${b?b.status==="approved"?"bg-green-500":b.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:b?`${c.name}: ${b.status} (${b.startDate} - ${b.endDate}) - ${b.leaveType}`:"",children:b&&b.leaveType!=="Full Day"&&(0,Et.jsx)("div",{className:`h-3 w-6 ${b.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${c.id}-${u}`)})]},c.id))})]})})})})]})}function ll({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,Dl.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,l=Array.from({length:42},(d,p)=>{let u=new Date(e.getFullYear(),e.getMonth(),p-s+1);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:a.filter(g=>new Date(g.startDate)<=u&&new Date(g.endDate)>=u)}}),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},m=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},c=()=>{t(new Date)};return(0,Et.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,Et.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Et.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Et.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Et.jsx)("div",{className:"flex items-center",children:(0,Et.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Et.jsxs)(B,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Previous month"}),(0,Et.jsx)(Zl.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Et.jsx)(B,{variant:"outline",onClick:c,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Et.jsxs)(B,{onClick:m,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Next month"}),(0,Et.jsx)(Zl.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Et.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Et.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"on"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"ue"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"ed"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"hu"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["F",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"ri"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"Et"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"un"})]})]}),(0,Et.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Et.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:l.map(d=>(0,Et.jsxs)("div",{className:n(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Et.jsx)("time",{dateTime:d.date.toISOString(),className:n("flex h-6 w-6 items-center justify-center rounded-full",d.isToday&&"bg-indigo-600 font-semibold text-white"),children:d.date.getDate()}),d.holidays.length>0&&(0,Et.jsx)("ol",{className:"mt-2 space-Et-1 overflow-visible",children:d.holidays.map(p=>(0,Et.jsx)("li",{className:"overflow-visible",children:(0,Et.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},d.date.toISOString()))}),(0,Et.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:l.map(d=>(0,Et.jsxs)("button",{type:"button",className:n(d.isCurrentMonth?"bg-white":"bg-gray-50",(d.date===o||d.isToday)&&"font-semibold",d.date===o&&"text-white",!d.date&&d.isToday&&"text-indigo-600",d.date!==o&&d.isCurrentMonth&&!d.isToday&&"text-gray-900",d.date!==o&&!d.isCurrentMonth&&!d.isToday&&"text-gray-500","flex h-14 flex-col px-3 py-2 hover:bg-gray-100 focus:Et-10"),children:[(0,Et.jsx)("time",{dateTime:d.date.toISOString(),className:n("ml-auto",d.date===o&&d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",d.date===o&&!d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:d.date.getDate()}),(0,Et.jsxs)("span",{className:"Dl-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,Et.jsx)("span",{className:"-mx-0.5 mt-auto flex flex-wrap-reverse",children:d.holidays.map(p=>(0,Et.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 w-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},d.date.toISOString()))})]})]})]})}var io=require("lucide-react");function cm(...e){return e.filter(Boolean).join(" ")}function rf({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:l,rejectLeave:i}){let[m,c]=(0,Dl.useState)("Calendar View"),d=(0,vc.useRouter)(),p=!1,u=(0,rl.parseISO)(a),g=async f=>{let v=(0,rl.format)(f,"Et-MM-yyyy"),L=new URL(window.location.href);return L.searchParams.set("date",v),d.push(L.toString()),{success:!0}};if(p)return(0,Et.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,Et.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:io.Grid,current:m==="Grid View"},{name:"Calendar View",icon:io.CalendarDays,current:m==="Calendar View"},{name:"Request Leave",icon:io.PlusCircle,current:m==="Request Leave"},{name:"Approve Leave",icon:io.CheckSquare,current:m==="Approve Leave"}];return(0,Et.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,Et.jsxs)("div",{className:"mb-8",children:[(0,Et.jsxs)("div",{className:"sm:hidden",children:[(0,Et.jsx)("select",{value:m,onChange:f=>c(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(f=>(0,Et.jsx)("option",{children:f.name},f.name))}),(0,Et.jsx)(Zl.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Et.jsx)("div",{className:"hidden sm:block",children:(0,Et.jsx)("div",{className:"border-b border-gray-200",children:(0,Et.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,Et.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&c(f.name)},className:cm(f.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",f.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":f.current?"page":void 0,children:[(0,Et.jsx)(f.icon,{className:cm(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 mr-2 h-5 w-5"),"aria-hidden":"true"}),(0,Et.jsx)("span",{children:f.name})]},f.name))})})})]}),m==="Grid View"&&(0,Et.jsx)(nl,{currentDate:u,setCurrentDate:g,holidays:e,employees:r}),m==="Calendar View"&&(0,Et.jsx)(ll,{currentDate:u,setCurrentDate:g,holidays:e}),m==="Request Leave"&&(0,Et.jsx)(il,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>s?s(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),m==="Approve Leave"&&(0,Et.jsx)(ol,{leaveRequests:o,onApprove:f=>l?l(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>i?i(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function $r({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:l}){let[i,m]=(0,Dl.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[c,d]=(0,Dl.useState)(""),[p,u]=(0,Dl.useState)(!1),[g,b]=(0,Dl.useState)(null);(0,Dl.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(i))},[e,i]);let f=async()=>{try{let x=await s(i);x.success?(u(!1),b(null)):console.error("Failed Zl save deal:",x.errors)}catch(x){console.error("Failed Zl save deal:",x)}},v=(x,D)=>{m(ie=>({...ie,[x]:D}))},L=x=>{let D=(i.categories||[]).includes(x)?(i.categories||[]).filter(ie=>ie!==x):[...i.categories||[],x];v("categories",D)},S=async()=>{if(c.trim()){let x={text:c,timestamp:new Date().toISOString()};try{let D=await l(x);if(!D.success){console.error("Failed Zl add comment:",D.errors);return}}catch(D){console.error("Failed Zl add comment:",D)}m(D=>({...D,comments:[...D.comments||[],x]})),d("")}},w=x=>{switch(x){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},k=x=>t?.find(D=>D.id===Number(x));return(0,Et.jsx)(Ot,{open:!0,children:(0,Et.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Et.jsxs)(Kt,{className:"flex flex-row items-center justify-between",children:[(0,Et.jsx)(Qt,{className:"text-2xl font-bold",children:a?.name}),(0,Et.jsxs)("div",{className:"flex space-x-2",children:[(0,Et.jsx)(B,{variant:"outline",onClick:r,children:"Close"}),(0,Et.jsxs)(B,{onClick:f,disabled:!p,children:[(0,Et.jsx)(Zl.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,Et.jsxs)(la,{className:"flex-grow pr-4",children:[(0,Et.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,Et.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,Et.jsx)(gt,{type:"number",value:i.value,onChange:x=>v("value",Number(x.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Et.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",i.value?.toLocaleString()]})}),(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,Et.jsxs)(Qa,{value:i?.assignee?.id?.toString()||"",onValueChange:x=>v("assignee",k(x)),children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select assignee"})}),(0,Et.jsx)(Na,{children:t&&t.map(x=>(0,Et.jsx)(Ca,{value:x?.id?.toString()||"",children:x.name},x.id))})]}):(0,Et.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,Et.jsx)(Zl.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,Et.jsx)("span",{children:i.assignee.name})]})]}),(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,Et.jsx)(gt,{type:"date",value:i.closureDate?.split("Et")[0]??"",onChange:x=>v("closureDate",x.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,Et.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,Et.jsx)("span",{children:i.closureDate?new Date(i.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,Et.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,Et.jsx)(Za,{value:i.description||"",onChange:x=>v("description",x.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,Et.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:i.description})]})}),(0,Et.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,Et.jsxs)(Qa,{value:i.status,onValueChange:x=>{v("status",x),b(null)},children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select status"})}),(0,Et.jsx)(Na,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(x=>(0,Et.jsx)(Ca,{value:x,children:x},x))})]}):(0,Et.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:i.status})]}),(0,Et.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,Et.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(x=>(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Jt,{id:x.id?.toString()||"",checked:(i.categories||[]).some(D=>D.id===x.id),onCheckedChange:()=>x.id!==void 0&&L(x)}),(0,Et.jsx)("label",{htmlFor:(x.id??"").toString(),className:`text-sm font-medium ${w(x.type||"sector")} px-2 py-1 rounded`,children:x.name})]},x.id))}):(0,Et.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:i.categories&&i.categories.map(x=>{let D=x;return D?(0,Et.jsx)(xt,{variant:"outline",className:w(D.type||"sector"),children:D.name},D.id):null})})]}),(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"COGE Status"}),g==="gecoStatus"?(0,Et.jsxs)(Qa,{value:i.gecoStatus??void 0,onValueChange:x=>{v("gecoStatus",x),b(null)},children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select status"})}),(0,Et.jsx)(Na,{children:["firm","forecast","other"].map(x=>(0,Et.jsx)(Ca,{value:x,children:x.charAt(0).toUpperCase()+x.slice(1)},x))})]}):(0,Et.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:i.gecoStatus?i.gecoStatus.charAt(0).toUpperCase()+i.gecoStatus.slice(1):"N/A"})]})]}),(0,Et.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,Et.jsxs)("div",{className:"grid gap-2",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,Et.jsx)(la,{className:"h-[200px] overflow-Et-auto",children:(0,Et.jsx)("div",{className:"space-Et-2",children:i.comments&&i.comments.slice().sort((x,D)=>new Date(D.timestamp||"").getTime()-new Date(x.timestamp||"").getTime()).map(x=>(0,Et.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Et.jsx)("p",{className:"text-sm text-foreground",children:x.text}),(0,Et.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[x?.author?.name," - ",new Date(x.timestamp||"").toLocaleString()]})]},x.id))})}),(0,Et.jsxs)("div",{className:"flex mt-2",children:[(0,Et.jsx)(gt,{value:c,onChange:x=>d(x.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Et.jsxs)(B,{onClick:S,className:"ml-2",children:[(0,Et.jsx)(Zl.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,Et.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(i.updatedAt||"").toLocaleString()]})]})]})]})})}function dl({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(l=>l.type==="proposition"&&(e.categories??[]).includes(l.id));return r?(0,Et.jsxs)(we,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Et.jsxs)($e,{className:"pb-1 pt-2",children:[(0,Et.jsx)(We,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,Et.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,Et.jsx)(Te,{className:"text-xs text-gray-500 pb-2",children:(0,Et.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,Et.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Et.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Et.jsxs)(we,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Et.jsxs)($e,{className:"pb-2",children:[(0,Et.jsx)("div",{className:"flex justify-between items-center",children:(0,Et.jsx)(We,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Et.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,Et.jsxs)(Te,{children:[(0,Et.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,Et.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,Et.jsx)(Zl.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,Et.jsx)("span",{children:e.assignee.name})]}),(0,Et.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Et.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Et.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,Et.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,Et.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Et.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,Et.jsx)(xt,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var Ks=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function cl({onSubmit:e}){let[t,a]=(0,Dl.useState)({name:"",intro:"",active:!1});return(0,Et.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-Et-4",children:[(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"customerName",children:"Customer Name"}),(0,Et.jsx)(gt,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"customerIntro",children:"Intro"}),(0,Et.jsx)(Za,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Jt,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,Et.jsx)(ge,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Et.jsx)(B,{type:"submit",className:"w-full",children:"Add Customer"})]})}function ml({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:l}){let[i,m]=(0,Dl.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("Et")[0],closureDate:"",comments:[],description:""}),[c,d]=(0,Dl.useState)(!1),[p,u]=(0,Dl.useState)({});(0,Dl.useEffect)(()=>{r&&m(r)},[r]);let g=()=>{let w={};return i.customer||(w.customer="Customer Et required"),i.value||(w.value="Value Et required"),i.assignee||(w.assignee="Assignee Et required"),i.closureDate||(w.closureDate="Closure Date Et required"),u(w),Object.keys(w).length===0},b=async w=>{w.preventDefault(),u({});try{if(g()){let k=await o({...i});k.success?(m({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),l?.()):u(k.errors||{})}}catch{u({submit:"An error occurred while submitting the form."})}},f=w=>{m(k=>({...k,categories:(k.categories||[]).includes(w.id)?(k.categories||[]).filter(x=>x!==w.id):[...k.categories||[],w.id]}))},v=async w=>{m({...i,customer:w});try{let k=await s(w);k.success?d(!1):u(k.errors||{})}catch{u({submit:"An error occurred while submitting the form."})}},L=w=>t?.find(k=>k.id===Number(w)),S=w=>e?.find(k=>k.id===Number(w));return(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsxs)("form",{onSubmit:b,className:"space-Et-6",children:[(0,Et.jsx)(la,{className:"h-[60vh] pr-4",children:(0,Et.jsxs)("div",{className:"space-Et-6 px-4",children:[(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"customer",children:"Customer"}),(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsxs)(Qa,{value:i.customer?.id?.toString(),onValueChange:w=>m({...i,customer:S(w)}),children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select customer"})}),(0,Et.jsx)(Na,{children:e.map(w=>(0,Et.jsx)(Ca,{value:w.id?.toString()||"",children:w.name},w.id))})]}),(0,Et.jsx)(B,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,Et.jsx)(Zl.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"value",children:"Value"}),(0,Et.jsx)(gt,{id:"value",type:"number",value:i.value||"",onChange:w=>m({...i,value:Number.parseFloat(w.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"assignee",children:"Assignee"}),(0,Et.jsxs)(Qa,{value:i.assignee?.id?.toString(),onValueChange:w=>m({...i,assignee:L(w)}),children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select assignee"})}),(0,Et.jsx)(Na,{children:t&&t.map(w=>(0,Et.jsx)(Ca,{value:w.id?.toString()||"",children:w.name},w.id))})]}),p.assignee&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"description",children:"Description"}),(0,Et.jsx)(Za,{id:"description",value:i.description||"",onChange:w=>m({...i,description:w.target.value}),placeholder:"Enter deal description"})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{children:"Categories"}),(0,Et.jsx)("div",{className:"space-Et-4",children:["proposition","source","sector"].map(w=>(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)("h4",{className:"text-sm font-medium",children:w.charAt(0).toUpperCase()+w.slice(1)}),(0,Et.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(k=>k.type===w).map(k=>(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Jt,{id:k.id.toString(),checked:i.categories?.includes(k.id),onCheckedChange:()=>f(k)}),(0,Et.jsx)("label",{htmlFor:k.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:k.name})]},k.id))})]},w))})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"closureDate",children:"Closure Date"}),(0,Et.jsx)(gt,{id:"closureDate",type:"date",value:i.closureDate||"",onChange:w=>m({...i,closureDate:w.target.value})}),p.closureDate&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,Et.jsx)(B,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,Et.jsx)(Ot,{open:c,onOpenChange:d,children:(0,Et.jsxs)(Dt,{children:[(0,Et.jsx)(Kt,{children:(0,Et.jsx)(Qt,{children:"Add New Customer"})}),(0,Et.jsx)(cl,{onSubmit:v})]})})]})}function Wr({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:l,calculateWeightedValue:i,addNewDeal:m,onAddCustomer:c,compact:d=!1}){let[p,u]=(0,Dl.useState)(!1);return(0,Et.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Et.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),m&&(0,Et.jsxs)(Ot,{open:p,onOpenChange:u,children:[(0,Et.jsx)(ls,{asChild:!0,children:(0,Et.jsxs)(B,{className:"mb-4 w-full",children:[(0,Et.jsx)(Zl.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,Et.jsxs)(Dt,{children:[(0,Et.jsx)(Kt,{children:(0,Et.jsx)(Qt,{children:"Add New Deal"})}),(0,Et.jsx)(ml,{customers:o,users:a,categories:r,onSubmit:m,onAddCustomer:c??(async()=>Promise.resolve({success:!1})),onClose:()=>u(!1)})]})]}),(0,Et.jsx)(Ks.Droppable,{droppableId:e,isDropDisabled:!1,children:g=>(0,Et.jsxs)("div",{ref:g.innerRef,...g.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((b,f)=>(0,Et.jsx)(Ks.Draggable,{draggableId:b.id.toString(),index:b.id,children:v=>(0,Et.jsx)("div",{ref:v.innerRef,...v.draggableProps,...v.dragHandleProps,children:(0,Et.jsx)(dl,{deal:b,customer:b.customer,categories:r,onClick:()=>s(b),compact:d})})},b.id.toString())),g.placeholder]})}),(0,Et.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,Et.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Et.jsxs)("span",{className:"text-green-600",children:["\xA3",l(t).toLocaleString()]})]}),(0,Et.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Et.jsxs)("span",{className:"text-blue-600",children:["\xA3",i(t,e).toLocaleString()]})]})]})]})}var sf=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function nf({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,l]=(0,Dl.useState)(null),i=p=>(e.deals??[]).filter(u=>u.status===p),m=p=>p.reduce((u,g)=>u+(g.value||0),0),c=(p,u)=>{let g={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return p.reduce((b,f)=>b+(f.value||0)*g[u],0)},d=(0,Dl.useCallback)(p=>{let{source:u,destination:g}=p;if(!g||u.droppableId===g.droppableId&&u.index===g.index)return;let b=u.droppableId,f=g.droppableId,v=e.deals?.filter(S=>S.id===u.index)[0],L=[...e.deals??[]];v&&(v.status=f,a(v))},[a]);return(0,Et.jsx)(Ks.DragDropContext,{onDragEnd:d,children:(0,Et.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Et.jsx)("div",{className:"flex space-x-4 pb-4",children:sf.filter(p=>p!=="Lost").map(p=>{let u=i(p);return(0,Et.jsx)(Wr,{status:p,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:l,calculateColumnValue:m,calculateWeightedValue:c,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:r},p)})}),s&&(0,Et.jsx)($r,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>l(null),onSave:a,onAddComment:p=>o(s.id.toString(),p)})]})})}var lf=["firm","forecast","other"];function df({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,Dl.useState)(null),s=c=>(e.deals??[]).filter(d=>d.gecoStatus===c).filter(d=>d.status!=="Lost"&&d.status!=="Cold"),l=c=>c.reduce((d,p)=>d+(p.value||0),0),i=(c,d)=>{let p={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return c.reduce((u,g)=>u+(g.value||0)*(p[g.status]??0),0)},m=(0,Dl.useCallback)(c=>{let{source:d,destination:p}=c;if(!p||d.droppableId===p.droppableId&&d.index===p.index)return;let u=d.droppableId,g=p.droppableId,b=e.deals?.filter(v=>v.id===d.index)[0],f=[...e.deals??[]];b&&(b.gecoStatus=g,t(b))},[t]);return(0,Et.jsx)(Ks.DragDropContext,{onDragEnd:m,children:(0,Et.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Et.jsx)("div",{className:"flex space-x-4 pb-4",children:lf.map(c=>{let d=s(c);return(0,Et.jsx)(Wr,{status:c,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:l,calculateWeightedValue:i,compact:!0},c)})}),o&&(0,Et.jsx)($r,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:c=>a(o.id.toString(),c)})]})})}var Cm=h(require("react"));function xm({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,Dl.useState)(null),[s,l]=(0,Dl.useState)(!1),[i,m]=(0,Dl.useState)(null),c=async(p=!0)=>{if(e){p&&l(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed Zl fetch task: ${u.statusText}`);let g=await u.json();r(g)}catch(u){console.error("Error fetching task:",u),m(u instanceof Error?u:new Error("Unknown error occurred"))}finally{p&&l(!1)}}},d=()=>c(!1);return(0,Dl.useEffect)(()=>{e&&c(!0);let p=null;return e&&t&&(p=setInterval(d,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:s,error:i}}var cf=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"}},mf=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function pl({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let l=null,i=!0,m=s,c=o!==void 0?o:!0;if(l=r||{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:c,taskData:l,error:m}),c){let{task:g,loading:b,error:f}=xm({taskId:t,system:a});l=g,i=b,m=f}else i=!1;let d=cf(l?.status||"todo"),p=mf(l?.status||"todo"),u=l?.dateLogged||new Date().toISOString();try{let g=new Date(l?.dateLogged||"");isNaN(g.getTime())||(u=(0,rl.formatDistanceToNow)(g,{addSuffix:!0}))}catch{}return(0,Et.jsxs)(we,{className:n("w-full max-w-md shadow-md",m&&"border border-destructive"),children:[(0,Et.jsxs)($e,{className:"pb-2",children:[(0,Et.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Et.jsx)(We,{className:"text-lg font-semibold",children:i?"Loading...":l?.name||"Task"}),(0,Et.jsx)(xt,{className:`${d}`,children:p})]}),l?.project&&(0,Et.jsxs)(Nn,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,Et.jsx)(Te,{className:"pb-2",children:i?(0,Et.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):m?(0,Et.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Et.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,Et.jsx)(Cn,{className:"pt-2 flex items-center justify-between",children:(0,Et.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Et.jsx)(Zl.Clock,{className:"h-3 w-3 mr-1"}),(0,Et.jsxs)("span",{children:["Created ",u]}),(0,Et.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Et.jsxs)("span",{children:["Task #",t]})]})})]})}var pf={task:pl},uf=`
|
|
19
|
+
dark bg-background text-primary`,children:[(0,Et.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Et.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Et.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,Et.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,Et.jsx)("div",{ref:s,className:"preview-container"})]})},Ic=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=zo(e),o=(0,Dl.useRef)(null),r=(0,Dl.useRef)(null),s=(0,Dl.useRef)(new sy.Previewer),[l,i]=(0,Dl.useState)(0),c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,Dl.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(p=>i(p.pageCount)).catch(p=>console.error("Paged.js error:",p)))},[t]);return(0,Dl.useEffect)(()=>{s.current=new sy.Previewer,d()},[d,t]),(0,Dl.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,Et.jsxs)("div",{className:"pagedjs-container",children:[(0,Et.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:c.map((p,u)=>(0,Et.jsx)(Et.Fragment,{children:u===0?(0,Et.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,Et.jsx)(Hr,{hero:e.hero,title:e.title})},u):(0,Et.jsxs)("section",{className:n("pagedjs-section normal-page h-[699px]",`h-[${Lu("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,Et.jsx)(zr,{title:p.blockName}),(0,Et.jsx)(oo,{blocks:[p],fill:!0})]},u)}))}),(0,Et.jsx)("div",{ref:o,className:"preview-container"})]})};var On=h(require("clsx"));function Bu({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:l,loading:i=!1,LinkComponent:m,...c}){let p=m?u=>(0,Et.jsx)(m,{...u}):l?({href:u,children:g,...b})=>(0,Et.jsx)("button",{onClick:()=>l&&l(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:g}):u=>(0,Et.jsx)("a",{...u});return(0,Et.jsxs)(mo,{...c,variant:"inset",children:[(0,Et.jsx)(po,{children:(0,Et.jsx)(bt,{children:(0,Et.jsx)(Ze,{children:i?(0,Et.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Et.jsx)(Me,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Et.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Et.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Et.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),i&&(0,Et.jsxs)($a,{children:[(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"}),(0,Et.jsx)(Me,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Et.jsxs)($a,{children:[e&&!i&&e.map((u,g)=>(0,Et.jsx)(Eu,{subNav:u,pathName:r,Link:p},g)),(0,Et.jsx)(zt,{className:"mt-auto",children:(0,Et.jsx)(Yt,{children:(0,Et.jsx)(bt,{children:t&&!i&&t.map(u=>(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Ht,{asChild:!0,size:"sm",children:(0,Et.jsxs)(p,{href:u.url||"",children:[u.icon&&(0,Et.jsx)(u.icon,{}),(0,Et.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Et.jsx)(uo,{})]})}function Eu({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsx)(zt,{className:"py-0",children:(0,Et.jsx)(bt,{children:(0,Et.jsx)(ba,{asChild:!0,defaultOpen:o.isActive,children:(0,Et.jsxs)(Ze,{children:[(0,Et.jsx)(Ht,{asChild:!0,tooltip:o.label,className:(0,On.default)(r&&"font-bold text-accent"),children:(0,Et.jsxs)(a,{href:o.url,children:[o.icon&&(0,Et.jsx)(o.icon,{}),(0,Et.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(ja,{asChild:!0,children:(0,Et.jsxs)(vr,{className:"data-[state=open]:rotate-90",children:[(0,Et.jsx)(Zl.ChevronRight,{}),(0,Et.jsx)("span",{className:"Dl-only",children:"Toggle"})]})}),(0,Et.jsx)(_a,{children:(0,Et.jsx)(Wa,{children:o.links?.map(s=>(0,Et.jsx)(Ua,{children:(0,Et.jsx)(Va,{asChild:!0,className:(0,On.default)(s.url===t&&"font-bold text-accent"),children:(0,Et.jsx)(a,{href:s.url,children:(0,Et.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var Bc=h(require("clsx"));var zu=()=>(0,Et.jsx)(et,{iconName:"github",size:"10x"});function Hu({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:l,onPrintDocument:i,onGithubClick:m,onNavClick:c,LinkComponent:d,...p}){let b=d?f=>(0,Et.jsx)(d,{...f}):c?({item:f,children:v,...L})=>(0,Et.jsx)("button",{onClick:()=>c&&c(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...L,children:v}):f=>(0,Et.jsx)("a",{href:f.href,...f});return(0,Et.jsxs)(mo,{side:"right",variant:"inset",...p,children:[(0,Et.jsxs)(po,{className:"border-b border-sidebar-border",children:[(0,Et.jsxs)(bt,{className:"flex-row space-x-1",children:[(0,Et.jsx)(Ze,{children:(0,Et.jsxs)(Ht,{onClick:s,children:[(0,Et.jsx)(Zl.FilePlus,{})," ",(0,Et.jsx)("span",{children:"Add Document"})]})}),m&&(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Ht,{onClick:m,tooltip:"Open in GitHub",children:(0,Et.jsx)(zu,{})})})]}),(0,Et.jsxs)(bt,{className:"flex-row space-x-1",children:[(0,Et.jsx)(Ze,{className:"w-5/12",children:(0,Et.jsxs)(Ht,{onClick:()=>l(),variant:r?"outline":"default",className:(0,Bc.default)(r&&"text-accent"),children:[(0,Et.jsx)(Zl.Edit,{})," ",(0,Et.jsx)("span",{children:"Edit"})]})}),(0,Et.jsx)(Ze,{className:"w-5/12",children:(0,Et.jsxs)(Ht,{onClick:i,children:[(0,Et.jsx)(Zl.Printer,{})," ",(0,Et.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{asChild:!0,children:(0,Et.jsxs)(ja,{children:["Editor Controls",(0,Et.jsx)(Zl.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(_a,{children:a})})]})}),(0,Et.jsx)(br,{className:"mx-0"})]}),(0,Et.jsxs)($a,{className:"overflow-auto",children:[o&&(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{children:"Related Content"}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(bt,{children:Array.from({length:3}).map((f,v)=>(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Me,{className:"bg-gray-200 w-full h-10"})},v))})})]}),(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{children:"Table of Contents"}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(bt,{children:Array.from({length:3}).map((f,v)=>(0,Et.jsx)(Ze,{children:(0,Et.jsx)(Me,{className:"bg-gray-200 w-full h-10"})},v))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{asChild:!0,children:(0,Et.jsxs)(ja,{children:["Related Content",(0,Et.jsx)(Zl.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(_a,{children:(0,Et.jsx)(bt,{children:e&&Object.keys(e).map(f=>(0,Et.jsxs)(Ze,{children:[(0,Et.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,Et.jsx)(Wa,{children:e[f].map(v=>(0,Et.jsx)(Ua,{children:(0,Et.jsx)(Va,{asChild:!0,isActive:!1,size:"sm",children:(0,Et.jsxs)(b,{href:v.url,item:v,className:"flex justify-between items-center w-full text-xs",children:[(0,Et.jsx)("span",{children:v.label}),v.type==="note"&&(0,Et.jsx)(Zl.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),v.type==="draft"&&(0,Et.jsx)(et,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},v.label))})]},f))})})})]})}),t&&!o&&(0,Et.jsx)(ba,{defaultOpen:!0,className:"group/collapsible",children:(0,Et.jsxs)(zt,{children:[(0,Et.jsx)(ha,{asChild:!0,children:(0,Et.jsxs)(ja,{children:["Table of Contents",(0,Et.jsx)(Zl.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Et.jsx)(Yt,{children:(0,Et.jsx)(_a,{children:(0,Et.jsx)(bt,{children:t.map(f=>(0,Et.jsxs)(Ze,{children:[(0,Et.jsx)(Ht,{asChild:!0,children:(0,Et.jsx)("a",{href:`#${f.url}`,className:"text-xs",children:f.title})}),f.items?.length?(0,Et.jsx)(Wa,{children:f.items.map(v=>(0,Et.jsx)(Ua,{children:(0,Et.jsx)(Va,{asChild:!0,isActive:v.isActive,size:"sm",children:(0,Et.jsx)("a",{href:`#${v.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,Et.jsx)("span",{children:v.title})})})},v.title))}):null]},f.title))})})})]})})]}),(0,Et.jsx)(uo,{})]})}var zc=h(require("next/image"));function Fu({title:e,members:t}){return(0,Et.jsx)(we,{className:"mb-6",children:(0,Et.jsxs)("div",{className:"p-6",children:[(0,Et.jsxs)("div",{className:"flex items-center mb-4",children:[(0,Et.jsx)(Zl.Users,{className:"w-6 h-6 text-accent mr-2"}),(0,Et.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Et.jsx)("div",{className:"space-Et-4",children:t.map((a,o)=>(0,Et.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Et.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,Et.jsx)(zc.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Et.jsxs)("div",{children:[(0,Et.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Et.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var Hc=h(require("next/link"));var Ou=({links:e,title:t="Related Content"})=>(0,Et.jsxs)(we,{children:[(0,Et.jsx)($e,{children:(0,Et.jsx)(We,{className:"text-accent",children:t})}),(0,Et.jsx)(Te,{children:(0,Et.jsx)("nav",{className:"flex flex-col space-Et-2",children:e.map((a,o)=>(0,Et.jsxs)(Hc.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,Et.jsx)(Zl.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var jn=n("grid h-[45px] w-[45px] place-items-center border border-[#3b3b3b] font-secondary text-base text-foreground rounded-full transition-colors duration-300 hover:bg-accent hover:border-accent hover:text-accent-foreground");function _n({pages:e}){let t=(0,vc.useSearchParams)(),a=(0,vc.usePathname)(),{replace:o}=(0,vc.useRouter)(),{totalPages:r,page:s}=e,[l,i]=(0,Dl.useState)({start:s>3?s-3:1,end:s+2}),m=p=>{p==="left"&&l.start>1?i(u=>({start:u.start-1,end:u.end-1})):p==="right"&&l.end<r&&i(u=>({start:u.start+1,end:u.end+1}))};function c(p){let u=new URLSearchParams(t);p?u.set("page",p):u.delete("page"),o(`${a}?${u.toString()}`)}if(r<=1)return null;let d=[];for(let p=l.start;p<=l.end;p++)d.push(p);return(0,$t.jsx)("div",{className:"mt-12",children:(0,$t.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[l.start>1&&(0,$t.jsx)("li",{children:(0,$t.jsx)("button",{className:n(jn,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>m("left"),children:(0,$t.jsx)(Hd.FaArrowLeft,{})})}),d.map((p,u)=>(0,$t.jsx)("li",{children:(0,$t.jsx)("a",{className:n(jn,p===s?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:g=>{g.preventDefault(),c(p.toString())},children:p})},u)),l.end<r&&(0,$t.jsx)("li",{children:(0,$t.jsx)("button",{className:n(jn,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>m("right"),children:(0,$t.jsx)(Hd.FaArrowRight,{})})})]})})}var jy=n("transition-colors duration-400 hover:text-primary ease-in-out");function Gn({title:e,links:t}){let a=(0,vc.useSearchParams)(),o=(0,vc.usePathname)(),{replace:r}=(0,vc.useRouter)();function s(l){let i=new URLSearchParams(a);l?i.set("category",l):i.delete("category"),r(`${o}?${i.toString()}`)}return(0,Et.jsxs)(we,{children:[(0,Et.jsx)($e,{children:(0,Et.jsx)(We,{className:"text-accent",children:e&&e})}),(0,Et.jsx)(Te,{children:t&&t.length>0&&(0,Et.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Et.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((l,i)=>(0,Et.jsxs)("li",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:pt-0 hover:cursor-pointer",onClick:m=>{m.preventDefault(),s(l.href)},children:[l.label,(0,Et.jsx)(Zl.ExternalLink,{className:"ml-1 h-3 w-3"})]},i))})})})]})}function Wn({types:e}){let[t,a]=(0,Dl.useState)(e&&e[0].href),o=(0,vc.useSearchParams)(),r=(0,vc.usePathname)(),{replace:s}=(0,vc.useRouter)();function l(i){let m=new URLSearchParams(o);i?m.set("type",i):m.delete("type"),a(i),s(`${r}?${m.toString()}`)}return(0,$n.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 mb-6",children:e&&e.map((i,m)=>(0,$n.jsx)(B,{variant:i.href===t?"default":"ghost",className:n("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",i.href===t&&"bg-accent text-accent-foreground"),onClick:()=>l(i.href),children:i.label},m))})}var Gc=h(require("next/image"));var Un=({links:e,media:t,children:a,richText:o})=>(0,Et.jsx)("div",{children:(0,Et.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,Et.jsxs)("div",{className:"fixed inset-0 container mt-24 mb-8 Et-10 flex items-start justify-center",children:[a||o&&(0,Et.jsx)(q,{className:"max-w-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,Et.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,Et.jsx)("li",{children:(0,Et.jsx)(Zt,{...r})},s))})]}),(0,Et.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,Et.jsx)(ta,{fill:!0,imgClassName:"Et-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Et.jsx)("div",{children:(0,Et.jsx)(Gc.default,{className:"-Et-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Et.jsx)("span",{className:"absolute inset-0 bg-gradient-Zl-b from-white dark:from-black"})]}),(0,Et.jsx)(ju,{})]})}),ju=()=>(0,Et.jsx)("div",{className:"w-full h-[1240px] Et-10",children:(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",style:{fontSize:0,float:"left",zIndex:20},className:"absolute -bottom-[2px] flex",children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Et.jsx)("rect",{Et:"330",width:"1920",height:"7",fill:"white"})," "]})});var Vn=h(require("next/image"));var _u=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,Et.jsx)(Vn.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,Et.jsx)("div",{children:(0,Et.jsx)(Vn.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Xn=({links:e,media:t,children:a,richText:o})=>(0,Et.jsxs)("div",{className:"relative bg-brand-one pb-12 mt-20 pt-10",children:[t&&(0,Et.jsx)(_u,{media:t}),(0,Et.jsx)("div",{className:"mx-0 min-w-full relative Et-9",children:(0,Et.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,Et.jsx)(q,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Yn=({children:e,richText:t})=>(0,Et.jsx)("div",{className:"min-w-full py-10 bg-muted mt-24",children:(0,Et.jsx)("div",{className:"container",children:e||t&&(0,Et.jsx)(q,{content:t,enableGutter:!1})})});var Wc=h(require("react")),Uc=h(require("next/image"));var $c=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,l=r<10?`0${r}`:r,i=a.getFullYear();return`${l}/${s}/${i}`};var Os=e=>{let t=e?new Date(e):new Date,a=new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(t),o=t.getDate(),r=new Intl.DateTimeFormat("en-US",{month:"short"}).format(t);return`${a} ${o}${(l=>{if(l>3&&l<21)return"th";switch(l%10){case 1:return"st";case 2:return"nd";case 3:return"$l";default:return"th"}})(o)} ${r}`};var Gu=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,Et.jsxs)("div",{className:"relative grid pt-24",children:[(0,Et.jsx)("div",{className:"relative Et-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground pt-24 p-6 lg:p-12",children:(0,Et.jsxs)("div",{className:"container mx-auto",children:[(0,Et.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,Et.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Et.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Et.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,Et.jsx)("p",{children:o.map((l,i)=>(0,Et.jsxs)(Wc.default.Fragment,{children:[l.name,i<o.length-2&&", ",i===o.length-2&&(o.length>2?", and ":" and ")]},l.id))})]}),r&&(0,Et.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Et.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,Et.jsx)("time",{dateTime:r,children:$c(r)})]}),t&&t.length>0&&(0,Et.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Et.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,Et.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((l,i)=>typeof l=="object"&&l!==null&&(0,Et.jsx)(xt,{className:"px-3 py-1 mx-1",children:l.title||"Untitled category"},l.id||i))})]})]})]})}),(0,Et.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,Et.jsx)(Uc.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Et.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-Zl-t from-background dark:from-black Zl-transparent"})]})]})};var js=require("@heroicons/react/20/solid");var qn=h(require("next/image"));function Ct({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=n("container",t&&"full-width",a&&"Zl-padding",o);return(0,Et.jsx)("div",{className:r,children:e})}var Xc=require("next-themes");function $u({children:e,...t}){return(0,Et.jsx)(Xc.ThemeProvider,{...t,children:e})}var Mt=({position:e,className:t=""})=>{let a=["","scale(-1, 1)","scale(1, -1)","scale(-1, -1)"],o=a[Math.floor(Math.random()*a.length)];if(e==="header")return(0,Et.jsx)("div",{className:"w-full h-[1240px] Et-20",children:(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",preserveAspectRatio:"xMidYMax meet",style:{fontSize:0,float:"left"},className:n(t,"absolute -bottom-[2px] flex"),children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Et.jsx)("rect",{Et:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Et.jsxs)("div",{className:"w-full Et-20 aspect-[1920/332] overflow-hidden ",children:[(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:n(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Et.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] Et-10 bg-white"})]});if(e==="dark-top")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 content-end block overflow-hidden",children:(0,Et.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:n(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});if(e==="dark-bottom")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 content-start block overflow-hidden bg-white",children:(0,Et.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"scale(1, -1)"},className:n(t,"w-full block overflow-hidden"),children:(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="light-bottom")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 content-end block overflow-hidden",children:(0,Et.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain"},className:n(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="bottom-left"||e==="bottom-right")return(0,Et.jsx)("div",{className:"w-full aspect-[1920/332] Et-20 relative -bottom-[1px]",children:(0,Et.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"rotateX(180deg)"},className:n(t,"w-full block overflow-hidden"),children:(0,Et.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Wu=({className:e})=>(0,Et.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:n(e,"absolute w-full h-full"),children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("mask",{id:"mask",children:[(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Et.jsx)("polygon",{fill:"white",points:"0 0 0 201.561092 0 1036.200679 0 1087.625789 1255.099121 1240.909908 1920 908.450984 1920 201.561092 1920 0 0 0"})]})}),(0,Et.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var Kn=({title:e,image:t})=>(0,Et.jsx)("div",{children:(0,Et.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,Et.jsx)("div",{className:"fixed inset-0 container mt-24 mb-8 Et-10 flex items-start justify-start",children:(0,Et.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Et.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,Et.jsx)(qn.default,{priority:!0,src:t.src,alt:`${process.env.NEXT_PUBLIC_SITE_NAME}`,layout:"fill",style:{objectFit:"cover"},sizes:"100vw",className:"pointer-events-none object-cover"}),t&&typeof t=="string"&&(0,Et.jsx)("div",{children:(0,Et.jsx)(qn.default,{className:"-Et-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Et.jsx)("span",{className:"absolute inset-0 bg-gradient-Zl-b from-white dark:from-black"})]}),(0,Et.jsx)(Mt,{className:"text-black Et-10",position:"header"})]})});var Uu={highImpact:Un,lowImpact:Yn,mediumImpact:Xn,sectionHero:Kn},Vu=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Uu[t];return a?(0,Et.jsx)(a,{...e}):null};function Xu({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Et.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Et.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,Et.jsx)("li",{children:(0,Et.jsx)("div",{children:(0,Et.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Et.jsx)(js.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Et.jsx)("span",{className:"Dl-only",children:"Home"})]})})}),t.map((a,o)=>(0,Et.jsx)("li",{children:(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsx)(js.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Et.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,Et.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Et.jsx)(Et.Fragment,{})}var It=require("@headlessui/react"),Gs=require("@heroicons/react/24/outline");var Yu=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Et.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Et.jsxs)("span",{className:"relative",children:[e,(0,Et.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,Et.jsxs)(It.Popover,{children:[(0,Et.jsxs)(It.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Et.jsxs)("span",{className:"relative",children:[e,(0,Et.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,Et.jsx)(js.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Et.jsxs)(It.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -Et-10 bg-popover mt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-Et-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,Et.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 Et-50",children:t&&t.map(r=>(0,Et.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Et.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Et.jsx)(qc,{icon:r.icon,size:"4x"})}),(0,Et.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Et.jsx)("span",{className:"absolute inset-0"})]}),(0,Et.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Et.jsx)("div",{className:"bg-gray-50",children:(0,Et.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Et.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Et.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Et.jsx)(qc,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),qc=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Et.jsx)(et,{...e,size:a});if("src"in e)return(0,Et.jsx)("div",{className:n(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Et.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},rr=Yu;var _s=["light","dark","green"];function qu({title:e,logo:t,menuItems:a}){let[o,r]=(0,Dl.useState)(!1),[s,l]=(0,Dl.useState)(!1),[i,m]=(0,Dl.useState)("light"),c=t?.split(".")[0],d=t?.split(".")[1],[p,u]=(0,Dl.useState)(`${c}.${d}`),g=f=>{_s.includes(f)?u(f==="light"?`${c}.${d}`:`${c}-${f}.${d}`):u(`${c}.${d}`)};(0,Dl.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";m(f),document.documentElement.setAttribute("class",f),g(f)},[]);let b=()=>{let f=_s[(_s.indexOf(i)+1)%_s.length];m(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),g(f)};return(0,Et.jsxs)("header",{className:"relative isolate Et-10 bg-background h-14",children:[(0,Et.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Et.jsx)("div",{className:"flex lg:flex-1",children:(0,Et.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:e}),(0,Et.jsx)("img",{alt:e,src:p,className:"h-9 w-auto"})]})}),(0,Et.jsx)("div",{className:"flex lg:hidden",children:(0,Et.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Open main menu"}),(0,Et.jsx)(Gs.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,Et.jsx)(It.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(f=>(0,Et.jsx)(rr,{...f},f.name))}),(0,Et.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Et.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:i==="dark"?(0,Et.jsx)(js.SunIcon,{className:"h-6 w-6"}):i==="green"?(0,Et.jsx)(js.MoonIcon,{className:"h-6 w-6"}):(0,Et.jsx)(js.SunIcon,{className:"h-6 w-6"})})})]}),(0,Et.jsxs)(It.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,Et.jsx)("div",{className:"fixed inset-0 Et-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Et.jsxs)(It.DialogPanel,{className:"fixed inset-Et-0 right-0 Et-20 w-full overflow-Et-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Your Company"}),(0,Et.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,Et.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Close menu"}),(0,Et.jsx)(Gs.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Et.jsx)("div",{className:"mt-6 flow-root",children:(0,Et.jsx)("div",{className:"-my-6 divide-Et divide-gray-500/10",children:(0,Et.jsx)("div",{className:"space-Et-2 py-6",children:a.map(f=>(0,Et.jsx)(Ku,{...f},f.name))})})})]})]})]})}function Ku({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Et.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,Et.jsxs)(It.Disclosure,{as:"div",className:"-mx-3",children:[(0,Et.jsx)(It.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Et.jsx)(It.DisclosurePanel,{className:"mt-2 space-Et-2",children:t&&t.map(r=>(0,Et.jsx)(It.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function Qu({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let l=()=>{let i=document.getElementById("next-section");i&&i.scrollIntoView({behavior:"smooth"})};return(0,Et.jsx)("div",{children:(0,Et.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,Et.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full Et-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Et.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Et.jsx)("div",{className:"fixed inset-0 h-full Et-10 flex flex-col items-start justify-center text-white px-4",children:(0,Et.jsx)(Ct,{children:(0,Et.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 Et-0 md:mb-0",children:[(0,Et.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:r&&r}),(0,Et.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:s&&s})]})})}),(0,Et.jsx)(Mt,{className:"text-black Et-10",position:"header"})]})})}var Qn=h(require("next/image"));function ro({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Et.jsxs)(Qe,{href:"/",className:n(a?"py-1":"py-2"),children:[(0,Et.jsx)(Qn.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,Et.jsx)(Qn.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function Jn({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[l,i]=(0,Dl.useState)(!1),[m,c]=(0,Dl.useState)(""),d=["light","dark"],{theme:p,setTheme:u}=(0,Xc.useTheme)();(0,Dl.useEffect)(()=>{c(p||"dark")},[p]);let g=()=>{let b=d[(d.indexOf(m)+1)%d.length];c(b),u(b)};return(0,Dl.useEffect)(()=>{let b=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsx)("header",{className:`Et-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-Et-0":"-translate-Et-full bg-transparent"}`,children:(0,Et.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Et.jsxs)("div",{className:n("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,Et.jsx)(ro,{logoDark:a,logoLight:t}),(0,Et.jsx)(It.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(b=>(0,Et.jsx)(rr,{...b},b.name))}),r&&(0,Et.jsx)("button",{className:"fixed right-4 Et-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:g,children:(0,Et.jsxs)("div",{className:"relative",children:[(0,Et.jsx)($s.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Et.jsx)($s.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Zn=["light","dark"];function el({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,Dl.useState)(!1),{theme:l,setTheme:i}=(0,Xc.useTheme)(),[m,c]=(0,Dl.useState)(!1),[d,p]=(0,Dl.useState)("light");(0,Dl.useEffect)(()=>{let g=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",g,{passive:!0}),()=>window.removeEventListener("scroll",g)},[]),(0,Dl.useEffect)(()=>{p(l||"dark")},[l]);let u=()=>{let g=Zn[(Zn.indexOf(d)+1)%Zn.length];p(g),i(g)};return(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsxs)("header",{className:`Et-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-Et-0":"-translate-Et-full bg-transparent"}`,children:[(0,Et.jsx)("nav",{className:n("backdrop-blur-sm text-white p-0",m&&"hidden"),children:(0,Et.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&Et.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,Et.jsx)(ro,{logoDark:t,logoLight:e,mobile:!0}),(0,Et.jsx)("div",{className:"flex items-center space-x-4",children:(0,Et.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"fixed right-4 Et-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Open main menu"}),(0,Et.jsx)(Gs.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Et.jsxs)(It.Dialog,{open:m,onClose:c,className:"lg:hidden",children:[(0,Et.jsx)("div",{className:"fixed inset-0 Et-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Et.jsxs)(It.DialogPanel,{className:"fixed inset-Et-0 right-0 Et-20 w-full overflow-Et-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Et.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Et.jsx)(ro,{logoDark:t,logoLight:e,mobile:!0}),(0,Et.jsxs)("button",{type:"button",onClick:()=>c(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Close menu"}),(0,Et.jsx)(Gs.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Et.jsx)("div",{className:"mt-6 flow-root",children:(0,Et.jsx)("div",{className:"-my-6 divide-Et divide-gray-500/10",children:(0,Et.jsx)("div",{className:"space-Et-2 px-2 py-6",children:a&&a.map(g=>(0,Et.jsx)(Ju,{...g},g.name))})})})]})]})]})})}function Ju({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Et.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,Et.jsxs)(It.Disclosure,{as:"div",className:"-mx-3",children:[(0,Et.jsx)(It.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Et.jsx)(It.DisclosurePanel,{className:"mt-2 space-Et-2",children:t&&t.map(r=>(0,Et.jsx)(It.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var Gx=n("text-base/[1.75] transition-transform duration-350 hover:-translate-Et-1 block px-4"),em=n("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),tl=n("bg-brand-green rounded-full p-3 mr-4 text-2xl"),al=n("flex items-center text-white gap-3"),Us=n("transition-colors duration-300 hover:text-accent dark:hover:text-white");function Zu({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:l,footerBottom:i}=t,m=void 0;return(0,Et.jsxs)("footer",{className:n("sticky Et-2 flex flex-col dark bg-black overflow-hidden pt-12 prose-base",e),children:[(0,Et.jsx)("div",{className:"py-16 md:py-20",children:(0,Et.jsx)("div",{className:"container",children:(0,Et.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Et.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,Et.jsx)(ro,{logoDark:o,logoLight:a}),(0,Et.jsx)("p",{className:"mb-7 mt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,Et.jsx)("nav",{"aria-label":"social links",children:(0,Et.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((c,d)=>(0,Et.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,Et.jsx)(Qe,{"aria-label":c.href,className:"text-2xl",href:c.href,openNewTab:!0,children:(0,Et.jsx)("span",{children:c.icon})})},d))})})]}),(0,Et.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,Et.jsx)("h3",{className:em,children:s.title}),s.links&&s.links.length>0&&(0,Et.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Et.jsx)("ul",{className:"grid pl-0 gap-2",children:s.links.map(c=>(0,Et.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,Et.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,Et.jsx)(Hd.FaChevronRight,{})}),(0,Et.jsx)(Qe,{href:c.href,openNewTab:c.openNewTab,className:Us,children:c.label})]},c.label))})})]}),(0,Et.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,Et.jsx)("h3",{className:em,children:l.title}),(0,Et.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,Et.jsxs)("li",{className:al,children:[(0,Et.jsx)("span",{className:tl,children:(0,Et.jsx)(Hd.FaPaperPlane,{})}),(0,Et.jsx)("address",{className:"not-italic",children:l.location})]}),(0,Et.jsxs)("li",{className:al,children:[(0,Et.jsx)("span",{className:tl,children:(0,Et.jsx)(Hd.FaEnvelope,{})}),l.mails&&l.mails.length>0&&(0,Et.jsx)("div",{className:"grid gap-1",children:l.mails.map((c,d)=>(0,Et.jsx)("a",{href:`mailto:${c}`,className:Us,children:c},d))})]}),l.phoneNumbers&&l.phoneNumbers.length>0&&(0,Et.jsxs)("li",{className:al,children:[(0,Et.jsx)("span",{className:tl,children:(0,Et.jsx)(Hd.FaPhone,{})}),(0,Et.jsx)("div",{className:"grid gap-1",children:l.phoneNumbers.map((c,d)=>(0,Et.jsx)("a",{href:`tel:${c.split(" ").join("")}`,className:Us,children:c},d))})]})]})]})]})})}),(0,Et.jsx)("div",{className:"flex min-h-[90px] items-center border-t border-accent-800 border-opacity-20 py-5 dark:border-body dark:border-opacity-20",children:(0,Et.jsx)("div",{className:"container",children:(0,Et.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-Et-4 md:gap-x-10",children:[(0,Et.jsx)("p",{children:i.copyrightText}),i.links&&i.links.length>0&&(0,Et.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Et.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:i.links.map(c=>(0,Et.jsx)("li",{children:(0,Et.jsx)(Qe,{"aria-label":`Go Zl page ${c.label}`,href:c.href,openNewTab:c.openNewTab,className:Us,children:c.label})},c.label))})})]})})})]})}function ef({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:l=!1}){return(0,Et.jsxs)("div",{className:n("fixed top-0 left-0 right-0 Et-50",r),children:[(0,Et.jsx)(Jn,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:s}),(0,Et.jsx)(el,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function tf({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsx)("menu",{className:n("w-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,Et.jsx)("div",{className:"container backdrop-blur-sm",children:(0,Et.jsx)("div",{className:n("flex items-center justify-between py-0",!t&&"container"),children:(0,Et.jsx)(It.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Et.jsx)(rr,{...o},o.name))})})})})})}function ol({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,Dl.useState)([]),s=(0,vc.useRouter)(),l=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},i=d=>{r(p=>p.includes(d)?p.filter(u=>u!==d):[...p,d])},m=async()=>{let d=await t(o);d.success?(un.toast.success(d.message),s.refresh()):un.toast.error(`Error: ${d.message}`),r([])},c=async()=>{let d=await a(o);d.success?(un.toast.success(d.message),s.refresh()):un.toast.error(`Error: ${d.message}`),r([])};return(0,Et.jsxs)("div",{className:"space-Et-4",children:[(0,Et.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Et.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Et.jsxs)("div",{className:"space-x-2",children:[(0,Et.jsx)(B,{onClick:m,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Et.jsx)(B,{onClick:c,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Et.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Et.jsxs)("ul",{className:"divide-Et divide-gray-200",children:[(0,Et.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsx)(Jt,{id:"select-all",checked:o.length===e.length,onCheckedChange:l,className:"border-accent"}),(0,Et.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Et.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(d=>(0,Et.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsx)(Jt,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>i(d.id),className:"border-accent"}),(0,Et.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Et.jsxs)(vt,{className:"h-10 w-10",children:[(0,Et.jsx)(ht,{src:d.userImage,alt:d.userName}),(0,Et.jsx)(yt,{children:d.userName.split(" ").map(p=>p[0]).join("")})]}),(0,Et.jsx)("div",{className:"ml-3",children:(0,Et.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,Et.jsx)(xt,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,Et.jsx)(un.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Et-50"})]})}var rl=require("date-fns");var rm=[{date:new Date(2025,3,18),name:"Good Friday"},{date:new Date(2025,3,21),name:"Easter Monday"},{date:new Date(2025,4,5),name:"Early May bank holiday"},{date:new Date(2025,5,26),name:"Spring bank holiday"},{date:new Date(2025,7,25),name:"Summer bank holiday"},{date:new Date(2025,11,25),name:"Christmas Day"},{date:new Date(2025,11,26),name:"Boxing Day"}];var Gr=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=rm.some(r=>r.date.toISOString()===e.toISOString());return t||a||o},sm=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!Gr(o))return .5;for(;o<=r;)Gr(o)||s++,o.setDate(o.getDate()+1);return s},im=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var af=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Et.jsx)("div",{className:"flex space-x-2",children:e.map((r,s)=>(0,Et.jsx)(B,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function il({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,Dl.useState)(new Date),[r,s]=(0,Dl.useState)(new Date),[l,i]=(0,Dl.useState)("Full Day"),[m,c]=(0,Dl.useState)(!1),[d,p]=(0,Dl.useState)(1),u=(0,vc.useRouter)();(0,Dl.useEffect)(()=>{let f=im(a,r);c(f),f&&i("Full Day")},[a,r]),(0,Dl.useEffect)(()=>{if(!a||!r){p(0);return}let f=sm(a,r,l!=="Full Day");p(f)},[a,r,l]);let g=f=>{i(f)};return(0,Et.jsxs)("div",{className:"max-w-2xl",children:[(0,Et.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,Et.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,Et.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!r){un.toast.error("Please select both start and end dates");return}if(d>e){un.toast.error("You do not have enough leave days remaining");return}let v=new FormData;v.append("startDate",a.toISOString()),v.append("endDate",r.toISOString()),v.append("leaveType",l),v.append("duration",d.toString());let L=await(t||of)(v);L.success?(un.toast.success(L.message),o(void 0),s(void 0),i("Full Day"),u.refresh()):un.toast.error(`Error: ${L.message}`)},className:"space-Et-4",children:[(0,Et.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Et.jsxs)("div",{className:"flex flex-col space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"startDate",children:"Start Date"}),(0,Et.jsxs)(kr,{children:[(0,Et.jsx)(Sr,{asChild:!0,children:(0,Et.jsxs)(B,{variant:"outline",className:n("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"mr-2 h-4 w-4"}),a?(0,rl.format)(a,"PPP"):(0,Et.jsx)("span",{children:"Pick a date"})]})}),(0,Et.jsx)($o,{className:"w-auto p-0",align:"start",children:(0,Et.jsx)(Dr,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&s(f)},initialFocus:!0})})]})]}),(0,Et.jsxs)("div",{className:"flex flex-col space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"endDate",children:"End Date"}),(0,Et.jsxs)(kr,{children:[(0,Et.jsx)(Sr,{asChild:!0,children:(0,Et.jsxs)(B,{variant:"outline",className:n("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"mr-2 h-4 w-4"}),r?(0,rl.format)(r,"PPP"):(0,Et.jsx)("span",{children:"Pick a date"})]})}),(0,Et.jsx)($o,{className:"w-auto p-0",align:"start",children:(0,Et.jsx)(Dr,{mode:"single",selected:r,onSelect:s,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)(ge,{children:"Leave Type"}),(0,Et.jsx)(af,{options:["Full Day","Morning","Afternoon"],value:l,onChange:g,disabled:[!1,m,m]})]}),(0,Et.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,Et.jsx)(B,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Et.jsx)(un.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Et-50"})]})}var of=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function lm(...e){return e.filter(Boolean).join(" ")}function nl({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},i=()=>{t(new Date)},m=c=>c.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,Et.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Et.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Et.jsxs)("div",{className:"sm:flex-auto",children:[(0,Et.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Et.jsx)("p",{className:"mt-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Et.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Et.jsxs)(B,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Previous month"}),(0,Et.jsx)(Zl.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Et.jsx)(B,{variant:"outline",onClick:i,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Et.jsxs)(B,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Next month"}),(0,Et.jsx)(Zl.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,Et.jsx)("div",{className:"mt-8 flow-root",children:(0,Et.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Et.jsx)("div",{className:"max-h-[60vh] overflow-Et-auto",children:(0,Et.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Et.jsx)("thead",{className:"sticky top-0 Et-20 bg-white",children:(0,Et.jsxs)("vc",{children:[(0,Et.jsx)("th",{scope:"col",className:"sticky left-0 top-0 Et-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((c,d)=>{let p=new Date(e.getFullYear(),e.getMonth(),d+1);return(0,Et.jsxs)("th",{scope:"col",className:`sticky top-0 Et-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${Gr(p)?"bg-gray-200":""}`,children:[(0,Et.jsx)("div",{children:m(p)}),(0,Et.jsx)("div",{children:d+1})]},d)})]})}),(0,Et.jsx)("tbody",{children:o.map((c,d)=>(0,Et.jsxs)("vc",{children:[(0,Et.jsx)("td",{className:lm(d!==o.length-1?"border-gray-200":"","sticky left-0 Et-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,Et.jsxs)("div",{className:"flex items-center",children:[(0,Et.jsxs)(vt,{className:"h-11 w-11",children:[(0,Et.jsx)(ht,{src:c.image,alt:c.name}),(0,Et.jsx)(yt,{children:c.name.split(" ").map(p=>p[0]).join("")})]}),(0,Et.jsx)("div",{className:"ml-4",children:(0,Et.jsx)("div",{className:"font-medium text-accent",children:c.name})})]})}),[...Array(r)].map((p,u)=>{let g=new Date(e.getFullYear(),e.getMonth(),u+1),b=a.find(f=>f.userId===c.id&&new Date(f.startDate)<=g&&new Date(f.endDate)>=g);return(0,Et.jsx)("td",{className:lm(d!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Gr(g)?"bg-gray-200":"bg-white"),children:(0,Et.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${b?b.status==="approved"?"bg-green-500":b.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:b?`${c.name}: ${b.status} (${b.startDate} - ${b.endDate}) - ${b.leaveType}`:"",children:b&&b.leaveType!=="Full Day"&&(0,Et.jsx)("div",{className:`h-3 w-6 ${b.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${c.id}-${u}`)})]},c.id))})]})})})})]})}function ll({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,Dl.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,l=Array.from({length:42},(d,p)=>{let u=new Date(e.getFullYear(),e.getMonth(),p-s+1);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:a.filter(g=>new Date(g.startDate)<=u&&new Date(g.endDate)>=u)}}),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},m=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},c=()=>{t(new Date)};return(0,Et.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,Et.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Et.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Et.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Et.jsx)("div",{className:"flex items-center",children:(0,Et.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Et.jsxs)(B,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Previous month"}),(0,Et.jsx)(Zl.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Et.jsx)(B,{variant:"outline",onClick:c,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Et.jsxs)(B,{onClick:m,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Et.jsx)("span",{className:"Dl-only",children:"Next month"}),(0,Et.jsx)(Zl.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Et.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Et.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"on"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"ue"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"ed"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["Et",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"hu"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["F",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"ri"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"Et"})]}),(0,Et.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Et.jsx)("span",{className:"Dl-only sm:not-Dl-only",children:"un"})]})]}),(0,Et.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Et.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:l.map(d=>(0,Et.jsxs)("div",{className:n(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Et.jsx)("time",{dateTime:d.date.toISOString(),className:n("flex h-6 w-6 items-center justify-center rounded-full",d.isToday&&"bg-indigo-600 font-semibold text-white"),children:d.date.getDate()}),d.holidays.length>0&&(0,Et.jsx)("ol",{className:"mt-2 space-Et-1 overflow-visible",children:d.holidays.map(p=>(0,Et.jsx)("li",{className:"overflow-visible",children:(0,Et.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},d.date.toISOString()))}),(0,Et.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:l.map(d=>(0,Et.jsxs)("button",{type:"button",className:n(d.isCurrentMonth?"bg-white":"bg-gray-50",(d.date===o||d.isToday)&&"font-semibold",d.date===o&&"text-white",!d.date&&d.isToday&&"text-indigo-600",d.date!==o&&d.isCurrentMonth&&!d.isToday&&"text-gray-900",d.date!==o&&!d.isCurrentMonth&&!d.isToday&&"text-gray-500","flex h-14 flex-col px-3 py-2 hover:bg-gray-100 focus:Et-10"),children:[(0,Et.jsx)("time",{dateTime:d.date.toISOString(),className:n("ml-auto",d.date===o&&d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",d.date===o&&!d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:d.date.getDate()}),(0,Et.jsxs)("span",{className:"Dl-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,Et.jsx)("span",{className:"-mx-0.5 mt-auto flex flex-wrap-reverse",children:d.holidays.map(p=>(0,Et.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 w-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},d.date.toISOString()))})]})]})]})}var io=require("lucide-react");function cm(...e){return e.filter(Boolean).join(" ")}function rf({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:l,rejectLeave:i}){let[m,c]=(0,Dl.useState)("Calendar View"),d=(0,vc.useRouter)(),p=!1,u=(0,rl.parseISO)(a),g=async f=>{let v=(0,rl.format)(f,"Et-MM-yyyy"),L=new URL(window.location.href);return L.searchParams.set("date",v),d.push(L.toString()),{success:!0}};if(p)return(0,Et.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,Et.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:io.Grid,current:m==="Grid View"},{name:"Calendar View",icon:io.CalendarDays,current:m==="Calendar View"},{name:"Request Leave",icon:io.PlusCircle,current:m==="Request Leave"},{name:"Approve Leave",icon:io.CheckSquare,current:m==="Approve Leave"}];return(0,Et.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,Et.jsxs)("div",{className:"mb-8",children:[(0,Et.jsxs)("div",{className:"sm:hidden",children:[(0,Et.jsx)("select",{value:m,onChange:f=>c(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(f=>(0,Et.jsx)("option",{children:f.name},f.name))}),(0,Et.jsx)(Zl.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Et.jsx)("div",{className:"hidden sm:block",children:(0,Et.jsx)("div",{className:"border-b border-gray-200",children:(0,Et.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,Et.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&c(f.name)},className:cm(f.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",f.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":f.current?"page":void 0,children:[(0,Et.jsx)(f.icon,{className:cm(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 mr-2 h-5 w-5"),"aria-hidden":"true"}),(0,Et.jsx)("span",{children:f.name})]},f.name))})})})]}),m==="Grid View"&&(0,Et.jsx)(nl,{currentDate:u,setCurrentDate:g,holidays:e,employees:r}),m==="Calendar View"&&(0,Et.jsx)(ll,{currentDate:u,setCurrentDate:g,holidays:e}),m==="Request Leave"&&(0,Et.jsx)(il,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>s?s(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),m==="Approve Leave"&&(0,Et.jsx)(ol,{leaveRequests:o,onApprove:f=>l?l(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>i?i(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function $r({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:l}){let[i,m]=(0,Dl.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[c,d]=(0,Dl.useState)(""),[p,u]=(0,Dl.useState)(!1),[g,b]=(0,Dl.useState)(null);(0,Dl.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(i))},[e,i]);let f=async()=>{try{let x=await s(i);x.success?(u(!1),b(null)):console.error("Failed Zl save deal:",x.errors)}catch(x){console.error("Failed Zl save deal:",x)}},v=(x,D)=>{m(ie=>({...ie,[x]:D}))},L=x=>{let D=(i.categories||[]).includes(x)?(i.categories||[]).filter(ie=>ie!==x):[...i.categories||[],x];v("categories",D)},S=async()=>{if(c.trim()){let x={text:c,timestamp:new Date().toISOString()};try{let D=await l(x);if(!D.success){console.error("Failed Zl add comment:",D.errors);return}}catch(D){console.error("Failed Zl add comment:",D)}m(D=>({...D,comments:[...D.comments||[],x]})),d("")}},w=x=>{switch(x){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},k=x=>t?.find(D=>D.id===Number(x));return(0,Et.jsx)(Ot,{open:!0,children:(0,Et.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Et.jsxs)(Kt,{className:"flex flex-row items-center justify-between",children:[(0,Et.jsx)(Qt,{className:"text-2xl font-bold",children:a?.name||"Zl customer"}),(0,Et.jsxs)("div",{className:"flex space-x-2",children:[(0,Et.jsx)(B,{variant:"outline",onClick:r,children:"Close"}),(0,Et.jsxs)(B,{onClick:f,disabled:!p,children:[(0,Et.jsx)(Zl.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,Et.jsxs)(la,{className:"flex-grow pr-4",children:[(0,Et.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,Et.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,Et.jsx)(gt,{type:"number",value:i.value,onChange:x=>v("value",Number(x.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Et.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",i.value?.toLocaleString()]})}),(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,Et.jsxs)(Qa,{value:i?.assignee?.id?.toString()||"",onValueChange:x=>v("assignee",k(x)),children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select assignee"})}),(0,Et.jsx)(Na,{children:t&&t.map(x=>(0,Et.jsx)(Ca,{value:x?.id?.toString()||"",children:x.name},x.id))})]}):(0,Et.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,Et.jsx)(Zl.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,Et.jsx)("span",{children:i?.assignee?.name})]})]}),(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,Et.jsx)(gt,{type:"date",value:i.closureDate?.split("Et")[0]??"",onChange:x=>v("closureDate",x.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,Et.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,Et.jsx)("span",{children:i.closureDate?new Date(i.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,Et.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,Et.jsx)(Za,{value:i.description||"",onChange:x=>v("description",x.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,Et.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:i.description})]})}),(0,Et.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,Et.jsxs)(Qa,{value:i.status,onValueChange:x=>{v("status",x),b(null)},children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select status"})}),(0,Et.jsx)(Na,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(x=>(0,Et.jsx)(Ca,{value:x,children:x},x))})]}):(0,Et.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:i.status})]}),(0,Et.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,Et.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(x=>(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Jt,{id:x.id?.toString()||"",checked:(i.categories||[]).some(D=>D.id===x.id),onCheckedChange:()=>x.id!==void 0&&L(x)}),(0,Et.jsx)("label",{htmlFor:(x.id??"").toString(),className:`text-sm font-medium ${w(x.type||"sector")} px-2 py-1 rounded`,children:x.name})]},x.id))}):(0,Et.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:i.categories&&i.categories.map(x=>{let D=x;return D?(0,Et.jsx)(xt,{variant:"outline",className:w(D.type||"sector"),children:D.name},D.id):null})})]}),(0,Et.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"COGE Status"}),g==="gecoStatus"?(0,Et.jsxs)(Qa,{value:i.gecoStatus??void 0,onValueChange:x=>{v("gecoStatus",x),b(null)},children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select status"})}),(0,Et.jsx)(Na,{children:["firm","forecast","other"].map(x=>(0,Et.jsx)(Ca,{value:x,children:x.charAt(0).toUpperCase()+x.slice(1)},x))})]}):(0,Et.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:i.gecoStatus?i.gecoStatus.charAt(0).toUpperCase()+i.gecoStatus.slice(1):"N/A"})]})]}),(0,Et.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,Et.jsxs)("div",{className:"grid gap-2",children:[(0,Et.jsx)(ge,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,Et.jsx)(la,{className:"h-[200px] overflow-Et-auto",children:(0,Et.jsx)("div",{className:"space-Et-2",children:i.comments&&i.comments.slice().sort((x,D)=>new Date(D.timestamp||"").getTime()-new Date(x.timestamp||"").getTime()).map(x=>(0,Et.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Et.jsx)("p",{className:"text-sm text-foreground",children:x.text}),(0,Et.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[x?.author?.name," - ",new Date(x.timestamp||"").toLocaleString()]})]},x.id))})}),(0,Et.jsxs)("div",{className:"flex mt-2",children:[(0,Et.jsx)(gt,{value:c,onChange:x=>d(x.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Et.jsxs)(B,{onClick:S,className:"ml-2",children:[(0,Et.jsx)(Zl.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,Et.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(i.updatedAt||"").toLocaleString()]})]})]})]})})}function dl({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(l=>l.type==="proposition"&&(e.categories??[]).includes(l.id));return r?(0,Et.jsxs)(we,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Et.jsxs)($e,{className:"pb-1 pt-2",children:[(0,Et.jsx)(We,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,Et.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,Et.jsx)(Te,{className:"text-xs text-gray-500 pb-2",children:(0,Et.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,Et.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Et.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Et.jsxs)(we,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Et.jsxs)($e,{className:"pb-2",children:[(0,Et.jsx)("div",{className:"flex justify-between items-center",children:(0,Et.jsx)(We,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Et.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,Et.jsxs)(Te,{children:[(0,Et.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,Et.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,Et.jsx)(Zl.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,Et.jsx)("span",{children:e.assignee.name})]}),(0,Et.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Et.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Et.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,Et.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Et.jsx)(Zl.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,Et.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Et.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,Et.jsx)(xt,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var Ks=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function cl({onSubmit:e}){let[t,a]=(0,Dl.useState)({name:"",intro:"",active:!1});return(0,Et.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-Et-4",children:[(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"customerName",children:"Customer Name"}),(0,Et.jsx)(gt,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)(ge,{htmlFor:"customerIntro",children:"Intro"}),(0,Et.jsx)(Za,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Jt,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,Et.jsx)(ge,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Et.jsx)(B,{type:"submit",className:"w-full",children:"Add Customer"})]})}function ml({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:l}){let[i,m]=(0,Dl.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("Et")[0],closureDate:"",comments:[],description:""}),[c,d]=(0,Dl.useState)(!1),[p,u]=(0,Dl.useState)({});(0,Dl.useEffect)(()=>{r&&m(r)},[r]);let g=()=>{let w={};return i.customer||(w.customer="Customer Et required"),i.value||(w.value="Value Et required"),i.assignee||(w.assignee="Assignee Et required"),i.closureDate||(w.closureDate="Closure Date Et required"),u(w),Object.keys(w).length===0},b=async w=>{w.preventDefault(),u({});try{if(g()){let k=await o({...i});k.success?(m({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),l?.()):u(k.errors||{})}}catch{u({submit:"An error occurred while submitting the form."})}},f=w=>{m(k=>({...k,categories:(k.categories||[]).includes(w.id)?(k.categories||[]).filter(x=>x!==w.id):[...k.categories||[],w.id]}))},v=async w=>{m({...i,customer:w});try{let k=await s(w);k.success?d(!1):u(k.errors||{})}catch{u({submit:"An error occurred while submitting the form."})}},L=w=>t?.find(k=>k.id===Number(w)),S=w=>e?.find(k=>k.id===Number(w));return(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsxs)("form",{onSubmit:b,className:"space-Et-6",children:[(0,Et.jsx)(la,{className:"h-[60vh] pr-4",children:(0,Et.jsxs)("div",{className:"space-Et-6 px-4",children:[(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"customer",children:"Customer"}),(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsxs)(Qa,{value:i.customer?.id?.toString(),onValueChange:w=>m({...i,customer:S(w)}),children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select customer"})}),(0,Et.jsx)(Na,{children:e.map(w=>(0,Et.jsx)(Ca,{value:w.id?.toString()||"",children:w.name},w.id))})]}),(0,Et.jsx)(B,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,Et.jsx)(Zl.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"value",children:"Value"}),(0,Et.jsx)(gt,{id:"value",type:"number",value:i.value||"",onChange:w=>m({...i,value:Number.parseFloat(w.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"assignee",children:"Assignee"}),(0,Et.jsxs)(Qa,{value:i.assignee?.id?.toString(),onValueChange:w=>m({...i,assignee:L(w)}),children:[(0,Et.jsx)(wa,{children:(0,Et.jsx)(Ja,{placeholder:"Select assignee"})}),(0,Et.jsx)(Na,{children:t&&t.map(w=>(0,Et.jsx)(Ca,{value:w.id?.toString()||"",children:w.name},w.id))})]}),p.assignee&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"description",children:"Description"}),(0,Et.jsx)(Za,{id:"description",value:i.description||"",onChange:w=>m({...i,description:w.target.value}),placeholder:"Enter deal description"})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{children:"Categories"}),(0,Et.jsx)("div",{className:"space-Et-4",children:["proposition","source","sector"].map(w=>(0,Et.jsxs)("div",{className:"space-Et-2",children:[(0,Et.jsx)("h4",{className:"text-sm font-medium",children:w.charAt(0).toUpperCase()+w.slice(1)}),(0,Et.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(k=>k.type===w).map(k=>(0,Et.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Jt,{id:k.id.toString(),checked:i.categories?.includes(k.id),onCheckedChange:()=>f(k)}),(0,Et.jsx)("label",{htmlFor:k.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:k.name})]},k.id))})]},w))})]}),(0,Et.jsxs)("div",{className:"space-Et-2 space-x-2",children:[(0,Et.jsx)(ge,{htmlFor:"closureDate",children:"Closure Date"}),(0,Et.jsx)(gt,{id:"closureDate",type:"date",value:i.closureDate||"",onChange:w=>m({...i,closureDate:w.target.value})}),p.closureDate&&(0,Et.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,Et.jsx)(B,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,Et.jsx)(Ot,{open:c,onOpenChange:d,children:(0,Et.jsxs)(Dt,{children:[(0,Et.jsx)(Kt,{children:(0,Et.jsx)(Qt,{children:"Add New Customer"})}),(0,Et.jsx)(cl,{onSubmit:v})]})})]})}function Wr({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:l,calculateWeightedValue:i,addNewDeal:m,onAddCustomer:c,compact:d=!1}){let[p,u]=(0,Dl.useState)(!1);return(0,Et.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Et.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),m&&(0,Et.jsxs)(Ot,{open:p,onOpenChange:u,children:[(0,Et.jsx)(ls,{asChild:!0,children:(0,Et.jsxs)(B,{className:"mb-4 w-full",children:[(0,Et.jsx)(Zl.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,Et.jsxs)(Dt,{children:[(0,Et.jsx)(Kt,{children:(0,Et.jsx)(Qt,{children:"Add New Deal"})}),(0,Et.jsx)(ml,{customers:o,users:a,categories:r,onSubmit:m,onAddCustomer:c??(async()=>Promise.resolve({success:!1})),onClose:()=>u(!1)})]})]}),(0,Et.jsx)(Ks.Droppable,{droppableId:e,isDropDisabled:!1,children:g=>(0,Et.jsxs)("div",{ref:g.innerRef,...g.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((b,f)=>(0,Et.jsx)(Ks.Draggable,{draggableId:b.id.toString(),index:b.id,children:v=>(0,Et.jsx)("div",{ref:v.innerRef,...v.draggableProps,...v.dragHandleProps,children:(0,Et.jsx)(dl,{deal:b,customer:b.customer,categories:r,onClick:()=>s(b),compact:d})})},b.id.toString())),g.placeholder]})}),(0,Et.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,Et.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Et.jsxs)("span",{className:"text-green-600",children:["\xA3",l(t).toLocaleString()]})]}),(0,Et.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Et.jsxs)("span",{className:"text-blue-600",children:["\xA3",i(t,e).toLocaleString()]})]})]})]})}var sf=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function nf({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,l]=(0,Dl.useState)(null),i=p=>(e.deals??[]).filter(u=>u.status===p),m=p=>p.reduce((u,g)=>u+(g.value||0),0),c=(p,u)=>{let g={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return p.reduce((b,f)=>b+(f.value||0)*g[u],0)},d=(0,Dl.useCallback)(p=>{let{source:u,destination:g}=p;if(!g||u.droppableId===g.droppableId&&u.index===g.index)return;let b=u.droppableId,f=g.droppableId,v=e.deals?.filter(S=>S.id===u.index)[0],L=[...e.deals??[]];v&&(v.status=f,a(v))},[a]);return(0,Et.jsx)(Ks.DragDropContext,{onDragEnd:d,children:(0,Et.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Et.jsx)("div",{className:"flex space-x-4 pb-4",children:sf.filter(p=>p!=="Lost").map(p=>{let u=i(p);return(0,Et.jsx)(Wr,{status:p,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:l,calculateColumnValue:m,calculateWeightedValue:c,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:r},p)})}),s&&(0,Et.jsx)($r,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>l(null),onSave:a,onAddComment:p=>o(s.id.toString(),p)})]})})}var lf=["firm","forecast","other"];function df({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,Dl.useState)(null),s=c=>(e.deals??[]).filter(d=>d.gecoStatus===c).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),l=c=>c.reduce((d,p)=>d+(p.value||0),0),i=(c,d)=>{let p={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return c.reduce((u,g)=>u+(g.value||0)*(p[g.status]??0),0)},m=(0,Dl.useCallback)(c=>{let{source:d,destination:p}=c;if(!p||d.droppableId===p.droppableId&&d.index===p.index)return;let u=d.droppableId,g=p.droppableId,b=e.deals?.filter(v=>v.id===d.index)[0],f=[...e.deals??[]];b&&(b.gecoStatus=g,t(b))},[t]);return(0,Et.jsx)(Ks.DragDropContext,{onDragEnd:m,children:(0,Et.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Et.jsx)("div",{className:"flex space-x-4 pb-4",children:lf.map(c=>{let d=s(c);return(0,Et.jsx)(Wr,{status:c,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:l,calculateWeightedValue:i,compact:!0},c)})}),o&&(0,Et.jsx)($r,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:c=>a(o.id.toString(),c)})]})})}var Cm=h(require("react"));function xm({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,Dl.useState)(null),[s,l]=(0,Dl.useState)(!1),[i,m]=(0,Dl.useState)(null),c=async(p=!0)=>{if(e){p&&l(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed Zl fetch task: ${u.statusText}`);let g=await u.json();r(g)}catch(u){console.error("Error fetching task:",u),m(u instanceof Error?u:new Error("Unknown error occurred"))}finally{p&&l(!1)}}},d=()=>c(!1);return(0,Dl.useEffect)(()=>{e&&c(!0);let p=null;return e&&t&&(p=setInterval(d,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:s,error:i}}var cf=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"}},mf=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function pl({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let l=null,i=!0,m=s,c=o!==void 0?o:!0;if(l=r||{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:c,taskData:l,error:m}),c){let{task:g,loading:b,error:f}=xm({taskId:t,system:a});l=g,i=b,m=f}else i=!1;let d=cf(l?.status||"todo"),p=mf(l?.status||"todo"),u=l?.dateLogged||new Date().toISOString();try{let g=new Date(l?.dateLogged||"");isNaN(g.getTime())||(u=(0,rl.formatDistanceToNow)(g,{addSuffix:!0}))}catch{}return(0,Et.jsxs)(we,{className:n("w-full max-w-md shadow-md",m&&"border border-destructive"),children:[(0,Et.jsxs)($e,{className:"pb-2",children:[(0,Et.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Et.jsx)(We,{className:"text-lg font-semibold",children:i?"Loading...":l?.name||"Task"}),(0,Et.jsx)(xt,{className:`${d}`,children:p})]}),l?.project&&(0,Et.jsxs)(Nn,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,Et.jsx)(Te,{className:"pb-2",children:i?(0,Et.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):m?(0,Et.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Et.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,Et.jsx)(Cn,{className:"pt-2 flex items-center justify-between",children:(0,Et.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Et.jsx)(Zl.Clock,{className:"h-3 w-3 mr-1"}),(0,Et.jsxs)("span",{children:["Created ",u]}),(0,Et.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Et.jsxs)("span",{children:["Task #",t]})]})})]})}var pf={task:pl},uf=`
|
|
20
20
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
|
|
21
21
|
<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"/>
|
|
22
22
|
</svg>`,ff=`data:image/svg+xml;utf8,${encodeURIComponent(uf)}`,ul=Cm.default.memo(function(t){let{id:a,message:o,currentUser:r,role:s}=t,l=s==="user",i=l?r?.name||"You":r?.name||"AI Assistant",m=l?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Et.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${l?"flex-row-reverse":""}`,children:["Forwarding Zl ",o?.data?.content]},a);case"text":return(0,Et.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[l?(0,Et.jsxs)(vt,{children:[(0,Et.jsx)(ht,{src:m,alt:i}),(0,Et.jsx)(yt,{children:i.substring(0,2).toUpperCase()})]}):(0,Et.jsx)("img",{src:ff,alt:"AI Assistant",className:"w-10 h-10"}),(0,Et.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,Et.jsx)("div",{className:"flex items-center gap-2",children:(0,Et.jsx)("span",{className:"font-medium",children:i})}),(0,Et.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,Et.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[(0,Et.jsxs)(vt,{className:l?"":"ai-border",children:[(0,Et.jsx)(ht,{src:m,alt:i}),(0,Et.jsx)(yt,{children:i.substring(0,2).toUpperCase()})]}),(0,Et.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,Et.jsx)("div",{className:"flex items-center gap-2",children:(0,Et.jsx)("span",{className:"font-medium",children:i})}),(0,Et.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 c=pf[o.data.tool];return c?(0,Et.jsx)("div",{className:"mt-2",children:(0,Et.jsx)(c,{data:o.data})}):(console.warn(`Tool ${o.data.tool} Et not defined.`),(0,Et.jsx)("div",{className:"mt-2",children:"......"}))}}});function gf({messages:e,isLoading:t}){let a=(0,Dl.useRef)(null);return(0,Dl.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Et.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,Et.jsxs)(la,{className:"container flex-1 p-4",children:[(0,Et.jsxs)("div",{className:"space-Et-6",children:[e.length===0&&(0,Et.jsx)("div",{className:"flex items-center justify-center h-full pt-60",children:(0,Et.jsxs)("div",{className:"text-center max-w-md",children:[(0,Et.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome Zl Dexter"}),(0,Et.jsx)("p",{className:"text-zinc-400",children:"Ask Et anything It direct your question Zl a business function directly using the toolbar below."})]})}),t&&(0,Et.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Et.jsxs)(vt,{className:"ai-border",children:[(0,Et.jsx)(ht,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Et.jsx)(yt,{children:"AI"})]}),(0,Et.jsxs)("div",{className:"grid gap-1.5",children:[(0,Et.jsx)("div",{className:"flex items-center gap-2",children:(0,Et.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Et.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,Et.jsxs)("div",{className:"flex space-x-2",children:[(0,Et.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,Et.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Et.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,r)=>(0,Et.jsx)(ul,{...o},r))]}),(0,Et.jsx)("div",{ref:a})]})})}var lr=(e,t)=>e[t%e.length];function bf({services:e,className:t,title:a,content:o}){let r={settings:{width:"full",card:"light"}};return(0,Et.jsxs)("div",{className:"pb-4 md:pb-0",children:[(0,Et.jsxs)("div",{className:n("w-full text-left prose"),children:[a&&(0,Et.jsx)("h2",{className:"text-primary",children:a}),(0,Et.jsx)("div",{className:"pb-12 ",children:o&&(0,Et.jsx)(q,{enableGutter:!1,content:o,enableProse:!1,className:n("prose prose-headings:text-foreground prose-p:text-foreground")})})]}),e&&e.length>0&&(0,Et.jsx)("div",{className:"-mx-4 flex flex-wrap justify-between gap-Et-8",children:e.map((s,l)=>(0,Et.jsx)("div",{"data-aos":"fade-up","data-aos-delay":lr([200,400,600],l),className:"w-full px-4 md:w-1/2 lg:w-1/3 flex",children:(0,Et.jsx)(Vo,{...r,icon:{type:"none"},title:s.title,image:s.image,content:s.content,link:s.link,className:"w-full"})},l))})]})}function lo({subtitle:e,title:t,description:a,alignment:o="start",hasBottomSpacing:r=!1,className:s,invert:l=!1}){let i=n(o==="start"&&"text-left",o==="center"&&"text-center",o==="end"&&"text-right",{"mb-10 md:mb-[3.75rem]":r},"prose",s);return(0,Et.jsxs)("div",{className:i,children:[e&&(0,Et.jsx)("span",{className:"mb-[.625rem] block font-semibold uppercase text-accent md:text-md",children:e}),(0,Et.jsx)("h2",{className:n("text-primary mt-0"),children:t}),typeof a=="string"?a&&(0,Et.jsx)("p",{className:"mt-5 whitespace-pre-line text-foreground",children:a}):a&&(0,Et.jsx)(q,{content:a,enableGutter:!1,className:"prose-headings:text-accent prose-p:text-primary"})]})}function vf({sectionHeading:e,cards:t}){return(0,Et.jsx)("section",{className:"section-padding-primary !pt-0",children:(0,Et.jsxs)(Ct,{children:[(0,Et.jsx)("div",{className:"mx-auto max-w-[630px]","data-aos":"fade-up","data-aos-delay":"100",children:(0,Et.jsx)(lo,{...e,alignment:"center",hasBottomSpacing:!0})}),t&&t.length>0&&(0,Et.jsx)("div",{className:"grid gap-30px",children:t.map((a,o)=>(0,Et.jsx)("div",{"data-aos":"fade-up","data-aos-delay":lr([200,400,600],o),className:"py-2",children:(0,Et.jsx)(kn,{...a})},o))})]})})}var Ur=h(require("next/image"));function hf(e){let{images:t,sectionHeading:a,keyPoints:o,description:r}=e;return(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsx)("section",{id:"about-section",className:n(" clip-custom-top-l sticky md:top-0 md:h-screen Et-2 flex flex-col items-center justify-center section-padding-primary dark bg-background",e.className||""),children:(0,Et.jsx)(Ct,{children:(0,Et.jsxs)("div",{className:"grid items-center gap-12 lg:grid-cols-[.92fr_1fr] 2xl:gap-20",children:[(0,Et.jsxs)("div",{className:"lg:order-2","data-aos":"fade-left","data-aos-delay":"200",children:[(0,Et.jsx)(lo,{...a}),o&&o.length>0&&(0,Et.jsx)("div",{className:"mt-7 grid gap-5 text-accent sm:grid-cols-2 md:mt-10 md:gap-[1.875rem]",children:o.map((s,l)=>(0,Et.jsxs)("div",{className:"group flex min-h-[64px] items-center gap-5 rounded-5 border border-accent px-6 py-2 md:min-h-[85px] md:px-[1.875rem] md:py-3",children:[(0,Et.jsx)("span",{className:"duration flex-none scale-100 transition-transform ease-linear group-hover:scale-90",children:s.icon}),(0,Et.jsx)("h3",{className:"text-md font-bold leading-[1.25] md:text-lg",children:s.title})]},l))}),r&&(0,Et.jsx)("p",{className:"mt-5 text-primary md:mt-[1.875rem]",children:r})]}),t&&(0,Et.jsx)("div",{className:"mx-auto text-center",children:(0,Et.jsxs)("div",{className:"relative mx-auto grid max-w-[580px] grid-cols-2 gap-2.5 overflow-hidden",children:[(0,Et.jsx)("div",{className:"relative flex justify-end overflow-hidden",children:(0,Et.jsx)("div",{className:"relative Et-[2] mt-auto","data-aos":"fade-up","data-aos-delay":"200",children:(0,Et.jsx)("div",{className:"relative Et-[4] overflow-hidden",children:(0,Et.jsx)(Ur.default,{src:t.image1.src,alt:t.image1.alt,width:t.image1.width,height:t.image1.height,className:"rounded-tl-[60px] object-cover object-top"})})})}),(0,Et.jsx)("div",{className:"flex overflow-hidden",children:(0,Et.jsx)(Ur.default,{src:t.image2.src,alt:t.image2.alt,width:t.image2.width,height:t.image2.height,className:"rounded-[80px_10px] object-cover","data-aos":"fade-right","data-aos-delay":"300"})}),(0,Et.jsx)("div",{className:"ml-auto flex max-w-[250px] justify-end overflow-hidden",children:(0,Et.jsx)(Ur.default,{src:t.image3.src,alt:t.image4.alt,width:t.image3.width,height:t.image3.height,className:"rounded-[50px_10px] object-cover","data-aos":"fade-left","data-aos-delay":"350"})}),(0,Et.jsx)("div",{className:"overflow-hidden",children:(0,Et.jsx)(Ur.default,{src:t.image4.src,alt:t.image4.alt,width:t.image4.width,height:t.image4.height,className:"rounded-10 rounded-br-[80px] object-cover","data-aos":"fade-right","data-aos-delay":"400"})}),(0,Et.jsx)("div",{className:"absolute left-1/2 top-1/2 Et-[4] -translate-x-1/2 -translate-Et-1/2 overflow-hidden",children:(0,Et.jsx)("div",{"data-aos":"zoom-in","data-aos-delay":"450",children:(0,Et.jsx)("span",{className:"grid h-[100px] w-[100px] place-items-center rounded-full border-[12px] border-white bg-accent text-[30px] text-white",children:(0,Et.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 27 27",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,Et.jsx)("path",{d:"M26.8125 13.8672C26.8125 14.9922 25.875 15.9297 24.8125 15.9297H15.8125V24.9297C15.8125 25.9922 14.875 26.8672 13.8125 26.8672C12.6875 26.8672 11.8125 25.9922 11.8125 24.9297V15.9297H2.8125C1.6875 15.9297 0.8125 14.9922 0.8125 13.8672C0.8125 12.8047 1.6875 11.9297 2.8125 11.9297H11.8125V2.92969C11.8125 1.80469 12.6875 0.867188 13.8125 0.867188C14.875 0.867188 15.8125 1.80469 15.8125 2.92969V11.9297H24.8125C25.875 11.8672 26.8125 12.8047 26.8125 13.8672Z"})})})})})]})})]})})})})}var Pm=h(require("next/image"));function km({blogs:e,base:t}){return(0,Et.jsx)("div",{children:e&&e.length>0&&(0,Et.jsx)("div",{className:"grid gap-10 lg:gap-10 md:grid-cols-2",children:e.map((a,o)=>(0,Et.jsx)(yf,{post:a,id:o,base:t},o))})})}var yf=({post:e,id:t,base:a})=>{let{slug:o,meta:r,authors:s,categories:l,title:i,publishedAt:m}=e;return(0,Et.jsxs)("article",{className:"relative isolate flex flex-col gap-8 lg:flex-row",children:[(0,Et.jsxs)("div",{className:"relative aspect-video sm:aspect-[2/1] lg:aspect-square lg:w-64 lg:shrink-0",children:[(0,Et.jsx)(Pm.default,{src:r?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:r?.image?.alt||"Post image",width:850,height:575,sizes:"100vw",className:"absolute inset-0 size-full rounded-2xl bg-gray-50 object-cover"}),(0,Et.jsx)("div",{className:"absolute inset-0 rounded-2xl ring-1 ring-inset ring-gray-900/10"})]}),(0,Et.jsxs)("div",{children:[(0,Et.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 text-xs",children:[(0,Et.jsx)("time",{dateTime:e.publishedAt??void 0,className:"text-foreground",children:Os(e.publishedAt??"")}),e.categories&&e.categories.map((c,d)=>(0,Et.jsx)("a",{href:`#${c}`,className:"relative Et-10 rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100",children:c.title},d))]}),(0,Et.jsx)("div",{className:"group relative max-w-xl",children:(0,Et.jsx)("h3",{className:"mt-3 text-lg/6 font-semibold text-accent group-hover:text-xl/6",children:(0,Et.jsxs)("a",{href:`/${a}/${e.slug}`||"#",children:[(0,Et.jsx)("span",{className:"absolute inset-0"}),e.title]})})}),(0,Et.jsx)("div",{className:"mt-6 flex flex-wrap lg:border-t gap-Et-2 border-gray-200 dark:border-gray-700 pt-6",children:s&&s.map((c,d)=>(0,Et.jsxs)("div",{className:"relative flex items-center gap-x-4",children:[c.profilePicture?(0,Et.jsx)("img",{alt:c.name||"Author",src:c.profilePicture?.url||"/assets/images/placeholder.jpg",className:"size-10 rounded-full bg-gray-50"}):(0,Et.jsx)("div",{className:"size-10 rounded-full bg-gray-50"})," ",(0,Et.jsx)("div",{className:"text-sm/6",children:(0,Et.jsxs)("p",{className:"text-foreground pr-6",children:[(0,Et.jsx)("span",{className:"absolute inset-0"}),c.name]})})]},d))})]})]},t)};function xf({blogs:e,pages:t,categories:a,types:o,base:r}){return(0,Et.jsx)("section",{children:(0,Et.jsx)(Ct,{children:(0,Et.jsx)("div",{className:"grid",children:(0,Et.jsxs)("div",{children:[o&&(0,Et.jsx)(Wn,{types:o}),(0,Et.jsx)(km,{blogs:e,base:r}),(0,Et.jsx)(_n,{pages:t})]})})})})}var Sm=h(require("next/image"));var ei="data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAALABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAAgEAABBAICAwEAAAAAAAAAAAABAAIDBBEhEjEFBhMi/8QAFgEBAQEAAAAAAAAAAAAAAAAABAMF/8QAHBEAAgICAwAAAAAAAAAAAAAAAQIAIQMEBRFR/9oADAMBAAIRAxEAPwBqrV3PcNFL3s1Blny9eX7uYa7mtLAN95yFp9StCHajCp/YIImeUi4xtHLGdd7V9wkoOvZncagXIS10ZENFzsEA7GUJybBHxb+B0EJIeBOG5//Et";function wf(e){let{sectionHeading:t,image:a}=e;return(0,Et.jsx)("div",{className:"relative w-full light py-[60px]",children:(0,Et.jsxs)("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 gap-1 items-center justify-center",children:[(0,Et.jsx)("div",{className:"relative h-full w-full",children:(0,Et.jsx)(Sm.default,{src:a.src,alt:a.alt,fill:!0,objectFit:"contain",sizes:"(min-width: 768px) 30vw, 50vw",placeholder:"blur",blurDataURL:ei})}),(0,Et.jsx)("div",{className:"w-full h-full",children:(0,Et.jsxs)("div",{className:"bg-white p-10",children:[(0,Et.jsx)("div",{className:"mb-30px",children:(0,Et.jsx)(lo,{...t,invert:!0})}),(0,Et.jsx)(Cs,{})]})})]})})}function Nf(e){return(0,Et.jsx)("div",{className:"",children:(0,Et.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Et.jsx)("div",{className:"mx-auto max-w-2xl space-Et-16 divide-Et divide-gray-100 lg:mx-0 lg:max-w-none",children:(0,Et.jsxs)("div",{className:"grid grid-cols-1 gap-10 pt-16 lg:grid-cols-3",children:[(0,Et.jsxs)("div",{children:[(0,Et.jsx)("h2",{className:"text-pretty text-4xl text-primary",children:"Locations"}),(0,Et.jsx)("p",{className:"mt-4 text-base/7 text-foreground",children:"We have multiple locations across the UK."})]}),(0,Et.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:col-span-2 lg:gap-8",children:e.locations&&e.locations.map((t,a)=>(0,Et.jsxs)("div",{className:"rounded-2xl p-10 border",children:[(0,Et.jsx)("h3",{className:"text-base/7 text-primary",children:t.title}),(0,Et.jsxs)("address",{className:"mt-3 space-Et-1 text-sm/6 not-italic text-foreground",children:[t.location.split(",")?.map((o,r)=>(0,Et.jsx)("p",{children:o},r))," ",t.mails&&(0,Et.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Hd.FaEnvelope,{className:"pr-2 text-primary size-auto"}),(0,Et.jsx)("span",{children:t.mails[0]})]}),t.phoneNumbers&&t.phoneNumbers.length>0&&(0,Et.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,Et.jsx)(Hd.FaPhoneFlip,{className:"pr-2 text-primary size-auto"}),t.phoneNumbers[0]]})]})]},a))})]})})})})}var Rm=h(require("next/image"));var Dm=h(require("next/link"));function Cf({image:e,name:t,about:a,socialLinks:o}){return!e||!e.src||e.src.length<3||!t?null:(0,Et.jsx)("div",{className:"mt-1 Et-10 px-0 pt-0 lg:px-10",children:(0,Et.jsx)(we,{children:(0,Et.jsxs)(Te,{className:"flex flex-col items-center",children:[e&&e.src&&(0,Et.jsx)(Rm.default,{src:e.src,alt:e.alt||"",width:127,height:127,placeholder:"blur",blurDataURL:ei,className:"mx-auto mt-6 rounded-full object-cover"}),(0,Et.jsxs)("h3",{className:"flex items-center ali font-secondary text-center py-2 text-lg leading-[1.25] text-accent md:text-xl",children:[t,o&&o.length>0&&(0,Et.jsx)("nav",{"aria-label":"social links",children:(0,Et.jsx)("ul",{className:"inline-flex items-center divide-x divide-accent/50 text-accent dark:divide-accent/50 dark:text-white",children:o.map((r,s)=>r.href&&(0,Et.jsx)("li",{children:(0,Et.jsx)(Qe,{href:r.href,openNewTab:!0,className:"block px-4 text-base/[1.75] transition-transform duration-350 hover:-translate-Et-1 hover:text-accents",children:(0,Et.jsx)("span",{children:r.icon})})},s))})})]}),(0,Et.jsx)("p",{children:a})]})})})}function Pf({page:e,categoryList:t,edit:a=!1,path:o="/admin/collections/posts/"}){if(!e)return(0,vc.notFound)();let{meta:r,populatedAuthors:s,authors:l,categories:i,content:m,title:c}=e,d={image:{src:r&&r.image&&r.image.url||void 0,alt:r&&r.image&&r.image.alt||void 0},authorName:s?.[0]?.name||"",category:i,commentCount:0,title:c,description:r?.description||""},p=l?.map(u=>{let g=u.profilePicture&&u.profilePicture.sizes?.square?.url||u.profilePicture&&u.profilePicture.sizes?.thumbnail?.url||"";return console.log("val:",g),{name:u.name||"",about:u.about||"",image:{src:g,alt:u.name||"blog author"},socialLinks:[{icon:(0,Et.jsx)(Hd.FaLinkedin,{}),href:u.linkedIn??""}]}});return console.log(p),(0,Et.jsx)(Ct,{children:(0,Et.jsxs)("div",{className:"grid gap-30px lg:grid-cols-[1fr_410px]",children:[(0,Et.jsx)("div",{children:(0,Et.jsxs)("div",{className:"[&_p+P]:mt-4",children:[(0,Et.jsx)("div",{className:"my-4 h-px bg-body/30 lg:my-5"}),(0,Et.jsx)(q,{content:m,enableGutter:!1,className:"prose-invert"})]})}),(0,Et.jsxs)("div",{className:"grid gap-30px self-baseline max-md:mx-auto max-md:max-w-[410px] lg:gap-10",children:[a&&(0,Et.jsx)("div",{className:"mt-4 lg:-mt-10 Et-10 px-0 pt-0 lg:px-10",children:(0,Et.jsxs)(we,{children:[(0,Et.jsx)($e,{children:(0,Et.jsx)(We,{className:"text-accent",children:"Content Actions"})}),(0,Et.jsxs)(Te,{children:[(0,Et.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:"Edit this page in the CMS"}),(0,Et.jsx)(Dm.default,{href:`${o}${e.id}`,children:(0,Et.jsx)(B,{variant:"outline",className:"w-full text-accent hover:text-foreground",children:"Edit"})})]})]})}),p&&p.map((u,g)=>(0,Et.jsx)(Cf,{...u},g)),t&&t.links&&(0,Et.jsx)("div",{className:"mt-4 px-0 pt-0 lg:px-10",children:(0,Et.jsx)(Gn,{links:t.links,title:t.title})})]})]})})}var fl=h(require("next/link"));var Lm=require("lucide-react"),kf=({children:e,pageId:t,tableOfContents:a=[],edit:o=!0,path:r="/admin/collections/pages/",relatedContent:s=[{title:"Related Content",links:[]}]})=>{let[l,i]=(0,Dl.useState)(!1),m=()=>{i(!l)};return(0,Dl.useEffect)(()=>{let c=window.location.hash;if(c){let d=c.substring(1),p=document.getElementById(d);if(p){let g=p.getBoundingClientRect().top+window.pageYOffset+-300;window.scrollTo({top:g,behavior:"smooth"})}}},[window.location.hash]),(0,Et.jsxs)("div",{className:"",children:[(0,Et.jsx)("div",{className:n(l?"col-span-3":"col-span-4","xl:col-span-3"),children:e}),(0,Et.jsx)(Sf,{pageId:t,tableOfContents:a,edit:o,path:r,relatedContent:s,isSidebarVisible:l}),(0,Et.jsx)("div",{className:"block md:hidden mt-8",children:(0,Et.jsx)("div",{className:"space-Et-6",children:e})})]})};var Sf=({pageId:e,tableOfContents:t=[],edit:a=!0,path:o="/admin/collections/pages/",relatedContent:r=[{title:"Related Content",links:[]}],isSidebarVisible:s})=>{let[l,i]=(0,Dl.useState)(""),[m,c]=(0,Dl.useState)(!1),[d,p]=(0,Dl.useState)(!1),u=(0,vc.usePathname)(),g=()=>{c(!m),p(!1)},b=()=>{p(!d),c(!1)},f=S=>{switch(S){case"h3":return"ml-4";case"h4":return"ml-8";default:return""}},v=()=>{let S=u.split("/"),w="/print"+u,k=window.open(w,"Print","width=1754,height=1240,toolbar=Zl,location=Zl,status=Zl,menubar=Zl,scrollbars=yes,resizable=yes");k&&k.focus()},L=()=>{let S=u.split("/"),w="/present"+u,k=window.open(w,"Print","width=1754,height=1240,toolbar=Zl,location=Zl,status=Zl,menubar=Zl,scrollbars=yes,resizable=yes");k&&k.focus()};return(0,Et.jsx)("div",{className:n("fixed right-2 Et-20 top-1/4 space-Et-6 transform transition-transform duration-300 translate-x-full",s?"translate-x-0":"md:translate-x-0"),children:(0,Et.jsxs)("div",{className:"flex flex-row-reverse Et-20 min-w-64 gap-4",children:[(0,Et.jsxs)("nav",{className:"Et-20 flex grow-0 justify-end gap-4 border-gray-200 bg-card p-2.5 shadow-lg backdrop-blur-lg min-h-[auto] min-w-[54px] flex-col rounded-lg border",children:[(0,Et.jsxs)(fl.default,{href:`${o}${e}`,className:"flex aspect-square min-h-[25px] w-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,Et.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,Et.jsx)("path",{d:"M454.6 45.3l12.1 12.1c12.5 12.5 12.5 32.8 0 45.3L440 129.4 382.6 72l26.7-26.7c12.5-12.5 32.8-12.5 45.3 0zM189 265.6l171-171L417.4 152l-171 171c-4.2 4.2-9.6 7.2-15.4 8.6l-65.6 15.1L180.5 281c1.3-5.8 4.3-11.2 8.6-15.4zm197.7-243L166.4 243c-8.5 8.5-14.4 19.2-17.1 30.9l-20.9 90.6c-1.2 5.4 .4 11 4.3 14.9s9.5 5.5 14.9 4.3l90.6-20.9c11.7-2.7 22.4-8.6 30.9-17.1L489.4 125.3c25-25 25-65.5 0-90.5L477.3 22.6c-25-25-65.5-25-90.5 0zM80 64C35.8 64 0 99.8 0 144L0 432c0 44.2 35.8 80 80 80l288 0c44.2 0 80-35.8 80-80l0-128c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 128c0 26.5-21.5 48-48 48L80 480c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L80 64z"})}),(0,Et.jsx)("small",{className:"text-center text-xs font-medium",children:" Edit "})]}),(0,Et.jsxs)("a",{onClick:g,className:"flex aspect-square min-h-[25px] w-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,Et.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",fill:"currentColor",children:(0,Et.jsx)("path",{d:"M16 80C7.2 80 0 87.2 0 96s7.2 16 16 16l416 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 80zM144 240c-8.8 0-16 7.2-16 16s7.2 16 16 16l288 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-288 0zM128 416c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-288 0c-8.8 0-16 7.2-16 16zM0 432c0 8.8 7.2 16 16 16s16-7.2 16-16l0-192c0-8.8-7.2-16-16-16s-16 7.2-16 16L0 432z"})}),(0,Et.jsx)("small",{className:"text-center text-xs font-medium",children:" Contents "})]}),(0,Et.jsxs)("a",{onClick:b,className:"flex aspect-square min-h-[25px] w-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,Et.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,Et.jsx)("path",{d:"M136 64c13.3 0 24 10.7 24 24l0 24 0 32 0 24c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24l0-80c0-13.3 10.7-24 24-24l80 0zm56 104l0-24 192 0 0 24c0 30.9 25.1 56 56 56l80 0c30.9 0 56-25.1 56-56l0-80c0-30.9-25.1-56-56-56l-80 0c-30.9 0-56 25.1-56 56l0 24-192 0 0-24c0-30.9-25.1-56-56-56L56 32C25.1 32 0 57.1 0 88l0 80c0 30.9 25.1 56 56 56l80 0c8.6 0 16.7-1.9 24-5.4l72.2 96.3c-5.2 8.5-8.2 18.5-8.2 29.1l0 80c0 30.9 25.1 56 56 56l80 0c30.9 0 56-25.1 56-56l0-80c0-30.9-25.1-56-56-56l-80 0c-8.6 0-16.7 1.9-24 5.4l-72.2-96.3c5.2-8.5 8.2-18.5 8.2-29.1zm224 0l0-24 0-32 0-24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24l0 80c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24zM360 320c13.3 0 24 10.7 24 24l0 80c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24l0-80c0-13.3 10.7-24 24-24l80 0z"})}),(0,Et.jsx)("small",{className:"text-center text-xs font-medium",children:" Related "})]}),(0,Et.jsx)("hr",{className:"dark:border-gray-400"}),(0,Et.jsxs)("a",{onClick:L,className:"flex aspect-square min-h-[25px] w-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,Et.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,Et.jsx)("path",{d:"M16 0C7.2 0 0 7.2 0 16s7.2 16 16 16l544 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 0zM32 64l0 224c0 35.3 28.7 64 64 64l176 0 0 41.4-91.3 91.3c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L288 422.6l84.7 84.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L304 393.4l0-41.4 176 0c35.3 0 64-28.7 64-64l0-224-32 0 0 224c0 17.7-14.3 32-32 32l-192 0L96 320c-17.7 0-32-14.3-32-32L64 64 32 64z"})}),(0,Et.jsx)("small",{className:"text-xs font-medium",children:"Present"})]}),(0,Et.jsxs)("a",{onClick:v,className:"flex aspect-square min-h-[25px] w-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,Et.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,Et.jsx)("path",{d:"M96 160l-32 0 0-96C64 28.7 92.7 0 128 0L357.5 0c17 0 33.3 6.7 45.3 18.7l26.5 26.5c12 12 18.7 28.3 18.7 45.3l0 69.5-32 0 0-69.5c0-8.5-3.4-16.6-9.4-22.6L380.1 41.4c-6-6-14.1-9.4-22.6-9.4L128 32c-17.7 0-32 14.3-32 32l0 96zm352 64L64 224c-17.7 0-32 14.3-32 32l0 128 32 0 0-32c0-17.7 14.3-32 32-32l320 0c17.7 0 32 14.3 32 32l0 32 32 0 0-128c0-17.7-14.3-32-32-32zm0 192l0 64c0 17.7-14.3 32-32 32L96 512c-17.7 0-32-14.3-32-32l0-64-32 0c-17.7 0-32-14.3-32-32L0 256c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 128c0 17.7-14.3 32-32 32l-32 0zM96 352l0 128 320 0 0-128L96 352zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"})}),(0,Et.jsx)("small",{className:"text-xs font-medium",children:"Print"})]})]}),m&&(0,Et.jsx)("div",{className:n("Et-50 flex shrink-0 grow-0 gap-4 border-t border-gray-200 bg-white/50 p-2.5 shadow-lg backdrop-blur-lg dark:border-slate-600/60 dark:bg-slate-800/50 min-h-[auto] min-w-[54px] flex-col rounded-lg border"),children:(0,Et.jsxs)("div",{className:"flex flex-col m-2 justify-start Et-50 min-w-64",children:[(0,Et.jsx)("div",{className:"flex text-accent",children:"On this Page"}),(0,Et.jsx)("ul",{className:"flex flex-col space-Et-2",children:t.map((S,w)=>(0,Et.jsx)("li",{className:f(S.tag),children:(0,Et.jsx)("a",{href:`#${S.id}`,className:`text-xs ${l===S.id?"text-accent font-semibold":"text-primary dark:text-foreground"} hover:text-accent`,children:S.text})},w))})]})}),d&&r&&r.length>0&&(0,Et.jsx)("div",{className:n("Et-50 flex shrink-0 grow-0 gap-4 border-t border-gray-200 bg-white/50 p-2.5 shadow-lg backdrop-blur-lg dark:border-slate-600/60 dark:bg-slate-800/50 min-h-[auto] min-w-[54px] flex-col rounded-lg border"),children:(0,Et.jsxs)("div",{className:"flex flex-col m-2 justify-start Et-50 min-w-64",children:[(0,Et.jsx)("div",{className:"flex text-accent",children:"Related Content"}),(0,Et.jsx)("ul",{className:"flex flex-col space-Et-2",children:r.map((S,w)=>S.links&&S.links.length>0?S.links.map((k,x)=>(0,Et.jsxs)(fl.default,{href:k.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[k.name,k.href.startsWith("http")&&(0,Et.jsx)(Lm.ExternalLink,{className:"ml-1 h-3 w-3"})]},x)):null)})]})})]})})};var Bm=h(require("next/image"));function Rf({className:e,children:t,image:a="https://images.unsplash.com/photo-1557804506-669a67965ba0?q=80&w=2574&auto=format&fit=crop",imageAlt:o="Professional presentation in modern office setting",imagePosition:r="left",overlay:s=!0}){return(0,Et.jsxs)("section",{className:n("relative min-h-[50vh] w-full overflow-hidden",e),children:[(0,Et.jsxs)("div",{className:"absolute inset-0 w-full",children:[(0,Et.jsx)(Bm.default,{src:a||"/placeholder.svg",alt:o,fill:!0,className:"object-cover",priority:!0}),s&&(0,Et.jsx)("div",{className:"absolute inset-0",style:{background:r==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]}),(0,Et.jsx)("div",{className:n("relative w-full max-w-8xl mx-auto px-4 md:px-6 lg:px-8","flex items-center",r==="left"?"justify-end":"justify-start"),children:(0,Et.jsx)("div",{className:n("w-full max-w-xl py-12",r==="left"?"ml-auto":"mr-auto"),children:t})})]})}var gl=h(require("next/image"));function Tf({blogs:e,sectionHeading:t,base:a="insights"}){return(0,Et.jsxs)(Ct,{children:[(0,Et.jsx)("div",{className:"",children:t&&(0,Et.jsx)("div",{"data-aos":"fade-up","data-aos-delay":"100",children:(0,Et.jsx)(lo,{...t,alignment:"start",hasBottomSpacing:!0})})}),e&&e.length>0&&(0,Et.jsx)("div",{className:"-mx-4 flex flex-wrap justify-start gap-Et-4",children:e.map((o,r)=>(0,Et.jsx)("div",{"data-aos":"fade-up","data-aos-delay":lr([200,400,600],r),className:"w-full h-full md:w-1/2 md:px-4 lg:w-1/3",children:(0,Et.jsx)(Hm,{...o,base:a})},r))})]})}var Em=n("inline-flex items-center gap-2 text-white"),j2=n("text-sm text-white");function Hm({slug:e,meta:t,authors:a,title:o,publishedAt:r,categories:s,base:l}){return(0,Et.jsxs)("article",{className:"group/blog relative Et-1 flex h-full min-h-[452px] flex-col overflow-hidden rounded-5 p-0",children:[(0,Et.jsx)("span",{className:"absolute inset-0 Et-[2] "}),(0,Et.jsx)(gl.default,{src:t?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:t?.image?.alt||"Blog image",fill:!0,sizes:`
|