uigraph 1.0.0 → 1.0.2

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 (323) hide show
  1. package/README.md +30 -51
  2. package/dist/bin.mjs +1608 -59037
  3. package/dist/viewer/assets/abnfDiagram-VCTEODGH-D7zWJuPJ.js +1 -0
  4. package/dist/viewer/assets/actor-avatar-Bu-mKKXB.js +1 -0
  5. package/dist/viewer/assets/{api-adapters-CnQpLiWI.js → api-adapters-tfr51BsS.js} +1 -1
  6. package/dist/viewer/assets/{api-endpoints-DCA5GNpC.js → api-endpoints-D-Whnnwd.js} +9 -9
  7. package/dist/viewer/assets/{api-group-endpoints-page-Di42W69y.js → api-group-endpoints-page-B9R1EI4i.js} +9 -9
  8. package/dist/viewer/assets/{arc-Cn8owoDw.js → arc-DauzQXFu.js} +1 -1
  9. package/dist/viewer/assets/architectureDiagram-5GKGNRK7-CXzgHd-c.js +36 -0
  10. package/dist/viewer/assets/{arrow-left-DWcMgM2U.js → arrow-left-DpQqmf17.js} +1 -1
  11. package/dist/viewer/assets/avatar-DAFUyk1i.js +43 -0
  12. package/dist/viewer/assets/badge-hR3QvPWv.js +1 -0
  13. package/dist/viewer/assets/better-delete-confirmation-modal-CGEQ5O4X.js +1 -0
  14. package/dist/viewer/assets/better-dialog-DcIxFWwk.js +1 -0
  15. package/dist/viewer/assets/{blockDiagram-I7D4REHJ-CbYzOsL_.js → blockDiagram-I7D4REHJ-CFHWUw4z.js} +2 -2
  16. package/dist/viewer/assets/{brands-Bd4RklRx.js → brands-DtmA1AhP.js} +1 -1
  17. package/dist/viewer/assets/button-DZj74qS7.js +1 -0
  18. package/dist/viewer/assets/{c4Diagram-7LVT6UL2-CLkVbphC.js → c4Diagram-7LVT6UL2-BHSggPKI.js} +6 -6
  19. package/dist/viewer/assets/{calendar-C0xdI_ag.js → calendar-Bolgc8E5.js} +1 -1
  20. package/dist/viewer/assets/channel-CNRSofFP.js +1 -0
  21. package/dist/viewer/assets/{check-XjanpAFg.js → check-BpmCQNbj.js} +1 -1
  22. package/dist/viewer/assets/checkbox-CFJfXL6R.js +1 -0
  23. package/dist/viewer/assets/{chevron-down-R7pQzyLD.js → chevron-down-DDsUE_xz.js} +1 -1
  24. package/dist/viewer/assets/{chevron-up-CRPypfOs.js → chevron-up-DVznKMGv.js} +1 -1
  25. package/dist/viewer/assets/{chunk-2Q5K7J3B-CcvtugCu.js → chunk-2Q5K7J3B-CNfz5YDQ.js} +1 -1
  26. package/dist/viewer/assets/{chunk-5VM5RSS4-CpZHHr12.js → chunk-5VM5RSS4-CwIhjvMe.js} +1 -1
  27. package/dist/viewer/assets/{chunk-F27PBJKO-DeAl4iOc.js → chunk-F27PBJKO-YFexFJof.js} +1 -1
  28. package/dist/viewer/assets/{chunk-IMKFNOWR-BfrPe7pS.js → chunk-IMKFNOWR-GY2yrvuo.js} +1 -1
  29. package/dist/viewer/assets/{chunk-JWPE2WC7-DDjyvUmZ.js → chunk-JWPE2WC7-xd0JGvne.js} +1 -1
  30. package/dist/viewer/assets/chunk-OB3PAWPO-DJIP1M4r.js +12 -0
  31. package/dist/viewer/assets/{chunk-POPQ4Y6H-DkDb0mzz.js → chunk-POPQ4Y6H-Bh6rizEy.js} +1 -1
  32. package/dist/viewer/assets/{chunk-SVP7TREG-D-K2XIGs.js → chunk-SVP7TREG-DtNrjvpq.js} +1 -1
  33. package/dist/viewer/assets/{chunk-TICWLB2K-DWMQQx6z.js → chunk-TICWLB2K-DrERwtw8.js} +1 -1
  34. package/dist/viewer/assets/{chunk-XXDRQBXY-DfkljAyM.js → chunk-XXDRQBXY-fYo04iwY.js} +1 -1
  35. package/dist/viewer/assets/{circle-alert-pm13M-Ef.js → circle-alert-Bl7DXYD_.js} +1 -1
  36. package/dist/viewer/assets/classDiagram-ZZMXUADV-D7PO-ME9.js +1 -0
  37. package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-D7PO-ME9.js +1 -0
  38. package/dist/viewer/assets/color-input-ClkkG_kZ.js +11 -0
  39. package/dist/viewer/assets/{common-Y7ySZBdh.js → common-DLCsGQ-t.js} +1 -1
  40. package/dist/viewer/assets/{component-icons-D1BDAuEt.js → component-icons-MJ61E9nt.js} +2 -2
  41. package/dist/viewer/assets/{copy-CN4K2f_R.js → copy-DMJJonQF.js} +1 -1
  42. package/dist/viewer/assets/cose-bilkent-JH36ORCC-Dplz8nVT.js +1 -0
  43. package/dist/viewer/assets/cross-button-D5qst1tj.js +1 -0
  44. package/dist/viewer/assets/{cynefin-OW5HDTMX-yz-uw9Kz.js → cynefin-OW5HDTMX-DiBs4CI8.js} +1 -1
  45. package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-COXS8-dI.js +62 -0
  46. package/dist/viewer/assets/{dagre-GXQ25YYZ-zjZDwXOe.js → dagre-GXQ25YYZ-K8qvfG8D.js} +2 -2
  47. package/dist/viewer/assets/dashboard-diagrams-page-Cb0xNr4W.js +2 -0
  48. package/dist/viewer/assets/dashboard-diagrams-page-inner-CD--zr5q.js +1 -0
  49. package/dist/viewer/assets/dashboard-docs-page-BfWR9Ai9.js +2 -0
  50. package/dist/viewer/assets/dashboard-docs-page-inner-BLbX-YwF.js +67 -0
  51. package/dist/viewer/assets/dashboard-layout-sTeeHNsZ.js +1 -0
  52. package/dist/viewer/assets/dashboard-lens-layout-D-tu_4kn.js +1 -0
  53. package/dist/viewer/assets/dashboard-map-frame-page-7pDmbTSe.js +1 -0
  54. package/dist/viewer/assets/dashboard-plans-page-CfwOZ34A.js +1 -0
  55. package/dist/viewer/assets/dashboard-service-apis-k93fjW51.js +1 -0
  56. package/dist/viewer/assets/{dashboard-service-diagrams-CIjk95Jk.js → dashboard-service-diagrams-BIWUxX-Y.js} +3 -3
  57. package/dist/viewer/assets/dashboard-service-docs-CnniTD6Q.js +1 -0
  58. package/dist/viewer/assets/{dashboard-service-overview-CzePVPjl.js → dashboard-service-overview-CGBu4omY.js} +5 -5
  59. package/dist/viewer/assets/dashboard-services-DEscIO2O.js +1 -0
  60. package/dist/viewer/assets/{db-type-badge-DOgu1Pyc.js → db-type-badge-UbPgpwQf.js} +2 -2
  61. package/dist/viewer/assets/debounce-Cp8eREM4-D7o-Pzb-.js +2 -0
  62. package/dist/viewer/assets/{dependencies-CYdEztHw.js → dependencies-DK2GDlhQ.js} +1 -1
  63. package/dist/viewer/assets/{dependency-graph-DbyfN-rC.js → dependency-graph-xBEnCS0J.js} +3 -3
  64. package/dist/viewer/assets/{diagram-S7CK7UJ4-q-NHkUCx.js → diagram-S7CK7UJ4-D-liadVe.js} +2 -2
  65. package/dist/viewer/assets/diagram-UQ7AKVKN-CnA8mgXp.js +41 -0
  66. package/dist/viewer/assets/{diagram-VSXAHHWV-DZc1kHGx.js → diagram-VSXAHHWV-Ck7dgRFR.js} +2 -2
  67. package/dist/viewer/assets/diagram-VX7I27RA-Cm1LHbu3.js +24 -0
  68. package/dist/viewer/assets/diagram-Z3DM3KII-DV3yBUCB.js +24 -0
  69. package/dist/viewer/assets/diagram-live-preview-DzJ7Nxp1.js +2 -0
  70. package/dist/viewer/assets/{diagram-portal-page-CWxuok9E.js → diagram-portal-page-gguGLULH.js} +24 -24
  71. package/dist/viewer/assets/{diagrams-C1xkRPqT.js → diagrams-BqBSv2eb.js} +4 -4
  72. package/dist/viewer/assets/dialog-D7wzTt0L.js +6 -0
  73. package/dist/viewer/assets/{doc-file-content-B06roi8L.js → doc-file-content-Be0au9Vo.js} +4 -4
  74. package/dist/viewer/assets/{download-CLdCXVsO.js → download-DhyZ3g4F.js} +1 -1
  75. package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BXbHVQvG.js +1 -0
  76. package/dist/viewer/assets/{editor-vqK4qAnB.js → editor-F9o4zoeB.js} +2 -2
  77. package/dist/viewer/assets/{erDiagram-RLTQ6QDP-BWuA-aqV.js → erDiagram-RLTQ6QDP-DMfiWput.js} +2 -2
  78. package/dist/viewer/assets/{file-text-BvszilVL.js → file-text-BFqJQ67P.js} +1 -1
  79. package/dist/viewer/assets/flow-diagram-preview-B83UU1n_.js +1 -0
  80. package/dist/viewer/assets/{flowDiagram-HODETNUW-Db0QtNj4.js → flowDiagram-HODETNUW-BNFS2Mkr.js} +1 -1
  81. package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-DFDsYJNp.js +292 -0
  82. package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-BVHabPDp.js +106 -0
  83. package/dist/viewer/assets/global-loader-XJO9_e0l.js +1 -0
  84. package/dist/viewer/assets/{globe-Jl6eIZmG.js → globe-CJ35KsQW.js} +1 -1
  85. package/dist/viewer/assets/gql-FFIj8zdp.js +1 -0
  86. package/dist/viewer/assets/{grid-scroll-body-CPqSxU6-.js → grid-scroll-body-DC5pYDPJ.js} +2 -2
  87. package/dist/viewer/assets/iconBase-DtqdW2XR.js +1 -0
  88. package/dist/viewer/assets/index-B6MxYIzs.js +1 -0
  89. package/dist/viewer/assets/index-BC5xdBQU.js +48 -0
  90. package/dist/viewer/assets/index-BIrx3oY4.js +1 -0
  91. package/dist/viewer/assets/{index-jm22RWpY.js → index-BZGsDmUx.js} +5 -5
  92. package/dist/viewer/assets/{index-Poftp9f1.js → index-BZXhpoWr.js} +4 -4
  93. package/dist/viewer/assets/index-Bn2bqqMd.js +1 -0
  94. package/dist/viewer/assets/{index-HU5pz3kj.js → index-BpCVYTvP.js} +36 -36
  95. package/dist/viewer/assets/{index-Bt2YHgxl.js → index-CBOYhBKJ.js} +1 -1
  96. package/dist/viewer/assets/index-CH7cEAxj.js +17 -0
  97. package/dist/viewer/assets/index-CIf0GId3.js +74 -0
  98. package/dist/viewer/assets/{index-D7MEHpJf.js → index-Ck66Ic_p.js} +4 -4
  99. package/dist/viewer/assets/index-Cp9mIQ8F.js +1 -0
  100. package/dist/viewer/assets/{index-c6Bxcoqm.js → index-DDmBuMKI.js} +1 -1
  101. package/dist/viewer/assets/{index-BSyJbFDG.js → index-DY3BFyb6.js} +1 -1
  102. package/dist/viewer/assets/{index-BS94XVnd.js → index-DkzZ-ZvR.js} +1 -1
  103. package/dist/viewer/assets/{index-C_43VC19.js → index-PglMbhys.js} +1 -1
  104. package/dist/viewer/assets/infoDiagram-27XIBGKW-CG-wwxBf.js +2 -0
  105. package/dist/viewer/assets/input--C59pq6j.js +1 -0
  106. package/dist/viewer/assets/{ishikawaDiagram-5VMMS53U-C4PzFnZ4.js → ishikawaDiagram-5VMMS53U-BlgV7ceJ.js} +2 -2
  107. package/dist/viewer/assets/{journeyDiagram-3NMN7TZE-Dpn3bBNo.js → journeyDiagram-3NMN7TZE-Cn03_Xl6.js} +2 -2
  108. package/dist/viewer/assets/{kanban-definition-UXKFOSKX-CJ99H4G6.js → kanban-definition-UXKFOSKX-CJogvDPY.js} +6 -6
  109. package/dist/viewer/assets/{layout-Bfvxt_D5.js → layout-B26eC4yQ.js} +1 -1
  110. package/dist/viewer/assets/{lens-run-page-DZneics-.js → lens-run-page-Ba1ppzJt.js} +3 -3
  111. package/dist/viewer/assets/lens-runs-page-BnUS57LM.js +1 -0
  112. package/dist/viewer/assets/{link-2-C75goIOt.js → link-2-D1e0xznG.js} +1 -1
  113. package/dist/viewer/assets/linked-project-dot-BY1gEES9.js +543 -0
  114. package/dist/viewer/assets/{loader-circle-C5jZoM7X.js → loader-circle-CiqyoJF7.js} +1 -1
  115. package/dist/viewer/assets/{merge-Cy7YkrN7.js → merge-BhOMvhW1.js} +1 -1
  116. package/dist/viewer/assets/mermaid.core-BDgZg3kW.js +312 -0
  117. package/dist/viewer/assets/method-badge-DErZP7y5.js +1 -0
  118. package/dist/viewer/assets/{mindmap-definition-YA3MSWOX-yQCKA-K4.js → mindmap-definition-YA3MSWOX-DFkLu0ac.js} +2 -2
  119. package/dist/viewer/assets/nav-links-DZWMpwMR.js +61 -0
  120. package/dist/viewer/assets/{network-COWNXGMM.js → network-B1apzT1s.js} +1 -1
  121. package/dist/viewer/assets/{nosql-editor-modal-DTiWkc_r.js → nosql-editor-modal-CvH0SWAi.js} +5 -5
  122. package/dist/viewer/assets/not-found-page-C-fn8QeM.js +1 -0
  123. package/dist/viewer/assets/organization-dependency-graph-page-BryP-iJL.js +1 -0
  124. package/dist/viewer/assets/pegDiagram-XKGWAZYB-g1cM14-L.js +1 -0
  125. package/dist/viewer/assets/{pieDiagram-E7YTZNPT-DqnkpCX4.js → pieDiagram-E7YTZNPT-WEnDsMY3.js} +2 -2
  126. package/dist/viewer/assets/{plus-DQakmTjA.js → plus-DbyuOgKB.js} +1 -1
  127. package/dist/viewer/assets/popover-476u3TN0.js +1 -0
  128. package/dist/viewer/assets/preload-helper-BlTxHScW.js +1 -0
  129. package/dist/viewer/assets/{quadrantDiagram-AXDQQJYC-iQjJfars.js → quadrantDiagram-AXDQQJYC-NdfQCpzF.js} +2 -2
  130. package/dist/viewer/assets/query-D9oj6LGx.js +50 -0
  131. package/dist/viewer/assets/{quill-rCHj4fCw.js → quill-Cde5JMRD.js} +1 -1
  132. package/dist/viewer/assets/railroadDiagram-O6MQD6OU-BYhlXlMY.js +1 -0
  133. package/dist/viewer/assets/{react-BNzYaZuG.js → react-Bx48XWN4.js} +1 -1
  134. package/dist/viewer/assets/react-flow-wrapper-BcbvHgxz.js +277 -0
  135. package/dist/viewer/assets/{requirementDiagram-BXWQKSXE-Bv-Vh1dW.js → requirementDiagram-BXWQKSXE-C25Bcm2L.js} +2 -2
  136. package/dist/viewer/assets/{sankeyDiagram-P5KCCOFB-C__uD07f.js → sankeyDiagram-P5KCCOFB-h8LiCsgk.js} +2 -2
  137. package/dist/viewer/assets/scroll-area-RagrStGj.js +6 -0
  138. package/dist/viewer/assets/{search-DW-qhXLk.js → search-vw7ucoOs.js} +1 -1
  139. package/dist/viewer/assets/section-loader-C4hOfhQS.js +1 -0
  140. package/dist/viewer/assets/section-not-found-BnrXiPog.js +1 -0
  141. package/dist/viewer/assets/select-D9fbrr7O.js +1 -0
  142. package/dist/viewer/assets/{sequenceDiagram-WJ2MYXX4-1RbvcHwO.js → sequenceDiagram-WJ2MYXX4-CDRVvD30.js} +2 -2
  143. package/dist/viewer/assets/{service-context-C17u_Fw9.js → service-context-D5nBtU18.js} +1 -1
  144. package/dist/viewer/assets/{service-database-list-page-cYuDHIls.js → service-database-list-page-DBjaDLVy.js} +2 -2
  145. package/dist/viewer/assets/service-database-page-CenNCgwf.js +2 -0
  146. package/dist/viewer/assets/service-database-page-inner-gS51TQTZ.js +85 -0
  147. package/dist/viewer/assets/{service-doc-Dir8g83J.js → service-doc-C-jHqT1U.js} +4 -4
  148. package/dist/viewer/assets/{service-doc-preview-modal-bJ6tJ5YR.js → service-doc-preview-modal-5sX6FOu1.js} +2 -2
  149. package/dist/viewer/assets/service-layout-Bf0vZBCH.js +1 -0
  150. package/dist/viewer/assets/service-pages-CFikvX4t.js +1 -0
  151. package/dist/viewer/assets/{services-Crqkffr5.js → services-Ivav34WC.js} +4 -4
  152. package/dist/viewer/assets/{share-2-BmYmqN4k.js → share-2-CQEaWbfH.js} +1 -1
  153. package/dist/viewer/assets/sizeCapture-INFHLROL-BJ6ndnPM.js +1 -0
  154. package/dist/viewer/assets/stateDiagram-D77RDMKH-B_tNCX3o.js +1 -0
  155. package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-Dl9wqdli.js +1 -0
  156. package/dist/viewer/assets/{style-DgSU0bQl.js → style-BPesJvJr.js} +8 -8
  157. package/dist/viewer/assets/super-circle-loader-DSkos6uP.js +1 -0
  158. package/dist/viewer/assets/super-logo-loader-Cxlbn6MB.js +1 -0
  159. package/dist/viewer/assets/swimlanes-42K2YHIH-CzURzYwf.js +1 -0
  160. package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-DrIlwFtk.js +8 -0
  161. package/dist/viewer/assets/table-B4pFND-o.js +1 -0
  162. package/dist/viewer/assets/textarea-Clgdv3Oi.js +1 -0
  163. package/dist/viewer/assets/{timeline-definition-24CTP7MA-C4yuLwUH.js → timeline-definition-24CTP7MA-D0YXQE1U.js} +2 -2
  164. package/dist/viewer/assets/ui-graph-logo-gHowu5gP.js +1 -0
  165. package/dist/viewer/assets/{upload-CRsS43j9.js → upload-CYb3nN_5.js} +1 -1
  166. package/dist/viewer/assets/{uploads-BOQHX9l4.js → uploads-CX2kdXbM.js} +8 -8
  167. package/dist/viewer/assets/{use-debounced-value-Ba-kkCUY.js → use-debounced-value-BpNFJd3C.js} +1 -1
  168. package/dist/viewer/assets/{use-localstorage-DIisTx-J.js → use-localstorage-D233xVb0.js} +1 -1
  169. package/dist/viewer/assets/use-permissions-BvmxJJ5r.js +1 -0
  170. package/dist/viewer/assets/{use-scoped-storage-C4RzED-E.js → use-scoped-storage-DL1XVp1j.js} +1 -1
  171. package/dist/viewer/assets/useMutation-D5ZHwHsx.js +1 -0
  172. package/dist/viewer/assets/useQuery-Dhe6uxrL.js +1 -0
  173. package/dist/viewer/assets/{vennDiagram-4TSXK5OY-BCtqXZqe.js → vennDiagram-4TSXK5OY-SSjHlqCQ.js} +2 -2
  174. package/dist/viewer/assets/{wardleyDiagram-VM6X3IG4-D3OtZJoT.js → wardleyDiagram-VM6X3IG4-CZWNdQxH.js} +2 -2
  175. package/dist/viewer/assets/{xychartDiagram-S5SC5T6Z-DxLL2CHH.js → xychartDiagram-S5SC5T6Z-B2qAGeb0.js} +2 -2
  176. package/dist/viewer/assets/zod-BMU4UTQt.js +1 -0
  177. package/dist/viewer/index.html +10 -1
  178. package/package.json +57 -57
  179. package/dist/abort-signals-B4fc3ahg.mjs +0 -34
  180. package/dist/agents.md +0 -28
  181. package/dist/anthropic-messages-KPxCHqBN.mjs +0 -14327
  182. package/dist/auth-storage-BvNH97p9.mjs +0 -2180
  183. package/dist/azure-openai-config-BbeCSg4y.mjs +0 -55
  184. package/dist/azure-openai-responses-BRzy8RfL.mjs +0 -182
  185. package/dist/classifier-shared-DBUHiTGw.mjs +0 -105
  186. package/dist/cli-2R6QQFp1.mjs +0 -451
  187. package/dist/cloudflare-workers-ai-system-one-BfqwmRQf.mjs +0 -44
  188. package/dist/config-D8DMGzIq.mjs +0 -647
  189. package/dist/cross-spawn-B2jIQPlu.mjs +0 -404
  190. package/dist/diagnostics-xdSgQR8t.mjs +0 -131
  191. package/dist/dist-BRyghrKX.mjs +0 -404
  192. package/dist/dist-D0EzrblG.mjs +0 -12161
  193. package/dist/dist-EKhnHWHG.mjs +0 -140221
  194. package/dist/dist-pQtuusFv.mjs +0 -1243
  195. package/dist/easter-egg-3d-C9_btlWn.mjs +0 -1225
  196. package/dist/env-api-keys-uytNub6O.mjs +0 -122
  197. package/dist/error-body-FhmCtR7m.mjs +0 -101
  198. package/dist/esm-D5isprgl.mjs +0 -1533
  199. package/dist/esm-DnqE4pfM.mjs +0 -104876
  200. package/dist/execute-BoTKl80U.mjs +0 -1715
  201. package/dist/github-copilot-headers-DWcTgoXr.mjs +0 -22
  202. package/dist/google-generative-ai-Brs5YpJo.mjs +0 -332
  203. package/dist/google-shared-2CyYa4VE.mjs +0 -33438
  204. package/dist/google-vertex-DZDUQPKa.mjs +0 -378
  205. package/dist/hash-DN7ukSfd.mjs +0 -16
  206. package/dist/headers-GhQHLk-3.mjs +0 -17
  207. package/dist/jiti-9kWALm4Y.mjs +0 -5439
  208. package/dist/jiti-loader-f21DrY1K.mjs +0 -27
  209. package/dist/jiti-static-loader-BI_w28l7.mjs +0 -41704
  210. package/dist/json-parse-B2mHg7o7.mjs +0 -381
  211. package/dist/keybinding-hints-D0nLU3ZH.mjs +0 -17899
  212. package/dist/lib-Dj1gKQJc.mjs +0 -24379
  213. package/dist/llama-cpp-classify-C73BoMYd.mjs +0 -344
  214. package/dist/mistral-conversations-DXVR7znL.mjs +0 -698
  215. package/dist/models-DBdii9gQ.mjs +0 -1255
  216. package/dist/multipart-parser-DLw9Z0uJ.mjs +0 -298
  217. package/dist/node-B0NU8X55.mjs +0 -2479
  218. package/dist/node-B8gaKm9g.mjs +0 -23
  219. package/dist/openai-I3_AqKDX.mjs +0 -17357
  220. package/dist/openai-codex-responses-PcZHDuBD.mjs +0 -1198
  221. package/dist/openai-completions-a_mH01ii.mjs +0 -994
  222. package/dist/openai-decisions-Du8y4mQG.mjs +0 -142
  223. package/dist/openai-prompt-cache-Bc6qNWt0.mjs +0 -8
  224. package/dist/openai-responses-a9lV_U7O.mjs +0 -270
  225. package/dist/openai-responses-shared-CDs_PBiH.mjs +0 -598
  226. package/dist/openrouter-images-D0Zc8Cjs.mjs +0 -125
  227. package/dist/photon_rs-DCvMOMu0.mjs +0 -4252
  228. package/dist/pi-messages-B5ietIBq.mjs +0 -306
  229. package/dist/plan-prompt.md +0 -56
  230. package/dist/prompt.md +0 -44
  231. package/dist/provider-env-BJhgA66g.mjs +0 -37
  232. package/dist/provider-retry-DXYM7rVE.mjs +0 -79
  233. package/dist/runtime-DTkBxiaM.mjs +0 -2822
  234. package/dist/sanitize-unicode-CqChtoM6.mjs +0 -26
  235. package/dist/shell-836_JFnI.mjs +0 -162
  236. package/dist/source-CKPndhKl.mjs +0 -478
  237. package/dist/src-DNm2QRm3.mjs +0 -5028
  238. package/dist/system-one-shared-DUAFtNa8.mjs +0 -75
  239. package/dist/token-DEUkymby.mjs +0 -56
  240. package/dist/token-util-Cx5S4eKt.mjs +0 -3
  241. package/dist/tool-DHDYqsyG.mjs +0 -6673
  242. package/dist/transform-messages-BClk99Vn.mjs +0 -477
  243. package/dist/typesafe-system-one-D2d8j8hZ.mjs +0 -24
  244. package/dist/typescript-Br-vsRJV.mjs +0 -6737
  245. package/dist/uuid-CNCZqNBb.mjs +0 -49
  246. package/dist/v2-1z8ijsD3.mjs +0 -6120
  247. package/dist/viewer/assets/abnfDiagram-VCTEODGH-j5YaKnl9.js +0 -1
  248. package/dist/viewer/assets/actor-avatar-DqmoY8Xc.js +0 -1
  249. package/dist/viewer/assets/architectureDiagram-5GKGNRK7-D80cJKz_.js +0 -36
  250. package/dist/viewer/assets/avatar-BI7D-Aia.js +0 -43
  251. package/dist/viewer/assets/badge-870-A4Y6.js +0 -1
  252. package/dist/viewer/assets/better-delete-confirmation-modal-Dib31LVb.js +0 -1
  253. package/dist/viewer/assets/better-dialog-D3AAiahr.js +0 -1
  254. package/dist/viewer/assets/button-DadqadpO.js +0 -1
  255. package/dist/viewer/assets/channel-DRkt3LIn.js +0 -1
  256. package/dist/viewer/assets/checkbox-BXpR079x.js +0 -1
  257. package/dist/viewer/assets/classDiagram-ZZMXUADV-G5CebNaC.js +0 -1
  258. package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-G5CebNaC.js +0 -1
  259. package/dist/viewer/assets/color-input-Efm-lxDy.js +0 -11
  260. package/dist/viewer/assets/cose-bilkent-JH36ORCC-CrSHFmnp.js +0 -1
  261. package/dist/viewer/assets/cross-button-5Sr5rWVP.js +0 -1
  262. package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-Bdl_eBdu.js +0 -62
  263. package/dist/viewer/assets/dashboard-diagrams-page-DMupOe1m.js +0 -2
  264. package/dist/viewer/assets/dashboard-diagrams-page-inner-Dh0yKh2A.js +0 -1
  265. package/dist/viewer/assets/dashboard-docs-page-DWJ1qOQz.js +0 -2
  266. package/dist/viewer/assets/dashboard-docs-page-inner-Fs6G3oGo.js +0 -67
  267. package/dist/viewer/assets/dashboard-layout-D36InAaB.js +0 -1
  268. package/dist/viewer/assets/dashboard-lens-layout-Cv1Xx3hY.js +0 -1
  269. package/dist/viewer/assets/dashboard-map-frame-page-CTn61NUO.js +0 -1
  270. package/dist/viewer/assets/dashboard-plans-page-DxFJkrgK.js +0 -1
  271. package/dist/viewer/assets/dashboard-service-apis-BHtD9s5z.js +0 -1
  272. package/dist/viewer/assets/dashboard-service-docs-Uv_1uxxO.js +0 -1
  273. package/dist/viewer/assets/dashboard-services-CUP-L4Jg.js +0 -1
  274. package/dist/viewer/assets/diagram-UQ7AKVKN-DhFcurW6.js +0 -41
  275. package/dist/viewer/assets/diagram-VX7I27RA-DE1nREE8.js +0 -24
  276. package/dist/viewer/assets/diagram-Z3DM3KII-CSrYcCbc.js +0 -24
  277. package/dist/viewer/assets/diagram-live-preview-i5doxXLH.js +0 -2
  278. package/dist/viewer/assets/dialog-D_HtNS17.js +0 -6
  279. package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BfL8m_sf.js +0 -1
  280. package/dist/viewer/assets/flow-diagram-preview-T0Z4iMVU.js +0 -1
  281. package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-CsITpniw.js +0 -292
  282. package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-B4eCBGoe.js +0 -106
  283. package/dist/viewer/assets/iconBase-BoDZfJgC.js +0 -1
  284. package/dist/viewer/assets/index-5E1tJ7yK.js +0 -125
  285. package/dist/viewer/assets/index-7XpV2DRw.js +0 -1
  286. package/dist/viewer/assets/index-C0Rs3s9Z.js +0 -1
  287. package/dist/viewer/assets/index-CzHjJWeV.js +0 -1
  288. package/dist/viewer/assets/index-DcEA6SIV.js +0 -74
  289. package/dist/viewer/assets/infoDiagram-27XIBGKW-lTebN5Ix.js +0 -2
  290. package/dist/viewer/assets/input-YvHTVS0E.js +0 -1
  291. package/dist/viewer/assets/lens-runs-page-DoAOObxx.js +0 -1
  292. package/dist/viewer/assets/linked-project-dot-Ds2uEmJ9.js +0 -543
  293. package/dist/viewer/assets/mermaid.core-BCRBv8Us.js +0 -312
  294. package/dist/viewer/assets/method-badge-DMYDKdDZ.js +0 -1
  295. package/dist/viewer/assets/nav-links-8vT2ixiI.js +0 -61
  296. package/dist/viewer/assets/not-found-page-CnfLlhS4.js +0 -1
  297. package/dist/viewer/assets/organization-dependency-graph-page-3xqIxjNx.js +0 -1
  298. package/dist/viewer/assets/pegDiagram-XKGWAZYB-CMXqeAum.js +0 -1
  299. package/dist/viewer/assets/popover-CN9ni1N3.js +0 -1
  300. package/dist/viewer/assets/railroadDiagram-O6MQD6OU-CfqToX3W.js +0 -1
  301. package/dist/viewer/assets/react-flow-wrapper-BPlRstyO.js +0 -276
  302. package/dist/viewer/assets/scroll-area-BodE-n7W.js +0 -6
  303. package/dist/viewer/assets/section-loader-BzpYM_Nx.js +0 -1
  304. package/dist/viewer/assets/select-DDtnmSET.js +0 -1
  305. package/dist/viewer/assets/service-database-page-CMi1wF4h.js +0 -2
  306. package/dist/viewer/assets/service-database-page-inner-CoqAj93L.js +0 -85
  307. package/dist/viewer/assets/service-layout-0NMm_bKG.js +0 -1
  308. package/dist/viewer/assets/service-pages-dfnc91SU.js +0 -1
  309. package/dist/viewer/assets/sizeCapture-INFHLROL-BRJi3gCg.js +0 -1
  310. package/dist/viewer/assets/stateDiagram-D77RDMKH-DdLsfxgy.js +0 -1
  311. package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-DFwg8Qki.js +0 -1
  312. package/dist/viewer/assets/super-circle-loader-D8MElOMh.js +0 -1
  313. package/dist/viewer/assets/super-logo-loader-DJYiRbCS.js +0 -1
  314. package/dist/viewer/assets/swimlanes-42K2YHIH-AuYjrPqh.js +0 -1
  315. package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-0nIGA8_4.js +0 -8
  316. package/dist/viewer/assets/table-Bi4Auk9Z.js +0 -1
  317. package/dist/viewer/assets/textarea-MgxZ5x6-.js +0 -1
  318. package/dist/viewer/assets/ui-graph-logo-D4jRhd4z.js +0 -1
  319. package/dist/viewer/assets/use-permissions-6JVET753.js +0 -1
  320. package/dist/viewer/assets/useMutation-CmVaR9zz.js +0 -1
  321. package/dist/viewer/assets/useQuery-B8yYhO0c.js +0 -1
  322. package/dist/viewer/assets/zod-Dc4H6VVJ.js +0 -1
  323. package/dist/virtual-modules-DnCx0Gdx.mjs +0 -340
@@ -1,4 +1,4 @@
1
- import{r,j as e,c as P,g as Se,u as O,ae as ce,b as xt,t as gt,S as Ae,L as Me}from"./index-5E1tJ7yK.js";import{B as k}from"./button-DadqadpO.js";import{C as ft}from"./color-input-Efm-lxDy.js";import{C as jt,D as Ee,a as De,b as Le,c as te}from"./scroll-area-BodE-n7W.js";import{I as W}from"./input-YvHTVS0E.js";import{S as me,a as pe,b as ue,c as he,d as V}from"./select-DDtnmSET.js";import{u as _e}from"./uploads-BOQHX9l4.js";import{u as ze}from"./use-debounced-value-Ba-kkCUY.js";import{u as Y}from"./use-permissions-6JVET753.js";import{E as Re,u as Te}from"./use-scoped-storage-C4RzED-E.js";import{u as bt,a as Oe,b as Be,c as vt,U as Ge,D as yt,e as Ue,f as Ct,j as Nt,I as $e,q as Ve,L as wt,r as Ft,s as Ze,t as kt,v as It,G as Pt,B as qe,M as St,p as ye,w as At,x as Mt,y as Et,k as Dt,z as He,A as Lt,o as se,E as _t,H as zt,J as Rt}from"./linked-project-dot-Ds2uEmJ9.js";import{c as J,J as Tt,K as Ot,N as Bt,O as Qe}from"./nav-links-8vT2ixiI.js";import{DashboardSectionHeader as Gt,DashboardPageSectionLayout as We}from"./index-7XpV2DRw.js";import{G as Ce}from"./grid-scroll-body-CPqSxU6-.js";import{i as Ut,d as $t}from"./style-DgSU0bQl.js";import{a as X}from"./index-Dj_05fqk.js";import{S as U}from"./super-circle-loader-D8MElOMh.js";import{S as xe}from"./section-loader-BzpYM_Nx.js";import{c as Xe}from"./react-BNzYaZuG.js";import{u as Z}from"./useQuery-B8yYhO0c.js";import{u as z}from"./useMutation-CmVaR9zz.js";import{L as T,T as Ye}from"./textarea-MgxZ5x6-.js";import{u as Je,a as Ke,C as H}from"./zod-Dc4H6VVJ.js";import{U as et}from"./upload-CRsS43j9.js";import{X as tt,c as Vt,d as ge,e as fe,f as st}from"./dialog-D_HtNS17.js";import{o as at,s as Q,D as Zt}from"./index-DcEA6SIV.js";import{A as qt}from"./actor-avatar-DqmoY8Xc.js";import{D as Ht}from"./dashboard-layout-D36InAaB.js";import{B as Qt,a as Wt,b as Xt}from"./better-dialog-D3AAiahr.js";import{C as Yt}from"./check-XjanpAFg.js";import{C as rt}from"./calendar-C0xdI_ag.js";import{f as ot}from"./format-BquKoU4D.js";import{S as Jt}from"./services-Crqkffr5.js";import"./iconBase-BoDZfJgC.js";import"./checkbox-BXpR079x.js";import"./react-flow-wrapper-BPlRstyO.js";import"./index-HU5pz3kj.js";import"./mermaid.core-BCRBv8Us.js";import"./transform-BqqRT-Iy.js";import"./last-DXTTfs9a.js";import"./index-C0Rs3s9Z.js";import"./value-wA6veExk.js";import"./component-icons-D1BDAuEt.js";import"./use-localstorage-DIisTx-J.js";import"./avatar-BI7D-Aia.js";import"./index-C_43VC19.js";import"./chevron-down-R7pQzyLD.js";import"./better-delete-confirmation-modal-Dib31LVb.js";import"./badge-870-A4Y6.js";import"./table-Bi4Auk9Z.js";import"./common-Y7ySZBdh.js";import"./en-US-B1Lg1a1H.js";import"./endOfMonth-CMPv5yN4.js";import"./popover-CN9ni1N3.js";import"./index-Bt2YHgxl.js";import"./index-BS94XVnd.js";import"./ui-graph-logo-D4jRhd4z.js";import"./chevron-up-CRPypfOs.js";import"./cross-button-5Sr5rWVP.js";import"./super-logo-loader-DJYiRbCS.js";import"./index-CzHjJWeV.js";import"./index-c6Bxcoqm.js";import"./method-badge-DMYDKdDZ.js";import"./api-adapters-CnQpLiWI.js";import"./api-endpoints-DCA5GNpC.js";import"./loader-circle-C5jZoM7X.js";import"./diagrams-C1xkRPqT.js";import"./link-2-C75goIOt.js";import"./flow-diagram-preview-T0Z4iMVU.js";import"./index-D7MEHpJf.js";import"./getRoundingMethod-DC1wW3rl.js";import"./quill-rCHj4fCw.js";import"./merge-Cy7YkrN7.js";import"./doc-file-content-B06roi8L.js";import"./file-text-BvszilVL.js";import"./globe-Jl6eIZmG.js";import"./index-jm22RWpY.js";import"./index-BSyJbFDG.js";import"./katex-HP8lGamR.js";import"./service-doc-Dir8g83J.js";import"./git-BilAlIQ8.js";/**
1
+ import{r,j as e}from"./index-CH7cEAxj.js";import{B as k}from"./button-DZj74qS7.js";import{C as xt}from"./color-input-ClkkG_kZ.js";import{C as gt,D as Se,a as Ae,b as Me,c as te}from"./scroll-area-RagrStGj.js";import{I as W}from"./input--C59pq6j.js";import{S as me,a as pe,b as ue,c as he,d as V}from"./select-D9fbrr7O.js";import{u as Ee}from"./uploads-CX2kdXbM.js";import{u as De}from"./use-debounced-value-BpNFJd3C.js";import{u as Y}from"./use-permissions-BvmxJJ5r.js";import{E as Le,u as _e}from"./use-scoped-storage-DL1XVp1j.js";import{u as ft,a as ze,b as Re,c as jt,U as Te,D as bt,e as Oe,f as vt,j as yt,I as Be,q as Ge,L as Ct,r as wt,s as Ue,t as Nt,v as Ft,G as kt,B as $e,M as It,p as ye,w as Pt,x as St,y as At,k as Mt,z as Ve,A as Et,o as se,E as Dt,H as Lt,J as _t}from"./linked-project-dot-BY1gEES9.js";import{u as O,B as ce}from"./query-D9oj6LGx.js";import{c as J,O as zt,Q as Rt,S as Tt,U as Ze}from"./nav-links-DZWMpwMR.js";import{DashboardSectionHeader as Ot,DashboardPageSectionLayout as Qe}from"./index-Bn2bqqMd.js";import{G as Ce}from"./grid-scroll-body-DC5pYDPJ.js";import{c as P,a as Bt,L as qe}from"./chunk-OB3PAWPO-DJIP1M4r.js";import{i as Gt,d as Ut}from"./style-BPesJvJr.js";import{a as X}from"./index-Dj_05fqk.js";import{S as U}from"./super-circle-loader-DSkos6uP.js";import{S as xe}from"./section-loader-C4hOfhQS.js";import{g as He}from"./gql-FFIj8zdp.js";import{c as We}from"./react-Bx48XWN4.js";import{u as Z}from"./useQuery-Dhe6uxrL.js";import{u as z}from"./useMutation-D5ZHwHsx.js";import{L as T,T as Xe}from"./textarea-Clgdv3Oi.js";import{u as Ye,a as Je,C as q}from"./zod-BMU4UTQt.js";import{U as Ke}from"./upload-CYb3nN_5.js";import{X as et,c as $t,d as ge,e as fe,f as tt}from"./dialog-D7wzTt0L.js";import{o as st,s as H,D as Vt}from"./index-CIf0GId3.js";import{A as Zt}from"./actor-avatar-Bu-mKKXB.js";import{S as at}from"./section-not-found-BnrXiPog.js";import{D as Qt}from"./dashboard-layout-sTeeHNsZ.js";import{B as qt,a as Ht,b as Wt}from"./better-dialog-DcIxFWwk.js";import{t as Xt}from"./index-B6MxYIzs.js";import{C as Yt}from"./check-BpmCQNbj.js";import{C as rt}from"./calendar-Bolgc8E5.js";import{f as ot}from"./format-BquKoU4D.js";import{S as Jt}from"./services-Ivav34WC.js";import"./iconBase-DtqdW2XR.js";import"./checkbox-CFJfXL6R.js";import"./react-flow-wrapper-BcbvHgxz.js";import"./index-BpCVYTvP.js";import"./preload-helper-BlTxHScW.js";import"./mermaid.core-BDgZg3kW.js";import"./transform-BqqRT-Iy.js";import"./last-DXTTfs9a.js";import"./index-BIrx3oY4.js";import"./value-wA6veExk.js";import"./component-icons-MJ61E9nt.js";import"./use-localstorage-D233xVb0.js";import"./avatar-DAFUyk1i.js";import"./index-PglMbhys.js";import"./chevron-down-DDsUE_xz.js";import"./better-delete-confirmation-modal-CGEQ5O4X.js";import"./badge-hR3QvPWv.js";import"./table-B4pFND-o.js";import"./common-DLCsGQ-t.js";import"./en-US-B1Lg1a1H.js";import"./endOfMonth-CMPv5yN4.js";import"./popover-476u3TN0.js";import"./index-CBOYhBKJ.js";import"./index-DkzZ-ZvR.js";import"./ui-graph-logo-gHowu5gP.js";import"./chevron-up-DVznKMGv.js";import"./cross-button-D5qst1tj.js";import"./super-logo-loader-Cxlbn6MB.js";import"./index-Cp9mIQ8F.js";import"./index-DDmBuMKI.js";import"./method-badge-DErZP7y5.js";import"./api-adapters-tfr51BsS.js";import"./api-endpoints-D-Whnnwd.js";import"./loader-circle-CiqyoJF7.js";import"./diagrams-BqBSv2eb.js";import"./link-2-D1e0xznG.js";import"./flow-diagram-preview-B83UU1n_.js";import"./index-Ck66Ic_p.js";import"./getRoundingMethod-DC1wW3rl.js";import"./quill-Cde5JMRD.js";import"./merge-BhOMvhW1.js";import"./doc-file-content-Be0au9Vo.js";import"./file-text-BFqJQ67P.js";import"./globe-CJ35KsQW.js";import"./index-BZGsDmUx.js";import"./index-DY3BFyb6.js";import"./katex-HP8lGamR.js";import"./service-doc-C-jHqT1U.js";import"./git-BilAlIQ8.js";/**
2
2
  * @license lucide-react v0.514.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -23,7 +23,7 @@ import{r,j as e,c as P,g as Se,u as O,ae as ce,b as xt,t as gt,S as Ae,L as Me}f
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const ns=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],is=J("target",ns);function it({currentPage:t,totalPages:s,setCurrentPage:n}){const d=r.useMemo(()=>s<=7?Array.from({length:s},(i,a)=>a+1):t<=4?[1,2,3,4,5,"...",s]:t>=s-3?[1,"...",s-4,s-3,s-2,s-1,s]:[1,"...",t-1,t,t+1,"...",s],[t,s]);return e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(k,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-md border border-[#2A3242] p-0 hover:bg-[#1E2533] disabled:opacity-50",disabled:t===1,onClick:()=>n(t-1),children:e.jsx(ft,{className:"h-4 w-4"})}),d.map((i,a)=>typeof i=="number"?e.jsx(k,{size:"sm",className:i===t?"h-8 min-w-[36px] rounded-md border border-blue-500/30 bg-blue-500/15 px-3 py-1.5 text-sm font-medium text-blue-300 hover:bg-blue-500/25":"h-8 min-w-[36px] rounded-md border border-[#2A3242] bg-[#1E2533] px-3 py-1.5 text-sm text-[#D2D9E6] hover:bg-[#2A3242] hover:text-[#F4F7FC]",variant:"ghost",onClick:()=>n(i),children:i},i):e.jsx("span",{className:"px-2 text-[#828DA3]",children:"..."},a)),e.jsx(k,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-md border border-[#2A3242] p-0 hover:bg-[#1E2533] disabled:opacity-50",disabled:t===s,onClick:()=>n(t+1),children:e.jsx(jt,{className:"h-4 w-4"})})]})}function ls(t){return e.jsxs("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:[e.jsx("path",{d:"M10.1766 12.8667H8.83803C6.94499 12.8667 5.99846 12.8667 5.41036 12.2786C4.82227 11.6905 4.82227 10.744 4.82227 8.85094V5.50446C4.82227 3.6114 4.82227 2.66487 5.41036 2.07678C5.99846 1.48868 6.94499 1.48868 8.83803 1.48868H9.73703C10.2842 1.48868 10.5577 1.48868 10.8038 1.59057C11.0497 1.69247 11.2432 1.88591 11.6301 2.27281L13.4083 4.05103C13.7952 4.43792 13.9886 4.63137 14.0905 4.87737C14.1924 5.12336 14.1924 5.39694 14.1924 5.94409V8.85094C14.1924 10.744 14.1924 11.6905 13.6043 12.2786C13.0163 12.8667 12.0697 12.8667 10.1766 12.8667Z",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M10.5107 1.82333V2.49263C10.5107 3.75467 10.5107 4.38569 10.9028 4.77775C11.2949 5.16982 11.9259 5.16982 13.1879 5.16982H13.8572",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4.82137 3.49658C3.71244 3.49658 2.81348 4.39555 2.81348 5.50447V10.8588C2.81348 12.752 2.81348 13.6985 3.40157 14.2865C3.98967 14.8746 4.9362 14.8746 6.82926 14.8746H10.176C11.2849 14.8746 12.1839 13.9756 12.1839 12.8667",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7.16504 7.51236H9.84223M7.16504 10.1895H11.8501",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"})]})}function cs(t){return e.jsx("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M10.8118 0.819214L11.2119 1.56734C11.4825 2.07312 11.6178 2.32601 11.5284 2.43432C11.4389 2.54262 11.1443 2.45515 10.555 2.28021C9.96591 2.1053 9.34045 2.0112 8.6923 2.0112C5.1807 2.0112 2.33398 4.77373 2.33398 8.18151C2.33398 9.30533 2.64361 10.3591 3.18461 11.2666M6.57286 15.5438L6.17264 14.7956C5.90206 14.2898 5.76677 14.0369 5.85623 13.9286C5.94569 13.8203 6.24033 13.9078 6.82958 14.0828C7.4187 14.2577 8.04416 14.3518 8.6923 14.3518C12.2039 14.3518 15.0506 11.5892 15.0506 8.18151C15.0506 7.05763 14.741 6.0039 14.2 5.09634",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"})})}function ds(t){return e.jsx("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M8.81043 2.82727V13.536M14.1648 8.18164H3.45605",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ms(t){return e.jsx("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M14.1648 8.18164H3.45605",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ne="flex h-full items-center gap-1.5 rounded-[0.8125rem] border border-[#2A3242] px-[0.803125rem] text-sm text-[#F4F7FC] transition-colors hover:bg-[#1E2533] disabled:cursor-not-allowed disabled:text-[#828DA3] disabled:opacity-60",we="flex size-10 items-center justify-center rounded-[0.8125rem] border border-[#2A3242] text-[#F4F7FC] transition-colors hover:bg-[#1E2533]";function ps({zoom:t,onZoomIn:s,onZoomOut:n,onSaveLayout:d,onResetLayout:i,isSaveLayoutLoading:a,isSaveLayoutDisabled:o,isResetLayoutDisabled:u,isResetLayoutLoading:v}){return e.jsxs("div",{className:"absolute top-6 right-6 flex h-12 gap-4 rounded-2xl border border-[#2A3242] bg-[#141925] p-1 shadow-sm",children:[e.jsxs("button",{onClick:d,disabled:o||a,className:Ne,children:[a?e.jsx(U,{className:"text-base"}):e.jsx(ls,{className:"text-base"}),"Save Layout"]}),e.jsxs("div",{className:"flex h-full items-center gap-3",children:[e.jsx("button",{onClick:s,className:we,children:e.jsx(ds,{className:"text-base"})}),e.jsxs("span",{className:"flex w-9 items-center justify-center text-sm text-[#F4F7FC]",children:[Math.round(t*100),"%"]}),e.jsx("button",{onClick:n,className:we,children:e.jsx(ms,{className:"text-base"})})]}),e.jsxs("button",{onClick:i,disabled:u||v,className:P(Ne,"disabled:hover:bg-transparent"),children:[v?e.jsx(U,{className:"text-base"}):e.jsx(cs,{className:"text-base"}),"Reset View"]})]})}const us=400,Fe=20,ke=Se(`
26
+ */const ns=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],is=J("target",ns);function it({currentPage:t,totalPages:s,setCurrentPage:n}){const d=r.useMemo(()=>s<=7?Array.from({length:s},(i,a)=>a+1):t<=4?[1,2,3,4,5,"...",s]:t>=s-3?[1,"...",s-4,s-3,s-2,s-1,s]:[1,"...",t-1,t,t+1,"...",s],[t,s]);return e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(k,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-md border border-[#2A3242] p-0 hover:bg-[#1E2533] disabled:opacity-50",disabled:t===1,onClick:()=>n(t-1),children:e.jsx(xt,{className:"h-4 w-4"})}),d.map((i,a)=>typeof i=="number"?e.jsx(k,{size:"sm",className:i===t?"h-8 min-w-[36px] rounded-md border border-blue-500/30 bg-blue-500/15 px-3 py-1.5 text-sm font-medium text-blue-300 hover:bg-blue-500/25":"h-8 min-w-[36px] rounded-md border border-[#2A3242] bg-[#1E2533] px-3 py-1.5 text-sm text-[#D2D9E6] hover:bg-[#2A3242] hover:text-[#F4F7FC]",variant:"ghost",onClick:()=>n(i),children:i},i):e.jsx("span",{className:"px-2 text-[#828DA3]",children:"..."},a)),e.jsx(k,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-md border border-[#2A3242] p-0 hover:bg-[#1E2533] disabled:opacity-50",disabled:t===s,onClick:()=>n(t+1),children:e.jsx(gt,{className:"h-4 w-4"})})]})}function ls(t){return e.jsxs("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:[e.jsx("path",{d:"M10.1766 12.8667H8.83803C6.94499 12.8667 5.99846 12.8667 5.41036 12.2786C4.82227 11.6905 4.82227 10.744 4.82227 8.85094V5.50446C4.82227 3.6114 4.82227 2.66487 5.41036 2.07678C5.99846 1.48868 6.94499 1.48868 8.83803 1.48868H9.73703C10.2842 1.48868 10.5577 1.48868 10.8038 1.59057C11.0497 1.69247 11.2432 1.88591 11.6301 2.27281L13.4083 4.05103C13.7952 4.43792 13.9886 4.63137 14.0905 4.87737C14.1924 5.12336 14.1924 5.39694 14.1924 5.94409V8.85094C14.1924 10.744 14.1924 11.6905 13.6043 12.2786C13.0163 12.8667 12.0697 12.8667 10.1766 12.8667Z",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M10.5107 1.82333V2.49263C10.5107 3.75467 10.5107 4.38569 10.9028 4.77775C11.2949 5.16982 11.9259 5.16982 13.1879 5.16982H13.8572",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4.82137 3.49658C3.71244 3.49658 2.81348 4.39555 2.81348 5.50447V10.8588C2.81348 12.752 2.81348 13.6985 3.40157 14.2865C3.98967 14.8746 4.9362 14.8746 6.82926 14.8746H10.176C11.2849 14.8746 12.1839 13.9756 12.1839 12.8667",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7.16504 7.51236H9.84223M7.16504 10.1895H11.8501",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"})]})}function cs(t){return e.jsx("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M10.8118 0.819214L11.2119 1.56734C11.4825 2.07312 11.6178 2.32601 11.5284 2.43432C11.4389 2.54262 11.1443 2.45515 10.555 2.28021C9.96591 2.1053 9.34045 2.0112 8.6923 2.0112C5.1807 2.0112 2.33398 4.77373 2.33398 8.18151C2.33398 9.30533 2.64361 10.3591 3.18461 11.2666M6.57286 15.5438L6.17264 14.7956C5.90206 14.2898 5.76677 14.0369 5.85623 13.9286C5.94569 13.8203 6.24033 13.9078 6.82958 14.0828C7.4187 14.2577 8.04416 14.3518 8.6923 14.3518C12.2039 14.3518 15.0506 11.5892 15.0506 8.18151C15.0506 7.05763 14.741 6.0039 14.2 5.09634",stroke:"currentColor",strokeWidth:"1.00395",strokeLinecap:"round",strokeLinejoin:"round"})})}function ds(t){return e.jsx("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M8.81043 2.82727V13.536M14.1648 8.18164H3.45605",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ms(t){return e.jsx("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M14.1648 8.18164H3.45605",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const we="flex h-full items-center gap-1.5 rounded-[0.8125rem] border border-[#2A3242] px-[0.803125rem] text-sm text-[#F4F7FC] transition-colors hover:bg-[#1E2533] disabled:cursor-not-allowed disabled:text-[#828DA3] disabled:opacity-60",Ne="flex size-10 items-center justify-center rounded-[0.8125rem] border border-[#2A3242] text-[#F4F7FC] transition-colors hover:bg-[#1E2533]";function ps({zoom:t,onZoomIn:s,onZoomOut:n,onSaveLayout:d,onResetLayout:i,isSaveLayoutLoading:a,isSaveLayoutDisabled:o,isResetLayoutDisabled:u,isResetLayoutLoading:v}){return e.jsxs("div",{className:"absolute top-6 right-6 flex h-12 gap-4 rounded-2xl border border-[#2A3242] bg-[#141925] p-1 shadow-sm",children:[e.jsxs("button",{onClick:d,disabled:o||a,className:we,children:[a?e.jsx(U,{className:"text-base"}):e.jsx(ls,{className:"text-base"}),"Save Layout"]}),e.jsxs("div",{className:"flex h-full items-center gap-3",children:[e.jsx("button",{onClick:s,className:Ne,children:e.jsx(ds,{className:"text-base"})}),e.jsxs("span",{className:"flex w-9 items-center justify-center text-sm text-[#F4F7FC]",children:[Math.round(t*100),"%"]}),e.jsx("button",{onClick:n,className:Ne,children:e.jsx(ms,{className:"text-base"})})]}),e.jsxs("button",{onClick:i,disabled:u||v,className:P(we,"disabled:hover:bg-transparent"),children:[v?e.jsx(U,{className:"text-base"}):e.jsx(cs,{className:"text-base"}),"Reset View"]})]})}const us=400,Fe=20,ke=He(`
27
27
  query Canvas($orgId: ID!, $mapId: ID!) {
28
28
  canvas(orgId: $orgId, mapId: $mapId) {
29
29
  mapId
@@ -35,7 +35,7 @@ import{r,j as e,c as P,g as Se,u as O,ae as ce,b as xt,t as gt,S as Ae,L as Me}f
35
35
  updatedAt
36
36
  }
37
37
  }
38
- `),hs=Se(`
38
+ `),hs=He(`
39
39
  mutation UpsertCanvas($orgId: ID!, $mapId: ID!, $input: UpsertCanvasInput!) {
40
40
  upsertCanvas(orgId: $orgId, mapId: $mapId, input: $input) {
41
41
  mapId
@@ -47,4 +47,4 @@ import{r,j as e,c as P,g as Se,u as O,ae as ce,b as xt,t as gt,S as Ae,L as Me}f
47
47
  updatedAt
48
48
  }
49
49
  }
50
- `),[xs,lt]=Xe(({pages:t,project:s})=>{const n=bt(),[d,i]=r.useState(0),a=O()?.id,o=s.id,u=Z(ke,{variables:{orgId:a,mapId:o},skip:!a||!o}),[v,b]=z(hs,{awaitRefetchQueries:!0,refetchQueries:[{query:ke,variables:{orgId:a,mapId:o}}]}),[h,f]=r.useState([]),[g,l]=r.useState([]),[C,F]=r.useState([]),[y,M]=r.useState([]),w=r.useCallback(async()=>{if(!a||!o)return;const N=await Promise.all(t.map(L=>Promise.all([ce.query({query:Oe,variables:{orgId:a,mapId:o,frameId:L.id},fetchPolicy:"network-only"}),ce.query({query:Be,variables:{orgId:a,mapId:o,frameId:L.id},fetchPolicy:"network-only"}),ce.query({query:vt,variables:{orgId:a,mapId:o,frameId:L.id},fetchPolicy:"network-only"})]))),E=N.flatMap(([L])=>L.data?.focalPoints??[]),D=N.flatMap(([,L])=>L.data?.frameGroups??[]),_=N.flatMap(([,,L])=>L.data?.frameLinks??[]);f(E),l(D),F(_.filter(L=>L.kind==="frame")),M(_.filter(L=>L.kind==="map"))},[t,a,o]);r.useEffect(()=>{w().catch(console.error)},[w]);const c=r.useMemo(()=>{const N=u.data?.canvas?.framePositions;if(!N)return[];try{const E=JSON.parse(N);return Object.entries(E).map(([D,_])=>({pageId:D,position:_}))}catch{return[]}},[u.data?.canvas?.framePositions]),I=n.focalPoint,j=r.useMemo(()=>h.find(N=>N.id===I),[h,I]),A=n.frameGroup,x=r.useMemo(()=>g.find(N=>N.id===A),[g,A]),[R,B]=z(Ge),[$,G]=z(yt),[q,K]=z(Ue),[ae,re]=z(Ct),oe=r.useMemo(()=>!x||h.length===0?[]:h.filter(N=>Nt({x:x.locationX,y:x.locationY,width:x.width,height:x.height},{x:N.locationX,y:N.locationY})),[h,x]);return{zoom:d,setZoom:i,isCreatePageCanvasLoading:b.loading,async createPageCanvas(N,E){const D=Object.fromEntries(E.map(_=>[_.pageId,_.position]));return v({variables:{orgId:a,mapId:o,input:{zoom:N,framePositions:JSON.stringify(D)}}})},isPageCanvasLoading:u.loading,pageCanvasZoom:u.data?.canvas?.zoom,pageCanvasItems:c,pages:t,project:s,canvasTarget:n,focalPoints:h,pageLinks:C,frameGroups:g,projectLinks:y,selectedFocalPoint:j,selectedFrameGroup:x,selectedFrameGroupPoints:oe,isUpdateFocalPointLoading:B.loading,async updateFocalPoint(N,E){const D=h.find(_=>_.id===N);await R({variables:{orgId:a,mapId:o,frameId:D?.frameId??"",id:N,input:E}}),await w()},isDeleteFocalPointLoading:G.loading,async deleteFocalPoint(N){const E=h.find(D=>D.id===N);await $({variables:{orgId:a,mapId:o,frameId:E?.frameId??"",id:N}}),await w()},isUpdateFrameGroupLoading:K.loading,async updateFrameGroup(N,E){const D=g.find(_=>_.id===N);await q({variables:{orgId:a,mapId:o,frameId:D?.frameId??"",id:N,input:E}}),await w()},isDeleteFrameGroupLoading:re.loading,async deleteFrameGroup(N){const E=g.find(D=>D.id===N);await ae({variables:{orgId:a,mapId:o,frameId:E?.frameId??"",id:N}}),await w()}}},{useChildrenProvider(t,s){return s.isPageCanvasLoading?e.jsx(xe,{}):t}});function Ie(t){return t.sort((s,n)=>s.id.localeCompare(n.id)).map(s=>`${s.id}@${s.position.x}@${s.position.y}`).join("|")}function gs(t,s){const n=Ie(t),d=Ie(s);return n===d}function fs({id:t}){const{pages:s,canvasTarget:n,focalPoints:d,frameGroups:i,pageLinks:a,projectLinks:o,selectedFrameGroup:u}=lt(),v=r.useMemo(()=>s.find(l=>l.id===t),[s,t]),b=r.useMemo(()=>d.filter(l=>l.frameId===t),[d,t]),h=r.useMemo(()=>i.filter(l=>l.frameId===t),[i,t]),f=r.useMemo(()=>a.filter(l=>l.frameId===t),[a,t]),g=r.useMemo(()=>o.filter(l=>l.frameId===t),[o,t]);return v?e.jsx("div",{className:"w-[400px] overflow-hidden rounded-md bg-white shadow-sm",children:e.jsx($e,{frame:v,onEmptyClick:()=>{n.clearTarget()},content:e.jsxs(e.Fragment,{children:[h.map(l=>e.jsx(Ve,{frame:v,frameGroup:l,contentSize:"sm",isSelected:u?.id===l.id,onClick:()=>{n.setTarget("group",l.id)}},l.id)),f.map(l=>e.jsx(wt,{pageLink:l,contentSize:"sm",deletePageLink:async()=>Promise.resolve(),updatePageLink:async()=>Promise.resolve()},l.id)),g.map(l=>e.jsx(Ft,{projectLink:l,contentSize:"sm",deleteProjectLink:async()=>Promise.resolve(),updateProjectLink:async()=>Promise.resolve()},l.id)),b.map(l=>e.jsx(Ze,{focalPoint:l,contentSize:"sm",onClick:()=>{n.setTarget("point",l.id)}},l.id))]})})}):null}const js={image:fs};function bs({...t}){return e.jsx(xs,{...t,children:e.jsx(vs,{})})}function vs(){const{canWrite:t}=Y(),[s,n]=r.useState(null),{zoom:d,setZoom:i,pageCanvasZoom:a,pages:o,project:u,pageCanvasItems:v,createPageCanvas:b,isCreatePageCanvasLoading:h,selectedFocalPoint:f,selectedFrameGroup:g,selectedFrameGroupPoints:l,updateFocalPoint:C,deleteFocalPoint:F,updateFrameGroup:y,deleteFrameGroup:M}=lt();r.useEffect(()=>{!s||!a||s.getZoom()===a||(i(a),s.fitView({maxZoom:a,minZoom:a,interpolate:"linear",duration:0}))},[i,a,s]);const w=r.useMemo(()=>{const x=X(v);return o.map((R,B)=>{const $=x.find(G=>G.pageId===R.id);return{type:"image",id:R.id,position:{y:x.length?$?.position?.y??0:Fe,x:x.length?$?.position?.x??0:us*B+(B+1)*Fe},data:{}}})},[o,v]),[c,I]=r.useState(w),j=r.useMemo(()=>gs(c,w)&&d===a,[c,w,d,a]),A=!!(f||g);return e.jsxs("div",{className:P("grid h-full transition-[grid-template-columns,gap]",A?"grid-cols-[1fr_27.25rem] gap-2":"grid-cols-[1fr_0] gap-0"),children:[e.jsxs("div",{className:"bg-shading-gray relative isolate size-full flex-1 overflow-hidden rounded-3xl border border-[#2A3242]",children:[e.jsx(Ut,{nodes:c,nodeTypes:js,onNodesChange:x=>{I(R=>$t(x,R))},className:P("absolute inset-0 size-full opacity-0",s&&"opacity-100"),minZoom:.2,onInit:async x=>{await x.fitView({maxZoom:1}),i(x.getZoom()),n(x)},onWheelCapture:()=>{s&&i(s.getZoom())}}),e.jsx(ps,{zoom:d,onZoomIn:async()=>{s&&(await s.zoomIn(),i(s.getZoom()))},onZoomOut:async()=>{s&&(await s.zoomOut(),i(s.getZoom()))},isSaveLayoutDisabled:j||!t,isResetLayoutDisabled:j,onResetLayout:()=>I(w),isSaveLayoutLoading:h,onSaveLayout:async()=>{s&&await b(s.getZoom(),c.map(x=>({pageId:x.id,position:x.position})))}})]}),!g&&f&&e.jsx("div",{className:"mt-[-66px]",children:e.jsx(Ce,{className:"border-stock h-full w-[27.25rem] rounded-[0.75rem] border border-[#2A3242] bg-[#141925]",children:e.jsx(kt,{focalPoint:f,mapId:u.id,children:e.jsx(It,{focalPoint:f,updateFocalPoint:async(x,R)=>{await C(x,R)},deleteFocalPoint:async x=>{await F(x)}})})})}),!f&&g&&e.jsx("div",{className:"mt-[-66px]",children:e.jsx(Ce,{className:"border-stock h-full w-[27.25rem] rounded-[0.75rem] border border-[#2A3242] bg-[#141925]",children:e.jsx(Pt,{frame:o.find(x=>x.id===g.frameId),frameGroup:g,frameGroupPoints:l,updateFrameGroup:async x=>{await y(g.id,x)},deleteFrameGroup:async()=>{await M(g.id)}})})})]})}const ys="h-[56px] rounded-[16px] border border-[#2A3242] bg-transparent px-6 focus:outline-none",Cs="min-h-[80px] w-full resize-none rounded-[16px] border border-[#2A3242] bg-transparent px-6 py-4 text-sm focus:outline-none",Ns=at({name:Q().min(1,"Page name is required"),description:Q().optional(),profileId:Q().optional().default("default"),imageFile:Zt(t=>t instanceof File&&t!==null,{message:"UI screenshot/design is required"})});function ws({title:t,description:s,ctaLabel:n,open:d,onOpenChange:i,initialValues:a,submitForm:o}){const[u,v]=r.useState(!1),[b,h]=r.useState(""),[f,g]=r.useState(null),l=r.useRef(null),{control:C,handleSubmit:F,reset:y,watch:M,formState:{errors:w}}=Je({mode:"onChange",resolver:Ke(Ns),values:{name:a?.name||"",description:a?.description||"",profileId:a?.profileId||"default",imageFile:a?.imageFile||null}}),c=M("imageFile");return r.useEffect(()=>{y(),g(null),l.current&&(l.current.value="")},[d,y]),e.jsx(qe,{open:d,onOpenChange:i,title:t,description:s,children:e.jsxs("form",{onSubmit:F(async I=>{v(!0),h("");try{const j=I;await o({name:j.name,description:j.description,profileId:j.profileId,imageFile:j.imageFile??null})}catch{h("Something went wrong. Please try again.")}v(!1)}),className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name",className:"leding-[1.33] text-sm font-normal",children:"Frame Name"}),e.jsx(H,{name:"name",control:C,render:({field:I})=>e.jsx(W,{id:"name",...I,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"e.g. Checkout Flow",className:P(ys,w.name&&"border-red-500")})}),w.name&&e.jsx("p",{className:"text-sm text-red-500",children:w.name.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"description",className:"text-sm leading-[1.33] font-normal",children:"Description (Optional)"}),e.jsx(H,{name:"description",control:C,render:({field:I})=>e.jsx(Ye,{id:"description",...I,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"Describe what happens in this frame",className:P(Cs,w.description&&"border-red-500")})}),w.description&&e.jsx("p",{className:"text-sm text-red-500",children:w.description.message})]}),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-normal",children:"Upload UI Screenshot/Design"}),e.jsx(H,{name:"imageFile",control:C,render:({field:I})=>f?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{type:"button",preset:"outline",onClick:()=>l.current?.click(),className:"h-10 px-4 text-sm",children:"Change File"}),e.jsx("span",{className:"text-sm font-medium text-[#F4F7FC]",children:c?.name}),e.jsx(k,{type:"button",preset:"ghost",size:"icon",onClick:()=>{I.onChange(null),g(null),l.current&&(l.current.value="")},className:"text-muted-foreground h-6 w-6 hover:text-red-500",children:e.jsx(tt,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"rounded-[16px] border border-[#2A3242] bg-transparent p-3",children:e.jsx("img",{src:f||"/placeholder.svg",alt:"Preview",className:"mx-auto block h-48 w-full rounded-[12px] border border-[#2A3242] object-contain"})})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{type:"button",preset:"outline",onClick:()=>l.current?.click(),className:"h-10 px-4 text-sm",children:"Choose File"}),e.jsx("span",{className:"text-muted-foreground text-sm",children:c?c.name:"No file chosen"}),e.jsx(et,{className:"text-muted-foreground h-4 w-4"}),e.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:j=>{if(j.target.files&&j.target.files[0]){I.onChange(j.target.files[0]);const A=new FileReader;A.onload=x=>{g(x.target?.result)},A.readAsDataURL(j.target.files[0])}},className:"hidden"})]})}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Tip: Use a clear, high-resolution image of the UI you want to document"}),w.imageFile&&e.jsx("p",{className:"text-sm text-red-500",children:w.imageFile.message})]})}),b&&e.jsx("p",{className:"text-sm text-red-500",children:b}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(k,{type:"button",preset:"outline",onClick:()=>i(!1),disabled:u,children:"Cancel"}),e.jsxs(k,{type:"submit",preset:"primary",disabled:u,children:[u&&e.jsx(U,{}),n]})]})]})})}const[Fs,je]=Xe(()=>{const t=O()?.id,{mapId:s}=xt(),n=Z(St,{variables:{orgId:t,id:s},fetchPolicy:"cache-and-network",skip:!t}),d=Z(ye,{variables:{orgId:t,mapId:s},fetchPolicy:"cache-and-network",skip:!t}),i=[{query:ye,variables:{orgId:t,mapId:s}}],[a,{loading:o}]=z(At,{awaitRefetchQueries:!0,refetchQueries:i}),[u,{loading:v}]=z(Mt,{awaitRefetchQueries:!0,refetchQueries:i}),[b,{loading:h}]=z(Et,{awaitRefetchQueries:!0,refetchQueries:i});return{loading:n.loading&&!n.data?.map,map:r.useMemo(()=>n.data?.map??null,[n.data?.map]),frames:r.useMemo(()=>X(d.data?.frames.items),[d.data?.frames.items]),mapId:s,createFrame:a,deleteFrame:u,updateFrame:b,isCreatingFrame:o,isFrameDeleting:v,isFrameUpdating:h}},{useChildrenProvider(t,s){return!s.loading&&s.map?t:e.jsxs(Ht,{crumbs:[{to:"/dashboard/maps",label:"Maps"}],children:[e.jsx(Gt,{title:"Frames",description:"Manage and organize all frames within this map. Create, edit, and collaborate on individual frames."}),s.loading&&e.jsx(xe,{}),!s.loading&&!s.map&&e.jsx("div",{className:"flex h-[400px] w-full items-center justify-center",children:e.jsx("p",{className:"text-gray-500",children:"No map found"})})]})}}),ks="h-[56px] rounded-[16px] border border-[#2A3242] bg-transparent px-6 focus:outline-none",Is="min-h-[80px] w-full resize-none rounded-[16px] border border-[#2A3242] bg-transparent px-6 py-4 text-sm focus:outline-none",Pe=["Frame details","Reposition points"];function Ps({open:t,onOpenChange:s,frame:n}){return e.jsx(Qt,{open:t,onOpenChange:s,className:"h-[100%]! min-h-[100%]! [--width:100%]",children:e.jsx(Ss,{frame:n,onOpenChange:s})})}function Ss({frame:t,onOpenChange:s}){const n=O()?.id,{mapId:d,updateFrame:i}=je(),[a,o]=r.useState(0),[u,v]=r.useState(t.name??""),[b,h]=r.useState(t.description??""),[f,g]=r.useState(null),[l,C]=r.useState(null),[F,y]=r.useState(null),[M,w]=r.useState(!1),[c,I]=r.useState(null),[j,A]=r.useState(null),[x,R]=r.useState({}),[B,$]=r.useState({}),G=r.useRef(null),q={orgId:n,mapId:d,frameId:t.id},K={skip:!n||!d},ae=Z(Oe,{fetchPolicy:"cache-and-network",variables:q,...K}),re=Z(Be,{fetchPolicy:"cache-and-network",variables:q,...K}),[oe]=z(Ge),[N]=z(Ue),E=X(ae.data?.focalPoints),D=X(re.data?.frameGroups),_=E.length+D.length,L=!!l&&_>0,ne=Object.keys(x).length+Object.keys(B).length;function ie(){R({}),$({}),A(null)}function dt(){g(null),C(null),y(null),ie(),G.current&&(G.current.value="")}function mt(p,m){return c?.type==="point"&&c.id===p?{x:c.x,y:c.y}:x[p]??m}function pt(p,m){return c?.type==="group"&&c.id===p?{x:c.x,y:c.y,width:c.width,height:c.height}:B[p]??m}function ut(p){if(!c)return;const m=p.currentTarget.getBoundingClientRect(),S=Dt(m.width,{x:p.clientX-m.left,y:Math.min(p.clientY-m.top,m.height)});if(c.type==="point"){I({...c,x:S.x,y:S.y});return}I({...c,x:Math.min(c.anchorX,S.x),y:Math.min(c.anchorY,S.y),width:Math.abs(S.x-c.anchorX),height:Math.abs(S.y-c.anchorY)})}function be(){c&&(c.type==="point"?R(p=>({...p,[c.id]:{x:c.x,y:c.y}})):c.width>0&&c.height>0&&$(p=>({...p,[c.id]:{x:c.x,y:c.y,width:c.width,height:c.height}})),I(null))}async function ve(){w(!0);try{const p=f?await _e(n,f):void 0;for(const[m,S]of Object.entries(x))await oe({variables:{...q,id:m,input:{locationX:S.x,locationY:S.y}}});for(const[m,S]of Object.entries(B))await N({variables:{...q,id:m,input:{locationX:S.x,locationY:S.y,width:S.width,height:S.height}}});await i({variables:{orgId:n,mapId:d,id:t.id,input:{name:u,description:b,screenshotAssetId:p}}}),s(!1)}catch{gt.error("Failed to save the frame")}finally{w(!1)}}return e.jsx(Wt,{_headerContent:e.jsxs(ge,{className:"border-stock flex min-h-18 w-full shrink-0 flex-row items-center gap-6 border-b px-6",children:[e.jsx(fe,{className:"shrink-0 text-left text-base font-medium",children:"Edit Frame"}),_>0&&e.jsx("ol",{className:"hidden min-w-0 flex-1 items-center gap-2 lg:flex",children:Pe.map((p,m)=>e.jsxs("li",{className:"flex min-w-0 items-center gap-2 last:flex-1",children:[e.jsx("span",{className:P("flex size-5 shrink-0 items-center justify-center rounded-full border text-[0.625rem] font-medium transition-colors",m<a&&"border-primary/40 bg-primary/10 text-primary",m===a&&"border-primary bg-primary text-white",m>a&&"border-stock text-paragraph/60"),children:m<a?e.jsx(Yt,{className:"size-3"}):m+1}),e.jsx("span",{className:P("truncate text-xs transition-colors",m<=a?"text-foreground":"text-paragraph/60"),children:p}),m<Pe.length-1&&e.jsx("span",{className:P("h-px min-w-3 flex-1 transition-colors",m<a?"bg-primary/30":"bg-stock")})]},p))}),e.jsx(Xt,{className:"ml-auto"})]}),_footerContent:e.jsx("footer",{className:"border-stock flex shrink-0 items-center justify-between gap-3 border-t px-6 py-4",children:a===0?e.jsxs(e.Fragment,{children:[e.jsx(Vt,{asChild:!0,children:e.jsx(k,{preset:"outline",disabled:M,children:"Cancel"})}),L?e.jsxs(k,{preset:"primary",disabled:!u,onClick:()=>o(1),children:["Continue",e.jsx(Tt,{})]}):e.jsxs(k,{preset:"primary",disabled:M||!u,onClick:ve,children:[M&&e.jsx(U,{}),"Save Changes"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(k,{preset:"outline",disabled:M,onClick:()=>o(0),children:[e.jsx(Ot,{}),"Back"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-paragraph/60 text-xs",children:ne===0?"Nothing repositioned yet":`${ne} repositioned`}),e.jsxs(k,{preset:"ghost",disabled:M||ne===0,onClick:ie,children:[e.jsx(Bt,{}),"Reset"]}),e.jsxs(k,{preset:"primary",disabled:M,onClick:ve,children:[M&&e.jsx(U,{}),"Save Changes"]})]})]})}),children:a===0?e.jsxs("div",{className:"mx-auto w-full max-w-xl space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name",className:"text-sm font-normal",children:"Frame Name"}),e.jsx(W,{id:"name",value:u,onChange:p=>v(p.target.value),autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"e.g. Checkout Flow",className:P(ks,!u&&"border-red-500")}),!u&&e.jsx("p",{className:"text-sm text-red-500",children:"Frame name is required"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"description",className:"text-sm font-normal",children:"Description (Optional)"}),e.jsx(Ye,{id:"description",value:b,onChange:p=>h(p.target.value),autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"Describe what happens in this frame",className:Is})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-normal",children:"Replace UI Screenshot/Design (Optional)"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{preset:"outline",onClick:()=>G.current?.click(),className:"h-10 px-4 text-sm",children:f?"Change File":"Choose File"}),e.jsx("span",{className:"text-paragraph/60 min-w-0 flex-1 truncate text-sm",children:f?f.name:"No file chosen"}),f?e.jsx(k,{preset:"ghost",size:"icon",onClick:dt,className:"text-paragraph/60 h-6 w-6 hover:text-red-500",children:e.jsx(tt,{className:"h-4 w-4"})}):e.jsx(et,{className:"text-paragraph/60 h-4 w-4"}),e.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:p=>{const m=p.target.files?.[0];if(!m)return;g(m),y(null),ie();const S=new FileReader;S.onload=le=>{C(le.target?.result)},S.readAsDataURL(m)},className:"hidden"})]}),l&&e.jsx("div",{className:"border-stock rounded-[16px] border p-3",children:e.jsx("img",{src:l,alt:"New frame preview",className:"mx-auto block h-48 w-full rounded-[12px] object-contain"})}),L&&e.jsxs("p",{className:"text-paragraph/60 text-xs",children:["This frame has ",_," focal points and groups. Continue to line them up with the new image."]})]})]}):e.jsx("div",{className:"flex h-full items-center justify-center select-none",children:e.jsx("div",{className:"h-full max-w-full",style:{aspectRatio:F??void 0},children:e.jsx($e,{frame:{...t,screenshotImageUrl:l},setCanvasSize:({width:p,height:m})=>y(p/m),onEmptyClick:()=>A(null),content:e.jsxs(e.Fragment,{children:[D.map(p=>{const m=pt(p.id,{x:p.locationX,y:p.locationY,width:p.width,height:p.height});return e.jsx(Ve,{frame:t,frameGroup:{...p,locationX:m.x,locationY:m.y,width:m.width,height:m.height},isSelected:j===p.id,contentSize:"md",onClick:()=>A(p.id),onResizePointerDown:S=>{const le=m.x+m.width,ht=m.y+m.height;I({type:"group",id:p.id,anchorX:S.endsWith("-left")?le:m.x,anchorY:S.startsWith("top-")?ht:m.y,x:m.x,y:m.y,width:m.width,height:m.height})}},p.id)}),E.map(p=>{const m=mt(p.id,{x:p.locationX,y:p.locationY});return e.jsx(Ze,{focalPoint:{...p,locationX:m.x,locationY:m.y},contentSize:"md",onPointerDown:()=>I({type:"point",id:p.id,x:m.x,y:m.y})},p.id)}),c&&e.jsx("div",{className:P("absolute inset-0 z-50",c.type==="point"&&"cursor-grabbing",c.type==="group"&&"cursor-crosshair"),onPointerMove:ut,onPointerUp:be,onPointerLeave:be})]})})})})})}function As({pages:t}){return t.length===0?e.jsx(Ae,{label:"No frames found"}):e.jsx("div",{className:"grid gap-6 pb-6",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:t.map(s=>e.jsx(Ms,{page:s},s.id))})}function Ms({page:t}){const{canWrite:s}=Y(),n=O()?.id,{mapId:d,deleteFrame:i,isFrameDeleting:a}=je(),[o,u]=r.useState(!1),[v,b]=r.useState(!1),[h,f]=r.useState(!1),[g,l]=r.useState(!0),[C,F]=r.useState(!1);function y(M){const{naturalWidth:w,naturalHeight:c}=M.currentTarget;c>0&&l(w/c<1.4)}return e.jsxs("div",{className:"group relative",children:[e.jsxs(Me,{to:`/dashboard/frame/${t.id}`,className:"relative block cursor-pointer overflow-hidden rounded-[1.4525rem] bg-[#141925] shadow-[0_1px_3px_rgba(0,0,0,0.3),0_1px_2px_rgba(0,0,0,0.2)] ring-1 ring-[#2A3242] transition-all duration-300 hover:shadow-[0_0_0_3px_rgba(1,90,235,0.25),0_8px_24px_rgba(0,0,0,0.4)] hover:ring-2 hover:ring-[#015AEB]",children:[e.jsxs("div",{className:P("relative aspect-[16/10] w-full transition-colors duration-300",t.screenshotImageUrl&&!C?"bg-[#1E2533] group-hover:bg-[#2A3242]":"bg-[#1E2533]"),children:[t.screenshotImageUrl&&!C?e.jsx("img",{alt:t.name??"Frame Image",src:t.screenshotImageUrl,onLoad:y,onError:()=>F(!0),className:P("h-full w-full",g?"object-cover object-top group-hover:object-bottom":"object-contain"),style:g?{transition:"object-position 2.5s ease-in-out"}:void 0}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-[#2A3242]",children:e.jsx(Qe,{className:"size-4 text-[#586378]"})}),e.jsx("span",{className:"text-[11px] font-medium text-[#586378]",children:"No preview available"})]}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-[#141925]/40 to-transparent"})]}),e.jsx("div",{className:"h-px bg-[#2A3242]"}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("h4",{className:"line-clamp-1 text-sm font-semibold text-[#F4F7FC]",children:t.name??e.jsx("span",{className:"text-[#586378]",children:"Untitled Frame"})}),e.jsxs("div",{className:"mt-2 flex min-h-[1.75rem] items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3 text-[#828DA3]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(rt,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"text-[11px]",children:t.createdAt?ot(new Date(t.createdAt),"dd MMM yyyy"):"N/A"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(is,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{className:"text-[11px]",children:[t.focalPointCount??0," focal points"]})]})]}),e.jsx(qt,{actor:t.updatedByActor??t.createdByActor,commitHash:t.updatedByActor?t.updatedByCommitHash:t.createdByCommitHash,className:"shrink-0"})]})]})]}),e.jsxs(Ee,{open:h,onOpenChange:f,children:[e.jsx(De,{asChild:!0,children:e.jsx(k,{size:"icon",variant:"ghost",className:P("absolute top-2 right-2 h-7 w-7 rounded-lg bg-[#1E2533]/80 opacity-0 shadow-sm backdrop-blur-sm transition-opacity group-hover:opacity-100 hover:bg-[#1E2533]",h&&"opacity-100"),children:e.jsx(Re,{className:"h-3.5 w-3.5 text-[#828DA3]"})})}),e.jsxs(Le,{align:"end",children:[e.jsx(te,{disabled:!s,onClick:()=>u(!0),children:"Edit"}),e.jsx(te,{variant:"destructive",disabled:!s,onClick:()=>b(!0),children:"Delete"})]})]}),e.jsx(Ps,{open:o,onOpenChange:u,frame:t}),e.jsxs(He,{open:v,onOpenChange:b,className:"!max-w-md",children:[e.jsxs(ge,{className:"p-6",children:[e.jsx(fe,{children:"Delete Frame?"}),e.jsx(st,{children:"Are you sure you want to delete this frame? This action cannot be undone."})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-0",children:[e.jsx(k,{variant:"outline",className:"h-11",onClick:()=>b(!1),children:"Cancel"}),e.jsxs(k,{variant:"destructive",className:"h-11",disabled:a,onClick:async()=>{await i({variables:{orgId:n,mapId:d,id:t.id}}),b(!1)},children:[a&&e.jsx(U,{}),"Delete"]})]})]})]})}function Es({viewMode:t,onViewModeChange:s}){return e.jsx("div",{className:"min-w-[160px] rounded-full bg-[#1E2533] p-1",children:e.jsxs("div",{className:"relative isolate grid grid-cols-2 rounded-[inherit]",children:[e.jsx("div",{className:P("absolute inset-y-0 left-0 z-0 h-full w-1/2 rounded-[inherit] bg-[#2A3242] shadow-sm transition-transform duration-300",t==="canvas"&&"translate-x-full")}),e.jsxs("button",{type:"button","aria-pressed":t==="grid",onClick:()=>s("grid"),className:P("relative z-10 flex h-8 flex-1 items-center justify-center rounded-[inherit] px-3 text-[#F4F7FC] transition-colors duration-200 focus:outline-none",t==="grid"?"":"text-[#828DA3] hover:text-[#F4F7FC]"),children:[e.jsx(ts,{className:"mr-1 h-4 w-4"}),"Grid"]}),e.jsxs("button",{type:"button","aria-pressed":t==="canvas",onClick:()=>s("canvas"),className:P("relative z-10 flex h-8 flex-1 items-center justify-center rounded-[inherit] px-3 text-[#F4F7FC] transition-colors duration-200 focus:outline-none",t==="canvas"?"":"text-[#828DA3] hover:text-[#F4F7FC]"),children:[e.jsx(os,{className:"mr-1 h-4 w-4"}),"Canvas"]})]})})}const ee=24;function Ds(){const[t,s]=Lt("viewMode"),n=O()?.id,{map:d,frames:i,mapId:a,createFrame:o}=je(),{canWrite:u}=Y(),[v,b]=r.useState(!1),[h,f]=Te(`${a}:screens:sort`,"order"),[g,l]=r.useState(""),C=ze(g),[F,y]=r.useState(0);r.useEffect(()=>{y(0)},[h,C]);const M=r.useMemo(()=>{let j=i;if(C){const A=C.toLowerCase();j=j.filter(x=>x.name?.toLowerCase().includes(A))}return h==="name"?j=[...j].sort((A,x)=>A.name.localeCompare(x.name)):h==="created"&&(j=[...j].sort((A,x)=>new Date(x.createdAt).getTime()-new Date(A.createdAt).getTime())),j},[i,C,h]),w=Math.ceil(M.length/ee),c=M.slice(F*ee,F*ee+ee),I=t.viewMode??"grid";return d?e.jsxs(We,{title:"Frames",description:"Manage and organize all frames within this map. Create, edit, and collaborate on individual frames.",crumbs:[{to:"/dashboard/maps",label:"Maps"},{to:"/dashboard/maps/"+d.id,label:d.name}],headerContent:e.jsxs(k,{disabled:!u,onClick:()=>b(!0),className:"h-11 rounded-[0.8rem]",children:[e.jsx(nt,{className:"h-4 w-4"}),"Add Frame"]}),children:[e.jsxs("div",{className:"flex h-full flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"flex-1 text-lg font-semibold text-gray-900",children:"All Frames"}),e.jsx("div",{className:"flex flex-1 justify-center",children:e.jsx(Es,{viewMode:I,onViewModeChange:j=>s({viewMode:j})})}),e.jsx("div",{className:"flex flex-1 items-center justify-end gap-3",children:I==="grid"&&e.jsxs(e.Fragment,{children:[e.jsx(W,{value:g,onChange:j=>l(j.target.value),placeholder:"Search frames...",className:"h-10 w-44 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none focus-visible:bg-[#1E2533]"}),e.jsxs(me,{value:h,onValueChange:f,children:[e.jsx(pe,{className:"h-10 w-36 shrink-0 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none",children:e.jsx(ue,{})}),e.jsxs(he,{children:[e.jsx(V,{value:"order",children:"Default order"}),e.jsx(V,{value:"created",children:"Newest"}),e.jsx(V,{value:"name",children:"Name"})]})]})]})})]}),I==="grid"&&e.jsxs(e.Fragment,{children:[e.jsx(As,{pages:c}),w>1&&e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsx(it,{currentPage:F+1,totalPages:w,setCurrentPage:j=>y(j-1)})})]}),I==="canvas"&&e.jsx(bs,{pages:i,project:d})]}),e.jsx(ws,{open:v,onOpenChange:b,title:"Add Frame",ctaLabel:"Add Frame",description:"Create a new frame for this map.",submitForm:async j=>{const A=j.imageFile?await _e(n,j.imageFile):void 0;await o({variables:{orgId:n,mapId:a,input:{name:j.name,description:j.description,templateType:j.profileId,screenshotAssetId:A}}}),b(!1)}})]}):null}function pr(){return e.jsx(Fs,{children:e.jsx(Ds,{})})}const Ls=at({name:Q().min(1,"Project name is required"),description:Q().optional(),serviceId:Q().optional()});function ct({submitForm:t,ctaLabel:s,withService:n,...d}){const[i,a]=r.useState(!1),[o,u]=r.useState(""),v=O()?.id,b=Z(Jt,{variables:{orgId:v,sortBy:"name",sortDir:"asc"},skip:!v||!n}),h=X(b.data?.services.items),{control:f,handleSubmit:g,reset:l,formState:{errors:C}}=Je({mode:"onChange",resolver:Ke(Ls),values:{...d.initialValues,name:d.initialValues?.name||""}});return r.useEffect(()=>{l()},[d.open,l]),e.jsx(qe,{...d,children:e.jsxs("form",{onSubmit:g(async F=>{if(n&&!F.serviceId){u("Choose the service whose repository stores this map");return}a(!0),u("");try{await t(F)}catch(y){u(y instanceof Error?y.message:"Something went wrong. Please try again.")}a(!1)}),className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name",className:"leding-[1.33] text-sm font-normal",children:"Map Name"}),e.jsx(H,{name:"name",control:f,render:({field:F})=>e.jsx(W,{id:"name",...F,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"e.g. Checkout Flow",className:P("h-[56px] rounded-[16px] border border-[#2A3242] bg-[#1E2533] px-6 focus:outline-none",C.name&&"border-red-500")})}),C.name&&e.jsx("p",{className:"text-sm text-red-500",children:C.name.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"description",children:"Description"}),e.jsx(H,{name:"description",control:f,render:({field:F})=>e.jsx(W,{id:"description",...F,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"Describe what this map represents",className:P("h-[56px] rounded-[16px] border border-[#2A3242] bg-[#1E2533] px-6 focus:outline-none",C.description&&"border-red-500")})}),C.description&&e.jsx("p",{className:"text-sm text-red-500",children:C.description.message})]}),n&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"service",children:"Service"}),e.jsx(H,{name:"serviceId",control:f,render:({field:F})=>e.jsxs(me,{value:F.value,onValueChange:F.onChange,children:[e.jsx(pe,{id:"service",className:"h-[56px]! w-full rounded-[16px] border border-[#2A3242] bg-[#1E2533] px-6 focus:outline-none",children:e.jsx(ue,{className:"text-sm leading-[1.33] font-normal text-[#828DA3]",placeholder:"Select the service that stores this map"})}),e.jsx(he,{children:h.map(y=>e.jsx(V,{value:y.id,children:y.name},y.id))})]})}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"The map is saved in this service's .uigraph.yaml"})]}),o&&e.jsx("p",{className:"text-sm text-red-500",children:o}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(k,{type:"button",variant:"outline",onClick:()=>d.onOpenChange(!1),disabled:i,className:"bg-shading text-paragraph border-stock h-11 rounded-[12.85px] text-sm leading-[1.33] font-normal",children:"Cancel"}),e.jsxs(k,{type:"submit",disabled:i,className:"h-11 rounded-[12.85px] bg-[#015AEB] text-sm leading-[1.33] font-normal hover:bg-blue-700",children:[i&&e.jsx(U,{}),s]})]})]})})}function _s({urls:t,name:s}){const[n,d]=r.useState(!1),[i,a]=r.useState(!0),o=t.filter(Boolean),u=o.length>0&&!n;function v(b){const{naturalWidth:h,naturalHeight:f}=b.currentTarget;f>0&&a(h/f<1.4)}return e.jsxs("div",{className:P("relative aspect-[16/10] w-full transition-colors duration-300",u?"bg-[#1E2533] group-hover:bg-[#252D3E]":"bg-[#1A2030]"),children:[u?o.length===1?e.jsx("img",{src:o[0],alt:s??"Map preview",onLoad:v,onError:()=>d(!0),className:P("h-full w-full",i?"object-cover object-top group-hover:object-bottom":"object-contain"),style:i?{transition:"object-position 2.5s ease-in-out"}:void 0}):e.jsx("div",{className:P("grid h-full w-full gap-px bg-[#2A3242]",o.length===2?"grid-cols-2":"grid-cols-2 grid-rows-2"),children:o.slice(0,4).map((b,h)=>e.jsx("img",{src:b,alt:`${s??"Map"} frame ${h+1}`,onError:()=>d(!0),className:"h-full w-full object-cover object-top"},`${b}-${h}`))}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-[#2A3242]/70",children:e.jsx(Qe,{className:"size-4 text-[#586378]"})}),e.jsx("span",{className:"text-[11px] font-medium text-[#586378]",children:"No images available"})]}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-[#141925]/40 to-transparent"})]})}function zs({projects:t}){return t.length===0?e.jsx(Ae,{label:"No maps found"}):e.jsx("div",{className:"grid gap-6 pb-4",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:t.map(s=>e.jsx(Rs,{project:s},s.id))})}function Rs({project:t}){const{canWrite:s}=Y(),n=O()?.id,[d,i]=r.useState(!1),[a,o]=r.useState(!1),[u,v]=r.useState(!1),[b]=z(_t,{refetchQueries:[se],awaitRefetchQueries:!0}),[h,{loading:f}]=z(zt,{refetchQueries:[se],awaitRefetchQueries:!0});return e.jsxs("div",{className:"group relative",children:[e.jsxs(Me,{to:`/dashboard/maps/${t.id}`,className:"relative block cursor-pointer overflow-hidden rounded-[1.4525rem] bg-[#141925] shadow-[0_1px_3px_rgba(0,0,0,0.3),0_1px_2px_rgba(0,0,0,0.2)] ring-1 ring-[#2A3242] transition-all duration-300 hover:shadow-[0_0_0_3px_rgba(1,90,235,0.25),0_8px_24px_rgba(0,0,0,0.4)] hover:ring-2 hover:ring-[#015AEB]",onDragStart:g=>g.preventDefault(),children:[e.jsx(_s,{urls:t.previewImgUrls??[],name:t.name}),e.jsx("div",{className:"h-px bg-[#2A3242]"}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("h4",{className:"line-clamp-1 text-sm font-semibold text-[#F4F7FC]",children:t.name??e.jsx("span",{className:"text-[#586378]",children:"Untitled Map"})}),e.jsx("div",{className:"mt-2 flex min-h-[1.75rem] items-center justify-between gap-2",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3 text-[#828DA3]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(rt,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"text-[11px]",children:t.createdAt?ot(t.createdAt,"dd MMM yyyy"):"N/A"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(as,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{className:"text-[11px]",children:[t.previewImgUrls?.filter(Boolean).length??0," screens"]})]})]})})]})]}),e.jsxs(Ee,{open:u,onOpenChange:v,children:[e.jsx(De,{asChild:!0,children:e.jsx(k,{size:"icon",variant:"ghost",className:P("absolute top-2 right-2 h-7 w-7 rounded-lg bg-[#1E2533]/80 opacity-0 shadow-sm backdrop-blur-sm transition-opacity group-hover:opacity-100 hover:bg-[#1E2533]",u&&"opacity-100"),children:e.jsx(Re,{className:"h-3.5 w-3.5 text-[#828DA3]"})})}),e.jsxs(Le,{align:"end",children:[e.jsx(te,{disabled:!s,onClick:()=>i(!0),children:"Edit"}),e.jsx(te,{variant:"destructive",disabled:!s,onClick:()=>o(!0),children:"Delete"})]})]}),e.jsx(ct,{title:"Edit Map",ctaLabel:"Update Map",description:"Customize your map details below.",open:d,onOpenChange:i,initialValues:{name:t?.name||"",description:t?.description||""},submitForm:async g=>{await b({variables:{orgId:n,id:t.id,input:{name:g.name,description:g.description||""}}}),i(!1)}}),e.jsxs(He,{open:a,onOpenChange:o,className:"!max-w-md",children:[e.jsxs(ge,{className:"p-6",children:[e.jsx(fe,{children:"Delete Map?"}),e.jsx(st,{children:"Are you sure you want to delete this map? This action cannot be undone."})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-0",children:[e.jsx(k,{variant:"outline",className:"h-11",onClick:()=>o(!1),children:"Cancel"}),e.jsxs(k,{variant:"destructive",className:"h-11",disabled:f,onClick:async()=>{await h({variables:{orgId:n,id:t.id}}),o(!1)},children:[f&&e.jsx(U,{}),"Delete"]})]})]})]})}const de=24;function Ts(){const t=O()?.id,[s,n]=Te("maps:sort","created"),[d,i]=r.useState(""),a=ze(d),[o,u]=r.useState(0),v=s==="name"?"asc":"desc";r.useEffect(()=>{u(0)},[s,a]);const b={orgId:t,search:a||null,sortBy:s,sortDir:v,limit:de,offset:o*de},{data:h,loading:f}=Z(se,{fetchPolicy:"cache-and-network",variables:b,skip:!t}),[g]=z(Rt,{awaitRefetchQueries:!0,refetchQueries:[se]});return{projectsLoading:f&&!h?.maps,projects:X(h?.maps.items),totalCount:h?.maps.totalCount??0,pageSize:de,page:o,setPage:u,sortBy:s,setSortBy:n,search:d,setSearch:i,createProject:g}}function ur(){const t=O()?.id,{projects:s,totalCount:n,pageSize:d,page:i,setPage:a,createProject:o,projectsLoading:u,sortBy:v,setSortBy:b,search:h,setSearch:f}=Ts(),{canWrite:g}=Y(),[l,C]=r.useState(!1),F=Math.ceil(n/d);return e.jsxs(We,{title:"System Maps",description:"End-to-end views of your product, flows, and services.",crumbs:[{to:"/dashboard/maps",label:"Maps"}],headerContent:e.jsxs(k,{disabled:!g,onClick:()=>C(!0),className:"h-11 rounded-[0.8rem]",children:[e.jsx(nt,{className:"h-4 w-4"}),"Create Map"]}),children:[e.jsxs("div",{className:"mb-6 flex flex-wrap items-center gap-3",children:[e.jsx(W,{value:h,onChange:y=>f(y.target.value),placeholder:"Search maps...",className:"h-10 w-52 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none focus-visible:bg-[#1E2533]"}),e.jsxs(me,{value:v,onValueChange:b,children:[e.jsx(pe,{className:"h-10 w-40 shrink-0 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none",children:e.jsx(ue,{})}),e.jsxs(he,{children:[e.jsx(V,{value:"created",children:"Newest"}),e.jsx(V,{value:"updated",children:"Recently updated"}),e.jsx(V,{value:"name",children:"Name"})]})]})]}),u?e.jsx(xe,{}):e.jsxs(e.Fragment,{children:[e.jsx(zs,{projects:s}),F>1&&e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsx(it,{currentPage:i+1,totalPages:F,setCurrentPage:y=>a(y-1)})})]}),e.jsx(ct,{title:"Create Map",ctaLabel:"Create Map",withService:!0,description:"Create a new map to visualize flows, services, and architecture.",open:l,onOpenChange:C,submitForm:async y=>{await o({variables:{orgId:t,input:{name:y.name,description:y.description||"",serviceId:y.serviceId}}}),C(!1)}})]})}export{pr as DashboardProjectPage,ur as DashboardProjects};
50
+ `),[xs,lt]=We(({pages:t,project:s})=>{const n=ft(),[d,i]=r.useState(0),a=O()?.id,o=s.id,u=Z(ke,{variables:{orgId:a,mapId:o},skip:!a||!o}),[v,b]=z(hs,{awaitRefetchQueries:!0,refetchQueries:[{query:ke,variables:{orgId:a,mapId:o}}]}),[h,f]=r.useState([]),[g,l]=r.useState([]),[C,F]=r.useState([]),[y,M]=r.useState([]),N=r.useCallback(async()=>{if(!a||!o)return;const w=await Promise.all(t.map(L=>Promise.all([ce.query({query:ze,variables:{orgId:a,mapId:o,frameId:L.id},fetchPolicy:"network-only"}),ce.query({query:Re,variables:{orgId:a,mapId:o,frameId:L.id},fetchPolicy:"network-only"}),ce.query({query:jt,variables:{orgId:a,mapId:o,frameId:L.id},fetchPolicy:"network-only"})]))),E=w.flatMap(([L])=>L.data?.focalPoints??[]),D=w.flatMap(([,L])=>L.data?.frameGroups??[]),_=w.flatMap(([,,L])=>L.data?.frameLinks??[]);f(E),l(D),F(_.filter(L=>L.kind==="frame")),M(_.filter(L=>L.kind==="map"))},[t,a,o]);r.useEffect(()=>{N().catch(console.error)},[N]);const c=r.useMemo(()=>{const w=u.data?.canvas?.framePositions;if(!w)return[];try{const E=JSON.parse(w);return Object.entries(E).map(([D,_])=>({pageId:D,position:_}))}catch{return[]}},[u.data?.canvas?.framePositions]),I=n.focalPoint,j=r.useMemo(()=>h.find(w=>w.id===I),[h,I]),A=n.frameGroup,x=r.useMemo(()=>g.find(w=>w.id===A),[g,A]),[R,B]=z(Te),[$,G]=z(bt),[Q,K]=z(Oe),[ae,re]=z(vt),oe=r.useMemo(()=>!x||h.length===0?[]:h.filter(w=>yt({x:x.locationX,y:x.locationY,width:x.width,height:x.height},{x:w.locationX,y:w.locationY})),[h,x]);return{zoom:d,setZoom:i,isCreatePageCanvasLoading:b.loading,async createPageCanvas(w,E){const D=Object.fromEntries(E.map(_=>[_.pageId,_.position]));return v({variables:{orgId:a,mapId:o,input:{zoom:w,framePositions:JSON.stringify(D)}}})},isPageCanvasLoading:u.loading,pageCanvasZoom:u.data?.canvas?.zoom,pageCanvasItems:c,pages:t,project:s,canvasTarget:n,focalPoints:h,pageLinks:C,frameGroups:g,projectLinks:y,selectedFocalPoint:j,selectedFrameGroup:x,selectedFrameGroupPoints:oe,isUpdateFocalPointLoading:B.loading,async updateFocalPoint(w,E){const D=h.find(_=>_.id===w);await R({variables:{orgId:a,mapId:o,frameId:D?.frameId??"",id:w,input:E}}),await N()},isDeleteFocalPointLoading:G.loading,async deleteFocalPoint(w){const E=h.find(D=>D.id===w);await $({variables:{orgId:a,mapId:o,frameId:E?.frameId??"",id:w}}),await N()},isUpdateFrameGroupLoading:K.loading,async updateFrameGroup(w,E){const D=g.find(_=>_.id===w);await Q({variables:{orgId:a,mapId:o,frameId:D?.frameId??"",id:w,input:E}}),await N()},isDeleteFrameGroupLoading:re.loading,async deleteFrameGroup(w){const E=g.find(D=>D.id===w);await ae({variables:{orgId:a,mapId:o,frameId:E?.frameId??"",id:w}}),await N()}}},{useChildrenProvider(t,s){return s.isPageCanvasLoading?e.jsx(xe,{}):t}});function Ie(t){return t.sort((s,n)=>s.id.localeCompare(n.id)).map(s=>`${s.id}@${s.position.x}@${s.position.y}`).join("|")}function gs(t,s){const n=Ie(t),d=Ie(s);return n===d}function fs({id:t}){const{pages:s,canvasTarget:n,focalPoints:d,frameGroups:i,pageLinks:a,projectLinks:o,selectedFrameGroup:u}=lt(),v=r.useMemo(()=>s.find(l=>l.id===t),[s,t]),b=r.useMemo(()=>d.filter(l=>l.frameId===t),[d,t]),h=r.useMemo(()=>i.filter(l=>l.frameId===t),[i,t]),f=r.useMemo(()=>a.filter(l=>l.frameId===t),[a,t]),g=r.useMemo(()=>o.filter(l=>l.frameId===t),[o,t]);return v?e.jsx("div",{className:"w-[400px] overflow-hidden rounded-md bg-white shadow-sm",children:e.jsx(Be,{frame:v,onEmptyClick:()=>{n.clearTarget()},content:e.jsxs(e.Fragment,{children:[h.map(l=>e.jsx(Ge,{frame:v,frameGroup:l,contentSize:"sm",isSelected:u?.id===l.id,onClick:()=>{n.setTarget("group",l.id)}},l.id)),f.map(l=>e.jsx(Ct,{pageLink:l,contentSize:"sm",deletePageLink:async()=>Promise.resolve(),updatePageLink:async()=>Promise.resolve()},l.id)),g.map(l=>e.jsx(wt,{projectLink:l,contentSize:"sm",deleteProjectLink:async()=>Promise.resolve(),updateProjectLink:async()=>Promise.resolve()},l.id)),b.map(l=>e.jsx(Ue,{focalPoint:l,contentSize:"sm",onClick:()=>{n.setTarget("point",l.id)}},l.id))]})})}):null}const js={image:fs};function bs({...t}){return e.jsx(xs,{...t,children:e.jsx(vs,{})})}function vs(){const{canWrite:t}=Y(),[s,n]=r.useState(null),{zoom:d,setZoom:i,pageCanvasZoom:a,pages:o,project:u,pageCanvasItems:v,createPageCanvas:b,isCreatePageCanvasLoading:h,selectedFocalPoint:f,selectedFrameGroup:g,selectedFrameGroupPoints:l,updateFocalPoint:C,deleteFocalPoint:F,updateFrameGroup:y,deleteFrameGroup:M}=lt();r.useEffect(()=>{!s||!a||s.getZoom()===a||(i(a),s.fitView({maxZoom:a,minZoom:a,interpolate:"linear",duration:0}))},[i,a,s]);const N=r.useMemo(()=>{const x=X(v);return o.map((R,B)=>{const $=x.find(G=>G.pageId===R.id);return{type:"image",id:R.id,position:{y:x.length?$?.position?.y??0:Fe,x:x.length?$?.position?.x??0:us*B+(B+1)*Fe},data:{}}})},[o,v]),[c,I]=r.useState(N),j=r.useMemo(()=>gs(c,N)&&d===a,[c,N,d,a]),A=!!(f||g);return e.jsxs("div",{className:P("grid h-full transition-[grid-template-columns,gap]",A?"grid-cols-[1fr_27.25rem] gap-2":"grid-cols-[1fr_0] gap-0"),children:[e.jsxs("div",{className:"bg-shading-gray relative isolate size-full flex-1 overflow-hidden rounded-3xl border border-[#2A3242]",children:[e.jsx(Gt,{nodes:c,nodeTypes:js,onNodesChange:x=>{I(R=>Ut(x,R))},className:P("absolute inset-0 size-full opacity-0",s&&"opacity-100"),minZoom:.2,onInit:async x=>{await x.fitView({maxZoom:1}),i(x.getZoom()),n(x)},onWheelCapture:()=>{s&&i(s.getZoom())}}),e.jsx(ps,{zoom:d,onZoomIn:async()=>{s&&(await s.zoomIn(),i(s.getZoom()))},onZoomOut:async()=>{s&&(await s.zoomOut(),i(s.getZoom()))},isSaveLayoutDisabled:j||!t,isResetLayoutDisabled:j,onResetLayout:()=>I(N),isSaveLayoutLoading:h,onSaveLayout:async()=>{s&&await b(s.getZoom(),c.map(x=>({pageId:x.id,position:x.position})))}})]}),!g&&f&&e.jsx("div",{className:"mt-[-66px]",children:e.jsx(Ce,{className:"border-stock h-full w-[27.25rem] rounded-[0.75rem] border border-[#2A3242] bg-[#141925]",children:e.jsx(Nt,{focalPoint:f,mapId:u.id,children:e.jsx(Ft,{focalPoint:f,updateFocalPoint:async(x,R)=>{await C(x,R)},deleteFocalPoint:async x=>{await F(x)}})})})}),!f&&g&&e.jsx("div",{className:"mt-[-66px]",children:e.jsx(Ce,{className:"border-stock h-full w-[27.25rem] rounded-[0.75rem] border border-[#2A3242] bg-[#141925]",children:e.jsx(kt,{frame:o.find(x=>x.id===g.frameId),frameGroup:g,frameGroupPoints:l,updateFrameGroup:async x=>{await y(g.id,x)},deleteFrameGroup:async()=>{await M(g.id)}})})})]})}const ys="h-[56px] rounded-[16px] border border-[#2A3242] bg-transparent px-6 focus:outline-none",Cs="min-h-[80px] w-full resize-none rounded-[16px] border border-[#2A3242] bg-transparent px-6 py-4 text-sm focus:outline-none",ws=st({name:H().min(1,"Page name is required"),description:H().optional(),profileId:H().optional().default("default"),imageFile:Vt(t=>t instanceof File&&t!==null,{message:"UI screenshot/design is required"})});function Ns({title:t,description:s,ctaLabel:n,open:d,onOpenChange:i,initialValues:a,submitForm:o}){const[u,v]=r.useState(!1),[b,h]=r.useState(""),[f,g]=r.useState(null),l=r.useRef(null),{control:C,handleSubmit:F,reset:y,watch:M,formState:{errors:N}}=Ye({mode:"onChange",resolver:Je(ws),values:{name:a?.name||"",description:a?.description||"",profileId:a?.profileId||"default",imageFile:a?.imageFile||null}}),c=M("imageFile");return r.useEffect(()=>{y(),g(null),l.current&&(l.current.value="")},[d,y]),e.jsx($e,{open:d,onOpenChange:i,title:t,description:s,children:e.jsxs("form",{onSubmit:F(async I=>{v(!0),h("");try{const j=I;await o({name:j.name,description:j.description,profileId:j.profileId,imageFile:j.imageFile??null})}catch{h("Something went wrong. Please try again.")}v(!1)}),className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name",className:"leding-[1.33] text-sm font-normal",children:"Frame Name"}),e.jsx(q,{name:"name",control:C,render:({field:I})=>e.jsx(W,{id:"name",...I,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"e.g. Checkout Flow",className:P(ys,N.name&&"border-red-500")})}),N.name&&e.jsx("p",{className:"text-sm text-red-500",children:N.name.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"description",className:"text-sm leading-[1.33] font-normal",children:"Description (Optional)"}),e.jsx(q,{name:"description",control:C,render:({field:I})=>e.jsx(Xe,{id:"description",...I,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"Describe what happens in this frame",className:P(Cs,N.description&&"border-red-500")})}),N.description&&e.jsx("p",{className:"text-sm text-red-500",children:N.description.message})]}),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-normal",children:"Upload UI Screenshot/Design"}),e.jsx(q,{name:"imageFile",control:C,render:({field:I})=>f?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{type:"button",preset:"outline",onClick:()=>l.current?.click(),className:"h-10 px-4 text-sm",children:"Change File"}),e.jsx("span",{className:"text-sm font-medium text-[#F4F7FC]",children:c?.name}),e.jsx(k,{type:"button",preset:"ghost",size:"icon",onClick:()=>{I.onChange(null),g(null),l.current&&(l.current.value="")},className:"text-muted-foreground h-6 w-6 hover:text-red-500",children:e.jsx(et,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"rounded-[16px] border border-[#2A3242] bg-transparent p-3",children:e.jsx("img",{src:f||"/placeholder.svg",alt:"Preview",className:"mx-auto block h-48 w-full rounded-[12px] border border-[#2A3242] object-contain"})})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{type:"button",preset:"outline",onClick:()=>l.current?.click(),className:"h-10 px-4 text-sm",children:"Choose File"}),e.jsx("span",{className:"text-muted-foreground text-sm",children:c?c.name:"No file chosen"}),e.jsx(Ke,{className:"text-muted-foreground h-4 w-4"}),e.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:j=>{if(j.target.files&&j.target.files[0]){I.onChange(j.target.files[0]);const A=new FileReader;A.onload=x=>{g(x.target?.result)},A.readAsDataURL(j.target.files[0])}},className:"hidden"})]})}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Tip: Use a clear, high-resolution image of the UI you want to document"}),N.imageFile&&e.jsx("p",{className:"text-sm text-red-500",children:N.imageFile.message})]})}),b&&e.jsx("p",{className:"text-sm text-red-500",children:b}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(k,{type:"button",preset:"outline",onClick:()=>i(!1),disabled:u,children:"Cancel"}),e.jsxs(k,{type:"submit",preset:"primary",disabled:u,children:[u&&e.jsx(U,{}),n]})]})]})})}const[Fs,je]=We(()=>{const t=O()?.id,{mapId:s}=Bt(),n=Z(It,{variables:{orgId:t,id:s},fetchPolicy:"cache-and-network",skip:!t}),d=Z(ye,{variables:{orgId:t,mapId:s},fetchPolicy:"cache-and-network",skip:!t}),i=[{query:ye,variables:{orgId:t,mapId:s}}],[a,{loading:o}]=z(Pt,{awaitRefetchQueries:!0,refetchQueries:i}),[u,{loading:v}]=z(St,{awaitRefetchQueries:!0,refetchQueries:i}),[b,{loading:h}]=z(At,{awaitRefetchQueries:!0,refetchQueries:i});return{loading:n.loading&&!n.data?.map,map:r.useMemo(()=>n.data?.map??null,[n.data?.map]),frames:r.useMemo(()=>X(d.data?.frames.items),[d.data?.frames.items]),mapId:s,createFrame:a,deleteFrame:u,updateFrame:b,isCreatingFrame:o,isFrameDeleting:v,isFrameUpdating:h}},{useChildrenProvider(t,s){return!s.loading&&s.map?t:e.jsxs(Qt,{crumbs:[{to:"/dashboard/maps",label:"Maps"}],children:[e.jsx(Ot,{title:"Frames",description:"Manage and organize all frames within this map. Create, edit, and collaborate on individual frames."}),s.loading&&e.jsx(xe,{}),!s.loading&&!s.map&&e.jsx("div",{className:"flex h-[400px] w-full items-center justify-center",children:e.jsx("p",{className:"text-gray-500",children:"No map found"})})]})}}),ks="h-[56px] rounded-[16px] border border-[#2A3242] bg-transparent px-6 focus:outline-none",Is="min-h-[80px] w-full resize-none rounded-[16px] border border-[#2A3242] bg-transparent px-6 py-4 text-sm focus:outline-none",Pe=["Frame details","Reposition points"];function Ps({open:t,onOpenChange:s,frame:n}){return e.jsx(qt,{open:t,onOpenChange:s,className:"h-[100%]! min-h-[100%]! [--width:100%]",children:e.jsx(Ss,{frame:n,onOpenChange:s})})}function Ss({frame:t,onOpenChange:s}){const n=O()?.id,{mapId:d,updateFrame:i}=je(),[a,o]=r.useState(0),[u,v]=r.useState(t.name??""),[b,h]=r.useState(t.description??""),[f,g]=r.useState(null),[l,C]=r.useState(null),[F,y]=r.useState(null),[M,N]=r.useState(!1),[c,I]=r.useState(null),[j,A]=r.useState(null),[x,R]=r.useState({}),[B,$]=r.useState({}),G=r.useRef(null),Q={orgId:n,mapId:d,frameId:t.id},K={skip:!n||!d},ae=Z(ze,{fetchPolicy:"cache-and-network",variables:Q,...K}),re=Z(Re,{fetchPolicy:"cache-and-network",variables:Q,...K}),[oe]=z(Te),[w]=z(Oe),E=X(ae.data?.focalPoints),D=X(re.data?.frameGroups),_=E.length+D.length,L=!!l&&_>0,ne=Object.keys(x).length+Object.keys(B).length;function ie(){R({}),$({}),A(null)}function dt(){g(null),C(null),y(null),ie(),G.current&&(G.current.value="")}function mt(p,m){return c?.type==="point"&&c.id===p?{x:c.x,y:c.y}:x[p]??m}function pt(p,m){return c?.type==="group"&&c.id===p?{x:c.x,y:c.y,width:c.width,height:c.height}:B[p]??m}function ut(p){if(!c)return;const m=p.currentTarget.getBoundingClientRect(),S=Mt(m.width,{x:p.clientX-m.left,y:Math.min(p.clientY-m.top,m.height)});if(c.type==="point"){I({...c,x:S.x,y:S.y});return}I({...c,x:Math.min(c.anchorX,S.x),y:Math.min(c.anchorY,S.y),width:Math.abs(S.x-c.anchorX),height:Math.abs(S.y-c.anchorY)})}function be(){c&&(c.type==="point"?R(p=>({...p,[c.id]:{x:c.x,y:c.y}})):c.width>0&&c.height>0&&$(p=>({...p,[c.id]:{x:c.x,y:c.y,width:c.width,height:c.height}})),I(null))}async function ve(){N(!0);try{const p=f?await Ee(n,f):void 0;for(const[m,S]of Object.entries(x))await oe({variables:{...Q,id:m,input:{locationX:S.x,locationY:S.y}}});for(const[m,S]of Object.entries(B))await w({variables:{...Q,id:m,input:{locationX:S.x,locationY:S.y,width:S.width,height:S.height}}});await i({variables:{orgId:n,mapId:d,id:t.id,input:{name:u,description:b,screenshotAssetId:p}}}),s(!1)}catch{Xt.error("Failed to save the frame")}finally{N(!1)}}return e.jsx(Ht,{_headerContent:e.jsxs(ge,{className:"border-stock flex min-h-18 w-full shrink-0 flex-row items-center gap-6 border-b px-6",children:[e.jsx(fe,{className:"shrink-0 text-left text-base font-medium",children:"Edit Frame"}),_>0&&e.jsx("ol",{className:"hidden min-w-0 flex-1 items-center gap-2 lg:flex",children:Pe.map((p,m)=>e.jsxs("li",{className:"flex min-w-0 items-center gap-2 last:flex-1",children:[e.jsx("span",{className:P("flex size-5 shrink-0 items-center justify-center rounded-full border text-[0.625rem] font-medium transition-colors",m<a&&"border-primary/40 bg-primary/10 text-primary",m===a&&"border-primary bg-primary text-white",m>a&&"border-stock text-paragraph/60"),children:m<a?e.jsx(Yt,{className:"size-3"}):m+1}),e.jsx("span",{className:P("truncate text-xs transition-colors",m<=a?"text-foreground":"text-paragraph/60"),children:p}),m<Pe.length-1&&e.jsx("span",{className:P("h-px min-w-3 flex-1 transition-colors",m<a?"bg-primary/30":"bg-stock")})]},p))}),e.jsx(Wt,{className:"ml-auto"})]}),_footerContent:e.jsx("footer",{className:"border-stock flex shrink-0 items-center justify-between gap-3 border-t px-6 py-4",children:a===0?e.jsxs(e.Fragment,{children:[e.jsx($t,{asChild:!0,children:e.jsx(k,{preset:"outline",disabled:M,children:"Cancel"})}),L?e.jsxs(k,{preset:"primary",disabled:!u,onClick:()=>o(1),children:["Continue",e.jsx(zt,{})]}):e.jsxs(k,{preset:"primary",disabled:M||!u,onClick:ve,children:[M&&e.jsx(U,{}),"Save Changes"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(k,{preset:"outline",disabled:M,onClick:()=>o(0),children:[e.jsx(Rt,{}),"Back"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-paragraph/60 text-xs",children:ne===0?"Nothing repositioned yet":`${ne} repositioned`}),e.jsxs(k,{preset:"ghost",disabled:M||ne===0,onClick:ie,children:[e.jsx(Tt,{}),"Reset"]}),e.jsxs(k,{preset:"primary",disabled:M,onClick:ve,children:[M&&e.jsx(U,{}),"Save Changes"]})]})]})}),children:a===0?e.jsxs("div",{className:"mx-auto w-full max-w-xl space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name",className:"text-sm font-normal",children:"Frame Name"}),e.jsx(W,{id:"name",value:u,onChange:p=>v(p.target.value),autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"e.g. Checkout Flow",className:P(ks,!u&&"border-red-500")}),!u&&e.jsx("p",{className:"text-sm text-red-500",children:"Frame name is required"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"description",className:"text-sm font-normal",children:"Description (Optional)"}),e.jsx(Xe,{id:"description",value:b,onChange:p=>h(p.target.value),autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"Describe what happens in this frame",className:Is})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-normal",children:"Replace UI Screenshot/Design (Optional)"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{preset:"outline",onClick:()=>G.current?.click(),className:"h-10 px-4 text-sm",children:f?"Change File":"Choose File"}),e.jsx("span",{className:"text-paragraph/60 min-w-0 flex-1 truncate text-sm",children:f?f.name:"No file chosen"}),f?e.jsx(k,{preset:"ghost",size:"icon",onClick:dt,className:"text-paragraph/60 h-6 w-6 hover:text-red-500",children:e.jsx(et,{className:"h-4 w-4"})}):e.jsx(Ke,{className:"text-paragraph/60 h-4 w-4"}),e.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:p=>{const m=p.target.files?.[0];if(!m)return;g(m),y(null),ie();const S=new FileReader;S.onload=le=>{C(le.target?.result)},S.readAsDataURL(m)},className:"hidden"})]}),l&&e.jsx("div",{className:"border-stock rounded-[16px] border p-3",children:e.jsx("img",{src:l,alt:"New frame preview",className:"mx-auto block h-48 w-full rounded-[12px] object-contain"})}),L&&e.jsxs("p",{className:"text-paragraph/60 text-xs",children:["This frame has ",_," focal points and groups. Continue to line them up with the new image."]})]})]}):e.jsx("div",{className:"flex h-full items-center justify-center select-none",children:e.jsx("div",{className:"h-full max-w-full",style:{aspectRatio:F??void 0},children:e.jsx(Be,{frame:{...t,screenshotImageUrl:l},setCanvasSize:({width:p,height:m})=>y(p/m),onEmptyClick:()=>A(null),content:e.jsxs(e.Fragment,{children:[D.map(p=>{const m=pt(p.id,{x:p.locationX,y:p.locationY,width:p.width,height:p.height});return e.jsx(Ge,{frame:t,frameGroup:{...p,locationX:m.x,locationY:m.y,width:m.width,height:m.height},isSelected:j===p.id,contentSize:"md",onClick:()=>A(p.id),onResizePointerDown:S=>{const le=m.x+m.width,ht=m.y+m.height;I({type:"group",id:p.id,anchorX:S.endsWith("-left")?le:m.x,anchorY:S.startsWith("top-")?ht:m.y,x:m.x,y:m.y,width:m.width,height:m.height})}},p.id)}),E.map(p=>{const m=mt(p.id,{x:p.locationX,y:p.locationY});return e.jsx(Ue,{focalPoint:{...p,locationX:m.x,locationY:m.y},contentSize:"md",onPointerDown:()=>I({type:"point",id:p.id,x:m.x,y:m.y})},p.id)}),c&&e.jsx("div",{className:P("absolute inset-0 z-50",c.type==="point"&&"cursor-grabbing",c.type==="group"&&"cursor-crosshair"),onPointerMove:ut,onPointerUp:be,onPointerLeave:be})]})})})})})}function As({pages:t}){return t.length===0?e.jsx(at,{label:"No frames found"}):e.jsx("div",{className:"grid gap-6 pb-6",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:t.map(s=>e.jsx(Ms,{page:s},s.id))})}function Ms({page:t}){const{canWrite:s}=Y(),n=O()?.id,{mapId:d,deleteFrame:i,isFrameDeleting:a}=je(),[o,u]=r.useState(!1),[v,b]=r.useState(!1),[h,f]=r.useState(!1),[g,l]=r.useState(!0),[C,F]=r.useState(!1);function y(M){const{naturalWidth:N,naturalHeight:c}=M.currentTarget;c>0&&l(N/c<1.4)}return e.jsxs("div",{className:"group relative",children:[e.jsxs(qe,{to:`/dashboard/frame/${t.id}`,className:"relative block cursor-pointer overflow-hidden rounded-[1.4525rem] bg-[#141925] shadow-[0_1px_3px_rgba(0,0,0,0.3),0_1px_2px_rgba(0,0,0,0.2)] ring-1 ring-[#2A3242] transition-all duration-300 hover:shadow-[0_0_0_3px_rgba(1,90,235,0.25),0_8px_24px_rgba(0,0,0,0.4)] hover:ring-2 hover:ring-[#015AEB]",children:[e.jsxs("div",{className:P("relative aspect-[16/10] w-full transition-colors duration-300",t.screenshotImageUrl&&!C?"bg-[#1E2533] group-hover:bg-[#2A3242]":"bg-[#1E2533]"),children:[t.screenshotImageUrl&&!C?e.jsx("img",{alt:t.name??"Frame Image",src:t.screenshotImageUrl,onLoad:y,onError:()=>F(!0),className:P("h-full w-full",g?"object-cover object-top group-hover:object-bottom":"object-contain"),style:g?{transition:"object-position 2.5s ease-in-out"}:void 0}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-[#2A3242]",children:e.jsx(Ze,{className:"size-4 text-[#586378]"})}),e.jsx("span",{className:"text-[11px] font-medium text-[#586378]",children:"No preview available"})]}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-[#141925]/40 to-transparent"})]}),e.jsx("div",{className:"h-px bg-[#2A3242]"}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("h4",{className:"line-clamp-1 text-sm font-semibold text-[#F4F7FC]",children:t.name??e.jsx("span",{className:"text-[#586378]",children:"Untitled Frame"})}),e.jsxs("div",{className:"mt-2 flex min-h-[1.75rem] items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3 text-[#828DA3]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(rt,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"text-[11px]",children:t.createdAt?ot(new Date(t.createdAt),"dd MMM yyyy"):"N/A"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(is,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{className:"text-[11px]",children:[t.focalPointCount??0," focal points"]})]})]}),e.jsx(Zt,{actor:t.updatedByActor??t.createdByActor,commitHash:t.updatedByActor?t.updatedByCommitHash:t.createdByCommitHash,className:"shrink-0"})]})]})]}),e.jsxs(Se,{open:h,onOpenChange:f,children:[e.jsx(Ae,{asChild:!0,children:e.jsx(k,{size:"icon",variant:"ghost",className:P("absolute top-2 right-2 h-7 w-7 rounded-lg bg-[#1E2533]/80 opacity-0 shadow-sm backdrop-blur-sm transition-opacity group-hover:opacity-100 hover:bg-[#1E2533]",h&&"opacity-100"),children:e.jsx(Le,{className:"h-3.5 w-3.5 text-[#828DA3]"})})}),e.jsxs(Me,{align:"end",children:[e.jsx(te,{disabled:!s,onClick:()=>u(!0),children:"Edit"}),e.jsx(te,{variant:"destructive",disabled:!s,onClick:()=>b(!0),children:"Delete"})]})]}),e.jsx(Ps,{open:o,onOpenChange:u,frame:t}),e.jsxs(Ve,{open:v,onOpenChange:b,className:"!max-w-md",children:[e.jsxs(ge,{className:"p-6",children:[e.jsx(fe,{children:"Delete Frame?"}),e.jsx(tt,{children:"Are you sure you want to delete this frame? This action cannot be undone."})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-0",children:[e.jsx(k,{variant:"outline",className:"h-11",onClick:()=>b(!1),children:"Cancel"}),e.jsxs(k,{variant:"destructive",className:"h-11",disabled:a,onClick:async()=>{await i({variables:{orgId:n,mapId:d,id:t.id}}),b(!1)},children:[a&&e.jsx(U,{}),"Delete"]})]})]})]})}function Es({viewMode:t,onViewModeChange:s}){return e.jsx("div",{className:"min-w-[160px] rounded-full bg-[#1E2533] p-1",children:e.jsxs("div",{className:"relative isolate grid grid-cols-2 rounded-[inherit]",children:[e.jsx("div",{className:P("absolute inset-y-0 left-0 z-0 h-full w-1/2 rounded-[inherit] bg-[#2A3242] shadow-sm transition-transform duration-300",t==="canvas"&&"translate-x-full")}),e.jsxs("button",{type:"button","aria-pressed":t==="grid",onClick:()=>s("grid"),className:P("relative z-10 flex h-8 flex-1 items-center justify-center rounded-[inherit] px-3 text-[#F4F7FC] transition-colors duration-200 focus:outline-none",t==="grid"?"":"text-[#828DA3] hover:text-[#F4F7FC]"),children:[e.jsx(ts,{className:"mr-1 h-4 w-4"}),"Grid"]}),e.jsxs("button",{type:"button","aria-pressed":t==="canvas",onClick:()=>s("canvas"),className:P("relative z-10 flex h-8 flex-1 items-center justify-center rounded-[inherit] px-3 text-[#F4F7FC] transition-colors duration-200 focus:outline-none",t==="canvas"?"":"text-[#828DA3] hover:text-[#F4F7FC]"),children:[e.jsx(os,{className:"mr-1 h-4 w-4"}),"Canvas"]})]})})}const ee=24;function Ds(){const[t,s]=Et("viewMode"),n=O()?.id,{map:d,frames:i,mapId:a,createFrame:o}=je(),{canWrite:u}=Y(),[v,b]=r.useState(!1),[h,f]=_e(`${a}:screens:sort`,"order"),[g,l]=r.useState(""),C=De(g),[F,y]=r.useState(0);r.useEffect(()=>{y(0)},[h,C]);const M=r.useMemo(()=>{let j=i;if(C){const A=C.toLowerCase();j=j.filter(x=>x.name?.toLowerCase().includes(A))}return h==="name"?j=[...j].sort((A,x)=>A.name.localeCompare(x.name)):h==="created"&&(j=[...j].sort((A,x)=>new Date(x.createdAt).getTime()-new Date(A.createdAt).getTime())),j},[i,C,h]),N=Math.ceil(M.length/ee),c=M.slice(F*ee,F*ee+ee),I=t.viewMode??"grid";return d?e.jsxs(Qe,{title:"Frames",description:"Manage and organize all frames within this map. Create, edit, and collaborate on individual frames.",crumbs:[{to:"/dashboard/maps",label:"Maps"},{to:"/dashboard/maps/"+d.id,label:d.name}],headerContent:e.jsxs(k,{disabled:!u,onClick:()=>b(!0),className:"h-11 rounded-[0.8rem]",children:[e.jsx(nt,{className:"h-4 w-4"}),"Add Frame"]}),children:[e.jsxs("div",{className:"flex h-full flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"flex-1 text-lg font-semibold text-gray-900",children:"All Frames"}),e.jsx("div",{className:"flex flex-1 justify-center",children:e.jsx(Es,{viewMode:I,onViewModeChange:j=>s({viewMode:j})})}),e.jsx("div",{className:"flex flex-1 items-center justify-end gap-3",children:I==="grid"&&e.jsxs(e.Fragment,{children:[e.jsx(W,{value:g,onChange:j=>l(j.target.value),placeholder:"Search frames...",className:"h-10 w-44 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none focus-visible:bg-[#1E2533]"}),e.jsxs(me,{value:h,onValueChange:f,children:[e.jsx(pe,{className:"h-10 w-36 shrink-0 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none",children:e.jsx(ue,{})}),e.jsxs(he,{children:[e.jsx(V,{value:"order",children:"Default order"}),e.jsx(V,{value:"created",children:"Newest"}),e.jsx(V,{value:"name",children:"Name"})]})]})]})})]}),I==="grid"&&e.jsxs(e.Fragment,{children:[e.jsx(As,{pages:c}),N>1&&e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsx(it,{currentPage:F+1,totalPages:N,setCurrentPage:j=>y(j-1)})})]}),I==="canvas"&&e.jsx(bs,{pages:i,project:d})]}),e.jsx(Ns,{open:v,onOpenChange:b,title:"Add Frame",ctaLabel:"Add Frame",description:"Create a new frame for this map.",submitForm:async j=>{const A=j.imageFile?await Ee(n,j.imageFile):void 0;await o({variables:{orgId:n,mapId:a,input:{name:j.name,description:j.description,templateType:j.profileId,screenshotAssetId:A}}}),b(!1)}})]}):null}function jr(){return e.jsx(Fs,{children:e.jsx(Ds,{})})}const Ls=st({name:H().min(1,"Project name is required"),description:H().optional(),serviceId:H().optional()});function ct({submitForm:t,ctaLabel:s,withService:n,...d}){const[i,a]=r.useState(!1),[o,u]=r.useState(""),v=O()?.id,b=Z(Jt,{variables:{orgId:v,sortBy:"name",sortDir:"asc"},skip:!v||!n}),h=X(b.data?.services.items),{control:f,handleSubmit:g,reset:l,formState:{errors:C}}=Ye({mode:"onChange",resolver:Je(Ls),values:{...d.initialValues,name:d.initialValues?.name||""}});return r.useEffect(()=>{l()},[d.open,l]),e.jsx($e,{...d,children:e.jsxs("form",{onSubmit:g(async F=>{if(n&&!F.serviceId){u("Choose the service whose repository stores this map");return}a(!0),u("");try{await t(F)}catch(y){u(y instanceof Error?y.message:"Something went wrong. Please try again.")}a(!1)}),className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name",className:"leding-[1.33] text-sm font-normal",children:"Map Name"}),e.jsx(q,{name:"name",control:f,render:({field:F})=>e.jsx(W,{id:"name",...F,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"e.g. Checkout Flow",className:P("h-[56px] rounded-[16px] border border-[#2A3242] bg-[#1E2533] px-6 focus:outline-none",C.name&&"border-red-500")})}),C.name&&e.jsx("p",{className:"text-sm text-red-500",children:C.name.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"description",children:"Description"}),e.jsx(q,{name:"description",control:f,render:({field:F})=>e.jsx(W,{id:"description",...F,autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"Describe what this map represents",className:P("h-[56px] rounded-[16px] border border-[#2A3242] bg-[#1E2533] px-6 focus:outline-none",C.description&&"border-red-500")})}),C.description&&e.jsx("p",{className:"text-sm text-red-500",children:C.description.message})]}),n&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"service",children:"Service"}),e.jsx(q,{name:"serviceId",control:f,render:({field:F})=>e.jsxs(me,{value:F.value,onValueChange:F.onChange,children:[e.jsx(pe,{id:"service",className:"h-[56px]! w-full rounded-[16px] border border-[#2A3242] bg-[#1E2533] px-6 focus:outline-none",children:e.jsx(ue,{className:"text-sm leading-[1.33] font-normal text-[#828DA3]",placeholder:"Select the service that stores this map"})}),e.jsx(he,{children:h.map(y=>e.jsx(V,{value:y.id,children:y.name},y.id))})]})}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"The map is saved in this service's .uigraph.yaml"})]}),o&&e.jsx("p",{className:"text-sm text-red-500",children:o}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(k,{type:"button",variant:"outline",onClick:()=>d.onOpenChange(!1),disabled:i,className:"bg-shading text-paragraph border-stock h-11 rounded-[12.85px] text-sm leading-[1.33] font-normal",children:"Cancel"}),e.jsxs(k,{type:"submit",disabled:i,className:"h-11 rounded-[12.85px] bg-[#015AEB] text-sm leading-[1.33] font-normal hover:bg-blue-700",children:[i&&e.jsx(U,{}),s]})]})]})})}function _s({urls:t,name:s}){const[n,d]=r.useState(!1),[i,a]=r.useState(!0),o=t.filter(Boolean),u=o.length>0&&!n;function v(b){const{naturalWidth:h,naturalHeight:f}=b.currentTarget;f>0&&a(h/f<1.4)}return e.jsxs("div",{className:P("relative aspect-[16/10] w-full transition-colors duration-300",u?"bg-[#1E2533] group-hover:bg-[#252D3E]":"bg-[#1A2030]"),children:[u?o.length===1?e.jsx("img",{src:o[0],alt:s??"Map preview",onLoad:v,onError:()=>d(!0),className:P("h-full w-full",i?"object-cover object-top group-hover:object-bottom":"object-contain"),style:i?{transition:"object-position 2.5s ease-in-out"}:void 0}):e.jsx("div",{className:P("grid h-full w-full gap-px bg-[#2A3242]",o.length===2?"grid-cols-2":"grid-cols-2 grid-rows-2"),children:o.slice(0,4).map((b,h)=>e.jsx("img",{src:b,alt:`${s??"Map"} frame ${h+1}`,onError:()=>d(!0),className:"h-full w-full object-cover object-top"},`${b}-${h}`))}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-[#2A3242]/70",children:e.jsx(Ze,{className:"size-4 text-[#586378]"})}),e.jsx("span",{className:"text-[11px] font-medium text-[#586378]",children:"No images available"})]}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-[#141925]/40 to-transparent"})]})}function zs({projects:t}){return t.length===0?e.jsx(at,{label:"No maps found"}):e.jsx("div",{className:"grid gap-6 pb-4",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:t.map(s=>e.jsx(Rs,{project:s},s.id))})}function Rs({project:t}){const{canWrite:s}=Y(),n=O()?.id,[d,i]=r.useState(!1),[a,o]=r.useState(!1),[u,v]=r.useState(!1),[b]=z(Dt,{refetchQueries:[se],awaitRefetchQueries:!0}),[h,{loading:f}]=z(Lt,{refetchQueries:[se],awaitRefetchQueries:!0});return e.jsxs("div",{className:"group relative",children:[e.jsxs(qe,{to:`/dashboard/maps/${t.id}`,className:"relative block cursor-pointer overflow-hidden rounded-[1.4525rem] bg-[#141925] shadow-[0_1px_3px_rgba(0,0,0,0.3),0_1px_2px_rgba(0,0,0,0.2)] ring-1 ring-[#2A3242] transition-all duration-300 hover:shadow-[0_0_0_3px_rgba(1,90,235,0.25),0_8px_24px_rgba(0,0,0,0.4)] hover:ring-2 hover:ring-[#015AEB]",onDragStart:g=>g.preventDefault(),children:[e.jsx(_s,{urls:t.previewImgUrls??[],name:t.name}),e.jsx("div",{className:"h-px bg-[#2A3242]"}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("h4",{className:"line-clamp-1 text-sm font-semibold text-[#F4F7FC]",children:t.name??e.jsx("span",{className:"text-[#586378]",children:"Untitled Map"})}),e.jsx("div",{className:"mt-2 flex min-h-[1.75rem] items-center justify-between gap-2",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3 text-[#828DA3]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(rt,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"text-[11px]",children:t.createdAt?ot(t.createdAt,"dd MMM yyyy"):"N/A"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(as,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{className:"text-[11px]",children:[t.previewImgUrls?.filter(Boolean).length??0," screens"]})]})]})})]})]}),e.jsxs(Se,{open:u,onOpenChange:v,children:[e.jsx(Ae,{asChild:!0,children:e.jsx(k,{size:"icon",variant:"ghost",className:P("absolute top-2 right-2 h-7 w-7 rounded-lg bg-[#1E2533]/80 opacity-0 shadow-sm backdrop-blur-sm transition-opacity group-hover:opacity-100 hover:bg-[#1E2533]",u&&"opacity-100"),children:e.jsx(Le,{className:"h-3.5 w-3.5 text-[#828DA3]"})})}),e.jsxs(Me,{align:"end",children:[e.jsx(te,{disabled:!s,onClick:()=>i(!0),children:"Edit"}),e.jsx(te,{variant:"destructive",disabled:!s,onClick:()=>o(!0),children:"Delete"})]})]}),e.jsx(ct,{title:"Edit Map",ctaLabel:"Update Map",description:"Customize your map details below.",open:d,onOpenChange:i,initialValues:{name:t?.name||"",description:t?.description||""},submitForm:async g=>{await b({variables:{orgId:n,id:t.id,input:{name:g.name,description:g.description||""}}}),i(!1)}}),e.jsxs(Ve,{open:a,onOpenChange:o,className:"!max-w-md",children:[e.jsxs(ge,{className:"p-6",children:[e.jsx(fe,{children:"Delete Map?"}),e.jsx(tt,{children:"Are you sure you want to delete this map? This action cannot be undone."})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-0",children:[e.jsx(k,{variant:"outline",className:"h-11",onClick:()=>o(!1),children:"Cancel"}),e.jsxs(k,{variant:"destructive",className:"h-11",disabled:f,onClick:async()=>{await h({variables:{orgId:n,id:t.id}}),o(!1)},children:[f&&e.jsx(U,{}),"Delete"]})]})]})]})}const de=24;function Ts(){const t=O()?.id,[s,n]=_e("maps:sort","created"),[d,i]=r.useState(""),a=De(d),[o,u]=r.useState(0),v=s==="name"?"asc":"desc";r.useEffect(()=>{u(0)},[s,a]);const b={orgId:t,search:a||null,sortBy:s,sortDir:v,limit:de,offset:o*de},{data:h,loading:f}=Z(se,{fetchPolicy:"cache-and-network",variables:b,skip:!t}),[g]=z(_t,{awaitRefetchQueries:!0,refetchQueries:[se]});return{projectsLoading:f&&!h?.maps,projects:X(h?.maps.items),totalCount:h?.maps.totalCount??0,pageSize:de,page:o,setPage:u,sortBy:s,setSortBy:n,search:d,setSearch:i,createProject:g}}function br(){const t=O()?.id,{projects:s,totalCount:n,pageSize:d,page:i,setPage:a,createProject:o,projectsLoading:u,sortBy:v,setSortBy:b,search:h,setSearch:f}=Ts(),{canWrite:g}=Y(),[l,C]=r.useState(!1),F=Math.ceil(n/d);return e.jsxs(Qe,{title:"System Maps",description:"End-to-end views of your product, flows, and services.",crumbs:[{to:"/dashboard/maps",label:"Maps"}],headerContent:e.jsxs(k,{disabled:!g,onClick:()=>C(!0),className:"h-11 rounded-[0.8rem]",children:[e.jsx(nt,{className:"h-4 w-4"}),"Create Map"]}),children:[e.jsxs("div",{className:"mb-6 flex flex-wrap items-center gap-3",children:[e.jsx(W,{value:h,onChange:y=>f(y.target.value),placeholder:"Search maps...",className:"h-10 w-52 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none focus-visible:bg-[#1E2533]"}),e.jsxs(me,{value:v,onValueChange:b,children:[e.jsx(pe,{className:"h-10 w-40 shrink-0 rounded-lg border-[#2A3242] bg-[#1E2533] text-[13px] shadow-none",children:e.jsx(ue,{})}),e.jsxs(he,{children:[e.jsx(V,{value:"created",children:"Newest"}),e.jsx(V,{value:"updated",children:"Recently updated"}),e.jsx(V,{value:"name",children:"Name"})]})]})]}),u?e.jsx(xe,{}):e.jsxs(e.Fragment,{children:[e.jsx(zs,{projects:s}),F>1&&e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsx(it,{currentPage:i+1,totalPages:F,setCurrentPage:y=>a(y-1)})})]}),e.jsx(ct,{title:"Create Map",ctaLabel:"Create Map",withService:!0,description:"Create a new map to visualize flows, services, and architecture.",open:l,onOpenChange:C,submitForm:async y=>{await o({variables:{orgId:t,input:{name:y.name,description:y.description||"",serviceId:y.serviceId}}}),C(!1)}})]})}export{jr as DashboardProjectPage,br as DashboardProjects};
@@ -0,0 +1 @@
1
+ import{f as v,U as N}from"./scroll-area-RagrStGj.js";import{D as i}from"./dashboard-layout-sTeeHNsZ.js";import{a as L,b as F,c as A}from"./dashboard-layout-sTeeHNsZ.js";import{j as e}from"./index-CH7cEAxj.js";import{c as n}from"./chunk-OB3PAWPO-DJIP1M4r.js";import"./ui-graph-logo-gHowu5gP.js";import"./iconBase-DtqdW2XR.js";import"./nav-links-DZWMpwMR.js";import"./query-D9oj6LGx.js";import"./grid-scroll-body-DC5pYDPJ.js";import"./popover-476u3TN0.js";function D({crumbs:r,children:a,noPadding:s,headerContent:t,...o}){return e.jsx(i,{crumbs:r,children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(d,{...o,children:t}),e.jsx(l,{noPadding:s,children:a})]})})}function d({title:r,children:a,description:s}){return e.jsxs("div",{className:"bg-card flex items-center justify-between gap-4 border-b border-[#2A3242] px-4 py-6 pt-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"mb-2 text-xl font-semibold text-[#F4F7FC]",children:r}),e.jsx("p",{className:"text-sm leading-[1.33] font-normal text-[#828DA3]",children:s})]}),e.jsx("div",{children:a})]})}function l({noPadding:r,className:a,...s}){return e.jsx("div",{className:n("flex size-full flex-1 flex-col",!r&&"px-4 pt-4 pb-6",a),...s})}export{v as DashboardHeader,L as DashboardLayout,i as DashboardPageLayout,D as DashboardPageSectionLayout,l as DashboardSectionContent,d as DashboardSectionHeader,F as DashboardSettingsLayout,A as DashboardSidebar,N as UserBadge};