@aglyn/plugins-crm 1.0.0-beta.143

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 (669) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +21 -0
  5. package/src/index.js +29 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/activity-list.d.ts +98 -0
  8. package/src/lib/components/activity-list.js +321 -0
  9. package/src/lib/components/activity-list.js.map +1 -0
  10. package/src/lib/components/activity-queries.d.ts +117 -0
  11. package/src/lib/components/activity-queries.js +198 -0
  12. package/src/lib/components/activity-queries.js.map +1 -0
  13. package/src/lib/components/add-to-list-button.d.ts +25 -0
  14. package/src/lib/components/add-to-list-button.js +64 -0
  15. package/src/lib/components/add-to-list-button.js.map +1 -0
  16. package/src/lib/components/add-to-list-dialog.d.ts +24 -0
  17. package/src/lib/components/add-to-list-dialog.js +327 -0
  18. package/src/lib/components/add-to-list-dialog.js.map +1 -0
  19. package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
  20. package/src/lib/components/assignment-rule-drawer.js +293 -0
  21. package/src/lib/components/assignment-rule-drawer.js.map +1 -0
  22. package/src/lib/components/companies-bulk-bar.d.ts +29 -0
  23. package/src/lib/components/companies-bulk-bar.js +274 -0
  24. package/src/lib/components/companies-bulk-bar.js.map +1 -0
  25. package/src/lib/components/companies-section.d.ts +54 -0
  26. package/src/lib/components/companies-section.js +522 -0
  27. package/src/lib/components/companies-section.js.map +1 -0
  28. package/src/lib/components/company-contacts-card.d.ts +49 -0
  29. package/src/lib/components/company-contacts-card.js +435 -0
  30. package/src/lib/components/company-contacts-card.js.map +1 -0
  31. package/src/lib/components/company-deals-card.d.ts +20 -0
  32. package/src/lib/components/company-deals-card.js +38 -0
  33. package/src/lib/components/company-deals-card.js.map +1 -0
  34. package/src/lib/components/company-detail-page.d.ts +20 -0
  35. package/src/lib/components/company-detail-page.js +165 -0
  36. package/src/lib/components/company-detail-page.js.map +1 -0
  37. package/src/lib/components/company-edit-drawer.d.ts +65 -0
  38. package/src/lib/components/company-edit-drawer.js +433 -0
  39. package/src/lib/components/company-edit-drawer.js.map +1 -0
  40. package/src/lib/components/company-import-drawer.d.ts +42 -0
  41. package/src/lib/components/company-import-drawer.js +99 -0
  42. package/src/lib/components/company-import-drawer.js.map +1 -0
  43. package/src/lib/components/company-picker.d.ts +127 -0
  44. package/src/lib/components/company-picker.js +323 -0
  45. package/src/lib/components/company-picker.js.map +1 -0
  46. package/src/lib/components/company-properties-card.d.ts +47 -0
  47. package/src/lib/components/company-properties-card.js +289 -0
  48. package/src/lib/components/company-properties-card.js.map +1 -0
  49. package/src/lib/components/contact-address-fields.d.ts +29 -0
  50. package/src/lib/components/contact-address-fields.js +149 -0
  51. package/src/lib/components/contact-address-fields.js.map +1 -0
  52. package/src/lib/components/contact-associations-card.d.ts +72 -0
  53. package/src/lib/components/contact-associations-card.js +296 -0
  54. package/src/lib/components/contact-associations-card.js.map +1 -0
  55. package/src/lib/components/contact-custom-columns.d.ts +38 -0
  56. package/src/lib/components/contact-custom-columns.js +102 -0
  57. package/src/lib/components/contact-custom-columns.js.map +1 -0
  58. package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
  59. package/src/lib/components/contact-custom-fields-card.js +204 -0
  60. package/src/lib/components/contact-custom-fields-card.js.map +1 -0
  61. package/src/lib/components/contact-deals-card.d.ts +20 -0
  62. package/src/lib/components/contact-deals-card.js +38 -0
  63. package/src/lib/components/contact-deals-card.js.map +1 -0
  64. package/src/lib/components/contact-detail-page.d.ts +46 -0
  65. package/src/lib/components/contact-detail-page.js +535 -0
  66. package/src/lib/components/contact-detail-page.js.map +1 -0
  67. package/src/lib/components/contact-duplicates-card.d.ts +42 -0
  68. package/src/lib/components/contact-duplicates-card.js +167 -0
  69. package/src/lib/components/contact-duplicates-card.js.map +1 -0
  70. package/src/lib/components/contact-field-drawer.d.ts +64 -0
  71. package/src/lib/components/contact-field-drawer.js +251 -0
  72. package/src/lib/components/contact-field-drawer.js.map +1 -0
  73. package/src/lib/components/contact-import-drawer.d.ts +46 -0
  74. package/src/lib/components/contact-import-drawer.js +149 -0
  75. package/src/lib/components/contact-import-drawer.js.map +1 -0
  76. package/src/lib/components/contact-known-by-card.d.ts +39 -0
  77. package/src/lib/components/contact-known-by-card.js +142 -0
  78. package/src/lib/components/contact-known-by-card.js.map +1 -0
  79. package/src/lib/components/contact-list-columns.d.ts +53 -0
  80. package/src/lib/components/contact-list-columns.js +288 -0
  81. package/src/lib/components/contact-list-columns.js.map +1 -0
  82. package/src/lib/components/contact-merge-dialog.d.ts +79 -0
  83. package/src/lib/components/contact-merge-dialog.js +405 -0
  84. package/src/lib/components/contact-merge-dialog.js.map +1 -0
  85. package/src/lib/components/contact-properties-card.d.ts +89 -0
  86. package/src/lib/components/contact-properties-card.js +492 -0
  87. package/src/lib/components/contact-properties-card.js.map +1 -0
  88. package/src/lib/components/contact-timeline-card.d.ts +68 -0
  89. package/src/lib/components/contact-timeline-card.js +435 -0
  90. package/src/lib/components/contact-timeline-card.js.map +1 -0
  91. package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
  92. package/src/lib/components/contacts-bulk-bar.js +493 -0
  93. package/src/lib/components/contacts-bulk-bar.js.map +1 -0
  94. package/src/lib/components/contacts-section.d.ts +26 -0
  95. package/src/lib/components/contacts-section.js +1025 -0
  96. package/src/lib/components/contacts-section.js.map +1 -0
  97. package/src/lib/components/copy-capture-address-button.d.ts +33 -0
  98. package/src/lib/components/copy-capture-address-button.js +60 -0
  99. package/src/lib/components/copy-capture-address-button.js.map +1 -0
  100. package/src/lib/components/crm-attribution-zone.d.ts +38 -0
  101. package/src/lib/components/crm-attribution-zone.js +36 -0
  102. package/src/lib/components/crm-attribution-zone.js.map +1 -0
  103. package/src/lib/components/crm-booking-zone.d.ts +61 -0
  104. package/src/lib/components/crm-booking-zone.js +50 -0
  105. package/src/lib/components/crm-booking-zone.js.map +1 -0
  106. package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
  107. package/src/lib/components/crm-bulk-bar-frame.js +137 -0
  108. package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
  109. package/src/lib/components/crm-call-actions.d.ts +65 -0
  110. package/src/lib/components/crm-call-actions.js +110 -0
  111. package/src/lib/components/crm-call-actions.js.map +1 -0
  112. package/src/lib/components/crm-column-menu.d.ts +21 -0
  113. package/src/lib/components/crm-column-menu.js +103 -0
  114. package/src/lib/components/crm-column-menu.js.map +1 -0
  115. package/src/lib/components/crm-console-page.d.ts +19 -0
  116. package/src/lib/components/crm-console-page.js +151 -0
  117. package/src/lib/components/crm-console-page.js.map +1 -0
  118. package/src/lib/components/crm-console-sections.d.ts +52 -0
  119. package/src/lib/components/crm-console-sections.js +83 -0
  120. package/src/lib/components/crm-console-sections.js.map +1 -0
  121. package/src/lib/components/crm-custom-field-control.d.ts +26 -0
  122. package/src/lib/components/crm-custom-field-control.js +131 -0
  123. package/src/lib/components/crm-custom-field-control.js.map +1 -0
  124. package/src/lib/components/crm-email-template-tools.d.ts +69 -0
  125. package/src/lib/components/crm-email-template-tools.js +240 -0
  126. package/src/lib/components/crm-email-template-tools.js.map +1 -0
  127. package/src/lib/components/crm-export-all-button.d.ts +39 -0
  128. package/src/lib/components/crm-export-all-button.js +98 -0
  129. package/src/lib/components/crm-export-all-button.js.map +1 -0
  130. package/src/lib/components/crm-filter-bar.d.ts +53 -0
  131. package/src/lib/components/crm-filter-bar.js +294 -0
  132. package/src/lib/components/crm-filter-bar.js.map +1 -0
  133. package/src/lib/components/crm-glance-card.d.ts +54 -0
  134. package/src/lib/components/crm-glance-card.js +219 -0
  135. package/src/lib/components/crm-glance-card.js.map +1 -0
  136. package/src/lib/components/crm-next-activity-column.d.ts +35 -0
  137. package/src/lib/components/crm-next-activity-column.js +100 -0
  138. package/src/lib/components/crm-next-activity-column.js.map +1 -0
  139. package/src/lib/components/crm-record-header.d.ts +97 -0
  140. package/src/lib/components/crm-record-header.js +160 -0
  141. package/src/lib/components/crm-record-header.js.map +1 -0
  142. package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
  143. package/src/lib/components/crm-record-insights-zone.js +169 -0
  144. package/src/lib/components/crm-record-insights-zone.js.map +1 -0
  145. package/src/lib/components/crm-record-picker.d.ts +42 -0
  146. package/src/lib/components/crm-record-picker.js +104 -0
  147. package/src/lib/components/crm-record-picker.js.map +1 -0
  148. package/src/lib/components/crm-send-email-button.d.ts +39 -0
  149. package/src/lib/components/crm-send-email-button.js +81 -0
  150. package/src/lib/components/crm-send-email-button.js.map +1 -0
  151. package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
  152. package/src/lib/components/crm-send-email-dialog.js +851 -0
  153. package/src/lib/components/crm-send-email-dialog.js.map +1 -0
  154. package/src/lib/components/crm-site-picker.d.ts +61 -0
  155. package/src/lib/components/crm-site-picker.js +99 -0
  156. package/src/lib/components/crm-site-picker.js.map +1 -0
  157. package/src/lib/components/crm-suite-lock.d.ts +29 -0
  158. package/src/lib/components/crm-suite-lock.js +114 -0
  159. package/src/lib/components/crm-suite-lock.js.map +1 -0
  160. package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
  161. package/src/lib/components/crm-tasks-due-card.js +225 -0
  162. package/src/lib/components/crm-tasks-due-card.js.map +1 -0
  163. package/src/lib/components/crm-views-control.d.ts +65 -0
  164. package/src/lib/components/crm-views-control.js +518 -0
  165. package/src/lib/components/crm-views-control.js.map +1 -0
  166. package/src/lib/components/csv-import-drawer.d.ts +132 -0
  167. package/src/lib/components/csv-import-drawer.js +746 -0
  168. package/src/lib/components/csv-import-drawer.js.map +1 -0
  169. package/src/lib/components/deal-board.d.ts +70 -0
  170. package/src/lib/components/deal-board.js +478 -0
  171. package/src/lib/components/deal-board.js.map +1 -0
  172. package/src/lib/components/deal-detail-page.d.ts +18 -0
  173. package/src/lib/components/deal-detail-page.js +323 -0
  174. package/src/lib/components/deal-detail-page.js.map +1 -0
  175. package/src/lib/components/deal-edit-drawer.d.ts +59 -0
  176. package/src/lib/components/deal-edit-drawer.js +640 -0
  177. package/src/lib/components/deal-edit-drawer.js.map +1 -0
  178. package/src/lib/components/deal-import-drawer.d.ts +24 -0
  179. package/src/lib/components/deal-import-drawer.js +83 -0
  180. package/src/lib/components/deal-import-drawer.js.map +1 -0
  181. package/src/lib/components/deal-products-card.d.ts +48 -0
  182. package/src/lib/components/deal-products-card.js +614 -0
  183. package/src/lib/components/deal-products-card.js.map +1 -0
  184. package/src/lib/components/deal-properties-card.d.ts +29 -0
  185. package/src/lib/components/deal-properties-card.js +144 -0
  186. package/src/lib/components/deal-properties-card.js.map +1 -0
  187. package/src/lib/components/deal-stage-card.d.ts +24 -0
  188. package/src/lib/components/deal-stage-card.js +199 -0
  189. package/src/lib/components/deal-stage-card.js.map +1 -0
  190. package/src/lib/components/deals-bulk-bar.d.ts +31 -0
  191. package/src/lib/components/deals-bulk-bar.js +340 -0
  192. package/src/lib/components/deals-bulk-bar.js.map +1 -0
  193. package/src/lib/components/deals-section.d.ts +49 -0
  194. package/src/lib/components/deals-section.js +767 -0
  195. package/src/lib/components/deals-section.js.map +1 -0
  196. package/src/lib/components/email-capture-card.d.ts +42 -0
  197. package/src/lib/components/email-capture-card.js +134 -0
  198. package/src/lib/components/email-capture-card.js.map +1 -0
  199. package/src/lib/components/email-template-drawer.d.ts +33 -0
  200. package/src/lib/components/email-template-drawer.js +209 -0
  201. package/src/lib/components/email-template-drawer.js.map +1 -0
  202. package/src/lib/components/email-templates-card.d.ts +33 -0
  203. package/src/lib/components/email-templates-card.js +370 -0
  204. package/src/lib/components/email-templates-card.js.map +1 -0
  205. package/src/lib/components/erase-person-action.d.ts +92 -0
  206. package/src/lib/components/erase-person-action.js +261 -0
  207. package/src/lib/components/erase-person-action.js.map +1 -0
  208. package/src/lib/components/fields-section.d.ts +37 -0
  209. package/src/lib/components/fields-section.js +641 -0
  210. package/src/lib/components/fields-section.js.map +1 -0
  211. package/src/lib/components/form-contact-fields-card.d.ts +46 -0
  212. package/src/lib/components/form-contact-fields-card.js +253 -0
  213. package/src/lib/components/form-contact-fields-card.js.map +1 -0
  214. package/src/lib/components/insert-link-at-caret.d.ts +28 -0
  215. package/src/lib/components/insert-link-at-caret.js +37 -0
  216. package/src/lib/components/insert-link-at-caret.js.map +1 -0
  217. package/src/lib/components/lead-convert-dialog.d.ts +32 -0
  218. package/src/lib/components/lead-convert-dialog.js +493 -0
  219. package/src/lib/components/lead-convert-dialog.js.map +1 -0
  220. package/src/lib/components/lead-detail-page.d.ts +16 -0
  221. package/src/lib/components/lead-detail-page.js +163 -0
  222. package/src/lib/components/lead-detail-page.js.map +1 -0
  223. package/src/lib/components/lead-history-card.d.ts +32 -0
  224. package/src/lib/components/lead-history-card.js +165 -0
  225. package/src/lib/components/lead-history-card.js.map +1 -0
  226. package/src/lib/components/lead-import-drawer.d.ts +24 -0
  227. package/src/lib/components/lead-import-drawer.js +95 -0
  228. package/src/lib/components/lead-import-drawer.js.map +1 -0
  229. package/src/lib/components/lead-owner-select.d.ts +35 -0
  230. package/src/lib/components/lead-owner-select.js +91 -0
  231. package/src/lib/components/lead-owner-select.js.map +1 -0
  232. package/src/lib/components/lead-properties-card.d.ts +61 -0
  233. package/src/lib/components/lead-properties-card.js +395 -0
  234. package/src/lib/components/lead-properties-card.js.map +1 -0
  235. package/src/lib/components/lead-status-chip.d.ts +12 -0
  236. package/src/lib/components/lead-status-chip.js +43 -0
  237. package/src/lib/components/lead-status-chip.js.map +1 -0
  238. package/src/lib/components/lead-surfaces-note.d.ts +126 -0
  239. package/src/lib/components/lead-surfaces-note.js +262 -0
  240. package/src/lib/components/lead-surfaces-note.js.map +1 -0
  241. package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
  242. package/src/lib/components/lead-unqualify-dialog.js +125 -0
  243. package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
  244. package/src/lib/components/leads-bulk-bar.d.ts +58 -0
  245. package/src/lib/components/leads-bulk-bar.js +307 -0
  246. package/src/lib/components/leads-bulk-bar.js.map +1 -0
  247. package/src/lib/components/leads-section.d.ts +23 -0
  248. package/src/lib/components/leads-section.js +664 -0
  249. package/src/lib/components/leads-section.js.map +1 -0
  250. package/src/lib/components/linked-deals-card.d.ts +32 -0
  251. package/src/lib/components/linked-deals-card.js +163 -0
  252. package/src/lib/components/linked-deals-card.js.map +1 -0
  253. package/src/lib/components/log-activity-dialog.d.ts +60 -0
  254. package/src/lib/components/log-activity-dialog.js +368 -0
  255. package/src/lib/components/log-activity-dialog.js.map +1 -0
  256. package/src/lib/components/lost-reason-dialog.d.ts +26 -0
  257. package/src/lib/components/lost-reason-dialog.js +95 -0
  258. package/src/lib/components/lost-reason-dialog.js.map +1 -0
  259. package/src/lib/components/new-contact-drawer.d.ts +78 -0
  260. package/src/lib/components/new-contact-drawer.js +343 -0
  261. package/src/lib/components/new-contact-drawer.js.map +1 -0
  262. package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
  263. package/src/lib/components/org-lead-surfaces-note.js +172 -0
  264. package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
  265. package/src/lib/components/owner-avatar.d.ts +18 -0
  266. package/src/lib/components/owner-avatar.js +61 -0
  267. package/src/lib/components/owner-avatar.js.map +1 -0
  268. package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
  269. package/src/lib/components/pipeline-stages-dialog.js +339 -0
  270. package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
  271. package/src/lib/components/pipelines-dialog.d.ts +55 -0
  272. package/src/lib/components/pipelines-dialog.js +517 -0
  273. package/src/lib/components/pipelines-dialog.js.map +1 -0
  274. package/src/lib/components/recent-activity-feed.d.ts +39 -0
  275. package/src/lib/components/recent-activity-feed.js +103 -0
  276. package/src/lib/components/recent-activity-feed.js.map +1 -0
  277. package/src/lib/components/recipes-card.d.ts +39 -0
  278. package/src/lib/components/recipes-card.js +485 -0
  279. package/src/lib/components/recipes-card.js.map +1 -0
  280. package/src/lib/components/record-activity-card.d.ts +26 -0
  281. package/src/lib/components/record-activity-card.js +121 -0
  282. package/src/lib/components/record-activity-card.js.map +1 -0
  283. package/src/lib/components/record-files-card.d.ts +67 -0
  284. package/src/lib/components/record-files-card.js +290 -0
  285. package/src/lib/components/record-files-card.js.map +1 -0
  286. package/src/lib/components/record-tasks-card.d.ts +32 -0
  287. package/src/lib/components/record-tasks-card.js +306 -0
  288. package/src/lib/components/record-tasks-card.js.map +1 -0
  289. package/src/lib/components/reports/activity-card.d.ts +57 -0
  290. package/src/lib/components/reports/activity-card.js +281 -0
  291. package/src/lib/components/reports/activity-card.js.map +1 -0
  292. package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
  293. package/src/lib/components/reports/closed-deals-card.js +194 -0
  294. package/src/lib/components/reports/closed-deals-card.js.map +1 -0
  295. package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
  296. package/src/lib/components/reports/contacts-mix-card.js +161 -0
  297. package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
  298. package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
  299. package/src/lib/components/reports/contacts-trend-card.js +144 -0
  300. package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
  301. package/src/lib/components/reports/forecast-card.d.ts +22 -0
  302. package/src/lib/components/reports/forecast-card.js +251 -0
  303. package/src/lib/components/reports/forecast-card.js.map +1 -0
  304. package/src/lib/components/reports/lead-counts.d.ts +32 -0
  305. package/src/lib/components/reports/lead-counts.js +44 -0
  306. package/src/lib/components/reports/lead-counts.js.map +1 -0
  307. package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
  308. package/src/lib/components/reports/lead-funnel-card.js +375 -0
  309. package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
  310. package/src/lib/components/reports/pipeline-card.d.ts +19 -0
  311. package/src/lib/components/reports/pipeline-card.js +338 -0
  312. package/src/lib/components/reports/pipeline-card.js.map +1 -0
  313. package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
  314. package/src/lib/components/reports/report-bar-chart.js +133 -0
  315. package/src/lib/components/reports/report-bar-chart.js.map +1 -0
  316. package/src/lib/components/reports/report-breakdown.d.ts +32 -0
  317. package/src/lib/components/reports/report-breakdown.js +105 -0
  318. package/src/lib/components/reports/report-breakdown.js.map +1 -0
  319. package/src/lib/components/reports/report-export.d.ts +37 -0
  320. package/src/lib/components/reports/report-export.js +66 -0
  321. package/src/lib/components/reports/report-export.js.map +1 -0
  322. package/src/lib/components/reports/report-format.d.ts +36 -0
  323. package/src/lib/components/reports/report-format.js +43 -0
  324. package/src/lib/components/reports/report-format.js.map +1 -0
  325. package/src/lib/components/reports/report-scope.d.ts +81 -0
  326. package/src/lib/components/reports/report-scope.js +58 -0
  327. package/src/lib/components/reports/report-scope.js.map +1 -0
  328. package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
  329. package/src/lib/components/reports/report-stat-tile.js +96 -0
  330. package/src/lib/components/reports/report-stat-tile.js.map +1 -0
  331. package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
  332. package/src/lib/components/reports/source-conversion-card.js +205 -0
  333. package/src/lib/components/reports/source-conversion-card.js.map +1 -0
  334. package/src/lib/components/reports/tasks-card.d.ts +26 -0
  335. package/src/lib/components/reports/tasks-card.js +279 -0
  336. package/src/lib/components/reports/tasks-card.js.map +1 -0
  337. package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
  338. package/src/lib/components/reports/use-aggregate-read.js +195 -0
  339. package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
  340. package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
  341. package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
  342. package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
  343. package/src/lib/components/reports-section.d.ts +42 -0
  344. package/src/lib/components/reports-section.js +308 -0
  345. package/src/lib/components/reports-section.js.map +1 -0
  346. package/src/lib/components/sending-addresses-card.d.ts +49 -0
  347. package/src/lib/components/sending-addresses-card.js +262 -0
  348. package/src/lib/components/sending-addresses-card.js.map +1 -0
  349. package/src/lib/components/settings-section.d.ts +151 -0
  350. package/src/lib/components/settings-section.js +783 -0
  351. package/src/lib/components/settings-section.js.map +1 -0
  352. package/src/lib/components/task-cells.d.ts +51 -0
  353. package/src/lib/components/task-cells.js +139 -0
  354. package/src/lib/components/task-cells.js.map +1 -0
  355. package/src/lib/components/task-edit-drawer.d.ts +53 -0
  356. package/src/lib/components/task-edit-drawer.js +483 -0
  357. package/src/lib/components/task-edit-drawer.js.map +1 -0
  358. package/src/lib/components/task-import-drawer.d.ts +24 -0
  359. package/src/lib/components/task-import-drawer.js +82 -0
  360. package/src/lib/components/task-import-drawer.js.map +1 -0
  361. package/src/lib/components/task-snooze-menu.d.ts +65 -0
  362. package/src/lib/components/task-snooze-menu.js +207 -0
  363. package/src/lib/components/task-snooze-menu.js.map +1 -0
  364. package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
  365. package/src/lib/components/tasks-bulk-bar.js +348 -0
  366. package/src/lib/components/tasks-bulk-bar.js.map +1 -0
  367. package/src/lib/components/tasks-calendar.d.ts +38 -0
  368. package/src/lib/components/tasks-calendar.js +228 -0
  369. package/src/lib/components/tasks-calendar.js.map +1 -0
  370. package/src/lib/components/tasks-section.d.ts +27 -0
  371. package/src/lib/components/tasks-section.js +579 -0
  372. package/src/lib/components/tasks-section.js.map +1 -0
  373. package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
  374. package/src/lib/components/use-contact-campaign-emails.js +83 -0
  375. package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
  376. package/src/lib/components/use-crm-api.d.ts +44 -0
  377. package/src/lib/components/use-crm-api.js +84 -0
  378. package/src/lib/components/use-crm-api.js.map +1 -0
  379. package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
  380. package/src/lib/components/use-crm-inbound-address.js +124 -0
  381. package/src/lib/components/use-crm-inbound-address.js.map +1 -0
  382. package/src/lib/components/use-emails-hub-path.d.ts +24 -0
  383. package/src/lib/components/use-emails-hub-path.js +59 -0
  384. package/src/lib/components/use-emails-hub-path.js.map +1 -0
  385. package/src/lib/components/use-member-email-aliases.d.ts +54 -0
  386. package/src/lib/components/use-member-email-aliases.js +186 -0
  387. package/src/lib/components/use-member-email-aliases.js.map +1 -0
  388. package/src/lib/components/use-org-members.d.ts +40 -0
  389. package/src/lib/components/use-org-members.js +100 -0
  390. package/src/lib/components/use-org-members.js.map +1 -0
  391. package/src/lib/constants/api-routes.d.ts +109 -0
  392. package/src/lib/constants/api-routes.js +74 -0
  393. package/src/lib/constants/api-routes.js.map +1 -0
  394. package/src/lib/constants/bundle-common.d.ts +14 -0
  395. package/src/lib/constants/bundle-common.js +14 -0
  396. package/src/lib/constants/bundle-common.js.map +1 -0
  397. package/src/lib/constants/company-filters.d.ts +18 -0
  398. package/src/lib/constants/company-filters.js +51 -0
  399. package/src/lib/constants/company-filters.js.map +1 -0
  400. package/src/lib/constants/contact-filters.d.ts +38 -0
  401. package/src/lib/constants/contact-filters.js +294 -0
  402. package/src/lib/constants/contact-filters.js.map +1 -0
  403. package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
  404. package/src/lib/hooks/use-contact-field-definitions.js +72 -0
  405. package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
  406. package/src/lib/hooks/use-contact-update.d.ts +25 -0
  407. package/src/lib/hooks/use-contact-update.js +80 -0
  408. package/src/lib/hooks/use-contact-update.js.map +1 -0
  409. package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
  410. package/src/lib/hooks/use-crm-activity-logger.js +101 -0
  411. package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
  412. package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
  413. package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
  414. package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
  415. package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
  416. package/src/lib/hooks/use-crm-default-view.js +64 -0
  417. package/src/lib/hooks/use-crm-default-view.js.map +1 -0
  418. package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
  419. package/src/lib/hooks/use-crm-email-templates.js +103 -0
  420. package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
  421. package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
  422. package/src/lib/hooks/use-crm-hub-path.js +41 -0
  423. package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
  424. package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
  425. package/src/lib/hooks/use-crm-org-mount.js +215 -0
  426. package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
  427. package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
  428. package/src/lib/hooks/use-crm-record-names.js +126 -0
  429. package/src/lib/hooks/use-crm-record-names.js.map +1 -0
  430. package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
  431. package/src/lib/hooks/use-crm-records-quota.js +118 -0
  432. package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
  433. package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
  434. package/src/lib/hooks/use-crm-saved-view.js +329 -0
  435. package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
  436. package/src/lib/hooks/use-crm-scope.d.ts +117 -0
  437. package/src/lib/hooks/use-crm-scope.js +147 -0
  438. package/src/lib/hooks/use-crm-scope.js.map +1 -0
  439. package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
  440. package/src/lib/hooks/use-crm-tasks.js +153 -0
  441. package/src/lib/hooks/use-crm-tasks.js.map +1 -0
  442. package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
  443. package/src/lib/hooks/use-crm-view-grid.js +170 -0
  444. package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
  445. package/src/lib/hooks/use-crm-views.d.ts +42 -0
  446. package/src/lib/hooks/use-crm-views.js +84 -0
  447. package/src/lib/hooks/use-crm-views.js.map +1 -0
  448. package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
  449. package/src/lib/hooks/use-deal-stage-api.js +78 -0
  450. package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
  451. package/src/lib/hooks/use-deals.d.ts +47 -0
  452. package/src/lib/hooks/use-deals.js +105 -0
  453. package/src/lib/hooks/use-deals.js.map +1 -0
  454. package/src/lib/hooks/use-org-leads.d.ts +53 -0
  455. package/src/lib/hooks/use-org-leads.js +114 -0
  456. package/src/lib/hooks/use-org-leads.js.map +1 -0
  457. package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
  458. package/src/lib/hooks/use-org-member-directory.js +116 -0
  459. package/src/lib/hooks/use-org-member-directory.js.map +1 -0
  460. package/src/lib/hooks/use-org-member-options.d.ts +38 -0
  461. package/src/lib/hooks/use-org-member-options.js +131 -0
  462. package/src/lib/hooks/use-org-member-options.js.map +1 -0
  463. package/src/lib/hooks/use-pipeline.d.ts +71 -0
  464. package/src/lib/hooks/use-pipeline.js +159 -0
  465. package/src/lib/hooks/use-pipeline.js.map +1 -0
  466. package/src/lib/model/companies-bulk-writes.d.ts +40 -0
  467. package/src/lib/model/companies-bulk-writes.js +103 -0
  468. package/src/lib/model/companies-bulk-writes.js.map +1 -0
  469. package/src/lib/model/companies-csv.d.ts +36 -0
  470. package/src/lib/model/companies-csv.js +38 -0
  471. package/src/lib/model/companies-csv.js.map +1 -0
  472. package/src/lib/model/companies.d.ts +99 -0
  473. package/src/lib/model/companies.js +168 -0
  474. package/src/lib/model/companies.js.map +1 -0
  475. package/src/lib/model/company-delete-route.d.ts +43 -0
  476. package/src/lib/model/company-delete-route.js +31 -0
  477. package/src/lib/model/company-delete-route.js.map +1 -0
  478. package/src/lib/model/company-delete.d.ts +42 -0
  479. package/src/lib/model/company-delete.js +52 -0
  480. package/src/lib/model/company-delete.js.map +1 -0
  481. package/src/lib/model/contact-duplicates.d.ts +58 -0
  482. package/src/lib/model/contact-duplicates.js +67 -0
  483. package/src/lib/model/contact-duplicates.js.map +1 -0
  484. package/src/lib/model/contact-record.d.ts +113 -0
  485. package/src/lib/model/contact-record.js +70 -0
  486. package/src/lib/model/contact-record.js.map +1 -0
  487. package/src/lib/model/contact-update.d.ts +93 -0
  488. package/src/lib/model/contact-update.js +50 -0
  489. package/src/lib/model/contact-update.js.map +1 -0
  490. package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
  491. package/src/lib/model/contacts-bulk-writes.js +196 -0
  492. package/src/lib/model/contacts-bulk-writes.js.map +1 -0
  493. package/src/lib/model/contacts-csv.d.ts +54 -0
  494. package/src/lib/model/contacts-csv.js +67 -0
  495. package/src/lib/model/contacts-csv.js.map +1 -0
  496. package/src/lib/model/contacts-list-seed.d.ts +51 -0
  497. package/src/lib/model/contacts-list-seed.js +63 -0
  498. package/src/lib/model/contacts-list-seed.js.map +1 -0
  499. package/src/lib/model/crm-activity-report.d.ts +27 -0
  500. package/src/lib/model/crm-activity-report.js +56 -0
  501. package/src/lib/model/crm-activity-report.js.map +1 -0
  502. package/src/lib/model/crm-api.d.ts +49 -0
  503. package/src/lib/model/crm-api.js +47 -0
  504. package/src/lib/model/crm-api.js.map +1 -0
  505. package/src/lib/model/crm-bulk-writes.d.ts +147 -0
  506. package/src/lib/model/crm-bulk-writes.js +207 -0
  507. package/src/lib/model/crm-bulk-writes.js.map +1 -0
  508. package/src/lib/model/crm-company-import.d.ts +154 -0
  509. package/src/lib/model/crm-company-import.js +331 -0
  510. package/src/lib/model/crm-company-import.js.map +1 -0
  511. package/src/lib/model/crm-custom-draft.d.ts +62 -0
  512. package/src/lib/model/crm-custom-draft.js +67 -0
  513. package/src/lib/model/crm-custom-draft.js.map +1 -0
  514. package/src/lib/model/crm-deal-import.d.ts +112 -0
  515. package/src/lib/model/crm-deal-import.js +263 -0
  516. package/src/lib/model/crm-deal-import.js.map +1 -0
  517. package/src/lib/model/crm-import.d.ts +244 -0
  518. package/src/lib/model/crm-import.js +466 -0
  519. package/src/lib/model/crm-import.js.map +1 -0
  520. package/src/lib/model/crm-lead-import.d.ts +105 -0
  521. package/src/lib/model/crm-lead-import.js +255 -0
  522. package/src/lib/model/crm-lead-import.js.map +1 -0
  523. package/src/lib/model/crm-record-routes.d.ts +21 -0
  524. package/src/lib/model/crm-record-routes.js +70 -0
  525. package/src/lib/model/crm-record-routes.js.map +1 -0
  526. package/src/lib/model/crm-routes.d.ts +101 -0
  527. package/src/lib/model/crm-routes.js +92 -0
  528. package/src/lib/model/crm-routes.js.map +1 -0
  529. package/src/lib/model/crm-task-import.d.ts +94 -0
  530. package/src/lib/model/crm-task-import.js +275 -0
  531. package/src/lib/model/crm-task-import.js.map +1 -0
  532. package/src/lib/model/crm-view-param.d.ts +43 -0
  533. package/src/lib/model/crm-view-param.js +49 -0
  534. package/src/lib/model/crm-view-param.js.map +1 -0
  535. package/src/lib/model/deal-board-model.d.ts +241 -0
  536. package/src/lib/model/deal-board-model.js +439 -0
  537. package/src/lib/model/deal-board-model.js.map +1 -0
  538. package/src/lib/model/deal-form-model.d.ts +114 -0
  539. package/src/lib/model/deal-form-model.js +218 -0
  540. package/src/lib/model/deal-form-model.js.map +1 -0
  541. package/src/lib/model/deals-csv.d.ts +32 -0
  542. package/src/lib/model/deals-csv.js +37 -0
  543. package/src/lib/model/deals-csv.js.map +1 -0
  544. package/src/lib/model/import-column-shapes.d.ts +36 -0
  545. package/src/lib/model/import-column-shapes.js +76 -0
  546. package/src/lib/model/import-column-shapes.js.map +1 -0
  547. package/src/lib/model/lead-company-suggestion.d.ts +61 -0
  548. package/src/lib/model/lead-company-suggestion.js +65 -0
  549. package/src/lib/model/lead-company-suggestion.js.map +1 -0
  550. package/src/lib/model/lead-filters.d.ts +29 -0
  551. package/src/lib/model/lead-filters.js +39 -0
  552. package/src/lib/model/lead-filters.js.map +1 -0
  553. package/src/lib/model/lead-surfaces.d.ts +58 -0
  554. package/src/lib/model/lead-surfaces.js +67 -0
  555. package/src/lib/model/lead-surfaces.js.map +1 -0
  556. package/src/lib/model/leads-csv.d.ts +40 -0
  557. package/src/lib/model/leads-csv.js +40 -0
  558. package/src/lib/model/leads-csv.js.map +1 -0
  559. package/src/lib/model/next-activity-api.d.ts +31 -0
  560. package/src/lib/model/next-activity-api.js +57 -0
  561. package/src/lib/model/next-activity-api.js.map +1 -0
  562. package/src/lib/model/next-activity.d.ts +64 -0
  563. package/src/lib/model/next-activity.js +47 -0
  564. package/src/lib/model/next-activity.js.map +1 -0
  565. package/src/lib/model/person-key-web.d.ts +43 -0
  566. package/src/lib/model/person-key-web.js +52 -0
  567. package/src/lib/model/person-key-web.js.map +1 -0
  568. package/src/lib/model/record-facts.d.ts +282 -0
  569. package/src/lib/model/record-facts.js +434 -0
  570. package/src/lib/model/record-facts.js.map +1 -0
  571. package/src/lib/model/task-api.d.ts +28 -0
  572. package/src/lib/model/task-api.js +57 -0
  573. package/src/lib/model/task-api.js.map +1 -0
  574. package/src/lib/model/task-calendar.d.ts +108 -0
  575. package/src/lib/model/task-calendar.js +139 -0
  576. package/src/lib/model/task-calendar.js.map +1 -0
  577. package/src/lib/model/task-routes.d.ts +177 -0
  578. package/src/lib/model/task-routes.js +197 -0
  579. package/src/lib/model/task-routes.js.map +1 -0
  580. package/src/lib/model/task-scope.d.ts +45 -0
  581. package/src/lib/model/task-scope.js +51 -0
  582. package/src/lib/model/task-scope.js.map +1 -0
  583. package/src/lib/model/task-views.d.ts +149 -0
  584. package/src/lib/model/task-views.js +286 -0
  585. package/src/lib/model/task-views.js.map +1 -0
  586. package/src/lib/model/tasks-csv.d.ts +28 -0
  587. package/src/lib/model/tasks-csv.js +28 -0
  588. package/src/lib/model/tasks-csv.js.map +1 -0
  589. package/src/lib/plugin.d.ts +32 -0
  590. package/src/lib/plugin.js +208 -0
  591. package/src/lib/plugin.js.map +1 -0
  592. package/src/lib/server/companies-import.d.ts +57 -0
  593. package/src/lib/server/companies-import.js +242 -0
  594. package/src/lib/server/companies-import.js.map +1 -0
  595. package/src/lib/server/company-delete.d.ts +59 -0
  596. package/src/lib/server/company-delete.js +146 -0
  597. package/src/lib/server/company-delete.js.map +1 -0
  598. package/src/lib/server/contact-email-history.d.ts +82 -0
  599. package/src/lib/server/contact-email-history.js +264 -0
  600. package/src/lib/server/contact-email-history.js.map +1 -0
  601. package/src/lib/server/contact-profile.d.ts +41 -0
  602. package/src/lib/server/contact-profile.js +45 -0
  603. package/src/lib/server/contact-profile.js.map +1 -0
  604. package/src/lib/server/contact-update.d.ts +92 -0
  605. package/src/lib/server/contact-update.js +512 -0
  606. package/src/lib/server/contact-update.js.map +1 -0
  607. package/src/lib/server/contacts-import.d.ts +73 -0
  608. package/src/lib/server/contacts-import.js +263 -0
  609. package/src/lib/server/contacts-import.js.map +1 -0
  610. package/src/lib/server/contacts-merge.d.ts +86 -0
  611. package/src/lib/server/contacts-merge.js +206 -0
  612. package/src/lib/server/contacts-merge.js.map +1 -0
  613. package/src/lib/server/deals-import.d.ts +76 -0
  614. package/src/lib/server/deals-import.js +246 -0
  615. package/src/lib/server/deals-import.js.map +1 -0
  616. package/src/lib/server/email-send.d.ts +119 -0
  617. package/src/lib/server/email-send.js +667 -0
  618. package/src/lib/server/email-send.js.map +1 -0
  619. package/src/lib/server/email-template-duplicate.d.ts +19 -0
  620. package/src/lib/server/email-template-duplicate.js +206 -0
  621. package/src/lib/server/email-template-duplicate.js.map +1 -0
  622. package/src/lib/server/erase-person.d.ts +108 -0
  623. package/src/lib/server/erase-person.js +309 -0
  624. package/src/lib/server/erase-person.js.map +1 -0
  625. package/src/lib/server/import-context.d.ts +85 -0
  626. package/src/lib/server/import-context.js +181 -0
  627. package/src/lib/server/import-context.js.map +1 -0
  628. package/src/lib/server/inbound-address.d.ts +61 -0
  629. package/src/lib/server/inbound-address.js +188 -0
  630. package/src/lib/server/inbound-address.js.map +1 -0
  631. package/src/lib/server/lead-convert.d.ts +78 -0
  632. package/src/lib/server/lead-convert.js +250 -0
  633. package/src/lib/server/lead-convert.js.map +1 -0
  634. package/src/lib/server/leads-import.d.ts +84 -0
  635. package/src/lib/server/leads-import.js +261 -0
  636. package/src/lib/server/leads-import.js.map +1 -0
  637. package/src/lib/server/next-activity-routes.d.ts +33 -0
  638. package/src/lib/server/next-activity-routes.js +110 -0
  639. package/src/lib/server/next-activity-routes.js.map +1 -0
  640. package/src/lib/server/org-activity.d.ts +61 -0
  641. package/src/lib/server/org-activity.js +120 -0
  642. package/src/lib/server/org-activity.js.map +1 -0
  643. package/src/lib/server/org-caller.d.ts +110 -0
  644. package/src/lib/server/org-caller.js +154 -0
  645. package/src/lib/server/org-caller.js.map +1 -0
  646. package/src/lib/server/recipe-routes.d.ts +75 -0
  647. package/src/lib/server/recipe-routes.js +442 -0
  648. package/src/lib/server/recipe-routes.js.map +1 -0
  649. package/src/lib/server/record-facts.d.ts +65 -0
  650. package/src/lib/server/record-facts.js +337 -0
  651. package/src/lib/server/record-facts.js.map +1 -0
  652. package/src/lib/server/record-timeline.d.ts +51 -0
  653. package/src/lib/server/record-timeline.js +215 -0
  654. package/src/lib/server/record-timeline.js.map +1 -0
  655. package/src/lib/server/suite-gate.d.ts +42 -0
  656. package/src/lib/server/suite-gate.js +87 -0
  657. package/src/lib/server/suite-gate.js.map +1 -0
  658. package/src/lib/server/task-routes.d.ts +132 -0
  659. package/src/lib/server/task-routes.js +699 -0
  660. package/src/lib/server/task-routes.js.map +1 -0
  661. package/src/lib/server/tasks-import.d.ts +54 -0
  662. package/src/lib/server/tasks-import.js +157 -0
  663. package/src/lib/server/tasks-import.js.map +1 -0
  664. package/src/lib/server-deal-stage.d.ts +88 -0
  665. package/src/lib/server-deal-stage.js +316 -0
  666. package/src/lib/server-deal-stage.js.map +1 -0
  667. package/src/lib/server.d.ts +149 -0
  668. package/src/lib/server.js +615 -0
  669. package/src/lib/server.js.map +1 -0
@@ -0,0 +1,42 @@
1
+ import { type ConsentGroup } from '@aglyn/aglyn';
2
+ import type { ContactPick } from './contact-merge-dialog';
3
+ export interface ContactDuplicatesCardProps {
4
+ /** The record whose page this is. */
5
+ current: ContactPick;
6
+ /** `['orgs', orgId]` — where the contacts live. */
7
+ scope: readonly [string, string];
8
+ consentGroup: ConsentGroup;
9
+ /**
10
+ * What this viewer may list — the query's `array-contains-any` — or
11
+ * `null` at the organization level, where the query carries no clause
12
+ * (AGL-2630).
13
+ */
14
+ visibleTo: readonly string[] | null;
15
+ /** The hub's own path, for the link to a candidate's page. */
16
+ basePath: string;
17
+ /** Opens the merge dialog with the candidate picked. */
18
+ onMerge: (candidate: ContactPick) => void;
19
+ /**
20
+ * The org's plan lacks the CRM (AGL-2788). Looking stays drawn; each
21
+ * candidate's merge stands locked.
22
+ */
23
+ suiteLocked?: boolean;
24
+ }
25
+ /**
26
+ * LIKELY DUPLICATES (AGL-2625) — on ask, never on mount.
27
+ *
28
+ * One bounded read when the button is pressed: the contacts this viewer may
29
+ * list that carry the same normalized name, on the `(visibleTo, nameLower)`
30
+ * index the list's own search uses. The rule — same name AND a shared phone
31
+ * or company — is applied to that page, so a record with a different name
32
+ * is never offered; a reader who knows two differently-named records are
33
+ * one person merges them from the overflow menu instead.
34
+ *
35
+ * A button rather than a listener because the question costs a page of
36
+ * PII, and most record pages are opened by somebody who did not ask it.
37
+ */
38
+ export declare function ContactDuplicatesCard(props: ContactDuplicatesCardProps): import("react").JSX.Element;
39
+ export declare namespace ContactDuplicatesCard {
40
+ var displayName: string;
41
+ }
42
+ export default ContactDuplicatesCard;
@@ -0,0 +1,167 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { _ as _extends } from "@swc/helpers/_/_extends";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { contactDisplayName, pluginDocsHelp } from "@aglyn/aglyn";
20
+ import { AppLink, CardDisplay } from "@aglyn/shared-ui-jsx";
21
+ import { useFirestore } from "@aglyn/tenant-feature-instance";
22
+ import { Button, Chip, List, ListItem, ListItemText, Stack, Typography } from "@mui/material";
23
+ import { collection, getDocs, limit, query, where } from "firebase/firestore";
24
+ import { useCallback, useState } from "react";
25
+ import { crmVisibleToClause } from "../hooks/use-crm-scope.js";
26
+ import { crmRoutes } from "../model/crm-routes.js";
27
+ import { CONTACT_DUPLICATES_LIMIT, DUPLICATE_REASON_LABELS, duplicateNameKey, likelyDuplicateReasons } from "../model/contact-duplicates.js";
28
+ import { CrmSuiteLockedButton } from "./crm-suite-lock.js";
29
+ /**
30
+ * LIKELY DUPLICATES (AGL-2625) — on ask, never on mount.
31
+ *
32
+ * One bounded read when the button is pressed: the contacts this viewer may
33
+ * list that carry the same normalized name, on the `(visibleTo, nameLower)`
34
+ * index the list's own search uses. The rule — same name AND a shared phone
35
+ * or company — is applied to that page, so a record with a different name
36
+ * is never offered; a reader who knows two differently-named records are
37
+ * one person merges them from the overflow menu instead.
38
+ *
39
+ * A button rather than a listener because the question costs a page of
40
+ * PII, and most record pages are opened by somebody who did not ask it.
41
+ */ export function ContactDuplicatesCard(props) {
42
+ const { current, scope, consentGroup, visibleTo, basePath, onMerge, suiteLocked = false } = props;
43
+ const firestore = useFirestore();
44
+ const routes = crmRoutes(basePath);
45
+ const groupId = consentGroup.groupId;
46
+ const [candidates, setCandidates] = useState(null);
47
+ const [searching, setSearching] = useState(false);
48
+ const [error, setError] = useState(null);
49
+ const nameKey = duplicateNameKey(current.doc, groupId);
50
+ const find = useCallback(async ()=>{
51
+ if (searching || !nameKey) return;
52
+ setSearching(true);
53
+ setError(null);
54
+ try {
55
+ const found = await getDocs(query(collection(firestore, scope[0], scope[1], 'contacts'), ...crmVisibleToClause(visibleTo), where('nameLower', '==', nameKey), limit(CONTACT_DUPLICATES_LIMIT)));
56
+ setCandidates(found.docs.map((snapshot)=>({
57
+ id: snapshot.id,
58
+ doc: snapshot.data()
59
+ })).map((pick)=>_extends({}, pick, {
60
+ reasons: likelyDuplicateReasons(current, pick, groupId)
61
+ })).filter((pick)=>pick.reasons.length > 0));
62
+ } catch (findError) {
63
+ console.error(findError);
64
+ setCandidates(null);
65
+ setError('The duplicates could not be looked for.');
66
+ } finally{
67
+ setSearching(false);
68
+ }
69
+ }, [
70
+ searching,
71
+ nameKey,
72
+ firestore,
73
+ scope,
74
+ visibleTo,
75
+ current,
76
+ groupId
77
+ ]);
78
+ return /*#__PURE__*/ _jsx(CardDisplay, {
79
+ header: "Likely duplicates",
80
+ subheader: "Other records with this name and the same phone or company.",
81
+ help: pluginDocsHelp('contactRecord', {
82
+ anchor: '#likely-duplicates'
83
+ }),
84
+ contentGutterX: true,
85
+ contentGutterY: true,
86
+ HeaderProps: {
87
+ action: /*#__PURE__*/ _jsx(Button, {
88
+ size: "small",
89
+ variant: "outlined",
90
+ onClick: ()=>void find(),
91
+ disabled: searching || !nameKey,
92
+ children: searching ? 'Looking…' : 'Find likely duplicates'
93
+ })
94
+ },
95
+ children: !nameKey ? /*#__PURE__*/ _jsx(Typography, {
96
+ variant: "body2",
97
+ color: "text.secondary",
98
+ children: 'Give this contact a name first — duplicates are found by name.'
99
+ }) : error ? /*#__PURE__*/ _jsx(Typography, {
100
+ variant: "body2",
101
+ color: "error",
102
+ children: error
103
+ }) : candidates === null ? /*#__PURE__*/ _jsx(Typography, {
104
+ variant: "body2",
105
+ color: "text.secondary",
106
+ children: 'Not looked for yet. A record with a different name can still be ' + 'merged from the menu above.'
107
+ }) : candidates.length === 0 ? /*#__PURE__*/ _jsx(Typography, {
108
+ variant: "body2",
109
+ color: "text.secondary",
110
+ children: 'No likely duplicates among the contacts you can see.'
111
+ }) : /*#__PURE__*/ _jsx(List, {
112
+ dense: true,
113
+ disablePadding: true,
114
+ "aria-label": "Likely duplicates",
115
+ children: candidates.map((candidate)=>{
116
+ var _candidate_doc_email, _candidate_doc_email1;
117
+ return /*#__PURE__*/ _jsx(ListItem, {
118
+ disableGutters: true,
119
+ secondaryAction: suiteLocked ? /*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
120
+ children: 'Merge into this record'
121
+ }) : /*#__PURE__*/ _jsx(Button, {
122
+ size: "small",
123
+ onClick: ()=>onMerge(candidate),
124
+ children: 'Merge into this record'
125
+ }),
126
+ children: /*#__PURE__*/ _jsx(ListItemText, {
127
+ primary: /*#__PURE__*/ _jsx(AppLink, {
128
+ href: routes.contact(candidate.id),
129
+ color: "inherit",
130
+ underline: "hover",
131
+ children: contactDisplayName(candidate.doc, groupId) || String((_candidate_doc_email = candidate.doc['email']) != null ? _candidate_doc_email : candidate.id)
132
+ }),
133
+ secondary: /*#__PURE__*/ _jsxs(Stack, {
134
+ component: "span",
135
+ direction: "row",
136
+ spacing: 1,
137
+ sx: {
138
+ alignItems: 'center',
139
+ flexWrap: 'wrap',
140
+ rowGap: 0.5
141
+ },
142
+ children: [
143
+ /*#__PURE__*/ _jsx("span", {
144
+ children: String((_candidate_doc_email1 = candidate.doc['email']) != null ? _candidate_doc_email1 : '')
145
+ }),
146
+ candidate.reasons.map((reason)=>/*#__PURE__*/ _jsx(Chip, {
147
+ size: "small",
148
+ variant: "outlined",
149
+ label: DUPLICATE_REASON_LABELS[reason]
150
+ }, reason))
151
+ ]
152
+ }),
153
+ slotProps: {
154
+ secondary: {
155
+ component: 'div'
156
+ }
157
+ }
158
+ })
159
+ }, candidate.id);
160
+ })
161
+ })
162
+ });
163
+ }
164
+ ContactDuplicatesCard.displayName = 'ContactDuplicatesCard';
165
+ export default ContactDuplicatesCard;
166
+
167
+ //# sourceMappingURL=contact-duplicates-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contact-duplicates-card.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { type ConsentGroup, contactDisplayName, pluginDocsHelp } from '@aglyn/aglyn'\nimport { AppLink, CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { useFirestore } from '@aglyn/tenant-feature-instance'\nimport {\n Button,\n Chip,\n List,\n ListItem,\n ListItemText,\n Stack,\n Typography,\n} from '@mui/material'\nimport { collection, getDocs, limit, query, where } from 'firebase/firestore'\nimport { useCallback, useState } from 'react'\nimport { crmVisibleToClause } from '../hooks/use-crm-scope'\nimport { crmRoutes } from '../model/crm-routes'\nimport {\n CONTACT_DUPLICATES_LIMIT,\n DUPLICATE_REASON_LABELS,\n type DuplicateReason,\n duplicateNameKey,\n likelyDuplicateReasons,\n} from '../model/contact-duplicates'\nimport type { ContactPick } from './contact-merge-dialog'\nimport { CrmSuiteLockedButton } from './crm-suite-lock'\n\nexport interface ContactDuplicatesCardProps {\n /** The record whose page this is. */\n current: ContactPick\n /** `['orgs', orgId]` — where the contacts live. */\n scope: readonly [string, string]\n consentGroup: ConsentGroup\n /**\n * What this viewer may list — the query's `array-contains-any` — or\n * `null` at the organization level, where the query carries no clause\n * (AGL-2630).\n */\n visibleTo: readonly string[] | null\n /** The hub's own path, for the link to a candidate's page. */\n basePath: string\n /** Opens the merge dialog with the candidate picked. */\n onMerge: (candidate: ContactPick) => void\n /**\n * The org's plan lacks the CRM (AGL-2788). Looking stays drawn; each\n * candidate's merge stands locked.\n */\n suiteLocked?: boolean\n}\n\ninterface Candidate extends ContactPick {\n reasons: DuplicateReason[]\n}\n\n/**\n * LIKELY DUPLICATES (AGL-2625) — on ask, never on mount.\n *\n * One bounded read when the button is pressed: the contacts this viewer may\n * list that carry the same normalized name, on the `(visibleTo, nameLower)`\n * index the list's own search uses. The rule — same name AND a shared phone\n * or company — is applied to that page, so a record with a different name\n * is never offered; a reader who knows two differently-named records are\n * one person merges them from the overflow menu instead.\n *\n * A button rather than a listener because the question costs a page of\n * PII, and most record pages are opened by somebody who did not ask it.\n */\nexport function ContactDuplicatesCard(props: ContactDuplicatesCardProps) {\n const {\n current,\n scope,\n consentGroup,\n visibleTo,\n basePath,\n onMerge,\n suiteLocked = false,\n } = props\n const firestore = useFirestore()\n const routes = crmRoutes(basePath)\n const groupId = consentGroup.groupId\n const [candidates, setCandidates] = useState<Candidate[] | null>(null)\n const [searching, setSearching] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const nameKey = duplicateNameKey(current.doc, groupId)\n\n const find = useCallback(async () => {\n if (searching || !nameKey) return\n setSearching(true)\n setError(null)\n try {\n const found = await getDocs(\n query(\n collection(firestore, scope[0], scope[1], 'contacts'),\n ...crmVisibleToClause(visibleTo),\n where('nameLower', '==', nameKey),\n limit(CONTACT_DUPLICATES_LIMIT),\n ),\n )\n setCandidates(\n found.docs\n .map((snapshot) => ({ id: snapshot.id, doc: snapshot.data() }))\n .map((pick) => ({\n ...pick,\n reasons: likelyDuplicateReasons(current, pick, groupId),\n }))\n .filter((pick) => pick.reasons.length > 0),\n )\n } catch (findError) {\n console.error(findError)\n setCandidates(null)\n setError('The duplicates could not be looked for.')\n } finally {\n setSearching(false)\n }\n }, [searching, nameKey, firestore, scope, visibleTo, current, groupId])\n\n return (\n <CardDisplay\n header=\"Likely duplicates\"\n subheader=\"Other records with this name and the same phone or company.\"\n help={pluginDocsHelp('contactRecord', { anchor: '#likely-duplicates' })}\n contentGutterX\n contentGutterY\n HeaderProps={{\n action: (\n <Button\n size=\"small\"\n variant=\"outlined\"\n onClick={() => void find()}\n disabled={searching || !nameKey}\n >\n {searching ? 'Looking…' : 'Find likely duplicates'}\n </Button>\n ),\n }}\n >\n {!nameKey ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Give this contact a name first — duplicates are found by name.'}\n </Typography>\n ) : error ? (\n <Typography variant=\"body2\" color=\"error\">\n {error}\n </Typography>\n ) : candidates === null ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Not looked for yet. A record with a different name can still be ' +\n 'merged from the menu above.'}\n </Typography>\n ) : candidates.length === 0 ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'No likely duplicates among the contacts you can see.'}\n </Typography>\n ) : (\n <List dense disablePadding aria-label=\"Likely duplicates\">\n {candidates.map((candidate) => (\n <ListItem\n key={candidate.id}\n disableGutters\n secondaryAction={\n suiteLocked ? (\n <CrmSuiteLockedButton>{'Merge into this record'}</CrmSuiteLockedButton>\n ) : (\n <Button size=\"small\" onClick={() => onMerge(candidate)}>\n {'Merge into this record'}\n </Button>\n )\n }\n >\n <ListItemText\n primary={\n <AppLink href={routes.contact(candidate.id)} color=\"inherit\" underline=\"hover\">\n {contactDisplayName(candidate.doc, groupId) ||\n String(candidate.doc['email'] ?? candidate.id)}\n </AppLink>\n }\n secondary={\n <Stack\n component=\"span\"\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center', flexWrap: 'wrap', rowGap: 0.5 }}\n >\n <span>{String(candidate.doc['email'] ?? '')}</span>\n {candidate.reasons.map((reason) => (\n <Chip\n key={reason}\n size=\"small\"\n variant=\"outlined\"\n label={DUPLICATE_REASON_LABELS[reason]}\n />\n ))}\n </Stack>\n }\n slotProps={{ secondary: { component: 'div' } }}\n />\n </ListItem>\n ))}\n </List>\n )}\n </CardDisplay>\n )\n}\nContactDuplicatesCard.displayName = 'ContactDuplicatesCard'\n\nexport default ContactDuplicatesCard\n"],"names":["contactDisplayName","pluginDocsHelp","AppLink","CardDisplay","useFirestore","Button","Chip","List","ListItem","ListItemText","Stack","Typography","collection","getDocs","limit","query","where","useCallback","useState","crmVisibleToClause","crmRoutes","CONTACT_DUPLICATES_LIMIT","DUPLICATE_REASON_LABELS","duplicateNameKey","likelyDuplicateReasons","CrmSuiteLockedButton","ContactDuplicatesCard","props","current","scope","consentGroup","visibleTo","basePath","onMerge","suiteLocked","firestore","routes","groupId","candidates","setCandidates","searching","setSearching","error","setError","nameKey","doc","find","found","docs","map","snapshot","id","data","pick","reasons","filter","length","findError","console","header","subheader","help","anchor","contentGutterX","contentGutterY","HeaderProps","action","size","variant","onClick","disabled","color","dense","disablePadding","aria-label","candidate","disableGutters","secondaryAction","primary","href","contact","underline","String","secondary","component","direction","spacing","sx","alignItems","flexWrap","rowGap","span","reason","label","slotProps","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAA4BA,kBAAkB,EAAEC,cAAc,QAAQ,eAAc;AACpF,SAASC,OAAO,EAAEC,WAAW,QAAQ,uBAAsB;AAC3D,SAASC,YAAY,QAAQ,iCAAgC;AAC7D,SACEC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,YAAY,EACZC,KAAK,EACLC,UAAU,QACL,gBAAe;AACtB,SAASC,UAAU,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAQ,qBAAoB;AAC7E,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAO;AAC7C,SAASC,kBAAkB,QAAQ,4BAAwB;AAC3D,SAASC,SAAS,QAAQ,yBAAqB;AAC/C,SACEC,wBAAwB,EACxBC,uBAAuB,EAEvBC,gBAAgB,EAChBC,sBAAsB,QACjB,iCAA6B;AAEpC,SAASC,oBAAoB,QAAQ,sBAAkB;AA6BvD;;;;;;;;;;;;CAYC,GACD,OAAO,SAASC,sBAAsBC,KAAiC;IACrE,MAAM,EACJC,OAAO,EACPC,KAAK,EACLC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACPC,cAAc,KAAK,EACpB,GAAGP;IACJ,MAAMQ,YAAY/B;IAClB,MAAMgC,SAAShB,UAAUY;IACzB,MAAMK,UAAUP,aAAaO,O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C,eAAerE,sBAAqB"}
@@ -0,0 +1,64 @@
1
+ import { type ContactFieldType, type CrmFieldObject } from '@aglyn/aglyn';
2
+ import type { ContactFieldDefinitionDoc } from '../hooks/use-contact-field-definitions';
3
+ /** What the drawer hands back — the definition's editable half. */
4
+ export interface ContactFieldDraft {
5
+ label: string;
6
+ key: string;
7
+ type: ContactFieldType;
8
+ /** The choices, for `select`; empty for every other type. */
9
+ options: string[];
10
+ required: boolean;
11
+ }
12
+ export interface ContactFieldDrawerProps {
13
+ open: boolean;
14
+ onClose: () => void;
15
+ /** The definition being edited, or `null` to create one. */
16
+ definition: ContactFieldDefinitionDoc | null;
17
+ /**
18
+ * Every key the org has already used, retired ones included. A key is
19
+ * the map key values are stored under, so a retired field's key is still
20
+ * taken: a new field reusing it would read the old values back as its own.
21
+ */
22
+ takenKeys: readonly string[];
23
+ /** Receives the draft; closing on success is the caller's job. */
24
+ onSubmit: (draft: ContactFieldDraft) => Promise<void> | void;
25
+ /**
26
+ * The record the field describes (AGL-2661) — the Fields section's
27
+ * current tab. Contacts when unsaid. The drawer's copy follows it, and it
28
+ * is the one thing here a form-field mapping cares about: a website form
29
+ * saves into a CONTACT field only, because a submission is a fact about
30
+ * a person, so the other objects' drawers say so instead of offering it.
31
+ */
32
+ object?: CrmFieldObject;
33
+ }
34
+ /**
35
+ * What the drawer says about website forms, per object — see
36
+ * {@link ContactFieldDrawerProps.object}.
37
+ */
38
+ export declare function fieldDrawerMappingNote(object: CrmFieldObject): string;
39
+ /**
40
+ * The one form a custom contact field is created and edited through
41
+ * (AGL-2601).
42
+ *
43
+ * ## The key follows the label until the author takes it over
44
+ *
45
+ * A merchant types "Annual revenue" and should not have to know that the
46
+ * value is stored under `annual_revenue`. So the key is derived from the
47
+ * label as they type — `normalizeContactFieldKey` — and shown beside it, and
48
+ * only becomes the author's own the moment they edit it. That is the whole
49
+ * of the grammar they are asked to learn, and the field is still there for
50
+ * the author who wants `arr` instead.
51
+ *
52
+ * ## Two things do not change after creation
53
+ *
54
+ * The KEY is the map key every value is stored under, so changing it would
55
+ * orphan every value already written; the TYPE is what every reader coerces
56
+ * those values by, so changing it would make them unreadable. Both are
57
+ * disabled on an existing field and say why. A rename is a new field and a
58
+ * retire, which the section's list offers.
59
+ */
60
+ export declare function ContactFieldDrawer(props: ContactFieldDrawerProps): import("react").JSX.Element;
61
+ export declare namespace ContactFieldDrawer {
62
+ var displayName: string;
63
+ }
64
+ export default ContactFieldDrawer;
@@ -0,0 +1,251 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { CONTACT_FIELD_TYPE_LABELS, CONTACT_FIELD_TYPES, isContactFieldType, normalizeContactFieldKey } from "@aglyn/aglyn";
19
+ import { Button, Drawer, FormControlLabel, MenuItem, Stack, Switch, TextField, Typography } from "@mui/material";
20
+ import { useCallback, useEffect, useMemo, useState } from "react";
21
+ /** How the object reads in the drawer's own sentences — singular, lowercase. */ const OBJECT_NOUN = {
22
+ contact: 'contact',
23
+ company: 'company',
24
+ deal: 'deal'
25
+ };
26
+ /**
27
+ * What the drawer says about website forms, per object — see
28
+ * {@link ContactFieldDrawerProps.object}.
29
+ */ export function fieldDrawerMappingNote(object) {
30
+ return object === 'contact' ? 'A website form field can save its answer into this field.' : `A website form field saves into contact fields only; a ${OBJECT_NOUN[object]} ` + 'field is filled on the record, by CSV import or over the API.';
31
+ }
32
+ /** How many choices a select may declare, and how long each may be. */ const OPTIONS_MAX = 50;
33
+ const OPTION_MAX_LENGTH = 120;
34
+ const LABEL_MAX_LENGTH = 80;
35
+ /** One choice per line, trimmed, blanks dropped, duplicates collapsed. */ function parseOptions(text) {
36
+ const seen = new Set();
37
+ const options = [];
38
+ for (const line of text.split('\n')){
39
+ const option = line.trim().slice(0, OPTION_MAX_LENGTH);
40
+ if (!option || seen.has(option)) continue;
41
+ seen.add(option);
42
+ options.push(option);
43
+ if (options.length >= OPTIONS_MAX) break;
44
+ }
45
+ return options;
46
+ }
47
+ /**
48
+ * The one form a custom contact field is created and edited through
49
+ * (AGL-2601).
50
+ *
51
+ * ## The key follows the label until the author takes it over
52
+ *
53
+ * A merchant types "Annual revenue" and should not have to know that the
54
+ * value is stored under `annual_revenue`. So the key is derived from the
55
+ * label as they type — `normalizeContactFieldKey` — and shown beside it, and
56
+ * only becomes the author's own the moment they edit it. That is the whole
57
+ * of the grammar they are asked to learn, and the field is still there for
58
+ * the author who wants `arr` instead.
59
+ *
60
+ * ## Two things do not change after creation
61
+ *
62
+ * The KEY is the map key every value is stored under, so changing it would
63
+ * orphan every value already written; the TYPE is what every reader coerces
64
+ * those values by, so changing it would make them unreadable. Both are
65
+ * disabled on an existing field and say why. A rename is a new field and a
66
+ * retire, which the section's list offers.
67
+ */ export function ContactFieldDrawer(props) {
68
+ const { open, onClose, definition, takenKeys, onSubmit, object = 'contact' } = props;
69
+ const editing = Boolean(definition);
70
+ const noun = OBJECT_NOUN[object];
71
+ const [label, setLabel] = useState('');
72
+ const [key, setKey] = useState('');
73
+ const [keyTouched, setKeyTouched] = useState(false);
74
+ const [type, setType] = useState('text');
75
+ const [optionsText, setOptionsText] = useState('');
76
+ const [required, setRequired] = useState(false);
77
+ const [busy, setBusy] = useState(false);
78
+ const [error, setError] = useState(null);
79
+ // Seeded on every open, from the definition when there is one: a drawer
80
+ // that kept the previous field's draft would offer it as the next one.
81
+ useEffect(()=>{
82
+ var _ref, _ref1, _ref2, _ref3;
83
+ if (!open) return;
84
+ setLabel((_ref = definition == null ? void 0 : definition.label) != null ? _ref : '');
85
+ setKey((_ref1 = definition == null ? void 0 : definition.key) != null ? _ref1 : '');
86
+ setKeyTouched(Boolean(definition));
87
+ setType((_ref2 = definition == null ? void 0 : definition.type) != null ? _ref2 : 'text');
88
+ setOptionsText(((_ref3 = definition == null ? void 0 : definition.options) != null ? _ref3 : []).join('\n'));
89
+ setRequired((definition == null ? void 0 : definition.required) === true);
90
+ setBusy(false);
91
+ setError(null);
92
+ }, [
93
+ open,
94
+ definition
95
+ ]);
96
+ const derivedKey = useMemo(()=>keyTouched ? normalizeContactFieldKey(key) : normalizeContactFieldKey(label), [
97
+ keyTouched,
98
+ key,
99
+ label
100
+ ]);
101
+ const shownKey = keyTouched ? key : derivedKey != null ? derivedKey : '';
102
+ const keyTaken = !editing && derivedKey != null && takenKeys.includes(derivedKey);
103
+ const options = useMemo(()=>parseOptions(optionsText), [
104
+ optionsText
105
+ ]);
106
+ const keyHelp = editing ? 'Values are stored under this key, so it cannot change once the field exists.' : keyTaken ? 'That key is already in use — a retired field keeps its key.' : shownKey && !derivedKey ? 'A key starts with a letter and uses letters, digits and underscores.' : 'Derived from the label; edit it to choose your own.';
107
+ const canSubmit = !busy && label.trim().length > 0 && derivedKey != null && !keyTaken && (type !== 'select' || options.length > 0);
108
+ const handleSubmit = useCallback(async ()=>{
109
+ if (!canSubmit || derivedKey == null) return;
110
+ setBusy(true);
111
+ setError(null);
112
+ try {
113
+ await onSubmit({
114
+ label: label.trim().slice(0, LABEL_MAX_LENGTH),
115
+ key: derivedKey,
116
+ type,
117
+ options: type === 'select' ? options : [],
118
+ required
119
+ });
120
+ } catch (caught) {
121
+ console.error(caught);
122
+ setError('Could not save the field. Try again.');
123
+ } finally{
124
+ setBusy(false);
125
+ }
126
+ }, [
127
+ canSubmit,
128
+ derivedKey,
129
+ onSubmit,
130
+ label,
131
+ type,
132
+ options,
133
+ required
134
+ ]);
135
+ return /*#__PURE__*/ _jsx(Drawer, {
136
+ anchor: "right",
137
+ open: open,
138
+ onClose: onClose,
139
+ children: /*#__PURE__*/ _jsxs(Stack, {
140
+ spacing: 2,
141
+ sx: {
142
+ width: 360,
143
+ p: 3
144
+ },
145
+ children: [
146
+ /*#__PURE__*/ _jsx(Typography, {
147
+ variant: "h6",
148
+ children: editing ? `Edit ${noun} field` : `New ${noun} field`
149
+ }),
150
+ /*#__PURE__*/ _jsx(Typography, {
151
+ variant: "body2",
152
+ color: "text.secondary",
153
+ children: fieldDrawerMappingNote(object)
154
+ }),
155
+ /*#__PURE__*/ _jsx(TextField, {
156
+ size: "small",
157
+ label: "Label",
158
+ value: label,
159
+ onChange: (event)=>setLabel(event.target.value),
160
+ slotProps: {
161
+ htmlInput: {
162
+ maxLength: LABEL_MAX_LENGTH
163
+ }
164
+ },
165
+ autoFocus: !editing,
166
+ fullWidth: true
167
+ }),
168
+ /*#__PURE__*/ _jsx(TextField, {
169
+ size: "small",
170
+ label: "Key",
171
+ value: shownKey,
172
+ onChange: (event)=>{
173
+ setKeyTouched(true);
174
+ setKey(event.target.value);
175
+ },
176
+ disabled: editing,
177
+ error: !editing && (keyTaken || shownKey.length > 0 && !derivedKey),
178
+ helperText: keyHelp,
179
+ slotProps: {
180
+ htmlInput: {
181
+ maxLength: 40,
182
+ spellCheck: false
183
+ }
184
+ },
185
+ fullWidth: true
186
+ }),
187
+ /*#__PURE__*/ _jsx(TextField, {
188
+ select: true,
189
+ size: "small",
190
+ label: "Type",
191
+ value: type,
192
+ onChange: (event)=>{
193
+ const next = event.target.value;
194
+ if (isContactFieldType(next)) setType(next);
195
+ },
196
+ disabled: editing,
197
+ helperText: editing ? 'Values are read by type, so it is fixed once the field exists.' : undefined,
198
+ fullWidth: true,
199
+ children: CONTACT_FIELD_TYPES.map((option)=>/*#__PURE__*/ _jsx(MenuItem, {
200
+ value: option,
201
+ children: CONTACT_FIELD_TYPE_LABELS[option]
202
+ }, option))
203
+ }),
204
+ type === 'select' ? /*#__PURE__*/ _jsx(TextField, {
205
+ size: "small",
206
+ label: "Choices",
207
+ value: optionsText,
208
+ onChange: (event)=>setOptionsText(event.target.value),
209
+ helperText: "One per line. A stored value has to be one of these.",
210
+ multiline: true,
211
+ minRows: 3,
212
+ fullWidth: true
213
+ }) : null,
214
+ /*#__PURE__*/ _jsx(FormControlLabel, {
215
+ control: /*#__PURE__*/ _jsx(Switch, {
216
+ checked: required,
217
+ onChange: (event)=>setRequired(event.target.checked)
218
+ }),
219
+ label: `Required on the ${noun} form`
220
+ }),
221
+ error ? /*#__PURE__*/ _jsx(Typography, {
222
+ variant: "body2",
223
+ color: "error",
224
+ children: error
225
+ }) : null,
226
+ /*#__PURE__*/ _jsxs(Stack, {
227
+ direction: "row",
228
+ spacing: 1,
229
+ children: [
230
+ /*#__PURE__*/ _jsx(Button, {
231
+ variant: "contained",
232
+ color: "primary",
233
+ disabled: !canSubmit,
234
+ onClick: handleSubmit,
235
+ children: editing ? 'Save' : 'Create field'
236
+ }),
237
+ /*#__PURE__*/ _jsx(Button, {
238
+ onClick: onClose,
239
+ disabled: busy,
240
+ children: 'Cancel'
241
+ })
242
+ ]
243
+ })
244
+ ]
245
+ })
246
+ });
247
+ }
248
+ ContactFieldDrawer.displayName = 'ContactFieldDrawer';
249
+ export default ContactFieldDrawer;
250
+
251
+ //# sourceMappingURL=contact-field-drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contact-field-drawer.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n CONTACT_FIELD_TYPE_LABELS,\n CONTACT_FIELD_TYPES,\n type ContactFieldType,\n type CrmFieldObject,\n isContactFieldType,\n normalizeContactFieldKey,\n} from '@aglyn/aglyn'\nimport {\n Button,\n Drawer,\n FormControlLabel,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport type { ContactFieldDefinitionDoc } from '../hooks/use-contact-field-definitions'\n\n/** What the drawer hands back — the definition's editable half. */\nexport interface ContactFieldDraft {\n label: string\n key: string\n type: ContactFieldType\n /** The choices, for `select`; empty for every other type. */\n options: string[]\n required: boolean\n}\n\nexport interface ContactFieldDrawerProps {\n open: boolean\n onClose: () => void\n /** The definition being edited, or `null` to create one. */\n definition: ContactFieldDefinitionDoc | null\n /**\n * Every key the org has already used, retired ones included. A key is\n * the map key values are stored under, so a retired field's key is still\n * taken: a new field reusing it would read the old values back as its own.\n */\n takenKeys: readonly string[]\n /** Receives the draft; closing on success is the caller's job. */\n onSubmit: (draft: ContactFieldDraft) => Promise<void> | void\n /**\n * The record the field describes (AGL-2661) — the Fields section's\n * current tab. Contacts when unsaid. The drawer's copy follows it, and it\n * is the one thing here a form-field mapping cares about: a website form\n * saves into a CONTACT field only, because a submission is a fact about\n * a person, so the other objects' drawers say so instead of offering it.\n */\n object?: CrmFieldObject\n}\n\n/** How the object reads in the drawer's own sentences — singular, lowercase. */\nconst OBJECT_NOUN: Record<CrmFieldObject, string> = {\n contact: 'contact',\n company: 'company',\n deal: 'deal',\n}\n\n/**\n * What the drawer says about website forms, per object — see\n * {@link ContactFieldDrawerProps.object}.\n */\nexport function fieldDrawerMappingNote(object: CrmFieldObject): string {\n return object === 'contact'\n ? 'A website form field can save its answer into this field.'\n : `A website form field saves into contact fields only; a ${OBJECT_NOUN[object]} ` +\n 'field is filled on the record, by CSV import or over the API.'\n}\n\n/** How many choices a select may declare, and how long each may be. */\nconst OPTIONS_MAX = 50\nconst OPTION_MAX_LENGTH = 120\nconst LABEL_MAX_LENGTH = 80\n\n/** One choice per line, trimmed, blanks dropped, duplicates collapsed. */\nfunction parseOptions(text: string): string[] {\n const seen = new Set<string>()\n const options: string[] = []\n for (const line of text.split('\\n')) {\n const option = line.trim().slice(0, OPTION_MAX_LENGTH)\n if (!option || seen.has(option)) continue\n seen.add(option)\n options.push(option)\n if (options.length >= OPTIONS_MAX) break\n }\n return options\n}\n\n/**\n * The one form a custom contact field is created and edited through\n * (AGL-2601).\n *\n * ## The key follows the label until the author takes it over\n *\n * A merchant types \"Annual revenue\" and should not have to know that the\n * value is stored under `annual_revenue`. So the key is derived from the\n * label as they type — `normalizeContactFieldKey` — and shown beside it, and\n * only becomes the author's own the moment they edit it. That is the whole\n * of the grammar they are asked to learn, and the field is still there for\n * the author who wants `arr` instead.\n *\n * ## Two things do not change after creation\n *\n * The KEY is the map key every value is stored under, so changing it would\n * orphan every value already written; the TYPE is what every reader coerces\n * those values by, so changing it would make them unreadable. Both are\n * disabled on an existing field and say why. A rename is a new field and a\n * retire, which the section's list offers.\n */\nexport function ContactFieldDrawer(props: ContactFieldDrawerProps) {\n const { open, onClose, definition, takenKeys, onSubmit, object = 'contact' } = props\n const editing = Boolean(definition)\n const noun = OBJECT_NOUN[object]\n\n const [label, setLabel] = useState('')\n const [key, setKey] = useState('')\n const [keyTouched, setKeyTouched] = useState(false)\n const [type, setType] = useState<ContactFieldType>('text')\n const [optionsText, setOptionsText] = useState('')\n const [required, setRequired] = useState(false)\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n // Seeded on every open, from the definition when there is one: a drawer\n // that kept the previous field's draft would offer it as the next one.\n useEffect(() => {\n if (!open) return\n setLabel(definition?.label ?? '')\n setKey(definition?.key ?? '')\n setKeyTouched(Boolean(definition))\n setType(definition?.type ?? 'text')\n setOptionsText((definition?.options ?? []).join('\\n'))\n setRequired(definition?.required === true)\n setBusy(false)\n setError(null)\n }, [open, definition])\n\n const derivedKey = useMemo(\n () => (keyTouched ? normalizeContactFieldKey(key) : normalizeContactFieldKey(label)),\n [keyTouched, key, label],\n )\n const shownKey = keyTouched ? key : (derivedKey ?? '')\n const keyTaken =\n !editing && derivedKey != null && takenKeys.includes(derivedKey)\n const options = useMemo(() => parseOptions(optionsText), [optionsText])\n\n const keyHelp = editing\n ? 'Values are stored under this key, so it cannot change once the field exists.'\n : keyTaken\n ? 'That key is already in use — a retired field keeps its key.'\n : shownKey && !derivedKey\n ? 'A key starts with a letter and uses letters, digits and underscores.'\n : 'Derived from the label; edit it to choose your own.'\n\n const canSubmit =\n !busy &&\n label.trim().length > 0 &&\n derivedKey != null &&\n !keyTaken &&\n (type !== 'select' || options.length > 0)\n\n const handleSubmit = useCallback(async () => {\n if (!canSubmit || derivedKey == null) return\n setBusy(true)\n setError(null)\n try {\n await onSubmit({\n label: label.trim().slice(0, LABEL_MAX_LENGTH),\n key: derivedKey,\n type,\n options: type === 'select' ? options : [],\n required,\n })\n } catch (caught) {\n console.error(caught)\n setError('Could not save the field. Try again.')\n } finally {\n setBusy(false)\n }\n }, [canSubmit, derivedKey, onSubmit, label, type, options, required])\n\n return (\n <Drawer anchor=\"right\" open={open} onClose={onClose}>\n <Stack spacing={2} sx={{ width: 360, p: 3 }}>\n <Typography variant=\"h6\">\n {editing ? `Edit ${noun} field` : `New ${noun} field`}\n </Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {fieldDrawerMappingNote(object)}\n </Typography>\n <TextField\n size=\"small\"\n label=\"Label\"\n value={label}\n onChange={(event) => setLabel(event.target.value)}\n slotProps={{ htmlInput: { maxLength: LABEL_MAX_LENGTH } }}\n autoFocus={!editing}\n fullWidth\n />\n <TextField\n size=\"small\"\n label=\"Key\"\n value={shownKey}\n onChange={(event) => {\n setKeyTouched(true)\n setKey(event.target.value)\n }}\n disabled={editing}\n error={!editing && (keyTaken || (shownKey.length > 0 && !derivedKey))}\n helperText={keyHelp}\n slotProps={{ htmlInput: { maxLength: 40, spellCheck: false } }}\n fullWidth\n />\n <TextField\n select\n size=\"small\"\n label=\"Type\"\n value={type}\n onChange={(event) => {\n const next = event.target.value\n if (isContactFieldType(next)) setType(next)\n }}\n disabled={editing}\n helperText={\n editing\n ? 'Values are read by type, so it is fixed once the field exists.'\n : undefined\n }\n fullWidth\n >\n {CONTACT_FIELD_TYPES.map((option) => (\n <MenuItem key={option} value={option}>\n {CONTACT_FIELD_TYPE_LABELS[option]}\n </MenuItem>\n ))}\n </TextField>\n {type === 'select' ? (\n <TextField\n size=\"small\"\n label=\"Choices\"\n value={optionsText}\n onChange={(event) => setOptionsText(event.target.value)}\n helperText=\"One per line. A stored value has to be one of these.\"\n multiline\n minRows={3}\n fullWidth\n />\n ) : null}\n <FormControlLabel\n control={\n <Switch\n checked={required}\n onChange={(event) => setRequired(event.target.checked)}\n />\n }\n label={`Required on the ${noun} form`}\n />\n {error ? (\n <Typography variant=\"body2\" color=\"error\">\n {error}\n </Typography>\n ) : null}\n <Stack direction=\"row\" spacing={1}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={!canSubmit}\n onClick={handleSubmit}\n >\n {editing ? 'Save' : 'Create field'}\n </Button>\n <Button onClick={onClose} disabled={busy}>\n {'Cancel'}\n </Button>\n </Stack>\n </Stack>\n </Drawer>\n )\n}\nContactFieldDrawer.displayName = 'ContactFieldDrawer'\n\nexport default ContactFieldDrawer\n"],"names":["CONTACT_FIELD_TYPE_LABELS","CONTACT_FIELD_TYPES","isContactFieldType","normalizeContactFieldKey","Button","Drawer","FormControlLabel","MenuItem","Stack","Switch","TextField","Typography","useCallback","useEffect","useMemo","useState","OBJECT_NOUN","contact","company","deal","fieldDrawerMappingNote","object","OPTIONS_MAX","OPTION_MAX_LENGTH","LABEL_MAX_LENGTH","parseOptions","text","seen","Set","options","line","split","option","trim","slice","has","add","push","length","ContactFieldDrawer","props","open","onClose","definition","takenKeys","onSubmit","editing","Boolean","noun","label","setLabel","key","setKey","keyTouched","setKeyTouched","type","setType","optionsText","setOptionsText","required","setRequired","busy","setBusy","error","setError","join","derivedKey","shownKey","keyTaken","includes","keyHelp","canSubmit","handleSubmit","caught","console","anchor","spacing","sx","width","p","variant","color","size","value","onChange","event","target","slotProps","htmlInput","maxLength","autoFocus","fullWidth","disabled","helperText","spellCheck","select","next","undefined","map","multiline","minRows","control","checked","direction","onClick","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SACEA,yBAAyB,EACzBC,mBAAmB,EAGnBC,kBAAkB,EAClBC,wBAAwB,QACnB,eAAc;AACrB,SACEC,MAAM,EACNC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,EACRC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AAoCjE,8EAA8E,GAC9E,MAAMC,cAA8C;IAClDC,SAAS;IACTC,SAAS;IACTC,MAAM;AACR;AAEA;;;CAGC,GACD,OAAO,SAASC,uBAAuBC,MAAsB;IAC3D,OAAOA,WAAW,YACd,8DACA,CAAC,uDAAuD,EAAEL,WAAW,CAACK,OAAO,CAAC,CAAC,CAAC,GAC9E;AACR;AAEA,qEAAqE,GACrE,MAAMC,cAAc;AACpB,MAAMC,oBAAoB;AAC1B,MAAMC,mBAAmB;AAEzB,wEAAwE,GACxE,SAASC,aAAaC,IAAY;IAChC,MAAMC,OAAO,IAAIC;IACjB,MAAMC,UAAoB,EAAE;IAC5B,KAAK,MAAMC,QAAQJ,KAAKK,KAAK,CAAC,MAAO;QACnC,MAAMC,SAASF,KAAKG,IAAI,GAAGC,KAAK,CAAC,GAAGX;QACpC,IAAI,CAACS,UAAUL,KAAKQ,GAAG,CAACH,SAAS;QACjCL,KAAKS,GAAG,CAACJ;QACTH,QAAQQ,IAAI,CAACL;QACb,IAAIH,QAAQS,MAAM,IAAIhB,aAAa;IACrC;IACA,OAAOO;AACT;AAEA;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M;8BAC/BlB;qBAED;8BACJ,MAACvD;oBAAM+F,WAAU;oBAAM3B,SAAS;;sCAC9B,KAACxE;4BACC4E,SAAQ;4BACRC,OAAM;4BACNW,UAAU,CAACrB;4BACXiC,SAAShC;sCAER1B,UAAU,SAAS;;sCAEtB,KAAC1C;4BAAOoG,SAAS9D;4BAASkD,UAAU/B;sCACjC;;;;;;;AAMb;AACAtB,mBAAmBkE,WAAW,GAAG;AAEjC,eAAelE,mBAAkB"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * IMPORTING A CONTACT FILE — the contact vocabulary over the shared drawer
3
+ * (AGL-2602; the drawer itself is `csv-import-drawer.tsx` since AGL-2621).
4
+ *
5
+ * The server half is `server/contacts-import.ts`. What this file adds to
6
+ * the walk the shared drawer makes is what is particular to people: the
7
+ * contact fields and their aliases, the holder's custom fields as further
8
+ * targets, the email as the one cell every row needs — judged here by the
9
+ * same normalizer the route runs, as a courtesy count — and the line in
10
+ * the result that says how many companies the file's company column made.
11
+ */
12
+ import { type ConsolePluginPageProps } from '@aglyn/aglyn';
13
+ export interface ContactImportDrawerProps {
14
+ open: boolean;
15
+ onClose: () => void;
16
+ /**
17
+ * The site the file is imported INTO — what the route captures every row
18
+ * under — or `null` at the organization level (AGL-2630), where the
19
+ * drawer asks which site with a picker and holds the import until one is
20
+ * named.
21
+ */
22
+ hostId: string | null;
23
+ /**
24
+ * The org document the shell passed, for the consent group's scope
25
+ * tokens. Typed as the page prop it is forwarded from, so the contacts
26
+ * list mounts the button with the value it already holds and no cast.
27
+ */
28
+ org?: ConsolePluginPageProps['org'];
29
+ }
30
+ export declare function ContactImportDrawer(props: ContactImportDrawerProps): import("react").JSX.Element;
31
+ export declare namespace ContactImportDrawer {
32
+ var displayName: string;
33
+ }
34
+ /**
35
+ * The "Import CSV" action on the contacts list, with the drawer it opens —
36
+ * mounted only once opened, so the list pays nothing for it until then.
37
+ */
38
+ export declare function ContactImportButton(props: {
39
+ /** The site the list is read under, or `null` at the organization level. */
40
+ hostId: string | null;
41
+ org?: ConsolePluginPageProps['org'];
42
+ }): import("react").JSX.Element;
43
+ export declare namespace ContactImportButton {
44
+ var displayName: string;
45
+ }
46
+ export default ContactImportDrawer;