@xframework-ca-test/cli 1.0.32 → 1.0.34

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 (377) hide show
  1. package/dist/ui/assets/AIVision-0025192f.js +4 -0
  2. package/dist/ui/assets/AccountDetails-42610e44.js +1 -0
  3. package/dist/ui/assets/AccountDetails-5b4cd3f7.js +1 -0
  4. package/dist/ui/assets/AccountServices-f68f471d.js +1 -0
  5. package/dist/ui/assets/AccountsList-262479cf.js +1 -0
  6. package/dist/ui/assets/ActionLink-9db8b1c2.js +1 -0
  7. package/dist/ui/assets/AdaptableCard-3d1e1f96.js +1 -0
  8. package/dist/ui/assets/AddAccount-2cd72664.js +1 -0
  9. package/dist/ui/assets/AddEditFile-6ae10d57.js +1 -0
  10. package/dist/ui/assets/AddEditTranslation-3812ff0f.js +1 -0
  11. package/dist/ui/assets/AiApiLogList-1eac39b7.js +1 -0
  12. package/dist/ui/assets/AiCa-2e90495f.js +1 -0
  13. package/dist/ui/assets/Alert-59d09a99.js +1 -0
  14. package/dist/ui/assets/ApiService-df126758.js +1 -0
  15. package/dist/ui/assets/AppLandingPage-afcea727.js +4 -0
  16. package/dist/ui/assets/AuditLogsList-ea37686b.js +1 -0
  17. package/dist/ui/assets/Auth0Callback-00729568.js +1 -0
  18. package/dist/ui/assets/BarCodes-4ff49536.js +1 -0
  19. package/dist/ui/assets/BlankLayout-7085ab88.js +1 -0
  20. package/dist/ui/assets/{BrainServices-a4bb698e.js → BrainServices-4cb93af5.js} +1 -1
  21. package/dist/ui/assets/CalendarList-689ed66a.js +2 -0
  22. package/dist/ui/assets/CalendarList-f4a9aa21.css +8 -0
  23. package/dist/ui/assets/CategoryList-a6d01041.js +1 -0
  24. package/dist/ui/assets/CategoryList-c03f4259.js +1 -0
  25. package/dist/ui/assets/ChatContainer-fec7b84d.js +1 -0
  26. package/dist/ui/assets/ChatsList-4b3194e4.js +1 -0
  27. package/dist/ui/assets/Check-af681a30.js +1 -0
  28. package/dist/ui/assets/CheckInVideo-aa9f50b2.js +6 -0
  29. package/dist/ui/assets/ClassicLayout-a9866742.js +2 -0
  30. package/dist/ui/assets/CompanyList-94119d71.js +1 -0
  31. package/dist/ui/assets/{CompanyService-1bf7c3c8.js → CompanyService-491a9cc1.js} +1 -1
  32. package/dist/ui/assets/{Component-59e4c14b.js → Component-566d01e0.js} +1 -1
  33. package/dist/ui/assets/ConfirmDialog-2838a642.js +1 -0
  34. package/dist/ui/assets/ContactDetails-c9dc0ed1.js +1 -0
  35. package/dist/ui/assets/{ContactService-92281a90.js → ContactService-8afcaeb7.js} +1 -1
  36. package/dist/ui/assets/ContactsList-5b06c9b8.js +1 -0
  37. package/dist/ui/assets/CountiesList-18b23cf7.js +1 -0
  38. package/dist/ui/assets/CountyDetails-ea024f14.js +1 -0
  39. package/dist/ui/assets/CourseDetails-8a5f8d63.js +1 -0
  40. package/dist/ui/assets/CourseList-3564fec3.js +1 -0
  41. package/dist/ui/assets/{CourseService-f0dc3bf1.js → CourseService-29ad460c.js} +1 -1
  42. package/dist/ui/assets/CreateSignature-c22e4a71.js +7 -0
  43. package/dist/ui/assets/{CustomerInfoField-fff65ace.js → CustomerInfoField-4bf880e2.js} +1 -1
  44. package/dist/ui/assets/DeckedLayout-610fe851.js +1 -0
  45. package/dist/ui/assets/DensitySelector-5d2e901f.js +1 -0
  46. package/dist/ui/assets/{DepartmentServices-3d56a9e7.js → DepartmentServices-a53e998b.js} +1 -1
  47. package/dist/ui/assets/{DigitalSignature-fff42e33.js → DigitalSignature-69eaf80c.js} +1 -1
  48. package/dist/ui/assets/{DocumemtManagementService-6501a5c1.js → DocumemtManagementService-85cde51a.js} +1 -1
  49. package/dist/ui/assets/DocumentActivity-bc938c61.js +1 -0
  50. package/dist/ui/assets/DocumentLayout-a12982d7.js +1 -0
  51. package/dist/ui/assets/DocumentList2-9c8c6284.js +23 -0
  52. package/dist/ui/assets/DocumentLists-1cdaae06.js +1 -0
  53. package/dist/ui/assets/DocumentUserSigned-f7371fc5.js +7 -0
  54. package/dist/ui/assets/DocumentsList-3b25907c.js +1 -0
  55. package/dist/ui/assets/DoubleSidedImage-b4bd3915.js +1 -0
  56. package/dist/ui/assets/{Drawer-949c18c6.js → Drawer-4f97e662.js} +1 -1
  57. package/dist/ui/assets/DynamicDashboard-0a41d287.js +1 -0
  58. package/dist/ui/assets/{DynamicTablesService-963fe77b.js → DynamicTablesService-6aa57f52.js} +1 -1
  59. package/dist/ui/assets/EditAccount-e42d66af.js +1 -0
  60. package/dist/ui/assets/EditLead-c8c9760a.js +1 -0
  61. package/dist/ui/assets/FaqItems-25d66543.js +6 -0
  62. package/dist/ui/assets/{FileManagementServices-25fd64c5.js → FileManagementServices-19b47568.js} +1 -1
  63. package/dist/ui/assets/{FolderOpen-88bfcc74.js → FolderOpen-7b0e2ac0.js} +1 -1
  64. package/dist/ui/assets/FormContainer-9a52b9e8.js +1 -0
  65. package/dist/ui/assets/{GeneralSettings-a7f805e8.js → GeneralSettings-c8c2f051.js} +5 -5
  66. package/dist/ui/assets/GenericPage-81e41302.js +1 -0
  67. package/dist/ui/assets/GridMapDetails-38f50b3c.js +1 -0
  68. package/dist/ui/assets/HorizontalMenuContent-fd559f4d.js +1 -0
  69. package/dist/ui/assets/{ImportFile-3f60d715.js → ImportFile-026b1771.js} +1 -1
  70. package/dist/ui/assets/{InlineSignaturePad-09c06619.js → InlineSignaturePad-f5630151.js} +1 -1
  71. package/dist/ui/assets/InvoicesList-9723bc5a.js +1 -0
  72. package/dist/ui/assets/{KeyVaultService-874d83fe.js → KeyVaultService-9608f0ff.js} +1 -1
  73. package/dist/ui/assets/LeadDetails-8cdaae0e.js +1 -0
  74. package/dist/ui/assets/{LeadSourceService-e46fa85e.js → LeadSourceService-cf71ea64.js} +1 -1
  75. package/dist/ui/assets/LeadsList-1ec20a77.js +1 -0
  76. package/dist/ui/assets/Logo-dd6f7656.js +1 -0
  77. package/dist/ui/assets/MapView-dcab88b3.js +1 -0
  78. package/dist/ui/assets/MarketingPage-998d10b0.js +4 -0
  79. package/dist/ui/assets/MenuNew-79fc95f3.js +1 -0
  80. package/dist/ui/assets/{MenuTable-c2c65021.js → MenuTable-f69e0fe4.js} +1 -1
  81. package/dist/ui/assets/MessageInput-07fcc5cb.js +21 -0
  82. package/dist/ui/assets/MessagesList-21d2b034.js +1 -0
  83. package/dist/ui/assets/ModernLayout-05af7cf7.js +1 -0
  84. package/dist/ui/assets/{NoData-8c485a3a.js → NoData-4cc4af03.js} +1 -1
  85. package/dist/ui/assets/Notify-8fb74d48.js +1 -0
  86. package/dist/ui/assets/OpportunitiesList-2f96958f.js +1 -0
  87. package/dist/ui/assets/OpportunityDetails-aaec3200.js +1 -0
  88. package/dist/ui/assets/{OpportunityServices-fa4fabfd.js → OpportunityServices-c4510dd2.js} +1 -1
  89. package/dist/ui/assets/OpportunityStatus-ea3b5ee2.js +1 -0
  90. package/dist/ui/assets/PageBreadcrumb-cf54a6e9.js +1 -0
  91. package/dist/ui/assets/{Password-d9294711.js → Password-21414dc6.js} +1 -1
  92. package/dist/ui/assets/PasswordInput-333c82ca.js +1 -0
  93. package/dist/ui/assets/{PreferenceService-75bf9db6.js → PreferenceService-d2b3e003.js} +1 -1
  94. package/dist/ui/assets/Profile-8c9fd2fc.js +1 -0
  95. package/dist/ui/assets/{ReportEditor-8880f57e.js → ReportEditor-4e4f6d53.js} +3 -3
  96. package/dist/ui/assets/{ReportViewer-9f1080f7.js → ReportViewer-616d3cfc.js} +30 -30
  97. package/dist/ui/assets/RoleEdit-a076ea85.js +1 -0
  98. package/dist/ui/assets/RoleForm-47691f91.js +1 -0
  99. package/dist/ui/assets/{RoleNew-49fadb16.js → RoleNew-e86a1513.js} +1 -1
  100. package/dist/ui/assets/{RoleService-7008da2c.js → RoleService-2f9ed883.js} +1 -1
  101. package/dist/ui/assets/ScheduleCycle-0ae23631.js +1 -0
  102. package/dist/ui/assets/{ScheduleService-7228f0a3.js → ScheduleService-41a88c41.js} +1 -1
  103. package/dist/ui/assets/ScreenList-8f58150b.js +1 -0
  104. package/dist/ui/assets/Settings-fc91c9d2.js +2 -0
  105. package/dist/ui/assets/{SetupWizard-4172e377.js → SetupWizard-d1363582.js} +1 -1
  106. package/dist/ui/assets/SimpleLayout-77cfb778.js +1 -0
  107. package/dist/ui/assets/StackedSideLayout-2f1ee9d1.js +1 -0
  108. package/dist/ui/assets/StickyFooter-3e569b80.js +1 -0
  109. package/dist/ui/assets/SupportRequets-0ecd4ab8.js +1 -0
  110. package/dist/ui/assets/{Switcher-c8648037.js → Switcher-e2fba588.js} +1 -1
  111. package/dist/ui/assets/TimeLogApprovalDataList-7b49a432.js +1 -0
  112. package/dist/ui/assets/TimeLogApprovalList-78cab2b6.js +1 -0
  113. package/dist/ui/assets/TimeLogList-592b29aa.js +1 -0
  114. package/dist/ui/assets/{TimeLogService-cd7b2f61.js → TimeLogService-83166cbc.js} +1 -1
  115. package/dist/ui/assets/TimesheetsList-d1520efb.js +1 -0
  116. package/dist/ui/assets/TranslationList-88d7d5d7.js +1 -0
  117. package/dist/ui/assets/TweaksPanel-bc10bc47.js +112 -0
  118. package/dist/ui/assets/{Upload-fb34ce03.js → Upload-be937eb6.js} +4 -4
  119. package/dist/ui/assets/UserEdit-1f8208f3.js +1 -0
  120. package/dist/ui/assets/UserForm-e9b56aff.js +1 -0
  121. package/dist/ui/assets/{UserNew-b36c342c.js → UserNew-31fa258f.js} +1 -1
  122. package/dist/ui/assets/{UserService-047aef51.js → UserService-1b93ceb0.js} +1 -1
  123. package/dist/ui/assets/ViewTimeLogForApproval-ae077050.js +1 -0
  124. package/dist/ui/assets/Views-1359da48.js +1 -0
  125. package/dist/ui/assets/WelcomeList-dc8666ec.js +9 -0
  126. package/dist/ui/assets/WidgetLayoutsService-49730609.js +1 -0
  127. package/dist/ui/assets/{WrapperCell-a7981b07.js → WrapperCell-3d5592cf.js} +1 -1
  128. package/dist/ui/assets/actioncell-6b5ebd6c.js +1 -0
  129. package/dist/ui/assets/{ar-3c9c213e.js → ar-fb4f0ea8.js} +1 -1
  130. package/dist/ui/assets/calendarList-ac838a86.js +2 -0
  131. package/dist/ui/assets/{cjs-162261df.js → cjs-998de55c.js} +1 -1
  132. package/dist/ui/assets/createSvgIcon-aba65987.js +1 -0
  133. package/dist/ui/assets/documentsList-4e2e061e.js +1 -0
  134. package/dist/ui/assets/{es-be649ede.js → es-cd58d3ad.js} +1 -1
  135. package/dist/ui/assets/{esm-f306d015.js → esm-c40433f8.js} +1 -1
  136. package/dist/ui/assets/gridList-e1571c87.js +1 -0
  137. package/dist/ui/assets/gridMapTable-d95f9c70.js +1 -0
  138. package/dist/ui/assets/{index-f6be0390.js → index-00a8eb64.js} +1 -1
  139. package/dist/ui/assets/index-04438b6b.js +22 -0
  140. package/dist/ui/assets/index-058738bc.js +1 -0
  141. package/dist/ui/assets/{index-e4c6057f.js → index-0b08ce18.js} +1 -1
  142. package/dist/ui/assets/index-0d730815.js +4 -0
  143. package/dist/ui/assets/index-0efcf53a.js +1 -0
  144. package/dist/ui/assets/index-0f432250.js +1 -0
  145. package/dist/ui/assets/{index-cebd880b.js → index-0fd6e996.js} +1 -1
  146. package/dist/ui/assets/{index-49a94e54.js → index-11297f4a.js} +1 -1
  147. package/dist/ui/assets/index-14c1c1d7.js +1 -0
  148. package/dist/ui/assets/index-15e1f4be.js +1 -0
  149. package/dist/ui/assets/index-16586c21.js +1 -0
  150. package/dist/ui/assets/index-19346c14.js +1 -0
  151. package/dist/ui/assets/{index-16bb10a6.js → index-1dc2b9d2.js} +1 -1
  152. package/dist/ui/assets/index-211fbe21.js +1 -0
  153. package/dist/ui/assets/index-23e16bff.js +1 -0
  154. package/dist/ui/assets/index-27aef8b5.js +1 -0
  155. package/dist/ui/assets/{index-36228db5.js → index-289b3fd9.js} +1 -1
  156. package/dist/ui/assets/{index-a22a3546.js → index-2dae59b1.js} +1 -1
  157. package/dist/ui/assets/index-353fd6dd.js +1 -0
  158. package/dist/ui/assets/{index-ea125a16.js → index-359d245d.js} +1 -1
  159. package/dist/ui/assets/{index-c62ac197.js → index-3b5ce20a.js} +70 -62
  160. package/dist/ui/assets/index-3b929ba4.js +34 -0
  161. package/dist/ui/assets/index-42e3a337.js +1 -0
  162. package/dist/ui/assets/index-44b6de3a.js +1 -0
  163. package/dist/ui/assets/index-46d3ca9a.js +7 -0
  164. package/dist/ui/assets/{index-e3cc723f.js → index-49016ad0.js} +1 -1
  165. package/dist/ui/assets/index-51132258.js +1 -0
  166. package/dist/ui/assets/{index-dc103f22.js → index-52963879.js} +1 -1
  167. package/dist/ui/assets/{index-fcc1c999.js → index-533fd007.js} +1 -1
  168. package/dist/ui/assets/index-59ec468b.js +13 -0
  169. package/dist/ui/assets/index-5e2d5279.js +1 -0
  170. package/dist/ui/assets/{index-d17da176.js → index-62f95885.js} +1 -1
  171. package/dist/ui/assets/index-659c6412.js +1 -0
  172. package/dist/ui/assets/index-6873dfc3.js +1 -0
  173. package/dist/ui/assets/index-69a68d9e.js +1 -0
  174. package/dist/ui/assets/index-6a6902c7.js +1 -0
  175. package/dist/ui/assets/index-7596c6bb.js +1 -0
  176. package/dist/ui/assets/{index-47dcc43a.js → index-8045c5f0.js} +1 -1
  177. package/dist/ui/assets/{index-b028e652.js → index-8677acd1.js} +1 -1
  178. package/dist/ui/assets/{index-42e65911.js → index-88c52b97.js} +1 -1
  179. package/dist/ui/assets/index-89cfefab.js +1 -0
  180. package/dist/ui/assets/{index-bea4c3dc.js → index-8c0643fd.js} +1 -1
  181. package/dist/ui/assets/index-8d5b6a1f.js +1 -0
  182. package/dist/ui/assets/index-8d5d70f9.js +1 -0
  183. package/dist/ui/assets/{index-9b41371d.js → index-91505016.js} +1 -1
  184. package/dist/ui/assets/{index-ffc00dbb.js → index-92314073.js} +1 -1
  185. package/dist/ui/assets/index-985cf3f6.js +1 -0
  186. package/dist/ui/assets/index-a14e51de.js +1 -0
  187. package/dist/ui/assets/index-a733f80b.js +1 -0
  188. package/dist/ui/assets/index-a84d5808.js +1 -0
  189. package/dist/ui/assets/index-acac6006.js +1 -0
  190. package/dist/ui/assets/index-b0ef7ac3.js +1 -0
  191. package/dist/ui/assets/index-b6ef5984.js +1 -0
  192. package/dist/ui/assets/{index-fc9071e0.js → index-bd4edda3.js} +1 -1
  193. package/dist/ui/assets/{index-0ec72c4b.js → index-c29b8474.js} +1 -1
  194. package/dist/ui/assets/index-c88c7790.js +19 -0
  195. package/dist/ui/assets/index-ce89a95e.css +7 -0
  196. package/dist/ui/assets/index-d221d69e.js +1 -0
  197. package/dist/ui/assets/{index-f1576468.js → index-d33facae.js} +1 -1
  198. package/dist/ui/assets/index-e46c57a5.js +1 -0
  199. package/dist/ui/assets/index-e863817c.js +1 -0
  200. package/dist/ui/assets/index-f4af2342.js +1 -0
  201. package/dist/ui/assets/{index-77e820d0.js → index-fc9f8c4b.js} +1 -1
  202. package/dist/ui/assets/{index-ec2010d2.js → index-ff23edc5.js} +1 -1
  203. package/dist/ui/assets/{index.esm-70ab539c.js → index.esm-b2d342b5.js} +1 -1
  204. package/dist/ui/assets/liveLocation-8e0bb2f3.js +1 -0
  205. package/dist/ui/assets/{mapView-ab35acaa.js → mapView-c8063ed6.js} +1 -1
  206. package/dist/ui/assets/modeuls-setup-4b06843c.js +1 -0
  207. package/dist/ui/assets/{permissionHoc-6f787658.js → permissionHoc-0818bfb0.js} +1 -1
  208. package/dist/ui/assets/{react-21134174.js → react-12ddbe48.js} +1 -1
  209. package/dist/ui/assets/{react-4d5dc208.js → react-61e0b284.js} +1 -1
  210. package/dist/ui/assets/{strongPassword-bbec776a.js → strongPassword-6bc8786f.js} +1 -1
  211. package/dist/ui/assets/{styles-0608350c.js → styles-b7ae7bf6.js} +1 -1
  212. package/dist/ui/assets/{tableV2-4d1c9fd2.js → tableV2-99c808c0.js} +1 -1
  213. package/dist/ui/assets/tableV3-24eed052.js +1 -0
  214. package/dist/ui/assets/ticketRequestDetails-8b299fbd.js +1 -0
  215. package/dist/ui/assets/{useDidUpdate-25c4d4ed.js → useDidUpdate-de319a18.js} +1 -1
  216. package/dist/ui/assets/{useDrop-02b0e5d7.js → useDrop-8f0d11a7.js} +1 -1
  217. package/dist/ui/assets/useFilteredData-e8fad668.js +1 -0
  218. package/dist/ui/assets/{usePermission-d94b4984.js → usePermission-4689548c.js} +1 -1
  219. package/dist/ui/assets/{vendor-charts-eccea5d1.js → vendor-charts-4be0b5ab.js} +1 -1
  220. package/dist/ui/assets/{vendor-codemirror-c8203b49.js → vendor-codemirror-1a1216c9.js} +11 -11
  221. package/dist/ui/assets/{vendor-devex-33a39e11.js → vendor-devex-4076ffeb.js} +2 -2
  222. package/dist/ui/assets/{vendor-excel-ee8fc4e5.js → vendor-excel-3b3553df.js} +1 -1
  223. package/dist/ui/assets/{vendor-i18n-2fcb1983.js → vendor-i18n-b89304ef.js} +1 -1
  224. package/dist/ui/assets/vendor-mui-98daa63f.js +185 -0
  225. package/dist/ui/assets/{vendor-pdf-b2a5d8b1.js → vendor-pdf-3c29882d.js} +1 -1
  226. package/dist/ui/assets/withHeaderItem-df2cc5d9.js +1 -0
  227. package/dist/ui/assets/{zh-cn-1881e930.js → zh-cn-13c6c696.js} +1 -1
  228. package/dist/ui/config.js +16 -20
  229. package/dist/ui/index.html +9 -9
  230. package/dist/ui/manifest.json +2 -2
  231. package/index.bundle.js +23 -9
  232. package/package.json +1 -1
  233. package/dist/ui/assets/AIVision-4f515575.js +0 -4
  234. package/dist/ui/assets/AccountDetails-2b42d262.js +0 -1
  235. package/dist/ui/assets/AccountDetails-492dee8f.js +0 -1
  236. package/dist/ui/assets/AccountServices-62599aae.js +0 -1
  237. package/dist/ui/assets/AccountsList-fe7cb5f9.js +0 -1
  238. package/dist/ui/assets/ActionLink-33e476e1.js +0 -1
  239. package/dist/ui/assets/AdaptableCard-df7695d6.js +0 -1
  240. package/dist/ui/assets/AddAccount-a05910e8.js +0 -1
  241. package/dist/ui/assets/AddEditFile-063c229b.js +0 -1
  242. package/dist/ui/assets/AddEditTranslation-43beae49.js +0 -1
  243. package/dist/ui/assets/AiApiLogList-a488921d.js +0 -1
  244. package/dist/ui/assets/AiCa-9c1b25b2.js +0 -1
  245. package/dist/ui/assets/Alert-7dfbd254.js +0 -1
  246. package/dist/ui/assets/ApiService-2b99757f.js +0 -1
  247. package/dist/ui/assets/AppLandingPage-3956cf0c.js +0 -4
  248. package/dist/ui/assets/AuditLogsList-7a2ce37d.js +0 -1
  249. package/dist/ui/assets/Auth0Callback-b943f19f.js +0 -1
  250. package/dist/ui/assets/BarCodes-17ed5da4.js +0 -1
  251. package/dist/ui/assets/BlankLayout-2f6e1153.js +0 -1
  252. package/dist/ui/assets/CalendarList-25834ddb.css +0 -11
  253. package/dist/ui/assets/CalendarList-72739043.js +0 -2
  254. package/dist/ui/assets/CategoryList-9f82e9a3.js +0 -1
  255. package/dist/ui/assets/CategoryList-c97891e7.js +0 -1
  256. package/dist/ui/assets/ChatContainer-4a38b179.js +0 -1
  257. package/dist/ui/assets/ChatsList-6c2c3e2f.js +0 -1
  258. package/dist/ui/assets/Check-71f21a49.js +0 -1
  259. package/dist/ui/assets/CheckInVideo-cb5fa9a2.js +0 -6
  260. package/dist/ui/assets/ClassicLayout-7d09e5ac.js +0 -1
  261. package/dist/ui/assets/CompanyList-9532f511.js +0 -1
  262. package/dist/ui/assets/ConfirmDialog-3202eb3d.js +0 -1
  263. package/dist/ui/assets/ContactDetails-3b70919b.js +0 -1
  264. package/dist/ui/assets/ContactsList-e9ac0fa3.js +0 -1
  265. package/dist/ui/assets/CountiesList-6ad338a5.js +0 -1
  266. package/dist/ui/assets/CountyDetails-22d4bc89.js +0 -1
  267. package/dist/ui/assets/CourseDetails-18040b49.js +0 -1
  268. package/dist/ui/assets/CourseList-e502f89d.js +0 -1
  269. package/dist/ui/assets/CreateSignature-375d191b.js +0 -7
  270. package/dist/ui/assets/DeckedLayout-909ac220.js +0 -1
  271. package/dist/ui/assets/DensitySelector-a2c1c68f.js +0 -1
  272. package/dist/ui/assets/DocumentActivity-d63dacec.js +0 -1
  273. package/dist/ui/assets/DocumentLayout-637075fd.js +0 -1
  274. package/dist/ui/assets/DocumentList2-518d2fa4.js +0 -23
  275. package/dist/ui/assets/DocumentLists-2da9ff88.js +0 -1
  276. package/dist/ui/assets/DocumentUserSigned-27bfa6e6.js +0 -7
  277. package/dist/ui/assets/DocumentsList-9f56db71.js +0 -1
  278. package/dist/ui/assets/DoubleSidedImage-ae98733b.js +0 -1
  279. package/dist/ui/assets/DynamicDashboard-6f177244.js +0 -1
  280. package/dist/ui/assets/EditAccount-1c1a8318.js +0 -1
  281. package/dist/ui/assets/EditLead-cc38d2a2.js +0 -1
  282. package/dist/ui/assets/FaqItems-c1c85af7.js +0 -6
  283. package/dist/ui/assets/FormContainer-91c2b0e4.js +0 -1
  284. package/dist/ui/assets/GenericPage-25a5d92a.js +0 -1
  285. package/dist/ui/assets/GridMapDetails-851a5781.js +0 -1
  286. package/dist/ui/assets/HorizontalMenuContent-96da38e1.js +0 -1
  287. package/dist/ui/assets/InvoicesList-8e66a112.js +0 -1
  288. package/dist/ui/assets/LeadDetails-ad63b3df.js +0 -1
  289. package/dist/ui/assets/LeadsList-bd7d9804.js +0 -1
  290. package/dist/ui/assets/Logo-3f3c9ee6.js +0 -1
  291. package/dist/ui/assets/MapView-afd1c913.js +0 -1
  292. package/dist/ui/assets/MarketingPage-89a860b1.js +0 -4
  293. package/dist/ui/assets/MenuEdit-d6e0d64c.js +0 -1
  294. package/dist/ui/assets/MessageInput-6dc83761.js +0 -21
  295. package/dist/ui/assets/MessagesList-966b69c5.js +0 -1
  296. package/dist/ui/assets/ModernLayout-03f30574.js +0 -1
  297. package/dist/ui/assets/Notify-bb3ce372.js +0 -1
  298. package/dist/ui/assets/OpportunitiesList-62eb34f6.js +0 -1
  299. package/dist/ui/assets/OpportunityDetails-356a8580.js +0 -1
  300. package/dist/ui/assets/OpportunityStatus-fa8108ea.js +0 -1
  301. package/dist/ui/assets/PasswordInput-8619a9df.js +0 -1
  302. package/dist/ui/assets/Profile-9104808b.js +0 -1
  303. package/dist/ui/assets/RoleEdit-98a6410b.js +0 -1
  304. package/dist/ui/assets/RoleForm-cc251eba.js +0 -1
  305. package/dist/ui/assets/ScheduleCycle-22c8e809.js +0 -1
  306. package/dist/ui/assets/ScreenList-9f7afa1c.js +0 -1
  307. package/dist/ui/assets/SidePanelContent-6b13836f.js +0 -1
  308. package/dist/ui/assets/SimpleLayout-d5445c0d.js +0 -2
  309. package/dist/ui/assets/StackedSideLayout-51127dc5.js +0 -1
  310. package/dist/ui/assets/StickyFooter-5b934274.js +0 -1
  311. package/dist/ui/assets/SupportRequets-be6542a9.js +0 -1
  312. package/dist/ui/assets/TimeLogApprovalDataList-c16d8bae.js +0 -1
  313. package/dist/ui/assets/TimeLogApprovalList-f6a75a20.js +0 -1
  314. package/dist/ui/assets/TimeLogList-ea288cce.js +0 -1
  315. package/dist/ui/assets/TimesheetsList-4a20e96c.js +0 -1
  316. package/dist/ui/assets/TranslationList-7a989333.js +0 -1
  317. package/dist/ui/assets/UserEdit-87262ea5.js +0 -1
  318. package/dist/ui/assets/UserForm-31fdd3b3.js +0 -1
  319. package/dist/ui/assets/ViewTimeLogForApproval-43b24a1a.js +0 -1
  320. package/dist/ui/assets/Views-74429e81.js +0 -1
  321. package/dist/ui/assets/WelcomeList-6c693eae.js +0 -9
  322. package/dist/ui/assets/actioncell-17e12e21.js +0 -1
  323. package/dist/ui/assets/calendarList-511b4d8f.js +0 -2
  324. package/dist/ui/assets/createSvgIcon-c5fc0d04.js +0 -1
  325. package/dist/ui/assets/documentsList-ac2c91ec.js +0 -1
  326. package/dist/ui/assets/dxicons-4c1b2089.ttf +0 -0
  327. package/dist/ui/assets/dxicons-ade3c9ed.woff2 +0 -0
  328. package/dist/ui/assets/dxicons-b4cd1226.woff +0 -0
  329. package/dist/ui/assets/gridList-cb9a14b1.js +0 -1
  330. package/dist/ui/assets/gridMapTable-c19770a8.js +0 -1
  331. package/dist/ui/assets/index-1d60e514.js +0 -1
  332. package/dist/ui/assets/index-26466d9d.js +0 -1
  333. package/dist/ui/assets/index-289cfedb.js +0 -1
  334. package/dist/ui/assets/index-2ce5b358.js +0 -1
  335. package/dist/ui/assets/index-307ce6d7.js +0 -1
  336. package/dist/ui/assets/index-36ba4ea7.js +0 -1
  337. package/dist/ui/assets/index-3f02e05a.js +0 -1
  338. package/dist/ui/assets/index-44662933.js +0 -13
  339. package/dist/ui/assets/index-51ee35f9.js +0 -1
  340. package/dist/ui/assets/index-54372d82.js +0 -1
  341. package/dist/ui/assets/index-569a9d2c.js +0 -1
  342. package/dist/ui/assets/index-62de659f.js +0 -13
  343. package/dist/ui/assets/index-6589dd2d.js +0 -1
  344. package/dist/ui/assets/index-6b6d0f06.js +0 -1
  345. package/dist/ui/assets/index-6c618440.js +0 -1
  346. package/dist/ui/assets/index-785ad361.js +0 -1
  347. package/dist/ui/assets/index-7df8779c.js +0 -1
  348. package/dist/ui/assets/index-82c9477e.js +0 -1
  349. package/dist/ui/assets/index-8ab45286.js +0 -1
  350. package/dist/ui/assets/index-8c229076.css +0 -7
  351. package/dist/ui/assets/index-a205cfed.js +0 -34
  352. package/dist/ui/assets/index-a23f9c87.js +0 -1
  353. package/dist/ui/assets/index-a455424a.js +0 -1
  354. package/dist/ui/assets/index-a4f78ee1.js +0 -1
  355. package/dist/ui/assets/index-aaad94c2.js +0 -1
  356. package/dist/ui/assets/index-b1b6b0f6.js +0 -1
  357. package/dist/ui/assets/index-c1f92742.js +0 -4
  358. package/dist/ui/assets/index-c2088808.js +0 -1
  359. package/dist/ui/assets/index-cbc29fa8.js +0 -1
  360. package/dist/ui/assets/index-cd2b7d32.js +0 -1
  361. package/dist/ui/assets/index-cf3804f1.js +0 -19
  362. package/dist/ui/assets/index-d0ef2cc2.js +0 -1
  363. package/dist/ui/assets/index-d1145737.js +0 -7
  364. package/dist/ui/assets/index-d58fb185.js +0 -1
  365. package/dist/ui/assets/index-d5b5a7e1.js +0 -1
  366. package/dist/ui/assets/index-daeff047.js +0 -1
  367. package/dist/ui/assets/index-ded3b055.js +0 -1
  368. package/dist/ui/assets/index-ede23a2b.js +0 -1
  369. package/dist/ui/assets/index-f8144346.js +0 -1
  370. package/dist/ui/assets/index-fd68b510.js +0 -1
  371. package/dist/ui/assets/index-fe3409ae.js +0 -1
  372. package/dist/ui/assets/liveLocation-646eef95.js +0 -1
  373. package/dist/ui/assets/modeuls-setup-402f891e.js +0 -1
  374. package/dist/ui/assets/tableV3-3d2f4952.js +0 -1
  375. package/dist/ui/assets/ticketRequestDetails-f78147f7.js +0 -1
  376. package/dist/ui/assets/vendor-mui-69397583.js +0 -185
  377. package/dist/ui/menudata/menus.json +0 -606
@@ -0,0 +1,7 @@
1
+ import{j as e}from"./vendor-mui-98daa63f.js";import{r as a,k as De}from"./vendor-react-ece1c85f.js";import{D as Ee,G as Fe,v as Ie,P as Pe}from"./vendor-pdf-3c29882d.js";import{D as $e,H as ze}from"./index-2dae59b1.js";import{S as Ue}from"./index-8677acd1.js";import"./Alert-59d09a99.js";import{Z as ae,B as I,a0 as re,r as Me}from"./index-3b5ce20a.js";import"./index-7596c6bb.js";import{a as Le}from"./index-a14e51de.js";import"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import{U as Be}from"./Upload-be937eb6.js";import{F as We}from"./index-533fd007.js";import{Q as Ve}from"./index-0ec48d3d.js";import{p as _}from"./Notify-8fb74d48.js";import{b as Re,c as me,d as Oe,e as He}from"./DigitalSignature-69eaf80c.js";import{C as Ae}from"./ConfirmDialog-2838a642.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";Fe.workerSrc=`https://unpkg.com/pdfjs-dist@${Ie}/build/pdf.worker.min.mjs`;const Ge=({fields:y,scale:u,numPages:F,onOpenSignature:P,onOpenTextEditor:j,activeFieldId:p})=>(a.useEffect(()=>{if(p){const C=document.getElementById(`field-${p}`);C&&C.scrollIntoView({behavior:"smooth",block:"center"})}},[p]),e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
2
+ @keyframes pulseHighlight {
3
+ 0%, 100% { box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.7); }
4
+ 50% { box-shadow: 0 0 16px 4px rgba(255, 215, 0, 0.95); }
5
+ }
6
+ .animate-pulse-highlight { animation: pulseHighlight 1.8s infinite; }
7
+ `}),Array.from({length:F}).map((C,c)=>e.jsxs("div",{className:"relative mb-6 flex justify-center w-full",children:[e.jsx(Pe,{pageNumber:c+1,width:Math.round(850*u),renderTextLayer:!1,renderAnnotationLayer:!1},`page_${c+1}`),y.filter(i=>i.pageNumber===c+1).map(i=>{var x;const d=!!i.isOwnField,m=p===i.id;return e.jsxs("div",{id:`field-${i.id}`,className:`absolute transition-transform flex items-center justify-center text-center z-[10] ${m?"scale-105 animate-pulse-highlight":""}`,style:{left:`${i.x*u}px`,top:`${i.y*u}px`,width:`${i.width*u}px`,height:`${i.height*u}px`,border:`2px dashed ${((x=i.assignedUser)==null?void 0:x.color)||"#888"}`,backgroundColor:d?"rgba(255,255,180,0.85)":"rgba(255,255,255,0.7)",borderRadius:"6px",cursor:d?"pointer":"default"},onClick:()=>{d&&(i.fieldType==="signature"||i.fieldType==="initials"?P(i.id,i.assignedUser,i.fieldType):j(i.id,i.textValue||""))},children:[d&&e.jsx("div",{className:"absolute -top-5 left-1/2 -translate-x-1/2 bg-yellow-400 text-gray-900 text-[10px] font-bold px-2 py-[2px] rounded shadow whitespace-nowrap",children:i.fieldType==="signature"?"Sign Here":i.fieldType==="initials"?"Initial Here":i.fieldType==="date"?"Date Here":"Fill Here"}),e.jsxs("div",{className:"w-full h-full flex items-center justify-center",children:[(i.fieldType==="signature"||i.fieldType==="initials")&&!i.signatureData&&e.jsx("div",{className:`text-xs font-semibold ${d?"text-gray-700 cursor-pointer":"text-gray-400"}`,children:d?"Click to Sign":"Signature"}),(i.fieldType==="signature"||i.fieldType==="initials")&&i.signatureData&&e.jsx("div",{className:"w-full h-full overflow-hidden flex items-center justify-center",children:e.jsx("img",{src:i.signatureData,alt:"Signature",className:"pointer-events-none",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"cover"}})}),i.fieldType==="text"&&e.jsx("div",{className:"font-semibold flex items-center justify-center overflow-hidden break-words leading-tight w-full h-full text-center whitespace-nowrap",style:{fontSize:`${Math.min(i.height*.5*u,20)}px`,color:d?"#333":"#999",lineHeight:"1.1",textOverflow:"ellipsis"},children:e.jsx("span",{className:"overflow-hidden",style:{display:"inline-block",maxWidth:"100%",textOverflow:"ellipsis"},children:i.textValue||(d?"Enter Text":"—")})}),i.fieldType==="date"&&e.jsx("div",{className:`text-xs font-semibold ${d?"text-gray-700 cursor-pointer":"text-gray-400"}`,children:i.textValue||(d?"Enter Date":"—")})]})]},i.id)})]},c))]})),xe=(y,u)=>{const[F,P]=a.useState({top:0,left:0,placement:"right"});return a.useEffect(()=>{if(!y)return;const j=()=>{const c=document.getElementById(`field-${y}`),i=u==null?void 0:u.current;if(!c||!i)return;const d=c.getBoundingClientRect();i.getBoundingClientRect();const m=window.innerWidth,x=window.innerHeight,f=420,N=250,k=16;let w="right",g=d.top,z=d.right+k;z+f>m-20&&(d.left-f-k>20?(w="left",z=d.left-f-k):(w="below",z=Math.max(20,Math.min(d.left,m-f-20)),g=d.bottom+k)),g<20&&(g=20),g+N>x-100&&(g=Math.max(20,x-N-100)),w==="below"&&g+N>x-100&&d.top-N-k>20&&(w="above",g=d.top-N-k),P({top:g,left:z,placement:w})};j();const p=()=>j();window.addEventListener("resize",p);const C=u==null?void 0:u.current;return C&&C.addEventListener("scroll",p),()=>{window.removeEventListener("resize",p),C&&C.removeEventListener("scroll",p)}},[y,u]),F},Ye=({visible:y,value:u,onClose:F,onSave:P,isLastField:j,onFinalize:p,fieldId:C,containerRef:c})=>{const[i,d]=a.useState(u||""),[m,x]=a.useState(""),f=xe(y?C:null,c);if(a.useEffect(()=>{d(u||""),x("")},[u,y]),!y)return null;const N=()=>{if(!i.trim()){x("This field is required.");return}x(""),P(i.trim())},k=w=>{if(w.key==="Enter"&&!w.shiftKey){if(w.preventDefault(),!i.trim()){x("This field is required.");return}if(j){P(i.trim()),setTimeout(()=>{p==null||p()},150);return}else N()}};return e.jsx("div",{className:"fixed inset-0 z-50",onClick:F,children:e.jsxs("div",{className:"fixed bg-white rounded-xl p-4 shadow-2xl border border-gray-200 w-[320px] sm:w-[380px]",style:{top:`${f.top}px`,left:`${f.left}px`,maxWidth:"calc(100vw - 40px)"},onClick:w=>w.stopPropagation(),children:[e.jsx("div",{className:`absolute w-3 h-3 bg-white border-gray-200 transform rotate-45 ${f.placement==="right"?"-left-1.5 top-6 border-l border-b":f.placement==="left"?"-right-1.5 top-6 border-r border-t":f.placement==="below"?"-top-1.5 left-6 border-l border-t":"-bottom-1.5 left-6 border-r border-b"}`}),e.jsx("h3",{className:"font-semibold text-base mb-2 text-gray-800",children:"Enter Text"}),e.jsxs("div",{className:"mb-3",children:[e.jsx(re,{textArea:!0,className:`border rounded-md p-2 w-full ${m?"border-red-500":"border-gray-300"}`,value:i,onChange:w=>{d(w.target.value),m&&x("")},onKeyDown:k,placeholder:"Enter field value",autoFocus:!0}),m&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:m})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(I,{variant:"plain",size:"sm",onClick:F,children:"Cancel"}),e.jsx(I,{variant:"solid",size:"sm",onClick:N,disabled:!i.trim(),children:j?"Finish":"Save"})]})]})})},qe=({visible:y,onClose:u,onSave:F,type:P,field:j,existingSignature:p,tokenParam:C})=>{const c=a.useRef(null),[i,d]=a.useState("draw"),[m,x]=a.useState(null),[f,N]=a.useState(""),[k,w]=a.useState("Great Vibes"),[g,z]=a.useState(32),[T,S]=a.useState(""),[G,K]=a.useState(!1),[O,X]=a.useState({width:480,height:230});a.useEffect(()=>{const s=()=>{const r=window.innerWidth,l=Math.max(280,Math.min(480,Math.floor(r*.86))),D=Math.round(l/480*230);X({width:l,height:D})};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),a.useEffect(()=>{if(p&&c.current&&y&&i==="draw"){const s=c.current.getCanvas(),r=s.getContext("2d"),l=new Image;l.onload=()=>{r.clearRect(0,0,s.width,s.height);const D=Math.min(s.width/l.width,s.height/l.height),L=l.width*D,Y=l.height*D,U=(s.width-L)/2,q=(s.height-Y)/2;r.drawImage(l,U,q,L,Y),c.current&&(c.current._isEmpty=!1,c.current.isEmpty=()=>!1)},l.src=p}},[p,y,i,O]),a.useEffect(()=>{const s=document.createElement("link");s.href="https://fonts.googleapis.com/css2?family=Great+Vibes&family=Pacifico&family=Dancing+Script&family=Alex+Brush&family=Sacramento&display=swap",s.rel="stylesheet",document.head.appendChild(s)},[]),a.useEffect(()=>{var s;y||(N(""),x(null),(s=c.current)!=null&&s.clear&&c.current.clear(),S(""))},[y]);const H=`${window.location.origin}/create-signature?token=${j==null?void 0:j.signatureToken}`,W=async()=>{var s,r;if(!(j!=null&&j.signatureToken)){u();return}K(!0);try{const l=await me(C);if(l!=null&&l.success&&((r=(s=l==null?void 0:l.data)==null?void 0:s.assignedFields)!=null&&r.$values)){const D=l.data.assignedFields.$values.find(L=>L.id===j.id);if(D!=null&&D.signatureData&&D.signatureData!==p){_("Signature received via QR code!",void 0,"success"),F(D.signatureData);return}}}catch(l){console.error("Error fetching signature data:",l),_("Could not check for signature updates",void 0,"warning")}finally{K(!1)}u()},le=s=>{const r=new FileReader;r.onloadend=()=>{x(r.result),S("")},r.readAsDataURL(s)},ee=()=>{var r,l;if((r=c.current)!=null&&r.isEmpty&&((l=c.current)!=null&&l.isEmpty())){S("Please draw your signature before saving.");return}S("");const s=c.current.getTrimmedCanvas().toDataURL("image/png");F(s)},te=()=>{if(!f.trim()){S("Please type your signature before saving.");return}S("");const s=document.createElement("canvas"),r=s.getContext("2d");s.width=480,s.height=230,r.fillStyle="#fff",r.fillRect(0,0,s.width,s.height),r.fillStyle="#000",r.textAlign="center",r.textBaseline="middle",r.font=`${g}px "${k}"`,r.fillText(f,s.width/2,s.height/2);const l=s.toDataURL("image/png");F(l)},ie=()=>{if(!m){S("Please upload an image before saving.");return}S(""),F(m)};if(!y)return null;let V=["draw","type","upload","qr"];return e.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-xl p-4 sm:p-6 shadow-lg w-[96vw] max-w-[720px] max-h-[90vh] overflow-auto relative",children:[G&&e.jsx("div",{className:"absolute inset-0 bg-white/80 flex items-center justify-center z-10 rounded-xl",children:e.jsx(ae,{loading:!0})}),e.jsx("h3",{className:"font-semibold text-lg mb-3 text-gray-800 capitalize",children:P==="initials"?"Initials":"Signature"}),e.jsx("div",{className:"flex mb-4 border-b border-gray-200 overflow-x-auto -mx-2 px-2",children:V==null?void 0:V.map(s=>e.jsx("button",{className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${i===s?"border-custom-500 text-custom-600":"border-transparent text-gray-500"}`,onClick:()=>{d(s),S("")},children:s==="draw"?"Draw":s==="upload"?"Upload":s==="qr"?"Sign via QR":"Type"},s))}),i==="draw"&&e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"border border-gray-300 rounded-md mb-2 w-full flex justify-center px-2",children:e.jsx(Ue,{ref:c,penColor:"black",minWidth:1.8,maxWidth:3.8,velocityFilterWeight:.6,dotSize:1.2,throttle:12,backgroundColor:"white",canvasProps:{width:O.width,height:O.height,className:"rounded-md touch-none select-none"}})}),T&&e.jsx("p",{className:"text-red-500 text-xs mb-2",children:T}),e.jsxs("div",{className:"flex justify-end gap-2 w-full px-2",children:[e.jsx(I,{variant:"plain",size:"sm",onClick:()=>{if(c.current){const s=c.current.getCanvas();s.getContext("2d").clearRect(0,0,s.width,s.height),c.current.clear()}S("")},children:"Clear"}),e.jsx(I,{variant:"solid",size:"sm",onClick:ee,children:"Save"}),e.jsx(I,{onClick:u,variant:"twoTone",size:"sm",children:"Cancel"})]})]}),i==="type"&&e.jsxs("div",{className:"flex flex-col items-center px-2",children:[e.jsxs("div",{className:"w-full grid grid-cols-1 gap-3 mb-3",children:[e.jsx("label",{children:"Type your signature"}),e.jsx(re,{value:f,onChange:s=>{N(s.target.value),S("")},className:`border rounded-md px-3 py-2 text-center ${T&&!f.trim()?"border-red-500":"border-gray-300"}`,placeholder:"Enter name or initials"}),T&&!f.trim()&&e.jsx("p",{className:"text-red-500 text-xs",children:T}),e.jsxs("div",{className:"w-full grid grid-cols-2 gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("label",{children:"Font Style"}),e.jsx(Me,{value:k,options:[{label:"Great Vibes",value:"Great Vibes"},{label:"Pacifico",value:"Pacifico"},{label:"Dancing Script",value:"Dancing Script"},{label:"Alex Brush",value:"Alex Brush"},{label:"Sacramento",value:"Sacramento"}],onChange:s=>w(s.value)})]}),e.jsxs("div",{children:[e.jsx("label",{children:"Font Size"}),e.jsx(re,{type:"number",value:g,onChange:s=>z(Number(s.target.value)||32),min:30,max:120,className:"border border-gray-300 rounded-md px-3 py-2 text-center"})]})]})]}),e.jsx("div",{className:"border border-gray-300 rounded-md w-full flex items-center justify-center h-40 bg-gray-50 mb-4",style:{fontFamily:k,fontSize:`${g}px`},children:f||"Preview"}),e.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[e.jsx(I,{variant:"solid",size:"sm",onClick:te,children:"Save"}),e.jsx(I,{onClick:u,variant:"twoTone",size:"sm",children:"Cancel"})]})]}),i==="upload"&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2",children:[e.jsx(Be,{accept:"image/*",onChange:s=>le(s[0]),label:"Upload your signature",draggable:!0,className:`w-full ${T&&!m?"border-red-400":""}`,children:e.jsxs("div",{className:"my-8 text-center",children:[e.jsx(We,{className:"text-5xl mx-auto mb-2"}),e.jsx("p",{className:"font-semibold",children:"Drop or browse an image"})]})}),T&&!m&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:T}),m&&e.jsx("img",{src:m,alt:"Uploaded signature",className:"max-h-36 mb-2 border border-gray-300 rounded-md"}),e.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[e.jsx(I,{variant:"solid",size:"sm",onClick:ie,children:"Save"}),e.jsx(I,{onClick:u,variant:"twoTone",size:"sm",children:"Cancel"})]})]}),i==="qr"&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-6 px-2",children:[e.jsx(Ve,{value:H,size:Math.min(240,O.width)}),e.jsx("p",{className:"mt-3 text-sm text-gray-600 text-center",children:"Scan this QR code to sign"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 text-center",children:"After signing via QR, click Close to check for updates"}),e.jsx("div",{className:"mt-6 flex justify-end gap-2 w-full",children:e.jsx(I,{onClick:W,variant:"solid",size:"sm",disabled:G,children:G?"Checking...":"Close"})})]})]})})},Qe=({visible:y,value:u,onClose:F,onSave:P,isLastField:j,onFinalize:p,fieldId:C,containerRef:c})=>{const[i,d]=a.useState(u||""),[m,x]=a.useState(""),f=xe(y?C:null,c);if(a.useEffect(()=>{d(u||""),x("")},[u,y]),!y)return null;const N=g=>{const z=String(g.getMonth()+1).padStart(2,"0"),T=String(g.getDate()).padStart(2,"0"),S=g.getFullYear();return`${z}/${T}/${S}`},k=()=>{if(!i){x("This field is required.");return}x(""),P(i)},w=()=>{if(!i){x("This field is required.");return}j?(P(i),setTimeout(()=>{p==null||p()},150)):k()};return e.jsx("div",{className:"fixed inset-0 z-50",onClick:F,children:e.jsxs("div",{className:"fixed bg-white rounded-xl p-4 shadow-2xl border border-gray-200 w-[320px] sm:w-[380px]",style:{top:`${f.top}px`,left:`${f.left}px`,maxWidth:"calc(100vw - 40px)"},onClick:g=>g.stopPropagation(),children:[e.jsx("div",{className:`absolute w-3 h-3 bg-white border-gray-200 transform rotate-45 ${f.placement==="right"?"-left-1.5 top-6 border-l border-b":f.placement==="left"?"-right-1.5 top-6 border-r border-t":f.placement==="below"?"-top-1.5 left-6 border-l border-t":"-bottom-1.5 left-6 border-r border-b"}`}),e.jsx("h3",{className:"font-semibold text-base mb-2 text-gray-800",children:"Select Date"}),e.jsxs("div",{className:"mb-3",children:[e.jsx(Le,{value:i?new Date(i):void 0,inputFormat:"MM/DD/YYYY",onChange:g=>{if(!g){d("");return}const z=N(g);d(z),m&&x("")},className:"w-full"}),m&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:m})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(I,{variant:"plain",size:"sm",onClick:F,children:"Cancel"}),e.jsx(I,{variant:"solid",size:"sm",onClick:w,disabled:!i,children:j?"Finish":"Save"})]})]})})};function wt(){var de;const[y,u]=a.useState(null),[F,P]=a.useState(""),[j,p]=a.useState(""),[C]=De(),c=C.get("token"),[i,d]=a.useState(!1),[m,x]=a.useState([]),[f,N]=a.useState(!1),[k,w]=a.useState(!1),[g,z]=a.useState(!1),[T,S]=a.useState({visible:!1,fieldId:null,value:""}),G=async t=>{d(!0);try{const n=await Oe(t);if(n instanceof Blob){const o=URL.createObjectURL(n);u(o)}else console.error("Unexpected response type:",n),u(null)}catch(n){console.error("Error fetching document:",n),u(null)}finally{d(!1)}},K=async t=>{var n,o,h,M,J;d(!0);try{const $=await me(t);if($!=null&&$.success&&($!=null&&$.data)){const E=$.data;p(E),w((E==null?void 0:E.partyStatus)==="Signed"),z((E==null?void 0:E.signingOrder)===((o=(n=E==null?void 0:E.allParties)==null?void 0:n.$values)==null?void 0:o.length));const Se={id:1,name:E.partyName,color:"#1E90FF"};if((M=(h=E.assignedFields)==null?void 0:h.$values)!=null&&M.length){const Ne=((J=E==null?void 0:E.allParties)==null?void 0:J.$values)||[],Te=new Map(Ne.map(v=>[v.id,v])),Ce=E.assignedFields.$values.map((v,ke)=>{const ce=!!v.isOwnField,A=Te.get(v.assignedPartyId),ue=v.fieldType===1||v.fieldType===4;return{id:v.id||`field_${ke}`,fieldType:v.fieldType===1?"text":v.fieldType===3?"signature":v.fieldType===4?"date":v.fieldType===2?"initials":"unknown",x:v.x,y:v.y,width:v.width,height:v.height,pageNumber:v.pageNumber,textValue:ue&&v.signatureData||"",isOwnField:ce,assignedPartyId:v.assignedPartyId,assignedUser:ce?Se:{id:`party_${v.assignedPartyId}`,name:(A==null?void 0:A.name)||"Other party",color:(A==null?void 0:A.color)||"#888"},signatureData:ue?null:v.signatureData,signatureToken:v.signatureToken}});x(Ce)}else x([])}else console.error("Unexpected response:",$),x([])}catch($){console.error("Error fetching document:",$),x([])}finally{d(!1)}};a.useEffect(()=>{const t=async n=>{await G(n),await K(n)};c&&(P(c),t(c))},[c]);const[O,X]=a.useState(1),[H]=a.useState(1.5),W=a.useRef(null),[le,ee]=a.useState(Math.round(850*H)),[te,ie]=a.useState(H);a.useEffect(()=>{const t=()=>{const o=W.current,h=32,M=850*H,J=o?o.clientWidth-h:window.innerWidth-h,$=Math.max(260,Math.min(M,Math.floor(J)));ee($),ie($/850)};t();const n=new ResizeObserver(()=>t());return W.current&&n.observe(W.current),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t);try{n.disconnect()}catch{}}},[H]);const[V,s]=a.useState(m);a.useEffect(()=>{m!=null&&m.length&&s(m)},[m]);const r=V.filter(t=>t.isOwnField).sort((t,n)=>t.pageNumber!==n.pageNumber?t.pageNumber-n.pageNumber:t.y!==n.y?t.y-n.y:t.x-n.x),[l,D]=a.useState(0),[L,Y]=a.useState(!1),[U,q]=a.useState({visible:!1,fieldId:null,type:null,field:null}),[R,Z]=a.useState({visible:!1,fieldId:null,value:""}),b=r[l]||null,Q=a.useRef(!1),B=()=>{q({visible:!1,fieldId:null,type:null,field:null}),Z({visible:!1,fieldId:null,value:""}),S({visible:!1,fieldId:null,value:""})};a.useEffect(()=>{var o;if(!L||!b||Q.current||(b.fieldType==="signature"||b.fieldType==="initials"?b.signatureData:(o=b.textValue)!=null&&o.trim()))return;B();const t=document.getElementById(`field-${b.id}`);t&&t.scrollIntoView({behavior:"smooth",block:"center"});const n=setTimeout(()=>{b.fieldType==="signature"||b.fieldType==="initials"?q({visible:!0,fieldId:b.id,type:b.fieldType,field:b}):b.fieldType==="text"?Z({visible:!0,fieldId:b.id,value:b.textValue||""}):b.fieldType==="date"&&S({visible:!0,fieldId:b.id,value:b.textValue||""})},300);return()=>clearTimeout(n)},[l,L,b]);const se=t=>{t!=null&&t.isOwnField&&(Q.current=!0,B(),["signature","initials"].includes(t.fieldType)?q({visible:!0,fieldId:t.id,type:t.fieldType,field:t}):t.fieldType==="text"?Z({visible:!0,fieldId:t.id,value:t.textValue||""}):t.fieldType==="date"&&S({visible:!0,fieldId:t.id,value:t.textValue||""}))};a.useEffect(()=>{!U.visible&&!R.visible&&(Q.current=!1)},[U.visible,R.visible]);const oe=t=>t?t.fieldType==="signature"||t.fieldType==="initials"?!!t.signatureData:t.fieldType==="text"||t.fieldType==="date"?!!(t.textValue&&String(t.textValue).trim().length>0):!0:!0,fe=()=>{for(let t=0;t<r.length;t++)if(!oe(r[t]))return t;return-1},he=()=>{B(),Q.current=!1;const t=r[l];if(t&&!oe(t)){_("Please complete the current field before proceeding.",void 0,"danger"),se(t);return}l<r.length-1&&D(n=>n+1)},pe=()=>{B(),Q.current=!1,l>0&&D(t=>t-1)},ge=async()=>{var n,o;const t=r.map(h=>({fieldId:h.id,value:h.fieldType==="signature"||h.fieldType==="initials"?h.signatureData:h.textValue}));try{d(!0),(await He(c,{signatures:t})).success&&w(!0)}catch(h){console.error(h),_(((o=(n=h==null?void 0:h.response)==null?void 0:n.data)==null?void 0:o.message)??"Failed to submit. Try again.","Error","danger")}finally{d(!1)}},ne=()=>{const t=fe();if(t!==-1){_(`Please complete field ${t+1} before finalizing.`,"Warning","warning");return}B(),Y(!1),N(!0)},ye=t=>{if(s(n=>n.map(o=>o.id===U.fieldId?{...o,signatureData:t}:o)),B(),L){const n=r.findIndex(o=>o.id===U.fieldId);n!==-1&&n===l&&setTimeout(()=>{l<r.length-1&&D(o=>o+1)},50)}},ve=t=>{if(s(n=>n.map(o=>o.id===R.fieldId?{...o,textValue:t}:o)),B(),L){const n=r.findIndex(o=>o.id===R.fieldId);n!==-1&&n===l&&setTimeout(()=>{l<r.length-1&&D(o=>o+1)},50)}},be=t=>{if(s(n=>n.map(o=>o.id===T.fieldId?{...o,textValue:t}:o)),B(),L){const n=r.findIndex(o=>o.id===T.fieldId);n!==-1&&n===l&&setTimeout(()=>{l<r.length-1&&D(o=>o+1)},50)}},we=()=>{N(!1),ge()},je=async()=>{d(!0);const t=await Re(c),n=t.headers["content-type"],o=new Blob([t.data],{type:n}),h=URL.createObjectURL(o);if(d(!1),n.startsWith("image/")||n==="application/pdf")window.open(h,"_blank");else{const M=document.createElement("a");M.href=h,M.download="signed-file",document.body.appendChild(M),M.click(),document.body.removeChild(M)}};return k?e.jsxs(e.Fragment,{children:[i&&e.jsx("div",{className:"flex justify-center items-center absolute inset-0 bg-gray-300 bg-opacity-20 z-50",children:e.jsx(ae,{loading:!0})}),e.jsx("div",{className:" h-[88vh] p-4 bg-white",children:e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsxs("div",{className:"shadow-lg text-center rounded-2xl px-10 py-10 w-[80%] max-w-[800px] h-[50%] bg-custom-600",children:[e.jsx("h2",{className:"text-2xl font-semibold text-center mb-10 text-white",children:"Document Signing Status"}),e.jsx("div",{className:"space-y-8 relative",children:[{id:1,description:"You received the document"},{id:2,description:"You signed the document",link:"Download a copy"},...g?[]:[{id:3,description:"Waiting for next recipient to sign"}]].map(t=>e.jsxs("div",{className:"ticket-activity",children:[e.jsx("div",{className:"t-activity absolute top-0 w-3 h-3 rounded-full bg-custom-500 ring-2 ring-white"}),e.jsxs("div",{className:"",children:[e.jsx("div",{className:"text-sm text-white",children:e.jsx("span",{className:"font-bold",children:t==null?void 0:t.description})}),t.link&&e.jsx("div",{className:"text-xs text-white mt-1 cursor-pointer",onClick:()=>je(),children:t==null?void 0:t.link})]})]},t.id))})]})})})]}):e.jsxs(e.Fragment,{children:[i&&e.jsx("div",{className:"flex justify-center items-center absolute inset-0 bg-gray-300 bg-opacity-20 z-50",children:e.jsx(ae,{loading:!0})}),y?e.jsx($e,{backend:ze,children:e.jsxs("div",{className:"relative flex-1 md:p-4",children:[e.jsx("div",{id:"pdfContainer",ref:W,className:"relative bg-gray-50 border border-gray-300 rounded-lg overflow-auto h-[88vh] flex justify-center items-start md:p-4",children:e.jsx(Ee,{file:y,onLoadSuccess:({numPages:t})=>X(t),loading:"Loading PDF...",children:e.jsx(Ge,{fields:V,scale:te,numPages:O,activeFieldId:(b==null?void 0:b.id)||null,onOpenSignature:(t,n,o)=>{const h=V.find(M=>M.id===t);h&&se(h)},onOpenTextEditor:(t,n)=>{const o=V.find(h=>h.id===t);o&&se(o)}})})}),r.length>0&&e.jsx("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 bg-black text-white rounded-xl shadow-xl px-4 py-3 w-[94vw] sm:w-[80vw] md:w-[70vw] max-w-[760px] flex flex-col items-center z-[100]",children:!L&&!f?e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"text-white text-center mb-2 text-sm sm:text-base",children:"Welcome! Ready to sign your document?"}),e.jsxs("p",{className:"text-xs sm:text-sm font-medium mb-3 text-center",children:["We'll guide you through ",r.length," fields that need your attention."]}),e.jsx(I,{size:"lg",variant:"solid",onClick:()=>Y(!0),children:"Start Signing →"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-full bg-gray-700 h-2 rounded-full mb-3",children:e.jsx("div",{className:"h-2 bg-custom-600 rounded-full transition-all duration-300",style:{width:`${(l+1)/r.length*100}%`}})}),e.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[e.jsx(I,{variant:"default",size:"sm",disabled:l===0,onClick:pe,children:"← Back"}),e.jsxs("p",{className:"text-xs text-gray-300 text-center flex-1",children:["Field ",l+1," of ",r.length]}),e.jsx(I,{variant:"solid",size:"sm",onClick:l===r.length-1?ne:he,children:l===r.length-1?"Finalize →":"Next →"})]})]})}),U.visible&&e.jsx(qe,{visible:!0,type:U.type,onClose:B,onSave:ye,field:U.field,existingSignature:(de=U==null?void 0:U.field)==null?void 0:de.signatureData,tokenParam:c}),R.visible&&e.jsx(Ye,{visible:R.visible,value:R.value,onClose:()=>Z({visible:!1,fieldId:null,value:""}),onSave:ve,isLastField:l===r.length-1,onFinalize:ne,fieldId:R.fieldId,containerRef:W}),T.visible&&e.jsx(Qe,{visible:T.visible,value:T.value,onClose:()=>S({visible:!1,fieldId:null,value:""}),onSave:be,isLastField:l===r.length-1,onFinalize:ne,fieldId:T.fieldId,containerRef:W})]})}):e.jsx(e.Fragment,{children:i?"":"No Pdf Found"}),e.jsx(Ae,{isOpen:f,type:"warning",title:"Confirm Your Electronic Signature",onCancel:()=>N(!1),onConfirm:we,cancelText:"Go Back",confirmText:"Confirm & Sign Document",confirmButtonColor:"custom-600",children:e.jsxs("div",{className:"text-gray-700 text-sm leading-relaxed mt-1",children:["By clicking ",e.jsx("b",{children:'"Confirm & Sign Document"'}),", you are electronically signing this document. This action carries the same legal effect as a handwritten signature.",e.jsx("div",{className:"bg-yellow-50 mt-3 p-3 rounded text-amber-700 border border-amber-200",children:"You agree that all signatures, initials, and data you provided are accurate and intentional."})]})})]})}export{wt as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-mui-98daa63f.js";import{r as s}from"./vendor-react-ece1c85f.js";import{P as d}from"./PageBreadcrumb-cf54a6e9.js";import{R as h,p as f,q as x,r as b}from"./vendor-devex-4076ffeb.js";import"./index-3b5ce20a.js";import{A as l}from"./AdaptableCard-3d1e1f96.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";const g=new h({endpointUrl:"https://js.devexpress.com/Demos/Mvc/api/file-manager-file-system-images"}),F=()=>{s.useState(!1),s.useState(!1),s.useState(!1);const[m,a]=s.useState("Widescreen"),[n,t]=s.useState(!1),[o,i]=s.useState({}),p=s.useCallback(r=>{t(!0),i({name:r.file.name,url:r.file.dataItem.url})},[t,i]),u=s.useCallback(()=>{t(!1)},[t]),c=s.useCallback(r=>{a(r.component.option("currentPath"))},[a]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:[e.jsx(d,{items:[{label:"Documents"}]}),e.jsx("div",{className:"lg:flex items-center justify-between",children:e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Documents"})})]}),e.jsx(l,{className:"m-6 h-full py-4 px-6 bg-transparent",bodyClass:"h-full",children:e.jsxs(l,{className:"borderless",children:[e.jsx(f,{currentPath:m,fileSystemProvider:g,onSelectedFileOpened:p,onCurrentDirectoryChanged:c,height:950,children:e.jsx(x,{create:!0,copy:!0,move:!0,delete:!0,rename:!0,upload:!0,download:!0})}),e.jsx(b,{maxHeight:600,hideOnOutsideClick:!0,showCloseButton:!0,title:o.name,visible:n,onHiding:u,className:"photo-popup-content",children:e.jsx("img",{src:o.url,className:"photo-popup-image"})})]})})]})};export{F as default};
@@ -0,0 +1 @@
1
+ import{j as c}from"./vendor-mui-98daa63f.js";import{c as p,T as a}from"./index-3b5ce20a.js";const{MODE_DARK:i}=a,d=({src:e,darkModeSrc:o,alt:s="",...t})=>{const m=p(r=>r.theme.mode);return c.jsx("img",{src:m===i?o:e,alt:s,...t})};export{d as D};
@@ -1 +1 @@
1
- import{j as r}from"./vendor-mui-69397583.js";import{b4 as D,d as a,b5 as M,b6 as z}from"./index-c62ac197.js";const A=m=>{const{bodyOpenClassName:p,bodyClass:y,children:f,className:b,closable:n=!0,closeTimeoutMS:C=300,footer:i,footerClass:h,headerClass:w,height:o=400,isOpen:d,lockScroll:N=!0,onClose:t,overlayClassName:u,placement:e="right",portalClassName:x,showBackdrop:v=!0,title:s,width:l=400,...j}=m,S=B=>{t==null||t(B)},g=r.jsx(z,{onClick:S}),k=()=>e==="left"||e==="right"?{dimensionClass:"vertical",contentStyle:{width:l},motionStyle:{[e]:`-${l}${typeof l=="number"&&"px"}`}}:e==="top"||e==="bottom"?{dimensionClass:"horizontal",contentStyle:{height:o},motionStyle:{[e]:`-${o}${typeof o=="number"&&"px"}`}}:{motionStyle:{}},{dimensionClass:O,contentStyle:$,motionStyle:c}=k();return r.jsx(D,{className:{base:a("drawer",b),afterOpen:"drawer-after-open",beforeClose:"drawer-before-close"},overlayClassName:{base:a("drawer-overlay",u,!v&&"bg-transparent"),afterOpen:"drawer-overlay-after-open",beforeClose:"drawer-overlay-before-close"},portalClassName:a("drawer-portal",x),bodyOpenClassName:a("drawer-open",N&&"drawer-lock-scroll",p),ariaHideApp:!1,isOpen:d,closeTimeoutMS:C,...j,children:r.jsxs(M.div,{className:a("drawer-content",O),style:$,initial:c,animate:{[e]:d?0:c[e]},children:[s||n?r.jsxs("div",{className:a("drawer-header",w),children:[typeof s=="string"?r.jsx("h4",{children:s}):r.jsx("div",{className:"flex",children:s}),n&&g]}):null,r.jsx("div",{className:a("drawer-body",y),children:f}),i&&r.jsx("div",{className:a("drawer-footer",h),children:i})]})})};A.displayName="Drawer";export{A as D};
1
+ import{j as r}from"./vendor-mui-98daa63f.js";import{bT as D,g as a,bu as M,ah as T}from"./index-3b5ce20a.js";const z=m=>{const{bodyOpenClassName:p,bodyClass:y,children:f,className:h,closable:n=!0,closeTimeoutMS:C=300,footer:i,footerClass:b,headerClass:w,height:o=400,isOpen:d,lockScroll:u=!0,onClose:t,overlayClassName:N,placement:e="right",portalClassName:x,showBackdrop:v=!0,title:s,width:l=400,...j}=m,S=B=>{t==null||t(B)},g=r.jsx(T,{onClick:S}),k=()=>e==="left"||e==="right"?{dimensionClass:"vertical",contentStyle:{width:l},motionStyle:{[e]:`-${l}${typeof l=="number"&&"px"}`}}:e==="top"||e==="bottom"?{dimensionClass:"horizontal",contentStyle:{height:o},motionStyle:{[e]:`-${o}${typeof o=="number"&&"px"}`}}:{motionStyle:{}},{dimensionClass:O,contentStyle:$,motionStyle:c}=k();return r.jsx(D,{className:{base:a("drawer",h),afterOpen:"drawer-after-open",beforeClose:"drawer-before-close"},overlayClassName:{base:a("drawer-overlay",N,!v&&"bg-transparent"),afterOpen:"drawer-overlay-after-open",beforeClose:"drawer-overlay-before-close"},portalClassName:a("drawer-portal",x),bodyOpenClassName:a("drawer-open",u&&"drawer-lock-scroll",p),ariaHideApp:!1,isOpen:d,closeTimeoutMS:C,...j,children:r.jsxs(M.div,{className:a("drawer-content",O),style:$,initial:c,animate:{[e]:d?0:c[e]},children:[s||n?r.jsxs("div",{className:a("drawer-header",w),children:[typeof s=="string"?r.jsx("h4",{children:s}):r.jsx("div",{className:"flex",children:s}),n&&g]}):null,r.jsx("div",{className:a("drawer-body",y),children:f}),i&&r.jsx("div",{className:a("drawer-footer",b),children:i})]})})};z.displayName="Drawer";export{z as D};
@@ -0,0 +1 @@
1
+ import{j as a,l as j}from"./vendor-mui-98daa63f.js";import{u as L,r as E,b as D}from"./index-a733f80b.js";import{D as A,k as N}from"./index-3b5ce20a.js";import{B as W,C as G,O as R,a as k,L as B,c as h,b as T,M,d as H,A as z,f as O,N as P,g as $}from"./OpportunityStatus-ea3b5ee2.js";import{r as s}from"./vendor-react-ece1c85f.js";import{r as b}from"./styles-b7ae7bf6.js";import{A as F}from"./AdaptableCard-3d1e1f96.js";import"./vendor-redux-a1f00e6b.js";import"./WidgetLayoutsService-49730609.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./useControllableState-d0909575.js";import"./index-a14e51de.js";import"./useDidUpdate-de319a18.js";import"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import"./index-8c0643fd.js";import"./esm-c40433f8.js";import"./tableV3-24eed052.js";import"./FileSaver.min-20f3f13a.js";import"./mapView-c8063ed6.js";import"./lodash-306e3f66.js";import"./DensitySelector-5d2e901f.js";import"./NoData-4cc4af03.js";import"./cjs-998de55c.js";const U=[{widgetId:"6f8a2c3e-9d4a-4c3b-9f6e-8b6d3f4a2e91",name:"Bar Graph",component:W,icon:G,layout:{i:"o-1",x:0,y:1/0,w:6,h:3},templateId:"o-1",desc:"Shows a timeline...",configuration:{}},{widgetId:"1b7e9d2a-4c6f-4e1a-b8d3-2a9f6c5e7d10",name:"Data Grid",component:R,icon:k,layout:{i:"o-2",x:0,y:1/0,w:12,h:4},templateId:"o-2",desc:"Displays content...",configuration:{}},{widgetId:"c3f9a6b4-2d7e-4a5f-9e18-6b0d2a4c8f31",name:"Line Graph",component:B,icon:h,layout:{i:"o-3",x:0,y:1/0,w:4,h:2},templateId:"o-3",desc:"Track automation ...",configuration:{}},{widgetId:"9e2d6b5a-7c3f-4a1e-b084-3f6c9d2a8e57",name:"Count Card",component:T,icon:h,layout:{i:"o-4",x:0,y:1/0,w:4,h:1},templateId:"o-4",desc:"Track counts...",configuration:{}},{widgetId:"4a8f2c9d-6b3e-4f1a-9d72-5e8b6c3a2f40",name:"Maps",component:M,icon:H,layout:{i:"o-5",x:0,y:1/0,w:6,h:4},templateId:"o-5",desc:"Visualizes location data...",configuration:{}},{widgetId:"2f6b9a8e-3d4c-4e1a-bf57-9c2d6a8e4b10",name:"Activity Log",component:z,icon:O,layout:{i:"o-7",x:0,y:1/0,w:10,h:3},templateId:"o-7",desc:"Shows a timeline...",configuration:{}},{widgetId:"a9e3f2d6-8b4c-4f1a-9d75-6c2e8b4a0f93",name:"Alert",component:P,icon:$,layout:{i:"o-8",x:0,y:1/0,w:12,h:1},templateId:"o-8",desc:"Displays brief messages...",configuration:{}}],V=d=>{const g=["lg","md","sm","xs","xxs"],c={};return g.forEach(l=>{c[l]=d.map(m=>({...m}))}),c},Y=b.WidthProvider(b.Responsive),_=30,q={className:"layout",breakpoints:{lg:1200},cols:{lg:12,md:10,sm:6,xs:4},rowHeight:_,draggableHandle:".react-grid-dragHandleExample",isDroppable:!0},At=({menuData:d})=>{const{name:g,keyExpr:c,layoutId:l}=d;A("layouts",E);const m=N(),{loadingDetails:x,selectedLayout:J,selectedLayoutData:o}=L(t=>t.layouts.data),[I,p]=s.useState([]),[u,f]=s.useState([]),v=s.useRef({}),w=async()=>{m(D(l))};s.useEffect(()=>{w()},[]),s.useEffect(()=>{var t;if(!((t=o==null?void 0:o.WIDGETS)!=null&&t.length)){p([]),f([]);return}},[o]);const C=V(u);return s.useEffect(()=>{var i;if(!((i=o==null?void 0:o.WIDGETS)!=null&&i.length)){p([]),f([]);return}const t=new Map(o.LAYOUT.map(e=>[e.i,{...e,y:Number.isFinite(e.y)?e.y:0}])),n=o.WIDGETS.map(e=>{const y=U.find(S=>S.templateId===e.templateId);return y?{...y,...e,layout:t.get(e.id)}:null}).filter(Boolean),r=n.map(e=>e.layout).filter(Boolean);p(n),f(r)},[o]),a.jsx("div",{children:a.jsxs(F,{className:"m-6 h-full py-4 px-6 bg-transparent",bodyClass:"h-full",children:[x&&a.jsx(j,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),a.jsx("div",{className:"flex w-full h-[calc(100vh-120px)] gap-4",children:a.jsx("div",{className:"transition-all duration-300 w-full h-full overflow-hidden",children:a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsx(Y,{...q,layouts:C,isDraggable:!1,isResizable:!1,children:I.map(t=>{const n=u.find(i=>i.i===t.id),r=t.component;return a.jsx("div",{"data-grid":n,className:"relative",children:a.jsx("div",{ref:i=>v.current[t.id]=i,className:"relative w-full h-full p-2 bg-white rounded-md shadow-sm group",children:a.jsx("div",{className:`widget-content widget-content-${t.id} overflow-hidden`,style:{width:"100%"},children:r&&a.jsx(r,{widgetData:t})})})},t.id)})},`grid-${u.length}`)})})})]})})};export{At as default};
@@ -1 +1 @@
1
- import{d6 as n}from"./index-c62ac197.js";async function l(a){return(await n.apiV10DynamicTablesPost(a)).data}async function d(a,e,s,t){return(await n.apiV10DynamicTablesTableIdExportGet(a,e,s,t)).data}async function y(a){return(await n.apiV10DynamicTablesTableIdGet(a)).data}async function b(a,e,s,t,o,i,r){return(await n.apiV10DynamicTablesTableIdImportPost(a,e,s,t,o,i,r)).data}async function T(a,e){return(await n.apiV10DynamicTablesTableIdQueryPost(a,e)).data}async function u(a,e){return(await n.apiV10DynamicTablesTableIdRowsPost(a,e)).data}async function m(a,e){return(await n.apiV10DynamicTablesTableIdRowsRowIdDelete(a,e)).data}async function w(a,e,s){return(await n.apiV10DynamicTablesTableIdRowsRowIdPut(a,e,s)).data}async function D(a){return(await n.apiV10DynamicTablesListPost(a)).data}async function I(a){return(await n.apiV10DynamicTablesTableIdDelete(a)).data}async function f(a,e,s){return(await n.apiV10DynamicTablesTableIdRowsRowIdFilesColumnNameGet(a,e,s)).data}async function R(a,e,s,t){return(await n.apiV10DynamicTablesTableIdRowsRowIdFilesColumnNamePost(a,e,s,t)).data}async function P(a,e,s){return(await n.apiV10DynamicTablesTableIdRowsRowIdFilesColumnNameDelete(a,e,s)).data}async function V(a,e){return(await n.apiV10DynamicTablesTableIdSchemaPatch(a,e)).data}export{D as a,l as b,y as c,V as d,I as e,b as f,T as g,m as h,R as i,f as j,P as k,d as l,u as m,w as n};
1
+ import{e7 as n}from"./index-3b5ce20a.js";async function l(a){return(await n.apiV10DynamicTablesPost(a)).data}async function d(a,e,s,t){return(await n.apiV10DynamicTablesTableIdExportGet(a,e,s,t)).data}async function y(a){return(await n.apiV10DynamicTablesTableIdGet(a)).data}async function b(a,e,s,t,o,i,r){return(await n.apiV10DynamicTablesTableIdImportPost(a,e,s,t,o,i,r)).data}async function T(a,e){return(await n.apiV10DynamicTablesTableIdQueryPost(a,e)).data}async function u(a,e){return(await n.apiV10DynamicTablesTableIdRowsPost(a,e)).data}async function m(a,e){return(await n.apiV10DynamicTablesTableIdRowsRowIdDelete(a,e)).data}async function w(a,e,s){return(await n.apiV10DynamicTablesTableIdRowsRowIdPut(a,e,s)).data}async function D(a){return(await n.apiV10DynamicTablesListPost(a)).data}async function I(a){return(await n.apiV10DynamicTablesTableIdDelete(a)).data}async function f(a,e,s){return(await n.apiV10DynamicTablesTableIdRowsRowIdFilesColumnNameGet(a,e,s)).data}async function R(a,e,s,t){return(await n.apiV10DynamicTablesTableIdRowsRowIdFilesColumnNamePost(a,e,s,t)).data}async function P(a,e,s){return(await n.apiV10DynamicTablesTableIdRowsRowIdFilesColumnNameDelete(a,e,s)).data}async function V(a,e){return(await n.apiV10DynamicTablesTableIdSchemaPatch(a,e)).data}export{l as a,y as b,V as c,I as d,b as e,T as f,D as g,m as h,R as i,f as j,P as k,d as l,u as m,w as n};
@@ -0,0 +1 @@
1
+ import{j as t}from"./vendor-mui-98daa63f.js";import{r as h,f as ct}from"./vendor-react-ece1c85f.js";import{_ as it,k as ot,a0 as w,r as B,B as V,cF as rt,D as lt,Z as dt,cE as H,E as J,F as K}from"./index-3b5ce20a.js";import{D as pt}from"./DoubleSidedImage-b4bd3915.js";import{b as G,c as mt,a as ut}from"./vendor-redux-a1f00e6b.js";import{d as ft,e as gt,f as Ct,a as yt}from"./AccountServices-f68f471d.js";import{b as ht}from"./ContactService-8afcaeb7.js";import{a as g,F as xt}from"./FormContainer-9a52b9e8.js";import{h as bt}from"./index-b0ef7ac3.js";import{S as jt}from"./StickyFooter-3e569b80.js";import{C as Dt}from"./ConfirmDialog-2838a642.js";import{u as Q,d as C,c as At,a as wt,F as Nt,b as St}from"./index.esm-b2d342b5.js";import{A as It}from"./AdaptableCard-3d1e1f96.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as X}from"./Drawer-4f97e662.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import{c as Y,C as tt,d as et,a as Ft,b as Et}from"./AddAccount-2cd72664.js";import{a as Ot}from"./index-0b08ce18.js";const q="AccountsData",T=G(`${q}/getAccountsData`,async i=>(await ft(i)).data),P=G(q+"/getAccountDetails",async i=>(await gt(i.id)).data),W=G(`${q}/getAccountContactList`,async i=>(await ht(i)).data),Mt={total:0,pageIndex:1,pageSize:10,query:"",sort:{order:"",key:""}},Rt={loading:!1,deleteConfirmation:!1,selectedRowData:"",tableData:Mt,filterData:{parentAccount:"",primaryContact:"",billingContact:""},accountList:[],contactList:[]},nt=mt({name:`${q}`,initialState:Rt,reducers:{setTableData:(i,a)=>{i.tableData=a.payload},setFilterData:(i,a)=>{i.filterData=a.payload},toggleDeleteConfirmation:(i,a)=>{i.deleteConfirmation=a.payload},setSelectedRowData:(i,a)=>{i.selectedRowData=a.payload}},extraReducers:i=>{i.addCase(T.fulfilled,(a,n)=>{a.accountList=n.payload.$values,a.tableData.total=n.payload.$values.length,a.loading=!1}).addCase(T.pending,a=>{a.loading=!0}).addCase(W.fulfilled,(a,n)=>{a.contactList=n.payload.$values}).addCase(P.fulfilled,(a,n)=>{a.account=n.payload,a.loading=!1}).addCase(P.pending,a=>{a.loading=!0})}}),{setTableData:ce,setFilterData:ie,toggleDeleteConfirmation:re,setSelectedRowData:le}=nt.actions,kt=nt.reducer,zt=ut({data:kt}),$=it,Lt=i=>{var _,v;const a=ot(),{touched:n,errors:o,type:x}=i,{setFieldValue:d}=Q(),b=h.useRef(null),{values:l}=Q(),[k,N]=h.useState(!1),[E,y]=h.useState(""),[z,L]=h.useState(""),[e,u]=h.useState(!1),[A,S]=h.useState(),j=$(s=>{var r,c,p;return(p=(c=(r=s.AccountsData)==null?void 0:r.data)==null?void 0:c.accountList)==null?void 0:p.map(m=>({value:m.id,label:m.accountName}))}),D=$(s=>{var c,p,m;return(m=(p=(c=s==null?void 0:s.AccountsData)==null?void 0:c.data)==null?void 0:p.contactList)==null?void 0:m.map(f=>({value:f.id,label:f.contactName,desc:f}))});h.useEffect(()=>{I()},[]);const I=()=>{const s=W({});a(s),(j==null?void 0:j.length)==0&&a(T({}))},F=(s,r)=>{y(s),L(r),N(!0)},O=s=>{N(!1),d(z,{value:s.id,label:s.contactName}),I(),y(""),L("")},M=()=>{N(!1),y(""),L("")};h.useEffect(()=>{const s=()=>{if(window.google&&window.google.maps){const r=new window.google.maps.places.Autocomplete(b.current,{types:["address"],componentRestrictions:{country:"us"}});r.addListener("place_changed",()=>{const c=r.getPlace();if(c.geometry){const{lat:m,lng:f}=c.geometry.location;d("latitude",m()),d("longitude",f())}let p={};c.address_components.forEach(m=>{const f=m.types;f.includes("locality")?p.city=m.long_name:f.includes("administrative_area_level_1")?p.state=m.short_name:f.includes("postal_code")&&(p.zipcode=m.long_name)}),d("address",c.name),d("city",p.city||""),d("state",p.state||""),d("zip",p.zipcode||"")})}};if(window.google&&window.google.maps)s();else{const r=setInterval(()=>{window.google&&window.google.maps&&(s(),clearInterval(r))},500)}},[i]);const R=()=>{S(null),u(!1),a(W({}))};return t.jsxs(It,{className:"mb-4",children:[t.jsx(g,{label:"Name*",invalid:o.accountName&&n.accountName,errorMessage:o.accountName,children:t.jsx(C,{type:"text",autoComplete:"off",name:"accountName",placeholder:"Account Name",component:w})}),t.jsx(g,{label:"Parent Account",invalid:o.parentAccountId&&n.parentAccountId,errorMessage:o.parentAccountId,children:t.jsx(C,{name:"parentAccountId",children:({field:s,form:r})=>t.jsx(B,{field:s,form:r,options:j,name:"parentAccountId",onChange:c=>{r.setFieldValue(s.name,c)}})})}),t.jsx(g,{label:"Address",invalid:o.address&&n.address,errorMessage:o.address,children:t.jsx(C,{name:"address",children:({field:s})=>t.jsx(w,{...s,ref:b,placeholder:"Address"})})}),t.jsxs("div",{className:"grid md:grid-cols-3 gap-4 py-1",children:[t.jsx(g,{label:"City",invalid:o.city&&n.city,errorMessage:o.city,children:t.jsx(C,{type:"text",autoComplete:"off",name:"city",placeholder:"City",component:w})}),t.jsx(g,{label:"State",invalid:o.state&&n.state,errorMessage:o.state,children:t.jsx(C,{type:"text",autoComplete:"off",name:"state",placeholder:"State",component:w})}),t.jsx(g,{label:"Zip",invalid:o.zip&&n.zip,errorMessage:o.zip,children:t.jsx(C,{type:"text",autoComplete:"off",name:"zip",placeholder:"Zip",component:w})})]}),t.jsxs(g,{label:"Primary Contact",invalid:o.primaryContact&&n.primaryContact,errorMessage:o.primaryContact,children:[t.jsx(C,{name:"primaryContact",children:({field:s,form:r})=>t.jsx(B,{field:s,form:r,options:D,name:"primaryContact",components:{DropdownIndicator:null,IndicatorSeparator:null,Option:Y},componentAs:tt,onCreateOption:c=>F(c,"primaryContact"),onChange:c=>{r.setFieldValue(s.name,c)},styles:{input:c=>({...c,color:"black"})}})}),((_=l==null?void 0:l.primaryContact)==null?void 0:_.value)&&t.jsx(et,{data:l==null?void 0:l.primaryContact,sortedContacts:D,setIsEditModalOpen:u,setEditedId:S})]}),t.jsxs(g,{label:"Billing Contact",invalid:o.billingContact&&n.billingContact,errorMessage:o.billingContact,children:[t.jsx(C,{name:"billingContact",children:({field:s,form:r})=>t.jsx(B,{field:s,form:r,options:D,name:"billingContact",componentAs:tt,components:{DropdownIndicator:null,IndicatorSeparator:null,Option:Y},onCreateOption:c=>F(c,"billingContact"),onChange:c=>{r.setFieldValue(s.name,c)},styles:{input:c=>({...c,color:"black"})}})}),((v=l==null?void 0:l.billingContact)==null?void 0:v.value)&&t.jsx(et,{data:l==null?void 0:l.billingContact,sortedContacts:D,setIsEditModalOpen:u,setEditedId:S})]}),t.jsx(g,{label:"Website",invalid:o.website&&n.website,errorMessage:o.website,children:t.jsx(C,{type:"text",autoComplete:"off",name:"website",placeholder:"Website",component:w})}),t.jsx(g,{label:"Industry",invalid:o.industry&&n.industry,errorMessage:o.industry,children:t.jsx(C,{type:"text",autoComplete:"off",name:"industry",placeholder:"Industry",component:w})}),t.jsx(g,{label:"No of Employees",invalid:o.noOfEmployees&&n.noOfEmployees,errorMessage:o.noOfEmployees,children:t.jsx(C,{type:"text",autoComplete:"off",name:"noOfEmployees",placeholder:"No of Employees",component:w})}),t.jsx(g,{label:"Notes",invalid:o.notes&&n.notes,errorMessage:o.notes,children:t.jsx(C,{type:"text",autoComplete:"off",name:"notes",placeholder:"Notes",component:w,textArea:!0})}),t.jsx(X,{title:"New Contact",isOpen:k,onClose:M,onRequestClose:M,portalClassName:"w30",children:t.jsx(Ft,{onDrawerClose:M,isfromDropdown:!0,onContactCreated:O,newContactName:E})}),t.jsx(X,{title:"Edit Contact",isOpen:e,onClose:R,onRequestClose:R,portalClassName:"w30",children:t.jsx(Et,{id:A,onDrawerClose:R})})]})},{useUniqueId:_t}=bt,at=At().shape({accountName:wt().required("Account name Required")}),vt=({onDelete:i})=>{const[a,n]=h.useState(!1),o=()=>{n(!0)},x=()=>{n(!1)},d=()=>{i==null||i(n)};return t.jsxs(t.Fragment,{children:[t.jsx(V,{className:"text-red-600",variant:"plain",size:"sm",icon:t.jsx(rt,{}),type:"button",onClick:o,children:"Delete"}),t.jsx(Dt,{isOpen:a,type:"danger",title:"Delete Category",confirmButtonColor:"red-600",onClose:x,onRequestClose:x,onCancel:x,onConfirm:d,children:t.jsx("p",{children:"Are you sure you want to delete this? All record related to this role will be deleted as well. This action cannot be undone."})})]})},st=h.forwardRef((i,a)=>{const{type:n,footerWidth:o,initialData:x={id:"",accountName:"",parentAccountId:"",address:"",city:"",state:"",zip:"",primaryContact:"",billingContact:"",notes:""},onFormSubmit:d,onDiscard:b,onDelete:l}=i,k=_t("Lead-");return t.jsx(t.Fragment,{children:t.jsx(Nt,{innerRef:a,initialValues:{...x},validationSchema:at,onSubmit:(N,{setSubmitting:E})=>{const y=N;n==="new"&&(y.id=k),d==null||d(y,E)},children:({values:N,touched:E,errors:y,isSubmitting:z})=>t.jsx(St,{children:t.jsxs(xt,{children:[t.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-1 gap-4",children:t.jsx("div",{className:"lg:col-span-2 pb-8",children:t.jsx(Lt,{type:n,touched:E,errors:y})})}),t.jsxs(jt,{className:`px-8 flex items-center justify-between py-4 ${o}`,stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:[t.jsx("div",{children:n==="edit"&&t.jsx(vt,{onDelete:l})}),t.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[t.jsx(V,{size:"sm",className:"ltr:mr-3 rtl:ml-3",type:"button",onClick:()=>b==null?void 0:b(),children:"Discard"}),t.jsx(V,{size:"sm",variant:"solid",loading:z,icon:t.jsx(Ot,{}),type:"submit",children:"Save"})]})]})]})})})})});st.displayName="AccountForm";lt("AccountsData",zt);const de=i=>{const{id:a,footerWidth:n,onDrawerClose:o}=i,x=ot();ct();const d=$(e=>e.AccountsData.data.tableData),b=$(e=>{var u,A,S,j,D,I,F,O,M,R,_,v,s,r,c,p,m,f,U,Z;return{...(A=(u=e.AccountsData)==null?void 0:u.data)==null?void 0:A.account,primaryContact:{value:(D=(j=(S=e.AccountsData)==null?void 0:S.data)==null?void 0:j.account)==null?void 0:D.primaryContact,label:(O=(F=(I=e.AccountsData)==null?void 0:I.data)==null?void 0:F.account)==null?void 0:O.primaryContactName},billingContact:{value:(_=(R=(M=e.AccountsData)==null?void 0:M.data)==null?void 0:R.account)==null?void 0:_.billingContact,label:(r=(s=(v=e.AccountsData)==null?void 0:v.data)==null?void 0:s.account)==null?void 0:r.billingContactName},parentAccountId:{value:(m=(p=(c=e.AccountsData)==null?void 0:c.data)==null?void 0:p.account)==null?void 0:m.parentAccountId,label:(Z=(U=(f=e.AccountsData)==null?void 0:f.data)==null?void 0:U.account)==null?void 0:Z.parentAccountName}}}),l=$(e=>{var u,A;return(A=(u=e.AccountsData)==null?void 0:u.data)==null?void 0:A.loading}),k=e=>{x(P({id:e}))},N=()=>{x(T({}))},E=async(e,u)=>{var j,D,I,F,O;u(!0);const A={accountName:e.accountName??"",parentAccount:(j=e.parentAccountId)!=null&&j.value&&((D=e.parentAccountId)==null?void 0:D.value)!==""?(I=e.parentAccountId)==null?void 0:I.value:void 0,address:e.address??"",city:e.city??"",state:e.state??"",zip:e.zip??"",primaryContact:(F=e==null?void 0:e.primaryContact)==null?void 0:F.value,billingContact:(O=e==null?void 0:e.billingContact)==null?void 0:O.value,notes:e.notes??"",website:e.website??"",noOfEmployees:e.noOfEmployees??"",industry:e.industry??"",latitude:(e==null?void 0:e.latitude)??"",longitude:(e==null?void 0:e.longitude)??""},S=await Ct(a,A);u(!1),S&&(L("updated"),N(),o())},y=()=>{o()},z=async e=>{e(!1),await yt(a)&&(x(T(d)),J.push(t.jsx(K,{title:"Deleted",type:"success",duration:2500,children:"Account Successfully Deleted"}),{placement:"top-center"}),y())},L=e=>{J.push(t.jsxs(K,{title:"Success",type:"success",duration:2500,children:["Account Successfully ",e]}),{placement:"top-center"})};return h.useEffect(()=>{k(a)},[a]),t.jsxs(t.Fragment,{children:[t.jsx(dt,{loading:l,children:!H(b)&&t.jsx(t.Fragment,{children:t.jsx(st,{type:"edit",footerWidth:n,initialData:b,onFormSubmit:E,onDiscard:y,onDelete:z})})}),!l&&H(b)&&t.jsxs("div",{className:"h-full flex flex-col items-center justify-center",children:[t.jsx(pt,{src:"/img/others/img-2.png",darkModeSrc:"/img/others/img-2-dark.png",alt:"No product found!"}),t.jsx("h3",{className:"mt-8",children:"No account found!"})]})]})};export{de as E,le as a,P as g,zt as r,ie as s,re as t,$ as u};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-mui-98daa63f.js";import{k as J,a0 as ce,B as z,cF as Ce,E as F,F as v,r as se,d4 as fe,D as Ee,Z as ke,cE as ue}from"./index-3b5ce20a.js";import{u as T,g as Oe,b as Ue,c as Me,a as re,r as Re,d as Be,e as qe,f as Ae}from"./index-91505016.js";import{r as w,f as Se}from"./vendor-react-ece1c85f.js";import{D as $e}from"./DoubleSidedImage-b4bd3915.js";import{a as q,F as xe}from"./FormContainer-9a52b9e8.js";import{h as ge}from"./index-b0ef7ac3.js";import{S as je}from"./StickyFooter-3e569b80.js";import{C as De}from"./ConfirmDialog-2838a642.js";import{d as A,c as H,a as be,F as ye,b as we,u as Ve,i as Te}from"./index.esm-b2d342b5.js";import{A as Le}from"./AdaptableCard-3d1e1f96.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as oe}from"./Drawer-4f97e662.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import{U as ze}from"./Upload-be937eb6.js";import{C as ne,c as Pe,d as Ge,e as We,f as _e,a as Qe,b as Xe,E as Ze}from"./AddAccount-2cd72664.js";import{b as Ne,c as He,a as Je}from"./vendor-redux-a1f00e6b.js";import{a as Ke,b as Ye,c as ea}from"./LeadSourceService-cf71ea64.js";import{a as Ie}from"./index-0b08ce18.js";import{g as aa}from"./index-0fd6e996.js";import{g as ta}from"./AccountServices-f68f471d.js";import{c as oa}from"./ContactService-8afcaeb7.js";import{V as me,i as sa}from"./validationPatterns-77446c46.js";const le="LeadSourceData",de=Ne(`${le}/getLeadSourceData`,async c=>(await Ke(c)).data),pe=Ne(le+"/getLeadSourceDetails",async c=>(await Ye(c.id)).data),na={total:0,pageIndex:1,pageSize:10,query:"",sort:{order:"",key:""}},ca={loading:!1,deleteConfirmation:!1,selectedRowData:"",tableData:na,filterData:{name:"",category:["bags","cloths","devices","shoes","watches"],status:[0,1,2],productStatus:0},leadSourceList:[]},Fe=He({name:`${le}`,initialState:ca,reducers:{setTableData:(c,o)=>{c.tableData=o.payload},setFilterData:(c,o)=>{c.filterData=o.payload},toggleDeleteConfirmation:(c,o)=>{c.deleteConfirmation=o.payload},setSelectedRowData:(c,o)=>{c.selectedRowData=o.payload}},extraReducers:c=>{c.addCase(de.fulfilled,(o,r)=>{o.leadSourceList=r.payload.$values,o.tableData.total=r.payload.$values.length,o.loading=!1}).addCase(de.pending,o=>{o.loading=!0}).addCase(pe.fulfilled,(o,r)=>{o.leadSource=r.payload,o.loading=!1}).addCase(pe.pending,o=>{o.loading=!0})}});Fe.actions;const ra=Fe.reducer;Je({data:ra});const da=c=>{J();const{touched:o,errors:r,type:u}=c;return e.jsxs(Le,{className:"mb-4",children:[e.jsx(q,{label:"Lead Source",invalid:r.leadSourceName&&o.leadSourceName,errorMessage:r.leadSourceName,children:e.jsx(A,{type:"text",autoComplete:"off",name:"leadSourceName",placeholder:"Lead Source",component:ce})}),e.jsx(q,{label:"Description",invalid:r.leadSourceDescription&&o.leadSourceDescription,errorMessage:r.leadSourceDescription,children:e.jsx(A,{type:"text",autoComplete:"off",name:"leadSourceDescription",placeholder:"Description",component:ce,textArea:!0})})]})},{useUniqueId:la}=ge,he=H().shape({leadSourceName:be().required("Lead Source name Required")}),ia=({onDelete:c})=>{const[o,r]=w.useState(!1),u=()=>{r(!0)},l=()=>{r(!1)},f=()=>{c==null||c(r)};return e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"text-red-600",variant:"plain",size:"sm",icon:e.jsx(Ce,{}),type:"button",onClick:u,children:"Delete"}),e.jsx(De,{isOpen:o,type:"danger",title:"Delete Category",confirmButtonColor:"red-600",onClose:l,onRequestClose:l,onCancel:l,onConfirm:f,children:e.jsx("p",{children:"Are you sure you want to delete this? All record related to this role will be deleted as well. This action cannot be undone."})})]})},ve=w.forwardRef((c,o)=>{const{type:r,initialData:u={id:"",leadSourceName:""},onFormSubmit:l,onDiscard:f,onDelete:b}=c,L=la("LeadSource-");return e.jsx(e.Fragment,{children:e.jsx(ye,{innerRef:o,initialValues:{...u},validationSchema:he,onSubmit:(C,{setSubmitting:x})=>{const D=C;r==="new"&&(D.id=L),l==null||l(D,x)},children:({values:C,touched:x,errors:D,isSubmitting:S})=>e.jsx(we,{children:e.jsxs(xe,{children:[e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-1 gap-4",children:e.jsx("div",{className:"lg:col-span-2 pb-8",children:e.jsx(da,{type:r,touched:x,errors:D})})}),e.jsxs(je,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:[e.jsx("div",{children:r==="edit"&&e.jsx(ia,{onDelete:b})}),e.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(z,{size:"sm",className:"ltr:mr-3 rtl:ml-3",type:"button",onClick:()=>f==null?void 0:f(),children:"Discard"}),e.jsx(z,{size:"sm",variant:"solid",loading:S,icon:e.jsx(Ie,{}),type:"submit",children:"Save"})]})]})]})})})})});ve.displayName="LeadSourceForm";const ua=c=>{const{onDrawerClose:o,customerId:r,onContactCreated:u,isfromDropdown:l=!1,newContactName:f=""}=c;Se();const b=J();w.useState(!1);const L=async S=>await ea(S),C=()=>{b(de({}))},x=async(S,N)=>{N(!0);const y={leadSourceName:S.leadSourceName??"",leadSourceDescription:S.leadSourceDescription??""};L(y).then(s=>{s.success&&(F.push(e.jsx(v,{title:"Success",type:"success",duration:2500,children:"Lead Source Successfully Added"}),{placement:"top-center"}),u&&u(s==null?void 0:s.data),C(),o())}).catch(s=>{var h=s.response.data;N(!1),F.push(e.jsx(v,{title:"Error",type:"danger",duration:2500,children:h.message}),{placement:"top-center"})})},D=()=>{o()};return e.jsx(e.Fragment,{children:e.jsx(ve,{type:"new",onFormSubmit:x,onDiscard:D,initialData:l?{id:"",leadSourceName:f}:void 0})})},ma=c=>{const o=J(),{touched:r,errors:u,values:l}=c,[f,b]=w.useState(),{setFieldValue:L}=Ve(),[C,x]=w.useState(!1),[D,S]=w.useState(!1),[N,y]=w.useState(""),[s,h]=w.useState(""),[j,k]=w.useState(!1),[O,I]=w.useState(void 0),[M,U]=w.useState(!1),E=T(a=>{var i,n,d;return(d=(n=(i=a.LeadsData)==null?void 0:i.data)==null?void 0:n.leadSourceList)==null?void 0:d.map(t=>({value:t.id,label:t.leadSourceName}))}),R=T(a=>{var i,n,d;return(d=(n=(i=a.LeadsData)==null?void 0:i.data)==null?void 0:n.contactList)==null?void 0:d.map(t=>({value:t.id,label:t.contactName,desc:t}))}),B=T(a=>{var i,n;return(n=(i=a==null?void 0:a.AccountsData)==null?void 0:i.data.accountList)==null?void 0:n.map(d=>({value:d.id,label:d.accountName,desc:d}))}),$=()=>{o(Oe({}))},V=()=>{o(aa({}))},P=()=>{o(Ue({}))};w.useEffect(()=>{P(),$(),V()},[]);const K=(a,i)=>{y(a),h(i),oa({contactName:a??"",email:"",contactNumber:"",contactPosistion:void 0,accountId:void 0,notes:"",departmentId:void 0,preferredContactTime:""}).then(d=>{d.success&&(F.push(e.jsx(v,{title:"Success",type:"success",duration:2500,children:"Contact Successfully Added"}),{placement:"top-center"}),G(d==null?void 0:d.data))}).catch(d=>{var t,g;F.push(e.jsx(v,{title:"Error",type:"danger",duration:2500,children:(g=(t=d==null?void 0:d.response)==null?void 0:t.data)==null?void 0:g.message}),{placement:"top-center"})})},Y=(a,i)=>{y(a),h(i),S(!0)},ee=async(a,i)=>{y(a),h(i),ta({accountName:a??"",parentAccount:void 0,address:"",city:"",state:"",zip:"",primaryContact:void 0,billingContact:void 0,notes:"",website:"",noOfEmployees:"",industry:"",latitude:null,longitude:null}).then(d=>{d.success&&(F.push(e.jsx(v,{title:"Success",type:"success",duration:2500,children:"Account Successfully Added"}),{placement:"top-center"}),ae(d==null?void 0:d.data))}).catch(d=>{var t,g;F.push(e.jsx(v,{title:"Error",type:"danger",duration:2500,children:(g=(t=d==null?void 0:d.response)==null?void 0:t.data)==null?void 0:g.message}),{placement:"top-center"})})},G=a=>{x(!1),L("contactId",{value:a.id,label:a.contactName,desc:a}),$(),y(""),h("")},W=()=>{x(!1),y(""),h("")},_=()=>{S(!1),y(""),h("")},ae=a=>{x(!1),L("company",{value:a.id,label:a.accountName,desc:a}),V(),y(""),h("")},te=a=>{x(!1),L(s,{value:a.id,label:a.leadSourceName}),P(),y(""),h("")},Q=()=>{I(void 0),k(!1),$()},X=()=>{I(void 0),U(!1),V()},m=u,p=r;return e.jsxs(Le,{className:"mb-4",children:[e.jsx(q,{label:"Lead Source",asterisk:!0,invalid:u.leadSourceId&&r.leadSourceId,errorMessage:u.leadSourceId,children:e.jsx(A,{name:"leadSourceId",children:({field:a,form:i})=>e.jsx(se,{field:a,form:i,options:E,name:"leadSourceId",placeholder:"Create or Select Lead Sources",components:{DropdownIndicator:null,IndicatorSeparator:null},componentAs:ne,onCreateOption:n=>Y(n,"leadSourceId"),onChange:n=>{i.setFieldValue(a.name,n)},styles:{control:(n,d)=>({...n,borderColor:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"red":n.borderColor,boxShadow:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"0 0 0 1px red":d.isFocused?"0 0 0 1px #2684FF":n.boxShadow,"&:hover":{borderColor:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"red":n.borderColor}}),input:n=>({...n,color:"black"})}})})}),e.jsxs(q,{label:"Contact",asterisk:!0,invalid:u.contactId&&r.contactId,errorMessage:u.contactId,children:[e.jsx(A,{name:"contactId",children:({field:a,form:i})=>{const n=i.values.contactId,d=R==null?void 0:R.sort((t,g)=>t.value===(n==null?void 0:n.value)?-1:g.value===(n==null?void 0:n.value)?1:0);return e.jsx(se,{id:"contact-select",field:a,form:i,options:d,name:"contactId",placeholder:"Create or Select Contact",components:{DropdownIndicator:null,IndicatorSeparator:null,Option:t=>e.jsx(Pe,{...t,setIsEditModalOpen:k,setEditedId:I})},componentAs:ne,onCreateOption:t=>K(t,"contactId"),onChange:t=>{var g,Z;i.setFieldValue(a.name,t),i.setFieldValue("company",{label:(g=t==null?void 0:t.desc)==null?void 0:g.accountName,value:(Z=t==null?void 0:t.desc)==null?void 0:Z.accountId})},styles:{control:(t,g)=>({...t,borderColor:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"red":t.borderColor,boxShadow:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"0 0 0 1px red":g.isFocused?"0 0 0 1px #2684FF":t.boxShadow,"&:hover":{borderColor:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"red":t.borderColor}}),input:t=>({...t,color:"black"})}})}}),(l==null?void 0:l.contactId)&&e.jsx(Ge,{data:l==null?void 0:l.contactId,sortedContacts:R,setIsEditModalOpen:k,setEditedId:I})]}),e.jsxs(q,{label:"Company",invalid:u.company&&r.company,errorMessage:u.company,asterisk:!0,children:[e.jsx(A,{name:"company",children:({field:a,form:i})=>{const n=i.values.company,d=B==null?void 0:B.sort((t,g)=>t.value===(n==null?void 0:n.value)?-1:g.value===(n==null?void 0:n.value)?1:0);return e.jsx(se,{id:"company-select",field:a,form:i,options:d,placeholder:"Create or Select Company",name:"company",componentAs:ne,onCreateOption:t=>ee(t,"company"),components:{DropdownIndicator:null,IndicatorSeparator:null,Option:We},onChange:t=>{i.setFieldValue(a.name,t)},styles:{control:(t,g)=>({...t,borderColor:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"red":t.borderColor,boxShadow:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"0 0 0 1px red":g.isFocused?"0 0 0 1px #2684FF":t.boxShadow,"&:hover":{borderColor:m!=null&&m[a.name]&&(p!=null&&p[a.name])?"red":t.borderColor}}),input:t=>({...t,color:"black"})}})}}),(l==null?void 0:l.company)&&e.jsx(_e,{data:l==null?void 0:l.company,sortedAccounts:B,setIsEditModalOpen:U,setEditedId:I})]}),e.jsx(q,{label:"Notes",invalid:u.notes&&r.notes,errorMessage:u.notes,children:e.jsx(A,{textArea:!0,type:"text",autoComplete:"off",name:"notes",placeholder:"Notes",component:ce})}),e.jsxs(q,{label:"Business Card/Visiting Card",invalid:!!(u.bussinessCardUrl&&r.bussinessCardUrl),errorMessage:u.bussinessCardUrl,children:[e.jsx(A,{name:"bussinessCardUrl",children:({field:a,form:i})=>e.jsx(ze,{draggable:!0,multiple:!1,aspectRatio:4/3,onChange:n=>{i.setFieldValue(a.name,n),b(n[0])},onFileRemove:n=>i.setFieldValue(a.name,n)})}),f&&e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx("img",{style:{width:"75%",padding:"1rem"},className:"upload-file-image",src:URL.createObjectURL(f),alt:`file preview ${f.fileName}`})})]}),e.jsx(oe,{title:"New Contact",isOpen:C,onClose:W,showBackdrop:!1,portalClassName:"w30",children:e.jsx(Qe,{onDrawerClose:W,isfromDropdown:!0,onContactCreated:G,newContactName:N})}),e.jsx(oe,{title:"New Lead Source",isOpen:D,onClose:_,showBackdrop:!1,portalClassName:"w30",children:e.jsx(ua,{onDrawerClose:_,isfromDropdown:!0,onContactCreated:te,newContactName:N})}),e.jsx(oe,{title:"Edit Contact",isOpen:j,onClose:Q,portalClassName:"w30",showBackdrop:!1,children:e.jsx(Xe,{id:O,onDrawerClose:Q})}),e.jsx(oe,{title:"Edit Account",isOpen:M,onClose:X,portalClassName:"w30",showBackdrop:!1,children:e.jsx(Ze,{id:O,onDrawerClose:X})})]})},{useUniqueId:pa}=ge,ha=be().matches(me.sqlInjectionSafe,"Invalid input: SQL keywords not allowed").matches(me.noSpecialChars,"Special characters like < > = { } are not allowed").test("no-base64","Base64 encoded content is not allowed",c=>c?!sa(c.trim()):!0),Ca=H().shape({leadSourceId:H().required("Lead source Required"),contactId:H().required("Contact is required"),company:H().required("Company is required"),bussinessCardUrl:Te().max(1,"At least one file uploaded!"),notes:ha}),fa=({onDelete:c})=>{const[o,r]=w.useState(!1),u=()=>{r(!0)},l=()=>{r(!1)},f=()=>{c==null||c(r)};return e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"text-red-600",variant:"plain",size:"sm",icon:e.jsx(Ce,{}),type:"button",onClick:u,children:"Delete"}),e.jsx(De,{isOpen:o,type:"danger",title:"Delete Lead",confirmButtonColor:"red-600",onClose:l,onRequestClose:l,onCancel:l,onConfirm:f,children:e.jsx("p",{children:"Are you sure you want to delete this lead? This action cannot be undone."})})]})},ie=w.forwardRef((c,o)=>{const{type:r,footerWidth:u,initialData:l={id:"",leadSourceId:"",contactId:"",company:"",bussinessCardUrl:"",notes:""},onFormSubmit:f,onDiscard:b,onDelete:L}=c,C=pa("Lead-");return e.jsx(ye,{innerRef:o,initialValues:{...l},validationSchema:Ca,onSubmit:(x,{setSubmitting:D})=>{const S={...x};r==="new"&&(S.id=C),f==null||f(S,D)},children:({values:x,touched:D,errors:S,isSubmitting:N})=>e.jsx(we,{children:e.jsx(xe,{children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-1 gap-4",children:[e.jsx("div",{className:"lg:col-span-2 pb-8",children:e.jsx(ma,{type:r,touched:D,errors:S,values:x})}),e.jsxs(je,{className:`px-8 flex items-center justify-between py-4 ${u?`md:${u}`:""}`,stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:[e.jsx("div",{children:r==="edit"&&e.jsx(fa,{onDelete:L})}),e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsx(z,{size:"sm",className:"ltr:mr-3 rtl:ml-3",type:"button",onClick:()=>b==null?void 0:b(),children:"Discard"}),e.jsx(z,{size:"sm",variant:"solid",loading:N,icon:e.jsx(Ie,{}),type:"submit",children:"Save"})]})]})]})})})})});ie.displayName="LeadForm";const Pa=c=>{const{onDrawerClose:o,footerWidth:r,onContactCreated:u}=c,l=J(),f=()=>{fe(),l(re({}))},b=async(C,x)=>{var S,N,y,s,h;x(!0);const D={leadSourceId:((S=C.leadSourceId)==null?void 0:S.value)??"",notes:(C==null?void 0:C.notes)??"",contactId:((N=C.contactId)==null?void 0:N.value)??"",accountId:((y=C.company)==null?void 0:y.value)??"",website:C.website??"",noOfEmployees:C.noOfEmployees??"",preferredContactTime:C.preferredContactTime??"",industry:C.industry??"",bussinessCardImagePath:"",BussinessCardFile:C.bussinessCardUrl};try{const j=await Me(D,[]);j.success&&(F.push(e.jsx(v,{title:"Success",type:"success",duration:2500,children:"Leads Successfully Added"}),{placement:"top-center"}),u&&u(j==null?void 0:j.data),f(),o())}catch(j){x(!1),F.push(e.jsx(v,{title:"Error",type:"danger",duration:2500,children:((h=(s=j==null?void 0:j.response)==null?void 0:s.data)==null?void 0:h.message)||"Something went wrong. Please try again!"}),{placement:"top-center"})}},L=()=>{o()};return e.jsx(ie,{type:"new",footerWidth:r,onFormSubmit:b,onDiscard:L})};Ee("LeadsData",Re);const Ga=c=>{const{id:o,footerWidth:r,onDrawerClose:u}=c,l=J();Se();const f=T(s=>s.LeadsData.data.tableData),b=T(s=>{var h,j,k,O,I,M,U,E,R,B,$,V,P,K,Y,ee,G,W,_,ae,te,Q,X,m,p,a,i,n,d,t,g,Z;return{...(j=(h=s.LeadsData)==null?void 0:h.data)==null?void 0:j.lead,bussinessCardUrl:[],leadSourceId:{value:(I=(O=(k=s.LeadsData)==null?void 0:k.data)==null?void 0:O.lead)==null?void 0:I.leadSourceId,label:(E=(U=(M=s.LeadsData)==null?void 0:M.data)==null?void 0:U.lead)==null?void 0:E.leadSource},contactId:{value:($=(B=(R=s.LeadsData)==null?void 0:R.data)==null?void 0:B.lead)==null?void 0:$.contactId,label:(K=(P=(V=s.LeadsData)==null?void 0:V.data)==null?void 0:P.lead)==null?void 0:K.contactName,desc:{contactNumber:(G=(ee=(Y=s.LeadsData)==null?void 0:Y.data)==null?void 0:ee.lead)==null?void 0:G.contactNumber,contactPosistion:(ae=(_=(W=s.LeadsData)==null?void 0:W.data)==null?void 0:_.lead)==null?void 0:ae.contactPosistion,email:(X=(Q=(te=s.LeadsData)==null?void 0:te.data)==null?void 0:Q.lead)==null?void 0:X.email}},notes:(a=(p=(m=s.LeadsData)==null?void 0:m.data)==null?void 0:p.lead)==null?void 0:a.notes,company:{value:(d=(n=(i=s.LeadsData)==null?void 0:i.data)==null?void 0:n.lead)==null?void 0:d.accountId,label:(Z=(g=(t=s.LeadsData)==null?void 0:t.data)==null?void 0:g.lead)==null?void 0:Z.accountName}}}),L=T(s=>{var h,j;return(j=(h=s.LeadsData)==null?void 0:h.data)==null?void 0:j.loading}),C=s=>{l(Be({id:s}))},x=()=>{fe(),l(re({}))},D=async(s,h)=>{var k,O,I,M,U;h(!0);const j={leadSourceId:((k=s.leadSourceId)==null?void 0:k.value)??"",contactId:((O=s.contactId)==null?void 0:O.value)??"",accountId:((I=s.company)==null?void 0:I.value)??"",website:s.website??"",noOfEmployees:s.noOfEmployees??"",preferredContactTime:s.preferredContactTime??"",industry:s.industry??"",bussinessCardImagePath:"",BussinessCardFile:s.bussinessCardUrl,notes:(s==null?void 0:s.notes)??""};try{const E=await qe(o,j);h(!1),E&&(y("updated"),x(),u())}catch(E){F.push(e.jsx(v,{title:"Error",type:"danger",duration:2500,children:((U=(M=E==null?void 0:E.response)==null?void 0:M.data)==null?void 0:U.message)||"Something went wrong. please try again!"}),{placement:"top-center"})}},S=()=>{u()},N=async s=>{s(!1),await Ae(o)&&(l(re(f)),F.push(e.jsx(v,{title:"Deleted",type:"success",duration:2500,children:"Lead Successfully Deleted"}),{placement:"top-center"}),S())},y=s=>{F.push(e.jsxs(v,{title:"Success",type:"success",duration:2500,children:["Lead Successfully ",s]}),{placement:"top-center"})};return w.useEffect(()=>{C(o)},[o]),e.jsxs(e.Fragment,{children:[e.jsx(ke,{loading:L,children:!ue(b)&&e.jsx(e.Fragment,{children:e.jsx(ie,{type:"edit",footerWidth:r,initialData:b,onFormSubmit:D,onDiscard:S,onDelete:N})})}),!L&&ue(b)&&e.jsxs("div",{className:"h-full flex flex-col items-center justify-center",children:[e.jsx($e,{src:"/img/others/img-2.png",darkModeSrc:"/img/others/img-2-dark.png",alt:"No product found!"}),e.jsx("h3",{className:"mt-8",children:"No lead found!"})]})]})};export{Pa as A,Ga as E};
@@ -0,0 +1,6 @@
1
+ import{j as e}from"./vendor-mui-98daa63f.js";import{r as u}from"./vendor-react-ece1c85f.js";import{P as $}from"./PageBreadcrumb-cf54a6e9.js";import{bz as G,bA as H,cH as Z,cF as J,a0 as E,B as C,dm as w,Z as K,E as m,F as x}from"./index-3b5ce20a.js";import{A as W}from"./AdaptableCard-3d1e1f96.js";import{C as X}from"./ConfirmDialog-2838a642.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as Y}from"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import{u as _,a as ee,S as se,v as te}from"./sortable.esm-0625cd17.js";import{C as re,u as ae,a as ne,P as ie,D as ce,c as oe}from"./core.esm-4386752a.js";import{S as le}from"./StickyFooter-3e569b80.js";import{c as de,a as q,F as pe,b as ue}from"./index.esm-b2d342b5.js";import{u as me}from"./usePermission-4689548c.js";import{N as xe}from"./NoData-4cc4af03.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";const he=({faq:a,index:r,onEdit:l,onDelete:h,permissions:c,expanded:d,onToggleExpand:i})=>{const{attributes:j,listeners:p,setNodeRef:g,transform:y,transition:Q}=_({id:a.id}),v={transform:re.Transform.toString(y),transition:Q};return e.jsxs("div",{ref:g,style:v,className:"mb-2 border border-gray-200 rounded-lg bg-white",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 px-4 py-3 sm:px-6 sm:py-4 hover:bg-gray-50",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx("div",{...j,...p,className:"cursor-move pt-1 text-gray-400 hover:text-gray-600 shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[e.jsx("circle",{cx:"3",cy:"3",r:"1"}),e.jsx("circle",{cx:"3",cy:"8",r:"1"}),e.jsx("circle",{cx:"3",cy:"13",r:"1"}),e.jsx("circle",{cx:"8",cy:"3",r:"1"}),e.jsx("circle",{cx:"8",cy:"8",r:"1"}),e.jsx("circle",{cx:"8",cy:"13",r:"1"}),e.jsx("circle",{cx:"13",cy:"3",r:"1"}),e.jsx("circle",{cx:"13",cy:"8",r:"1"}),e.jsx("circle",{cx:"13",cy:"13",r:"1"})]})}),e.jsx("h4",{onClick:i,className:`\r
2
+ text-gray-900 font-semibold text-sm sm:text-base\r
3
+ cursor-pointer\r
4
+ break-words\r
5
+ sm:truncate\r
6
+ `,children:a.question})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:i,className:"p-1 text-gray-600",children:d?e.jsx(G,{}):e.jsx(H,{})}),(c==null?void 0:c.isEdit)&&e.jsx("button",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-custom-600 hover:bg-custom-700",onClick:F=>{F.stopPropagation(),l(a)},children:e.jsx(Z,{className:"text-white",size:16})}),(c==null?void 0:c.isDelete)&&e.jsx("button",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-red-700 hover:bg-red-800",onClick:F=>{F.stopPropagation(),h(a.id)},children:e.jsx(J,{className:"text-white",size:16})})]})]}),d&&e.jsx("div",{className:"px-4 sm:px-6 py-3 bg-gray-50 text-gray-700 text-sm break-words",children:a.answer||"No answer provided."})]})},fe=de().shape({question:q().required("Question is required"),answer:q().required("Answer is required")}),je=({open:a,onClose:r,onSubmit:l,initialValues:h,loading:c})=>e.jsx(Y,{isOpen:a,onClose:r,size:"md",portalClassName:"w30",title:h?"Edit FAQ":"Add FAQ",children:e.jsx(pe,{initialValues:h||{question:"",answer:""},validationSchema:fe,enableReinitialize:!0,onSubmit:(d,{resetForm:i})=>{l(d),i()},children:({values:d,errors:i,touched:j,handleChange:p,handleBlur:g})=>e.jsxs(ue,{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex-1 space-y-6 overflow-y-auto",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium mb-2",children:["Question ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(E,{name:"question",placeholder:"Enter FAQ question",value:d.question,onChange:p,onBlur:g}),i.question&&j.question&&e.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.question})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium mb-2",children:["Answer ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(E,{name:"answer",placeholder:"Enter FAQ answer",value:d.answer,onChange:p,onBlur:g,textArea:!0,rows:5}),i.answer&&j.answer&&e.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.answer})]})]}),e.jsx(le,{className:"px-6 py-4 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:e.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(C,{size:"sm",className:"ltr:mr-3 rtl:ml-3",onClick:r,children:"Cancel"}),e.jsx(C,{loading:c,size:"sm",type:"submit",variant:"solid",children:h?"Update FAQ":"Add FAQ"})]})})]})})});async function ye(){return(await w.apiV10FAQGetFAQsPost()).data}async function ge(a){return(await w.apiV10FAQAddFAQPost(a)).data}async function Fe(a,r){return(await w.apiV10FAQUpdateFAQIdPost(a,r)).data}async function be(a){return(await w.apiV10FAQDeleteFAQIdPost(a)).data}async function Ae(a){return(await w.apiV10FAQReorderFAQsPost(a)).data}const Xe=()=>{const a=ae(ne(ie)),[r,l]=u.useState([]),[h,c]=u.useState(null),[d,i]=u.useState(!1),[j,p]=u.useState(!1),[g,y]=u.useState(!1),[Q,v]=u.useState(null),[F,f]=u.useState(!1),N=me("FAQ"),[P,k]=u.useState(null),I=s=>{k(n=>n===s?null:s)},b=async()=>{var s,n;f(!0);try{let t=await ye();t!=null&&t.success&&l((n=(s=t==null?void 0:t.data)==null?void 0:s.finalResults)==null?void 0:n.$values)}catch{l([])}f(!1)};u.useEffect(()=>{b()},[]);const z=s=>{v(s),y(!0)},R=async()=>{var s,n;if(Q){f(!0);try{(await be(Q)).success&&(b(),m.push(e.jsx(x,{title:"Success",type:"success",children:"FAQ deleted successfully"}),{placement:"top-center"}))}catch(t){m.push(e.jsx(x,{title:"Error",type:"danger",children:((n=(s=t==null?void 0:t.response)==null?void 0:s.data)==null?void 0:n.message)||"Failed to delete FAQ"}),{placement:"top-center"})}y(!1),v(null),f(!1)}},B=async s=>{var n,t;try{f(!0),(await ge(s)).success&&(i(!1),b(),m.push(e.jsx(x,{title:"Success",type:"success",children:"FAQ created successfully"}),{placement:"top-center"}))}catch(o){m.push(e.jsx(x,{title:"Error",type:"danger",children:((t=(n=o==null?void 0:o.response)==null?void 0:n.data)==null?void 0:t.message)||"Failed to add FAQ"}),{placement:"top-center"})}f(!1)},O=async s=>{var n,t;f(!0);try{(await Fe(h.id,s)).success&&(i(!1),p(!1),c(null),b(),m.push(e.jsx(x,{title:"Success",type:"success",children:"FAQ updated successfully"}),{placement:"top-center"}))}catch(o){m.push(e.jsx(x,{title:"Error",type:"danger",children:((t=(n=o==null?void 0:o.response)==null?void 0:n.data)==null?void 0:t.message)||"Failed to update FAQ"}),{placement:"top-center"})}f(!1)},U=async s=>{const{active:n,over:t}=s;if(!t||n.id===t.id)return;const o=r.findIndex(A=>A.id===n.id),S=r.findIndex(A=>A.id===t.id);if(o===-1||S===-1)return;const D=r,L=r[o],T=ee(r,o,S);l(T);const M={id:L.id,displayOrder:S};try{(await Ae([M])).success?(m.push(e.jsx(x,{title:"Success",type:"success",children:"FAQs reordered successfully"}),{placement:"top-center"}),b()):(l(D),m.push(e.jsx(x,{title:"Error",type:"danger",children:"Failed to reorder FAQs"}),{placement:"top-center"}))}catch{l(D),m.push(e.jsx(x,{title:"Error",type:"danger",children:"Failed to reorder FAQs"}),{placement:"top-center"})}},V=()=>e.jsx(se,{items:r.map(s=>s.id),strategy:te,children:e.jsx("div",{children:r.map((s,n)=>e.jsx(he,{faq:s,index:n,permissions:N,expanded:s.id===P,onToggleExpand:()=>I(s.id),onEdit:()=>{c(s),p(!0),i(!0)},onDelete:()=>z(s.id)},s.id))})});return e.jsxs(e.Fragment,{children:[F&&e.jsx("div",{className:"flex justify-center items-center absolute inset-0 bg-gray-300 bg-opacity-20 z-50",children:e.jsx(K,{loading:!0})}),e.jsxs("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:[e.jsx($,{items:[{label:"FAQ's"}]}),e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"FAQ's"}),(N==null?void 0:N.isEdit)&&e.jsx("div",{className:"flex flex-col lg:flex-row lg:items-center",children:e.jsx(C,{variant:"solid",size:"sm",onClick:()=>{i(!0),c(null),p(!1)},children:"+ Add FAQ"})})]})]}),e.jsxs(W,{className:"m-6 h-full py-2 bg-transparent",children:[e.jsx("div",{className:"topbar py-2 px-6 border-gray-200 border-b",children:(r==null?void 0:r.length)>0?e.jsx(ce,{sensors:a,collisionDetection:oe,onDragEnd:U,children:e.jsx(V,{})}):e.jsx(xe,{title:"No FAQs available",description:"Start by adding your first FAQ"})}),d&&e.jsx(je,{open:d,onClose:()=>{i(!1),p(!1),c(null)},loading:F,onSubmit:j?O:B,initialValues:j?h:null}),e.jsx(X,{isOpen:g,type:"danger",title:"Delete FAQ",confirmButtonColor:"red-600",onClose:()=>y(!1),onRequestClose:()=>y(!1),onCancel:()=>y(!1),onConfirm:R,children:e.jsx("p",{children:"Are you sure you want to delete this FAQ?"})})]})]})};export{Xe as default};
@@ -1 +1 @@
1
- import{e8 as n}from"./index-c62ac197.js";async function t(a,e){return(await n.apiV10FileManagementUploadPost(a,e)).data}export{t as a};
1
+ import{e6 as n}from"./index-3b5ce20a.js";async function t(a,e){return(await n.apiV10FileManagementUploadPost(a,e)).data}export{t as a};
@@ -1 +1 @@
1
- import{s as r,j as t}from"./vendor-mui-69397583.js";import{r as a}from"./createSvgIcon-c5fc0d04.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,d=o(a()),i=t;u=e.default=(0,d.default)((0,i.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen");export{u as d};
1
+ import{u as r,j as t}from"./vendor-mui-98daa63f.js";import{r as a}from"./createSvgIcon-aba65987.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,d=o(a()),i=t;u=e.default=(0,d.default)((0,i.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen");export{u as d};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-mui-98daa63f.js";import{r as E}from"./vendor-react-ece1c85f.js";import{bO as z,bv as x,g as p,bU as r,bt as W,bu as w,bS as f,bF as Z,bV as H,bW as V}from"./index-3b5ce20a.js";const $=E.forwardRef((o,n)=>{const{asterisk:m,children:c,className:d,errorMessage:u,extra:i,htmlFor:b,invalid:a,label:t,labelClass:I,labelWidth:L,layout:j,style:h,size:v}=o,s=z(),{controlSize:F}=x(),y=v||(s==null?void 0:s.size)||F,S=L||(s==null?void 0:s.labelWidth),l=j||(s==null?void 0:s.layout),O=()=>{switch(l){case r.HORIZONTAL:return t?`h-${f[y]} ${t&&"ltr:pr-2 rtl:pl-2"}`:"ltr:pr-2 rtl:pl-2";case r.VERTICAL:return"mb-2";case r.INLINE:return`h-${f[y]} ${t&&"ltr:pr-2 rtl:pl-2"}`}},T=p("form-item",l,d,a?"invalid":""),C=p("form-label",t&&O(),I),R=()=>l===r.HORIZONTAL?{...h,minWidth:S}:{...h},g={opacity:1,marginTop:3,bottom:-30},N={opacity:0,marginTop:-10},A=N;return e.jsxs("div",{ref:n,className:T,children:[e.jsxs("label",{htmlFor:b,className:C,style:R(),children:[m&&e.jsx("span",{className:"text-red-500 ltr:mr-1 rtl:ml-1",children:"*"}),t,i&&e.jsx("span",{children:i}),t&&l!=="vertical"&&":"]}),e.jsxs("div",{className:l===r.HORIZONTAL?"w-full flex flex-col justify-center relative":"",children:[c,e.jsx(W,{mode:"wait",children:a&&e.jsx(w.div,{className:"form-explain",initial:A,animate:g,exit:N,transition:{duration:.15,type:"tween"},children:u})})]})]})});$.displayName="FormItem";const M=o=>{const{controlSize:n}=x(),{children:m,className:c,labelWidth:d=100,layout:u=r.VERTICAL,size:i=Z.MD}=o,b={labelWidth:d,layout:u,size:i||n};return e.jsx(H,{value:b,children:e.jsx(V,{children:a=>e.jsx("div",{className:p("form-container",a==null?void 0:a.layout,c),children:m})})})};M.displayName="FormContainer";export{M as F,$ as a};