cortex-react-components 1.42.3 → 1.42.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 (168) hide show
  1. package/dist/chunk-3FW5YDNM.mjs +1 -0
  2. package/dist/{chunk-23EQTK7B.mjs → chunk-423OEU3K.mjs} +1 -1
  3. package/dist/chunk-47TRCRZ7.mjs +1 -0
  4. package/dist/{chunk-REHZTVVN.mjs → chunk-7322R3ID.mjs} +1 -1
  5. package/dist/{chunk-4KGFHVYD.mjs → chunk-74TGU5CZ.mjs} +1 -1
  6. package/dist/{chunk-3PC5BLK7.mjs → chunk-7XSAYKJ7.mjs} +1 -1
  7. package/dist/{chunk-ROEHSKFW.mjs → chunk-AF5ISZTG.mjs} +1 -1
  8. package/dist/{chunk-AEPYNOEK.mjs → chunk-AS3NR4OU.mjs} +1 -1
  9. package/dist/{chunk-ZOLLFX4E.mjs → chunk-D3PXELYK.mjs} +1 -1
  10. package/dist/{chunk-DESYC5BB.mjs → chunk-GHBJK554.mjs} +1 -1
  11. package/dist/{chunk-Y6CZVVJF.mjs → chunk-HUN2X4VH.mjs} +1 -1
  12. package/dist/{chunk-YDQUZWFZ.mjs → chunk-HVA2GFDG.mjs} +1 -1
  13. package/dist/{chunk-NGK3IDFP.mjs → chunk-ICTOXY7D.mjs} +1 -1
  14. package/dist/{chunk-EMZQNDA7.mjs → chunk-IMAQJ7N3.mjs} +1 -1
  15. package/dist/{chunk-D43ENVPX.mjs → chunk-IPHHUHS3.mjs} +1 -1
  16. package/dist/chunk-J7XKTH35.mjs +1 -0
  17. package/dist/{chunk-GFV75XSU.mjs → chunk-JK3XF6LP.mjs} +1 -1
  18. package/dist/{chunk-AEBN4SQU.mjs → chunk-JP7FA4RR.mjs} +1 -1
  19. package/dist/{chunk-SHN4XZWD.mjs → chunk-KKLZ6CCZ.mjs} +1 -1
  20. package/dist/{chunk-A2YLYBNZ.mjs → chunk-KN2GNSS3.mjs} +1 -1
  21. package/dist/{chunk-3ZRLTNWG.mjs → chunk-KRJQF2ZW.mjs} +1 -1
  22. package/dist/{chunk-UDX5Y4SA.mjs → chunk-L2PQKIU4.mjs} +1 -1
  23. package/dist/{chunk-IE2A7UT3.mjs → chunk-LBKMUSVR.mjs} +1 -1
  24. package/dist/{chunk-MGXZTIQQ.mjs → chunk-LFBWTXXG.mjs} +1 -1
  25. package/dist/{chunk-EW2X7RMJ.mjs → chunk-M7BWRL34.mjs} +1 -1
  26. package/dist/{chunk-UD7JYMRU.mjs → chunk-MANZDSTF.mjs} +1 -1
  27. package/dist/{chunk-4R7S6EEU.mjs → chunk-NLTSDI7A.mjs} +1 -1
  28. package/dist/{chunk-WPTEMDOP.mjs → chunk-PV5S3GA7.mjs} +1 -1
  29. package/dist/{chunk-PBAL3B6N.mjs → chunk-Q5EQOIL7.mjs} +1 -1
  30. package/dist/{chunk-AEDBEVEE.mjs → chunk-Q77U5BXI.mjs} +1 -1
  31. package/dist/{chunk-HZ5QHCGZ.mjs → chunk-QIGWPB3D.mjs} +1 -1
  32. package/dist/{chunk-SILLEZTI.mjs → chunk-QZ2ZSGL6.mjs} +1 -1
  33. package/dist/{chunk-U3RGJJNS.mjs → chunk-R57OVXI5.mjs} +1 -1
  34. package/dist/{chunk-XBBQGSYP.mjs → chunk-R7P4VVM3.mjs} +1 -1
  35. package/dist/chunk-RQLWJFYT.mjs +1 -0
  36. package/dist/chunk-RXJVXPNC.mjs +1 -0
  37. package/dist/{chunk-GOMLTG5W.mjs → chunk-RZTXT4UD.mjs} +1 -1
  38. package/dist/chunk-SF7DGZCZ.mjs +1 -0
  39. package/dist/{chunk-YKDVNCHV.mjs → chunk-UA7SFE4H.mjs} +1 -1
  40. package/dist/{chunk-PVRWMAHW.mjs → chunk-UK4IPFAO.mjs} +1 -1
  41. package/dist/{chunk-EI7PFWFS.mjs → chunk-VPVXJCL6.mjs} +1 -1
  42. package/dist/{chunk-4ZT572BM.mjs → chunk-YDGF5GEU.mjs} +1 -1
  43. package/dist/{chunk-4L4RAUPG.mjs → chunk-YQZH5MJU.mjs} +1 -1
  44. package/dist/components/Blocks/Banner.mjs +1 -1
  45. package/dist/components/Blocks/CallToAction.mjs +1 -1
  46. package/dist/components/Blocks/Content.mjs +1 -1
  47. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  48. package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
  49. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  50. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  51. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  52. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  53. package/dist/components/Blocks/index.mjs +1 -1
  54. package/dist/components/CRM/DealCard.d.ts +2 -2
  55. package/dist/components/CRM/DealCard.js +1 -1
  56. package/dist/components/CRM/DealCard.mjs +1 -1
  57. package/dist/components/CRM/DealCard.stories.js +1 -1
  58. package/dist/components/CRM/DealCard.stories.mjs +1 -1
  59. package/dist/components/CRM/DealDetails.d.ts +3 -3
  60. package/dist/components/CRM/DealDetails.js +1 -1
  61. package/dist/components/CRM/DealDetails.mjs +1 -1
  62. package/dist/components/CRM/DealDetails.stories.js +1 -1
  63. package/dist/components/CRM/DealDetails.stories.mjs +1 -1
  64. package/dist/components/CRM/KanbanBoard.d.ts +2 -2
  65. package/dist/components/CRM/KanbanBoard.js +1 -1
  66. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  67. package/dist/components/CRM/KanbanBoard.stories.js +1 -1
  68. package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
  69. package/dist/components/CRM/KanbanColumn.d.ts +4 -4
  70. package/dist/components/CRM/KanbanColumn.js +1 -1
  71. package/dist/components/CRM/KanbanColumn.mjs +1 -1
  72. package/dist/components/CRM/KanbanColumn.stories.js +1 -1
  73. package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
  74. package/dist/components/CRM/NewCustomerForm.d.ts +2 -2
  75. package/dist/components/CRM/NewCustomerForm.js +1 -1
  76. package/dist/components/CRM/NewCustomerForm.mjs +1 -1
  77. package/dist/components/CRM/NewCustomerForm.stories.js +1 -1
  78. package/dist/components/CRM/NewCustomerForm.stories.mjs +1 -1
  79. package/dist/components/CRM/NewDealForm.d.ts +6 -5
  80. package/dist/components/CRM/NewDealForm.js +1 -1
  81. package/dist/components/CRM/NewDealForm.mjs +1 -1
  82. package/dist/components/CRM/NewDealForm.stories.js +1 -1
  83. package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
  84. package/dist/components/CRM/index.js +1 -1
  85. package/dist/components/CRM/index.mjs +1 -1
  86. package/dist/components/CRM/mockData.d.ts +2 -2
  87. package/dist/components/CRM/mockData.js +1 -1
  88. package/dist/components/CRM/mockData.mjs +1 -1
  89. package/dist/components/CRM/types.d.ts +7 -13
  90. package/dist/components/CRM/types.js +1 -1
  91. package/dist/components/HeaderFooter/Header.mjs +1 -1
  92. package/dist/components/HeaderFooter/Header.stories.mjs +1 -1
  93. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  94. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  95. package/dist/components/HeaderFooter/index.mjs +1 -1
  96. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  97. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  98. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  99. package/dist/components/Heros/PostHero/index.mjs +1 -1
  100. package/dist/components/Heros/RenderHero.mjs +1 -1
  101. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  102. package/dist/components/Heros/index.mjs +1 -1
  103. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  104. package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
  105. package/dist/components/Holidays/index.mjs +1 -1
  106. package/dist/components/Layouts/BlogList.mjs +1 -1
  107. package/dist/components/Layouts/BlogList.stories.mjs +1 -1
  108. package/dist/components/Layouts/SlideShow.mjs +1 -1
  109. package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
  110. package/dist/components/Layouts/index.mjs +1 -1
  111. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  112. package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
  113. package/dist/components/Menus/SidebarRight.mjs +1 -1
  114. package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
  115. package/dist/components/Menus/index.mjs +1 -1
  116. package/dist/components/Payload/Card/index.mjs +1 -1
  117. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  118. package/dist/components/Payload/Media/index.mjs +1 -1
  119. package/dist/components/Payload/RichText/index.mjs +1 -1
  120. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  121. package/dist/components/Payload/RichText.stories.mjs +1 -1
  122. package/dist/components/Payload/index.mjs +1 -1
  123. package/dist/components/index.js +4 -4
  124. package/dist/components/index.mjs +1 -1
  125. package/dist/components/ui/index.mjs +1 -1
  126. package/dist/components/ui/sidebar.mjs +1 -1
  127. package/dist/index.js +4 -4
  128. package/dist/index.mjs +1 -1
  129. package/dist/metafile-cjs.json +1 -1
  130. package/dist/metafile-esm.json +1 -1
  131. package/dist/pages/Blog.mjs +1 -1
  132. package/dist/pages/Blog.stories.mjs +1 -1
  133. package/dist/pages/Documentation.mjs +1 -1
  134. package/dist/pages/Documentation.stories.mjs +1 -1
  135. package/dist/pages/IndexPage.mjs +1 -1
  136. package/dist/pages/IndexPage.stories.mjs +1 -1
  137. package/dist/pages/Intranet.mjs +1 -1
  138. package/dist/pages/Intranet.stories.mjs +1 -1
  139. package/dist/pages/LandingPage.mjs +1 -1
  140. package/dist/pages/LandingPage.stories.mjs +1 -1
  141. package/dist/pages/Page.mjs +1 -1
  142. package/dist/pages/Page.stories.mjs +1 -1
  143. package/dist/pages/Publish.mjs +1 -1
  144. package/dist/pages/Publish.stories.mjs +1 -1
  145. package/dist/pages/Website.mjs +1 -1
  146. package/dist/pages/Website.stories.mjs +1 -1
  147. package/dist/sections/AboutSection.mjs +1 -1
  148. package/dist/sections/AboutSection.stories.mjs +1 -1
  149. package/dist/sections/BlogDetail.mjs +1 -1
  150. package/dist/sections/BlogDetail.stories.mjs +1 -1
  151. package/dist/sections/BlogListSection.mjs +1 -1
  152. package/dist/sections/BlogListSection.stories.mjs +1 -1
  153. package/dist/sections/ContactSection.mjs +1 -1
  154. package/dist/sections/ContactSection.stories.mjs +1 -1
  155. package/dist/sections/PricingSection.mjs +1 -1
  156. package/dist/sections/PricingSection.stories.mjs +1 -1
  157. package/dist/sections/form/index.mjs +1 -1
  158. package/dist/sections/index.mjs +1 -1
  159. package/package.json +1 -1
  160. package/dist/chunk-EMWBQUQC.mjs +0 -1
  161. package/dist/chunk-HIT3PDJA.mjs +0 -1
  162. package/dist/chunk-HQFNGDDO.mjs +0 -1
  163. package/dist/chunk-TSPWI4RS.mjs +0 -1
  164. package/dist/chunk-YOFO7YSO.mjs +0 -1
  165. package/dist/chunk-ZDNAXLAG.mjs +0 -1
  166. package/dist/components/CRM/actions.d.ts +0 -7
  167. package/dist/components/CRM/actions.js +0 -4
  168. package/dist/components/CRM/actions.mjs +0 -4
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  'use client'
4
4
 
5
- "use strict";var Bt=Object.create;var De=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var Ht=Object.getOwnPropertyNames;var Vt=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty;var Wt=(e,t)=>{for(var o in t)De(e,o,{get:t[o],enumerable:!0})},_e=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ht(t))!Ft.call(e,i)&&i!==o&&De(e,i,{get:()=>t[i],enumerable:!(a=zt(t,i))||a.enumerable});return e};var L=(e,t,o)=>(o=e!=null?Bt(Vt(e)):{},_e(t||!e||!e.__esModule?De(o,"default",{value:e,enumerable:!0}):o,e)),Gt=e=>_e(De({},"__esModule",{value:!0}),e);var Eo={};Wt(Eo,{Default:()=>Oe,NoDeals:()=>Lo,default:()=>Io});module.exports=Gt(Eo);var Se=require("react");var Ce=L(require("react")),k=L(require("@radix-ui/react-dialog")),rt=require("lucide-react");var ot=require("clsx");var Be="-",Ot=e=>{let t=$t(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let r=l.split(Be);return r[0]===""&&r.length!==1&&r.shift(),Qe(r,t)||Ut(l)},getConflictingClassGroupIds:(l,r)=>{let C=o[l]||[];return r&&a[l]?[...C,...a[l]]:C}}},Qe=(e,t)=>{var l;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),i=a?Qe(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let n=e.join(Be);return(l=t.validators.find(({validator:r})=>r(n)))==null?void 0:l.classGroupId},Ke=/^\[(.+)\]$/,Ut=e=>{if(Ke.test(e)){let t=Ke.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},$t=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Jt(Object.entries(e.classGroups),o).forEach(([n,l])=>{Ee(l,a,n,t)}),a},Ee=(e,t,o,a)=>{e.forEach(i=>{if(typeof i=="string"){let n=i===""?t:qe(t,i);n.classGroupId=o;return}if(typeof i=="function"){if(jt(i)){Ee(i(a),t,o,a);return}t.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([n,l])=>{Ee(l,qe(t,n),o,a)})})},qe=(e,t)=>{let o=e;return t.split(Be).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},jt=e=>e.isThemeGetter,Jt=(e,t)=>t?e.map(([o,a])=>{let i=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,r])=>[t+l,r])):n);return[o,i]}):e,_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,i=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=a.get(n))!==void 0)return i(n,l),l},set(n,l){o.has(n)?o.set(n,l):i(n,l)}}},Ze="!",Kt=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,i=t[0],n=t.length,l=r=>{let C=[],w=0,h=0,R;for(let v=0;v<r.length;v++){let c=r[v];if(w===0){if(c===i&&(a||r.slice(v,v+n)===t)){C.push(r.slice(h,v)),h=v+n;continue}if(c==="/"){R=v;continue}}c==="["?w++:c==="]"&&w--}let M=C.length===0?r:r.substring(h),p=M.startsWith(Ze),u=p?M.substring(1):M,x=R&&R>h?R-h:void 0;return{modifiers:C,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:x}};return o?r=>o({className:r,parseClassName:l}):l},qt=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Qt=e=>({cache:_t(e.cacheSize),parseClassName:Kt(e),...Ot(e)}),Zt=/\B+/,Xt=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:i}=t,n=[],l=e.trim().split(Zt),r="";for(let C=l.length-1;C>=0;C-=1){let w=l[C],{modifiers:h,hasImportantModifier:R,baseClassName:M,maybePostfixModifierPosition:p}=o(w),u=!!p,x=a(u?M.substring(0,p):M);if(!x){if(!u){r=w+(r.length>0?" "+r:r);continue}if(x=a(M),!x){r=w+(r.length>0?" "+r:r);continue}u=!1}let v=qt(h).join(":"),c=R?v+Ze:v,y=c+x;if(n.includes(y))continue;n.push(y);let I=i(x,u);for(let W=0;W<I.length;++W){let q=I[W];n.push(c+q)}r=w+(r.length>0?" "+r:r)}return r};function Yt(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Xe(t))&&(a&&(a+=" "),a+=o);return a}var Xe=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(o&&(o+=" "),o+=t);return o};function eo(e,...t){let o,a,i,n=l;function l(C){let w=t.reduce((h,R)=>R(h),e());return o=Qt(w),a=o.cache.get,i=o.cache.set,n=r,r(C)}function r(C){let w=a(C);if(w)return w;let h=Xt(C,o);return i(C,h),h}return function(){return n(Yt.apply(null,arguments))}}var S=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ye=/^\[(?:([a-z-]+):)?(.+)\]$/i,to=/^\B+\/\B+$/,oo=new Set(["px","full","screen"]),ro=/^(\B+(\.\B+)?)?(xs|sm|md|lg|xl)$/,ao=/\B+(%|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$/,so=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,io=/^(inset_)?-?((\B+)?\.?(\B+)[a-z]+|0)_-?((\B+)?\.?(\B+)[a-z]+|0)/,no=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$=e=>de(e)||oo.has(e)||to.test(e),j=e=>me(e,"length",bo),de=e=>!!e&&!Number.isNaN(Number(e)),Le=e=>me(e,"number",de),ye=e=>!!e&&Number.isInteger(Number(e)),lo=e=>e.endsWith("%")&&de(e.slice(0,-1)),f=e=>Ye.test(e),J=e=>ro.test(e),co=new Set(["length","size","percentage"]),mo=e=>me(e,co,et),po=e=>me(e,"position",et),uo=new Set(["image","url"]),fo=e=>me(e,uo,ho),go=e=>me(e,"",vo),xe=()=>!0,me=(e,t,o)=>{let a=Ye.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},bo=e=>ao.test(e)&&!so.test(e),et=()=>!1,vo=e=>io.test(e),ho=e=>no.test(e);var yo=()=>{let e=S("colors"),t=S("spacing"),o=S("blur"),a=S("brightness"),i=S("borderColor"),n=S("borderRadius"),l=S("borderSpacing"),r=S("borderWidth"),C=S("contrast"),w=S("grayscale"),h=S("hueRotate"),R=S("invert"),M=S("gap"),p=S("gradientColorStops"),u=S("gradientColorStopPositions"),x=S("inset"),v=S("margin"),c=S("opacity"),y=S("padding"),I=S("saturate"),W=S("scale"),q=S("sepia"),m=S("skew"),E=S("space"),G=S("translate"),ce=()=>["auto","contain","none"],ve=()=>["auto","hidden","clip","visible","scroll"],Te=()=>["auto",f,t],N=()=>[f,t],Ue=()=>["",$,j],Re=()=>["auto",de,f],$e=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ne=()=>["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"],Ie=()=>["start","end","center","between","around","evenly","stretch"],he=()=>["","0",f],Je=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[de,f];return{cacheSize:500,separator:":",theme:{colors:[xe],spacing:[$,j],blur:["none","",J,f],brightness:U(),borderColor:[e],borderRadius:["none","","full",J,f],borderSpacing:N(),borderWidth:Ue(),contrast:U(),grayscale:he(),hueRotate:U(),invert:he(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[lo,j],inset:Te(),margin:Te(),opacity:U(),padding:N(),saturate:U(),scale:U(),sepia:he(),skew:U(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",f]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":Je()}],"break-before":[{"break-before":Je()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$e(),f]}],overflow:[{overflow:ve()}],"overflow-x":[{"overflow-x":ve()}],"overflow-y":[{"overflow-y":ve()}],overscroll:[{overscroll:ce()}],"overscroll-x":[{"overscroll-x":ce()}],"overscroll-y":[{"overscroll-y":ce()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ye,f]}],basis:[{basis:Te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",f]}],grow:[{grow:he()}],shrink:[{shrink:he()}],order:[{order:["first","last","none",ye,f]}],"grid-cols":[{"grid-cols":[xe]}],"col-start-end":[{col:["auto",{span:["full",ye,f]},f]}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":[xe]}],"row-start-end":[{row:["auto",{span:[ye,f]},f]}],"row-start":[{"row-start":Re()}],"row-end":[{"row-end":Re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",f]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",f]}],gap:[{gap:[M]}],"gap-x":[{"gap-x":[M]}],"gap-y":[{"gap-y":[M]}],"justify-content":[{justify:["normal",...Ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ie(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],B:[{B:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",f,t]}],"min-w":[{"min-w":[f,t,"min","max","fit"]}],"max-w":[{"max-w":[f,t,"none","full","min","max","fit","prose",{screen:[J]},J]}],h:[{h:[f,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[f,t,"auto","min","max","fit"]}],"font-size":[{text:["base",J,j]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Le]}],"font-family":[{font:[xe]}],"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",f]}],"line-clamp":[{"line-clamp":["none",de,Le]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$,f]}],"list-image":[{"list-image":["none",f]}],"list-style-type":[{list:["none","disc","decimal",f]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[c]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[c]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$,j]}],"underline-offset":[{"underline-offset":["auto",$,f]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",f]}],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",f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[c]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$e(),po]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[u]}],"gradient-via-pos":[{via:[u]}],"gradient-to-pos":[{to:[u]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[n]}],"rounded-B":[{"rounded-B":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-Se":[{"rounded-Se":[n]}],"rounded-rt":[{"rounded-rt":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-B":[{"border-B":[r]}],"border-w-e":[{"border-e":[r]}],"border-w-t":[{"border-t":[r]}],"border-w-r":[{"border-r":[r]}],"border-w-b":[{"border-b":[r]}],"border-w-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[c]}],"border-style":[{border:[...Ne(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[c]}],"divide-style":[{divide:Ne()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-B":[{"border-B":[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:["",...Ne()]}],"outline-offset":[{"outline-offset":[$,f]}],"outline-w":[{outline:[$,j]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[c]}],"ring-offset-w":[{"ring-offset":[$,j]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,go]}],"shadow-color":[{shadow:[xe]}],opacity:[{opacity:[c]}],"mix-blend":[{"mix-blend":[...je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":je()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[C]}],"drop-shadow":[{"drop-shadow":["","none",J,f]}],grayscale:[{grayscale:[w]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[R]}],saturate:[{saturate:[I]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[C]}],"backdrop-grayscale":[{"backdrop-grayscale":[w]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[R]}],"backdrop-opacity":[{"backdrop-opacity":[c]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",f]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",f]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",f]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[W]}],"scale-x":[{"scale-x":[W]}],"scale-y":[{"scale-y":[W]}],rotate:[{rotate:[ye,f]}],"translate-x":[{"translate-x":[G]}],"translate-y":[{"translate-y":[G]}],"skew-x":[{"skew-x":[m]}],"skew-y":[{"skew-y":[m]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",f]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","B-resize","w-resize","B-resize","nw-resize","Se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",f]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-B":[{"scroll-B":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",f]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$,j,Le]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","B","mr","mb","ml"],mx:["mr","ml"],my:["B","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-B","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-Se","rounded-rt","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-B":["rounded-ss","rounded-es"],"rounded-e":["rounded-Se","rounded-rt"],"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-B","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-B","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-me","scroll-B","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-B","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 tt=eo(yo);function g(...e){return tt((0,ot.clsx)(e))}var B=require("react/jsx-runtime"),pe=k.Root,at=k.Trigger,xo=k.Portal;var st=Ce.forwardRef(({className:e,...t},o)=>(0,B.jsx)(k.Overlay,{ref:o,className:g("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}));st.displayName=k.Overlay.displayName;var Q=Ce.forwardRef(({className:e,children:t,...o},a)=>(0,B.jsxs)(xo,{children:[(0,B.jsx)(st,{}),(0,B.jsxs)(k.Content,{ref:a,className:g("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),...o,children:[t,(0,B.jsxs)(k.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,B.jsx)(rt.X,{className:"h-4 w-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Q.displayName=k.Content.displayName;var Z=({className:e,...t})=>(0,B.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Z.displayName="DialogHeader";var Co=({className:e,...t})=>(0,B.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Co.displayName="DialogFooter";var X=Ce.forwardRef(({className:e,...t},o)=>(0,B.jsx)(k.Title,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));X.displayName=k.Title.displayName;var wo=Ce.forwardRef(({className:e,...t},o)=>(0,B.jsx)(k.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));wo.displayName=k.Description.displayName;var it=require("@radix-ui/react-slot"),nt=require("class-variance-authority"),lt=L(require("react")),So=(0,nt.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-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),z=lt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...i},n)=>(0,B.jsx)(e?it.Slot:"button",{className:g(So({className:t,size:o,variant:a})),ref:n,...i}));z.displayName="Button";var dt=L(require("react"));var F=dt.forwardRef(({className:e,type:t,...o},a)=>(0,B.jsx)("input",{type:t,className:g("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,...o}));F.displayName="Input";var pt=L(require("react")),ze=L(require("@radix-ui/react-label"));var Ro=(0,nt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),A=pt.forwardRef(({className:e,...t},o)=>(0,B.jsx)(ze.Root,{ref:o,className:g(Ro(),e),...t}));A.displayName=ze.Root.displayName;var gt=L(require("react")),Y=gt.forwardRef(({className:e,...t},o)=>(0,B.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Y.displayName="Textarea";var b=L(require("@radix-ui/react-select")),_=L(require("react")),ue=b.Root;var fe=b.Value,te=_.forwardRef(({children:e,className:t,...o},a)=>(0,B.jsxs)(b.Trigger,{className:g("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,...o,children:[e,(0,B.jsx)(b.Icon,{asChild:!0,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));te.displayName=b.Trigger.displayName;var vt=_.forwardRef(({className:e,...t},o)=>(0,B.jsx)(b.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,B.jsx)(rt.ChevronUp,{className:"h-4 w-4"})}));vt.displayName=b.ScrollUpButton.displayName;var ht=_.forwardRef(({className:e,...t},o)=>(0,B.jsx)(b.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 w-4"})}));ht.displayName=b.ScrollDownButton.displayName;var oe=_.forwardRef(({children:e,className:t,position:o="popper",...a},i)=>(0,B.jsx)(b.Portal,{children:(0,B.jsxs)(b.Content,{className:g("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",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:i,...a,children:[(0,B.jsx)(vt,{}),(0,B.jsx)(b.Viewport,{className:g("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,B.jsx)(ht,{})]})}));oe.displayName=b.Content.displayName;var No=_.forwardRef(({className:e,...t},o)=>(0,B.jsx)(b.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));No.displayName=b.Label.displayName;var re=_.forwardRef(({children:e,className:t,...o},a)=>(0,B.jsxs)(b.Item,{className:g("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,...o,children:[(0,B.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,B.jsx)(b.ItemIndicator,{children:(0,B.jsx)(rt.Check,{className:"h-4 w-4"})})}),(0,B.jsx)(b.ItemText,{children:e})]}));re.displayName=b.Item.displayName;var Do=_.forwardRef(({className:e,...t},o)=>(0,B.jsx)(b.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Do.displayName=b.Separator.displayName;var we=L(require("@radix-ui/react-checkbox")),xt=L(require("react")),ae=xt.forwardRef(({className:e,...t},o)=>(0,B.jsx)(we.Root,{className:g("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:o,...t,children:(0,B.jsx)(we.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,B.jsx)(rt.Check,{className:"h-4 w-4"})})}));ae.displayName=we.Root.displayName;var Po=(0,nt.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Me({className:e,variant:t,...o}){return(0,B.jsx)("div",{className:g(Po({variant:t}),e),...o})}var He=L(require("react")),V=L(require("@radix-ui/react-scroll-area"));var ge=He.forwardRef(({className:e,children:t,...o},a)=>(0,B.jsxs)(V.Root,{ref:a,className:g("relative overflow-hidden",e),...o,children:[(0,B.jsx)(V.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,B.jsx)(St,{}),(0,B.jsx)(V.Corner,{})]}));ge.displayName=V.Root.displayName;var St=He.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,B.jsx)(V.ScrollAreaScrollbar,{ref:a,orientation:t,className:g("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),...o,children:(0,B.jsx)(V.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));St.displayName=V.ScrollAreaScrollbar.displayName;function Rt({deal:e,users:t,customer:o,categories:a,onClose:i,onSave:n,onAddComment:l}){var q;let[r,C]=(0,Se.useState)({...e,value:e.value||0}),[w,h]=(0,Se.useState)(""),[R,M]=(0,Se.useState)(!1),[p,u]=(0,Se.useState)(null);(0,Se.useEffect)(()=>{M(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let x=()=>{n(r),M(!1),u(null)},v=(m,E)=>{C(G=>({...G,[m]:E}))},c=m=>{let E=r.categories.includes(m)?r.categories.filter(G=>G!==m):[...r.categories,m];v("categories",E)},y=()=>{w.trim()&&(l({id:Date.now().toString(),text:w,timestamp:new Date().toISOString()}),h(""))},I=m=>{switch(m){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},W=(m,E,G)=>{let ce=p===m;return(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(A,{className:"text-sm font-medium text-gray-500",children:E}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[G,ce?(0,B.jsx)(F,{value:r[m],onChange:ve=>v(m,ve.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,B.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>u(m),children:r[m]}),!ce&&(0,B.jsx)(z,{variant:"ghost",size:"sm",onClick:()=>u(m),children:(0,B.jsx)(rt.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,B.jsx)(pe,{open:!0,children:(0,B.jsxs)(Q,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,B.jsxs)(Z,{className:"flex flex-row items-center justify-between",children:[(0,B.jsx)(X,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,B.jsxs)("div",{className:"flex space-x-2",children:[(0,B.jsx)(z,{variant:"outline",onClick:i,children:"Close"}),(0,B.jsxs)(z,{onClick:x,disabled:!R,children:[(0,B.jsx)(rt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,B.jsxs)(ge,{className:"flex-grow pr-4",children:[(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,B.jsx)("div",{className:"grid gap-2",children:p==="value"?(0,B.jsx)(F,{type:"number",value:r.value,onChange:m=>v("value",Number(m.target.value)),onBlur:()=>u(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,B.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("value"),children:["\xA3",(q=r.value)==null?void 0:q.toLocaleString()]})}),(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(A,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),p==="assignee"?(0,B.jsxs)(ue,{value:r.assignee,onValueChange:m=>v("assignee",m),children:[(0,B.jsx)(te,{children:(0,B.jsx)(fe,{placeholder:"Select assignee"})}),(0,B.jsx)(oe,{children:t&&t.map(m=>(0,B.jsx)(re,{value:m.id.toString(),children:m.name},m.id))})]}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("assignee"),children:[(0,B.jsx)(rt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:r.assignee})]})]}),(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(A,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),p==="closureDate"?(0,B.jsx)(F,{type:"date",value:r.closureDate.split("B")[0],onChange:m=>v("closureDate",m.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("closureDate"),children:[(0,B.jsx)(rt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:new Date(r.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,B.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(A,{className:"text-sm font-medium text-gray-500",children:"Description"}),p==="description"?(0,B.jsx)(Y,{value:r.description,onChange:m=>v("description",m.target.value),onBlur:()=>u(null),className:"min-h-[100px]",autoFocus:!0}):(0,B.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>u("description"),children:r.description})]})}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(A,{className:"text-sm font-medium text-gray-500",children:"Status"}),p==="status"?(0,B.jsxs)(ue,{value:r.status,onValueChange:m=>{v("status",m),u(null)},children:[(0,B.jsx)(te,{children:(0,B.jsx)(fe,{placeholder:"Select status"})}),(0,B.jsx)(oe,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(m=>(0,B.jsx)(re,{value:m,children:m},m))})]}):(0,B.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("status"),children:r.status})]}),(0,B.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,B.jsx)(A,{className:"text-sm font-medium text-gray-500",children:"Categories"}),p==="categories"?(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(m=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:m.id,checked:r.categories.includes(m.id),onCheckedChange:()=>c(m.id)}),(0,B.jsx)("label",{htmlFor:m.id,className:`text-sm font-medium ${I(m.type)} px-2 py-1 rounded`,children:m.name})]},m.id))}):(0,B.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("categories"),children:r.categories.map(m=>{let E=a.find(G=>G.id===m);return E?(0,B.jsx)(Me,{variant:"secondary",className:I(E.type),children:E.name},E.id):null})})]})]}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(A,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,B.jsx)(ge,{className:"h-[200px] overflow-y-auto",children:(0,B.jsx)("div",{className:"space-y-2",children:r.comments.map(m=>(0,B.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,B.jsx)("p",{className:"text-sm text-gray-700",children:m.text}),(0,B.jsxs)("p",{className:"text-xs text-gray-500 B-1",children:[m.author," - ",new Date(m.timestamp).toLocaleString()]})]},m.id))})}),(0,B.jsxs)("div",{className:"flex B-2",children:[(0,B.jsx)(F,{value:w,onChange:m=>h(m.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,B.jsxs)(z,{onClick:y,className:"ml-2",children:[(0,B.jsx)(rt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,B.jsxs)("div",{className:"text-xs text-gray-500 B-4",children:["Last modified: ",new Date(r.lastModified).toLocaleString()]})]})]})]})})}var ie=L(require("react"));var Ve=ie.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Ve.displayName="Card";var Fe=ie.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:g("flex flex-col space-y-1.5 p-6",e),...t}));Fe.displayName="CardHeader";var We=ie.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));We.displayName="CardTitle";var Mo=ie.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Mo.displayName="CardDescription";var Ge=ie.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:g("p-6 pt-0",e),...t}));Ge.displayName="CardContent";var ko=ie.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:g("flex items-center p-6 pt-0",e),...t}));ko.displayName="CardFooter";function Nt({deal:e,customer:t,categories:o,onClick:a}){let i=o.find(n=>n.type==="proposition"&&e.categories.includes(n.id));return(0,B.jsxs)(Ve,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(Fe,{className:"pb-2",children:[(0,B.jsx)("div",{className:"flex justify-between items-center",children:(0,B.jsx)(We,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,B.jsx)("p",{className:"text-sm text-gray-500 B-1",children:e.description})]}),(0,B.jsxs)(Ge,{children:[(0,B.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,B.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,B.jsx)(rt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,B.jsx)("span",{children:e.assignee})]}),(0,B.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,B.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,B.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,B.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,B.jsx)(rt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,B.jsx)("span",{children:new Date(e.lastModified).toLocaleDateString()})]})}),(0,B.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,B.jsx)(Me,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var Ae=require("react-beautiful-dnd");function Pt({onSubmit:e}){let[t,o]=(0,Se.useState)({name:"",intro:"",active:!0});return(0,B.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({id:Date.now().toString(),...t}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(A,{htmlFor:"customerName",children:"Customer Name"}),(0,B.jsx)(F,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(A,{htmlFor:"customerIntro",children:"Intro"}),(0,B.jsx)(Y,{id:"customerIntro",value:t.intro,onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:"activeCustomer",checked:t.active,onCheckedChange:i=>o({...t,active:i})}),(0,B.jsx)(A,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,B.jsx)(z,{type:"submit",className:"w-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:o,onSubmit:a,initialDeal:i,onAddCustomer:n}){let[l,r]=(0,Se.useState)(i||{customerId:"",value:0,assignee:"",status:"Cold",categories:[],dateLogged:new Date().toISOString().split("B")[0],closureDate:"",lastModified:new Date().toISOString(),comments:[],description:""}),[C,w]=(0,Se.useState)(!1),[h,R]=(0,Se.useState)({});(0,Se.useEffect)(()=>{i&&r(i)},[i]);let M=()=>{let c={};return l.customerId||(c.customerId="Customer is required"),l.value||(c.value="Value is required"),l.assignee||(c.assignee="Assignee is required"),l.closureDate||(c.closureDate="Closure Date is required"),R(c),Object.keys(c).length===0},p=c=>{c.preventDefault(),M()&&(a({...l,id:l.id||Date.now().toString(),lastModified:new Date().toISOString()}),r({customerId:"",value:0,assignee:"",description:"",status:"Cold",closureDate:""}),R({}))},u=c=>{r(y=>{var I;return{...y,categories:(I=y.categories)!=null&&I.includes(c)?y.categories.filter(W=>W!==c):[...y.categories||[],c]}})},x=c=>{switch(c){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},v=c=>{e.push(c),r({...l,customerId:c.id}),w(!1),n(c)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("form",{onSubmit:p,className:"space-y-6",children:[(0,B.jsx)(ge,{className:"h-[60vh] pr-4",children:(0,B.jsxs)("div",{className:"space-y-6",children:[(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(A,{htmlFor:"customer",children:"Customer"}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsxs)(ue,{value:l.customerId,onValueChange:c=>r({...l,customerId:c}),children:[(0,B.jsx)(te,{children:(0,B.jsx)(fe,{placeholder:"Select customer"})}),(0,B.jsx)(oe,{children:e.map(c=>(0,B.jsx)(re,{value:c.id,children:c.name},c.id))})]}),(0,B.jsx)(z,{variant:"outline",size:"icon",onClick:()=>w(!0),children:(0,B.jsx)(rt.PlusIcon,{className:"w-5 h-5"})})]}),h.customerId&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:h.customerId})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(A,{htmlFor:"value",children:"Value"}),(0,B.jsx)(F,{id:"value",type:"number",value:l.value||"",onChange:c=>r({...l,value:Number.parseFloat(c.target.value)}),placeholder:"Enter deal value"}),h.value&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:h.value})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(A,{htmlFor:"assignee",children:"Assignee"}),(0,B.jsxs)(ue,{value:l.assignee,onValueChange:c=>r({...l,assignee:c}),children:[(0,B.jsx)(te,{children:(0,B.jsx)(fe,{placeholder:"Select assignee"})}),(0,B.jsx)(oe,{children:t&&t.map(c=>(0,B.jsx)(re,{value:c.id.toString(),children:c.name},c.id))})]}),h.assignee&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:h.assignee})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(A,{htmlFor:"description",children:"Description"}),(0,B.jsx)(Y,{id:"description",value:l.description||"",onChange:c=>r({...l,description:c.target.value}),placeholder:"Enter deal description"})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(A,{children:"Categories"}),(0,B.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(c=>(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)("h4",{className:"text-sm font-medium",children:c.charAt(0).toUpperCase()+c.slice(1)}),(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(y=>y.type===c).map(y=>{var I;return(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:y.id,checked:(I=l.categories)==null?void 0:I.includes(y.id),onCheckedChange:()=>u(y.id)}),(0,B.jsx)("label",{htmlFor:y.id,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${x(y.type)}`,children:y.name})]},y.id)})})]},c))})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(A,{htmlFor:"closureDate",children:"Closure Date"}),(0,B.jsx)(F,{id:"closureDate",type:"date",value:l.closureDate,onChange:c=>r({...l,closureDate:c.target.value})}),h.closureDate&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:h.closureDate})]})]})}),(0,B.jsx)(z,{type:"submit",className:"w-full",children:i?"Update Deal":"Add Deal"})]}),(0,B.jsx)(pe,{open:C,onOpenChange:w,children:(0,B.jsxs)(Q,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(X,{children:"Add New Customer"})}),(0,B.jsx)(Pt,{onSubmit:v})]})})]})}function Tt({status:e,deals:t,users:o,customers:a,categories:i,onDealClick:n,calculateColumnValue:l,calculateWeightedValue:r,addNewDeal:C,onAddCustomer:w}){return(0,B.jsxs)("div",{className:"flex flex-col w-80",children:[(0,B.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),C&&(0,B.jsxs)(pe,{children:[(0,B.jsx)(at,{asChild:!0,children:(0,B.jsxs)(z,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,B.jsx)(rt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,B.jsxs)(Q,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(X,{children:"Add New Deal"})}),(0,B.jsx)(kt,{customers:a,users:o,categories:i,onSubmit:C,onAddCustomer:w})]})]}),(0,B.jsx)(Ae.Droppable,{droppableId:e,children:h=>(0,B.jsxs)("div",{ref:h.innerRef,...h.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((R,M)=>(0,B.jsx)(Ae.Draggable,{draggableId:R.id,index:M,children:p=>(0,B.jsx)("div",{ref:p.innerRef,...p.draggableProps,...p.dragHandleProps,children:(0,B.jsx)(Nt,{deal:R,customer:a.find(u=>u.id===R.customerId),categories:i,onClick:()=>n(R)})})},R.id)),h.placeholder]})}),(0,B.jsxs)("div",{className:"B-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,B.jsxs)("p",{className:"font-semibold",children:["Total: ",(0,B.jsxs)("span",{className:"text-green-600",children:["$",l(t).toLocaleString()]})]}),(0,B.jsxs)("p",{className:"font-semibold",children:["Weighted: ",(0,B.jsxs)("span",{className:"text-blue-600",children:["$",r(t,e).toLocaleString()]})]})]})]})}var Ao=["Cold","Qualified","Proposal","SoW","Won","Lost"];function Lt({initialData:e,addNewDeal:t,updateDeal:o,addComment:a,addNewCustomer:i}){let[n,l]=(0,Se.useState)(null),[r,C]=(0,Se.useState)(e),w=p=>r.deals.filter(u=>u.status===p),h=p=>p.reduce((u,x)=>u+(x.value||0),0),R=(p,u)=>{let x={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((v,c)=>v+(c.value||0)*x[u],0)},M=(0,Se.useCallback)(p=>{let{source:u,destination:x}=p;if(!x||u.droppableId===x.droppableId&&u.index===x.index)return;let v=u.droppableId,c=x.droppableId;console.log("Moving from ",v,"to",c);let y=[...r.deals],[I]=y.splice(u.index,1);I.status=c,y.splice(x.index,0,I),C({...r,deals:y}),o(I)},[r,o]);return(0,B.jsx)(Ae.DragDropContext,{onDragEnd:M,children:(0,B.jsxs)("div",{className:"p-4",children:[(0,B.jsx)("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:Ao.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let u=w(p);return(0,B.jsx)(Tt,{status:p,deals:u,customers:e.customers,users:e.users,categories:e.categories,onDealClick:l,calculateColumnValue:h,calculateWeightedValue:R,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),n&&(0,B.jsx)(Rt,{deal:n,users:e.users,customer:r.customers.find(p=>p.id===n.customerId),categories:r.categories,onClose:()=>l(null),onSave:o,onAddComment:p=>a(n.id,p)})]})})}var Et=[{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"}];var To={title:"CRM/KanbanBoard",component:Lt,parameters:{layout:"fullscreen"}},Io=To,Oe={args:{initialData:{deals:Array.from({length:20},(e,t)=>({id:`${t+1}`,customerId:`${t%3+1}`,value:Math.floor(Math.random()*1e5)+5e3,assignee:["John Doe","Jane Smith","Bob Johnson"][Math.floor(Math.random()*3)],status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[`${t%6+1}`],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:[],lastModified:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. Ae'B a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:[{id:"1",name:"Acme Corp",active:!0},{id:"2",name:"GlobalTech",active:!0},{id:"3",name:"InnoSystems",active:!0}],users:Et,categories:[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}]},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),updateDeal:async e=>(console.log("Updating deal:",e),e),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"})}},Lo={args:{...Oe.args,initialData:{...Oe.args.initialData,deals:[]}}};0&&(module.exports={Default,NoDeals});
5
+ "use strict";var Qt=Object.create;var ke=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var Yt=Object.getPrototypeOf,eo=Object.prototype.hasOwnProperty;var to=(e,t)=>{for(var o in t)ke(e,o,{get:t[o],enumerable:!0})},Qe=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Xt(t))!eo.call(e,n)&&n!==o&&ke(e,n,{get:()=>t[n],enumerable:!(a=Zt(t,n))||a.enumerable});return e};var z=(e,t,o)=>(o=e!=null?Qt(Yt(e)):{},Qe(t||!e||!e.__esModule?ke(o,"default",{value:e,enumerable:!0}):o,e)),oo=e=>Qe(ke({},"__esModule",{value:!0}),e);var qo={};to(qo,{Default:()=>ye,NoDeals:()=>$o,default:()=>Jo});module.exports=oo(qo);var De=require("react");var Se=z(require("react")),T=z(require("@radix-ui/react-dialog")),st=require("lucide-react");var it=require("clsx");var He="-",ro=e=>{let t=io(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{let r=d.split(He);return r[0]===""&&r.length!==1&&r.shift(),Ye(r,t)||ao(d)},getConflictingClassGroupIds:(d,r)=>{let b=o[d]||[];return r&&a[d]?[...b,...a[d]]:b}}},Ye=(e,t)=>{var d;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?Ye(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(He);return(d=t.validators.find(({validator:r})=>r(i)))==null?void 0:d.classGroupId},Ze=/^\[(.+)\]$/,ao=e=>{if(Ze.test(e)){let t=Ze.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},io=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return no(Object.entries(e.classGroups),o).forEach(([i,d])=>{ze(d,a,i,t)}),a},ze=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Xe(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(so(n)){ze(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,d])=>{ze(d,Xe(t,i),o,a)})})},Xe=(e,t)=>{let o=e;return t.split(He).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},so=e=>e.isThemeGetter,no=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([d,r])=>[t+d,r])):i);return[o,n]}):e,lo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,d)=>{o.set(i,d),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let d=o.get(i);if(d!==void 0)return d;if((d=a.get(i))!==void 0)return n(i,d),d},set(i,d){o.has(i)?o.set(i,d):n(i,d)}}},et="!",co=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,d=r=>{let b=[],C=0,w=0,x;for(let v=0;v<r.length;v++){let S=r[v];if(C===0){if(S===n&&(a||r.slice(v,v+i)===t)){b.push(r.slice(w,v)),w=v+i;continue}if(S==="/"){x=v;continue}}S==="["?C++:S==="]"&&C--}let P=b.length===0?r:r.substring(w),p=P.startsWith(et),u=p?P.substring(1):P,y=x&&x>w?x-w:void 0;return{modifiers:b,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:y}};return o?r=>o({className:r,parseClassName:d}):d},mo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},po=e=>({cache:lo(e.cacheSize),parseClassName:co(e),...ro(e)}),uo=/\H+/,fo=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],d=e.trim().split(uo),r="";for(let b=d.length-1;b>=0;b-=1){let C=d[b],{modifiers:w,hasImportantModifier:x,baseClassName:P,maybePostfixModifierPosition:p}=o(C),u=!!p,y=a(u?P.substring(0,p):P);if(!y){if(!u){r=C+(r.length>0?" "+r:r);continue}if(y=a(P),!y){r=C+(r.length>0?" "+r:r);continue}u=!1}let v=mo(w).join(":"),S=x?v+et:v,M=S+y;if(i.includes(M))continue;i.push(M);let B=n(y,u);for(let O=0;O<B.length;++O){let m=B[O];i.push(S+m)}r=C+(r.length>0?" "+r:r)}return r};function go(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=tt(t))&&(a&&(a+=" "),a+=o);return a}var tt=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=tt(e[a]))&&(o&&(o+=" "),o+=t);return o};function bo(e,...t){let o,a,n,i=d;function d(b){let C=t.reduce((w,x)=>x(w),e());return o=po(C),a=o.cache.get,n=o.cache.set,i=r,r(b)}function r(b){let C=a(b);if(C)return C;let w=fo(b,o);return n(b,w),w}return function(){return i(go.apply(null,arguments))}}var R=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},ot=/^\[(?:([a-z-]+):)?(.+)\]$/i,vo=/^\d+\/\d+$/,ho=new Set(["px","full","screen"]),yo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|H|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Co=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)st-?((\d+)?\.?(\d+)[a-z]+|0)/,So=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,J=e=>pe(e)||ho.has(e)||vo.test(e),$=e=>ue(e,"length",To),pe=e=>!!e&&!Number.isNaN(Number(e)),Be=e=>ue(e,"number",pe),Ce=e=>!!e&&Number.isInteger(Number(e)),No=e=>e.endsWith("%")&&pe(e.slice(0,-1)),f=e=>ot.test(e),q=e=>yo.test(e),Do=new Set(["length","size","percentage"]),Ro=e=>ue(e,Do,rt),Po=e=>ue(e,"position",rt),ko=new Set(["image","url"]),Mo=e=>ue(e,ko,Io),Ao=e=>ue(e,"",Lo),we=()=>!0,ue=(e,t,o)=>{let a=ot.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},To=e=>xo.test(e)&&!Co.test(e),rt=()=>!1,Lo=e=>wo.test(e),Io=e=>So.test(e);var Eo=()=>{let e=R("colors"),t=R("spacing"),o=R("blur"),a=R("brightness"),n=R("borderColor"),i=R("borderRadius"),d=R("borderSpacing"),r=R("borderWidth"),b=R("contrast"),C=R("grayscale"),w=R("hueRotate"),x=R("invert"),P=R("gap"),p=R("gradientColorStops"),u=R("gradientColorStopPositions"),y=R("inset"),v=R("margin"),S=R("opacity"),M=R("padding"),B=R("saturate"),O=R("scale"),m=R("sepia"),D=R("skew"),G=R("space"),l=R("translate"),E=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",f,t],N=()=>[f,t],Ke=()=>["",J,$],Re=()=>["auto",pe,f],Je=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Pe=()=>["solid","dashed","dotted","double","none"],$e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>["start","end","center","between","around","evenly","stretch"],xe=()=>["","0",f],qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[pe,f];return{cacheSize:500,separator:":",theme:{colors:[we],spacing:[J,$],blur:["none","",q,f],brightness:K(),borderColor:[e],borderRadius:["none","","full",q,f],borderSpacing:N(),borderWidth:Ke(),contrast:K(),grayscale:xe(),hueRotate:K(),invert:xe(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[No,$],inset:me(),margin:me(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:xe(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",f]}],container:["container"],columns:[{columns:[q]}],"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:[...Je(),f]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ce,f]}],basis:[{basis:me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",f]}],grow:[{grow:xe()}],shrink:[{shrink:xe()}],order:[{order:["first","last","none",Ce,f]}],"grid-cols":[{"grid-cols":[we]}],"col-start-end":[{col:["auto",{span:["full",Ce,f]},f]}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":[we]}],"row-start-end":[{row:["auto",{span:[Ce,f]},f]}],"row-start":[{"row-start":Re()}],"row-end":[{"row-end":Re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",f]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",f]}],gap:[{gap:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...Ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ee(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],H:[{H:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[G]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[G]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",f,t]}],"min-w":[{"min-w":[f,t,"min","max","fit"]}],"max-w":[{"max-w":[f,t,"none","full","min","max","fit","prose",{screen:[q]},q]}],h:[{h:[f,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[f,t,"auto","min","max","fit"]}],"font-size":[{text:["base",q,$]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Be]}],"font-family":[{font:[we]}],"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",f]}],"line-clamp":[{"line-clamp":["none",pe,Be]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",J,f]}],"list-image":[{"list-image":["none",f]}],"list-style-type":[{list:["none","disc","decimal",f]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Pe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",J,$]}],"underline-offset":[{"underline-offset":["auto",J,f]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",f]}],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",f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Je(),Po]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ro]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Mo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[u]}],"gradient-via-pos":[{via:[u]}],"gradient-to-pos":[{to:[u]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-H":[{"rounded-H":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-H":[{"border-H":[r]}],"border-w-e":[{"border-e":[r]}],"border-w-t":[{"border-t":[r]}],"border-w-r":[{"border-r":[r]}],"border-w-b":[{"border-b":[r]}],"border-w-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...Pe(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Pe()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-H":[{"border-H":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...Pe()]}],"outline-offset":[{"outline-offset":[J,f]}],"outline-w":[{outline:[J,$]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[J,$]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",q,Ao]}],"shadow-color":[{shadow:[we]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...$e(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$e()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",q,f]}],grayscale:[{grayscale:[C]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[x]}],saturate:[{saturate:[B]}],sepia:[{sepia:[m]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[C]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",f]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",f]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",f]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Ce,f]}],"translate-x":[{"translate-x":[l]}],"translate-y":[{"translate-y":[l]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",f]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","H-resize","w-resize","De-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",f]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-H":[{"scroll-H":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",f]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[J,$,Be]}],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","H","pr","pb","pl"],px:["pr","pl"],py:["H","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-H","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-H":["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-H","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-H","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-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-H","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-H","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var at=bo(Eo);function g(...e){return at((0,it.clsx)(e))}var H=require("react/jsx-runtime"),fe=T.Root,nt=T.Trigger,Bo=T.Portal;var lt=Se.forwardRef(({className:e,...t},o)=>(0,H.jsx)(T.Overlay,{ref:o,className:g("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}));lt.displayName=T.Overlay.displayName;var X=Se.forwardRef(({className:e,children:t,...o},a)=>(0,H.jsxs)(Bo,{children:[(0,H.jsx)(lt,{}),(0,H.jsxs)(T.Content,{ref:a,className:g("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),...o,children:[t,(0,H.jsxs)(T.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,H.jsx)(st.X,{className:"h-4 w-4"}),(0,H.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));X.displayName=T.Content.displayName;var Y=({className:e,...t})=>(0,H.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Y.displayName="DialogHeader";var zo=({className:e,...t})=>(0,H.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zo.displayName="DialogFooter";var ee=Se.forwardRef(({className:e,...t},o)=>(0,H.jsx)(T.Title,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));ee.displayName=T.Title.displayName;var Ho=Se.forwardRef(({className:e,...t},o)=>(0,H.jsx)(T.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Ho.displayName=T.Description.displayName;var ct=require("@radix-ui/react-slot"),dt=require("class-variance-authority"),mt=z(require("react")),Vo=(0,dt.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-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),V=mt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,H.jsx)(e?ct.Slot:"button",{className:g(Vo({className:t,size:o,variant:a})),ref:i,...n}));V.displayName="Button";var ut=z(require("react"));var j=ut.forwardRef(({className:e,type:t,...o},a)=>(0,H.jsx)("input",{type:t,className:g("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,...o}));j.displayName="Input";var gt=z(require("react")),Ve=z(require("@radix-ui/react-label"));var Fo=(0,dt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=gt.forwardRef(({className:e,...t},o)=>(0,H.jsx)(Ve.Root,{ref:o,className:g(Fo(),e),...t}));L.displayName=Ve.Root.displayName;var ht=z(require("react")),te=ht.forwardRef(({className:e,...t},o)=>(0,H.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));te.displayName="Textarea";var h=z(require("@radix-ui/react-select")),Q=z(require("react")),ge=h.Root;var be=h.Value,re=Q.forwardRef(({children:e,className:t,...o},a)=>(0,H.jsxs)(h.Trigger,{className:g("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,...o,children:[e,(0,H.jsx)(h.Icon,{asChild:!0,children:(0,H.jsx)(st.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=h.Trigger.displayName;var xt=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,H.jsx)(st.ChevronUp,{className:"h-4 w-4"})}));xt.displayName=h.ScrollUpButton.displayName;var Ct=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,H.jsx)(st.ChevronDown,{className:"h-4 w-4"})}));Ct.displayName=h.ScrollDownButton.displayName;var ae=Q.forwardRef(({children:e,className:t,position:o="popper",...a},n)=>(0,H.jsx)(h.Portal,{children:(0,H.jsxs)(h.Content,{className:g("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",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:n,...a,children:[(0,H.jsx)(xt,{}),(0,H.jsx)(h.Viewport,{className:g("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,H.jsx)(Ct,{})]})}));ae.displayName=h.Content.displayName;var Wo=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Wo.displayName=h.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...o},a)=>(0,H.jsxs)(h.Item,{className:g("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,...o,children:[(0,H.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,H.jsx)(h.ItemIndicator,{children:(0,H.jsx)(st.Check,{className:"h-4 w-4"})})}),(0,H.jsx)(h.ItemText,{children:e})]}));ie.displayName=h.Item.displayName;var Oo=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Oo.displayName=h.Separator.displayName;var Ne=z(require("@radix-ui/react-checkbox")),St=z(require("react")),se=St.forwardRef(({className:e,...t},o)=>(0,H.jsx)(Ne.Root,{className:g("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:o,...t,children:(0,H.jsx)(Ne.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,H.jsx)(st.Check,{className:"h-4 w-4"})})}));se.displayName=Ne.Root.displayName;var Go=(0,dt.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 Ae({className:e,variant:t,...o}){return(0,H.jsx)("div",{className:g(Go({variant:t}),e),...o})}var Fe=z(require("react")),W=z(require("@radix-ui/react-scroll-area"));var ve=Fe.forwardRef(({className:e,children:t,...o},a)=>(0,H.jsxs)(W.Root,{ref:a,className:g("relative overflow-hidden",e),...o,children:[(0,H.jsx)(W.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,H.jsx)(Rt,{}),(0,H.jsx)(W.Corner,{})]}));ve.displayName=W.Root.displayName;var Rt=Fe.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,H.jsx)(W.ScrollAreaScrollbar,{ref:a,orientation:t,className:g("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),...o,children:(0,H.jsx)(W.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Rt.displayName=W.ScrollAreaScrollbar.displayName;function Pt({deal:e,users:t,customer:o,categories:a,onClose:n,onSave:i,onAddComment:d}){var m,D,G;let[r,b]=(0,De.useState)({...e,value:e.value||0}),[C,w]=(0,De.useState)(""),[x,P]=(0,De.useState)(!1),[p,u]=(0,De.useState)(null);(0,De.useEffect)(()=>{P(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let y=()=>{i(r),P(!1),u(null)},v=(l,E)=>{b(U=>({...U,[l]:E}))},S=l=>{let E=r.categories.includes(l)?r.categories.filter(U=>U!==l):[...r.categories,l];v("categories",E)},M=()=>{C.trim()&&(d({id:Date.now().toString(),text:C,timestamp:new Date().toISOString()}),w(""))},B=l=>{switch(l){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},O=(l,E,U)=>{let me=p===l;return(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:E}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[U,me?(0,H.jsx)(j,{value:r[l],onChange:N=>v(l,N.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,H.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>u(l),children:r[l]}),!me&&(0,H.jsx)(V,{variant:"ghost",size:"sm",onClick:()=>u(l),children:(0,H.jsx)(st.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,H.jsx)(fe,{open:!0,children:(0,H.jsxs)(X,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,H.jsxs)(Y,{className:"flex flex-row items-center justify-between",children:[(0,H.jsx)(ee,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,H.jsxs)("div",{className:"flex space-x-2",children:[(0,H.jsx)(V,{variant:"outline",onClick:n,children:"Close"}),(0,H.jsxs)(V,{onClick:y,disabled:!x,children:[(0,H.jsx)(st.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,H.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,H.jsx)("div",{className:"grid gap-2",children:p==="value"?(0,H.jsx)(j,{type:"number",value:r.value,onChange:l=>v("value",Number(l.target.value)),onBlur:()=>u(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,H.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("value"),children:["\xA3",(m=r.value)==null?void 0:m.toLocaleString()]})}),(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),p==="assignee"?(0,H.jsxs)(ge,{value:((G=(D=r==null?void 0:r.assignee)==null?void 0:D.id)==null?void 0:G.toString())||"",onValueChange:l=>v("assignee",l),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select assignee"})}),(0,H.jsx)(ae,{children:t&&t.map(l=>{var E;return(0,H.jsx)(ie,{value:((E=l==null?void 0:l.id)==null?void 0:E.toString())||"",children:l.name},l.id)})})]}):(0,H.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("assignee"),children:[(0,H.jsx)(st.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,H.jsx)("span",{children:r.assignee.name})]})]}),(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),p==="closureDate"?(0,H.jsx)(j,{type:"date",value:r.closureDate.split("T")[0],onChange:l=>v("closureDate",l.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,H.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("closureDate"),children:[(0,H.jsx)(st.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,H.jsx)("span",{children:new Date(r.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Description"}),p==="description"?(0,H.jsx)(te,{value:r.description,onChange:l=>v("description",l.target.value),onBlur:()=>u(null),className:"min-h-[100px]",autoFocus:!0}):(0,H.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>u("description"),children:r.description})]})}),(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 H-2 gap-4",children:[(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Status"}),p==="status"?(0,H.jsxs)(ge,{value:r.status,onValueChange:l=>{v("status",l),u(null)},children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select status"})}),(0,H.jsx)(ae,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(l=>(0,H.jsx)(ie,{value:l,children:l},l))})]}):(0,H.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("status"),children:r.status})]}),(0,H.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Categories"}),p==="categories"?(0,H.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(l=>(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:l.id,checked:r.categories.includes(l.id),onCheckedChange:()=>S(l.id)}),(0,H.jsx)("label",{htmlFor:l.id,className:`text-sm font-medium ${B(l.type)} px-2 py-1 rounded`,children:l.name})]},l.id))}):(0,H.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("categories"),children:r.categories.map(l=>{let E=a.find(U=>U.id===l);return E?(0,H.jsx)(Ae,{variant:"secondary",className:B(E.type),children:E.name},E.id):null})})]})]}),(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 H-4 gap-4",children:[(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,H.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,H.jsx)("div",{className:"space-y-2",children:r.comments.map(l=>(0,H.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,H.jsx)("p",{className:"text-sm text-gray-700",children:l.text}),(0,H.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[l.author," - ",new Date(l.timestamp).toLocaleString()]})]},l.id))})}),(0,H.jsxs)("div",{className:"flex mt-2",children:[(0,H.jsx)(j,{value:C,onChange:l=>w(l.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,H.jsxs)(V,{onClick:M,className:"ml-2",children:[(0,H.jsx)(st.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,H.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.lastModified).toLocaleString()]})]})]})]})})}var le=z(require("react"));var We=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));We.displayName="Card";var Oe=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("flex flex-col space-y-1.5 p-6",e),...t}));Oe.displayName="CardHeader";var Ge=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));Ge.displayName="CardTitle";var Uo=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Uo.displayName="CardDescription";var Ue=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("p-6 H-0",e),...t}));Ue.displayName="CardContent";var jo=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("flex items-center p-6 H-0",e),...t}));jo.displayName="CardFooter";function kt({deal:e,customer:t,categories:o,onClick:a}){let n=o.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,H.jsxs)(We,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,H.jsxs)(Oe,{className:"pb-2",children:[(0,H.jsx)("div",{className:"flex justify-between items-center",children:(0,H.jsx)(Ge,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,H.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,H.jsxs)(Ue,{children:[(0,H.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,H.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,H.jsx)(st.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,H.jsx)("span",{children:e.assignee.name})]}),(0,H.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,H.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,H.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,H.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,H.jsx)(st.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,H.jsx)("span",{children:new Date(e.lastModified).toLocaleDateString()})]})}),(0,H.jsx)("div",{className:"flex justify-between items-left",children:n&&(0,H.jsx)(Ae,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:n.name})})]})]})}var Le=require("react-beautiful-dnd");function At({onSubmit:e}){var n;let[t,o]=(0,De.useState)({name:"",intro:"",active:!0});return(0,H.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)(L,{htmlFor:"customerName",children:"Customer Name"}),(0,H.jsx)(j,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)(L,{htmlFor:"customerIntro",children:"Intro"}),(0,H.jsx)(te,{id:"customerIntro",value:(n=t.intro)!=null?n:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,H.jsx)(L,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,H.jsx)(V,{type:"submit",className:"w-full",children:"Add Customer"})]})}function Lt({customers:e,users:t,categories:o,onSubmit:a,initialDeal:n,onAddCustomer:i,onClose:d}){var S,M,B,O;let[r,b]=(0,De.useState)(n||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",lastModified:new Date().toISOString(),comments:[],description:""}),[C,w]=(0,De.useState)(!1),[x,P]=(0,De.useState)({});(0,De.useEffect)(()=>{n&&b(n)},[n]);let p=()=>{let m={};return r.customer||(m.customer="Customer is required"),r.value||(m.value="Value is required"),r.assignee||(m.assignee="Assignee is required"),r.closureDate||(m.closureDate="Closure Date is required"),P(m),Object.keys(m).length===0},u=m=>{m.preventDefault(),p()&&(a({...r,lastModified:new Date().toISOString()}),b({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),P({}),d==null||d())},y=m=>{b(D=>{var G;return{...D,categories:(G=D.categories)!=null&&G.includes(m)?D.categories.filter(l=>l!==m):[...D.categories||[],m]}})},v=m=>{e.push(m),b({...r,customer:m}),w(!1),i(m)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,H.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,H.jsxs)("div",{className:"space-y-6 px-4",children:[(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"customer",children:"Customer"}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsxs)(ge,{value:(M=(S=r.customer)==null?void 0:S.id)==null?void 0:M.toString(),onValueChange:m=>b({...r,customer:{id:Number(m)}}),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select customer"})}),(0,H.jsx)(ae,{children:e.map(m=>{var D;return(0,H.jsx)(ie,{value:((D=m.id)==null?void 0:D.toString())||"",children:m.name},m.id)})})]}),(0,H.jsx)(V,{variant:"outline",size:"icon",onClick:()=>w(!0),children:(0,H.jsx)(st.PlusIcon,{className:"w-5 h-5"})})]}),x.customerId&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.customerId})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"value",children:"Value"}),(0,H.jsx)(j,{id:"value",type:"number",value:r.value||"",onChange:m=>b({...r,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),x.value&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.value})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"assignee",children:"Assignee"}),(0,H.jsxs)(ge,{value:(O=(B=r.assignee)==null?void 0:B.id)==null?void 0:O.toString(),onValueChange:m=>b({...r,assignee:{id:Number(m)}}),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select assignee"})}),(0,H.jsx)(ae,{children:t&&t.map(m=>{var D;return(0,H.jsx)(ie,{value:((D=m.id)==null?void 0:D.toString())||"",children:m.name},m.id)})})]}),x.assignee&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.assignee})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"description",children:"Description"}),(0,H.jsx)(te,{id:"description",value:r.description||"",onChange:m=>b({...r,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{children:"Categories"}),(0,H.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,H.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(D=>D.type===m).map(D=>{var G;return(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:D.id,checked:(G=r.categories)==null?void 0:G.includes(D.id),onCheckedChange:()=>y(D.id)}),(0,H.jsx)("label",{htmlFor:D.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:D.name})]},D.id)})})]},m))})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"closureDate",children:"Closure Date"}),(0,H.jsx)(j,{id:"closureDate",type:"date",value:r.closureDate,onChange:m=>b({...r,closureDate:m.target.value})}),x.closureDate&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.closureDate})]})]})}),(0,H.jsx)(V,{type:"submit",className:"w-full",children:n?"Update Deal":"Add Deal"})]}),(0,H.jsx)(fe,{open:C,onOpenChange:w,children:(0,H.jsxs)(X,{children:[(0,H.jsx)(Y,{children:(0,H.jsx)(ee,{children:"Add New Customer"})}),(0,H.jsx)(At,{onSubmit:v})]})})]})}function Bt({status:e,deals:t,users:o,customers:a,categories:n,onDealClick:i,calculateColumnValue:d,calculateWeightedValue:r,addNewDeal:b,onAddCustomer:C}){let[w,x]=(0,De.useState)(!1);return(0,H.jsxs)("div",{className:"flex flex-col w-80",children:[(0,H.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),b&&(0,H.jsxs)(fe,{open:w,onOpenChange:x,children:[(0,H.jsx)(nt,{asChild:!0,children:(0,H.jsxs)(V,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,H.jsx)(st.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,H.jsxs)(X,{children:[(0,H.jsx)(Y,{children:(0,H.jsx)(ee,{children:"Add New Deal"})}),(0,H.jsx)(Lt,{customers:a,users:o,categories:n,onSubmit:b,onAddCustomer:C,onClose:()=>x(!1)})]})]}),(0,H.jsx)(Le.Droppable,{droppableId:e,children:P=>(0,H.jsxs)("div",{ref:P.innerRef,...P.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((p,u)=>(0,H.jsx)(Le.Draggable,{draggableId:p.id.toString(),index:u,children:y=>(0,H.jsx)("div",{ref:y.innerRef,...y.draggableProps,...y.dragHandleProps,children:(0,H.jsx)(kt,{deal:p,customer:a.find(v=>v.id===p.customer.id),categories:n,onClick:()=>i(p)})})},p.id)),P.placeholder]})}),(0,H.jsxs)("div",{className:"mt-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,H.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,H.jsxs)("span",{className:"text-green-600",children:["\xA3",d(t).toLocaleString()]})]}),(0,H.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,H.jsxs)("span",{className:"text-blue-600",children:["\xA3",r(t,e).toLocaleString()]})]})]})]})}var _o=["Cold","Qualified","Proposal","SoW","Won","Lost"];function Ht({initialData:e,addNewDeal:t,updateDeal:o,addComment:a,addNewCustomer:n}){let[i,d]=(0,De.useState)(null),[r,b]=(0,De.useState)(e),C=p=>r.deals.filter(u=>u.status===p),w=p=>p.reduce((u,y)=>u+(y.value||0),0),x=(p,u)=>{let y={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((v,S)=>v+(S.value||0)*y[u],0)},P=(0,De.useCallback)(p=>{let{source:u,destination:y}=p;if(!y||u.droppableId===y.droppableId&&u.index===y.index)return;let v=u.droppableId,S=y.droppableId;console.log("Moving from ",v,"to",S);let M=[...r.deals],[B]=M.splice(u.index,1);B.status=S,M.splice(y.index,0,B),b({...r,deals:M}),o(B)},[r,o]);return(0,H.jsx)(Le.DragDropContext,{onDragEnd:P,children:(0,H.jsxs)("div",{className:"p-4",children:[(0,H.jsx)("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:_o.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let u=C(p);return(0,H.jsx)(Bt,{status:p,deals:u,customers:e.customers,users:e.users,categories:e.categories,onDealClick:d,calculateColumnValue:w,calculateWeightedValue:x,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:n},p)})}),i&&(0,H.jsx)(Pt,{deal:i,users:e.users,customer:r.customers.find(p=>p.id===i.customer.id),categories:r.categories,onClose:()=>d(null),onSave:o,onAddComment:p=>a(i.id.toString(),p)})]})})}var je=[{id:1,name:"Acme Corp",intro:"H leading technology company",active:!0},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1}],_e=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}];var Ie=[{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"}];var Ko={title:"CRM/KanbanBoard",component:Ht,parameters:{layout:"fullscreen"}},Jo=Ko,ye={args:{initialData:{deals:Array.from({length:20},(e,t)=>({id:t+1,customer:je[t%je.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:Ie[Math.floor(Math.random()*Ie.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[_e[t%_e.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:[],lastModified:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. De'H a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:[{id:"1",name:"Acme Corp",active:!0},{id:"2",name:"GlobalTech",active:!0},{id:"3",name:"InnoSystems",active:!0}],users:Ie,categories:[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}]},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),updateDeal:async e=>(console.log("Updating deal:",e),e),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"})}},Vt,Ft,Wt,Ot,Gt,Ut,jt,_t,Kt,Jt,$t,qt,$o={args:{...(Vt=ye.args)!=null?Vt:{},initialData:{...(Wt=(Ft=ye.args)==null?void 0:Ft.initialData)!=null?Wt:{},deals:[],users:(Ut=(Gt=(Ot=ye.args)==null?void 0:Ot.initialData)==null?void 0:Gt.users)!=null?Ut:[],customers:(Kt=(_t=(jt=ye.args)==null?void 0:jt.initialData)==null?void 0:_t.customers)!=null?Kt:[],categories:(qt=($t=(Jt=ye.args)==null?void 0:Jt.initialData)==null?void 0:$t.categories)!=null?qt:[]}}};0&&(module.exports={Default,NoDeals});
@@ -1 +1 @@
1
- import{d as o}from"../../chunk-HIT3PDJA.mjs";import{a}from"../../chunk-SILLEZTI.mjs";import"../../chunk-ZDNAXLAG.mjs";import"../../chunk-TSPWI4RS.mjs";import"../../chunk-EMWBQUQC.mjs";import"../../chunk-HQFNGDDO.mjs";import"../../chunk-YOFO7YSO.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-Q6SEVCRG.mjs";import"../../chunk-GLEWUUGS.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";var n={title:"CRM/KanbanBoard",component:a,parameters:{layout:"fullscreen"}},i=n,r={args:{initialData:{deals:Array.from({length:20},(e,t)=>({id:`${t+1}`,customerId:`${t%3+1}`,value:Math.floor(Math.random()*1e5)+5e3,assignee:["John Doe","Jane Smith","Bob Johnson"][Math.floor(Math.random()*3)],status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[`${t%6+1}`],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:[],lastModified: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:[{id:"1",name:"Acme Corp",active:!0},{id:"2",name:"GlobalTech",active:!0},{id:"3",name:"InnoSystems",active:!0}],users:o,categories:[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}]},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),updateDeal:async e=>(console.log("Updating deal:",e),e),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"})}},l={args:{...r.args,initialData:{...r.args.initialData,deals:[]}}};export{r as Default,l as NoDeals,i as default};
1
+ import{a as r,b as n,d as o}from"../../chunk-RQLWJFYT.mjs";import{a as s}from"../../chunk-QZ2ZSGL6.mjs";import"../../chunk-47TRCRZ7.mjs";import"../../chunk-SF7DGZCZ.mjs";import"../../chunk-RXJVXPNC.mjs";import"../../chunk-3FW5YDNM.mjs";import"../../chunk-J7XKTH35.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-Q6SEVCRG.mjs";import"../../chunk-GLEWUUGS.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";var D={title:"CRM/KanbanBoard",component:s,parameters:{layout:"fullscreen"}},C=D,a={args:{initialData:{deals:Array.from({length:20},(e,t)=>({id:t+1,customer:r[t%r.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:o[Math.floor(Math.random()*o.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:[],lastModified: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:[{id:"1",name:"Acme Corp",active:!0},{id:"2",name:"GlobalTech",active:!0},{id:"3",name:"InnoSystems",active:!0}],users:o,categories:[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}]},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),updateDeal:async e=>(console.log("Updating deal:",e),e),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"})}},i,d,l,m,c,u,g,p,y,f,h,M,b={args:{...(i=a.args)!=null?i:{},initialData:{...(l=(d=a.args)==null?void 0:d.initialData)!=null?l:{},deals:[],users:(u=(c=(m=a.args)==null?void 0:m.initialData)==null?void 0:c.users)!=null?u:[],customers:(y=(p=(g=a.args)==null?void 0:g.initialData)==null?void 0:p.customers)!=null?y:[],categories:(M=(h=(f=a.args)==null?void 0:f.initialData)==null?void 0:h.categories)!=null?M:[]}}};export{a as Default,b as NoDeals,C as default};
@@ -1,15 +1,15 @@
1
- import type { Deal, CRMStatus, CRMCategory, CRMCustomer, User } from "./types";
1
+ import type { Deal, CRMStatus, CRMCategory, Customer, User } from './types';
2
2
  type KanbanColumnProps = {
3
3
  status: CRMStatus;
4
4
  deals: Deal[];
5
- users?: User[];
6
- customers: CRMCustomer[];
5
+ users?: Partial<User>[];
6
+ customers: Partial<Customer>[];
7
7
  categories: CRMCategory[];
8
8
  onDealClick: (deal: Deal) => void;
9
9
  calculateColumnValue: (deals: Deal[]) => number;
10
10
  calculateWeightedValue: (deals: Deal[], status: CRMStatus) => number;
11
11
  addNewDeal?: (deal: Deal) => void;
12
- onAddCustomer: (customer: CRMCustomer) => void;
12
+ onAddCustomer: (customer: Partial<Customer>) => void;
13
13
  };
14
14
  export declare function KanbanColumn({ status, deals, users, customers, categories, onDealClick, calculateColumnValue, calculateWeightedValue, addNewDeal, onAddCustomer, }: KanbanColumnProps): import("react/jsx-runtime").JSX.Element;
15
15
  export {};