@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
@@ -1 +0,0 @@
1
- import{j as r}from"./vendor-mui-69397583.js";import{h as c}from"./index-c62ac197.js";import{L as l}from"./Logo-3f3c9ee6.js";import a from"./DocumentUserSigned-27bfa6e6.js";import d from"./CreateSignature-375d191b.js";import{u as x}from"./vendor-react-ece1c85f.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./index-a22a3546.js";import"./index-b028e652.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./useControllableState-d0909575.js";import"./index-c2088808.js";import"./useDidUpdate-25c4d4ed.js";import"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import"./index-fcc1c999.js";import"./index-0ec48d3d.js";import"./Notify-bb3ce372.js";import"./DigitalSignature-fff42e33.js";import"./ConfirmDialog-3202eb3d.js";function u(t,i){if(!i)return"/img/others/auth-background.jpg";const n=i.replace(/\\/g,"/").split("/").map(encodeURIComponent).join("/");return`${t}/${n}`}function f(t){const i=[".jpg",".jpeg",".png",".gif",".webp"],o=[".mp4",".webm",".ogg"],n=t.slice(t.lastIndexOf(".")).toLowerCase();return i.includes(n)?"img":o.includes(n)?".mp4":"img"}const $=()=>{const t=x(),i=c(e=>{var m;return((m=e==null?void 0:e.theme)==null?void 0:m.coverLayout)||{}}),o=c(e=>{var m;return((m=e==null?void 0:e.theme)==null?void 0:m.productsLayout)||i}),n=u(window.RUNTIME_CONFIG.VITE_API_BASE_URL,(o==null?void 0:o.settingFilePath)||"/img/others/auth-background.jpg");f(n);let p={primaryText:"Your Journey to Exceptional Service",secondaryText:"ContentActive",description:"Elevate Your Client Relationships and Deliver Excellence Every Step of the Way"};try{if(o!=null&&o.moreInformation){const e=JSON.parse(o.moreInformation);p={...p,...e==null?void 0:e.themeText}}}catch(e){console.error("Error parsing themeText:",e)}const s=()=>t.pathname.includes("/sign-document")?r.jsx(a,{}):r.jsx(d,{});return r.jsxs("div",{className:"app-layout-blank flex flex-col min-h-screen bg-white dark:bg-gray-900",children:[r.jsx("div",{className:"flex justify-center py-4",children:r.jsx(l,{mode:"light",logoWidth:140})}),r.jsx("div",{className:"flex flex-col items-center justify-center flex-grow px-2 md:px-6 md:px-12",children:r.jsx("div",{className:"w-full max-w-[98%] md:max-w-[70vw]",children:s()})})]})};export{$ as default};
@@ -1,23 +0,0 @@
1
- import{j as i}from"./vendor-mui-69397583.js";import{r as z,a as ye,u as He,f as Ae}from"./vendor-react-ece1c85f.js";import{D as Oe,G as _e,v as Fe,P as Be}from"./vendor-pdf-b2a5d8b1.js";import{D as Ie,H as Ue}from"./index-a22a3546.js";import"./index-b028e652.js";import{D as $e}from"./cjs-162261df.js";import"./Alert-7dfbd254.js";import{D as Ge,I as oe,B as Q,O as Y,E as Xe,ak as Ye,al as ce,Q as Z}from"./index-c62ac197.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import{D as qe}from"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import{f as Ve,g as Ze,h as Qe,i as Je,j as Ke,k as et,l as ue,m as tt,n as st}from"./DigitalSignature-fff42e33.js";import"./index-0ec48d3d.js";import{F as it,a as rt}from"./index-e3cc723f.js";import{A as at}from"./DocumentActivity-d63dacec.js";import{u as nt,a as ot}from"./useDrop-02b0e5d7.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";import"./AdaptableCard-df7695d6.js";import"./DateDifference-e47d2393.js";var H=globalThis&&globalThis.__assign||function(){return H=Object.assign||function(s){for(var a,t=1,e=arguments.length;t<e;t++){a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a[r])}return s},H.apply(this,arguments)},fe={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},ge={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},te={width:"20px",height:"20px",position:"absolute",zIndex:1},lt={top:H(H({},fe),{top:"-5px"}),right:H(H({},ge),{left:void 0,right:"-5px"}),bottom:H(H({},fe),{top:void 0,bottom:"-5px"}),left:H(H({},ge),{left:"-5px"}),topRight:H(H({},te),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:H(H({},te),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:H(H({},te),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:H(H({},te),{left:"-10px",top:"-10px",cursor:"nw-resize"})},ht=z.memo(function(s){var a=s.onResizeStart,t=s.direction,e=s.children,r=s.replaceStyles,l=s.className,n=z.useCallback(function(h){a(h,t)},[a,t]),o=z.useCallback(function(h){a(h,t)},[a,t]),p=z.useMemo(function(){return H(H({position:"absolute",userSelect:"none"},lt[t]),r??{})},[r,t]);return i.jsx("div",{className:l||void 0,style:p,onMouseDown:n,onTouchStart:o,children:e})}),dt=globalThis&&globalThis.__extends||function(){var s=function(a,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])},s(a,t)};return function(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");s(a,t);function e(){this.constructor=a}a.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),X=globalThis&&globalThis.__assign||function(){return X=Object.assign||function(s){for(var a,t=1,e=arguments.length;t<e;t++){a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a[r])}return s},X.apply(this,arguments)},pt={width:"auto",height:"auto"},se=function(s,a,t){return Math.max(Math.min(s,t),a)},me=function(s,a,t){var e=Math.round(s/a);return e*a+t*(e-1)},K=function(s,a){return new RegExp(s,"i").test(a)},ie=function(s){return!!(s.touches&&s.touches.length)},ct=function(s){return!!((s.clientX||s.clientX===0)&&(s.clientY||s.clientY===0))},xe=function(s,a,t){t===void 0&&(t=0);var e=a.reduce(function(l,n,o){return Math.abs(n-s)<Math.abs(a[l]-s)?o:l},0),r=Math.abs(a[e]-s);return t===0||r<t?a[e]:s},ae=function(s){return s=s.toString(),s==="auto"||s.endsWith("px")||s.endsWith("%")||s.endsWith("vh")||s.endsWith("vw")||s.endsWith("vmax")||s.endsWith("vmin")?s:"".concat(s,"px")},re=function(s,a,t,e){if(s&&typeof s=="string"){if(s.endsWith("px"))return Number(s.replace("px",""));if(s.endsWith("%")){var r=Number(s.replace("%",""))/100;return a*r}if(s.endsWith("vw")){var r=Number(s.replace("vw",""))/100;return t*r}if(s.endsWith("vh")){var r=Number(s.replace("vh",""))/100;return e*r}}return s},ut=function(s,a,t,e,r,l,n){return e=re(e,s.width,a,t),r=re(r,s.height,a,t),l=re(l,s.width,a,t),n=re(n,s.height,a,t),{maxWidth:typeof e>"u"?void 0:Number(e),maxHeight:typeof r>"u"?void 0:Number(r),minWidth:typeof l>"u"?void 0:Number(l),minHeight:typeof n>"u"?void 0:Number(n)}},ft=function(s){return Array.isArray(s)?s:[s,s]},gt=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],ve="__resizable_base__",mt=function(s){dt(a,s);function a(t){var e,r,l,n,o=s.call(this,t)||this;return o.ratio=1,o.resizable=null,o.parentLeft=0,o.parentTop=0,o.resizableLeft=0,o.resizableRight=0,o.resizableTop=0,o.resizableBottom=0,o.targetLeft=0,o.targetTop=0,o.delta={width:0,height:0},o.appendBase=function(){if(!o.resizable||!o.window)return null;var p=o.parentNode;if(!p)return null;var h=o.window.document.createElement("div");return h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.transform="scale(0, 0)",h.style.left="0",h.style.flex="0 0 100%",h.classList?h.classList.add(ve):h.className+=ve,p.appendChild(h),h},o.removeBase=function(p){var h=o.parentNode;h&&h.removeChild(p)},o.state={isResizing:!1,width:(r=(e=o.propsSize)===null||e===void 0?void 0:e.width)!==null&&r!==void 0?r:"auto",height:(n=(l=o.propsSize)===null||l===void 0?void 0:l.height)!==null&&n!==void 0?n:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},o.onResizeStart=o.onResizeStart.bind(o),o.onMouseMove=o.onMouseMove.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o}return Object.defineProperty(a.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||pt},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"size",{get:function(){var t=0,e=0;if(this.resizable&&this.window){var r=this.resizable.offsetWidth,l=this.resizable.offsetHeight,n=this.resizable.style.position;n!=="relative"&&(this.resizable.style.position="relative"),t=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:r,e=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:l,this.resizable.style.position=n}return{width:t,height:e}},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sizeStyle",{get:function(){var t=this,e=this.props.size,r=function(o){var p;if(typeof t.state[o]>"u"||t.state[o]==="auto")return"auto";if(t.propsSize&&t.propsSize[o]&&(!((p=t.propsSize[o])===null||p===void 0)&&p.toString().endsWith("%"))){if(t.state[o].toString().endsWith("%"))return t.state[o].toString();var h=t.getParentSize(),v=Number(t.state[o].toString().replace("px","")),u=v/h[o]*100;return"".concat(u,"%")}return ae(t.state[o])},l=e&&typeof e.width<"u"&&!this.state.isResizing?ae(e.width):r("width"),n=e&&typeof e.height<"u"&&!this.state.isResizing?ae(e.height):r("height");return{width:l,height:n}},enumerable:!1,configurable:!0}),a.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var t=this.appendBase();if(!t)return{width:0,height:0};var e=!1,r=this.parentNode.style.flexWrap;r!=="wrap"&&(e=!0,this.parentNode.style.flexWrap="wrap"),t.style.position="relative",t.style.minWidth="100%",t.style.minHeight="100%";var l={width:t.offsetWidth,height:t.offsetHeight};return e&&(this.parentNode.style.flexWrap=r),this.removeBase(t),l},a.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},a.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},a.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var t=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:t.flexBasis!=="auto"?t.flexBasis:void 0})}},a.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},a.prototype.createSizeForCssProperty=function(t,e){var r=this.propsSize&&this.propsSize[e];return this.state[e]==="auto"&&this.state.original[e]===t&&(typeof r>"u"||r==="auto")?"auto":t},a.prototype.calculateNewMaxFromBoundary=function(t,e){var r=this.props.boundsByDirection,l=this.state.direction,n=r&&K("left",l),o=r&&K("top",l),p,h;if(this.props.bounds==="parent"){var v=this.parentNode;v&&(p=n?this.resizableRight-this.parentLeft:v.offsetWidth+(this.parentLeft-this.resizableLeft),h=o?this.resizableBottom-this.parentTop:v.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(p=n?this.resizableRight:this.window.innerWidth-this.resizableLeft,h=o?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(p=n?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),h=o?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return p&&Number.isFinite(p)&&(t=t&&t<p?t:p),h&&Number.isFinite(h)&&(e=e&&e<h?e:h),{maxWidth:t,maxHeight:e}},a.prototype.calculateNewSizeFromDirection=function(t,e){var r=this.props.scale||1,l=ft(this.props.resizeRatio||1),n=l[0],o=l[1],p=this.state,h=p.direction,v=p.original,u=this.props,m=u.lockAspectRatio,x=u.lockAspectRatioExtraHeight,b=u.lockAspectRatioExtraWidth,D=v.width,M=v.height,k=x||0,T=b||0;return K("right",h)&&(D=v.width+(t-v.x)*n/r,m&&(M=(D-T)/this.ratio+k)),K("left",h)&&(D=v.width-(t-v.x)*n/r,m&&(M=(D-T)/this.ratio+k)),K("bottom",h)&&(M=v.height+(e-v.y)*o/r,m&&(D=(M-k)*this.ratio+T)),K("top",h)&&(M=v.height-(e-v.y)*o/r,m&&(D=(M-k)*this.ratio+T)),{newWidth:D,newHeight:M}},a.prototype.calculateNewSizeFromAspectRatio=function(t,e,r,l){var n=this.props,o=n.lockAspectRatio,p=n.lockAspectRatioExtraHeight,h=n.lockAspectRatioExtraWidth,v=typeof l.width>"u"?10:l.width,u=typeof r.width>"u"||r.width<0?t:r.width,m=typeof l.height>"u"?10:l.height,x=typeof r.height>"u"||r.height<0?e:r.height,b=p||0,D=h||0;if(o){var M=(m-b)*this.ratio+D,k=(x-b)*this.ratio+D,T=(v-D)/this.ratio+b,R=(u-D)/this.ratio+b,C=Math.max(v,M),E=Math.min(u,k),g=Math.max(m,T),S=Math.min(x,R);t=se(t,C,E),e=se(e,g,S)}else t=se(t,v,u),e=se(e,m,x);return{newWidth:t,newHeight:e}},a.prototype.setBoundingClientRect=function(){var t=1/(this.props.scale||1);if(this.props.bounds==="parent"){var e=this.parentNode;if(e){var r=e.getBoundingClientRect();this.parentLeft=r.left*t,this.parentTop=r.top*t}}if(this.props.bounds&&typeof this.props.bounds!="string"){var l=this.props.bounds.getBoundingClientRect();this.targetLeft=l.left*t,this.targetTop=l.top*t}if(this.resizable){var n=this.resizable.getBoundingClientRect(),o=n.left,p=n.top,h=n.right,v=n.bottom;this.resizableLeft=o*t,this.resizableRight=h*t,this.resizableTop=p*t,this.resizableBottom=v*t}},a.prototype.onResizeStart=function(t,e){if(!(!this.resizable||!this.window)){var r=0,l=0;if(t.nativeEvent&&ct(t.nativeEvent)?(r=t.nativeEvent.clientX,l=t.nativeEvent.clientY):t.nativeEvent&&ie(t.nativeEvent)&&(r=t.nativeEvent.touches[0].clientX,l=t.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var n=this.props.onResizeStart(t,e,this.resizable);if(n===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var o,p=this.window.getComputedStyle(this.resizable);if(p.flexBasis!=="auto"){var h=this.parentNode;if(h){var v=this.window.getComputedStyle(h).flexDirection;this.flexDir=v.startsWith("row")?"row":"column",o=p.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var u={original:{x:r,y:l,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:X(X({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),direction:e,flexBasis:o};this.setState(u)}},a.prototype.onMouseMove=function(t){var e=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&ie(t))try{t.preventDefault(),t.stopPropagation()}catch{}var r=this.props,l=r.maxWidth,n=r.maxHeight,o=r.minWidth,p=r.minHeight,h=ie(t)?t.touches[0].clientX:t.clientX,v=ie(t)?t.touches[0].clientY:t.clientY,u=this.state,m=u.direction,x=u.original,b=u.width,D=u.height,M=this.getParentSize(),k=ut(M,this.window.innerWidth,this.window.innerHeight,l,n,o,p);l=k.maxWidth,n=k.maxHeight,o=k.minWidth,p=k.minHeight;var T=this.calculateNewSizeFromDirection(h,v),R=T.newHeight,C=T.newWidth,E=this.calculateNewMaxFromBoundary(l,n);this.props.snap&&this.props.snap.x&&(C=xe(C,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(R=xe(R,this.props.snap.y,this.props.snapGap));var g=this.calculateNewSizeFromAspectRatio(C,R,{width:E.maxWidth,height:E.maxHeight},{width:o,height:p});if(C=g.newWidth,R=g.newHeight,this.props.grid){var S=me(C,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),j=me(R,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),N=this.props.snapGap||0,W=N===0||Math.abs(S-C)<=N?S:C,L=N===0||Math.abs(j-R)<=N?j:R;C=W,R=L}var P={width:C-x.width,height:R-x.height};if(this.delta=P,b&&typeof b=="string"){if(b.endsWith("%")){var B=C/M.width*100;C="".concat(B,"%")}else if(b.endsWith("vw")){var U=C/this.window.innerWidth*100;C="".concat(U,"vw")}else if(b.endsWith("vh")){var I=C/this.window.innerHeight*100;C="".concat(I,"vh")}}if(D&&typeof D=="string"){if(D.endsWith("%")){var B=R/M.height*100;R="".concat(B,"%")}else if(D.endsWith("vw")){var U=R/this.window.innerWidth*100;R="".concat(U,"vw")}else if(D.endsWith("vh")){var I=R/this.window.innerHeight*100;R="".concat(I,"vh")}}var _={width:this.createSizeForCssProperty(C,"width"),height:this.createSizeForCssProperty(R,"height")};this.flexDir==="row"?_.flexBasis=_.width:this.flexDir==="column"&&(_.flexBasis=_.height);var q=this.state.width!==_.width,F=this.state.height!==_.height,ee=this.state.flexBasis!==_.flexBasis,$=q||F||ee;$&&ye.flushSync(function(){e.setState(_)}),this.props.onResize&&$&&this.props.onResize(t,m,this.resizable,P)}},a.prototype.onMouseUp=function(t){var e,r,l=this.state,n=l.isResizing,o=l.direction;l.original,!(!n||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(t,o,this.resizable,this.delta),this.props.size&&this.setState({width:(e=this.props.size.width)!==null&&e!==void 0?e:"auto",height:(r=this.props.size.height)!==null&&r!==void 0?r:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:X(X({},this.state.backgroundStyle),{cursor:"auto"})}))},a.prototype.updateSize=function(t){var e,r;this.setState({width:(e=t.width)!==null&&e!==void 0?e:"auto",height:(r=t.height)!==null&&r!==void 0?r:"auto"})},a.prototype.renderResizer=function(){var t=this,e=this.props,r=e.enable,l=e.handleStyles,n=e.handleClasses,o=e.handleWrapperStyle,p=e.handleWrapperClass,h=e.handleComponent;if(!r)return null;var v=Object.keys(r).map(function(u){return r[u]!==!1?i.jsx(ht,{direction:u,onResizeStart:t.onResizeStart,replaceStyles:l&&l[u],className:n&&n[u],children:h&&h[u]?h[u]:null},u):null});return i.jsx("div",{className:p,style:o,children:v})},a.prototype.render=function(){var t=this,e=Object.keys(this.props).reduce(function(n,o){return gt.indexOf(o)!==-1||(n[o]=t.props[o]),n},{}),r=X(X(X({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var l=this.props.as||"div";return i.jsxs(l,X({style:r,className:this.props.className},e,{ref:function(n){n&&(t.resizable=n)},children:[this.state.isResizing&&i.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},a.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},a}(z.PureComponent);/*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */var le=function(s,a){return le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},le(s,a)};function xt(s,a){le(s,a);function t(){this.constructor=s}s.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}var O=function(){return O=Object.assign||function(a){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(a[l]=t[l])}return a},O.apply(this,arguments)};function vt(s,a){var t={};for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&a.indexOf(e)<0&&(t[e]=s[e]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(s);r<e.length;r++)a.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(s,e[r])&&(t[e[r]]=s[e[r]]);return t}var bt={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},yt=function(s){return{bottom:s,bottomLeft:s,bottomRight:s,left:s,right:s,top:s,topLeft:s,topRight:s}},wt=function(s){xt(a,s);function a(t){var e=s.call(this,t)||this;return e.resizingPosition={x:0,y:0},e.offsetFromParent={left:0,top:0},e.resizableElement={current:null},e.originalPosition={x:0,y:0},e.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},e.onResizeStart=e.onResizeStart.bind(e),e.onResize=e.onResize.bind(e),e.onResizeStop=e.onResizeStop.bind(e),e.onDragStart=e.onDragStart.bind(e),e.onDrag=e.onDrag.bind(e),e.onDragStop=e.onDragStop.bind(e),e.getMaxSizesFromProps=e.getMaxSizesFromProps.bind(e),e}return a.prototype.componentDidMount=function(){this.updateOffsetFromParent();var t=this.offsetFromParent,e=t.left,r=t.top,l=this.getDraggablePosition(),n=l.x,o=l.y;this.draggable.setState({x:n-e,y:o-r}),this.forceUpdate()},a.prototype.getDraggablePosition=function(){var t=this.draggable.state,e=t.x,r=t.y;return{x:e,y:r}},a.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},a.prototype.getParentSize=function(){return this.resizable.getParentSize()},a.prototype.getMaxSizesFromProps=function(){var t=typeof this.props.maxWidth>"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,e=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:t,maxHeight:e}},a.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},a.prototype.getOffsetHeight=function(t){var e=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/e;case"body":return document.body.offsetHeight/e;default:return t.offsetHeight}},a.prototype.getOffsetWidth=function(t){var e=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/e;case"body":return document.body.offsetWidth/e;default:return t.offsetWidth}},a.prototype.onDragStart=function(t,e){if(this.props.onDragStart&&this.props.onDragStart(t,e)===!1)return!1;var r=this.getDraggablePosition();if(this.originalPosition=r,!!this.props.bounds){var l=this.getParent(),n=this.props.scale,o;if(this.props.bounds==="parent")o=l;else if(this.props.bounds==="body"){var p=l.getBoundingClientRect(),h=p.left,v=p.top,u=document.body.getBoundingClientRect(),m=-(h-l.offsetLeft*n-u.left)/n,x=-(v-l.offsetTop*n-u.top)/n,b=(document.body.offsetWidth-this.resizable.size.width*n)/n+m,D=(document.body.offsetHeight-this.resizable.size.height*n)/n+x;return this.setState({bounds:{top:x,right:b,bottom:D,left:m}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var M=l.getBoundingClientRect(),k=M.left,T=M.top,R=-(k-l.offsetLeft*n)/n,C=-(T-l.offsetTop*n)/n,b=(window.innerWidth-this.resizable.size.width*n)/n+R,D=(window.innerHeight-this.resizable.size.height*n)/n+C;return this.setState({bounds:{top:C,right:b,bottom:D,left:R}})}else typeof this.props.bounds=="string"?o=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(o=this.props.bounds);if(!(!(o instanceof HTMLElement)||!(l instanceof HTMLElement))){var E=o.getBoundingClientRect(),g=E.left,S=E.top,j=l.getBoundingClientRect(),N=j.left,W=j.top,L=(g-N)/n,P=S-W;if(this.resizable){this.updateOffsetFromParent();var B=this.offsetFromParent;this.setState({bounds:{top:P-B.top,right:L+(o.offsetWidth-this.resizable.size.width)-B.left/n,bottom:P+(o.offsetHeight-this.resizable.size.height)-B.top,left:L-B.left/n}})}}}},a.prototype.onDrag=function(t,e){if(this.props.onDrag){var r=this.offsetFromParent,l=r.left,n=r.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(t,O(O({},e),{x:e.x+l,y:e.y+n}));if(this.props.dragAxis==="x")return this.props.onDrag(t,O(O({},e),{x:e.x+l,y:this.originalPosition.y+n,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(t,O(O({},e),{x:this.originalPosition.x+l,y:e.y+n,deltaX:0}))}},a.prototype.onDragStop=function(t,e){if(this.props.onDragStop){var r=this.offsetFromParent,l=r.left,n=r.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(t,O(O({},e),{x:e.x+l,y:e.y+n}));if(this.props.dragAxis==="x")return this.props.onDragStop(t,O(O({},e),{x:e.x+l,y:this.originalPosition.y+n,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(t,O(O({},e),{x:this.originalPosition.x+l,y:e.y+n,deltaX:0}))}},a.prototype.onResizeStart=function(t,e,r){if(this.props.onResizeStart&&this.props.onResizeStart(t,e,r)===!1)return!1;t.stopPropagation(),this.setState({resizing:!0});var l=this.props.scale,n=this.offsetFromParent,o=this.getDraggablePosition();if(this.resizingPosition={x:o.x+n.left,y:o.y+n.top},this.originalPosition=o,this.props.bounds){var p=this.getParent(),h=void 0;this.props.bounds==="parent"?h=p:this.props.bounds==="body"?h=document.body:this.props.bounds==="window"?h=window:typeof this.props.bounds=="string"?h=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(h=this.props.bounds);var v=this.getSelfElement();if(v instanceof Element&&(h instanceof HTMLElement||h===window)&&p instanceof HTMLElement){var u=this.getMaxSizesFromProps(),m=u.maxWidth,x=u.maxHeight,b=this.getParentSize();if(m&&typeof m=="string")if(m.endsWith("%")){var D=Number(m.replace("%",""))/100;m=b.width*D}else m.endsWith("px")&&(m=Number(m.replace("px","")));if(x&&typeof x=="string")if(x.endsWith("%")){var D=Number(x.replace("%",""))/100;x=b.height*D}else x.endsWith("px")&&(x=Number(x.replace("px","")));var M=v.getBoundingClientRect(),k=M.left,T=M.top,R=this.props.bounds==="window"?{left:0,top:0}:h.getBoundingClientRect(),C=R.left,E=R.top,g=this.getOffsetWidth(h),S=this.getOffsetHeight(h),j=e.toLowerCase().endsWith("left"),N=e.toLowerCase().endsWith("right"),W=e.startsWith("top"),L=e.startsWith("bottom");if((j||W)&&this.resizable){var P=(k-C)/l+this.resizable.size.width;this.setState({maxWidth:P>Number(m)?m:P})}if(N||this.props.lockAspectRatio&&!j&&!W){var P=g+(C-k)/l;this.setState({maxWidth:P>Number(m)?m:P})}if((W||j)&&this.resizable){var P=(T-E)/l+this.resizable.size.height;this.setState({maxHeight:P>Number(x)?x:P})}if(L||this.props.lockAspectRatio&&!W&&!j){var P=S+(E-T)/l;this.setState({maxHeight:P>Number(x)?x:P})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight})},a.prototype.onResize=function(t,e,r,l){var n=this,o={x:this.originalPosition.x,y:this.originalPosition.y},p=-l.width,h=-l.height,v=["top","left","topLeft","bottomLeft","topRight"];v.includes(e)&&(e==="bottomLeft"?o.x+=p:(e==="topRight"||(o.x+=p),o.y+=h));var u=this.draggable.state;(o.x!==u.x||o.y!==u.y)&&ye.flushSync(function(){n.draggable.setState(o)}),this.updateOffsetFromParent();var m=this.offsetFromParent,x=this.getDraggablePosition().x+m.left,b=this.getDraggablePosition().y+m.top;this.resizingPosition={x,y:b},this.props.onResize&&this.props.onResize(t,e,r,l,{x,y:b})},a.prototype.onResizeStop=function(t,e,r,l){this.setState({resizing:!1});var n=this.getMaxSizesFromProps(),o=n.maxWidth,p=n.maxHeight;this.setState({maxWidth:o,maxHeight:p}),this.props.onResizeStop&&this.props.onResizeStop(t,e,r,l,this.resizingPosition)},a.prototype.updateSize=function(t){this.resizable&&this.resizable.updateSize({width:t.width,height:t.height})},a.prototype.updatePosition=function(t){this.draggable.setState(t)},a.prototype.updateOffsetFromParent=function(){var t=this.props.scale,e=this.getParent(),r=this.getSelfElement();if(!e||r===null)return{top:0,left:0};var l=e.getBoundingClientRect(),n=l.left,o=l.top,p=r.getBoundingClientRect(),h=this.getDraggablePosition(),v=e.scrollLeft,u=e.scrollTop;this.offsetFromParent={left:p.left-n+v-h.x*t,top:p.top-o+u-h.y*t}},a.prototype.render=function(){var t=this,e=this.props,r=e.disableDragging,l=e.style,n=e.dragHandleClassName,o=e.position,p=e.onMouseDown,h=e.onMouseUp,v=e.dragAxis,u=e.dragGrid,m=e.bounds,x=e.enableUserSelectHack,b=e.cancel,D=e.children;e.onResizeStart,e.onResize,e.onResizeStop,e.onDragStart,e.onDrag,e.onDragStop;var M=e.resizeHandleStyles,k=e.resizeHandleClasses,T=e.resizeHandleComponent,R=e.enableResizing,C=e.resizeGrid,E=e.resizeHandleWrapperClass,g=e.resizeHandleWrapperStyle,S=e.scale,j=e.allowAnyClick,N=e.dragPositionOffset,W=vt(e,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),L=this.props.default?O({},this.props.default):void 0;delete W.default;var P=r||n?{cursor:"auto"}:{cursor:"move"},B=O(O(O({},bt),P),l),U=this.offsetFromParent,I=U.left,_=U.top,q;o&&(q={x:o.x-I,y:o.y-_});var F=this.state.resizing?void 0:q,ee=this.state.resizing?"both":v;return z.createElement($e,{ref:function($){$&&(t.draggable=$)},handle:n?".".concat(n):void 0,defaultPosition:L,onMouseDown:p,onMouseUp:h,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:ee,disabled:r,grid:u,bounds:m?this.state.bounds:void 0,position:F,enableUserSelectHack:x,cancel:b,scale:S,allowAnyClick:j,nodeRef:this.resizableElement,positionOffset:N},z.createElement(mt,O({},W,{ref:function($){$&&(t.resizable=$,t.resizableElement.current=$.resizable)},defaultSize:L,size:this.props.size,enable:typeof R=="boolean"?yt(R):R,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:B,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:C,handleWrapperClass:E,handleWrapperStyle:g,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:M,handleClasses:k,handleComponent:T,scale:this.props.scale}),D))},a.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},a}(z.PureComponent);const zt=({isOpen:s,onClose:a,expiryDate:t,documentId:e})=>{const[r,l]=z.useState([]),[n,o]=z.useState(!1),[p,h]=z.useState(null);z.useState(t||""),z.useEffect(()=>{s&&v()},[s]);const v=async()=>{var m,x;o(!0),h(null);try{const b=await Ve(e);(m=b==null?void 0:b.data)!=null&&m.$values&&l((x=b==null?void 0:b.data)==null?void 0:x.$values)}catch(b){console.error(b),h("Failed to load sign links. Please try again."),l([])}finally{o(!1)}},u=m=>{navigator.clipboard.writeText(m),Y.success("Link copied to clipboard!")};return i.jsx(Ge,{isOpen:s,onClose:a,closable:!0,width:"70vw",height:"80vh",contentClassName:"p-6",children:i.jsxs("div",{className:"space-y-6 mx-auto",children:[i.jsx("h3",{className:"text-xl font-semibold mb-1",children:"Sign Links"}),i.jsx("p",{className:"text-gray-600",children:"Copy each sign link and share with the respective parties:"}),n&&i.jsx("p",{className:"text-gray-500",children:"Loading sign links..."}),p&&i.jsx("p",{className:"text-red-500",children:p}),!n&&!p&&r.length>0&&i.jsx("div",{className:"space-y-6",children:r.map((m,x)=>i.jsxs("div",{className:"border-b pb-4",children:[i.jsxs("p",{className:"custom-text-600 mb-2",children:[x+1,"st Party:"," ",i.jsx("span",{className:"font-normal",children:m.name||"-"})]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(oe,{type:"text",prefix:i.jsx("span",{className:"ml-4",children:"Sign link:"}),suffix:i.jsx(Q,{size:"sm",variant:"solid",icon:i.jsx(it,{}),onClick:()=>u(m.signingUrl),children:"Copy link"}),readOnly:!0,value:m.signingUrl,className:"flex-1 border rounded-md px-3 py-2 text-sm bg-gray-50"})})]},m.id||x))})]})})},St=zt;_e.workerSrc=`https://unpkg.com/pdfjs-dist@${Fe}/build/pdf.worker.min.mjs`;const jt=[{type:"text",label:"Text Field"},{type:"signature",label:"Signature"},{type:"date",label:"Date"},{type:"initials",label:"Initials"}],ne={text:1,initials:2,signature:3,date:4},Nt=({field:s})=>{const[,a]=nt(()=>({type:"FIELD",item:{fieldType:s.type}}));return i.jsx("div",{ref:a,className:"cursor-move px-3 py-2 mb-2 rounded-md border text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-100 bg-white",children:s.label})},Dt=({field:s,scale:a,onMove:t,onResize:e,onRequestOpenAssignMenu:r,onRemoveField:l,onSign:n,onEditText:o})=>{var v;const p=z.useRef(null),h=()=>{const u=Math.max(10,Math.round(s.height*a/3)),m=Math.max(.4,Math.min(1.2,s.height/40));if(s.fieldType==="signature"&&s.signatureData)return i.jsx("img",{src:s.signatureData,alt:"Signature",style:{maxHeight:`${s.height*a*.9}px`,maxWidth:`${s.width*a*.9}px`,transform:`scale(${m})`,transformOrigin:"center"},className:"mx-auto object-contain"});if(s.fieldType==="initials"){if(s.signatureData)return i.jsx("img",{src:s.signatureData,alt:"Initials",style:{maxHeight:`${s.height*a*.9}px`,maxWidth:`${s.width*a*.9}px`,transform:`scale(${m})`,transformOrigin:"center"},className:"mx-auto object-contain"});if(s.assignedUser){const x=s.assignedUser.name.split(" ").map(b=>b[0]).join("").toUpperCase();return i.jsx("div",{className:"font-semibold text-gray-700 flex items-center justify-center",style:{fontSize:u},children:x})}else return i.jsx("div",{className:"font-semibold text-gray-700 flex items-center justify-center",style:{fontSize:u},children:"Initials"})}return s.fieldType==="text"?i.jsx("div",{className:"font-semibold text-gray-700 cursor-text flex items-center justify-center w-full h-full text-center",style:{fontSize:u},children:s.textValue||"Enter Text"}):s.fieldType==="date"?i.jsx("div",{className:"font-semibold text-gray-700 cursor-pointer flex items-center justify-center w-full h-full text-center",style:{fontSize:u},children:s.textValue||"Pick Date"}):i.jsx("span",{className:"font-semibold text-gray-700 flex items-center justify-center",style:{fontSize:u},children:s.fieldType.toUpperCase()})};return i.jsx(wt,{size:{width:s.width*a,height:s.height*a},position:{x:s.x*a,y:s.y*a},onDragStop:(u,m)=>t(s.id,m.x/a,m.y/a),onResize:(u,m,x,b,D)=>e(s.id,x.offsetWidth/a,x.offsetHeight/a,D.x/a,D.y/a),bounds:"parent",enableResizing:{bottomRight:!0,bottomLeft:!0,topRight:!0,topLeft:!0},style:{border:`2px dashed ${((v=s.assignedUser)==null?void 0:v.color)||"#888"}`,backgroundColor:"rgba(255,255,255,0.9)",borderRadius:"6px",zIndex:5,padding:4},className:"group",children:i.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full relative text-center",children:[h(),i.jsxs("div",{className:"absolute -top-8 right-0 bg-white border rounded-md shadow-md flex items-center gap-1 p-1",onClick:u=>u.stopPropagation(),children:[i.jsx("button",{ref:p,className:"text-xs px-2 py-0.5 rounded hover:bg-gray-100 flex items-center gap-1",onClick:u=>{var x;u.stopPropagation();const m=(x=p.current)==null?void 0:x.getBoundingClientRect();r(s.id,m??null)},children:s.assignedUser?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{background:s.assignedUser.color}}),i.jsx("span",{children:s.assignedUser.name})]}):"Assign"}),i.jsx("button",{onClick:()=>l(s.id),className:"text-gray-500 text-xs font-bold px-2 py-0.5 rounded hover:bg-gray-100",children:"🗑"})]})]})})},Rt=({visible:s,onClose:a,parties:t=[],setParties:e,onSubmit:r,onSend:l})=>{const[n,o]=z.useState([]),[p,h]=z.useState(null),[v,u]=z.useState(null);z.useEffect(()=>{s&&t&&o([...t])},[s,t]);const m=(E,g)=>{h(g),E.dataTransfer.effectAllowed="move",E.dataTransfer.setData("text/html",E.target.outerHTML),E.target.style.opacity="0.5"},x=E=>{E.target.style.opacity="1",h(null),u(null)},b=E=>{E.preventDefault(),E.dataTransfer.dropEffect="move"},D=(E,g)=>{E.preventDefault(),u(g)},M=()=>{u(null)};let k=null;const T=(E,g)=>{if(E.preventDefault(),p===null||p===g)return;const S=[...n],j=S[p];S.splice(p,1),S.splice(g,0,j),o(S),e(S),h(null),u(null),k&&clearTimeout(k),k=setTimeout(()=>{r(S)},1e3)},R=z.useCallback(()=>{l()},[]),C=z.useCallback(()=>{o([...t]),a()},[t,a]);return s?i.jsx("div",{className:"fixed inset-0 bg-black/40 flex justify-end z-50",children:i.jsxs("div",{className:"bg-white w-[500px] h-full p-5 flex flex-col shadow-lg",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"Signing Order"}),i.jsxs("span",{className:"text-sm text-gray-500",children:[n.length," ",n.length===1?"party":"parties"]})]}),i.jsx("div",{className:"mt-3",children:i.jsx("p",{className:"text-xs text-gray-500",children:n.length>0?"Drag and drop to reorder signing sequence":"Add parties first to set signing order"})}),n.length===0?i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsxs("div",{className:"text-center text-gray-500",children:[i.jsx("p",{className:"text-lg mb-2",children:"No parties added yet"}),i.jsx("p",{className:"text-sm",children:"Add some parties to set signing order"})]})}):i.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:i.jsx("div",{className:"space-y-3",children:n.map((E,g)=>{var S,j;return i.jsxs("div",{draggable:!0,onDragStart:N=>m(N,g),onDragEnd:x,onDragOver:b,onDragEnter:N=>D(N,g),onDragLeave:M,onDrop:N=>T(N,g),className:`
15
- flex items-center justify-between rounded-lg px-4 py-3 border-2 transition-all duration-200 cursor-grab active:cursor-grabbing
16
- ${p===g?"bg-blue-50 border-blue-300 opacity-50":v===g?"bg-green-50 border-green-300 transform scale-105":"bg-gray-50 border-gray-200 hover:bg-gray-100 hover:border-gray-300"}
17
- `,children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-0.5 text-gray-400 cursor-grab",children:[i.jsxs("div",{className:"flex gap-1",children:[i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"}),i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"})]}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"}),i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"})]}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"}),i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"})]})]}),i.jsx("div",{style:{backgroundColor:E.color||"#6b7280"},className:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold text-sm flex-shrink-0 shadow-sm",children:((j=(S=E.name)==null?void 0:S.charAt(0))==null?void 0:j.toUpperCase())||"?"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"font-semibold text-gray-900 text-sm truncate",children:E.name||"Unknown"}),i.jsx("div",{className:"text-xs text-gray-500 truncate",children:E.email||"No email"})]})]}),i.jsx("div",{className:"flex-shrink-0 ml-3",children:i.jsxs("div",{className:`
18
- w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold
19
- ${p===g?"bg-blue-500 text-white":"bg-gray-200 text-gray-700"}
20
- `,children:["#",g+1]})})]},`${E.email}_${g}`)})})}),i.jsx("div",{className:"mt-6 pt-4 border-t border-gray-200",children:i.jsxs("div",{className:"flex justify-between gap-3",children:[i.jsx(Q,{size:"sm",className:"ltr:mr-3 rtl:ml-3",onClick:C,children:"Cancel"}),i.jsx(Q,{variant:"solid",size:"sm",onClick:R,disabled:n.length===0,children:"Send to Signers (Email)"})]})})]})}):null},be=850,Pt=({fields:s,setFields:a,numPages:t,scale:e,users:r,onOpenSignature:l,onOpenTextEditor:n})=>{const o=z.useRef([]),p=z.useRef(null),[h,v]=z.useState({open:!1,x:0,y:0,fieldId:null}),[u,m]=z.useState(null),x=u?Math.max(.4,(u-32)/be):e,b=z.useRef(x);z.useEffect(()=>{b.current=x},[x]),z.useEffect(()=>{const g=p.current;if(!g)return;const S=new ResizeObserver(j=>{for(const N of j)m(N.contentRect.width)});return S.observe(g),()=>S.disconnect()},[]);const[,D]=ot(()=>({accept:"FIELD",drop:(g,S)=>{var W;const j=S.getClientOffset();if(!j)return;const N=b.current;for(let L=0;L<o.current.length;L++){const P=(W=o.current[L])==null?void 0:W.getBoundingClientRect();if(P&&j.y>=P.top&&j.y<=P.bottom){let I=(j.x-P.left)/N-75,_=(j.y-P.top)/N-20/2;I=Math.max(0,Math.min(I,P.width/N-150)),_=Math.max(0,Math.min(_,P.height/N-20));const q=`${g.fieldType}_${Date.now()}`;a(F=>[...F,{id:q,x:I,y:_,width:150,height:20,fieldType:g.fieldType,assignedUser:null,signatureData:null,textValue:"",pageNumber:L+1,pageWidth:P.width/N,pageHeight:P.height/N}]);break}}}})),M=(g,S,j)=>a(N=>N.map(W=>W.id===g?{...W,x:S,y:j}:W)),k=(g,S,j,N,W)=>a(L=>L.map(P=>P.id===g?{...P,width:S,height:j,x:N,y:W}:P)),T=g=>a(S=>S.filter(j=>j.id!==g)),R=(g,S)=>{if(!S){v({open:!0,x:window.innerWidth/2-80,y:window.innerHeight/2-40,fieldId:g});return}v({open:!0,x:S.left,y:S.bottom,fieldId:g})},C=()=>v({open:!1,x:0,y:0,fieldId:null}),E=(g,S)=>{a(j=>j.map(N=>N.id===g?{...N,assignedUser:S}:N)),C()};return i.jsxs("div",{ref:g=>{D(g),p.current=g},className:"relative bg-gray-50 border border-gray-300 rounded-lg overflow-auto h-[88vh] p-4",children:[Array.from({length:t}).map((g,S)=>i.jsxs("div",{ref:j=>o.current[S]=j,className:"relative mb-6 flex justify-center",children:[i.jsx(Be,{pageNumber:S+1,width:be*x,renderTextLayer:!1,renderAnnotationLayer:!1}),s.filter(j=>j.pageNumber===S+1).map(j=>i.jsx(Dt,{field:j,scale:x,onMove:M,onResize:k,onRequestOpenAssignMenu:(N,W)=>R(N,W),onRemoveField:T,onSign:(N,W,L)=>l(N,W,L),onEditText:(N,W)=>n(N,W)},j.id))]},S)),h.open&&i.jsx("div",{onClick:g=>g.stopPropagation(),className:"absolute z-50",style:{position:"fixed",top:h.y+6,left:h.x,width:180},children:i.jsxs("div",{className:"bg-white border rounded shadow-md py-1",children:[i.jsx("div",{className:"px-2 py-1 text-xs text-gray-500",children:"Assign to"}),r==null?void 0:r.map(g=>i.jsxs("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-sm flex items-center gap-2",onClick:()=>E(h.fieldId,g),children:[i.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{background:g.color}}),i.jsx("div",{className:"flex flex-col",children:i.jsx("span",{className:"text-sm",children:g.name})})]},g.email)),i.jsx("div",{className:"px-2 py-2 border-t flex justify-end",children:i.jsx(Q,{size:"sm",variant:"plain",className:"text-xs text-gray-500",onClick:C,children:"Close"})})]})})]})};function rs(){const[s,a]=z.useState(null),[t,e]=z.useState([]),[r,l]=z.useState(1),[n,o]=z.useState([]),[p,h]=z.useState(!1),[v,u]=z.useState({visible:!1,fieldId:null,user:null,type:null}),[m,x]=z.useState({visible:!1,fieldId:null,value:""}),[b,D]=z.useState({name:"",email:""}),M=He(),[k,T]=z.useState(!1),[R,C]=z.useState({name:"",email:""}),[E,g]=z.useState("2026-01-25"),[S,j]=z.useState(!1),[N,W]=z.useState(!1),[L,P]=z.useState(null),[B,U]=z.useState(null),[I,_]=z.useState(!1),q=Ae(),F=M.pathname.substring(M.pathname.lastIndexOf("/")+1);z.useEffect(()=>{const d=f=>u({visible:!0,fieldId:f.detail.id,user:f.detail.user,type:f.detail.type}),y=f=>x({visible:!0,fieldId:f.detail.id,value:f.detail.text});return window.addEventListener("openSignaturePad",d),window.addEventListener("openTextEditor",y),()=>{window.removeEventListener("openSignaturePad",d),window.removeEventListener("openTextEditor",y)}},[]),z.useEffect(()=>{const d=f=>u({visible:!0,fieldId:f.detail.id,user:f.detail.user,type:f.detail.type}),y=f=>x({visible:!0,fieldId:f.detail.id,value:f.detail.text});return window.addEventListener("openSignaturePad",d),window.addEventListener("openTextEditor",y),()=>{window.removeEventListener("openSignaturePad",d),window.removeEventListener("openTextEditor",y)}},[]);const ee=async()=>{T(!0);try{const d=await tt(F);if(d instanceof Blob){const y=URL.createObjectURL(d);a(y)}else console.error("Unexpected response type:",d),a(null)}catch(d){console.error("Error fetching document:",d),a(null)}finally{T(!1)}},$=async()=>{var d,y,f,w;try{const c=await ue(F);if((y=(d=c==null?void 0:c.data)==null?void 0:d.finalResults)!=null&&y.$values){const A=((w=(f=c==null?void 0:c.data)==null?void 0:f.finalResults)==null?void 0:w.$values)||[];o(A);const V=A.length>0&&A.every(J=>J.status==="Signed");_(V)}}catch(c){console.error("Failed to fetch parties:",c),o([]),_(!1)}},he=(d,y)=>d.map(f=>{var A;let w=String(f.fieldType).toLowerCase();w==="1"||w==="text"?w="text":w==="2"||w==="initials"?w="initials":w==="3"||w==="signature"?w="signature":w==="4"||w==="date"?w="date":w="text";const c=f.assignedPartyId?{id:f.assignedPartyId,name:f.assignedParty,color:((A=y.find(V=>V.id===f.assignedPartyId))==null?void 0:A.color)||"#3b82f6"}:null;return{id:f.id,x:f.positionX,y:f.positionY,width:f.width,height:f.height,pageNumber:f.pageNumber,fieldType:w,assignedUser:c,textValue:f.placeholderText||"",signatureData:f.signatureData||null,pageWidth:f.pageWidth,pageHeight:f.pageHeight}}),we=async()=>{var d,y,f,w;try{const c=await st(F);(y=(d=c==null?void 0:c.data)==null?void 0:d.finalResults)!=null&&y.$values&&e(he((w=(f=c==null?void 0:c.data)==null?void 0:f.finalResults)==null?void 0:w.$values,n))}catch(c){console.error("Failed to fetch parties:",c),e([])}};z.useEffect(()=>{(async()=>{ee(),await $(),await we()})()},[F]);const de=async(d,y,f)=>{var w,c;try{const A=y==null?void 0:y.map((V,J)=>({partyId:V.id,signingOrder:J+1}));await Ze(F,A),Y.push(i.jsx(Z,{title:"Success",type:"success",children:"Parties signing order saved successfully!"}))}catch(A){console.error("Error saving parties:",A),Y.push(i.jsx(Z,{title:"Error",type:"danger",children:((c=(w=A==null?void 0:A.response)==null?void 0:w.data)==null?void 0:c.message)??"Failed to save parties. Please try again."}))}},ze=async d=>{var y,f;try{await Qe(F),Y.push(i.jsx(Z,{title:"Success",type:"success",children:"Document sent successfully!"})),d(!1)}catch(w){console.error("Error saving parties:",w),Y.push(i.jsx(Z,{title:"Error",type:"danger",children:((f=(y=w==null?void 0:w.response)==null?void 0:y.data)==null?void 0:f.message)??"Failed to sent parties. Please try again."}))}},Se=async d=>{var y,f;try{await Je(d),Y.push(i.jsx(Z,{title:"Success",type:"success",children:"Party Deleted successfully!"})),$()}catch(w){console.error("Error saving parties:",w),Y.push(i.jsx(Z,{title:"Error",type:"danger",children:((f=(y=w==null?void 0:w.response)==null?void 0:y.data)==null?void 0:f.message)??"Failed to delete parties. Please try again."}))}},je=async d=>{var y,f;try{let w=d==null?void 0:d.map(c=>{var A;return{fieldType:ne==null?void 0:ne[c==null?void 0:c.fieldType],fieldName:c==null?void 0:c.id,pageNumber:c==null?void 0:c.pageNumber,positionX:c==null?void 0:c.x,positionY:c==null?void 0:c.y,width:c==null?void 0:c.width,height:c==null?void 0:c.height,assignedPartyId:c!=null&&c.assignedUser?(A=c==null?void 0:c.assignedUser)==null?void 0:A.id:null,pageWidth:c==null?void 0:c.pageWidth,pageHeight:c==null?void 0:c.pageHeight}});await Ke(F,w),h(!1)}catch(w){console.error("Error saving fields:",w),Y.push(i.jsx(Z,{title:"Error",type:"danger",children:((f=(y=w==null?void 0:w.response)==null?void 0:y.data)==null?void 0:f.message)??"Failed to save fields. Please try again."}))}},Ne=d=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d),De=async()=>{var w,c,A,V,J,pe;const d={name:"",email:""};if(b.name.trim()||(d.name="Name is required"),b.email.trim()?Ne(b.email.trim())||(d.email="Invalid email address"):d.email="Email is required",C(d),d.name||d.email)return;const y="#"+Math.floor(Math.random()*16777215).toString(16),f={...b,color:y};try{await et(F,f);const G=await ue(F);(c=(w=G==null?void 0:G.data)==null?void 0:w.finalResults)!=null&&c.$values&&o(((V=(A=G==null?void 0:G.data)==null?void 0:A.finalResults)==null?void 0:V.$values)||[]),D({name:"",email:""}),C({name:"",email:""})}catch(G){console.error("Error adding party:",G);const Te=((pe=(J=G==null?void 0:G.response)==null?void 0:J.data)==null?void 0:pe.message)||"Failed to add party";Y.push(i.jsx(Z,{title:"Error",type:"danger",children:Te}))}},Re=(d,y,f)=>{u({visible:!0,fieldId:d,user:y,type:f})},Pe=(d,y)=>{x({visible:!0,fieldId:d,value:y})};z.useEffect(()=>{if(!(t!=null&&t.length))return;const d=setTimeout(()=>{je(t)},2e3);return()=>clearTimeout(d)},[t]);const Ee=(d,y)=>{P(y),d.dataTransfer.effectAllowed="move",d.dataTransfer.setData("text/plain",String(y)),d.currentTarget.style.opacity="0.5"},Ce=d=>{d.currentTarget.style.opacity="1",P(null),U(null)},We=d=>{d.preventDefault(),d.dataTransfer.dropEffect="move"},Me=(d,y)=>{d.preventDefault(),U(y)},ke=()=>{U(null)},Le=(d,y)=>{if(d.preventDefault(),L===null||L===y)return;const f=[...n],w=f[L];f.splice(L,1),f.splice(y,0,w),o(f),de(null,f),P(null),U(null)};return i.jsxs(i.Fragment,{children:[k&&i.jsx("div",{className:"flex justify-center items-center absolute inset-0 bg-gray-300 bg-opacity-20 z-50",children:i.jsx(Xe,{loading:!0})}),s?i.jsxs(Ie,{backend:Ue,children:[i.jsxs("div",{className:"flex bg-white rounded-lg shadow-lg overflow-hidden h-[90vh]",children:[i.jsxs("div",{className:"w-[20%] border-r bg-gray-100 p-4 flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold text-gray-700",children:"Fields"}),i.jsxs(Q,{size:"sm",variant:"solid",onClick:()=>q("/app/pages/signature/documents"),className:"transition-all duration-300 group hover:pr-8 hover:w-auto",children:[i.jsx(Ye,{size:24}),i.jsx("span",{className:"opacity-0 max-w-0 transition-all duration-300 group-hover:opacity-100 group-hover:max-w-xs whitespace-nowrap",children:"Back"})]})]}),jt.map(d=>i.jsx(Nt,{field:d},d.type)),(t==null?void 0:t.length)>0&&i.jsx("div",{onClick:()=>e([]),className:"cursor-move px-3 py-2 mb-2 border-t-custom-50 rounded-md border text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-100",children:!I&&i.jsxs("div",{className:"flex gap-4",children:[i.jsx(ce,{color:"red",size:18}),i.jsx("span",{children:" Clear all Fields"})]})}),i.jsx("h3",{className:"font-semibold text-gray-700 mt-6 mb-2",children:"Parties"}),i.jsx("div",{className:"space-y-2 max-h-54 overflow-auto mb-3",children:n==null?void 0:n.map((d,y)=>{var f,w;return i.jsxs("div",{draggable:!0,onDragStart:c=>Ee(c,y),onDragEnd:Ce,onDragOver:We,onDragEnter:c=>Me(c,y),onDragLeave:ke,onDrop:c=>Le(c,y),className:`
21
- flex items-center justify-between rounded px-3 py-2 border cursor-grab
22
- ${L===y?"bg-blue-50 border-blue-300 opacity-50":B===y?"bg-green-50 border-green-300 scale-[1.02]":"bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300"}
23
- `,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{style:{background:d.color||"#f3741c"},className:"w-8 h-8 rounded flex items-center justify-center text-white font-semibold",children:(w=(f=d.name)==null?void 0:f.slice(0,1))==null?void 0:w.toUpperCase()}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-medium",children:d.name}),i.jsx("div",{className:"text-xs text-gray-500",children:d.email})]})]}),!I&&i.jsx("button",{className:"text-red-500 text-sm",onClick:()=>Se(d.id),children:i.jsx(ce,{size:18})})]},d.id)})}),!I&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mt-2 space-y-2",children:[i.jsx(oe,{className:`border rounded px-2 py-1 text-xs w-full ${R.name?"border-red-500":""}`,placeholder:"Name",required:!0,value:b.name,onChange:d=>D({...b,name:d.target.value})}),R.name&&i.jsx("p",{className:"text-red-500 text-[11px] -mt-1",children:R.name}),i.jsx(oe,{className:`border rounded px-2 py-1 text-xs w-full ${R.email?"border-red-500":""}`,placeholder:"Email",required:!0,value:b.email,onChange:d=>D({...b,email:d.target.value})}),R.email&&i.jsx("p",{className:"text-red-500 text-[11px] -mt-1",children:R.email}),i.jsx(Q,{variant:"solid",size:"sm",className:"w-full text-xs py-1",onClick:De,children:"Add Party"})]}),i.jsxs("div",{className:"mt-auto pt-3 border-t space-y-2",children:[i.jsx(Q,{className:"w-full text-sm",size:"sm",variant:"solid",disabled:(n==null?void 0:n.length)===0,onClick:()=>h(!0),children:"Send To Signers (Email)"}),i.jsx(Q,{className:"w-full text-sm",size:"sm",variant:"solid",disabled:(n==null?void 0:n.length)===0,onClick:()=>j(!0),children:"Generate Links"})]})]})]}),i.jsx("div",{className:"flex-1 min-w-0 p-4",children:i.jsx(Oe,{file:s,onLoadSuccess:({numPages:d})=>l(d),loading:"Loading PDF...",children:i.jsx(Pt,{fields:t,setFields:e,numPages:r,scale:1.5,users:n,onOpenSignature:Re,onOpenTextEditor:Pe})})})]}),i.jsx(Rt,{visible:p,onClose:()=>h(!1),parties:n,setParties:o,onSubmit:d=>de(t,d),onSend:()=>ze(()=>h(!1))}),i.jsx(St,{isOpen:S,onClose:()=>j(!1),signLinks:n,documentId:F,expiryDate:E,onUpdateDate:d=>g(d)}),i.jsxs("button",{className:"fixed bottom-10 right-10 z-0 flex items-center gap-2 bg-custom-500 text-white rounded-full shadow-lg px-5 py-3 transition-all duration-300 group hover:pr-8 hover:w-auto",onClick:()=>W(!0),children:[i.jsx(rt,{size:24,className:"min-w-6"}),i.jsx("span",{className:"opacity-0 max-w-0 overflow-hidden transition-all duration-300 group-hover:opacity-100 group-hover:max-w-xs whitespace-nowrap",children:"Document Activity"})]})]}):i.jsx(i.Fragment,{children:k?"":"No Pdf Found"}),i.jsx(qe,{title:"Document Activity",isOpen:N,onClose:()=>W(!1),portalClassName:"w30",children:i.jsx(at,{documentId:F})})]})}export{rs as default};
@@ -1 +0,0 @@
1
- import{j as e,l as ce}from"./vendor-mui-69397583.js";import{A as Q}from"./AdaptableCard-df7695d6.js";import{r as a,c as de,f as me,L as Oe}from"./vendor-react-ece1c85f.js";import{b as ue,c as Pe,a as qe}from"./vendor-redux-a1f00e6b.js";import{p as Ve,q as Ye,r as _e,s as Ge,t as Xe,h as Ze,u as He,v as Ke,w as We,x as Qe}from"./DigitalSignature-fff42e33.js";import{F as Je,I as O,W as et,B as T,D as tt,Y as pe,l as fe,f as he,Z as ge,V as xe,O as S,Q as C}from"./index-c62ac197.js";import{T as I,A as ye}from"./actioncell-17e12e21.js";import{D as je}from"./tableV2-4d1c9fd2.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import{D as Y}from"./Drawer-949c18c6.js";import{a as ne}from"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import{U as be}from"./Upload-fb34ce03.js";import{c as ee,a as X,i as De,h as at,F as te,b as ae,d as L,E as J}from"./index.esm-70ab539c.js";import{S as Se}from"./StickyFooter-5b934274.js";import{A as st}from"./DocumentActivity-d63dacec.js";import{C as Ce}from"./ConfirmDialog-3202eb3d.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./FileSaver.min-20f3f13a.js";import"./DensitySelector-a2c1c68f.js";import"./NoData-8c485a3a.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";import"./DateDifference-e47d2393.js";const se="SignatureData",_=ue(`${se}/getDocumentsData`,async i=>(await Ve()).data),G=ue(`${se}/getDocumentsTemplates`,async()=>(await Ye()).data),lt={total:0,pageIndex:1,pageSize:10,query:"",sort:{order:"",key:""}},it={loading:!1,deleteConfirmation:!1,selectedRowData:"",tableData:lt,filterData:{parentAccount:"",primaryContact:"",billingContact:""},accountList:[],contactList:[],documentList:[],DocumentTemplate:[]},we=Pe({name:`${se}`,initialState:it,reducers:{setTableData:(i,s)=>{i.tableData=s.payload},setFilterData:(i,s)=>{i.filterData=s.payload},toggleDeleteConfirmation:(i,s)=>{i.deleteConfirmation=s.payload},setSelectedRowData:(i,s)=>{i.selectedRowData=s.payload}},extraReducers:i=>{i.addCase(_.fulfilled,(s,c)=>{var f,h,m,u;console.log("action.payload",(h=(f=c.payload)==null?void 0:f.finalResults)==null?void 0:h.$values),s.documentList=(u=(m=c.payload)==null?void 0:m.finalResults)==null?void 0:u.$values,s.loading=!1}).addCase(_.pending,s=>{s.loading=!0}).addCase(_.rejected,(s,c)=>{s.documentList=[]}).addCase(G.fulfilled,(s,c)=>{var f,h;s.DocumentTemplate=(h=(f=c.payload)==null?void 0:f.finalResults)==null?void 0:h.$values,s.loading=!1}).addCase(G.pending,s=>{s.loading=!0}).addCase(G.rejected,(s,c)=>{s.DocumentTemplate=[]})}}),{setTableData:Zt,setFilterData:Ht,toggleDeleteConfirmation:Ne,setSelectedRowData:Fe}=we.actions,nt=we.reducer,Te=qe({data:nt}),U=Je,oe=1,ot=ee({title:X().required("Title is required"),files:De().of(at()).test("file-or-template","Please either upload a file or select a template",function(i){const c=((this==null?void 0:this.parent)||{}).templateId,f=Array.isArray(i)&&i.length>0,h=c!=null&&c!=="";return f||h}),templateId:X().nullable()}),rt=({initialData:i={files:[],title:"",templateId:null},onSubmit:s,onCancel:c,type:f="Add"})=>{const h=["application/pdf"],[m,u]=a.useState([]);a.useEffect(()=>{(async()=>{var r,x,p,j,o,g,D;try{const b=await _e();(p=(x=(r=b==null?void 0:b.data)==null?void 0:r.data)==null?void 0:x.finalResults)!=null&&p.$values&&u((D=(g=(o=(j=b.data)==null?void 0:j.data)==null?void 0:o.finalResults)==null?void 0:g.$values)==null?void 0:D.map(F=>({id:F.id,name:F.templateName})))}catch(b){console.error("Failed to load filter options",b)}})()},[]);const N=(d,r)=>{let x=!0;const p=1e7;if(r.length>=oe)return`You can only upload ${oe} file(s)`;if(d)for(const j of d)h.includes(j.type)?j.size>=p&&(x="Upload file cannot be more than 10MB!"):x="Only PDF files are allowed!";return x};return e.jsx(te,{initialValues:{...i},validationSchema:ot,onSubmit:(d,{setSubmitting:r})=>{s(d,r)},children:({values:d,setFieldValue:r,touched:x,errors:p,isSubmitting:j})=>e.jsx(ae,{children:e.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Title*"}),e.jsx(L,{name:"title",children:({field:o})=>e.jsx(O,{...o,placeholder:"File title"})}),e.jsx(J,{name:"title",component:"div",className:"text-red-600"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select Template"}),e.jsx(et,{options:m.map(o=>({label:o.name,value:o.id})),isMulti:!1,value:d.templateId?m.map(o=>({label:o.name,value:o.id})).find(o=>o.value===d.templateId):null,onChange:o=>{r("templateId",(o==null?void 0:o.value)||null),r("files",[])},isDisabled:d.files&&d.files.length>0,className:"rounded-md",styles:{input:o=>({...o,color:"black"})}}),e.jsx(J,{name:"templateId",component:"div",className:"text-red-600"})]}),e.jsx("p",{className:"text-center",children:"OR"}),e.jsxs("div",{className:"mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload File"}),e.jsx(L,{name:"files",children:({field:o,form:g})=>e.jsx(be,{draggable:!0,accept:h,beforeUpload:N,fileList:d.files||[],disabled:!!d.templateId,onChange:D=>{r("files",D),r("templateId",null)},onFileRemove:D=>g.setFieldValue(o.name,D)})}),p.files&&x.files&&e.jsx("div",{className:"text-red-500 text-sm mt-1",children:p.files})]}),e.jsx(Se,{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.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(T,{size:"sm",className:"mr-2",onClick:c,children:"Cancel"}),e.jsx(T,{size:"sm",variant:"solid",type:"submit",loading:j,children:"Save"})]})})]})})})},ct=ee().shape({fileName:X().required("Name is required")}),dt=({isOpen:i,onClose:s,onSubmit:c,loading:f,FileName:h})=>e.jsx(tt,{isOpen:i,onClose:s,contentClassName:"pb-0 px-0",className:"my-4",children:e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"px-6",children:"Save Template"}),e.jsx(te,{initialValues:{fileName:h??"",description:""},validationSchema:ct,onSubmit:m=>{c(m)},children:({errors:m,touched:u})=>e.jsxs(ae,{className:"px-6 pb-6 pt-4 gap-2",children:[e.jsx(ne,{label:"Template Name",asterisk:!0,invalid:!!m.fileName&&u.fileName,errorMessage:m.fileName,children:e.jsx(L,{type:"text",name:"fileName",className:"mt-2",placeholder:"Template Name",component:O,errors:m,touched:u})}),e.jsx(ne,{label:"Description",invalid:!!m.description&&u.description,errorMessage:m.description,children:e.jsx(L,{type:"text",textArea:!0,name:"description",className:"mt-2",placeholder:"Description",component:O,errors:m,touched:u})}),e.jsxs("div",{className:"flex justify-between gap-2 mt-4",children:[e.jsx(T,{type:"button",onClick:s,size:"sm",children:"Cancel"}),e.jsx(T,{type:"submit",size:"sm",loading:f,variant:"solid",children:"Save"})]})]})})]})}),re=1,mt=ee({title:X().required("Title is required"),files:De().min(1,"Please upload at least one file").required("File upload is required")}),ut=({initialData:i={files:[],title:"",description:""},onSubmit:s,onCancel:c,type:f="Add"})=>{const h=["application/pdf"],m=(u,N)=>{let d=!0;const r=1e7;if(N.length>=re)return`You can only upload ${re} file(s)`;if(u)for(const x of u)h.includes(x.type)?x.size>=r&&(d="Upload file cannot be more than 10MB!"):d="Only PDF files are allowed!";return d};return e.jsx(te,{initialValues:{...i},validationSchema:mt,onSubmit:(u,{setSubmitting:N})=>{s(u,N)},children:({values:u,setFieldValue:N,touched:d,errors:r,isSubmitting:x})=>e.jsx(ae,{children:e.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Title*"}),e.jsx(L,{name:"title",children:({field:p})=>e.jsx(O,{...p,placeholder:"Template title"})}),e.jsx(J,{name:"title",component:"div",className:"text-red-600"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),e.jsx(L,{name:"description",children:({field:p})=>e.jsx(O,{textArea:!0,...p,placeholder:"description"})})]}),e.jsxs("div",{className:"mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload Template*"}),e.jsx(L,{name:"files",children:({field:p,form:j})=>e.jsx(be,{draggable:!0,accept:h,beforeUpload:m,fileList:u.files||[],disabled:!!u.templateId,onChange:o=>{N("files",o)},onFileRemove:o=>j.setFieldValue(p.name,o)})}),r.files&&d.files&&e.jsx("div",{className:"text-red-500 text-sm mt-1",children:r.files})]}),e.jsx(Se,{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.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(T,{size:"sm",className:"mr-2",onClick:c,children:"Cancel"}),e.jsx(T,{size:"sm",variant:"solid",type:"submit",loading:x,children:"Save"})]})})]})})})};pe("SignatureData",Te);function pt(i){if(i===0)return"0 B";const s=["B","KB","MB","GB","TB"],c=Math.floor(Math.log(i)/Math.log(1024));return`${(i/Math.pow(1024,c)).toFixed(2)} ${s[c]}`}const Re=()=>{const[i,s]=a.useState([]);a.useState(!1);const[c,f]=a.useState(!1);a.useState(!1),a.useState();const[h,m]=a.useState(!1),[u,N]=a.useState(!1);a.useState(!1),a.useState(!1),a.useState(null);const d={edit:!1,delete:!0,view:!1};a.useRef(null),me();const r=fe(),{textTheme:x}=he(),p=U(l=>l.SignatureData.data.loading);U(l=>l.SignatureData.data.tableData);const j=U(l=>{var w,v;return((v=(w=l==null?void 0:l.SignatureData)==null?void 0:w.data)==null?void 0:v.DocumentTemplate)||[]}),[o,g]=a.useState(null),[D,b]=a.useState(!1),F=()=>{f(!0)},k=()=>{f(!1)},R=a.useCallback(async()=>{try{await r(G())}catch(l){console.error("Failed to fetch document data:",l)}},[r]),Z=a.useCallback(()=>{m(!0)},[]),A=a.useCallback((l,w)=>{w===I.delete&&(r(Ne(!0)),r(Fe(l)),g(l),b(!0))},[r]),P=async(l,w)=>{try{await Ge(l==null?void 0:l.title,l==null?void 0:l.description,l==null?void 0:l.files[0]),await R(),w(!1),k(),S.push(e.jsx(C,{title:"Success",type:"success",children:"Template added successfully!"}))}catch(v){console.error("Error adding document:",v),w(!1),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to upload document"}))}},H=a.useMemo(()=>[{dataField:"Action",caption:"Action",width:"10%",cellRender:l=>e.jsx("div",{id:"mAction","data-cname":"Action",children:e.jsx(ye,{row:l==null?void 0:l.data,actions:d,buttonClick:A})})},{dataField:"templateName",cssClass:"truncate-cell",caption:"Title",width:"15%",cellRender:l=>e.jsx("div",{"data-cname":"Name",children:l.value})},{dataField:"description",caption:"Description",width:"30%",cssClass:"truncate-cell",cellRender:l=>e.jsx("div",{"data-cname":"Description",children:l.value})},{dataField:"fileSize",caption:"Size",width:"10%",alignment:"left",cellRender:l=>e.jsx("div",{"data-cname":"Size",children:pt(l.value)})},{dataField:"createdByUserName",caption:"Uploaded By",width:"20%"},{dataField:"uploadDate",caption:"Upload Date",width:"10%",dataType:"date",format:"dd-MM-yyyy",cellRender:l=>{const w=ge(l.value).format("MM/DD/YYYY");return e.jsx("div",{"data-cname":"Upload Date",children:w})}}],[x,A]),[M,K]=a.useState({pageSize:"",pageIndex:""});a.useEffect(()=>{R()},[R]);const q=async()=>{if(o!=null&&o.id){b(!0);try{await Xe(o.id),S.push(e.jsx(C,{title:"Deleted",type:"success",children:"Template deleted successfully!"})),$(),await R()}catch(l){console.error("Delete error:",l),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to delete document"}))}finally{b(!1)}}},$=()=>{b(!1),g(null)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2 px-4 border-gray-200 border-b",children:e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Document Templates"}),e.jsx("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2",children:e.jsx(T,{onClick:F,block:!0,variant:"solid",size:"sm",icon:e.jsx(xe,{}),children:"New Template"})})]})}),(p||u)&&e.jsx(ce,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),e.jsx(Q,{className:"p-4",children:e.jsx(je,{columns:H,tableName:"digital-signature-template",data:j||[],defaultHiddenColumn:[],height:"calc(100vh - 200px)",fetchData:R,id_label:"$id",selectedRowId:i,setSelectedRowId:s,setFilterValues:()=>{},filterValues:[],identity:"digital-signature-template",setInLineFilters:()=>{},inLineFilter:[],inLineFilterMobileView:[],setInLineFiltersMobileView:()=>{},setColSorting:()=>{},ImpColumnName:"DocumentId",idName:"DocumentTemplate-Listing",handleSearch:()=>{},isColumnResizing:!0,pager:M,setPager:K,openFilter:Z,isPaginationReq:!0,isFilterReq:!1,isSelectionReq:!1,isLoading:p})}),e.jsx(Y,{title:"Add New Template",isOpen:c,onClose:k,portalClassName:"w30",children:e.jsx(ut,{onSubmit:P,onCancel:k,type:"Add"})}),e.jsx(Ce,{isOpen:D,type:"danger",title:"Delete Template",confirmButtonColor:"red-600",onClose:$,onCancel:$,onConfirm:q,children:e.jsx("p",{children:"Are you sure you want to delete this Template? This action cannot be undone."})})]})};Re.displayName="DocumentTemplate";const ft=de.memo(Re);pe("SignatureData",Te);const ht=(i="")=>i.replace(/([A-Z])/g," $1").trim();function gt(i){if(i===0)return"0 B";const s=["B","KB","MB","GB","TB"],c=Math.floor(Math.log(i)/Math.log(1024));return`${(i/Math.pow(1024,c)).toFixed(2)} ${s[c]}`}const ve=()=>{const[i,s]=a.useState([]);a.useState(!1);const[c,f]=a.useState(!1),[h,m]=a.useState(!1);a.useState();const[u,N]=a.useState(!1),[d,r]=a.useState(!1),[x,p]=a.useState(!1),[j,o]=a.useState(!1),[g,D]=a.useState(null),b={edit:!1,delete:!0,view:!0,activity:!0,sendForSignature:!0,template:!0,signedDoc:!0};a.useRef(null),me();const F=fe(),{textTheme:k}=he(),R=U(t=>t.SignatureData.data.loading);U(t=>t.SignatureData.data.tableData);const Z=U(t=>{var n,y;return((y=(n=t==null?void 0:t.SignatureData)==null?void 0:n.data)==null?void 0:y.documentList)||[]}),[A,P]=a.useState(null),[H,M]=a.useState(!1),[K,q]=a.useState(!1),$=()=>{q(!0)},l=()=>{q(!1)},w=()=>{f(!0)},v=()=>{f(!1)},Ae=t=>{m(!0)},z=a.useCallback(async()=>{try{await F(_())}catch(t){console.error("Failed to fetch document data:",t)}},[F]),Ie=a.useCallback(()=>{N(!0)},[]),le=a.useCallback(t=>{window.open(`/app/pages/signature/documents/details/${t.id}`)},[]),ie=a.useCallback((t,n)=>{n===I.view&&le(t),n===I.activity&&(Ae(),D(t)),n===I.delete&&(F(Ne(!0)),F(Fe(t)),P(t),M(!0)),n===I.sendForSignature&&ke(t.id),n===I.template&&(D(t),p(!0)),n===I.signedDoc&&Ue(t.id)},[F,le]),Le=async(t,n)=>{try{await Ke(t==null?void 0:t.files[0],(t==null?void 0:t.templateId)??void 0,t==null?void 0:t.title),await z(),n(!1),v(),S.push(e.jsx(C,{title:"Success",type:"success",children:"Document uploaded successfully!"}))}catch(y){console.error("Error adding document:",y),n(!1),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to upload document"}))}},ke=async t=>{r(!0);try{await Ze(t),S.push(e.jsx(C,{title:"Success",type:"success",children:"Document sent successfully!"}))}catch(n){console.error("Error adding document:",n),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to sent document"}))}finally{r(!1)}},Me=async t=>{var n,y,V;try{r(!0),(n=(await We(g==null?void 0:g.id,t==null?void 0:t.fileName,t==null?void 0:t.description)).data)!=null&&n.success&&(r(!1),D(null),p(!1),S.push(e.jsx(C,{title:"Success",type:"success",children:"Template Saved successfully!"})))}catch(E){S.push(e.jsx(C,{title:"Error",type:"danger",children:((V=(y=E.response)==null?void 0:y.data)==null?void 0:V.message)||"An unexpected error occurred while Saving the template."}))}finally{r(!1)}},Ue=async t=>{const n=await He(t),y=n.headers["content-type"],V=new Blob([n.data],{type:y}),E=URL.createObjectURL(V);if(y.startsWith("image/")||y==="application/pdf")window.open(E,"_blank");else{const B=document.createElement("a");B.href=E,B.download="signed-file",document.body.appendChild(B),B.click(),document.body.removeChild(B)}},$e=a.useMemo(()=>[{dataField:"Action",caption:"Action",width:"10%",cellRender:t=>e.jsx("div",{id:"mAction","data-cname":"Action",children:e.jsx(ye,{row:t==null?void 0:t.data,actions:b,buttonClick:ie})})},{dataField:"description",caption:"Title",width:"30%",cellRender:t=>{var n;return e.jsx("div",{"data-cname":"Name",children:e.jsx(Oe,{to:`/app/pages/signature/documents/details/${(n=t==null?void 0:t.data)==null?void 0:n.id}`,className:`${k} hover:underline`,children:t.value})})}},{dataField:"status",caption:"Status",alignment:"left",width:"10%",cellRender:t=>{const n=t.value||"Pending",y={Completed:"bg-green-100 text-green-800",Draft:"bg-yellow-100 text-yellow-800",Pending:"bg-gray-100 text-gray-800",PendingSignatures:"bg-red-100 text-red-800"};return e.jsx("div",{"data-cname":"Status",children:e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${y[n]||y.Pending}`,children:ht(n)})})}},{dataField:"sourceType",caption:"Source",width:"12%",alignment:"left",cellRender:t=>{var y;const n=(y=t==null?void 0:t.data)==null?void 0:y.isCreatedFromTemplate;return e.jsx("div",{"data-cname":"Source",children:e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${n?"bg-custom-100 text-custom-800":"bg-purple-100 text-purple-800"}`,children:n?"Template Upload":"File Upload"})})}},{dataField:"fileSize",caption:"Size",width:"10%",alignment:"left",cellRender:t=>e.jsx("div",{"data-cname":"Size",children:gt(t.value)})},{dataField:"createdByUserName",caption:"Uploaded By",width:"20%"},{dataField:"createdDate",caption:"Upload Date",width:"10%",dataType:"date",format:"dd-MM-yyyy",cellRender:t=>{const n=ge(t.value).format("MM/DD/YYYY");return e.jsx("div",{"data-cname":"Upload Date",children:n})}}],[k,ie]),[ze,Ee]=a.useState({pageSize:"",pageIndex:""});a.useEffect(()=>{z()},[z]);const Be=async()=>{if(A!=null&&A.id){M(!0);try{await Qe(A.id),S.push(e.jsx(C,{title:"Deleted",type:"success",children:"Document deleted successfully!"})),W(),await z()}catch(t){console.error("Delete error:",t),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to delete document"}))}finally{M(!1)}}},W=()=>{M(!1),P(null)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Document List"}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2",children:[e.jsx(T,{onClick:$,block:!0,variant:"solid",size:"sm",className:"mr-2",children:"View Templates"}),e.jsx(T,{onClick:w,block:!0,variant:"solid",size:"sm",icon:e.jsx(xe,{}),children:"New Document"})]})]})}),e.jsxs(Q,{className:"h-full py-2 px-4 m-6 bg-transparent",bodyClass:"h-full",children:[(R||d)&&e.jsx(ce,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),e.jsx(Q,{className:"borderless",children:e.jsx(je,{columns:$e,tableName:"digital-signature-Listing",data:Z||[],defaultHiddenColumn:[],height:"calc(100vh - 310px)",fetchData:z,id_label:"$id",selectedRowId:i,setSelectedRowId:s,setFilterValues:()=>{},filterValues:[],identity:"digital-signature-Listing",setInLineFilters:()=>{},inLineFilter:[],inLineFilterMobileView:[],setInLineFiltersMobileView:()=>{},setColSorting:()=>{},ImpColumnName:"DocumentId",idName:"DocumentList-Listing",handleSearch:()=>{},isColumnResizing:!0,pager:ze,setPager:Ee,openFilter:Ie,isPaginationReq:!0,isFilterReq:!1,isSelectionReq:!1,isLoading:R})})]}),e.jsx(Y,{title:"Upload New Document",isOpen:c,onClose:v,portalClassName:"w30",children:e.jsx(rt,{onSubmit:Le,onCancel:v,type:"Add"})}),e.jsx(Y,{title:"Document Activity",isOpen:h,onClose:()=>m(!1),portalClassName:"w30",children:e.jsx(st,{documentId:g==null?void 0:g.id})}),e.jsx(Ce,{isOpen:H,type:"danger",title:"Delete Record",confirmButtonColor:"red-600",onClose:W,onCancel:W,onConfirm:Be,children:e.jsx("p",{children:"Are you sure you want to delete this File Record? This action cannot be undone."})}),e.jsx(Y,{title:"",isOpen:K,onClose:l,portalClassName:"w90",children:e.jsx(ft,{})}),e.jsx(dt,{isOpen:x,onClose:()=>p(!1),userId:g,loading:j,onSubmit:Me,FileName:`Copy of ${g==null?void 0:g.description}`})]})};ve.displayName="DocumentList";const Kt=de.memo(ve);export{Kt as default};
@@ -1,7 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{r as a,k as Ne}from"./vendor-react-ece1c85f.js";import{D as Te,G as Ce,v as ke,P as De}from"./vendor-pdf-b2a5d8b1.js";import{D as Ee,H as Fe}from"./index-a22a3546.js";import{S as Ie}from"./index-b028e652.js";import"./Alert-7dfbd254.js";import{E as ae,B as F,I as re,W as ze}from"./index-c62ac197.js";import"./index-6b6d0f06.js";import{a as Pe}from"./index-c2088808.js";import"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import{U as $e}from"./Upload-fb34ce03.js";import{F as Ue}from"./index-fcc1c999.js";import{Q as Me}from"./index-0ec48d3d.js";import{p as _}from"./Notify-bb3ce372.js";import{b as Le,c as ue,d as We,e as Be}from"./DigitalSignature-fff42e33.js";import{C as Ve}from"./ConfirmDialog-3202eb3d.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";Ce.workerSrc=`https://unpkg.com/pdfjs-dist@${ke}/build/pdf.worker.min.mjs`;const Re=({fields:v,currentUser:x,scale:S,numPages:I,onOpenSignature:N,onOpenTextEditor:b,activeFieldId:C})=>(a.useEffect(()=>{if(C){const d=document.getElementById(`field-${C}`);d&&d.scrollIntoView({behavior:"smooth",block:"center"})}},[C]),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:I}).map((d,l)=>e.jsxs("div",{className:"relative mb-6 flex justify-center w-full",children:[e.jsx(De,{pageNumber:l+1,width:Math.round(850*S),renderTextLayer:!1,renderAnnotationLayer:!1},`page_${l+1}`),v.filter(i=>i.pageNumber===l+1).map(i=>{var c,T;const o=((c=i.assignedUser)==null?void 0:c.id)===(x==null?void 0:x.id),h=C===i.id;return e.jsxs("div",{id:`field-${i.id}`,className:`absolute transition-transform ${h?"scale-105 animate-pulse-highlight":""}`,style:{left:`${i.x*S}px`,top:`${i.y*S}px`,width:`${i.width*S}px`,height:`${i.height*S}px`,border:`2px dashed ${((T=i.assignedUser)==null?void 0:T.color)||"#888"}`,backgroundColor:o?"rgba(255,255,180,0.85)":"rgba(255,255,255,0.7)",borderRadius:"6px",zIndex:10,cursor:o?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},onClick:()=>{o&&(i.fieldType==="signature"||i.fieldType==="initials"?N(i.id,i.assignedUser,i.fieldType):b(i.id,i.textValue||""))},children:[o&&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 ${o?"text-gray-700 cursor-pointer":"text-gray-400"}`,children:o?"Click to Sign":"Signature"}),(i.fieldType==="signature"||i.fieldType==="initials")&&i.signatureData&&e.jsx("div",{style:{width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"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",style:{fontSize:`${Math.min(i.height*.5*S,20)}px`,color:o?"#333":"#999",width:"100%",height:"100%",lineHeight:"1.1",textAlign:"center",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.jsx("span",{style:{display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"},children:i.textValue||"Enter Text"})}),i.fieldType==="date"&&e.jsx("div",{className:`text-xs font-semibold ${o?"text-gray-700 cursor-pointer":"text-gray-400"}`,children:i.textValue||"Enter Date"})]})]},i.id)})]},l))]})),me=(v,x)=>{const[S,I]=a.useState({top:0,left:0,placement:"right"});return a.useEffect(()=>{if(!v)return;const N=()=>{const d=document.getElementById(`field-${v}`),l=x==null?void 0:x.current;if(!d||!l)return;const i=d.getBoundingClientRect();l.getBoundingClientRect();const o=window.innerWidth,h=window.innerHeight,c=420,T=250,k=16;let w="right",p=i.top,z=i.right+k;z+c>o-20&&(i.left-c-k>20?(w="left",z=i.left-c-k):(w="below",z=Math.max(20,Math.min(i.left,o-c-20)),p=i.bottom+k)),p<20&&(p=20),p+T>h-100&&(p=Math.max(20,h-T-100)),w==="below"&&p+T>h-100&&i.top-T-k>20&&(w="above",p=i.top-T-k),I({top:p,left:z,placement:w})};N();const b=()=>N();window.addEventListener("resize",b);const C=x==null?void 0:x.current;return C&&C.addEventListener("scroll",b),()=>{window.removeEventListener("resize",b),C&&C.removeEventListener("scroll",b)}},[v,x]),S},Ae=({visible:v,value:x,onClose:S,onSave:I,isLastField:N,onFinalize:b,fieldId:C,containerRef:d})=>{const[l,i]=a.useState(x||""),[o,h]=a.useState(""),c=me(v?C:null,d);if(a.useEffect(()=>{i(x||""),h("")},[x,v]),!v)return null;const T=()=>{if(!l.trim()){h("This field is required.");return}h(""),I(l.trim())},k=w=>{if(w.key==="Enter"&&!w.shiftKey){if(w.preventDefault(),!l.trim()){h("This field is required.");return}if(N){I(l.trim()),setTimeout(()=>{b==null||b()},150);return}else T()}};return e.jsx("div",{className:"fixed inset-0 z-50",onClick:S,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:`${c.top}px`,left:`${c.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 ${c.placement==="right"?"-left-1.5 top-6 border-l border-b":c.placement==="left"?"-right-1.5 top-6 border-r border-t":c.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 ${o?"border-red-500":"border-gray-300"}`,value:l,onChange:w=>{i(w.target.value),o&&h("")},onKeyDown:k,placeholder:"Enter field value",autoFocus:!0}),o&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:o})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(F,{variant:"plain",size:"sm",onClick:S,children:"Cancel"}),e.jsx(F,{variant:"solid",size:"sm",onClick:T,disabled:!l.trim(),children:N?"Finish":"Save"})]})]})})},He=({visible:v,onClose:x,onSave:S,type:I,field:N,existingSignature:b,tokenParam:C})=>{const d=a.useRef(null),[l,i]=a.useState("draw"),[o,h]=a.useState(null),[c,T]=a.useState(""),[k,w]=a.useState("Great Vibes"),[p,z]=a.useState(32),[P,E]=a.useState(""),[L,O]=a.useState(!1),[G,J]=a.useState({width:480,height:230});a.useEffect(()=>{const s=()=>{const f=window.innerWidth,m=Math.max(280,Math.min(480,Math.floor(f*.86))),u=Math.round(m/480*230);J({width:m,height:u})};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),a.useEffect(()=>{if(b&&d.current&&v&&l==="draw"){const s=d.current.getCanvas(),f=s.getContext("2d"),m=new Image;m.onload=()=>{f.clearRect(0,0,s.width,s.height);const u=Math.min(s.width/m.width,s.height/m.height),y=m.width*u,R=m.height*u,A=(s.width-y)/2,K=(s.height-R)/2;f.drawImage(m,A,K,y,R),d.current&&(d.current._isEmpty=!1,d.current.isEmpty=()=>!1)},m.src=b}},[b,v,l,G]),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;v||(T(""),h(null),(s=d.current)!=null&&s.clear&&d.current.clear(),E(""))},[v]);const X=`${window.location.origin}/create-signature?token=${N==null?void 0:N.signatureToken}`,ee=async()=>{var s,f;if(!(N!=null&&N.signatureToken)){x();return}O(!0);try{const m=await ue(C);if(m!=null&&m.success&&((f=(s=m==null?void 0:m.data)==null?void 0:s.assignedFields)!=null&&f.$values)){const u=m.data.assignedFields.$values.find(y=>y.signatureToken===N.signatureToken);if(u!=null&&u.signatureData&&u.signatureData!==b){_("Signature received via QR code!",void 0,"success"),S(u.signatureData);return}}}catch(m){console.error("Error fetching signature data:",m),_("Could not check for signature updates",void 0,"warning")}finally{O(!1)}x()},Y=s=>{const f=new FileReader;f.onloadend=()=>{h(f.result),E("")},f.readAsDataURL(s)},V=()=>{var f,m;if((f=d.current)!=null&&f.isEmpty&&((m=d.current)!=null&&m.isEmpty())){E("Please draw your signature before saving.");return}E("");const s=d.current.getTrimmedCanvas().toDataURL("image/png");S(s)},le=()=>{if(!c.trim()){E("Please type your signature before saving.");return}E("");const s=document.createElement("canvas"),f=s.getContext("2d");s.width=480,s.height=230,f.fillStyle="#fff",f.fillRect(0,0,s.width,s.height),f.fillStyle="#000",f.textAlign="center",f.textBaseline="middle",f.font=`${p}px "${k}"`,f.fillText(c,s.width/2,s.height/2);const m=s.toDataURL("image/png");S(m)},te=()=>{if(!o){E("Please upload an image before saving.");return}E(""),S(o)};if(!v)return null;let q=b||I==="initials"?["draw","type","upload"]:["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:[L&&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:I==="initials"?"Initials":"Signature"}),e.jsx("div",{className:"flex mb-4 border-b border-gray-200 overflow-x-auto -mx-2 px-2",children:q==null?void 0:q.map(s=>e.jsx("button",{className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${l===s?"border-custom-500 text-custom-600":"border-transparent text-gray-500"}`,onClick:()=>{i(s),E("")},children:s==="draw"?"Draw":s==="upload"?"Upload":s==="qr"?"Sign via QR":"Type"},s))}),l==="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(Ie,{ref:d,penColor:"black",minWidth:1.8,maxWidth:3.8,velocityFilterWeight:.6,dotSize:1.2,throttle:12,backgroundColor:"white",canvasProps:{width:G.width,height:G.height,className:"rounded-md touch-none select-none"}})}),P&&e.jsx("p",{className:"text-red-500 text-xs mb-2",children:P}),e.jsxs("div",{className:"flex justify-end gap-2 w-full px-2",children:[e.jsx(F,{variant:"plain",size:"sm",onClick:()=>{if(d.current){const s=d.current.getCanvas();s.getContext("2d").clearRect(0,0,s.width,s.height),d.current.clear()}E("")},children:"Clear"}),e.jsx(F,{variant:"solid",size:"sm",onClick:V,children:"Save"}),e.jsx(F,{onClick:x,variant:"twoTone",size:"sm",children:"Cancel"})]})]}),l==="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:c,onChange:s=>{T(s.target.value),E("")},className:`border rounded-md px-3 py-2 text-center ${P&&!c.trim()?"border-red-500":"border-gray-300"}`,placeholder:"Enter name or initials"}),P&&!c.trim()&&e.jsx("p",{className:"text-red-500 text-xs",children:P}),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(ze,{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:p,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:`${p}px`},children:c||"Preview"}),e.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[e.jsx(F,{variant:"solid",size:"sm",onClick:le,children:"Save"}),e.jsx(F,{onClick:x,variant:"twoTone",size:"sm",children:"Cancel"})]})]}),l==="upload"&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2",children:[e.jsx($e,{accept:"image/*",onChange:s=>Y(s[0]),label:"Upload your signature",draggable:!0,className:`w-full ${P&&!o?"border-red-400":""}`,children:e.jsxs("div",{className:"my-8 text-center",children:[e.jsx(Ue,{className:"text-5xl mx-auto mb-2"}),e.jsx("p",{className:"font-semibold",children:"Drop or browse an image"})]})}),P&&!o&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:P}),o&&e.jsx("img",{src:o,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(F,{variant:"solid",size:"sm",onClick:te,children:"Save"}),e.jsx(F,{onClick:x,variant:"twoTone",size:"sm",children:"Cancel"})]})]}),l==="qr"&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-6 px-2",children:[e.jsx(Me,{value:X,size:Math.min(240,G.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(F,{onClick:ee,variant:"solid",size:"sm",disabled:L,children:L?"Checking...":"Close"})})]})]})})},Oe=({visible:v,value:x,onClose:S,onSave:I,isLastField:N,onFinalize:b,fieldId:C,containerRef:d})=>{const[l,i]=a.useState(x||""),[o,h]=a.useState(""),c=me(v?C:null,d);if(a.useEffect(()=>{i(x||""),h("")},[x,v]),!v)return null;const T=p=>{const z=String(p.getMonth()+1).padStart(2,"0"),P=String(p.getDate()).padStart(2,"0"),E=p.getFullYear();return`${z}/${P}/${E}`},k=()=>{if(!l){h("This field is required.");return}h(""),I(l)},w=()=>{if(!l){h("This field is required.");return}N?(I(l),setTimeout(()=>{b==null||b()},150)):k()};return e.jsx("div",{className:"fixed inset-0 z-50",onClick:S,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:`${c.top}px`,left:`${c.left}px`,maxWidth:"calc(100vw - 40px)"},onClick:p=>p.stopPropagation(),children:[e.jsx("div",{className:`absolute w-3 h-3 bg-white border-gray-200 transform rotate-45 ${c.placement==="right"?"-left-1.5 top-6 border-l border-b":c.placement==="left"?"-right-1.5 top-6 border-r border-t":c.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(Pe,{value:l?new Date(l):void 0,inputFormat:"MM/DD/YYYY",onChange:p=>{if(!p){i("");return}const z=T(p);i(z),o&&h("")},className:"w-full"}),o&&e.jsx("p",{className:"text-red-500 text-xs mt-1",children:o})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(F,{variant:"plain",size:"sm",onClick:S,children:"Cancel"}),e.jsx(F,{variant:"solid",size:"sm",onClick:w,disabled:!l,children:N?"Finish":"Save"})]})]})})};function pt(){var de;const[v,x]=a.useState(null),[S,I]=a.useState(""),[N,b]=a.useState(""),[C]=Ne(),d=C.get("token"),[l,i]=a.useState(!1),[o,h]=a.useState([]),[c,T]=a.useState(null),[k,w]=a.useState(!1),[p,z]=a.useState(!1),[P,E]=a.useState(!1),[L,O]=a.useState({visible:!1,fieldId:null,value:""}),G=async t=>{i(!0);try{const n=await We(t);if(n instanceof Blob){const r=URL.createObjectURL(n);x(r)}else console.error("Unexpected response type:",n),x(null)}catch(n){console.error("Error fetching document:",n),x(null)}finally{i(!1)}},J=async t=>{var n,r,g,$;i(!0);try{const U=await ue(t);if(U!=null&&U.success&&(U!=null&&U.data)){const D=U.data;b(D),z((D==null?void 0:D.partyStatus)==="Signed"),E((D==null?void 0:D.signingOrder)===((r=(n=D==null?void 0:D.allParties)==null?void 0:n.$values)==null?void 0:r.length));const ce={id:1,name:D.partyName,color:"#1E90FF"};if(T(ce),($=(g=D.assignedFields)==null?void 0:g.$values)!=null&&$.length){const je=D.assignedFields.$values.map((M,Se)=>({id:M.id||`field_${Se}`,fieldType:M.fieldType===1?"text":M.fieldType===3?"signature":M.fieldType===4?"date":M.fieldType===2?"initials":"unknown",x:M.x,y:M.y,width:M.width,height:M.height,pageNumber:M.pageNumber,textValue:"",assignedUser:ce,signatureData:M.signatureData,signatureToken:M.signatureToken}));h(je)}else h([])}else console.error("Unexpected response:",U),h([])}catch(U){console.error("Error fetching document:",U),h([])}finally{i(!1)}};a.useEffect(()=>{const t=async n=>{await G(n),await J(n)};d&&(I(d),t(d))},[d]);const[X,ee]=a.useState(1),[Y]=a.useState(1.5),V=a.useRef(null),[le,te]=a.useState(Math.round(850*Y)),[q,s]=a.useState(Y);a.useEffect(()=>{const t=()=>{const r=V.current,g=32,$=850*Y,U=r?r.clientWidth-g:window.innerWidth-g,D=Math.max(260,Math.min($,Math.floor(U)));te(D),s(D/850)};t();const n=new ResizeObserver(()=>t());return V.current&&n.observe(V.current),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t);try{n.disconnect()}catch{}}},[Y]);const[f,m]=a.useState(o);a.useEffect(()=>{o!=null&&o.length&&m(o)},[o]);const u=f.filter(t=>{var n;return((n=t.assignedUser)==null?void 0:n.id)===(c==null?void 0:c.id)}).sort((t,n)=>t.pageNumber!==n.pageNumber?t.pageNumber-n.pageNumber:t.y!==n.y?t.y-n.y:t.x-n.x),[y,R]=a.useState(0),[A,K]=a.useState(!1),[W,ie]=a.useState({visible:!1,fieldId:null,type:null,field:null}),[H,Z]=a.useState({visible:!1,fieldId:null,value:""}),j=u[y]||null,Q=a.useRef(!1),B=()=>{ie({visible:!1,fieldId:null,type:null,field:null}),Z({visible:!1,fieldId:null,value:""}),O({visible:!1,fieldId:null,value:""})};a.useEffect(()=>{var r;if(!A||!j||Q.current||(j.fieldType==="signature"||j.fieldType==="initials"?j.signatureData:(r=j.textValue)!=null&&r.trim()))return;B();const t=document.getElementById(`field-${j.id}`);t&&t.scrollIntoView({behavior:"smooth",block:"center"});const n=setTimeout(()=>{j.fieldType==="signature"||j.fieldType==="initials"?ie({visible:!0,fieldId:j.id,type:j.fieldType,field:j}):j.fieldType==="text"?Z({visible:!0,fieldId:j.id,value:j.textValue||""}):j.fieldType==="date"&&O({visible:!0,fieldId:j.id,value:j.textValue||""})},300);return()=>clearTimeout(n)},[y,A,j]);const se=t=>{Q.current=!0,B(),["signature","initials"].includes(t.fieldType)?ie({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"&&O({visible:!0,fieldId:t.id,value:t.textValue||""})};a.useEffect(()=>{!W.visible&&!H.visible&&(Q.current=!1)},[W.visible,H.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,xe=()=>{for(let t=0;t<u.length;t++)if(!oe(u[t]))return t;return-1},fe=()=>{B(),Q.current=!1;const t=u[y];if(t&&!oe(t)){_("Please complete the current field before proceeding.",void 0,"danger"),se(t);return}y<u.length-1&&R(n=>n+1)},he=()=>{B(),Q.current=!1,y>0&&R(t=>t-1)},ge=async()=>{var n,r;const t=u.map(g=>({fieldId:g.id,value:g.fieldType==="signature"||g.fieldType==="initials"?g.signatureData:g.textValue}));try{i(!0),(await Be(d,{signatures:t})).success&&z(!0)}catch(g){console.error(g),_(((r=(n=g==null?void 0:g.response)==null?void 0:n.data)==null?void 0:r.message)??"Failed to submit. Try again.","Error","danger")}finally{i(!1)}},ne=()=>{const t=xe();if(t!==-1){_(`Please complete field ${t+1} before finalizing.`,"Warning","warning");return}B(),K(!1),w(!0)},pe=t=>{if(m(n=>n.map(r=>r.id===W.fieldId?{...r,signatureData:t}:r)),B(),A){const n=u.findIndex(r=>r.id===W.fieldId);n!==-1&&n===y&&setTimeout(()=>{y<u.length-1&&R(r=>r+1)},50)}},ye=t=>{if(m(n=>n.map(r=>r.id===H.fieldId?{...r,textValue:t}:r)),B(),A){const n=u.findIndex(r=>r.id===H.fieldId);n!==-1&&n===y&&setTimeout(()=>{y<u.length-1&&R(r=>r+1)},50)}},ve=t=>{if(m(n=>n.map(r=>r.id===L.fieldId?{...r,textValue:t}:r)),B(),A){const n=u.findIndex(r=>r.id===L.fieldId);n!==-1&&n===y&&setTimeout(()=>{y<u.length-1&&R(r=>r+1)},50)}},be=()=>{w(!1),ge()},we=async()=>{i(!0);const t=await Le(d),n=t.headers["content-type"],r=new Blob([t.data],{type:n}),g=URL.createObjectURL(r);if(i(!1),n.startsWith("image/")||n==="application/pdf")window.open(g,"_blank");else{const $=document.createElement("a");$.href=g,$.download="signed-file",document.body.appendChild($),$.click(),document.body.removeChild($)}};return p?e.jsxs(e.Fragment,{children:[l&&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"},...P?[]:[{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:()=>we(),children:t==null?void 0:t.link})]})]},t.id))})]})})})]}):e.jsxs(e.Fragment,{children:[l&&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})}),v?e.jsx(Ee,{backend:Fe,children:e.jsxs("div",{className:"relative flex-1 md:p-4",children:[e.jsx("div",{id:"pdfContainer",ref:V,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(Te,{file:v,onLoadSuccess:({numPages:t})=>ee(t),loading:"Loading PDF...",children:e.jsx(Re,{fields:f,currentUser:c,scale:q,numPages:X,activeFieldId:(j==null?void 0:j.id)||null,onOpenSignature:(t,n,r)=>{const g=f.find($=>$.id===t);g&&se(g)},onOpenTextEditor:(t,n)=>{const r=f.find(g=>g.id===t);r&&se(r)}})})}),u.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:!A&&!k?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 ",u.length," fields that need your attention."]}),e.jsx(F,{size:"lg",variant:"solid",onClick:()=>K(!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:`${(y+1)/u.length*100}%`}})}),e.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[e.jsx(F,{variant:"default",size:"sm",disabled:y===0,onClick:he,children:"← Back"}),e.jsxs("p",{className:"text-xs text-gray-300 text-center flex-1",children:["Field ",y+1," of ",u.length]}),e.jsx(F,{variant:"solid",size:"sm",onClick:y===u.length-1?ne:fe,children:y===u.length-1?"Finalize →":"Next →"})]})]})}),W.visible&&e.jsx(He,{visible:!0,type:W.type,onClose:B,onSave:pe,field:W.field,existingSignature:(de=W==null?void 0:W.field)==null?void 0:de.signatureData,tokenParam:d}),H.visible&&e.jsx(Ae,{visible:H.visible,value:H.value,onClose:()=>Z({visible:!1,fieldId:null,value:""}),onSave:ye,isLastField:y===u.length-1,onFinalize:ne,fieldId:H.fieldId,containerRef:V}),L.visible&&e.jsx(Oe,{visible:L.visible,value:L.value,onClose:()=>O({visible:!1,fieldId:null,value:""}),onSave:ve,isLastField:y===u.length-1,onFinalize:ne,fieldId:L.fieldId,containerRef:V})]})}):e.jsx(e.Fragment,{children:l?"":"No Pdf Found"}),e.jsx(Ve,{isOpen:k,type:"warning",title:"Confirm Your Electronic Signature",onCancel:()=>w(!1),onConfirm:be,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{pt as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{r as t}from"./vendor-react-ece1c85f.js";import{R as d,p as h,q as f,r as x}from"./vendor-devex-33a39e11.js";import"./index-c62ac197.js";import{A as l}from"./AdaptableCard-df7695d6.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";const g=new d({endpointUrl:"https://js.devexpress.com/Demos/Mvc/api/file-manager-file-system-images"}),k=()=>{t.useState(!1),t.useState(!1),t.useState(!1);const[m,a]=t.useState("Widescreen"),[n,s]=t.useState(!1),[o,i]=t.useState({}),p=t.useCallback(r=>{s(!0),i({name:r.file.name,url:r.file.dataItem.url})},[s,i]),u=t.useCallback(()=>{s(!1)},[s]),c=t.useCallback(r=>{a(r.component.option("currentPath"))},[a]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children: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:"p-4",children:[e.jsx(h,{currentPath:m,fileSystemProvider:g,onSelectedFileOpened:p,onCurrentDirectoryChanged:c,height:950,children:e.jsx(f,{create:!0,copy:!0,move:!0,delete:!0,rename:!0,upload:!0,download:!0})}),e.jsx(x,{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{k as default};
@@ -1 +0,0 @@
1
- import{j as p}from"./vendor-mui-69397583.js";import{h as a,b2 as c}from"./index-c62ac197.js";const{MODE_DARK:i}=c,d=({src:e,darkModeSrc:o,alt:s="",...t})=>{const m=a(r=>r.theme.mode);return p.jsx("img",{src:m===i?o:e,alt:s,...t})};export{d as D};
@@ -1 +0,0 @@
1
- import{j as a,l as j}from"./vendor-mui-69397583.js";import{u as L,r as E,f as A}from"./index-8ab45286.js";import{Y as D,l as N}from"./index-c62ac197.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 Y}from"./OpportunityStatus-fa8108ea.js";import{r as s}from"./vendor-react-ece1c85f.js";import{r as b}from"./styles-0608350c.js";import{A as $}from"./AdaptableCard-df7695d6.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./useControllableState-d0909575.js";import"./index-c2088808.js";import"./useDidUpdate-25c4d4ed.js";import"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import"./index-bea4c3dc.js";import"./esm-f306d015.js";import"./tableV3-3d2f4952.js";import"./FileSaver.min-20f3f13a.js";import"./mapView-ab35acaa.js";import"./lodash-306e3f66.js";import"./DensitySelector-a2c1c68f.js";import"./NoData-8c485a3a.js";import"./cjs-162261df.js";const F=[{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:Y,layout:{i:"o-8",x:0,y:1/0,w:12,h:1},templateId:"o-8",desc:"Displays brief messages...",configuration:{}}],U=d=>{const g=["lg","md","sm","xs","xxs"],c={};return g.forEach(l=>{c[l]=d.map(m=>({...m}))}),c},V=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;D("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(A(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=U(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=F.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($,{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(V,{...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 +0,0 @@
1
- import{j as t}from"./vendor-mui-69397583.js";import{r as h,f as ct}from"./vendor-react-ece1c85f.js";import{F as it,l as ot,I as w,W as B,B as V,al as rt,Y as lt,E as dt,c9 as Q,O as Y,Q as H}from"./index-c62ac197.js";import{D as pt}from"./DoubleSidedImage-ae98733b.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-62599aae.js";import{b as ht}from"./ContactService-92281a90.js";import{a as g,F as xt}from"./FormContainer-91c2b0e4.js";import{h as bt}from"./index-36ba4ea7.js";import{S as jt}from"./StickyFooter-5b934274.js";import{C as Dt}from"./ConfirmDialog-3202eb3d.js";import{u as J,d as C,c as At,a as wt,F as Nt,b as St}from"./index.esm-70ab539c.js";import{A as It}from"./AdaptableCard-df7695d6.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import{D as K}from"./Drawer-949c18c6.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import{c as X,C as tt,d as et,a as Ft,b as Et}from"./AddAccount-a05910e8.js";import{a as Ot}from"./index-e4c6057f.js";const q="AccountsData",T=G(`${q}/getAccountsData`,async i=>(await ft(i)).data),W=G(q+"/getAccountDetails",async i=>(await gt(i.id)).data),P=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(P.fulfilled,(a,n)=>{a.contactList=n.payload.$values}).addCase(W.fulfilled,(a,n)=>{a.account=n.payload,a.loading=!1}).addCase(W.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}=J(),b=h.useRef(null),{values:l}=J(),[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=P({});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(P({}))};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:X},componentAs:tt,onCreateOption:c=>F(c,"primaryContact"),onChange:c=>{r.setFieldValue(s.name,c)},styles:{input:c=>({...c,color:"black"})}})}),((v=l==null?void 0:l.primaryContact)==null?void 0:v.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:X},onCreateOption:c=>F(c,"billingContact"),onChange:c=>{r.setFieldValue(s.name,c)},styles:{input:c=>({...c,color:"black"})}})}),((_=l==null?void 0:l.billingContact)==null?void 0:_.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(K,{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(K,{title:"Edit Contact",isOpen:e,onClose:R,onRequestClose:R,portalClassName:"w30",children:t.jsx(Et,{id:A,onDrawerClose:R})})]})},{useUniqueId:vt}=bt,at=At().shape({accountName:wt().required("Account name Required")}),_t=({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=vt("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(_t,{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:(v=(R=(M=e.AccountsData)==null?void 0:M.data)==null?void 0:R.account)==null?void 0:v.billingContact,label:(r=(s=(_=e.AccountsData)==null?void 0:_.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(W({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)),Y.push(t.jsx(H,{title:"Deleted",type:"success",duration:2500,children:"Account Successfully Deleted"}),{placement:"top-center"}),y())},L=e=>{Y.push(t.jsxs(H,{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:!Q(b)&&t.jsx(t.Fragment,{children:t.jsx(st,{type:"edit",footerWidth:n,initialData:b,onFormSubmit:E,onDiscard:y,onDelete:z})})}),!l&&Q(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,W as g,zt as r,ie as s,re as t,$ as u};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{l as J,I as ce,B as z,al as Ce,O as F,Q as v,W as se,cC as fe,Y as Ee,E as Oe,c9 as ue}from"./index-c62ac197.js";import{u as T,g as ke,b as Ue,c as Me,a as re,r as Re,d as Be,e as qe,f as Ae}from"./index-9b41371d.js";import{r as w,f as Se}from"./vendor-react-ece1c85f.js";import{D as $e}from"./DoubleSidedImage-ae98733b.js";import{a as q,F as xe}from"./FormContainer-91c2b0e4.js";import{h as ge}from"./index-36ba4ea7.js";import{S as je}from"./StickyFooter-5b934274.js";import{C as De}from"./ConfirmDialog-3202eb3d.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-70ab539c.js";import{A as Le}from"./AdaptableCard-df7695d6.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import{D as oe}from"./Drawer-949c18c6.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import{U as ze}from"./Upload-fb34ce03.js";import{C as ne,c as Pe,d as We,e as Ge,f as Qe,a as _e,b as Xe,E as Ye}from"./AddAccount-a05910e8.js";import{b as Ie,c as He,a as Je}from"./vendor-redux-a1f00e6b.js";import{a as Ke,b as Ze,c as ea}from"./LeadSourceService-e46fa85e.js";import{a as Ne}from"./index-e4c6057f.js";import{g as aa}from"./index-cebd880b.js";import{g as ta}from"./AccountServices-62599aae.js";import{c as oa}from"./ContactService-92281a90.js";import{V as me,i as sa}from"./validationPatterns-77446c46.js";const le="LeadSourceData",de=Ie(`${le}/getLeadSourceData`,async c=>(await Ke(c)).data),pe=Ie(le+"/getLeadSourceDetails",async c=>(await Ze(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(Ne,{}),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,I)=>{I(!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;I(!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),[I,y]=w.useState(""),[s,h]=w.useState(""),[j,O]=w.useState(!1),[k,N]=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(ke({}))},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"}),W(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"})})},Z=(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"})})},W=a=>{x(!1),L("contactId",{value:a.id,label:a.contactName,desc:a}),$(),y(""),h("")},G=()=>{x(!1),y(""),h("")},Q=()=>{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("")},_=()=>{N(void 0),O(!1),$()},X=()=>{N(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=>Z(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:O,setEditedId:N})},componentAs:ne,onCreateOption:t=>K(t,"contactId"),onChange:t=>{var g,Y;i.setFieldValue(a.name,t),i.setFieldValue("company",{label:(g=t==null?void 0:t.desc)==null?void 0:g.accountName,value:(Y=t==null?void 0:t.desc)==null?void 0:Y.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(We,{data:l==null?void 0:l.contactId,sortedContacts:R,setIsEditModalOpen:O,setEditedId:N})]}),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:Ge},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(Qe,{data:l==null?void 0:l.company,sortedAccounts:B,setIsEditModalOpen:U,setEditedId:N})]}),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:G,showBackdrop:!1,portalClassName:"w30",children:e.jsx(_e,{onDrawerClose:G,isfromDropdown:!0,onContactCreated:W,newContactName:I})}),e.jsx(oe,{title:"New Lead Source",isOpen:D,onClose:Q,showBackdrop:!1,portalClassName:"w30",children:e.jsx(ua,{onDrawerClose:Q,isfromDropdown:!0,onContactCreated:te,newContactName:I})}),e.jsx(oe,{title:"Edit Contact",isOpen:j,onClose:_,portalClassName:"w30",showBackdrop:!1,children:e.jsx(Xe,{id:k,onDrawerClose:_})}),e.jsx(oe,{title:"Edit Account",isOpen:M,onClose:X,portalClassName:"w30",showBackdrop:!1,children:e.jsx(Ye,{id:k,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:I})=>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:I,icon:e.jsx(Ne,{}),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,I,y,s,h;x(!0);const D={leadSourceId:((S=C.leadSourceId)==null?void 0:S.value)??"",notes:(C==null?void 0:C.notes)??"",contactId:((I=C.contactId)==null?void 0:I.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 Wa=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,O,k,N,M,U,E,R,B,$,V,P,K,Z,ee,W,G,Q,ae,te,_,X,m,p,a,i,n,d,t,g,Y;return{...(j=(h=s.LeadsData)==null?void 0:h.data)==null?void 0:j.lead,bussinessCardUrl:[],leadSourceId:{value:(N=(k=(O=s.LeadsData)==null?void 0:O.data)==null?void 0:k.lead)==null?void 0:N.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:(W=(ee=(Z=s.LeadsData)==null?void 0:Z.data)==null?void 0:ee.lead)==null?void 0:W.contactNumber,contactPosistion:(ae=(Q=(G=s.LeadsData)==null?void 0:G.data)==null?void 0:Q.lead)==null?void 0:ae.contactPosistion,email:(X=(_=(te=s.LeadsData)==null?void 0:te.data)==null?void 0:_.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:(Y=(g=(t=s.LeadsData)==null?void 0:t.data)==null?void 0:g.lead)==null?void 0:Y.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 O,k,N,M,U;h(!0);const j={leadSourceId:((O=s.leadSourceId)==null?void 0:O.value)??"",contactId:((k=s.contactId)==null?void 0:k.value)??"",accountId:((N=s.company)==null?void 0:N.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()},I=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(Oe,{loading:L,children:!ue(b)&&e.jsx(e.Fragment,{children:e.jsx(ie,{type:"edit",footerWidth:r,initialData:b,onFormSubmit:D,onDiscard:S,onDelete:I})})}),!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,Wa as E};
@@ -1,6 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{r as u}from"./vendor-react-ece1c85f.js";import{bd as $,k as G,cb as H,al as J,I as E,B as C,cV as w,E as K,O as m,Q as x}from"./index-c62ac197.js";import{A as W}from"./AdaptableCard-df7695d6.js";import{C as X}from"./ConfirmDialog-3202eb3d.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import{D as Y}from"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import{u as Z,a as _,S as ee,v as se}from"./sortable.esm-0625cd17.js";import{C as te,u as re,a as ae,P as ne,D as ie,c as ce}from"./core.esm-4386752a.js";import{S as oe}from"./StickyFooter-5b934274.js";import{c as le,a as q,F as de,b as pe}from"./index.esm-70ab539c.js";import{u as ue}from"./usePermission-d94b4984.js";import{N as me}from"./NoData-8c485a3a.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";const xe=({faq:a,index:r,onEdit:l,onDelete:h,permissions:c,expanded:d,onToggleExpand:i})=>{const{attributes:y,listeners:p,setNodeRef:g,transform:j,transition:Q}=Z({id:a.id}),v={transform:te.Transform.toString(j),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",{...y,...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($,{}):e.jsx(G,{})}),(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(H,{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."})]})},he=le().shape({question:q().required("Question is required"),answer:q().required("Answer is required")}),fe=({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(de,{initialValues:h||{question:"",answer:""},validationSchema:he,enableReinitialize:!0,onSubmit:(d,{resetForm:i})=>{l(d),i()},children:({values:d,errors:i,touched:y,handleChange:p,handleBlur:g})=>e.jsxs(pe,{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&&y.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&&y.answer&&e.jsx("p",{className:"text-xs text-red-500 mt-1",children:i.answer})]})]}),e.jsx(oe,{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 je(a){return(await w.apiV10FAQAddFAQPost(a)).data}async function ge(a,r){return(await w.apiV10FAQUpdateFAQIdPost(a,r)).data}async function Fe(a){return(await w.apiV10FAQDeleteFAQIdPost(a)).data}async function be(a){return(await w.apiV10FAQReorderFAQsPost(a)).data}const We=()=>{const a=re(ae(ne)),[r,l]=u.useState([]),[h,c]=u.useState(null),[d,i]=u.useState(!1),[y,p]=u.useState(!1),[g,j]=u.useState(!1),[Q,v]=u.useState(null),[F,f]=u.useState(!1),N=ue("FAQ"),[k,P]=u.useState(null),I=s=>{P(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),j(!0)},R=async()=>{var s,n;if(Q){f(!0);try{(await Fe(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"})}j(!1),v(null),f(!1)}},O=async s=>{var n,t;try{f(!0),(await je(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)},V=async s=>{var n,t;f(!0);try{(await ge(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)},B=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=_(r,o,S);l(T);const M={id:L.id,displayOrder:S};try{(await be([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"})}},U=()=>e.jsx(ee,{items:r.map(s=>s.id),strategy:se,children:e.jsx("div",{children:r.map((s,n)=>e.jsx(xe,{faq:s,index:n,permissions:N,expanded:s.id===k,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.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children: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(ie,{sensors:a,collisionDetection:ce,onDragEnd:B,children:e.jsx(U,{})}):e.jsx(me,{title:"No FAQs available",description:"Start by adding your first FAQ"})}),d&&e.jsx(fe,{open:d,onClose:()=>{i(!1),p(!1),c(null)},loading:F,onSubmit:y?V:O,initialValues:y?h:null}),e.jsx(X,{isOpen:g,type:"danger",title:"Delete FAQ",confirmButtonColor:"red-600",onClose:()=>j(!1),onRequestClose:()=>j(!1),onCancel:()=>j(!1),onConfirm:R,children:e.jsx("p",{children:"Are you sure you want to delete this FAQ?"})})]})]})};export{We as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{r as E}from"./vendor-react-ece1c85f.js";import{bs as g,b9 as x,d as p,bx as t,b8 as w,b5 as W,bu as f,bj as Z,by as H,bz as $}from"./index-c62ac197.js";const V=E.forwardRef((o,n)=>{const{asterisk:m,children:c,className:d,errorMessage:u,extra:i,htmlFor:b,invalid:a,label:r,labelClass:I,labelWidth:L,layout:j,style:h,size:v}=o,s=g(),{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 t.HORIZONTAL:return r?`h-${f[y]} ${r&&"ltr:pr-2 rtl:pl-2"}`:"ltr:pr-2 rtl:pl-2";case t.VERTICAL:return"mb-2";case t.INLINE:return`h-${f[y]} ${r&&"ltr:pr-2 rtl:pl-2"}`}},T=p("form-item",l,d,a?"invalid":""),C=p("form-label",r&&O(),I),R=()=>l===t.HORIZONTAL?{...h,minWidth:S}:{...h},z={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:"*"}),r,i&&e.jsx("span",{children:i}),r&&l!=="vertical"&&":"]}),e.jsxs("div",{className:l===t.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:z,exit:N,transition:{duration:.15,type:"tween"},children:u})})]})]})});V.displayName="FormItem";const M=o=>{const{controlSize:n}=x(),{children:m,className:c,labelWidth:d=100,layout:u=t.VERTICAL,size:i=Z.MD}=o,b={labelWidth:d,layout:u,size:i||n};return e.jsx(H,{value:b,children:e.jsx($,{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,V as a};
@@ -1 +0,0 @@
1
- import{j as t,s as Le,n as Oe,o as pe,r as he,a1 as fe,i as ge,l as Ve}from"./vendor-mui-69397583.js";import{r as D,e as Te,g as Pe}from"./vendor-react-ece1c85f.js";import{d as _,a as ye,h as ce,k as _e,c as Be,F as Ae,b as Me}from"./index.esm-70ab539c.js";import{O as re,Q as se,W as qe,I as Q,di as Ue,B as X,ei as He,Z as Ee,V as Je}from"./index-c62ac197.js";import{a as Ze,F as Ne}from"./FormContainer-91c2b0e4.js";import{A as be}from"./AdaptableCard-df7695d6.js";import{C as Ge}from"./tableV3-3d2f4952.js";import{D as Fe}from"./Drawer-949c18c6.js";import{S as Ie}from"./StickyFooter-5b934274.js";import{A as We,T as xe}from"./actioncell-17e12e21.js";import{C as Ke}from"./ConfirmDialog-3202eb3d.js";import{h as Qe,g as je,i as Xe,j as et,k as tt,l as at,m as rt,n as st,c as nt}from"./DynamicTablesService-963fe77b.js";import{P as it}from"./PasswordInput-8619a9df.js";import{U as Re}from"./Upload-fb34ce03.js";import{a as ot,d as lt}from"./index-c2088808.js";import{V as ct}from"./validationPatterns-77446c46.js";import{u as dt}from"./usePermission-d94b4984.js";import{r as $e}from"./createSvgIcon-c5fc0d04.js";import{D as ut,g as de}from"./vendor-devex-33a39e11.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./FileSaver.min-20f3f13a.js";import"./mapView-ab35acaa.js";import"./esm-f306d015.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./useControllableState-d0909575.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./lodash-306e3f66.js";import"./DensitySelector-a2c1c68f.js";import"./NoData-8c485a3a.js";import"./index-42e65911.js";import"./useDidUpdate-25c4d4ed.js";const mt=({tableId:x,rowId:d,isOpen:p,fetchData:h,onDialogClose:n})=>{const s=async()=>{try{const i=await Qe(x,d);i!=null&&i.message&&(n(),h(),re.push(t.jsx(se,{title:"Delete",type:"success",duration:2500,children:"Successfully Deleted"}),{placement:"top-center"}))}catch(i){console.error("Delete failed:",i)}};return t.jsx(Ke,{isOpen:p,type:"danger",title:"Delete",confirmButtonColor:"red-600",onClose:n,onRequestClose:n,onCancel:n,onConfirm:s,children:t.jsx("p",{children:"Are you sure you want to delete this item? All records related to this item will be deleted as well."})})};async function pt(x,d){var n,s;const p=await je(x,{});return(((s=(n=p==null?void 0:p.data)==null?void 0:n.data)==null?void 0:s.$values)||[]).map(i=>{const y=i.Id,o=d!=null&&d.length?d.map(g=>i[g]).filter(Boolean).join(" "):String(y);return{value:String(y),label:String(o)}})}const ht=({schema:x,touched:d,errors:p,values:h,globalUploadProps:n,drawerType:s,addressRef:i})=>{const[y,o]=D.useState({}),[g,a]=D.useState({}),[l,w]=D.useState({}),k=D.useMemo(()=>x.map(e=>({name:e.name,ds:e.dataSource})).filter(e=>e.ds&&e.ds.tableId),[x]);D.useEffect(()=>{let e=!0;const c={};return k.forEach(({name:f,ds:E})=>{const u=E==null?void 0:E.tableId,j=E==null?void 0:E.labelField,v=j==null?void 0:j.split(",").map(F=>F.trim()).filter(Boolean);if(!u||y[f])return;const A=new AbortController;c[f]=A,a(F=>({...F,[f]:!0})),w(F=>({...F,[f]:null})),pt(u,v).then(F=>{console.log("opts",F),e&&o($=>({...$,[f]:F}))}).catch(F=>{e&&F.name!=="AbortError"&&(w($=>({...$,[f]:F.message||"Failed to load options"})),o($=>({...$,[f]:null})))}).finally(()=>{e&&a(F=>({...F,[f]:!1}))})}),()=>{e=!1,Object.values(c).forEach(f=>f.abort())}},[k.map(e=>e.name).join(","),JSON.stringify(k)]);const L=(e=[],c)=>{if(c==null)return null;const f=typeof c=="string"?c.toLowerCase():String(c);return e.find(E=>typeof E.value=="string"?E.value.toLowerCase()===f:String(E.value)===f)||null},Y=(e=[],c=[])=>e.filter(f=>c==null?void 0:c.includes(f.value)),r=e=>{let{value:c}=e.target;c=c.replace(/\D/g,"");const f=c.length;return f>0&&(c="("+c),f>3&&(c=c.slice(0,4)+") "+c.slice(4,11)),f>6&&(c=c.slice(0,9)+"-"+c.slice(9)),c};return t.jsx(t.Fragment,{children:x.filter(e=>!(s==="Edit"&&e.name==="Id")).filter(e=>e.type!=="file").map(e=>{if(e.conditional&&!e.conditional(h))return null;const c=y[e.name],f=!!g[e.name],E=l[e.name]??null;return t.jsx(Ze,{label:e.label,asterisk:e.required,invalid:!!(d[e.name]&&p[e.name]),errorMessage:p[e.name]??"",children:e.type==="select"||e.type==="multiselect"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>{const v=e.options||[],A=v.length>0?v:Array.isArray(c)?c:[],F=e.type==="multiselect",$=(()=>{var I,V;if(!F||Array.isArray(u.value))return u.value;if(!u.value||typeof u.value!="string"||!u.value.trim())return[];try{return JSON.parse(u.value)}catch{return((V=(I=u.value).split)==null?void 0:V.call(I,",").map(P=>P.trim()))??[]}})(),O=F?Y(A,$.map(String)):L(A,String($));return t.jsxs(t.Fragment,{children:[t.jsx(qe,{...F?{isMulti:!0}:{},options:A,value:O,placeholder:e.placeholder||e.label,isLoading:f,noOptionsMessage:()=>f?"Loading...":E||"No options",onChange:I=>{if(F){const V=Array.isArray(I)?I.map(P=>P.value):[];j.setFieldValue(e.name,V)}else j.setFieldValue(e.name,I?I.value:"")}}),E?t.jsx("div",{className:"text-sm text-red-600 mt-1",children:E}):null]})}}):e.type==="textarea"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(Q,{...u,type:"textarea",value:u.value??"",placeholder:e.placeholder||e.label,onChange:v=>j.setFieldValue(e.name,v.target.value)})}):e.type==="password"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(it,{...u,value:u.value,placeholder:e.placeholder||e.label,onChange:v=>j.setFieldValue(e.name,v.target.value)})}):e.type==="richtext"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(Ue,{value:u.value,onChange:v=>j.setFieldValue(e.name,v)})}):e.type==="file"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>{var F,$,O;const v=Array.isArray(h[e.name])?h[e.name]:Array.isArray(u.value)?u.value:[],A={draggable:((F=e.uploadProps)==null?void 0:F.draggable)??!0,beforeUpload:(($=e.uploadProps)==null?void 0:$.beforeUpload)??(n==null?void 0:n.beforeUpload),accept:e.accept??((O=e.uploadProps)==null?void 0:O.accept)??void 0,multiple:!!e.multiple,...e.uploadProps??{},...n??{}};return t.jsx(Re,{draggable:!!A.draggable,cropNeeded:!1,beforeUpload:A.beforeUpload,accept:A.accept,multiple:!!A.multiple,fileList:v,onChange:I=>{j.setFieldValue(e.name,I)},onFileRemove:I=>{j.setFieldValue(e.name,I)}})}}):e.type==="datepicker"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(ot,{field:u,form:j,inputFormat:"MM/DD/YYYY",value:h[e.name]||null,...e.type==="datetime"?{showTime:!0}:{},onChange:v=>{j.setFieldValue(e.name,v)}})}):e.type==="datetimepicker"||e.type==="time"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(lt,{amPm:!0,field:e,placeholder:"Datetime",value:e.value,onChange:v=>{j.setFieldValue(e.name,v)}})}):e.type==="checkbox"?t.jsx(_,{name:e.name,type:"checkbox",children:({field:u,form:j})=>t.jsx("input",{...u,type:"checkbox",checked:!!u.value,onChange:v=>j.setFieldValue(e.name,v.target.checked)})}):e.type==="number"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(Q,{...u,type:"number",value:u.value??"",placeholder:e.placeholder||e.label,onChange:v=>{const A=v.target.value;j.setFieldValue(e.name,A===""?"":Number(A))}})}):e.type==="email"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(Q,{...u,type:"email",value:u.value??"",placeholder:e.placeholder||e.label,onChange:v=>j.setFieldValue(e.name,v.target.value)})}):e.type==="phone"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(Q,{...u,type:"text",value:u.value??"",placeholder:e.placeholder||e.label,onChange:v=>{const A=r(v);j.setFieldValue(e.name,A)}})}):e.type==="colorPicker"?t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(Q,{...u,className:"w-[100px]",type:"color",value:u.value??"",placeholder:e.placeholder||e.label,onChange:v=>{j.setFieldValue(e.name,v.target.value)}})}):e.name.includes("address")?t.jsx(_,{name:e.name,children:({field:u})=>t.jsx(Q,{...u,ref:i,placeholder:e.placeholder||e.label})}):t.jsx(_,{name:e.name,children:({field:u,form:j})=>t.jsx(Q,{...u,value:u.value??"",placeholder:e.placeholder||e.label,onChange:v=>j.setFieldValue(e.name,v.target.value)})})},e.name)})})},ft=ye().matches(ct.sqlInjectionSafe,"Invalid input: SQL keywords not allowed"),ae=x=>x&&(typeof File<"u"&&x instanceof File||typeof Blob<"u"&&x instanceof Blob||typeof x.size=="number"&&typeof x.type=="string"),Ce=(x,d,p)=>{if(!x)return!0;if(!(typeof p=="number"?x.size<=p*1024*1024:!0))return!1;if(Array.isArray(d)&&d.length>0){const n=x.type||"",s=(x.name||"").toLowerCase();return d.some(y=>{const o=y.toLowerCase();if(o.startsWith("."))return s.endsWith(o);if(o.endsWith("/*")){const g=o.split("/")[0];return n.startsWith(g+"/")}return n===o})}return!0},gt=x=>{const d={};return x.forEach(p=>{const h=p.label||p.name;let n;switch(p.type){case"richtext":case"text":case"password":n=ft;break;case"number":n=_e();break;case"select":n=ce();break;case"multiselect":n=ce();break;case"email":n=ye().matches(/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,}$/,"Invalid email");break;case"phone":n=ye().matches(/^[0-9()\-\s]+$/,"Phone must only contain numbers, parentheses, dashes, and spaces").test("is-ten-digits","Please enter valid Phone No",s=>s?s.replace(/[()\-\s]/g,"").length===10:!0).nullable();break;case"file":case"file[]":{const s=p.type==="file[]"||!!p.multiple,i=p.accept,y=p.maxSizeMB,o=p.maxFiles,g=ce().test("is-file-like",`${h} must be a file.`,a=>a?Array.isArray(a)||typeof FileList<"u"&&a instanceof FileList?a.length>0?ae(a[0]):!0:ae(a):!0).test("file-size-and-type",`${h} failed file validation`,a=>{if(!a)return!0;let l=a;return(typeof FileList<"u"&&a instanceof FileList||Array.isArray(a))&&(l=a[0]),Ce(l,i,y)});s?n=ce().test("is-file-list-or-array",`${h} must be one or more files`,a=>a?typeof FileList<"u"&&a instanceof FileList||Array.isArray(a)?a.length>0:!!ae(a):!0).test("files-count-and-each",`${h} failed file(s) validation`,a=>{if(!a)return!0;let l=[];if(typeof FileList<"u"&&a instanceof FileList)l=Array.from(a);else if(Array.isArray(a))l=a;else if(ae(a))l=[a];else return!1;if(typeof o=="number"&&l.length>o)return!1;for(const w of l)if(!Ce(w,i,y))return!1;return!0}):n=g}break}!p.required&&n&&typeof n.nullable=="function"&&(n=n.nullable()),p.required&&(p.type==="multiselect"?n=n.min(1,`${h} is required`).required(`${h} is required`):p.type==="file"||p.type==="file[]"||p.multiple?n=n.test("file-required",`${h} is required`,s=>s?typeof FileList<"u"&&s instanceof FileList||Array.isArray(s)?s.length>0:ae(s):!1):n=n.required(`${h} is required`)),d[p.name]=n}),Be().shape(d)};var we={},xt=Le;Object.defineProperty(we,"__esModule",{value:!0});var ze=we.default=void 0,yt=xt($e()),bt=t;ze=we.default=(0,yt.default)((0,bt.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description");var Se={},jt=Le;Object.defineProperty(Se,"__esModule",{value:!0});var ve=Se.default=void 0,vt=jt($e()),wt=t;ve=Se.default=(0,vt.default)((0,wt.jsx)("path",{d:"M19 7H9c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m0 2v2H9V9zm-6 6v-2h2v2zm2 2v2h-2v-2zm-4-2H9v-2h2zm6-2h2v2h-2zm-8 4h2v2H9zm8 2v-2h2v2zM6 17H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v1h-2V5H5v10h1z"}),"TableView");const St=({onExport:x})=>{const[d,p]=D.useState(null),[h,n]=D.useState(null),s=o=>{p(o.currentTarget)},i=()=>p(null),y=async o=>{n(o),i();try{await x(o)}finally{n(null)}};return t.jsxs(t.Fragment,{children:[t.jsx(X,{block:!0,variant:"solid",size:"sm",icon:t.jsx(He,{}),disabled:h!==null,onClick:s,children:h?"Exporting...":"Export"}),t.jsxs(Oe,{anchorEl:d,open:!!d,onClose:i,children:[t.jsxs(pe,{disabled:h==="csv",onClick:()=>y("csv"),children:[t.jsx(he,{children:h==="csv"?t.jsx(fe,{size:20}):t.jsx(ze,{fontSize:"small"})}),t.jsx(ge,{primary:"Export as CSV"})]}),t.jsxs(pe,{disabled:h==="xlsx",onClick:()=>y("xlsx"),children:[t.jsx(he,{children:h==="xlsx"?t.jsx(fe,{size:20}):t.jsx(ve,{fontSize:"small"})}),t.jsx(ge,{primary:"Export as xlsx"})]}),t.jsxs(pe,{disabled:h==="json",onClick:()=>y("json"),children:[t.jsx(he,{children:h==="json"?t.jsx(fe,{size:20}):t.jsx(ve,{fontSize:"small"})}),t.jsx(ge,{primary:"Export as Json"})]})]})]})};var Ye={exports:{}};(function(x,d){(function(p,h){x.exports=h()})(Te,function(){var p={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},h=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,s=/\d\d/,i=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,o={},g=function(r){return(r=+r)+(r>68?1900:2e3)},a=function(r){return function(e){this[r]=+e}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(r){(this.zone||(this.zone={})).offset=function(e){if(!e||e==="Z")return 0;var c=e.match(/([+-]|\d\d)/g),f=60*c[1]+(+c[2]||0);return f===0?0:c[0]==="+"?-f:f}(r)}],w=function(r){var e=o[r];return e&&(e.indexOf?e:e.s.concat(e.f))},k=function(r,e){var c,f=o.meridiem;if(f){for(var E=1;E<=24;E+=1)if(r.indexOf(f(E,0,e))>-1){c=E>12;break}}else c=r===(e?"pm":"PM");return c},L={A:[y,function(r){this.afternoon=k(r,!1)}],a:[y,function(r){this.afternoon=k(r,!0)}],Q:[n,function(r){this.month=3*(r-1)+1}],S:[n,function(r){this.milliseconds=100*+r}],SS:[s,function(r){this.milliseconds=10*+r}],SSS:[/\d{3}/,function(r){this.milliseconds=+r}],s:[i,a("seconds")],ss:[i,a("seconds")],m:[i,a("minutes")],mm:[i,a("minutes")],H:[i,a("hours")],h:[i,a("hours")],HH:[i,a("hours")],hh:[i,a("hours")],D:[i,a("day")],DD:[s,a("day")],Do:[y,function(r){var e=o.ordinal,c=r.match(/\d+/);if(this.day=c[0],e)for(var f=1;f<=31;f+=1)e(f).replace(/\[|\]/g,"")===r&&(this.day=f)}],w:[i,a("week")],ww:[s,a("week")],M:[i,a("month")],MM:[s,a("month")],MMM:[y,function(r){var e=w("months"),c=(w("monthsShort")||e.map(function(f){return f.slice(0,3)})).indexOf(r)+1;if(c<1)throw new Error;this.month=c%12||c}],MMMM:[y,function(r){var e=w("months").indexOf(r)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,a("year")],YY:[s,function(r){this.year=g(r)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function Y(r){var e,c;e=r,c=o&&o.formats;for(var f=(r=e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function($,O,I){var V=I&&I.toUpperCase();return O||c[I]||p[I]||c[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(P,J,Z){return J||Z.slice(1)})})).match(h),E=f.length,u=0;u<E;u+=1){var j=f[u],v=L[j],A=v&&v[0],F=v&&v[1];f[u]=F?{regex:A,parser:F}:j.replace(/^\[|\]$/g,"")}return function($){for(var O={},I=0,V=0;I<E;I+=1){var P=f[I];if(typeof P=="string")V+=P.length;else{var J=P.regex,Z=P.parser,ee=$.slice(V),G=J.exec(ee)[0];Z.call(O,G),$=$.replace(G,"")}}return function(U){var K=U.afternoon;if(K!==void 0){var B=U.hours;K?B<12&&(U.hours+=12):B===12&&(U.hours=0),delete U.afternoon}}(O),O}}return function(r,e,c){c.p.customParseFormat=!0,r&&r.parseTwoDigitYear&&(g=r.parseTwoDigitYear);var f=e.prototype,E=f.parse;f.parse=function(u){var j=u.date,v=u.utc,A=u.args;this.$u=v;var F=A[1];if(typeof F=="string"){var $=A[2]===!0,O=A[3]===!0,I=$||O,V=A[2];O&&(V=A[2]),o=this.$locale(),!$&&V&&(o=c.Ls[V]),this.$d=function(ee,G,U,K){try{if(["x","X"].indexOf(G)>-1)return new Date((G==="X"?1e3:1)*ee);var B=Y(G)(ee),te=B.year,ne=B.month,le=B.day,ie=B.hours,ue=B.minutes,me=B.seconds,m=B.milliseconds,S=B.zone,C=B.week,M=new Date,N=le||(te||ne?1:M.getDate()),b=te||M.getFullYear(),T=0;te&&!ne||(T=ne>0?ne-1:M.getMonth());var R,z=ie||0,H=ue||0,W=me||0,oe=m||0;return S?new Date(Date.UTC(b,T,N,z,H,W,oe+60*S.offset*1e3)):U?new Date(Date.UTC(b,T,N,z,H,W,oe)):(R=new Date(b,T,N,z,H,W,oe),C&&(R=K(R).week(C).toDate()),R)}catch{return new Date("")}}(j,F,v,c),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),I&&j!=this.format(F)&&(this.$d=new Date("")),o={}}else if(F instanceof Array)for(var P=F.length,J=1;J<=P;J+=1){A[1]=F[J-1];var Z=c.apply(this,A);if(Z.isValid()){this.$d=Z.$d,this.$L=Z.$L,this.init();break}J===P&&(this.$d=new Date(""))}else E.call(this,u)}}})})(Ye);var Ft=Ye.exports;const Ct=Pe(Ft);Ee.extend(Ct);const q=(x,d)=>t.jsx("div",{"data-cname":x,className:"mobile-cell",children:d}),De=(x,d)=>{if(!x)return"—";const p=Ee(x);return p.isValid()?p.format(d):"—"},ke=x=>x?String(x).trim():"",Dt=(x,d)=>{const p=(n,s)=>n?((d==null?void 0:d[n])??[]).find(y=>y.value===(s==null?void 0:s.toLowerCase())||""):null,h=(n,s)=>{let i=[];if(Array.isArray(s))i=s;else if(typeof s=="string")try{const o=JSON.parse(s);i=Array.isArray(o)?o:[o]}catch{i=s.replace(/[\[\]\s"]/g,"").split(",").filter(Boolean)}else s!=null&&(i=[s]);i=i.map(o=>String(o).trim().toLowerCase()).filter(Boolean);const y=(d==null?void 0:d[n])??[];return i.map(o=>{var g;return((g=y.find(a=>a.value===o))==null?void 0:g.label)??o}).filter(Boolean).join(", ")};return x.map(n=>{const s={dataField:n.dataField,caption:n.caption,width:n.width,visible:n.visible},i=n.displayName||n.caption||n.dataField,y=n.type,o=n.uiConfig,g=((o==null?void 0:o.Mode)||"").toLowerCase();if(g==="static"&&(o!=null&&o.StaticValues)){const a=o.StaticValues.split(",").map(l=>({id:l.trim(),label:l.trim()}));return y==="dropdown"&&(s.lookup={dataSource:a,valueExpr:"id",displayExpr:"label"},s.calculateCellValue=l=>{var w;return((w=a.find(k=>k.id===l[n.dataField]))==null?void 0:w.label)??l[n.dataField]},s.cellRender=l=>q(i,l.value??"")),y==="multiselect"&&(s.calculateCellValue=l=>{const w=l[n.dataField];return w?(Array.isArray(w)?w:typeof w=="string"?JSON.parse(w):[w]).map(L=>{var Y;return((Y=a.find(r=>r.id===L))==null?void 0:Y.label)??L}).join(", "):""},s.cellRender=l=>q(i,l.value??"")),s}return g==="table"&&(o!=null&&o.DataSource)?(y==="dropdown"&&(s.calculateCellValue=a=>{var l;return((l=p(n.dataField,a[n.dataField]))==null?void 0:l.label)??""},s.cellRender=a=>{var k;const l=p(n.dataField,(k=a==null?void 0:a.data)==null?void 0:k[n.dataField]),w=ke(l==null?void 0:l.color);return q(i,t.jsx("div",{className:"text-[13px] rounded-full px-3 py-1 w-24",style:{color:w||"#000",backgroundColor:w?`${w}20`:"#FFF"},children:(l==null?void 0:l.label)??""}))}),y==="multiselect"&&(s.calculateCellValue=a=>h(n.dataField,a[n.dataField])??"",s.cellRender=a=>{var l;return q(i,h(n.dataField,(l=a==null?void 0:a.data)==null?void 0:l[n.dataField]))}),s):y==="colorPicker"?(s.cellRender=a=>{const l=ke(a==null?void 0:a.value);return q(i,t.jsx("div",{className:"text-[13px] rounded-full px-3 py-1 w-24 text-center",style:{color:l,backgroundColor:`${l}20`},children:l||""}))},s):y==="richtext"?(s.cellRender=a=>{const w=((a==null?void 0:a.value)??"").replace(/<[^>]*>/g,"").trim();return q(i,w||"")},s):y==="datepicker"?(s.dataType="date",s.cellRender=a=>q(i,De(a==null?void 0:a.value,"MM/DD/YYYY")),s):y==="datetimepicker"?(s.dataType="datetime",s.cellRender=a=>q(i,De(a==null?void 0:a.value,"MM/DD/YYYY hh:mm")),s):y==="upload"?(s.cellRender=a=>{var k;let l=(k=a==null?void 0:a.data)==null?void 0:k[n.dataField];if(!l)return q(i,"");try{l=typeof l=="string"?JSON.parse(l):l}catch{return q(i,"Invalid file")}const w=Array.isArray(l)?l:[l];return q(i,t.jsx(t.Fragment,{children:w.map((L,Y)=>t.jsx("div",{children:t.jsx("a",{href:L.Url||L.StoragePath,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:L.FileName||`File ${Y+1}`})},Y))}))},s):(s.cellRender=a=>q(i,String((a==null?void 0:a.value)??"")),s)})},kt=({tableId:x,row:d,columnName:p,setFileDrawerOpen:h,fetchData:n})=>{const[s,i]=D.useState([]),[y,o]=D.useState(!1),[g,a]=D.useState([]),l=r=>{i(r)},w=r=>{r.success?(n(),re.push(t.jsx(se,{title:"Success",type:"success",duration:2500,children:(r==null?void 0:r.message)||"Success"}),{placement:"top-center"})):re.push(t.jsx(se,{title:"Error",type:"danger",duration:2500,children:r.message}),{placement:"top-center"})},k=async()=>{var r,e;try{o(!0),a([]),console.log("fileList",s[0]);const c=await Xe(x,d==null?void 0:d.Id,p==null?void 0:p.dataField,s==null?void 0:s[0]);w(c)}catch(c){a([((e=(r=c==null?void 0:c.response)==null?void 0:r.data)==null?void 0:e.message)||"Upload failed"])}finally{o(!1)}},L=async()=>{const r=await et(x,d==null?void 0:d.Id,p==null?void 0:p.dataField);console.log("res",r)};D.useEffect(()=>{L()},[]);const Y=async r=>{const e=await tt(x,r==null?void 0:r.Id,p==null?void 0:p.dataField);w(e)};return t.jsxs(t.Fragment,{children:[t.jsx(Ae,{initialValues:{files:[]},validationSchema:{},onSubmit:()=>{},children:()=>t.jsx(Me,{children:t.jsx(Ne,{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.jsxs(be,{divider:!0,className:"mb-4",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block mb-1 font-medium",children:"Upload File"}),t.jsx(Re,{draggable:!0,multiple:!1,accept:".csv,.xlsx,.xls",fileList:s||[],onChange:r=>l(r),onFileRemove:r=>l(r)}),(g==null?void 0:g.length)>0&&t.jsx("div",{className:"mt-1 text-red-500 text-sm",children:t.jsx("ul",{children:g.map((r,e)=>t.jsx("li",{children:r},e))})}),t.jsx("div",{className:"mt-4 flex justify-end",children:t.jsx(X,{type:"button",size:"sm",variant:"solid",loading:y,onClick:k,children:"Upload"})})]}),t.jsx(Ie,{className:"flex items-center p-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:t.jsx("div",{className:"flex items-center justify-end w-full",children:t.jsx(X,{size:"sm",disabled:y,onClick:()=>h(!1),children:"Close"})})})]})})})})})}),t.jsxs("div",{className:"mt-3",children:[t.jsx("label",{className:"block mb-1 font-medium",children:"Files"}),t.jsxs(ut,{dataSource:[],keyExpr:"id",showBorders:!0,columnAutoWidth:!0,rowAlternationEnabled:!0,noDataText:"No files uploaded yet",height:300,children:[t.jsx(de,{dataField:"name",caption:"File Name"}),t.jsx(de,{dataField:"size",caption:"Size (KB)"}),t.jsx(de,{dataField:"uploadedAt",caption:"Uploaded On",dataType:"date",format:"dd/MM/yyyy HH:mm"}),t.jsx(de,{caption:"Actions",width:100,alignment:"center",cellRender:({data:r})=>t.jsx(X,{size:"xs",variant:"solid",color:"red-600",onClick:()=>Y(r),children:"Delete"})})]})]})]})};function Lt(x){return x.map((d,p)=>{const h=(d.Name||`field_${p}`).trim(),n=(d.DisplayName||h).trim(),s=h.toLowerCase(),i=(d.ColumnType||"").toLowerCase(),y=(d.Format||"").toLowerCase(),o=d.ColumnType==="multiselect";let g="text";i==="boolean"?g="checkbox":i==="number"||i==="integer"||i==="float"||i==="double"?g="number":i==="multiselect"?g="multiselect":i==="dropdown"?g="select":i==="upload"?g="file":i==="richtext"?g="richtext":i==="textarea"?g="textarea":i==="datepicker"?g="datepicker":i==="datetimepicker"?g="datetimepicker":i==="email"?g="email":i==="phone"?g="phone":y==="date"||s.includes("date")?g="date":y==="time"||s.includes("time")?g="time":i==="colorpicker"&&(g="colorPicker");let a=(d.Enum||[]).map(L=>({label:L,value:L})),l;const w=d.UiConfig;if(w&&w.Mode){const L=(w.Mode||"").toString().toLowerCase();if(L==="static"){const Y=(w.StaticValues||"").toString();Y.trim()&&(a=Y.split(",").map(r=>r.trim()).filter(Boolean).map(r=>({label:r,value:r}))),a.length&&g!=="multiselect"&&(g="select")}else if(L==="table"){const Y=(w.DataSource||"").toString(),r=(w.Labels||"").toString()||(w.LabelField||"").toString()||"";Y&&(l={tableId:Y,labelField:r},o?g="multiselect":g="select")}}a.length&&((d.ColumnType||"").toLowerCase()==="multiselect"?g="multiselect":(d.ColumnType||"").toLowerCase()==="dropdown"&&(g="select"));const k={id:`f${p+1}`,name:h,label:n,type:g,required:!!d.Required,maxLength:d.MaxLength||void 0,options:a.length?a:void 0,multiple:o||void 0,accept:d.Accept||void 0,placeholder:void 0,dataSource:l};return Object.keys(k).forEach(L=>{k[L]===void 0&&delete k[L]}),k})}const pa=({menuData:x})=>{const{name:d,keyExpr:p,dynamicTableId:h,height:n="calc(100vh - 200px)"}=x,s=dt(d),[i,y]=D.useState([]),[o,g]=D.useState([]),[a,l]=D.useState(!1),[w,k]=D.useState(!1),[L,Y]=D.useState("Add"),[r,e]=D.useState(null),[c,f]=D.useState([]),[E,u]=D.useState(!1),[j,v]=D.useState(!1),A=D.useRef(null),F=async m=>{var N;const S=await nt(m),C=((N=JSON.parse(S.data.schemaDefinition||"{}"))==null?void 0:N.Columns)||[],M=C.filter(b=>b.Name!=="Id").map(b=>({dataField:b.Name,caption:b.DisplayName,width:150,visible:!0,type:b.ColumnType,uiConfig:b.UiConfig}));return f(Lt(C.filter(b=>b.Name!=="Id"))),g(M),C},$=async m=>{var C,M;const S=await je(m,{});y(((M=(C=S==null?void 0:S.data)==null?void 0:C.data)==null?void 0:M.$values)||[])},O=async()=>{l(!0);try{await Promise.all([F(h),$(h)])}catch(m){console.error("Failed to fetch schema or table data",m),l(!1)}finally{l(!1)}};D.useEffect(()=>{O()},[d]);const I=c.reduce((m,S)=>(m[S.name]="",m),{}),V=m=>{m.success?(O(),re.push(t.jsx(se,{title:"Success",type:"success",duration:2500,children:(m==null?void 0:m.message)||"Success"}),{placement:"top-center"})):re.push(t.jsx(se,{title:"Error",type:"danger",duration:2500,children:m.message}),{placement:"top-center"})},P=async(m,S)=>{var C,M,N;try{let b;L==="Add"?b=await rt(h,{data:m}):L==="Edit"&&(r!=null&&r.Id)&&(b=await st(h,r.Id,{data:m})),b&&(V(b),b.success&&k(!1),S(!1))}catch(b){console.error("Submit failed",b),S(!1),re.push(t.jsx(se,{title:"Error",type:"danger",duration:2500,children:((N=(M=(C=b==null?void 0:b.response)==null?void 0:C.data)==null?void 0:M.data)==null?void 0:N.message)||(b==null?void 0:b.message)||"Submission failed"}),{placement:"top-center"})}},J=o==null?void 0:o.some(m=>m.type==="upload"),Z={edit:s.isEdit,delete:s.isDelete,view:!1,fileImport:s.isEdit&&J},ee=(m,S)=>{S===xe.edit&&(Y("Edit"),e(m),k(!0)),S===xe.delete&&(e(m),u(!0)),S===xe.fileImport&&(e(m),v(!0))},G=()=>new Date().toISOString().replace(/[:.]/g,"-"),[U,K]=D.useState({}),[B,te]=D.useState({}),[ne,le]=D.useState({}),ie=D.useMemo(()=>c.map(m=>({name:m.name,ds:m.dataSource})).filter(m=>m.ds&&m.ds.tableId),[c]);async function ue(m,S,C){var T,R;const M=await je(m,{signal:C}),N=((R=(T=M==null?void 0:M.data)==null?void 0:T.data)==null?void 0:R.$values)||[],b=typeof S=="string"?S.split(",").map(z=>z.trim()).filter(Boolean):S;return N.map(z=>{const H=z.Id,W=b!=null&&b.length?b.map(oe=>z[oe]).filter(Boolean).join(" - "):String(H);return{value:String(H),label:String(W)}})}D.useEffect(()=>{let m=!0;const S={};return ie.forEach(({name:C,ds:M})=>{const N=M==null?void 0:M.tableId,b=M==null?void 0:M.labelField;if(!N||U[C])return;const T=new AbortController;S[C]=T,te(R=>({...R,[C]:!0})),le(R=>({...R,[C]:null})),ue(N,b,T.signal).then(R=>{console.log("opts",R),m&&K(z=>({...z,[C]:R}))}).catch(R=>{m&&R.name!=="AbortError"&&(le(z=>({...z,[C]:R.message||"Failed to load options"})),K(z=>({...z,[C]:null})))}).finally(()=>{m&&te(R=>({...R,[C]:!1}))})}),()=>{m=!1,Object.values(S).forEach(C=>C.abort())}},[ie.map(m=>m.name).join(","),JSON.stringify(ie)]);const me=D.useMemo(()=>Dt(o,U),[o,U]);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b dark:bg-[#292f3c] dark:text-white",children:t.jsxs("div",{className:"lg:flex items-center justify-between",children:[t.jsx("h3",{className:"mb-4 lg:mb-0",children:d}),t.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2",children:[t.jsx(X,{block:!0,variant:"solid",size:"sm",icon:t.jsx(Je,{}),onClick:()=>{Y("Add"),e(null),k(!0)},children:"Add New"}),t.jsx("div",{className:"flex-shrink-0",children:t.jsx(St,{onExport:async m=>{const S=await at(h,m);if(m==="json"){const C=S.data??S,M=new Blob([JSON.stringify(C,null,2)],{type:"application/json"}),N=window.URL.createObjectURL(M),b=document.createElement("a");b.href=N,b.setAttribute("download",`${d}_${G()}_export.json`),document.body.appendChild(b),b.click(),b.remove()}else{const C=S.blob?await S.blob():new Blob([S.data],{type:S.type}),M=window.URL.createObjectURL(C),N=document.createElement("a");N.href=M,N.setAttribute("download",`${d}_${G()}_export.${m==="csv"?"csv":"xlsx"}`),document.body.appendChild(N),N.click(),N.remove()}}})})]})]})}),a&&t.jsx(Ve,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),t.jsx(be,{className:"m-6 h-full py-4 px-6 bg-transparent",children:t.jsx("div",{className:"responsive-table",children:t.jsx(Ge,{tableName:d,dataSource:i,height:n,columns:o.length>0?[{dataField:"Action",caption:"Action",width:130,allowSorting:!1,allowFiltering:!1,allowSearch:!1,cellRender:m=>t.jsx("div",{id:"mAction","data-cname":"Actions",children:t.jsx(We,{row:m.data,actions:Z,buttonClick:ee})})},...me]:[],keyExpr:"$id",stateStorageKey:d.toLowerCase(),isLoading:a})})}),t.jsx(Fe,{title:L,isOpen:w,portalClassName:"w30",onClose:()=>k(!1),children:t.jsx(Ae,{initialValues:r||I,validationSchema:gt(c),onSubmit:(m,{setSubmitting:S})=>{P(m,S)},children:({setFieldValue:m,errors:S,touched:C,values:M,isSubmitting:N})=>(D.useEffect(()=>{const b=()=>{if(window.google&&window.google.maps){const T=new window.google.maps.places.Autocomplete(A.current,{types:["address"],componentRestrictions:{country:"us"}});T.addListener("place_changed",()=>{const R=T.getPlace(),z={};R.address_components.forEach(H=>{const W=H.types;W.includes("locality")?z.city=H.long_name:W.includes("administrative_area_level_1")?z.state=H.short_name:W.includes("postal_code")&&(z.zipcode=H.long_name)}),m("address",R.name),m("city",z.city||""),m("state",z.state||""),m("zip",z.zipcode||"")})}};if(window.google&&window.google.maps)b();else{const T=setInterval(()=>{window.google&&window.google.maps&&(b(),clearInterval(T))},500)}},[]),t.jsx(Me,{children:t.jsx(Ne,{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.jsxs(be,{divider:!0,className:"mb-4",children:[t.jsx(ht,{schema:c,errors:S,touched:C,values:M,drawerType:L,addressRef:A}),t.jsx(Ie,{className:"flex items-center p-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx(X,{size:"sm",className:"mr-2",disabled:N,onClick:()=>k(!1),children:"Discard"}),t.jsx(X,{size:"sm",variant:"solid",type:"submit",loading:N,children:L==="Edit"?"Save":L})]})})]})})})})}))})}),t.jsx(mt,{tableId:h,rowId:(r==null?void 0:r.Id)||"",isOpen:E,fetchData:O,onDialogClose:()=>u(!1)}),t.jsx(Fe,{title:"Manage File",isOpen:j,portalClassName:"w50",onClose:()=>v(!1),children:t.jsx(kt,{setFileDrawerOpen:v,fetchData:O,tableId:h,row:r,columnName:o==null?void 0:o.find(m=>m.type==="upload")})})]})};export{pa as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./vendor-mui-69397583.js";import{u as n,r as c}from"./vendor-react-ece1c85f.js";import"./index-c62ac197.js";import{A as d}from"./AdaptableCard-df7695d6.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";const v=m=>{var e;const{state:r}=n(),i=r==null?void 0:r.leadData;r!=null&&r.leadMeetings;const[h,l]=c.useState(0);return c.useEffect(()=>{i&&l(i.leadStatusId===1||i.leadStatusId===6?0:i.leadStatusId===5?1:2)},[i]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:s.jsx("div",{className:"lg:flex items-center justify-between",children:s.jsx("h3",{className:"mb-4 lg:mb-0",children:"Map Detail"})})}),s.jsx(d,{className:"m-6 h-full py-4 px-6 bg-transparent",bodyClass:"h-full",children:s.jsxs(d,{className:"py-4 px-6",children:[s.jsx("h3",{className:"mt-2 mtb-2 lg:mb-0",children:"Details"}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-4 py-1",children:[s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Owner"}),s.jsx("h6",{children:i==null?void 0:i.leadName})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Source"}),s.jsx("h6",{children:i==null?void 0:i.leadSource})]})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-4 py-1",children:[s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Company"}),s.jsx("h6",{children:i==null?void 0:i.accountName})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Website"}),s.jsx("h6",{children:i==null?void 0:i.website})]})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-4 py-1",children:[s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Designation"}),s.jsx("h6",{children:(e=i==null?void 0:i.contactPosistion)==null?void 0:e.positionName})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Email"}),s.jsx("h6",{children:i==null?void 0:i.contactEmail})]})]}),s.jsx("div",{className:"grid md:grid-cols-2 gap-4 py-1",children:s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Phone"}),s.jsx("h6",{children:i==null?void 0:i.contactNumber})]})}),s.jsx("hr",{}),s.jsx("div",{className:"grid md:grid-cols-2 gap-4 py-1",children:s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Address"}),s.jsxs("h6",{children:[i==null?void 0:i.address,", ",i==null?void 0:i.state,", ",i==null?void 0:i.city,", ",i==null?void 0:i.zip]})]})}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-4 py-1",children:[s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"Industry"}),s.jsx("h6",{children:i==null?void 0:i.industry})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{children:"No Of Employees"}),s.jsx("h6",{children:i==null?void 0:i.noOfEmployees})]})]}),s.jsx("hr",{}),s.jsx("div",{className:"grid md:grid-cols-2 gap-4 py-1",children:s.jsx("div",{className:"mb-3",children:s.jsx("h6",{children:"Business Card"})})})]})})]})};export{v as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{L as x}from"./Logo-3f3c9ee6.js";import{h as m,d as o,k as p}from"./index-c62ac197.js";import{M as u,D as a}from"./index-c2088808.js";import{L as j}from"./vendor-react-ece1c85f.js";import{u as M}from"./vendor-i18n-2fcb1983.js";const H=()=>{const t=m(n=>n.theme.mode),i=m(n=>n.theme.navMode)==="dark"?"dark":t;return e.jsx(x,{mode:i,logoWidth:"150px",className:"hidden md:block"})},h=({path:t,children:r,isExternalLink:i,className:n})=>e.jsx(j,{className:o("h-full w-full flex items-center",n),to:t,target:i?"_blank":"",children:e.jsx("span",{children:r})}),c=({nav:t,isLink:r,manuVariant:i})=>{const{menuName:n,routeLink:s,isExternalLink:l}=t;return e.jsx(e.Fragment,{children:s&&r?e.jsx(h,{path:s,isExternalLink:l,children:e.jsx(u,{variant:"light",children:e.jsx("span",{children:n})})}):e.jsxs(u,{variant:"light",children:[e.jsx("span",{children:n}),e.jsx(p,{className:"ml-0.5 text-xs opacity-50"})]})})},d=({nav:t})=>{const{menuName:r,translateKey:i,routeLink:n,$id:s,isExternalLink:l}=t;return e.jsx(a.Item,{eventKey:s,className:o(n&&"px-0"),children:n?e.jsx(h,{path:n,className:o(n&&"px-2"),isExternalLink:l,children:r}):e.jsx("span",{children:r})})},N=({manuVariant:t,userAuthority:r=[],menus:i=[]})=>(M(),e.jsx("span",{className:"flex items-center",children:i.map(n=>n.isView?n.childMenus.$values.length>0?e.jsx(a,{trigger:"hover",renderTitle:e.jsx(c,{manuVariant:t,nav:n},n.$id),children:n.childMenus.$values.map(s=>s.isView?e.jsx(e.Fragment,{children:s.childMenus.$values.length>0?e.jsx(a.Menu,{title:s.menuName,children:s.childMenus.$values.map(l=>l.isView?e.jsx(d,{nav:l}):null)}):e.jsx(d,{nav:s},s.$id)}):null)},n.$id):n.childMenus.$values.length===0?e.jsx(c,{isLink:!0,nav:n,manuVariant:t}):null:null)}));export{N as H,H as a};