cortex-react-components 1.59.2 → 1.59.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/{chunk-KIICLHKI.mjs → chunk-23BDC5JG.mjs} +1 -1
  2. package/dist/{chunk-4WJNMYVD.mjs → chunk-262AEZUO.mjs} +1 -1
  3. package/dist/{chunk-KB6PO4K4.mjs → chunk-2IKC7MAP.mjs} +1 -1
  4. package/dist/{chunk-PWCOSXXO.mjs → chunk-7PNAXVQ2.mjs} +1 -1
  5. package/dist/{chunk-FEYDWMHW.mjs → chunk-AM2RC47K.mjs} +1 -1
  6. package/dist/chunk-BKTNKT2H.mjs +4 -0
  7. package/dist/{chunk-T4I5D4XZ.mjs → chunk-D44ZXHH4.mjs} +1 -1
  8. package/dist/{chunk-DNUAT3WL.mjs → chunk-DW2PXYEK.mjs} +1 -1
  9. package/dist/{chunk-BYAZAWJT.mjs → chunk-IDU3K2IT.mjs} +1 -1
  10. package/dist/{chunk-SBAFXZVU.mjs → chunk-IO222G5L.mjs} +1 -1
  11. package/dist/{chunk-S7I4XJS6.mjs → chunk-KLCZHZKQ.mjs} +1 -1
  12. package/dist/{chunk-WARSIFKB.mjs → chunk-KUJXSGYS.mjs} +1 -1
  13. package/dist/{chunk-SHXLLMMQ.mjs → chunk-LSRCUGWD.mjs} +1 -1
  14. package/dist/{chunk-AV32ES47.mjs → chunk-OSJ5SO3C.mjs} +1 -1
  15. package/dist/{chunk-C5CD2Z6J.mjs → chunk-PIZJV2CM.mjs} +1 -1
  16. package/dist/{chunk-VEBYJI35.mjs → chunk-PQA5CYYB.mjs} +1 -1
  17. package/dist/{chunk-PY53YVFX.mjs → chunk-QMFZRG7O.mjs} +1 -1
  18. package/dist/{chunk-LNOGD2XI.mjs → chunk-RUY34B5T.mjs} +1 -1
  19. package/dist/{chunk-KLMSIHUH.mjs → chunk-S234OU3X.mjs} +1 -1
  20. package/dist/{chunk-7IZ2X75V.mjs → chunk-SMD2U5NY.mjs} +1 -1
  21. package/dist/{chunk-KQJLOUAU.mjs → chunk-T67YJGQO.mjs} +1 -1
  22. package/dist/components/Blocks/Banner.mjs +1 -1
  23. package/dist/components/Blocks/CallToAction.mjs +1 -1
  24. package/dist/components/Blocks/CallToAction.stories.mjs +1 -1
  25. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  26. package/dist/components/Blocks/CollapsibleArea.stories.mjs +1 -1
  27. package/dist/components/Blocks/Content.mjs +1 -1
  28. package/dist/components/Blocks/Content.stories.mjs +1 -1
  29. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  30. package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
  31. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  32. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  33. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  34. package/dist/components/Blocks/index.mjs +1 -1
  35. package/dist/components/CRM/DealDetails.mjs +1 -1
  36. package/dist/components/CRM/DealDetails.stories.mjs +1 -1
  37. package/dist/components/CRM/KanbanBoard.js +1 -1
  38. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  39. package/dist/components/CRM/KanbanBoard.stories.js +1 -1
  40. package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
  41. package/dist/components/CRM/KanbanColumn.mjs +1 -1
  42. package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
  43. package/dist/components/CRM/NewDealForm.mjs +1 -1
  44. package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
  45. package/dist/components/CRM/index.js +1 -1
  46. package/dist/components/CRM/index.mjs +1 -1
  47. package/dist/components/Cards/ContentCard.mjs +1 -1
  48. package/dist/components/Cards/ContentCard.stories.mjs +1 -1
  49. package/dist/components/Cards/FeatureCard.mjs +1 -1
  50. package/dist/components/Cards/FeatureCard.stories.mjs +1 -1
  51. package/dist/components/Cards/index.mjs +1 -1
  52. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  53. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  54. package/dist/components/DigitalColleagues/MainPage.stories.mjs +1 -1
  55. package/dist/components/HeaderFooter/Header.stories.mjs +1 -1
  56. package/dist/components/HeaderFooter/HeaderDesktop.stories.mjs +1 -1
  57. package/dist/components/HeaderFooter/HeaderMobile.stories.mjs +1 -1
  58. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  59. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  60. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  61. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  62. package/dist/components/Heros/PostHero/index.mjs +1 -1
  63. package/dist/components/Heros/RenderHero.mjs +1 -1
  64. package/dist/components/Heros/index.mjs +1 -1
  65. package/dist/components/Layouts/FeatureGrid.stories.mjs +1 -1
  66. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  67. package/dist/components/Layouts/Print.mjs +1 -1
  68. package/dist/components/Layouts/Print.stories.mjs +1 -1
  69. package/dist/components/Layouts/SlideShow.mjs +1 -1
  70. package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
  71. package/dist/components/Layouts/index.mjs +1 -1
  72. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  73. package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
  74. package/dist/components/Menus/SidebarRight.mjs +1 -1
  75. package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
  76. package/dist/components/Menus/index.mjs +1 -1
  77. package/dist/components/Payload/RichText/index.mjs +1 -1
  78. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  79. package/dist/components/Payload/RichText.stories.mjs +1 -1
  80. package/dist/components/Payload/index.mjs +1 -1
  81. package/dist/components/index.js +1 -1
  82. package/dist/components/index.mjs +1 -1
  83. package/dist/components/ui/index.mjs +1 -1
  84. package/dist/components/ui/sidebar.mjs +1 -1
  85. package/dist/hooks/index.mjs +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/index.mjs +1 -1
  88. package/dist/metafile-cjs.json +1 -1
  89. package/dist/metafile-esm.json +1 -1
  90. package/dist/pages/Blog.mjs +1 -1
  91. package/dist/pages/Blog.stories.mjs +1 -1
  92. package/dist/pages/Documentation.mjs +1 -1
  93. package/dist/pages/Documentation.stories.mjs +1 -1
  94. package/dist/pages/IndexPage.mjs +1 -1
  95. package/dist/pages/IndexPage.stories.mjs +1 -1
  96. package/dist/pages/Intranet.mjs +1 -1
  97. package/dist/pages/Intranet.stories.mjs +1 -1
  98. package/dist/pages/LandingPage.mjs +1 -1
  99. package/dist/pages/LandingPage.stories.mjs +1 -1
  100. package/dist/pages/Page.mjs +1 -1
  101. package/dist/pages/Page.stories.mjs +1 -1
  102. package/dist/pages/Printable.stories.mjs +1 -1
  103. package/dist/pages/Publish.mjs +1 -1
  104. package/dist/pages/Publish.stories.mjs +1 -1
  105. package/dist/pages/Website.mjs +1 -1
  106. package/dist/pages/Website.stories.mjs +1 -1
  107. package/dist/sections/AboutSection.mjs +1 -1
  108. package/dist/sections/AboutSection.stories.mjs +1 -1
  109. package/dist/sections/BlogDetail.mjs +1 -1
  110. package/dist/sections/BlogDetail.stories.mjs +1 -1
  111. package/dist/sections/BlogList.mjs +1 -1
  112. package/dist/sections/BlogList.stories.mjs +1 -1
  113. package/dist/sections/BlogListSection.mjs +1 -1
  114. package/dist/sections/BlogListSection.stories.mjs +1 -1
  115. package/dist/sections/ContactSection.mjs +1 -1
  116. package/dist/sections/ContactSection.stories.mjs +1 -1
  117. package/dist/sections/ImageSection.stories.mjs +1 -1
  118. package/dist/sections/PageSections.mjs +1 -1
  119. package/dist/sections/PageSections.stories.mjs +1 -1
  120. package/dist/sections/PricingSection.mjs +1 -1
  121. package/dist/sections/PricingSection.stories.mjs +1 -1
  122. package/dist/sections/ServiceDetail.mjs +1 -1
  123. package/dist/sections/ServiceDetailSection.mjs +1 -1
  124. package/dist/sections/ServiceDetailSection.stories.mjs +1 -1
  125. package/dist/sections/ServiceSection.mjs +1 -1
  126. package/dist/sections/ServiceSection.stories.mjs +1 -1
  127. package/dist/sections/index.mjs +1 -1
  128. package/package.json +1 -1
  129. package/dist/chunk-QK4CHE4X.mjs +0 -4
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";var Gt=Object.create;var Te=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Kt=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var $t=(e,t)=>{for(var r in t)Te(e,r,{get:t[r],enumerable:!0})},Ze=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jt(t))!_t.call(e,i)&&i!==r&&Te(e,i,{get:()=>t[i],enumerable:!(a=Ot(t,i))||a.enumerable});return e};var H=(e,t,r)=>(r=e!=null?Gt(Kt(e)):{},Ze(t||!e||!e.__esModule?Te(r,"default",{value:e,enumerable:!0}):r,e)),qt=e=>Ze(Te({},"__esModule",{value:!0}),e);var Fr={};$t(Fr,{Default:()=>ze,NoDeals:()=>Ut,default:()=>Vr});module.exports=qt(Fr);var Vt=require("react");var De=H(require("react")),M=H(require("@radix-ui/react-dialog")),nt=require("lucide-react");var it=require("clsx");var Ue="-",Jt=e=>{let t=Zt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let o=c.split(Ue);return o[0]===""&&o.length!==1&&o.shift(),et(o,t)||Qt(c)},getConflictingClassGroupIds:(c,o)=>{let v=r[c]||[];return o&&a[c]?[...v,...a[c]]:v}}},et=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),i=a?et(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let s=e.join(Ue);return(c=t.validators.find(({validator:o})=>o(s)))==null?void 0:c.classGroupId},Xe=/^\[(.+)\]$/,Qt=e=>{if(Xe.test(e)){let t=Xe.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Zt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return Yt(Object.entries(e.classGroups),r).forEach(([s,c])=>{Fe(c,a,s,t)}),a},Fe=(e,t,r,a)=>{e.forEach(i=>{if(typeof i=="string"){let s=i===""?t:Ye(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(Xt(i)){Fe(i(a),t,r,a);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,c])=>{Fe(c,Ye(t,s),r,a)})})},Ye=(e,t)=>{let r=e;return t.split(Ue).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Xt=e=>e.isThemeGetter,Yt=(e,t)=>t?e.map(([r,a])=>{let i=a.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,o])=>[t+c,o])):s);return[r,i]}):e,er=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,i=(s,c)=>{r.set(s,c),t++,t>e&&(t=0,a=r,r=new Map)};return{get(s){let c=r.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return i(s,c),c},set(s,c){r.has(s)?r.set(s,c):i(s,c)}}},tt="!",tr=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,i=t[0],s=t.length,c=o=>{let v=[],N=0,P=0,D;for(let x=0;x<o.length;x++){let A=o[x];if(N===0){if(A===i&&(a||o.slice(x,x+s)===t)){v.push(o.slice(P,x)),P=x+s;continue}if(A==="/"){D=x;continue}}A==="["?N++:A==="]"&&N--}let p=v.length===0?o:o.substring(P),g=p.startsWith(tt),b=g?p.substring(1):p,w=D&&D>P?D-P:void 0;return{modifiers:v,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:w}};return r?o=>r({className:o,parseClassName:c}):c},rr=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},or=e=>({cache:er(e.cacheSize),parseClassName:tr(e),...Jt(e)}),ar=/\s+/,sr=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:i}=t,s=[],c=e.trim().split(ar),o="";for(let v=c.length-1;v>=0;v-=1){let N=c[v],{modifiers:P,hasImportantModifier:D,baseClassName:p,maybePostfixModifierPosition:g}=r(N),b=!!g,w=a(b?p.substring(0,g):p);if(!w){if(!b){o=N+(o.length>0?" "+o:o);continue}if(w=a(p),!w){o=N+(o.length>0?" "+o:o);continue}b=!1}let x=rr(P).join(":"),A=D?x+tt:x,E=A+w;if(s.includes(E))continue;s.push(E);let z=i(w,b);for(let B=0;B<z.length;++B){let U=z[B];s.push(A+U)}o=N+(o.length>0?" "+o:o)}return o};function ir(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=rt(t))&&(a&&(a+=" "),a+=r);return a}var rt=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=rt(e[a]))&&(r&&(r+=" "),r+=t);return r};function nr(e,...t){let r,a,i,s=c;function c(v){let N=t.reduce((P,D)=>D(P),e());return r=or(N),a=r.cache.get,i=r.cache.set,s=o,o(v)}function o(v){let N=a(v);if(N)return N;let P=sr(v,r);return i(v,P),P}return function(){return s(ir.apply(null,arguments))}}var R=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},ot=/^\[(?:([a-z-]+):)?(.+)\]$/i,lr=/^\V+\/\V+$/,cr=new Set(["px","full","screen"]),dr=/^(\V+(\.\V+)?)?(xs|sm|md|lg|xl)$/,mr=/\V+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ur=/^(inset_)?-?((\V+)?\.?(\V+)[a-z]+|0)_-?((\V+)?\.?(\V+)[a-z]+|0)/,fr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_=e=>ue(e)||cr.has(e)||lr.test(e),q=e=>fe(e,"length",wr),ue=e=>!!e&&!Number.isNaN(Number(e)),Ve=e=>fe(e,"number",ue),we=e=>!!e&&Number.isInteger(Number(e)),gr=e=>e.endsWith("%")&&ue(e.slice(0,-1)),u=e=>ot.test(e),J=e=>dr.test(e),br=new Set(["length","size","percentage"]),vr=e=>fe(e,br,at),hr=e=>fe(e,"position",at),yr=new Set(["image","url"]),xr=e=>fe(e,yr,Dr),Cr=e=>fe(e,"",Sr),Se=()=>!0,fe=(e,t,r)=>{let a=ot.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},wr=e=>mr.test(e)&&!pr.test(e),at=()=>!1,Sr=e=>ur.test(e),Dr=e=>fr.test(e);var Nr=()=>{let e=R("colors"),t=R("spacing"),r=R("blur"),a=R("brightness"),i=R("borderColor"),s=R("borderRadius"),c=R("borderSpacing"),o=R("borderWidth"),v=R("contrast"),N=R("grayscale"),P=R("hueRotate"),D=R("invert"),p=R("gap"),g=R("gradientColorStops"),b=R("gradientColorStopPositions"),w=R("inset"),x=R("margin"),A=R("opacity"),E=R("padding"),z=R("saturate"),B=R("scale"),U=R("sepia"),$=R("skew"),m=R("space"),h=R("translate"),O=()=>["auto","contain","none"],l=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto",u,t],S=()=>[u,t],Re=()=>["",_,q],Ae=()=>["auto",ue,u],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ke=()=>["solid","dashed","dotted","double","none"],Je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],He=()=>["start","end","center","between","around","evenly","stretch"],Ce=()=>["","0",u],Qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[ue,u];return{cacheSize:500,separator:":",theme:{colors:[Se],spacing:[_,q],blur:["none","",J,u],brightness:K(),borderColor:[e],borderRadius:["none","","full",J,u],borderSpacing:S(),borderWidth:Re(),contrast:K(),grayscale:Ce(),hueRotate:K(),invert:Ce(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[gr,q],inset:C(),margin:C(),opacity:K(),padding:S(),saturate:K(),scale:K(),sepia:Ce(),skew:K(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":Qe()}],"break-before":[{"break-before":Qe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...qe(),u]}],overflow:[{overflow:l()}],"overflow-x":[{"overflow-x":l()}],"overflow-y":[{"overflow-y":l()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",we,u]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",u]}],grow:[{grow:Ce()}],shrink:[{shrink:Ce()}],order:[{order:["first","last","none",we,u]}],"grid-cols":[{"grid-cols":[Se]}],"col-start-end":[{col:["auto",{span:["full",we,u]},u]}],"col-start":[{"col-start":Ae()}],"col-end":[{"col-end":Ae()}],"grid-rows":[{"grid-rows":[Se]}],"row-start-end":[{row:["auto",{span:[we,u]},u]}],"row-start":[{"row-start":Ae()}],"row-end":[{"row-end":Ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",u]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",u]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...He()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...He(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...He(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],V:[{V:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[m]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[m]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",u,t]}],"min-w":[{"min-w":[u,t,"min","max","fit"]}],"max-w":[{"max-w":[u,t,"none","full","min","max","fit","prose",{screen:[J]},J]}],h:[{h:[u,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[u,t,"auto","min","max","fit"]}],"font-size":[{text:["base",J,q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ve]}],"font-family":[{font:[Se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",u]}],"line-clamp":[{"line-clamp":["none",ue,Ve]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_,u]}],"list-image":[{"list-image":["none",u]}],"list-style-type":[{list:["none","disc","decimal",u]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_,q]}],"underline-offset":[{"underline-offset":["auto",_,u]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),hr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...ke(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:ke()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...ke()]}],"outline-offset":[{"outline-offset":[_,u]}],"outline-w":[{outline:[_,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[_,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,Cr]}],"shadow-color":[{shadow:[Se]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...Je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Je()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",J,u]}],grayscale:[{grayscale:[N]}],"hue-rotate":[{"hue-rotate":[P]}],invert:[{invert:[D]}],saturate:[{saturate:[z]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[P]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[B]}],"scale-x":[{"scale-x":[B]}],"scale-y":[{"scale-y":[B]}],rotate:[{rotate:[we,u]}],"translate-x":[{"translate-x":[h]}],"translate-y":[{"translate-y":[h]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",u]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","V-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-V":[{"scroll-V":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",u]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[_,q,Ve]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","V","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-V","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var st=nr(Nr);function f(...e){return st((0,it.clsx)(e))}var V=require("react/jsx-runtime"),ge=M.Root,lt=M.Trigger,Pr=M.Portal;var ct=De.forwardRef(({className:e,...t},r)=>(0,V.jsx)(M.Overlay,{ref:r,className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ct.displayName=M.Overlay.displayName;var Y=De.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(Pr,{children:[(0,V.jsx)(ct,{}),(0,V.jsxs)(M.Content,{ref:a,className:f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,(0,V.jsxs)(M.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,V.jsx)(nt.nt,{className:"h-4 w-4"}),(0,V.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Y.displayName=M.Content.displayName;var ee=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ee.displayName="DialogHeader";var Rr=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rr.displayName="DialogFooter";var te=De.forwardRef(({className:e,...t},r)=>(0,V.jsx)(M.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));te.displayName=M.Title.displayName;var Ar=De.forwardRef(({className:e,...t},r)=>(0,V.jsx)(M.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Ar.displayName=M.Description.displayName;var dt=require("@radix-ui/react-slot"),mt=require("class-variance-authority"),pt=H(require("react")),kr=(0,mt.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),W=pt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...i},s)=>(0,V.jsx)(e?dt.Slot:"button",{className:f(kr({className:t,size:r,variant:a})),ref:s,...i}));W.displayName="Button";var ft=H(require("react"));var j=ft.forwardRef(({className:e,type:t,...r},a)=>(0,V.jsx)("input",{type:t,className:f("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));j.displayName="Input";var bt=H(require("react")),We=H(require("@radix-ui/react-label"));var Tr=(0,mt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=bt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(We.Root,{ref:r,className:f(Tr(),e),...t}));I.displayName=We.Root.displayName;var yt=H(require("react")),re=yt.forwardRef(({className:e,...t},r)=>(0,V.jsx)("textarea",{className:f("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));re.displayName="Textarea";var y=H(require("@radix-ui/react-select")),Q=H(require("react")),be=y.Root;var ve=y.Value,ae=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(y.Trigger,{className:f("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...r,children:[e,(0,V.jsx)(y.Icon,{asChild:!0,children:(0,V.jsx)(nt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ae.displayName=y.Trigger.displayName;var Ct=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(nt.ChevronUp,{className:"h-4 w-4"})}));Ct.displayName=y.ScrollUpButton.displayName;var wt=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(nt.ChevronDown,{className:"h-4 w-4"})}));wt.displayName=y.ScrollDownButton.displayName;var se=Q.forwardRef(({children:e,className:t,position:r="popper",...a},i)=>(0,V.jsx)(y.Portal,{children:(0,V.jsxs)(y.Content,{className:f("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,ref:i,...a,children:[(0,V.jsx)(Ct,{}),(0,V.jsx)(y.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,V.jsx)(wt,{})]})}));se.displayName=y.Content.displayName;var Mr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));Mr.displayName=y.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(y.Item,{className:f("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...r,children:[(0,V.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,V.jsx)(y.ItemIndicator,{children:(0,V.jsx)(nt.Check,{className:"h-4 w-4"})})}),(0,V.jsx)(y.ItemText,{children:e})]}));ie.displayName=y.Item.displayName;var Lr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Lr.displayName=y.Separator.displayName;var Ne=H(require("@radix-ui/react-checkbox")),Dt=H(require("react")),ne=Dt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(Ne.Root,{className:f("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:r,...t,children:(0,V.jsx)(Ne.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,V.jsx)(nt.Check,{className:"h-4 w-4"})})}));ne.displayName=Ne.Root.displayName;var Ir=(0,mt.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Le({className:e,variant:t,...r}){return(0,V.jsx)("div",{className:f(Ir({variant:t}),e),...r})}var Ge=H(require("react")),G=H(require("@radix-ui/react-scroll-area"));var he=Ge.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(G.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,V.jsx)(G.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,V.jsx)(Rt,{}),(0,V.jsx)(G.Corner,{})]}));he.displayName=G.Root.displayName;var Rt=Ge.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,V.jsx)(G.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,V.jsx)(G.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Rt.displayName=G.ScrollAreaScrollbar.displayName;function At({deal:e,users:t,customer:r,categories:a,onClose:i,onSave:s,onAddComment:c}){var U,$,m,h,O;let[o,v]=(0,Vt.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[N,P]=(0,Vt.useState)(""),[D,p]=(0,Vt.useState)(!1),[g,b]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{p(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let w=async()=>{try{let l=await s(o);l.success?(p(!1),b(null)):console.error("Failed to save deal:",l.errors)}catch(l){console.error("Failed to save deal:",l)}},x=(l,C)=>{v(S=>({...S,[l]:C}))},A=l=>{let C=(o.categories||[]).includes(l)?(o.categories||[]).filter(S=>S!==l):[...o.categories||[],l];x("categories",C)},E=async()=>{if(N.trim()){let l={text:N,timestamp:new Date().toISOString()};try{let C=await c(l);if(!C.success){console.error("Failed to add comment:",C.errors);return}}catch(C){console.error("Failed to add comment:",C)}v(C=>({...C,comments:[...C.comments||[],l]})),P("")}},z=l=>{switch(l){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"}},B=l=>t==null?void 0:t.find(C=>C.id===Number(l));return(0,V.jsx)(ge,{open:!0,children:(0,V.jsxs)(Y,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,V.jsxs)(ee,{className:"flex flex-row items-center justify-between",children:[(0,V.jsx)(te,{className:"text-2xl font-bold",children:r==null?void 0:r.name}),(0,V.jsxs)("div",{className:"flex space-x-2",children:[(0,V.jsx)(W,{variant:"outline",onClick:i,children:"Close"}),(0,V.jsxs)(W,{onClick:w,disabled:!D,children:[(0,V.jsx)(nt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,V.jsxs)(he,{className:"flex-grow pr-4",children:[(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,V.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,V.jsx)(j,{type:"number",value:o.value,onChange:l=>x("value",Number(l.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,V.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",(U=o.value)==null?void 0:U.toLocaleString()]})}),(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,V.jsxs)(be,{value:((m=($=o==null?void 0:o.assignee)==null?void 0:$.id)==null?void 0:m.toString())||"",onValueChange:l=>x("assignee",B(l)),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(l=>{var C;return(0,V.jsx)(ie,{value:((C=l==null?void 0:l.id)==null?void 0:C.toString())||"",children:l.name},l.id)})})]}):(0,V.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,V.jsx)(nt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.assignee.name})]})]}),(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,V.jsx)(j,{type:"date",value:(O=(h=o.closureDate)==null?void 0:h.split("V")[0])!=null?O:"",onChange:l=>x("closureDate",l.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,V.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,V.jsx)(nt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,V.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,V.jsx)(re,{value:o.description||"",onChange:l=>x("description",l.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,V.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:o.description})]})}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,V.jsxs)(be,{value:o.status,onValueChange:l=>{x("status",l),b(null)},children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select status"})}),(0,V.jsx)(se,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(l=>(0,V.jsx)(ie,{value:l,children:l},l))})]}):(0,V.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:o.status})]}),(0,V.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(l=>{var C,S;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:((C=l.id)==null?void 0:C.toString())||"",checked:(o.categories||[]).some(Re=>Re.id===l.id),onCheckedChange:()=>l.id!==void 0&&A(l)}),(0,V.jsx)("label",{htmlFor:((S=l.id)!=null?S:"").toString(),className:`text-sm font-medium ${z(l.type||"sector")} px-2 py-1 rounded`,children:l.name})]},l.id)})}):(0,V.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:o.categories&&o.categories.map(l=>{let C=l;return C?(0,V.jsx)(Le,{variant:"outline",className:z(C.type||"sector"),children:C.name},C.id):null})})]})]}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,V.jsx)(he,{className:"h-[200px] overflow-y-auto",children:(0,V.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((l,C)=>new Date(C.timestamp||"").getTime()-new Date(l.timestamp||"").getTime()).map(l=>{var C;return(0,V.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,V.jsx)("p",{className:"text-sm text-foreground",children:l.text}),(0,V.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[(C=l==null?void 0:l.author)==null?void 0:C.name," - ",new Date(l.timestamp||"").toLocaleString()]})]},l.id)})})}),(0,V.jsxs)("div",{className:"flex mt-2",children:[(0,V.jsx)(j,{value:N,onChange:l=>P(l.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,V.jsxs)(W,{onClick:E,className:"ml-2",children:[(0,V.jsx)(nt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,V.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ce=H(require("react"));var Oe=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Oe.displayName="Card";var je=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));je.displayName="CardHeader";var Ke=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Ke.displayName="CardTitle";var Er=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Er.displayName="CardDescription";var _e=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("p-6 pt-0",e),...t}));_e.displayName="CardContent";var Br=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex items-center p-6 pt-0",e),...t}));Br.displayName="CardFooter";function kt({deal:e,customer:t,categories:r,onClick:a}){let i=r.find(s=>{var c;return s.type==="proposition"&&((c=e.categories)!=null?c:[]).includes(s.id)});return(0,V.jsxs)(Oe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,V.jsxs)(je,{className:"pb-2",children:[(0,V.jsx)("div",{className:"flex justify-between items-center",children:(0,V.jsx)(Ke,{className:"text-lg font-semibold text-foreground",children:t==null?void 0:t.name})}),(0,V.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,V.jsxs)(_e,{children:[(0,V.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,V.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,V.jsx)(nt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,V.jsx)("span",{children:e.assignee.name})]}),(0,V.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,V.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,V.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,V.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,V.jsx)(nt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,V.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,V.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,V.jsx)(Le,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var Ee=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Mt({onSubmit:e}){var i;let[t,r]=(0,Vt.useState)({name:"",intro:"",active:!1});return(0,V.jsxs)("form",{onSubmit:s=>{s.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),r({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,V.jsx)(j,{id:"customerName",value:t.name,onChange:s=>r({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,V.jsx)(re,{id:"customerIntro",value:(i=t.intro)!=null?i:"",onChange:s=>r({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>r({...t,active:s})}),(0,V.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,V.jsx)(W,{type:"submit",className:"w-full",children:"Add Customer"})]})}function It({customers:e,users:t,categories:r,onSubmit:a,initialDeal:i,onAddCustomer:s,onClose:c}){var z,B,U,$;let[o,v]=(0,Vt.useState)(i||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("V")[0],closureDate:"",comments:[],description:""}),[N,P]=(0,Vt.useState)(!1),[D,p]=(0,Vt.useState)({});(0,Vt.useEffect)(()=>{i&&v(i)},[i]);let g=()=>{let m={};return o.customer||(m.customer="Customer is required"),o.value||(m.value="Value is required"),o.assignee||(m.assignee="Assignee is required"),o.closureDate||(m.closureDate="Closure Date is required"),p(m),Object.keys(m).length===0},b=async m=>{m.preventDefault(),p({});try{if(g()){let h=await a({...o});h.success?(v({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),c==null||c()):p(h.errors||{})}}catch{p({submit:"An error occurred while submitting the form."})}},w=m=>{v(h=>({...h,categories:(h.categories||[]).includes(m.id)?(h.categories||[]).filter(O=>O!==m.id):[...h.categories||[],m.id]}))},x=async m=>{v({...o,customer:m});try{let h=await s(m);h.success?P(!1):p(h.errors||{})}catch{p({submit:"An error occurred while submitting the form."})}},A=m=>t==null?void 0:t.find(h=>h.id===Number(m)),E=m=>e==null?void 0:e.find(h=>h.id===Number(m));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,V.jsx)(he,{className:"h-[60vh] pr-4",children:(0,V.jsxs)("div",{className:"space-y-6 px-4",children:[(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsxs)(be,{value:(B=(z=o.customer)==null?void 0:z.id)==null?void 0:B.toString(),onValueChange:m=>v({...o,customer:E(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select customer"})}),(0,V.jsx)(se,{children:e.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),(0,V.jsx)(W,{variant:"outline",size:"icon",onClick:()=>P(!0),children:(0,V.jsx)(nt.PlusIcon,{className:"w-5 h-5"})})]}),D.customerId&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.customerId})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"value",children:"Value"}),(0,V.jsx)(j,{id:"value",type:"number",value:o.value||"",onChange:m=>v({...o,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),D.value&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.value})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,V.jsxs)(be,{value:($=(U=o.assignee)==null?void 0:U.id)==null?void 0:$.toString(),onValueChange:m=>v({...o,assignee:A(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),D.assignee&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.assignee})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"description",children:"Description"}),(0,V.jsx)(re,{id:"description",value:o.description||"",onChange:m=>v({...o,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{children:"Categories"}),(0,V.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(h=>h.type===m).map(h=>{var O;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:h.id.toString(),checked:(O=o.categories)==null?void 0:O.includes(h.id),onCheckedChange:()=>w(h)}),(0,V.jsx)("label",{htmlFor:h.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:h.name})]},h.id)})})]},m))})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,V.jsx)(j,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:m=>v({...o,closureDate:m.target.value})}),D.closureDate&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.closureDate})]})]})}),(0,V.jsx)(W,{type:"submit",className:"w-full",children:i?"Update Deal":"Add Deal"})]}),(0,V.jsx)(ge,{open:N,onOpenChange:P,children:(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Customer"})}),(0,V.jsx)(Mt,{onSubmit:x})]})})]})}function zt({status:e,deals:t,users:r,customers:a,categories:i,onDealClick:s,calculateColumnValue:c,calculateWeightedValue:o,addNewDeal:v,onAddCustomer:N}){let[P,D]=(0,Vt.useState)(!1);return(0,V.jsxs)("div",{className:"flex flex-col w-80",children:[(0,V.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),v&&(0,V.jsxs)(ge,{open:P,onOpenChange:D,children:[(0,V.jsx)(lt,{asChild:!0,children:(0,V.jsxs)(W,{className:"mb-4 w-full",children:[(0,V.jsx)(nt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Deal"})}),(0,V.jsx)(It,{customers:a,users:r,categories:i,onSubmit:v,onAddCustomer:N,onClose:()=>D(!1)})]})]}),(0,V.jsx)(Ee.Droppable,{droppableId:e,isDropDisabled:!1,children:p=>(0,V.jsxs)("div",{ref:p.innerRef,...p.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((g,b)=>(0,V.jsx)(Ee.Draggable,{draggableId:g.id.toString(),index:g.id,children:w=>(0,V.jsx)("div",{ref:w.innerRef,...w.draggableProps,...w.dragHandleProps,children:(0,V.jsx)(kt,{deal:g,customer:g.customer,categories:i,onClick:()=>s(g)})})},g.id.toString())),p.placeholder]})}),(0,V.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,V.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,V.jsxs)("span",{className:"text-green-600",children:["\xA3",c(t).toLocaleString()]})]}),(0,V.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,V.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var zr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function $e({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:i}){var D;let[s,c]=(0,Vt.useState)(null),o=p=>{var g;return((g=e.deals)!=null?g:[]).filter(b=>b.status===p)},v=p=>p.reduce((g,b)=>g+(b.value||0),0),N=(p,g)=>{let b={Cold:.2,Qualified:.4,"Proposal Made":.6,"SoW Submitted":.7,Won:1,Lost:0};return p.reduce((w,x)=>w+(x.value||0)*b[g],0)},P=(0,Vt.useCallback)(p=>{var z,B;let{source:g,destination:b}=p;if(!b||g.droppableId===b.droppableId&&g.index===b.index)return;let w=g.droppableId,x=b.droppableId,A=(z=e.deals)==null?void 0:z.filter(U=>U.id===g.index)[0],E=[...(B=e.deals)!=null?B:[]];A&&(A.status=x,r(A))},[r]);return(0,V.jsx)(Ee.DragDropContext,{onDragEnd:P,children:(0,V.jsxs)("div",{className:"p-4 max-h-[90vh] overflow-auto",children:[(0,V.jsx)("div",{className:"flex space-x-4 pb-4",children:zr.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{var b,w;let g=o(p);return(0,V.jsx)(zt,{status:p,deals:g,customers:(b=e.customers)!=null?b:[],users:e.users,categories:(w=e.categories)!=null?w:[],onDealClick:c,calculateColumnValue:v,calculateWeightedValue:N,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),s&&(0,V.jsx)(At,{deal:s,users:e.users,customer:s.customer,categories:(D=e.categories)!=null?D:[],onClose:()=>c(null),onSave:r,onAddComment:p=>a(s.id.toString(),p)})]})})}var Pe=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1,createdAt:"2023-01-01",updatedAt:"2023-01-01"}],xe=[{id:1,name:"Software",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Hardware",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Referral",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Outbound",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Tech",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:6,name:"Finance",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],pe=[{id:1,name:"John Doe",email:"john.doe@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Bob Johnson",email:"bob.johnson@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Alice Brown",email:"alice.brown@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Charlie Davis",email:"charlie.davis@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],aa=[{id:1,customer:Pe[0],value:5e4,assignee:pe[2],status:"Qualified",categories:xe.slice(0,3),dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",createdAt:"2023-01-01",comments:[{id:"1",text:"Initial contact made",author:pe[5],timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},value:75e3,assignee:{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},status:"Proposal Made",categories:xe.slice(0,3),dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",createdAt:"2023-01-01",comments:[{id:"2",text:"Proposal sent",author:pe[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var Hr={title:"CRM/KanbanBoard",component:$e},Vr=Hr,Ft=e=>{let[t,r]=(0,Vt.useState)(e.initialData);return(0,V.jsx)($e,{...e,initialData:t,updateDeal:async i=>(console.log("Updating deal:",i),r(s=>{var c;return{...s,deals:((c=s.deals)!=null?c:[]).map(o=>o.id===i.id?i:o)}}),i)})},ze=Ft.bind({});ze.args={initialData:{deals:Array.from({length:3},(e,t)=>({id:t+1,customer:Pe[t%Pe.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:pe[Math.floor(Math.random()*pe.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[xe[t%xe.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:Pe,users:pe,categories:xe},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),addNewCustomer:async e=>(console.log("Adding customer:",e),{...e,id:"new-customer-id"}),addComment:async(e,t)=>(console.log("Adding comment to deal:",e,t),{...t,id:"new-comment-id"})};var Ut=Ft.bind({});Ut.args={...ze.args,initialData:{...ze.args.initialData,deals:[]}};0&&(module.exports={Default,NoDeals});
4
+ "use strict";var Gt=Object.create;var Te=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Kt=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var $t=(e,t)=>{for(var r in t)Te(e,r,{get:t[r],enumerable:!0})},Ze=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jt(t))!_t.call(e,i)&&i!==r&&Te(e,i,{get:()=>t[i],enumerable:!(a=Ot(t,i))||a.enumerable});return e};var H=(e,t,r)=>(r=e!=null?Gt(Kt(e)):{},Ze(t||!e||!e.__esModule?Te(r,"default",{value:e,enumerable:!0}):r,e)),qt=e=>Ze(Te({},"__esModule",{value:!0}),e);var Fr={};$t(Fr,{Default:()=>ze,NoDeals:()=>Ut,default:()=>Vr});module.exports=qt(Fr);var Vt=require("react");var De=H(require("react")),M=H(require("@radix-ui/react-dialog")),nt=require("lucide-react");var it=require("clsx");var Ue="-",Jt=e=>{let t=Zt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let o=c.split(Ue);return o[0]===""&&o.length!==1&&o.shift(),et(o,t)||Qt(c)},getConflictingClassGroupIds:(c,o)=>{let v=r[c]||[];return o&&a[c]?[...v,...a[c]]:v}}},et=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),i=a?et(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let s=e.join(Ue);return(c=t.validators.find(({validator:o})=>o(s)))==null?void 0:c.classGroupId},Xe=/^\[(.+)\]$/,Qt=e=>{if(Xe.test(e)){let t=Xe.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Zt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return Yt(Object.entries(e.classGroups),r).forEach(([s,c])=>{Fe(c,a,s,t)}),a},Fe=(e,t,r,a)=>{e.forEach(i=>{if(typeof i=="string"){let s=i===""?t:Ye(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(Xt(i)){Fe(i(a),t,r,a);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,c])=>{Fe(c,Ye(t,s),r,a)})})},Ye=(e,t)=>{let r=e;return t.split(Ue).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Xt=e=>e.isThemeGetter,Yt=(e,t)=>t?e.map(([r,a])=>{let i=a.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,o])=>[t+c,o])):s);return[r,i]}):e,er=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,i=(s,c)=>{r.set(s,c),t++,t>e&&(t=0,a=r,r=new Map)};return{get(s){let c=r.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return i(s,c),c},set(s,c){r.has(s)?r.set(s,c):i(s,c)}}},tt="!",tr=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,i=t[0],s=t.length,c=o=>{let v=[],N=0,P=0,D;for(let x=0;x<o.length;x++){let A=o[x];if(N===0){if(A===i&&(a||o.slice(x,x+s)===t)){v.push(o.slice(P,x)),P=x+s;continue}if(A==="/"){D=x;continue}}A==="["?N++:A==="]"&&N--}let p=v.length===0?o:o.substring(P),g=p.startsWith(tt),b=g?p.substring(1):p,w=D&&D>P?D-P:void 0;return{modifiers:v,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:w}};return r?o=>r({className:o,parseClassName:c}):c},rr=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},or=e=>({cache:er(e.cacheSize),parseClassName:tr(e),...Jt(e)}),ar=/\s+/,sr=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:i}=t,s=[],c=e.trim().split(ar),o="";for(let v=c.length-1;v>=0;v-=1){let N=c[v],{modifiers:P,hasImportantModifier:D,baseClassName:p,maybePostfixModifierPosition:g}=r(N),b=!!g,w=a(b?p.substring(0,g):p);if(!w){if(!b){o=N+(o.length>0?" "+o:o);continue}if(w=a(p),!w){o=N+(o.length>0?" "+o:o);continue}b=!1}let x=rr(P).join(":"),A=D?x+tt:x,E=A+w;if(s.includes(E))continue;s.push(E);let z=i(w,b);for(let B=0;B<z.length;++B){let U=z[B];s.push(A+U)}o=N+(o.length>0?" "+o:o)}return o};function ir(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=rt(t))&&(a&&(a+=" "),a+=r);return a}var rt=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=rt(e[a]))&&(r&&(r+=" "),r+=t);return r};function nr(e,...t){let r,a,i,s=c;function c(v){let N=t.reduce((P,D)=>D(P),e());return r=or(N),a=r.cache.get,i=r.cache.set,s=o,o(v)}function o(v){let N=a(v);if(N)return N;let P=sr(v,r);return i(v,P),P}return function(){return s(ir.apply(null,arguments))}}var R=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},ot=/^\[(?:([a-z-]+):)?(.+)\]$/i,lr=/^\V+\/\V+$/,cr=new Set(["px","full","screen"]),dr=/^(\V+(\.\V+)?)?(xs|sm|md|lg|xl)$/,mr=/\V+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ur=/^(inset_)?-?((\V+)?\.?(\V+)[a-z]+|0)_-?((\V+)?\.?(\V+)[a-z]+|0)/,fr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_=e=>ue(e)||cr.has(e)||lr.test(e),q=e=>fe(e,"length",wr),ue=e=>!!e&&!Number.isNaN(Number(e)),Ve=e=>fe(e,"number",ue),we=e=>!!e&&Number.isInteger(Number(e)),gr=e=>e.endsWith("%")&&ue(e.slice(0,-1)),u=e=>ot.test(e),J=e=>dr.test(e),br=new Set(["length","size","percentage"]),vr=e=>fe(e,br,at),hr=e=>fe(e,"position",at),yr=new Set(["image","url"]),xr=e=>fe(e,yr,Dr),Cr=e=>fe(e,"",Sr),Se=()=>!0,fe=(e,t,r)=>{let a=ot.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},wr=e=>mr.test(e)&&!pr.test(e),at=()=>!1,Sr=e=>ur.test(e),Dr=e=>fr.test(e);var Nr=()=>{let e=R("colors"),t=R("spacing"),r=R("blur"),a=R("brightness"),i=R("borderColor"),s=R("borderRadius"),c=R("borderSpacing"),o=R("borderWidth"),v=R("contrast"),N=R("grayscale"),P=R("hueRotate"),D=R("invert"),p=R("gap"),g=R("gradientColorStops"),b=R("gradientColorStopPositions"),w=R("inset"),x=R("margin"),A=R("opacity"),E=R("padding"),z=R("saturate"),B=R("scale"),U=R("sepia"),$=R("skew"),m=R("space"),h=R("translate"),O=()=>["auto","contain","none"],l=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto",u,t],S=()=>[u,t],Re=()=>["",_,q],Ae=()=>["auto",ue,u],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ke=()=>["solid","dashed","dotted","double","none"],Je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],He=()=>["start","end","center","between","around","evenly","stretch"],Ce=()=>["","0",u],Qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[ue,u];return{cacheSize:500,separator:":",theme:{colors:[Se],spacing:[_,q],blur:["none","",J,u],brightness:K(),borderColor:[e],borderRadius:["none","","full",J,u],borderSpacing:S(),borderWidth:Re(),contrast:K(),grayscale:Ce(),hueRotate:K(),invert:Ce(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[gr,q],inset:C(),margin:C(),opacity:K(),padding:S(),saturate:K(),scale:K(),sepia:Ce(),skew:K(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":Qe()}],"break-before":[{"break-before":Qe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...qe(),u]}],overflow:[{overflow:l()}],"overflow-x":[{"overflow-x":l()}],"overflow-y":[{"overflow-y":l()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",we,u]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",u]}],grow:[{grow:Ce()}],shrink:[{shrink:Ce()}],order:[{order:["first","last","none",we,u]}],"grid-cols":[{"grid-cols":[Se]}],"col-start-end":[{col:["auto",{span:["full",we,u]},u]}],"col-start":[{"col-start":Ae()}],"col-end":[{"col-end":Ae()}],"grid-rows":[{"grid-rows":[Se]}],"row-start-end":[{row:["auto",{span:[we,u]},u]}],"row-start":[{"row-start":Ae()}],"row-end":[{"row-end":Ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",u]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",u]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...He()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...He(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...He(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],V:[{V:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[m]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[m]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",u,t]}],"min-w":[{"min-w":[u,t,"min","max","fit"]}],"max-w":[{"max-w":[u,t,"none","full","min","max","fit","prose",{screen:[J]},J]}],h:[{h:[u,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[u,t,"auto","min","max","fit"]}],"font-size":[{text:["base",J,q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ve]}],"font-family":[{font:[Se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",u]}],"line-clamp":[{"line-clamp":["none",ue,Ve]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_,u]}],"list-image":[{"list-image":["none",u]}],"list-style-type":[{list:["none","disc","decimal",u]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_,q]}],"underline-offset":[{"underline-offset":["auto",_,u]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),hr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...ke(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:ke()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...ke()]}],"outline-offset":[{"outline-offset":[_,u]}],"outline-w":[{outline:[_,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[_,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,Cr]}],"shadow-color":[{shadow:[Se]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...Je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Je()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",J,u]}],grayscale:[{grayscale:[N]}],"hue-rotate":[{"hue-rotate":[P]}],invert:[{invert:[D]}],saturate:[{saturate:[z]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[P]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[B]}],"scale-x":[{"scale-x":[B]}],"scale-y":[{"scale-y":[B]}],rotate:[{rotate:[we,u]}],"translate-x":[{"translate-x":[h]}],"translate-y":[{"translate-y":[h]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",u]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","V-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-V":[{"scroll-V":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",u]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[_,q,Ve]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","V","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-V","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var st=nr(Nr);function f(...e){return st((0,it.clsx)(e))}var V=require("react/jsx-runtime"),ge=M.Root,lt=M.Trigger,Pr=M.Portal;var ct=De.forwardRef(({className:e,...t},r)=>(0,V.jsx)(M.Overlay,{ref:r,className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ct.displayName=M.Overlay.displayName;var Y=De.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(Pr,{children:[(0,V.jsx)(ct,{}),(0,V.jsxs)(M.Content,{ref:a,className:f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,(0,V.jsxs)(M.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,V.jsx)(nt.nt,{className:"h-4 w-4"}),(0,V.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Y.displayName=M.Content.displayName;var ee=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ee.displayName="DialogHeader";var Rr=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rr.displayName="DialogFooter";var te=De.forwardRef(({className:e,...t},r)=>(0,V.jsx)(M.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));te.displayName=M.Title.displayName;var Ar=De.forwardRef(({className:e,...t},r)=>(0,V.jsx)(M.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Ar.displayName=M.Description.displayName;var dt=require("@radix-ui/react-slot"),mt=require("class-variance-authority"),pt=H(require("react")),kr=(0,mt.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),W=pt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...i},s)=>(0,V.jsx)(e?dt.Slot:"button",{className:f(kr({className:t,size:r,variant:a})),ref:s,...i}));W.displayName="Button";var ft=H(require("react"));var j=ft.forwardRef(({className:e,type:t,...r},a)=>(0,V.jsx)("input",{type:t,className:f("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));j.displayName="Input";var bt=H(require("react")),We=H(require("@radix-ui/react-label"));var Tr=(0,mt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=bt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(We.Root,{ref:r,className:f(Tr(),e),...t}));I.displayName=We.Root.displayName;var yt=H(require("react")),re=yt.forwardRef(({className:e,...t},r)=>(0,V.jsx)("textarea",{className:f("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));re.displayName="Textarea";var y=H(require("@radix-ui/react-select")),Q=H(require("react")),be=y.Root;var ve=y.Value,ae=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(y.Trigger,{className:f("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...r,children:[e,(0,V.jsx)(y.Icon,{asChild:!0,children:(0,V.jsx)(nt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ae.displayName=y.Trigger.displayName;var Ct=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(nt.ChevronUp,{className:"h-4 w-4"})}));Ct.displayName=y.ScrollUpButton.displayName;var wt=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(nt.ChevronDown,{className:"h-4 w-4"})}));wt.displayName=y.ScrollDownButton.displayName;var se=Q.forwardRef(({children:e,className:t,position:r="popper",...a},i)=>(0,V.jsx)(y.Portal,{children:(0,V.jsxs)(y.Content,{className:f("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,ref:i,...a,children:[(0,V.jsx)(Ct,{}),(0,V.jsx)(y.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,V.jsx)(wt,{})]})}));se.displayName=y.Content.displayName;var Mr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));Mr.displayName=y.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(y.Item,{className:f("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...r,children:[(0,V.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,V.jsx)(y.ItemIndicator,{children:(0,V.jsx)(nt.Check,{className:"h-4 w-4"})})}),(0,V.jsx)(y.ItemText,{children:e})]}));ie.displayName=y.Item.displayName;var Lr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Lr.displayName=y.Separator.displayName;var Ne=H(require("@radix-ui/react-checkbox")),Dt=H(require("react")),ne=Dt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(Ne.Root,{className:f("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:r,...t,children:(0,V.jsx)(Ne.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,V.jsx)(nt.Check,{className:"h-4 w-4"})})}));ne.displayName=Ne.Root.displayName;var Ir=(0,mt.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Le({className:e,variant:t,...r}){return(0,V.jsx)("div",{className:f(Ir({variant:t}),e),...r})}var Ge=H(require("react")),G=H(require("@radix-ui/react-scroll-area"));var he=Ge.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(G.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,V.jsx)(G.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,V.jsx)(Rt,{}),(0,V.jsx)(G.Corner,{})]}));he.displayName=G.Root.displayName;var Rt=Ge.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,V.jsx)(G.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,V.jsx)(G.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Rt.displayName=G.ScrollAreaScrollbar.displayName;function At({deal:e,users:t,customer:r,categories:a,onClose:i,onSave:s,onAddComment:c}){var U,$,m,h,O;let[o,v]=(0,Vt.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[N,P]=(0,Vt.useState)(""),[D,p]=(0,Vt.useState)(!1),[g,b]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{p(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let w=async()=>{try{let l=await s(o);l.success?(p(!1),b(null)):console.error("Failed to save deal:",l.errors)}catch(l){console.error("Failed to save deal:",l)}},x=(l,C)=>{v(S=>({...S,[l]:C}))},A=l=>{let C=(o.categories||[]).includes(l)?(o.categories||[]).filter(S=>S!==l):[...o.categories||[],l];x("categories",C)},E=async()=>{if(N.trim()){let l={text:N,timestamp:new Date().toISOString()};try{let C=await c(l);if(!C.success){console.error("Failed to add comment:",C.errors);return}}catch(C){console.error("Failed to add comment:",C)}v(C=>({...C,comments:[...C.comments||[],l]})),P("")}},z=l=>{switch(l){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"}},B=l=>t==null?void 0:t.find(C=>C.id===Number(l));return(0,V.jsx)(ge,{open:!0,children:(0,V.jsxs)(Y,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,V.jsxs)(ee,{className:"flex flex-row items-center justify-between",children:[(0,V.jsx)(te,{className:"text-2xl font-bold",children:r==null?void 0:r.name}),(0,V.jsxs)("div",{className:"flex space-x-2",children:[(0,V.jsx)(W,{variant:"outline",onClick:i,children:"Close"}),(0,V.jsxs)(W,{onClick:w,disabled:!D,children:[(0,V.jsx)(nt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,V.jsxs)(he,{className:"flex-grow pr-4",children:[(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,V.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,V.jsx)(j,{type:"number",value:o.value,onChange:l=>x("value",Number(l.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,V.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",(U=o.value)==null?void 0:U.toLocaleString()]})}),(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,V.jsxs)(be,{value:((m=($=o==null?void 0:o.assignee)==null?void 0:$.id)==null?void 0:m.toString())||"",onValueChange:l=>x("assignee",B(l)),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(l=>{var C;return(0,V.jsx)(ie,{value:((C=l==null?void 0:l.id)==null?void 0:C.toString())||"",children:l.name},l.id)})})]}):(0,V.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,V.jsx)(nt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.assignee.name})]})]}),(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,V.jsx)(j,{type:"date",value:(O=(h=o.closureDate)==null?void 0:h.split("V")[0])!=null?O:"",onChange:l=>x("closureDate",l.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,V.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,V.jsx)(nt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,V.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,V.jsx)(re,{value:o.description||"",onChange:l=>x("description",l.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,V.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:o.description})]})}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,V.jsxs)(be,{value:o.status,onValueChange:l=>{x("status",l),b(null)},children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select status"})}),(0,V.jsx)(se,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(l=>(0,V.jsx)(ie,{value:l,children:l},l))})]}):(0,V.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:o.status})]}),(0,V.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(l=>{var C,S;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:((C=l.id)==null?void 0:C.toString())||"",checked:(o.categories||[]).some(Re=>Re.id===l.id),onCheckedChange:()=>l.id!==void 0&&A(l)}),(0,V.jsx)("label",{htmlFor:((S=l.id)!=null?S:"").toString(),className:`text-sm font-medium ${z(l.type||"sector")} px-2 py-1 rounded`,children:l.name})]},l.id)})}):(0,V.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:o.categories&&o.categories.map(l=>{let C=l;return C?(0,V.jsx)(Le,{variant:"outline",className:z(C.type||"sector"),children:C.name},C.id):null})})]})]}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,V.jsx)(he,{className:"h-[200px] overflow-y-auto",children:(0,V.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((l,C)=>new Date(C.timestamp||"").getTime()-new Date(l.timestamp||"").getTime()).map(l=>{var C;return(0,V.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,V.jsx)("p",{className:"text-sm text-foreground",children:l.text}),(0,V.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[(C=l==null?void 0:l.author)==null?void 0:C.name," - ",new Date(l.timestamp||"").toLocaleString()]})]},l.id)})})}),(0,V.jsxs)("div",{className:"flex mt-2",children:[(0,V.jsx)(j,{value:N,onChange:l=>P(l.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,V.jsxs)(W,{onClick:E,className:"ml-2",children:[(0,V.jsx)(nt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,V.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ce=H(require("react"));var Oe=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Oe.displayName="Card";var je=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));je.displayName="CardHeader";var Ke=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Ke.displayName="CardTitle";var Er=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Er.displayName="CardDescription";var _e=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("p-6 pt-0",e),...t}));_e.displayName="CardContent";var Br=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex items-center p-6 pt-0",e),...t}));Br.displayName="CardFooter";function kt({deal:e,customer:t,categories:r,onClick:a}){let i=r.find(s=>{var c;return s.type==="proposition"&&((c=e.categories)!=null?c:[]).includes(s.id)});return(0,V.jsxs)(Oe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,V.jsxs)(je,{className:"pb-2",children:[(0,V.jsx)("div",{className:"flex justify-between items-center",children:(0,V.jsx)(Ke,{className:"text-lg font-semibold text-foreground",children:t==null?void 0:t.name})}),(0,V.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,V.jsxs)(_e,{children:[(0,V.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,V.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,V.jsx)(nt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,V.jsx)("span",{children:e.assignee.name})]}),(0,V.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,V.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,V.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,V.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,V.jsx)(nt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,V.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,V.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,V.jsx)(Le,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var Ee=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Mt({onSubmit:e}){var i;let[t,r]=(0,Vt.useState)({name:"",intro:"",active:!1});return(0,V.jsxs)("form",{onSubmit:s=>{s.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),r({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,V.jsx)(j,{id:"customerName",value:t.name,onChange:s=>r({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,V.jsx)(re,{id:"customerIntro",value:(i=t.intro)!=null?i:"",onChange:s=>r({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>r({...t,active:s})}),(0,V.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,V.jsx)(W,{type:"submit",className:"w-full",children:"Add Customer"})]})}function It({customers:e,users:t,categories:r,onSubmit:a,initialDeal:i,onAddCustomer:s,onClose:c}){var z,B,U,$;let[o,v]=(0,Vt.useState)(i||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("V")[0],closureDate:"",comments:[],description:""}),[N,P]=(0,Vt.useState)(!1),[D,p]=(0,Vt.useState)({});(0,Vt.useEffect)(()=>{i&&v(i)},[i]);let g=()=>{let m={};return o.customer||(m.customer="Customer is required"),o.value||(m.value="Value is required"),o.assignee||(m.assignee="Assignee is required"),o.closureDate||(m.closureDate="Closure Date is required"),p(m),Object.keys(m).length===0},b=async m=>{m.preventDefault(),p({});try{if(g()){let h=await a({...o});h.success?(v({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),c==null||c()):p(h.errors||{})}}catch{p({submit:"An error occurred while submitting the form."})}},w=m=>{v(h=>({...h,categories:(h.categories||[]).includes(m.id)?(h.categories||[]).filter(O=>O!==m.id):[...h.categories||[],m.id]}))},x=async m=>{v({...o,customer:m});try{let h=await s(m);h.success?P(!1):p(h.errors||{})}catch{p({submit:"An error occurred while submitting the form."})}},A=m=>t==null?void 0:t.find(h=>h.id===Number(m)),E=m=>e==null?void 0:e.find(h=>h.id===Number(m));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,V.jsx)(he,{className:"h-[60vh] pr-4",children:(0,V.jsxs)("div",{className:"space-y-6 px-4",children:[(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsxs)(be,{value:(B=(z=o.customer)==null?void 0:z.id)==null?void 0:B.toString(),onValueChange:m=>v({...o,customer:E(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select customer"})}),(0,V.jsx)(se,{children:e.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),(0,V.jsx)(W,{variant:"outline",size:"icon",onClick:()=>P(!0),children:(0,V.jsx)(nt.PlusIcon,{className:"w-5 h-5"})})]}),D.customerId&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.customerId})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"value",children:"Value"}),(0,V.jsx)(j,{id:"value",type:"number",value:o.value||"",onChange:m=>v({...o,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),D.value&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.value})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,V.jsxs)(be,{value:($=(U=o.assignee)==null?void 0:U.id)==null?void 0:$.toString(),onValueChange:m=>v({...o,assignee:A(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(ve,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),D.assignee&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.assignee})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"description",children:"Description"}),(0,V.jsx)(re,{id:"description",value:o.description||"",onChange:m=>v({...o,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{children:"Categories"}),(0,V.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(h=>h.type===m).map(h=>{var O;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:h.id.toString(),checked:(O=o.categories)==null?void 0:O.includes(h.id),onCheckedChange:()=>w(h)}),(0,V.jsx)("label",{htmlFor:h.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:h.name})]},h.id)})})]},m))})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,V.jsx)(j,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:m=>v({...o,closureDate:m.target.value})}),D.closureDate&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:D.closureDate})]})]})}),(0,V.jsx)(W,{type:"submit",className:"w-full",children:i?"Update Deal":"Add Deal"})]}),(0,V.jsx)(ge,{open:N,onOpenChange:P,children:(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Customer"})}),(0,V.jsx)(Mt,{onSubmit:x})]})})]})}function zt({status:e,deals:t,users:r,customers:a,categories:i,onDealClick:s,calculateColumnValue:c,calculateWeightedValue:o,addNewDeal:v,onAddCustomer:N}){let[P,D]=(0,Vt.useState)(!1);return(0,V.jsxs)("div",{className:"flex flex-col w-80",children:[(0,V.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),v&&(0,V.jsxs)(ge,{open:P,onOpenChange:D,children:[(0,V.jsx)(lt,{asChild:!0,children:(0,V.jsxs)(W,{className:"mb-4 w-full",children:[(0,V.jsx)(nt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Deal"})}),(0,V.jsx)(It,{customers:a,users:r,categories:i,onSubmit:v,onAddCustomer:N,onClose:()=>D(!1)})]})]}),(0,V.jsx)(Ee.Droppable,{droppableId:e,isDropDisabled:!1,children:p=>(0,V.jsxs)("div",{ref:p.innerRef,...p.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((g,b)=>(0,V.jsx)(Ee.Draggable,{draggableId:g.id.toString(),index:g.id,children:w=>(0,V.jsx)("div",{ref:w.innerRef,...w.draggableProps,...w.dragHandleProps,children:(0,V.jsx)(kt,{deal:g,customer:g.customer,categories:i,onClick:()=>s(g)})})},g.id.toString())),p.placeholder]})}),(0,V.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,V.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,V.jsxs)("span",{className:"text-green-600",children:["\xA3",c(t).toLocaleString()]})]}),(0,V.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,V.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var zr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function $e({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:i}){var D;let[s,c]=(0,Vt.useState)(null),o=p=>{var g;return((g=e.deals)!=null?g:[]).filter(b=>b.status===p)},v=p=>p.reduce((g,b)=>g+(b.value||0),0),N=(p,g)=>{let b={Cold:.2,Qualified:.4,"Proposal Made":.6,"SoW Submitted":.7,Won:1,Lost:0};return p.reduce((w,x)=>w+(x.value||0)*b[g],0)},P=(0,Vt.useCallback)(p=>{var z,B;let{source:g,destination:b}=p;if(!b||g.droppableId===b.droppableId&&g.index===b.index)return;let w=g.droppableId,x=b.droppableId,A=(z=e.deals)==null?void 0:z.filter(U=>U.id===g.index)[0],E=[...(B=e.deals)!=null?B:[]];A&&(A.status=x,r(A))},[r]);return(0,V.jsx)(Ee.DragDropContext,{onDragEnd:P,children:(0,V.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,V.jsx)("div",{className:"flex space-x-4 pb-4",children:zr.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{var b,w;let g=o(p);return(0,V.jsx)(zt,{status:p,deals:g,customers:(b=e.customers)!=null?b:[],users:e.users,categories:(w=e.categories)!=null?w:[],onDealClick:c,calculateColumnValue:v,calculateWeightedValue:N,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),s&&(0,V.jsx)(At,{deal:s,users:e.users,customer:s.customer,categories:(D=e.categories)!=null?D:[],onClose:()=>c(null),onSave:r,onAddComment:p=>a(s.id.toString(),p)})]})})}var Pe=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1,createdAt:"2023-01-01",updatedAt:"2023-01-01"}],xe=[{id:1,name:"Software",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Hardware",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Referral",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Outbound",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Tech",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:6,name:"Finance",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],pe=[{id:1,name:"John Doe",email:"john.doe@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Bob Johnson",email:"bob.johnson@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Alice Brown",email:"alice.brown@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Charlie Davis",email:"charlie.davis@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],aa=[{id:1,customer:Pe[0],value:5e4,assignee:pe[2],status:"Qualified",categories:xe.slice(0,3),dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",createdAt:"2023-01-01",comments:[{id:"1",text:"Initial contact made",author:pe[5],timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},value:75e3,assignee:{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},status:"Proposal Made",categories:xe.slice(0,3),dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",createdAt:"2023-01-01",comments:[{id:"2",text:"Proposal sent",author:pe[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var Hr={title:"CRM/KanbanBoard",component:$e},Vr=Hr,Ft=e=>{let[t,r]=(0,Vt.useState)(e.initialData);return(0,V.jsx)($e,{...e,initialData:t,updateDeal:async i=>(console.log("Updating deal:",i),r(s=>{var c;return{...s,deals:((c=s.deals)!=null?c:[]).map(o=>o.id===i.id?i:o)}}),i)})},ze=Ft.bind({});ze.args={initialData:{deals:Array.from({length:13},(e,t)=>({id:t+1,customer:Pe[t%Pe.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:pe[Math.floor(Math.random()*pe.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[xe[t%xe.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:Pe,users:pe,categories:xe},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),addNewCustomer:async e=>(console.log("Adding customer:",e),{...e,id:"new-customer-id"}),addComment:async(e,t)=>(console.log("Adding comment to deal:",e,t),{...t,id:"new-comment-id"})};var Ut=Ft.bind({});Ut.args={...ze.args,initialData:{...ze.args.initialData,deals:[]}};0&&(module.exports={Default,NoDeals});
@@ -1 +1 @@
1
- import{a as e,b as n,c as r}from"../../chunk-TLBLUYXL.mjs";import{a as d}from"../../chunk-QK4CHE4X.mjs";import"../../chunk-4WJNMYVD.mjs";import"../../chunk-PWCOSXXO.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-KTQEW4OB.mjs";import"../../chunk-WARSIFKB.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";import{useState as h}from"react";import{jsx as D}from"react/jsx-runtime";var u={title:"CRM/KanbanBoard",component:d},w=u,c=a=>{let[t,g]=h(a.initialData);return D(d,{...a,initialData:t,updateDeal:async o=>(console.log("Updating deal:",o),g(i=>{var l;return{...i,deals:((l=i.deals)!=null?l:[]).map(m=>m.id===o.id?o:m)}}),o)})},s=c.bind({});s.args={initialData:{deals:Array.from({length:3},(a,t)=>({id:t+1,customer:e[t%e.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:r[Math.floor(Math.random()*r.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[n[t%n.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:e,users:r,categories:n},addNewDeal:async a=>(console.log("Adding deal:",a),{...a,id:"new-deal-id"}),addNewCustomer:async a=>(console.log("Adding customer:",a),{...a,id:"new-customer-id"}),addComment:async(a,t)=>(console.log("Adding comment to deal:",a,t),{...t,id:"new-comment-id"})};var p=c.bind({});p.args={...s.args,initialData:{...s.args.initialData,deals:[]}};export{s as Default,p as NoDeals,w as default};
1
+ import{a as e,b as n,c as r}from"../../chunk-TLBLUYXL.mjs";import{a as d}from"../../chunk-BKTNKT2H.mjs";import"../../chunk-KUJXSGYS.mjs";import"../../chunk-262AEZUO.mjs";import"../../chunk-7PNAXVQ2.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-KTQEW4OB.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";import{useState as h}from"react";import{jsx as D}from"react/jsx-runtime";var u={title:"CRM/KanbanBoard",component:d},w=u,c=a=>{let[t,g]=h(a.initialData);return D(d,{...a,initialData:t,updateDeal:async o=>(console.log("Updating deal:",o),g(i=>{var l;return{...i,deals:((l=i.deals)!=null?l:[]).map(m=>m.id===o.id?o:m)}}),o)})},s=c.bind({});s.args={initialData:{deals:Array.from({length:13},(a,t)=>({id:t+1,customer:e[t%e.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:r[Math.floor(Math.random()*r.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[n[t%n.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:e,users:r,categories:n},addNewDeal:async a=>(console.log("Adding deal:",a),{...a,id:"new-deal-id"}),addNewCustomer:async a=>(console.log("Adding customer:",a),{...a,id:"new-customer-id"}),addComment:async(a,t)=>(console.log("Adding comment to deal:",a,t),{...t,id:"new-comment-id"})};var p=c.bind({});p.args={...s.args,initialData:{...s.args.initialData,deals:[]}};export{s as Default,p as NoDeals,w as default};
@@ -1 +1 @@
1
- import{a}from"../../chunk-4WJNMYVD.mjs";import"../../chunk-PWCOSXXO.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-KTQEW4OB.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";export{a as KanbanColumn};
1
+ import{a}from"../../chunk-262AEZUO.mjs";import"../../chunk-7PNAXVQ2.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-KTQEW4OB.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";export{a as KanbanColumn};
@@ -1 +1 @@
1
- import{a as l,b as n,d as r}from"../../chunk-TLBLUYXL.mjs";import{a}from"../../chunk-4WJNMYVD.mjs";import"../../chunk-PWCOSXXO.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-KTQEW4OB.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";var m={title:"CRM/KanbanColumn",component:a,parameters:{layout:"centered"}},p=m,c={args:{status:"Qualified",deals:r.filter(e=>e.status==="Qualified"),customers:l,categories:n,onDealClick:e=>console.log("Deal clicked:",e),calculateColumnValue:e=>e.reduce((o,t)=>o+t.value,0),calculateWeightedValue:(e,o)=>{let t={Cold:.2,Qualified:.4,"Proposal Made":.6,"SoW Submitted":.7,Won:1,Lost:0};return e.reduce((s,u)=>s+u.value*t[o],0)},addNewDeal:async e=>console.log("Adding new deal:",e),onAddCustomer:async e=>console.log("Adding new customer:",e)}},y={args:{...c.args,status:"Won",deals:[]}};export{c as Default,y as EmptyColumn,p as default};
1
+ import{a as l,b as n,d as r}from"../../chunk-TLBLUYXL.mjs";import{a}from"../../chunk-262AEZUO.mjs";import"../../chunk-7PNAXVQ2.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-KTQEW4OB.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";var m={title:"CRM/KanbanColumn",component:a,parameters:{layout:"centered"}},p=m,c={args:{status:"Qualified",deals:r.filter(e=>e.status==="Qualified"),customers:l,categories:n,onDealClick:e=>console.log("Deal clicked:",e),calculateColumnValue:e=>e.reduce((o,t)=>o+t.value,0),calculateWeightedValue:(e,o)=>{let t={Cold:.2,Qualified:.4,"Proposal Made":.6,"SoW Submitted":.7,Won:1,Lost:0};return e.reduce((s,u)=>s+u.value*t[o],0)},addNewDeal:async e=>console.log("Adding new deal:",e),onAddCustomer:async e=>console.log("Adding new customer:",e)}},y={args:{...c.args,status:"Won",deals:[]}};export{c as Default,y as EmptyColumn,p as default};
@@ -1 +1 @@
1
- import{a}from"../../chunk-PWCOSXXO.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";export{a as NewDealForm};
1
+ import{a}from"../../chunk-7PNAXVQ2.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";export{a as NewDealForm};
@@ -1 +1 @@
1
- import{a as t,b as r,c as s,d as a}from"../../chunk-TLBLUYXL.mjs";import{a as o}from"../../chunk-PWCOSXXO.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";var n={title:"CRM/NewDealForm",component:o,parameters:{layout:"centered"}},u=n,c={args:{customers:t,categories:r,users:s,onSubmit:async e=>(console.log("Submitting deal:",e),{success:!0}),onAddCustomer:async e=>(console.log("Adding new customer:",e),{success:!0})}},i={args:{...c.args,initialDeal:a[0]}},d={args:{...c.args,onSubmit:async e=>(console.log("Submitting deal:",e),{success:!1,error:"Failed to submit deal"}),onAddCustomer:async e=>(console.log("Adding new customer:",e),{success:!1,error:"Failed to add customer"})}};export{c as Default,i as EditExistingDeal,d as FailedAPI,u as default};
1
+ import{a as t,b as r,c as s,d as a}from"../../chunk-TLBLUYXL.mjs";import{a as o}from"../../chunk-7PNAXVQ2.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";var n={title:"CRM/NewDealForm",component:o,parameters:{layout:"centered"}},u=n,c={args:{customers:t,categories:r,users:s,onSubmit:async e=>(console.log("Submitting deal:",e),{success:!0}),onAddCustomer:async e=>(console.log("Adding new customer:",e),{success:!0})}},i={args:{...c.args,initialDeal:a[0]}},d={args:{...c.args,onSubmit:async e=>(console.log("Submitting deal:",e),{success:!1,error:"Failed to submit deal"}),onAddCustomer:async e=>(console.log("Adding new customer:",e),{success:!1,error:"Failed to add customer"})}};export{c as Default,i as EditExistingDeal,d as FailedAPI,u as default};