@malloy-publisher/server 0.0.113 → 0.0.114
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.
- package/dist/app/assets/{Chip-BPFN-2iK.js → Chip-DpRfGWL9.js} +1 -1
- package/dist/app/assets/{Container-S_LHoTtj.js → Container-pCaIjpH5.js} +1 -1
- package/dist/app/assets/{DialogTitle-BoaRUY5e.js → DialogTitle-Df6dToBj.js} +1 -1
- package/dist/app/assets/{Edit-DxSFhHwr.js → Edit-Do7LZWER.js} +1 -1
- package/dist/app/assets/FormControlContext-Ccuzn_SP.js +1 -0
- package/dist/app/assets/{HomePage-Ciykl78O.js → HomePage-pfv0GYQd.js} +1 -1
- package/dist/app/assets/{MainPage-DQs1DLly.js → MainPage-1RQ43yX6.js} +1 -1
- package/dist/app/assets/{MenuItem-CKcvMIiT.js → MenuItem-BWMnNgqP.js} +1 -1
- package/dist/app/assets/{Modal-B09ILQKb.js → Modal-BbVeNLvO.js} +1 -1
- package/dist/app/assets/{ModelPage-B4pPCb_A.js → ModelPage-BFSBWoUi.js} +1 -1
- package/dist/app/assets/{MoreVert-CBj2COu2.js → MoreVert-Dh8A2FDF.js} +1 -1
- package/dist/app/assets/{PackagePage-v9ybKZsV.js → PackagePage-Dbb4lm1F.js} +1 -1
- package/dist/app/assets/{ProjectPage--ytNIoOY.js → ProjectPage-Ccyp5m5h.js} +1 -1
- package/dist/app/assets/{RouteError-DODx40fJ.js → RouteError-soNErEMV.js} +1 -1
- package/dist/app/assets/{WorkbookPage-DEmSMCHP.js → WorkbookPage-D_yrMjqR.js} +2 -2
- package/dist/app/assets/{index-CPPmFTED.js → index-BS_9W4Tt.js} +63 -63
- package/dist/app/assets/index-B_Z1qGAK.js +1184 -0
- package/dist/app/assets/index-CMlGQMcl.css +1 -0
- package/dist/app/assets/{index-BNDPWBNi.js → index-CZpA8zwK.js} +235 -235
- package/dist/app/assets/{index.es20-lNMjicWC.js → index.es20-DzH7kq4S.js} +1 -1
- package/dist/app/assets/{index.es23-BYJIDfXQ.js → index.es23-C-bQftBc.js} +2 -2
- package/dist/app/assets/{index.es323-Cmd8ebKW.js → index.es287-BsK0ZRDU.js} +1 -1
- package/dist/app/assets/{index.es324-BllQIgQd.js → index.es288-pwa92z63.js} +1 -1
- package/dist/app/assets/{index.es327-DhM3xEyp.js → index.es291-LYy-CnOC.js} +1 -1
- package/dist/app/assets/{index.es332-Dn786pMK.js → index.es296-BxlxlVr1.js} +1 -1
- package/dist/app/assets/{index.es340-JoyRj8Ul.js → index.es304-jV2gZBYS.js} +1 -1
- package/dist/app/assets/{index.es341-9uOuiCzh.js → index.es305-DrF4mmwj.js} +1 -1
- package/dist/app/assets/{index.es344-hoFJ9wLz.js → index.es308-CZZGZfCL.js} +1 -1
- package/dist/app/assets/{index.es348-D8pWOBN4.js → index.es312-CM4OW1Tu.js} +1 -1
- package/dist/app/assets/{index.es351-CuxSqnpe.js → index.es315-CSNCJz_t.js} +1 -1
- package/dist/app/assets/{index.es354-DvlPdd_8.js → index.es318-BnlIqKdP.js} +1 -1
- package/dist/app/assets/{index.es355-CunDDQIR.js → index.es319-BqfPxZyn.js} +1 -1
- package/dist/app/assets/{index.es369-CYf8oS2b.js → index.es333-DrlQlC9C.js} +1 -1
- package/dist/app/assets/{index.es370-Cbr8LiAr.js → index.es334-CrN25jeJ.js} +1 -1
- package/dist/app/assets/{index.es371--q2H8od3.js → index.es335-BMF1iNAk.js} +1 -1
- package/dist/app/assets/{index.es373-BuiMQ1bX.js → index.es337-DddOBpwk.js} +1 -1
- package/dist/app/assets/{index.es378-CkjxECEH.js → index.es342-5MyjXhLR.js} +1 -1
- package/dist/app/assets/{index.es380-C6KQCo6t.js → index.es344-BpzCATdh.js} +1 -1
- package/dist/app/assets/{index.es381-CwHcQBsW.js → index.es345-CcT82qyg.js} +1 -1
- package/dist/app/assets/{index.es386-FC0u_O0U.js → index.es350-DT_CVHOb.js} +1 -1
- package/dist/app/assets/{index.es387-xHeBAFPr.js → index.es351-IRimHV8f.js} +1 -1
- package/dist/app/assets/{index.es389-BwaLxarl.js → index.es353-e0DSyH1F.js} +1 -1
- package/dist/app/assets/{index.es390-B3IQVAJV.js → index.es354-DvXzIB3B.js} +1 -1
- package/dist/app/assets/{index.es391-BwkoCHxh.js → index.es355-BpinPwMf.js} +1 -1
- package/dist/app/assets/{index.es394-BPWLHcqA.js → index.es358-B2FwChKl.js} +1 -1
- package/dist/app/assets/{index.es396-COP1dwQ2.js → index.es360-B11Uptoy.js} +1 -1
- package/dist/app/assets/{index.es397-Ba4K4mAk.js → index.es361-CqPSZKxw.js} +1 -1
- package/dist/app/assets/{index.es398-BSYOs98v.js → index.es362-kID_QP2b.js} +1 -1
- package/dist/app/assets/{index.es404-DGUWv76G.js → index.es368-DEU47Nmo.js} +1 -1
- package/dist/app/assets/{index.es405-DBe4EGNb.js → index.es369-BAVwPVpH.js} +1 -1
- package/dist/app/assets/{index.es406-CFlwXxP9.js → index.es370-CQSqpEY2.js} +1 -1
- package/dist/app/assets/{index.es407-DTR_lE2r.js → index.es371-DSPIJ8l-.js} +1 -1
- package/dist/app/assets/{index.es409-DrFr_RuK.js → index.es373-CTLjf8LZ.js} +1 -1
- package/dist/app/assets/{index.es413-DaCYI7j4.js → index.es377-BFPElb8k.js} +1 -1
- package/dist/app/assets/{index.es414-C7v51edE.js → index.es378-Bi8-8y3Z.js} +1 -1
- package/dist/app/assets/{index.es422-BCUhEH3B.js → index.es386-BRbfYhrv.js} +1 -1
- package/dist/app/assets/{index.es425-BZfdHlSw.js → index.es389-SMY2M5Dd.js} +1 -1
- package/dist/app/assets/{index.es428-BX-XuKJl.js → index.es392-fGYxK-uk.js} +1 -1
- package/dist/app/assets/{index.es431-BVtQbGWk.js → index.es395--SrhnzjM.js} +1 -1
- package/dist/app/assets/{index.es435-CzRAsM7q.js → index.es399-BP5VLghY.js} +1 -1
- package/dist/app/assets/{index.es437-D_UmiHxH.js → index.es401-CopVMHFF.js} +1 -1
- package/dist/app/assets/{index.es445-Bm8V_39j.js → index.es409-C0EaxmtL.js} +1 -1
- package/dist/app/assets/{index.es446-Wf2I0eqD.js → index.es410-B2INzLoQ.js} +1 -1
- package/dist/app/assets/{index.es453-Gs69FCIA.js → index.es417-B6GOQZs3.js} +1 -1
- package/dist/app/assets/{index.es454-3-JraJzM.js → index.es418-Dt4O9kPw.js} +1 -1
- package/dist/app/assets/{index.es464-C7bC7aMW.js → index.es428-BGqtBs8m.js} +1 -1
- package/dist/app/assets/{index.es468-DfkjH5vL.js → index.es432-BzFuvoyF.js} +1 -1
- package/dist/app/assets/{index.es474-D78hU9hI.js → index.es438-DvNyQZ9B.js} +1 -1
- package/dist/app/assets/{index.es479-De4o0oHW.js → index.es443-DC0KqCTi.js} +1 -1
- package/dist/app/assets/{index.es480-CLNDiA6D.js → index.es444-CTooryRZ.js} +1 -1
- package/dist/app/assets/{index.es482-CnRcoveV.js → index.es446-DGMBZ3_7.js} +1 -1
- package/dist/app/assets/{index.es486-qlG5fVnA.js → index.es450-BCWIDv3j.js} +1 -1
- package/dist/app/assets/{index.es488-DTMS730P.js → index.es452-B8WGaHgy.js} +1 -1
- package/dist/app/assets/{index.es490-C06M4v41.js → index.es454-Cp0AvzKu.js} +1 -1
- package/dist/app/assets/{index.es493-BxjgJJow.js → index.es457-C87oaIOo.js} +1 -1
- package/dist/app/assets/{index.es494-DlbKs2fg.js → index.es458-CBexwHfM.js} +1 -1
- package/dist/app/assets/{index.es498-DalR4GX0.js → index.es462-DGwyl90J.js} +1 -1
- package/dist/app/assets/{index.es500-BcWqEBYK.js → index.es464-Dzf6WDCJ.js} +1 -1
- package/dist/app/assets/{index.es507-BOX6c_Kn.js → index.es471-BOZxaHLN.js} +1 -1
- package/dist/app/assets/{index.es509--wACVBhv.js → index.es473-C4VYB3vo.js} +1 -1
- package/dist/app/assets/{index.es511-C-Y0Jtd1.js → index.es475-OnXMAP7q.js} +1 -1
- package/dist/app/assets/{index.es515-RpK-kOK2.js → index.es479-H38Vf5YC.js} +1 -1
- package/dist/app/assets/{index.es525-DuRYU1r6.js → index.es489-Cm4BEHNL.js} +1 -1
- package/dist/app/assets/{index.es526-DWCmcnaA.js → index.es490-DtqPpdnf.js} +1 -1
- package/dist/app/assets/{index.es533-DsvhN0ks.js → index.es497-BvZ-y4_B.js} +1 -1
- package/dist/app/assets/{index.es534-BGVyZEaI.js → index.es498-DeJOiud8.js} +1 -1
- package/dist/app/assets/{index.es7-Baro92Ee.js → index.es7-Lspe9b-6.js} +1 -1
- package/dist/app/assets/{index.modern-BPeknk47.js → index.modern-J74LOUay.js} +1 -1
- package/dist/app/assets/{index.umd-DgCSOv4v.js → index.umd-iTdVE6k1.js} +1 -1
- package/dist/app/assets/{listItemTextClasses-BS6WKuj5.js → listItemTextClasses-D0rI_qhy.js} +1 -1
- package/dist/app/index.html +2 -2
- package/package.json +1 -1
- package/dist/app/assets/FormControlContext-DB8XoAZ6.js +0 -1
- package/dist/app/assets/index-BV8rQ2ml.css +0 -1
- package/dist/app/assets/index-Dd2_AgmS.js +0 -287
- /package/dist/app/assets/{index.es312-CG6Dc4jp.js → index.es276-CG6Dc4jp.js} +0 -0
- /package/dist/app/assets/{index.es320-DsBKuouk.js → index.es284-DsBKuouk.js} +0 -0
- /package/dist/app/assets/{index.es321-D_z4Izcz.js → index.es285-D_z4Izcz.js} +0 -0
- /package/dist/app/assets/{index.es322-727ZlQH0.js → index.es286-727ZlQH0.js} +0 -0
- /package/dist/app/assets/{index.es325-Dn00JSTd.js → index.es289-Dn00JSTd.js} +0 -0
- /package/dist/app/assets/{index.es326-COJ4H7py.js → index.es290-COJ4H7py.js} +0 -0
- /package/dist/app/assets/{index.es328-Bu5BbsvL.js → index.es292-Bu5BbsvL.js} +0 -0
- /package/dist/app/assets/{index.es329-7O62HKoU.js → index.es293-7O62HKoU.js} +0 -0
- /package/dist/app/assets/{index.es330-BPT9niGB.js → index.es294-BPT9niGB.js} +0 -0
- /package/dist/app/assets/{index.es331-Dhn9LcZ4.js → index.es295-Dhn9LcZ4.js} +0 -0
- /package/dist/app/assets/{index.es333-eg146-Ew.js → index.es297-eg146-Ew.js} +0 -0
- /package/dist/app/assets/{index.es334-Du268qiB.js → index.es298-Du268qiB.js} +0 -0
- /package/dist/app/assets/{index.es335-fje9CFhw.js → index.es299-fje9CFhw.js} +0 -0
- /package/dist/app/assets/{index.es336-BwXTMy5W.js → index.es300-BwXTMy5W.js} +0 -0
- /package/dist/app/assets/{index.es337-3xVqZejG.js → index.es301-3xVqZejG.js} +0 -0
- /package/dist/app/assets/{index.es338-xW4inM5L.js → index.es302-xW4inM5L.js} +0 -0
- /package/dist/app/assets/{index.es339-DHo0CJ0O.js → index.es303-DHo0CJ0O.js} +0 -0
- /package/dist/app/assets/{index.es342-C3t2pwGQ.js → index.es306-C3t2pwGQ.js} +0 -0
- /package/dist/app/assets/{index.es343-DNquZEk8.js → index.es307-DNquZEk8.js} +0 -0
- /package/dist/app/assets/{index.es345-BHOwM8T6.js → index.es309-BHOwM8T6.js} +0 -0
- /package/dist/app/assets/{index.es346-DxSadP1t.js → index.es310-DxSadP1t.js} +0 -0
- /package/dist/app/assets/{index.es347-DbXoA79R.js → index.es311-DbXoA79R.js} +0 -0
- /package/dist/app/assets/{index.es349-Bp6g37R7.js → index.es313-Bp6g37R7.js} +0 -0
- /package/dist/app/assets/{index.es350-sacFqUAJ.js → index.es314-sacFqUAJ.js} +0 -0
- /package/dist/app/assets/{index.es352-C7gG9l05.js → index.es316-C7gG9l05.js} +0 -0
- /package/dist/app/assets/{index.es353-Dsg_Bt_b.js → index.es317-Dsg_Bt_b.js} +0 -0
- /package/dist/app/assets/{index.es356-D9R-vmeu.js → index.es320-D9R-vmeu.js} +0 -0
- /package/dist/app/assets/{index.es357-BPhBrDlE.js → index.es321-BPhBrDlE.js} +0 -0
- /package/dist/app/assets/{index.es358-C-TU5hQ_.js → index.es322-C-TU5hQ_.js} +0 -0
- /package/dist/app/assets/{index.es359-DtFQj3wx.js → index.es323-DtFQj3wx.js} +0 -0
- /package/dist/app/assets/{index.es360-m2LEI-9-.js → index.es324-m2LEI-9-.js} +0 -0
- /package/dist/app/assets/{index.es361-BoXegm-a.js → index.es325-BoXegm-a.js} +0 -0
- /package/dist/app/assets/{index.es362-B9wLZaAG.js → index.es326-B9wLZaAG.js} +0 -0
- /package/dist/app/assets/{index.es363-ClGRhx96.js → index.es327-ClGRhx96.js} +0 -0
- /package/dist/app/assets/{index.es364-DEIpsLCJ.js → index.es328-DEIpsLCJ.js} +0 -0
- /package/dist/app/assets/{index.es365-BgYniUM_.js → index.es329-BgYniUM_.js} +0 -0
- /package/dist/app/assets/{index.es366-COcR7UxN.js → index.es330-COcR7UxN.js} +0 -0
- /package/dist/app/assets/{index.es367-BjQB5zDj.js → index.es331-BjQB5zDj.js} +0 -0
- /package/dist/app/assets/{index.es368-C-nORZOA.js → index.es332-C-nORZOA.js} +0 -0
- /package/dist/app/assets/{index.es372-BX77sIaO.js → index.es336-BX77sIaO.js} +0 -0
- /package/dist/app/assets/{index.es374-B-DoSBHF.js → index.es338-B-DoSBHF.js} +0 -0
- /package/dist/app/assets/{index.es375-bCA53EVm.js → index.es339-bCA53EVm.js} +0 -0
- /package/dist/app/assets/{index.es376-w-ucz2PV.js → index.es340-w-ucz2PV.js} +0 -0
- /package/dist/app/assets/{index.es377-Dayu4EKP.js → index.es341-Dayu4EKP.js} +0 -0
- /package/dist/app/assets/{index.es379-DKXYxT9g.js → index.es343-DKXYxT9g.js} +0 -0
- /package/dist/app/assets/{index.es382-DfxzS6Rs.js → index.es346-DfxzS6Rs.js} +0 -0
- /package/dist/app/assets/{index.es383-SKMF96pI.js → index.es347-SKMF96pI.js} +0 -0
- /package/dist/app/assets/{index.es384-ajMbGru0.js → index.es348-ajMbGru0.js} +0 -0
- /package/dist/app/assets/{index.es385--30QC5Em.js → index.es349--30QC5Em.js} +0 -0
- /package/dist/app/assets/{index.es388-B430Bg39.js → index.es352-B430Bg39.js} +0 -0
- /package/dist/app/assets/{index.es392-CM8KxXT1.js → index.es356-CM8KxXT1.js} +0 -0
- /package/dist/app/assets/{index.es393-B1SYOhNW.js → index.es357-B1SYOhNW.js} +0 -0
- /package/dist/app/assets/{index.es395-DkBy-JyN.js → index.es359-DkBy-JyN.js} +0 -0
- /package/dist/app/assets/{index.es399-BILxekzW.js → index.es363-BILxekzW.js} +0 -0
- /package/dist/app/assets/{index.es400-C5wWYbrZ.js → index.es364-C5wWYbrZ.js} +0 -0
- /package/dist/app/assets/{index.es401-HzYwdGDm.js → index.es365-HzYwdGDm.js} +0 -0
- /package/dist/app/assets/{index.es402-T-Tgc4AT.js → index.es366-T-Tgc4AT.js} +0 -0
- /package/dist/app/assets/{index.es403-ifBTmRxC.js → index.es367-ifBTmRxC.js} +0 -0
- /package/dist/app/assets/{index.es408-BMj5Y0dO.js → index.es372-BMj5Y0dO.js} +0 -0
- /package/dist/app/assets/{index.es410-BjABl1g7.js → index.es374-BjABl1g7.js} +0 -0
- /package/dist/app/assets/{index.es411-xI-RfyKK.js → index.es375-xI-RfyKK.js} +0 -0
- /package/dist/app/assets/{index.es412-ySlJ1b_l.js → index.es376-ySlJ1b_l.js} +0 -0
- /package/dist/app/assets/{index.es415-BQoSv7ci.js → index.es379-BQoSv7ci.js} +0 -0
- /package/dist/app/assets/{index.es416-w8dY5SsB.js → index.es380-w8dY5SsB.js} +0 -0
- /package/dist/app/assets/{index.es417-TU54ms6u.js → index.es381-TU54ms6u.js} +0 -0
- /package/dist/app/assets/{index.es418-DREVFZK8.js → index.es382-DREVFZK8.js} +0 -0
- /package/dist/app/assets/{index.es419-BfivnA6A.js → index.es383-BfivnA6A.js} +0 -0
- /package/dist/app/assets/{index.es420-P4WzXJd0.js → index.es384-P4WzXJd0.js} +0 -0
- /package/dist/app/assets/{index.es421-BAng5TT0.js → index.es385-BAng5TT0.js} +0 -0
- /package/dist/app/assets/{index.es423-B5lbUyaz.js → index.es387-B5lbUyaz.js} +0 -0
- /package/dist/app/assets/{index.es424-mebxcVVE.js → index.es388-mebxcVVE.js} +0 -0
- /package/dist/app/assets/{index.es426-XBlWyCtg.js → index.es390-XBlWyCtg.js} +0 -0
- /package/dist/app/assets/{index.es427-BfCpw3nA.js → index.es391-BfCpw3nA.js} +0 -0
- /package/dist/app/assets/{index.es429-Cc5clBb7.js → index.es393-Cc5clBb7.js} +0 -0
- /package/dist/app/assets/{index.es430-IuBKFhSY.js → index.es394-IuBKFhSY.js} +0 -0
- /package/dist/app/assets/{index.es432-Du5NY7AG.js → index.es396-Du5NY7AG.js} +0 -0
- /package/dist/app/assets/{index.es433-Bvotw-X0.js → index.es397-Bvotw-X0.js} +0 -0
- /package/dist/app/assets/{index.es434-UIAJJxZW.js → index.es398-UIAJJxZW.js} +0 -0
- /package/dist/app/assets/{index.es436-D9-PGadD.js → index.es400-D9-PGadD.js} +0 -0
- /package/dist/app/assets/{index.es438-sdHcTMYB.js → index.es402-sdHcTMYB.js} +0 -0
- /package/dist/app/assets/{index.es439-Ci6OQyBP.js → index.es403-Ci6OQyBP.js} +0 -0
- /package/dist/app/assets/{index.es440-BC5c_5Pe.js → index.es404-BC5c_5Pe.js} +0 -0
- /package/dist/app/assets/{index.es441-Tz6hzZYG.js → index.es405-Tz6hzZYG.js} +0 -0
- /package/dist/app/assets/{index.es442-DB_GagMm.js → index.es406-DB_GagMm.js} +0 -0
- /package/dist/app/assets/{index.es443-DLbgOhZU.js → index.es407-DLbgOhZU.js} +0 -0
- /package/dist/app/assets/{index.es444-B0XVJmRM.js → index.es408-B0XVJmRM.js} +0 -0
- /package/dist/app/assets/{index.es447-shcSOmrb.js → index.es411-shcSOmrb.js} +0 -0
- /package/dist/app/assets/{index.es448-D4Tzg5kh.js → index.es412-D4Tzg5kh.js} +0 -0
- /package/dist/app/assets/{index.es449-Deuh7S70.js → index.es413-Deuh7S70.js} +0 -0
- /package/dist/app/assets/{index.es450-BUEGK8hf.js → index.es414-BUEGK8hf.js} +0 -0
- /package/dist/app/assets/{index.es451-BNioltXt.js → index.es415-BNioltXt.js} +0 -0
- /package/dist/app/assets/{index.es452-JqZropPD.js → index.es416-JqZropPD.js} +0 -0
- /package/dist/app/assets/{index.es455-LKU2TuZ1.js → index.es419-LKU2TuZ1.js} +0 -0
- /package/dist/app/assets/{index.es456-BFLt1xDp.js → index.es420-BFLt1xDp.js} +0 -0
- /package/dist/app/assets/{index.es457-DKykz6zU.js → index.es421-DKykz6zU.js} +0 -0
- /package/dist/app/assets/{index.es458-B3ZDOciz.js → index.es422-B3ZDOciz.js} +0 -0
- /package/dist/app/assets/{index.es459-CSHBycmS.js → index.es423-CSHBycmS.js} +0 -0
- /package/dist/app/assets/{index.es460-BIEUsx6d.js → index.es424-BIEUsx6d.js} +0 -0
- /package/dist/app/assets/{index.es461-B48N-Iqd.js → index.es425-B48N-Iqd.js} +0 -0
- /package/dist/app/assets/{index.es462-BY-TUvya.js → index.es426-BY-TUvya.js} +0 -0
- /package/dist/app/assets/{index.es463-zocC4JxJ.js → index.es427-zocC4JxJ.js} +0 -0
- /package/dist/app/assets/{index.es465-Cza_XSSt.js → index.es429-Cza_XSSt.js} +0 -0
- /package/dist/app/assets/{index.es466-Bg-kzb6g.js → index.es430-Bg-kzb6g.js} +0 -0
- /package/dist/app/assets/{index.es467-DhUJRlN_.js → index.es431-DhUJRlN_.js} +0 -0
- /package/dist/app/assets/{index.es469-C8lEn-DE.js → index.es433-C8lEn-DE.js} +0 -0
- /package/dist/app/assets/{index.es470-DhMKtDLN.js → index.es434-DhMKtDLN.js} +0 -0
- /package/dist/app/assets/{index.es471-CwjWoCRV.js → index.es435-CwjWoCRV.js} +0 -0
- /package/dist/app/assets/{index.es472-CzouJOBO.js → index.es436-CzouJOBO.js} +0 -0
- /package/dist/app/assets/{index.es473-B1bQXN8T.js → index.es437-B1bQXN8T.js} +0 -0
- /package/dist/app/assets/{index.es475-5LuOXUq_.js → index.es439-5LuOXUq_.js} +0 -0
- /package/dist/app/assets/{index.es476-DWJ3fJO_.js → index.es440-DWJ3fJO_.js} +0 -0
- /package/dist/app/assets/{index.es477-DJlmqQ1C.js → index.es441-DJlmqQ1C.js} +0 -0
- /package/dist/app/assets/{index.es478-QhoSD0DR.js → index.es442-QhoSD0DR.js} +0 -0
- /package/dist/app/assets/{index.es481-Be6lgOlo.js → index.es445-Be6lgOlo.js} +0 -0
- /package/dist/app/assets/{index.es483-BJ4Li9vH.js → index.es447-BJ4Li9vH.js} +0 -0
- /package/dist/app/assets/{index.es484-DQVVAn-B.js → index.es448-DQVVAn-B.js} +0 -0
- /package/dist/app/assets/{index.es485-BJGe-b2p.js → index.es449-BJGe-b2p.js} +0 -0
- /package/dist/app/assets/{index.es487-BLhTXw86.js → index.es451-BLhTXw86.js} +0 -0
- /package/dist/app/assets/{index.es489-atvbtKCR.js → index.es453-atvbtKCR.js} +0 -0
- /package/dist/app/assets/{index.es491-DkLiglaE.js → index.es455-DkLiglaE.js} +0 -0
- /package/dist/app/assets/{index.es492-C1w2a3ep.js → index.es456-C1w2a3ep.js} +0 -0
- /package/dist/app/assets/{index.es495-Cf8iN4DR.js → index.es459-Cf8iN4DR.js} +0 -0
- /package/dist/app/assets/{index.es496-COK4E0Yg.js → index.es460-COK4E0Yg.js} +0 -0
- /package/dist/app/assets/{index.es497-BknIz3MU.js → index.es461-BknIz3MU.js} +0 -0
- /package/dist/app/assets/{index.es499-BeQkCIfX.js → index.es463-BeQkCIfX.js} +0 -0
- /package/dist/app/assets/{index.es501-BSxZ-RaX.js → index.es465-BSxZ-RaX.js} +0 -0
- /package/dist/app/assets/{index.es502-C7L56vO4.js → index.es466-C7L56vO4.js} +0 -0
- /package/dist/app/assets/{index.es503-CUnW07Te.js → index.es467-CUnW07Te.js} +0 -0
- /package/dist/app/assets/{index.es504-C1XDQQGZ.js → index.es468-C1XDQQGZ.js} +0 -0
- /package/dist/app/assets/{index.es505-CQjiPCtT.js → index.es469-CQjiPCtT.js} +0 -0
- /package/dist/app/assets/{index.es506-DQ1-QYvQ.js → index.es470-DQ1-QYvQ.js} +0 -0
- /package/dist/app/assets/{index.es508-BbSNqyBO.js → index.es472-BbSNqyBO.js} +0 -0
- /package/dist/app/assets/{index.es510-CB2ApiWb.js → index.es474-CB2ApiWb.js} +0 -0
- /package/dist/app/assets/{index.es512-B_m7g4N7.js → index.es476-B_m7g4N7.js} +0 -0
- /package/dist/app/assets/{index.es513-B6W0miNI.js → index.es477-B6W0miNI.js} +0 -0
- /package/dist/app/assets/{index.es514-BMR_PYu6.js → index.es478-BMR_PYu6.js} +0 -0
- /package/dist/app/assets/{index.es516-Dj6nwHGl.js → index.es480-Dj6nwHGl.js} +0 -0
- /package/dist/app/assets/{index.es517-BpWG_bgh.js → index.es481-BpWG_bgh.js} +0 -0
- /package/dist/app/assets/{index.es518-BVUVsWT6.js → index.es482-BVUVsWT6.js} +0 -0
- /package/dist/app/assets/{index.es519-CAQ2eGtk.js → index.es483-CAQ2eGtk.js} +0 -0
- /package/dist/app/assets/{index.es520-BFOHcciG.js → index.es484-BFOHcciG.js} +0 -0
- /package/dist/app/assets/{index.es521-CdO5JTpU.js → index.es485-CdO5JTpU.js} +0 -0
- /package/dist/app/assets/{index.es522-CJaU5se_.js → index.es486-CJaU5se_.js} +0 -0
- /package/dist/app/assets/{index.es523-DYoNaHQp.js → index.es487-DYoNaHQp.js} +0 -0
- /package/dist/app/assets/{index.es524-m4uW47V2.js → index.es488-m4uW47V2.js} +0 -0
- /package/dist/app/assets/{index.es527-nyqBNV6O.js → index.es491-nyqBNV6O.js} +0 -0
- /package/dist/app/assets/{index.es528-C6j12Q_x.js → index.es492-C6j12Q_x.js} +0 -0
- /package/dist/app/assets/{index.es529-7A4Fjokl.js → index.es493-7A4Fjokl.js} +0 -0
- /package/dist/app/assets/{index.es530-CB0Krxn9.js → index.es494-CB0Krxn9.js} +0 -0
- /package/dist/app/assets/{index.es531-DCE3LsBG.js → index.es495-DCE3LsBG.js} +0 -0
- /package/dist/app/assets/{index.es532-C3FkfJm5.js → index.es496-C3FkfJm5.js} +0 -0
- /package/dist/app/assets/{index.es535-CVw76BM1.js → index.es499-CVw76BM1.js} +0 -0
- /package/dist/app/assets/{index.es536-HnGAYVZD.js → index.es500-HnGAYVZD.js} +0 -0
- /package/dist/app/assets/{index.es537-BVz_zdnA.js → index.es501-BVz_zdnA.js} +0 -0
- /package/dist/app/assets/{index.es538-C3khCPGq.js → index.es502-C3khCPGq.js} +0 -0
- /package/dist/app/assets/{index.es539-D-2ljcwZ.js → index.es503-D-2ljcwZ.js} +0 -0
- /package/dist/app/assets/{index.es540-Cv9koXgw.js → index.es504-Cv9koXgw.js} +0 -0
- /package/dist/app/assets/{index.es541-CD_QflpE.js → index.es505-CD_QflpE.js} +0 -0
- /package/dist/app/assets/{index.es542-DRW-0cLl.js → index.es506-DRW-0cLl.js} +0 -0
- /package/dist/app/assets/{index.es543-C-_shW-Y.js → index.es507-C-_shW-Y.js} +0 -0
- /package/dist/app/assets/{index.es544-LGGdnPYs.js → index.es508-LGGdnPYs.js} +0 -0
- /package/dist/app/assets/{index.es545-C3mMm8J8.js → index.es509-C3mMm8J8.js} +0 -0
- /package/dist/app/assets/{index.es546-BzJJZx-M.js → index.es510-BzJJZx-M.js} +0 -0
- /package/dist/app/assets/{index.es547-BXkSAIEj.js → index.es511-BXkSAIEj.js} +0 -0
- /package/dist/app/assets/{index.es548-BgDCqdQA.js → index.es512-BgDCqdQA.js} +0 -0
- /package/dist/app/assets/{index.es549-C8M2exoo.js → index.es513-C8M2exoo.js} +0 -0
- /package/dist/app/assets/{index.es550-DHJKELXO.js → index.es514-DHJKELXO.js} +0 -0
- /package/dist/app/assets/{index.es551-Cuk6v7N8.js → index.es515-Cuk6v7N8.js} +0 -0
- /package/dist/app/assets/{index.es552-DH5Ifo-i.js → index.es516-DH5Ifo-i.js} +0 -0
- /package/dist/app/assets/{index.es553-E3gJ1_iC.js → index.es517-E3gJ1_iC.js} +0 -0
- /package/dist/app/assets/{index.es554-DAi9KRSo.js → index.es518-DAi9KRSo.js} +0 -0
- /package/dist/app/assets/{index.es555-D7oLnXFd.js → index.es519-D7oLnXFd.js} +0 -0
- /package/dist/app/assets/{index.es556-BfjtVDDH.js → index.es520-BfjtVDDH.js} +0 -0
- /package/dist/app/assets/{index.es557-DnULxvSX.js → index.es521-DnULxvSX.js} +0 -0
- /package/dist/app/assets/{index.es558-CkXjmgJE.js → index.es522-CkXjmgJE.js} +0 -0
- /package/dist/app/assets/{index.es559-CfQXZHmo.js → index.es523-CfQXZHmo.js} +0 -0
- /package/dist/app/assets/{index.es560-DWedfzmr.js → index.es524-DWedfzmr.js} +0 -0
- /package/dist/app/assets/{index.es561-DUszq2jm.js → index.es525-DUszq2jm.js} +0 -0
- /package/dist/app/assets/{index.es562-B7mTdjB0.js → index.es526-B7mTdjB0.js} +0 -0
- /package/dist/app/assets/{index.es563-D5KoaKCx.js → index.es527-D5KoaKCx.js} +0 -0
- /package/dist/app/assets/{index.es564-BfHTSMKl.js → index.es528-BfHTSMKl.js} +0 -0
- /package/dist/app/assets/{index.es565-B0m2ddpp.js → index.es529-B0m2ddpp.js} +0 -0
- /package/dist/app/assets/{index.es566-CyktbL80.js → index.es530-CyktbL80.js} +0 -0
- /package/dist/app/assets/{index.es567-Csfq5Kiy.js → index.es531-Csfq5Kiy.js} +0 -0
- /package/dist/app/assets/{index.es568-CafNBF8u.js → index.es532-CafNBF8u.js} +0 -0
- /package/dist/app/assets/{index.es569-CTRr51gU.js → index.es533-CTRr51gU.js} +0 -0
- /package/dist/app/assets/{index.es570-D4h5O-jR.js → index.es534-D4h5O-jR.js} +0 -0
- /package/dist/app/assets/{index.es571-C39BiMTA.js → index.es535-C39BiMTA.js} +0 -0
- /package/dist/app/assets/{index.es572-Ddv68eIx.js → index.es536-Ddv68eIx.js} +0 -0
- /package/dist/app/assets/{index.es573-GBQ2dnAY.js → index.es537-GBQ2dnAY.js} +0 -0
- /package/dist/app/assets/{index.es574-PoHY5YXO.js → index.es538-PoHY5YXO.js} +0 -0
- /package/dist/app/assets/{index.es575-3e1v2bzS.js → index.es539-3e1v2bzS.js} +0 -0
- /package/dist/app/assets/{index.es576-CS3Unz2-.js → index.es540-CS3Unz2-.js} +0 -0
- /package/dist/app/assets/{index.es577-bN70gL4F.js → index.es541-bN70gL4F.js} +0 -0
- /package/dist/app/assets/{index.es578-CmCqftbK.js → index.es542-CmCqftbK.js} +0 -0
- /package/dist/app/assets/{index.es579-Ds-gbosJ.js → index.es543-Ds-gbosJ.js} +0 -0
- /package/dist/app/assets/{index.es580-CjDtw9vr.js → index.es544-CjDtw9vr.js} +0 -0
- /package/dist/app/assets/{index.es581-BthQWCQV.js → index.es545-BthQWCQV.js} +0 -0
- /package/dist/app/assets/{index.es582-DqwNpetd.js → index.es546-DqwNpetd.js} +0 -0
- /package/dist/app/assets/{index.es583-Bw305WKR.js → index.es547-Bw305WKR.js} +0 -0
- /package/dist/app/assets/{index.es584-DXbdFlpD.js → index.es548-DXbdFlpD.js} +0 -0
- /package/dist/app/assets/{index.es585-L9t79GZl.js → index.es549-L9t79GZl.js} +0 -0
- /package/dist/app/assets/{index.es586-CbfX1IO0.js → index.es550-CbfX1IO0.js} +0 -0
- /package/dist/app/assets/{index.es587-DBQeEorK.js → index.es551-DBQeEorK.js} +0 -0
- /package/dist/app/assets/{index.es588-BEBZ7ncR.js → index.es552-BEBZ7ncR.js} +0 -0
- /package/dist/app/assets/{index.es589-Bkuqu6BP.js → index.es553-Bkuqu6BP.js} +0 -0
- /package/dist/app/assets/{index.es590-D0r3Knsf.js → index.es554-D0r3Knsf.js} +0 -0
- /package/dist/app/assets/{index.es591-CVO1_9PV.js → index.es555-CVO1_9PV.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as b,q as z,s as A,a6 as lt,a7 as ie,x as k,j as t,F as N,H as U,L as Ee,a8 as He,w as W,T as w,A as F,J as H,a9 as ct,aa as We,ab as Be,K as dt,D as Q,Z as Y,W as X,ac as te,ad as oe,ae as se,B as T,y as ee,af as pt,e as Z,R as _,a as le,b as Ce,v as we,N as Se,M as Ge,E as ce,ag as Oe,ah as Ke,C as ke,Q as Le,d as ut,G as xt,I as $e,P as ge,ai as mt,u as ht,a5 as Te,S as je,a0 as Ye,aj as Ve,V as gt}from"./index-CPPmFTED.js";import{f as bt}from"./index.es20-lNMjicWC.js";import{I as yt}from"./index.es7-Baro92Ee.js";import{L as de,i as ft,a as Pe,D as Re}from"./listItemTextClasses-BS6WKuj5.js";import{L as ue,b as jt,S as Je,P as vt,G as D}from"./Edit-DxSFhHwr.js";import{F as Ct}from"./FormControlContext-DB8XoAZ6.js";import{D as Qe,a as Xe,b as Ze}from"./DialogTitle-BoaRUY5e.js";import"./index.modern-BPeknk47.js";import"./Modal-B09ILQKb.js";function wt({props:e,states:o,muiFormControl:s}){return o.reduce((n,a)=>(n[a]=e[a],s&&typeof e[a]>"u"&&(n[a]=s[a]),n),{})}function _e(){return b.useContext(Ct)}function St(e){return z("PrivateSwitchBase",e)}A("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const kt=e=>{const{classes:o,checked:s,disabled:n,edge:a}=e,r={root:["root",s&&"checked",n&&"disabled",a&&`edge${N(a)}`],input:["input"]};return U(r,St,o)},$t=k(Ee,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:o})=>e==="start"&&o.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:o})=>e==="end"&&o.size!=="small",style:{marginRight:-12}}]}),Tt=k("input",{name:"MuiSwitchBase",shouldForwardProp:He})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Pt=b.forwardRef(function(o,s){const{autoFocus:n,checked:a,checkedIcon:r,defaultChecked:c,disabled:i,disableFocusRipple:u=!1,edge:d=!1,icon:l,id:x,inputProps:h,inputRef:g,name:y,onBlur:C,onChange:p,onFocus:f,readOnly:S,required:m=!1,tabIndex:v,type:P,value:G,slots:ne={},slotProps:O={},...V}=o,[q,ae]=lt({controlled:a,default:!!c,name:"SwitchBase",state:"checked"}),I=_e(),J=$=>{f&&f($),I&&I.onFocus&&I.onFocus($)},M=$=>{C&&C($),I&&I.onBlur&&I.onBlur($)},B=$=>{if($.nativeEvent.defaultPrevented)return;const E=$.target.checked;ae(E),p&&p($,E)};let L=i;I&&typeof L>"u"&&(L=I.disabled);const st=P==="checkbox"||P==="radio",fe={...o,checked:q,disabled:L,disableFocusRipple:u,edge:d},Fe=kt(fe),Ie={slots:ne,slotProps:{input:h,...O}},[nt,at]=ie("root",{ref:s,elementType:$t,className:Fe.root,shouldForwardComponentProp:!0,externalForwardedProps:{...Ie,component:"span",...V},getSlotProps:$=>({...$,onFocus:E=>{$.onFocus?.(E),J(E)},onBlur:E=>{$.onBlur?.(E),M(E)}}),ownerState:fe,additionalProps:{centerRipple:!0,focusRipple:!u,disabled:L,role:void 0,tabIndex:null}}),[rt,it]=ie("input",{ref:g,elementType:Tt,className:Fe.input,externalForwardedProps:Ie,getSlotProps:$=>({...$,onChange:E=>{$.onChange?.(E),B(E)}}),ownerState:fe,additionalProps:{autoFocus:n,checked:a,defaultChecked:c,disabled:L,id:st?x:void 0,name:y,readOnly:S,required:m,tabIndex:v,type:P,...P==="checkbox"&&G===void 0?{}:{value:G}}});return t.jsxs(nt,{...at,children:[t.jsx(rt,{...it}),q?r:l]})});function Rt(e){return z("MuiFormControlLabel",e)}const pe=A("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Nt=e=>{const{classes:o,disabled:s,labelPlacement:n,error:a,required:r}=e,c={root:["root",s&&"disabled",`labelPlacement${N(n)}`,a&&"error",r&&"required"],label:["label",s&&"disabled"],asterisk:["asterisk",a&&"error"]};return U(c,Rt,o)},Mt=k("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[{[`& .${pe.label}`]:o.label},o.root,o[`labelPlacement${N(s.labelPlacement)}`]]}})(H(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${pe.disabled}`]:{cursor:"default"},[`& .${pe.label}`]:{[`&.${pe.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:o})=>o==="start"||o==="top"||o==="bottom",style:{marginLeft:16}}]}))),Ft=k("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(H(({theme:e})=>({[`&.${pe.error}`]:{color:(e.vars||e).palette.error.main}}))),It=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiFormControlLabel"}),{checked:a,className:r,componentsProps:c={},control:i,disabled:u,disableTypography:d,inputRef:l,label:x,labelPlacement:h="end",name:g,onChange:y,required:C,slots:p={},slotProps:f={},value:S,...m}=n,v=_e(),P=u??i.props.disabled??v?.disabled,G=C??i.props.required,ne={disabled:P,required:G};["checked","name","onChange","value","inputRef"].forEach(B=>{typeof i.props[B]>"u"&&typeof n[B]<"u"&&(ne[B]=n[B])});const O=wt({props:n,muiFormControl:v,states:["error"]}),V={...n,disabled:P,labelPlacement:h,required:G,error:O.error},q=Nt(V),ae={slots:p,slotProps:{...c,...f}},[I,J]=ie("typography",{elementType:w,externalForwardedProps:ae,ownerState:V});let M=x;return M!=null&&M.type!==w&&!d&&(M=t.jsx(I,{component:"span",...J,className:F(q.label,J?.className),children:M})),t.jsxs(Mt,{className:F(q.root,r),ownerState:V,ref:s,...m,children:[b.cloneElement(i,ne),G?t.jsxs("div",{children:[M,t.jsxs(Ft,{ownerState:V,"aria-hidden":!0,className:q.asterisk,children:[" ","*"]})]}):M]})});function Bt(e){return z("MuiListItem",e)}A("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function Lt(e){return z("MuiListItemButton",e)}const re=A("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Dt=(e,o)=>{const{ownerState:s}=e;return[o.root,s.dense&&o.dense,s.alignItems==="flex-start"&&o.alignItemsFlexStart,s.divider&&o.divider,!s.disableGutters&&o.gutters]},zt=e=>{const{alignItems:o,classes:s,dense:n,disabled:a,disableGutters:r,divider:c,selected:i}=e,d=U({root:["root",n&&"dense",!r&&"gutters",c&&"divider",a&&"disabled",o==="flex-start"&&"alignItemsFlexStart",i&&"selected"]},Lt,s);return{...s,...d}},At=k(Ee,{shouldForwardProp:e=>He(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:Dt})(H(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${re.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${re.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${re.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${re.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${re.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:o})=>o.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:o})=>!o.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:o})=>o.dense,style:{paddingTop:4,paddingBottom:4}}]}))),et=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiListItemButton"}),{alignItems:a="center",autoFocus:r=!1,component:c="div",children:i,dense:u=!1,disableGutters:d=!1,divider:l=!1,focusVisibleClassName:x,selected:h=!1,className:g,...y}=n,C=b.useContext(de),p=b.useMemo(()=>({dense:u||C.dense||!1,alignItems:a,disableGutters:d}),[a,C.dense,u,d]),f=b.useRef(null);ct(()=>{r&&f.current&&f.current.focus()},[r]);const S={...n,alignItems:a,dense:p.dense,disableGutters:d,divider:l,selected:h},m=zt(S),v=We(f,s);return t.jsx(de.Provider,{value:p,children:t.jsx(At,{ref:v,href:y.href||y.to,component:(y.href||y.to)&&c==="div"?"button":c,focusVisibleClassName:F(m.focusVisible,x),ownerState:S,className:F(m.root,g),...y,classes:m,children:i})})});function Ut(e){return z("MuiListItemSecondaryAction",e)}A("MuiListItemSecondaryAction",["root","disableGutters"]);const qt=e=>{const{disableGutters:o,classes:s}=e;return U({root:["root",o&&"disableGutters"]},Ut,s)},Et=k("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,s.disableGutters&&o.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),tt=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiListItemSecondaryAction"}),{className:a,...r}=n,c=b.useContext(de),i={...n,disableGutters:c.disableGutters},u=qt(i);return t.jsx(Et,{className:F(u.root,a),ownerState:i,ref:s,...r})});tt.muiName="ListItemSecondaryAction";const Ht=(e,o)=>{const{ownerState:s}=e;return[o.root,s.dense&&o.dense,s.alignItems==="flex-start"&&o.alignItemsFlexStart,s.divider&&o.divider,!s.disableGutters&&o.gutters,!s.disablePadding&&o.padding,s.hasSecondaryAction&&o.secondaryAction]},Wt=e=>{const{alignItems:o,classes:s,dense:n,disableGutters:a,disablePadding:r,divider:c,hasSecondaryAction:i}=e;return U({root:["root",n&&"dense",!a&&"gutters",!r&&"padding",c&&"divider",o==="flex-start"&&"alignItemsFlexStart",i&&"secondaryAction"],container:["container"]},Bt,s)},Gt=k("div",{name:"MuiListItem",slot:"Root",overridesResolver:Ht})(H(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:o})=>!o.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:o})=>!o.disablePadding&&o.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:o})=>!o.disablePadding&&!o.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:o})=>!o.disablePadding&&!!o.secondaryAction,style:{paddingRight:48}},{props:({ownerState:o})=>!!o.secondaryAction,style:{[`& > .${re.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:o})=>o.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:o})=>o.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:o})=>o.hasSecondaryAction,style:{paddingRight:48}}]}))),Ot=k("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),he=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiListItem"}),{alignItems:a="center",children:r,className:c,component:i,components:u={},componentsProps:d={},ContainerComponent:l="li",ContainerProps:{className:x,...h}={},dense:g=!1,disableGutters:y=!1,disablePadding:C=!1,divider:p=!1,secondaryAction:f,slotProps:S={},slots:m={},...v}=n,P=b.useContext(de),G=b.useMemo(()=>({dense:g||P.dense||!1,alignItems:a,disableGutters:y}),[a,P.dense,g,y]),ne=b.useRef(null),O=b.Children.toArray(r),V=O.length&&ft(O[O.length-1],["ListItemSecondaryAction"]),q={...n,alignItems:a,dense:G.dense,disableGutters:y,disablePadding:C,divider:p,hasSecondaryAction:V},ae=Wt(q),I=We(ne,s),J=m.root||u.Root||Gt,M=S.root||d.root||{},B={className:F(ae.root,M.className,c),...v};let L=i||"li";return V?(L=!B.component&&!i?"div":L,l==="li"&&(L==="li"?L="div":B.component==="li"&&(B.component="div")),t.jsx(de.Provider,{value:G,children:t.jsxs(Ot,{as:l,className:F(ae.container,x),ref:I,ownerState:q,...h,children:[t.jsx(J,{...M,...!Be(J)&&{as:L,ownerState:{...q,...M.ownerState}},...B,children:O}),O.pop()]})})):t.jsx(de.Provider,{value:G,children:t.jsxs(J,{...M,as:L,ref:I,...!Be(J)&&{ownerState:{...q,...M.ownerState}},...B,children:[O,f&&t.jsx(tt,{children:f})]})})});function Kt(e){return z("MuiSwitch",e)}const R=A("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Yt=e=>{const{classes:o,edge:s,size:n,color:a,checked:r,disabled:c}=e,i={root:["root",s&&`edge${N(s)}`,`size${N(n)}`],switchBase:["switchBase",`color${N(a)}`,r&&"checked",c&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},u=U(i,Kt,o);return{...o,...u}},Vt=k("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,s.edge&&o[`edge${N(s.edge)}`],o[`size${N(s.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${R.thumb}`]:{width:16,height:16},[`& .${R.switchBase}`]:{padding:4,[`&.${R.checked}`]:{transform:"translateX(16px)"}}}}]}),Jt=k(Pt,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.switchBase,{[`& .${R.input}`]:o.input},s.color!=="default"&&o[`color${N(s.color)}`]]}})(H(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${R.checked}`]:{transform:"translateX(20px)"},[`&.${R.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${R.checked} + .${R.track}`]:{opacity:.5},[`&.${R.disabled} + .${R.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${R.input}`]:{left:"-100%",width:"300%"}})),H(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(dt(["light"])).map(([o])=>({props:{color:o},style:{[`&.${R.checked}`]:{color:(e.vars||e).palette[o].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[o].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${R.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${o}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[o].main,.62):e.darken(e.palette[o].main,.55)}`}},[`&.${R.checked} + .${R.track}`]:{backgroundColor:(e.vars||e).palette[o].main}}}))]}))),Qt=k("span",{name:"MuiSwitch",slot:"Track"})(H(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),Xt=k("span",{name:"MuiSwitch",slot:"Thumb"})(H(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Zt=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiSwitch"}),{className:a,color:r="primary",edge:c=!1,size:i="medium",sx:u,slots:d={},slotProps:l={},...x}=n,h={...n,color:r,edge:c,size:i},g=Yt(h),y={slots:d,slotProps:l},[C,p]=ie("root",{className:F(g.root,a),elementType:Vt,externalForwardedProps:y,ownerState:h,additionalProps:{sx:u}}),[f,S]=ie("thumb",{className:g.thumb,elementType:Xt,externalForwardedProps:y,ownerState:h}),m=t.jsx(f,{...S}),[v,P]=ie("track",{className:g.track,elementType:Qt,externalForwardedProps:y,ownerState:h});return t.jsxs(C,{...p,children:[t.jsx(Jt,{type:"checkbox",icon:m,checkedIcon:m,ref:s,ownerState:h,...x,classes:{...g,root:g.switchBase},slots:{...d.switchBase&&{root:d.switchBase},...d.input&&{input:d.input}},slotProps:{...l.switchBase&&{root:typeof l.switchBase=="function"?l.switchBase(h):l.switchBase},input:{role:"switch"},...l.input&&{input:typeof l.input=="function"?l.input(h):l.input}}}),t.jsx(v,{...P})]})}),ot=b.createContext();function _t(e){return z("MuiTable",e)}A("MuiTable",["root","stickyHeader"]);const eo=e=>{const{classes:o,stickyHeader:s}=e;return U({root:["root",s&&"stickyHeader"]},_t,o)},to=k("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,s.stickyHeader&&o.stickyHeader]}})(H(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:o})=>o.stickyHeader,style:{borderCollapse:"separate"}}]}))),De="table",xe=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTable"}),{className:a,component:r=De,padding:c="normal",size:i="medium",stickyHeader:u=!1,...d}=n,l={...n,component:r,padding:c,size:i,stickyHeader:u},x=eo(l),h=b.useMemo(()=>({padding:c,size:i,stickyHeader:u}),[c,i,u]);return t.jsx(ot.Provider,{value:h,children:t.jsx(to,{as:r,role:r===De?null:"table",ref:s,className:F(x.root,a),ownerState:l,...d})})}),ye=b.createContext();function oo(e){return z("MuiTableBody",e)}A("MuiTableBody",["root"]);const so=e=>{const{classes:o}=e;return U({root:["root"]},oo,o)},no=k("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),ao={variant:"body"},ze="tbody",me=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTableBody"}),{className:a,component:r=ze,...c}=n,i={...n,component:r},u=so(i);return t.jsx(ye.Provider,{value:ao,children:t.jsx(no,{className:F(u.root,a),as:r,ref:s,role:r===ze?null:"rowgroup",ownerState:i,...c})})});function ro(e){return z("MuiTableCell",e)}const io=A("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),lo=e=>{const{classes:o,variant:s,align:n,padding:a,size:r,stickyHeader:c}=e,i={root:["root",s,c&&"stickyHeader",n!=="inherit"&&`align${N(n)}`,a!=="normal"&&`padding${N(a)}`,`size${N(r)}`]};return U(i,ro,o)},co=k("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,o[s.variant],o[`size${N(s.size)}`],s.padding!=="normal"&&o[`padding${N(s.padding)}`],s.align!=="inherit"&&o[`align${N(s.align)}`],s.stickyHeader&&o.stickyHeader]}})(H(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
|
|
1
|
+
import{r as b,q as z,s as A,a6 as lt,a7 as ie,x as k,j as t,F as N,H as U,L as Ee,a8 as He,w as W,T as w,A as F,J as H,a9 as ct,aa as We,ab as Be,K as dt,D as Q,Z as Y,W as X,ac as te,ad as oe,ae as se,B as T,y as ee,af as pt,e as Z,R as _,a as le,b as Ce,v as we,N as Se,M as Ge,E as ce,ag as Oe,ah as Ke,C as ke,Q as Le,d as ut,G as xt,I as $e,P as ge,ai as mt,u as ht,a5 as Te,S as je,a0 as Ye,aj as Ve,V as gt}from"./index-BS_9W4Tt.js";import{f as bt}from"./index.es20-DzH7kq4S.js";import{I as yt}from"./index.es7-Lspe9b-6.js";import{L as de,i as ft,a as Pe,D as Re}from"./listItemTextClasses-D0rI_qhy.js";import{L as ue,b as jt,S as Je,P as vt,G as D}from"./Edit-Do7LZWER.js";import{F as Ct}from"./FormControlContext-Ccuzn_SP.js";import{D as Qe,a as Xe,b as Ze}from"./DialogTitle-Df6dToBj.js";import"./index.modern-J74LOUay.js";import"./Modal-BbVeNLvO.js";function wt({props:e,states:o,muiFormControl:s}){return o.reduce((n,a)=>(n[a]=e[a],s&&typeof e[a]>"u"&&(n[a]=s[a]),n),{})}function _e(){return b.useContext(Ct)}function St(e){return z("PrivateSwitchBase",e)}A("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const kt=e=>{const{classes:o,checked:s,disabled:n,edge:a}=e,r={root:["root",s&&"checked",n&&"disabled",a&&`edge${N(a)}`],input:["input"]};return U(r,St,o)},$t=k(Ee,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:o})=>e==="start"&&o.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:o})=>e==="end"&&o.size!=="small",style:{marginRight:-12}}]}),Tt=k("input",{name:"MuiSwitchBase",shouldForwardProp:He})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Pt=b.forwardRef(function(o,s){const{autoFocus:n,checked:a,checkedIcon:r,defaultChecked:c,disabled:i,disableFocusRipple:u=!1,edge:d=!1,icon:l,id:x,inputProps:h,inputRef:g,name:y,onBlur:C,onChange:p,onFocus:f,readOnly:S,required:m=!1,tabIndex:v,type:P,value:G,slots:ne={},slotProps:O={},...V}=o,[q,ae]=lt({controlled:a,default:!!c,name:"SwitchBase",state:"checked"}),I=_e(),J=$=>{f&&f($),I&&I.onFocus&&I.onFocus($)},M=$=>{C&&C($),I&&I.onBlur&&I.onBlur($)},B=$=>{if($.nativeEvent.defaultPrevented)return;const E=$.target.checked;ae(E),p&&p($,E)};let L=i;I&&typeof L>"u"&&(L=I.disabled);const st=P==="checkbox"||P==="radio",fe={...o,checked:q,disabled:L,disableFocusRipple:u,edge:d},Fe=kt(fe),Ie={slots:ne,slotProps:{input:h,...O}},[nt,at]=ie("root",{ref:s,elementType:$t,className:Fe.root,shouldForwardComponentProp:!0,externalForwardedProps:{...Ie,component:"span",...V},getSlotProps:$=>({...$,onFocus:E=>{$.onFocus?.(E),J(E)},onBlur:E=>{$.onBlur?.(E),M(E)}}),ownerState:fe,additionalProps:{centerRipple:!0,focusRipple:!u,disabled:L,role:void 0,tabIndex:null}}),[rt,it]=ie("input",{ref:g,elementType:Tt,className:Fe.input,externalForwardedProps:Ie,getSlotProps:$=>({...$,onChange:E=>{$.onChange?.(E),B(E)}}),ownerState:fe,additionalProps:{autoFocus:n,checked:a,defaultChecked:c,disabled:L,id:st?x:void 0,name:y,readOnly:S,required:m,tabIndex:v,type:P,...P==="checkbox"&&G===void 0?{}:{value:G}}});return t.jsxs(nt,{...at,children:[t.jsx(rt,{...it}),q?r:l]})});function Rt(e){return z("MuiFormControlLabel",e)}const pe=A("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Nt=e=>{const{classes:o,disabled:s,labelPlacement:n,error:a,required:r}=e,c={root:["root",s&&"disabled",`labelPlacement${N(n)}`,a&&"error",r&&"required"],label:["label",s&&"disabled"],asterisk:["asterisk",a&&"error"]};return U(c,Rt,o)},Mt=k("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[{[`& .${pe.label}`]:o.label},o.root,o[`labelPlacement${N(s.labelPlacement)}`]]}})(H(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${pe.disabled}`]:{cursor:"default"},[`& .${pe.label}`]:{[`&.${pe.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:o})=>o==="start"||o==="top"||o==="bottom",style:{marginLeft:16}}]}))),Ft=k("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(H(({theme:e})=>({[`&.${pe.error}`]:{color:(e.vars||e).palette.error.main}}))),It=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiFormControlLabel"}),{checked:a,className:r,componentsProps:c={},control:i,disabled:u,disableTypography:d,inputRef:l,label:x,labelPlacement:h="end",name:g,onChange:y,required:C,slots:p={},slotProps:f={},value:S,...m}=n,v=_e(),P=u??i.props.disabled??v?.disabled,G=C??i.props.required,ne={disabled:P,required:G};["checked","name","onChange","value","inputRef"].forEach(B=>{typeof i.props[B]>"u"&&typeof n[B]<"u"&&(ne[B]=n[B])});const O=wt({props:n,muiFormControl:v,states:["error"]}),V={...n,disabled:P,labelPlacement:h,required:G,error:O.error},q=Nt(V),ae={slots:p,slotProps:{...c,...f}},[I,J]=ie("typography",{elementType:w,externalForwardedProps:ae,ownerState:V});let M=x;return M!=null&&M.type!==w&&!d&&(M=t.jsx(I,{component:"span",...J,className:F(q.label,J?.className),children:M})),t.jsxs(Mt,{className:F(q.root,r),ownerState:V,ref:s,...m,children:[b.cloneElement(i,ne),G?t.jsxs("div",{children:[M,t.jsxs(Ft,{ownerState:V,"aria-hidden":!0,className:q.asterisk,children:[" ","*"]})]}):M]})});function Bt(e){return z("MuiListItem",e)}A("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function Lt(e){return z("MuiListItemButton",e)}const re=A("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Dt=(e,o)=>{const{ownerState:s}=e;return[o.root,s.dense&&o.dense,s.alignItems==="flex-start"&&o.alignItemsFlexStart,s.divider&&o.divider,!s.disableGutters&&o.gutters]},zt=e=>{const{alignItems:o,classes:s,dense:n,disabled:a,disableGutters:r,divider:c,selected:i}=e,d=U({root:["root",n&&"dense",!r&&"gutters",c&&"divider",a&&"disabled",o==="flex-start"&&"alignItemsFlexStart",i&&"selected"]},Lt,s);return{...s,...d}},At=k(Ee,{shouldForwardProp:e=>He(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:Dt})(H(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${re.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${re.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${re.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${re.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${re.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:o})=>o.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:o})=>!o.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:o})=>o.dense,style:{paddingTop:4,paddingBottom:4}}]}))),et=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiListItemButton"}),{alignItems:a="center",autoFocus:r=!1,component:c="div",children:i,dense:u=!1,disableGutters:d=!1,divider:l=!1,focusVisibleClassName:x,selected:h=!1,className:g,...y}=n,C=b.useContext(de),p=b.useMemo(()=>({dense:u||C.dense||!1,alignItems:a,disableGutters:d}),[a,C.dense,u,d]),f=b.useRef(null);ct(()=>{r&&f.current&&f.current.focus()},[r]);const S={...n,alignItems:a,dense:p.dense,disableGutters:d,divider:l,selected:h},m=zt(S),v=We(f,s);return t.jsx(de.Provider,{value:p,children:t.jsx(At,{ref:v,href:y.href||y.to,component:(y.href||y.to)&&c==="div"?"button":c,focusVisibleClassName:F(m.focusVisible,x),ownerState:S,className:F(m.root,g),...y,classes:m,children:i})})});function Ut(e){return z("MuiListItemSecondaryAction",e)}A("MuiListItemSecondaryAction",["root","disableGutters"]);const qt=e=>{const{disableGutters:o,classes:s}=e;return U({root:["root",o&&"disableGutters"]},Ut,s)},Et=k("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,s.disableGutters&&o.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),tt=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiListItemSecondaryAction"}),{className:a,...r}=n,c=b.useContext(de),i={...n,disableGutters:c.disableGutters},u=qt(i);return t.jsx(Et,{className:F(u.root,a),ownerState:i,ref:s,...r})});tt.muiName="ListItemSecondaryAction";const Ht=(e,o)=>{const{ownerState:s}=e;return[o.root,s.dense&&o.dense,s.alignItems==="flex-start"&&o.alignItemsFlexStart,s.divider&&o.divider,!s.disableGutters&&o.gutters,!s.disablePadding&&o.padding,s.hasSecondaryAction&&o.secondaryAction]},Wt=e=>{const{alignItems:o,classes:s,dense:n,disableGutters:a,disablePadding:r,divider:c,hasSecondaryAction:i}=e;return U({root:["root",n&&"dense",!a&&"gutters",!r&&"padding",c&&"divider",o==="flex-start"&&"alignItemsFlexStart",i&&"secondaryAction"],container:["container"]},Bt,s)},Gt=k("div",{name:"MuiListItem",slot:"Root",overridesResolver:Ht})(H(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:o})=>!o.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:o})=>!o.disablePadding&&o.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:o})=>!o.disablePadding&&!o.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:o})=>!o.disablePadding&&!!o.secondaryAction,style:{paddingRight:48}},{props:({ownerState:o})=>!!o.secondaryAction,style:{[`& > .${re.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:o})=>o.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:o})=>o.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:o})=>o.hasSecondaryAction,style:{paddingRight:48}}]}))),Ot=k("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),he=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiListItem"}),{alignItems:a="center",children:r,className:c,component:i,components:u={},componentsProps:d={},ContainerComponent:l="li",ContainerProps:{className:x,...h}={},dense:g=!1,disableGutters:y=!1,disablePadding:C=!1,divider:p=!1,secondaryAction:f,slotProps:S={},slots:m={},...v}=n,P=b.useContext(de),G=b.useMemo(()=>({dense:g||P.dense||!1,alignItems:a,disableGutters:y}),[a,P.dense,g,y]),ne=b.useRef(null),O=b.Children.toArray(r),V=O.length&&ft(O[O.length-1],["ListItemSecondaryAction"]),q={...n,alignItems:a,dense:G.dense,disableGutters:y,disablePadding:C,divider:p,hasSecondaryAction:V},ae=Wt(q),I=We(ne,s),J=m.root||u.Root||Gt,M=S.root||d.root||{},B={className:F(ae.root,M.className,c),...v};let L=i||"li";return V?(L=!B.component&&!i?"div":L,l==="li"&&(L==="li"?L="div":B.component==="li"&&(B.component="div")),t.jsx(de.Provider,{value:G,children:t.jsxs(Ot,{as:l,className:F(ae.container,x),ref:I,ownerState:q,...h,children:[t.jsx(J,{...M,...!Be(J)&&{as:L,ownerState:{...q,...M.ownerState}},...B,children:O}),O.pop()]})})):t.jsx(de.Provider,{value:G,children:t.jsxs(J,{...M,as:L,ref:I,...!Be(J)&&{ownerState:{...q,...M.ownerState}},...B,children:[O,f&&t.jsx(tt,{children:f})]})})});function Kt(e){return z("MuiSwitch",e)}const R=A("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Yt=e=>{const{classes:o,edge:s,size:n,color:a,checked:r,disabled:c}=e,i={root:["root",s&&`edge${N(s)}`,`size${N(n)}`],switchBase:["switchBase",`color${N(a)}`,r&&"checked",c&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},u=U(i,Kt,o);return{...o,...u}},Vt=k("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,s.edge&&o[`edge${N(s.edge)}`],o[`size${N(s.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${R.thumb}`]:{width:16,height:16},[`& .${R.switchBase}`]:{padding:4,[`&.${R.checked}`]:{transform:"translateX(16px)"}}}}]}),Jt=k(Pt,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.switchBase,{[`& .${R.input}`]:o.input},s.color!=="default"&&o[`color${N(s.color)}`]]}})(H(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${R.checked}`]:{transform:"translateX(20px)"},[`&.${R.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${R.checked} + .${R.track}`]:{opacity:.5},[`&.${R.disabled} + .${R.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${R.input}`]:{left:"-100%",width:"300%"}})),H(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(dt(["light"])).map(([o])=>({props:{color:o},style:{[`&.${R.checked}`]:{color:(e.vars||e).palette[o].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[o].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${R.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${o}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[o].main,.62):e.darken(e.palette[o].main,.55)}`}},[`&.${R.checked} + .${R.track}`]:{backgroundColor:(e.vars||e).palette[o].main}}}))]}))),Qt=k("span",{name:"MuiSwitch",slot:"Track"})(H(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),Xt=k("span",{name:"MuiSwitch",slot:"Thumb"})(H(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Zt=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiSwitch"}),{className:a,color:r="primary",edge:c=!1,size:i="medium",sx:u,slots:d={},slotProps:l={},...x}=n,h={...n,color:r,edge:c,size:i},g=Yt(h),y={slots:d,slotProps:l},[C,p]=ie("root",{className:F(g.root,a),elementType:Vt,externalForwardedProps:y,ownerState:h,additionalProps:{sx:u}}),[f,S]=ie("thumb",{className:g.thumb,elementType:Xt,externalForwardedProps:y,ownerState:h}),m=t.jsx(f,{...S}),[v,P]=ie("track",{className:g.track,elementType:Qt,externalForwardedProps:y,ownerState:h});return t.jsxs(C,{...p,children:[t.jsx(Jt,{type:"checkbox",icon:m,checkedIcon:m,ref:s,ownerState:h,...x,classes:{...g,root:g.switchBase},slots:{...d.switchBase&&{root:d.switchBase},...d.input&&{input:d.input}},slotProps:{...l.switchBase&&{root:typeof l.switchBase=="function"?l.switchBase(h):l.switchBase},input:{role:"switch"},...l.input&&{input:typeof l.input=="function"?l.input(h):l.input}}}),t.jsx(v,{...P})]})}),ot=b.createContext();function _t(e){return z("MuiTable",e)}A("MuiTable",["root","stickyHeader"]);const eo=e=>{const{classes:o,stickyHeader:s}=e;return U({root:["root",s&&"stickyHeader"]},_t,o)},to=k("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,s.stickyHeader&&o.stickyHeader]}})(H(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:o})=>o.stickyHeader,style:{borderCollapse:"separate"}}]}))),De="table",xe=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTable"}),{className:a,component:r=De,padding:c="normal",size:i="medium",stickyHeader:u=!1,...d}=n,l={...n,component:r,padding:c,size:i,stickyHeader:u},x=eo(l),h=b.useMemo(()=>({padding:c,size:i,stickyHeader:u}),[c,i,u]);return t.jsx(ot.Provider,{value:h,children:t.jsx(to,{as:r,role:r===De?null:"table",ref:s,className:F(x.root,a),ownerState:l,...d})})}),ye=b.createContext();function oo(e){return z("MuiTableBody",e)}A("MuiTableBody",["root"]);const so=e=>{const{classes:o}=e;return U({root:["root"]},oo,o)},no=k("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),ao={variant:"body"},ze="tbody",me=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTableBody"}),{className:a,component:r=ze,...c}=n,i={...n,component:r},u=so(i);return t.jsx(ye.Provider,{value:ao,children:t.jsx(no,{className:F(u.root,a),as:r,ref:s,role:r===ze?null:"rowgroup",ownerState:i,...c})})});function ro(e){return z("MuiTableCell",e)}const io=A("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),lo=e=>{const{classes:o,variant:s,align:n,padding:a,size:r,stickyHeader:c}=e,i={root:["root",s,c&&"stickyHeader",n!=="inherit"&&`align${N(n)}`,a!=="normal"&&`padding${N(a)}`,`size${N(r)}`]};return U(i,ro,o)},co=k("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,o[s.variant],o[`size${N(s.size)}`],s.padding!=="normal"&&o[`padding${N(s.padding)}`],s.align!=="inherit"&&o[`align${N(s.align)}`],s.stickyHeader&&o.stickyHeader]}})(H(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
|
|
2
2
|
${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${io.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:o})=>o.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),j=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTableCell"}),{align:a="inherit",className:r,component:c,padding:i,scope:u,size:d,sortDirection:l,variant:x,...h}=n,g=b.useContext(ot),y=b.useContext(ye),C=y&&y.variant==="head";let p;c?p=c:p=C?"th":"td";let f=u;p==="td"?f=void 0:!f&&C&&(f="col");const S=x||y&&y.variant,m={...n,align:a,component:p,padding:i||(g&&g.padding?g.padding:"normal"),size:d||(g&&g.size?g.size:"medium"),sortDirection:l,stickyHeader:S==="head"&&g&&g.stickyHeader,variant:S},v=lo(m);let P=null;return l&&(P=l==="asc"?"ascending":"descending"),t.jsx(co,{as:p,ref:s,className:F(v.root,r),"aria-sort":P,scope:f,ownerState:m,...h})});function po(e){return z("MuiTableContainer",e)}A("MuiTableContainer",["root"]);const uo=e=>{const{classes:o}=e;return U({root:["root"]},po,o)},xo=k("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),Ne=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTableContainer"}),{className:a,component:r="div",...c}=n,i={...n,component:r},u=uo(i);return t.jsx(xo,{ref:s,as:r,className:F(u.root,a),ownerState:i,...c})});function mo(e){return z("MuiTableHead",e)}A("MuiTableHead",["root"]);const ho=e=>{const{classes:o}=e;return U({root:["root"]},mo,o)},go=k("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),bo={variant:"head"},Ae="thead",Me=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTableHead"}),{className:a,component:r=Ae,...c}=n,i={...n,component:r},u=ho(i);return t.jsx(ye.Provider,{value:bo,children:t.jsx(go,{as:r,className:F(u.root,a),ref:s,role:r===Ae?null:"rowgroup",ownerState:i,...c})})});function yo(e){return z("MuiTableRow",e)}const Ue=A("MuiTableRow",["root","selected","hover","head","footer"]),fo=e=>{const{classes:o,selected:s,hover:n,head:a,footer:r}=e;return U({root:["root",s&&"selected",n&&"hover",a&&"head",r&&"footer"]},yo,o)},jo=k("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,s.head&&o.head,s.footer&&o.footer]}})(H(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Ue.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Ue.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),qe="tr",K=b.forwardRef(function(o,s){const n=W({props:o,name:"MuiTableRow"}),{className:a,component:r=qe,hover:c=!1,selected:i=!1,...u}=n,d=b.useContext(ye),l={...n,component:r,hover:c,selected:i,head:d&&d.variant==="head",footer:d&&d.variant==="footer"},x=fo(l);return t.jsx(jo,{as:r,ref:s,className:F(x.root,a),role:r===qe?null:"row",ownerState:l,...u})});function vo({resourceUri:e}){const{apiClients:o}=Q(),{projectName:s,packageName:n,versionId:a}=Y(e),{data:r,isSuccess:c,isError:i,error:u}=X({queryKey:["package",s,n,a],queryFn:()=>o.packages.getPackage(s,n,a,!1)});return t.jsx(te,{children:t.jsxs(oe,{children:[t.jsx(se,{children:"Package Config"}),t.jsx(T,{sx:{maxHeight:"200px",overflowY:"auto"},children:t.jsxs(Pe,{dense:!0,disablePadding:!0,children:[t.jsx(he,{dense:!0,disablePadding:!0,children:t.jsx(ue,{primary:"Name",primaryTypographyProps:{fontWeight:"500"},secondary:n})}),!c&&!i&&t.jsx(he,{children:t.jsx(ee,{text:"Fetching Package Metadata..."})}),c&&(r.data&&t.jsx(he,{dense:!0,disablePadding:!0,children:t.jsx(ue,{primary:"Description",primaryTypographyProps:{fontWeight:"500"},secondary:r.data.description})})||t.jsxs(he,{disablePadding:!0,dense:!0,sx:{mt:"20px"},children:[t.jsx(pt,{sx:{color:"grey.600",mr:"10px"}}),t.jsx(ue,{primary:"No package manifest"})]})),i&&t.jsx(Z,{error:u,context:`${s} > ${n} > ${a}`})]})})]})})}const be={postgres:[{label:"Host",name:"host",type:"text"},{label:"Port",name:"port",type:"number"},{label:"Database Name",name:"databaseName",type:"text"},{label:"User Name",name:"userName",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Connection String",name:"connectionString",type:"text"}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text"},{label:"Billing Project ID",name:"billingProjectId",type:"text"},{label:"Location",name:"location",type:"text"},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text"},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text"},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text"}],snowflake:[{label:"Account",name:"account",type:"text"},{label:"Username",name:"username",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Warehouse",name:"warehouse",type:"text"},{label:"Database",name:"database",type:"text"},{label:"Schema",name:"schema",type:"text"},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text"}],trino:[{label:"Server",name:"server",type:"text"},{label:"Port",name:"port",type:"number"},{label:"Catalog",name:"catalog",type:"text"},{label:"Schema",name:"schema",type:"text"},{label:"User",name:"user",type:"text"},{label:"Password",name:"password",type:"password"}],mysql:[{label:"Host",name:"host",type:"text"},{label:"Port",name:"port",type:"number"},{label:"User",name:"user",type:"text"},{label:"Password",name:"password",type:"password"},{label:"Database",name:"database",type:"text"}]},ve={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",mysql:"mysqlConnection"};function Co({onSubmit:e,isSubmitting:o}){const[s,n]=b.useState(!1),[a,r]=b.useState("postgres"),c=()=>{n(!0)},i=()=>{n(!1)},u=async d=>{d.preventDefault();const l=new FormData(d.currentTarget),x=l.get("name")?.toString(),h=l.get("type")?.toString(),g=be[h];if(!x)throw new Error("Name is required");if(!h)throw new Error("Type is required");const y={name:x,type:h,[{postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",mysql:"mysqlConnection"}[h]]:g.reduce((C,p)=>(C[p.name]=l.get(p.name)?.toString(),C),{})};await e(y),i()};return t.jsxs(_.Fragment,{children:[t.jsx(le,{variant:"outlined",onClick:c,children:"Add Connection"}),t.jsxs(Ce,{open:s,onClose:i,children:[t.jsx(we,{children:"Create New Connection"}),t.jsxs(Se,{children:[t.jsx(Ge,{children:"Add a new connection to query your data database using Malloy."}),t.jsxs("form",{onSubmit:u,id:"connection-form",children:[t.jsx(ce,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),t.jsx(ce,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:a,select:!0,onChange:d=>r(d.target.value),children:Object.values(Oe).map(d=>t.jsx(Ke,{value:d,children:d},d))}),be[a].map(d=>t.jsx(ce,{margin:"dense",id:d.name,name:d.name,label:d.label,type:d.type,fullWidth:!0,variant:"standard"},d.name))]})]}),t.jsxs(ke,{children:[t.jsx(le,{disabled:o,onClick:i,children:"Cancel"}),t.jsx(le,{type:"submit",form:"connection-form",loading:o,children:"Create Connection"})]})]})]})}function wo({connection:e,onCloseDialog:o,isMutating:s,onDelete:n}){const[a,r]=b.useState(!1),[c,i]=b.useState(""),u=()=>{r(!0)},d=()=>{r(!1),o()};return t.jsxs(_.Fragment,{children:[t.jsx(Le,{onClick:l=>{l.stopPropagation(),u()},children:t.jsx(jt,{})}),t.jsxs(Ce,{onClose:d,"aria-labelledby":"customized-dialog-title",open:a,children:[t.jsx(we,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),t.jsx(Le,{"aria-label":"close",onClick:d,sx:l=>({position:"absolute",right:8,top:8,color:l.palette.grey[500]}),children:t.jsx(ut,{})}),t.jsx(Se,{dividers:!0,children:t.jsxs(xt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),t.jsx(ke,{children:t.jsx(le,{loading:s,variant:"contained",autoFocus:!0,onClick:()=>n(),color:"error",children:"Delete"})}),t.jsx(Je,{open:c!=="",autoHideDuration:6e3,onClose:()=>i(""),message:c})]})]})}function So({connection:e,onSubmit:o,isSubmitting:s}){const[n,a]=b.useState(!1),[r,c]=b.useState(e.type),i=()=>{a(!0)},u=()=>{a(!1)},d=async l=>{l.preventDefault();const x=new FormData(l.currentTarget),h=x.get("name")?.toString(),g=x.get("type")?.toString(),y=be[g];if(!h)throw new Error("Name is required");if(!g)throw new Error("Type is required");const C={name:h,type:g,[ve[g]]:y.reduce((p,f)=>(p[f.name]=x.get(f.name)?.toString()??e[ve[g]][f.name],p),{})};await o(C),u()};return t.jsxs(_.Fragment,{children:[t.jsx($e,{onClick:l=>{l.preventDefault(),l.stopPropagation(),i()},children:t.jsx(vt,{})}),t.jsxs(Ce,{open:n,onClose:u,children:[t.jsx(we,{onClick:l=>{l.stopPropagation()},children:"Edit Connection"}),t.jsxs(Se,{onClick:l=>{l.stopPropagation()},children:[t.jsx(Ge,{children:"Edit a connection to query your data database using Malloy."}),t.jsxs("form",{onSubmit:d,id:"connection-form",children:[t.jsx(ce,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",value:e.name,defaultValue:e.name}),t.jsx(ce,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:r,select:!0,onChange:l=>c(l.target.value),children:Object.values(Oe).map(l=>t.jsx(Ke,{value:l,children:l},l))}),be[r].map(l=>t.jsx(ce,{margin:"dense",id:l.name,name:l.name,label:l.label,type:l.type,fullWidth:!0,variant:"standard",defaultValue:e?.[ve[r]??""]?.[l.name??""]??""},l.name))]})]}),t.jsxs(ke,{onClick:l=>{l.stopPropagation()},children:[t.jsx(le,{disabled:s,onClick:u,children:"Cancel"}),t.jsx(le,{type:"submit",form:"connection-form",loading:s,children:"Edit Connection"})]})]})]})}function ko({connectionName:e,resourceUri:o,schema:s}){const{apiClients:n}=Q(),{projectName:a}=Y(o),[r,c]=_.useState(void 0),[i,u]=_.useState(s||null),[d,l]=_.useState(!1),{data:x,isSuccess:h,isError:g,error:y,isLoading:C}=X({queryKey:["tablePath",a,e],queryFn:()=>n.connections.listSchemas(a,e)});return t.jsxs(D,{container:!0,spacing:1,children:[!s&&t.jsx(D,{size:{xs:12,md:4},children:t.jsxs(ge,{sx:{p:1,m:0},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[t.jsx(w,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),t.jsx(It,{control:t.jsx(Zt,{checked:d,onChange:p=>l(p.target.checked)}),label:"Hidden Schemas"})]}),t.jsx(Re,{sx:{mt:"2px"}}),t.jsxs(T,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[C&&t.jsx(ee,{text:"Fetching Table Paths..."}),g&&t.jsx(Z,{error:y,context:`${a} > ${e}`}),h&&x.data.length===0&&t.jsx(w,{variant:"body2",children:"No Schemas"}),h&&x.data.length>0&&t.jsx(Pe,{dense:!0,disablePadding:!0,children:x.data.filter(({isHidden:p})=>d||!p).sort((p,f)=>p.isDefault===f.isDefault?0:p.isDefault?-1:1).map(p=>{const f=(p.description||"").trim(),S=f!=="",m=S?f.split(/\r?\n/)[0]:void 0,v=t.jsx(et,{selected:i===p.name,onClick:()=>u(p.name),children:t.jsx(ue,{primary:p.name,secondary:m})},p.name);return S?t.jsx(mt,{title:f,arrow:!0,children:v},p.name):v})})]})]})}),t.jsx(D,{size:{xs:12,md:s?6:4},children:i&&t.jsx(ge,{sx:{p:1,m:0},children:t.jsx(To,{connectionName:e,schemaName:i,onTableClick:p=>{c(p)},resourceUri:o})})}),t.jsx(D,{size:{xs:12,md:s?6:4},children:r&&i&&t.jsx(ge,{sx:{p:1,m:0},children:t.jsx($o,{connectionName:e,schemaName:i,tableName:r,resourceUri:o})})})]})}function $o({connectionName:e,schemaName:o,tableName:s,resourceUri:n}){const{apiClients:a}=Q(),{projectName:r}=Y(n),{data:c,isSuccess:i,isError:u,error:d,isLoading:l}=X({queryKey:["tablePathSchema",r,e,o,s],queryFn:()=>a.connections.getTablesource(r,e,s,`${o}.${s}`)});return t.jsxs(t.Fragment,{children:[t.jsxs(w,{variant:"overline",fontWeight:"bold",children:["Schema: ",o,".",s]}),t.jsx(Re,{}),t.jsxs(T,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:[l&&t.jsx(ee,{text:"Fetching Table Details..."}),u&&t.jsx(Z,{error:d,context:`${r} > ${e} > ${o}.${s}`}),i&&c&&t.jsx(Ne,{children:t.jsxs(xe,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[t.jsx(Me,{children:t.jsxs(K,{children:[t.jsx(j,{children:"NAME"}),t.jsx(j,{children:"TYPE"})]})}),t.jsx(me,{children:c.data.columns?.map(x=>t.jsxs(K,{children:[t.jsx(j,{children:x.name}),t.jsx(j,{children:x.type})]},x.name))})]})})]})]})}function To({connectionName:e,schemaName:o,onTableClick:s,resourceUri:n}){const{projectName:a}=Y(n),{apiClients:r}=Q(),{data:c,isSuccess:i,isError:u,error:d,isLoading:l}=X({queryKey:["tablesInSchema",a,e,o],queryFn:()=>r.connections.listTables(a,e,o)});return t.jsxs(t.Fragment,{children:[t.jsxs(w,{variant:"overline",fontWeight:"bold",children:["Tables in ",o]}),t.jsx(Re,{}),t.jsxs(T,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[l&&t.jsx(ee,{text:"Fetching Tables..."}),u&&t.jsx(Z,{error:d,context:`${a} > ${e} > ${o}`}),i&&c.data.length===0&&t.jsx(w,{variant:"body2",children:"No Tables"}),i&&c.data.length>0&&t.jsx(Pe,{dense:!0,disablePadding:!0,children:c.data.map(x=>t.jsx(et,{onClick:()=>s(x),children:t.jsx(ue,{primary:x})},x))})]})]})}function Po({connection:e,onClick:o,onEdit:s,onDelete:n,isMutating:a,mutable:r}){return t.jsxs(K,{sx:{"&:hover":{backgroundColor:"action.hover"}},children:[t.jsx(j,{sx:{cursor:"pointer",flexGrow:1},onClick:o,children:t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(w,{variant:"body2",children:e.name}),t.jsx(Ye,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),t.jsx(j,{sx:{minWidth:"120px"},children:t.jsx(w,{variant:"body2",children:e.type})}),r&&t.jsxs(j,{sx:{minWidth:"120px"},children:[t.jsx(So,{connection:e,onSubmit:s,isSubmitting:a}),t.jsx(wo,{connection:e,onCloseDialog:()=>{},isMutating:a,onDelete:()=>n(e)})]})]},e.name)}function Ro({resourceUri:e}){const{apiClients:o,mutable:s}=Q(),n=ht(),{projectName:a}=Y(e),[r,c]=b.useState(""),[i,u]=b.useState(null),d=Te({projectName:a,connectionName:i}),{data:l,isSuccess:x,isError:h,error:g}=X({queryKey:["connections",a],queryFn:()=>o.connections.listConnections(a)}),y=m=>{u(m)},C=()=>{u(null)},p=je({mutationFn:m=>o.projects.updateProject(a,{name:a,connections:[...l.data,m]}),onSuccess(){c("Connection added successfully"),n.invalidateQueries({queryKey:["connections",a]})},onError(m){c(m.message)}}),f=je({mutationFn:m=>o.projects.updateProject(a,{name:a,connections:l.data.map(v=>v.name===m.name?m:v)}),onSuccess(m,v){c(`Connection ${v.name} updated successfully`),n.invalidateQueries({queryKey:["connections",a]})},onError(m){c(m.message)}}),S=je({mutationFn:m=>o.projects.updateProject(a,{name:a,connections:l.data.filter(v=>v.name!==m.name)}),onSuccess(m,v){c(`Connection ${v.name} deleted successfully`),n.invalidateQueries({queryKey:["connections",a]})},onError(m){c(m.message)}});return t.jsxs(t.Fragment,{children:[t.jsx(te,{children:t.jsxs(oe,{children:[t.jsx(se,{children:"Database Connections"}),t.jsxs(T,{sx:{mb:1,maxHeight:"200px",overflowY:"auto"},children:[!x&&!h&&t.jsx(w,{variant:"body2",sx:{m:"auto"},children:"Fetching Connections..."}),x&&l.data.length>0&&t.jsx(xe,{size:"small",sx:{borderCollapse:"collapse","& .MuiTableRow-root":{display:"flex",width:"100%"},"& .MuiTableCell-root":{borderBottom:"1px solid #e0e0e0",display:"flex",alignItems:"center"},"& .MuiTableRow-root:last-child .MuiTableCell-root":{borderBottom:"none"}},children:t.jsxs(me,{children:[t.jsxs(K,{children:[t.jsx(j,{sx:{flexGrow:1},children:t.jsx(w,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Connection Name"})}),t.jsx(j,{sx:{minWidth:"120px"},children:t.jsx(w,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Type"})}),s&&t.jsx(j,{sx:{minWidth:"120px"},children:t.jsx(w,{variant:"body2",fontWeight:"500",color:"text.secondary",sx:{mx:"auto"},children:"Actions"})})]}),l.data.map(m=>t.jsx(Po,{connection:m,onClick:()=>y(m.name),onEdit:v=>f.mutateAsync(v),onDelete:v=>S.mutateAsync(v),isMutating:f.isPending||S.isPending,mutable:s},m.name))]})}),x&&l.data.length===0&&t.jsx(w,{variant:"body2",children:"No Connections"}),h&&t.jsx(Z,{error:g,context:`${a} > Connections`})]}),s&&t.jsx(T,{sx:{display:"flex",justifyContent:"flex-end"},children:t.jsx(Co,{onSubmit:m=>p.mutateAsync(m),isSubmitting:p.isPending})})]})}),t.jsx(Je,{open:r!=="",autoHideDuration:6e3,onClose:()=>c(""),message:r}),t.jsxs(Qe,{open:i!==null,onClose:C,maxWidth:"lg",fullWidth:!0,children:[t.jsxs(Xe,{children:["Connection Explorer: ",i,t.jsx($e,{"aria-label":"close",onClick:C,sx:{position:"absolute",right:8,top:8},children:t.jsx(T,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),t.jsx(Ze,{children:i&&t.jsx(ko,{resourceUri:d,connectionName:i})})]})]})}function No({resourceUri:e}){const{apiClients:o}=Q(),{projectName:s,packageName:n,versionId:a}=Y(e),[r,c]=_.useState(!1),[i,u]=_.useState(null),d=p=>{u(p),c(!0)},l=()=>{c(!1),u(null)},{data:x,isError:h,error:g,isSuccess:y}=X({queryKey:["databases",s,n,a],queryFn:()=>o.databases.listDatabases(s,n,a)}),C=p=>p>=1024*1024*1024*1024?`${(p/(1024*1024*1024)).toFixed(2)} T`:p>=1024*1024*1024?`${(p/(1024*1024*1024)).toFixed(2)} G`:p>=1024*1024?`${(p/(1024*1024)).toFixed(2)} M`:`${(p/1024).toFixed(2)} K`;return t.jsxs(t.Fragment,{children:[t.jsx(te,{children:t.jsxs(oe,{children:[t.jsx(se,{children:"Embedded Databases"}),t.jsxs(T,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!y&&!h&&t.jsx(ee,{text:"Fetching Databases..."}),h&&t.jsx(Z,{error:g,context:`${s} > ${n} > Databases`}),y&&x.data.length>0&&t.jsx(xe,{size:"small",sx:{borderCollapse:"collapse","& .MuiTableCell-root":{borderBottom:"1px solid #e0e0e0"},"& .MuiTableRow-root:last-child .MuiTableCell-root":{borderBottom:"none"}},children:t.jsxs(me,{children:[t.jsxs(K,{children:[t.jsx(j,{children:t.jsx(w,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Name"})}),t.jsx(j,{align:"right",children:t.jsx(w,{variant:"body2",fontWeight:"500",color:"text.secondary",children:"Rows"})})]}),x.data.map(p=>t.jsxs(K,{onClick:()=>d(p),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:[t.jsx(j,{component:"th",scope:"row",children:t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(w,{variant:"body2",children:p.path}),t.jsx(Ye,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),t.jsx(j,{align:"right",children:t.jsx(w,{variant:"body2",children:C(p.info.rowCount)})})]},p.path))]})}),y&&x.data.length===0&&t.jsx(w,{variant:"body2",sx:{m:"auto"},children:"No databases found"})]})]})}),t.jsxs(Qe,{open:r,onClose:l,maxWidth:"sm",fullWidth:!0,children:[t.jsxs(Xe,{children:[i?.path,t.jsx($e,{"aria-label":"close",onClick:l,sx:{position:"absolute",right:8,top:8},children:t.jsx(T,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),t.jsx(Ze,{children:i?.info?.columns&&t.jsx(Ne,{children:t.jsxs(xe,{size:"small",children:[t.jsx(Me,{children:t.jsxs(K,{children:[t.jsx(j,{children:"Column"}),t.jsx(j,{children:"Type"})]})}),t.jsx(me,{children:i.info.columns.map(p=>t.jsxs(K,{children:[t.jsx(j,{component:"th",scope:"row",children:p.name}),t.jsx(j,{children:p.type})]},p.name))})]})})})]})]})}const Mo=["notebooks/","models/"];function Fo({onClickModelFile:e,resourceUri:o}){const{projectName:s,packageName:n,versionId:a}=Y(o),{apiClients:r}=Q(),{data:c,isError:i,error:u,isSuccess:d}=X({queryKey:["models",s,n,a],queryFn:()=>r.models.listModels(s,n,a)});return t.jsx(te,{children:t.jsxs(oe,{children:[t.jsx(se,{children:"Semantic Models"}),t.jsxs(T,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!d&&!i&&t.jsx(ee,{text:"Fetching Models..."}),i&&t.jsx(Z,{error:u,context:`${s} > ${n} > Models`}),d&&c.data.length>0&&t.jsx(Ve,{items:c.data.sort((l,x)=>l.path.localeCompare(x.path)),onClickTreeNode:e,defaultExpandedItems:Mo}),d&&c.data.length===0&&t.jsx(w,{variant:"body2",children:"No models found"})]})]})})}const Io=["notebooks/"];function Bo({onClickNotebookFile:e,resourceUri:o}){const{apiClients:s}=Q(),{projectName:n,packageName:a,versionId:r}=Y(o),{data:c,isError:i,error:u,isSuccess:d}=X({queryKey:["notebooks",n,a,r],queryFn:()=>s.notebooks.listNotebooks(n,a,r)});return t.jsx(te,{children:t.jsxs(oe,{children:[t.jsx(se,{children:"Notebooks"}),t.jsxs(T,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!d&&!i&&t.jsx(ee,{text:"Fetching Notebooks..."}),i&&t.jsx(Z,{error:u,context:`${n} > ${a} > Notebooks`}),d&&c.data.length>0&&t.jsx(Ve,{items:c.data.sort((l,x)=>l.path.localeCompare(x.path)),defaultExpandedItems:Io,onClickTreeNode:e}),d&&c.data.length===0&&t.jsx(w,{variant:"body2",children:"No notebooks found"})]})]})})}function Lo({resourceUri:e}){const{apiClients:o}=Q(),{projectName:s,packageName:n,versionId:a}=Y(e),{data:r,isError:c,isLoading:i,error:u}=X({queryKey:["schedules",s,n,a],queryFn:()=>o.schedules.listSchedules(s,n,a)});return i?t.jsx(ee,{text:"Fetching Schedules..."}):c?t.jsx(Z,{error:u,context:`${s} > ${n} > Schedules`}):r.data.length?t.jsx(te,{children:t.jsxs(oe,{children:[t.jsx(se,{children:"Scheduler"}),t.jsx(T,{sx:{maxHeight:"200px",overflowY:"auto"},children:t.jsx(Ne,{component:ge,children:t.jsxs(xe,{sx:{minWidth:300},size:"small",children:[t.jsx(Me,{children:t.jsxs(K,{children:[t.jsx(j,{align:"left",children:"Resource"}),t.jsx(j,{align:"left",children:"Schedule"}),t.jsx(j,{align:"left",children:"Action"}),t.jsx(j,{align:"left",children:"Connection"}),t.jsx(j,{align:"left",children:"Last Run"}),t.jsx(j,{align:"left",children:"Status"})]})}),t.jsx(me,{children:r.data.map(d=>t.jsxs(K,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[t.jsx(j,{align:"left",children:d.resource}),t.jsx(j,{align:"left",children:d.schedule}),t.jsx(j,{align:"left",children:d.action}),t.jsx(j,{align:"left",children:d.connection}),t.jsx(j,{align:"left",children:d.lastRunTime?new Date(d.lastRunTime).toLocaleString():"n/a"}),t.jsx(j,{align:"left",children:d.lastRunStatus})]},d.resource))})]})})})]})}):null}const Do="README.malloynb";function zo({onClickPackageFile:e,resourceUri:o}){e||(e=n=>{window.location.href=n});const s=Te({...Y(o),modelPath:Do});return t.jsx(t.Fragment,{children:t.jsxs(D,{container:!0,spacing:3,columns:12,children:[t.jsx(D,{size:{xs:12,md:4},children:t.jsx(vo,{resourceUri:o})}),t.jsx(D,{size:{xs:12,md:4},children:t.jsx(Bo,{onClickNotebookFile:e,resourceUri:o})}),t.jsx(D,{size:{xs:12,md:4},children:t.jsx(Fo,{onClickModelFile:e,resourceUri:o})}),t.jsx(D,{size:{xs:12,md:6},children:t.jsx(No,{resourceUri:o})}),t.jsx(D,{size:{xs:12,md:6},children:t.jsx(Ro,{resourceUri:o})}),t.jsx(D,{size:{xs:12,md:12},children:t.jsx(Lo,{resourceUri:o})}),t.jsx(D,{size:{xs:12,md:12},children:t.jsx(te,{children:t.jsxs(oe,{children:[t.jsx(se,{children:"README"}),t.jsx(T,{sx:{mt:1},children:t.jsx(yt,{resourceUri:s})})]})})})]})})}function Yo(){const{projectName:e,packageName:o}=gt(),s=bt();if(e)if(o){const n=Te({projectName:e,packageName:o});return t.jsx(zo,{onClickPackageFile:s,resourceUri:n})}else return t.jsx("div",{children:t.jsx("h2",{children:"Missing package name"})});else return t.jsx("div",{children:t.jsx("h2",{children:"Missing project name"})})}export{Yo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,j as e,Z as k,D as j,W as I,y as T,ac as q,ad as A,ae as G,B as C,e as M,r as h,u as D,S as F,R as E,a as f,b as w,v as U,N as z,M as R,E as b,C as N,Q,d as V,G as Y,a5 as W,T as P,I as _,ap as O,V as Z}from"./index-
|
|
1
|
+
import{c as L,j as e,Z as k,D as j,W as I,y as T,ac as q,ad as A,ae as G,B as C,e as M,r as h,u as D,S as F,R as E,a as f,b as w,v as U,N as z,M as R,E as b,C as N,Q,d as V,G as Y,a5 as W,T as P,I as _,ap as O,V as Z}from"./index-BS_9W4Tt.js";import{f as J}from"./index.es20-DzH7kq4S.js";import{p as X}from"./index.modern-J74LOUay.js";import{S as $,b as ee,L as B,P as ae,G as y}from"./Edit-Do7LZWER.js";import{M as H,a as re}from"./MenuItem-BWMnNgqP.js";import{L as K,A as se}from"./MoreVert-Dh8A2FDF.js";import{D as ne}from"./listItemTextClasses-D0rI_qhy.js";import"./Modal-BbVeNLvO.js";const te=L(e.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}));function ie({resourceUri:n}){const{projectName:r}=k(n),{apiClients:i}=j(),{data:s,isSuccess:l,isError:t,error:o}=I({queryKey:["about",r],queryFn:()=>i.projects.getProject(r,!1)});return e.jsxs(e.Fragment,{children:[!l&&!t&&e.jsx(T,{text:"Fetching About..."}),l&&s.data?.readme&&e.jsx(q,{children:e.jsxs(A,{children:[e.jsx(G,{children:"Readme"}),e.jsx(C,{sx:{mt:1},children:e.jsx(X,{children:s.data.readme})})]})}),t&&e.jsx(M,{error:o,context:`${r} > About`})]})}function oe({resourceUri:n}){const[r,i]=h.useState(!1),{apiClients:s}=j(),l=D(),[t,o]=h.useState(""),d=()=>{i(!0)},a=()=>{i(!1)},{projectName:u}=k(n),p=F({async mutationFn(c){return s.packages.createPackage(u,{name:c.name,description:c.description,location:c.location})},onSuccess(){a(),o("Package created successfully"),l.invalidateQueries({queryKey:["packages",u]})},onError(c){o(c instanceof Error?c.message:"An unknown error occurred")}}),g=c=>{c.preventDefault();const m=new FormData(c.currentTarget),v=m.get("name")?.toString(),x=m.get("description")?.toString(),S=m.get("location")?.toString();p.mutate({name:v,description:x,location:S})};return e.jsxs(E.Fragment,{children:[e.jsx(f,{onClick:d,variant:"contained",color:"primary",startIcon:e.jsx(te,{}),sx:{color:"white"},children:"Add Package"}),e.jsxs(w,{open:r,onClose:a,children:[e.jsx(U,{children:"Create New Package"}),e.jsxs(z,{children:[e.jsxs(R,{children:["Create a new malloy package to start exploring your data.",e.jsx("br",{}),e.jsx("br",{}),"The location can be a GitHub/S3/GCP URL containing a package (Zipped or unzipped), or an absolute path to a directory that the publisher server has access to.",e.jsx("br",{}),e.jsx("br",{}),"Make sure to conform the"," ",e.jsx("a",{href:"https://github.com/malloydata/publisher/blob/main/README.md#architecture-overview",target:"_blank",rel:"noopener noreferrer",children:"Malloy Package Format"}),"."]}),e.jsxs("form",{onSubmit:g,id:"package-form",children:[e.jsx(b,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"standard"}),e.jsx(b,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,variant:"standard"}),e.jsx(b,{id:"location",name:"location",label:"Location",type:"text",placeholder:"E.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"standard"})]})]}),e.jsxs(N,{children:[e.jsx(f,{disabled:p.isPending,onClick:a,children:"Cancel"}),e.jsx(f,{type:"submit",form:"package-form",loading:p.isPending,children:"Save Changes"})]})]}),e.jsx($,{open:t!=="",autoHideDuration:6e3,onClose:()=>o(""),message:t})]})}function ce({resourceUri:n,onCloseDialog:r}){const[i,s]=h.useState(!1),{apiClients:l}=j(),t=D(),[o,d]=h.useState(""),a=()=>{s(!0)},u=()=>{s(!1),r()},{projectName:p,packageName:g}=k(n),c=F({mutationFn:()=>l.packages.deletePackage(p,g),onSuccess(){u(),t.invalidateQueries({queryKey:["packages"]}),d("Package deleted successfully")},onError(m){d(m instanceof Error?m.message:"An unknown error occurred")}});return e.jsxs(E.Fragment,{children:[e.jsxs(H,{onClick:a,children:[e.jsx(K,{children:e.jsx(ee,{fontSize:"small"})}),e.jsx(B,{children:"Delete"})]}),e.jsxs(w,{onClose:u,"aria-labelledby":"customized-dialog-title",open:i,children:[e.jsx(U,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),e.jsx(Q,{"aria-label":"close",onClick:u,sx:m=>({position:"absolute",right:8,top:8,color:m.palette.grey[500]}),children:e.jsx(V,{})}),e.jsx(z,{dividers:!0,children:e.jsxs(Y,{gutterBottom:!0,children:['Are you sure you want to delete "',g,'"? This action cannot be undone.']})}),e.jsx(N,{children:e.jsx(f,{variant:"contained",autoFocus:!0,onClick:()=>c.mutate(),color:"error",loading:c.isPending,children:"Delete"})}),e.jsx($,{open:o!=="",autoHideDuration:6e3,onClose:()=>d(""),message:o})]})]})}function le({package:n,resourceUri:r,onCloseDialog:i}){const[s,l]=h.useState(!1),{apiClients:t}=j(),o=D(),[d,a]=h.useState(""),u=()=>{l(!0)},p=()=>{l(!1),i()},{packageName:g,projectName:c}=k(r),m=F({async mutationFn(x){return t.packages.updatePackage(c,g,{name:g,description:x.description})},onSuccess(){p(),a("Package updated successfully"),o.invalidateQueries({queryKey:["packages",c]})},onError(x){a(x instanceof Error?x.message:"An unknown error occurred")}}),v=x=>{x.preventDefault();const S=new FormData(x.currentTarget).get("description")?.toString();m.mutate({description:S})};return e.jsxs(E.Fragment,{children:[e.jsxs(H,{onClick:u,children:[e.jsx(K,{children:e.jsx(ae,{fontSize:"small"})}),e.jsx(B,{children:"Edit"})]}),e.jsxs(w,{open:s,onClose:p,children:[e.jsx(U,{children:"Edit Package"}),e.jsxs(z,{children:[e.jsxs(R,{children:['Update the details for "',n.name,'".']}),e.jsxs("form",{onSubmit:v,id:"package-form",children:[e.jsx(b,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:n.name}),e.jsx(b,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:n.description,variant:"standard"})]})]}),e.jsxs(N,{children:[e.jsx(f,{disabled:m.isPending,onClick:p,children:"Cancel"}),e.jsx(f,{type:"submit",form:"package-form",loading:m.isPending,children:"Save Changes"})]})]}),e.jsx($,{open:d!=="",autoHideDuration:6e3,onClose:()=>a(""),message:d})]})}const de=({package:n,resourceUri:r})=>{const{mutable:i}=j(),[s,l]=h.useState(null),t=!!s,o=a=>{l(a.currentTarget)},d=()=>{l(null)};return e.jsx(e.Fragment,{children:i&&e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:a=>{a.stopPropagation(),o(a)},"aria-controls":t?"package-menu":void 0,"aria-haspopup":"true","aria-expanded":t?"true":void 0,children:e.jsx(se,{fontSize:"small"})}),e.jsxs(re,{id:"package-menu","aria-haspopup":"true","aria-expanded":t?"true":void 0,open:t,anchorEl:s,onClose:d,disableRestoreFocus:!0,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},onClick:a=>{a.stopPropagation()},children:[e.jsx(le,{package:n,resourceUri:r,onCloseDialog:d}),e.jsx(ce,{resourceUri:r,onCloseDialog:d})]})]})})};function ue({onSelectPackage:n,resourceUri:r}){const{apiClients:i}=j(),{projectName:s}=k(r),{data:l,isSuccess:t,isError:o,error:d}=I({queryKey:["packages",s],queryFn:()=>i.packages.listPackages(s)});return e.jsxs(e.Fragment,{children:[!t&&!o&&e.jsx(T,{text:"Fetching Packages..."}),t&&e.jsx(y,{container:!0,spacing:3,columns:12,children:l.data.sort((a,u)=>a.name.localeCompare(u.name)).map(a=>{const u=W({projectName:s,packageName:a.name});return e.jsx(y,{size:{xs:12,sm:12,md:12,lg:4},children:e.jsx(q,{sx:{cursor:"pointer",transition:"all 0.2s ease-in-out",paddingTop:"8px","&:hover":{boxShadow:"0 2px 6px rgba(0, 0, 0, 0.08)",transform:"translateY(-1px)"}},onClick:p=>{n(a.name,p)},children:e.jsxs(A,{children:[e.jsxs(C,{display:"flex",alignItems:"center",justifyContent:"space-between",sx:{marginBottom:"8px"},children:[e.jsx(P,{variant:"overline",sx:{fontSize:"12px",fontWeight:"600",color:"primary.main",textTransform:"uppercase",letterSpacing:"0.5px"},children:a.name}),e.jsx(de,{package:a,resourceUri:u})]}),e.jsx(ne,{sx:{mb:2}}),e.jsx(C,{sx:{maxHeight:"120px",overflowY:"auto",mt:2},children:e.jsx(P,{variant:"body2",children:a.description})})]})})},a.name)})}),o&&e.jsx(M,{error:d,context:`${s} > Packages`})]})}function me({onSelectPackage:n,resourceUri:r}){const{mutable:i}=j(),{projectName:s}=k(r);return e.jsx(e.Fragment,{children:e.jsxs(O,{children:[e.jsxs(C,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[e.jsxs(P,{variant:"h6",children:[s," packages"]}),i&&e.jsx(oe,{resourceUri:r})]}),e.jsxs(y,{container:!0,spacing:3,columns:12,children:[e.jsx(y,{size:{xs:12,md:12},children:e.jsx(ue,{onSelectPackage:n,resourceUri:r})}),e.jsx(y,{size:{xs:12,md:12},children:e.jsx(ie,{resourceUri:r})})]})]})})}function ye(){const n=J(),{projectName:r}=Z();if(r){const i=W({projectName:r});return e.jsx(me,{onSelectPackage:n,resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})})}export{ye as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as e,j as r,f as s,B as t,T as n}from"./index-
|
|
1
|
+
import{aD as e,j as r,f as s,B as t,T as n}from"./index-BS_9W4Tt.js";import{C as a}from"./Container-pCaIjpH5.js";function c(){const o=e();return console.error(o),r.jsx(a,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(s,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(n,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{c as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{q as ae,s as le,r as k,w as ce,aE as We,aF as Pe,ay as ze,aA as Ae,aa as Fe,j as e,x as Y,A as de,H as ue,aG as ge,J as Ie,T as w,a8 as Te,F as je,aH as Ne,R as h,aI as Re,_ as Ue,ai as Q,I as V,aJ as re,aK as ke,am as
|
|
1
|
+
import{q as ae,s as le,r as k,w as ce,aE as We,aF as Pe,ay as ze,aA as Ae,aa as Fe,j as e,x as Y,A as de,H as ue,aG as ge,J as Ie,T as w,a8 as Te,F as je,aH as Ne,R as h,aI as Re,_ as Ue,ai as Q,I as V,aJ as re,aK as ke,am as $e,aL as He,B as U,aM as pe,aN as Be,f as xe,a2 as Le,n as _,Z as ve,D as me,W as Oe,e as qe,d as Je,aO as Qe,aP as Ve,aQ as _e,aR as X,aS as Ke,aT as Ge,V as Xe,a5 as Ye}from"./index-BS_9W4Tt.js";import{p as Ze}from"./index.modern-J74LOUay.js";import{D as Ce,a as ye,b as Se}from"./DialogTitle-Df6dToBj.js";import{F as et}from"./FormControlContext-Ccuzn_SP.js";import{i as he,D as De}from"./listItemTextClasses-D0rI_qhy.js";import{C as tt}from"./Chip-DpRfGWL9.js";import{a as Me,M as ne}from"./MenuItem-BWMnNgqP.js";import{f as ot}from"./index.es20-DzH7kq4S.js";import"./Modal-BbVeNLvO.js";function st(t){return ae("MuiCollapse",t)}le("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const rt=t=>{const{orientation:o,classes:s}=t,r={root:["root",`${o}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${o}`],wrapperInner:["wrapperInner",`${o}`]};return ue(r,st,s)},nt=Y("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:s}=t;return[o.root,o[s.orientation],s.state==="entered"&&o.entered,s.state==="exited"&&!s.in&&s.collapsedSize==="0px"&&o.hidden]}})(Ie(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:o})=>o.state==="exited"&&!o.in&&o.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),it=Y("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),at=Y("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ie=k.forwardRef(function(o,s){const r=ce({props:o,name:"MuiCollapse"}),{addEndListener:c,children:b,className:p,collapsedSize:d="0px",component:j,easing:E,in:C,onEnter:F,onEntered:m,onEntering:l,onExit:f,onExited:I,onExiting:W,orientation:O="vertical",style:y,timeout:i=We.standard,TransitionComponent:S=Pe,...$}=r,T={...r,orientation:O,collapsedSize:d},P=rt(T),J=ze(),q=Ae(),v=k.useRef(null),N=k.useRef(),H=typeof d=="number"?`${d}px`:d,D=O==="horizontal",R=D?"width":"height",z=k.useRef(null),g=Fe(s,z),M=a=>B=>{if(a){const L=z.current;B===void 0?a(L):a(L,B)}},K=()=>v.current?v.current[D?"clientWidth":"clientHeight"]:0,G=M((a,B)=>{v.current&&D&&(v.current.style.position="absolute"),a.style[R]=H,F&&F(a,B)}),Z=M((a,B)=>{const L=K();v.current&&D&&(v.current.style.position="");const{duration:te,easing:se}=ge({style:y,timeout:i,easing:E},{mode:"enter"});if(i==="auto"){const fe=J.transitions.getAutoHeightDuration(L);a.style.transitionDuration=`${fe}ms`,N.current=fe}else a.style.transitionDuration=typeof te=="string"?te:`${te}ms`;a.style[R]=`${L}px`,a.style.transitionTimingFunction=se,l&&l(a,B)}),n=M((a,B)=>{a.style[R]="auto",m&&m(a,B)}),u=M(a=>{a.style[R]=`${K()}px`,f&&f(a)}),x=M(I),A=M(a=>{const B=K(),{duration:L,easing:te}=ge({style:y,timeout:i,easing:E},{mode:"exit"});if(i==="auto"){const se=J.transitions.getAutoHeightDuration(B);a.style.transitionDuration=`${se}ms`,N.current=se}else a.style.transitionDuration=typeof L=="string"?L:`${L}ms`;a.style[R]=H,a.style.transitionTimingFunction=te,W&&W(a)}),ee=a=>{i==="auto"&&q.start(N.current||0,a),c&&c(z.current,a)};return e.jsx(S,{in:C,onEnter:G,onEntered:n,onEntering:Z,onExit:u,onExited:x,onExiting:A,addEndListener:ee,nodeRef:z,timeout:i==="auto"?null:i,...$,children:(a,{ownerState:B,...L})=>e.jsx(nt,{as:j,className:de(P.root,p,{entered:P.entered,exited:!C&&H==="0px"&&P.hidden}[a]),style:{[D?"minWidth":"minHeight"]:H,...y},ref:g,ownerState:{...T,state:a},...L,children:e.jsx(it,{ownerState:{...T,state:a},className:P.wrapper,ref:v,children:e.jsx(at,{ownerState:{...T,state:a},className:P.wrapperInner,children:b})})})})});ie&&(ie.muiSupportAuto=!0);function we(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function be(t,o=!1){return t&&(we(t.value)&&t.value!==""||o&&we(t.defaultValue)&&t.defaultValue!=="")}function lt(t){return t.startAdornment}function ct(t){return ae("MuiDialogActions",t)}le("MuiDialogActions",["root","spacing"]);const dt=t=>{const{classes:o,disableSpacing:s}=t;return ue({root:["root",!s&&"spacing"]},ct,o)},ut=Y("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:s}=t;return[o.root,!s.disableSpacing&&o.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:t})=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Ee=k.forwardRef(function(o,s){const r=ce({props:o,name:"MuiDialogActions"}),{className:c,disableSpacing:b=!1,...p}=r,d={...r,disableSpacing:b},j=dt(d);return e.jsx(ut,{className:de(j.root,c),ownerState:d,ref:s,...p})});function ht(t){return ae("MuiDialogContentText",t)}le("MuiDialogContentText",["root"]);const pt=t=>{const{classes:o}=t,r=ue({root:["root"]},ht,o);return{...o,...r}},xt=Y(w,{shouldForwardProp:t=>Te(t)||t==="classes",name:"MuiDialogContentText",slot:"Root"})({}),mt=k.forwardRef(function(o,s){const r=ce({props:o,name:"MuiDialogContentText"}),{children:c,className:b,...p}=r,d=pt(p);return e.jsx(xt,{component:"p",variant:"body1",color:"textSecondary",ref:s,ownerState:p,className:de(d.root,b),...r,classes:d})});function ft(t){return ae("MuiFormControl",t)}le("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const gt=t=>{const{classes:o,margin:s,fullWidth:r}=t,c={root:["root",s!=="none"&&`margin${je(s)}`,r&&"fullWidth"]};return ue(c,ft,o)},kt=Y("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:s}=t;return[o.root,o[`margin${je(s.margin)}`],s.fullWidth&&o.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),wt=k.forwardRef(function(o,s){const r=ce({props:o,name:"MuiFormControl"}),{children:c,className:b,color:p="primary",component:d="div",disabled:j=!1,error:E=!1,focused:C,fullWidth:F=!1,hiddenLabel:m=!1,margin:l="none",required:f=!1,size:I="medium",variant:W="outlined",...O}=r,y={...r,color:p,component:d,disabled:j,error:E,fullWidth:F,hiddenLabel:m,margin:l,required:f,size:I,variant:W},i=gt(y),[S,$]=k.useState(()=>{let z=!1;return c&&k.Children.forEach(c,g=>{if(!he(g,["Input","Select"]))return;const M=he(g,["Select"])?g.props.input:g;M&<(M.props)&&(z=!0)}),z}),[T,P]=k.useState(()=>{let z=!1;return c&&k.Children.forEach(c,g=>{he(g,["Input","Select"])&&(be(g.props,!0)||be(g.props.inputProps,!0))&&(z=!0)}),z}),[J,q]=k.useState(!1);j&&J&&q(!1);const v=C!==void 0&&!j?C:J;let N;k.useRef(!1);const H=k.useCallback(()=>{P(!0)},[]),D=k.useCallback(()=>{P(!1)},[]),R=k.useMemo(()=>({adornedStart:S,setAdornedStart:$,color:p,disabled:j,error:E,filled:T,focused:v,fullWidth:F,hiddenLabel:m,size:I,onBlur:()=>{q(!1)},onFocus:()=>{q(!0)},onEmpty:D,onFilled:H,registerEffect:N,required:f,variant:W}),[S,p,j,E,T,v,F,m,N,D,H,f,I,W]);return e.jsx(et.Provider,{value:R,children:e.jsx(kt,{as:d,ownerState:y,className:de(i.root,b),ref:s,...O,children:c})})});class oe{constructor(o,s){this.workbookData=s,this.workbookStorage=o,this.workbookData?this.isSaved=!0:(this.workbookData={models:[],cells:[],workbookPath:void 0},this.isSaved=!1)}isSaved;workbookStorage;getWorkbookData(){return this.workbookData}getWorkbookPath(){return this.workbookData.workbookPath}async renameWorkbook(o){if(this.workbookData.workbookPath.path!==o)try{await this.workbookStorage.moveWorkbook(this.workbookData.workbookPath,{path:o,workspace:this.workbookData.workbookPath.workspace})}catch{}return this.workbookData.workbookPath.path=o,this.isSaved=!1,await this.saveWorkbook()}getCells(){return this.workbookData.cells}deleteCell(o){return this.workbookData.cells=[...this.workbookData.cells.slice(0,o),...this.workbookData.cells.slice(o+1)],this.isSaved=!1,this}insertCell(o,s){return this.workbookData.cells=[...this.workbookData.cells.slice(0,o),s,...this.workbookData.cells.slice(o)],this.isSaved=!1,this}setCell(o,s){return this.workbookData.cells[o]=s,this.isSaved=!1,this}setModels(o){return this.workbookData.models=o,this.isSaved=!1,this}getModels(){return this.workbookData.models}updateWorkbookData(o){return this.workbookData=o,this.isSaved=!1,this}async saveWorkbook(){if(!this.isSaved){if(!this.workbookData.workbookPath)throw new Error("Workbook path is not set");await this.workbookStorage.saveWorkbook(this.workbookData.workbookPath,JSON.stringify(this.workbookData)),this.isSaved=!0}return new oe(this.workbookStorage,this.workbookData)}toMalloyWorkbook(){return this.workbookData.cells.map(o=>o.isMarkdown?`>>>markdown
|
|
2
2
|
`+o.value:`>>>malloy
|
|
3
3
|
import {${o.sourceName}}" from '${o.modelPath}'"
|
|
4
4
|
`+o.value+`
|
|
5
5
|
`).join(`
|
|
6
|
-
`)}static newWorkbook(o){return new oe(o,void 0)}static async loadWorkbook(o,s){let r;try{const c=await o.getWorkbook(s);c&&(r=JSON.parse(c))}catch{r={models:[],cells:[],workbookPath:s}}return new oe(o,r)}}function bt({cell:t,sourceAndPaths:o,resourceUri:s,onQueryChange:r,onSourceChange:c}){const b={query:t.value,malloyResult:t.result?JSON.parse(t.result):void 0,malloyQuery:t.queryInfo?JSON.parse(t.queryInfo):void 0},p=o.findIndex(d=>d.sourceInfo.name===t.sourceName);return e.jsx(Ne,{resourceUri:s,sourceAndPaths:o,selectedSourceIndex:p>=0?p:0,existingQuery:b,onQueryChange:r,onSourceChange:c})}function jt({cell:t,editingMalloy:o,editingMarkdown:s,sourceAndPaths:r,resourceUri:c,onCellChange:b,onClose:p,onEdit:d,onDelete:j,addButtonCallback:E}){const[C,F]=k.useState(t.value),[m,l]=h.useState(!1),[f,I]=h.useState(!1),[W,$]=h.useState(),[y]=h.useState(),[i,S]=h.useState(Re()),[H,T]=h.useState(!1),[P,J]=h.useState(t.sourceName?r.findIndex(n=>n.sourceInfo.name===t.sourceName):0);k.useEffect(()=>{t.isMarkdown||Ue(t.value,"malloy").then(n=>{$(n)})},[t]),h.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[q,v]=k.useState(!1),N=()=>{j(),v(!1)},B=r.length===0,D=h.useCallback(()=>{const n=r[P],u=n?.modelPath||t.modelPath||"",x=n?.sourceInfo.name||t.sourceName||"";b({...t,value:t.isMarkdown?C:i.query,result:i.malloyResult?JSON.stringify(i.malloyResult):void 0,queryInfo:i.malloyQuery?JSON.stringify(i.malloyQuery):void 0,sourceName:x,modelPath:u})},[t,C,i,b,P,r]),R=e.jsx(Q,{title:"Delete Cell",children:e.jsx(V,{size:"small",onClick:()=>v(!0),children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),z=e.jsxs(Ce,{open:q,onClose:()=>v(!1),children:[e.jsx(ye,{children:"Confirm Delete"}),e.jsx(Se,{children:e.jsx(w,{children:"Are you sure you want to delete this cell?"})}),e.jsxs(Ee,{children:[e.jsx(_,{onClick:()=>v(!1),children:"Cancel"}),e.jsx(_,{onClick:N,color:"error",children:"Delete"})]})]}),g=()=>{D(),p()},M=t.isMarkdown?e.jsxs(e.Fragment,{children:[s?e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}):e.jsx(Q,{title:"Edit",children:e.jsx(V,{size:"small",onClick:d,children:e.jsx(ke,{})})}),!s&&R]}):e.jsxs(e.Fragment,{children:[!o&&e.jsx(Q,{title:m?"Hide Code":"View Code",children:e.jsx(V,{size:"small",onClick:()=>{l(!m)},children:e.jsx(He,{})})}),!o&&t.result&&e.jsx(Q,{title:f?"Hide Embedding":"View Embedding",children:e.jsx(V,{size:"small",onClick:()=>{I(!f)},children:e.jsx(Be,{})})}),o&&e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}),!o&&e.jsx(Q,{title:"Edit",children:e.jsx(V,{size:"small",onClick:d,children:e.jsx(ke,{})})}),!o&&R]}),K=o||s,G=s?e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}):o?e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}):null,Z=H&&e.jsx(U,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!K&&e.jsxs(e.Fragment,{children:[E(!0),E(!1),M]})||G});return e.jsxs(pe,{sx:{position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:"#fff",minHeight:"50px"},onMouseEnter:()=>T(!0),onMouseLeave:()=>{T(!1)},children:[Z,t.isMarkdown?e.jsx(e.Fragment,{children:s?e.jsx(Le,{value:C,preview:"edit",autoFocus:!0,onChange:n=>{F(n),b({...t,value:n})},onBlur:()=>{D(),H||g()}}):e.jsx(U,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:t.value?e.jsx(U,{onClick:d,sx:{cursor:"pointer"},children:e.jsx(Ze,{children:t.value})}):e.jsxs(U,{onClick:d,sx:{cursor:"pointer"},children:[e.jsx(w,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),e.jsx(w,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{in:f,timeout:"auto",unmountOnExit:!0,children:e.jsx(xe,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:e.jsx(w,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:y}})})}),e.jsx(ie,{in:m,timeout:"auto",unmountOnExit:!0,children:e.jsx(xe,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:e.jsx(w,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:W}})})}),o&&(B?e.jsxs(e.Fragment,{children:[e.jsx(w,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),e.jsx(w,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):e.jsx(bt,{sourceAndPaths:r,resourceUri:c,onQueryChange:n=>{S(n)},onSourceChange:n=>{J(n)},cell:t})),!o&&t.result&&e.jsx(pe,{variant:"outlined",sx:{borderRadius:0},children:e.jsx(Oe,{result:t.result,minHeight:300,maxHeight:800})}),!o&&!t.result&&e.jsxs(U,{onClick:d,sx:{cursor:"pointer"},children:[e.jsx(w,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),e.jsx(w,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),q&&z]})}function vt({initialSelectedModels:t,onModelChange:o,resourceUri:s}){const{projectName:r,packageName:c,versionId:b}=ve(s),{apiClients:p}=me(),{data:d,isLoading:j,isSuccess:E,isError:C,error:F}=$e({queryKey:["models",r,c,b],queryFn:()=>p.models.listModels(r,c,b)}),[m,l]=h.useState(t||[]),[f,I]=h.useState(null);h.useEffect(()=>{l(t||[])},[t]);const W=i=>{const S=m.filter(H=>H!==i);l(S),o(S)},$=i=>{const S=[...m,i];l(S),o(S),I(null)};let y=[];return E&&d?.data&&(y=d.data.filter(i=>!m.includes(i.path)).map(i=>i.path)),C?e.jsx(qe,{error:F,context:`${r} > ${c} > Model Picker`}):e.jsxs(e.Fragment,{children:[e.jsxs(wt,{fullWidth:!0,children:[j&&e.jsx(w,{children:"Loading..."}),e.jsxs(xe,{direction:"row",spacing:1,children:[m.map(i=>e.jsx(tt,{label:i,onDelete:()=>W(i),deleteIcon:e.jsx(Je,{}),sx:{marginBottom:"5px"}},i)),e.jsx(_,{size:"small",startIcon:e.jsx(Qe,{}),onClick:i=>I(i.currentTarget),disabled:j||C||y.length===0,children:"Add Model"})]})]}),e.jsxs(Me,{anchorEl:f,open:!!f,onClose:()=>I(null),children:[e.jsx(w,{variant:"subtitle2",sx:{ml:1},children:"Models"}),e.jsx(De,{}),y.length===0?e.jsx(ne,{disabled:!0,children:"No models available"}):y.map(i=>e.jsx(ne,{onClick:()=>$(i),children:e.jsx(w,{variant:"body2",children:i})},i))]})]})}function Ct({workbookPath:t,resourceUri:o}){const s=ot(),{server:r,getAccessToken:c}=me(),{apiClients:b}=me(),{workbookStorage:p}=Ve(),{projectName:d,packageName:j}=ve(o),[E,C]=h.useState(void 0),[F,m]=h.useState(void 0);if(!p)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[l,f]=h.useState(),[I,W]=h.useState(),[$,y]=h.useState(),[i,S]=h.useState([]),[H,T]=h.useState(null),[P,J]=h.useState(null),q=!!H,v=()=>{T(null),J(null)},N=(n,u)=>{l&&(f(l.insertCell(u,{isMarkdown:n,value:""})),n?y(u):W(u),v(),console.log("handleAddCell",n,u))},[B,D]=h.useState(!1),R=()=>{D(!0)},z=async()=>{t&&p&&await p.deleteWorkbook(t).then(()=>{m(void 0),C(void 0)}).catch(n=>{m(`Error deleting workbook: ${n.message}`),C(void 0)}),D(!1),s(`/${d}/${j}`)},g=()=>{D(!1)},M=h.useCallback(async()=>{if(!l){console.log("No workbook data ref");return}try{f(await l.saveWorkbook()),m(void 0),C("Workbook saved")}catch(n){m(`Error saving workbook: ${n.message}`),C(void 0)}},[l]);if(h.useEffect(()=>{l&&(async()=>{const n=new Map(i.map(({modelPath:A,sourceInfos:ee})=>[A,ee])),u=[],x=[];for(const A of l.getModels())n.has(A)?u.push({modelPath:A,sourceInfos:n.get(A)}):(console.log("Fetching model from Publisher",A),x.push(b.models.getModel(d,j,A,void 0).then(ee=>({modelPath:A,sourceInfos:ee.data.sourceInfos.map(a=>JSON.parse(a))}))));if(x.length>0){const A=await Promise.all(x);S([...u,...A])}else S(u)})()},[c,l,j,d,r]),h.useEffect(()=>{t&&oe.loadWorkbook(p,t).then(n=>{f(n)})},[t,p]),!l)return e.jsx("div",{children:"Loading..."});const K=n=>{const u=[];for(const x of n)for(const A of x.sourceInfos)u.push({modelPath:x.modelPath,sourceInfo:A});return u},G=(n,u)=>e.jsx(_,{size:"small",startIcon:e.jsx(Ge,{}),onClick:()=>N(n,u),variant:"contained",sx:{backgroundColor:"#fff",color:x=>x.palette.mode==="dark"?x.palette.grey[100]:x.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:x=>x.palette.mode==="dark"?x.palette.grey[500]:x.palette.grey[300],boxShadow:"none"}},children:n?"Markdown":"Explore"}),Z=e.jsxs(U,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[G(!1,l.getCells().length),G(!0,l.getCells().length)]});return e.jsxs(pe,{variant:"outlined",children:[e.jsxs(_e,{children:[e.jsx(U,{sx:{mb:2},children:e.jsx(U,{sx:{minHeight:"24px"},children:F?e.jsx(w,{color:"error",variant:"body2",children:F}):E?e.jsx(w,{color:"success",variant:"body2",children:E}):e.jsx("span",{children:" "})})}),e.jsxs(X,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(X,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(w,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),e.jsx(w,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${t.workspace} > ${t.path}`})]}),e.jsxs(X,{sx:{display:"flex",flexDirection:"row",gap:1},children:[e.jsx(U,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:e.jsx(yt,{workbookData:l})}),e.jsxs(U,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[e.jsx(_,{color:"error",onClick:R,size:"small",children:"Delete"}),e.jsxs(Ce,{open:B,onClose:g,children:[e.jsx(ye,{children:"Delete Workbook"}),e.jsx(Se,{children:e.jsxs(mt,{children:['Are you sure you want to delete the workbook "',t.path,'"? This action cannot be undone.']})}),e.jsxs(Ee,{children:[e.jsx(_,{onClick:g,color:"primary",size:"small",children:"Cancel"}),e.jsx(_,{onClick:z,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),e.jsx(De,{}),e.jsxs(X,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[e.jsx(U,{sx:{flex:1},children:e.jsx(vt,{initialSelectedModels:l.getModels(),onModelChange:n=>{f(l.setModels(n)),M()},resourceUri:o})}),e.jsx(U,{sx:{flex:1}})]})]}),e.jsx(Ke,{children:e.jsxs(X,{children:[l.getCells().length===0&&e.jsxs(e.Fragment,{children:[e.jsx(w,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),e.jsx(w,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),l.getCells().map((n,u)=>e.jsx(h.Fragment,{children:e.jsx(jt,{cell:n,resourceUri:o,addButtonCallback:x=>G(x,u),sourceAndPaths:K(i),editingMarkdown:$===u,editingMalloy:I===u,onDelete:()=>{f(l.deleteCell(u)),M()},onCellChange:x=>{f(l.setCell(u,x))},onEdit:()=>{n.isMarkdown?y(u):W(u)},onClose:()=>{n.isMarkdown?y(void 0):W(void 0),M()}},`${u}-${n.isMarkdown}-${t.workspace}-${t.path}`)},`${u}-${l.getCells().length}`)),Z,e.jsxs(Me,{anchorEl:H,open:q,onClose:v,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[e.jsx(ne,{onClick:()=>N(!0,P??0),children:"Add Markdown"}),e.jsx(ne,{onClick:()=>N(!1,P??0),children:"Add Malloy"})]}),e.jsx(X,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function yt({workbookData:t}){const[o,s]=h.useState(!1);return e.jsx(_,{color:"primary",onClick:async()=>{if(!t)return;const r=t.toMalloyWorkbook();try{await navigator.clipboard.writeText(r),s(!0),setTimeout(()=>s(!1),1500)}catch{s(!1),alert("Failed to copy to clipboard")}},size:"small",children:o?"Copied!":"Export"})}function It(){const{workspace:t,workbookPath:o,projectName:s,packageName:r}=Xe();if(t)if(o)if(s)if(r){const c=Ye({projectName:s,packageName:r});return e.jsx(Ct,{workbookPath:{path:o,workspace:t},resourceUri:c},`${o}`)}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workbook path"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workspace"})})}export{It as default};
|
|
6
|
+
`)}static newWorkbook(o){return new oe(o,void 0)}static async loadWorkbook(o,s){let r;try{const c=await o.getWorkbook(s);c&&(r=JSON.parse(c))}catch{r={models:[],cells:[],workbookPath:s}}return new oe(o,r)}}function bt({cell:t,sourceAndPaths:o,resourceUri:s,onQueryChange:r,onSourceChange:c}){const b={query:t.value,malloyResult:t.result?JSON.parse(t.result):void 0,malloyQuery:t.queryInfo?JSON.parse(t.queryInfo):void 0},p=o.findIndex(d=>d.sourceInfo.name===t.sourceName);return e.jsx(Ne,{resourceUri:s,sourceAndPaths:o,selectedSourceIndex:p>=0?p:0,existingQuery:b,onQueryChange:r,onSourceChange:c})}function jt({cell:t,editingMalloy:o,editingMarkdown:s,sourceAndPaths:r,resourceUri:c,onCellChange:b,onClose:p,onEdit:d,onDelete:j,addButtonCallback:E}){const[C,F]=k.useState(t.value),[m,l]=h.useState(!1),[f,I]=h.useState(!1),[W,O]=h.useState(),[y]=h.useState(),[i,S]=h.useState(Re()),[$,T]=h.useState(!1),[P,J]=h.useState(t.sourceName?r.findIndex(n=>n.sourceInfo.name===t.sourceName):0);k.useEffect(()=>{t.isMarkdown||Ue(t.value,"malloy").then(n=>{O(n)})},[t]),h.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[q,v]=k.useState(!1),N=()=>{j(),v(!1)},H=r.length===0,D=h.useCallback(()=>{const n=r[P],u=n?.modelPath||t.modelPath||"",x=n?.sourceInfo.name||t.sourceName||"";b({...t,value:t.isMarkdown?C:i.query,result:i.malloyResult?JSON.stringify(i.malloyResult):void 0,queryInfo:i.malloyQuery?JSON.stringify(i.malloyQuery):void 0,sourceName:x,modelPath:u})},[t,C,i,b,P,r]),R=e.jsx(Q,{title:"Delete Cell",children:e.jsx(V,{size:"small",onClick:()=>v(!0),children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),z=e.jsxs(Ce,{open:q,onClose:()=>v(!1),children:[e.jsx(ye,{children:"Confirm Delete"}),e.jsx(Se,{children:e.jsx(w,{children:"Are you sure you want to delete this cell?"})}),e.jsxs(Ee,{children:[e.jsx(_,{onClick:()=>v(!1),children:"Cancel"}),e.jsx(_,{onClick:N,color:"error",children:"Delete"})]})]}),g=()=>{D(),p()},M=t.isMarkdown?e.jsxs(e.Fragment,{children:[s?e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}):e.jsx(Q,{title:"Edit",children:e.jsx(V,{size:"small",onClick:d,children:e.jsx(ke,{})})}),!s&&R]}):e.jsxs(e.Fragment,{children:[!o&&e.jsx(Q,{title:m?"Hide Code":"View Code",children:e.jsx(V,{size:"small",onClick:()=>{l(!m)},children:e.jsx($e,{})})}),!o&&t.result&&e.jsx(Q,{title:f?"Hide Embedding":"View Embedding",children:e.jsx(V,{size:"small",onClick:()=>{I(!f)},children:e.jsx(He,{})})}),o&&e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}),!o&&e.jsx(Q,{title:"Edit",children:e.jsx(V,{size:"small",onClick:d,children:e.jsx(ke,{})})}),!o&&R]}),K=o||s,G=s?e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}):o?e.jsx(Q,{title:"Save",children:e.jsx(V,{size:"small",onClick:g,children:e.jsx(re,{})})}):null,Z=$&&e.jsx(U,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!K&&e.jsxs(e.Fragment,{children:[E(!0),E(!1),M]})||G});return e.jsxs(pe,{sx:{position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:"#fff",minHeight:"50px"},onMouseEnter:()=>T(!0),onMouseLeave:()=>{T(!1)},children:[Z,t.isMarkdown?e.jsx(e.Fragment,{children:s?e.jsx(Be,{value:C,preview:"edit",autoFocus:!0,onChange:n=>{F(n),b({...t,value:n})},onBlur:()=>{D(),$||g()}}):e.jsx(U,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:t.value?e.jsx(U,{onClick:d,sx:{cursor:"pointer"},children:e.jsx(Ze,{children:t.value})}):e.jsxs(U,{onClick:d,sx:{cursor:"pointer"},children:[e.jsx(w,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),e.jsx(w,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{in:f,timeout:"auto",unmountOnExit:!0,children:e.jsx(xe,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:e.jsx(w,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:y}})})}),e.jsx(ie,{in:m,timeout:"auto",unmountOnExit:!0,children:e.jsx(xe,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:e.jsx(w,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:W}})})}),o&&(H?e.jsxs(e.Fragment,{children:[e.jsx(w,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),e.jsx(w,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):e.jsx(bt,{sourceAndPaths:r,resourceUri:c,onQueryChange:n=>{S(n)},onSourceChange:n=>{J(n)},cell:t})),!o&&t.result&&e.jsx(pe,{variant:"outlined",sx:{borderRadius:0},children:e.jsx(Le,{result:t.result,minHeight:300,maxHeight:800})}),!o&&!t.result&&e.jsxs(U,{onClick:d,sx:{cursor:"pointer"},children:[e.jsx(w,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),e.jsx(w,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),q&&z]})}function vt({initialSelectedModels:t,onModelChange:o,resourceUri:s}){const{projectName:r,packageName:c,versionId:b}=ve(s),{apiClients:p}=me(),{data:d,isLoading:j,isSuccess:E,isError:C,error:F}=Oe({queryKey:["models",r,c,b],queryFn:()=>p.models.listModels(r,c,b)}),[m,l]=h.useState(t||[]),[f,I]=h.useState(null);h.useEffect(()=>{l(t||[])},[t]);const W=i=>{const S=m.filter($=>$!==i);l(S),o(S)},O=i=>{const S=[...m,i];l(S),o(S),I(null)};let y=[];return E&&d?.data&&(y=d.data.filter(i=>!m.includes(i.path)).map(i=>i.path)),C?e.jsx(qe,{error:F,context:`${r} > ${c} > Model Picker`}):e.jsxs(e.Fragment,{children:[e.jsxs(wt,{fullWidth:!0,children:[j&&e.jsx(w,{children:"Loading..."}),e.jsxs(xe,{direction:"row",spacing:1,children:[m.map(i=>e.jsx(tt,{label:i,onDelete:()=>W(i),deleteIcon:e.jsx(Je,{}),sx:{marginBottom:"5px"}},i)),e.jsx(_,{size:"small",startIcon:e.jsx(Qe,{}),onClick:i=>I(i.currentTarget),disabled:j||C||y.length===0,children:"Add Model"})]})]}),e.jsxs(Me,{anchorEl:f,open:!!f,onClose:()=>I(null),children:[e.jsx(w,{variant:"subtitle2",sx:{ml:1},children:"Models"}),e.jsx(De,{}),y.length===0?e.jsx(ne,{disabled:!0,children:"No models available"}):y.map(i=>e.jsx(ne,{onClick:()=>O(i),children:e.jsx(w,{variant:"body2",children:i})},i))]})]})}function Ct({workbookPath:t,resourceUri:o}){const s=ot(),{server:r,getAccessToken:c}=me(),{apiClients:b}=me(),{workbookStorage:p}=Ve(),{projectName:d,packageName:j}=ve(o),[E,C]=h.useState(void 0),[F,m]=h.useState(void 0);if(!p)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[l,f]=h.useState(),[I,W]=h.useState(),[O,y]=h.useState(),[i,S]=h.useState([]),[$,T]=h.useState(null),[P,J]=h.useState(null),q=!!$,v=()=>{T(null),J(null)},N=(n,u)=>{l&&(f(l.insertCell(u,{isMarkdown:n,value:""})),n?y(u):W(u),v(),console.log("handleAddCell",n,u))},[H,D]=h.useState(!1),R=()=>{D(!0)},z=async()=>{t&&p&&await p.deleteWorkbook(t).then(()=>{m(void 0),C(void 0)}).catch(n=>{m(`Error deleting workbook: ${n.message}`),C(void 0)}),D(!1),s(`/${d}/${j}`)},g=()=>{D(!1)},M=h.useCallback(async()=>{if(!l){console.log("No workbook data ref");return}try{f(await l.saveWorkbook()),m(void 0),C("Workbook saved")}catch(n){m(`Error saving workbook: ${n.message}`),C(void 0)}},[l]);if(h.useEffect(()=>{l&&(async()=>{const n=new Map(i.map(({modelPath:A,sourceInfos:ee})=>[A,ee])),u=[],x=[];for(const A of l.getModels())n.has(A)?u.push({modelPath:A,sourceInfos:n.get(A)}):(console.log("Fetching model from Publisher",A),x.push(b.models.getModel(d,j,A,void 0).then(ee=>({modelPath:A,sourceInfos:ee.data.sourceInfos.map(a=>JSON.parse(a))}))));if(x.length>0){const A=await Promise.all(x);S([...u,...A])}else S(u)})()},[c,l,j,d,r]),h.useEffect(()=>{t&&oe.loadWorkbook(p,t).then(n=>{f(n)})},[t,p]),!l)return e.jsx("div",{children:"Loading..."});const K=n=>{const u=[];for(const x of n)for(const A of x.sourceInfos)u.push({modelPath:x.modelPath,sourceInfo:A});return u},G=(n,u)=>e.jsx(_,{size:"small",startIcon:e.jsx(Ge,{}),onClick:()=>N(n,u),variant:"contained",sx:{backgroundColor:"#fff",color:x=>x.palette.mode==="dark"?x.palette.grey[100]:x.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:x=>x.palette.mode==="dark"?x.palette.grey[500]:x.palette.grey[300],boxShadow:"none"}},children:n?"Markdown":"Explore"}),Z=e.jsxs(U,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[G(!1,l.getCells().length),G(!0,l.getCells().length)]});return e.jsxs(pe,{variant:"outlined",children:[e.jsxs(_e,{children:[e.jsx(U,{sx:{mb:2},children:e.jsx(U,{sx:{minHeight:"24px"},children:F?e.jsx(w,{color:"error",variant:"body2",children:F}):E?e.jsx(w,{color:"success",variant:"body2",children:E}):e.jsx("span",{children:" "})})}),e.jsxs(X,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(X,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(w,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),e.jsx(w,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${t.workspace} > ${t.path}`})]}),e.jsxs(X,{sx:{display:"flex",flexDirection:"row",gap:1},children:[e.jsx(U,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:e.jsx(yt,{workbookData:l})}),e.jsxs(U,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[e.jsx(_,{color:"error",onClick:R,size:"small",children:"Delete"}),e.jsxs(Ce,{open:H,onClose:g,children:[e.jsx(ye,{children:"Delete Workbook"}),e.jsx(Se,{children:e.jsxs(mt,{children:['Are you sure you want to delete the workbook "',t.path,'"? This action cannot be undone.']})}),e.jsxs(Ee,{children:[e.jsx(_,{onClick:g,color:"primary",size:"small",children:"Cancel"}),e.jsx(_,{onClick:z,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),e.jsx(De,{}),e.jsxs(X,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[e.jsx(U,{sx:{flex:1},children:e.jsx(vt,{initialSelectedModels:l.getModels(),onModelChange:n=>{f(l.setModels(n)),M()},resourceUri:o})}),e.jsx(U,{sx:{flex:1}})]})]}),e.jsx(Ke,{children:e.jsxs(X,{children:[l.getCells().length===0&&e.jsxs(e.Fragment,{children:[e.jsx(w,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),e.jsx(w,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),l.getCells().map((n,u)=>e.jsx(h.Fragment,{children:e.jsx(jt,{cell:n,resourceUri:o,addButtonCallback:x=>G(x,u),sourceAndPaths:K(i),editingMarkdown:O===u,editingMalloy:I===u,onDelete:()=>{f(l.deleteCell(u)),M()},onCellChange:x=>{f(l.setCell(u,x))},onEdit:()=>{n.isMarkdown?y(u):W(u)},onClose:()=>{n.isMarkdown?y(void 0):W(void 0),M()}},`${u}-${n.isMarkdown}-${t.workspace}-${t.path}`)},`${u}-${l.getCells().length}`)),Z,e.jsxs(Me,{anchorEl:$,open:q,onClose:v,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[e.jsx(ne,{onClick:()=>N(!0,P??0),children:"Add Markdown"}),e.jsx(ne,{onClick:()=>N(!1,P??0),children:"Add Malloy"})]}),e.jsx(X,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function yt({workbookData:t}){const[o,s]=h.useState(!1);return e.jsx(_,{color:"primary",onClick:async()=>{if(!t)return;const r=t.toMalloyWorkbook();try{await navigator.clipboard.writeText(r),s(!0),setTimeout(()=>s(!1),1500)}catch{s(!1),alert("Failed to copy to clipboard")}},size:"small",children:o?"Copied!":"Export"})}function It(){const{workspace:t,workbookPath:o,projectName:s,packageName:r}=Xe();if(t)if(o)if(s)if(r){const c=Ye({projectName:s,packageName:r});return e.jsx(Ct,{workbookPath:{path:o,workspace:t},resourceUri:c},`${o}`)}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workbook path"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workspace"})})}export{It as default};
|