From 7b3dd0288e70ce0a44d7d908f50516ffb477abe2 Mon Sep 17 00:00:00 2001 From: Darko Gjorgjijoski Date: Sun, 28 Jan 2024 17:17:48 +0100 Subject: [PATCH] Update build --- public/build/assets/404-Z7jKPlt3.js | 1 + public/build/assets/404.4d7685db.js | 1 - .../build/assets/AccountSetting-06M3GRJr.js | 1 + .../build/assets/AccountSetting.d7aa051b.js | 1 - .../assets/AddressInformation-rf-keUEw.js | 1 + .../assets/AddressInformation.790df2bc.js | 1 - public/build/assets/AstronautIcon-Cu4zzuLg.js | 1 + public/build/assets/AstronautIcon.5afbaf6c.js | 1 - public/build/assets/BackupSetting-mmKrsMfR.js | 1 + public/build/assets/BackupSetting.e9cd0073.js | 1 - ...r.bacb9608.css => BaseEditor-8o6Sf_Iq.css} | 0 public/build/assets/BaseEditor-nkRYKoo1.js | 73 + public/build/assets/BaseEditor.ec8bd38c.js | 73 - public/build/assets/BaseListItem-SKSPChPw.js | 1 + public/build/assets/BaseListItem.5fd4d75d.js | 1 - .../build/assets/BaseMultiselect-T7POF4wb.js | 1 + .../build/assets/BaseMultiselect.f7bf60e3.js | 1 - public/build/assets/BaseTable-HYHVnjlk.js | 1 + public/build/assets/BaseTable.c2b2d20a.js | 1 - public/build/assets/CapsuleIcon-Rj3UD5LO.js | 1 + public/build/assets/CapsuleIcon.730f4dd2.js | 1 - public/build/assets/CategoryModal-k2zsC2hK.js | 1 + public/build/assets/CategoryModal.cb867f43.js | 1 - .../assets/CompanyInfoSettings-1CNniwZ8.js | 1 + .../assets/CompanyInfoSettings.e80e4a03.js | 1 - public/build/assets/Create-II8eq-s_.js | 1 + public/build/assets/Create-W4ThzIMu.js | 1 + public/build/assets/Create-ay9iZL5d.js | 1 + public/build/assets/Create-htsQOe0Y.js | 1 + public/build/assets/Create-iSgr_dU6.js | 1 + public/build/assets/Create.6a1b616b.js | 1 - public/build/assets/Create.6d36d723.js | 1 - public/build/assets/Create.701a2926.js | 1 - public/build/assets/Create.9313a497.js | 1 - public/build/assets/Create.c6a28457.js | 1 - .../assets/CreateCustomFields-hHeYNhLY.js | 7 + .../assets/CreateCustomFields.5609a247.js | 1 - .../assets/CustomFieldsSetting-W-qITsqX.js | 7 + .../assets/CustomFieldsSetting.5910326d.js | 1 - .../assets/CustomerIndexDropdown-dSzhysTu.js | 1 + .../assets/CustomerIndexDropdown.44b8afc5.js | 1 - .../build/assets/CustomerSettings-x29BvxZg.js | 1 + .../build/assets/CustomerSettings.b26235a8.js | 1 - .../assets/CustomizationSetting-VYZFiTwK.js | 1 + .../assets/CustomizationSetting.77479b06.js | 1 - public/build/assets/Dashboard-AkFBE3Pt.js | 1 + public/build/assets/Dashboard-kgGGyUGQ.js | 1 + public/build/assets/Dashboard.79084651.js | 1 - public/build/assets/Dashboard.905d2846.js | 1 - public/build/assets/DateTimeType-hV9WZ_9z.js | 1 + public/build/assets/DateTimeType.4faa64b8.js | 1 - public/build/assets/DateType-AuJbnKst.js | 1 + public/build/assets/DateType.074be010.js | 1 - public/build/assets/DragIcon-szQ4f7me.js | 10 + public/build/assets/DragIcon.7c80aca9.js | 10 - public/build/assets/DropdownType-dylq9kV9.js | 1 + public/build/assets/DropdownType.f13bd479.js | 1 - .../build/assets/EstimateCreate-JIRqdSKA.js | 1 + .../build/assets/EstimateCreate.15e0dde4.js | 1 - public/build/assets/EstimateIcon-Jl2662IN.js | 1 + public/build/assets/EstimateIcon.a0aca522.js | 1 - .../assets/EstimateIndexDropdown-ZN9wO8Lw.js | 1 + .../assets/EstimateIndexDropdown.bae761c6.js | 1 - .../assets/ExchangeRateConverter-ZwwFqeKM.js | 1 + .../assets/ExchangeRateConverter.0aa9df3c.js | 1 - .../ExchangeRateProviderSetting-r-dCB5Fc.js | 1 + .../ExchangeRateProviderSetting.4ea17a5c.js | 1 - .../assets/ExpenseCategorySetting-74_Blw7j.js | 1 + .../assets/ExpenseCategorySetting.188d492f.js | 1 - .../build/assets/FileDiskSetting-Ns0c-FNZ.js | 1 + .../build/assets/FileDiskSetting.e6793479.js | 1 - .../build/assets/ForgotPassword-WS5c4CnP.js | 1 + .../build/assets/ForgotPassword-eqAwwXNW.js | 1 + .../build/assets/ForgotPassword.ca04a561.js | 1 - .../build/assets/ForgotPassword.f56b2527.js | 1 - public/build/assets/Index-28CpEt3A.js | 1 + public/build/assets/Index-5ShXhPYh.js | 1 + public/build/assets/Index-6qiU6m-S.js | 1 + public/build/assets/Index-AANAHlQ2.js | 1 + public/build/assets/Index-G9G1PIfr.js | 1 + public/build/assets/Index-M1bPd3Wc.js | 1 + public/build/assets/Index-Rihd2aA2.js | 1 + public/build/assets/Index-cea-iEJX.js | 1 + public/build/assets/Index-dSIICLwC.js | 1 + public/build/assets/Index-getU2mY4.js | 1 + public/build/assets/Index-q-Hmx4if.js | 1 + public/build/assets/Index-wEUaFE85.js | 1 + public/build/assets/Index-xtdfV9KI.js | 1 + public/build/assets/Index.0dab6293.js | 1 - public/build/assets/Index.0e445439.js | 1 - public/build/assets/Index.23a9a4c6.js | 1 - public/build/assets/Index.2f358b6e.js | 1 - public/build/assets/Index.443c85db.js | 1 - public/build/assets/Index.56225d5b.js | 1 - public/build/assets/Index.5820505d.js | 1 - public/build/assets/Index.5c342df0.js | 1 - public/build/assets/Index.85722697.js | 1 - public/build/assets/Index.8e17349f.js | 1 - public/build/assets/Index.9ec2b26a.js | 1 - public/build/assets/Index.db63375d.js | 1 - public/build/assets/Index.ffa09876.js | 1 - public/build/assets/InputType-L0rMrry9.js | 1 + public/build/assets/InputType.22b7cbab.js | 1 - public/build/assets/Installation-QPa-1r5S.js | 1 + public/build/assets/Installation.345739e0.js | 1 - public/build/assets/InvoiceCreate-tss67BFs.js | 1 + public/build/assets/InvoiceCreate.f33d2f08.js | 1 - .../assets/InvoiceIndexDropdown-pu_jVPSm.js | 1 + .../assets/InvoiceIndexDropdown.5aa0548b.js | 1 - .../assets/InvoicePublicPage-vTeOBslJ.js | 1 + .../assets/InvoicePublicPage.49bea2e2.js | 1 - public/build/assets/ItemUnitModal-BC4Fg9D4.js | 1 + public/build/assets/ItemUnitModal.f71b6bbd.js | 1 - public/build/assets/LayoutBasic-E2NyFHv0.js | 1 + public/build/assets/LayoutBasic-sPuhaYCP.js | 1 + public/build/assets/LayoutBasic.754d58be.js | 1 - public/build/assets/LayoutBasic.8d94499d.js | 1 - .../assets/LayoutInstallation-MnXpVZpR.js | 1 + .../assets/LayoutInstallation.ef8c1f28.js | 1 - public/build/assets/LayoutLogin-NPOaWC_w.js | 1 + public/build/assets/LayoutLogin-zaAD4FDU.js | 1 + public/build/assets/LayoutLogin.53af66e4.js | 1 - public/build/assets/LayoutLogin.ad0ca28d.js | 1 - public/build/assets/LineChart-wa69n_NW.js | 56 + public/build/assets/LineChart.2823de1b.js | 56 - public/build/assets/LoadingIcon-fUkhTV3p.js | 1 + public/build/assets/LoadingIcon.4d92e0c0.js | 1 - public/build/assets/Login-0_Qt8hoa.js | 1 + public/build/assets/Login-d6ikdrcp.js | 1 + public/build/assets/Login.cc831709.js | 1 - public/build/assets/Login.fd14ea97.js | 1 - .../assets/MailConfigSetting-1hXxeQ4V.js | 1 + .../assets/MailConfigSetting.f7d10f38.js | 1 - .../build/assets/MoonwalkerIcon-2NrMqjN-.js | 1 + .../build/assets/MoonwalkerIcon.92ea8796.js | 1 - ...al.3245b7d3.css => NoteModal-lSPPZux7.css} | 0 public/build/assets/NoteModal-rdu-Hccj.js | 1 + public/build/assets/NoteModal.ecba55bc.js | 1 - public/build/assets/NotesSetting-CW5tKP32.js | 1 + public/build/assets/NotesSetting.6052e5e3.js | 1 - .../build/assets/NotificationRoot-dU6Sc2aV.js | 1 + .../build/assets/NotificationRoot.452046ea.js | 1 - .../assets/NotificationsSetting-S1DylUbI.js | 1 + .../assets/NotificationsSetting.b153c485.js | 1 - public/build/assets/NumberType-LSMIEyWL.js | 1 + public/build/assets/NumberType.5e07b641.js | 1 - .../build/assets/ObservatoryIcon-NvQ8CxCP.js | 1 + .../build/assets/ObservatoryIcon.6d06653e.js | 1 - .../build/assets/PaymentModeModal-OW7LJo93.js | 1 + .../build/assets/PaymentModeModal.ca34bfc6.js | 1 - .../assets/PaymentsModeSetting-06uCV4bc.js | 1 + .../assets/PaymentsModeSetting.b422aded.js | 1 - public/build/assets/PhoneType-9SsFabB7.js | 1 + public/build/assets/PhoneType.10fcbacc.js | 1 - .../Poppins-Black-tiyKixU2.ttf} | Bin .../Poppins-Light-oQZpbsDM.ttf} | Bin .../Poppins-Medium-8AJSf1CK.ttf} | Bin .../Poppins-Regular-gxOM_eBK.ttf} | Bin .../Poppins-SemiBold-xkkfLQvD.ttf} | Bin .../assets/PreferencesSetting-qDiIMYco.js | 1 + .../assets/PreferencesSetting.91fd3c64.js | 1 - .../assets/RecurringInvoiceCreate-xoYk2gUe.js | 1 + .../assets/RecurringInvoiceCreate.63960c81.js | 1 - .../RecurringInvoiceIndexDropdown-PyrJU784.js | 1 + .../RecurringInvoiceIndexDropdown.a1e59959.js | 1 - public/build/assets/ResetPassword-uBIR2v0g.js | 1 + public/build/assets/ResetPassword-yF1cFJet.js | 1 + public/build/assets/ResetPassword.48d64201.js | 1 - public/build/assets/ResetPassword.bff307e0.js | 1 - public/build/assets/RolesSettings-gCNnqU54.js | 1 + public/build/assets/RolesSettings.f104eca8.js | 1 - public/build/assets/SalesTax-CDQbOzvw.js | 1 + public/build/assets/SalesTax.70513e81.js | 1 - .../build/assets/SelectNotePopup-DKlwyGyu.js | 1 + .../build/assets/SelectNotePopup.332d8bb2.js | 1 - .../assets/SendEstimateModal-GmEK-a4y.js | 1 + .../assets/SendEstimateModal.91274455.js | 1 - .../build/assets/SendInvoiceModal-DTdeZlwF.js | 1 + .../build/assets/SendInvoiceModal.b0759567.js | 1 - .../build/assets/SendPaymentModal-4tmkg0dz.js | 1 + .../build/assets/SendPaymentModal.5b2acf9d.js | 1 - public/build/assets/SettingsIndex-dvOPTB0E.js | 1 + public/build/assets/SettingsIndex-xl6FX5wL.js | 1 + public/build/assets/SettingsIndex.af05238d.js | 1 - public/build/assets/SettingsIndex.c15daa63.js | 1 - public/build/assets/SwitchType-35txdira.js | 1 + public/build/assets/SwitchType.522fc982.js | 1 - .../THSarabunNew-AjsEQpFw.ttf} | Bin .../THSarabunNew-Bold-6rQIu1fB.ttf} | Bin .../THSarabunNew-BoldItalic-t52o19PJ.ttf} | Bin .../THSarabunNew-Italic-AIglRIUE.ttf} | Bin public/build/assets/TaxTypeModal-HlOjbce1.js | 1 + public/build/assets/TaxTypeModal.73b640f9.js | 1 - .../build/assets/TaxTypesSetting-VOaQcNuU.js | 1 + .../build/assets/TaxTypesSetting.95e6443a.js | 1 - public/build/assets/TextAreaType-G_tBc6oP.js | 1 + public/build/assets/TextAreaType.d6dd293e.js | 1 - public/build/assets/TimeType-_QpZML6e.js | 1 + public/build/assets/TimeType.3f06c579.js | 1 - .../build/assets/UpdateAppSetting-n48rjGXD.js | 1 + ...987a.css => UpdateAppSetting-rzmq_by0.css} | 0 .../build/assets/UpdateAppSetting.aef85435.js | 1 - public/build/assets/UrlType-kbgsrP4R.js | 1 + public/build/assets/UrlType.a77493a7.js | 1 - public/build/assets/View-6rSeFJSD.js | 1 + public/build/assets/View-8tfG5u9N.js | 1 + public/build/assets/View-Eq6jnt-f.js | 1 + public/build/assets/View-aJjoeJiw.js | 1 + public/build/assets/View-baJjXj9x.js | 1 + public/build/assets/View-h94cNM2j.js | 2 + public/build/assets/View-j7p-fIXT.js | 1 + public/build/assets/View-tAcvKt0q.js | 1 + public/build/assets/View-zrAhMWDK.js | 1 + public/build/assets/View.040f1403.js | 1 - public/build/assets/View.5145c8b2.js | 1 - public/build/assets/View.8950a1c9.js | 1 - public/build/assets/View.912160dc.js | 1 - public/build/assets/View.a4972ae5.js | 2 - public/build/assets/View.b0d70782.js | 1 - public/build/assets/View.b9049173.js | 1 - public/build/assets/View.cf2fb879.js | 1 - public/build/assets/View.dc6375b6.js | 1 - public/build/assets/auth-KGSQmcys.js | 1 + public/build/assets/auth.75822dcb.js | 1 - public/build/assets/category-UGWSUknX.js | 1 + public/build/assets/category.3bd14c85.js | 1 - .../default-avatar-4j3-l2sn.jpg} | Bin public/build/assets/disk-GjCD9u7d.js | 1 + public/build/assets/disk.84b94298.js | 1 - .../assets/dynamic-import-helper-0gtGTknh.js | 1 + public/build/assets/estimate-XE92iG-s.js | 1 + public/build/assets/estimate.9b0ec424.js | 1 - public/build/assets/exchange-rate--sifpuzz.js | 1 + public/build/assets/exchange-rate.e85a4793.js | 1 - public/build/assets/expense-jTuBtGLS.js | 1 + public/build/assets/expense.9bde13f4.js | 1 - .../frame.svg => assets/frame-u8HpZIO2.svg} | 0 public/build/assets/global-TrqB6NgK.js | 1 + public/build/assets/global.cf2a9bd7.js | 1 - .../icon.png => assets/icon-BI8tR8R6.png} | Bin public/build/assets/index.esm-Ea-ZFYlS.js | 1 + public/build/assets/index.esm.7e25573e.js | 1 - public/build/assets/invoice-KrT8OLdk.js | 1 + public/build/assets/invoice.6fd08b90.js | 1 - .../invoice1-eInfYhl4.png} | Bin .../invoice2-WhNY4coq.png} | Bin .../invoice3-oNC02WIt.png} | Bin .../login-vector1-FbAMlCtm.svg} | 0 .../login-vector2-NfewgmhZ.svg} | 0 .../login-vector3-B4jR7JVY.svg} | 0 .../logo-gray-5nGU86PO.png} | Bin .../logo-white-nGDfNlBY.png} | Bin .../logo.png => assets/logo-xCiSAN0z.png} | Bin public/build/assets/mail-driver-9YpfUUN4.js | 1 + public/build/assets/mail-driver.2253d638.js | 1 - public/build/assets/main-jjUNXUL3.css | 1 + .../{vendor.fd3b1727.js => main-vzIkKseS.js} | 1600 +++++------ public/build/assets/main.30b53055.css | 1 - public/build/assets/main.fc26c84f.js | 16 - public/build/assets/payment-ALr-TD5m.js | 1 + public/build/assets/payment-GpRe3-Wi.js | 1 + public/build/assets/payment.20522a38.js | 1 - public/build/assets/payment.505d9057.js | 1 - .../tick.png => assets/tick-ZCqPAN6j.png} | Bin public/build/assets/users-8F9xl7d2.js | 1 + public/build/assets/users.bb63694b.js | 1 - public/build/img/PDF/invoice1.png | Bin 96871 -> 0 bytes public/build/img/PDF/invoice2.png | Bin 95540 -> 0 bytes public/build/img/PDF/invoice3.png | Bin 107435 -> 0 bytes public/build/manifest.json | 2344 +++++++++-------- 270 files changed, 2265 insertions(+), 2220 deletions(-) create mode 100644 public/build/assets/404-Z7jKPlt3.js delete mode 100644 public/build/assets/404.4d7685db.js create mode 100644 public/build/assets/AccountSetting-06M3GRJr.js delete mode 100644 public/build/assets/AccountSetting.d7aa051b.js create mode 100644 public/build/assets/AddressInformation-rf-keUEw.js delete mode 100644 public/build/assets/AddressInformation.790df2bc.js create mode 100644 public/build/assets/AstronautIcon-Cu4zzuLg.js delete mode 100644 public/build/assets/AstronautIcon.5afbaf6c.js create mode 100644 public/build/assets/BackupSetting-mmKrsMfR.js delete mode 100644 public/build/assets/BackupSetting.e9cd0073.js rename public/build/assets/{BaseEditor.bacb9608.css => BaseEditor-8o6Sf_Iq.css} (100%) create mode 100644 public/build/assets/BaseEditor-nkRYKoo1.js delete mode 100644 public/build/assets/BaseEditor.ec8bd38c.js create mode 100644 public/build/assets/BaseListItem-SKSPChPw.js delete mode 100644 public/build/assets/BaseListItem.5fd4d75d.js create mode 100644 public/build/assets/BaseMultiselect-T7POF4wb.js delete mode 100644 public/build/assets/BaseMultiselect.f7bf60e3.js create mode 100644 public/build/assets/BaseTable-HYHVnjlk.js delete mode 100644 public/build/assets/BaseTable.c2b2d20a.js create mode 100644 public/build/assets/CapsuleIcon-Rj3UD5LO.js delete mode 100644 public/build/assets/CapsuleIcon.730f4dd2.js create mode 100644 public/build/assets/CategoryModal-k2zsC2hK.js delete mode 100644 public/build/assets/CategoryModal.cb867f43.js create mode 100644 public/build/assets/CompanyInfoSettings-1CNniwZ8.js delete mode 100644 public/build/assets/CompanyInfoSettings.e80e4a03.js create mode 100644 public/build/assets/Create-II8eq-s_.js create mode 100644 public/build/assets/Create-W4ThzIMu.js create mode 100644 public/build/assets/Create-ay9iZL5d.js create mode 100644 public/build/assets/Create-htsQOe0Y.js create mode 100644 public/build/assets/Create-iSgr_dU6.js delete mode 100644 public/build/assets/Create.6a1b616b.js delete mode 100644 public/build/assets/Create.6d36d723.js delete mode 100644 public/build/assets/Create.701a2926.js delete mode 100644 public/build/assets/Create.9313a497.js delete mode 100644 public/build/assets/Create.c6a28457.js create mode 100644 public/build/assets/CreateCustomFields-hHeYNhLY.js delete mode 100644 public/build/assets/CreateCustomFields.5609a247.js create mode 100644 public/build/assets/CustomFieldsSetting-W-qITsqX.js delete mode 100644 public/build/assets/CustomFieldsSetting.5910326d.js create mode 100644 public/build/assets/CustomerIndexDropdown-dSzhysTu.js delete mode 100644 public/build/assets/CustomerIndexDropdown.44b8afc5.js create mode 100644 public/build/assets/CustomerSettings-x29BvxZg.js delete mode 100644 public/build/assets/CustomerSettings.b26235a8.js create mode 100644 public/build/assets/CustomizationSetting-VYZFiTwK.js delete mode 100644 public/build/assets/CustomizationSetting.77479b06.js create mode 100644 public/build/assets/Dashboard-AkFBE3Pt.js create mode 100644 public/build/assets/Dashboard-kgGGyUGQ.js delete mode 100644 public/build/assets/Dashboard.79084651.js delete mode 100644 public/build/assets/Dashboard.905d2846.js create mode 100644 public/build/assets/DateTimeType-hV9WZ_9z.js delete mode 100644 public/build/assets/DateTimeType.4faa64b8.js create mode 100644 public/build/assets/DateType-AuJbnKst.js delete mode 100644 public/build/assets/DateType.074be010.js create mode 100644 public/build/assets/DragIcon-szQ4f7me.js delete mode 100644 public/build/assets/DragIcon.7c80aca9.js create mode 100644 public/build/assets/DropdownType-dylq9kV9.js delete mode 100644 public/build/assets/DropdownType.f13bd479.js create mode 100644 public/build/assets/EstimateCreate-JIRqdSKA.js delete mode 100644 public/build/assets/EstimateCreate.15e0dde4.js create mode 100644 public/build/assets/EstimateIcon-Jl2662IN.js delete mode 100644 public/build/assets/EstimateIcon.a0aca522.js create mode 100644 public/build/assets/EstimateIndexDropdown-ZN9wO8Lw.js delete mode 100644 public/build/assets/EstimateIndexDropdown.bae761c6.js create mode 100644 public/build/assets/ExchangeRateConverter-ZwwFqeKM.js delete mode 100644 public/build/assets/ExchangeRateConverter.0aa9df3c.js create mode 100644 public/build/assets/ExchangeRateProviderSetting-r-dCB5Fc.js delete mode 100644 public/build/assets/ExchangeRateProviderSetting.4ea17a5c.js create mode 100644 public/build/assets/ExpenseCategorySetting-74_Blw7j.js delete mode 100644 public/build/assets/ExpenseCategorySetting.188d492f.js create mode 100644 public/build/assets/FileDiskSetting-Ns0c-FNZ.js delete mode 100644 public/build/assets/FileDiskSetting.e6793479.js create mode 100644 public/build/assets/ForgotPassword-WS5c4CnP.js create mode 100644 public/build/assets/ForgotPassword-eqAwwXNW.js delete mode 100644 public/build/assets/ForgotPassword.ca04a561.js delete mode 100644 public/build/assets/ForgotPassword.f56b2527.js create mode 100644 public/build/assets/Index-28CpEt3A.js create mode 100644 public/build/assets/Index-5ShXhPYh.js create mode 100644 public/build/assets/Index-6qiU6m-S.js create mode 100644 public/build/assets/Index-AANAHlQ2.js create mode 100644 public/build/assets/Index-G9G1PIfr.js create mode 100644 public/build/assets/Index-M1bPd3Wc.js create mode 100644 public/build/assets/Index-Rihd2aA2.js create mode 100644 public/build/assets/Index-cea-iEJX.js create mode 100644 public/build/assets/Index-dSIICLwC.js create mode 100644 public/build/assets/Index-getU2mY4.js create mode 100644 public/build/assets/Index-q-Hmx4if.js create mode 100644 public/build/assets/Index-wEUaFE85.js create mode 100644 public/build/assets/Index-xtdfV9KI.js delete mode 100644 public/build/assets/Index.0dab6293.js delete mode 100644 public/build/assets/Index.0e445439.js delete mode 100644 public/build/assets/Index.23a9a4c6.js delete mode 100644 public/build/assets/Index.2f358b6e.js delete mode 100644 public/build/assets/Index.443c85db.js delete mode 100644 public/build/assets/Index.56225d5b.js delete mode 100644 public/build/assets/Index.5820505d.js delete mode 100644 public/build/assets/Index.5c342df0.js delete mode 100644 public/build/assets/Index.85722697.js delete mode 100644 public/build/assets/Index.8e17349f.js delete mode 100644 public/build/assets/Index.9ec2b26a.js delete mode 100644 public/build/assets/Index.db63375d.js delete mode 100644 public/build/assets/Index.ffa09876.js create mode 100644 public/build/assets/InputType-L0rMrry9.js delete mode 100644 public/build/assets/InputType.22b7cbab.js create mode 100644 public/build/assets/Installation-QPa-1r5S.js delete mode 100644 public/build/assets/Installation.345739e0.js create mode 100644 public/build/assets/InvoiceCreate-tss67BFs.js delete mode 100644 public/build/assets/InvoiceCreate.f33d2f08.js create mode 100644 public/build/assets/InvoiceIndexDropdown-pu_jVPSm.js delete mode 100644 public/build/assets/InvoiceIndexDropdown.5aa0548b.js create mode 100644 public/build/assets/InvoicePublicPage-vTeOBslJ.js delete mode 100644 public/build/assets/InvoicePublicPage.49bea2e2.js create mode 100644 public/build/assets/ItemUnitModal-BC4Fg9D4.js delete mode 100644 public/build/assets/ItemUnitModal.f71b6bbd.js create mode 100644 public/build/assets/LayoutBasic-E2NyFHv0.js create mode 100644 public/build/assets/LayoutBasic-sPuhaYCP.js delete mode 100644 public/build/assets/LayoutBasic.754d58be.js delete mode 100644 public/build/assets/LayoutBasic.8d94499d.js create mode 100644 public/build/assets/LayoutInstallation-MnXpVZpR.js delete mode 100644 public/build/assets/LayoutInstallation.ef8c1f28.js create mode 100644 public/build/assets/LayoutLogin-NPOaWC_w.js create mode 100644 public/build/assets/LayoutLogin-zaAD4FDU.js delete mode 100644 public/build/assets/LayoutLogin.53af66e4.js delete mode 100644 public/build/assets/LayoutLogin.ad0ca28d.js create mode 100644 public/build/assets/LineChart-wa69n_NW.js delete mode 100644 public/build/assets/LineChart.2823de1b.js create mode 100644 public/build/assets/LoadingIcon-fUkhTV3p.js delete mode 100644 public/build/assets/LoadingIcon.4d92e0c0.js create mode 100644 public/build/assets/Login-0_Qt8hoa.js create mode 100644 public/build/assets/Login-d6ikdrcp.js delete mode 100644 public/build/assets/Login.cc831709.js delete mode 100644 public/build/assets/Login.fd14ea97.js create mode 100644 public/build/assets/MailConfigSetting-1hXxeQ4V.js delete mode 100644 public/build/assets/MailConfigSetting.f7d10f38.js create mode 100644 public/build/assets/MoonwalkerIcon-2NrMqjN-.js delete mode 100644 public/build/assets/MoonwalkerIcon.92ea8796.js rename public/build/assets/{NoteModal.3245b7d3.css => NoteModal-lSPPZux7.css} (100%) create mode 100644 public/build/assets/NoteModal-rdu-Hccj.js delete mode 100644 public/build/assets/NoteModal.ecba55bc.js create mode 100644 public/build/assets/NotesSetting-CW5tKP32.js delete mode 100644 public/build/assets/NotesSetting.6052e5e3.js create mode 100644 public/build/assets/NotificationRoot-dU6Sc2aV.js delete mode 100644 public/build/assets/NotificationRoot.452046ea.js create mode 100644 public/build/assets/NotificationsSetting-S1DylUbI.js delete mode 100644 public/build/assets/NotificationsSetting.b153c485.js create mode 100644 public/build/assets/NumberType-LSMIEyWL.js delete mode 100644 public/build/assets/NumberType.5e07b641.js create mode 100644 public/build/assets/ObservatoryIcon-NvQ8CxCP.js delete mode 100644 public/build/assets/ObservatoryIcon.6d06653e.js create mode 100644 public/build/assets/PaymentModeModal-OW7LJo93.js delete mode 100644 public/build/assets/PaymentModeModal.ca34bfc6.js create mode 100644 public/build/assets/PaymentsModeSetting-06uCV4bc.js delete mode 100644 public/build/assets/PaymentsModeSetting.b422aded.js create mode 100644 public/build/assets/PhoneType-9SsFabB7.js delete mode 100644 public/build/assets/PhoneType.10fcbacc.js rename public/build/{fonts/Poppins-Black.ttf => assets/Poppins-Black-tiyKixU2.ttf} (100%) rename public/build/{fonts/Poppins-Light.ttf => assets/Poppins-Light-oQZpbsDM.ttf} (100%) rename public/build/{fonts/Poppins-Medium.ttf => assets/Poppins-Medium-8AJSf1CK.ttf} (100%) rename public/build/{fonts/Poppins-Regular.ttf => assets/Poppins-Regular-gxOM_eBK.ttf} (100%) rename public/build/{fonts/Poppins-SemiBold.ttf => assets/Poppins-SemiBold-xkkfLQvD.ttf} (100%) create mode 100644 public/build/assets/PreferencesSetting-qDiIMYco.js delete mode 100644 public/build/assets/PreferencesSetting.91fd3c64.js create mode 100644 public/build/assets/RecurringInvoiceCreate-xoYk2gUe.js delete mode 100644 public/build/assets/RecurringInvoiceCreate.63960c81.js create mode 100644 public/build/assets/RecurringInvoiceIndexDropdown-PyrJU784.js delete mode 100644 public/build/assets/RecurringInvoiceIndexDropdown.a1e59959.js create mode 100644 public/build/assets/ResetPassword-uBIR2v0g.js create mode 100644 public/build/assets/ResetPassword-yF1cFJet.js delete mode 100644 public/build/assets/ResetPassword.48d64201.js delete mode 100644 public/build/assets/ResetPassword.bff307e0.js create mode 100644 public/build/assets/RolesSettings-gCNnqU54.js delete mode 100644 public/build/assets/RolesSettings.f104eca8.js create mode 100644 public/build/assets/SalesTax-CDQbOzvw.js delete mode 100644 public/build/assets/SalesTax.70513e81.js create mode 100644 public/build/assets/SelectNotePopup-DKlwyGyu.js delete mode 100644 public/build/assets/SelectNotePopup.332d8bb2.js create mode 100644 public/build/assets/SendEstimateModal-GmEK-a4y.js delete mode 100644 public/build/assets/SendEstimateModal.91274455.js create mode 100644 public/build/assets/SendInvoiceModal-DTdeZlwF.js delete mode 100644 public/build/assets/SendInvoiceModal.b0759567.js create mode 100644 public/build/assets/SendPaymentModal-4tmkg0dz.js delete mode 100644 public/build/assets/SendPaymentModal.5b2acf9d.js create mode 100644 public/build/assets/SettingsIndex-dvOPTB0E.js create mode 100644 public/build/assets/SettingsIndex-xl6FX5wL.js delete mode 100644 public/build/assets/SettingsIndex.af05238d.js delete mode 100644 public/build/assets/SettingsIndex.c15daa63.js create mode 100644 public/build/assets/SwitchType-35txdira.js delete mode 100644 public/build/assets/SwitchType.522fc982.js rename public/build/{fonts/THSarabunNew.ttf => assets/THSarabunNew-AjsEQpFw.ttf} (100%) rename public/build/{fonts/THSarabunNew-Bold.ttf => assets/THSarabunNew-Bold-6rQIu1fB.ttf} (100%) rename public/build/{fonts/THSarabunNew-BoldItalic.ttf => assets/THSarabunNew-BoldItalic-t52o19PJ.ttf} (100%) rename public/build/{fonts/THSarabunNew-Italic.ttf => assets/THSarabunNew-Italic-AIglRIUE.ttf} (100%) create mode 100644 public/build/assets/TaxTypeModal-HlOjbce1.js delete mode 100644 public/build/assets/TaxTypeModal.73b640f9.js create mode 100644 public/build/assets/TaxTypesSetting-VOaQcNuU.js delete mode 100644 public/build/assets/TaxTypesSetting.95e6443a.js create mode 100644 public/build/assets/TextAreaType-G_tBc6oP.js delete mode 100644 public/build/assets/TextAreaType.d6dd293e.js create mode 100644 public/build/assets/TimeType-_QpZML6e.js delete mode 100644 public/build/assets/TimeType.3f06c579.js create mode 100644 public/build/assets/UpdateAppSetting-n48rjGXD.js rename public/build/assets/{UpdateAppSetting.7d8b987a.css => UpdateAppSetting-rzmq_by0.css} (100%) delete mode 100644 public/build/assets/UpdateAppSetting.aef85435.js create mode 100644 public/build/assets/UrlType-kbgsrP4R.js delete mode 100644 public/build/assets/UrlType.a77493a7.js create mode 100644 public/build/assets/View-6rSeFJSD.js create mode 100644 public/build/assets/View-8tfG5u9N.js create mode 100644 public/build/assets/View-Eq6jnt-f.js create mode 100644 public/build/assets/View-aJjoeJiw.js create mode 100644 public/build/assets/View-baJjXj9x.js create mode 100644 public/build/assets/View-h94cNM2j.js create mode 100644 public/build/assets/View-j7p-fIXT.js create mode 100644 public/build/assets/View-tAcvKt0q.js create mode 100644 public/build/assets/View-zrAhMWDK.js delete mode 100644 public/build/assets/View.040f1403.js delete mode 100644 public/build/assets/View.5145c8b2.js delete mode 100644 public/build/assets/View.8950a1c9.js delete mode 100644 public/build/assets/View.912160dc.js delete mode 100644 public/build/assets/View.a4972ae5.js delete mode 100644 public/build/assets/View.b0d70782.js delete mode 100644 public/build/assets/View.b9049173.js delete mode 100644 public/build/assets/View.cf2fb879.js delete mode 100644 public/build/assets/View.dc6375b6.js create mode 100644 public/build/assets/auth-KGSQmcys.js delete mode 100644 public/build/assets/auth.75822dcb.js create mode 100644 public/build/assets/category-UGWSUknX.js delete mode 100644 public/build/assets/category.3bd14c85.js rename public/build/{img/default-avatar.jpg => assets/default-avatar-4j3-l2sn.jpg} (100%) create mode 100644 public/build/assets/disk-GjCD9u7d.js delete mode 100644 public/build/assets/disk.84b94298.js create mode 100644 public/build/assets/dynamic-import-helper-0gtGTknh.js create mode 100644 public/build/assets/estimate-XE92iG-s.js delete mode 100644 public/build/assets/estimate.9b0ec424.js create mode 100644 public/build/assets/exchange-rate--sifpuzz.js delete mode 100644 public/build/assets/exchange-rate.e85a4793.js create mode 100644 public/build/assets/expense-jTuBtGLS.js delete mode 100644 public/build/assets/expense.9bde13f4.js rename public/build/{img/login/frame.svg => assets/frame-u8HpZIO2.svg} (100%) create mode 100644 public/build/assets/global-TrqB6NgK.js delete mode 100644 public/build/assets/global.cf2a9bd7.js rename public/build/{img/icon.png => assets/icon-BI8tR8R6.png} (100%) create mode 100644 public/build/assets/index.esm-Ea-ZFYlS.js delete mode 100644 public/build/assets/index.esm.7e25573e.js create mode 100644 public/build/assets/invoice-KrT8OLdk.js delete mode 100644 public/build/assets/invoice.6fd08b90.js rename public/build/{img/PDF/estimate1.png => assets/invoice1-eInfYhl4.png} (100%) rename public/build/{img/PDF/estimate2.png => assets/invoice2-WhNY4coq.png} (100%) rename public/build/{img/PDF/estimate3.png => assets/invoice3-oNC02WIt.png} (100%) rename public/build/{img/login/login-vector1.svg => assets/login-vector1-FbAMlCtm.svg} (100%) rename public/build/{img/login/login-vector2.svg => assets/login-vector2-NfewgmhZ.svg} (100%) rename public/build/{img/login/login-vector3.svg => assets/login-vector3-B4jR7JVY.svg} (100%) rename public/build/{img/logo-gray.png => assets/logo-gray-5nGU86PO.png} (100%) rename public/build/{img/logo-white.png => assets/logo-white-nGDfNlBY.png} (100%) rename public/build/{img/logo.png => assets/logo-xCiSAN0z.png} (100%) create mode 100644 public/build/assets/mail-driver-9YpfUUN4.js delete mode 100644 public/build/assets/mail-driver.2253d638.js create mode 100644 public/build/assets/main-jjUNXUL3.css rename public/build/assets/{vendor.fd3b1727.js => main-vzIkKseS.js} (51%) delete mode 100644 public/build/assets/main.30b53055.css delete mode 100644 public/build/assets/main.fc26c84f.js create mode 100644 public/build/assets/payment-ALr-TD5m.js create mode 100644 public/build/assets/payment-GpRe3-Wi.js delete mode 100644 public/build/assets/payment.20522a38.js delete mode 100644 public/build/assets/payment.505d9057.js rename public/build/{img/tick.png => assets/tick-ZCqPAN6j.png} (100%) create mode 100644 public/build/assets/users-8F9xl7d2.js delete mode 100644 public/build/assets/users.bb63694b.js delete mode 100644 public/build/img/PDF/invoice1.png delete mode 100644 public/build/img/PDF/invoice2.png delete mode 100644 public/build/img/PDF/invoice3.png diff --git a/public/build/assets/404-Z7jKPlt3.js b/public/build/assets/404-Z7jKPlt3.js new file mode 100644 index 00000000..7cb6f38d --- /dev/null +++ b/public/build/assets/404-Z7jKPlt3.js @@ -0,0 +1 @@ +import{J as u,f as m,l as d,r as n,o as p,c as h,b as s,t as o,a as c,w as f,q as _,m as x}from"./main-vzIkKseS.js";const g={class:"w-full h-screen"},w={class:"flex items-center justify-center w-full h-full"},y={class:"flex flex-col items-center justify-center"},b={class:"text-primary-500",style:{"font-size":"10rem"}},v={class:"mb-10 text-3xl text-primary-500"},k={setup(B){const e=u();m();const l=d(()=>{if(e.path.indexOf("customer")>-1&&e.params.company)return`/${e.params.company}/customer/dashboard`;if(e.params.catchAll){let a=e.params.catchAll.indexOf("/");return a>-1?`/${e.params.catchAll.substring(a,0)}/customer/dashboard`:"/"}else return"/admin/dashboard"});return(t,a)=>{const r=n("BaseIcon"),i=n("router-link");return p(),h("div",g,[s("div",w,[s("div",y,[s("h1",b,o(t.$t("general.four_zero_four")),1),s("h5",v,o(t.$t("general.you_got_lost")),1),c(i,{class:"flex items-center w-32 h-12 px-3 py-1 text-base font-medium leading-none text-center text-white rounded whitespace-nowrap bg-primary-500 btn-lg hover:text-white",to:x(l)},{default:f(()=>[c(r,{name:"ArrowLeftIcon",class:"mr-2 text-white icon"}),_(" "+o(t.$t("general.go_home")),1)]),_:1},8,["to"])])])])}}};export{k as default}; diff --git a/public/build/assets/404.4d7685db.js b/public/build/assets/404.4d7685db.js deleted file mode 100644 index 79abb09d..00000000 --- a/public/build/assets/404.4d7685db.js +++ /dev/null @@ -1 +0,0 @@ -import{G as u,aN as d,k as m,r as n,o as h,e as p,h as s,t as o,f as c,w as f,i as _,u as x}from"./vendor.fd3b1727.js";const g={class:"w-full h-screen"},w={class:"flex items-center justify-center w-full h-full"},y={class:"flex flex-col items-center justify-center"},b={class:"text-primary-500",style:{"font-size":"10rem"}},v={class:"mb-10 text-3xl text-primary-500"},$={setup(k){const e=u();d();const l=m(()=>{if(e.path.indexOf("customer")>-1&&e.params.company)return`/${e.params.company}/customer/dashboard`;if(e.params.catchAll){let a=e.params.catchAll.indexOf("/");return a>-1?`/${e.params.catchAll.substring(a,0)}/customer/dashboard`:"/"}else return"/admin/dashboard"});return(t,a)=>{const r=n("BaseIcon"),i=n("router-link");return h(),p("div",g,[s("div",w,[s("div",y,[s("h1",b,o(t.$t("general.four_zero_four")),1),s("h5",v,o(t.$t("general.you_got_lost")),1),c(i,{class:"flex items-center w-32 h-12 px-3 py-1 text-base font-medium leading-none text-center text-white rounded whitespace-nowrap bg-primary-500 btn-lg hover:text-white",to:x(l)},{default:f(()=>[c(r,{name:"ArrowLeftIcon",class:"mr-2 text-white icon"}),_(" "+o(t.$t("general.go_home")),1)]),_:1},8,["to"])])])])}}};export{$ as default}; diff --git a/public/build/assets/AccountSetting-06M3GRJr.js b/public/build/assets/AccountSetting-06M3GRJr.js new file mode 100644 index 00000000..c17e54f7 --- /dev/null +++ b/public/build/assets/AccountSetting-06M3GRJr.js @@ -0,0 +1 @@ +import{K as N,E as D,C as R,e as h,g as $,l as B,h as f,i as V,j as E,G as L,Z as j,F as z,k as H,r as u,o as b,c as K,a as o,w as l,m as e,p as P,n as T,H as Z,I as J,q as O,t as Q,s as W,b as X}from"./main-vzIkKseS.js";const Y=["onSubmit"],x=X("span",null,null,-1),se={setup(ee){const i=N(),U=D(),I=R(),{t:c}=h();let d=$(!1),m=$(null),g=$([]);const w=$(!1);i.currentUser.avatar&&g.value.push({image:i.currentUser.avatar});const S=B(()=>({name:{required:f.withMessage(c("validation.required"),V)},email:{required:f.withMessage(c("validation.required"),V),email:f.withMessage(c("validation.email_incorrect"),E)},password:{minLength:f.withMessage(c("validation.password_length",{count:8}),L(8))},confirm_password:{sameAsPassword:f.withMessage(c("validation.password_incorrect"),j(s.password))}})),s=z({name:i.currentUser.name,email:i.currentUser.email,language:i.currentUserSettings.language||I.selectedCompanySettings.language,password:"",confirm_password:""}),n=H(S,B(()=>s));function C(r,a){m.value=a}function y(){m.value=null,w.value=!0}async function F(){if(n.value.$touch(),n.value.$invalid)return!0;d.value=!0;let r={name:s.name,email:s.email};try{if(s.password!=null&&s.password!==void 0&&s.password!==""&&(r={...r,password:s.password}),i.currentUserSettings.language!==s.language&&await i.updateUserSettings({settings:{language:s.language}}),(await i.updateCurrentUser(r)).data.data){if(d.value=!1,m.value||w.value){let v=new FormData;m.value&&v.append("admin_avatar",m.value),v.append("is_admin_avatar_removed",w.value),await i.uploadAvatar(v),m.value=null,w.value=!1}s.password="",s.confirm_password=""}}catch{return d.value=!1,!0}}return(r,a)=>{const v=u("BaseFileUploader"),p=u("BaseInputGroup"),_=u("BaseInput"),q=u("BaseMultiselect"),M=u("BaseInputGrid"),k=u("BaseIcon"),G=u("BaseButton"),A=u("BaseSettingCard");return b(),K("form",{class:"relative",onSubmit:W(F,["prevent"])},[o(A,{title:r.$t("settings.account_settings.account_settings"),description:r.$t("settings.account_settings.section_description")},{default:l(()=>[o(M,null,{default:l(()=>[o(p,{label:r.$tc("settings.account_settings.profile_picture")},{default:l(()=>[o(v,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=t=>P(g)?g.value=t:g=t),avatar:!0,accept:"image/*",onChange:C,onRemove:y},null,8,["modelValue"])]),_:1},8,["label"]),x,o(p,{label:r.$tc("settings.account_settings.name"),error:e(n).name.$error&&e(n).name.$errors[0].$message,required:""},{default:l(()=>[o(_,{modelValue:e(s).name,"onUpdate:modelValue":a[1]||(a[1]=t=>e(s).name=t),invalid:e(n).name.$error,onInput:a[2]||(a[2]=t=>e(n).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(p,{label:r.$tc("settings.account_settings.email"),error:e(n).email.$error&&e(n).email.$errors[0].$message,required:""},{default:l(()=>[o(_,{modelValue:e(s).email,"onUpdate:modelValue":a[3]||(a[3]=t=>e(s).email=t),invalid:e(n).email.$error,onInput:a[4]||(a[4]=t=>e(n).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(p,{error:e(n).password.$error&&e(n).password.$errors[0].$message,label:r.$tc("settings.account_settings.password")},{default:l(()=>[o(_,{modelValue:e(s).password,"onUpdate:modelValue":a[5]||(a[5]=t=>e(s).password=t),type:"password",onInput:a[6]||(a[6]=t=>e(n).password.$touch())},null,8,["modelValue"])]),_:1},8,["error","label"]),o(p,{label:r.$tc("settings.account_settings.confirm_password"),error:e(n).confirm_password.$error&&e(n).confirm_password.$errors[0].$message},{default:l(()=>[o(_,{modelValue:e(s).confirm_password,"onUpdate:modelValue":a[7]||(a[7]=t=>e(s).confirm_password=t),type:"password",onInput:a[8]||(a[8]=t=>e(n).confirm_password.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"]),o(p,{label:r.$tc("settings.language")},{default:l(()=>[o(q,{modelValue:e(s).language,"onUpdate:modelValue":a[9]||(a[9]=t=>e(s).language=t),options:e(U).config.languages,label:"name","value-prop":"code","track-by":"name","open-direction":"top"},null,8,["modelValue","options"])]),_:1},8,["label"])]),_:1}),o(G,{loading:e(d),disabled:e(d),class:"mt-6"},{left:l(t=>[e(d)?J("",!0):(b(),T(k,{key:0,name:"SaveIcon",class:Z(t.class)},null,8,["class"]))]),default:l(()=>[O(" "+Q(r.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title","description"])],40,Y)}}};export{se as default}; diff --git a/public/build/assets/AccountSetting.d7aa051b.js b/public/build/assets/AccountSetting.d7aa051b.js deleted file mode 100644 index 21e68ffb..00000000 --- a/public/build/assets/AccountSetting.d7aa051b.js +++ /dev/null @@ -1 +0,0 @@ -var L=Object.defineProperty,P=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var U=(u,s,i)=>s in u?L(u,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[s]=i,S=(u,s)=>{for(var i in s||(s={}))z.call(s,i)&&U(u,i,s[i]);if(V)for(var i of V(s))E.call(s,i)&&U(u,i,s[i]);return u},I=(u,s)=>P(u,T(s));import{J,B as b,k as y,L as _,M as C,Q,N as H,P as K,a0 as O,T as W,r as m,o as M,e as X,f as r,w as d,u as e,x as Y,l as Z,m as x,j as ee,i as ae,t as se,U as te,h as ne}from"./vendor.fd3b1727.js";import{e as oe,d as re,b as le}from"./main.fc26c84f.js";const ie=["onSubmit"],ue=ne("span",null,null,-1),ce={setup(u){const s=oe(),i=re(),F=le(),{t:v}=J();let p=b(!1),c=b(null),f=b([]);const $=b(!1);s.currentUser.avatar&&f.value.push({image:s.currentUser.avatar});const q=y(()=>({name:{required:_.withMessage(v("validation.required"),C)},email:{required:_.withMessage(v("validation.required"),C),email:_.withMessage(v("validation.email_incorrect"),Q)},password:{minLength:_.withMessage(v("validation.password_length",{count:8}),H(8))},confirm_password:{sameAsPassword:_.withMessage(v("validation.password_incorrect"),K(t.password))}})),t=O({name:s.currentUser.name,email:s.currentUser.email,language:s.currentUserSettings.language||F.selectedCompanySettings.language,password:"",confirm_password:""}),o=W(q,y(()=>t));function k(l,a){c.value=a}function N(){c.value=null,$.value=!0}async function A(){if(o.value.$touch(),o.value.$invalid)return!0;p.value=!0;let l={name:t.name,email:t.email};try{if(t.password!=null&&t.password!==void 0&&t.password!==""&&(l=I(S({},l),{password:t.password})),s.currentUserSettings.language!==t.language&&await s.updateUserSettings({settings:{language:t.language}}),(await s.updateCurrentUser(l)).data.data){if(p.value=!1,c.value||$.value){let w=new FormData;c.value&&w.append("admin_avatar",c.value),w.append("is_admin_avatar_removed",$.value),await s.uploadAvatar(w),c.value=null,$.value=!1}t.password="",t.confirm_password=""}}catch{return p.value=!1,!0}}return(l,a)=>{const w=m("BaseFileUploader"),g=m("BaseInputGroup"),B=m("BaseInput"),G=m("BaseMultiselect"),D=m("BaseInputGrid"),R=m("BaseIcon"),h=m("BaseButton"),j=m("BaseSettingCard");return M(),X("form",{class:"relative",onSubmit:te(A,["prevent"])},[r(j,{title:l.$t("settings.account_settings.account_settings"),description:l.$t("settings.account_settings.section_description")},{default:d(()=>[r(D,null,{default:d(()=>[r(g,{label:l.$tc("settings.account_settings.profile_picture")},{default:d(()=>[r(w,{modelValue:e(f),"onUpdate:modelValue":a[0]||(a[0]=n=>Y(f)?f.value=n:f=n),avatar:!0,accept:"image/*",onChange:k,onRemove:N},null,8,["modelValue"])]),_:1},8,["label"]),ue,r(g,{label:l.$tc("settings.account_settings.name"),error:e(o).name.$error&&e(o).name.$errors[0].$message,required:""},{default:d(()=>[r(B,{modelValue:e(t).name,"onUpdate:modelValue":a[1]||(a[1]=n=>e(t).name=n),invalid:e(o).name.$error,onInput:a[2]||(a[2]=n=>e(o).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),r(g,{label:l.$tc("settings.account_settings.email"),error:e(o).email.$error&&e(o).email.$errors[0].$message,required:""},{default:d(()=>[r(B,{modelValue:e(t).email,"onUpdate:modelValue":a[3]||(a[3]=n=>e(t).email=n),invalid:e(o).email.$error,onInput:a[4]||(a[4]=n=>e(o).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),r(g,{error:e(o).password.$error&&e(o).password.$errors[0].$message,label:l.$tc("settings.account_settings.password")},{default:d(()=>[r(B,{modelValue:e(t).password,"onUpdate:modelValue":a[5]||(a[5]=n=>e(t).password=n),type:"password",onInput:a[6]||(a[6]=n=>e(o).password.$touch())},null,8,["modelValue"])]),_:1},8,["error","label"]),r(g,{label:l.$tc("settings.account_settings.confirm_password"),error:e(o).confirm_password.$error&&e(o).confirm_password.$errors[0].$message},{default:d(()=>[r(B,{modelValue:e(t).confirm_password,"onUpdate:modelValue":a[7]||(a[7]=n=>e(t).confirm_password=n),type:"password",onInput:a[8]||(a[8]=n=>e(o).confirm_password.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"]),r(g,{label:l.$tc("settings.language")},{default:d(()=>[r(G,{modelValue:e(t).language,"onUpdate:modelValue":a[9]||(a[9]=n=>e(t).language=n),options:e(i).config.languages,label:"name","value-prop":"code","track-by":"name","open-direction":"top"},null,8,["modelValue","options"])]),_:1},8,["label"])]),_:1}),r(h,{loading:e(p),disabled:e(p),class:"mt-6"},{left:d(n=>[e(p)?ee("",!0):(M(),Z(R,{key:0,name:"SaveIcon",class:x(n.class)},null,8,["class"]))]),default:d(()=>[ae(" "+se(l.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title","description"])],40,ie)}}};export{ce as default}; diff --git a/public/build/assets/AddressInformation-rf-keUEw.js b/public/build/assets/AddressInformation-rf-keUEw.js new file mode 100644 index 00000000..1b9e0fc7 --- /dev/null +++ b/public/build/assets/AddressInformation-rf-keUEw.js @@ -0,0 +1 @@ +import{J as C,e as I,g as z,r as m,o as b,c as y,a as o,w as n,b as d,t as p,m as e,H as h,q as F,I as $,n as S,s as k}from"./main-vzIkKseS.js";import{a as w,u as D}from"./global-TrqB6NgK.js";import"./auth-KGSQmcys.js";const N=["onSubmit"],j={class:"mb-6"},A={class:"font-bold text-left"},G={class:"mt-2 text-sm leading-snug text-left text-gray-500",style:{"max-width":"680px"}},T={class:"grid grid-cols-5 gap-4 mb-8"},q={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},E={class:"grid col-span-5 lg:col-span-4 gap-y-6 gap-x-4 md:grid-cols-6"},H={class:"md:col-span-3"},J={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},R={class:"p-1"},K={class:"grid grid-cols-5 gap-4 mb-8"},L={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},O={key:0,class:"grid col-span-5 lg:col-span-4 gap-y-6 gap-x-4 md:grid-cols-6"},P={class:"md:col-span-3"},Q={class:"flex items-center justify-end"},le={setup(W){const s=w();C();const{tm:v,t:X}=I(),g=D();let u=z(!1);g.fetchCountries();function B(){u.value=!0;let a=s.userForm;s.updateCurrentUser({data:a,message:v("customers.address_updated_message")}).then(t=>{u.value=!1}).catch(t=>{u.value=!1})}return(a,t)=>{const i=m("BaseInput"),r=m("BaseInputGroup"),f=m("BaseMultiselect"),c=m("BaseTextarea"),U=m("BaseDivider"),_=m("BaseIcon"),V=m("BaseButton"),M=m("BaseCard");return b(),y("form",{class:"relative h-full mt-4",onSubmit:k(B,["prevent"])},[o(M,null,{default:n(()=>[d("div",j,[d("h6",A,p(a.$t("settings.menu_title.address_information")),1),d("p",G,p(a.$t("settings.address_information.section_description")),1)]),d("div",T,[d("h6",q,p(a.$t("customers.billing_address")),1),d("div",E,[o(r,{label:a.$t("customers.name"),class:"w-full md:col-span-3"},{default:n(()=>[o(i,{modelValue:e(s).userForm.billing.name,"onUpdate:modelValue":t[0]||(t[0]=l=>e(s).userForm.billing.name=l),modelModifiers:{trim:!0},type:"text",class:"w-full",name:"address_name"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.country"),class:"md:col-span-3"},{default:n(()=>[o(f,{modelValue:e(s).userForm.billing.country_id,"onUpdate:modelValue":t[1]||(t[1]=l=>e(s).userForm.billing.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"",options:e(g).countries,placeholder:a.$t("general.select_country"),class:"w-full"},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.state"),class:"md:col-span-3"},{default:n(()=>[o(i,{modelValue:e(s).userForm.billing.state,"onUpdate:modelValue":t[2]||(t[2]=l=>e(s).userForm.billing.state=l),name:"billing.state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.city"),class:"md:col-span-3"},{default:n(()=>[o(i,{modelValue:e(s).userForm.billing.city,"onUpdate:modelValue":t[3]||(t[3]=l=>e(s).userForm.billing.city=l),name:"billing.city",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.address"),class:"md:col-span-3"},{default:n(()=>[o(c,{modelValue:e(s).userForm.billing.address_street_1,"onUpdate:modelValue":t[4]||(t[4]=l=>e(s).userForm.billing.address_street_1=l),modelModifiers:{trim:!0},placeholder:a.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3"},null,8,["modelValue","placeholder"]),o(c,{modelValue:e(s).userForm.billing.address_street_2,"onUpdate:modelValue":t[5]||(t[5]=l=>e(s).userForm.billing.address_street_2=l),modelModifiers:{trim:!0},placeholder:a.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),d("div",H,[o(r,{label:a.$t("customers.phone"),class:"text-left"},{default:n(()=>[o(i,{modelValue:e(s).userForm.billing.phone,"onUpdate:modelValue":t[6]||(t[6]=l=>e(s).userForm.billing.phone=l),modelModifiers:{trim:!0},type:"text",name:"phone"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.zip_code"),class:"mt-2 text-left"},{default:n(()=>[o(i,{modelValue:e(s).userForm.billing.zip,"onUpdate:modelValue":t[7]||(t[7]=l=>e(s).userForm.billing.zip=l),modelModifiers:{trim:!0},type:"text",name:"zip"},null,8,["modelValue"])]),_:1},8,["label"])])])]),o(U,{class:"mb-5 md:mb-8"}),d("div",J,[d("div",R,[o(V,{ref:(l,x)=>{x.sameAddress=l},type:"button",onClick:t[8]||(t[8]=l=>e(s).copyAddress(!0))},{left:n(l=>[o(_,{name:"DocumentDuplicateIcon",class:h(l.class)},null,8,["class"])]),default:n(()=>[F(" "+p(a.$t("customers.copy_billing_address")),1)]),_:1},512)])]),d("div",K,[d("h6",L,p(a.$t("customers.shipping_address")),1),e(s).userForm.shipping?(b(),y("div",O,[o(r,{label:a.$t("customers.name"),class:"md:col-span-3"},{default:n(()=>[o(i,{modelValue:e(s).userForm.shipping.name,"onUpdate:modelValue":t[9]||(t[9]=l=>e(s).userForm.shipping.name=l),modelModifiers:{trim:!0},type:"text",name:"address_name"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.country"),class:"md:col-span-3"},{default:n(()=>[o(f,{modelValue:e(s).userForm.shipping.country_id,"onUpdate:modelValue":t[10]||(t[10]=l=>e(s).userForm.shipping.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"",options:e(g).countries,placeholder:a.$t("general.select_country"),class:"w-full"},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.state"),class:"md:col-span-3"},{default:n(()=>[o(i,{modelValue:e(s).userForm.shipping.state,"onUpdate:modelValue":t[11]||(t[11]=l=>e(s).userForm.shipping.state=l),name:"shipping.state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.city"),class:"md:col-span-3"},{default:n(()=>[o(i,{modelValue:e(s).userForm.shipping.city,"onUpdate:modelValue":t[12]||(t[12]=l=>e(s).userForm.shipping.city=l),name:"shipping.city",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.address"),class:"md:col-span-3"},{default:n(()=>[o(c,{modelValue:e(s).userForm.shipping.address_street_1,"onUpdate:modelValue":t[13]||(t[13]=l=>e(s).userForm.shipping.address_street_1=l),modelModifiers:{trim:!0},type:"text",placeholder:a.$t("general.street_1"),name:"shipping_street1"},null,8,["modelValue","placeholder"]),o(c,{modelValue:e(s).userForm.shipping.address_street_2,"onUpdate:modelValue":t[14]||(t[14]=l=>e(s).userForm.shipping.address_street_2=l),modelModifiers:{trim:!0},type:"text",placeholder:a.$t("general.street_2"),name:"shipping_street2",class:"mt-3"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),d("div",P,[o(r,{label:a.$t("customers.phone"),class:"text-left"},{default:n(()=>[o(i,{modelValue:e(s).userForm.shipping.phone,"onUpdate:modelValue":t[15]||(t[15]=l=>e(s).userForm.shipping.phone=l),modelModifiers:{trim:!0},type:"text",name:"phone"},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:a.$t("customers.zip_code"),class:"mt-2 text-left"},{default:n(()=>[o(i,{modelValue:e(s).userForm.shipping.zip,"onUpdate:modelValue":t[16]||(t[16]=l=>e(s).userForm.shipping.zip=l),modelModifiers:{trim:!0},type:"text",name:"zip"},null,8,["modelValue"])]),_:1},8,["label"])])])):$("",!0)]),d("div",Q,[o(V,{loading:e(u),disabled:e(u)},{left:n(l=>[e(u)?$("",!0):(b(),S(_,{key:0,name:"SaveIcon",class:h(l.class)},null,8,["class"]))]),default:n(()=>[F(" "+p(a.$t("general.save")),1)]),_:1},8,["loading","disabled"])])]),_:1})],40,N)}}};export{le as default}; diff --git a/public/build/assets/AddressInformation.790df2bc.js b/public/build/assets/AddressInformation.790df2bc.js deleted file mode 100644 index 46a3f52c..00000000 --- a/public/build/assets/AddressInformation.790df2bc.js +++ /dev/null @@ -1 +0,0 @@ -import{G as C,J as z,B as I,r as m,o as b,e as y,f as o,w as r,h as d,t as p,u as e,m as h,i as F,j as v,l as S,U as j}from"./vendor.fd3b1727.js";import{a as k,u as w}from"./global.cf2a9bd7.js";import"./auth.75822dcb.js";import"./main.fc26c84f.js";const D=["onSubmit"],G={class:"mb-6"},N={class:"font-bold text-left"},A={class:"mt-2 text-sm leading-snug text-left text-gray-500",style:{"max-width":"680px"}},T={class:"grid grid-cols-5 gap-4 mb-8"},E={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},J={class:"grid col-span-5 lg:col-span-4 gap-y-6 gap-x-4 md:grid-cols-6"},R={class:"md:col-span-3"},q={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},H={class:"p-1"},K={class:"grid grid-cols-5 gap-4 mb-8"},L={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},O={key:0,class:"grid col-span-5 lg:col-span-4 gap-y-6 gap-x-4 md:grid-cols-6"},P={class:"md:col-span-3"},Q={class:"flex items-center justify-end"},se={setup(W){const s=k();C();const{tm:$,t:X}=z(),g=w();let u=I(!1);g.fetchCountries();function B(){u.value=!0;let a=s.userForm;s.updateCurrentUser({data:a,message:$("customers.address_updated_message")}).then(t=>{u.value=!1}).catch(t=>{u.value=!1})}return(a,t)=>{const i=m("BaseInput"),n=m("BaseInputGroup"),f=m("BaseMultiselect"),c=m("BaseTextarea"),U=m("BaseDivider"),_=m("BaseIcon"),V=m("BaseButton"),M=m("BaseCard");return b(),y("form",{class:"relative h-full mt-4",onSubmit:j(B,["prevent"])},[o(M,null,{default:r(()=>[d("div",G,[d("h6",N,p(a.$t("settings.menu_title.address_information")),1),d("p",A,p(a.$t("settings.address_information.section_description")),1)]),d("div",T,[d("h6",E,p(a.$t("customers.billing_address")),1),d("div",J,[o(n,{label:a.$t("customers.name"),class:"w-full md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(s).userForm.billing.name,"onUpdate:modelValue":t[0]||(t[0]=l=>e(s).userForm.billing.name=l),modelModifiers:{trim:!0},type:"text",class:"w-full",name:"address_name"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.country"),class:"md:col-span-3"},{default:r(()=>[o(f,{modelValue:e(s).userForm.billing.country_id,"onUpdate:modelValue":t[1]||(t[1]=l=>e(s).userForm.billing.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"",options:e(g).countries,placeholder:a.$t("general.select_country"),class:"w-full"},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.state"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(s).userForm.billing.state,"onUpdate:modelValue":t[2]||(t[2]=l=>e(s).userForm.billing.state=l),name:"billing.state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.city"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(s).userForm.billing.city,"onUpdate:modelValue":t[3]||(t[3]=l=>e(s).userForm.billing.city=l),name:"billing.city",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.address"),class:"md:col-span-3"},{default:r(()=>[o(c,{modelValue:e(s).userForm.billing.address_street_1,"onUpdate:modelValue":t[4]||(t[4]=l=>e(s).userForm.billing.address_street_1=l),modelModifiers:{trim:!0},placeholder:a.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3"},null,8,["modelValue","placeholder"]),o(c,{modelValue:e(s).userForm.billing.address_street_2,"onUpdate:modelValue":t[5]||(t[5]=l=>e(s).userForm.billing.address_street_2=l),modelModifiers:{trim:!0},placeholder:a.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),d("div",R,[o(n,{label:a.$t("customers.phone"),class:"text-left"},{default:r(()=>[o(i,{modelValue:e(s).userForm.billing.phone,"onUpdate:modelValue":t[6]||(t[6]=l=>e(s).userForm.billing.phone=l),modelModifiers:{trim:!0},type:"text",name:"phone"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.zip_code"),class:"mt-2 text-left"},{default:r(()=>[o(i,{modelValue:e(s).userForm.billing.zip,"onUpdate:modelValue":t[7]||(t[7]=l=>e(s).userForm.billing.zip=l),modelModifiers:{trim:!0},type:"text",name:"zip"},null,8,["modelValue"])]),_:1},8,["label"])])])]),o(U,{class:"mb-5 md:mb-8"}),d("div",q,[d("div",H,[o(V,{ref:(l,x)=>{x.sameAddress=l},type:"button",onClick:t[8]||(t[8]=l=>e(s).copyAddress(!0))},{left:r(l=>[o(_,{name:"DocumentDuplicateIcon",class:h(l.class)},null,8,["class"])]),default:r(()=>[F(" "+p(a.$t("customers.copy_billing_address")),1)]),_:1},512)])]),d("div",K,[d("h6",L,p(a.$t("customers.shipping_address")),1),e(s).userForm.shipping?(b(),y("div",O,[o(n,{label:a.$t("customers.name"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(s).userForm.shipping.name,"onUpdate:modelValue":t[9]||(t[9]=l=>e(s).userForm.shipping.name=l),modelModifiers:{trim:!0},type:"text",name:"address_name"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.country"),class:"md:col-span-3"},{default:r(()=>[o(f,{modelValue:e(s).userForm.shipping.country_id,"onUpdate:modelValue":t[10]||(t[10]=l=>e(s).userForm.shipping.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"",options:e(g).countries,placeholder:a.$t("general.select_country"),class:"w-full"},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.state"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(s).userForm.shipping.state,"onUpdate:modelValue":t[11]||(t[11]=l=>e(s).userForm.shipping.state=l),name:"shipping.state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.city"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(s).userForm.shipping.city,"onUpdate:modelValue":t[12]||(t[12]=l=>e(s).userForm.shipping.city=l),name:"shipping.city",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.address"),class:"md:col-span-3"},{default:r(()=>[o(c,{modelValue:e(s).userForm.shipping.address_street_1,"onUpdate:modelValue":t[13]||(t[13]=l=>e(s).userForm.shipping.address_street_1=l),modelModifiers:{trim:!0},type:"text",placeholder:a.$t("general.street_1"),name:"shipping_street1"},null,8,["modelValue","placeholder"]),o(c,{modelValue:e(s).userForm.shipping.address_street_2,"onUpdate:modelValue":t[14]||(t[14]=l=>e(s).userForm.shipping.address_street_2=l),modelModifiers:{trim:!0},type:"text",placeholder:a.$t("general.street_2"),name:"shipping_street2",class:"mt-3"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),d("div",P,[o(n,{label:a.$t("customers.phone"),class:"text-left"},{default:r(()=>[o(i,{modelValue:e(s).userForm.shipping.phone,"onUpdate:modelValue":t[15]||(t[15]=l=>e(s).userForm.shipping.phone=l),modelModifiers:{trim:!0},type:"text",name:"phone"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.zip_code"),class:"mt-2 text-left"},{default:r(()=>[o(i,{modelValue:e(s).userForm.shipping.zip,"onUpdate:modelValue":t[16]||(t[16]=l=>e(s).userForm.shipping.zip=l),modelModifiers:{trim:!0},type:"text",name:"zip"},null,8,["modelValue"])]),_:1},8,["label"])])])):v("",!0)]),d("div",Q,[o(V,{loading:e(u),disabled:e(u)},{left:r(l=>[e(u)?v("",!0):(b(),S(_,{key:0,name:"SaveIcon",class:h(l.class)},null,8,["class"]))]),default:r(()=>[F(" "+p(a.$t("general.save")),1)]),_:1},8,["loading","disabled"])])]),_:1})],40,D)}}};export{se as default}; diff --git a/public/build/assets/AstronautIcon-Cu4zzuLg.js b/public/build/assets/AstronautIcon-Cu4zzuLg.js new file mode 100644 index 00000000..5485bdcb --- /dev/null +++ b/public/build/assets/AstronautIcon-Cu4zzuLg.js @@ -0,0 +1 @@ +import{o,c as i,b as l,H as d}from"./main-vzIkKseS.js";const n={width:"125",height:"110",viewBox:"0 0 125 110",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r={"clip-path":"url(#clip0)"},C=l("defs",null,[l("clipPath",{id:"clip0"},[l("rect",{width:"124.808",height:"110",fill:"white"})])],-1),s={props:{primaryFillColor:{type:String,default:"fill-primary-500"},secondaryFillColor:{type:String,default:"fill-gray-600"}},setup(e){return(a,c)=>(o(),i("svg",n,[l("g",r,[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M46.8031 84.4643C46.8031 88.8034 43.3104 92.3215 39.0026 92.3215C34.6948 92.3215 31.2021 88.8034 31.2021 84.4643C31.2021 80.1252 34.6948 76.6072 39.0026 76.6072C43.3104 76.6072 46.8031 80.1252 46.8031 84.4643Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M60.4536 110H64.3539V72.6785H60.4536V110Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M85.8055 76.6072H70.2045C69.1319 76.6072 68.2544 77.4911 68.2544 78.5715V82.5C68.2544 83.5804 69.1319 84.4643 70.2045 84.4643H85.8055C86.878 84.4643 87.7556 83.5804 87.7556 82.5V78.5715C87.7556 77.4911 86.878 76.6072 85.8055 76.6072ZM70.2045 82.5H85.8055V78.5715H70.2045V82.5Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M91.6556 1.96429C94.8811 1.96429 97.506 4.60821 97.506 7.85714V19.6429H83.8181L85.308 21.6071H99.4561V7.85714C99.4561 3.53571 95.9459 0 91.6556 0H33.152C28.8618 0 25.3516 3.53571 25.3516 7.85714V21.6071H39.3203L40.8745 19.6429H27.3017V7.85714C27.3017 4.60821 29.9265 1.96429 33.152 1.96429H91.6556Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M122.858 92.3213H117.007C115.935 92.3213 115.057 93.2052 115.057 94.2856V102.143C115.057 103.223 115.935 104.107 117.007 104.107H122.858C123.93 104.107 124.808 103.223 124.808 102.143V94.2856C124.808 93.2052 123.93 92.3213 122.858 92.3213ZM117.007 102.143H122.858V94.2856H117.007V102.143Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M103.356 43.2142V70.7142H21.4511V43.2142H26.1821V41.2498H19.501V72.6783H105.306V41.2498H98.3541L98.2839 43.2142H103.356Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M101.406 21.6071C104.632 21.6071 107.257 24.251 107.257 27.5V41.25H98.2257L98.0853 43.2142H109.207V27.5C109.207 23.1609 105.714 19.6428 101.406 19.6428H83.8182L85.0878 21.6071H101.406ZM40.8746 19.6428H23.4016C19.0937 19.6428 15.6011 23.1609 15.6011 27.5V43.2142H26.1961L26.3365 41.25H17.5512V27.5C17.5512 24.251 20.1761 21.6071 23.4016 21.6071H39.3204L40.8746 19.6428Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M62.4041 9.82153C45.1709 9.82153 31.2021 23.8917 31.2021 41.2501C31.2021 58.6085 45.1709 72.6787 62.4041 72.6787C79.6373 72.6787 93.606 58.6085 93.606 41.2501C93.606 23.8917 79.6373 9.82153 62.4041 9.82153ZM62.4041 11.7858C78.5335 11.7858 91.6559 25.0035 91.6559 41.2501C91.6559 57.4967 78.5335 70.7144 62.4041 70.7144C46.2746 70.7144 33.1523 57.4967 33.1523 41.2501C33.1523 25.0035 46.2746 11.7858 62.4041 11.7858Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M62.4041 19.6428C45.1709 19.6428 31.2021 23.8916 31.2021 41.25C31.2021 58.6084 45.1709 66.7857 62.4041 66.7857C79.6373 66.7857 93.606 58.6084 93.606 41.25C93.606 23.8916 79.6373 19.6428 62.4041 19.6428ZM62.4041 21.6071C82.6346 21.6071 91.6559 27.665 91.6559 41.25C91.6559 56.0096 80.7216 64.8214 62.4041 64.8214C44.0866 64.8214 33.1523 56.0096 33.1523 41.25C33.1523 27.665 42.1735 21.6071 62.4041 21.6071Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M101.406 70.7144H23.4014C10.478 70.7144 0 81.2685 0 94.2858V110H124.808V94.2858C124.808 81.2685 114.33 70.7144 101.406 70.7144ZM101.406 72.6786C113.234 72.6786 122.858 82.3724 122.858 94.2858V108.036H1.95012V94.2858C1.95012 82.3724 11.574 72.6786 23.4014 72.6786H101.406Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M33.152 33.3928H29.2518C27.0969 33.3928 25.3516 35.1509 25.3516 37.3214V45.1785C25.3516 47.3491 27.0969 49.1071 29.2518 49.1071H33.152V33.3928ZM31.2019 35.3571V47.1428H29.2518C28.1773 47.1428 27.3017 46.2609 27.3017 45.1785V37.3214C27.3017 36.2391 28.1773 35.3571 29.2518 35.3571H31.2019Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M95.556 33.3928H91.6558V49.1071H95.556C97.7109 49.1071 99.4562 47.3491 99.4562 45.1785V37.3214C99.4562 35.1509 97.7109 33.3928 95.556 33.3928ZM95.556 35.3571C96.6305 35.3571 97.5061 36.2391 97.5061 37.3214V45.1785C97.5061 46.2609 96.6305 47.1428 95.556 47.1428H93.6059V35.3571H95.556Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M94.581 15.7144C94.0447 15.7144 93.606 16.1563 93.606 16.6965V34.3751C93.606 34.9152 94.0447 35.3572 94.581 35.3572C95.1173 35.3572 95.5561 34.9152 95.5561 34.3751V16.6965C95.5561 16.1563 95.1173 15.7144 94.581 15.7144Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M38.0273 41.2499C37.4891 41.2499 37.0522 40.8099 37.0522 40.2678C37.0522 33.3142 44.1409 25.5356 53.6283 25.5356C54.1665 25.5356 54.6033 25.9756 54.6033 26.5178C54.6033 27.0599 54.1665 27.4999 53.6283 27.4999C45.2564 27.4999 39.0024 34.2414 39.0024 40.2678C39.0024 40.8099 38.5655 41.2499 38.0273 41.2499Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M97.5059 110H99.456V72.6785H97.5059V110Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.3516 110H27.3017V72.6785H25.3516V110Z",class:d(e.secondaryFillColor)},null,2)]),C]))}};export{s as _}; diff --git a/public/build/assets/AstronautIcon.5afbaf6c.js b/public/build/assets/AstronautIcon.5afbaf6c.js deleted file mode 100644 index aa571fc6..00000000 --- a/public/build/assets/AstronautIcon.5afbaf6c.js +++ /dev/null @@ -1 +0,0 @@ -import{o,e as i,h as l,m as d}from"./vendor.fd3b1727.js";const n={width:"125",height:"110",viewBox:"0 0 125 110",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r={"clip-path":"url(#clip0)"},C=l("defs",null,[l("clipPath",{id:"clip0"},[l("rect",{width:"124.808",height:"110",fill:"white"})])],-1),s={props:{primaryFillColor:{type:String,default:"fill-primary-500"},secondaryFillColor:{type:String,default:"fill-gray-600"}},setup(e){return(a,c)=>(o(),i("svg",n,[l("g",r,[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M46.8031 84.4643C46.8031 88.8034 43.3104 92.3215 39.0026 92.3215C34.6948 92.3215 31.2021 88.8034 31.2021 84.4643C31.2021 80.1252 34.6948 76.6072 39.0026 76.6072C43.3104 76.6072 46.8031 80.1252 46.8031 84.4643Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M60.4536 110H64.3539V72.6785H60.4536V110Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M85.8055 76.6072H70.2045C69.1319 76.6072 68.2544 77.4911 68.2544 78.5715V82.5C68.2544 83.5804 69.1319 84.4643 70.2045 84.4643H85.8055C86.878 84.4643 87.7556 83.5804 87.7556 82.5V78.5715C87.7556 77.4911 86.878 76.6072 85.8055 76.6072ZM70.2045 82.5H85.8055V78.5715H70.2045V82.5Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M91.6556 1.96429C94.8811 1.96429 97.506 4.60821 97.506 7.85714V19.6429H83.8181L85.308 21.6071H99.4561V7.85714C99.4561 3.53571 95.9459 0 91.6556 0H33.152C28.8618 0 25.3516 3.53571 25.3516 7.85714V21.6071H39.3203L40.8745 19.6429H27.3017V7.85714C27.3017 4.60821 29.9265 1.96429 33.152 1.96429H91.6556Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M122.858 92.3213H117.007C115.935 92.3213 115.057 93.2052 115.057 94.2856V102.143C115.057 103.223 115.935 104.107 117.007 104.107H122.858C123.93 104.107 124.808 103.223 124.808 102.143V94.2856C124.808 93.2052 123.93 92.3213 122.858 92.3213ZM117.007 102.143H122.858V94.2856H117.007V102.143Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M103.356 43.2142V70.7142H21.4511V43.2142H26.1821V41.2498H19.501V72.6783H105.306V41.2498H98.3541L98.2839 43.2142H103.356Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M101.406 21.6071C104.632 21.6071 107.257 24.251 107.257 27.5V41.25H98.2257L98.0853 43.2142H109.207V27.5C109.207 23.1609 105.714 19.6428 101.406 19.6428H83.8182L85.0878 21.6071H101.406ZM40.8746 19.6428H23.4016C19.0937 19.6428 15.6011 23.1609 15.6011 27.5V43.2142H26.1961L26.3365 41.25H17.5512V27.5C17.5512 24.251 20.1761 21.6071 23.4016 21.6071H39.3204L40.8746 19.6428Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M62.4041 9.82153C45.1709 9.82153 31.2021 23.8917 31.2021 41.2501C31.2021 58.6085 45.1709 72.6787 62.4041 72.6787C79.6373 72.6787 93.606 58.6085 93.606 41.2501C93.606 23.8917 79.6373 9.82153 62.4041 9.82153ZM62.4041 11.7858C78.5335 11.7858 91.6559 25.0035 91.6559 41.2501C91.6559 57.4967 78.5335 70.7144 62.4041 70.7144C46.2746 70.7144 33.1523 57.4967 33.1523 41.2501C33.1523 25.0035 46.2746 11.7858 62.4041 11.7858Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M62.4041 19.6428C45.1709 19.6428 31.2021 23.8916 31.2021 41.25C31.2021 58.6084 45.1709 66.7857 62.4041 66.7857C79.6373 66.7857 93.606 58.6084 93.606 41.25C93.606 23.8916 79.6373 19.6428 62.4041 19.6428ZM62.4041 21.6071C82.6346 21.6071 91.6559 27.665 91.6559 41.25C91.6559 56.0096 80.7216 64.8214 62.4041 64.8214C44.0866 64.8214 33.1523 56.0096 33.1523 41.25C33.1523 27.665 42.1735 21.6071 62.4041 21.6071Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M101.406 70.7144H23.4014C10.478 70.7144 0 81.2685 0 94.2858V110H124.808V94.2858C124.808 81.2685 114.33 70.7144 101.406 70.7144ZM101.406 72.6786C113.234 72.6786 122.858 82.3724 122.858 94.2858V108.036H1.95012V94.2858C1.95012 82.3724 11.574 72.6786 23.4014 72.6786H101.406Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M33.152 33.3928H29.2518C27.0969 33.3928 25.3516 35.1509 25.3516 37.3214V45.1785C25.3516 47.3491 27.0969 49.1071 29.2518 49.1071H33.152V33.3928ZM31.2019 35.3571V47.1428H29.2518C28.1773 47.1428 27.3017 46.2609 27.3017 45.1785V37.3214C27.3017 36.2391 28.1773 35.3571 29.2518 35.3571H31.2019Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M95.556 33.3928H91.6558V49.1071H95.556C97.7109 49.1071 99.4562 47.3491 99.4562 45.1785V37.3214C99.4562 35.1509 97.7109 33.3928 95.556 33.3928ZM95.556 35.3571C96.6305 35.3571 97.5061 36.2391 97.5061 37.3214V45.1785C97.5061 46.2609 96.6305 47.1428 95.556 47.1428H93.6059V35.3571H95.556Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M94.581 15.7144C94.0447 15.7144 93.606 16.1563 93.606 16.6965V34.3751C93.606 34.9152 94.0447 35.3572 94.581 35.3572C95.1173 35.3572 95.5561 34.9152 95.5561 34.3751V16.6965C95.5561 16.1563 95.1173 15.7144 94.581 15.7144Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M38.0273 41.2499C37.4891 41.2499 37.0522 40.8099 37.0522 40.2678C37.0522 33.3142 44.1409 25.5356 53.6283 25.5356C54.1665 25.5356 54.6033 25.9756 54.6033 26.5178C54.6033 27.0599 54.1665 27.4999 53.6283 27.4999C45.2564 27.4999 39.0024 34.2414 39.0024 40.2678C39.0024 40.8099 38.5655 41.2499 38.0273 41.2499Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M97.5059 110H99.456V72.6785H97.5059V110Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.3516 110H27.3017V72.6785H25.3516V110Z",class:d(e.secondaryFillColor)},null,2)]),C]))}};export{s as _}; diff --git a/public/build/assets/BackupSetting-mmKrsMfR.js b/public/build/assets/BackupSetting-mmKrsMfR.js new file mode 100644 index 00000000..86402feb --- /dev/null +++ b/public/build/assets/BackupSetting-mmKrsMfR.js @@ -0,0 +1 @@ +import{a2 as W,v as G,$ as x,u as P,g as y,F as E,D as O,e as R,l as w,h as j,i as F,k as Y,r as i,o as L,n as U,w as l,b as D,q as $,t as S,m as s,a as o,H as A,I as Z,s as ee,a5 as te,c as ae,L as se}from"./main-vzIkKseS.js";import{u as H}from"./disk-GjCD9u7d.js";const X=(I=!1)=>{const m=I?window.pinia.defineStore:W,{global:_}=window.i18n;return m({id:"backup",state:()=>({backups:[],currentBackupData:{option:"full",selected_disk:null}}),actions:{fetchBackups(f){return new Promise((n,a)=>{G.get("/api/v1/backups",{params:f}).then(e=>{this.backups=e.data.data,n(e)}).catch(e=>{x(e),a(e)})})},createBackup(f){return new Promise((n,a)=>{G.post("/api/v1/backups",f).then(e=>{P().showNotification({type:"success",message:_.t("settings.backup.created_message")}),n(e)}).catch(e=>{x(e),a(e)})})},removeBackup(f){return new Promise((n,a)=>{G.delete(`/api/v1/backups/${f.disk}`,{params:f}).then(e=>{P().showNotification({type:"success",message:_.t("settings.backup.deleted_message")}),n(e)}).catch(e=>{x(e),a(e)})})}}})()},oe={class:"flex justify-between w-full"},ne=["onSubmit"],le={class:"p-6"},ce={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid"},ie={setup(I){y(null),y(!1);let m=y(!1),_=y(!1);const f=E(["full","only-db","only-files"]),n=X(),a=O(),e=H(),{t:p}=R(),k=w(()=>a.active&&a.componentName==="BackupModal"),M=w(()=>e.disks.map(c=>({...c,name:c.name+" — ["+c.driver+"]"}))),V=w(()=>({currentBackupData:{option:{required:j.withMessage(p("validation.required"),F)},selected_disk:{required:j.withMessage(p("validation.required"),F)}}})),b=Y(V,w(()=>n));async function N(){if(b.value.currentBackupData.$touch(),b.value.currentBackupData.$invalid)return!0;let c={option:n.currentBackupData.option,file_disk_id:n.currentBackupData.selected_disk.id};try{m.value=!0,(await n.createBackup(c)).data&&(m.value=!1,a.refreshData&&a.refreshData(),a.closeModal())}catch{m.value=!1}}async function z(){_.value=!0;let c=await e.fetchDisks({limit:"all"});n.currentBackupData.selected_disk=c.data.data[0],_.value=!1}function C(){a.closeModal(),setTimeout(()=>{b.value.$reset(),n.$reset()})}return(c,B)=>{const t=i("BaseIcon"),r=i("BaseMultiselect"),d=i("BaseInputGroup"),u=i("BaseInputGrid"),v=i("BaseButton"),T=i("BaseModal");return L(),U(T,{show:s(k),onClose:C,onOpen:z},{header:l(()=>[D("div",oe,[$(S(s(a).title)+" ",1),o(t,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:C})])]),default:l(()=>[D("form",{onSubmit:ee(N,["prevent"])},[D("div",le,[o(u,{layout:"one-column"},{default:l(()=>[o(d,{label:c.$t("settings.backup.select_backup_type"),error:s(b).currentBackupData.option.$error&&s(b).currentBackupData.option.$errors[0].$message,horizontal:"",required:"",class:"py-2"},{default:l(()=>[o(r,{modelValue:s(n).currentBackupData.option,"onUpdate:modelValue":B[0]||(B[0]=h=>s(n).currentBackupData.option=h),options:s(f),"can-deselect":!1,placeholder:c.$t("settings.backup.select_backup_type"),searchable:""},null,8,["modelValue","options","placeholder"])]),_:1},8,["label","error"]),o(d,{label:c.$t("settings.disk.select_disk"),error:s(b).currentBackupData.selected_disk.$error&&s(b).currentBackupData.selected_disk.$errors[0].$message,horizontal:"",required:"",class:"py-2"},{default:l(()=>[o(r,{modelValue:s(n).currentBackupData.selected_disk,"onUpdate:modelValue":B[1]||(B[1]=h=>s(n).currentBackupData.selected_disk=h),"content-loading":s(_),options:s(M),searchable:!0,"allow-empty":!1,label:"name","value-prop":"id",placeholder:c.$t("settings.disk.select_disk"),"track-by":"name",object:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","error"])]),_:1})]),D("div",ce,[o(v,{class:"mr-3",variant:"primary-outline",type:"button",onClick:C},{default:l(()=>[$(S(c.$t("general.cancel")),1)]),_:1}),o(v,{loading:s(m),disabled:s(m),variant:"primary",type:"submit"},{left:l(h=>[s(m)?Z("",!0):(L(),U(t,{key:0,name:"SaveIcon",class:A(h.class)},null,8,["class"]))]),default:l(()=>[$(" "+S(c.$t("general.create")),1)]),_:1},8,["loading","disabled"])])],40,ne)]),_:1},8,["show"])}}},re={class:"grid my-14 md:grid-cols-3"},ue={class:"inline-block"},ke={setup(I){const m=te(),_=X(),f=O(),n=H(),{t:a}=R(),e=E({selected_disk:{driver:"local"}}),p=y("");let k=y(!0);const M=w(()=>[{key:"path",label:a("settings.backup.path"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"created_at",label:a("settings.backup.created_at"),tdClass:"font-medium text-gray-900"},{key:"size",label:a("settings.backup.size"),tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]),V=w(()=>n.disks.map(t=>({...t,name:t.name+" — ["+t.driver+"]"})));z();function b(t){m.openDialog({title:a("general.are_you_sure"),message:a("settings.backup.backup_confirm_delete"),yesLabel:a("general.ok"),noLabel:a("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async r=>{if(r){let d={disk:e.selected_disk.driver,file_disk_id:e.selected_disk.id,path:t.path},u=await _.removeBackup(d);if(u.data.success||u.data.backup)return p.value&&p.value.refresh(),!0}})}function N(){setTimeout(()=>{p.value.refresh()},100)}async function z(){k.value=!0;let t=await n.fetchDisks({limit:"all"});t.data.error,e.selected_disk=t.data.data.find(r=>r.set_as_default==0),k.value=!1}async function C({page:t,filter:r,sort:d}){let u={disk:e.selected_disk.driver,filed_disk_id:e.selected_disk.id};k.value=!0;let v=await _.fetchBackups(u);return k.value=!1,{data:v.data.backups,pagination:{totalPages:1,currentPage:1}}}async function c(){f.openModal({title:a("settings.backup.create_backup"),componentName:"BackupModal",refreshData:p.value&&p.value.refresh,size:"sm"})}async function B(t){k.value=!0,window.axios({method:"GET",url:"/api/v1/download-backup",responseType:"blob",params:{disk:e.selected_disk.driver,file_disk_id:e.selected_disk.id,path:t.path}}).then(r=>{const d=window.URL.createObjectURL(new Blob([r.data])),u=document.createElement("a");u.href=d,u.setAttribute("download",t.path.split("/")[1]),document.body.appendChild(u),u.click(),k.value=!1}).catch(r=>{k.value=!1})}return(t,r)=>{const d=i("BaseIcon"),u=i("BaseButton"),v=i("BaseMultiselect"),T=i("BaseInputGroup"),h=i("BaseDropdownItem"),J=i("BaseDropdown"),K=i("BaseTable"),Q=i("BaseSettingCard");return L(),ae(se,null,[o(ie),o(Q,{title:t.$tc("settings.backup.title",1),description:t.$t("settings.backup.description")},{action:l(()=>[o(u,{variant:"primary-outline",onClick:c},{left:l(g=>[o(d,{class:A(g.class),name:"PlusIcon"},null,8,["class"])]),default:l(()=>[$(" "+S(t.$t("settings.backup.new_backup")),1)]),_:1})]),default:l(()=>[D("div",re,[o(T,{label:t.$t("settings.disk.select_disk"),"content-loading":s(k)},{default:l(()=>[o(v,{modelValue:s(e).selected_disk,"onUpdate:modelValue":r[0]||(r[0]=g=>s(e).selected_disk=g),"content-loading":s(k),options:s(V),"track-by":"name",placeholder:t.$t("settings.disk.select_disk"),label:"name",searchable:!0,object:"",class:"w-full","value-prop":"id",onSelect:N},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"])]),o(K,{ref:(g,q)=>{q.table=g,p.value=g},class:"mt-10","show-filter":!1,data:C,columns:s(M)},{"cell-actions":l(({row:g})=>[o(J,null,{activator:l(()=>[D("div",ue,[o(d,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:l(()=>[o(h,{onClick:q=>B(g.data)},{default:l(()=>[o(d,{name:"CloudDownloadIcon",class:"mr-3 text-gray-600"}),$(" "+S(t.$t("general.download")),1)]),_:2},1032,["onClick"]),o(h,{onClick:q=>b(g.data)},{default:l(()=>[o(d,{name:"TrashIcon",class:"mr-3 text-gray-600"}),$(" "+S(t.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{ke as default}; diff --git a/public/build/assets/BackupSetting.e9cd0073.js b/public/build/assets/BackupSetting.e9cd0073.js deleted file mode 100644 index 056b1874..00000000 --- a/public/build/assets/BackupSetting.e9cd0073.js +++ /dev/null @@ -1 +0,0 @@ -var te=Object.defineProperty,ae=Object.defineProperties;var se=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var F=(d,t,l)=>t in d?te(d,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):d[t]=l,q=(d,t)=>{for(var l in t||(t={}))oe.call(t,l)&&F(d,l,t[l]);if(U)for(var l of U(t))ne.call(t,l)&&F(d,l,t[l]);return d},G=(d,t)=>ae(d,se(t));import{a as x,d as le,B as w,a0 as E,J as O,k as D,L as R,M as A,T as ce,r as u,o as L,l as H,w as i,h as $,i as S,t as C,u as o,f as n,m as J,j as ie,U as re,e as ue,F as de}from"./vendor.fd3b1727.js";import{h as P,u as X,c as K,j as pe}from"./main.fc26c84f.js";import{u as Q}from"./disk.84b94298.js";const W=(d=!1)=>{const t=d?window.pinia.defineStore:le,{global:l}=window.i18n;return t({id:"backup",state:()=>({backups:[],currentBackupData:{option:"full",selected_disk:null}}),actions:{fetchBackups(b){return new Promise((c,s)=>{x.get("/api/v1/backups",{params:b}).then(e=>{this.backups=e.data.data,c(e)}).catch(e=>{P(e),s(e)})})},createBackup(b){return new Promise((c,s)=>{x.post("/api/v1/backups",b).then(e=>{X().showNotification({type:"success",message:l.t("settings.backup.created_message")}),c(e)}).catch(e=>{P(e),s(e)})})},removeBackup(b){return new Promise((c,s)=>{x.delete(`/api/v1/backups/${b.disk}`,{params:b}).then(e=>{X().showNotification({type:"success",message:l.t("settings.backup.deleted_message")}),c(e)}).catch(e=>{P(e),s(e)})})}}})()},ke={class:"flex justify-between w-full"},me=["onSubmit"],fe={class:"p-6"},_e={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid"},be={setup(d){w(null),w(!1);let t=w(!1),l=w(!1);const b=E(["full","only-db","only-files"]),c=W(),s=K(),e=Q(),{t:f}=O(),_=D(()=>s.active&&s.componentName==="BackupModal"),M=D(()=>e.disks.map(r=>G(q({},r),{name:r.name+" \u2014 ["+r.driver+"]"}))),V=D(()=>({currentBackupData:{option:{required:R.withMessage(f("validation.required"),A)},selected_disk:{required:R.withMessage(f("validation.required"),A)}}})),g=ce(V,D(()=>c));async function N(){if(g.value.currentBackupData.$touch(),g.value.currentBackupData.$invalid)return!0;let r={option:c.currentBackupData.option,file_disk_id:c.currentBackupData.selected_disk.id};try{t.value=!0,(await c.createBackup(r)).data&&(t.value=!1,s.refreshData&&s.refreshData(),s.closeModal())}catch{t.value=!1}}async function j(){l.value=!0;let r=await e.fetchDisks({limit:"all"});c.currentBackupData.selected_disk=r.data.data[0],l.value=!1}function I(){s.closeModal(),setTimeout(()=>{g.value.$reset(),c.$reset()})}return(r,h)=>{const a=u("BaseIcon"),p=u("BaseMultiselect"),m=u("BaseInputGroup"),k=u("BaseInputGrid"),y=u("BaseButton"),T=u("BaseModal");return L(),H(T,{show:o(_),onClose:I,onOpen:j},{header:i(()=>[$("div",ke,[S(C(o(s).title)+" ",1),n(a,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:I})])]),default:i(()=>[$("form",{onSubmit:re(N,["prevent"])},[$("div",fe,[n(k,{layout:"one-column"},{default:i(()=>[n(m,{label:r.$t("settings.backup.select_backup_type"),error:o(g).currentBackupData.option.$error&&o(g).currentBackupData.option.$errors[0].$message,horizontal:"",required:"",class:"py-2"},{default:i(()=>[n(p,{modelValue:o(c).currentBackupData.option,"onUpdate:modelValue":h[0]||(h[0]=v=>o(c).currentBackupData.option=v),options:o(b),"can-deselect":!1,placeholder:r.$t("settings.backup.select_backup_type"),searchable:""},null,8,["modelValue","options","placeholder"])]),_:1},8,["label","error"]),n(m,{label:r.$t("settings.disk.select_disk"),error:o(g).currentBackupData.selected_disk.$error&&o(g).currentBackupData.selected_disk.$errors[0].$message,horizontal:"",required:"",class:"py-2"},{default:i(()=>[n(p,{modelValue:o(c).currentBackupData.selected_disk,"onUpdate:modelValue":h[1]||(h[1]=v=>o(c).currentBackupData.selected_disk=v),"content-loading":o(l),options:o(M),searchable:!0,"allow-empty":!1,label:"name","value-prop":"id",placeholder:r.$t("settings.disk.select_disk"),"track-by":"name",object:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","error"])]),_:1})]),$("div",_e,[n(y,{class:"mr-3",variant:"primary-outline",type:"button",onClick:I},{default:i(()=>[S(C(r.$t("general.cancel")),1)]),_:1}),n(y,{loading:o(t),disabled:o(t),variant:"primary",type:"submit"},{left:i(v=>[o(t)?ie("",!0):(L(),H(a,{key:0,name:"SaveIcon",class:J(v.class)},null,8,["class"]))]),default:i(()=>[S(" "+C(r.$t("general.create")),1)]),_:1},8,["loading","disabled"])])],40,me)]),_:1},8,["show"])}}},ge={class:"grid my-14 md:grid-cols-3"},Be={class:"inline-block"},De={setup(d){const t=pe(),l=W(),b=K(),c=Q(),{t:s}=O(),e=E({selected_disk:{driver:"local"}}),f=w("");let _=w(!0);const M=D(()=>[{key:"path",label:s("settings.backup.path"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"created_at",label:s("settings.backup.created_at"),tdClass:"font-medium text-gray-900"},{key:"size",label:s("settings.backup.size"),tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]),V=D(()=>c.disks.map(a=>G(q({},a),{name:a.name+" \u2014 ["+a.driver+"]"})));j();function g(a){t.openDialog({title:s("general.are_you_sure"),message:s("settings.backup.backup_confirm_delete"),yesLabel:s("general.ok"),noLabel:s("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async p=>{if(p){let m={disk:e.selected_disk.driver,file_disk_id:e.selected_disk.id,path:a.path},k=await l.removeBackup(m);if(k.data.success||k.data.backup)return f.value&&f.value.refresh(),!0}})}function N(){setTimeout(()=>{f.value.refresh()},100)}async function j(){_.value=!0;let a=await c.fetchDisks({limit:"all"});a.data.error,e.selected_disk=a.data.data.find(p=>p.set_as_default==0),_.value=!1}async function I({page:a,filter:p,sort:m}){let k={disk:e.selected_disk.driver,filed_disk_id:e.selected_disk.id};_.value=!0;let y=await l.fetchBackups(k);return _.value=!1,{data:y.data.backups,pagination:{totalPages:1,currentPage:1}}}async function r(){b.openModal({title:s("settings.backup.create_backup"),componentName:"BackupModal",refreshData:f.value&&f.value.refresh,size:"sm"})}async function h(a){_.value=!0,window.axios({method:"GET",url:"/api/v1/download-backup",responseType:"blob",params:{disk:e.selected_disk.driver,file_disk_id:e.selected_disk.id,path:a.path}}).then(p=>{const m=window.URL.createObjectURL(new Blob([p.data])),k=document.createElement("a");k.href=m,k.setAttribute("download",a.path.split("/")[1]),document.body.appendChild(k),k.click(),_.value=!1}).catch(p=>{_.value=!1})}return(a,p)=>{const m=u("BaseIcon"),k=u("BaseButton"),y=u("BaseMultiselect"),T=u("BaseInputGroup"),v=u("BaseDropdownItem"),Y=u("BaseDropdown"),Z=u("BaseTable"),ee=u("BaseSettingCard");return L(),ue(de,null,[n(be),n(ee,{title:a.$tc("settings.backup.title",1),description:a.$t("settings.backup.description")},{action:i(()=>[n(k,{variant:"primary-outline",onClick:r},{left:i(B=>[n(m,{class:J(B.class),name:"PlusIcon"},null,8,["class"])]),default:i(()=>[S(" "+C(a.$t("settings.backup.new_backup")),1)]),_:1})]),default:i(()=>[$("div",ge,[n(T,{label:a.$t("settings.disk.select_disk"),"content-loading":o(_)},{default:i(()=>[n(y,{modelValue:o(e).selected_disk,"onUpdate:modelValue":p[0]||(p[0]=B=>o(e).selected_disk=B),"content-loading":o(_),options:o(V),"track-by":"name",placeholder:a.$t("settings.disk.select_disk"),label:"name",searchable:!0,object:"",class:"w-full","value-prop":"id",onSelect:N},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"])]),n(Z,{ref:(B,z)=>{z.table=B,f.value=B},class:"mt-10","show-filter":!1,data:I,columns:o(M)},{"cell-actions":i(({row:B})=>[n(Y,null,{activator:i(()=>[$("div",Be,[n(m,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:i(()=>[n(v,{onClick:z=>h(B.data)},{default:i(()=>[n(m,{name:"CloudDownloadIcon",class:"mr-3 text-gray-600"}),S(" "+C(a.$t("general.download")),1)]),_:2},1032,["onClick"]),n(v,{onClick:z=>g(B.data)},{default:i(()=>[n(m,{name:"TrashIcon",class:"mr-3 text-gray-600"}),S(" "+C(a.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{De as default}; diff --git a/public/build/assets/BaseEditor.bacb9608.css b/public/build/assets/BaseEditor-8o6Sf_Iq.css similarity index 100% rename from public/build/assets/BaseEditor.bacb9608.css rename to public/build/assets/BaseEditor-8o6Sf_Iq.css diff --git a/public/build/assets/BaseEditor-nkRYKoo1.js b/public/build/assets/BaseEditor-nkRYKoo1.js new file mode 100644 index 00000000..1b2127b6 --- /dev/null +++ b/public/build/assets/BaseEditor-nkRYKoo1.js @@ -0,0 +1,73 @@ +import{bo as Pa,bp as za,aZ as lr,g as zr,W as Kn,aB as Br,bq as ve,br as Ba,al as La,bn as Fa,m as Va,bs as Ha,F as ja,bt as qa,bu as Ja,X as wt,o as gt,c as St,b as T,Y as Wa,bv as Ka,bw as $a,bx as Ua,bf as Ga,z as Ya,a8 as Xa,r as X,n as Qa,w as en,a as F,H as B,I as Za}from"./main-vzIkKseS.js";function ut(e){this.content=e}ut.prototype={constructor:ut,find:function(e){for(var t=0;t>1}};ut.from=function(e){if(e instanceof ut)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new ut(t)};var Fo=ut;function Ii(e,t,r){for(var n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;var o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){var a=Ii(o.content,i.content,r+1);if(a!=null)return a}r+=o.nodeSize}}function Ri(e,t,r,n){for(var o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};var s=e.child(--o),a=t.child(--i),c=s.nodeSize;if(s==a){r-=c,n-=c;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){for(var l=0,u=Math.min(s.text.length,a.text.length);lt&&n(c,o+a,i,s)!==!1&&c.content.size){var u=a+1;c.nodesBetween(Math.max(0,t-u),Math.min(c.content.size,r-u),n,o+u)}a=l}};k.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)};k.prototype.textBetween=function(t,r,n,o){var i="",s=!0;return this.nodesBetween(t,r,function(a,c){a.isText?(i+=a.text.slice(Math.max(t,c)-c,r-c),s=!n):a.isLeaf&&o?(i+=o,s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i};k.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(var i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=c}return new k(n,o)};k.prototype.cutByIndex=function(t,r){return t==r?k.empty:t==0&&r==this.content.length?this:new k(this.content.slice(t,r))};k.prototype.replaceChild=function(t,r){var n=this.content[t];if(n==r)return this;var o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new k(o,i)};k.prototype.addToStart=function(t){return new k([t].concat(this.content),this.size+t.nodeSize)};k.prototype.addToEnd=function(t){return new k(this.content.concat(t),this.size+t.nodeSize)};k.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var r=0;rthis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,o=0;;n++){var i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?yr(n+1,s):yr(n,o);o=s}};k.prototype.toString=function(){return"<"+this.toStringInner()+">"};k.prototype.toStringInner=function(){return this.content.join(", ")};k.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null};k.fromJSON=function(t,r){if(!r)return k.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(r.map(t.nodeFromJSON))};k.fromArray=function(t){if(!t.length)return k.empty;for(var r,n=0,o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r};R.prototype.removeFromSet=function(t){for(var r=0;r0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t};x.fromJSON=function(t,r){if(!r)return x.empty;var n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new x(k.fromJSON(t,r.content),n,o)};x.maxOpen=function(t,r){r===void 0&&(r=!0);for(var n=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(var s=t.lastChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.lastChild)o++;return new x(t,n,o)};Object.defineProperties(x.prototype,Pi);function zi(e,t,r){var n=e.findIndex(t),o=n.index,i=n.offset,s=e.maybeChild(o),a=e.findIndex(r),c=a.index,l=a.offset;if(i==t||s.isText){if(l!=r&&!e.child(c).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(o!=c)throw new RangeError("Removing non-flat range");return e.replaceChild(o,s.copy(zi(s.content,t-i-1,r-i-1)))}function Bi(e,t,r,n){var o=e.findIndex(t),i=o.index,s=o.offset,a=e.maybeChild(i);if(s==t||a.isText)return n&&!n.canReplace(i,i,r)?null:e.cut(0,t).append(r).append(e.cut(t));var c=Bi(a.content,t-s-1,r);return c&&e.replaceChild(i,a.copy(c))}x.empty=new x(k.empty,0,0);function tc(e,t,r){if(r.openStart>e.depth)throw new Wt("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new Wt("Inconsistent open depths");return Li(e,t,r,0)}function Li(e,t,r,n){var o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function Ke(e,t,r,n){var o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(ge(e.nodeAfter,n),i++));for(var a=i;ao&&wn(e,t,o+1),s=n.depth>o&&wn(r,n,o+1),a=[];return Ke(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(Fi(i,s),ge(ye(i,Vi(e,t,r,n,o+1)),a)):(i&&ge(ye(i,Or(e,t,o+1)),a),Ke(t,r,o,a),s&&ge(ye(s,Or(r,n,o+1)),a)),Ke(n,null,o,a),new k(a)}function Or(e,t,r){var n=[];if(Ke(null,e,r,n),e.depth>r){var o=wn(e,t,r+1);ge(ye(o,Or(e,t,r+1)),n)}return Ke(t,null,r,n),new k(n)}function ec(e,t){for(var r=t.depth-e.openStart,n=t.node(r),o=n.copy(e.content),i=r-1;i>=0;i--)o=t.node(i).copy(k.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}var K=function(t,r,n){this.pos=t,this.path=r,this.depth=r.length/3-1,this.parentOffset=n},Le={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};K.prototype.resolveDepth=function(t){return t==null?this.depth:t<0?this.depth+t:t};Le.parent.get=function(){return this.node(this.depth)};Le.doc.get=function(){return this.node(0)};K.prototype.node=function(t){return this.path[this.resolveDepth(t)*3]};K.prototype.index=function(t){return this.path[this.resolveDepth(t)*3+1]};K.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)};K.prototype.start=function(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1};K.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size};K.prototype.before=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]};K.prototype.after=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize};Le.textOffset.get=function(){return this.pos-this.path[this.path.length-1]};Le.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var r=this.pos-this.path[this.path.length-1],n=e.child(t);return r?e.child(t).cut(r):n};Le.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)};K.prototype.posAtIndex=function(t,r){r=this.resolveDepth(r);for(var n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1,i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0};K.prototype.blockRange=function(t,r){if(t===void 0&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new Ze(this,t,n)};K.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset};K.prototype.max=function(t){return t.pos>this.pos?t:this};K.prototype.min=function(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");for(var n=[],o=0,i=r,s=t;;){var a=s.content.findIndex(i),c=a.index,l=a.offset,u=i-l;if(n.push(s,c,o+l),!u||(s=s.child(c),s.isText))break;i=u-1,o+=l+1}return new K(r,n,i)};K.resolveCached=function(t,r){for(var n=0;nt&&this.nodesBetween(t,r,function(i){return n.isInSet(i.marks)&&(o=!0),!o}),o};Tt.isBlock.get=function(){return this.type.isBlock};Tt.isTextblock.get=function(){return this.type.isTextblock};Tt.inlineContent.get=function(){return this.type.inlineContent};Tt.isInline.get=function(){return this.type.isInline};Tt.isText.get=function(){return this.type.isText};Tt.isLeaf.get=function(){return this.type.isLeaf};Tt.isAtom.get=function(){return this.type.isAtom};P.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Hi(this.marks,t)};P.prototype.contentMatchAt=function(t){var r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r};P.prototype.canReplace=function(t,r,n,o,i){n===void 0&&(n=k.empty),o===void 0&&(o=0),i===void 0&&(i=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(var c=o;c=0;r--)t=e[r].type.name+"("+t+")";return t}var ft=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},Fr={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};ft.parse=function(t,r){var n=new Vr(t,r);if(n.next==null)return ft.empty;var o=qi(n);n.next&&n.err("Unexpected trailing text");var i=fc(uc(o));return pc(i,n),i};ft.prototype.matchType=function(t){for(var r=0;r>1};ft.prototype.edge=function(t){var r=t<<1;if(r>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[r],next:this.next[r+1]}};ft.prototype.toString=function(){var t=[];function r(n){t.push(n);for(var o=1;o"+t.indexOf(n.next[s+1]);return i}).join(` +`)};Object.defineProperties(ft.prototype,Fr);ft.empty=new ft(!0);var Vr=function(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()},ji={next:{configurable:!0}};ji.next.get=function(){return this.tokens[this.pos]};Vr.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)};Vr.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")};Object.defineProperties(Vr.prototype,ji);function qi(e){var t=[];do t.push(ic(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function ic(e){var t=[];do t.push(sc(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function sc(e){for(var t=lc(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=ac(e,t);else break;return t}function Vo(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function ac(e,t){var r=Vo(e),n=r;return e.eat(",")&&(e.next!="}"?n=Vo(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function cc(e,t){var r=e.nodeTypes,n=r[t];if(n)return[n];var o=[];for(var i in r){var s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function lc(e){if(e.eat("(")){var t=qi(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{var r=cc(e,e.next).map(function(n){return e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}});return e.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}}function uc(e){var t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,c){var l={term:c,to:a};return t[s].push(l),l}function o(s,a){s.forEach(function(c){return c.to=a})}function i(s,a){if(s.type=="choice")return s.exprs.reduce(function(S,y){return S.concat(i(y,a))},[]);if(s.type=="seq")for(var c=0;;c++){var l=i(s.exprs[c],a);if(c==s.exprs.length-1)return l;o(l,a=r())}else if(s.type=="star"){var u=r();return n(a,u),o(i(s.expr,u),u),[n(u)]}else if(s.type=="plus"){var f=r();return o(i(s.expr,a),f),o(i(s.expr,f),f),[n(f)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){for(var p=a,d=0;d-1&&o[p+1];Ho(e,f).forEach(function(h){d||o.push(u,d=[]),d.indexOf(h)==-1&&d.push(h)})}})});for(var i=t[n.join(",")]=new ft(n.indexOf(e.length-1)>-1),s=0;s-1};yt.prototype.allowsMarks=function(t){if(this.markSet==null)return!0;for(var r=0;r-1};var Se=function(t){this.spec={};for(var r in t)this.spec[r]=t[r];this.spec.nodes=Fo.from(t.nodes),this.spec.marks=Fo.from(t.marks),this.nodes=yt.compile(this.spec.nodes,this),this.marks=oe.compile(this.spec.marks,this);var n=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=ft.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?jo(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=u==null?[l]:u==""?[]:jo(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};Se.prototype.node=function(t,r,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof yt){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)};Se.prototype.text=function(t,r){var n=this.nodes.text;return new oc(n,n.defaultAttrs,t,R.setFrom(r))};Se.prototype.mark=function(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)};Se.prototype.nodeFromJSON=function(t){return P.fromJSON(this,t)};Se.prototype.markFromJSON=function(t){return R.fromJSON(this,t)};Se.prototype.nodeType=function(t){var r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r};function jo(e,t){for(var r=[],n=0;n-1)&&r.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}var Bt=function(t,r){var n=this;this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(function(o){o.tag?n.tags.push(o):o.style&&n.styles.push(o)}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=t.nodes[o.node];return i.contentMatch.matchType(i)})};Bt.prototype.parse=function(t,r){r===void 0&&(r={});var n=new W(this,r,!1);return n.addAll(t,null,r.from,r.to),n.finish()};Bt.prototype.parseSlice=function(t,r){r===void 0&&(r={});var n=new W(this,r,!0);return n.addAll(t,null,r.from,r.to),x.maxOpen(n.finish())};Bt.prototype.matchTag=function(t,r,n){for(var o=n?this.tags.indexOf(n)+1:0;ot.length&&(s.style.charCodeAt(t.length)!=61||s.style.slice(t.length+1)!=r))){if(s.getAttrs){var a=s.getAttrs(r);if(a===!1)continue;s.attrs=a}return s}}};Bt.schemaRules=function(t){var r=[];function n(c){for(var l=c.priority==null?50:c.priority,u=0;u=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]};Xt.prototype.applyPending=function(t){for(var r=0,n=this.pendingMarks;r=0;o--){var i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(var a=0;athis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}};W.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)};W.prototype.sync=function(t){for(var r=this.open;r>=0;r--)if(this.nodes[r]==t){this.open=r;return}};Gn.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var r=this.nodes[t].content,n=r.length-1;n>=0;n--)e+=r[n].nodeSize;t&&e++}return e};W.prototype.findAtPoint=function(t,r){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=function(c,l){for(;c>=0;c--){var u=n[c];if(u==""){if(c==n.length-1||c==0)continue;for(;l>=s;l--)if(a(c-1,l))return!0;return!1}else{var f=l>0||l==0&&i?r.nodes[l].type:o&&l>=s?o.node(l-s).type:null;if(!f||f.name!=u&&f.groups.indexOf(u)==-1)return!1;l--}}return!0};return a(n.length-1,this.open)};W.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var r=t.depth;r>=0;r--){var n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}};W.prototype.addPendingMark=function(t){var r=yc(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)};W.prototype.removePendingMark=function(t,r){for(var n=this.open;n>=0;n--){var o=this.nodes[n],i=o.pendingMarks.lastIndexOf(t);if(i>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}};Object.defineProperties(W.prototype,Gn);function hc(e){for(var t=e.firstChild,r=null;t;t=t.nextSibling){var n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&Yi.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function mc(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function vc(e){for(var t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];r=t.exec(e);)n.push(r[1],r[2].trim());return n}function qo(e){var t={};for(var r in e)t[r]=e[r];return t}function gc(e,t){var r=t.schema.nodes,n=function(s){var a=r[s];if(a.allowsMarkType(e)){var c=[],l=function(u){c.push(u);for(var f=0;f=0;o--){var i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n};st.prototype.serializeMark=function(t,r,n){n===void 0&&(n={});var o=this.marks[t.type.name];return o&&st.renderSpec(Yn(n),o(t,r))};st.renderSpec=function(t,r,n){if(n===void 0&&(n=null),typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;var o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));var s=null,a=n?t.createElementNS(n,o):t.createElement(o),c=r[1],l=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){l=2;for(var u in c)if(c[u]!=null){var f=u.indexOf(" ");f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):a.setAttribute(u,c[u])}}for(var p=l;pl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{var h=st.renderSpec(t,d,n),v=h.dom,g=h.contentDOM;if(a.appendChild(v),g){if(s)throw new RangeError("Multiple content holes");s=g}}}return{dom:a,contentDOM:s}};st.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new st(this.nodesFromSchema(t),this.marksFromSchema(t)))};st.nodesFromSchema=function(t){var r=Qi(t.nodes);return r.text||(r.text=function(n){return n.text}),r};st.marksFromSchema=function(t){return Qi(t.marks)};function Qi(e){var t={};for(var r in e){var n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function Yn(e){return e.document||window.document}var Zi=65535,ts=Math.pow(2,16);function bc(e,t){return e+t*ts}function es(e){return e&Zi}function kc(e){return(e-(e&Zi))/ts}var An=function(t,r,n){r===void 0&&(r=!1),n===void 0&&(n=null),this.pos=t,this.deleted=r,this.recover=n},ot=function(t,r){r===void 0&&(r=!1),this.ranges=t,this.inverted=r};ot.prototype.recover=function(t){var r=0,n=es(t);if(!this.inverted)for(var o=0;ot)break;var l=this.ranges[a+i],u=this.ranges[a+s],f=c+l;if(t<=f){var p=l?t==c?-1:t==f?1:r:r,d=c+o+(p<0?0:u);if(n)return d;var h=t==(r<0?c:f)?null:bc(a/3,t-c);return new An(d,r<0?t!=c:t!=f,h)}o+=u-l}return n?t+o:new An(t+o)};ot.prototype.touches=function(t,r){for(var n=0,o=es(r),i=this.inverted?2:1,s=this.inverted?1:2,a=0;at)break;var l=this.ranges[a+i],u=c+l;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-l}return!1};ot.prototype.forEach=function(t){for(var r=this.inverted?2:1,n=this.inverted?1:2,o=0,i=0;o=0;r--){var o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:null)}};pt.prototype.invert=function(){var t=new pt;return t.appendMappingInverted(this),t};pt.prototype.map=function(t,r){if(r===void 0&&(r=1),this.mirror)return this._map(t,r,!0);for(var n=this.from;ni&&c0};Y.prototype.addStep=function(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r};Object.defineProperties(Y.prototype,Xn);function Hr(){throw new Error("Override me")}var _n=Object.create(null),ht=function(){};ht.prototype.apply=function(t){return Hr()};ht.prototype.getMap=function(){return ot.empty};ht.prototype.invert=function(t){return Hr()};ht.prototype.map=function(t){return Hr()};ht.prototype.merge=function(t){return null};ht.prototype.toJSON=function(){return Hr()};ht.fromJSON=function(t,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=_n[r.stepType];if(!n)throw new RangeError("No step type "+r.stepType+" defined");return n.fromJSON(t,r)};ht.jsonID=function(t,r){if(t in _n)throw new RangeError("Duplicate use of step JSON ID "+t);return _n[t]=r,r.prototype.jsonID=t,r};var vt=function(t,r){this.doc=t,this.failed=r};vt.ok=function(t){return new vt(t,null)};vt.fail=function(t){return new vt(null,t)};vt.fromReplace=function(t,r,n,o){try{return vt.ok(t.replace(r,n,o))}catch(i){if(i instanceof Wt)return vt.fail(i.message);throw i}};var Qt=function(e){function t(r,n,o,i){e.call(this),this.from=r,this.to=n,this.slice=o,this.structure=!!i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){return this.structure&&Nn(n,this.from,this.to)?vt.fail("Structure replace would overwrite content"):vt.fromReplace(n,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new ot([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(n){return new t(this.from,this.from+this.slice.size,n.slice(this.from,this.to))},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new t(o.pos,Math.max(o.pos,i.pos),this.slice)},t.prototype.merge=function(n){if(!(n instanceof t)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){var o=this.slice.size+n.slice.size==0?x.empty:new x(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new t(this.from,this.to+(n.to-n.from),o,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){var i=this.slice.size+n.slice.size==0?x.empty:new x(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new t(n.from,this.to,i,this.structure)}else return null},t.prototype.toJSON=function(){var n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(o.from,o.to,x.fromJSON(n,o.slice),!!o.structure)},t}(ht);ht.jsonID("replace",Qt);var Mt=function(e){function t(r,n,o,i,s,a,c){e.call(this),this.from=r,this.to=n,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=!!c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){if(this.structure&&(Nn(n,this.from,this.gapFrom)||Nn(n,this.gapTo,this.to)))return vt.fail("Structure gap-replace would overwrite content");var o=n.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return vt.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?vt.fromReplace(n,this.from,this.to,i):vt.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new ot([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(n){var o=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1),s=n.map(this.gapFrom,-1),a=n.map(this.gapTo,1);return o.deleted&&i.deleted||si.pos?null:new t(o.pos,i.pos,s,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(o.from,o.to,o.gapFrom,o.gapTo,x.fromJSON(n,o.slice),o.insert,!!o.structure)},t}(ht);ht.jsonID("replaceAround",Mt);function Nn(e,t,r){for(var n=e.resolve(t),o=r-t,i=n.depth;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0)for(var s=n.node(i).maybeChild(n.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Sc(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function Ve(e){for(var t=e.parent,r=t.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nt;f--)p||r.index(f)>0?(p=!0,l=k.from(r.node(f).copy(l)),u++):a--;for(var d=k.empty,h=0,v=o,g=!1;v>t;v--)g||n.after(v+1)=0;n--)r=k.from(t[n].type.create(t[n].attrs,r));var o=e.start,i=e.end;return this.step(new Mt(o,i,o,i,new x(r,0,0),t.length,!0))};Y.prototype.setBlockType=function(e,t,r,n){var o=this;if(t===void 0&&(t=e),!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(e,t,function(s,a){if(s.isTextblock&&!s.hasMarkup(r,n)&&Cc(o.doc,o.mapping.slice(i).map(a),r)){o.clearIncompatible(o.mapping.slice(i).map(a,1),r);var c=o.mapping.slice(i),l=c.map(a,1),u=c.map(a+s.nodeSize,1);return o.step(new Mt(l,u,l+1,u-1,new x(k.from(r.create(n,null,s.marks)),0,0),1,!0)),!1}}),this};function Cc(e,t,r){var n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}Y.prototype.setNodeMarkup=function(e,t,r,n){var o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(r,null,n||o.marks);if(o.isLeaf)return this.replaceWith(e,e+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new Mt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new x(k.from(i),0,0),1,!0))};function _e(e,t,r,n){r===void 0&&(r=1);var o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=r-2;a>i;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var f=l.content.cutByIndex(u,l.childCount),p=n&&n[c]||l;if(p!=l&&(f=f.replaceChild(0,p.type.create(p.attrs))),!l.canReplace(u+1,l.childCount)||!p.type.validContent(f))return!1}var d=o.indexAfter(i),h=n&&n[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)}Y.prototype.split=function(e,t,r){t===void 0&&(t=1);for(var n=this.doc.resolve(e),o=k.empty,i=k.empty,s=n.depth,a=n.depth-t,c=t-1;s>a;s--,c--){o=k.from(n.node(s).copy(o));var l=r&&r[c];i=k.from(l?l.type.create(l.attrs,i):n.node(s).copy(i))}return this.step(new Qt(e,e,new x(o.append(i),t,t),!0))};function Zn(e,t){var r=e.resolve(t),n=r.index();return Oc(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function Oc(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}Y.prototype.join=function(e,t){t===void 0&&(t=1);var r=new Qt(e-t,e+t,x.empty,!0);return this.step(r)};function wc(e,t,r){var n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(var o=n.depth-1;o>=0;o--){var i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(var s=n.depth-1;s>=0;s--){var a=n.indexAfter(s);if(n.node(s).canReplaceWith(a,a,r))return n.after(s+1);if(a=0;a--){var c=a==n.depth?0:n.pos<=(n.start(a+1)+n.end(a+1))/2?-1:1,l=n.index(a)+(c>0?1:0),u=n.node(a),f=!1;if(s==1)f=u.canReplace(l,l,o);else{var p=u.contentMatchAt(l).findWrapping(o.firstChild.type);f=p&&u.canReplaceWith(l,l,p[0])}if(f)return c==0?n.pos:c<0?n.before(a+1):n.after(a+1)}return null}function to(e,t,r){for(var n=[],o=0;o=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(n){if(n instanceof t&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new t(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(o.from,o.to,n.markFromJSON(o.mark))},t}(ht);ht.jsonID("addMark",eo);var fr=function(e){function t(r,n,o){e.call(this),this.from=r,this.to=n,this.mark=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){var o=this,i=n.slice(this.from,this.to),s=new x(to(i.content,function(a){return a.mark(o.mark.removeFromSet(a.marks))}),i.openStart,i.openEnd);return vt.fromReplace(n,this.from,this.to,s)},t.prototype.invert=function(){return new eo(this.from,this.to,this.mark)},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(n){if(n instanceof t&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new t(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(o.from,o.to,n.markFromJSON(o.mark))},t}(ht);ht.jsonID("removeMark",fr);Y.prototype.addMark=function(e,t,r){var n=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(e,t,function(c,l,u){if(c.isInline){var f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){for(var p=Math.max(l,e),d=Math.min(l+c.nodeSize,t),h=r.addToSet(f),v=0;v=0;p--)this.step(o[p]);return this};function Tc(e,t,r,n){if(r===void 0&&(r=t),n===void 0&&(n=x.empty),t==r&&!n.size)return null;var o=e.resolve(t),i=e.resolve(r);return ns(o,i,n)?new Qt(t,r,n):new It(o,i,n).fit()}Y.prototype.replace=function(e,t,r){t===void 0&&(t=e),r===void 0&&(r=x.empty);var n=Tc(this.doc,e,t,r);return n&&this.step(n),this};Y.prototype.replaceWith=function(e,t,r){return this.replace(e,t,new x(k.from(r),0,0))};Y.prototype.delete=function(e,t){return this.replace(e,t,x.empty)};Y.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};function ns(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}var It=function(t,r,n){this.$to=r,this.$from=t,this.unplaced=n,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=k.empty;for(var s=t.depth;s>0;s--)this.placed=k.from(t.node(s).copy(this.placed))},is={depth:{configurable:!0}};is.depth.get=function(){return this.frontier.length-1};It.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var r=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(r<0?this.$to:o.doc.resolve(r));if(!i)return null;for(var s=this.placed,a=o.depth,c=i.depth;a&&c&&s.childCount==1;)s=s.firstChild.content,a--,c--;var l=new x(s,a,c);if(r>-1)return new Mt(o.pos,r,this.$to.pos,this.$to.end(),l,n);if(l.size||o.pos!=this.$to.pos)return new Qt(o.pos,i.pos,l)};It.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var r=this.unplaced.openStart;r>=0;r--){var n=void 0,o=void 0;r?(o=ro(this.unplaced.content,r-1).firstChild,n=o.content):n=this.unplaced.content;for(var i=n.firstChild,s=this.depth;s>=0;s--){var a=this.frontier[s],c=a.type,l=a.match,u=void 0,f=void 0;if(t==1&&(i?l.matchType(i.type)||(f=l.fillBefore(k.from(i),!1)):c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(t==2&&i&&(u=l.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&l.matchType(o.type))break}}};It.prototype.openMore=function(){var t=this.unplaced,r=t.content,n=t.openStart,o=t.openEnd,i=ro(r,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new x(r,n+1,Math.max(o,i.size+n>=r.size-o?n+1:0)),!0)};It.prototype.dropNode=function(){var t=this.unplaced,r=t.content,n=t.openStart,o=t.openEnd,i=ro(r,n);if(i.childCount<=1&&n>0){var s=r.size-n<=n+i.size;this.unplaced=new x(tr(r,n-1,1),n-1,s?n-1:o)}else this.unplaced=new x(tr(r,n,1),n,o)};It.prototype.placeNodes=function(t){for(var r=t.sliceDepth,n=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a1||u==0||y.content.size)&&(h=I,p.push(ss(y.mark(v.allowedMarks(y.marks)),f==1?u:0,f==l.childCount?S:-1)))}var m=f==l.childCount;m||(S=-1),this.placed=pr(this.placed,n,k.from(p)),this.frontier[n].match=h,m&&S<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var D=0,C=l;D1&&i==this.$to.end(--o);)++i;return i};It.prototype.findCloseLevel=function(t){t:for(var r=Math.min(this.depth,t.depth);r>=0;r--){var n=this.frontier[r],o=n.match,i=n.type,s=r=0;c--){var l=this.frontier[c],u=l.match,f=l.type,p=En(t,c,f,u,!0);if(!p||p.childCount)continue t}return{depth:r,fit:a,move:s?t.doc.resolve(t.after(r+1)):t}}}};It.prototype.close=function(t){var r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=pr(this.placed,r.depth,r.fit)),t=r.move;for(var n=r.depth+1;n<=t.depth;n++){var o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t};It.prototype.openFrontierNode=function(t,r,n){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=pr(this.placed,this.depth,k.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})};It.prototype.closeFrontierNode=function(){var t=this.frontier.pop(),r=t.match.fillBefore(k.empty,!0);r.childCount&&(this.placed=pr(this.placed,this.frontier.length,r))};Object.defineProperties(It.prototype,is);function tr(e,t,r){return t==0?e.cutByIndex(r):e.replaceChild(0,e.firstChild.copy(tr(e.firstChild.content,t-1,r)))}function pr(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(pr(e.lastChild.content,t-1,r)))}function ro(e,t){for(var r=0;r1&&(n=n.replaceChild(0,ss(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(k.empty,!0)))),e.copy(n)}function En(e,t,r,n,o){var i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;var a=n.fillBefore(i.content,!0,s);return a&&!Ac(r,i.content,s)?a:null}function Ac(e,t,r){for(var n=r;n0;a--,c--){var l=n.node(a).type.spec;if(l.defining||l.isolating)break;i.indexOf(a)>-1?s=a:n.before(a)==c&&i.splice(1,0,-a)}for(var u=i.indexOf(s),f=[],p=r.openStart,d=r.content,h=0;;h++){var v=d.firstChild;if(f.push(v),h==r.openStart)break;d=v.content}p>0&&f[p-1].type.spec.defining&&n.node(u).type!=f[p-1].type?p-=1:p>=2&&f[p-1].isTextblock&&f[p-2].type.spec.defining&&n.node(u).type!=f[p-2].type&&(p-=2);for(var g=r.openStart;g>=0;g--){var S=(g+p+1)%(r.openStart+1),y=f[S];if(y)for(var I=0;I=0&&(this.replace(e,t,r),!(this.steps.length>q));$--){var w=i[$];w<0||(e=n.before(w),t=o.after(w))}return this};function as(e,t,r,n,o){if(tn){var s=o.contentMatchAt(0),a=s.fillBefore(e).append(e);e=a.append(s.matchFragment(a).fillBefore(k.empty,!0))}return e}Y.prototype.replaceRangeWith=function(e,t,r){if(!r.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var n=wc(this.doc,e,r.type);n!=null&&(e=t=n)}return this.replaceRange(e,t,new x(k.from(r),0,0))};Y.prototype.deleteRange=function(e,t){for(var r=this.doc.resolve(e),n=this.doc.resolve(t),o=cs(r,n),i=0;i0&&(a||r.node(s-1).canReplace(r.index(s-1),n.indexAfter(s-1))))return this.delete(r.before(s),n.after(s))}for(var c=1;c<=r.depth&&c<=n.depth;c++)if(e-r.start(c)==r.depth-c&&t>r.end(c)&&n.end(c)-t!=n.depth-c)return this.delete(r.before(c),t);return this.delete(e,t)};function cs(e,t){for(var r=[],n=Math.min(e.depth,t.depth),o=n;o>=0;o--){var i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;i==t.start(o)&&r.push(o)}return r}var Dn=Object.create(null),E=function(t,r,n){this.ranges=n||[new _c(t.min(r),t.max(r))],this.$anchor=t,this.$head=r},ce={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ce.anchor.get=function(){return this.$anchor.pos};ce.head.get=function(){return this.$head.pos};ce.from.get=function(){return this.$from.pos};ce.to.get=function(){return this.$to.pos};ce.$from.get=function(){return this.ranges[0].$from};ce.$to.get=function(){return this.ranges[0].$to};ce.empty.get=function(){for(var e=this.ranges,t=0;t=0;i--){var s=r<0?Ne(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Ne(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}};E.near=function(t,r){return r===void 0&&(r=1),this.findFrom(t,r)||this.findFrom(t,-r)||new le(t.node(0))};E.atStart=function(t){return Ne(t,t,0,0,1)||new le(t)};E.atEnd=function(t){return Ne(t,t,t.content.size,t.childCount,-1)||new le(t)};E.fromJSON=function(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Dn[r.type];if(!n)throw new RangeError("No selection type "+r.type+" defined");return n.fromJSON(t,r)};E.jsonID=function(t,r){if(t in Dn)throw new RangeError("Duplicate use of selection JSON ID "+t);return Dn[t]=r,r.prototype.jsonID=t,r};E.prototype.getBookmark=function(){return H.between(this.$anchor,this.$head).getBookmark()};Object.defineProperties(E.prototype,ce);E.prototype.visible=!0;var _c=function(t,r){this.$from=t,this.$to=r},H=function(e){function t(n,o){o===void 0&&(o=n),e.call(this,n,o)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={$cursor:{configurable:!0}};return r.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(o,i){var s=o.resolve(i.map(this.head));if(!s.parent.inlineContent)return e.near(s);var a=o.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:s,s)},t.prototype.replace=function(o,i){if(i===void 0&&(i=x.empty),e.prototype.replace.call(this,o,i),i==x.empty){var s=this.$from.marksAcross(this.$to);s&&o.ensureMarks(s)}},t.prototype.eq=function(o){return o instanceof t&&o.anchor==this.anchor&&o.head==this.head},t.prototype.getBookmark=function(){return new er(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(o.resolve(i.anchor),o.resolve(i.head))},t.create=function(o,i,s){s===void 0&&(s=i);var a=o.resolve(i);return new this(a,s==i?a:o.resolve(s))},t.between=function(o,i,s){var a=o.pos-i.pos;if((!s||a)&&(s=a>=0?1:-1),!i.parent.inlineContent){var c=e.findFrom(i,s,!0)||e.findFrom(i,-s,!0);if(c)i=c.$head;else return e.near(i,s)}return o.parent.inlineContent||(a==0?o=i:(o=(e.findFrom(o,-s,!0)||e.findFrom(o,s,!0)).$anchor,o.pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&N.isSelectable(a))return N.create(e,r-(o<0?a.nodeSize:0))}else{var c=Ne(e,a,r+o,o<0?a.childCount:0,o,i);if(c)return c}r+=a.nodeSize*o}}function ls(e,t,r){var n=e.steps.length-1;if(!(n0},t.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=br,this},t.prototype.ensureMarks=function(o){return R.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},t.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},r.storedMarksSet.get=function(){return(this.updated&br)>0},t.prototype.addStep=function(o,i){e.prototype.addStep.call(this,o,i),this.updated=this.updated&~br,this.storedMarks=null},t.prototype.setTime=function(o){return this.time=o,this},t.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},t.prototype.replaceSelectionWith=function(o,i){var s=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||R.none))),s.replaceWith(this,o),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(o,i,s){s===void 0&&(s=i);var a=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(a.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,s);var c=this.storedMarks;if(!c){var l=this.doc.resolve(i);c=s==i?l.marks():l.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(i,s,a.text(o,c)),this.selection.empty||this.setSelection(E.near(this.selection.$to)),this},t.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},t.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},r.isGeneric.get=function(){for(var n in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=Ko,this},r.scrolledIntoView.get=function(){return(this.updated&Ko)>0},Object.defineProperties(t.prototype,r),t}(Y);function $o(e,t){return!t||!e?e:e.bind(t)}var Je=function(t,r,n){this.name=t,this.init=$o(r.init,n),this.apply=$o(r.apply,n)},Dc=[new Je("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Je("selection",{init:function(t,r){return t.selection||E.atStart(r.doc)},apply:function(t){return t.selection}}),new Je("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,r,n,o){return o.selection.$cursor?t.storedMarks:null}}),new Je("scrollToSelection",{init:function(){return 0},apply:function(t,r){return t.scrolledIntoView?r+1:r}})],no=function(t,r){var n=this;this.schema=t,this.fields=Dc.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),r&&r.forEach(function(o){if(n.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");n.plugins.push(o),n.pluginsByKey[o.key]=o,o.spec.state&&n.fields.push(new Je(o.key,o.spec.state,o))})},dt=function(t){this.config=t},jr={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};jr.schema.get=function(){return this.config.schema};jr.plugins.get=function(){return this.config.plugins};dt.prototype.apply=function(t){return this.applyTransaction(t).state};dt.prototype.filterTransaction=function(t,r){r===void 0&&(r=-1);for(var n=0;n-1&&rr.splice(r,1)};Object.defineProperties(dt.prototype,jr);var rr=[];function us(e,t,r){for(var n in e){var o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=us(o,t,{})),r[n]=o}return r}var Rt=function(t){this.props={},t.props&&us(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:fs("plugin")};Rt.prototype.getState=function(t){return t[this.key]};var sn=Object.create(null);function fs(e){return e in sn?e+"$"+ ++sn[e]:(sn[e]=0,e+"$")}var Kt=function(t){t===void 0&&(t="key"),this.key=fs(t)};Kt.prototype.get=function(t){return t.config.pluginsByKey[this.key]};Kt.prototype.getState=function(t){return t[this.key]};var M={};if(typeof navigator<"u"&&typeof document<"u"){var an=/Edge\/(\d+)/.exec(navigator.userAgent),Uo=/MSIE \d/.test(navigator.userAgent),cn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);M.mac=/Mac/.test(navigator.platform);var ln=M.ie=!!(Uo||cn||an);M.ie_version=Uo?document.documentMode||6:cn?+cn[1]:an?+an[1]:null,M.gecko=!ln&&/gecko\/(\d+)/i.test(navigator.userAgent),M.gecko_version=M.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var un=!ln&&/Chrome\/(\d+)/.exec(navigator.userAgent);M.chrome=!!un,M.chrome_version=un&&+un[1],M.safari=!ln&&/Apple Computer/.test(navigator.vendor),M.ios=M.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),M.android=/Android \d/.test(navigator.userAgent),M.webkit="webkitFontSmoothing"in document.documentElement.style,M.webkit_version=M.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Dt=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},oo=function(e){var t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Go=null,Yt=function(e,t,r){var n=Go||(Go=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},Tr=function(e,t,r,n){return r&&(Yo(e,t,r,n,-1)||Yo(e,t,r,n,1))},Ic=/^(img|br|input|textarea|hr)$/i;function Yo(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:qt(e))){var i=e.parentNode;if(i.nodeType!=1||Pc(e)||Ic.test(e.nodeName)||e.contentEditable=="false")return!1;t=Dt(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?qt(e):0}else return!1}}function qt(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Rc(e,t,r){for(var n=t==0,o=t==qt(e);n||o;){if(e==r)return!0;var i=Dt(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==qt(e)}}function Pc(e){for(var t,r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var io=function(e){var t=e.isCollapsed;return t&&M.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Ae(e,t){var r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function zc(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function te(e,t){return typeof e=="number"?e:e[t]}function Bc(e){var t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Xo(e,t,r){for(var n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=r||e.dom;s;s=oo(s))if(s.nodeType==1){var a=s==i.body||s.nodeType!=1,c=a?zc(i):Bc(s),l=0,u=0;if(t.topc.bottom-te(n,"bottom")&&(u=t.bottom-c.bottom+te(o,"bottom")),t.leftc.right-te(n,"right")&&(l=t.right-c.right+te(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var f=s.scrollLeft,p=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var d=s.scrollLeft-f,h=s.scrollTop-p;t={left:t.left-d,top:t.top-h,right:t.right-d,bottom:t.bottom-h}}if(a)break}}function Lc(e){for(var t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o,i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=c.top;break}}}return{refDOM:n,refTop:o,stack:ps(e.dom)}}function ps(e){for(var t=[],r=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=r);e=oo(e));return t}function Fc(e){var t=e.refDOM,r=e.refTop,n=e.stack,o=t?t.getBoundingClientRect().top:0;ds(n,o==0?0:o-r)}function ds(e,t){for(var r=0;r=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);var d=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}!r&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=l+1)}}return r&&r.nodeType==3?Hc(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:hs(r,o)}function Hc(e,t){for(var r=e.nodeValue.length,n=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function so(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function jc(e,t){var r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}function Jc(e,t,r,n){for(var o=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>n.left||a.top>n.top)o=s.posBefore;else if(a.right-1?o:e.docView.posFromDOM(t,r)}function ms(e,t,r){var n=e.childNodes.length;if(n&&r.topt.top&&s++}i==e.dom&&s==i.childNodes.length-1&&i.lastChild.nodeType==1&&t.top>i.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:(s==0||i.nodeType!=1||i.childNodes[s-1].nodeName!="BR")&&(u=Jc(e,i,s,t))}u==null&&(u=qc(e,l,t));var v=e.docView.nearestDesc(l,!0);return{pos:u,inside:v?v.posAtStart-v.border:-1}}function ee(e,t){var r=e.getClientRects();return r.length?r[t<0?0:r.length-1]:e.getBoundingClientRect()}var Kc=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function vs(e,t,r){var n=e.docView.domFromPos(t,r<0?-1:1),o=n.node,i=n.offset,s=M.webkit||M.gecko;if(o.nodeType==3)if(s&&(Kc.test(o.nodeValue)||(r<0?!i:i==o.nodeValue.length))){var a=ee(Yt(o,i,i),r);if(M.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0&&i==o.nodeValue.length?(u--,p=1):r<0?u--:f++,qe(ee(Yt(o,u,f),p),p<0)}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(r<0||i==qt(o))){var d=o.childNodes[i-1];if(d.nodeType==1)return fn(d.getBoundingClientRect(),!1)}if(i=0)}if(i&&(r<0||i==qt(o))){var v=o.childNodes[i-1],g=v.nodeType==3?Yt(v,qt(v)-(s?0:1)):v.nodeType==1&&(v.nodeName!="BR"||!v.nextSibling)?v:null;if(g)return qe(ee(g,1),!1)}if(i=0)}function qe(e,t){if(e.width==0)return e;var r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function fn(e,t){if(e.height==0)return e;var r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function gs(e,t,r){var n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function $c(e,t,r){var n=t.selection,o=r=="up"?n.$from:n.$to;return gs(e,t,function(){for(var i=e.docView.domFromPos(o.pos,r=="up"?-1:1),s=i.node;;){var a=e.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.dom;break}s=a.dom.parentNode}for(var c=vs(e,o.pos,1),l=s.firstChild;l;l=l.nextSibling){var u=void 0;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Yt(l,0,l.nodeValue.length).getClientRects();else continue;for(var f=0;fp.top&&(r=="up"?p.bottomc.bottom-1))return!1}}return!0})}var Uc=/[\u0590-\u08ac]/;function Gc(e,t,r){var n=t.selection,o=n.$head;if(!o.parent.isTextblock)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size,c=e.root.getSelection();return!Uc.test(o.parent.textContent)||!c.modify?r=="left"||r=="backward"?s:a:gs(e,t,function(){var l=c.getRangeAt(0),u=c.focusNode,f=c.focusOffset,p=c.caretBidiLevel;c.modify("move",r,"character");var d=o.depth?e.docView.domAfterPos(o.before()):e.dom,h=!d.contains(c.focusNode.nodeType==1?c.focusNode:c.focusNode.parentNode)||u==c.focusNode&&f==c.focusOffset;return c.removeAllRanges(),c.addRange(l),p!=null&&(c.caretBidiLevel=p),h})}var Qo=null,Zo=null,ti=!1;function Yc(e,t,r){return Qo==t&&Zo==r?ti:(Qo=t,Zo=r,ti=r=="up"||r=="down"?$c(e,t,r):Gc(e,t,r))}var Lt=0,ys=1,Ue=2,ie=3,J=function(t,r,n,o){this.parent=t,this.children=r,this.dom=n,n.pmViewDesc=this,this.contentDOM=o,this.dirty=Lt},$t={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0}};J.prototype.matchesWidget=function(){return!1};J.prototype.matchesMark=function(){return!1};J.prototype.matchesNode=function(){return!1};J.prototype.matchesHack=function(t){return!1};$t.beforePosition.get=function(){return!1};J.prototype.parseRule=function(){return null};J.prototype.stopEvent=function(){return!1};$t.size.get=function(){for(var e=0,t=0;tDt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))c=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(var l=t;;l=l.parentNode){if(l==this.dom){c=!1;break}if(l.parentNode.firstChild!=l)break}if(c==null&&r==t.childNodes.length)for(var u=t;;u=u.parentNode){if(u==this.dom){c=!0;break}if(u.parentNode.lastChild!=u)break}}return c??n>0?this.posAtEnd:this.posAtStart};J.prototype.nearestDesc=function(t,r){for(var n=!0,o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i&&(!r||i.node))if(n&&i.nodeDOM&&!(i.nodeDOM.nodeType==1?i.nodeDOM.contains(t.nodeType==1?t:t.parentNode):i.nodeDOM==t))n=!1;else return i}};J.prototype.getDesc=function(t){for(var r=t.pmViewDesc,n=r;n;n=n.parent)if(n==this)return r};J.prototype.posFromDOM=function(t,r,n){for(var o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1};J.prototype.descAt=function(t){for(var r=0,n=0;r=t:a>t)&&(a>t||o+1>=this.children.length||!this.children[o+1].beforePosition))return s.domFromPos(t-n-s.border,r);n=a}};J.prototype.parseRange=function(t,r,n){if(n===void 0&&(n=0),this.children.length==0)return{node:this.contentDOM,from:t,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var o=-1,i=-1,s=n,a=0;;a++){var c=this.children[a],l=s+c.size;if(o==-1&&t<=l){var u=s+c.border;if(t>=u&&r<=l-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,r,u);t=s;for(var f=a;f>0;f--){var p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=Dt(p.dom)+1;break}t-=p.size}o==-1&&(o=0)}if(o>-1&&(l>r||a==this.children.length-1)){r=l;for(var d=a+1;dc&&sr){var L=f;f=p,p=L}var q=document.createRange();q.setEnd(p.node,p.offset),q.setStart(f.node,f.offset),d.removeAllRanges(),d.addRange(q)}}};J.prototype.ignoreMutation=function(t){return!this.contentDOM&&t.type!="selection"};$t.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)};J.prototype.markDirty=function(t,r){for(var n=0,o=0;o=n:tn){var a=n+i.border,c=s-i.border;if(t>=a&&r<=c){this.dirty=t==n||r==s?Ue:ys,t==a&&r==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ie:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM?Ue:ie}n=s}this.dirty=Ue};J.prototype.markParentsDirty=function(){for(var t=1,r=this.parent;r;r=r.parent,t++){var n=t==1?Ue:ys;r.dirty0&&(a=Pn(a,0,n,i));for(var l=0;l-1?l:null,f=l&&l.pos<0,p=new Pt(this,u&&u.node);ol(this.node,this.innerDeco,function(d,h,v){d.spec.marks?p.syncToMarks(d.spec.marks,a,o):d.type.side>=0&&!v&&p.syncToMarks(h==s.node.childCount?R.none:s.node.child(h).marks,a,o),p.placeWidget(d,o,c)},function(d,h,v,g){p.syncToMarks(d.marks,a,o);var S;p.findNodeMatch(d,h,v,g)||f&&o.state.selection.from>c&&o.state.selection.to-1&&p.updateNodeAt(d,h,v,S,o)||p.updateNextNode(d,h,v,o,g)||p.addNode(d,h,v,o,c),c+=d.nodeSize}),p.syncToMarks(se,a,o),this.node.isTextblock&&p.addTextblockHacks(),p.destroyRest(),(p.changed||this.dirty==Ue)&&(u&&this.protectLocalComposition(o,u),Ss(this.contentDOM,this.children,o),M.ios&&il(this.dom))},t.prototype.localCompositionInfo=function(o,i){var s=o.state.selection,a=s.from,c=s.to;if(!(!(o.state.selection instanceof H)||ai+this.node.content.size)){var l=o.root.getSelection(),u=sl(l.focusNode,l.focusOffset);if(!(!u||!this.dom.contains(u.parentNode)))if(this.node.inlineContent){var f=u.nodeValue,p=al(this.node.content,f,a-i,c-i);return p<0?null:{node:u,pos:p,text:f}}else return{node:u,pos:-1}}},t.prototype.protectLocalComposition=function(o,i){var s=i.node,a=i.pos,c=i.text;if(!this.getDesc(s)){for(var l=s;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=null)}var u=new Qc(this,l,s,c);o.compositionNodes.push(u),this.children=Pn(this.children,a,a+c.length,o,u)}},t.prototype.update=function(o,i,s,a){return this.dirty==ie||!o.sameMarkup(this.node)?!1:(this.updateInner(o,i,s,a),!0)},t.prototype.updateInner=function(o,i,s,a){this.updateOuterDeco(i),this.node=o,this.innerDeco=s,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=Lt},t.prototype.updateOuterDeco=function(o){if(!Rn(o,this.outerDeco)){var i=this.nodeDOM.nodeType!=1,s=this.dom;this.dom=Ms(this.dom,this.nodeDOM,In(this.outerDeco,this.node,i),In(o,this.node,i)),this.dom!=s&&(s.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=o}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")},r.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(t.prototype,r),t}(J);function bs(e,t,r,n,o){return xs(n,t,e),new dr(null,e,t,r,n,n,n,o,0)}var ks=function(e){function t(n,o,i,s,a,c,l){e.call(this,n,o,i,s,a,null,c,l)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var o=this.nodeDOM.parentNode;o&&o!=this.dom&&!o.pmIsDeco;)o=o.parentNode;return{skip:o||!0}},t.prototype.update=function(o,i,s,a){return this.dirty==ie||this.dirty!=Lt&&!this.inParent()||!o.sameMarkup(this.node)?!1:(this.updateOuterDeco(i),(this.dirty!=Lt||o.text!=this.node.text)&&o.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=o.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=o,this.dirty=Lt,!0)},t.prototype.inParent=function(){for(var o=this.parent.contentDOM,i=this.nodeDOM;i;i=i.parentNode)if(i==o)return!0;return!1},t.prototype.domFromPos=function(o){return{node:this.nodeDOM,offset:o}},t.prototype.localPosFromDOM=function(o,i,s){return o==this.nodeDOM?this.posAtStart+Math.min(i,this.node.text.length):e.prototype.localPosFromDOM.call(this,o,i,s)},t.prototype.ignoreMutation=function(o){return o.type!="characterData"&&o.type!="selection"},t.prototype.slice=function(o,i,s){var a=this.node.cut(o,i),c=document.createTextNode(a.text);return new t(this.parent,a,this.outerDeco,this.innerDeco,c,c,s)},t.prototype.markDirty=function(o,i){e.prototype.markDirty.call(this,o,i),this.dom!=this.nodeDOM&&(o==0||i==this.nodeDOM.nodeValue.length)&&(this.dirty=ie)},r.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,r),t}(dr),Zc=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(o){return this.dirty==Lt&&this.dom.nodeName==o},r.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,r),t}(J),tl=function(e){function t(r,n,o,i,s,a,c,l,u,f){e.call(this,r,n,o,i,s,a,c,u,f),this.spec=l}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(n,o,i,s){if(this.dirty==ie)return!1;if(this.spec.update){var a=this.spec.update(n,o,i);return a&&this.updateInner(n,o,i,s),a}else return!this.contentDOM&&!n.isLeaf?!1:e.prototype.update.call(this,n,o,i,s)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(n,o,i,s){this.spec.setSelection?this.spec.setSelection(n,o,i):e.prototype.setSelection.call(this,n,o,i,s)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(n){return this.spec.stopEvent?this.spec.stopEvent(n):!1},t.prototype.ignoreMutation=function(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):e.prototype.ignoreMutation.call(this,n)},t}(dr);function Ss(e,t,r){for(var n=e.firstChild,o=!1,i=0;i>1,s=Math.min(i,t.length);o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=ao.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}};Pt.prototype.findNodeMatch=function(t,r,n,o){var i=this.top.children,s=-1;if(o>=this.preMatch.index){for(var a=this.index;a0&&n>0;n--){var i=t[n-1],s=i.node;if(s){if(s!=e.child(r-1))break;--r,o.set(i,r)}}return{index:r,matched:o}}function nl(e,t){return e.type.side-t.type.side}function ol(e,t,r,n){var o=t.locals(e),i=0;if(o.length==0){for(var s=0;si;)l.push(o[c++]);var y=i+v.nodeSize;if(v.isText){var I=y;c0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=qt(e)}else if(e.nodeType==1&&t=r){var u=c.lastIndexOf(t,n-a);if(u>=0&&u+t.length+a>=r)return a+u}}}return-1}function Pn(e,t,r,n,o){for(var i=[],s=0,a=0;s=r||u<=t?i.push(c):(lr&&i.push(c.slice(r-l,c.size,n)))}return i}function Cs(e,t){var r=e.root.getSelection(),n=e.state.doc;if(!r.focusNode)return null;var o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset);if(s<0)return null;var a=n.resolve(s),c,l;if(io(r)){for(c=a;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&N.isSelectable(o.node)&&o.parent&&!(o.node.isInline&&Rc(r.focusNode,r.focusOffset,o.dom))){var u=o.posBefore;l=new N(s==u?a:n.resolve(u))}}else{var f=e.docView.posFromDOM(r.anchorNode,r.anchorOffset);if(f<0)return null;c=n.resolve(f)}if(!l){var p=t=="pointer"||e.state.selection.head0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&E.findFrom(s,t)}function he(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function si(e,t,r){var n=e.state.selection;if(n instanceof H){if(!n.empty||r.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var o=zn(e.state,t);return o&&o instanceof N?he(e,o):!1}else if(!(M.mac&&r.indexOf("m")>-1)){var i=n.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;var c=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=e.docView.descAt(c))&&!a.contentDOM?N.isSelectable(s)?he(e,new N(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):M.webkit?he(e,new H(e.state.doc.resolve(t<0?c:c+s.nodeSize))):!1:!1}}else{if(n instanceof N&&n.node.isInline)return he(e,new H(t>0?n.$to:n.$from));var l=zn(e.state,t);return l?he(e,l):!1}}function Ar(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ye(e){var t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function dn(e){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(r){var o,i,s=!1;for(M.gecko&&r.nodeType==1&&n0){if(r.nodeType!=1)break;var a=r.childNodes[n-1];if(Ye(a))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}else{if(Ts(r))break;for(var c=r.previousSibling;c&&Ye(c);)o=r.parentNode,i=Dt(c),c=c.previousSibling;if(c)r=c,n=Ar(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}s?Bn(e,t,r,n):o&&Bn(e,t,o,i)}}function hn(e){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(r){for(var o=Ar(r),i,s;;)if(n-1||M.mac&&r.indexOf("m")>-1)return!1;var o=n.$from,i=n.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var s=zn(e.state,t);if(s&&s instanceof N)return he(e,s)}if(!o.parent.inlineContent){var a=t<0?o:i,c=n instanceof le?E.near(a,t):E.findFrom(a,t);return c?he(e,c):!1}return!1}function ci(e,t){if(!(e.state.selection instanceof H))return!0;var r=e.state.selection,n=r.$head,o=r.$anchor,i=r.empty;if(!n.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){var a=e.state.tr;return t<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),e.dispatch(a),!0}return!1}function li(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function pl(e){if(!(!M.safari||e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(r&&r.nodeType==1&&n==0&&r.firstChild&&r.firstChild.contentEditable=="false"){var o=r.firstChild;li(e,o,!0),setTimeout(function(){return li(e,o,!1)},20)}}}function dl(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function hl(e,t){var r=t.keyCode,n=dl(t);return r==8||M.mac&&r==72&&n=="c"?ci(e,-1)||dn(e):r==46||M.mac&&r==68&&n=="c"?ci(e,1)||hn(e):r==13||r==27?!0:r==37?si(e,-1,n)||dn(e):r==39?si(e,1,n)||hn(e):r==38?ai(e,-1,n)||dn(e):r==40?pl(e)||ai(e,1,n)||hn(e):n==(M.mac?"m":"c")&&(r==66||r==73||r==89||r==90)}function ml(e,t,r){var n=e.docView.parseRange(t,r),o=n.node,i=n.fromOffset,s=n.toOffset,a=n.from,c=n.to,l=e.root.getSelection(),u=null,f=l.anchorNode;if(f&&e.dom.contains(f.nodeType==1?f:f.parentNode)&&(u=[{node:f,offset:l.anchorOffset}],io(l)||u.push({node:l.focusNode,offset:l.focusOffset})),M.chrome&&e.lastKeyCode===8)for(var p=s;p>i;p--){var d=o.childNodes[p-1],h=d.pmViewDesc;if(d.nodeName=="BR"&&!h){s=p;break}if(!h||h.size)break}var v=e.state.doc,g=e.someProp("domParser")||Bt.fromSchema(e.state.schema),S=v.resolve(a),y=null,I=g.parse(o,{topNode:S.parent,topMatch:S.parent.contentMatchAt(S.index()),topOpen:!0,from:i,to:s,preserveWhitespace:S.parent.type.spec.code?"full":!0,editableContent:!0,findPositions:u,ruleFromNode:vl,context:S});if(u&&u[0].pos!=null){var m=u[0].pos,D=u[1]&&u[1].pos;D==null&&(D=m),y={anchor:m+a,head:D+a}}return{doc:I,sel:y,from:a,to:c}}function vl(e){var t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(M.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||M.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function gl(e,t,r,n,o){if(t<0){var i=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,s=Cs(e,i);if(s&&!e.state.selection.eq(s)){var a=e.state.tr.setSelection(s);i=="pointer"?a.setMeta("pointer",!0):i=="key"&&a.scrollIntoView(),e.dispatch(a)}return}var c=e.state.doc.resolve(t),l=c.sharedDepth(r);t=c.before(l+1),r=e.state.doc.resolve(r).after(l+1);var u=e.state.selection,f=ml(e,t,r);if(M.chrome&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from){var p=e.cursorWrapper.deco.type.toDOM.nextSibling,d=p&&p.nodeValue?p.nodeValue.length:1;f.sel={anchor:f.sel.anchor+d,head:f.sel.anchor+d}}var h=e.state.doc,v=h.slice(f.from,f.to),g,S;e.lastKeyCode===8&&Date.now()-100Date.now()-225||M.android)&&o.some(function(G){return G.nodeName=="DIV"||G.nodeName=="P"})&&e.someProp("handleKeyDown",function(G){return G(e,Ae(13,"Enter"))})){e.lastIOSEnter=0;return}else{if(f.sel){var I=ui(e,e.state.doc,f.sel);I&&!I.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(I))}return}e.domChangeCount++,e.state.selection.frome.state.selection.from&&y.start<=e.state.selection.from+2?y.start=e.state.selection.from:y.endA=e.state.selection.to-2&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),M.ie&&M.ie_version<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)=="  "&&(y.start--,y.endA--,y.endB--);var m=f.doc.resolveNoCache(y.start-f.from),D=f.doc.resolveNoCache(y.endB-f.from),C=m.sameParent(D)&&m.parent.inlineContent,L;if((M.ios&&e.lastIOSEnter>Date.now()-225&&(!C||o.some(function(G){return G.nodeName=="DIV"||G.nodeName=="P"}))||!C&&m.posy.start&&bl(h,y.start,y.endA,m,D)&&e.someProp("handleKeyDown",function(G){return G(e,Ae(8,"Backspace"))})){M.android&&M.chrome&&e.domObserver.suppressSelectionUpdates();return}M.chrome&&M.android&&y.toB==y.from&&(e.lastAndroidDelete=Date.now()),M.android&&!C&&m.start()!=D.start()&&D.parentOffset==0&&m.depth==D.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,D=f.doc.resolveNoCache(y.endB-f.from),setTimeout(function(){e.someProp("handleKeyDown",function(G){return G(e,Ae(13,"Enter"))})},20));var q=y.start,$=y.endA,w,Gt,et,lt;if(C){if(m.pos==D.pos)M.ie&&M.ie_version<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return ue(e)},20)),w=e.state.tr.delete(q,$),Gt=h.resolve(y.start).marksAcross(h.resolve(y.endA));else if(y.endA==y.endB&&(lt=h.resolve(y.start))&&(et=yl(m.parent.content.cut(m.parentOffset,D.parentOffset),lt.parent.content.cut(lt.parentOffset,y.endA-lt.start()))))w=e.state.tr,et.type=="add"?w.addMark(q,$,et.mark):w.removeMark(q,$,et.mark);else if(m.parent.child(m.index()).isText&&m.index()==D.index()-(D.textOffset?0:1)){var Ht=m.parent.textBetween(m.parentOffset,D.parentOffset);if(e.someProp("handleTextInput",function(G){return G(e,q,$,Ht)}))return;w=e.state.tr.insertText(Ht,q,$)}}if(w||(w=e.state.tr.replace(q,$,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){var U=ui(e,w.doc,f.sel);U&&!(M.chrome&&M.android&&e.composing&&U.empty&&(y.start!=y.endB||e.lastAndroidDeletet.content.size?null:co(e,t.resolve(r.anchor),t.resolve(r.head))}function yl(e,t){for(var r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,c,l=0;lr||mn(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r)for(var i=e.node(n).maybeChild(e.indexAfter(n));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function kl(e,t,r,n,o){var i=e.findDiffStart(t,r);if(i==null)return null;var s=e.findDiffEnd(t,r+e.size,r+t.size),a=s.a,c=s.b;if(o=="end"){var l=Math.max(0,i-Math.min(a,c));n-=a+l-i}if(a=a?i-n:0;i-=u,c=i+(c-a),a=i}else if(c=c?i-n:0;i-=f,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}function As(e,t){for(var r=[],n=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;var s=n.firstChild;r.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),n=s.content}var a=e.someProp("clipboardSerializer")||st.fromSchema(e.state.schema),c=Rs(),l=c.createElement("div");l.appendChild(a.serializeFragment(n,{document:c}));for(var u=l.firstChild,f;u&&u.nodeType==1&&(f=Is[u.nodeName.toLowerCase()]);){for(var p=f.length-1;p>=0;p--){for(var d=c.createElement(f[p]);l.firstChild;)d.appendChild(l.firstChild);l.appendChild(d),f[p]!="tbody"&&(o++,i++)}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(r));var h=e.someProp("clipboardTextSerializer",function(v){return v(t)})||t.content.textBetween(0,t.content.size,` + +`);return{dom:l,text:h}}function _s(e,t,r,n,o){var i,s=o.parent.type.spec.code,a;if(!r&&!t)return null;var c=t&&(n||s||!r);if(c){if(e.someProp("transformPastedText",function(S){t=S(t,s||n)}),s)return new x(k.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0);var l=e.someProp("clipboardTextParser",function(S){return S(t,o,n)});if(l)a=l;else{var u=o.marks(),f=e.state,p=f.schema,d=st.fromSchema(p);i=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach(function(S){i.appendChild(document.createElement("p")).appendChild(d.serializeNode(p.text(S,u)))})}}else e.someProp("transformPastedHTML",function(S){r=S(r)}),i=xl(r),M.webkit&&Cl(i);var h=i&&i.querySelector("[data-pm-slice]"),v=h&&/^(\d+) (\d+) (.*)/.exec(h.getAttribute("data-pm-slice"));if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||Bt.fromSchema(e.state.schema);a=g.parseSlice(i,{preserveWhitespace:!!(c||v),context:o})}return v?a=Ol(Ml(a,+v[1],+v[2]),v[3]):a=x.maxOpen(Sl(a.content,o),!1),e.someProp("transformPasted",function(S){a=S(a)}),a}function Sl(e,t){if(e.childCount<2)return e;for(var r=function(i){var s=t.node(i),a=s.contentMatchAt(t.index(i)),c=void 0,l=[];if(e.forEach(function(u){if(l){var f=a.findWrapping(u.type),p;if(!f)return l=null;if(p=l.length&&c.length&&Es(f,c,u,l[l.length-1],0))l[l.length-1]=p;else{l.length&&(l[l.length-1]=Ds(l[l.length-1],c.length));var d=Ns(u,f);l.push(d),a=a.matchType(d.type,d.attrs),c=f}}}),l)return{v:k.from(l)}},n=t.depth;n>=0;n--){var o=r(n);if(o)return o.v}return e}function Ns(e,t,r){r===void 0&&(r=0);for(var n=t.length-1;n>=r;n--)e=t[n].create(null,k.from(e));return e}function Es(e,t,r,n,o){if(o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(k.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Ml(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var r=Rs().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&Is[n[1].toLowerCase()])&&(e=o.map(function(s){return"<"+s+">"}).join("")+e+o.map(function(s){return""}).reverse().join("")),r.innerHTML=e,o)for(var i=0;i=0;a-=2){var c=r.nodes[n[a]];if(!c||c.hasRequiredAttrs())break;o=k.from(c.create(n[a+1],o)),i++,s++}return new x(o,i,s)}var wl={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},uo=M.ie&&M.ie_version<=11,fo=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};fo.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset};fo.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var At=function(t,r){var n=this;this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var i=0;is.target.nodeValue.length})?n.flushSoon():n.flush()}),this.currentSelection=new fo,uo&&(this.onCharData=function(o){n.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};At.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){t.flushingSoon=-1,t.flush()},20))};At.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())};At.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,wl),uo&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()};At.prototype.stop=function(){var t=this;if(this.observer){var r=this.observer.takeRecords();if(r.length){for(var n=0;n-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var r=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&lo(this.view)&&!this.ignoreSelectionChange(r),o=-1,i=-1,s=!1,a=[];if(this.view.editable)for(var c=0;c1){var u=a.filter(function(d){return d.nodeName=="BR"});if(u.length==2){var f=u[0],p=u[1];f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}}(o>-1||n)&&(o>-1&&(this.view.docView.markDirty(o,i),Tl(this.view)),this.handleDOMChange(o,i,s,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(r)||ue(this.view),this.currentSelection.set(r))}};At.prototype.registerMutation=function(t,r){if(r.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(var o=0;oi.depth?u(e,r,i.nodeAfter,i.before(l),o,!0):u(e,r,i.node(l),i.before(l),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function Ee(e,t,r){e.focused||e.focus();var n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function Il(e,t){if(t==-1)return!1;var r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&N.isSelectable(n)?(Ee(e,new N(r),"pointer"),!0):!1}function Rl(e,t){if(t==-1)return!1;var r=e.state.selection,n,o;r instanceof N&&(n=r.node);for(var i=e.state.doc.resolve(t),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(N.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(Ee(e,N.create(e.state.doc,o),"pointer"),!0):!1}function Pl(e,t,r,n,o){return mo(e,"handleClickOn",t,r,n)||e.someProp("handleClick",function(i){return i(e,t,n)})||(o?Rl(e,r):Il(e,r))}function zl(e,t,r,n){return mo(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",function(o){return o(e,t,n)})}function Bl(e,t,r,n){return mo(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",function(o){return o(e,t,n)})||Ll(e,r,n)}function Ll(e,t,r){if(r.button!=0)return!1;var n=e.state.doc;if(t==-1)return n.inlineContent?(Ee(e,H.create(n,0,n.content.size),"pointer"),!0):!1;for(var o=n.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Ee(e,H.create(n,a+1,a+1+s.content.size),"pointer");else if(N.isSelectable(s))Ee(e,N.create(n,a),"pointer");else continue;return!0}}function vo(e){return _r(e)}var Ps=M.mac?"metaKey":"ctrlKey";xt.mousedown=function(e,t){e.shiftKey=t.shiftKey;var r=vo(e),n=Date.now(),o="singleClick";n-e.lastClick.time<500&&Dl(t,e.lastClick)&&!t[Ps]&&(e.lastClick.type=="singleClick"?o="doubleClick":e.lastClick.type=="doubleClick"&&(o="tripleClick")),e.lastClick={time:n,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(qr(t));i&&(o=="singleClick"?(e.mouseDown&&e.mouseDown.done(),e.mouseDown=new Jr(e,i,t,r)):(o=="doubleClick"?zl:Bl)(e,i.pos,i.inside,t)?t.preventDefault():be(e,"pointer"))};var Jr=function(t,r,n,o){var i=this;this.view=t,this.startDoc=t.state.doc,this.pos=r,this.event=n,this.flushed=o,this.selectNode=n[Ps],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1;var s,a;if(r.inside>-1)s=t.state.doc.nodeAt(r.inside),a=r.inside;else{var c=t.state.doc.resolve(r.pos);s=c.parent,a=c.depth?c.before():0}this.mightDrag=null;var l=o?null:n.target,u=l?t.docView.nearestDesc(l,!0):null;this.target=u?u.dom:null;var f=t.state,p=f.selection;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||p instanceof N&&p.from<=a&&p.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&M.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){i.view.mouseDown==i&&i.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),be(t,"pointer")};Jr.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return ue(t.view)}),this.view.mouseDown=null};Jr.prototype.up=function(t){if(this.done(),!!this.view.dom.contains(t.target.nodeType==3?t.target.parentNode:t.target)){var r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(qr(t))),this.allowDefault||!r?be(this.view,"pointer"):Pl(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||M.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||M.chrome&&!(this.view.state.selection instanceof H)&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Ee(this.view,E.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):be(this.view,"pointer")}};Jr.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),be(this.view,"pointer"),t.buttons==0&&this.done()};xt.touchdown=function(e){vo(e),be(e,"pointer")};xt.contextmenu=function(e){return vo(e)};function zs(e,t){return e.composing?!0:M.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500?(e.compositionEndedAt=-2e8,!0):!1}var Fl=M.android?5e3:-1;bt.compositionstart=bt.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(function(a){return a.type.spec.inclusive===!1})))e.markCursor=e.state.storedMarks||r.marks(),_r(e,!0),e.markCursor=null;else if(_r(e),M.gecko&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length)for(var n=e.root.getSelection(),o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){n.collapse(s,s.nodeValue.length);break}else o=s,i=-1}e.composing=!0}Bs(e,Fl)};bt.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,Bs(e,20))};function Bs(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return _r(e)},t))}function Ls(e){for(e.composing&&(e.composing=!1,e.compositionEndedAt=Vl());e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function Vl(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function _r(e,t){if(e.domObserver.forceFlush(),Ls(e),t||e.docView.dirty){var r=Cs(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}function Hl(e,t){if(e.dom.parentNode){var r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";var n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(function(){r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}}var Ie=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;xt.copy=bt.cut=function(e,t){var r=e.state.selection,n=t.type=="cut";if(!r.empty){var o=Ie?null:t.clipboardData,i=r.content(),s=As(e,i),a=s.dom,c=s.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",c)):Hl(e,a),n&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}};function jl(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function ql(e,t){if(e.dom.parentNode){var r=e.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(function(){e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Fn(e,n.value,null,t):Fn(e,n.textContent,n.innerHTML,t)},50)}}function Fn(e,t,r,n){var o=_s(e,t,r,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",function(a){return a(e,n,o||x.empty)}))return!0;if(!o)return!1;var i=jl(o),s=i?e.state.tr.replaceSelectionWith(i,e.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}bt.paste=function(e,t){var r=Ie?null:t.clipboardData;r&&Fn(e,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():ql(e,t)};var Jl=function(t,r){this.slice=t,this.move=r},Fs=M.mac?"altKey":"ctrlKey";xt.dragstart=function(e,t){var r=e.mouseDown;if(r&&r.done(),!!t.dataTransfer){var n=e.state.selection,o=n.empty?null:e.posAtCoords(qr(t));if(!(o&&o.pos>=n.from&&o.pos<=(n instanceof N?n.to-1:n.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(N.create(e.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){var i=e.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=e.docView&&e.dispatch(e.state.tr.setSelection(N.create(e.state.doc,i.posBefore)))}}var s=e.state.selection.content(),a=As(e,s),c=a.dom,l=a.text;t.dataTransfer.clearData(),t.dataTransfer.setData(Ie?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ie||t.dataTransfer.setData("text/plain",l),e.dragging=new Jl(s,!t[Fs])}};xt.dragend=function(e){var t=e.dragging;window.setTimeout(function(){e.dragging==t&&(e.dragging=null)},50)};bt.dragover=bt.dragenter=function(e,t){return t.preventDefault()};bt.drop=function(e,t){var r=e.dragging;if(e.dragging=null,!!t.dataTransfer){var n=e.posAtCoords(qr(t));if(n){var o=e.state.doc.resolve(n.pos);if(o){var i=r&&r.slice;i?e.someProp("transformPasted",function(h){i=h(i)}):i=_s(e,t.dataTransfer.getData(Ie?"Text":"text/plain"),Ie?null:t.dataTransfer.getData("text/html"),!1,o);var s=r&&!t[Fs];if(e.someProp("handleDrop",function(h){return h(e,t,i||x.empty,s)})){t.preventDefault();return}if(i){t.preventDefault();var a=i?rs(e.state.doc,o.pos,i):o.pos;a==null&&(a=o.pos);var c=e.state.tr;s&&c.deleteSelection();var l=c.mapping.map(a),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(l,l,i.content.firstChild):c.replaceRange(l,l,i),!c.doc.eq(f)){var p=c.doc.resolve(l);if(u&&N.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new N(p));else{var d=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(function(h,v,g,S){return d=S}),c.setSelection(co(e,p,c.doc.resolve(d)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}}}}}};xt.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&ue(e)},20))};xt.blur=function(e,t){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.set({}),e.focused=!1)};xt.beforeinput=function(e,t){if(M.chrome&&M.android&&t.inputType=="deleteContentBackward"){var r=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==r&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(i){return i(e,Ae(8,"Backspace"))}))){var n=e.state.selection,o=n.$cursor;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}};for(var di in bt)xt[di]=bt[di];function nr(e,t){if(e==t)return!0;for(var r in e)if(e[r]!==t[r])return!1;for(var n in t)if(!(n in e))return!1;return!0}var or=function(t,r){this.spec=r||Me,this.side=this.spec.side||0,this.toDOM=t};or.prototype.map=function(t,r,n,o){var i=t.mapResult(r.from+o,this.side<0?-1:1),s=i.pos,a=i.deleted;return a?null:new rt(s-n,s-n,this)};or.prototype.valid=function(){return!0};or.prototype.eq=function(t){return this==t||t instanceof or&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&nr(this.spec,t.spec))};var Ft=function(t,r){this.spec=r||Me,this.attrs=t};Ft.prototype.map=function(t,r,n,o){var i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new rt(i,s,this)};Ft.prototype.valid=function(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(var c=0;ct){var l=this.children[c]+1;this.children[c+2].findInner(t-l,r-l,n,o+l,i)}};j.prototype.map=function(t,r,n){return this==at||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Me)};j.prototype.mapInner=function(t,r,n,o,i){for(var s,a=0;aa&&u.to=t){this.children[i]==t&&(n=this.children[i+2]);break}for(var s=t+1,a=s+r.content.size,c=0;cs&&l.type instanceof Ft){var u=Math.max(s,l.from)-s,f=Math.min(a,l.to)-s;uG+i||(et>=a[U]+i?a[U+1]=-1:lt>=o&&(Zt=Ht-lt-(et-Gt))&&(a[U]+=Zt,a[U+1]+=Zt))}},l=0;l=n.content.size){u=!0;continue}var h=r.map(e[f+1]+i,-1),v=h-o,g=n.content.findIndex(d),S=g.index,y=g.offset,I=n.maybeChild(S);if(I&&y==d&&y+I.nodeSize==v){var m=a[f+2].mapInner(r,I,p+1,e[f]+i+1,s);m!=at?(a[f]=d,a[f+1]=v,a[f+2]=m):(a[f+1]=-2,u=!0)}else u=!0}if(u){var D=Kl(a,e,t||[],r,o,i,s),C=Wr(D,n,0,s);t=C.local;for(var L=0;Lr&&s.to0;)t++;e.splice(t,0,r)}function bo(e){var t=[];return e.someProp("decorations",function(r){var n=r(e.state);n&&n!=at&&t.push(n)}),e.cursorWrapper&&t.push(j.create(e.state.doc,[e.cursorWrapper.deco])),Et.from(t)}var Q=function(t,r){this._props=r,this.state=r.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Ws(this),this.markCursor=null,this.cursorWrapper=null,Js(this),this.nodeViews=Ks(this),this.docView=bs(this.state.doc,qs(this),bo(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,Al(this),this.pluginViews=[],this.updatePluginViews()},ko={props:{configurable:!0},root:{configurable:!0}};ko.props.get=function(){if(this._props.state!=this.state){var e=this._props;this._props={};for(var t in e)this._props[t]=e[t];this._props.state=this.state}return this._props};Q.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&po(this),this._props=t,this.updateStateInner(t.state,!0)};Q.prototype.setProps=function(t){var r={};for(var n in this._props)r[n]=this._props[n];r.state=this.state;for(var o in t)r[o]=t[o];this.update(r)};Q.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)};Q.prototype.updateStateInner=function(t,r){var n=this,o=this.state,i=!1,s=!1;if(t.storedMarks&&this.composing&&(Ls(this),s=!0),this.state=t,r){var a=Ks(this);Ul(a,this.nodeViews)&&(this.nodeViews=a,i=!0),po(this)}this.editable=Ws(this),Js(this);var c=bo(this),l=qs(this),u=r?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(t.doc,l,c);(f||!t.selection.eq(o.selection))&&(s=!0);var p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Lc(this);if(s){this.domObserver.stop();var d=f&&(M.ie||M.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&$l(o.selection,t.selection);if(f){var h=M.chrome?this.trackWrites=this.root.getSelection().focusNode:null;(i||!this.docView.update(t.doc,l,c,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=bs(t.doc,l,c,this.dom,this)),h&&!this.trackWrites&&(d=!0)}d||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&fl(this))?ue(this,d):(ws(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),u=="reset")this.dom.scrollTop=0;else if(u=="to selection"){var v=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(g){return g(n)})||(t.selection instanceof N?Xo(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),v):Xo(this,this.coordsAtPos(t.selection.head,1),v))}else p&&Fc(p)};Q.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()};Q.prototype.updatePluginViews=function(t){if(!t||t.plugins!=this.state.plugins){this.destroyPluginViews();for(var r=0;r",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},mi=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Gl=typeof navigator<"u"&&/Apple Computer/.test(navigator.vendor),Yl=typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent),vi=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xl=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ql=mi&&(vi||+mi[1]<57)||Yl&&vi;for(var nt=0;nt<10;nt++)ae[48+nt]=ae[96+nt]=String(nt);for(var nt=1;nt<=24;nt++)ae[nt+111]="F"+nt;for(var nt=65;nt<=90;nt++)ae[nt]=String.fromCharCode(nt+32),Er[nt]=String.fromCharCode(nt);for(var vn in ae)Er.hasOwnProperty(vn)||(Er[vn]=ae[vn]);function Zl(e){var t=Ql&&(e.ctrlKey||e.altKey||e.metaKey)||(Gl||Xl)&&e.shiftKey&&e.key&&e.key.length==1,r=!t&&e.key||(e.shiftKey?Er:ae)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}var tu=typeof navigator<"u"?/Mac/.test(navigator.platform):!1;function eu(e){var t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");for(var n,o,i,s,a=0;a127)&&(s=ae[n.keyCode])&&s!=o){var c=t[gn(s,n,!0)];if(c&&c(r.state,r.dispatch,r))return!0}else if(i&&n.shiftKey){var l=t[gn(o,n,!0)];if(l&&l(r.state,r.dispatch,r))return!0}return!1}}var Kr=function(t,r){this.match=t,this.handler=typeof r=="string"?ou(r):r};function ou(e){return function(t,r,n,o){var i=e;if(r[1]){var s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;var a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}var iu=500;function su(e){var t=e.rules,r=new Rt({state:{init:function(){return null},apply:function(o,i){var s=o.getMeta(this);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput:function(o,i,s,a){return gi(o,i,s,a,t,r)},handleDOMEvents:{compositionend:function(n){setTimeout(function(){var o=n.state.selection,i=o.$cursor;i&&gi(n,i.pos,i.pos,"",t,r)})}}},isInputRules:!0});return r}function gi(e,t,r,n,o,i){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-iu),a.parentOffset,null,"")+n,l=0;l=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1}function So(e,t,r,n){return new Kr(e,function(o,i,s,a){var c=r instanceof Function?r(i):r,l=o.tr.delete(s,a),u=l.doc.resolve(s),f=u.blockRange(),p=f&&Qn(f,t,c);if(!p)return null;l.wrap(f,p);var d=l.doc.resolve(s-1).nodeBefore;return d&&d.type==t&&Zn(l.doc,s-1)&&(!n||n(i,d))&&l.join(s-1),l})}function Vn(e,t,r){return new Kr(e,function(n,o,i,s){var a=n.doc.resolve(i),c=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,c):null})}function cu(e,t){return e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function lu(e,t,r){var n=e.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("backward",e):o.parentOffset>0))return!1;var i=Us(o);if(!i){var s=o.blockRange(),a=s&&Ve(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}var c=i.nodeBefore;if(!c.type.spec.isolating&&Qs(e,i,t))return!0;if(o.parent.content.size==0&&(Re(c,"end")||N.isSelectable(c))){if(t){var l=e.tr.deleteRange(o.before(),o.after());l.setSelection(Re(c,"end")?E.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):N.create(l.doc,i.pos-c.nodeSize)),t(l.scrollIntoView())}return!0}return c.isAtom&&i.depth==o.depth-1?(t&&t(e.tr.delete(i.pos-c.nodeSize,i.pos).scrollIntoView()),!0):!1}function Re(e,t,r){for(;e;e=t=="start"?e.firstChild:e.lastChild){if(e.isTextblock)return!0;if(r&&e.childCount!=1)return!1}return!1}function uu(e,t,r){var n=e.selection,o=n.$head,i=n.empty,s=o;if(!i)return!1;if(o.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):o.parentOffset>0)return!1;s=Us(o)}var a=s&&s.nodeBefore;return!a||!N.isSelectable(a)?!1:(t&&t(e.tr.setSelection(N.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}function Us(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function fu(e,t,r){var n=e.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("forward",e):o.parentOffset=0;t--){var r=e.node(t);if(e.index(t)+11&&n.after()!=n.end(-1)){var o=n.before();if(_e(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),s=i&&Ve(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}function gu(e,t){var r=e.selection,n=r.$from,o=r.to,i,s=n.sharedDepth(o);return s==0?!1:(i=n.before(s),t&&t(e.tr.setSelection(N.create(e.doc,i))),!0)}function yu(e,t){return t&&t(e.tr.setSelection(new le(e.doc))),!0}function bu(e,t,r){var n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Zn(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function Qs(e,t,r){var n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(bu(e,t,r))return!0;var a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){for(var c=t.pos+o.nodeSize,l=k.empty,u=i.length-1;u>=0;u--)l=k.from(i[u].create(null,l));l=k.from(n.copy(l));var f=e.tr.step(new Mt(t.pos-1,c,t.pos,c,new x(l,1,0),i.length,!0)),p=c+2*i.length;Zn(f.doc,p)&&f.join(p),r(f.scrollIntoView())}return!0}var d=E.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),v=h&&Ve(h);if(v!=null&&v>=t.depth)return r&&r(e.tr.lift(h,v).scrollIntoView()),!0;if(a&&Re(o,"start",!0)&&Re(n,"end")){for(var g=n,S=[];S.push(g),!g.isTextblock;)g=g.lastChild;for(var y=o,I=1;!y.isTextblock;y=y.firstChild)I++;if(g.canReplace(g.childCount,g.childCount,y.content)){if(r){for(var m=k.empty,D=S.length-1;D>=0;D--)m=k.from(S[D].copy(m));var C=e.tr.step(new Mt(t.pos-S.length,t.pos+o.nodeSize,t.pos+I,t.pos+o.nodeSize-I,new x(m,S.length,0),0,!0));r(C.scrollIntoView())}return!0}}return!1}function Zs(e,t){return function(r,n){var o=r.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&Qn(a,e,t);return c?(n&&n(r.tr.wrap(a,c).scrollIntoView()),!0):!1}}function ku(e,t){return function(r,n){var o=r.selection,i=o.from,s=o.to,a=!1;return r.doc.nodesBetween(i,s,function(c,l){if(a)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)a=!0;else{var u=r.doc.resolve(l),f=u.index();a=u.parent.canReplaceWith(f,f+1,e)}}),a?(n&&n(r.tr.setBlockType(i,s,e,t).scrollIntoView()),!0):!1}}typeof navigator<"u"?/Mac/.test(navigator.platform):typeof os<"u"&&os.platform()=="darwin";function Su(e,t){return function(r,n){var o=r.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=!1,l=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;var u=r.doc.resolve(a.start-2);l=new Ze(u,u,a.depth),a.endIndex=0;s--)i=k.from(r[s].type.create(r[s].attrs,i));e.step(new Mt(t.start-(n?2:0),t.end,t.start,t.end,new x(i,0,0),r.length,!0));for(var a=0,c=0;ca;s--)i-=o.child(s).nodeSize,n.delete(i-1,i+1);var c=n.doc.resolve(r.start),l=c.nodeAfter,u=r.startIndex==0,f=r.endIndex==o.childCount,p=c.node(-1),d=c.index(-1);if(!p.canReplace(d+(u?0:1),d+1,l.content.append(f?k.empty:k.from(o))))return!1;var h=c.pos,v=h+l.nodeSize;return n.step(new Mt(h-(u?1:0),v+(f?1:0),h+1,v-1,new x((u?k.empty:k.from(o.copy(k.empty))).append(f?k.empty:k.from(o.copy(k.empty))),u?0:1,f?0:1),u?0:1)),t(n.scrollIntoView()),!0}function wu(e){return function(t,r){var n=t.selection,o=n.$from,i=n.$to,s=o.blockRange(i,function(v){return v.childCount&&v.firstChild.type==e});if(!s)return!1;var a=s.startIndex;if(a==0)return!1;var c=s.parent,l=c.child(a-1);if(l.type!=e)return!1;if(r){var u=l.lastChild&&l.lastChild.type==c.type,f=k.from(u?e.create():null),p=new x(k.from(e.create(null,k.from(c.type.create(null,f)))),u?3:1,0),d=s.start,h=s.end;r(t.tr.step(new Mt(d-(u?3:1),h,d,h,p,1,!0)).scrollIntoView())}return!0}}function $r(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function tt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Tu(e,t){const r=tt(t,e.schema),{from:n,to:o}=e.selection;let i=[];e.doc.nodesBetween(n,o,a=>{i=[...i,a]});const s=i.reverse().find(a=>a.type.name===r.name);return s?{...s.attrs}:{}}function fe(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function ta(e,t){const r=fe(t,e.schema),{from:n,to:o,empty:i}=e.selection;let s=[];i?s=e.selection.$head.marks():e.doc.nodesBetween(n,o,c=>{s=[...s,...c.marks]});const a=s.find(c=>c.type.name===r.name);return a?{...a.attrs}:{}}function Au(e,t){const r=$r(typeof t=="string"?t:t.name,e.schema);return r==="node"?Tu(e,t):r==="mark"?ta(e,t):{}}function sr(e,t){const r=Object.keys(t);return r.length?!!r.filter(n=>t[n]===e[n]).length:!0}function Pe(e,t,r={}){const{from:n,to:o,empty:i}=e.selection,s=t?tt(t,e.schema):null;let a=[];if(e.doc.nodesBetween(n,o,(u,f)=>{if(!u.isText){const p=Math.max(n,f),d=Math.min(o,f+u.nodeSize);a=[...a,{node:u,from:p,to:d}]}}),i)return!!a.filter(u=>s?s.name===u.node.type.name:!0).find(u=>sr(u.node.attrs,r));const c=o-n;return a.filter(u=>s?s.name===u.node.type.name:!0).filter(u=>sr(u.node.attrs,r)).reduce((u,f)=>{const p=f.to-f.from;return u+p},0)>=c}function Hn(e,t,r={}){const{from:n,to:o,empty:i}=e.selection,s=t?fe(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>sr(p.attrs,r));let a=0,c=[];if(e.doc.nodesBetween(n,o,(p,d)=>{if(p.isText){const h=Math.max(n,d),v=Math.min(o,d+p.nodeSize),g=v-h;a+=g,c=[...c,...p.marks.map(S=>({mark:S,from:h,to:v}))]}}),a===0)return!1;const l=c.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>sr(p.mark.attrs,r)).reduce((p,d)=>{const h=d.to-d.from;return p+h},0),u=c.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,d)=>{const h=d.to-d.from;return p+h},0);return(l>0?l+u:l)>=a}function _u(e,t,r={}){if(!t)return Pe(e,null,r)||Hn(e,null,r);const n=$r(t,e.schema);return n==="node"?Pe(e,t,r):n==="mark"?Hn(e,t,r):!1}function Nu(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function yi(e){const t=`${e}`;return new window.DOMParser().parseFromString(t,"text/html").body}function Dr(e,t,r){if(r={slice:!0,parseOptions:{},...r},typeof e=="object"&&e!==null)try{return Array.isArray(e)?k.fromArray(e.map(n=>t.nodeFromJSON(n))):t.nodeFromJSON(e)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",n),Dr("",t,r)}if(typeof e=="string"){const n=Bt.fromSchema(t);return r.slice?n.parseSlice(yi(e),r.parseOptions).content:n.parse(yi(e),r.parseOptions)}return Dr("",t,r)}function ea(e,t,r={}){return Dr(e,t,{slice:!1,parseOptions:r})}function Eu(e,t){const r=st.fromSchema(t).serializeFragment(e.content),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(r),o.innerHTML}function Du(e){var t;const r=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),n=e.toJSON();return JSON.stringify(r)===JSON.stringify(n)}function Iu(e){const t=document.querySelector("style[data-tiptap-style]");if(t!==null)return t;const r=document.createElement("style");return r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}class Ru{constructor(t,r){this.editor=t,this.commands=r}createCommands(){const{commands:t,editor:r}=this,{state:n,view:o}=r,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>{const f=c(...u)(s);return i.getMeta("preventDispatch")||o.dispatch(i),f}]))}createChain(t,r=!0){const{commands:n,editor:o}=this,{state:i,view:s}=o,a=[],c=!!t,l=t||i.tr,u=()=>(!c&&r&&!l.getMeta("preventDispatch")&&s.dispatch(l),a.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(n).map(([p,d])=>[p,(...v)=>{const g=this.buildProps(l,r),S=d(...v)(g);return a.push(S),f}])),run:u};return f}createCan(t){const{commands:r,editor:n}=this,{state:o}=n,i=void 0,s=t||o.tr,a=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...f)=>u(...f)({...a,dispatch:i})])),chain:()=>this.createChain(s,i)}}buildProps(t,r=!0){const{editor:n,commands:o}=this,{state:i,view:s}=n;i.storedMarks&&t.setStoredMarks(i.storedMarks);const a={tr:t,editor:n,view:s,state:this.chainableState(t,i),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(o).map(([c,l])=>[c,(...u)=>l(...u)(a)]))}};return a}chainableState(t,r){let{selection:n}=t,{doc:o}=t,{storedMarks:i}=t;return{...r,schema:r.schema,plugins:r.plugins,apply:r.apply.bind(r),applyTransaction:r.applyTransaction.bind(r),reconfigure:r.reconfigure.bind(r),toJSON:r.toJSON.bind(r),get storedMarks(){return i},get selection(){return n},get doc(){return o},get tr(){return n=t.selection,o=t.doc,i=t.storedMarks,t}}}}function A(e,t,r={}){return e.config[t]===void 0&&e.parent?A(e.parent,t,r):typeof e.config[t]=="function"?e.config[t].bind({...r,parent:e.parent?A(e.parent,t,r):null}):e.config[t]}function ar(e){const t=e.filter(o=>o.type==="extension"),r=e.filter(o=>o.type==="node"),n=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:r,markExtensions:n}}function ra(e){const t=[],{nodeExtensions:r,markExtensions:n}=ar(e),o=[...r,...n],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return e.forEach(s=>{const a={name:s.name,options:s.options},c=A(s,"addGlobalAttributes",a);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,d])=>{t.push({type:f,name:p,attribute:{...i,...d}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options},c=A(s,"addAttributes",a);if(!c)return;const l=c();Object.entries(l).forEach(([u,f])=>{t.push({type:s.name,name:u,attribute:{...i,...f}})})}),t}function Ct(...e){return e.filter(t=>!!t).reduce((t,r)=>{const n={...t};return Object.entries(r).forEach(([o,i])=>{if(!n[o]){n[o]=i;return}o==="class"?n[o]=[n[o],i].join(" "):o==="style"?n[o]=[n[o],i].join("; "):n[o]=i}),n},{})}function jn(e,t){return t.filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(e.attrs)||{}:{[r.name]:e.attrs[r.name]}).reduce((r,n)=>Ct(r,n),{})}function Pu(e={}){return Object.keys(e).length===0&&e.constructor===Object}function zu(e){return typeof e!="string"?e:e.match(/^\d*(\.\d+)?$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function bi(e,t){return e.style?e:{...e,getAttrs:r=>{const n=e.getAttrs?e.getAttrs(r):e.attrs;if(n===!1)return!1;const o=t.filter(i=>i.attribute.rendered).reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(r)||{}:{[s.name]:zu(r.getAttribute(s.name))},c=Object.fromEntries(Object.entries(a).filter(([,l])=>l!=null));return{...i,...c}},{});return{...n,...o}}}}function Z(e,t=void 0,...r){return typeof e=="function"?t?e.bind(t)(...r):e(...r):e}function ki(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>t==="attrs"&&Pu(r)?!1:r!=null))}function Bu(e){var t;const r=ra(e),{nodeExtensions:n,markExtensions:o}=ar(e),i=(t=n.find(c=>A(c,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(n.map(c=>{const l=r.filter(v=>v.type===c.name),u={name:c.name,options:c.options},f=e.reduce((v,g)=>{const S=A(g,"extendNodeSchema",u);return{...v,...S?S(c):{}}},{}),p=ki({...f,content:Z(A(c,"content",u)),marks:Z(A(c,"marks",u)),group:Z(A(c,"group",u)),inline:Z(A(c,"inline",u)),atom:Z(A(c,"atom",u)),selectable:Z(A(c,"selectable",u)),draggable:Z(A(c,"draggable",u)),code:Z(A(c,"code",u)),defining:Z(A(c,"defining",u)),isolating:Z(A(c,"isolating",u)),attrs:Object.fromEntries(l.map(v=>{var g;return[v.name,{default:(g=v==null?void 0:v.attribute)===null||g===void 0?void 0:g.default}]}))}),d=Z(A(c,"parseHTML",u));d&&(p.parseDOM=d.map(v=>bi(v,l)));const h=A(c,"renderHTML",u);return h&&(p.toDOM=v=>h({node:v,HTMLAttributes:jn(v,l)})),[c.name,p]})),a=Object.fromEntries(o.map(c=>{const l=r.filter(v=>v.type===c.name),u={name:c.name,options:c.options},f=e.reduce((v,g)=>{const S=A(g,"extendMarkSchema",u);return{...v,...S?S(c):{}}},{}),p=ki({...f,inclusive:Z(A(c,"inclusive",u)),excludes:Z(A(c,"excludes",u)),group:Z(A(c,"group",u)),spanning:Z(A(c,"spanning",u)),attrs:Object.fromEntries(l.map(v=>{var g;return[v.name,{default:(g=v==null?void 0:v.attribute)===null||g===void 0?void 0:g.default}]}))}),d=Z(A(c,"parseHTML",u));d&&(p.parseDOM=d.map(v=>bi(v,l)));const h=A(c,"renderHTML",u);return h&&(p.toDOM=v=>h({mark:v,HTMLAttributes:jn(v,l)})),[c.name,p]}));return new Se({topNode:i,nodes:s,marks:a})}function yn(e,t){return t.nodes[e]?t.nodes[e]:t.marks[e]?t.marks[e]:null}class Xe{constructor(t,r){this.splittableMarks=[],this.editor=r,this.extensions=Xe.resolve(t),this.schema=Bu(this.extensions),this.extensions.forEach(n=>{var o;const i={name:n.name,options:n.options,editor:this.editor,type:yn(n.name,this.schema)};n.type==="mark"&&(!((o=Z(A(n,"keepOnSplit",i)))!==null&&o!==void 0)||o)&&this.splittableMarks.push(n.name);const s=A(n,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const a=A(n,"onCreate",i);a&&this.editor.on("create",a);const c=A(n,"onUpdate",i);c&&this.editor.on("update",c);const l=A(n,"onSelectionUpdate",i);l&&this.editor.on("selectionUpdate",l);const u=A(n,"onTransaction",i);u&&this.editor.on("transaction",u);const f=A(n,"onFocus",i);f&&this.editor.on("focus",f);const p=A(n,"onBlur",i);p&&this.editor.on("blur",p);const d=A(n,"onDestroy",i);d&&this.editor.on("destroy",d)})}static resolve(t){return Xe.sort(Xe.flatten(t))}static flatten(t){return t.map(r=>{const n={name:r.name,options:r.options},o=A(r,"addExtensions",n);return o?[r,...this.flatten(o())]:r}).flat(10)}static sort(t){return t.sort((n,o)=>{const i=A(n,"priority")||100,s=A(o,"priority")||100;return i>s?-1:i{const n={name:r.name,options:r.options,editor:this.editor,type:yn(r.name,this.schema)},o=A(r,"addCommands",n);return o?{...t,...o()}:t},{})}get plugins(){return[...this.extensions].reverse().map(t=>{const r={name:t.name,options:t.options,editor:this.editor,type:yn(t.name,this.schema)},n=[],o=A(t,"addKeyboardShortcuts",r);if(o){const c=Object.fromEntries(Object.entries(o()).map(([u,f])=>[u,()=>f({editor:this.editor})])),l=nu(c);n.push(l)}const i=A(t,"addInputRules",r);if(this.editor.options.enableInputRules&&i){const c=i(),l=c.length?[su({rules:c})]:[];n.push(...l)}const s=A(t,"addPasteRules",r);if(this.editor.options.enablePasteRules&&s){const c=s();n.push(...c)}const a=A(t,"addProseMirrorPlugins",r);if(a){const c=a();n.push(...c)}return n}).flat()}get attributes(){return ra(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:r}=ar(this.extensions);return Object.fromEntries(r.filter(n=>!!A(n,"addNodeView")).map(n=>{const o=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,editor:t,type:tt(n.name,this.schema)},s=A(n,"addNodeView",i);if(!s)return[];const a=(c,l,u,f)=>{const p=jn(c,o);return s()({editor:t,node:c,getPos:u,decorations:f,HTMLAttributes:p,extension:n})};return[n.name,a]}))}get textSerializers(){const{editor:t}=this,{nodeExtensions:r}=ar(this.extensions);return Object.fromEntries(r.filter(n=>!!A(n,"renderText")).map(n=>{const o={name:n.name,options:n.options,editor:t,type:tt(n.name,this.schema)},i=A(n,"renderText",o);if(!i)return[];const s=a=>i(a);return[n.name,s]}))}}class Lu{constructor(){this.callbacks={}}on(t,r){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(r),this}emit(t,...r){const n=this.callbacks[t];return n&&n.forEach(o=>o.apply(this,r)),this}off(t,r){const n=this.callbacks[t];return n&&(r?this.callbacks[t]=n.filter(o=>o!==r):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function Fu(e){return Object.prototype.toString.call(e).slice(8,-1)}function bn(e){return Fu(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Ur(e,t){const r={...e};return bn(e)&&bn(t)&&Object.keys(t).forEach(n=>{bn(t[n])?n in e?r[n]=Ur(e[n],t[n]):Object.assign(r,{[n]:t[n]}):Object.assign(r,{[n]:t[n]})}),r}class kt{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new kt(t)}configure(t={}){const r=this.extend();return r.options=Ur(this.options,t),r}extend(t={}){const r=new kt(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}const Vu=(e,t,r,n,o)=>{let i="",s=!0;return e.state.doc.nodesBetween(t,r,(a,c)=>{var l;const u=e.extensionManager.textSerializers[a.type.name];u?(i+=u({node:a}),s=!n):a.isText?(i+=(l=a==null?void 0:a.text)===null||l===void 0?void 0:l.slice(Math.max(t,c)-c,r-c),s=!n):a.isLeaf&&o?(i+=o,s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i},Hu=kt.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new Kt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{from:t,to:r}=e.state.selection;return Vu(e,t,r,` +`)}}})]}}),ju=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{e.isDestroyed||t.dom.blur()}),!0);var qu=Object.freeze({__proto__:null,blur:ju});const Ju=(e=!1)=>({commands:t})=>t.setContent("",e);var Wu=Object.freeze({__proto__:null,clearContent:Ju});const Ku=()=>({state:e,tr:t,dispatch:r})=>{const{selection:n}=t,{ranges:o}=n;return o.forEach(i=>{e.doc.nodesBetween(i.$from.pos,i.$to.pos,(s,a)=>{if(s.type.isText)return;const c=t.doc.resolve(t.mapping.map(a)),l=t.doc.resolve(t.mapping.map(a+s.nodeSize)),u=c.blockRange(l);if(!u)return;const f=Ve(u);if(s.type.isTextblock&&r){const{defaultType:p}=c.parent.contentMatchAt(c.index());t.setNodeMarkup(u.start,p)}(f||f===0)&&r&&t.lift(u,f)})}),!0};var $u=Object.freeze({__proto__:null,clearNodes:Ku});const Uu=e=>t=>e(t);var Gu=Object.freeze({__proto__:null,command:Uu});const Yu=()=>({state:e,dispatch:t})=>mu(e,t);var Xu=Object.freeze({__proto__:null,createParagraphNear:Yu});const Qu=e=>({tr:t,state:r,dispatch:n})=>{const o=tt(e,r.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(n){const c=i.before(s),l=i.after(s);t.delete(c,l).scrollIntoView()}return!0}return!1};var Zu=Object.freeze({__proto__:null,deleteNode:Qu});const tf=e=>({tr:t,dispatch:r})=>{const{from:n,to:o}=e;return r&&t.delete(n,o),!0};var ef=Object.freeze({__proto__:null,deleteRange:tf});const rf=()=>({state:e,dispatch:t})=>cu(e,t);var nf=Object.freeze({__proto__:null,deleteSelection:rf});const of=()=>({commands:e})=>e.keyboardShortcut("Enter");var sf=Object.freeze({__proto__:null,enter:of});const af=()=>({state:e,dispatch:t})=>hu(e,t);var cf=Object.freeze({__proto__:null,exitCode:af});function qn(e,t,r={}){return e.find(n=>n.type===t&&sr(n.attrs,r))}function lf(e,t,r={}){return!!qn(e,t,r)}function na(e,t,r={}){if(!e||!t)return;const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=qn(n.node.marks,t,r);if(!o)return;let i=e.index(),s=e.start()+n.offset,a=i+1,c=s+n.node.nodeSize;for(qn(n.node.marks,t,r);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a({tr:r,state:n,dispatch:o})=>{const i=fe(e,n.schema),{doc:s,selection:a}=r,{$from:c,from:l,to:u}=a;if(o){const f=na(c,i,t);if(f&&f.from<=l&&f.to>=u){const p=H.create(s,f.from,f.to);r.setSelection(p)}}return!0};var ff=Object.freeze({__proto__:null,extendMarkRange:uf});const pf=e=>t=>{const r=typeof e=="function"?e(t):e;for(let n=0;n({editor:t,view:r,tr:n,dispatch:o})=>{const i=()=>{requestAnimationFrame(()=>{t.isDestroyed||r.focus()})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!ia(t.state.selection))return i(),!0;const{from:s,to:a}=mf(t.state,e)||t.state.selection,{doc:c,storedMarks:l}=n,u=E.atStart(c).from,f=E.atEnd(c).to,p=cr(s,u,f),d=cr(a,u,f),h=H.create(c,p,d),v=t.state.selection.eq(h);return o&&(v||n.setSelection(h),v&&l&&n.setStoredMarks(l),i()),!0};var gf=Object.freeze({__proto__:null,focus:vf});const yf=(e,t)=>r=>e.every((n,o)=>t(n,{...r,index:o}));var bf=Object.freeze({__proto__:null,forEach:yf});const kf=(e,t)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},e,t);var Sf=Object.freeze({__proto__:null,insertContent:kf});function Mf(e,t,r){const n=e.steps.length-1;if(n{s===0&&(s=u)}),e.setSelection(E.near(e.doc.resolve(s),r))}const xf=(e,t,r)=>({tr:n,dispatch:o,editor:i})=>{if(o){const s=Dr(t,i.schema,{parseOptions:{preserveWhitespace:"full"},...r||{}});if(s.toString()==="<>")return!0;const{from:a,to:c}=typeof e=="number"?{from:e,to:e}:e;n.replaceWith(a,c,s),Mf(n,n.steps.length-1,1)}return!0};var Cf=Object.freeze({__proto__:null,insertContentAt:xf});const Of=()=>({state:e,dispatch:t})=>lu(e,t);var wf=Object.freeze({__proto__:null,joinBackward:Of});const Tf=()=>({state:e,dispatch:t})=>fu(e,t);var Af=Object.freeze({__proto__:null,joinForward:Tf});const _f=typeof navigator<"u"?/Mac/.test(navigator.platform):!1;function Nf(e){const t=e.split(/-(?!$)/);let r=t[t.length-1];r==="Space"&&(r=" ");let n,o,i,s;for(let a=0;a({editor:t,view:r,tr:n,dispatch:o})=>{const i=Nf(e).split(/-(?!$)/),s=i.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{r.someProp("handleKeyDown",l=>l(r,a))});return c==null||c.steps.forEach(l=>{const u=l.map(n.mapping);u&&o&&n.maybeStep(u)}),!0};var Df=Object.freeze({__proto__:null,keyboardShortcut:Ef});const If=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Pe(r,o,t)?Ys(r,n):!1};var Rf=Object.freeze({__proto__:null,lift:If});const Pf=()=>({state:e,dispatch:t})=>vu(e,t);var zf=Object.freeze({__proto__:null,liftEmptyBlock:Pf});const Bf=e=>({state:t,dispatch:r})=>{const n=tt(e,t.schema);return xu(n)(t,r)};var Lf=Object.freeze({__proto__:null,liftListItem:Bf});const Ff=()=>({state:e,dispatch:t})=>du(e,t);var Vf=Object.freeze({__proto__:null,newlineInCode:Ff});function Si(e,t){const r=typeof t=="string"?[t]:t;return Object.keys(e).reduce((n,o)=>(r.includes(o)||(n[o]=e[o]),n),{})}const Hf=(e,t)=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null;const a=$r(typeof e=="string"?e:e.name,n.schema);return a?(a==="node"&&(i=tt(e,n.schema)),a==="mark"&&(s=fe(e,n.schema)),o&&r.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(l,u)=>{i&&i===l.type&&r.setNodeMarkup(u,void 0,Si(l.attrs,t)),s&&l.marks.length&&l.marks.forEach(f=>{s===f.type&&r.addMark(u,u+l.nodeSize,s.create(Si(f.attrs,t)))})})}),!0):!1};var jf=Object.freeze({__proto__:null,resetAttributes:Hf});const qf=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0);var Jf=Object.freeze({__proto__:null,scrollIntoView:qf});const Wf=()=>({state:e,dispatch:t})=>yu(e,t);var Kf=Object.freeze({__proto__:null,selectAll:Wf});const $f=()=>({state:e,dispatch:t})=>uu(e,t);var Uf=Object.freeze({__proto__:null,selectNodeBackward:$f});const Gf=()=>({state:e,dispatch:t})=>pu(e,t);var Yf=Object.freeze({__proto__:null,selectNodeForward:Gf});const Xf=()=>({state:e,dispatch:t})=>gu(e,t);var Qf=Object.freeze({__proto__:null,selectParentNode:Xf});const Zf=(e,t=!1,r={})=>({tr:n,editor:o,dispatch:i})=>{const{doc:s}=n,a=ea(e,o.schema,r),c=H.create(s,0,s.content.size);return i&&n.setSelection(c).replaceSelectionWith(a,!1).setMeta("preventUpdate",!t),!0};var tp=Object.freeze({__proto__:null,setContent:Zf});const ep=(e,t={})=>({tr:r,state:n,dispatch:o})=>{const{selection:i}=r,{empty:s,ranges:a}=i,c=fe(e,n.schema);if(o)if(s){const l=ta(n,c);r.addStoredMark(c.create({...l,...t}))}else a.forEach(l=>{const u=l.$from.pos,f=l.$to.pos;n.doc.nodesBetween(u,f,(p,d)=>{const h=Math.max(d,u),v=Math.min(d+p.nodeSize,f);p.marks.find(S=>S.type===c)?p.marks.forEach(S=>{c===S.type&&r.addMark(h,v,c.create({...S.attrs,...t}))}):r.addMark(h,v,c.create(t))})});return!0};var rp=Object.freeze({__proto__:null,setMark:ep});const np=(e,t)=>({tr:r})=>(r.setMeta(e,t),!0);var op=Object.freeze({__proto__:null,setMeta:np});const ip=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return ku(o,t)(r,n)};var sp=Object.freeze({__proto__:null,setNode:ip});const ap=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,o=E.atStart(n).from,i=E.atEnd(n).to,s=cr(e,o,i),a=N.create(n,s);t.setSelection(a)}return!0};var cp=Object.freeze({__proto__:null,setNodeSelection:ap});const lp=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,{from:o,to:i}=typeof e=="number"?{from:e,to:e}:e,s=E.atStart(n).from,a=E.atEnd(n).to,c=cr(o,s,a),l=cr(i,s,a),u=H.create(n,c,l);t.setSelection(u)}return!0};var up=Object.freeze({__proto__:null,setTextSelection:lp});const fp=e=>({state:t,dispatch:r})=>{const n=tt(e,t.schema);return wu(n)(t,r)};var pp=Object.freeze({__proto__:null,sinkListItem:fp});function Mr(e,t,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const o=e.find(i=>i.type===t&&i.name===n);return o?o.attribute.keepOnSplit:!1}))}function dp(e){for(let t=0;tt==null?void 0:t.includes(o.type.name));e.tr.ensureMarks(n)}}const hp=({keepMarks:e=!0}={})=>({tr:t,state:r,dispatch:n,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:c}=i,l=o.extensionManager.attributes,u=Mr(l,a.node().type.name,a.node().attrs);if(i instanceof N&&i.node.isBlock)return!a.parentOffset||!_e(s,a.pos)?!1:(n&&(e&&Mi(r,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(n){const f=c.parentOffset===c.parent.content.size;i instanceof H&&t.deleteSelection();const p=a.depth===0?void 0:dp(a.node(-1).contentMatchAt(a.indexAfter(-1)));let d=f&&p?[{type:p,attrs:u}]:void 0,h=_e(t.doc,t.mapping.map(a.pos),1,d);if(!d&&!h&&_e(t.doc,t.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(h=!0,d=p?[{type:p,attrs:u}]:void 0),h&&(t.split(t.mapping.map(a.pos),1,d),p&&!f&&!a.parentOffset&&a.parent.type!==p)){const v=t.mapping.map(a.before()),g=t.doc.resolve(v);a.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&t.setNodeMarkup(t.mapping.map(a.before()),p)}e&&Mi(r,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0};var mp=Object.freeze({__proto__:null,splitBlock:hp});const vp=e=>({tr:t,state:r,dispatch:n,editor:o})=>{var i;const s=tt(e,r.schema),{$from:a,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||a.depth<2||!a.sameParent(c))return!1;const u=a.node(-1);if(u.type!==s)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(n){let g=k.empty;const S=a.index(-1)?1:a.index(-2)?2:3;for(let L=a.depth-S;L>=a.depth-3;L-=1)g=k.from(a.node(L).copy(g));const y=a.indexAfter(-1){if(C>-1)return!1;L.isTextblock&&L.content.size===0&&(C=q+1)}),C>-1&&t.setSelection(H.near(t.doc.resolve(C))),t.scrollIntoView()}return!0}const p=c.pos===a.end()?u.contentMatchAt(0).defaultType:null,d=Mr(f,u.type.name,u.attrs),h=Mr(f,a.node().type.name,a.node().attrs);t.delete(a.pos,c.pos);const v=p?[{type:s,attrs:d},{type:p,attrs:h}]:[{type:s,attrs:d}];return _e(t.doc,a.pos,2)?(n&&t.split(a.pos,2,v).scrollIntoView(),!0):!1};var gp=Object.freeze({__proto__:null,splitListItem:vp});function yp(e,t){for(let r=e.depth;r>0;r-=1){const n=e.node(r);if(t(n))return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:n}}}function bp(e){return t=>yp(t.$from,e)}function xi(e,t){const{nodeExtensions:r}=ar(t),n=r.find(s=>s.name===e);if(!n)return!1;const o={name:n.name,options:n.options},i=Z(A(n,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}const kp=(e,t)=>({editor:r,tr:n,state:o,dispatch:i,chain:s,commands:a,can:c})=>{const{extensions:l}=r.extensionManager,u=tt(e,o.schema),f=tt(t,o.schema),{selection:p}=o,{$from:d,$to:h}=p,v=d.blockRange(h);if(!v)return!1;const g=bp(y=>xi(y.type.name,l))(p);if(v.depth>=1&&g&&v.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(f);if(xi(g.node.type.name,l)&&u.validContent(g.node.content)&&i)return n.setNodeMarkup(g.pos,u),!0}return c().wrapInList(u)?a.wrapInList(u):s().clearNodes().wrapInList(u).run()};var Sp=Object.freeze({__proto__:null,toggleList:kp});const Mp=(e,t={})=>({state:r,commands:n})=>{const o=fe(e,r.schema);return Hn(r,o,t)?n.unsetMark(o):n.setMark(o,t)};var xp=Object.freeze({__proto__:null,toggleMark:Mp});const Cp=(e,t,r={})=>({state:n,commands:o})=>{const i=tt(e,n.schema),s=tt(t,n.schema);return Pe(n,i,r)?o.setNode(s):o.setNode(i,r)};var Op=Object.freeze({__proto__:null,toggleNode:Cp});const wp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Pe(r,o,t)?Ys(r,n):Zs(o,t)(r,n)};var Tp=Object.freeze({__proto__:null,toggleWrap:wp});const Ap=()=>({state:e,dispatch:t})=>au(e,t);var _p=Object.freeze({__proto__:null,undoInputRule:Ap});const Np=()=>({tr:e,state:t,dispatch:r})=>{const{selection:n}=e,{empty:o,ranges:i}=n;return o||r&&Object.entries(t.schema.marks).forEach(([,s])=>{i.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos,s)})}),!0};var Ep=Object.freeze({__proto__:null,unsetAllMarks:Np});const Dp=e=>({tr:t,state:r,dispatch:n})=>{const{selection:o}=t,i=fe(e,r.schema),{$from:s,empty:a,ranges:c}=o;if(n){if(a){let{from:l,to:u}=o;const f=na(s,i);f&&(l=f.from,u=f.to),t.removeMark(l,u,i)}else c.forEach(l=>{t.removeMark(l.$from.pos,l.$to.pos,i)});t.removeStoredMark(i)}return!0};var Ip=Object.freeze({__proto__:null,unsetMark:Dp});const Rp=(e,t={})=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null;const a=$r(typeof e=="string"?e:e.name,n.schema);return a?(a==="node"&&(i=tt(e,n.schema)),a==="mark"&&(s=fe(e,n.schema)),o&&r.selection.ranges.forEach(c=>{const l=c.$from.pos,u=c.$to.pos;n.doc.nodesBetween(l,u,(f,p)=>{i&&i===f.type&&r.setNodeMarkup(p,void 0,{...f.attrs,...t}),s&&f.marks.length&&f.marks.forEach(d=>{if(s===d.type){const h=Math.max(p,l),v=Math.min(p+f.nodeSize,u);r.addMark(h,v,s.create({...d.attrs,...t}))}})})}),!0):!1};var Pp=Object.freeze({__proto__:null,updateAttributes:Rp});const zp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Pe(r,o,t)?!1:Zs(o,t)(r,n)};var Bp=Object.freeze({__proto__:null,wrapIn:zp});const Lp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Su(o,t)(r,n)};var Fp=Object.freeze({__proto__:null,wrapInList:Lp});const Vp=kt.create({name:"commands",addCommands(){return{...qu,...Wu,...$u,...Gu,...Xu,...Zu,...ef,...nf,...sf,...cf,...ff,...df,...gf,...bf,...Sf,...Cf,...wf,...Af,...Df,...Rf,...zf,...Lf,...Vf,...jf,...Jf,...Kf,...Uf,...Yf,...Qf,...tp,...rp,...op,...sp,...cp,...up,...pp,...mp,...gp,...Sp,...xp,...Op,...Tp,..._p,...Ep,...Ip,...Pp,...Bp,...Fp}}}),Hp=kt.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new Kt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),jp=kt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Rt({key:new Kt("focusEvents"),props:{attributes:{tabindex:"0"},handleDOMEvents:{focus:(t,r)=>{e.isFocused=!0;const n=e.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1},blur:(t,r)=>{e.isFocused=!1;const n=e.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1}}}})]}}),qp=kt.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.deleteSelection(),()=>r.joinBackward(),()=>r.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:r})=>[()=>r.deleteSelection(),()=>r.joinForward(),()=>r.selectNodeForward()]);return{Enter:()=>this.editor.commands.first(({commands:r})=>[()=>r.newlineInCode(),()=>r.createParagraphNear(),()=>r.liftEmptyBlock(),()=>r.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:()=>e(),"Mod-Backspace":()=>e(),Delete:()=>t(),"Mod-Delete":()=>t()}}});var Jp=Object.freeze({__proto__:null,ClipboardTextSerializer:Hu,Commands:Vp,Editable:Hp,FocusEvents:jp,Keymap:qp});const Wp=`.ProseMirror { + position: relative; +} + +.ProseMirror { + word-wrap: break-word; + white-space: pre-wrap; + -webkit-font-variant-ligatures: none; + font-variant-ligatures: none; +} + +.ProseMirror [contenteditable="false"] { + white-space: normal; +} + +.ProseMirror [contenteditable="false"] [contenteditable="true"] { + white-space: pre-wrap; +} + +.ProseMirror pre { + white-space: pre-wrap; +} + +.ProseMirror-gapcursor { + display: none; + pointer-events: none; + position: absolute; +} + +.ProseMirror-gapcursor:after { + content: ""; + display: block; + position: absolute; + top: -2px; + width: 20px; + border-top: 1px solid black; + animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; +} + +@keyframes ProseMirror-cursor-blink { + to { + visibility: hidden; + } +} + +.ProseMirror-hideselection *::selection { + background: transparent; +} + +.ProseMirror-hideselection *::-moz-selection { + background: transparent; +} + +.ProseMirror-hideselection * { + caret-color: transparent; +} + +.ProseMirror-focused .ProseMirror-gapcursor { + display: block; +} + +.tippy-box[data-animation=fade][data-state=hidden] { + opacity: 0 +}`;let Kp=class extends Lu{constructor(t={}){super(),this.isFocused=!1,this.options={element:document.createElement("div"),content:"",injectCSS:!0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get commands(){return this.commandManager.createCommands()}chain(){return this.commandManager.createChain()}can(){return this.commandManager.createCan()}injectCSS(){this.options.injectCSS&&document&&(this.css=Iu(Wp))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){this.setOptions({editable:t})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,r){const n=typeof r=="function"?r(t,this.state.plugins):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const r=typeof t=="string"?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(r))});this.view.updateState(n)}createExtensionManager(){const r=[...Object.entries(Jp).map(([,n])=>n),...this.options.extensions].filter(n=>["extension","node","mark"].includes(n==null?void 0:n.type));this.extensionManager=new Xe(r,this)}createCommandManager(){this.commandManager=new Ru(this,this.extensionManager.commands)}createSchema(){this.schema=this.extensionManager.schema}createView(){this.view=new Q(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:dt.create({doc:ea(this.options.content,this.schema,this.options.parseOptions)})});const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const r=this.state.apply(t),n=!this.state.selection.eq(r.selection);this.view.updateState(r),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Au(this.state,t)}isActive(t,r){const n=typeof t=="string"?t:null,o=typeof t=="string"?r:t;return _u(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Eu(this.state.doc,this.schema)}get isEmpty(){return Du(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners(),Nu(this.css)}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};class Ot{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new Ot(t)}configure(t={}){const r=this.extend();return r.options=Ur(this.options,t),r}extend(t={}){const r=new Ot(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}class ke{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new ke(t)}configure(t={}){const r=this.extend();return r.options=Ur(this.options,t),r}extend(t={}){const r=new ke(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}function $p(e,t,r){return new Kr(e,(n,o,i,s)=>{const a=r instanceof Function?r(o):r,{tr:c}=n;return o[0]&&c.replaceWith(i-1,s,t.create(a)),c})}function Up(e,t,r){let n=[];return r.doc.nodesBetween(e,t,(o,i)=>{n=[...n,...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s}))]}),n}function ze(e,t,r){return new Kr(e,(n,o,i,s)=>{const a=r instanceof Function?r(o):r,{tr:c}=n,l=o[o.length-1],u=o[0];let f=s;if(l){const p=u.search(/\S/),d=i+u.indexOf(l),h=d+l.length;if(Up(i,s,n).filter(g=>{const{excluded:S}=g.mark.type;return S.find(y=>y.name===t.name)}).filter(g=>g.to>d).length)return null;hi&&c.delete(i+p,d),f=i+p+l.length,c.addMark(i+p,f,t.create(a)),c.removeStoredMark(t)}return c})}function Be(e,t,r){const n=(o,i)=>{const s=[];return o.forEach(a=>{if(a.isText&&a.text){const{text:c}=a;let l=0,u;for(;(u=e.exec(c))!==null;){const f=Math.max(u.length-2,0),p=Math.max(u.length-1,0);if(i!=null&&i.type.allowsMarkType(t)){const h=u.index+u[0].indexOf(u[f]),v=h+u[f].length,g=h+u[f].lastIndexOf(u[p]),S=g+u[p].length,y=r instanceof Function?r(u):r;if(!y&&y!==void 0)continue;h>0&&s.push(a.cut(l,h)),s.push(a.cut(g,S).mark(t.create(y).addToSet(a.marks))),l=v}}lnew x(n(o.content),o.openStart,o.openEnd)}})}function Gp(e){return oa(e)&&e instanceof N}function sa(e,t,r){const n=e.coordsAtPos(t),o=e.coordsAtPos(r,-1),i=Math.min(n.top,o.top),s=Math.max(n.bottom,o.bottom),a=Math.min(n.left,o.left),c=Math.max(n.right,o.right),l=c-a,u=s-i,d={top:i,bottom:s,left:a,right:c,width:l,height:u,x:a,y:i};return{...d,toJSON:()=>d}}var Yp="tippy-box",aa="tippy-content",Xp="tippy-backdrop",ca="tippy-arrow",la="tippy-svg-arrow",de={passive:!0,capture:!0};function kn(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function Mo(e,t){var r={}.toString.call(e);return r.indexOf("[object")===0&&r.indexOf(t+"]")>-1}function ua(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Ci(e,t){if(t===0)return e;var r;return function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function Qp(e){return e.split(/\s+/).filter(Boolean)}function We(e){return[].concat(e)}function Oi(e,t){e.indexOf(t)===-1&&e.push(t)}function Zp(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function td(e){return e.split("-")[0]}function Ir(e){return[].slice.call(e)}function ed(e){return Object.keys(e).reduce(function(t,r){return e[r]!==void 0&&(t[r]=e[r]),t},{})}function Qe(){return document.createElement("div")}function Gr(e){return["Element","Fragment"].some(function(t){return Mo(e,t)})}function rd(e){return Mo(e,"NodeList")}function nd(e){return Mo(e,"MouseEvent")}function od(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function id(e){return Gr(e)?[e]:rd(e)?Ir(e):Array.isArray(e)?e:Ir(document.querySelectorAll(e))}function Sn(e,t){e.forEach(function(r){r&&(r.style.transitionDuration=t+"ms")})}function wi(e,t){e.forEach(function(r){r&&r.setAttribute("data-state",t)})}function sd(e){var t,r=We(e),n=r[0];return!(n==null||(t=n.ownerDocument)==null)&&t.body?n.ownerDocument:document}function ad(e,t){var r=t.clientX,n=t.clientY;return e.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,c=a.interactiveBorder,l=td(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=l==="bottom"?u.top.y:0,p=l==="top"?u.bottom.y:0,d=l==="right"?u.left.x:0,h=l==="left"?u.right.x:0,v=i.top-n+f>c,g=n-i.bottom-p>c,S=i.left-r+d>c,y=r-i.right-h>c;return v||g||S||y})}function Mn(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[n](o,r)})}var jt={isTouch:!1},Ti=0;function cd(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",fa))}function fa(){var e=performance.now();e-Ti<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",fa)),Ti=e}function ld(){var e=document.activeElement;if(od(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function ud(){document.addEventListener("touchstart",cd,de),window.addEventListener("blur",ld)}var fd=typeof window<"u"&&typeof document<"u",pd=fd?navigator.userAgent:"",dd=/MSIE |Trident\//.test(pd),hd={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},md={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},zt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},hd,{},md),vd=Object.keys(zt),gd=function(t){var r=Object.keys(t);r.forEach(function(n){zt[n]=t[n]})};function pa(e){var t=e.plugins||[],r=t.reduce(function(n,o){var i=o.name,s=o.defaultValue;return i&&(n[i]=e[i]!==void 0?e[i]:s),n},{});return Object.assign({},e,{},r)}function yd(e,t){var r=t?Object.keys(pa(Object.assign({},zt,{plugins:t}))):vd,n=r.reduce(function(o,i){var s=(e.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return n}function Ai(e,t){var r=Object.assign({},t,{content:ua(t.content,[e])},t.ignoreAttributes?{}:yd(e,t.plugins));return r.aria=Object.assign({},zt.aria,{},r.aria),r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content},r}var bd=function(){return"innerHTML"};function Jn(e,t){e[bd()]=t}function _i(e){var t=Qe();return e===!0?t.className=ca:(t.className=la,Gr(e)?t.appendChild(e):Jn(t,e)),t}function Ni(e,t){Gr(t.content)?(Jn(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Jn(e,t.content):e.textContent=t.content)}function Wn(e){var t=e.firstElementChild,r=Ir(t.children);return{box:t,content:r.find(function(n){return n.classList.contains(aa)}),arrow:r.find(function(n){return n.classList.contains(ca)||n.classList.contains(la)}),backdrop:r.find(function(n){return n.classList.contains(Xp)})}}function da(e){var t=Qe(),r=Qe();r.className=Yp,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=Qe();n.className=aa,n.setAttribute("data-state","hidden"),Ni(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props);function o(i,s){var a=Wn(t),c=a.box,l=a.content,u=a.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Ni(l,e.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(_i(s.arrow))):c.appendChild(_i(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:o}}da.$$tippy=!0;var kd=1,kr=[],xn=[];function Sd(e,t){var r=Ai(e,Object.assign({},zt,{},pa(ed(t)))),n,o,i,s=!1,a=!1,c=!1,l=!1,u,f,p,d=[],h=Ci(Eo,r.interactiveDebounce),v,g=kd++,S=null,y=Zp(r.plugins),I={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:g,reference:e,popper:Qe(),popperInstance:S,props:r,state:I,plugins:y,clearDelayTimeouts:wa,setProps:Ta,setContent:Aa,show:_a,hide:Na,hideWithInteractivity:Ea,enable:Ca,disable:Oa,unmount:Da,destroy:Ia};if(!r.render)return m;var D=r.render(m),C=D.popper,L=D.onUpdate;C.setAttribute("data-tippy-root",""),C.id="tippy-"+m.id,m.popper=C,e._tippy=m,C._tippy=m;var q=y.map(function(b){return b.fn(m)}),$=e.hasAttribute("aria-expanded");return Ao(),je(),Zt(),_t("onCreate",[m]),r.showOnCreate&&Bo(),C.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),C.addEventListener("mouseleave",function(b){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&(Ht().addEventListener("mousemove",h),h(b))}),m;function w(){var b=m.props.touch;return Array.isArray(b)?b:[b,0]}function Gt(){return w()[0]==="hold"}function et(){var b;return!!((b=m.props.render)!=null&&b.$$tippy)}function lt(){return v||e}function Ht(){var b=lt().parentNode;return b?sd(b):document}function U(){return Wn(C)}function G(b){return m.state.isMounted&&!m.state.isVisible||jt.isTouch||u&&u.type==="focus"?0:kn(m.props.delay,b?0:1,zt.delay)}function Zt(){C.style.pointerEvents=m.props.interactive&&m.state.isVisible?"":"none",C.style.zIndex=""+m.props.zIndex}function _t(b,O,_){if(_===void 0&&(_=!0),q.forEach(function(z){z[b]&&z[b].apply(void 0,O)}),_){var V;(V=m.props)[b].apply(V,O)}}function xo(){var b=m.props.aria;if(b.content){var O="aria-"+b.content,_=C.id,V=We(m.props.triggerTarget||e);V.forEach(function(z){var mt=z.getAttribute(O);if(m.state.isVisible)z.setAttribute(O,mt?mt+" "+_:_);else{var Nt=mt&&mt.replace(_,"").trim();Nt?z.setAttribute(O,Nt):z.removeAttribute(O)}})}}function je(){if(!($||!m.props.aria.expanded)){var b=We(m.props.triggerTarget||e);b.forEach(function(O){m.props.interactive?O.setAttribute("aria-expanded",m.state.isVisible&&O===lt()?"true":"false"):O.removeAttribute("aria-expanded")})}}function Yr(){Ht().removeEventListener("mousemove",h),kr=kr.filter(function(b){return b!==h})}function hr(b){if(!(jt.isTouch&&(c||b.type==="mousedown"))&&!(m.props.interactive&&C.contains(b.target))){if(lt().contains(b.target)){if(jt.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else _t("onClickOutside",[m,b]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),a=!0,setTimeout(function(){a=!1}),m.state.isMounted||Xr())}}function Co(){c=!0}function Oo(){c=!1}function wo(){var b=Ht();b.addEventListener("mousedown",hr,!0),b.addEventListener("touchend",hr,de),b.addEventListener("touchstart",Oo,de),b.addEventListener("touchmove",Co,de)}function Xr(){var b=Ht();b.removeEventListener("mousedown",hr,!0),b.removeEventListener("touchend",hr,de),b.removeEventListener("touchstart",Oo,de),b.removeEventListener("touchmove",Co,de)}function Sa(b,O){To(b,function(){!m.state.isVisible&&C.parentNode&&C.parentNode.contains(C)&&O()})}function Ma(b,O){To(b,O)}function To(b,O){var _=U().box;function V(z){z.target===_&&(Mn(_,"remove",V),O())}if(b===0)return O();Mn(_,"remove",f),Mn(_,"add",V),f=V}function Ce(b,O,_){_===void 0&&(_=!1);var V=We(m.props.triggerTarget||e);V.forEach(function(z){z.addEventListener(b,O,_),d.push({node:z,eventType:b,handler:O,options:_})})}function Ao(){Gt()&&(Ce("touchstart",No,{passive:!0}),Ce("touchend",Do,{passive:!0})),Qp(m.props.trigger).forEach(function(b){if(b!=="manual")switch(Ce(b,No),b){case"mouseenter":Ce("mouseleave",Do);break;case"focus":Ce(dd?"focusout":"blur",Io);break;case"focusin":Ce("focusout",Io);break}})}function _o(){d.forEach(function(b){var O=b.node,_=b.eventType,V=b.handler,z=b.options;O.removeEventListener(_,V,z)}),d=[]}function No(b){var O,_=!1;if(!(!m.state.isEnabled||Ro(b)||a)){var V=((O=u)==null?void 0:O.type)==="focus";u=b,v=b.currentTarget,je(),!m.state.isVisible&&nd(b)&&kr.forEach(function(z){return z(b)}),b.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||s)&&m.props.hideOnClick!==!1&&m.state.isVisible?_=!0:Bo(b),b.type==="click"&&(s=!_),_&&!V&&mr(b)}}function Eo(b){var O=b.target,_=lt().contains(O)||C.contains(O);if(!(b.type==="mousemove"&&_)){var V=Qr().concat(C).map(function(z){var mt,Nt=z._tippy,Oe=(mt=Nt.popperInstance)==null?void 0:mt.state;return Oe?{popperRect:z.getBoundingClientRect(),popperState:Oe,props:r}:null}).filter(Boolean);ad(V,b)&&(Yr(),mr(b))}}function Do(b){var O=Ro(b)||m.props.trigger.indexOf("click")>=0&&s;if(!O){if(m.props.interactive){m.hideWithInteractivity(b);return}mr(b)}}function Io(b){m.props.trigger.indexOf("focusin")<0&&b.target!==lt()||m.props.interactive&&b.relatedTarget&&C.contains(b.relatedTarget)||mr(b)}function Ro(b){return jt.isTouch?Gt()!==b.type.indexOf("touch")>=0:!1}function Po(){zo();var b=m.props,O=b.popperOptions,_=b.placement,V=b.offset,z=b.getReferenceClientRect,mt=b.moveTransition,Nt=et()?Wn(C).arrow:null,Oe=z?{getBoundingClientRect:z,contextElement:z.contextElement||lt()}:e,Lo={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(vr){var we=vr.state;if(et()){var Ra=U(),tn=Ra.box;["placement","reference-hidden","escaped"].forEach(function(gr){gr==="placement"?tn.setAttribute("data-placement",we.placement):we.attributes.popper["data-popper-"+gr]?tn.setAttribute("data-"+gr,""):tn.removeAttribute("data-"+gr)}),we.attributes.popper={}}}},pe=[{name:"offset",options:{offset:V}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!mt}},Lo];et()&&Nt&&pe.push({name:"arrow",options:{element:Nt,padding:3}}),pe.push.apply(pe,(O==null?void 0:O.modifiers)||[]),m.popperInstance=za(Oe,C,Object.assign({},O,{placement:_,onFirstUpdate:p,modifiers:pe}))}function zo(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function xa(){var b=m.props.appendTo,O,_=lt();m.props.interactive&&b===zt.appendTo||b==="parent"?O=_.parentNode:O=ua(b,[_]),O.contains(C)||O.appendChild(C),Po()}function Qr(){return Ir(C.querySelectorAll("[data-tippy-root]"))}function Bo(b){m.clearDelayTimeouts(),b&&_t("onTrigger",[m,b]),wo();var O=G(!0),_=w(),V=_[0],z=_[1];jt.isTouch&&V==="hold"&&z&&(O=z),O?n=setTimeout(function(){m.show()},O):m.show()}function mr(b){if(m.clearDelayTimeouts(),_t("onUntrigger",[m,b]),!m.state.isVisible){Xr();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(b.type)>=0&&s)){var O=G(!1);O?o=setTimeout(function(){m.state.isVisible&&m.hide()},O):i=requestAnimationFrame(function(){m.hide()})}}function Ca(){m.state.isEnabled=!0}function Oa(){m.hide(),m.state.isEnabled=!1}function wa(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)}function Ta(b){if(!m.state.isDestroyed){_t("onBeforeUpdate",[m,b]),_o();var O=m.props,_=Ai(e,Object.assign({},m.props,{},b,{ignoreAttributes:!0}));m.props=_,Ao(),O.interactiveDebounce!==_.interactiveDebounce&&(Yr(),h=Ci(Eo,_.interactiveDebounce)),O.triggerTarget&&!_.triggerTarget?We(O.triggerTarget).forEach(function(V){V.removeAttribute("aria-expanded")}):_.triggerTarget&&e.removeAttribute("aria-expanded"),je(),Zt(),L&&L(O,_),m.popperInstance&&(Po(),Qr().forEach(function(V){requestAnimationFrame(V._tippy.popperInstance.forceUpdate)})),_t("onAfterUpdate",[m,b])}}function Aa(b){m.setProps({content:b})}function _a(){var b=m.state.isVisible,O=m.state.isDestroyed,_=!m.state.isEnabled,V=jt.isTouch&&!m.props.touch,z=kn(m.props.duration,0,zt.duration);if(!(b||O||_||V)&&!lt().hasAttribute("disabled")&&(_t("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,et()&&(C.style.visibility="visible"),Zt(),wo(),m.state.isMounted||(C.style.transition="none"),et()){var mt=U(),Nt=mt.box,Oe=mt.content;Sn([Nt,Oe],0)}p=function(){var pe;if(!(!m.state.isVisible||l)){if(l=!0,C.offsetHeight,C.style.transition=m.props.moveTransition,et()&&m.props.animation){var Zr=U(),vr=Zr.box,we=Zr.content;Sn([vr,we],z),wi([vr,we],"visible")}xo(),je(),Oi(xn,m),(pe=m.popperInstance)==null||pe.forceUpdate(),m.state.isMounted=!0,_t("onMount",[m]),m.props.animation&&et()&&Ma(z,function(){m.state.isShown=!0,_t("onShown",[m])})}},xa()}}function Na(){var b=!m.state.isVisible,O=m.state.isDestroyed,_=!m.state.isEnabled,V=kn(m.props.duration,1,zt.duration);if(!(b||O||_)&&(_t("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,l=!1,s=!1,et()&&(C.style.visibility="hidden"),Yr(),Xr(),Zt(),et()){var z=U(),mt=z.box,Nt=z.content;m.props.animation&&(Sn([mt,Nt],V),wi([mt,Nt],"hidden"))}xo(),je(),m.props.animation?et()&&Sa(V,m.unmount):m.unmount()}}function Ea(b){Ht().addEventListener("mousemove",h),Oi(kr,h),h(b)}function Da(){m.state.isVisible&&m.hide(),m.state.isMounted&&(zo(),Qr().forEach(function(b){b._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),xn=xn.filter(function(b){return b!==m}),m.state.isMounted=!1,_t("onHidden",[m]))}function Ia(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),_o(),delete e._tippy,m.state.isDestroyed=!0,_t("onDestroy",[m]))}}function He(e,t){t===void 0&&(t={});var r=zt.plugins.concat(t.plugins||[]);ud();var n=Object.assign({},t,{plugins:r}),o=id(e),i=o.reduce(function(s,a){var c=a&&Sd(a,n);return c&&s.push(c),s},[]);return Gr(e)?i[0]:i}He.defaultProps=zt;He.setDefaultProps=gd;He.currentInput=jt;Object.assign({},Pa,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});He.setDefaultProps({render:da});class Md{constructor({editor:t,element:r,view:n,tippyOptions:o,shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s,from:a,to:c})=>{const{doc:l,selection:u}=s,{empty:f}=u,p=!l.textBetween(a,c).length&&ia(s.selection);return!(f||p)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.element.style.visibility="visible",requestAnimationFrame(()=>{this.createTooltip(o)})}createTooltip(t={}){this.tippy=He(this.editor.options.element,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...t})}update(t,r){var n;const{state:o,composing:i}=t,{doc:s,selection:a}=o,c=r&&r.doc.eq(s)&&r.selection.eq(a);if(i||c)return;const{ranges:l}=a,u=Math.min(...l.map(d=>d.$from.pos)),f=Math.max(...l.map(d=>d.$to.pos));if(!this.shouldShow({editor:this.editor,view:t,state:o,oldState:r,from:u,to:f})){this.hide();return}(n=this.tippy)===null||n===void 0||n.setProps({getReferenceClientRect:()=>{if(Gp(o.selection)){const d=t.nodeDOM(u);if(d)return d.getBoundingClientRect()}return sa(t,u,f)}}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ha=e=>new Rt({key:typeof e.pluginKey=="string"?new Kt(e.pluginKey):e.pluginKey,view:t=>new Md({view:t,...e})});kt.create({name:"bubbleMenu",defaultOptions:{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null},addProseMirrorPlugins(){return this.options.element?[ha({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class xd{constructor({editor:t,element:r,view:n,tippyOptions:o,shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s})=>{const{selection:a}=s,{$anchor:c,empty:l}=a,u=c.depth===1,f=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent;return!(!l||!u||!f)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.element.style.visibility="visible",requestAnimationFrame(()=>{this.createTooltip(o)})}createTooltip(t={}){this.tippy=He(this.editor.options.element,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...t})}update(t,r){var n;const{state:o,composing:i}=t,{doc:s,selection:a}=o,{from:c,to:l}=a,u=r&&r.doc.eq(s)&&r.selection.eq(a);if(i||u)return;if(!this.shouldShow({editor:this.editor,view:t,state:o,oldState:r})){this.hide();return}(n=this.tippy)===null||n===void 0||n.setProps({getReferenceClientRect:()=>sa(t,c,l)}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ma=e=>new Rt({key:typeof e.pluginKey=="string"?new Kt(e.pluginKey):e.pluginKey,view:t=>new xd({view:t,...e})});kt.create({name:"floatingMenu",defaultOptions:{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null},addProseMirrorPlugins(){return this.options.element?[ma({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});lr({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const r=zr(null);return Kn(()=>{const{pluginKey:n,editor:o,tippyOptions:i,shouldShow:s}=e;o.registerPlugin(ha({pluginKey:n,editor:o,element:r.value,tippyOptions:i,shouldShow:s}))}),Br(()=>{const{pluginKey:n,editor:o}=e;o.unregisterPlugin(n)}),()=>{var n;return ve("div",{ref:r},(n=t.default)===null||n===void 0?void 0:n.call(t))}}});function Cd(e){return Ja((t,r)=>({get(){return t(),e},set(n){e=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{r()})})}}))}class Od extends Kp{constructor(t={}){return super(t),this.vueRenderers=ja(new Map),this.contentComponent=null,this.reactiveState=Cd(this.view.state),this.on("transaction",()=>{this.reactiveState.value=this.view.state}),qa(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}registerPlugin(t,r){super.registerPlugin(t,r),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const wd=lr({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=zr(),r=Ba();return La(()=>{const n=e.editor;n&&n.options.element&&t.value&&Fa(()=>{if(!t.value||!n.options.element.firstChild)return;const o=Va(t.value);t.value.append(...n.options.element.childNodes),n.contentComponent=r.ctx._,n.setOptions({element:o}),n.createNodeViews()})}),Br(()=>{const n=e.editor;if(!n||(n.isDestroyed||n.view.setProps({nodeViews:{}}),n.contentComponent=null,!n.options.element.firstChild))return;const o=document.createElement("div");o.append(...n.options.element.childNodes),n.setOptions({element:o})}),{rootEl:t}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach(t=>{const r=ve(Ha,{to:t.teleportElement,key:t.id},ve(t.component,{ref:t.id,...t.props}));e.push(r)}),ve("div",{ref:t=>{this.rootEl=t}},...e)}});lr({name:"FloatingMenu",props:{pluginKey:{type:[String,Object],default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const r=zr(null);return Kn(()=>{const{pluginKey:n,editor:o,tippyOptions:i,shouldShow:s}=e;o.registerPlugin(ma({pluginKey:n,editor:o,element:r.value,tippyOptions:i,shouldShow:s}))}),Br(()=>{const{pluginKey:n,editor:o}=e;o.unregisterPlugin(n)}),()=>{var n;return ve("div",{ref:r},(n=t.default)===null||n===void 0?void 0:n.call(t))}}});const Td=(e={})=>{const t=zr();return Kn(()=>{t.value=new Od(e)}),Br(()=>{var r;(r=t.value)===null||r===void 0||r.destroy()}),t};lr({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return ve(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragStart:this.onDragStart},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}});lr({props:{as:{type:String,default:"div"}},render(){return ve(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const Ad=/^\s*>\s$/gm,_d=Ot.create({name:"blockquote",defaultOptions:{HTMLAttributes:{}},content:"block*",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[So(Ad,this.type)]}}),Nd=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,Ed=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm,Dd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm,Id=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm,Rd=ke.create({name:"bold",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ze(Nd,this.type),ze(Dd,this.type)]},addPasteRules(){return[Be(Ed,this.type),Be(Id,this.type)]}}),Pd=/^\s*([-+*])\s$/,zd=Ot.create({name:"bulletList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[So(Pd,this.type)]}}),Bd=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,Ld=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/gm,Fd=ke.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ze(Bd,this.type)]},addPasteRules(){return[Be(Ld,this.type)]}}),Vd=/^```(?[a-z]*)? $/,Hd=/^~~~(?[a-z]*)? $/,jd=Ot.create({name:"codeBlock",defaultOptions:{languageClassPrefix:"language-",HTMLAttributes:{}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const r=(t=e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("class");if(!r)return null;const n=new RegExp(`^(${this.options.languageClassPrefix})`);return{language:r.replace(n,"")}},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,r=t.pos===1;return!e||t.parent.type.name!==this.name?!1:r||!t.parent.textContent.length?this.editor.commands.clearNodes():!1}}},addInputRules(){return[Vn(Vd,this.type,({groups:e})=>e),Vn(Hd,this.type,({groups:e})=>e)]}}),qd=Ot.create({name:"doc",topNode:!0,content:"block+"});function Jd(e){return e===void 0&&(e={}),new Rt({view:function(r){return new Ut(r,e)}})}var Ut=function(t,r){var n=this;this.editorView=t,this.width=r.width||1,this.color=r.color||"black",this.class=r.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map(function(o){var i=function(s){return n[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})};Ut.prototype.destroy=function(){var t=this;this.handlers.forEach(function(r){var n=r.name,o=r.handler;return t.editorView.dom.removeEventListener(n,o)})};Ut.prototype.update=function(t,r){this.cursorPos!=null&&r.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())};Ut.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())};Ut.prototype.updateOverlay=function(){var t=this.editorView.state.doc.resolve(this.cursorPos),r;if(!t.parent.inlineContent){var n=t.nodeBefore,o=t.nodeAfter;if(n||o){var i=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),s=n?i.bottom:i.top;n&&o&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:i.left,right:i.right,top:s-this.width/2,bottom:s+this.width/2}}}if(!r){var a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var l,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")l=-pageXOffset,u=-pageYOffset;else{var f=c.getBoundingClientRect();l=f.left-c.scrollLeft,u=f.top-c.scrollTop}this.element.style.left=r.left-l+"px",this.element.style.top=r.top-u+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"};Ut.prototype.scheduleRemoval=function(t){var r=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return r.setCursor(null)},t)};Ut.prototype.dragover=function(t){if(this.editorView.editable){var r=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(r){var n=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(n=rs(this.editorView.state.doc,n,this.editorView.dragging.slice),n==null))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}};Ut.prototype.dragend=function(){this.scheduleRemoval(20)};Ut.prototype.drop=function(){this.scheduleRemoval(20)};Ut.prototype.dragleave=function(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)};const Wd=kt.create({name:"dropCursor",defaultOptions:{color:"currentColor",width:1,class:null},addProseMirrorPlugins(){return[Jd(this.options)]}});var Vt=function(e){function t(r){e.call(this,r,r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,o){var i=n.resolve(o.map(this.head));return t.valid(i)?new t(i):e.near(i)},t.prototype.content=function(){return x.empty},t.prototype.eq=function(n){return n instanceof t&&n.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(n,o){if(typeof o.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(n.resolve(o.pos))},t.prototype.getBookmark=function(){return new Rr(this.anchor)},t.valid=function(n){var o=n.parent;if(o.isTextblock||!Kd(n)||!$d(n))return!1;var i=o.type.spec.allowGapCursor;if(i!=null)return i;var s=o.contentMatchAt(n.index()).defaultType;return s&&s.isTextblock},t.findFrom=function(n,o,i){t:for(;;){if(!i&&t.valid(n))return n;for(var s=n.pos,a=null,c=n.depth;;c--){var l=n.node(c);if(o>0?n.indexAfter(c)0){a=l.child(o>0?n.indexAfter(c):n.index(c)-1);break}else if(c==0)return null;s+=o;var u=n.doc.resolve(s);if(t.valid(u))return u}for(;;){var f=o>0?a.firstChild:a.lastChild;if(!f){if(a.isAtom&&!a.isText&&!N.isSelectable(a)){n=n.doc.resolve(s+a.nodeSize*o),i=!1;continue t}break}a=f,s+=o;var p=n.doc.resolve(s);if(t.valid(p))return p}return null}},t}(E);Vt.prototype.visible=!1;E.jsonID("gapcursor",Vt);var Rr=function(t){this.pos=t};Rr.prototype.map=function(t){return new Rr(t.map(this.pos))};Rr.prototype.resolve=function(t){var r=t.resolve(this.pos);return Vt.valid(r)?new Vt(r):E.near(r)};function Kd(e){for(var t=e.depth;t>=0;t--){var r=e.index(t);if(r!=0)for(var n=e.node(t).child(r-1);;n=n.lastChild){if(n.childCount==0&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}function $d(e){for(var t=e.depth;t>=0;t--){var r=e.indexAfter(t),n=e.node(t);if(r!=n.childCount)for(var o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}var Ud=function(){return new Rt({props:{decorations:Xd,createSelectionBetween:function(t,r,n){if(r.pos==n.pos&&Vt.valid(n))return new Vt(n)},handleClick:Yd,handleKeyDown:Gd}})},Gd=$s({ArrowLeft:Sr("horiz",-1),ArrowRight:Sr("horiz",1),ArrowUp:Sr("vert",-1),ArrowDown:Sr("vert",1)});function Sr(e,t){var r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){var s=n.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof H){if(!i.endOfTextblock(r)||a.depth==0)return!1;c=!1,a=n.doc.resolve(t>0?a.after():a.before())}var l=Vt.findFrom(a,t,c);return l?(o&&o(n.tr.setSelection(new Vt(l))),!0):!1}}function Yd(e,t,r){if(!e.editable)return!1;var n=e.state.doc.resolve(t);if(!Vt.valid(n))return!1;var o=e.posAtCoords({left:r.clientX,top:r.clientY}),i=o.inside;return i>-1&&N.isSelectable(e.state.doc.nodeAt(i))?!1:(e.dispatch(e.state.tr.setSelection(new Vt(n))),!0)}function Xd(e){if(!(e.selection instanceof Vt))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",j.create(e.doc,[rt.widget(e.selection.head,t,{key:"gapcursor"})])}const Qd=kt.create({name:"gapCursor",addProseMirrorPlugins(){return[Ud()]},extendNodeSchema(e){var t;const r={name:e.name,options:e.options};return{allowGapCursor:(t=Z(A(e,"allowGapCursor",r)))!==null&&t!==void 0?t:null}}}),Zd=Ot.create({name:"hardBreak",defaultOptions:{HTMLAttributes:{}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Ct(this.options.HTMLAttributes,e)]},addCommands(){return{setHardBreak:()=>({commands:e})=>e.first([()=>e.exitCode(),()=>e.insertContent({type:this.name})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),th=Ot.create({name:"heading",defaultOptions:{levels:[1,2,3,4,5,6],HTMLAttributes:{}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ct(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode("heading",e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode("heading","paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Vn(new RegExp(`^(#{1,${e}})\\s$`),this.type,{level:e}))}});var Pr=200,it=function(){};it.prototype.append=function(t){return t.length?(t=it.from(t),!this.length&&t||t.length=r?it.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};it.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};it.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};it.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};it.from=function(t){return t instanceof it?t:t&&t.length?new va(t):it.empty};var va=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var c=i;c=s;c--)if(o(this.values[c],a+c)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Pr)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Pr)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(it);it.empty=new va([]);var eh=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(it),ga=it,rh=500,ct=function(t,r){this.items=t,this.eventCount=r};ct.prototype.popEvent=function(t,r){var n=this;if(this.eventCount==0)return null;for(var o=this.items.length;;o--){var i=this.items.get(o-1);if(i.selection){--o;break}}var s,a;r&&(s=this.remapping(o,this.items.length),a=s.maps.length);var c=t.tr,l,u,f=[],p=[];return this.items.forEach(function(d,h){if(!d.step){s||(s=n.remapping(o,h+1),a=s.maps.length),a--,p.push(d);return}if(s){p.push(new Jt(d.map));var v=d.step.map(s.slice(a)),g;v&&c.maybeStep(v).doc&&(g=c.mapping.maps[c.mapping.maps.length-1],f.push(new Jt(g,null,null,f.length+p.length))),a--,g&&s.appendMap(g,a)}else c.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(a)):d.selection,u=new ct(n.items.slice(0,o).append(p.reverse().concat(f)),n.eventCount-1),!1},this.items.length,0),{remaining:u,transform:c,selection:l}};ct.prototype.addTransform=function(t,r,n,o){for(var i=[],s=this.eventCount,a=this.items,c=!o&&a.length?a.get(a.length-1):null,l=0;loh&&(a=nh(a,d),s-=d),new ct(a.append(i),s)};ct.prototype.remapping=function(t,r){var n=new pt;return this.items.forEach(function(o,i){var s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:null;n.appendMap(o.map,s)},t,r),n};ct.prototype.addMaps=function(t){return this.eventCount==0?this:new ct(this.items.append(t.map(function(r){return new Jt(r)})),this.eventCount)};ct.prototype.rebased=function(t,r){if(!this.eventCount)return this;var n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(function(d){d.selection&&a--},o);var c=r;this.items.forEach(function(d){var h=i.getMirror(--c);if(h!=null){s=Math.min(s,h);var v=i.maps[h];if(d.step){var g=t.steps[h].invert(t.docs[h]),S=d.selection&&d.selection.map(i.slice(c+1,h));S&&a++,n.push(new Jt(v,g,S))}else n.push(new Jt(v))}},o);for(var l=[],u=r;urh&&(p=p.compress(this.items.length-n.length)),p};ct.prototype.emptyItemCount=function(){var t=0;return this.items.forEach(function(r){r.step||t++}),t};ct.prototype.compress=function(t){t===void 0&&(t=this.items.length);var r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach(function(s,a){if(a>=t)o.push(s),s.selection&&i++;else if(s.step){var c=s.step.map(r.slice(n)),l=c&&c.getMap();if(n--,l&&r.appendMap(l,n),c){var u=s.selection&&s.selection.map(r.slice(n));u&&i++;var f=new Jt(l.invert(),c,u),p,d=o.length-1;(p=o.length&&o[d].merge(f))?o[d]=p:o.push(f)}}else s.map&&n--},this.items.length,0),new ct(ga.from(o.reverse()),i)};ct.empty=new ct(ga.empty,0);function nh(e,t){var r;return e.forEach(function(n,o){if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}var Jt=function(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o};Jt.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var r=t.step.merge(this.step);if(r)return new Jt(r.getMap().invert(),r,this.selection)}};var re=function(t,r,n,o){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o},oh=20;function ih(e,t,r,n){var o=r.getMeta(ne),i;if(o)return o.historyState;r.getMeta(ah)&&(e=new re(e.done,e.undone,null,0));var s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(ne))return s.getMeta(ne).redo?new re(e.done.addTransform(r,null,n,xr(t)),e.undone,Ei(r.mapping.maps[r.steps.length-1]),e.prevTime):new re(e.done,e.undone.addTransform(r,null,n,xr(t)),null,e.prevTime);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){var a=e.prevTime==0||!s&&(e.prevTime<(r.time||0)-n.newGroupDelay||!sh(r,e.prevRanges)),c=s?Cn(e.prevRanges,r.mapping):Ei(r.mapping.maps[r.steps.length-1]);return new re(e.done.addTransform(r,a?t.selection.getBookmark():null,n,xr(t)),ct.empty,c,r.time)}else return(i=r.getMeta("rebased"))?new re(e.done.rebased(r,i),e.undone.rebased(r,i),Cn(e.prevRanges,r.mapping),e.prevTime):new re(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),Cn(e.prevRanges,r.mapping),e.prevTime)}function sh(e,t){if(!t)return!1;if(!e.docChanged)return!0;var r=!1;return e.mapping.maps[0].forEach(function(n,o){for(var i=0;i=t[i]&&(r=!0)}),r}function Ei(e){var t=[];return e.forEach(function(r,n,o,i){return t.push(o,i)}),t}function Cn(e,t){if(!e)return null;for(var r=[],n=0;n({state:e,dispatch:t})=>ba(e,t),redo:()=>({state:e,dispatch:t})=>ka(e,t)}},addProseMirrorPlugins(){return[ch(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uh=Ot.create({name:"horizontalRule",defaultOptions:{HTMLAttributes:{}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Ct(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:t,dispatch:r})=>{const{selection:n}=t,{empty:o,$anchor:i}=n,s=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;if(!o||!s||!r)return!0;const a=i.before();return t.deleteRange(a,a+1),!0}).insertContent({type:this.name}).command(({tr:t,dispatch:r})=>{var n;if(r){const{parent:o,pos:i}=t.selection.$from,s=i+1;if(!t.doc.nodeAt(s)){const c=(n=o.type.contentMatch.defaultType)===null||n===void 0?void 0:n.create();c&&(t.insert(s,c),t.setSelection(H.create(t.doc,s)))}t.scrollIntoView()}return!0}).run()}},addInputRules(){return[$p(/^(?:---|—-|___\s|\*\*\*\s)$/,this.type)]}}),fh=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,ph=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,dh=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,hh=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,mh=ke.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ze(fh,this.type),ze(dh,this.type)]},addPasteRules(){return[Be(ph,this.type),Be(hh,this.type)]}}),vh=Ot.create({name:"listItem",defaultOptions:{HTMLAttributes:{}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Ct(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),gh=/^(\d+)\.\s$/,yh=Ot.create({name:"orderedList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",addAttributes(){return{start:{default:1,parseHTML:e=>({start:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1})}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...r}=e;return t===1?["ol",Ct(this.options.HTMLAttributes,r),0]:["ol",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[So(gh,this.type,e=>({start:+e[1]}),(e,t)=>t.childCount+t.attrs.start===+e[1])]}}),bh=Ot.create({name:"paragraph",priority:1e3,defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode("paragraph")}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kh=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,Sh=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm,Mh=ke.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Ct(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ze(kh,this.type)]},addPasteRules(){return[Be(Sh,this.type)]}}),xh=Ot.create({name:"text",group:"inline"}),Ch=kt.create({name:"starterKit",addExtensions(){var e,t,r,n,o,i,s,a,c,l,u,f,p,d,h,v,g,S;const y=[];return this.options.blockquote!==!1&&y.push(_d.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bold!==!1&&y.push(Rd.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.bulletList!==!1&&y.push(zd.configure((r=this.options)===null||r===void 0?void 0:r.bulletList)),this.options.code!==!1&&y.push(Fd.configure((n=this.options)===null||n===void 0?void 0:n.code)),this.options.codeBlock!==!1&&y.push(jd.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&y.push(qd.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&y.push(Wd.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&y.push(Qd.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&y.push(Zd.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&y.push(th.configure((l=this.options)===null||l===void 0?void 0:l.heading)),this.options.history!==!1&&y.push(lh.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&y.push(uh.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&y.push(mh.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&y.push(vh.configure((d=this.options)===null||d===void 0?void 0:d.listItem)),this.options.orderedList!==!1&&y.push(yh.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&y.push(bh.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&y.push(Mh.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&y.push(xh.configure((S=this.options)===null||S===void 0?void 0:S.text)),y}}),Oh=kt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.every(r=>t.updateAttributes(r,{textAlign:e})):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),wh={},Th={viewBox:"0 0 24 24"},Ah=T("path",{d:"M17.194 10.962A6.271 6.271 0 0012.844.248H4.3a1.25 1.25 0 000 2.5h1.013a.25.25 0 01.25.25V21a.25.25 0 01-.25.25H4.3a1.25 1.25 0 100 2.5h9.963a6.742 6.742 0 002.93-12.786zm-4.35-8.214a3.762 3.762 0 010 7.523H8.313a.25.25 0 01-.25-.25V3a.25.25 0 01.25-.25zm1.42 18.5H8.313a.25.25 0 01-.25-.25v-7.977a.25.25 0 01.25-.25h5.951a4.239 4.239 0 010 8.477z"},null,-1),_h=[Ah];function Nh(e,t){return gt(),St("svg",Th,_h)}const Eh=wt(wh,[["render",Nh]]),Dh={},Ih={viewBox:"0 0 24 24"},Rh=T("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Ph=[Rh];function zh(e,t){return gt(),St("svg",Ih,Ph)}const Bh=wt(Dh,[["render",zh]]),Lh={},Fh={viewBox:"0 0 24 24"},Vh=T("path",{d:"M22.5.248h-7.637a1.25 1.25 0 000 2.5h1.086a.25.25 0 01.211.384L4.78 21.017a.5.5 0 01-.422.231H1.5a1.25 1.25 0 000 2.5h7.637a1.25 1.25 0 000-2.5H8.051a.25.25 0 01-.211-.384L19.22 2.98a.5.5 0 01.422-.232H22.5a1.25 1.25 0 000-2.5z"},null,-1),Hh=[Vh];function jh(e,t){return gt(),St("svg",Fh,Hh)}const qh=wt(Lh,[["render",jh]]),Jh={},Wh={viewBox:"0 0 24 24"},Kh=T("path",{d:"M7.75 4.5h15a1 1 0 000-2h-15a1 1 0 000 2zm15 6.5h-15a1 1 0 100 2h15a1 1 0 000-2zm0 8.5h-15a1 1 0 000 2h15a1 1 0 000-2zM2.212 17.248a2 2 0 00-1.933 1.484.75.75 0 101.45.386.5.5 0 11.483.63.75.75 0 100 1.5.5.5 0 11-.482.635.75.75 0 10-1.445.4 2 2 0 103.589-1.648.251.251 0 010-.278 2 2 0 00-1.662-3.111zm2.038-6.5a2 2 0 00-4 0 .75.75 0 001.5 0 .5.5 0 011 0 1.031 1.031 0 01-.227.645L.414 14.029A.75.75 0 001 15.248h2.5a.75.75 0 000-1.5h-.419a.249.249 0 01-.195-.406L3.7 12.33a2.544 2.544 0 00.55-1.582zM4 5.248h-.25A.25.25 0 013.5 5V1.623A1.377 1.377 0 002.125.248H1.5a.75.75 0 000 1.5h.25A.25.25 0 012 2v3a.25.25 0 01-.25.25H1.5a.75.75 0 000 1.5H4a.75.75 0 000-1.5z"},null,-1),$h=[Kh];function Uh(e,t){return gt(),St("svg",Wh,$h)}const Gh=wt(Jh,[["render",Uh]]),Yh={},Xh={viewBox:"0 0 24 24"},Qh=Wa('',6),Zh=[Qh];function tm(e,t){return gt(),St("svg",Xh,Zh)}const em=wt(Yh,[["render",tm]]),rm={},nm={viewBox:"0 0 24 24"},om=T("path",{d:"M22.5.248H7.228a6.977 6.977 0 100 13.954h2.318a.25.25 0 01.25.25V22.5a1.25 1.25 0 002.5 0V3a.25.25 0 01.25-.25h3.682a.25.25 0 01.25.25v19.5a1.25 1.25 0 002.5 0V3a.249.249 0 01.25-.25H22.5a1.25 1.25 0 000-2.5zM9.8 11.452a.25.25 0 01-.25.25H7.228a4.477 4.477 0 110-8.954h2.318A.25.25 0 019.8 3z"},null,-1),im=[om];function sm(e,t){return gt(),St("svg",nm,im)}const am=wt(rm,[["render",sm]]),cm={},lm={viewBox:"0 0 24 24"},um=T("path",{d:"M18.559 3.932a4.942 4.942 0 100 9.883 4.609 4.609 0 001.115-.141.25.25 0 01.276.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.71 9.71 0 009.428-9.95V8.873a4.947 4.947 0 00-4.941-4.941zm-12.323 0a4.942 4.942 0 000 9.883 4.6 4.6 0 001.115-.141.25.25 0 01.277.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.711 9.711 0 009.428-9.95V8.873a4.947 4.947 0 00-4.942-4.941z"},null,-1),fm=[um];function pm(e,t){return gt(),St("svg",lm,fm)}const dm=wt(cm,[["render",pm]]),hm={},mm={viewBox:"0 0 24 24"},vm=T("path",{d:"M23.75 12.952A1.25 1.25 0 0022.5 11.7h-8.936a.492.492 0 01-.282-.09c-.722-.513-1.482-.981-2.218-1.432-2.8-1.715-4.5-2.9-4.5-4.863 0-2.235 2.207-2.569 3.523-2.569a4.54 4.54 0 013.081.764 2.662 2.662 0 01.447 1.99v.3a1.25 1.25 0 102.5 0v-.268a4.887 4.887 0 00-1.165-3.777C13.949.741 12.359.248 10.091.248c-3.658 0-6.023 1.989-6.023 5.069 0 2.773 1.892 4.512 4 5.927a.25.25 0 01-.139.458H1.5a1.25 1.25 0 000 2.5h10.977a.251.251 0 01.159.058 4.339 4.339 0 011.932 3.466c0 3.268-3.426 3.522-4.477 3.522-1.814 0-3.139-.405-3.834-1.173a3.394 3.394 0 01-.65-2.7 1.25 1.25 0 00-2.488-.246A5.76 5.76 0 004.4 21.753c1.2 1.324 3.114 2 5.688 2 4.174 0 6.977-2.42 6.977-6.022a6.059 6.059 0 00-.849-3.147.25.25 0 01.216-.377H22.5a1.25 1.25 0 001.25-1.255z"},null,-1),gm=[vm];function ym(e,t){return gt(),St("svg",mm,gm)}const bm=wt(hm,[["render",ym]]),km={},Sm={viewBox:"0 0 24 24"},Mm=T("path",{d:"M17.786 3.77a12.542 12.542 0 00-12.965-.865.249.249 0 01-.292-.045L1.937.269A.507.507 0 001.392.16a.5.5 0 00-.308.462v6.7a.5.5 0 00.5.5h6.7a.5.5 0 00.354-.854L6.783 5.115a.253.253 0 01-.068-.228.249.249 0 01.152-.181 10 10 0 019.466 1.1 9.759 9.759 0 01.094 15.809 1.25 1.25 0 001.473 2.016 12.122 12.122 0 005.013-9.961 12.125 12.125 0 00-5.127-9.9z"},null,-1),xm=[Mm];function Cm(e,t){return gt(),St("svg",Sm,xm)}const Om=wt(km,[["render",Cm]]),wm={},Tm={viewBox:"0 0 24 24"},Am=T("path",{d:"M22.608.161a.5.5 0 00-.545.108L19.472 2.86a.25.25 0 01-.292.045 12.537 12.537 0 00-12.966.865A12.259 12.259 0 006.1 23.632a1.25 1.25 0 001.476-2.018 9.759 9.759 0 01.091-15.809 10 10 0 019.466-1.1.25.25 0 01.084.409l-1.85 1.85a.5.5 0 00.354.853h6.7a.5.5 0 00.5-.5V.623a.5.5 0 00-.313-.462z"},null,-1),_m=[Am];function Nm(e,t){return gt(),St("svg",Tm,_m)}const Em=wt(wm,[["render",Nm]]),Dm={},Im={viewBox:"0 0 24 24"},Rm=T("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Pm=[Rm];function zm(e,t){return gt(),St("svg",Im,Pm)}const Bm=wt(Dm,[["render",zm]]),Lm={},Fm={viewBox:"0 0 24 24"},Vm=T("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.75 5.25h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 0 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5zm-4 4h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 1 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5z"},null,-1),Hm=[Vm];function jm(e,t){return gt(),St("svg",Fm,Hm)}const qm=wt(Lm,[["render",jm]]),Jm={components:{EditorContent:wd,BoldIcon:Eh,CodingIcon:Bh,ItalicIcon:qh,ListIcon:Gh,ListUlIcon:em,ParagraphIcon:am,QuoteIcon:dm,StrikethroughIcon:bm,UndoIcon:Om,RedoIcon:Em,CodeBlockIcon:Bm,DotsVerticalIcon:Ka,MenuCenterIcon:qm,MenuAlt2Icon:$a,MenuAlt3Icon:Ua,MenuIcon:Ga},props:{modelValue:{type:String,default:""},contentLoading:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const r=Td({content:e.modelValue,extensions:[Ch,Oh.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"]})],onUpdate:()=>{t("update:modelValue",r.value.getHTML())}});return Ya(()=>e.modelValue,n=>{r.value.getHTML()!==n&&r.value.commands.setContent(e.modelValue,!1)}),Xa(()=>{setTimeout(()=>{r.value.destroy()},500)}),{editor:r}}},Wm={key:1,class:"box-border w-full text-sm leading-8 text-left bg-white border border-gray-200 rounded-md min-h-[200px] overflow-hidden"},Km={key:0,class:"editor-content"},$m={class:"flex justify-end p-2 border-b border-gray-200 md:hidden"},Um={class:"flex items-center justify-center w-6 h-6 ml-2 text-sm text-black bg-white rounded-sm md:h-9 md:w-9"},Gm={class:"flex flex-wrap space-x-1"},Ym={class:"hidden p-2 border-b border-gray-200 md:flex"},Xm={class:"flex flex-wrap space-x-1"};function Qm(e,t,r,n,o,i){const s=X("BaseContentPlaceholdersBox"),a=X("BaseContentPlaceholders"),c=X("dots-vertical-icon"),l=X("bold-icon"),u=X("italic-icon"),f=X("strikethrough-icon"),p=X("coding-icon"),d=X("paragraph-icon"),h=X("list-ul-icon"),v=X("list-icon"),g=X("quote-icon"),S=X("code-block-icon"),y=X("undo-icon"),I=X("redo-icon"),m=X("BaseDropdown"),D=X("menu-alt2-icon"),C=X("menu-alt3-icon"),L=X("menu-icon"),q=X("menu-center-icon"),$=X("editor-content");return r.contentLoading?(gt(),Qa(a,{key:0},{default:en(()=>[F(s,{rounded:!0,class:"w-full",style:{height:"200px"}})]),_:1})):(gt(),St("div",Wm,[n.editor?(gt(),St("div",Km,[T("div",$m,[F(m,{"width-class":"w-48"},{activator:en(()=>[T("div",Um,[F(c,{class:"w-6 h-6 text-gray-600"})])]),default:en(()=>[T("div",Gm,[T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:t[0]||(t[0]=w=>n.editor.chain().focus().toggleBold().run())},[F(l,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:t[1]||(t[1]=w=>n.editor.chain().focus().toggleItalic().run())},[F(u,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:t[2]||(t[2]=w=>n.editor.chain().focus().toggleStrike().run())},[F(f,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:t[3]||(t[3]=w=>n.editor.chain().focus().toggleCode().run())},[F(p,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:t[4]||(t[4]=w=>n.editor.chain().focus().setParagraph().run())},[F(d,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:t[5]||(t[5]=w=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:t[6]||(t[6]=w=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:t[7]||(t[7]=w=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:t[8]||(t[8]=w=>n.editor.chain().focus().toggleBulletList().run())},[F(h,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:t[9]||(t[9]=w=>n.editor.chain().focus().toggleOrderedList().run())},[F(v,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:t[10]||(t[10]=w=>n.editor.chain().focus().toggleBlockquote().run())},[F(g,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:t[11]||(t[11]=w=>n.editor.chain().focus().toggleCodeBlock().run())},[F(S,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:t[12]||(t[12]=w=>n.editor.chain().focus().undo().run())},[F(y,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:t[13]||(t[13]=w=>n.editor.chain().focus().redo().run())},[F(I,{class:"h-3 cursor-pointer fill-current"})],2)])]),_:1})]),T("div",Ym,[T("div",Xm,[T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:t[14]||(t[14]=w=>n.editor.chain().focus().toggleBold().run())},[F(l,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:t[15]||(t[15]=w=>n.editor.chain().focus().toggleItalic().run())},[F(u,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:t[16]||(t[16]=w=>n.editor.chain().focus().toggleStrike().run())},[F(f,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:t[17]||(t[17]=w=>n.editor.chain().focus().toggleCode().run())},[F(p,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:t[18]||(t[18]=w=>n.editor.chain().focus().setParagraph().run())},[F(d,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:t[19]||(t[19]=w=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:t[20]||(t[20]=w=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:t[21]||(t[21]=w=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:t[22]||(t[22]=w=>n.editor.chain().focus().toggleBulletList().run())},[F(h,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:t[23]||(t[23]=w=>n.editor.chain().focus().toggleOrderedList().run())},[F(v,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:t[24]||(t[24]=w=>n.editor.chain().focus().toggleBlockquote().run())},[F(g,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:t[25]||(t[25]=w=>n.editor.chain().focus().toggleCodeBlock().run())},[F(S,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:t[26]||(t[26]=w=>n.editor.chain().focus().undo().run())},[F(y,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:t[27]||(t[27]=w=>n.editor.chain().focus().redo().run())},[F(I,{class:"h-3 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"left"})}]),onClick:t[28]||(t[28]=w=>n.editor.chain().focus().setTextAlign("left").run())},[F(D,{class:"h-5 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"right"})}]),onClick:t[29]||(t[29]=w=>n.editor.chain().focus().setTextAlign("right").run())},[F(C,{class:"h-5 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"justify"})}]),onClick:t[30]||(t[30]=w=>n.editor.chain().focus().setTextAlign("justify").run())},[F(L,{class:"h-5 cursor-pointer fill-current"})],2),T("span",{class:B(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"center"})}]),onClick:t[31]||(t[31]=w=>n.editor.chain().focus().setTextAlign("center").run())},[F(q,{class:"h-5 cursor-pointer fill-current"})],2)])]),F($,{editor:n.editor,class:"box-border relative w-full text-sm leading-8 text-left editor__content"},null,8,["editor"])])):Za("",!0)]))}const ev=wt(Jm,[["render",Qm]]);export{ev as default}; diff --git a/public/build/assets/BaseEditor.ec8bd38c.js b/public/build/assets/BaseEditor.ec8bd38c.js deleted file mode 100644 index 3f73f898..00000000 --- a/public/build/assets/BaseEditor.ec8bd38c.js +++ /dev/null @@ -1,73 +0,0 @@ -var nc=Object.defineProperty,oc=Object.defineProperties;var ic=Object.getOwnPropertyDescriptors;var Mr=Object.getOwnPropertySymbols;var Ko=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable;var Uo=(e,t,r)=>t in e?nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))Ko.call(t,r)&&Uo(e,r,t[r]);if(Mr)for(var r of Mr(t))$o.call(t,r)&&Uo(e,r,t[r]);return e},Tt=(e,t)=>oc(e,ic(t));var Go=(e,t)=>{var r={};for(var n in e)Ko.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mr)for(var n of Mr(e))t.indexOf(n)<0&&$o.call(e,n)&&(r[n]=e[n]);return r};import{bf as sc,a8 as ac,bg as $e,B as xr,D as sn,b1 as Cr,E as ye,bh as cc,a7 as lc,be as uc,u as fc,al as pc,a0 as dc,bi as hc,bj as mc,o as gt,e as Mt,h as A,ai as vc,bk as gc,bl as yc,bm as bc,b6 as kc,C as Sc,aS as Mc,r as Q,l as xc,w as an,f as V,m as L,j as Cc}from"./vendor.fd3b1727.js";import{_ as At}from"./main.fc26c84f.js";function ft(e){this.content=e}ft.prototype={constructor:ft,find:function(e){for(var t=0;t>1}};ft.from=function(e){if(e instanceof ft)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new ft(t)};var Yo=ft;function Xo(e,t,r){for(var n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;var o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){var a=Xo(o.content,i.content,r+1);if(a!=null)return a}r+=o.nodeSize}}function Qo(e,t,r,n){for(var o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};var s=e.child(--o),a=t.child(--i),c=s.nodeSize;if(s==a){r-=c,n-=c;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){for(var l=0,u=Math.min(s.text.length,a.text.length);lt&&n(c,o+a,i,s)!==!1&&c.content.size){var u=a+1;c.nodesBetween(Math.max(0,t-u),Math.min(c.content.size,r-u),n,o+u)}a=l}};k.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)};k.prototype.textBetween=function(t,r,n,o){var i="",s=!0;return this.nodesBetween(t,r,function(a,c){a.isText?(i+=a.text.slice(Math.max(t,c)-c,r-c),s=!n):a.isLeaf&&o?(i+=o,s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i};k.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(var i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=c}return new k(n,o)};k.prototype.cutByIndex=function(t,r){return t==r?k.empty:t==0&&r==this.content.length?this:new k(this.content.slice(t,r))};k.prototype.replaceChild=function(t,r){var n=this.content[t];if(n==r)return this;var o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new k(o,i)};k.prototype.addToStart=function(t){return new k([t].concat(this.content),this.size+t.nodeSize)};k.prototype.addToEnd=function(t){return new k(this.content.concat(t),this.size+t.nodeSize)};k.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var r=0;rthis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,o=0;;n++){var i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?wr(n+1,s):wr(n,o);o=s}};k.prototype.toString=function(){return"<"+this.toStringInner()+">"};k.prototype.toStringInner=function(){return this.content.join(", ")};k.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null};k.fromJSON=function(t,r){if(!r)return k.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(r.map(t.nodeFromJSON))};k.fromArray=function(t){if(!t.length)return k.empty;for(var r,n=0,o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r};P.prototype.removeFromSet=function(t){for(var r=0;r0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t};C.fromJSON=function(t,r){if(!r)return C.empty;var n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new C(k.fromJSON(t,r.content),n,o)};C.maxOpen=function(t,r){r===void 0&&(r=!0);for(var n=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(var s=t.lastChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.lastChild)o++;return new C(t,n,o)};Object.defineProperties(C.prototype,Zo);function ti(e,t,r){var n=e.findIndex(t),o=n.index,i=n.offset,s=e.maybeChild(o),a=e.findIndex(r),c=a.index,l=a.offset;if(i==t||s.isText){if(l!=r&&!e.child(c).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(o!=c)throw new RangeError("Removing non-flat range");return e.replaceChild(o,s.copy(ti(s.content,t-i-1,r-i-1)))}function ei(e,t,r,n){var o=e.findIndex(t),i=o.index,s=o.offset,a=e.maybeChild(i);if(s==t||a.isText)return n&&!n.canReplace(i,i,r)?null:e.cut(0,t).append(r).append(e.cut(t));var c=ei(a.content,t-s-1,r);return c&&e.replaceChild(i,a.copy(c))}C.empty=new C(k.empty,0,0);function Oc(e,t,r){if(r.openStart>e.depth)throw new Jt("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new Jt("Inconsistent open depths");return ri(e,t,r,0)}function ri(e,t,r,n){var o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function Ue(e,t,r,n){var o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(be(e.nodeAfter,n),i++));for(var a=i;ao&&ln(e,t,o+1),s=n.depth>o&&ln(r,n,o+1),a=[];return Ue(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(ni(i,s),be(ke(i,oi(e,t,r,n,o+1)),a)):(i&&be(ke(i,Ar(e,t,o+1)),a),Ue(t,r,o,a),s&&be(ke(s,Ar(r,n,o+1)),a)),Ue(n,null,o,a),new k(a)}function Ar(e,t,r){var n=[];if(Ue(null,e,r,n),e.depth>r){var o=ln(e,t,r+1);be(ke(o,Ar(e,t,r+1)),n)}return Ue(t,null,r,n),new k(n)}function wc(e,t){for(var r=t.depth-e.openStart,n=t.node(r),o=n.copy(e.content),i=r-1;i>=0;i--)o=t.node(i).copy(k.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}var $=function(t,r,n){this.pos=t,this.path=r,this.depth=r.length/3-1,this.parentOffset=n},De={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};$.prototype.resolveDepth=function(t){return t==null?this.depth:t<0?this.depth+t:t};De.parent.get=function(){return this.node(this.depth)};De.doc.get=function(){return this.node(0)};$.prototype.node=function(t){return this.path[this.resolveDepth(t)*3]};$.prototype.index=function(t){return this.path[this.resolveDepth(t)*3+1]};$.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)};$.prototype.start=function(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1};$.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size};$.prototype.before=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]};$.prototype.after=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize};De.textOffset.get=function(){return this.pos-this.path[this.path.length-1]};De.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var r=this.pos-this.path[this.path.length-1],n=e.child(t);return r?e.child(t).cut(r):n};De.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)};$.prototype.posAtIndex=function(t,r){r=this.resolveDepth(r);for(var n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1,i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0};$.prototype.blockRange=function(t,r){if(t===void 0&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new Ge(this,t,n)};$.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset};$.prototype.max=function(t){return t.pos>this.pos?t:this};$.prototype.min=function(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");for(var n=[],o=0,i=r,s=t;;){var a=s.content.findIndex(i),c=a.index,l=a.offset,u=i-l;if(n.push(s,c,o+l),!u||(s=s.child(c),s.isText))break;i=u-1,o+=l+1}return new $(r,n,i)};$.resolveCached=function(t,r){for(var n=0;nt&&this.nodesBetween(t,r,function(i){return n.isInSet(i.marks)&&(o=!0),!o}),o};_t.isBlock.get=function(){return this.type.isBlock};_t.isTextblock.get=function(){return this.type.isTextblock};_t.inlineContent.get=function(){return this.type.inlineContent};_t.isInline.get=function(){return this.type.isInline};_t.isText.get=function(){return this.type.isText};_t.isLeaf.get=function(){return this.type.isLeaf};_t.isAtom.get=function(){return this.type.isAtom};B.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ii(this.marks,t)};B.prototype.contentMatchAt=function(t){var r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r};B.prototype.canReplace=function(t,r,n,o,i){n===void 0&&(n=k.empty),o===void 0&&(o=0),i===void 0&&(i=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(var c=o;c=0;r--)t=e[r].type.name+"("+t+")";return t}var pt=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},_r={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};pt.parse=function(t,r){var n=new Nr(t,r);if(n.next==null)return pt.empty;var o=ai(n);n.next&&n.err("Unexpected trailing text");var i=Bc(Pc(o));return zc(i,n),i};pt.prototype.matchType=function(t){for(var r=0;r>1};pt.prototype.edge=function(t){var r=t<<1;if(r>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[r],next:this.next[r+1]}};pt.prototype.toString=function(){var t=[];function r(n){t.push(n);for(var o=1;o"+t.indexOf(n.next[s+1]);return i}).join(` -`)};Object.defineProperties(pt.prototype,_r);pt.empty=new pt(!0);var Nr=function(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()},si={next:{configurable:!0}};si.next.get=function(){return this.tokens[this.pos]};Nr.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)};Nr.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")};Object.defineProperties(Nr.prototype,si);function ai(e){var t=[];do t.push(Nc(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Nc(e){var t=[];do t.push(Ec(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Ec(e){for(var t=Rc(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=Dc(e,t);else break;return t}function ci(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Dc(e,t){var r=ci(e),n=r;return e.eat(",")&&(e.next!="}"?n=ci(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function Ic(e,t){var r=e.nodeTypes,n=r[t];if(n)return[n];var o=[];for(var i in r){var s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function Rc(e){if(e.eat("(")){var t=ai(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{var r=Ic(e,e.next).map(function(n){return e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}});return e.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}}function Pc(e){var t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,c){var l={term:c,to:a};return t[s].push(l),l}function o(s,a){s.forEach(function(c){return c.to=a})}function i(s,a){if(s.type=="choice")return s.exprs.reduce(function(M,y){return M.concat(i(y,a))},[]);if(s.type=="seq")for(var c=0;;c++){var l=i(s.exprs[c],a);if(c==s.exprs.length-1)return l;o(l,a=r())}else if(s.type=="star"){var u=r();return n(a,u),o(i(s.expr,u),u),[n(u)]}else if(s.type=="plus"){var f=r();return o(i(s.expr,a),f),o(i(s.expr,f),f),[n(f)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){for(var p=a,d=0;d-1&&o[p+1];ui(e,f).forEach(function(h){d||o.push(u,d=[]),d.indexOf(h)==-1&&d.push(h)})}})});for(var i=t[n.join(",")]=new pt(n.indexOf(e.length-1)>-1),s=0;s-1};yt.prototype.allowsMarks=function(t){if(this.markSet==null)return!0;for(var r=0;r-1};var Se=function(t){this.spec={};for(var r in t)this.spec[r]=t[r];this.spec.nodes=Yo.from(t.nodes),this.spec.marks=Yo.from(t.marks),this.nodes=yt.compile(this.spec.nodes,this),this.marks=ie.compile(this.spec.marks,this);var n=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=pt.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?vi(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=u==null?[l]:u==""?[]:vi(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};Se.prototype.node=function(t,r,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof yt){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)};Se.prototype.text=function(t,r){var n=this.nodes.text;return new _c(n,n.defaultAttrs,t,P.setFrom(r))};Se.prototype.mark=function(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)};Se.prototype.nodeFromJSON=function(t){return B.fromJSON(this,t)};Se.prototype.markFromJSON=function(t){return P.fromJSON(this,t)};Se.prototype.nodeType=function(t){var r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r};function vi(e,t){for(var r=[],n=0;n-1)&&r.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}var Lt=function(t,r){var n=this;this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(function(o){o.tag?n.tags.push(o):o.style&&n.styles.push(o)}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=t.nodes[o.node];return i.contentMatch.matchType(i)})};Lt.prototype.parse=function(t,r){r===void 0&&(r={});var n=new K(this,r,!1);return n.addAll(t,null,r.from,r.to),n.finish()};Lt.prototype.parseSlice=function(t,r){r===void 0&&(r={});var n=new K(this,r,!0);return n.addAll(t,null,r.from,r.to),C.maxOpen(n.finish())};Lt.prototype.matchTag=function(t,r,n){for(var o=n?this.tags.indexOf(n)+1:0;ot.length&&(s.style.charCodeAt(t.length)!=61||s.style.slice(t.length+1)!=r))){if(s.getAttrs){var a=s.getAttrs(r);if(a===!1)continue;s.attrs=a}return s}}};Lt.schemaRules=function(t){var r=[];function n(c){for(var l=c.priority==null?50:c.priority,u=0;u=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]};Zt.prototype.applyPending=function(t){for(var r=0,n=this.pendingMarks;r=0;o--){var i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(var a=0;athis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}};K.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)};K.prototype.sync=function(t){for(var r=this.open;r>=0;r--)if(this.nodes[r]==t){this.open=r;return}};mn.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var r=this.nodes[t].content,n=r.length-1;n>=0;n--)e+=r[n].nodeSize;t&&e++}return e};K.prototype.findAtPoint=function(t,r){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=function(c,l){for(;c>=0;c--){var u=n[c];if(u==""){if(c==n.length-1||c==0)continue;for(;l>=s;l--)if(a(c-1,l))return!0;return!1}else{var f=l>0||l==0&&i?r.nodes[l].type:o&&l>=s?o.node(l-s).type:null;if(!f||f.name!=u&&f.groups.indexOf(u)==-1)return!1;l--}}return!0};return a(n.length-1,this.open)};K.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var r=t.depth;r>=0;r--){var n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}};K.prototype.addPendingMark=function(t){var r=qc(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)};K.prototype.removePendingMark=function(t,r){for(var n=this.open;n>=0;n--){var o=this.nodes[n],i=o.pendingMarks.lastIndexOf(t);if(i>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}};Object.defineProperties(K.prototype,mn);function Fc(e){for(var t=e.firstChild,r=null;t;t=t.nextSibling){var n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&gi.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function Vc(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Hc(e){for(var t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];r=t.exec(e);)n.push(r[1],r[2].trim());return n}function bi(e){var t={};for(var r in e)t[r]=e[r];return t}function jc(e,t){var r=t.schema.nodes,n=function(s){var a=r[s];if(!!a.allowsMarkType(e)){var c=[],l=function(u){c.push(u);for(var f=0;f=0;o--){var i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n};ot.prototype.serializeMark=function(t,r,n){n===void 0&&(n={});var o=this.marks[t.type.name];return o&&ot.renderSpec(vn(n),o(t,r))};ot.renderSpec=function(t,r,n){if(n===void 0&&(n=null),typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;var o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));var s=null,a=n?t.createElementNS(n,o):t.createElement(o),c=r[1],l=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){l=2;for(var u in c)if(c[u]!=null){var f=u.indexOf(" ");f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):a.setAttribute(u,c[u])}}for(var p=l;pl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{var h=ot.renderSpec(t,d,n),v=h.dom,g=h.contentDOM;if(a.appendChild(v),g){if(s)throw new RangeError("Multiple content holes");s=g}}}return{dom:a,contentDOM:s}};ot.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new ot(this.nodesFromSchema(t),this.marksFromSchema(t)))};ot.nodesFromSchema=function(t){var r=ki(t.nodes);return r.text||(r.text=function(n){return n.text}),r};ot.marksFromSchema=function(t){return ki(t.marks)};function ki(e){var t={};for(var r in e){var n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function vn(e){return e.document||window.document}var Si=65535,Mi=Math.pow(2,16);function Jc(e,t){return e+t*Mi}function xi(e){return e&Si}function Wc(e){return(e-(e&Si))/Mi}var gn=function(t,r,n){r===void 0&&(r=!1),n===void 0&&(n=null),this.pos=t,this.deleted=r,this.recover=n},it=function(t,r){r===void 0&&(r=!1),this.ranges=t,this.inverted=r};it.prototype.recover=function(t){var r=0,n=xi(t);if(!this.inverted)for(var o=0;ot)break;var l=this.ranges[a+i],u=this.ranges[a+s],f=c+l;if(t<=f){var p=l?t==c?-1:t==f?1:r:r,d=c+o+(p<0?0:u);if(n)return d;var h=t==(r<0?c:f)?null:Jc(a/3,t-c);return new gn(d,r<0?t!=c:t!=f,h)}o+=u-l}return n?t+o:new gn(t+o)};it.prototype.touches=function(t,r){for(var n=0,o=xi(r),i=this.inverted?2:1,s=this.inverted?1:2,a=0;at)break;var l=this.ranges[a+i],u=c+l;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-l}return!1};it.prototype.forEach=function(t){for(var r=this.inverted?2:1,n=this.inverted?1:2,o=0,i=0;o=0;r--){var o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:null)}};dt.prototype.invert=function(){var t=new dt;return t.appendMappingInverted(this),t};dt.prototype.map=function(t,r){if(r===void 0&&(r=1),this.mirror)return this._map(t,r,!0);for(var n=this.from;ni&&c0};X.prototype.addStep=function(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r};Object.defineProperties(X.prototype,yn);function Er(){throw new Error("Override me")}var bn=Object.create(null),ht=function(){};ht.prototype.apply=function(t){return Er()};ht.prototype.getMap=function(){return it.empty};ht.prototype.invert=function(t){return Er()};ht.prototype.map=function(t){return Er()};ht.prototype.merge=function(t){return null};ht.prototype.toJSON=function(){return Er()};ht.fromJSON=function(t,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=bn[r.stepType];if(!n)throw new RangeError("No step type "+r.stepType+" defined");return n.fromJSON(t,r)};ht.jsonID=function(t,r){if(t in bn)throw new RangeError("Duplicate use of step JSON ID "+t);return bn[t]=r,r.prototype.jsonID=t,r};var bt=function(t,r){this.doc=t,this.failed=r};bt.ok=function(t){return new bt(t,null)};bt.fail=function(t){return new bt(null,t)};bt.fromReplace=function(t,r,n,o){try{return bt.ok(t.replace(r,n,o))}catch(i){if(i instanceof Jt)return bt.fail(i.message);throw i}};var te=function(e){function t(r,n,o,i){e.call(this),this.from=r,this.to=n,this.slice=o,this.structure=!!i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){return this.structure&&kn(n,this.from,this.to)?bt.fail("Structure replace would overwrite content"):bt.fromReplace(n,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new it([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(n){return new t(this.from,this.from+this.slice.size,n.slice(this.from,this.to))},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new t(o.pos,Math.max(o.pos,i.pos),this.slice)},t.prototype.merge=function(n){if(!(n instanceof t)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){var o=this.slice.size+n.slice.size==0?C.empty:new C(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new t(this.from,this.to+(n.to-n.from),o,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){var i=this.slice.size+n.slice.size==0?C.empty:new C(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new t(n.from,this.to,i,this.structure)}else return null},t.prototype.toJSON=function(){var n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(o.from,o.to,C.fromJSON(n,o.slice),!!o.structure)},t}(ht);ht.jsonID("replace",te);var xt=function(e){function t(r,n,o,i,s,a,c){e.call(this),this.from=r,this.to=n,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=!!c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){if(this.structure&&(kn(n,this.from,this.gapFrom)||kn(n,this.gapTo,this.to)))return bt.fail("Structure gap-replace would overwrite content");var o=n.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return bt.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?bt.fromReplace(n,this.from,this.to,i):bt.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new it([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(n){var o=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1),s=n.map(this.gapFrom,-1),a=n.map(this.gapTo,1);return o.deleted&&i.deleted||si.pos?null:new t(o.pos,i.pos,s,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(o.from,o.to,o.gapFrom,o.gapTo,C.fromJSON(n,o.slice),o.insert,!!o.structure)},t}(ht);ht.jsonID("replaceAround",xt);function kn(e,t,r){for(var n=e.resolve(t),o=r-t,i=n.depth;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0)for(var s=n.node(i).maybeChild(n.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Kc(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function Pe(e){for(var t=e.parent,r=t.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nt;f--)p||r.index(f)>0?(p=!0,l=k.from(r.node(f).copy(l)),u++):a--;for(var d=k.empty,h=0,v=o,g=!1;v>t;v--)g||n.after(v+1)=0;n--)r=k.from(t[n].type.create(t[n].attrs,r));var o=e.start,i=e.end;return this.step(new xt(o,i,o,i,new C(r,0,0),t.length,!0))};X.prototype.setBlockType=function(e,t,r,n){var o=this;if(t===void 0&&(t=e),!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(e,t,function(s,a){if(s.isTextblock&&!s.hasMarkup(r,n)&&Gc(o.doc,o.mapping.slice(i).map(a),r)){o.clearIncompatible(o.mapping.slice(i).map(a,1),r);var c=o.mapping.slice(i),l=c.map(a,1),u=c.map(a+s.nodeSize,1);return o.step(new xt(l,u,l+1,u-1,new C(k.from(r.create(n,null,s.marks)),0,0),1,!0)),!1}}),this};function Gc(e,t,r){var n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}X.prototype.setNodeMarkup=function(e,t,r,n){var o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(r,null,n||o.marks);if(o.isLeaf)return this.replaceWith(e,e+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new xt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new C(k.from(i),0,0),1,!0))};function ee(e,t,r,n){r===void 0&&(r=1);var o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=r-2;a>i;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var f=l.content.cutByIndex(u,l.childCount),p=n&&n[c]||l;if(p!=l&&(f=f.replaceChild(0,p.type.create(p.attrs))),!l.canReplace(u+1,l.childCount)||!p.type.validContent(f))return!1}var d=o.indexAfter(i),h=n&&n[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)}X.prototype.split=function(e,t,r){t===void 0&&(t=1);for(var n=this.doc.resolve(e),o=k.empty,i=k.empty,s=n.depth,a=n.depth-t,c=t-1;s>a;s--,c--){o=k.from(n.node(s).copy(o));var l=r&&r[c];i=k.from(l?l.type.create(l.attrs,i):n.node(s).copy(i))}return this.step(new te(e,e,new C(o.append(i),t,t),!0))};function Mn(e,t){var r=e.resolve(t),n=r.index();return Yc(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function Yc(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}X.prototype.join=function(e,t){t===void 0&&(t=1);var r=new te(e-t,e+t,C.empty,!0);return this.step(r)};function Xc(e,t,r){var n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(var o=n.depth-1;o>=0;o--){var i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(var s=n.depth-1;s>=0;s--){var a=n.indexAfter(s);if(n.node(s).canReplaceWith(a,a,r))return n.after(s+1);if(a=0;a--){var c=a==n.depth?0:n.pos<=(n.start(a+1)+n.end(a+1))/2?-1:1,l=n.index(a)+(c>0?1:0),u=n.node(a),f=!1;if(s==1)f=u.canReplace(l,l,o);else{var p=u.contentMatchAt(l).findWrapping(o.firstChild.type);f=p&&u.canReplaceWith(l,l,p[0])}if(f)return c==0?n.pos:c<0?n.before(a+1):n.after(a+1)}return null}function xn(e,t,r){for(var n=[],o=0;o=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(n){if(n instanceof t&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new t(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(o.from,o.to,n.markFromJSON(o.mark))},t}(ht);ht.jsonID("addMark",Cn);var Qe=function(e){function t(r,n,o){e.call(this),this.from=r,this.to=n,this.mark=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){var o=this,i=n.slice(this.from,this.to),s=new C(xn(i.content,function(a){return a.mark(o.mark.removeFromSet(a.marks))}),i.openStart,i.openEnd);return bt.fromReplace(n,this.from,this.to,s)},t.prototype.invert=function(){return new Cn(this.from,this.to,this.mark)},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(n){if(n instanceof t&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new t(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(o.from,o.to,n.markFromJSON(o.mark))},t}(ht);ht.jsonID("removeMark",Qe);X.prototype.addMark=function(e,t,r){var n=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(e,t,function(c,l,u){if(!!c.isInline){var f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){for(var p=Math.max(l,e),d=Math.min(l+c.nodeSize,t),h=r.addToSet(f),v=0;v=0;p--)this.step(o[p]);return this};function Qc(e,t,r,n){if(r===void 0&&(r=t),n===void 0&&(n=C.empty),t==r&&!n.size)return null;var o=e.resolve(t),i=e.resolve(r);return wi(o,i,n)?new te(t,r,n):new It(o,i,n).fit()}X.prototype.replace=function(e,t,r){t===void 0&&(t=e),r===void 0&&(r=C.empty);var n=Qc(this.doc,e,t,r);return n&&this.step(n),this};X.prototype.replaceWith=function(e,t,r){return this.replace(e,t,new C(k.from(r),0,0))};X.prototype.delete=function(e,t){return this.replace(e,t,C.empty)};X.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};function wi(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}var It=function(t,r,n){this.$to=r,this.$from=t,this.unplaced=n,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=k.empty;for(var s=t.depth;s>0;s--)this.placed=k.from(t.node(s).copy(this.placed))},Ti={depth:{configurable:!0}};Ti.depth.get=function(){return this.frontier.length-1};It.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var r=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(r<0?this.$to:o.doc.resolve(r));if(!i)return null;for(var s=this.placed,a=o.depth,c=i.depth;a&&c&&s.childCount==1;)s=s.firstChild.content,a--,c--;var l=new C(s,a,c);if(r>-1)return new xt(o.pos,r,this.$to.pos,this.$to.end(),l,n);if(l.size||o.pos!=this.$to.pos)return new te(o.pos,i.pos,l)};It.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var r=this.unplaced.openStart;r>=0;r--){var n=void 0,o=void 0;r?(o=On(this.unplaced.content,r-1).firstChild,n=o.content):n=this.unplaced.content;for(var i=n.firstChild,s=this.depth;s>=0;s--){var a=this.frontier[s],c=a.type,l=a.match,u=void 0,f=void 0;if(t==1&&(i?l.matchType(i.type)||(f=l.fillBefore(k.from(i),!1)):c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(t==2&&i&&(u=l.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&l.matchType(o.type))break}}};It.prototype.openMore=function(){var t=this.unplaced,r=t.content,n=t.openStart,o=t.openEnd,i=On(r,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new C(r,n+1,Math.max(o,i.size+n>=r.size-o?n+1:0)),!0)};It.prototype.dropNode=function(){var t=this.unplaced,r=t.content,n=t.openStart,o=t.openEnd,i=On(r,n);if(i.childCount<=1&&n>0){var s=r.size-n<=n+i.size;this.unplaced=new C(Ze(r,n-1,1),n-1,s?n-1:o)}else this.unplaced=new C(Ze(r,n,1),n,o)};It.prototype.placeNodes=function(t){for(var r=t.sliceDepth,n=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a1||u==0||y.content.size)&&(h=R,p.push(Ai(y.mark(v.allowedMarks(y.marks)),f==1?u:0,f==l.childCount?M:-1)))}var m=f==l.childCount;m||(M=-1),this.placed=tr(this.placed,n,k.from(p)),this.frontier[n].match=h,m&&M<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var I=0,O=l;I1&&i==this.$to.end(--o);)++i;return i};It.prototype.findCloseLevel=function(t){t:for(var r=Math.min(this.depth,t.depth);r>=0;r--){var n=this.frontier[r],o=n.match,i=n.type,s=r=0;c--){var l=this.frontier[c],u=l.match,f=l.type,p=wn(t,c,f,u,!0);if(!p||p.childCount)continue t}return{depth:r,fit:a,move:s?t.doc.resolve(t.after(r+1)):t}}}};It.prototype.close=function(t){var r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=tr(this.placed,r.depth,r.fit)),t=r.move;for(var n=r.depth+1;n<=t.depth;n++){var o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t};It.prototype.openFrontierNode=function(t,r,n){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=tr(this.placed,this.depth,k.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})};It.prototype.closeFrontierNode=function(){var t=this.frontier.pop(),r=t.match.fillBefore(k.empty,!0);r.childCount&&(this.placed=tr(this.placed,this.frontier.length,r))};Object.defineProperties(It.prototype,Ti);function Ze(e,t,r){return t==0?e.cutByIndex(r):e.replaceChild(0,e.firstChild.copy(Ze(e.firstChild.content,t-1,r)))}function tr(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(tr(e.lastChild.content,t-1,r)))}function On(e,t){for(var r=0;r1&&(n=n.replaceChild(0,Ai(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(k.empty,!0)))),e.copy(n)}function wn(e,t,r,n,o){var i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;var a=n.fillBefore(i.content,!0,s);return a&&!Zc(r,i.content,s)?a:null}function Zc(e,t,r){for(var n=r;n0;a--,c--){var l=n.node(a).type.spec;if(l.defining||l.isolating)break;i.indexOf(a)>-1?s=a:n.before(a)==c&&i.splice(1,0,-a)}for(var u=i.indexOf(s),f=[],p=r.openStart,d=r.content,h=0;;h++){var v=d.firstChild;if(f.push(v),h==r.openStart)break;d=v.content}p>0&&f[p-1].type.spec.defining&&n.node(u).type!=f[p-1].type?p-=1:p>=2&&f[p-1].isTextblock&&f[p-2].type.spec.defining&&n.node(u).type!=f[p-2].type&&(p-=2);for(var g=r.openStart;g>=0;g--){var M=(g+p+1)%(r.openStart+1),y=f[M];if(!!y)for(var R=0;R=0&&(this.replace(e,t,r),!(this.steps.length>J));U--){var T=i[U];T<0||(e=n.before(T),t=o.after(T))}return this};function _i(e,t,r,n,o){if(tn){var s=o.contentMatchAt(0),a=s.fillBefore(e).append(e);e=a.append(s.matchFragment(a).fillBefore(k.empty,!0))}return e}X.prototype.replaceRangeWith=function(e,t,r){if(!r.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var n=Xc(this.doc,e,r.type);n!=null&&(e=t=n)}return this.replaceRange(e,t,new C(k.from(r),0,0))};X.prototype.deleteRange=function(e,t){for(var r=this.doc.resolve(e),n=this.doc.resolve(t),o=Ni(r,n),i=0;i0&&(a||r.node(s-1).canReplace(r.index(s-1),n.indexAfter(s-1))))return this.delete(r.before(s),n.after(s))}for(var c=1;c<=r.depth&&c<=n.depth;c++)if(e-r.start(c)==r.depth-c&&t>r.end(c)&&n.end(c)-t!=n.depth-c)return this.delete(r.before(c),t);return this.delete(e,t)};function Ni(e,t){for(var r=[],n=Math.min(e.depth,t.depth),o=n;o>=0;o--){var i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;i==t.start(o)&&r.push(o)}return r}var Tn=Object.create(null),D=function(t,r,n){this.ranges=n||[new tl(t.min(r),t.max(r))],this.$anchor=t,this.$head=r},se={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};se.anchor.get=function(){return this.$anchor.pos};se.head.get=function(){return this.$head.pos};se.from.get=function(){return this.$from.pos};se.to.get=function(){return this.$to.pos};se.$from.get=function(){return this.ranges[0].$from};se.$to.get=function(){return this.ranges[0].$to};se.empty.get=function(){for(var e=this.ranges,t=0;t=0;i--){var s=r<0?Be(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Be(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}};D.near=function(t,r){return r===void 0&&(r=1),this.findFrom(t,r)||this.findFrom(t,-r)||new re(t.node(0))};D.atStart=function(t){return Be(t,t,0,0,1)||new re(t)};D.atEnd=function(t){return Be(t,t,t.content.size,t.childCount,-1)||new re(t)};D.fromJSON=function(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Tn[r.type];if(!n)throw new RangeError("No selection type "+r.type+" defined");return n.fromJSON(t,r)};D.jsonID=function(t,r){if(t in Tn)throw new RangeError("Duplicate use of selection JSON ID "+t);return Tn[t]=r,r.prototype.jsonID=t,r};D.prototype.getBookmark=function(){return H.between(this.$anchor,this.$head).getBookmark()};Object.defineProperties(D.prototype,se);D.prototype.visible=!0;var tl=function(t,r){this.$from=t,this.$to=r},H=function(e){function t(n,o){o===void 0&&(o=n),e.call(this,n,o)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={$cursor:{configurable:!0}};return r.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(o,i){var s=o.resolve(i.map(this.head));if(!s.parent.inlineContent)return e.near(s);var a=o.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:s,s)},t.prototype.replace=function(o,i){if(i===void 0&&(i=C.empty),e.prototype.replace.call(this,o,i),i==C.empty){var s=this.$from.marksAcross(this.$to);s&&o.ensureMarks(s)}},t.prototype.eq=function(o){return o instanceof t&&o.anchor==this.anchor&&o.head==this.head},t.prototype.getBookmark=function(){return new er(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(o.resolve(i.anchor),o.resolve(i.head))},t.create=function(o,i,s){s===void 0&&(s=i);var a=o.resolve(i);return new this(a,s==i?a:o.resolve(s))},t.between=function(o,i,s){var a=o.pos-i.pos;if((!s||a)&&(s=a>=0?1:-1),!i.parent.inlineContent){var c=e.findFrom(i,s,!0)||e.findFrom(i,-s,!0);if(c)i=c.$head;else return e.near(i,s)}return o.parent.inlineContent||(a==0?o=i:(o=(e.findFrom(o,-s,!0)||e.findFrom(o,s,!0)).$anchor,o.pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&E.isSelectable(a))return E.create(e,r-(o<0?a.nodeSize:0))}else{var c=Be(e,a,r+o,o<0?a.childCount:0,o,i);if(c)return c}r+=a.nodeSize*o}}function Ei(e,t,r){var n=e.steps.length-1;if(!(n0},t.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=Ir,this},t.prototype.ensureMarks=function(o){return P.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},t.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},r.storedMarksSet.get=function(){return(this.updated&Ir)>0},t.prototype.addStep=function(o,i){e.prototype.addStep.call(this,o,i),this.updated=this.updated&~Ir,this.storedMarks=null},t.prototype.setTime=function(o){return this.time=o,this},t.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},t.prototype.replaceSelectionWith=function(o,i){var s=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||P.none))),s.replaceWith(this,o),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(o,i,s){s===void 0&&(s=i);var a=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(a.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,s);var c=this.storedMarks;if(!c){var l=this.doc.resolve(i);c=s==i?l.marks():l.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(i,s,a.text(o,c)),this.selection.empty||this.setSelection(D.near(this.selection.$to)),this},t.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},t.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},r.isGeneric.get=function(){for(var n in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=Ii,this},r.scrolledIntoView.get=function(){return(this.updated&Ii)>0},Object.defineProperties(t.prototype,r),t}(X);function Ri(e,t){return!t||!e?e:e.bind(t)}var rr=function(t,r,n){this.name=t,this.init=Ri(r.init,n),this.apply=Ri(r.apply,n)},nl=[new rr("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new rr("selection",{init:function(t,r){return t.selection||D.atStart(r.doc)},apply:function(t){return t.selection}}),new rr("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,r,n,o){return o.selection.$cursor?t.storedMarks:null}}),new rr("scrollToSelection",{init:function(){return 0},apply:function(t,r){return t.scrolledIntoView?r+1:r}})],An=function(t,r){var n=this;this.schema=t,this.fields=nl.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),r&&r.forEach(function(o){if(n.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");n.plugins.push(o),n.pluginsByKey[o.key]=o,o.spec.state&&n.fields.push(new rr(o.key,o.spec.state,o))})},mt=function(t){this.config=t},Rr={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Rr.schema.get=function(){return this.config.schema};Rr.plugins.get=function(){return this.config.plugins};mt.prototype.apply=function(t){return this.applyTransaction(t).state};mt.prototype.filterTransaction=function(t,r){r===void 0&&(r=-1);for(var n=0;n-1&&nr.splice(r,1)};Object.defineProperties(mt.prototype,Rr);var nr=[];function Pi(e,t,r){for(var n in e){var o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=Pi(o,t,{})),r[n]=o}return r}var Rt=function(t){this.props={},t.props&&Pi(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Bi("plugin")};Rt.prototype.getState=function(t){return t[this.key]};var _n=Object.create(null);function Bi(e){return e in _n?e+"$"+ ++_n[e]:(_n[e]=0,e+"$")}var Wt=function(t){t===void 0&&(t="key"),this.key=Bi(t)};Wt.prototype.get=function(t){return t.config.pluginsByKey[this.key]};Wt.prototype.getState=function(t){return t[this.key]};var x={};if(typeof navigator!="undefined"&&typeof document!="undefined"){var Nn=/Edge\/(\d+)/.exec(navigator.userAgent),zi=/MSIE \d/.test(navigator.userAgent),En=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);x.mac=/Mac/.test(navigator.platform);var Dn=x.ie=!!(zi||En||Nn);x.ie_version=zi?document.documentMode||6:En?+En[1]:Nn?+Nn[1]:null,x.gecko=!Dn&&/gecko\/(\d+)/i.test(navigator.userAgent),x.gecko_version=x.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var In=!Dn&&/Chrome\/(\d+)/.exec(navigator.userAgent);x.chrome=!!In,x.chrome_version=In&&+In[1],x.safari=!Dn&&/Apple Computer/.test(navigator.vendor),x.ios=x.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),x.android=/Android \d/.test(navigator.userAgent),x.webkit="webkitFontSmoothing"in document.documentElement.style,x.webkit_version=x.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Pt=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Rn=function(e){var t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Li=null,ne=function(e,t,r){var n=Li||(Li=document.createRange());return n.setEnd(e,r==null?e.nodeValue.length:r),n.setStart(e,t||0),n},Pr=function(e,t,r,n){return r&&(Fi(e,t,r,n,-1)||Fi(e,t,r,n,1))},ol=/^(img|br|input|textarea|hr)$/i;function Fi(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:Kt(e))){var i=e.parentNode;if(i.nodeType!=1||sl(e)||ol.test(e.nodeName)||e.contentEditable=="false")return!1;t=Pt(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?Kt(e):0}else return!1}}function Kt(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function il(e,t,r){for(var n=t==0,o=t==Kt(e);n||o;){if(e==r)return!0;var i=Pt(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==Kt(e)}}function sl(e){for(var t,r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Pn=function(e){var t=e.isCollapsed;return t&&x.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function ze(e,t){var r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function al(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ae(e,t){return typeof e=="number"?e:e[t]}function cl(e){var t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Vi(e,t,r){for(var n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=r||e.dom;s;s=Rn(s))if(s.nodeType==1){var a=s==i.body||s.nodeType!=1,c=a?al(i):cl(s),l=0,u=0;if(t.topc.bottom-ae(n,"bottom")&&(u=t.bottom-c.bottom+ae(o,"bottom")),t.leftc.right-ae(n,"right")&&(l=t.right-c.right+ae(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var f=s.scrollLeft,p=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var d=s.scrollLeft-f,h=s.scrollTop-p;t={left:t.left-d,top:t.top-h,right:t.right-d,bottom:t.bottom-h}}if(a)break}}function ll(e){for(var t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o,i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=c.top;break}}}return{refDOM:n,refTop:o,stack:Hi(e.dom)}}function Hi(e){for(var t=[],r=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=r);e=Rn(e));return t}function ul(e){var t=e.refDOM,r=e.refTop,n=e.stack,o=t?t.getBoundingClientRect().top:0;ji(n,o==0?0:o-r)}function ji(e,t){for(var r=0;r=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);var d=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}!r&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=l+1)}}return r&&r.nodeType==3?pl(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:qi(r,o)}function pl(e,t){for(var r=e.nodeValue.length,n=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Bn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dl(e,t){var r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}function ml(e,t,r,n){for(var o=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>n.left||a.top>n.top)o=s.posBefore;else if(a.right-1?o:e.docView.posFromDOM(t,r)}function Ji(e,t,r){var n=e.childNodes.length;if(n&&r.topt.top&&s++}i==e.dom&&s==i.childNodes.length-1&&i.lastChild.nodeType==1&&t.top>i.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:(s==0||i.nodeType!=1||i.childNodes[s-1].nodeName!="BR")&&(u=ml(e,i,s,t))}u==null&&(u=hl(e,l,t));var v=e.docView.nearestDesc(l,!0);return{pos:u,inside:v?v.posAtStart-v.border:-1}}function ce(e,t){var r=e.getClientRects();return r.length?r[t<0?0:r.length-1]:e.getBoundingClientRect()}var gl=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Wi(e,t,r){var n=e.docView.domFromPos(t,r<0?-1:1),o=n.node,i=n.offset,s=x.webkit||x.gecko;if(o.nodeType==3)if(s&&(gl.test(o.nodeValue)||(r<0?!i:i==o.nodeValue.length))){var a=ce(ne(o,i,i),r);if(x.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0&&i==o.nodeValue.length?(u--,p=1):r<0?u--:f++,or(ce(ne(o,u,f),p),p<0)}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(r<0||i==Kt(o))){var d=o.childNodes[i-1];if(d.nodeType==1)return zn(d.getBoundingClientRect(),!1)}if(i=0)}if(i&&(r<0||i==Kt(o))){var v=o.childNodes[i-1],g=v.nodeType==3?ne(v,Kt(v)-(s?0:1)):v.nodeType==1&&(v.nodeName!="BR"||!v.nextSibling)?v:null;if(g)return or(ce(g,1),!1)}if(i=0)}function or(e,t){if(e.width==0)return e;var r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function zn(e,t){if(e.height==0)return e;var r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function Ki(e,t,r){var n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function yl(e,t,r){var n=t.selection,o=r=="up"?n.$from:n.$to;return Ki(e,t,function(){for(var i=e.docView.domFromPos(o.pos,r=="up"?-1:1),s=i.node;;){var a=e.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.dom;break}s=a.dom.parentNode}for(var c=Wi(e,o.pos,1),l=s.firstChild;l;l=l.nextSibling){var u=void 0;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=ne(l,0,l.nodeValue.length).getClientRects();else continue;for(var f=0;fp.top&&(r=="up"?p.bottomc.bottom-1))return!1}}return!0})}var bl=/[\u0590-\u08ac]/;function kl(e,t,r){var n=t.selection,o=n.$head;if(!o.parent.isTextblock)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size,c=e.root.getSelection();return!bl.test(o.parent.textContent)||!c.modify?r=="left"||r=="backward"?s:a:Ki(e,t,function(){var l=c.getRangeAt(0),u=c.focusNode,f=c.focusOffset,p=c.caretBidiLevel;c.modify("move",r,"character");var d=o.depth?e.docView.domAfterPos(o.before()):e.dom,h=!d.contains(c.focusNode.nodeType==1?c.focusNode:c.focusNode.parentNode)||u==c.focusNode&&f==c.focusOffset;return c.removeAllRanges(),c.addRange(l),p!=null&&(c.caretBidiLevel=p),h})}var $i=null,Ui=null,Gi=!1;function Sl(e,t,r){return $i==t&&Ui==r?Gi:($i=t,Ui=r,Gi=r=="up"||r=="down"?yl(e,t,r):kl(e,t,r))}var Ft=0,Yi=1,ir=2,le=3,W=function(t,r,n,o){this.parent=t,this.children=r,this.dom=n,n.pmViewDesc=this,this.contentDOM=o,this.dirty=Ft},$t={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0}};W.prototype.matchesWidget=function(){return!1};W.prototype.matchesMark=function(){return!1};W.prototype.matchesNode=function(){return!1};W.prototype.matchesHack=function(t){return!1};$t.beforePosition.get=function(){return!1};W.prototype.parseRule=function(){return null};W.prototype.stopEvent=function(){return!1};$t.size.get=function(){for(var e=0,t=0;tPt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))c=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(var l=t;;l=l.parentNode){if(l==this.dom){c=!1;break}if(l.parentNode.firstChild!=l)break}if(c==null&&r==t.childNodes.length)for(var u=t;;u=u.parentNode){if(u==this.dom){c=!0;break}if(u.parentNode.lastChild!=u)break}}return(c==null?n>0:c)?this.posAtEnd:this.posAtStart};W.prototype.nearestDesc=function(t,r){for(var n=!0,o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i&&(!r||i.node))if(n&&i.nodeDOM&&!(i.nodeDOM.nodeType==1?i.nodeDOM.contains(t.nodeType==1?t:t.parentNode):i.nodeDOM==t))n=!1;else return i}};W.prototype.getDesc=function(t){for(var r=t.pmViewDesc,n=r;n;n=n.parent)if(n==this)return r};W.prototype.posFromDOM=function(t,r,n){for(var o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1};W.prototype.descAt=function(t){for(var r=0,n=0;r=t:a>t)&&(a>t||o+1>=this.children.length||!this.children[o+1].beforePosition))return s.domFromPos(t-n-s.border,r);n=a}};W.prototype.parseRange=function(t,r,n){if(n===void 0&&(n=0),this.children.length==0)return{node:this.contentDOM,from:t,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var o=-1,i=-1,s=n,a=0;;a++){var c=this.children[a],l=s+c.size;if(o==-1&&t<=l){var u=s+c.border;if(t>=u&&r<=l-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,r,u);t=s;for(var f=a;f>0;f--){var p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=Pt(p.dom)+1;break}t-=p.size}o==-1&&(o=0)}if(o>-1&&(l>r||a==this.children.length-1)){r=l;for(var d=a+1;dc&&sr){var F=f;f=p,p=F}var J=document.createRange();J.setEnd(p.node,p.offset),J.setStart(f.node,f.offset),d.removeAllRanges(),d.addRange(J)}}};W.prototype.ignoreMutation=function(t){return!this.contentDOM&&t.type!="selection"};$t.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)};W.prototype.markDirty=function(t,r){for(var n=0,o=0;o=n:tn){var a=n+i.border,c=s-i.border;if(t>=a&&r<=c){this.dirty=t==n||r==s?ir:Yi,t==a&&r==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=le:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM?ir:le}n=s}this.dirty=ir};W.prototype.markParentsDirty=function(){for(var t=1,r=this.parent;r;r=r.parent,t++){var n=t==1?ir:Yi;r.dirty0&&(a=Hn(a,0,n,i));for(var l=0;l-1?l:null,f=l&&l.pos<0,p=new Bt(this,u&&u.node);_l(this.node,this.innerDeco,function(d,h,v){d.spec.marks?p.syncToMarks(d.spec.marks,a,o):d.type.side>=0&&!v&&p.syncToMarks(h==s.node.childCount?P.none:s.node.child(h).marks,a,o),p.placeWidget(d,o,c)},function(d,h,v,g){p.syncToMarks(d.marks,a,o);var M;p.findNodeMatch(d,h,v,g)||f&&o.state.selection.from>c&&o.state.selection.to-1&&p.updateNodeAt(d,h,v,M,o)||p.updateNextNode(d,h,v,o,g)||p.addNode(d,h,v,o,c),c+=d.nodeSize}),p.syncToMarks(ue,a,o),this.node.isTextblock&&p.addTextblockHacks(),p.destroyRest(),(p.changed||this.dirty==ir)&&(u&&this.protectLocalComposition(o,u),Zi(this.contentDOM,this.children,o),x.ios&&Nl(this.dom))},t.prototype.localCompositionInfo=function(o,i){var s=o.state.selection,a=s.from,c=s.to;if(!(!(o.state.selection instanceof H)||ai+this.node.content.size)){var l=o.root.getSelection(),u=El(l.focusNode,l.focusOffset);if(!(!u||!this.dom.contains(u.parentNode)))if(this.node.inlineContent){var f=u.nodeValue,p=Dl(this.node.content,f,a-i,c-i);return p<0?null:{node:u,pos:p,text:f}}else return{node:u,pos:-1}}},t.prototype.protectLocalComposition=function(o,i){var s=i.node,a=i.pos,c=i.text;if(!this.getDesc(s)){for(var l=s;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=null)}var u=new xl(this,l,s,c);o.compositionNodes.push(u),this.children=Hn(this.children,a,a+c.length,o,u)}},t.prototype.update=function(o,i,s,a){return this.dirty==le||!o.sameMarkup(this.node)?!1:(this.updateInner(o,i,s,a),!0)},t.prototype.updateInner=function(o,i,s,a){this.updateOuterDeco(i),this.node=o,this.innerDeco=s,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=Ft},t.prototype.updateOuterDeco=function(o){if(!Vn(o,this.outerDeco)){var i=this.nodeDOM.nodeType!=1,s=this.dom;this.dom=ts(this.dom,this.nodeDOM,Fn(this.outerDeco,this.node,i),Fn(o,this.node,i)),this.dom!=s&&(s.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=o}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")},r.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(t.prototype,r),t}(W);function Xi(e,t,r,n,o){return es(n,t,e),new sr(null,e,t,r,n,n,n,o,0)}var Qi=function(e){function t(n,o,i,s,a,c,l){e.call(this,n,o,i,s,a,null,c,l)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var o=this.nodeDOM.parentNode;o&&o!=this.dom&&!o.pmIsDeco;)o=o.parentNode;return{skip:o||!0}},t.prototype.update=function(o,i,s,a){return this.dirty==le||this.dirty!=Ft&&!this.inParent()||!o.sameMarkup(this.node)?!1:(this.updateOuterDeco(i),(this.dirty!=Ft||o.text!=this.node.text)&&o.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=o.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=o,this.dirty=Ft,!0)},t.prototype.inParent=function(){for(var o=this.parent.contentDOM,i=this.nodeDOM;i;i=i.parentNode)if(i==o)return!0;return!1},t.prototype.domFromPos=function(o){return{node:this.nodeDOM,offset:o}},t.prototype.localPosFromDOM=function(o,i,s){return o==this.nodeDOM?this.posAtStart+Math.min(i,this.node.text.length):e.prototype.localPosFromDOM.call(this,o,i,s)},t.prototype.ignoreMutation=function(o){return o.type!="characterData"&&o.type!="selection"},t.prototype.slice=function(o,i,s){var a=this.node.cut(o,i),c=document.createTextNode(a.text);return new t(this.parent,a,this.outerDeco,this.innerDeco,c,c,s)},t.prototype.markDirty=function(o,i){e.prototype.markDirty.call(this,o,i),this.dom!=this.nodeDOM&&(o==0||i==this.nodeDOM.nodeValue.length)&&(this.dirty=le)},r.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,r),t}(sr),Cl=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(o){return this.dirty==Ft&&this.dom.nodeName==o},r.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,r),t}(W),Ol=function(e){function t(r,n,o,i,s,a,c,l,u,f){e.call(this,r,n,o,i,s,a,c,u,f),this.spec=l}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(n,o,i,s){if(this.dirty==le)return!1;if(this.spec.update){var a=this.spec.update(n,o,i);return a&&this.updateInner(n,o,i,s),a}else return!this.contentDOM&&!n.isLeaf?!1:e.prototype.update.call(this,n,o,i,s)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(n,o,i,s){this.spec.setSelection?this.spec.setSelection(n,o,i):e.prototype.setSelection.call(this,n,o,i,s)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(n){return this.spec.stopEvent?this.spec.stopEvent(n):!1},t.prototype.ignoreMutation=function(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):e.prototype.ignoreMutation.call(this,n)},t}(sr);function Zi(e,t,r){for(var n=e.firstChild,o=!1,i=0;i>1,s=Math.min(i,t.length);o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=Ln.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}};Bt.prototype.findNodeMatch=function(t,r,n,o){var i=this.top.children,s=-1;if(o>=this.preMatch.index){for(var a=this.index;a0&&n>0;n--){var i=t[n-1],s=i.node;if(!!s){if(s!=e.child(r-1))break;--r,o.set(i,r)}}return{index:r,matched:o}}function Al(e,t){return e.type.side-t.type.side}function _l(e,t,r,n){var o=t.locals(e),i=0;if(o.length==0){for(var s=0;si;)l.push(o[c++]);var y=i+v.nodeSize;if(v.isText){var R=y;c0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=Kt(e)}else if(e.nodeType==1&&t=r){var u=c.lastIndexOf(t,n-a);if(u>=0&&u+t.length+a>=r)return a+u}}}return-1}function Hn(e,t,r,n,o){for(var i=[],s=0,a=0;s=r||u<=t?i.push(c):(lr&&i.push(c.slice(r-l,c.size,n)))}return i}function ns(e,t){var r=e.root.getSelection(),n=e.state.doc;if(!r.focusNode)return null;var o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset);if(s<0)return null;var a=n.resolve(s),c,l;if(Pn(r)){for(c=a;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&E.isSelectable(o.node)&&o.parent&&!(o.node.isInline&&il(r.focusNode,r.focusOffset,o.dom))){var u=o.posBefore;l=new E(s==u?a:n.resolve(u))}}else{var f=e.docView.posFromDOM(r.anchorNode,r.anchorOffset);if(f<0)return null;c=n.resolve(f)}if(!l){var p=t=="pointer"||e.state.selection.head0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&D.findFrom(s,t)}function xe(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function fs(e,t,r){var n=e.state.selection;if(n instanceof H){if(!n.empty||r.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var o=Wn(e.state,t);return o&&o instanceof E?xe(e,o):!1}else if(!(x.mac&&r.indexOf("m")>-1)){var i=n.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;var c=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=e.docView.descAt(c))&&!a.contentDOM?E.isSelectable(s)?xe(e,new E(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):x.webkit?xe(e,new H(e.state.doc.resolve(t<0?c:c+s.nodeSize))):!1:!1}}else{if(n instanceof E&&n.node.isInline)return xe(e,new H(t>0?n.$to:n.$from));var l=Wn(e.state,t);return l?xe(e,l):!1}}function Br(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function cr(e){var t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function Kn(e){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(!!r){var o,i,s=!1;for(x.gecko&&r.nodeType==1&&n0){if(r.nodeType!=1)break;var a=r.childNodes[n-1];if(cr(a))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}else{if(ps(r))break;for(var c=r.previousSibling;c&&cr(c);)o=r.parentNode,i=Pt(c),c=c.previousSibling;if(c)r=c,n=Br(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}s?Un(e,t,r,n):o&&Un(e,t,o,i)}}function $n(e){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(!!r){for(var o=Br(r),i,s;;)if(n-1||x.mac&&r.indexOf("m")>-1)return!1;var o=n.$from,i=n.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var s=Wn(e.state,t);if(s&&s instanceof E)return xe(e,s)}if(!o.parent.inlineContent){var a=t<0?o:i,c=n instanceof re?D.near(a,t):D.findFrom(a,t);return c?xe(e,c):!1}return!1}function hs(e,t){if(!(e.state.selection instanceof H))return!0;var r=e.state.selection,n=r.$head,o=r.$anchor,i=r.empty;if(!n.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){var a=e.state.tr;return t<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),e.dispatch(a),!0}return!1}function ms(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function zl(e){if(!(!x.safari||e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(r&&r.nodeType==1&&n==0&&r.firstChild&&r.firstChild.contentEditable=="false"){var o=r.firstChild;ms(e,o,!0),setTimeout(function(){return ms(e,o,!1)},20)}}}function Ll(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function Fl(e,t){var r=t.keyCode,n=Ll(t);return r==8||x.mac&&r==72&&n=="c"?hs(e,-1)||Kn(e):r==46||x.mac&&r==68&&n=="c"?hs(e,1)||$n(e):r==13||r==27?!0:r==37?fs(e,-1,n)||Kn(e):r==39?fs(e,1,n)||$n(e):r==38?ds(e,-1,n)||Kn(e):r==40?zl(e)||ds(e,1,n)||$n(e):n==(x.mac?"m":"c")&&(r==66||r==73||r==89||r==90)}function Vl(e,t,r){var n=e.docView.parseRange(t,r),o=n.node,i=n.fromOffset,s=n.toOffset,a=n.from,c=n.to,l=e.root.getSelection(),u=null,f=l.anchorNode;if(f&&e.dom.contains(f.nodeType==1?f:f.parentNode)&&(u=[{node:f,offset:l.anchorOffset}],Pn(l)||u.push({node:l.focusNode,offset:l.focusOffset})),x.chrome&&e.lastKeyCode===8)for(var p=s;p>i;p--){var d=o.childNodes[p-1],h=d.pmViewDesc;if(d.nodeName=="BR"&&!h){s=p;break}if(!h||h.size)break}var v=e.state.doc,g=e.someProp("domParser")||Lt.fromSchema(e.state.schema),M=v.resolve(a),y=null,R=g.parse(o,{topNode:M.parent,topMatch:M.parent.contentMatchAt(M.index()),topOpen:!0,from:i,to:s,preserveWhitespace:M.parent.type.spec.code?"full":!0,editableContent:!0,findPositions:u,ruleFromNode:Hl,context:M});if(u&&u[0].pos!=null){var m=u[0].pos,I=u[1]&&u[1].pos;I==null&&(I=m),y={anchor:m+a,head:I+a}}return{doc:R,sel:y,from:a,to:c}}function Hl(e){var t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(x.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||x.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function jl(e,t,r,n,o){if(t<0){var i=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,s=ns(e,i);if(s&&!e.state.selection.eq(s)){var a=e.state.tr.setSelection(s);i=="pointer"?a.setMeta("pointer",!0):i=="key"&&a.scrollIntoView(),e.dispatch(a)}return}var c=e.state.doc.resolve(t),l=c.sharedDepth(r);t=c.before(l+1),r=e.state.doc.resolve(r).after(l+1);var u=e.state.selection,f=Vl(e,t,r);if(x.chrome&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from){var p=e.cursorWrapper.deco.type.toDOM.nextSibling,d=p&&p.nodeValue?p.nodeValue.length:1;f.sel={anchor:f.sel.anchor+d,head:f.sel.anchor+d}}var h=e.state.doc,v=h.slice(f.from,f.to),g,M;e.lastKeyCode===8&&Date.now()-100Date.now()-225||x.android)&&o.some(function(Y){return Y.nodeName=="DIV"||Y.nodeName=="P"})&&e.someProp("handleKeyDown",function(Y){return Y(e,ze(13,"Enter"))})){e.lastIOSEnter=0;return}else{if(f.sel){var R=vs(e,e.state.doc,f.sel);R&&!R.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(R))}return}e.domChangeCount++,e.state.selection.frome.state.selection.from&&y.start<=e.state.selection.from+2?y.start=e.state.selection.from:y.endA=e.state.selection.to-2&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),x.ie&&x.ie_version<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)==" \xA0"&&(y.start--,y.endA--,y.endB--);var m=f.doc.resolveNoCache(y.start-f.from),I=f.doc.resolveNoCache(y.endB-f.from),O=m.sameParent(I)&&m.parent.inlineContent,F;if((x.ios&&e.lastIOSEnter>Date.now()-225&&(!O||o.some(function(Y){return Y.nodeName=="DIV"||Y.nodeName=="P"}))||!O&&m.posy.start&&Jl(h,y.start,y.endA,m,I)&&e.someProp("handleKeyDown",function(Y){return Y(e,ze(8,"Backspace"))})){x.android&&x.chrome&&e.domObserver.suppressSelectionUpdates();return}x.chrome&&x.android&&y.toB==y.from&&(e.lastAndroidDelete=Date.now()),x.android&&!O&&m.start()!=I.start()&&I.parentOffset==0&&m.depth==I.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,I=f.doc.resolveNoCache(y.endB-f.from),setTimeout(function(){e.someProp("handleKeyDown",function(Y){return Y(e,ze(13,"Enter"))})},20));var J=y.start,U=y.endA,T,Qt,rt,ut;if(O){if(m.pos==I.pos)x.ie&&x.ie_version<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return fe(e)},20)),T=e.state.tr.delete(J,U),Qt=h.resolve(y.start).marksAcross(h.resolve(y.endA));else if(y.endA==y.endB&&(ut=h.resolve(y.start))&&(rt=ql(m.parent.content.cut(m.parentOffset,I.parentOffset),ut.parent.content.cut(ut.parentOffset,y.endA-ut.start()))))T=e.state.tr,rt.type=="add"?T.addMark(J,U,rt.mark):T.removeMark(J,U,rt.mark);else if(m.parent.child(m.index()).isText&&m.index()==I.index()-(I.textOffset?0:1)){var qt=m.parent.textBetween(m.parentOffset,I.parentOffset);if(e.someProp("handleTextInput",function(Y){return Y(e,J,U,qt)}))return;T=e.state.tr.insertText(qt,J,U)}}if(T||(T=e.state.tr.replace(J,U,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){var G=vs(e,T.doc,f.sel);G&&!(x.chrome&&x.android&&e.composing&&G.empty&&(y.start!=y.endB||e.lastAndroidDeletet.content.size?null:qn(e,t.resolve(r.anchor),t.resolve(r.head))}function ql(e,t){for(var r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,c,l=0;lr||Gn(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r)for(var i=e.node(n).maybeChild(e.indexAfter(n));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Wl(e,t,r,n,o){var i=e.findDiffStart(t,r);if(i==null)return null;var s=e.findDiffEnd(t,r+e.size,r+t.size),a=s.a,c=s.b;if(o=="end"){var l=Math.max(0,i-Math.min(a,c));n-=a+l-i}if(a=a?i-n:0;i-=u,c=i+(c-a),a=i}else if(c=c?i-n:0;i-=f,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}function gs(e,t){for(var r=[],n=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;var s=n.firstChild;r.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),n=s.content}var a=e.someProp("clipboardSerializer")||ot.fromSchema(e.state.schema),c=Cs(),l=c.createElement("div");l.appendChild(a.serializeFragment(n,{document:c}));for(var u=l.firstChild,f;u&&u.nodeType==1&&(f=Ms[u.nodeName.toLowerCase()]);){for(var p=f.length-1;p>=0;p--){for(var d=c.createElement(f[p]);l.firstChild;)d.appendChild(l.firstChild);l.appendChild(d),f[p]!="tbody"&&(o++,i++)}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(r));var h=e.someProp("clipboardTextSerializer",function(v){return v(t)})||t.content.textBetween(0,t.content.size,` - -`);return{dom:l,text:h}}function ys(e,t,r,n,o){var i,s=o.parent.type.spec.code,a;if(!r&&!t)return null;var c=t&&(n||s||!r);if(c){if(e.someProp("transformPastedText",function(M){t=M(t,s||n)}),s)return new C(k.from(e.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0);var l=e.someProp("clipboardTextParser",function(M){return M(t,o,n)});if(l)a=l;else{var u=o.marks(),f=e.state,p=f.schema,d=ot.fromSchema(p);i=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach(function(M){i.appendChild(document.createElement("p")).appendChild(d.serializeNode(p.text(M,u)))})}}else e.someProp("transformPastedHTML",function(M){r=M(r)}),i=Ul(r),x.webkit&&Gl(i);var h=i&&i.querySelector("[data-pm-slice]"),v=h&&/^(\d+) (\d+) (.*)/.exec(h.getAttribute("data-pm-slice"));if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||Lt.fromSchema(e.state.schema);a=g.parseSlice(i,{preserveWhitespace:!!(c||v),context:o})}return v?a=Yl($l(a,+v[1],+v[2]),v[3]):a=C.maxOpen(Kl(a.content,o),!1),e.someProp("transformPasted",function(M){a=M(a)}),a}function Kl(e,t){if(e.childCount<2)return e;for(var r=function(i){var s=t.node(i),a=s.contentMatchAt(t.index(i)),c=void 0,l=[];if(e.forEach(function(u){if(!!l){var f=a.findWrapping(u.type),p;if(!f)return l=null;if(p=l.length&&c.length&&ks(f,c,u,l[l.length-1],0))l[l.length-1]=p;else{l.length&&(l[l.length-1]=Ss(l[l.length-1],c.length));var d=bs(u,f);l.push(d),a=a.matchType(d.type,d.attrs),c=f}}}),l)return{v:k.from(l)}},n=t.depth;n>=0;n--){var o=r(n);if(o)return o.v}return e}function bs(e,t,r){r===void 0&&(r=0);for(var n=t.length-1;n>=r;n--)e=t[n].create(null,k.from(e));return e}function ks(e,t,r,n,o){if(o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(k.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function $l(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var r=Cs().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&Ms[n[1].toLowerCase()])&&(e=o.map(function(s){return"<"+s+">"}).join("")+e+o.map(function(s){return""}).reverse().join("")),r.innerHTML=e,o)for(var i=0;i=0;a-=2){var c=r.nodes[n[a]];if(!c||c.hasRequiredAttrs())break;o=k.from(c.create(n[a+1],o)),i++,s++}return new C(o,i,s)}var Xl={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Xn=x.ie&&x.ie_version<=11,Qn=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Qn.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset};Qn.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var Nt=function(t,r){var n=this;this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var i=0;is.target.nodeValue.length})?n.flushSoon():n.flush()}),this.currentSelection=new Qn,Xn&&(this.onCharData=function(o){n.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Nt.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){t.flushingSoon=-1,t.flush()},20))};Nt.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())};Nt.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Xl),Xn&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()};Nt.prototype.stop=function(){var t=this;if(this.observer){var r=this.observer.takeRecords();if(r.length){for(var n=0;n-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var r=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Jn(this.view)&&!this.ignoreSelectionChange(r),o=-1,i=-1,s=!1,a=[];if(this.view.editable)for(var c=0;c1){var u=a.filter(function(d){return d.nodeName=="BR"});if(u.length==2){var f=u[0],p=u[1];f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}}(o>-1||n)&&(o>-1&&(this.view.docView.markDirty(o,i),Ql(this.view)),this.handleDOMChange(o,i,s,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(r)||fe(this.view),this.currentSelection.set(r))}};Nt.prototype.registerMutation=function(t,r){if(r.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(var o=0;oi.depth?u(e,r,i.nodeAfter,i.before(l),o,!0):u(e,r,i.node(l),i.before(l),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function Fe(e,t,r){e.focused||e.focus();var n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function ou(e,t){if(t==-1)return!1;var r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&E.isSelectable(n)?(Fe(e,new E(r),"pointer"),!0):!1}function iu(e,t){if(t==-1)return!1;var r=e.state.selection,n,o;r instanceof E&&(n=r.node);for(var i=e.state.doc.resolve(t),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(E.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(Fe(e,E.create(e.state.doc,o),"pointer"),!0):!1}function su(e,t,r,n,o){return eo(e,"handleClickOn",t,r,n)||e.someProp("handleClick",function(i){return i(e,t,n)})||(o?iu(e,r):ou(e,r))}function au(e,t,r,n){return eo(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",function(o){return o(e,t,n)})}function cu(e,t,r,n){return eo(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",function(o){return o(e,t,n)})||lu(e,r,n)}function lu(e,t,r){if(r.button!=0)return!1;var n=e.state.doc;if(t==-1)return n.inlineContent?(Fe(e,H.create(n,0,n.content.size),"pointer"),!0):!1;for(var o=n.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Fe(e,H.create(n,a+1,a+1+s.content.size),"pointer");else if(E.isSelectable(s))Fe(e,E.create(n,a),"pointer");else continue;return!0}}function ro(e){return Fr(e)}var ws=x.mac?"metaKey":"ctrlKey";Ct.mousedown=function(e,t){e.shiftKey=t.shiftKey;var r=ro(e),n=Date.now(),o="singleClick";n-e.lastClick.time<500&&nu(t,e.lastClick)&&!t[ws]&&(e.lastClick.type=="singleClick"?o="doubleClick":e.lastClick.type=="doubleClick"&&(o="tripleClick")),e.lastClick={time:n,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(zr(t));!i||(o=="singleClick"?(e.mouseDown&&e.mouseDown.done(),e.mouseDown=new Lr(e,i,t,r)):(o=="doubleClick"?au:cu)(e,i.pos,i.inside,t)?t.preventDefault():Ce(e,"pointer"))};var Lr=function(t,r,n,o){var i=this;this.view=t,this.startDoc=t.state.doc,this.pos=r,this.event=n,this.flushed=o,this.selectNode=n[ws],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1;var s,a;if(r.inside>-1)s=t.state.doc.nodeAt(r.inside),a=r.inside;else{var c=t.state.doc.resolve(r.pos);s=c.parent,a=c.depth?c.before():0}this.mightDrag=null;var l=o?null:n.target,u=l?t.docView.nearestDesc(l,!0):null;this.target=u?u.dom:null;var f=t.state,p=f.selection;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||p instanceof E&&p.from<=a&&p.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&x.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){i.view.mouseDown==i&&i.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ce(t,"pointer")};Lr.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return fe(t.view)}),this.view.mouseDown=null};Lr.prototype.up=function(t){if(this.done(),!!this.view.dom.contains(t.target.nodeType==3?t.target.parentNode:t.target)){var r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(zr(t))),this.allowDefault||!r?Ce(this.view,"pointer"):su(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||x.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||x.chrome&&!(this.view.state.selection instanceof H)&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Fe(this.view,D.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Ce(this.view,"pointer")}};Lr.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),Ce(this.view,"pointer"),t.buttons==0&&this.done()};Ct.touchdown=function(e){ro(e),Ce(e,"pointer")};Ct.contextmenu=function(e){return ro(e)};function Ts(e,t){return e.composing?!0:x.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500?(e.compositionEndedAt=-2e8,!0):!1}var uu=x.android?5e3:-1;kt.compositionstart=kt.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(function(a){return a.type.spec.inclusive===!1})))e.markCursor=e.state.storedMarks||r.marks(),Fr(e,!0),e.markCursor=null;else if(Fr(e),x.gecko&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length)for(var n=e.root.getSelection(),o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){n.collapse(s,s.nodeValue.length);break}else o=s,i=-1}e.composing=!0}As(e,uu)};kt.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,As(e,20))};function As(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return Fr(e)},t))}function _s(e){for(e.composing&&(e.composing=!1,e.compositionEndedAt=fu());e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function fu(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Fr(e,t){if(e.domObserver.forceFlush(),_s(e),t||e.docView.dirty){var r=ns(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}function pu(e,t){if(!!e.dom.parentNode){var r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";var n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(function(){r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}}var Ve=x.ie&&x.ie_version<15||x.ios&&x.webkit_version<604;Ct.copy=kt.cut=function(e,t){var r=e.state.selection,n=t.type=="cut";if(!r.empty){var o=Ve?null:t.clipboardData,i=r.content(),s=gs(e,i),a=s.dom,c=s.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",c)):pu(e,a),n&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}};function du(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function hu(e,t){if(!!e.dom.parentNode){var r=e.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(function(){e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?no(e,n.value,null,t):no(e,n.textContent,n.innerHTML,t)},50)}}function no(e,t,r,n){var o=ys(e,t,r,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",function(a){return a(e,n,o||C.empty)}))return!0;if(!o)return!1;var i=du(o),s=i?e.state.tr.replaceSelectionWith(i,e.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kt.paste=function(e,t){var r=Ve?null:t.clipboardData;r&&no(e,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():hu(e,t)};var mu=function(t,r){this.slice=t,this.move=r},Ns=x.mac?"altKey":"ctrlKey";Ct.dragstart=function(e,t){var r=e.mouseDown;if(r&&r.done(),!!t.dataTransfer){var n=e.state.selection,o=n.empty?null:e.posAtCoords(zr(t));if(!(o&&o.pos>=n.from&&o.pos<=(n instanceof E?n.to-1:n.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(E.create(e.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){var i=e.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=e.docView&&e.dispatch(e.state.tr.setSelection(E.create(e.state.doc,i.posBefore)))}}var s=e.state.selection.content(),a=gs(e,s),c=a.dom,l=a.text;t.dataTransfer.clearData(),t.dataTransfer.setData(Ve?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ve||t.dataTransfer.setData("text/plain",l),e.dragging=new mu(s,!t[Ns])}};Ct.dragend=function(e){var t=e.dragging;window.setTimeout(function(){e.dragging==t&&(e.dragging=null)},50)};kt.dragover=kt.dragenter=function(e,t){return t.preventDefault()};kt.drop=function(e,t){var r=e.dragging;if(e.dragging=null,!!t.dataTransfer){var n=e.posAtCoords(zr(t));if(!!n){var o=e.state.doc.resolve(n.pos);if(!!o){var i=r&&r.slice;i?e.someProp("transformPasted",function(h){i=h(i)}):i=ys(e,t.dataTransfer.getData(Ve?"Text":"text/plain"),Ve?null:t.dataTransfer.getData("text/html"),!1,o);var s=r&&!t[Ns];if(e.someProp("handleDrop",function(h){return h(e,t,i||C.empty,s)})){t.preventDefault();return}if(!!i){t.preventDefault();var a=i?Oi(e.state.doc,o.pos,i):o.pos;a==null&&(a=o.pos);var c=e.state.tr;s&&c.deleteSelection();var l=c.mapping.map(a),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(l,l,i.content.firstChild):c.replaceRange(l,l,i),!c.doc.eq(f)){var p=c.doc.resolve(l);if(u&&E.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new E(p));else{var d=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(function(h,v,g,M){return d=M}),c.setSelection(qn(e,p,c.doc.resolve(d)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}}}}}};Ct.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&fe(e)},20))};Ct.blur=function(e,t){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.set({}),e.focused=!1)};Ct.beforeinput=function(e,t){if(x.chrome&&x.android&&t.inputType=="deleteContentBackward"){var r=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==r&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(i){return i(e,ze(8,"Backspace"))}))){var n=e.state.selection,o=n.$cursor;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}};for(var Es in kt)Ct[Es]=kt[Es];function lr(e,t){if(e==t)return!0;for(var r in e)if(e[r]!==t[r])return!1;for(var n in t)if(!(n in e))return!1;return!0}var ur=function(t,r){this.spec=r||Oe,this.side=this.spec.side||0,this.toDOM=t};ur.prototype.map=function(t,r,n,o){var i=t.mapResult(r.from+o,this.side<0?-1:1),s=i.pos,a=i.deleted;return a?null:new nt(s-n,s-n,this)};ur.prototype.valid=function(){return!0};ur.prototype.eq=function(t){return this==t||t instanceof ur&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&lr(this.spec,t.spec))};var Vt=function(t,r){this.spec=r||Oe,this.attrs=t};Vt.prototype.map=function(t,r,n,o){var i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new nt(i,s,this)};Vt.prototype.valid=function(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(var c=0;ct){var l=this.children[c]+1;this.children[c+2].findInner(t-l,r-l,n,o+l,i)}};q.prototype.map=function(t,r,n){return this==st||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Oe)};q.prototype.mapInner=function(t,r,n,o,i){for(var s,a=0;aa&&u.to=t){this.children[i]==t&&(n=this.children[i+2]);break}for(var s=t+1,a=s+r.content.size,c=0;cs&&l.type instanceof Vt){var u=Math.max(s,l.from)-s,f=Math.min(a,l.to)-s;uY+i||(rt>=a[G]+i?a[G+1]=-1:ut>=o&&(oe=qt-ut-(rt-Qt))&&(a[G]+=oe,a[G+1]+=oe))}},l=0;l=n.content.size){u=!0;continue}var h=r.map(e[f+1]+i,-1),v=h-o,g=n.content.findIndex(d),M=g.index,y=g.offset,R=n.maybeChild(M);if(R&&y==d&&y+R.nodeSize==v){var m=a[f+2].mapInner(r,R,p+1,e[f]+i+1,s);m!=st?(a[f]=d,a[f+1]=v,a[f+2]=m):(a[f+1]=-2,u=!0)}else u=!0}if(u){var I=gu(a,e,t||[],r,o,i,s),O=Hr(I,n,0,s);t=O.local;for(var F=0;Fr&&s.to0;)t++;e.splice(t,0,r)}function so(e){var t=[];return e.someProp("decorations",function(r){var n=r(e.state);n&&n!=st&&t.push(n)}),e.cursorWrapper&&t.push(q.create(e.state.doc,[e.cursorWrapper.deco])),zt.from(t)}var Z=function(t,r){this._props=r,this.state=r.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Ls(this),this.markCursor=null,this.cursorWrapper=null,zs(this),this.nodeViews=Fs(this),this.docView=Xi(this.state.doc,Bs(this),so(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,Zl(this),this.pluginViews=[],this.updatePluginViews()},ao={props:{configurable:!0},root:{configurable:!0}};ao.props.get=function(){if(this._props.state!=this.state){var e=this._props;this._props={};for(var t in e)this._props[t]=e[t];this._props.state=this.state}return this._props};Z.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Zn(this),this._props=t,this.updateStateInner(t.state,!0)};Z.prototype.setProps=function(t){var r={};for(var n in this._props)r[n]=this._props[n];r.state=this.state;for(var o in t)r[o]=t[o];this.update(r)};Z.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)};Z.prototype.updateStateInner=function(t,r){var n=this,o=this.state,i=!1,s=!1;if(t.storedMarks&&this.composing&&(_s(this),s=!0),this.state=t,r){var a=Fs(this);bu(a,this.nodeViews)&&(this.nodeViews=a,i=!0),Zn(this)}this.editable=Ls(this),zs(this);var c=so(this),l=Bs(this),u=r?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(t.doc,l,c);(f||!t.selection.eq(o.selection))&&(s=!0);var p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&ll(this);if(s){this.domObserver.stop();var d=f&&(x.ie||x.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&yu(o.selection,t.selection);if(f){var h=x.chrome?this.trackWrites=this.root.getSelection().focusNode:null;(i||!this.docView.update(t.doc,l,c,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Xi(t.doc,l,c,this.dom,this)),h&&!this.trackWrites&&(d=!0)}d||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&Bl(this))?fe(this,d):(ls(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),u=="reset")this.dom.scrollTop=0;else if(u=="to selection"){var v=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(g){return g(n)})||(t.selection instanceof E?Vi(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),v):Vi(this,this.coordsAtPos(t.selection.head,1),v))}else p&&ul(p)};Z.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()};Z.prototype.updatePluginViews=function(t){if(!t||t.plugins!=this.state.plugins){this.destroyPluginViews();for(var r=0;r",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Vs=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),ku=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),Su=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),Hs=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),Mu=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),xu=Vs&&(Hs||+Vs[1]<57)||Su&&Hs;for(var at=0;at<10;at++)pe[48+at]=pe[96+at]=String(at);for(var at=1;at<=24;at++)pe[at+111]="F"+at;for(var at=65;at<=90;at++)pe[at]=String.fromCharCode(at+32),jr[at]=String.fromCharCode(at);for(var co in pe)jr.hasOwnProperty(co)||(jr[co]=pe[co]);function Cu(e){var t=xu&&(e.ctrlKey||e.altKey||e.metaKey)||(ku||Mu)&&e.shiftKey&&e.key&&e.key.length==1,r=!t&&e.key||(e.shiftKey?jr:pe)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}var Ou=typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1;function wu(e){var t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");for(var n,o,i,s,a=0;a127)&&(s=pe[n.keyCode])&&s!=o){var c=t[lo(s,n,!0)];if(c&&c(r.state,r.dispatch,r))return!0}else if(i&&n.shiftKey){var l=t[lo(o,n,!0)];if(l&&l(r.state,r.dispatch,r))return!0}return!1}}var Ut=function(t,r){this.match=t,this.handler=typeof r=="string"?_u(r):r};function _u(e){return function(t,r,n,o){var i=e;if(r[1]){var s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;var a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}var Nu=500;function Eu(e){var t=e.rules,r=new Rt({state:{init:function(){return null},apply:function(o,i){var s=o.getMeta(this);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput:function(o,i,s,a){return qs(o,i,s,a,t,r)},handleDOMEvents:{compositionend:function(n){setTimeout(function(){var o=n.state.selection,i=o.$cursor;i&&qs(n,i.pos,i.pos,"",t,r)})}}},isInputRules:!0});return r}function qs(e,t,r,n,o,i){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-Nu),a.parentOffset,null,"\uFFFC")+n,l=0;l=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1}new Ut(/--$/,"\u2014");new Ut(/\.\.\.$/,"\u2026");new Ut(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C");new Ut(/"$/,"\u201D");new Ut(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018");new Ut(/'$/,"\u2019");function uo(e,t,r,n){return new Ut(e,function(o,i,s,a){var c=r instanceof Function?r(i):r,l=o.tr.delete(s,a),u=l.doc.resolve(s),f=u.blockRange(),p=f&&Sn(f,t,c);if(!p)return null;l.wrap(f,p);var d=l.doc.resolve(s-1).nodeBefore;return d&&d.type==t&&Mn(l.doc,s-1)&&(!n||n(i,d))&&l.join(s-1),l})}function fo(e,t,r){return new Ut(e,function(n,o,i,s){var a=n.doc.resolve(i),c=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,c):null})}function po(e,t){return e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function Js(e,t,r){var n=e.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("backward",e):o.parentOffset>0))return!1;var i=Ks(o);if(!i){var s=o.blockRange(),a=s&&Pe(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}var c=i.nodeBefore;if(!c.type.spec.isolating&&ra(e,i,t))return!0;if(o.parent.content.size==0&&(He(c,"end")||E.isSelectable(c))){if(t){var l=e.tr.deleteRange(o.before(),o.after());l.setSelection(He(c,"end")?D.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):E.create(l.doc,i.pos-c.nodeSize)),t(l.scrollIntoView())}return!0}return c.isAtom&&i.depth==o.depth-1?(t&&t(e.tr.delete(i.pos-c.nodeSize,i.pos).scrollIntoView()),!0):!1}function He(e,t,r){for(;e;e=t=="start"?e.firstChild:e.lastChild){if(e.isTextblock)return!0;if(r&&e.childCount!=1)return!1}return!1}function Ws(e,t,r){var n=e.selection,o=n.$head,i=n.empty,s=o;if(!i)return!1;if(o.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):o.parentOffset>0)return!1;s=Ks(o)}var a=s&&s.nodeBefore;return!a||!E.isSelectable(a)?!1:(t&&t(e.tr.setSelection(E.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}function Ks(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function $s(e,t,r){var n=e.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("forward",e):o.parentOffset=0;t--){var r=e.node(t);if(e.index(t)+11&&n.after()!=n.end(-1)){var o=n.before();if(ee(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),s=i&&Pe(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}function Iu(e,t){var r=e.selection,n=r.$from,o=r.$to;if(e.selection instanceof E&&e.selection.node.isBlock)return!n.parentOffset||!ee(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,s=e.tr;(e.selection instanceof H||e.selection instanceof re)&&s.deleteSelection();var a=n.depth==0?null:ho(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=i&&a?[{type:a}]:null,l=ee(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!l&&ee(s.doc,s.mapping.map(n.pos),1,a&&[{type:a}])&&(c=[{type:a}],l=!0),l&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){var u=s.mapping.map(n.before()),f=s.doc.resolve(u);n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}t(s.scrollIntoView())}return!0}function Ru(e,t){var r=e.selection,n=r.$from,o=r.to,i,s=n.sharedDepth(o);return s==0?!1:(i=n.before(s),t&&t(e.tr.setSelection(E.create(e.doc,i))),!0)}function ea(e,t){return t&&t(e.tr.setSelection(new re(e.doc))),!0}function Pu(e,t,r){var n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Mn(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function ra(e,t,r){var n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(Pu(e,t,r))return!0;var a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){for(var c=t.pos+o.nodeSize,l=k.empty,u=i.length-1;u>=0;u--)l=k.from(i[u].create(null,l));l=k.from(n.copy(l));var f=e.tr.step(new xt(t.pos-1,c,t.pos,c,new C(l,1,0),i.length,!0)),p=c+2*i.length;Mn(f.doc,p)&&f.join(p),r(f.scrollIntoView())}return!0}var d=D.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),v=h&&Pe(h);if(v!=null&&v>=t.depth)return r&&r(e.tr.lift(h,v).scrollIntoView()),!0;if(a&&He(o,"start",!0)&&He(n,"end")){for(var g=n,M=[];M.push(g),!g.isTextblock;)g=g.lastChild;for(var y=o,R=1;!y.isTextblock;y=y.firstChild)R++;if(g.canReplace(g.childCount,g.childCount,y.content)){if(r){for(var m=k.empty,I=M.length-1;I>=0;I--)m=k.from(M[I].copy(m));var O=e.tr.step(new xt(t.pos-M.length,t.pos+o.nodeSize,t.pos+R,t.pos+o.nodeSize-R,new C(m,M.length,0),0,!0));r(O.scrollIntoView())}return!0}}return!1}function na(e,t){return function(r,n){var o=r.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&Sn(a,e,t);return c?(n&&n(r.tr.wrap(a,c).scrollIntoView()),!0):!1}}function Bu(e,t){return function(r,n){var o=r.selection,i=o.from,s=o.to,a=!1;return r.doc.nodesBetween(i,s,function(c,l){if(a)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)a=!0;else{var u=r.doc.resolve(l),f=u.index();a=u.parent.canReplaceWith(f,f+1,e)}}),a?(n&&n(r.tr.setBlockType(i,s,e,t).scrollIntoView()),!0):!1}}function mo(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(r,n,o){for(var i=0;i=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;var u=r.doc.resolve(a.start-2);l=new Ge(u,u,a.depth),a.endIndex=0;s--)i=k.from(r[s].type.create(r[s].attrs,i));e.step(new xt(t.start-(n?2:0),t.end,t.start,t.end,new C(i,0,0),r.length,!0));for(var a=0,c=0;ca;s--)i-=o.child(s).nodeSize,n.delete(i-1,i+1);var c=n.doc.resolve(r.start),l=c.nodeAfter,u=r.startIndex==0,f=r.endIndex==o.childCount,p=c.node(-1),d=c.index(-1);if(!p.canReplace(d+(u?0:1),d+1,l.content.append(f?k.empty:k.from(o))))return!1;var h=c.pos,v=h+l.nodeSize;return n.step(new xt(h-(u?1:0),v+(f?1:0),h+1,v-1,new C((u?k.empty:k.from(o.copy(k.empty))).append(f?k.empty:k.from(o.copy(k.empty))),u?0:1,f?0:1),u?0:1)),t(n.scrollIntoView()),!0}function qu(e){return function(t,r){var n=t.selection,o=n.$from,i=n.$to,s=o.blockRange(i,function(v){return v.childCount&&v.firstChild.type==e});if(!s)return!1;var a=s.startIndex;if(a==0)return!1;var c=s.parent,l=c.child(a-1);if(l.type!=e)return!1;if(r){var u=l.lastChild&&l.lastChild.type==c.type,f=k.from(u?e.create():null),p=new C(k.from(e.create(null,k.from(c.type.create(null,f)))),u?3:1,0),d=s.start,h=s.end;r(t.tr.step(new xt(d-(u?3:1),h,d,h,p,1,!0)).scrollIntoView())}return!0}}function qr(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function tt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Ju(e,t){const r=tt(t,e.schema),{from:n,to:o}=e.selection;let i=[];e.doc.nodesBetween(n,o,a=>{i=[...i,a]});const s=i.reverse().find(a=>a.type.name===r.name);return s?S({},s.attrs):{}}function he(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function aa(e,t){const r=he(t,e.schema),{from:n,to:o,empty:i}=e.selection;let s=[];i?s=e.selection.$head.marks():e.doc.nodesBetween(n,o,c=>{s=[...s,...c.marks]});const a=s.find(c=>c.type.name===r.name);return a?S({},a.attrs):{}}function Wu(e,t){const r=qr(typeof t=="string"?t:t.name,e.schema);return r==="node"?Ju(e,t):r==="mark"?aa(e,t):{}}function pr(e,t){const r=Object.keys(t);return r.length?!!r.filter(n=>t[n]===e[n]).length:!0}function je(e,t,r={}){const{from:n,to:o,empty:i}=e.selection,s=t?tt(t,e.schema):null;let a=[];if(e.doc.nodesBetween(n,o,(u,f)=>{if(!u.isText){const p=Math.max(n,f),d=Math.min(o,f+u.nodeSize);a=[...a,{node:u,from:p,to:d}]}}),i)return!!a.filter(u=>s?s.name===u.node.type.name:!0).find(u=>pr(u.node.attrs,r));const c=o-n;return a.filter(u=>s?s.name===u.node.type.name:!0).filter(u=>pr(u.node.attrs,r)).reduce((u,f)=>{const p=f.to-f.from;return u+p},0)>=c}function vo(e,t,r={}){const{from:n,to:o,empty:i}=e.selection,s=t?he(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>pr(p.attrs,r));let a=0,c=[];if(e.doc.nodesBetween(n,o,(p,d)=>{if(p.isText){const h=Math.max(n,d),v=Math.min(o,d+p.nodeSize);a+=v-h,c=[...c,...p.marks.map(M=>({mark:M,from:h,to:v}))]}}),a===0)return!1;const l=c.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>pr(p.mark.attrs,r)).reduce((p,d)=>{const h=d.to-d.from;return p+h},0),u=c.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,d)=>{const h=d.to-d.from;return p+h},0);return(l>0?l+u:l)>=a}function Ku(e,t,r={}){if(!t)return je(e,null,r)||vo(e,null,r);const n=qr(t,e.schema);return n==="node"?je(e,t,r):n==="mark"?vo(e,t,r):!1}function $u(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ca(e){const t=`${e}`;return new window.DOMParser().parseFromString(t,"text/html").body}function Jr(e,t,r){if(r=S({slice:!0,parseOptions:{}},r),typeof e=="object"&&e!==null)try{return Array.isArray(e)?k.fromArray(e.map(n=>t.nodeFromJSON(n))):t.nodeFromJSON(e)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",n),Jr("",t,r)}if(typeof e=="string"){const n=Lt.fromSchema(t);return r.slice?n.parseSlice(ca(e),r.parseOptions).content:n.parse(ca(e),r.parseOptions)}return Jr("",t,r)}function la(e,t,r={}){return Jr(e,t,{slice:!1,parseOptions:r})}function Uu(e,t){const r=ot.fromSchema(t).serializeFragment(e.content),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(r),o.innerHTML}function Gu(e){var t;const r=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),n=e.toJSON();return JSON.stringify(r)===JSON.stringify(n)}function Yu(e){const t=document.querySelector("style[data-tiptap-style]");if(t!==null)return t;const r=document.createElement("style");return r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}class Xu{constructor(t,r){this.editor=t,this.commands=r}createCommands(){const{commands:t,editor:r}=this,{state:n,view:o}=r,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>{const f=c(...u)(s);return i.getMeta("preventDispatch")||o.dispatch(i),f}]))}createChain(t,r=!0){const{commands:n,editor:o}=this,{state:i,view:s}=o,a=[],c=!!t,l=t||i.tr,u=()=>(!c&&r&&!l.getMeta("preventDispatch")&&s.dispatch(l),a.every(p=>p===!0)),f=Tt(S({},Object.fromEntries(Object.entries(n).map(([p,d])=>[p,(...v)=>{const g=this.buildProps(l,r),M=d(...v)(g);return a.push(M),f}]))),{run:u});return f}createCan(t){const{commands:r,editor:n}=this,{state:o}=n,i=void 0,s=t||o.tr,a=this.buildProps(s,i),c=Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...f)=>u(...f)(Tt(S({},a),{dispatch:i}))]));return Tt(S({},c),{chain:()=>this.createChain(s,i)})}buildProps(t,r=!0){const{editor:n,commands:o}=this,{state:i,view:s}=n;i.storedMarks&&t.setStoredMarks(i.storedMarks);const a={tr:t,editor:n,view:s,state:this.chainableState(t,i),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(o).map(([c,l])=>[c,(...u)=>l(...u)(a)]))}};return a}chainableState(t,r){let{selection:n}=t,{doc:o}=t,{storedMarks:i}=t;return Tt(S({},r),{schema:r.schema,plugins:r.plugins,apply:r.apply.bind(r),applyTransaction:r.applyTransaction.bind(r),reconfigure:r.reconfigure.bind(r),toJSON:r.toJSON.bind(r),get storedMarks(){return i},get selection(){return n},get doc(){return o},get tr(){return n=t.selection,o=t.doc,i=t.storedMarks,t}})}}function _(e,t,r={}){return e.config[t]===void 0&&e.parent?_(e.parent,t,r):typeof e.config[t]=="function"?e.config[t].bind(Tt(S({},r),{parent:e.parent?_(e.parent,t,r):null})):e.config[t]}function dr(e){const t=e.filter(o=>o.type==="extension"),r=e.filter(o=>o.type==="node"),n=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:r,markExtensions:n}}function ua(e){const t=[],{nodeExtensions:r,markExtensions:n}=dr(e),o=[...r,...n],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return e.forEach(s=>{const a={name:s.name,options:s.options},c=_(s,"addGlobalAttributes",a);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,d])=>{t.push({type:f,name:p,attribute:S(S({},i),d)})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options},c=_(s,"addAttributes",a);if(!c)return;const l=c();Object.entries(l).forEach(([u,f])=>{t.push({type:s.name,name:u,attribute:S(S({},i),f)})})}),t}function Ot(...e){return e.filter(t=>!!t).reduce((t,r)=>{const n=S({},t);return Object.entries(r).forEach(([o,i])=>{if(!n[o]){n[o]=i;return}o==="class"?n[o]=[n[o],i].join(" "):o==="style"?n[o]=[n[o],i].join("; "):n[o]=i}),n},{})}function go(e,t){return t.filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(e.attrs)||{}:{[r.name]:e.attrs[r.name]}).reduce((r,n)=>Ot(r,n),{})}function Qu(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Zu(e){return typeof e!="string"?e:e.match(/^\d*(\.\d+)?$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function fa(e,t){return e.style?e:Tt(S({},e),{getAttrs:r=>{const n=e.getAttrs?e.getAttrs(r):e.attrs;if(n===!1)return!1;const o=t.filter(i=>i.attribute.rendered).reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(r)||{}:{[s.name]:Zu(r.getAttribute(s.name))},c=Object.fromEntries(Object.entries(a).filter(([,l])=>l!=null));return S(S({},i),c)},{});return S(S({},n),o)}})}function et(e,t=void 0,...r){return typeof e=="function"?t?e.bind(t)(...r):e(...r):e}function pa(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>t==="attrs"&&Qu(r)?!1:r!=null))}function tf(e){var t;const r=ua(e),{nodeExtensions:n,markExtensions:o}=dr(e),i=(t=n.find(c=>_(c,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(n.map(c=>{const l=r.filter(v=>v.type===c.name),u={name:c.name,options:c.options},f=e.reduce((v,g)=>{const M=_(g,"extendNodeSchema",u);return S(S({},v),M?M(c):{})},{}),p=pa(Tt(S({},f),{content:et(_(c,"content",u)),marks:et(_(c,"marks",u)),group:et(_(c,"group",u)),inline:et(_(c,"inline",u)),atom:et(_(c,"atom",u)),selectable:et(_(c,"selectable",u)),draggable:et(_(c,"draggable",u)),code:et(_(c,"code",u)),defining:et(_(c,"defining",u)),isolating:et(_(c,"isolating",u)),attrs:Object.fromEntries(l.map(v=>{var g;return[v.name,{default:(g=v==null?void 0:v.attribute)===null||g===void 0?void 0:g.default}]}))})),d=et(_(c,"parseHTML",u));d&&(p.parseDOM=d.map(v=>fa(v,l)));const h=_(c,"renderHTML",u);return h&&(p.toDOM=v=>h({node:v,HTMLAttributes:go(v,l)})),[c.name,p]})),a=Object.fromEntries(o.map(c=>{const l=r.filter(v=>v.type===c.name),u={name:c.name,options:c.options},f=e.reduce((v,g)=>{const M=_(g,"extendMarkSchema",u);return S(S({},v),M?M(c):{})},{}),p=pa(Tt(S({},f),{inclusive:et(_(c,"inclusive",u)),excludes:et(_(c,"excludes",u)),group:et(_(c,"group",u)),spanning:et(_(c,"spanning",u)),attrs:Object.fromEntries(l.map(v=>{var g;return[v.name,{default:(g=v==null?void 0:v.attribute)===null||g===void 0?void 0:g.default}]}))})),d=et(_(c,"parseHTML",u));d&&(p.parseDOM=d.map(v=>fa(v,l)));const h=_(c,"renderHTML",u);return h&&(p.toDOM=v=>h({mark:v,HTMLAttributes:go(v,l)})),[c.name,p]}));return new Se({topNode:i,nodes:s,marks:a})}function yo(e,t){return t.nodes[e]?t.nodes[e]:t.marks[e]?t.marks[e]:null}class hr{constructor(t,r){this.splittableMarks=[],this.editor=r,this.extensions=hr.resolve(t),this.schema=tf(this.extensions),this.extensions.forEach(n=>{var o;const i={name:n.name,options:n.options,editor:this.editor,type:yo(n.name,this.schema)};n.type==="mark"&&((o=et(_(n,"keepOnSplit",i)))!==null&&o!==void 0?o:!0)&&this.splittableMarks.push(n.name);const s=_(n,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const a=_(n,"onCreate",i);a&&this.editor.on("create",a);const c=_(n,"onUpdate",i);c&&this.editor.on("update",c);const l=_(n,"onSelectionUpdate",i);l&&this.editor.on("selectionUpdate",l);const u=_(n,"onTransaction",i);u&&this.editor.on("transaction",u);const f=_(n,"onFocus",i);f&&this.editor.on("focus",f);const p=_(n,"onBlur",i);p&&this.editor.on("blur",p);const d=_(n,"onDestroy",i);d&&this.editor.on("destroy",d)})}static resolve(t){return hr.sort(hr.flatten(t))}static flatten(t){return t.map(r=>{const n={name:r.name,options:r.options},o=_(r,"addExtensions",n);return o?[r,...this.flatten(o())]:r}).flat(10)}static sort(t){const r=100;return t.sort((n,o)=>{const i=_(n,"priority")||r,s=_(o,"priority")||r;return i>s?-1:i{const n={name:r.name,options:r.options,editor:this.editor,type:yo(r.name,this.schema)},o=_(r,"addCommands",n);return o?S(S({},t),o()):t},{})}get plugins(){return[...this.extensions].reverse().map(t=>{const r={name:t.name,options:t.options,editor:this.editor,type:yo(t.name,this.schema)},n=[],o=_(t,"addKeyboardShortcuts",r);if(o){const c=Object.fromEntries(Object.entries(o()).map(([u,f])=>[u,()=>f({editor:this.editor})])),l=Au(c);n.push(l)}const i=_(t,"addInputRules",r);if(this.editor.options.enableInputRules&&i){const c=i(),l=c.length?[Eu({rules:c})]:[];n.push(...l)}const s=_(t,"addPasteRules",r);if(this.editor.options.enablePasteRules&&s){const c=s();n.push(...c)}const a=_(t,"addProseMirrorPlugins",r);if(a){const c=a();n.push(...c)}return n}).flat()}get attributes(){return ua(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:r}=dr(this.extensions);return Object.fromEntries(r.filter(n=>!!_(n,"addNodeView")).map(n=>{const o=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,editor:t,type:tt(n.name,this.schema)},s=_(n,"addNodeView",i);if(!s)return[];const a=(c,l,u,f)=>{const p=go(c,o);return s()({editor:t,node:c,getPos:u,decorations:f,HTMLAttributes:p,extension:n})};return[n.name,a]}))}get textSerializers(){const{editor:t}=this,{nodeExtensions:r}=dr(this.extensions);return Object.fromEntries(r.filter(n=>!!_(n,"renderText")).map(n=>{const o={name:n.name,options:n.options,editor:t,type:tt(n.name,this.schema)},i=_(n,"renderText",o);if(!i)return[];const s=a=>i(a);return[n.name,s]}))}}class ef{constructor(){this.callbacks={}}on(t,r){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(r),this}emit(t,...r){const n=this.callbacks[t];return n&&n.forEach(o=>o.apply(this,r)),this}off(t,r){const n=this.callbacks[t];return n&&(r?this.callbacks[t]=n.filter(o=>o!==r):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function rf(e){return Object.prototype.toString.call(e).slice(8,-1)}function bo(e){return rf(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Wr(e,t){const r=S({},e);return bo(e)&&bo(t)&&Object.keys(t).forEach(n=>{bo(t[n])?n in e?r[n]=Wr(e[n],t[n]):Object.assign(r,{[n]:t[n]}):Object.assign(r,{[n]:t[n]})}),r}class St{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=S(S({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new St(t)}configure(t={}){const r=this.extend();return r.options=Wr(this.options,t),r}extend(t={}){const r=new St(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}const nf=(e,t,r,n,o)=>{let i="",s=!0;return e.state.doc.nodesBetween(t,r,(a,c)=>{var l;const u=e.extensionManager.textSerializers[a.type.name];u?(i+=u({node:a}),s=!n):a.isText?(i+=(l=a==null?void 0:a.text)===null||l===void 0?void 0:l.slice(Math.max(t,c)-c,r-c),s=!n):a.isLeaf&&o?(i+=o,s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i},of=St.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new Wt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{from:t,to:r}=e.state.selection;return nf(e,t,r,` -`)}}})]}}),sf=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{e.isDestroyed||t.dom.blur()}),!0);var af=Object.freeze({__proto__:null,blur:sf});const cf=(e=!1)=>({commands:t})=>t.setContent("",e);var lf=Object.freeze({__proto__:null,clearContent:cf});const uf=()=>({state:e,tr:t,dispatch:r})=>{const{selection:n}=t,{ranges:o}=n;return o.forEach(i=>{e.doc.nodesBetween(i.$from.pos,i.$to.pos,(s,a)=>{if(s.type.isText)return;const c=t.doc.resolve(t.mapping.map(a)),l=t.doc.resolve(t.mapping.map(a+s.nodeSize)),u=c.blockRange(l);if(!u)return;const f=Pe(u);if(s.type.isTextblock&&r){const{defaultType:p}=c.parent.contentMatchAt(c.index());t.setNodeMarkup(u.start,p)}(f||f===0)&&r&&t.lift(u,f)})}),!0};var ff=Object.freeze({__proto__:null,clearNodes:uf});const pf=e=>t=>e(t);var df=Object.freeze({__proto__:null,command:pf});const hf=()=>({state:e,dispatch:t})=>Zs(e,t);var mf=Object.freeze({__proto__:null,createParagraphNear:hf});const vf=e=>({tr:t,state:r,dispatch:n})=>{const o=tt(e,r.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(n){const c=i.before(s),l=i.after(s);t.delete(c,l).scrollIntoView()}return!0}return!1};var gf=Object.freeze({__proto__:null,deleteNode:vf});const yf=e=>({tr:t,dispatch:r})=>{const{from:n,to:o}=e;return r&&t.delete(n,o),!0};var bf=Object.freeze({__proto__:null,deleteRange:yf});const kf=()=>({state:e,dispatch:t})=>po(e,t);var Sf=Object.freeze({__proto__:null,deleteSelection:kf});const Mf=()=>({commands:e})=>e.keyboardShortcut("Enter");var xf=Object.freeze({__proto__:null,enter:Mf});const Cf=()=>({state:e,dispatch:t})=>Qs(e,t);var Of=Object.freeze({__proto__:null,exitCode:Cf});function ko(e,t,r={}){return e.find(n=>n.type===t&&pr(n.attrs,r))}function wf(e,t,r={}){return!!ko(e,t,r)}function da(e,t,r={}){if(!e||!t)return;const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ko(n.node.marks,t,r);if(!o)return;let i=e.index(),s=e.start()+n.offset,a=i+1,c=s+n.node.nodeSize;for(ko(n.node.marks,t,r);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a({tr:r,state:n,dispatch:o})=>{const i=he(e,n.schema),{doc:s,selection:a}=r,{$from:c,from:l,to:u}=a;if(o){const f=da(c,i,t);if(f&&f.from<=l&&f.to>=u){const p=H.create(s,f.from,f.to);r.setSelection(p)}}return!0};var Af=Object.freeze({__proto__:null,extendMarkRange:Tf});const _f=e=>t=>{const r=typeof e=="function"?e(t):e;for(let n=0;n({editor:t,view:r,tr:n,dispatch:o})=>{const i=()=>{requestAnimationFrame(()=>{t.isDestroyed||r.focus()})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!ma(t.state.selection))return i(),!0;const{from:s,to:a}=Df(t.state,e)||t.state.selection,{doc:c,storedMarks:l}=n,u=D.atStart(c).from,f=D.atEnd(c).to,p=mr(s,u,f),d=mr(a,u,f),h=H.create(c,p,d),v=t.state.selection.eq(h);return o&&(v||n.setSelection(h),v&&l&&n.setStoredMarks(l),i()),!0};var Rf=Object.freeze({__proto__:null,focus:If});const Pf=(e,t)=>r=>e.every((n,o)=>t(n,Tt(S({},r),{index:o})));var Bf=Object.freeze({__proto__:null,forEach:Pf});const zf=(e,t)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},e,t);var Lf=Object.freeze({__proto__:null,insertContent:zf});function Ff(e,t,r){const n=e.steps.length-1;if(n{s===0&&(s=u)}),e.setSelection(D.near(e.doc.resolve(s),r))}const Vf=(e,t,r)=>({tr:n,dispatch:o,editor:i})=>{if(o){const s=Jr(t,i.schema,S({parseOptions:{preserveWhitespace:"full"}},r||{}));if(s.toString()==="<>")return!0;const{from:a,to:c}=typeof e=="number"?{from:e,to:e}:e;n.replaceWith(a,c,s),Ff(n,n.steps.length-1,1)}return!0};var Hf=Object.freeze({__proto__:null,insertContentAt:Vf});const jf=()=>({state:e,dispatch:t})=>Js(e,t);var qf=Object.freeze({__proto__:null,joinBackward:jf});const Jf=()=>({state:e,dispatch:t})=>$s(e,t);var Wf=Object.freeze({__proto__:null,joinForward:Jf});const Kf=typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1;function $f(e){const t=e.split(/-(?!$)/);let r=t[t.length-1];r==="Space"&&(r=" ");let n,o,i,s;for(let a=0;a({editor:t,view:r,tr:n,dispatch:o})=>{const i=$f(e).split(/-(?!$)/),s=i.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{r.someProp("handleKeyDown",l=>l(r,a))});return c==null||c.steps.forEach(l=>{const u=l.map(n.mapping);u&&o&&n.maybeStep(u)}),!0};var Gf=Object.freeze({__proto__:null,keyboardShortcut:Uf});const Yf=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return je(r,o,t)?Ys(r,n):!1};var Xf=Object.freeze({__proto__:null,lift:Yf});const Qf=()=>({state:e,dispatch:t})=>ta(e,t);var Zf=Object.freeze({__proto__:null,liftEmptyBlock:Qf});const tp=e=>({state:t,dispatch:r})=>{const n=tt(e,t.schema);return Vu(n)(t,r)};var ep=Object.freeze({__proto__:null,liftListItem:tp});const rp=()=>({state:e,dispatch:t})=>Xs(e,t);var np=Object.freeze({__proto__:null,newlineInCode:rp});function va(e,t){const r=typeof t=="string"?[t]:t;return Object.keys(e).reduce((n,o)=>(r.includes(o)||(n[o]=e[o]),n),{})}const op=(e,t)=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null;const a=qr(typeof e=="string"?e:e.name,n.schema);return a?(a==="node"&&(i=tt(e,n.schema)),a==="mark"&&(s=he(e,n.schema)),o&&r.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(l,u)=>{i&&i===l.type&&r.setNodeMarkup(u,void 0,va(l.attrs,t)),s&&l.marks.length&&l.marks.forEach(f=>{s===f.type&&r.addMark(u,u+l.nodeSize,s.create(va(f.attrs,t)))})})}),!0):!1};var ip=Object.freeze({__proto__:null,resetAttributes:op});const sp=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0);var ap=Object.freeze({__proto__:null,scrollIntoView:sp});const cp=()=>({state:e,dispatch:t})=>ea(e,t);var lp=Object.freeze({__proto__:null,selectAll:cp});const up=()=>({state:e,dispatch:t})=>Ws(e,t);var fp=Object.freeze({__proto__:null,selectNodeBackward:up});const pp=()=>({state:e,dispatch:t})=>Us(e,t);var dp=Object.freeze({__proto__:null,selectNodeForward:pp});const hp=()=>({state:e,dispatch:t})=>Ru(e,t);var mp=Object.freeze({__proto__:null,selectParentNode:hp});const vp=(e,t=!1,r={})=>({tr:n,editor:o,dispatch:i})=>{const{doc:s}=n,a=la(e,o.schema,r),c=H.create(s,0,s.content.size);return i&&n.setSelection(c).replaceSelectionWith(a,!1).setMeta("preventUpdate",!t),!0};var gp=Object.freeze({__proto__:null,setContent:vp});const yp=(e,t={})=>({tr:r,state:n,dispatch:o})=>{const{selection:i}=r,{empty:s,ranges:a}=i,c=he(e,n.schema);if(o)if(s){const l=aa(n,c);r.addStoredMark(c.create(S(S({},l),t)))}else a.forEach(l=>{const u=l.$from.pos,f=l.$to.pos;n.doc.nodesBetween(u,f,(p,d)=>{const h=Math.max(d,u),v=Math.min(d+p.nodeSize,f);p.marks.find(M=>M.type===c)?p.marks.forEach(M=>{c===M.type&&r.addMark(h,v,c.create(S(S({},M.attrs),t)))}):r.addMark(h,v,c.create(t))})});return!0};var bp=Object.freeze({__proto__:null,setMark:yp});const kp=(e,t)=>({tr:r})=>(r.setMeta(e,t),!0);var Sp=Object.freeze({__proto__:null,setMeta:kp});const Mp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Bu(o,t)(r,n)};var xp=Object.freeze({__proto__:null,setNode:Mp});const Cp=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,o=D.atStart(n).from,i=D.atEnd(n).to,s=mr(e,o,i),a=E.create(n,s);t.setSelection(a)}return!0};var Op=Object.freeze({__proto__:null,setNodeSelection:Cp});const wp=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,{from:o,to:i}=typeof e=="number"?{from:e,to:e}:e,s=D.atStart(n).from,a=D.atEnd(n).to,c=mr(o,s,a),l=mr(i,s,a),u=H.create(n,c,l);t.setSelection(u)}return!0};var Tp=Object.freeze({__proto__:null,setTextSelection:wp});const Ap=e=>({state:t,dispatch:r})=>{const n=tt(e,t.schema);return qu(n)(t,r)};var _p=Object.freeze({__proto__:null,sinkListItem:Ap});function Kr(e,t,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const o=e.find(i=>i.type===t&&i.name===n);return o?o.attribute.keepOnSplit:!1}))}function Np(e){for(let t=0;tt==null?void 0:t.includes(o.type.name));e.tr.ensureMarks(n)}}const Ep=({keepMarks:e=!0}={})=>({tr:t,state:r,dispatch:n,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:c}=i,l=o.extensionManager.attributes,u=Kr(l,a.node().type.name,a.node().attrs);if(i instanceof E&&i.node.isBlock)return!a.parentOffset||!ee(s,a.pos)?!1:(n&&(e&&ga(r,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(n){const f=c.parentOffset===c.parent.content.size;i instanceof H&&t.deleteSelection();const p=a.depth===0?void 0:Np(a.node(-1).contentMatchAt(a.indexAfter(-1)));let d=f&&p?[{type:p,attrs:u}]:void 0,h=ee(t.doc,t.mapping.map(a.pos),1,d);if(!d&&!h&&ee(t.doc,t.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(h=!0,d=p?[{type:p,attrs:u}]:void 0),h&&(t.split(t.mapping.map(a.pos),1,d),p&&!f&&!a.parentOffset&&a.parent.type!==p)){const v=t.mapping.map(a.before()),g=t.doc.resolve(v);a.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&t.setNodeMarkup(t.mapping.map(a.before()),p)}e&&ga(r,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0};var Dp=Object.freeze({__proto__:null,splitBlock:Ep});const Ip=e=>({tr:t,state:r,dispatch:n,editor:o})=>{var i;const s=tt(e,r.schema),{$from:a,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||a.depth<2||!a.sameParent(c))return!1;const u=a.node(-1);if(u.type!==s)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(n){let g=k.empty;const M=a.index(-1)?1:a.index(-2)?2:3;for(let F=a.depth-M;F>=a.depth-3;F-=1)g=k.from(a.node(F).copy(g));const y=a.indexAfter(-1){if(O>-1)return!1;F.isTextblock&&F.content.size===0&&(O=J+1)}),O>-1&&t.setSelection(H.near(t.doc.resolve(O))),t.scrollIntoView()}return!0}const p=c.pos===a.end()?u.contentMatchAt(0).defaultType:null,d=Kr(f,u.type.name,u.attrs),h=Kr(f,a.node().type.name,a.node().attrs);t.delete(a.pos,c.pos);const v=p?[{type:s,attrs:d},{type:p,attrs:h}]:[{type:s,attrs:d}];return ee(t.doc,a.pos,2)?(n&&t.split(a.pos,2,v).scrollIntoView(),!0):!1};var Rp=Object.freeze({__proto__:null,splitListItem:Ip});function Pp(e,t){for(let r=e.depth;r>0;r-=1){const n=e.node(r);if(t(n))return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:n}}}function Bp(e){return t=>Pp(t.$from,e)}function ya(e,t){const{nodeExtensions:r}=dr(t),n=r.find(s=>s.name===e);if(!n)return!1;const o={name:n.name,options:n.options},i=et(_(n,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}const zp=(e,t)=>({editor:r,tr:n,state:o,dispatch:i,chain:s,commands:a,can:c})=>{const{extensions:l}=r.extensionManager,u=tt(e,o.schema),f=tt(t,o.schema),{selection:p}=o,{$from:d,$to:h}=p,v=d.blockRange(h);if(!v)return!1;const g=Bp(y=>ya(y.type.name,l))(p);if(v.depth>=1&&g&&v.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(f);if(ya(g.node.type.name,l)&&u.validContent(g.node.content)&&i)return n.setNodeMarkup(g.pos,u),!0}return c().wrapInList(u)?a.wrapInList(u):s().clearNodes().wrapInList(u).run()};var Lp=Object.freeze({__proto__:null,toggleList:zp});const Fp=(e,t={})=>({state:r,commands:n})=>{const o=he(e,r.schema);return vo(r,o,t)?n.unsetMark(o):n.setMark(o,t)};var Vp=Object.freeze({__proto__:null,toggleMark:Fp});const Hp=(e,t,r={})=>({state:n,commands:o})=>{const i=tt(e,n.schema),s=tt(t,n.schema);return je(n,i,r)?o.setNode(s):o.setNode(i,r)};var jp=Object.freeze({__proto__:null,toggleNode:Hp});const qp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return je(r,o,t)?Ys(r,n):na(o,t)(r,n)};var Jp=Object.freeze({__proto__:null,toggleWrap:qp});const Wp=()=>({state:e,dispatch:t})=>Du(e,t);var Kp=Object.freeze({__proto__:null,undoInputRule:Wp});const $p=()=>({tr:e,state:t,dispatch:r})=>{const{selection:n}=e,{empty:o,ranges:i}=n;return o||r&&Object.entries(t.schema.marks).forEach(([,s])=>{i.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos,s)})}),!0};var Up=Object.freeze({__proto__:null,unsetAllMarks:$p});const Gp=e=>({tr:t,state:r,dispatch:n})=>{const{selection:o}=t,i=he(e,r.schema),{$from:s,empty:a,ranges:c}=o;if(n){if(a){let{from:l,to:u}=o;const f=da(s,i);f&&(l=f.from,u=f.to),t.removeMark(l,u,i)}else c.forEach(l=>{t.removeMark(l.$from.pos,l.$to.pos,i)});t.removeStoredMark(i)}return!0};var Yp=Object.freeze({__proto__:null,unsetMark:Gp});const Xp=(e,t={})=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null;const a=qr(typeof e=="string"?e:e.name,n.schema);return a?(a==="node"&&(i=tt(e,n.schema)),a==="mark"&&(s=he(e,n.schema)),o&&r.selection.ranges.forEach(c=>{const l=c.$from.pos,u=c.$to.pos;n.doc.nodesBetween(l,u,(f,p)=>{i&&i===f.type&&r.setNodeMarkup(p,void 0,S(S({},f.attrs),t)),s&&f.marks.length&&f.marks.forEach(d=>{if(s===d.type){const h=Math.max(p,l),v=Math.min(p+f.nodeSize,u);r.addMark(h,v,s.create(S(S({},d.attrs),t)))}})})}),!0):!1};var Qp=Object.freeze({__proto__:null,updateAttributes:Xp});const Zp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return je(r,o,t)?!1:na(o,t)(r,n)};var td=Object.freeze({__proto__:null,wrapIn:Zp});const ed=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Lu(o,t)(r,n)};var rd=Object.freeze({__proto__:null,wrapInList:ed});const nd=St.create({name:"commands",addCommands(){return S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S({},af),lf),ff),df),mf),gf),bf),Sf),xf),Of),Af),Nf),Rf),Bf),Lf),Hf),qf),Wf),Gf),Xf),Zf),ep),np),ip),ap),lp),fp),dp),mp),gp),bp),Sp),xp),Op),Tp),_p),Dp),Rp),Lp),Vp),jp),Jp),Kp),Up),Yp),Qp),td),rd)}}),od=St.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new Wt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),id=St.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Rt({key:new Wt("focusEvents"),props:{attributes:{tabindex:"0"},handleDOMEvents:{focus:(t,r)=>{e.isFocused=!0;const n=e.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1},blur:(t,r)=>{e.isFocused=!1;const n=e.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1}}}})]}}),sd=St.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.deleteSelection(),()=>r.joinBackward(),()=>r.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:r})=>[()=>r.deleteSelection(),()=>r.joinForward(),()=>r.selectNodeForward()]);return{Enter:()=>this.editor.commands.first(({commands:r})=>[()=>r.newlineInCode(),()=>r.createParagraphNear(),()=>r.liftEmptyBlock(),()=>r.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:()=>e(),"Mod-Backspace":()=>e(),Delete:()=>t(),"Mod-Delete":()=>t()}}});var ad=Object.freeze({__proto__:null,ClipboardTextSerializer:of,Commands:nd,Editable:od,FocusEvents:id,Keymap:sd});const cd=`.ProseMirror { - position: relative; -} - -.ProseMirror { - word-wrap: break-word; - white-space: pre-wrap; - -webkit-font-variant-ligatures: none; - font-variant-ligatures: none; -} - -.ProseMirror [contenteditable="false"] { - white-space: normal; -} - -.ProseMirror [contenteditable="false"] [contenteditable="true"] { - white-space: pre-wrap; -} - -.ProseMirror pre { - white-space: pre-wrap; -} - -.ProseMirror-gapcursor { - display: none; - pointer-events: none; - position: absolute; -} - -.ProseMirror-gapcursor:after { - content: ""; - display: block; - position: absolute; - top: -2px; - width: 20px; - border-top: 1px solid black; - animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; -} - -@keyframes ProseMirror-cursor-blink { - to { - visibility: hidden; - } -} - -.ProseMirror-hideselection *::selection { - background: transparent; -} - -.ProseMirror-hideselection *::-moz-selection { - background: transparent; -} - -.ProseMirror-hideselection * { - caret-color: transparent; -} - -.ProseMirror-focused .ProseMirror-gapcursor { - display: block; -} - -.tippy-box[data-animation=fade][data-state=hidden] { - opacity: 0 -}`;class ld extends ef{constructor(t={}){super();this.isFocused=!1,this.options={element:document.createElement("div"),content:"",injectCSS:!0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get commands(){return this.commandManager.createCommands()}chain(){return this.commandManager.createChain()}can(){return this.commandManager.createCan()}injectCSS(){this.options.injectCSS&&document&&(this.css=Yu(cd))}setOptions(t={}){this.options=S(S({},this.options),t),!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){this.setOptions({editable:t})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,r){const n=typeof r=="function"?r(t,this.state.plugins):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const r=typeof t=="string"?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(r))});this.view.updateState(n)}createExtensionManager(){const r=[...Object.entries(ad).map(([,n])=>n),...this.options.extensions].filter(n=>["extension","node","mark"].includes(n==null?void 0:n.type));this.extensionManager=new hr(r,this)}createCommandManager(){this.commandManager=new Xu(this,this.extensionManager.commands)}createSchema(){this.schema=this.extensionManager.schema}createView(){this.view=new Z(this.options.element,Tt(S({},this.options.editorProps),{dispatchTransaction:this.dispatchTransaction.bind(this),state:mt.create({doc:la(this.options.content,this.schema,this.options.parseOptions)})}));const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const r=this.state.apply(t),n=!this.state.selection.eq(r.selection);this.view.updateState(r),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Wu(this.state,t)}isActive(t,r){const n=typeof t=="string"?t:null,o=typeof t=="string"?r:t;return Ku(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Uu(this.state.doc,this.schema)}get isEmpty(){return Gu(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners(),$u(this.css)}get isDestroyed(){var t;return!((t=this.view)===null||t===void 0?void 0:t.docView)}}class wt{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=S(S({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new wt(t)}configure(t={}){const r=this.extend();return r.options=Wr(this.options,t),r}extend(t={}){const r=new wt(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}class Te{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=S(S({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new Te(t)}configure(t={}){const r=this.extend();return r.options=Wr(this.options,t),r}extend(t={}){const r=new Te(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}function ud(e,t,r){return new Ut(e,(n,o,i,s)=>{const a=r instanceof Function?r(o):r,{tr:c}=n;return o[0]&&c.replaceWith(i-1,s,t.create(a)),c})}function fd(e,t,r){let n=[];return r.doc.nodesBetween(e,t,(o,i)=>{n=[...n,...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s}))]}),n}function qe(e,t,r){return new Ut(e,(n,o,i,s)=>{const a=r instanceof Function?r(o):r,{tr:c}=n,l=o[o.length-1],u=o[0];let f=s;if(l){const p=u.search(/\S/),d=i+u.indexOf(l),h=d+l.length;if(fd(i,s,n).filter(g=>{const{excluded:M}=g.mark.type;return M.find(y=>y.name===t.name)}).filter(g=>g.to>d).length)return null;hi&&c.delete(i+p,d),f=i+p+l.length,c.addMark(i+p,f,t.create(a)),c.removeStoredMark(t)}return c})}function Je(e,t,r){const n=(o,i)=>{const s=[];return o.forEach(a=>{if(a.isText&&a.text){const{text:c}=a;let l=0,u;for(;(u=e.exec(c))!==null;){const f=Math.max(u.length-2,0),p=Math.max(u.length-1,0);if(i==null?void 0:i.type.allowsMarkType(t)){const h=u.index+u[0].indexOf(u[f]),v=h+u[f].length,g=h+u[f].lastIndexOf(u[p]),M=g+u[p].length,y=r instanceof Function?r(u):r;if(!y&&y!==void 0)continue;h>0&&s.push(a.cut(l,h)),s.push(a.cut(g,M).mark(t.create(y).addToSet(a.marks))),l=v}}lnew C(n(o.content),o.openStart,o.openEnd)}})}function pd(e){return ha(e)&&e instanceof E}function ba(e,t,r){const n=e.coordsAtPos(t),o=e.coordsAtPos(r,-1),i=Math.min(n.top,o.top),s=Math.max(n.bottom,o.bottom),a=Math.min(n.left,o.left),c=Math.max(n.right,o.right),l=c-a,u=s-i,d={top:i,bottom:s,left:a,right:c,width:l,height:u,x:a,y:i};return Tt(S({},d),{toJSON:()=>d})}var dd="tippy-box",ka="tippy-content",hd="tippy-backdrop",Sa="tippy-arrow",Ma="tippy-svg-arrow",Ae={passive:!0,capture:!0};function So(e,t,r){if(Array.isArray(e)){var n=e[t];return n==null?Array.isArray(r)?r[t]:r:n}return e}function Mo(e,t){var r={}.toString.call(e);return r.indexOf("[object")===0&&r.indexOf(t+"]")>-1}function xa(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Ca(e,t){if(t===0)return e;var r;return function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function md(e){return e.split(/\s+/).filter(Boolean)}function vr(e){return[].concat(e)}function Oa(e,t){e.indexOf(t)===-1&&e.push(t)}function vd(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function gd(e){return e.split("-")[0]}function $r(e){return[].slice.call(e)}function yd(e){return Object.keys(e).reduce(function(t,r){return e[r]!==void 0&&(t[r]=e[r]),t},{})}function gr(){return document.createElement("div")}function Ur(e){return["Element","Fragment"].some(function(t){return Mo(e,t)})}function bd(e){return Mo(e,"NodeList")}function kd(e){return Mo(e,"MouseEvent")}function Sd(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Md(e){return Ur(e)?[e]:bd(e)?$r(e):Array.isArray(e)?e:$r(document.querySelectorAll(e))}function xo(e,t){e.forEach(function(r){r&&(r.style.transitionDuration=t+"ms")})}function wa(e,t){e.forEach(function(r){r&&r.setAttribute("data-state",t)})}function xd(e){var t,r=vr(e),n=r[0];return(n==null||(t=n.ownerDocument)==null?void 0:t.body)?n.ownerDocument:document}function Cd(e,t){var r=t.clientX,n=t.clientY;return e.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,c=a.interactiveBorder,l=gd(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=l==="bottom"?u.top.y:0,p=l==="top"?u.bottom.y:0,d=l==="right"?u.left.x:0,h=l==="left"?u.right.x:0,v=i.top-n+f>c,g=n-i.bottom-p>c,M=i.left-r+d>c,y=r-i.right-h>c;return v||g||M||y})}function Co(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[n](o,r)})}var Gt={isTouch:!1},Ta=0;function Od(){Gt.isTouch||(Gt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Aa))}function Aa(){var e=performance.now();e-Ta<20&&(Gt.isTouch=!1,document.removeEventListener("mousemove",Aa)),Ta=e}function wd(){var e=document.activeElement;if(Sd(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Td(){document.addEventListener("touchstart",Od,Ae),window.addEventListener("blur",wd)}var Ad=typeof window!="undefined"&&typeof document!="undefined",_d=Ad?navigator.userAgent:"",Nd=/MSIE |Trident\//.test(_d),Ed={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Dd={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ht=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ed,{},Dd),Id=Object.keys(Ht),Rd=function(t){var r=Object.keys(t);r.forEach(function(n){Ht[n]=t[n]})};function _a(e){var t=e.plugins||[],r=t.reduce(function(n,o){var i=o.name,s=o.defaultValue;return i&&(n[i]=e[i]!==void 0?e[i]:s),n},{});return Object.assign({},e,{},r)}function Pd(e,t){var r=t?Object.keys(_a(Object.assign({},Ht,{plugins:t}))):Id,n=r.reduce(function(o,i){var s=(e.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return n}function Na(e,t){var r=Object.assign({},t,{content:xa(t.content,[e])},t.ignoreAttributes?{}:Pd(e,t.plugins));return r.aria=Object.assign({},Ht.aria,{},r.aria),r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content},r}var Bd=function(){return"innerHTML"};function Oo(e,t){e[Bd()]=t}function Ea(e){var t=gr();return e===!0?t.className=Sa:(t.className=Ma,Ur(e)?t.appendChild(e):Oo(t,e)),t}function Da(e,t){Ur(t.content)?(Oo(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Oo(e,t.content):e.textContent=t.content)}function wo(e){var t=e.firstElementChild,r=$r(t.children);return{box:t,content:r.find(function(n){return n.classList.contains(ka)}),arrow:r.find(function(n){return n.classList.contains(Sa)||n.classList.contains(Ma)}),backdrop:r.find(function(n){return n.classList.contains(hd)})}}function Ia(e){var t=gr(),r=gr();r.className=dd,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=gr();n.className=ka,n.setAttribute("data-state","hidden"),Da(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props);function o(i,s){var a=wo(t),c=a.box,l=a.content,u=a.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Da(l,e.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(Ea(s.arrow))):c.appendChild(Ea(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:o}}Ia.$$tippy=!0;var zd=1,Gr=[],To=[];function Ld(e,t){var r=Na(e,Object.assign({},Ht,{},_a(yd(t)))),n,o,i,s=!1,a=!1,c=!1,l=!1,u,f,p,d=[],h=Ca(Lo,r.interactiveDebounce),v,g=zd++,M=null,y=vd(r.plugins),R={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:g,reference:e,popper:gr(),popperInstance:M,props:r,state:R,plugins:y,clearDelayTimeouts:Ua,setProps:Ga,setContent:Ya,show:Xa,hide:Qa,hideWithInteractivity:Za,enable:Ka,disable:$a,unmount:tc,destroy:ec};if(!r.render)return m;var I=r.render(m),O=I.popper,F=I.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+m.id,m.popper=O,e._tippy=m,O._tippy=m;var J=y.map(function(b){return b.fn(m)}),U=e.hasAttribute("aria-expanded");return Po(),Ke(),oe(),Et("onCreate",[m]),r.showOnCreate&&Jo(),O.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),O.addEventListener("mouseleave",function(b){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&(qt().addEventListener("mousemove",h),h(b))}),m;function T(){var b=m.props.touch;return Array.isArray(b)?b:[b,0]}function Qt(){return T()[0]==="hold"}function rt(){var b;return!!((b=m.props.render)==null?void 0:b.$$tippy)}function ut(){return v||e}function qt(){var b=ut().parentNode;return b?xd(b):document}function G(){return wo(O)}function Y(b){return m.state.isMounted&&!m.state.isVisible||Gt.isTouch||u&&u.type==="focus"?0:So(m.props.delay,b?0:1,Ht.delay)}function oe(){O.style.pointerEvents=m.props.interactive&&m.state.isVisible?"":"none",O.style.zIndex=""+m.props.zIndex}function Et(b,w,N){if(N===void 0&&(N=!0),J.forEach(function(z){z[b]&&z[b].apply(void 0,w)}),N){var j;(j=m.props)[b].apply(j,w)}}function No(){var b=m.props.aria;if(!!b.content){var w="aria-"+b.content,N=O.id,j=vr(m.props.triggerTarget||e);j.forEach(function(z){var vt=z.getAttribute(w);if(m.state.isVisible)z.setAttribute(w,vt?vt+" "+N:N);else{var Dt=vt&&vt.replace(N,"").trim();Dt?z.setAttribute(w,Dt):z.removeAttribute(w)}})}}function Ke(){if(!(U||!m.props.aria.expanded)){var b=vr(m.props.triggerTarget||e);b.forEach(function(w){m.props.interactive?w.setAttribute("aria-expanded",m.state.isVisible&&w===ut()?"true":"false"):w.removeAttribute("aria-expanded")})}}function tn(){qt().removeEventListener("mousemove",h),Gr=Gr.filter(function(b){return b!==h})}function yr(b){if(!(Gt.isTouch&&(c||b.type==="mousedown"))&&!(m.props.interactive&&O.contains(b.target))){if(ut().contains(b.target)){if(Gt.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else Et("onClickOutside",[m,b]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),a=!0,setTimeout(function(){a=!1}),m.state.isMounted||en())}}function Eo(){c=!0}function Do(){c=!1}function Io(){var b=qt();b.addEventListener("mousedown",yr,!0),b.addEventListener("touchend",yr,Ae),b.addEventListener("touchstart",Do,Ae),b.addEventListener("touchmove",Eo,Ae)}function en(){var b=qt();b.removeEventListener("mousedown",yr,!0),b.removeEventListener("touchend",yr,Ae),b.removeEventListener("touchstart",Do,Ae),b.removeEventListener("touchmove",Eo,Ae)}function qa(b,w){Ro(b,function(){!m.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&w()})}function Ja(b,w){Ro(b,w)}function Ro(b,w){var N=G().box;function j(z){z.target===N&&(Co(N,"remove",j),w())}if(b===0)return w();Co(N,"remove",f),Co(N,"add",j),f=j}function _e(b,w,N){N===void 0&&(N=!1);var j=vr(m.props.triggerTarget||e);j.forEach(function(z){z.addEventListener(b,w,N),d.push({node:z,eventType:b,handler:w,options:N})})}function Po(){Qt()&&(_e("touchstart",zo,{passive:!0}),_e("touchend",Fo,{passive:!0})),md(m.props.trigger).forEach(function(b){if(b!=="manual")switch(_e(b,zo),b){case"mouseenter":_e("mouseleave",Fo);break;case"focus":_e(Nd?"focusout":"blur",Vo);break;case"focusin":_e("focusout",Vo);break}})}function Bo(){d.forEach(function(b){var w=b.node,N=b.eventType,j=b.handler,z=b.options;w.removeEventListener(N,j,z)}),d=[]}function zo(b){var w,N=!1;if(!(!m.state.isEnabled||Ho(b)||a)){var j=((w=u)==null?void 0:w.type)==="focus";u=b,v=b.currentTarget,Ke(),!m.state.isVisible&&kd(b)&&Gr.forEach(function(z){return z(b)}),b.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||s)&&m.props.hideOnClick!==!1&&m.state.isVisible?N=!0:Jo(b),b.type==="click"&&(s=!N),N&&!j&&br(b)}}function Lo(b){var w=b.target,N=ut().contains(w)||O.contains(w);if(!(b.type==="mousemove"&&N)){var j=rn().concat(O).map(function(z){var vt,Dt=z._tippy,Ne=(vt=Dt.popperInstance)==null?void 0:vt.state;return Ne?{popperRect:z.getBoundingClientRect(),popperState:Ne,props:r}:null}).filter(Boolean);Cd(j,b)&&(tn(),br(b))}}function Fo(b){var w=Ho(b)||m.props.trigger.indexOf("click")>=0&&s;if(!w){if(m.props.interactive){m.hideWithInteractivity(b);return}br(b)}}function Vo(b){m.props.trigger.indexOf("focusin")<0&&b.target!==ut()||m.props.interactive&&b.relatedTarget&&O.contains(b.relatedTarget)||br(b)}function Ho(b){return Gt.isTouch?Qt()!==b.type.indexOf("touch")>=0:!1}function jo(){qo();var b=m.props,w=b.popperOptions,N=b.placement,j=b.offset,z=b.getReferenceClientRect,vt=b.moveTransition,Dt=rt()?wo(O).arrow:null,Ne=z?{getBoundingClientRect:z,contextElement:z.contextElement||ut()}:e,Wo={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(kr){var Ee=kr.state;if(rt()){var rc=G(),on=rc.box;["placement","reference-hidden","escaped"].forEach(function(Sr){Sr==="placement"?on.setAttribute("data-placement",Ee.placement):Ee.attributes.popper["data-popper-"+Sr]?on.setAttribute("data-"+Sr,""):on.removeAttribute("data-"+Sr)}),Ee.attributes.popper={}}}},ge=[{name:"offset",options:{offset:j}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!vt}},Wo];rt()&&Dt&&ge.push({name:"arrow",options:{element:Dt,padding:3}}),ge.push.apply(ge,(w==null?void 0:w.modifiers)||[]),m.popperInstance=ac(Ne,O,Object.assign({},w,{placement:N,onFirstUpdate:p,modifiers:ge}))}function qo(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function Wa(){var b=m.props.appendTo,w,N=ut();m.props.interactive&&b===Ht.appendTo||b==="parent"?w=N.parentNode:w=xa(b,[N]),w.contains(O)||w.appendChild(O),jo()}function rn(){return $r(O.querySelectorAll("[data-tippy-root]"))}function Jo(b){m.clearDelayTimeouts(),b&&Et("onTrigger",[m,b]),Io();var w=Y(!0),N=T(),j=N[0],z=N[1];Gt.isTouch&&j==="hold"&&z&&(w=z),w?n=setTimeout(function(){m.show()},w):m.show()}function br(b){if(m.clearDelayTimeouts(),Et("onUntrigger",[m,b]),!m.state.isVisible){en();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(b.type)>=0&&s)){var w=Y(!1);w?o=setTimeout(function(){m.state.isVisible&&m.hide()},w):i=requestAnimationFrame(function(){m.hide()})}}function Ka(){m.state.isEnabled=!0}function $a(){m.hide(),m.state.isEnabled=!1}function Ua(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)}function Ga(b){if(!m.state.isDestroyed){Et("onBeforeUpdate",[m,b]),Bo();var w=m.props,N=Na(e,Object.assign({},m.props,{},b,{ignoreAttributes:!0}));m.props=N,Po(),w.interactiveDebounce!==N.interactiveDebounce&&(tn(),h=Ca(Lo,N.interactiveDebounce)),w.triggerTarget&&!N.triggerTarget?vr(w.triggerTarget).forEach(function(j){j.removeAttribute("aria-expanded")}):N.triggerTarget&&e.removeAttribute("aria-expanded"),Ke(),oe(),F&&F(w,N),m.popperInstance&&(jo(),rn().forEach(function(j){requestAnimationFrame(j._tippy.popperInstance.forceUpdate)})),Et("onAfterUpdate",[m,b])}}function Ya(b){m.setProps({content:b})}function Xa(){var b=m.state.isVisible,w=m.state.isDestroyed,N=!m.state.isEnabled,j=Gt.isTouch&&!m.props.touch,z=So(m.props.duration,0,Ht.duration);if(!(b||w||N||j)&&!ut().hasAttribute("disabled")&&(Et("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,rt()&&(O.style.visibility="visible"),oe(),Io(),m.state.isMounted||(O.style.transition="none"),rt()){var vt=G(),Dt=vt.box,Ne=vt.content;xo([Dt,Ne],0)}p=function(){var ge;if(!(!m.state.isVisible||l)){if(l=!0,O.offsetHeight,O.style.transition=m.props.moveTransition,rt()&&m.props.animation){var nn=G(),kr=nn.box,Ee=nn.content;xo([kr,Ee],z),wa([kr,Ee],"visible")}No(),Ke(),Oa(To,m),(ge=m.popperInstance)==null||ge.forceUpdate(),m.state.isMounted=!0,Et("onMount",[m]),m.props.animation&&rt()&&Ja(z,function(){m.state.isShown=!0,Et("onShown",[m])})}},Wa()}}function Qa(){var b=!m.state.isVisible,w=m.state.isDestroyed,N=!m.state.isEnabled,j=So(m.props.duration,1,Ht.duration);if(!(b||w||N)&&(Et("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,l=!1,s=!1,rt()&&(O.style.visibility="hidden"),tn(),en(),oe(),rt()){var z=G(),vt=z.box,Dt=z.content;m.props.animation&&(xo([vt,Dt],j),wa([vt,Dt],"hidden"))}No(),Ke(),m.props.animation?rt()&&qa(j,m.unmount):m.unmount()}}function Za(b){qt().addEventListener("mousemove",h),Oa(Gr,h),h(b)}function tc(){m.state.isVisible&&m.hide(),!!m.state.isMounted&&(qo(),rn().forEach(function(b){b._tippy.unmount()}),O.parentNode&&O.parentNode.removeChild(O),To=To.filter(function(b){return b!==m}),m.state.isMounted=!1,Et("onHidden",[m]))}function ec(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),Bo(),delete e._tippy,m.state.isDestroyed=!0,Et("onDestroy",[m]))}}function We(e,t){t===void 0&&(t={});var r=Ht.plugins.concat(t.plugins||[]);Td();var n=Object.assign({},t,{plugins:r}),o=Md(e),i=o.reduce(function(s,a){var c=a&&Ld(a,n);return c&&s.push(c),s},[]);return Ur(e)?i[0]:i}We.defaultProps=Ht;We.setDefaultProps=Rd;We.currentInput=Gt;Object.assign({},sc,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});We.setDefaultProps({render:Ia});class Fd{constructor({editor:t,element:r,view:n,tippyOptions:o,shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s,from:a,to:c})=>{const{doc:l,selection:u}=s,{empty:f}=u,p=!l.textBetween(a,c).length&&ma(s.selection);return!(f||p)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.element.style.visibility="visible",requestAnimationFrame(()=>{this.createTooltip(o)})}createTooltip(t={}){this.tippy=We(this.editor.options.element,S({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},t))}update(t,r){var n;const{state:o,composing:i}=t,{doc:s,selection:a}=o,c=r&&r.doc.eq(s)&&r.selection.eq(a);if(i||c)return;const{ranges:l}=a,u=Math.min(...l.map(d=>d.$from.pos)),f=Math.max(...l.map(d=>d.$to.pos));if(!this.shouldShow({editor:this.editor,view:t,state:o,oldState:r,from:u,to:f})){this.hide();return}(n=this.tippy)===null||n===void 0||n.setProps({getReferenceClientRect:()=>{if(pd(o.selection)){const d=t.nodeDOM(u);if(d)return d.getBoundingClientRect()}return ba(t,u,f)}}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Ra=e=>new Rt({key:typeof e.pluginKey=="string"?new Wt(e.pluginKey):e.pluginKey,view:t=>new Fd(S({view:t},e))});St.create({name:"bubbleMenu",defaultOptions:{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null},addProseMirrorPlugins(){return this.options.element?[Ra({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Vd{constructor({editor:t,element:r,view:n,tippyOptions:o,shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s})=>{const{selection:a}=s,{$anchor:c,empty:l}=a,u=c.depth===1,f=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent;return!(!l||!u||!f)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.element.style.visibility="visible",requestAnimationFrame(()=>{this.createTooltip(o)})}createTooltip(t={}){this.tippy=We(this.editor.options.element,S({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},t))}update(t,r){var n;const{state:o,composing:i}=t,{doc:s,selection:a}=o,{from:c,to:l}=a,u=r&&r.doc.eq(s)&&r.selection.eq(a);if(i||u)return;if(!this.shouldShow({editor:this.editor,view:t,state:o,oldState:r})){this.hide();return}(n=this.tippy)===null||n===void 0||n.setProps({getReferenceClientRect:()=>ba(t,c,l)}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Pa=e=>new Rt({key:typeof e.pluginKey=="string"?new Wt(e.pluginKey):e.pluginKey,view:t=>new Vd(S({view:t},e))});St.create({name:"floatingMenu",defaultOptions:{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null},addProseMirrorPlugins(){return this.options.element?[Pa({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});$e({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const r=xr(null);return sn(()=>{const{pluginKey:n,editor:o,tippyOptions:i,shouldShow:s}=e;o.registerPlugin(Ra({pluginKey:n,editor:o,element:r.value,tippyOptions:i,shouldShow:s}))}),Cr(()=>{const{pluginKey:n,editor:o}=e;o.unregisterPlugin(n)}),()=>{var n;return ye("div",{ref:r},(n=t.default)===null||n===void 0?void 0:n.call(t))}}});function Hd(e){return hc((t,r)=>({get(){return t(),e},set(n){e=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{r()})})}}))}class jd extends ld{constructor(t={}){super(t);return this.vueRenderers=dc(new Map),this.contentComponent=null,this.reactiveState=Hd(this.view.state),this.on("transaction",()=>{this.reactiveState.value=this.view.state}),mc(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}registerPlugin(t,r){super.registerPlugin(t,r),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const qd=$e({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=xr(),r=cc();return lc(()=>{const n=e.editor;n&&n.options.element&&t.value&&uc(()=>{if(!t.value||!n.options.element.firstChild)return;const o=fc(t.value);t.value.append(...n.options.element.childNodes),n.contentComponent=r.ctx._,n.setOptions({element:o}),n.createNodeViews()})}),Cr(()=>{const n=e.editor;if(!n||(n.isDestroyed||n.view.setProps({nodeViews:{}}),n.contentComponent=null,!n.options.element.firstChild))return;const o=document.createElement("div");o.append(...n.options.element.childNodes),n.setOptions({element:o})}),{rootEl:t}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach(t=>{const r=ye(pc,{to:t.teleportElement,key:t.id},ye(t.component,S({ref:t.id},t.props)));e.push(r)}),ye("div",{ref:t=>{this.rootEl=t}},...e)}});$e({name:"FloatingMenu",props:{pluginKey:{type:[String,Object],default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const r=xr(null);return sn(()=>{const{pluginKey:n,editor:o,tippyOptions:i,shouldShow:s}=e;o.registerPlugin(Pa({pluginKey:n,editor:o,element:r.value,tippyOptions:i,shouldShow:s}))}),Cr(()=>{const{pluginKey:n,editor:o}=e;o.unregisterPlugin(n)}),()=>{var n;return ye("div",{ref:r},(n=t.default)===null||n===void 0?void 0:n.call(t))}}});const Jd=(e={})=>{const t=xr();return sn(()=>{t.value=new jd(e)}),Cr(()=>{var r;(r=t.value)===null||r===void 0||r.destroy()}),t};$e({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return ye(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragStart:this.onDragStart},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}});$e({props:{as:{type:String,default:"div"}},render(){return ye(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const Wd=/^\s*>\s$/gm,Kd=wt.create({name:"blockquote",defaultOptions:{HTMLAttributes:{}},content:"block*",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[uo(Wd,this.type)]}}),$d=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,Ud=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm,Gd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm,Yd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm,Xd=Te.create({name:"bold",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[qe($d,this.type),qe(Gd,this.type)]},addPasteRules(){return[Je(Ud,this.type),Je(Yd,this.type)]}}),Qd=/^\s*([-+*])\s$/,Zd=wt.create({name:"bulletList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[uo(Qd,this.type)]}}),th=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,eh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/gm,rh=Te.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[qe(th,this.type)]},addPasteRules(){return[Je(eh,this.type)]}}),nh=/^```(?[a-z]*)? $/,oh=/^~~~(?[a-z]*)? $/,ih=wt.create({name:"codeBlock",defaultOptions:{languageClassPrefix:"language-",HTMLAttributes:{}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const r=(t=e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("class");if(!r)return null;const n=new RegExp(`^(${this.options.languageClassPrefix})`);return{language:r.replace(n,"")}},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,r=t.pos===1;return!e||t.parent.type.name!==this.name?!1:r||!t.parent.textContent.length?this.editor.commands.clearNodes():!1}}},addInputRules(){return[fo(nh,this.type,({groups:e})=>e),fo(oh,this.type,({groups:e})=>e)]}}),sh=wt.create({name:"doc",topNode:!0,content:"block+"});function ah(e){return e===void 0&&(e={}),new Rt({view:function(r){return new Yt(r,e)}})}var Yt=function(t,r){var n=this;this.editorView=t,this.width=r.width||1,this.color=r.color||"black",this.class=r.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map(function(o){var i=function(s){return n[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})};Yt.prototype.destroy=function(){var t=this;this.handlers.forEach(function(r){var n=r.name,o=r.handler;return t.editorView.dom.removeEventListener(n,o)})};Yt.prototype.update=function(t,r){this.cursorPos!=null&&r.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())};Yt.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())};Yt.prototype.updateOverlay=function(){var t=this.editorView.state.doc.resolve(this.cursorPos),r;if(!t.parent.inlineContent){var n=t.nodeBefore,o=t.nodeAfter;if(n||o){var i=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),s=n?i.bottom:i.top;n&&o&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:i.left,right:i.right,top:s-this.width/2,bottom:s+this.width/2}}}if(!r){var a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var l,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")l=-pageXOffset,u=-pageYOffset;else{var f=c.getBoundingClientRect();l=f.left-c.scrollLeft,u=f.top-c.scrollTop}this.element.style.left=r.left-l+"px",this.element.style.top=r.top-u+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"};Yt.prototype.scheduleRemoval=function(t){var r=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return r.setCursor(null)},t)};Yt.prototype.dragover=function(t){if(!!this.editorView.editable){var r=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(r){var n=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(n=Oi(this.editorView.state.doc,n,this.editorView.dragging.slice),n==null))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}};Yt.prototype.dragend=function(){this.scheduleRemoval(20)};Yt.prototype.drop=function(){this.scheduleRemoval(20)};Yt.prototype.dragleave=function(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)};const ch=St.create({name:"dropCursor",defaultOptions:{color:"currentColor",width:1,class:null},addProseMirrorPlugins(){return[ah(this.options)]}});var jt=function(e){function t(r){e.call(this,r,r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,o){var i=n.resolve(o.map(this.head));return t.valid(i)?new t(i):e.near(i)},t.prototype.content=function(){return C.empty},t.prototype.eq=function(n){return n instanceof t&&n.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(n,o){if(typeof o.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(n.resolve(o.pos))},t.prototype.getBookmark=function(){return new Yr(this.anchor)},t.valid=function(n){var o=n.parent;if(o.isTextblock||!lh(n)||!uh(n))return!1;var i=o.type.spec.allowGapCursor;if(i!=null)return i;var s=o.contentMatchAt(n.index()).defaultType;return s&&s.isTextblock},t.findFrom=function(n,o,i){t:for(;;){if(!i&&t.valid(n))return n;for(var s=n.pos,a=null,c=n.depth;;c--){var l=n.node(c);if(o>0?n.indexAfter(c)0){a=l.child(o>0?n.indexAfter(c):n.index(c)-1);break}else if(c==0)return null;s+=o;var u=n.doc.resolve(s);if(t.valid(u))return u}for(;;){var f=o>0?a.firstChild:a.lastChild;if(!f){if(a.isAtom&&!a.isText&&!E.isSelectable(a)){n=n.doc.resolve(s+a.nodeSize*o),i=!1;continue t}break}a=f,s+=o;var p=n.doc.resolve(s);if(t.valid(p))return p}return null}},t}(D);jt.prototype.visible=!1;D.jsonID("gapcursor",jt);var Yr=function(t){this.pos=t};Yr.prototype.map=function(t){return new Yr(t.map(this.pos))};Yr.prototype.resolve=function(t){var r=t.resolve(this.pos);return jt.valid(r)?new jt(r):D.near(r)};function lh(e){for(var t=e.depth;t>=0;t--){var r=e.index(t);if(r!=0)for(var n=e.node(t).child(r-1);;n=n.lastChild){if(n.childCount==0&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}function uh(e){for(var t=e.depth;t>=0;t--){var r=e.indexAfter(t),n=e.node(t);if(r!=n.childCount)for(var o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}var fh=function(){return new Rt({props:{decorations:hh,createSelectionBetween:function(t,r,n){if(r.pos==n.pos&&jt.valid(n))return new jt(n)},handleClick:dh,handleKeyDown:ph}})},ph=js({ArrowLeft:Xr("horiz",-1),ArrowRight:Xr("horiz",1),ArrowUp:Xr("vert",-1),ArrowDown:Xr("vert",1)});function Xr(e,t){var r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){var s=n.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof H){if(!i.endOfTextblock(r)||a.depth==0)return!1;c=!1,a=n.doc.resolve(t>0?a.after():a.before())}var l=jt.findFrom(a,t,c);return l?(o&&o(n.tr.setSelection(new jt(l))),!0):!1}}function dh(e,t,r){if(!e.editable)return!1;var n=e.state.doc.resolve(t);if(!jt.valid(n))return!1;var o=e.posAtCoords({left:r.clientX,top:r.clientY}),i=o.inside;return i>-1&&E.isSelectable(e.state.doc.nodeAt(i))?!1:(e.dispatch(e.state.tr.setSelection(new jt(n))),!0)}function hh(e){if(!(e.selection instanceof jt))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",q.create(e.doc,[nt.widget(e.selection.head,t,{key:"gapcursor"})])}const mh=St.create({name:"gapCursor",addProseMirrorPlugins(){return[fh()]},extendNodeSchema(e){var t;const r={name:e.name,options:e.options};return{allowGapCursor:(t=et(_(e,"allowGapCursor",r)))!==null&&t!==void 0?t:null}}}),vh=wt.create({name:"hardBreak",defaultOptions:{HTMLAttributes:{}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Ot(this.options.HTMLAttributes,e)]},addCommands(){return{setHardBreak:()=>({commands:e})=>e.first([()=>e.exitCode(),()=>e.insertContent({type:this.name})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),gh=wt.create({name:"heading",defaultOptions:{levels:[1,2,3,4,5,6],HTMLAttributes:{}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode("heading",e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode("heading","paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>Tt(S({},e),{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>fo(new RegExp(`^(#{1,${e}})\\s$`),this.type,{level:e}))}});var Qr=200,ct=function(){};ct.prototype.append=function(t){return t.length?(t=ct.from(t),!this.length&&t||t.length=r?ct.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};ct.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ct.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};ct.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};ct.from=function(t){return t instanceof ct?t:t&&t.length?new Ba(t):ct.empty};var Ba=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var c=i;c=s;c--)if(o(this.values[c],a+c)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Qr)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Qr)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(ct);ct.empty=new Ba([]);var yh=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(ct),za=ct,bh=500,lt=function(t,r){this.items=t,this.eventCount=r};lt.prototype.popEvent=function(t,r){var n=this;if(this.eventCount==0)return null;for(var o=this.items.length;;o--){var i=this.items.get(o-1);if(i.selection){--o;break}}var s,a;r&&(s=this.remapping(o,this.items.length),a=s.maps.length);var c=t.tr,l,u,f=[],p=[];return this.items.forEach(function(d,h){if(!d.step){s||(s=n.remapping(o,h+1),a=s.maps.length),a--,p.push(d);return}if(s){p.push(new Xt(d.map));var v=d.step.map(s.slice(a)),g;v&&c.maybeStep(v).doc&&(g=c.mapping.maps[c.mapping.maps.length-1],f.push(new Xt(g,null,null,f.length+p.length))),a--,g&&s.appendMap(g,a)}else c.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(a)):d.selection,u=new lt(n.items.slice(0,o).append(p.reverse().concat(f)),n.eventCount-1),!1},this.items.length,0),{remaining:u,transform:c,selection:l}};lt.prototype.addTransform=function(t,r,n,o){for(var i=[],s=this.eventCount,a=this.items,c=!o&&a.length?a.get(a.length-1):null,l=0;lSh&&(a=kh(a,d),s-=d),new lt(a.append(i),s)};lt.prototype.remapping=function(t,r){var n=new dt;return this.items.forEach(function(o,i){var s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:null;n.appendMap(o.map,s)},t,r),n};lt.prototype.addMaps=function(t){return this.eventCount==0?this:new lt(this.items.append(t.map(function(r){return new Xt(r)})),this.eventCount)};lt.prototype.rebased=function(t,r){if(!this.eventCount)return this;var n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(function(d){d.selection&&a--},o);var c=r;this.items.forEach(function(d){var h=i.getMirror(--c);if(h!=null){s=Math.min(s,h);var v=i.maps[h];if(d.step){var g=t.steps[h].invert(t.docs[h]),M=d.selection&&d.selection.map(i.slice(c+1,h));M&&a++,n.push(new Xt(v,g,M))}else n.push(new Xt(v))}},o);for(var l=[],u=r;ubh&&(p=p.compress(this.items.length-n.length)),p};lt.prototype.emptyItemCount=function(){var t=0;return this.items.forEach(function(r){r.step||t++}),t};lt.prototype.compress=function(t){t===void 0&&(t=this.items.length);var r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach(function(s,a){if(a>=t)o.push(s),s.selection&&i++;else if(s.step){var c=s.step.map(r.slice(n)),l=c&&c.getMap();if(n--,l&&r.appendMap(l,n),c){var u=s.selection&&s.selection.map(r.slice(n));u&&i++;var f=new Xt(l.invert(),c,u),p,d=o.length-1;(p=o.length&&o[d].merge(f))?o[d]=p:o.push(f)}}else s.map&&n--},this.items.length,0),new lt(za.from(o.reverse()),i)};lt.empty=new lt(za.empty,0);function kh(e,t){var r;return e.forEach(function(n,o){if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}var Xt=function(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o};Xt.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var r=t.step.merge(this.step);if(r)return new Xt(r.getMap().invert(),r,this.selection)}};var me=function(t,r,n,o){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o},Sh=20;function Mh(e,t,r,n){var o=r.getMeta(ve),i;if(o)return o.historyState;r.getMeta(Ch)&&(e=new me(e.done,e.undone,null,0));var s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(ve))return s.getMeta(ve).redo?new me(e.done.addTransform(r,null,n,Zr(t)),e.undone,La(r.mapping.maps[r.steps.length-1]),e.prevTime):new me(e.done,e.undone.addTransform(r,null,n,Zr(t)),null,e.prevTime);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){var a=e.prevTime==0||!s&&(e.prevTime<(r.time||0)-n.newGroupDelay||!xh(r,e.prevRanges)),c=s?Ao(e.prevRanges,r.mapping):La(r.mapping.maps[r.steps.length-1]);return new me(e.done.addTransform(r,a?t.selection.getBookmark():null,n,Zr(t)),lt.empty,c,r.time)}else return(i=r.getMeta("rebased"))?new me(e.done.rebased(r,i),e.undone.rebased(r,i),Ao(e.prevRanges,r.mapping),e.prevTime):new me(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),Ao(e.prevRanges,r.mapping),e.prevTime)}function xh(e,t){if(!t)return!1;if(!e.docChanged)return!0;var r=!1;return e.mapping.maps[0].forEach(function(n,o){for(var i=0;i=t[i]&&(r=!0)}),r}function La(e){var t=[];return e.forEach(function(r,n,o,i){return t.push(o,i)}),t}function Ao(e,t){if(!e)return null;for(var r=[],n=0;n({state:e,dispatch:t})=>Ha(e,t),redo:()=>({state:e,dispatch:t})=>ja(e,t)}},addProseMirrorPlugins(){return[Oh(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Th=wt.create({name:"horizontalRule",defaultOptions:{HTMLAttributes:{}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Ot(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:t,dispatch:r})=>{const{selection:n}=t,{empty:o,$anchor:i}=n,s=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;if(!o||!s||!r)return!0;const a=i.before();return t.deleteRange(a,a+1),!0}).insertContent({type:this.name}).command(({tr:t,dispatch:r})=>{var n;if(r){const{parent:o,pos:i}=t.selection.$from,s=i+1;if(!t.doc.nodeAt(s)){const c=(n=o.type.contentMatch.defaultType)===null||n===void 0?void 0:n.create();c&&(t.insert(s,c),t.setSelection(H.create(t.doc,s)))}t.scrollIntoView()}return!0}).run()}},addInputRules(){return[ud(/^(?:---|—-|___\s|\*\*\*\s)$/,this.type)]}}),Ah=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,_h=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,Nh=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,Eh=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,Dh=Te.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qe(Ah,this.type),qe(Nh,this.type)]},addPasteRules(){return[Je(_h,this.type),Je(Eh,this.type)]}}),Ih=wt.create({name:"listItem",defaultOptions:{HTMLAttributes:{}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Ot(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),Rh=/^(\d+)\.\s$/,Ph=wt.create({name:"orderedList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",addAttributes(){return{start:{default:1,parseHTML:e=>({start:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1})}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const n=e,{start:t}=n,r=Go(n,["start"]);return t===1?["ol",Ot(this.options.HTMLAttributes,r),0]:["ol",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[uo(Rh,this.type,e=>({start:+e[1]}),(e,t)=>t.childCount+t.attrs.start===+e[1])]}}),Bh=wt.create({name:"paragraph",priority:1e3,defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode("paragraph")}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),zh=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,Lh=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm,Fh=Te.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qe(zh,this.type)]},addPasteRules(){return[Je(Lh,this.type)]}}),Vh=wt.create({name:"text",group:"inline"}),Hh=St.create({name:"starterKit",addExtensions(){var e,t,r,n,o,i,s,a,c,l,u,f,p,d,h,v,g,M;const y=[];return this.options.blockquote!==!1&&y.push(Kd.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bold!==!1&&y.push(Xd.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.bulletList!==!1&&y.push(Zd.configure((r=this.options)===null||r===void 0?void 0:r.bulletList)),this.options.code!==!1&&y.push(rh.configure((n=this.options)===null||n===void 0?void 0:n.code)),this.options.codeBlock!==!1&&y.push(ih.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&y.push(sh.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&y.push(ch.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&y.push(mh.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&y.push(vh.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&y.push(gh.configure((l=this.options)===null||l===void 0?void 0:l.heading)),this.options.history!==!1&&y.push(wh.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&y.push(Th.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&y.push(Dh.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&y.push(Ih.configure((d=this.options)===null||d===void 0?void 0:d.listItem)),this.options.orderedList!==!1&&y.push(Ph.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&y.push(Bh.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&y.push(Fh.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&y.push(Vh.configure((M=this.options)===null||M===void 0?void 0:M.text)),y}}),jh=St.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.every(r=>t.updateAttributes(r,{textAlign:e})):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),qh={},Jh={viewBox:"0 0 24 24"},Wh=A("path",{d:"M17.194 10.962A6.271 6.271 0 0012.844.248H4.3a1.25 1.25 0 000 2.5h1.013a.25.25 0 01.25.25V21a.25.25 0 01-.25.25H4.3a1.25 1.25 0 100 2.5h9.963a6.742 6.742 0 002.93-12.786zm-4.35-8.214a3.762 3.762 0 010 7.523H8.313a.25.25 0 01-.25-.25V3a.25.25 0 01.25-.25zm1.42 18.5H8.313a.25.25 0 01-.25-.25v-7.977a.25.25 0 01.25-.25h5.951a4.239 4.239 0 010 8.477z"},null,-1),Kh=[Wh];function $h(e,t){return gt(),Mt("svg",Jh,Kh)}var Uh=At(qh,[["render",$h]]);const Gh={},Yh={viewBox:"0 0 24 24"},Xh=A("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Qh=[Xh];function Zh(e,t){return gt(),Mt("svg",Yh,Qh)}var tm=At(Gh,[["render",Zh]]);const em={},rm={viewBox:"0 0 24 24"},nm=A("path",{d:"M22.5.248h-7.637a1.25 1.25 0 000 2.5h1.086a.25.25 0 01.211.384L4.78 21.017a.5.5 0 01-.422.231H1.5a1.25 1.25 0 000 2.5h7.637a1.25 1.25 0 000-2.5H8.051a.25.25 0 01-.211-.384L19.22 2.98a.5.5 0 01.422-.232H22.5a1.25 1.25 0 000-2.5z"},null,-1),om=[nm];function im(e,t){return gt(),Mt("svg",rm,om)}var sm=At(em,[["render",im]]);const am={},cm={viewBox:"0 0 24 24"},lm=A("path",{d:"M7.75 4.5h15a1 1 0 000-2h-15a1 1 0 000 2zm15 6.5h-15a1 1 0 100 2h15a1 1 0 000-2zm0 8.5h-15a1 1 0 000 2h15a1 1 0 000-2zM2.212 17.248a2 2 0 00-1.933 1.484.75.75 0 101.45.386.5.5 0 11.483.63.75.75 0 100 1.5.5.5 0 11-.482.635.75.75 0 10-1.445.4 2 2 0 103.589-1.648.251.251 0 010-.278 2 2 0 00-1.662-3.111zm2.038-6.5a2 2 0 00-4 0 .75.75 0 001.5 0 .5.5 0 011 0 1.031 1.031 0 01-.227.645L.414 14.029A.75.75 0 001 15.248h2.5a.75.75 0 000-1.5h-.419a.249.249 0 01-.195-.406L3.7 12.33a2.544 2.544 0 00.55-1.582zM4 5.248h-.25A.25.25 0 013.5 5V1.623A1.377 1.377 0 002.125.248H1.5a.75.75 0 000 1.5h.25A.25.25 0 012 2v3a.25.25 0 01-.25.25H1.5a.75.75 0 000 1.5H4a.75.75 0 000-1.5z"},null,-1),um=[lm];function fm(e,t){return gt(),Mt("svg",cm,um)}var pm=At(am,[["render",fm]]);const dm={},hm={viewBox:"0 0 24 24"},mm=vc('',6),vm=[mm];function gm(e,t){return gt(),Mt("svg",hm,vm)}var ym=At(dm,[["render",gm]]);const bm={},km={viewBox:"0 0 24 24"},Sm=A("path",{d:"M22.5.248H7.228a6.977 6.977 0 100 13.954h2.318a.25.25 0 01.25.25V22.5a1.25 1.25 0 002.5 0V3a.25.25 0 01.25-.25h3.682a.25.25 0 01.25.25v19.5a1.25 1.25 0 002.5 0V3a.249.249 0 01.25-.25H22.5a1.25 1.25 0 000-2.5zM9.8 11.452a.25.25 0 01-.25.25H7.228a4.477 4.477 0 110-8.954h2.318A.25.25 0 019.8 3z"},null,-1),Mm=[Sm];function xm(e,t){return gt(),Mt("svg",km,Mm)}var Cm=At(bm,[["render",xm]]);const Om={},wm={viewBox:"0 0 24 24"},Tm=A("path",{d:"M18.559 3.932a4.942 4.942 0 100 9.883 4.609 4.609 0 001.115-.141.25.25 0 01.276.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.71 9.71 0 009.428-9.95V8.873a4.947 4.947 0 00-4.941-4.941zm-12.323 0a4.942 4.942 0 000 9.883 4.6 4.6 0 001.115-.141.25.25 0 01.277.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.711 9.711 0 009.428-9.95V8.873a4.947 4.947 0 00-4.942-4.941z"},null,-1),Am=[Tm];function _m(e,t){return gt(),Mt("svg",wm,Am)}var Nm=At(Om,[["render",_m]]);const Em={},Dm={viewBox:"0 0 24 24"},Im=A("path",{d:"M23.75 12.952A1.25 1.25 0 0022.5 11.7h-8.936a.492.492 0 01-.282-.09c-.722-.513-1.482-.981-2.218-1.432-2.8-1.715-4.5-2.9-4.5-4.863 0-2.235 2.207-2.569 3.523-2.569a4.54 4.54 0 013.081.764 2.662 2.662 0 01.447 1.99v.3a1.25 1.25 0 102.5 0v-.268a4.887 4.887 0 00-1.165-3.777C13.949.741 12.359.248 10.091.248c-3.658 0-6.023 1.989-6.023 5.069 0 2.773 1.892 4.512 4 5.927a.25.25 0 01-.139.458H1.5a1.25 1.25 0 000 2.5h10.977a.251.251 0 01.159.058 4.339 4.339 0 011.932 3.466c0 3.268-3.426 3.522-4.477 3.522-1.814 0-3.139-.405-3.834-1.173a3.394 3.394 0 01-.65-2.7 1.25 1.25 0 00-2.488-.246A5.76 5.76 0 004.4 21.753c1.2 1.324 3.114 2 5.688 2 4.174 0 6.977-2.42 6.977-6.022a6.059 6.059 0 00-.849-3.147.25.25 0 01.216-.377H22.5a1.25 1.25 0 001.25-1.255z"},null,-1),Rm=[Im];function Pm(e,t){return gt(),Mt("svg",Dm,Rm)}var Bm=At(Em,[["render",Pm]]);const zm={},Lm={viewBox:"0 0 24 24"},Fm=A("path",{d:"M17.786 3.77a12.542 12.542 0 00-12.965-.865.249.249 0 01-.292-.045L1.937.269A.507.507 0 001.392.16a.5.5 0 00-.308.462v6.7a.5.5 0 00.5.5h6.7a.5.5 0 00.354-.854L6.783 5.115a.253.253 0 01-.068-.228.249.249 0 01.152-.181 10 10 0 019.466 1.1 9.759 9.759 0 01.094 15.809 1.25 1.25 0 001.473 2.016 12.122 12.122 0 005.013-9.961 12.125 12.125 0 00-5.127-9.9z"},null,-1),Vm=[Fm];function Hm(e,t){return gt(),Mt("svg",Lm,Vm)}var jm=At(zm,[["render",Hm]]);const qm={},Jm={viewBox:"0 0 24 24"},Wm=A("path",{d:"M22.608.161a.5.5 0 00-.545.108L19.472 2.86a.25.25 0 01-.292.045 12.537 12.537 0 00-12.966.865A12.259 12.259 0 006.1 23.632a1.25 1.25 0 001.476-2.018 9.759 9.759 0 01.091-15.809 10 10 0 019.466-1.1.25.25 0 01.084.409l-1.85 1.85a.5.5 0 00.354.853h6.7a.5.5 0 00.5-.5V.623a.5.5 0 00-.313-.462z"},null,-1),Km=[Wm];function $m(e,t){return gt(),Mt("svg",Jm,Km)}var Um=At(qm,[["render",$m]]);const Gm={},Ym={viewBox:"0 0 24 24"},Xm=A("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Qm=[Xm];function Zm(e,t){return gt(),Mt("svg",Ym,Qm)}var tv=At(Gm,[["render",Zm]]);const ev={},rv={viewBox:"0 0 24 24"},nv=A("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.75 5.25h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 0 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5zm-4 4h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 1 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5z"},null,-1),ov=[nv];function iv(e,t){return gt(),Mt("svg",rv,ov)}var sv=At(ev,[["render",iv]]);const av={components:{EditorContent:qd,BoldIcon:Uh,CodingIcon:tm,ItalicIcon:sm,ListIcon:pm,ListUlIcon:ym,ParagraphIcon:Cm,QuoteIcon:Nm,StrikethroughIcon:Bm,UndoIcon:jm,RedoIcon:Um,CodeBlockIcon:tv,DotsVerticalIcon:gc,MenuCenterIcon:sv,MenuAlt2Icon:yc,MenuAlt3Icon:bc,MenuIcon:kc},props:{modelValue:{type:String,default:""},contentLoading:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const r=Jd({content:e.modelValue,extensions:[Hh,jh.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"]})],onUpdate:()=>{t("update:modelValue",r.value.getHTML())}});return Sc(()=>e.modelValue,n=>{r.value.getHTML()!==n&&r.value.commands.setContent(e.modelValue,!1)}),Mc(()=>{setTimeout(()=>{r.value.destroy()},500)}),{editor:r}}},cv={key:1,class:"box-border w-full text-sm leading-8 text-left bg-white border border-gray-200 rounded-md min-h-[200px] overflow-hidden"},lv={key:0,class:"editor-content"},uv={class:"flex justify-end p-2 border-b border-gray-200 md:hidden"},fv={class:"flex items-center justify-center w-6 h-6 ml-2 text-sm text-black bg-white rounded-sm md:h-9 md:w-9"},pv={class:"flex flex-wrap space-x-1"},dv={class:"hidden p-2 border-b border-gray-200 md:flex"},hv={class:"flex flex-wrap space-x-1"};function mv(e,t,r,n,o,i){const s=Q("BaseContentPlaceholdersBox"),a=Q("BaseContentPlaceholders"),c=Q("dots-vertical-icon"),l=Q("bold-icon"),u=Q("italic-icon"),f=Q("strikethrough-icon"),p=Q("coding-icon"),d=Q("paragraph-icon"),h=Q("list-ul-icon"),v=Q("list-icon"),g=Q("quote-icon"),M=Q("code-block-icon"),y=Q("undo-icon"),R=Q("redo-icon"),m=Q("BaseDropdown"),I=Q("menu-alt2-icon"),O=Q("menu-alt3-icon"),F=Q("menu-icon"),J=Q("menu-center-icon"),U=Q("editor-content");return r.contentLoading?(gt(),xc(a,{key:0},{default:an(()=>[V(s,{rounded:!0,class:"w-full",style:{height:"200px"}})]),_:1})):(gt(),Mt("div",cv,[n.editor?(gt(),Mt("div",lv,[A("div",uv,[V(m,{"width-class":"w-48"},{activator:an(()=>[A("div",fv,[V(c,{class:"w-6 h-6 text-gray-600"})])]),default:an(()=>[A("div",pv,[A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:t[0]||(t[0]=T=>n.editor.chain().focus().toggleBold().run())},[V(l,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:t[1]||(t[1]=T=>n.editor.chain().focus().toggleItalic().run())},[V(u,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:t[2]||(t[2]=T=>n.editor.chain().focus().toggleStrike().run())},[V(f,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:t[3]||(t[3]=T=>n.editor.chain().focus().toggleCode().run())},[V(p,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:t[4]||(t[4]=T=>n.editor.chain().focus().setParagraph().run())},[V(d,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:t[5]||(t[5]=T=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:t[6]||(t[6]=T=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:t[7]||(t[7]=T=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:t[8]||(t[8]=T=>n.editor.chain().focus().toggleBulletList().run())},[V(h,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:t[9]||(t[9]=T=>n.editor.chain().focus().toggleOrderedList().run())},[V(v,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:t[10]||(t[10]=T=>n.editor.chain().focus().toggleBlockquote().run())},[V(g,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:t[11]||(t[11]=T=>n.editor.chain().focus().toggleCodeBlock().run())},[V(M,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:t[12]||(t[12]=T=>n.editor.chain().focus().undo().run())},[V(y,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:t[13]||(t[13]=T=>n.editor.chain().focus().redo().run())},[V(R,{class:"h-3 cursor-pointer fill-current"})],2)])]),_:1})]),A("div",dv,[A("div",hv,[A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:t[14]||(t[14]=T=>n.editor.chain().focus().toggleBold().run())},[V(l,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:t[15]||(t[15]=T=>n.editor.chain().focus().toggleItalic().run())},[V(u,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:t[16]||(t[16]=T=>n.editor.chain().focus().toggleStrike().run())},[V(f,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:t[17]||(t[17]=T=>n.editor.chain().focus().toggleCode().run())},[V(p,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:t[18]||(t[18]=T=>n.editor.chain().focus().setParagraph().run())},[V(d,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:t[19]||(t[19]=T=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:t[20]||(t[20]=T=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:t[21]||(t[21]=T=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:t[22]||(t[22]=T=>n.editor.chain().focus().toggleBulletList().run())},[V(h,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:t[23]||(t[23]=T=>n.editor.chain().focus().toggleOrderedList().run())},[V(v,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:t[24]||(t[24]=T=>n.editor.chain().focus().toggleBlockquote().run())},[V(g,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:t[25]||(t[25]=T=>n.editor.chain().focus().toggleCodeBlock().run())},[V(M,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:t[26]||(t[26]=T=>n.editor.chain().focus().undo().run())},[V(y,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:t[27]||(t[27]=T=>n.editor.chain().focus().redo().run())},[V(R,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"left"})}]),onClick:t[28]||(t[28]=T=>n.editor.chain().focus().setTextAlign("left").run())},[V(I,{class:"h-5 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"right"})}]),onClick:t[29]||(t[29]=T=>n.editor.chain().focus().setTextAlign("right").run())},[V(O,{class:"h-5 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"justify"})}]),onClick:t[30]||(t[30]=T=>n.editor.chain().focus().setTextAlign("justify").run())},[V(F,{class:"h-5 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"center"})}]),onClick:t[31]||(t[31]=T=>n.editor.chain().focus().setTextAlign("center").run())},[V(J,{class:"h-5 cursor-pointer fill-current"})],2)])]),V(U,{editor:n.editor,class:"box-border relative w-full text-sm leading-8 text-left editor__content"},null,8,["editor"])])):Cc("",!0)]))}var bv=At(av,[["render",mv]]);export{bv as default}; diff --git a/public/build/assets/BaseListItem-SKSPChPw.js b/public/build/assets/BaseListItem-SKSPChPw.js new file mode 100644 index 00000000..c34e53ee --- /dev/null +++ b/public/build/assets/BaseListItem-SKSPChPw.js @@ -0,0 +1 @@ +import{X as c,o as r,c as l,a0 as i,l as o,r as d,n as m,w as _,I as f,b as $,t as B,aG as h}from"./main-vzIkKseS.js";const x={name:"List"},y={class:"list-none"};function k(e,a,t,s,n,u){return r(),l("div",y,[i(e.$slots,"default")])}const v=c(x,[["render",k]]),C={name:"ListItem",props:{title:{type:String,required:!1,default:""},active:{type:Boolean,required:!0},index:{type:Number,default:null}},setup(e,{slots:a}){const t="cursor-pointer pb-2 pr-0 text-sm font-medium leading-5 flex items-center";let s=o(()=>!!a.icon),n=o(()=>e.active?`${t} text-primary-500`:`${t} text-gray-500`);return{hasIconSlot:s,containerClass:n}}},g={key:0,class:"mr-3"};function I(e,a,t,s,n,u){const p=d("router-link");return r(),m(p,h(e.$attrs,{class:s.containerClass}),{default:_(()=>[s.hasIconSlot?(r(),l("span",g,[i(e.$slots,"icon")])):f("",!0),$("span",null,B(t.title),1)]),_:3},16,["class"])}const L=c(C,[["render",I]]);export{L as B,v as a}; diff --git a/public/build/assets/BaseListItem.5fd4d75d.js b/public/build/assets/BaseListItem.5fd4d75d.js deleted file mode 100644 index 8c71deec..00000000 --- a/public/build/assets/BaseListItem.5fd4d75d.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./main.fc26c84f.js";import{o as n,e as c,g as i,k as l,r as d,l as m,w as f,j as _,h as $,t as h,s as B}from"./vendor.fd3b1727.js";const k={name:"List"},v={class:"list-none"};function x(e,r,t,s,a,p){return n(),c("div",v,[i(e.$slots,"default")])}var L=o(k,[["render",x]]);const y={name:"ListItem",props:{title:{type:String,required:!1,default:""},active:{type:Boolean,required:!0},index:{type:Number,default:null}},setup(e,{slots:r}){const t="cursor-pointer pb-2 pr-0 text-sm font-medium leading-5 flex items-center";let s=l(()=>!!r.icon),a=l(()=>e.active?`${t} text-primary-500`:`${t} text-gray-500`);return{hasIconSlot:s,containerClass:a}}},g={key:0,class:"mr-3"};function C(e,r,t,s,a,p){const u=d("router-link");return n(),m(u,B(e.$attrs,{class:s.containerClass}),{default:f(()=>[s.hasIconSlot?(n(),c("span",g,[i(e.$slots,"icon")])):_("",!0),$("span",null,h(t.title),1)]),_:3},16,["class"])}var b=o(y,[["render",C]]);export{b as B,L as a}; diff --git a/public/build/assets/BaseMultiselect-T7POF4wb.js b/public/build/assets/BaseMultiselect-T7POF4wb.js new file mode 100644 index 00000000..282a31be --- /dev/null +++ b/public/build/assets/BaseMultiselect-T7POF4wb.js @@ -0,0 +1 @@ +import{bm as x,g as M,l as w,z as re,bn as Ie,X as We,r as qe,o as I,n as Xe,w as Je,a as Qe,c as q,H as L,s as de,I as E,L as le,M as ne,a0 as C,q as Ue,t as X,b as P}from"./main-vzIkKseS.js";function H(e){return[null,void 0,!1].indexOf(e)!==-1}function Ye(e,u,a){const{object:i,valueProp:o,mode:v}=x(e),f=a.iv,g=p=>{f.value=c(p);const b=t(p);u.emit("change",b),u.emit("input",b),u.emit("update:modelValue",b)},t=p=>i.value||H(p)?p:Array.isArray(p)?p.map(b=>b[o.value]):p[o.value],c=p=>H(p)?v.value==="single"?{}:[]:p;return{update:g}}function Ze(e,u){const{value:a,modelValue:i,mode:o,valueProp:v}=x(e),f=M(o.value!=="single"?[]:{}),g=u.expose!==void 0?i:a,t=w(()=>o.value==="single"?f.value[v.value]:f.value.map(p=>p[v.value])),c=w(()=>o.value!=="single"?f.value.map(p=>p[v.value]).join(","):f.value[v.value]);return{iv:f,internalValue:f,ev:g,externalValue:g,textValue:c,plainValue:t}}function $e(e,u,a){const{preserveSearch:i}=x(e),o=M(e.initialSearch)||M(null),v=M(null),f=()=>{i.value||(o.value="")},g=c=>{o.value=c.target.value},t=c=>{u.emit("paste",c)};return re(o,c=>{u.emit("search-change",c)}),{search:o,input:v,clearSearch:f,handleSearchInput:g,handlePaste:t}}function _e(e,u,a){const{groupSelect:i,mode:o,groups:v}=x(e),f=M(null),g=c=>{c===void 0||c!==null&&c.disabled||v.value&&c&&c.group&&(o.value==="single"||!i.value)||(f.value=c)};return{pointer:f,setPointer:g,clearPointer:()=>{g(null)}}}function Be(e,u=!0){return u?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim()}function el(e){return Object.prototype.toString.call(e)==="[object Object]"}function ll(e,u){const a=u.slice().sort();return e.length===u.length&&e.slice().sort().every(function(i,o){return i===a[o]})}function al(e,u,a){const{options:i,mode:o,trackBy:v,limit:f,hideSelected:g,createTag:t,label:c,appendNewTag:p,multipleLabel:b,object:B,loading:V,delay:D,resolveOnLoad:h,minChars:r,filterResults:j,clearOnSearch:Y,clearOnSelect:k,valueProp:d,canDeselect:R,max:O,strict:J,closeOnSelect:Q,groups:Z,groupLabel:se,groupOptions:A,groupHideEmpty:ve,groupSelect:pe}=x(e),S=a.iv,F=a.ev,T=a.search,$=a.clearSearch,_=a.update,fe=a.pointer,ue=a.clearPointer,K=a.blur,ae=a.deactivate,n=M([]),m=M([]),G=M(!1),N=w(()=>{if(Z.value){let l=m.value||[],s=[];return l.forEach(y=>{Se(y[A.value]).forEach(W=>{s.push(Object.assign({},W,y.disabled?{disabled:!0}:{}))})}),s}else{let l=Se(m.value||[]);return n.value.length&&(l=l.concat(n.value)),l}}),we=w(()=>Z.value?Fe((m.value||[]).map(l=>{const s=Se(l[A.value]);return{...l,group:!0,[A.value]:ye(s,!1).map(y=>Object.assign({},y,l.disabled?{disabled:!0}:{})),__VISIBLE__:ye(s).map(y=>Object.assign({},y,l.disabled?{disabled:!0}:{}))}})):[]),oe=w(()=>{let l=N.value;return be.value.length&&(l=be.value.concat(l)),l=ye(l),f.value>0&&(l=l.slice(0,f.value)),l}),ge=w(()=>{switch(o.value){case"single":return!H(S.value[d.value]);case"multiple":case"tags":return!H(S.value)&&S.value.length>0}}),Te=w(()=>b!==void 0&&b.value!==void 0?b.value(S.value):S.value&&S.value.length>1?`${S.value.length} options selected`:"1 option selected"),Ce=w(()=>!N.value.length&&!G.value&&!be.value.length),De=w(()=>N.value.length>0&&oe.value.length==0&&(T.value&&Z.value||!Z.value)),be=w(()=>t.value===!1||!T.value?[]:Ne(T.value)!==-1?[]:[{[d.value]:T.value,[c.value]:T.value,[v.value]:T.value}]),Ee=w(()=>{switch(o.value){case"single":return null;case"multiple":case"tags":return[]}}),Ve=w(()=>V.value||G.value),te=l=>{switch(typeof l!="object"&&(l=z(l)),o.value){case"single":_(l);break;case"multiple":case"tags":_(S.value.concat(l));break}u.emit("select",Le(l),l)},ee=l=>{switch(typeof l!="object"&&(l=z(l)),o.value){case"single":Pe();break;case"tags":case"multiple":_(Array.isArray(l)?S.value.filter(s=>l.map(y=>y[d.value]).indexOf(s[d.value])===-1):S.value.filter(s=>s[d.value]!=l[d.value]));break}u.emit("deselect",Le(l),l)},Le=l=>B.value?l:l[d.value],Oe=l=>{ee(l)},Re=(l,s)=>{if(s.button!==0){s.preventDefault();return}Oe(l)},Pe=()=>{u.emit("clear"),_(Ee.value)},U=l=>{if(l.group!==void 0)return o.value==="single"?!1:Me(l[A.value])&&l[A.value].length;switch(o.value){case"single":return!H(S.value)&&S.value[d.value]==l[d.value];case"tags":case"multiple":return!H(S.value)&&S.value.map(s=>s[d.value]).indexOf(l[d.value])!==-1}},he=l=>l.disabled===!0,me=()=>O===void 0||O.value===-1||!ge.value&&O.value>0?!1:S.value.length>=O.value,Ge=l=>{if(!he(l)){switch(o.value){case"single":if(U(l)){R.value&&ee(l);return}K(),te(l);break;case"multiple":if(U(l)){ee(l);return}if(me())return;te(l),k.value&&$(),g.value&&ue(),Q.value&&K();break;case"tags":if(U(l)){ee(l);return}if(me())return;z(l[d.value])===void 0&&t.value&&(u.emit("tag",l[d.value]),p.value&&xe(l),$()),k.value&&$(),te(l),g.value&&ue(),Q.value&&K();break}Q.value&&ae()}},je=l=>{if(!(he(l)||o.value==="single"||!pe.value)){switch(o.value){case"multiple":case"tags":Ae(l[A.value])?ee(l[A.value]):te(l[A.value].filter(s=>S.value.map(y=>y[d.value]).indexOf(s[d.value])===-1).filter(s=>!s.disabled).filter((s,y)=>S.value.length+1+y<=O.value||O.value===-1));break}Q.value&&ae()}},Ae=l=>l.find(s=>!U(s)&&!s.disabled)===void 0,Me=l=>l.find(s=>!U(s))===void 0,z=l=>N.value[N.value.map(s=>String(s[d.value])).indexOf(String(l))],Ne=(l,s=!0)=>N.value.map(y=>y[v.value]).indexOf(l),He=l=>["tags","multiple"].indexOf(o.value)!==-1&&g.value&&U(l),xe=l=>{n.value.push(l)},Fe=l=>ve.value?l.filter(s=>T.value?s.__VISIBLE__.length:s[A.value].length):l.filter(s=>T.value?s.__VISIBLE__.length:!0),ye=(l,s=!0)=>{let y=l;return T.value&&j.value&&(y=y.filter(W=>Be(W[v.value],J.value).indexOf(Be(T.value,J.value))!==-1)),g.value&&s&&(y=y.filter(W=>!He(W))),y},Se=l=>{let s=l;return el(s)&&(s=Object.keys(s).map(y=>{let W=s[y];return{[d.value]:y,[v.value]:W,[c.value]:W}})),s=s.map(y=>typeof y=="object"?y:{[d.value]:y,[v.value]:y,[c.value]:y}),s},ie=()=>{H(F.value)||(S.value=ce(F.value))},ke=l=>{G.value=!0,i.value(T.value).then(s=>{m.value=s,typeof l=="function"&&l(s),G.value=!1})},ze=()=>{if(ge.value)if(o.value==="single"){let l=z(S.value[d.value])[c.value];S.value[c.value]=l,B.value&&(F.value[c.value]=l)}else S.value.forEach((l,s)=>{let y=z(S.value[s][d.value])[c.value];S.value[s][c.value]=y,B.value&&(F.value[s][c.value]=y)})},Ke=l=>{ke(l)},ce=l=>H(l)?o.value==="single"?{}:[]:B.value?l:o.value==="single"?z(l)||{}:l.filter(s=>!!z(s)).map(s=>z(s));if(o.value!=="single"&&!H(F.value)&&!Array.isArray(F.value))throw new Error(`v-model must be an array when using "${o.value}" mode`);return i&&typeof i.value=="function"?h.value?ke(ie):B.value==!0&&ie():(m.value=i.value,ie()),D.value>-1&&re(T,l=>{l.length{l==T.value&&i.value(T.value).then(s=>{l==T.value&&(m.value=s,fe.value=oe.value.filter(y=>y.disabled!==!0)[0]||null,G.value=!1)})},D.value))},{flush:"sync"}),re(F,l=>{if(H(l)){S.value=ce(l);return}switch(o.value){case"single":(B.value?l[d.value]!=S.value[d.value]:l!=S.value[d.value])&&(S.value=ce(l));break;case"multiple":case"tags":ll(B.value?l.map(s=>s[d.value]):l,S.value.map(s=>s[d.value]))||(S.value=ce(l));break}},{deep:!0}),typeof e.options!="function"&&re(i,(l,s)=>{m.value=e.options,Object.keys(S.value).length||ie(),ze()}),{fo:oe,filteredOptions:oe,hasSelected:ge,multipleLabelText:Te,eo:N,extendedOptions:N,fg:we,filteredGroups:we,noOptions:Ce,noResults:De,resolving:G,busy:Ve,select:te,deselect:ee,remove:Oe,clear:Pe,isSelected:U,isDisabled:he,isMax:me,getOption:z,handleOptionClick:Ge,handleGroupClick:je,handleTagRemove:Re,refreshOptions:Ke,resolveOptions:ke}}function tl(e,u,a){const{valueProp:i,showOptions:o,searchable:v,groupLabel:f,groups:g,mode:t,groupSelect:c}=x(e),p=a.fo,b=a.fg,B=a.handleOptionClick,V=a.handleGroupClick,D=a.search,h=a.pointer,r=a.setPointer,j=a.clearPointer,Y=a.multiselect,k=w(()=>p.value.filter(n=>!n.disabled)),d=w(()=>b.value.filter(n=>!n.disabled)),R=w(()=>t.value!=="single"&&c.value),O=w(()=>h.value&&h.value.group),J=w(()=>K(h.value)),Q=w(()=>{const n=O.value?h.value:K(h.value),m=d.value.map(N=>N[f.value]).indexOf(n[f.value]);let G=d.value[m-1];return G===void 0&&(G=se.value),G}),Z=w(()=>{let n=d.value.map(m=>m.label).indexOf(O.value?h.value[f.value]:K(h.value)[f.value])+1;return d.value.length<=n&&(n=0),d.value[n]}),se=w(()=>[...d.value].slice(-1)[0]),A=w(()=>h.value.__VISIBLE__.filter(n=>!n.disabled)[0]),ve=w(()=>{const n=J.value.__VISIBLE__.filter(m=>!m.disabled);return n[n.map(m=>m[i.value]).indexOf(h.value[i.value])-1]}),pe=w(()=>{const n=K(h.value).__VISIBLE__.filter(m=>!m.disabled);return n[n.map(m=>m[i.value]).indexOf(h.value[i.value])+1]}),S=w(()=>[...Q.value.__VISIBLE__.filter(n=>!n.disabled)].slice(-1)[0]),F=w(()=>[...se.value.__VISIBLE__.filter(n=>!n.disabled)].slice(-1)[0]),T=n=>{if(h.value)return n.group?h.value[f.value]==n[f.value]:h.value[i.value]==n[i.value]},$=()=>{r(k.value[0]||null)},_=()=>{!h.value||h.value.disabled===!0||(O.value?V(h.value):B(h.value))},fe=()=>{if(h.value===null)r((g.value&&R.value?d.value[0]:k.value[0])||null);else if(g.value&&R.value){let n=O.value?A.value:pe.value;n===void 0&&(n=Z.value),r(n||null)}else{let n=k.value.map(m=>m[i.value]).indexOf(h.value[i.value])+1;k.value.length<=n&&(n=0),r(k.value[n]||null)}Ie(()=>{ae()})},ue=()=>{if(h.value===null){let n=k.value[k.value.length-1];g.value&&R.value&&(n=F.value,n===void 0&&(n=se.value)),r(n||null)}else if(g.value&&R.value){let n=O.value?S.value:ve.value;n===void 0&&(n=O.value?Q.value:J.value),r(n||null)}else{let n=k.value.map(m=>m[i.value]).indexOf(h.value[i.value])-1;n<0&&(n=k.value.length-1),r(k.value[n]||null)}Ie(()=>{ae()})},K=n=>d.value.find(m=>m.__VISIBLE__.map(G=>G[i.value]).indexOf(n[i.value])!==-1),ae=()=>{let n=Y.value.querySelector("[data-pointed]");if(!n)return;let m=n.parentElement.parentElement;g.value&&(m=O.value?n.parentElement.parentElement.parentElement:n.parentElement.parentElement.parentElement.parentElement),n.offsetTop+n.offsetHeight>m.clientHeight+m.scrollTop&&(m.scrollTop=n.offsetTop+n.offsetHeight-m.clientHeight),n.offsetTop{v.value&&(n.length&&o.value?$():j())}),{pointer:h,canPointGroups:R,isPointed:T,setPointerFirst:$,selectPointer:_,forwardPointer:fe,backwardPointer:ue}}function nl(e,u,a){const{disabled:i}=x(e),o=M(!1);return{isOpen:o,open:()=>{o.value||i.value||(o.value=!0,u.emit("open"))},close:()=>{o.value&&(o.value=!1,u.emit("close"))}}}function rl(e,u,a){const{searchable:i,disabled:o}=x(e),v=a.input,f=a.open,g=a.close,t=a.clearSearch,c=M(null),p=M(!1),b=w(()=>i.value||o.value?-1:0),B=()=>{i.value&&v.value.blur(),c.value.blur()},V=()=>{i.value&&!o.value&&v.value.focus()},D=()=>{o.value||(p.value=!0,f())},h=()=>{p.value=!1,setTimeout(()=>{p.value||(g(),t())},1)};return{multiselect:c,tabindex:b,isActive:p,blur:B,handleFocus:V,activate:D,deactivate:h,handleCaretClick:()=>{p.value?(h(),B()):D()}}}function sl(e,u,a){const{mode:i,addTagOn:o,createTag:v,openDirection:f,searchable:g,showOptions:t,valueProp:c,groups:p}=x(e),b=a.iv,B=a.update,V=a.search,D=a.setPointer,h=a.selectPointer,r=a.backwardPointer,j=a.forwardPointer,Y=a.blur,k=a.fo,d=()=>{i.value==="tags"&&!t.value&&v.value&&g.value&&!p.value&&D(k.value[k.value.map(O=>O[c.value]).indexOf(V.value)])};return{handleKeydown:O=>{switch(O.keyCode){case 8:if(i.value==="single"||g.value&&[null,""].indexOf(V.value)===-1||b.value.length===0)return;B([...b.value].slice(0,-1));break;case 13:if(O.preventDefault(),i.value==="tags"&&o.value.indexOf("enter")===-1&&v.value)return;d(),h();break;case 32:if(g.value&&i.value!=="tags"&&!v.value||i.value==="tags"&&(o.value.indexOf("space")===-1&&v.value||!v.value))return;O.preventDefault(),d(),h();break;case 9:case 186:case 188:if(i.value!=="tags")return;const J={9:"tab",186:";",188:","};if(o.value.indexOf(J[O.keyCode])===-1||!v.value)return;d(),h(),O.preventDefault();break;case 27:Y();break;case 38:if(O.preventDefault(),!t.value)return;f.value==="top"?j():r();break;case 40:if(O.preventDefault(),!t.value)return;f.value==="top"?r():j();break}},preparePointer:d}}function ul(e,u,a){const i=x(e),{disabled:o,openDirection:v,showOptions:f,invalid:g}=i,t=a.isOpen,c=a.isPointed,p=a.isSelected,b=a.isDisabled,B=a.isActive,V=a.canPointGroups,D=a.resolving,h=a.fo,r={container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",containerInvalid:"is-invalid",containerInvalidActive:"is-invalid-active",singleLabel:"multiselect-single-label",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer",...i.classes.value},j=w(()=>!!(t.value&&f.value&&(!D.value||D.value&&h.value.length)));return{classList:w(()=>({container:[r.container].concat(o.value?r.containerDisabled:[]).concat(j.value&&v.value==="top"?r.containerOpenTop:[]).concat(j.value&&v.value!=="top"?r.containerOpen:[]).concat(B.value?r.containerActive:[]).concat(g.value?r.containerInvalid:[]),spacer:r.spacer,singleLabel:r.singleLabel,multipleLabel:r.multipleLabel,search:r.search,tags:r.tags,tag:[r.tag].concat(o.value?r.tagDisabled:[]),tagRemove:r.tagRemove,tagRemoveIcon:r.tagRemoveIcon,tagsSearchWrapper:r.tagsSearchWrapper,tagsSearch:r.tagsSearch,tagsSearchCopy:r.tagsSearchCopy,placeholder:r.placeholder,caret:[r.caret].concat(t.value?r.caretOpen:[]),clear:r.clear,clearIcon:r.clearIcon,spinner:r.spinner,dropdown:[r.dropdown].concat(v.value==="top"?r.dropdownTop:[]).concat(!t.value||!f.value||!j.value?r.dropdownHidden:[]),options:[r.options].concat(v.value==="top"?r.optionsTop:[]),group:r.group,groupLabel:k=>{let d=[r.groupLabel];return c(k)?d.push(p(k)?r.groupLabelSelectedPointed:r.groupLabelPointed):p(k)&&V.value?d.push(b(k)?r.groupLabelSelectedDisabled:r.groupLabelSelected):b(k)&&d.push(r.groupLabelDisabled),V.value&&d.push(r.groupLabelPointable),d},groupOptions:r.groupOptions,option:(k,d)=>{let R=[r.option];return c(k)?R.push(p(k)?r.optionSelectedPointed:r.optionPointed):p(k)?R.push(b(k)?r.optionSelectedDisabled:r.optionSelected):(b(k)||d&&b(d))&&R.push(r.optionDisabled),R},noOptions:r.noOptions,noResults:r.noResults,fakeInput:r.fakeInput})),showDropdown:j}}const ol={name:"BaseMultiselect",props:{preserveSearch:{type:Boolean,default:!1},initialSearch:{type:String,default:null},contentLoading:{type:Boolean,default:!1},value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!1},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},invalid:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({container:"p-0 relative mx-auto w-full flex items-center justify-end box-border cursor-pointer border border-gray-200 rounded-md bg-white text-sm leading-snug outline-none max-h-10",containerDisabled:"cursor-default bg-gray-200 bg-opacity-50 !text-gray-400",containerOpen:"",containerOpenTop:"",containerActive:"ring-1 ring-primary-400 border-primary-400",containerInvalid:"border-red-400 ring-red-400 focus:ring-red-400 focus:border-red-400",containerInvalidActive:"ring-1 border-red-400 ring-red-400",singleLabel:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5",multipleLabel:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5",search:"w-full absolute inset-0 outline-none appearance-none box-border border-0 text-sm font-sans bg-white rounded-md pl-3.5",tags:"grow shrink flex flex-wrap mt-1 pl-2",tag:"bg-primary-500 text-white text-sm font-semibold py-0.5 pl-2 rounded mr-1 mb-1 flex items-center whitespace-nowrap",tagDisabled:"pr-2 !bg-gray-400 text-white",tagRemove:"flex items-center justify-center p-1 mx-0.5 rounded-sm hover:bg-black hover:bg-opacity-10 group",tagRemoveIcon:"bg-multiselect-remove text-white bg-center bg-no-repeat opacity-30 inline-block w-3 h-3 group-hover:opacity-60",tagsSearchWrapper:"inline-block relative mx-1 mb-1 grow shrink h-full",tagsSearch:"absolute inset-0 border-0 focus:outline-none !shadow-none !focus:shadow-none appearance-none p-0 text-sm font-sans box-border w-full",tagsSearchCopy:"invisible whitespace-pre-wrap inline-block h-px",placeholder:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 text-gray-400 text-sm",caret:"bg-multiselect-caret bg-center bg-no-repeat w-5 h-5 py-px box-content z-5 relative mr-1 opacity-40 shrink-0 grow-0 transition-transform",caretOpen:"rotate-180 pointer-events-auto",clear:"pr-3.5 relative z-10 opacity-40 transition duration-300 shrink-0 grow-0 flex hover:opacity-80",clearIcon:"bg-multiselect-remove bg-center bg-no-repeat w-2.5 h-4 py-px box-content inline-block",spinner:"bg-multiselect-spinner bg-center bg-no-repeat w-4 h-4 z-10 mr-3.5 animate-spin shrink-0 grow-0",dropdown:"max-h-60 shadow-lg absolute -left-px -right-px -bottom-1 translate-y-full border border-gray-300 mt-1 overflow-y-auto z-50 bg-white flex flex-col rounded-md",dropdownTop:"-translate-y-full -top-2 bottom-auto flex-col-reverse rounded-md",dropdownHidden:"hidden",options:"flex flex-col p-0 m-0 list-none",optionsTop:"flex-col-reverse",group:"p-0 m-0",groupLabel:"flex text-sm box-border items-center justify-start text-left py-1 px-3 font-semibold bg-gray-200 cursor-default leading-normal",groupLabelPointable:"cursor-pointer",groupLabelPointed:"bg-gray-300 text-gray-700",groupLabelSelected:"bg-primary-600 text-white",groupLabelDisabled:"bg-gray-100 text-gray-300 cursor-not-allowed",groupLabelSelectedPointed:"bg-primary-600 text-white opacity-90",groupLabelSelectedDisabled:"text-primary-100 bg-primary-600 bg-opacity-50 cursor-not-allowed",groupOptions:"p-0 m-0",option:"flex items-center justify-start box-border text-left cursor-pointer text-sm leading-snug py-2 px-3",optionPointed:"text-gray-800 bg-gray-100",optionSelected:"text-white bg-primary-500",optionDisabled:"text-gray-300 cursor-not-allowed",optionSelectedPointed:"text-white bg-primary-500 opacity-90",optionSelectedDisabled:"text-primary-100 bg-primary-500 bg-opacity-50 cursor-not-allowed",noOptions:"py-2 px-3 text-gray-600 bg-white",noResults:"py-2 px-3 text-gray-600 bg-white",fakeInput:"bg-transparent absolute left-0 right-0 -bottom-px w-full h-px border-0 p-0 appearance-none outline-none text-transparent",spacer:"h-9 py-px box-content"})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"}},emits:["open","close","select","deselect","input","search-change","tag","update:modelValue","change","clear"],setup(e,u){const a=Ze(e,u),i=_e(e),o=nl(e,u),v=$e(e,u),f=Ye(e,u,{iv:a.iv}),g=rl(e,u,{input:v.input,open:o.open,close:o.close,clearSearch:v.clearSearch}),t=al(e,u,{ev:a.ev,iv:a.iv,search:v.search,clearSearch:v.clearSearch,update:f.update,pointer:i.pointer,clearPointer:i.clearPointer,blur:g.blur,deactivate:g.deactivate}),c=tl(e,u,{fo:t.fo,fg:t.fg,handleOptionClick:t.handleOptionClick,handleGroupClick:t.handleGroupClick,search:v.search,pointer:i.pointer,setPointer:i.setPointer,clearPointer:i.clearPointer,multiselect:g.multiselect}),p=sl(e,u,{iv:a.iv,update:f.update,search:v.search,setPointer:i.setPointer,selectPointer:c.selectPointer,backwardPointer:c.backwardPointer,forwardPointer:c.forwardPointer,blur:g.blur,fo:t.fo}),b=ul(e,u,{isOpen:o.isOpen,isPointed:c.isPointed,canPointGroups:c.canPointGroups,isSelected:t.isSelected,isDisabled:t.isDisabled,isActive:g.isActive,resolving:t.resolving,fo:t.fo});return{...a,...o,...g,...i,...f,...v,...t,...c,...p,...b}}},il=["id","tabindex"],cl=["type","modelValue","value","autocomplete"],dl=["onMousedown"],vl=["type","modelValue","value","autocomplete"],pl={class:"w-full overflow-y-auto"},fl=["data-pointed","onMouseenter","onClick"],gl=["data-pointed","onMouseenter","onClick"],bl=["data-pointed","onMouseenter","onClick"],hl=["innerHTML"],ml=["innerHTML"],yl=["value"],Sl=["name","value"],kl=["name","value"];function wl(e,u,a,i,o,v){const f=qe("BaseContentPlaceholdersBox"),g=qe("BaseContentPlaceholders");return a.contentLoading?(I(),Xe(g,{key:0},{default:Je(()=>[Qe(f,{rounded:!0,class:"w-full",style:{height:"40px"}})]),_:1})):(I(),q("div",{key:1,id:a.id,ref:"multiselect",tabindex:e.tabindex,class:L(e.classList.container),onFocusin:u[6]||(u[6]=(...t)=>e.activate&&e.activate(...t)),onFocusout:u[7]||(u[7]=(...t)=>e.deactivate&&e.deactivate(...t)),onKeydown:u[8]||(u[8]=(...t)=>e.handleKeydown&&e.handleKeydown(...t)),onFocus:u[9]||(u[9]=(...t)=>e.handleFocus&&e.handleFocus(...t))},[a.mode!=="tags"&&a.searchable&&!a.disabled?(I(),q("input",{key:0,ref:"input",type:a.inputType,modelValue:e.search,value:e.search,class:L(e.classList.search),autocomplete:a.autocomplete,onInput:u[0]||(u[0]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[1]||(u[1]=de((...t)=>e.handlePaste&&e.handlePaste(...t),["stop"]))},null,42,cl)):E("",!0),a.mode=="tags"?(I(),q("div",{key:1,class:L(e.classList.tags)},[(I(!0),q(le,null,ne(e.iv,(t,c,p)=>C(e.$slots,"tag",{option:t,handleTagRemove:e.handleTagRemove,disabled:a.disabled},()=>[(I(),q("span",{key:p,class:L(e.classList.tag)},[Ue(X(t[a.label])+" ",1),a.disabled?E("",!0):(I(),q("span",{key:0,class:L(e.classList.tagRemove),onMousedown:de(b=>e.handleTagRemove(t,b),["stop"])},[P("span",{class:L(e.classList.tagRemoveIcon)},null,2)],42,dl))],2))])),256)),P("div",{class:L(e.classList.tagsSearchWrapper)},[P("span",{class:L(e.classList.tagsSearchCopy)},X(e.search),3),a.searchable&&!a.disabled?(I(),q("input",{key:0,ref:"input",type:a.inputType,modelValue:e.search,value:e.search,class:L(e.classList.tagsSearch),autocomplete:a.autocomplete,style:{"box-shadow":"none !important"},onInput:u[2]||(u[2]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[3]||(u[3]=de((...t)=>e.handlePaste&&e.handlePaste(...t),["stop"]))},null,42,vl)):E("",!0)],2)],2)):E("",!0),a.mode=="single"&&e.hasSelected&&!e.search&&e.iv?C(e.$slots,"singlelabel",{key:2,value:e.iv},()=>[P("div",{class:L(e.classList.singleLabel)},X(e.iv[a.label]),3)]):E("",!0),a.mode=="multiple"&&e.hasSelected&&!e.search?C(e.$slots,"multiplelabel",{key:3,values:e.iv},()=>[P("div",{class:L(e.classList.multipleLabel)},X(e.multipleLabelText),3)]):E("",!0),a.placeholder&&!e.hasSelected&&!e.search?C(e.$slots,"placeholder",{key:4},()=>[P("div",{class:L(e.classList.placeholder)},X(a.placeholder),3)]):E("",!0),e.busy?C(e.$slots,"spinner",{key:5},()=>[P("span",{class:L(e.classList.spinner)},null,2)]):E("",!0),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?C(e.$slots,"clear",{key:6,clear:e.clear},()=>[P("span",{class:L(e.classList.clear),onMousedown:u[4]||(u[4]=(...t)=>e.clear&&e.clear(...t))},[P("span",{class:L(e.classList.clearIcon)},null,2)],34)]):E("",!0),a.caret?C(e.$slots,"caret",{key:7},()=>[P("span",{class:L(e.classList.caret),onMousedown:u[5]||(u[5]=de((...t)=>e.handleCaretClick&&e.handleCaretClick(...t),["prevent","stop"]))},null,34)]):E("",!0),P("div",{class:L(e.classList.dropdown),tabindex:"-1"},[P("div",pl,[C(e.$slots,"beforelist",{options:e.fo}),P("ul",{class:L(e.classList.options)},[a.groups?(I(!0),q(le,{key:0},ne(e.fg,(t,c,p)=>(I(),q("li",{key:p,class:L(e.classList.group)},[P("div",{class:L(e.classList.groupLabel(t)),"data-pointed":e.isPointed(t),onMouseenter:b=>e.setPointer(t),onClick:b=>e.handleGroupClick(t)},[C(e.$slots,"grouplabel",{group:t},()=>[P("span",null,X(t[a.groupLabel]),1)])],42,fl),P("ul",{class:L(e.classList.groupOptions)},[(I(!0),q(le,null,ne(t.__VISIBLE__,(b,B,V)=>(I(),q("li",{key:V,class:L(e.classList.option(b,t)),"data-pointed":e.isPointed(b),onMouseenter:D=>e.setPointer(b),onClick:D=>e.handleOptionClick(b)},[C(e.$slots,"option",{option:b,search:e.search},()=>[P("span",null,X(b[a.label]),1)])],42,gl))),128))],2)],2))),128)):(I(!0),q(le,{key:1},ne(e.fo,(t,c,p)=>(I(),q("li",{key:p,class:L(e.classList.option(t)),"data-pointed":e.isPointed(t),onMouseenter:b=>e.setPointer(t),onClick:b=>e.handleOptionClick(t)},[C(e.$slots,"option",{option:t,search:e.search},()=>[P("span",null,X(t[a.label]),1)])],42,bl))),128))],2),e.noOptions?C(e.$slots,"nooptions",{key:0},()=>[P("div",{class:L(e.classList.noOptions),innerHTML:a.noOptionsText},null,10,hl)]):E("",!0),e.noResults?C(e.$slots,"noresults",{key:1},()=>[P("div",{class:L(e.classList.noResults),innerHTML:a.noResultsText},null,10,ml)]):E("",!0),C(e.$slots,"afterlist",{options:e.fo})]),C(e.$slots,"action")],2),a.required?(I(),q("input",{key:8,class:L(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,yl)):E("",!0),a.nativeSupport?(I(),q(le,{key:9},[a.mode=="single"?(I(),q("input",{key:0,type:"hidden",name:a.name,value:e.plainValue!==void 0?e.plainValue:""},null,8,Sl)):(I(!0),q(le,{key:1},ne(e.plainValue,(t,c)=>(I(),q("input",{key:c,type:"hidden",name:`${a.name}[]`,value:t},null,8,kl))),128))],64)):E("",!0),P("div",{class:L(e.classList.spacer)},null,2)],42,il))}const Ol=We(ol,[["render",wl]]);export{Ol as default}; diff --git a/public/build/assets/BaseMultiselect.f7bf60e3.js b/public/build/assets/BaseMultiselect.f7bf60e3.js deleted file mode 100644 index 4136730e..00000000 --- a/public/build/assets/BaseMultiselect.f7bf60e3.js +++ /dev/null @@ -1 +0,0 @@ -var Xe=Object.defineProperty,Ye=Object.defineProperties;var Ze=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var $e=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var qe=(e,n,a)=>n in e?Xe(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,G=(e,n)=>{for(var a in n||(n={}))$e.call(n,a)&&qe(e,a,n[a]);if(Be)for(var a of Be(n))_e.call(n,a)&&qe(e,a,n[a]);return e},Ce=(e,n)=>Ye(e,Ze(n));import{bd as x,B as N,k as w,C as re,be as Te,r as De,o as I,l as el,w as ll,f as al,e as B,m as O,U as ve,j as E,F as ae,y as se,g as T,i as tl,t as J,h as P}from"./vendor.fd3b1727.js";import{_ as nl}from"./main.fc26c84f.js";function F(e){return[null,void 0,!1].indexOf(e)!==-1}function rl(e,n,a){const{object:i,valueProp:o,mode:v}=x(e),f=a.iv,g=p=>{f.value=c(p);const b=t(p);n.emit("change",b),n.emit("input",b),n.emit("update:modelValue",b)},t=p=>i.value||F(p)?p:Array.isArray(p)?p.map(b=>b[o.value]):p[o.value],c=p=>F(p)?v.value==="single"?{}:[]:p;return{update:g}}function sl(e,n){const{value:a,modelValue:i,mode:o,valueProp:v}=x(e),f=N(o.value!=="single"?[]:{}),g=n.expose!==void 0?i:a,t=w(()=>o.value==="single"?f.value[v.value]:f.value.map(p=>p[v.value])),c=w(()=>o.value!=="single"?f.value.map(p=>p[v.value]).join(","):f.value[v.value]);return{iv:f,internalValue:f,ev:g,externalValue:g,textValue:c,plainValue:t}}function ul(e,n,a){const{preserveSearch:i}=x(e),o=N(e.initialSearch)||N(null),v=N(null),f=()=>{i.value||(o.value="")},g=c=>{o.value=c.target.value},t=c=>{n.emit("paste",c)};return re(o,c=>{n.emit("search-change",c)}),{search:o,input:v,clearSearch:f,handleSearchInput:g,handlePaste:t}}function ol(e,n,a){const{groupSelect:i,mode:o,groups:v}=x(e),f=N(null),g=c=>{c===void 0||c!==null&&c.disabled||v.value&&c&&c.group&&(o.value==="single"||!i.value)||(f.value=c)};return{pointer:f,setPointer:g,clearPointer:()=>{g(null)}}}function Ee(e,n=!0){return n?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase().trim()}function il(e){return Object.prototype.toString.call(e)==="[object Object]"}function cl(e,n){const a=n.slice().sort();return e.length===n.length&&e.slice().sort().every(function(i,o){return i===a[o]})}function dl(e,n,a){const{options:i,mode:o,trackBy:v,limit:f,hideSelected:g,createTag:t,label:c,appendNewTag:p,multipleLabel:b,object:q,loading:V,delay:D,resolveOnLoad:m,minChars:s,filterResults:A,clearOnSearch:Z,clearOnSelect:k,valueProp:d,canDeselect:j,max:L,strict:Q,closeOnSelect:X,groups:$,groupLabel:ue,groupOptions:M,groupHideEmpty:pe,groupSelect:fe}=x(e),S=a.iv,z=a.ev,C=a.search,_=a.clearSearch,ee=a.update,ge=a.pointer,oe=a.clearPointer,W=a.blur,te=a.deactivate,r=N([]),h=N([]),R=N(!1),H=w(()=>{if($.value){let l=h.value||[],u=[];return l.forEach(y=>{ke(y[M.value]).forEach(U=>{u.push(Object.assign({},U,y.disabled?{disabled:!0}:{}))})}),u}else{let l=ke(h.value||[]);return r.value.length&&(l=l.concat(r.value)),l}}),Oe=w(()=>$.value?Ue((h.value||[]).map(l=>{const u=ke(l[M.value]);return Ce(G({},l),{group:!0,[M.value]:Se(u,!1).map(y=>Object.assign({},y,l.disabled?{disabled:!0}:{})),__VISIBLE__:Se(u).map(y=>Object.assign({},y,l.disabled?{disabled:!0}:{}))})})):[]),ie=w(()=>{let l=H.value;return me.value.length&&(l=me.value.concat(l)),l=Se(l),f.value>0&&(l=l.slice(0,f.value)),l}),be=w(()=>{switch(o.value){case"single":return!F(S.value[d.value]);case"multiple":case"tags":return!F(S.value)&&S.value.length>0}}),Ve=w(()=>b!==void 0&&b.value!==void 0?b.value(S.value):S.value&&S.value.length>1?`${S.value.length} options selected`:"1 option selected"),je=w(()=>!H.value.length&&!R.value&&!me.value.length),Re=w(()=>H.value.length>0&&ie.value.length==0&&(C.value&&$.value||!$.value)),me=w(()=>t.value===!1||!C.value?[]:ze(C.value)!==-1?[]:[{[d.value]:C.value,[c.value]:C.value,[v.value]:C.value}]),Ge=w(()=>{switch(o.value){case"single":return null;case"multiple":case"tags":return[]}}),Ae=w(()=>V.value||R.value),ne=l=>{switch(typeof l!="object"&&(l=K(l)),o.value){case"single":ee(l);break;case"multiple":case"tags":ee(S.value.concat(l));break}n.emit("select",Le(l),l)},le=l=>{switch(typeof l!="object"&&(l=K(l)),o.value){case"single":Ie();break;case"tags":case"multiple":ee(Array.isArray(l)?S.value.filter(u=>l.map(y=>y[d.value]).indexOf(u[d.value])===-1):S.value.filter(u=>u[d.value]!=l[d.value]));break}n.emit("deselect",Le(l),l)},Le=l=>q.value?l:l[d.value],Pe=l=>{le(l)},Me=(l,u)=>{if(u.button!==0){u.preventDefault();return}Pe(l)},Ie=()=>{n.emit("clear"),ee(Ge.value)},Y=l=>{if(l.group!==void 0)return o.value==="single"?!1:Fe(l[M.value])&&l[M.value].length;switch(o.value){case"single":return!F(S.value)&&S.value[d.value]==l[d.value];case"tags":case"multiple":return!F(S.value)&&S.value.map(u=>u[d.value]).indexOf(l[d.value])!==-1}},he=l=>l.disabled===!0,ye=()=>L===void 0||L.value===-1||!be.value&&L.value>0?!1:S.value.length>=L.value,Ne=l=>{if(!he(l)){switch(o.value){case"single":if(Y(l)){j.value&&le(l);return}W(),ne(l);break;case"multiple":if(Y(l)){le(l);return}if(ye())return;ne(l),k.value&&_(),g.value&&oe(),X.value&&W();break;case"tags":if(Y(l)){le(l);return}if(ye())return;K(l[d.value])===void 0&&t.value&&(n.emit("tag",l[d.value]),p.value&&We(l),_()),k.value&&_(),ne(l),g.value&&oe(),X.value&&W();break}X.value&&te()}},He=l=>{if(!(he(l)||o.value==="single"||!fe.value)){switch(o.value){case"multiple":case"tags":xe(l[M.value])?le(l[M.value]):ne(l[M.value].filter(u=>S.value.map(y=>y[d.value]).indexOf(u[d.value])===-1).filter(u=>!u.disabled).filter((u,y)=>S.value.length+1+y<=L.value||L.value===-1));break}X.value&&te()}},xe=l=>l.find(u=>!Y(u)&&!u.disabled)===void 0,Fe=l=>l.find(u=>!Y(u))===void 0,K=l=>H.value[H.value.map(u=>String(u[d.value])).indexOf(String(l))],ze=(l,u=!0)=>H.value.map(y=>y[v.value]).indexOf(l),Ke=l=>["tags","multiple"].indexOf(o.value)!==-1&&g.value&&Y(l),We=l=>{r.value.push(l)},Ue=l=>pe.value?l.filter(u=>C.value?u.__VISIBLE__.length:u[M.value].length):l.filter(u=>C.value?u.__VISIBLE__.length:!0),Se=(l,u=!0)=>{let y=l;return C.value&&A.value&&(y=y.filter(U=>Ee(U[v.value],Q.value).indexOf(Ee(C.value,Q.value))!==-1)),g.value&&u&&(y=y.filter(U=>!Ke(U))),y},ke=l=>{let u=l;return il(u)&&(u=Object.keys(u).map(y=>{let U=u[y];return{[d.value]:y,[v.value]:U,[c.value]:U}})),u=u.map(y=>typeof y=="object"?y:{[d.value]:y,[v.value]:y,[c.value]:y}),u},ce=()=>{F(z.value)||(S.value=de(z.value))},we=l=>{R.value=!0,i.value(C.value).then(u=>{h.value=u,typeof l=="function"&&l(u),R.value=!1})},Je=()=>{if(!!be.value)if(o.value==="single"){let l=K(S.value[d.value])[c.value];S.value[c.value]=l,q.value&&(z.value[c.value]=l)}else S.value.forEach((l,u)=>{let y=K(S.value[u][d.value])[c.value];S.value[u][c.value]=y,q.value&&(z.value[u][c.value]=y)})},Qe=l=>{we(l)},de=l=>F(l)?o.value==="single"?{}:[]:q.value?l:o.value==="single"?K(l)||{}:l.filter(u=>!!K(u)).map(u=>K(u));if(o.value!=="single"&&!F(z.value)&&!Array.isArray(z.value))throw new Error(`v-model must be an array when using "${o.value}" mode`);return i&&typeof i.value=="function"?m.value?we(ce):q.value==!0&&ce():(h.value=i.value,ce()),D.value>-1&&re(C,l=>{l.length{l==C.value&&i.value(C.value).then(u=>{l==C.value&&(h.value=u,ge.value=ie.value.filter(y=>y.disabled!==!0)[0]||null,R.value=!1)})},D.value))},{flush:"sync"}),re(z,l=>{if(F(l)){S.value=de(l);return}switch(o.value){case"single":(q.value?l[d.value]!=S.value[d.value]:l!=S.value[d.value])&&(S.value=de(l));break;case"multiple":case"tags":cl(q.value?l.map(u=>u[d.value]):l,S.value.map(u=>u[d.value]))||(S.value=de(l));break}},{deep:!0}),typeof e.options!="function"&&re(i,(l,u)=>{h.value=e.options,Object.keys(S.value).length||ce(),Je()}),{fo:ie,filteredOptions:ie,hasSelected:be,multipleLabelText:Ve,eo:H,extendedOptions:H,fg:Oe,filteredGroups:Oe,noOptions:je,noResults:Re,resolving:R,busy:Ae,select:ne,deselect:le,remove:Pe,clear:Ie,isSelected:Y,isDisabled:he,isMax:ye,getOption:K,handleOptionClick:Ne,handleGroupClick:He,handleTagRemove:Me,refreshOptions:Qe,resolveOptions:we}}function vl(e,n,a){const{valueProp:i,showOptions:o,searchable:v,groupLabel:f,groups:g,mode:t,groupSelect:c}=x(e),p=a.fo,b=a.fg,q=a.handleOptionClick,V=a.handleGroupClick,D=a.search,m=a.pointer,s=a.setPointer,A=a.clearPointer,Z=a.multiselect,k=w(()=>p.value.filter(r=>!r.disabled)),d=w(()=>b.value.filter(r=>!r.disabled)),j=w(()=>t.value!=="single"&&c.value),L=w(()=>m.value&&m.value.group),Q=w(()=>W(m.value)),X=w(()=>{const r=L.value?m.value:W(m.value),h=d.value.map(H=>H[f.value]).indexOf(r[f.value]);let R=d.value[h-1];return R===void 0&&(R=ue.value),R}),$=w(()=>{let r=d.value.map(h=>h.label).indexOf(L.value?m.value[f.value]:W(m.value)[f.value])+1;return d.value.length<=r&&(r=0),d.value[r]}),ue=w(()=>[...d.value].slice(-1)[0]),M=w(()=>m.value.__VISIBLE__.filter(r=>!r.disabled)[0]),pe=w(()=>{const r=Q.value.__VISIBLE__.filter(h=>!h.disabled);return r[r.map(h=>h[i.value]).indexOf(m.value[i.value])-1]}),fe=w(()=>{const r=W(m.value).__VISIBLE__.filter(h=>!h.disabled);return r[r.map(h=>h[i.value]).indexOf(m.value[i.value])+1]}),S=w(()=>[...X.value.__VISIBLE__.filter(r=>!r.disabled)].slice(-1)[0]),z=w(()=>[...ue.value.__VISIBLE__.filter(r=>!r.disabled)].slice(-1)[0]),C=r=>{if(!!m.value)return r.group?m.value[f.value]==r[f.value]:m.value[i.value]==r[i.value]},_=()=>{s(k.value[0]||null)},ee=()=>{!m.value||m.value.disabled===!0||(L.value?V(m.value):q(m.value))},ge=()=>{if(m.value===null)s((g.value&&j.value?d.value[0]:k.value[0])||null);else if(g.value&&j.value){let r=L.value?M.value:fe.value;r===void 0&&(r=$.value),s(r||null)}else{let r=k.value.map(h=>h[i.value]).indexOf(m.value[i.value])+1;k.value.length<=r&&(r=0),s(k.value[r]||null)}Te(()=>{te()})},oe=()=>{if(m.value===null){let r=k.value[k.value.length-1];g.value&&j.value&&(r=z.value,r===void 0&&(r=ue.value)),s(r||null)}else if(g.value&&j.value){let r=L.value?S.value:pe.value;r===void 0&&(r=L.value?X.value:Q.value),s(r||null)}else{let r=k.value.map(h=>h[i.value]).indexOf(m.value[i.value])-1;r<0&&(r=k.value.length-1),s(k.value[r]||null)}Te(()=>{te()})},W=r=>d.value.find(h=>h.__VISIBLE__.map(R=>R[i.value]).indexOf(r[i.value])!==-1),te=()=>{let r=Z.value.querySelector("[data-pointed]");if(!r)return;let h=r.parentElement.parentElement;g.value&&(h=L.value?r.parentElement.parentElement.parentElement:r.parentElement.parentElement.parentElement.parentElement),r.offsetTop+r.offsetHeight>h.clientHeight+h.scrollTop&&(h.scrollTop=r.offsetTop+r.offsetHeight-h.clientHeight),r.offsetTop{v.value&&(r.length&&o.value?_():A())}),{pointer:m,canPointGroups:j,isPointed:C,setPointerFirst:_,selectPointer:ee,forwardPointer:ge,backwardPointer:oe}}function pl(e,n,a){const{disabled:i}=x(e),o=N(!1);return{isOpen:o,open:()=>{o.value||i.value||(o.value=!0,n.emit("open"))},close:()=>{!o.value||(o.value=!1,n.emit("close"))}}}function fl(e,n,a){const{searchable:i,disabled:o}=x(e),v=a.input,f=a.open,g=a.close,t=a.clearSearch,c=N(null),p=N(!1),b=w(()=>i.value||o.value?-1:0),q=()=>{i.value&&v.value.blur(),c.value.blur()},V=()=>{i.value&&!o.value&&v.value.focus()},D=()=>{o.value||(p.value=!0,f())},m=()=>{p.value=!1,setTimeout(()=>{p.value||(g(),t())},1)};return{multiselect:c,tabindex:b,isActive:p,blur:q,handleFocus:V,activate:D,deactivate:m,handleCaretClick:()=>{p.value?(m(),q()):D()}}}function gl(e,n,a){const{mode:i,addTagOn:o,createTag:v,openDirection:f,searchable:g,showOptions:t,valueProp:c,groups:p}=x(e),b=a.iv,q=a.update,V=a.search,D=a.setPointer,m=a.selectPointer,s=a.backwardPointer,A=a.forwardPointer,Z=a.blur,k=a.fo,d=()=>{i.value==="tags"&&!t.value&&v.value&&g.value&&!p.value&&D(k.value[k.value.map(L=>L[c.value]).indexOf(V.value)])};return{handleKeydown:L=>{switch(L.keyCode){case 8:if(i.value==="single"||g.value&&[null,""].indexOf(V.value)===-1||b.value.length===0)return;q([...b.value].slice(0,-1));break;case 13:if(L.preventDefault(),i.value==="tags"&&o.value.indexOf("enter")===-1&&v.value)return;d(),m();break;case 32:if(g.value&&i.value!=="tags"&&!v.value||i.value==="tags"&&(o.value.indexOf("space")===-1&&v.value||!v.value))return;L.preventDefault(),d(),m();break;case 9:case 186:case 188:if(i.value!=="tags")return;const Q={9:"tab",186:";",188:","};if(o.value.indexOf(Q[L.keyCode])===-1||!v.value)return;d(),m(),L.preventDefault();break;case 27:Z();break;case 38:if(L.preventDefault(),!t.value)return;f.value==="top"?A():s();break;case 40:if(L.preventDefault(),!t.value)return;f.value==="top"?s():A();break}},preparePointer:d}}function bl(e,n,a){const i=x(e),{disabled:o,openDirection:v,showOptions:f,invalid:g}=i,t=a.isOpen,c=a.isPointed,p=a.isSelected,b=a.isDisabled,q=a.isActive,V=a.canPointGroups,D=a.resolving,m=a.fo,s=G({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",containerInvalid:"is-invalid",containerInvalidActive:"is-invalid-active",singleLabel:"multiselect-single-label",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},i.classes.value),A=w(()=>!!(t.value&&f.value&&(!D.value||D.value&&m.value.length)));return{classList:w(()=>({container:[s.container].concat(o.value?s.containerDisabled:[]).concat(A.value&&v.value==="top"?s.containerOpenTop:[]).concat(A.value&&v.value!=="top"?s.containerOpen:[]).concat(q.value?s.containerActive:[]).concat(g.value?s.containerInvalid:[]),spacer:s.spacer,singleLabel:s.singleLabel,multipleLabel:s.multipleLabel,search:s.search,tags:s.tags,tag:[s.tag].concat(o.value?s.tagDisabled:[]),tagRemove:s.tagRemove,tagRemoveIcon:s.tagRemoveIcon,tagsSearchWrapper:s.tagsSearchWrapper,tagsSearch:s.tagsSearch,tagsSearchCopy:s.tagsSearchCopy,placeholder:s.placeholder,caret:[s.caret].concat(t.value?s.caretOpen:[]),clear:s.clear,clearIcon:s.clearIcon,spinner:s.spinner,dropdown:[s.dropdown].concat(v.value==="top"?s.dropdownTop:[]).concat(!t.value||!f.value||!A.value?s.dropdownHidden:[]),options:[s.options].concat(v.value==="top"?s.optionsTop:[]),group:s.group,groupLabel:k=>{let d=[s.groupLabel];return c(k)?d.push(p(k)?s.groupLabelSelectedPointed:s.groupLabelPointed):p(k)&&V.value?d.push(b(k)?s.groupLabelSelectedDisabled:s.groupLabelSelected):b(k)&&d.push(s.groupLabelDisabled),V.value&&d.push(s.groupLabelPointable),d},groupOptions:s.groupOptions,option:(k,d)=>{let j=[s.option];return c(k)?j.push(p(k)?s.optionSelectedPointed:s.optionPointed):p(k)?j.push(b(k)?s.optionSelectedDisabled:s.optionSelected):(b(k)||d&&b(d))&&j.push(s.optionDisabled),j},noOptions:s.noOptions,noResults:s.noResults,fakeInput:s.fakeInput})),showDropdown:A}}const ml={name:"BaseMultiselect",props:{preserveSearch:{type:Boolean,default:!1},initialSearch:{type:String,default:null},contentLoading:{type:Boolean,default:!1},value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!1},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},invalid:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({container:"p-0 relative mx-auto w-full flex items-center justify-end box-border cursor-pointer border border-gray-200 rounded-md bg-white text-sm leading-snug outline-none max-h-10",containerDisabled:"cursor-default bg-gray-200 bg-opacity-50 !text-gray-400",containerOpen:"",containerOpenTop:"",containerActive:"ring-1 ring-primary-400 border-primary-400",containerInvalid:"border-red-400 ring-red-400 focus:ring-red-400 focus:border-red-400",containerInvalidActive:"ring-1 border-red-400 ring-red-400",singleLabel:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5",multipleLabel:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5",search:"w-full absolute inset-0 outline-none appearance-none box-border border-0 text-sm font-sans bg-white rounded-md pl-3.5",tags:"grow shrink flex flex-wrap mt-1 pl-2",tag:"bg-primary-500 text-white text-sm font-semibold py-0.5 pl-2 rounded mr-1 mb-1 flex items-center whitespace-nowrap",tagDisabled:"pr-2 !bg-gray-400 text-white",tagRemove:"flex items-center justify-center p-1 mx-0.5 rounded-sm hover:bg-black hover:bg-opacity-10 group",tagRemoveIcon:"bg-multiselect-remove text-white bg-center bg-no-repeat opacity-30 inline-block w-3 h-3 group-hover:opacity-60",tagsSearchWrapper:"inline-block relative mx-1 mb-1 grow shrink h-full",tagsSearch:"absolute inset-0 border-0 focus:outline-none !shadow-none !focus:shadow-none appearance-none p-0 text-sm font-sans box-border w-full",tagsSearchCopy:"invisible whitespace-pre-wrap inline-block h-px",placeholder:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 text-gray-400 text-sm",caret:"bg-multiselect-caret bg-center bg-no-repeat w-5 h-5 py-px box-content z-5 relative mr-1 opacity-40 shrink-0 grow-0 transition-transform",caretOpen:"rotate-180 pointer-events-auto",clear:"pr-3.5 relative z-10 opacity-40 transition duration-300 shrink-0 grow-0 flex hover:opacity-80",clearIcon:"bg-multiselect-remove bg-center bg-no-repeat w-2.5 h-4 py-px box-content inline-block",spinner:"bg-multiselect-spinner bg-center bg-no-repeat w-4 h-4 z-10 mr-3.5 animate-spin shrink-0 grow-0",dropdown:"max-h-60 shadow-lg absolute -left-px -right-px -bottom-1 translate-y-full border border-gray-300 mt-1 overflow-y-auto z-50 bg-white flex flex-col rounded-md",dropdownTop:"-translate-y-full -top-2 bottom-auto flex-col-reverse rounded-md",dropdownHidden:"hidden",options:"flex flex-col p-0 m-0 list-none",optionsTop:"flex-col-reverse",group:"p-0 m-0",groupLabel:"flex text-sm box-border items-center justify-start text-left py-1 px-3 font-semibold bg-gray-200 cursor-default leading-normal",groupLabelPointable:"cursor-pointer",groupLabelPointed:"bg-gray-300 text-gray-700",groupLabelSelected:"bg-primary-600 text-white",groupLabelDisabled:"bg-gray-100 text-gray-300 cursor-not-allowed",groupLabelSelectedPointed:"bg-primary-600 text-white opacity-90",groupLabelSelectedDisabled:"text-primary-100 bg-primary-600 bg-opacity-50 cursor-not-allowed",groupOptions:"p-0 m-0",option:"flex items-center justify-start box-border text-left cursor-pointer text-sm leading-snug py-2 px-3",optionPointed:"text-gray-800 bg-gray-100",optionSelected:"text-white bg-primary-500",optionDisabled:"text-gray-300 cursor-not-allowed",optionSelectedPointed:"text-white bg-primary-500 opacity-90",optionSelectedDisabled:"text-primary-100 bg-primary-500 bg-opacity-50 cursor-not-allowed",noOptions:"py-2 px-3 text-gray-600 bg-white",noResults:"py-2 px-3 text-gray-600 bg-white",fakeInput:"bg-transparent absolute left-0 right-0 -bottom-px w-full h-px border-0 p-0 appearance-none outline-none text-transparent",spacer:"h-9 py-px box-content"})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"}},emits:["open","close","select","deselect","input","search-change","tag","update:modelValue","change","clear"],setup(e,n){const a=sl(e,n),i=ol(e),o=pl(e,n),v=ul(e,n),f=rl(e,n,{iv:a.iv}),g=fl(e,n,{input:v.input,open:o.open,close:o.close,clearSearch:v.clearSearch}),t=dl(e,n,{ev:a.ev,iv:a.iv,search:v.search,clearSearch:v.clearSearch,update:f.update,pointer:i.pointer,clearPointer:i.clearPointer,blur:g.blur,deactivate:g.deactivate}),c=vl(e,n,{fo:t.fo,fg:t.fg,handleOptionClick:t.handleOptionClick,handleGroupClick:t.handleGroupClick,search:v.search,pointer:i.pointer,setPointer:i.setPointer,clearPointer:i.clearPointer,multiselect:g.multiselect}),p=gl(e,n,{iv:a.iv,update:f.update,search:v.search,setPointer:i.setPointer,selectPointer:c.selectPointer,backwardPointer:c.backwardPointer,forwardPointer:c.forwardPointer,blur:g.blur,fo:t.fo}),b=bl(e,n,{isOpen:o.isOpen,isPointed:c.isPointed,canPointGroups:c.canPointGroups,isSelected:t.isSelected,isDisabled:t.isDisabled,isActive:g.isActive,resolving:t.resolving,fo:t.fo});return G(G(G(G(G(G(G(G(G(G({},a),o),g),i),f),v),t),c),p),b)}},hl=["id","tabindex"],yl=["type","modelValue","value","autocomplete"],Sl=["onMousedown"],kl=["type","modelValue","value","autocomplete"],wl={class:"w-full overflow-y-auto"},Ol=["data-pointed","onMouseenter","onClick"],Ll=["data-pointed","onMouseenter","onClick"],Pl=["data-pointed","onMouseenter","onClick"],Il=["innerHTML"],Bl=["innerHTML"],ql=["value"],Cl=["name","value"],Tl=["name","value"];function Dl(e,n,a,i,o,v){const f=De("BaseContentPlaceholdersBox"),g=De("BaseContentPlaceholders");return a.contentLoading?(I(),el(g,{key:0},{default:ll(()=>[al(f,{rounded:!0,class:"w-full",style:{height:"40px"}})]),_:1})):(I(),B("div",{key:1,id:a.id,ref:"multiselect",tabindex:e.tabindex,class:O(e.classList.container),onFocusin:n[6]||(n[6]=(...t)=>e.activate&&e.activate(...t)),onFocusout:n[7]||(n[7]=(...t)=>e.deactivate&&e.deactivate(...t)),onKeydown:n[8]||(n[8]=(...t)=>e.handleKeydown&&e.handleKeydown(...t)),onFocus:n[9]||(n[9]=(...t)=>e.handleFocus&&e.handleFocus(...t))},[a.mode!=="tags"&&a.searchable&&!a.disabled?(I(),B("input",{key:0,ref:"input",type:a.inputType,modelValue:e.search,value:e.search,class:O(e.classList.search),autocomplete:a.autocomplete,onInput:n[0]||(n[0]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:n[1]||(n[1]=ve((...t)=>e.handlePaste&&e.handlePaste(...t),["stop"]))},null,42,yl)):E("",!0),a.mode=="tags"?(I(),B("div",{key:1,class:O(e.classList.tags)},[(I(!0),B(ae,null,se(e.iv,(t,c,p)=>T(e.$slots,"tag",{option:t,handleTagRemove:e.handleTagRemove,disabled:a.disabled},()=>[(I(),B("span",{key:p,class:O(e.classList.tag)},[tl(J(t[a.label])+" ",1),a.disabled?E("",!0):(I(),B("span",{key:0,class:O(e.classList.tagRemove),onMousedown:ve(b=>e.handleTagRemove(t,b),["stop"])},[P("span",{class:O(e.classList.tagRemoveIcon)},null,2)],42,Sl))],2))])),256)),P("div",{class:O(e.classList.tagsSearchWrapper)},[P("span",{class:O(e.classList.tagsSearchCopy)},J(e.search),3),a.searchable&&!a.disabled?(I(),B("input",{key:0,ref:"input",type:a.inputType,modelValue:e.search,value:e.search,class:O(e.classList.tagsSearch),autocomplete:a.autocomplete,style:{"box-shadow":"none !important"},onInput:n[2]||(n[2]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:n[3]||(n[3]=ve((...t)=>e.handlePaste&&e.handlePaste(...t),["stop"]))},null,42,kl)):E("",!0)],2)],2)):E("",!0),a.mode=="single"&&e.hasSelected&&!e.search&&e.iv?T(e.$slots,"singlelabel",{key:2,value:e.iv},()=>[P("div",{class:O(e.classList.singleLabel)},J(e.iv[a.label]),3)]):E("",!0),a.mode=="multiple"&&e.hasSelected&&!e.search?T(e.$slots,"multiplelabel",{key:3,values:e.iv},()=>[P("div",{class:O(e.classList.multipleLabel)},J(e.multipleLabelText),3)]):E("",!0),a.placeholder&&!e.hasSelected&&!e.search?T(e.$slots,"placeholder",{key:4},()=>[P("div",{class:O(e.classList.placeholder)},J(a.placeholder),3)]):E("",!0),e.busy?T(e.$slots,"spinner",{key:5},()=>[P("span",{class:O(e.classList.spinner)},null,2)]):E("",!0),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?T(e.$slots,"clear",{key:6,clear:e.clear},()=>[P("span",{class:O(e.classList.clear),onMousedown:n[4]||(n[4]=(...t)=>e.clear&&e.clear(...t))},[P("span",{class:O(e.classList.clearIcon)},null,2)],34)]):E("",!0),a.caret?T(e.$slots,"caret",{key:7},()=>[P("span",{class:O(e.classList.caret),onMousedown:n[5]||(n[5]=ve((...t)=>e.handleCaretClick&&e.handleCaretClick(...t),["prevent","stop"]))},null,34)]):E("",!0),P("div",{class:O(e.classList.dropdown),tabindex:"-1"},[P("div",wl,[T(e.$slots,"beforelist",{options:e.fo}),P("ul",{class:O(e.classList.options)},[a.groups?(I(!0),B(ae,{key:0},se(e.fg,(t,c,p)=>(I(),B("li",{key:p,class:O(e.classList.group)},[P("div",{class:O(e.classList.groupLabel(t)),"data-pointed":e.isPointed(t),onMouseenter:b=>e.setPointer(t),onClick:b=>e.handleGroupClick(t)},[T(e.$slots,"grouplabel",{group:t},()=>[P("span",null,J(t[a.groupLabel]),1)])],42,Ol),P("ul",{class:O(e.classList.groupOptions)},[(I(!0),B(ae,null,se(t.__VISIBLE__,(b,q,V)=>(I(),B("li",{key:V,class:O(e.classList.option(b,t)),"data-pointed":e.isPointed(b),onMouseenter:D=>e.setPointer(b),onClick:D=>e.handleOptionClick(b)},[T(e.$slots,"option",{option:b,search:e.search},()=>[P("span",null,J(b[a.label]),1)])],42,Ll))),128))],2)],2))),128)):(I(!0),B(ae,{key:1},se(e.fo,(t,c,p)=>(I(),B("li",{key:p,class:O(e.classList.option(t)),"data-pointed":e.isPointed(t),onMouseenter:b=>e.setPointer(t),onClick:b=>e.handleOptionClick(t)},[T(e.$slots,"option",{option:t,search:e.search},()=>[P("span",null,J(t[a.label]),1)])],42,Pl))),128))],2),e.noOptions?T(e.$slots,"nooptions",{key:0},()=>[P("div",{class:O(e.classList.noOptions),innerHTML:a.noOptionsText},null,10,Il)]):E("",!0),e.noResults?T(e.$slots,"noresults",{key:1},()=>[P("div",{class:O(e.classList.noResults),innerHTML:a.noResultsText},null,10,Bl)]):E("",!0),T(e.$slots,"afterlist",{options:e.fo})]),T(e.$slots,"action")],2),a.required?(I(),B("input",{key:8,class:O(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,ql)):E("",!0),a.nativeSupport?(I(),B(ae,{key:9},[a.mode=="single"?(I(),B("input",{key:0,type:"hidden",name:a.name,value:e.plainValue!==void 0?e.plainValue:""},null,8,Cl)):(I(!0),B(ae,{key:1},se(e.plainValue,(t,c)=>(I(),B("input",{key:c,type:"hidden",name:`${a.name}[]`,value:t},null,8,Tl))),128))],64)):E("",!0),P("div",{class:O(e.classList.spacer)},null,2)],42,hl))}var Rl=nl(ml,[["render",Dl]]);export{Rl as default}; diff --git a/public/build/assets/BaseTable-HYHVnjlk.js b/public/build/assets/BaseTable-HYHVnjlk.js new file mode 100644 index 00000000..e3526269 --- /dev/null +++ b/public/build/assets/BaseTable-HYHVnjlk.js @@ -0,0 +1 @@ +import{a9 as O,X,r as N,o as i,c as s,b as c,H as u,t as h,I as m,a as P,L as k,M as C,q as _,F as T,g as F,l as L,z as J,W as K,a0 as A,m as y,w as Q,S as U,n as Z,N as $}from"./main-vzIkKseS.js";function V(a,t){if(!t||a===null||typeof a!="object")return a;const[e,n]=t.split(/\.(.+)/);return V(a[e],n)}function ee(a,t){return t.reduce((e,n)=>(e[n]=a[n],e),{})}class te{constructor(t,e){this.data=t,this.columns=e}getValue(t){return V(this.data,t)}getColumn(t){return this.columns.find(e=>e.key===t)}getSortableValue(t){const e=this.getColumn(t).dataType;let n=this.getValue(t);if(n==null)return"";if(n instanceof String&&(n=n.toLowerCase()),e.startsWith("date")){const b=e.replace("date:","");return O(n,b).format("YYYYMMDDHHmmss")}return e==="numeric"?n:n.toString()}}class ae{constructor(t){const e=ee(t,["key","label","thClass","tdClass","sortBy","sortable","hidden","dataType"]);for(const n in e)this[n]=t[n];e.dataType||(this.dataType="string"),e.sortable===void 0&&(this.sortable=!0)}getFilterFieldName(){return this.filterOn||this.key}isSortable(){return this.sortable}getSortPredicate(t,e){const n=this.getSortFieldName(),l=e.find(g=>g.key===n).dataType;return l.startsWith("date")||l==="numeric"?(g,d)=>{const p=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x{const p=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x.localeCompare(p):p.localeCompare(x)}}getSortFieldName(){return this.sortBy||this.key}}const ne={props:{pagination:{type:Object,default:()=>({})}},computed:{pages(){return this.pagination.totalPages===void 0?[]:this.pageLinks()},hasFirst(){return this.pagination.currentPage>=4||this.pagination.totalPages<10},hasLast(){return this.pagination.currentPage<=this.pagination.totalPages-3||this.pagination.totalPages<10},hasFirstEllipsis(){return this.pagination.currentPage>=4&&this.pagination.totalPages>=10},hasLastEllipsis(){return this.pagination.currentPage<=this.pagination.totalPages-3&&this.pagination.totalPages>=10},shouldShowPagination(){return this.pagination.totalPages===void 0||this.pagination.count===0?!1:this.pagination.totalPages>1}},methods:{isActive(a){return(this.pagination.currentPage||1)===a},pageClicked(a){a==="..."||a===this.pagination.currentPage||a>this.pagination.totalPages||a<1||this.$emit("pageChange",a)},pageLinks(){const a=[];let t=2,e=this.pagination.totalPages-1;this.pagination.totalPages>=10&&(t=Math.max(1,this.pagination.currentPage-2),e=Math.min(this.pagination.currentPage+2,this.pagination.totalPages));for(let n=t;n<=e;n++)a.push(n);return a}}},re={key:0,class:"flex items-center justify-between px-4 py-3 bg-white border-t border-gray-200 sm:px-6"},ie={class:"flex justify-between flex-1 sm:hidden"},se={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},le={class:"text-sm text-gray-700"},oe=_(" Showing "+h(" ")+" "),de={key:0,class:"font-medium"},ge=_(" "+h(" ")+" to "+h(" ")+" "),ce={key:1,class:"font-medium"},ue={key:0},he={key:1},ye=_(" "+h(" ")+" of "+h(" ")+" "),fe={key:2,class:"font-medium"},me=_(" "+h(" ")+" results "),pe={class:"relative z-0 inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination"},be=c("span",{class:"sr-only"},"Previous",-1),xe={key:1,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},ve=["onClick"],ke={key:2,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},Ce=c("span",{class:"sr-only"},"Next",-1);function Pe(a,t,e,n,b,l){const g=N("BaseIcon");return l.shouldShowPagination?(i(),s("div",re,[c("div",ie,[c("a",{href:"#",class:u([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[0]||(t[0]=d=>l.pageClicked(e.pagination.currentPage-1))}," Previous ",2),c("a",{href:"#",class:u([{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages},"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[1]||(t[1]=d=>l.pageClicked(e.pagination.currentPage+1))}," Next ",2)]),c("div",se,[c("div",null,[c("p",le,[oe,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",de,h(e.pagination.currentPage*e.pagination.limit-(e.pagination.limit-1)),1)):m("",!0),ge,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",ce,[e.pagination.currentPage*e.pagination.limit<=e.pagination.totalCount?(i(),s("span",ue,h(e.pagination.currentPage*e.pagination.limit),1)):(i(),s("span",he,h(e.pagination.totalCount),1))])):m("",!0),ye,e.pagination.totalCount?(i(),s("span",fe,h(e.pagination.totalCount),1)):m("",!0),me])]),c("div",null,[c("nav",pe,[c("a",{href:"#",class:u([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md hover:bg-gray-50"]),onClick:t[2]||(t[2]=d=>l.pageClicked(e.pagination.currentPage-1))},[be,P(g,{name:"ChevronLeftIcon"})],2),l.hasFirst?(i(),s("a",{key:0,href:"#","aria-current":"page",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(1),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(1)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[3]||(t[3]=d=>l.pageClicked(1))}," 1 ",2)):m("",!0),l.hasFirstEllipsis?(i(),s("span",xe," ... ")):m("",!0),(i(!0),s(k,null,C(l.pages,d=>(i(),s("a",{key:d,href:"#",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(d),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(d),disabled:d==="..."},"relative items-center hidden px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 hover:bg-gray-50 md:inline-flex"]),onClick:p=>l.pageClicked(d)},h(d),11,ve))),128)),l.hasLastEllipsis?(i(),s("span",ke," ... ")):m("",!0),l.hasLast?(i(),s("a",{key:3,href:"#","aria-current":"page",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(e.pagination.totalPages),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(e.pagination.totalPages)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[4]||(t[4]=d=>l.pageClicked(e.pagination.totalPages))},h(e.pagination.totalPages),3)):m("",!0),c("a",{href:"#",class:u(["relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md hover:bg-gray-50",{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages}]),onClick:t[5]||(t[5]=d=>l.pageClicked(e.pagination.currentPage+1))},[Ce,P(g,{name:"ChevronRightIcon"})],2)])])])])):m("",!0)}const _e=X(ne,[["render",Pe]]),we={class:"flex flex-col"},Se={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8 pb-4 lg:pb-0"},Ne={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"},Te={class:"relative overflow-hidden bg-white border-b border-gray-200 shadow sm:rounded-lg"},Be=["onClick"],Fe={key:0,class:"asc-direction"},Le={key:1,class:"desc-direction"},Ae={key:0},Ve={key:1},Ie={key:0,class:"absolute top-0 left-0 z-10 flex items-center justify-center w-full h-full bg-white bg-opacity-60"},Me={key:1,class:"text-center text-gray-500 pb-2 flex h-[160px] justify-center items-center flex-col"},ze={class:"block mt-1"},Ee={props:{columns:{type:Array,required:!0},data:{type:[Array,Function],required:!0},sortBy:{type:String,default:""},sortOrder:{type:String,default:""},tableClass:{type:String,default:"min-w-full divide-y divide-gray-200"},theadClass:{type:String,default:"bg-gray-50"},tbodyClass:{type:String,default:""},noResultsMessage:{type:String,default:"No Results Found"},loading:{type:Boolean,default:!1},loadingType:{type:String,default:"placeholder",validator:function(a){return["placeholder","spinner"].indexOf(a)!==-1}},placeholderCount:{type:Number,default:3}},setup(a,{expose:t}){const e=a;let n=T([]),b=F(!1),l=T(e.columns.map(r=>new ae(r))),g=T({fieldName:"",order:""}),d=F("");const p=L(()=>Array.isArray(e.data)),x=L(()=>{if(!p.value||g.fieldName===""||l.length===0)return n.value;const r=I(g.fieldName);return r?[...n.value].sort(r.getSortPredicate(g.order,l)):n.value});function I(r){return l.find(o=>o.key===r)}function M(r){let o="whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider";return r.defaultThClass&&(o=r.defaultThClass),r.sortable?o=`${o} cursor-pointer`:o=`${o} pointer-events-none`,r.thClass&&(o=`${o} ${r.thClass}`),o}function B(r){let o="px-6 py-4 text-sm text-gray-500 whitespace-nowrap";return r.defaultTdClass&&(o=r.defaultTdClass),r.tdClass&&(o=`${o} ${r.tdClass}`),o}function z(r){let o="w-full";return r.placeholderClass&&(o=`${o} ${r.placeholderClass}`),o}function D(){return d.value=null,e.data}async function E(){const r=d.value&&d.value.currentPage||1;b.value=!0;const o=await e.data({sort:g,page:r});return b.value=!1,d.value=o.pagination,o.data}function R(r){g.fieldName!==r.key?(g.fieldName=r.key,g.order="asc"):g.order=g.order==="asc"?"desc":"asc",p.value||w()}async function w(){const r=p.value?D():await E();n.value=r.map(o=>new te(o,l))}async function H(r){d.value.currentPage=r,await w()}async function Y(){await w()}function q(r,o){return $.get(r,o)}return p.value&&J(()=>e.data,()=>{w()}),K(async()=>{await w()}),t({refresh:Y}),(r,o)=>{const W=N("base-content-placeholders-text"),j=N("base-content-placeholders"),G=N("BaseIcon");return i(),s("div",we,[c("div",Se,[c("div",Ne,[c("div",Te,[A(r.$slots,"header"),c("table",{class:u(a.tableClass)},[c("thead",{class:u(a.theadClass)},[c("tr",null,[(i(!0),s(k,null,C(y(l),f=>(i(),s("th",{key:f.key,class:u([M(f),{"text-bold text-black":y(g).fieldName===f.key}]),onClick:v=>R(f)},[_(h(f.label)+" ",1),y(g).fieldName===f.key&&y(g).order==="asc"?(i(),s("span",Fe," ↑ ")):m("",!0),y(g).fieldName===f.key&&y(g).order==="desc"?(i(),s("span",Le," ↓ ")):m("",!0)],10,Be))),128))])],2),a.loadingType==="placeholder"&&(a.loading||y(b))?(i(),s("tbody",Ae,[(i(!0),s(k,null,C(a.placeholderCount,f=>(i(),s("tr",{key:f,class:u(f%2===0?"bg-white":"bg-gray-50")},[(i(!0),s(k,null,C(a.columns,v=>(i(),s("td",{key:v.key,class:u(["",B(v)])},[P(j,{class:u(z(v)),rounded:!0},{default:Q(()=>[P(W,{class:"w-full h-6",lines:1})]),_:2},1032,["class"])],2))),128))],2))),128))])):(i(),s("tbody",Ve,[(i(!0),s(k,null,C(y(x),(f,v)=>(i(),s("tr",{key:v,class:u(v%2===0?"bg-white":"bg-gray-50")},[(i(!0),s(k,null,C(a.columns,S=>(i(),s("td",{key:S.key,class:u(["",B(S)])},[A(r.$slots,"cell-"+S.key,{row:f},()=>[_(h(q(f.data,S.key)),1)])],2))),128))],2))),128))]))],2),a.loadingType==="spinner"&&(a.loading||y(b))?(i(),s("div",Ie,[P(U,{class:"w-10 h-10 text-primary-500"})])):!a.loading&&!y(b)&&y(x)&&y(x).length===0?(i(),s("div",Me,[P(G,{name:"ExclamationCircleIcon",class:"w-6 h-6 text-gray-400"}),c("span",ze,h(a.noResultsMessage),1)])):m("",!0),y(d)?(i(),Z(_e,{key:2,pagination:y(d),onPageChange:H},null,8,["pagination"])):m("",!0)])])])])}}};export{Ee as default}; diff --git a/public/build/assets/BaseTable.c2b2d20a.js b/public/build/assets/BaseTable.c2b2d20a.js deleted file mode 100644 index adc44346..00000000 --- a/public/build/assets/BaseTable.c2b2d20a.js +++ /dev/null @@ -1 +0,0 @@ -import{I as O,r as T,o as i,e as s,h as u,m as c,t as h,j as m,f as k,F as C,y as P,i as _,a0 as N,B as F,k as A,C as J,D as K,g as L,u as f,w as Q,A as U,l as X}from"./vendor.fd3b1727.js";import{_ as Z,S as $}from"./main.fc26c84f.js";function V(a,t){if(!t||a===null||typeof a!="object")return a;const[e,n]=t.split(/\.(.+)/);return V(a[e],n)}function ee(a,t){return t.reduce((e,n)=>(e[n]=a[n],e),{})}class te{constructor(t,e){this.data=t,this.columns=e}getValue(t){return V(this.data,t)}getColumn(t){return this.columns.find(e=>e.key===t)}getSortableValue(t){const e=this.getColumn(t).dataType;let n=this.getValue(t);if(n==null)return"";if(n instanceof String&&(n=n.toLowerCase()),e.startsWith("date")){const b=e.replace("date:","");return O(n,b).format("YYYYMMDDHHmmss")}return e==="numeric"?n:n.toString()}}class ae{constructor(t){const e=ee(t,["key","label","thClass","tdClass","sortBy","sortable","hidden","dataType"]);for(const n in e)this[n]=t[n];e.dataType||(this.dataType="string"),e.sortable===void 0&&(this.sortable=!0)}getFilterFieldName(){return this.filterOn||this.key}isSortable(){return this.sortable}getSortPredicate(t,e){const n=this.getSortFieldName(),l=e.find(g=>g.key===n).dataType;return l.startsWith("date")||l==="numeric"?(g,d)=>{const p=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x{const p=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x.localeCompare(p):p.localeCompare(x)}}getSortFieldName(){return this.sortBy||this.key}}const ne={props:{pagination:{type:Object,default:()=>({})}},computed:{pages(){return this.pagination.totalPages===void 0?[]:this.pageLinks()},hasFirst(){return this.pagination.currentPage>=4||this.pagination.totalPages<10},hasLast(){return this.pagination.currentPage<=this.pagination.totalPages-3||this.pagination.totalPages<10},hasFirstEllipsis(){return this.pagination.currentPage>=4&&this.pagination.totalPages>=10},hasLastEllipsis(){return this.pagination.currentPage<=this.pagination.totalPages-3&&this.pagination.totalPages>=10},shouldShowPagination(){return this.pagination.totalPages===void 0||this.pagination.count===0?!1:this.pagination.totalPages>1}},methods:{isActive(a){return(this.pagination.currentPage||1)===a},pageClicked(a){a==="..."||a===this.pagination.currentPage||a>this.pagination.totalPages||a<1||this.$emit("pageChange",a)},pageLinks(){const a=[];let t=2,e=this.pagination.totalPages-1;this.pagination.totalPages>=10&&(t=Math.max(1,this.pagination.currentPage-2),e=Math.min(this.pagination.currentPage+2,this.pagination.totalPages));for(let n=t;n<=e;n++)a.push(n);return a}}},re={key:0,class:"flex items-center justify-between px-4 py-3 bg-white border-t border-gray-200 sm:px-6"},ie={class:"flex justify-between flex-1 sm:hidden"},se={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},le={class:"text-sm text-gray-700"},oe=_(" Showing "+h(" ")+" "),de={key:0,class:"font-medium"},ge=_(" "+h(" ")+" to "+h(" ")+" "),ue={key:1,class:"font-medium"},ce={key:0},he={key:1},fe=_(" "+h(" ")+" of "+h(" ")+" "),ye={key:2,class:"font-medium"},me=_(" "+h(" ")+" results "),pe={class:"relative z-0 inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination"},be=u("span",{class:"sr-only"},"Previous",-1),xe={key:1,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},ve=["onClick"],ke={key:2,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},Ce=u("span",{class:"sr-only"},"Next",-1);function Pe(a,t,e,n,b,l){const g=T("BaseIcon");return l.shouldShowPagination?(i(),s("div",re,[u("div",ie,[u("a",{href:"#",class:c([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[0]||(t[0]=d=>l.pageClicked(e.pagination.currentPage-1))}," Previous ",2),u("a",{href:"#",class:c([{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages},"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[1]||(t[1]=d=>l.pageClicked(e.pagination.currentPage+1))}," Next ",2)]),u("div",se,[u("div",null,[u("p",le,[oe,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",de,h(e.pagination.currentPage*e.pagination.limit-(e.pagination.limit-1)),1)):m("",!0),ge,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",ue,[e.pagination.currentPage*e.pagination.limit<=e.pagination.totalCount?(i(),s("span",ce,h(e.pagination.currentPage*e.pagination.limit),1)):(i(),s("span",he,h(e.pagination.totalCount),1))])):m("",!0),fe,e.pagination.totalCount?(i(),s("span",ye,h(e.pagination.totalCount),1)):m("",!0),me])]),u("div",null,[u("nav",pe,[u("a",{href:"#",class:c([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md hover:bg-gray-50"]),onClick:t[2]||(t[2]=d=>l.pageClicked(e.pagination.currentPage-1))},[be,k(g,{name:"ChevronLeftIcon"})],2),l.hasFirst?(i(),s("a",{key:0,href:"#","aria-current":"page",class:c([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(1),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(1)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[3]||(t[3]=d=>l.pageClicked(1))}," 1 ",2)):m("",!0),l.hasFirstEllipsis?(i(),s("span",xe," ... ")):m("",!0),(i(!0),s(C,null,P(l.pages,d=>(i(),s("a",{key:d,href:"#",class:c([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(d),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(d),disabled:d==="..."},"relative items-center hidden px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 hover:bg-gray-50 md:inline-flex"]),onClick:p=>l.pageClicked(d)},h(d),11,ve))),128)),l.hasLastEllipsis?(i(),s("span",ke," ... ")):m("",!0),l.hasLast?(i(),s("a",{key:3,href:"#","aria-current":"page",class:c([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(e.pagination.totalPages),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(e.pagination.totalPages)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[4]||(t[4]=d=>l.pageClicked(e.pagination.totalPages))},h(e.pagination.totalPages),3)):m("",!0),u("a",{href:"#",class:c(["relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md hover:bg-gray-50",{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages}]),onClick:t[5]||(t[5]=d=>l.pageClicked(e.pagination.currentPage+1))},[Ce,k(g,{name:"ChevronRightIcon"})],2)])])])])):m("",!0)}var _e=Z(ne,[["render",Pe]]);const we={class:"flex flex-col"},Se={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8 pb-4 lg:pb-0"},Te={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"},Ne={class:"relative overflow-hidden bg-white border-b border-gray-200 shadow sm:rounded-lg"},Be=["onClick"],Fe={key:0,class:"asc-direction"},Ae={key:1,class:"desc-direction"},Le={key:0},Ve={key:1},Ie={key:0,class:"absolute top-0 left-0 z-10 flex items-center justify-center w-full h-full bg-white bg-opacity-60"},De={key:1,class:"text-center text-gray-500 pb-2 flex h-[160px] justify-center items-center flex-col"},Me={class:"block mt-1"},Re={props:{columns:{type:Array,required:!0},data:{type:[Array,Function],required:!0},sortBy:{type:String,default:""},sortOrder:{type:String,default:""},tableClass:{type:String,default:"min-w-full divide-y divide-gray-200"},theadClass:{type:String,default:"bg-gray-50"},tbodyClass:{type:String,default:""},noResultsMessage:{type:String,default:"No Results Found"},loading:{type:Boolean,default:!1},loadingType:{type:String,default:"placeholder",validator:function(a){return["placeholder","spinner"].indexOf(a)!==-1}},placeholderCount:{type:Number,default:3}},setup(a,{expose:t}){const e=a;let n=N([]),b=F(!1),l=N(e.columns.map(r=>new ae(r))),g=N({fieldName:"",order:""}),d=F("");const p=A(()=>Array.isArray(e.data)),x=A(()=>{if(!p.value||g.fieldName===""||l.length===0)return n.value;const r=I(g.fieldName);return r?[...n.value].sort(r.getSortPredicate(g.order,l)):n.value});function I(r){return l.find(o=>o.key===r)}function D(r){let o="whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider";return r.defaultThClass&&(o=r.defaultThClass),r.sortable?o=`${o} cursor-pointer`:o=`${o} pointer-events-none`,r.thClass&&(o=`${o} ${r.thClass}`),o}function B(r){let o="px-6 py-4 text-sm text-gray-500 whitespace-nowrap";return r.defaultTdClass&&(o=r.defaultTdClass),r.tdClass&&(o=`${o} ${r.tdClass}`),o}function M(r){let o="w-full";return r.placeholderClass&&(o=`${o} ${r.placeholderClass}`),o}function z(){return d.value=null,e.data}async function E(){const r=d.value&&d.value.currentPage||1;b.value=!0;const o=await e.data({sort:g,page:r});return b.value=!1,d.value=o.pagination,o.data}function R(r){g.fieldName!==r.key?(g.fieldName=r.key,g.order="asc"):g.order=g.order==="asc"?"desc":"asc",p.value||w()}async function w(){const r=p.value?z():await E();n.value=r.map(o=>new te(o,l))}async function j(r){d.value.currentPage=r,await w()}async function Y(){await w()}function H(r,o){return U.exports.get(r,o)}return p.value&&J(()=>e.data,()=>{w()}),K(async()=>{await w()}),t({refresh:Y}),(r,o)=>{const q=T("base-content-placeholders-text"),W=T("base-content-placeholders"),G=T("BaseIcon");return i(),s("div",we,[u("div",Se,[u("div",Te,[u("div",Ne,[L(r.$slots,"header"),u("table",{class:c(a.tableClass)},[u("thead",{class:c(a.theadClass)},[u("tr",null,[(i(!0),s(C,null,P(f(l),y=>(i(),s("th",{key:y.key,class:c([D(y),{"text-bold text-black":f(g).fieldName===y.key}]),onClick:v=>R(y)},[_(h(y.label)+" ",1),f(g).fieldName===y.key&&f(g).order==="asc"?(i(),s("span",Fe," \u2191 ")):m("",!0),f(g).fieldName===y.key&&f(g).order==="desc"?(i(),s("span",Ae," \u2193 ")):m("",!0)],10,Be))),128))])],2),a.loadingType==="placeholder"&&(a.loading||f(b))?(i(),s("tbody",Le,[(i(!0),s(C,null,P(a.placeholderCount,y=>(i(),s("tr",{key:y,class:c(y%2==0?"bg-white":"bg-gray-50")},[(i(!0),s(C,null,P(a.columns,v=>(i(),s("td",{key:v.key,class:c(["",B(v)])},[k(W,{class:c(M(v)),rounded:!0},{default:Q(()=>[k(q,{class:"w-full h-6",lines:1})]),_:2},1032,["class"])],2))),128))],2))),128))])):(i(),s("tbody",Ve,[(i(!0),s(C,null,P(f(x),(y,v)=>(i(),s("tr",{key:v,class:c(v%2==0?"bg-white":"bg-gray-50")},[(i(!0),s(C,null,P(a.columns,S=>(i(),s("td",{key:S.key,class:c(["",B(S)])},[L(r.$slots,"cell-"+S.key,{row:y},()=>[_(h(H(y.data,S.key)),1)])],2))),128))],2))),128))]))],2),a.loadingType==="spinner"&&(a.loading||f(b))?(i(),s("div",Ie,[k($,{class:"w-10 h-10 text-primary-500"})])):!a.loading&&!f(b)&&f(x)&&f(x).length===0?(i(),s("div",De,[k(G,{name:"ExclamationCircleIcon",class:"w-6 h-6 text-gray-400"}),u("span",Me,h(a.noResultsMessage),1)])):m("",!0),f(d)?(i(),X(_e,{key:2,pagination:f(d),onPageChange:j},null,8,["pagination"])):m("",!0)])])])])}}};export{Re as default}; diff --git a/public/build/assets/CapsuleIcon-Rj3UD5LO.js b/public/build/assets/CapsuleIcon-Rj3UD5LO.js new file mode 100644 index 00000000..d43a9378 --- /dev/null +++ b/public/build/assets/CapsuleIcon-Rj3UD5LO.js @@ -0,0 +1 @@ +import{o as d,c as i,b as l,H as C}from"./main-vzIkKseS.js";const o={width:"118",height:"110",viewBox:"0 0 118 110",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r={"clip-path":"url(#clip0)"},n=l("defs",null,[l("clipPath",{id:"clip0"},[l("rect",{width:"117.333",height:"110",fill:"white"})])],-1),s={props:{primaryFillColor:{type:String,default:"fill-primary-500"},secondaryFillColor:{type:String,default:"fill-gray-600"}},setup(e){return(a,c)=>(d(),i("svg",o,[l("g",r,[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.6672 32.9999C42.1415 32.9999 32.973 28.5119 32.5898 28.3194L33.4093 26.6804C33.4992 26.7244 42.6127 31.1666 58.6672 31.1666C74.542 31.1666 83.8388 26.7208 83.9323 26.6768L84.7354 28.3231C84.3449 28.5156 74.9618 32.9999 58.6672 32.9999Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.2438 39.0117L28.4191 40.8451C28.839 41.0871 29.1415 41.4831 29.2698 41.9597C29.3963 42.4346 29.3321 42.9296 29.0901 43.3494L14.4235 68.7521C14.099 69.3167 13.4866 69.6669 12.8248 69.6669C12.504 69.6669 12.1978 69.5844 11.9191 69.4231L8.74382 67.5897L7.82715 69.1774L11.0025 71.0107C11.5763 71.3426 12.2051 71.5002 12.8248 71.5002C14.0953 71.5002 15.3346 70.8421 16.0111 69.6687L30.6778 44.2661C31.6861 42.5189 31.083 40.2657 29.3358 39.2574L26.1605 37.4241L25.2438 39.0117Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M91.1729 37.4241L87.9976 39.2574C86.2504 40.2657 85.6472 42.5189 86.6556 44.2661L101.322 69.6687C101.999 70.8421 103.238 71.5002 104.509 71.5002C105.128 71.5002 105.757 71.3426 106.331 71.0107L109.506 69.1774L108.59 67.5897L105.414 69.4231C105.139 69.5826 104.826 69.6669 104.509 69.6669C103.847 69.6669 103.234 69.3167 102.91 68.7521L88.2432 43.3494C88.0012 42.9296 87.9371 42.4346 88.0636 41.9597C88.1919 41.4831 88.4944 41.0871 88.9142 40.8451L92.0896 39.0117L91.1729 37.4241Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M115.5 84.3333V87.6993C115.5 89.2797 114.424 90.6308 112.88 90.9883C112.013 91.19 111.049 91.4393 109.96 91.7198C102.573 93.6228 88.8268 97.1667 58.6667 97.1667C28.292 97.1667 14.6942 93.6338 7.38833 91.7345C6.29383 91.4503 5.324 91.1992 4.44767 90.9938C2.90767 90.6363 1.83333 89.2833 1.83333 87.7067V84.3333L0 82.5V87.7067C0 90.134 1.66833 92.2295 4.0315 92.7795C10.9322 94.3873 23.6812 99 58.6667 99C93.3478 99 106.372 94.3818 113.296 92.7758C115.661 92.2258 117.333 90.1285 117.333 87.6993V82.5",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M79.6139 20.1666L115.245 81.7354C115.841 82.7566 115.344 84.0656 114.214 84.4102C107.345 86.4966 89.3159 89.8333 58.6662 89.8333C27.9744 89.8333 9.97652 86.3371 3.12535 84.2526C1.99602 83.9079 1.49919 82.5989 2.09502 81.5778L37.7204 20.1666L36.6662 18.3333L0.503686 80.6666C-0.686148 82.7071 0.322186 85.3251 2.58085 86.0163C9.60985 88.1704 27.7104 91.6666 58.6662 91.6666C89.4625 91.6666 107.664 88.3189 114.742 86.1666C117.008 85.4772 118.022 82.8574 116.829 80.8133L80.6662 18.3333",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M110.814 92.4116L115.245 100.069C115.841 101.089 115.344 102.4 114.214 102.742C107.345 104.831 89.3159 108.167 58.6662 108.167C27.9744 108.167 9.97469 104.671 3.12535 102.585C1.99602 102.242 1.49919 100.931 2.09502 99.9117L6.41985 92.4556L4.75885 91.6672L0.503686 99.0006C-0.686148 101.041 0.322185 103.657 2.58085 104.35C9.60985 106.504 27.7104 110.001 58.6662 110.001C89.4625 110.001 107.664 106.653 114.742 104.501C117.007 103.811 118.022 101.191 116.829 99.1472L112.682 91.9789L110.814 92.4116Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.667 0C47.238 0 36.667 7.1335 36.667 18.3407V20.1667C36.667 20.1667 42.6052 23.8333 58.667 23.8333C74.6665 23.8333 80.667 20.1667 80.667 20.1667V18.3333C80.667 7.24167 70.767 0 58.667 0ZM58.667 1.83333C70.3527 1.83333 78.8337 8.7725 78.8337 18.3333V19.0172C76.6887 19.9302 70.5103 22 58.667 22C46.7705 22 40.6197 19.9283 38.5003 19.0227V18.3407C38.5003 12.3658 41.7692 8.55617 44.51 6.41117C48.2317 3.50167 53.3907 1.83333 58.667 1.83333Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M69.6667 53.1666C70.6768 53.1666 71.5 53.9898 71.5 54.9999V89.8333H73.3333V54.9999C73.3333 52.9741 71.6925 51.3333 69.6667 51.3333H47.6667C45.6408 51.3333 44 52.9741 44 54.9999V89.8333H45.8333V54.9999C45.8333 53.9898 46.6565 53.1666 47.6667 53.1666H69.6667Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.6667 56.8333C53.6048 56.8333 49.5 60.9381 49.5 65.9999C49.5 71.0618 53.6048 75.1666 58.6667 75.1666C63.7285 75.1666 67.8333 71.0618 67.8333 65.9999C67.8333 60.9381 63.7285 56.8333 58.6667 56.8333ZM58.6667 58.6666C62.711 58.6666 66 61.9556 66 65.9999C66 70.0443 62.711 73.3333 58.6667 73.3333C54.6223 73.3333 51.3333 70.0443 51.3333 65.9999C51.3333 61.9556 54.6223 58.6666 58.6667 58.6666Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M63.2503 66C62.7443 66 62.3337 65.5893 62.3337 65.0833C62.3337 63.5672 61.0998 62.3333 59.5837 62.3333C59.0777 62.3333 58.667 61.9227 58.667 61.4167C58.667 60.9107 59.0777 60.5 59.5837 60.5C62.11 60.5 64.167 62.5552 64.167 65.0833C64.167 65.5893 63.7563 66 63.2503 66Z",class:C(e.primaryFillColor)},null,2)]),n]))}};export{s as _}; diff --git a/public/build/assets/CapsuleIcon.730f4dd2.js b/public/build/assets/CapsuleIcon.730f4dd2.js deleted file mode 100644 index 808ddcdf..00000000 --- a/public/build/assets/CapsuleIcon.730f4dd2.js +++ /dev/null @@ -1 +0,0 @@ -import{o as d,e as i,h as l,m as C}from"./vendor.fd3b1727.js";const o={width:"118",height:"110",viewBox:"0 0 118 110",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r={"clip-path":"url(#clip0)"},n=l("defs",null,[l("clipPath",{id:"clip0"},[l("rect",{width:"117.333",height:"110",fill:"white"})])],-1),s={props:{primaryFillColor:{type:String,default:"fill-primary-500"},secondaryFillColor:{type:String,default:"fill-gray-600"}},setup(e){return(a,c)=>(d(),i("svg",o,[l("g",r,[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.6672 32.9999C42.1415 32.9999 32.973 28.5119 32.5898 28.3194L33.4093 26.6804C33.4992 26.7244 42.6127 31.1666 58.6672 31.1666C74.542 31.1666 83.8388 26.7208 83.9323 26.6768L84.7354 28.3231C84.3449 28.5156 74.9618 32.9999 58.6672 32.9999Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.2438 39.0117L28.4191 40.8451C28.839 41.0871 29.1415 41.4831 29.2698 41.9597C29.3963 42.4346 29.3321 42.9296 29.0901 43.3494L14.4235 68.7521C14.099 69.3167 13.4866 69.6669 12.8248 69.6669C12.504 69.6669 12.1978 69.5844 11.9191 69.4231L8.74382 67.5897L7.82715 69.1774L11.0025 71.0107C11.5763 71.3426 12.2051 71.5002 12.8248 71.5002C14.0953 71.5002 15.3346 70.8421 16.0111 69.6687L30.6778 44.2661C31.6861 42.5189 31.083 40.2657 29.3358 39.2574L26.1605 37.4241L25.2438 39.0117Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M91.1729 37.4241L87.9976 39.2574C86.2504 40.2657 85.6472 42.5189 86.6556 44.2661L101.322 69.6687C101.999 70.8421 103.238 71.5002 104.509 71.5002C105.128 71.5002 105.757 71.3426 106.331 71.0107L109.506 69.1774L108.59 67.5897L105.414 69.4231C105.139 69.5826 104.826 69.6669 104.509 69.6669C103.847 69.6669 103.234 69.3167 102.91 68.7521L88.2432 43.3494C88.0012 42.9296 87.9371 42.4346 88.0636 41.9597C88.1919 41.4831 88.4944 41.0871 88.9142 40.8451L92.0896 39.0117L91.1729 37.4241Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M115.5 84.3333V87.6993C115.5 89.2797 114.424 90.6308 112.88 90.9883C112.013 91.19 111.049 91.4393 109.96 91.7198C102.573 93.6228 88.8268 97.1667 58.6667 97.1667C28.292 97.1667 14.6942 93.6338 7.38833 91.7345C6.29383 91.4503 5.324 91.1992 4.44767 90.9938C2.90767 90.6363 1.83333 89.2833 1.83333 87.7067V84.3333L0 82.5V87.7067C0 90.134 1.66833 92.2295 4.0315 92.7795C10.9322 94.3873 23.6812 99 58.6667 99C93.3478 99 106.372 94.3818 113.296 92.7758C115.661 92.2258 117.333 90.1285 117.333 87.6993V82.5",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M79.6139 20.1666L115.245 81.7354C115.841 82.7566 115.344 84.0656 114.214 84.4102C107.345 86.4966 89.3159 89.8333 58.6662 89.8333C27.9744 89.8333 9.97652 86.3371 3.12535 84.2526C1.99602 83.9079 1.49919 82.5989 2.09502 81.5778L37.7204 20.1666L36.6662 18.3333L0.503686 80.6666C-0.686148 82.7071 0.322186 85.3251 2.58085 86.0163C9.60985 88.1704 27.7104 91.6666 58.6662 91.6666C89.4625 91.6666 107.664 88.3189 114.742 86.1666C117.008 85.4772 118.022 82.8574 116.829 80.8133L80.6662 18.3333",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M110.814 92.4116L115.245 100.069C115.841 101.089 115.344 102.4 114.214 102.742C107.345 104.831 89.3159 108.167 58.6662 108.167C27.9744 108.167 9.97469 104.671 3.12535 102.585C1.99602 102.242 1.49919 100.931 2.09502 99.9117L6.41985 92.4556L4.75885 91.6672L0.503686 99.0006C-0.686148 101.041 0.322185 103.657 2.58085 104.35C9.60985 106.504 27.7104 110.001 58.6662 110.001C89.4625 110.001 107.664 106.653 114.742 104.501C117.007 103.811 118.022 101.191 116.829 99.1472L112.682 91.9789L110.814 92.4116Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.667 0C47.238 0 36.667 7.1335 36.667 18.3407V20.1667C36.667 20.1667 42.6052 23.8333 58.667 23.8333C74.6665 23.8333 80.667 20.1667 80.667 20.1667V18.3333C80.667 7.24167 70.767 0 58.667 0ZM58.667 1.83333C70.3527 1.83333 78.8337 8.7725 78.8337 18.3333V19.0172C76.6887 19.9302 70.5103 22 58.667 22C46.7705 22 40.6197 19.9283 38.5003 19.0227V18.3407C38.5003 12.3658 41.7692 8.55617 44.51 6.41117C48.2317 3.50167 53.3907 1.83333 58.667 1.83333Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M69.6667 53.1666C70.6768 53.1666 71.5 53.9898 71.5 54.9999V89.8333H73.3333V54.9999C73.3333 52.9741 71.6925 51.3333 69.6667 51.3333H47.6667C45.6408 51.3333 44 52.9741 44 54.9999V89.8333H45.8333V54.9999C45.8333 53.9898 46.6565 53.1666 47.6667 53.1666H69.6667Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.6667 56.8333C53.6048 56.8333 49.5 60.9381 49.5 65.9999C49.5 71.0618 53.6048 75.1666 58.6667 75.1666C63.7285 75.1666 67.8333 71.0618 67.8333 65.9999C67.8333 60.9381 63.7285 56.8333 58.6667 56.8333ZM58.6667 58.6666C62.711 58.6666 66 61.9556 66 65.9999C66 70.0443 62.711 73.3333 58.6667 73.3333C54.6223 73.3333 51.3333 70.0443 51.3333 65.9999C51.3333 61.9556 54.6223 58.6666 58.6667 58.6666Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M63.2503 66C62.7443 66 62.3337 65.5893 62.3337 65.0833C62.3337 63.5672 61.0998 62.3333 59.5837 62.3333C59.0777 62.3333 58.667 61.9227 58.667 61.4167C58.667 60.9107 59.0777 60.5 59.5837 60.5C62.11 60.5 64.167 62.5552 64.167 65.0833C64.167 65.5893 63.7563 66 63.2503 66Z",class:C(e.primaryFillColor)},null,2)]),n]))}};export{s as _}; diff --git a/public/build/assets/CategoryModal-k2zsC2hK.js b/public/build/assets/CategoryModal-k2zsC2hK.js new file mode 100644 index 00000000..a983ff33 --- /dev/null +++ b/public/build/assets/CategoryModal-k2zsC2hK.js @@ -0,0 +1 @@ +import{D as k,e as q,g as D,l as g,h as y,i as G,G as N,af as L,k as T,r as i,o as B,n as b,w as r,b as m,q as C,t as f,m as e,a as n,H as j,I as z,s as E}from"./main-vzIkKseS.js";import{u as U}from"./category-UGWSUknX.js";const A={class:"flex justify-between w-full"},H=["onSubmit"],X={class:"p-8 sm:p-6"},F={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},P={setup(J){const t=U(),u=k(),{t:p}=q();let c=D(!1);const h=g(()=>({currentCategory:{name:{required:y.withMessage(p("validation.required"),G),minLength:y.withMessage(p("validation.name_min_length",{count:3}),N(3))},description:{maxLength:y.withMessage(p("validation.description_maxlength",{count:255}),L(255))}}})),a=T(h,g(()=>t)),I=g(()=>u.active&&u.componentName==="CategoryModal");async function w(){if(a.value.currentCategory.$touch(),a.value.currentCategory.$invalid)return!0;const s=t.isEdit?t.updateCategory:t.addCategory;c.value=!0,await s(t.currentCategory),c.value=!1,u.refreshData&&u.refreshData(),d()}function d(){u.closeModal(),setTimeout(()=>{t.$reset(),a.value.$reset()},300)}return(s,o)=>{const v=i("BaseIcon"),x=i("BaseInput"),_=i("BaseInputGroup"),V=i("BaseTextarea"),M=i("BaseInputGrid"),$=i("BaseButton"),S=i("BaseModal");return B(),b(S,{show:e(I),onClose:d},{header:r(()=>[m("div",A,[C(f(e(u).title)+" ",1),n(v,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[m("form",{action:"",onSubmit:E(w,["prevent"])},[m("div",X,[n(M,{layout:"one-column"},{default:r(()=>[n(_,{label:s.$t("expenses.category"),error:e(a).currentCategory.name.$error&&e(a).currentCategory.name.$errors[0].$message,required:""},{default:r(()=>[n(x,{modelValue:e(t).currentCategory.name,"onUpdate:modelValue":o[0]||(o[0]=l=>e(t).currentCategory.name=l),invalid:e(a).currentCategory.name.$error,type:"text",onInput:o[1]||(o[1]=l=>e(a).currentCategory.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),n(_,{label:s.$t("expenses.description"),error:e(a).currentCategory.description.$error&&e(a).currentCategory.description.$errors[0].$message},{default:r(()=>[n(V,{modelValue:e(t).currentCategory.description,"onUpdate:modelValue":o[2]||(o[2]=l=>e(t).currentCategory.description=l),rows:"4",cols:"50",onInput:o[3]||(o[3]=l=>e(a).currentCategory.description.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"])]),_:1})]),m("div",F,[n($,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:d},{default:r(()=>[C(f(s.$t("general.cancel")),1)]),_:1}),n($,{loading:e(c),disabled:e(c),variant:"primary",type:"submit"},{left:r(l=>[e(c)?z("",!0):(B(),b(v,{key:0,name:"SaveIcon",class:j(l.class)},null,8,["class"]))]),default:r(()=>[C(" "+f(e(t).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,H)]),_:1},8,["show"])}}};export{P as _}; diff --git a/public/build/assets/CategoryModal.cb867f43.js b/public/build/assets/CategoryModal.cb867f43.js deleted file mode 100644 index 59ec6a90..00000000 --- a/public/build/assets/CategoryModal.cb867f43.js +++ /dev/null @@ -1 +0,0 @@ -import{J as j,B as k,k as g,L as y,M as N,N as L,S as T,T as q,r as i,o as B,l as b,w as r,h as m,i as f,t as C,u as e,f as n,m as D,j as G,U}from"./vendor.fd3b1727.js";import{u as z}from"./category.3bd14c85.js";import{c as E}from"./main.fc26c84f.js";const A={class:"flex justify-between w-full"},J=["onSubmit"],X={class:"p-8 sm:p-6"},F={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},Q={setup(H){const t=z(),u=E(),{t:p}=j();let c=k(!1);const h=g(()=>({currentCategory:{name:{required:y.withMessage(p("validation.required"),N),minLength:y.withMessage(p("validation.name_min_length",{count:3}),L(3))},description:{maxLength:y.withMessage(p("validation.description_maxlength",{count:255}),T(255))}}})),o=q(h,g(()=>t)),w=g(()=>u.active&&u.componentName==="CategoryModal");async function I(){if(o.value.currentCategory.$touch(),o.value.currentCategory.$invalid)return!0;const s=t.isEdit?t.updateCategory:t.addCategory;c.value=!0,await s(t.currentCategory),c.value=!1,u.refreshData&&u.refreshData(),d()}function d(){u.closeModal(),setTimeout(()=>{t.$reset(),o.value.$reset()},300)}return(s,a)=>{const v=i("BaseIcon"),x=i("BaseInput"),_=i("BaseInputGroup"),M=i("BaseTextarea"),V=i("BaseInputGrid"),$=i("BaseButton"),S=i("BaseModal");return B(),b(S,{show:e(w),onClose:d},{header:r(()=>[m("div",A,[f(C(e(u).title)+" ",1),n(v,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[m("form",{action:"",onSubmit:U(I,["prevent"])},[m("div",X,[n(V,{layout:"one-column"},{default:r(()=>[n(_,{label:s.$t("expenses.category"),error:e(o).currentCategory.name.$error&&e(o).currentCategory.name.$errors[0].$message,required:""},{default:r(()=>[n(x,{modelValue:e(t).currentCategory.name,"onUpdate:modelValue":a[0]||(a[0]=l=>e(t).currentCategory.name=l),invalid:e(o).currentCategory.name.$error,type:"text",onInput:a[1]||(a[1]=l=>e(o).currentCategory.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),n(_,{label:s.$t("expenses.description"),error:e(o).currentCategory.description.$error&&e(o).currentCategory.description.$errors[0].$message},{default:r(()=>[n(M,{modelValue:e(t).currentCategory.description,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).currentCategory.description=l),rows:"4",cols:"50",onInput:a[3]||(a[3]=l=>e(o).currentCategory.description.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"])]),_:1})]),m("div",F,[n($,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:d},{default:r(()=>[f(C(s.$t("general.cancel")),1)]),_:1}),n($,{loading:e(c),disabled:e(c),variant:"primary",type:"submit"},{left:r(l=>[e(c)?G("",!0):(B(),b(v,{key:0,name:"SaveIcon",class:D(l.class)},null,8,["class"]))]),default:r(()=>[f(" "+C(e(t).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,J)]),_:1},8,["show"])}}};export{Q as _}; diff --git a/public/build/assets/CompanyInfoSettings-1CNniwZ8.js b/public/build/assets/CompanyInfoSettings-1CNniwZ8.js new file mode 100644 index 00000000..4d54663b --- /dev/null +++ b/public/build/assets/CompanyInfoSettings-1CNniwZ8.js @@ -0,0 +1 @@ +import{C as T,D as j,E as A,f as ee,e as E,g as V,F as H,l as x,h as w,i as F,Z as ae,k as J,r,o as h,n as N,w as l,b as i,t as g,m as e,a as o,q as k,H as O,I as G,s as Z,a3 as te,G as oe,c as R,p as se,L as ne}from"./main-vzIkKseS.js";const le={class:"flex justify-between w-full"},de={class:"px-6 pt-6"},re={class:"font-medium text-lg text-left"},ie={class:"mt-2 text-sm leading-snug text-gray-500",style:{"max-width":"680px"}},ue=["onSubmit"],me={class:"p-4 sm:p-6 space-y-4"},ce={class:"z-0 flex justify-end p-4 bg-gray-50 border-modal-bg"},pe={setup(K){const c=T(),v=j(),I=A(),$=ee(),{t:S}=E();let u=V(!1);const a=H({id:c.selectedCompany.id,name:null}),b=x(()=>v.active&&v.componentName==="DeleteCompanyModal"),f={formData:{name:{required:w.withMessage(S("validation.required"),F),sameAsName:w.withMessage(S("validation.company_name_not_same"),ae(c.selectedCompany.name))}}},p=J(f,{formData:a},{$scope:!1});async function B(){if(p.value.$touch(),p.value.$invalid)return!0;const y=c.companies[0];u.value=!0;try{const _=await c.deleteCompany(a);console.log(_.data.success),_.data.success&&(m(),await c.setSelectedCompany(y),$.push("/admin/dashboard"),await I.setIsAppLoaded(!1),await I.bootstrap()),u.value=!1}catch{u.value=!1}}function M(){a.id=null,a.name="",p.value.$reset()}function m(){v.closeModal(),setTimeout(()=>{M(),p.value.$reset()},300)}return(y,_)=>{const U=r("BaseInput"),q=r("BaseInputGroup"),n=r("BaseButton"),t=r("BaseIcon"),D=r("BaseModal");return h(),N(D,{show:e(b),onClose:m},{default:l(()=>[i("div",le,[i("div",de,[i("h6",re,g(e(v).title),1),i("p",ie,g(y.$t("settings.company_info.delete_company_modal_desc",{company:e(c).selectedCompany.name})),1)])]),i("form",{action:"",onSubmit:Z(B,["prevent"])},[i("div",me,[o(q,{label:y.$t("settings.company_info.delete_company_modal_label",{company:e(c).selectedCompany.name}),error:e(p).formData.name.$error&&e(p).formData.name.$errors[0].$message,required:""},{default:l(()=>[o(U,{modelValue:e(a).name,"onUpdate:modelValue":_[0]||(_[0]=d=>e(a).name=d),invalid:e(p).formData.name.$error,onInput:_[1]||(_[1]=d=>e(p).formData.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),i("div",ce,[o(n,{class:"mr-3 text-sm",variant:"primary-outline",outline:"",type:"button",onClick:m},{default:l(()=>[k(g(y.$t("general.cancel")),1)]),_:1}),o(n,{loading:e(u),disabled:e(u),variant:"danger",type:"submit"},{left:l(d=>[e(u)?G("",!0):(h(),N(t,{key:0,name:"TrashIcon",class:O(d.class)},null,8,["class"]))]),default:l(()=>[k(" "+g(y.$t("general.delete")),1)]),_:1},8,["loading","disabled"])])],40,ue)]),_:1},8,["show"])}}},_e=["onSubmit"],fe={key:0,class:"py-5"},ye={class:"text-lg leading-6 font-medium text-gray-900"},ge={class:"mt-2 max-w-xl text-sm text-gray-500"},ve={class:"mt-5"},$e={setup(K){const c=T(),v=A(),I=j(),{t:$}=E(),S=te("utils");let u=V(!1);const a=H({name:null,logo:null,address:{address_street_1:"",address_street_2:"",website:"",country_id:null,state:"",city:"",phone:"",zip:""}});S.mergeSettings(a,{...c.selectedCompany});let b=V([]),f=V(null),p=V(null);const B=V(!1);a.logo&&b.value.push({image:a.logo});const M=x(()=>({name:{required:w.withMessage($("validation.required"),F),minLength:w.withMessage($("validation.name_min_length"),oe(3))},address:{country_id:{required:w.withMessage($("validation.required"),F)}}})),m=J(M,x(()=>a));v.fetchCountries();function y(n,t,D,d){p.value=d.name,f.value=t}function _(){f.value=null,B.value=!0}async function U(){if(m.value.$touch(),m.value.$invalid)return!0;if(u.value=!0,(await c.updateCompany(a)).data.data){if(f.value||B.value){let t=new FormData;f.value&&t.append("company_logo",JSON.stringify({name:p.value,data:f.value})),t.append("is_company_logo_removed",B.value),await c.updateCompanyLogo(t),f.value=null,B.value=!1}u.value=!1}u.value=!1}function q(n){I.openModal({title:$("settings.company_info.are_you_absolutely_sure"),componentName:"DeleteCompanyModal",size:"sm"})}return(n,t)=>{const D=r("BaseFileUploader"),d=r("BaseInputGroup"),z=r("BaseInputGrid"),C=r("BaseInput"),P=r("BaseMultiselect"),L=r("BaseTextarea"),Q=r("BaseIcon"),W=r("BaseButton"),X=r("BaseDivider"),Y=r("BaseSettingCard");return h(),R(ne,null,[i("form",{onSubmit:Z(U,["prevent"])},[o(Y,{title:n.$t("settings.company_info.company_info"),description:n.$t("settings.company_info.section_description")},{default:l(()=>[o(z,{class:"mt-5"},{default:l(()=>[o(d,{label:n.$tc("settings.company_info.company_logo")},{default:l(()=>[o(D,{modelValue:e(b),"onUpdate:modelValue":t[0]||(t[0]=s=>se(b)?b.value=s:b=s),base64:"",onChange:y,onRemove:_},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(z,{class:"mt-5"},{default:l(()=>[o(d,{label:n.$tc("settings.company_info.company_name"),error:e(m).name.$error&&e(m).name.$errors[0].$message,required:""},{default:l(()=>[o(C,{modelValue:e(a).name,"onUpdate:modelValue":t[1]||(t[1]=s=>e(a).name=s),invalid:e(m).name.$error,onBlur:t[2]||(t[2]=s=>e(m).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(d,{label:n.$tc("settings.company_info.phone")},{default:l(()=>[o(C,{modelValue:e(a).address.phone,"onUpdate:modelValue":t[3]||(t[3]=s=>e(a).address.phone=s)},null,8,["modelValue"])]),_:1},8,["label"]),o(d,{label:n.$tc("settings.company_info.country"),error:e(m).address.country_id.$error&&e(m).address.country_id.$errors[0].$message,required:""},{default:l(()=>[o(P,{modelValue:e(a).address.country_id,"onUpdate:modelValue":t[4]||(t[4]=s=>e(a).address.country_id=s),label:"name",invalid:e(m).address.country_id.$error,options:e(v).countries,"value-prop":"id","can-deselect":!0,"can-clear":!1,searchable:"","track-by":"name"},null,8,["modelValue","invalid","options"])]),_:1},8,["label","error"]),o(d,{label:n.$tc("settings.company_info.state")},{default:l(()=>[o(C,{modelValue:e(a).address.state,"onUpdate:modelValue":t[5]||(t[5]=s=>e(a).address.state=s),name:"state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(d,{label:n.$tc("settings.company_info.city")},{default:l(()=>[o(C,{modelValue:e(a).address.city,"onUpdate:modelValue":t[6]||(t[6]=s=>e(a).address.city=s),type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(d,{label:n.$tc("settings.company_info.zip")},{default:l(()=>[o(C,{modelValue:e(a).address.zip,"onUpdate:modelValue":t[7]||(t[7]=s=>e(a).address.zip=s)},null,8,["modelValue"])]),_:1},8,["label"]),i("div",null,[o(d,{label:n.$tc("settings.company_info.address")},{default:l(()=>[o(L,{modelValue:e(a).address.address_street_1,"onUpdate:modelValue":t[8]||(t[8]=s=>e(a).address.address_street_1=s),rows:"2"},null,8,["modelValue"])]),_:1},8,["label"]),o(L,{modelValue:e(a).address.address_street_2,"onUpdate:modelValue":t[9]||(t[9]=s=>e(a).address.address_street_2=s),rows:"2",row:2,class:"mt-2"},null,8,["modelValue"])])]),_:1}),o(W,{loading:e(u),disabled:e(u),type:"submit",class:"mt-6"},{left:l(s=>[e(u)?G("",!0):(h(),N(Q,{key:0,class:O(s.class),name:"SaveIcon"},null,8,["class"]))]),default:l(()=>[k(" "+g(n.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"]),e(c).companies.length!==1?(h(),R("div",fe,[o(X,{class:"my-4"}),i("h3",ye,g(n.$tc("settings.company_info.delete_company")),1),i("div",ge,[i("p",null,g(n.$tc("settings.company_info.delete_company_description")),1)]),i("div",ve,[i("button",{type:"button",class:"inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm",onClick:q},g(n.$tc("general.delete")),1)])])):G("",!0)]),_:1},8,["title","description"])],40,_e),o(pe)],64)}}};export{$e as default}; diff --git a/public/build/assets/CompanyInfoSettings.e80e4a03.js b/public/build/assets/CompanyInfoSettings.e80e4a03.js deleted file mode 100644 index 0e2b2c42..00000000 --- a/public/build/assets/CompanyInfoSettings.e80e4a03.js +++ /dev/null @@ -1 +0,0 @@ -var oe=Object.defineProperty;var T=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var R=(_,s,d)=>s in _?oe(_,s,{enumerable:!0,configurable:!0,writable:!0,value:d}):_[s]=d,A=(_,s)=>{for(var d in s||(s={}))se.call(s,d)&&R(_,d,s[d]);if(T)for(var d of T(s))ne.call(s,d)&&R(_,d,s[d]);return _};import{aN as le,J,B as C,a0 as E,k as F,L as h,M as k,P as de,T as O,r as u,o as I,l as q,w as r,h as m,t as b,u as e,f as o,i as j,m as P,j as z,U as H,ah as re,N as ie,e as K,x as ue,F as me}from"./vendor.fd3b1727.js";import{b as Q,c as W,d as X}from"./main.fc26c84f.js";const ce={class:"flex justify-between w-full"},pe={class:"px-6 pt-6"},fe={class:"font-medium text-lg text-left"},_e={class:"mt-2 text-sm leading-snug text-gray-500",style:{"max-width":"680px"}},ye=["onSubmit"],ge={class:"p-4 sm:p-6 space-y-4"},ve={class:"z-0 flex justify-end p-4 bg-gray-50 border-modal-bg"},be={setup(_){const s=Q(),d=W(),S=X(),B=le(),{t:M}=J();let c=C(!1);const a=E({id:s.selectedCompany.id,name:null}),$=F(()=>d.active&&d.componentName==="DeleteCompanyModal"),g={formData:{name:{required:h.withMessage(M("validation.required"),k),sameAsName:h.withMessage(M("validation.company_name_not_same"),de(s.selectedCompany.name))}}},f=O(g,{formData:a},{$scope:!1});async function V(){if(f.value.$touch(),f.value.$invalid)return!0;const v=s.companies[0];c.value=!0;try{const y=await s.deleteCompany(a);console.log(y.data.success),y.data.success&&(p(),await s.setSelectedCompany(v),B.push("/admin/dashboard"),await S.setIsAppLoaded(!1),await S.bootstrap()),c.value=!1}catch{c.value=!1}}function N(){a.id=null,a.name="",f.value.$reset()}function p(){d.closeModal(),setTimeout(()=>{N(),f.value.$reset()},300)}return(v,y)=>{const U=u("BaseInput"),x=u("BaseInputGroup"),l=u("BaseButton"),t=u("BaseIcon"),D=u("BaseModal");return I(),q(D,{show:e($),onClose:p},{default:r(()=>[m("div",ce,[m("div",pe,[m("h6",fe,b(e(d).title),1),m("p",_e,b(v.$t("settings.company_info.delete_company_modal_desc",{company:e(s).selectedCompany.name})),1)])]),m("form",{action:"",onSubmit:H(V,["prevent"])},[m("div",ge,[o(x,{label:v.$t("settings.company_info.delete_company_modal_label",{company:e(s).selectedCompany.name}),error:e(f).formData.name.$error&&e(f).formData.name.$errors[0].$message,required:""},{default:r(()=>[o(U,{modelValue:e(a).name,"onUpdate:modelValue":y[0]||(y[0]=i=>e(a).name=i),invalid:e(f).formData.name.$error,onInput:y[1]||(y[1]=i=>e(f).formData.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),m("div",ve,[o(l,{class:"mr-3 text-sm",variant:"primary-outline",outline:"",type:"button",onClick:p},{default:r(()=>[j(b(v.$t("general.cancel")),1)]),_:1}),o(l,{loading:e(c),disabled:e(c),variant:"danger",type:"submit"},{left:r(i=>[e(c)?z("",!0):(I(),q(t,{key:0,name:"TrashIcon",class:P(i.class)},null,8,["class"]))]),default:r(()=>[j(" "+b(v.$t("general.delete")),1)]),_:1},8,["loading","disabled"])])],40,ye)]),_:1},8,["show"])}}},$e=["onSubmit"],Be={key:0,class:"py-5"},Ve={class:"text-lg leading-6 font-medium text-gray-900"},Ce={class:"mt-2 max-w-xl text-sm text-gray-500"},we={class:"mt-5"},Me={setup(_){const s=Q(),d=X(),S=W(),{t:B}=J(),M=re("utils");let c=C(!1);const a=E({name:null,logo:null,address:{address_street_1:"",address_street_2:"",website:"",country_id:null,state:"",city:"",phone:"",zip:""}});M.mergeSettings(a,A({},s.selectedCompany));let $=C([]),g=C(null),f=C(null);const V=C(!1);a.logo&&$.value.push({image:a.logo});const N=F(()=>({name:{required:h.withMessage(B("validation.required"),k),minLength:h.withMessage(B("validation.name_min_length"),ie(3))},address:{country_id:{required:h.withMessage(B("validation.required"),k)}}})),p=O(N,F(()=>a));d.fetchCountries();function v(l,t,D,i){f.value=i.name,g.value=t}function y(){g.value=null,V.value=!0}async function U(){if(p.value.$touch(),p.value.$invalid)return!0;if(c.value=!0,(await s.updateCompany(a)).data.data){if(g.value||V.value){let t=new FormData;g.value&&t.append("company_logo",JSON.stringify({name:f.value,data:g.value})),t.append("is_company_logo_removed",V.value),await s.updateCompanyLogo(t),g.value=null,V.value=!1}c.value=!1}c.value=!1}function x(l){S.openModal({title:B("settings.company_info.are_you_absolutely_sure"),componentName:"DeleteCompanyModal",size:"sm"})}return(l,t)=>{const D=u("BaseFileUploader"),i=u("BaseInputGroup"),G=u("BaseInputGrid"),w=u("BaseInput"),Y=u("BaseMultiselect"),L=u("BaseTextarea"),Z=u("BaseIcon"),ee=u("BaseButton"),ae=u("BaseDivider"),te=u("BaseSettingCard");return I(),K(me,null,[m("form",{onSubmit:H(U,["prevent"])},[o(te,{title:l.$t("settings.company_info.company_info"),description:l.$t("settings.company_info.section_description")},{default:r(()=>[o(G,{class:"mt-5"},{default:r(()=>[o(i,{label:l.$tc("settings.company_info.company_logo")},{default:r(()=>[o(D,{modelValue:e($),"onUpdate:modelValue":t[0]||(t[0]=n=>ue($)?$.value=n:$=n),base64:"",onChange:v,onRemove:y},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(G,{class:"mt-5"},{default:r(()=>[o(i,{label:l.$tc("settings.company_info.company_name"),error:e(p).name.$error&&e(p).name.$errors[0].$message,required:""},{default:r(()=>[o(w,{modelValue:e(a).name,"onUpdate:modelValue":t[1]||(t[1]=n=>e(a).name=n),invalid:e(p).name.$error,onBlur:t[2]||(t[2]=n=>e(p).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(i,{label:l.$tc("settings.company_info.phone")},{default:r(()=>[o(w,{modelValue:e(a).address.phone,"onUpdate:modelValue":t[3]||(t[3]=n=>e(a).address.phone=n)},null,8,["modelValue"])]),_:1},8,["label"]),o(i,{label:l.$tc("settings.company_info.country"),error:e(p).address.country_id.$error&&e(p).address.country_id.$errors[0].$message,required:""},{default:r(()=>[o(Y,{modelValue:e(a).address.country_id,"onUpdate:modelValue":t[4]||(t[4]=n=>e(a).address.country_id=n),label:"name",invalid:e(p).address.country_id.$error,options:e(d).countries,"value-prop":"id","can-deselect":!0,"can-clear":!1,searchable:"","track-by":"name"},null,8,["modelValue","invalid","options"])]),_:1},8,["label","error"]),o(i,{label:l.$tc("settings.company_info.state")},{default:r(()=>[o(w,{modelValue:e(a).address.state,"onUpdate:modelValue":t[5]||(t[5]=n=>e(a).address.state=n),name:"state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(i,{label:l.$tc("settings.company_info.city")},{default:r(()=>[o(w,{modelValue:e(a).address.city,"onUpdate:modelValue":t[6]||(t[6]=n=>e(a).address.city=n),type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(i,{label:l.$tc("settings.company_info.zip")},{default:r(()=>[o(w,{modelValue:e(a).address.zip,"onUpdate:modelValue":t[7]||(t[7]=n=>e(a).address.zip=n)},null,8,["modelValue"])]),_:1},8,["label"]),m("div",null,[o(i,{label:l.$tc("settings.company_info.address")},{default:r(()=>[o(L,{modelValue:e(a).address.address_street_1,"onUpdate:modelValue":t[8]||(t[8]=n=>e(a).address.address_street_1=n),rows:"2"},null,8,["modelValue"])]),_:1},8,["label"]),o(L,{modelValue:e(a).address.address_street_2,"onUpdate:modelValue":t[9]||(t[9]=n=>e(a).address.address_street_2=n),rows:"2",row:2,class:"mt-2"},null,8,["modelValue"])])]),_:1}),o(ee,{loading:e(c),disabled:e(c),type:"submit",class:"mt-6"},{left:r(n=>[e(c)?z("",!0):(I(),q(Z,{key:0,class:P(n.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[j(" "+b(l.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"]),e(s).companies.length!==1?(I(),K("div",Be,[o(ae,{class:"my-4"}),m("h3",Ve,b(l.$tc("settings.company_info.delete_company")),1),m("div",Ce,[m("p",null,b(l.$tc("settings.company_info.delete_company_description")),1)]),m("div",we,[m("button",{type:"button",class:"inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm",onClick:x},b(l.$tc("general.delete")),1)])])):z("",!0)]),_:1},8,["title","description"])],40,$e),o(be)],64)}}};export{Me as default}; diff --git a/public/build/assets/Create-II8eq-s_.js b/public/build/assets/Create-II8eq-s_.js new file mode 100644 index 00000000..8e8ee683 --- /dev/null +++ b/public/build/assets/Create-II8eq-s_.js @@ -0,0 +1 @@ +import{a6 as ie,C as de,ac as ue,D as ce,J as pe,f as me,e as ge,E as xe,g as q,l as $,h as m,i as b,aD as _e,af as G,ad as ye,V as fe,k as ve,aB as Ee,r as d,o as v,c as $e,a as r,w as o,b as F,m as e,n as h,H as D,q as w,t as S,I as C,p as be,s as he,L as Ce}from"./main-vzIkKseS.js";import{u as Be}from"./expense-jTuBtGLS.js";import{u as Ve}from"./category-UGWSUknX.js";import{_ as we}from"./CreateCustomFields-hHeYNhLY.js";import{_ as Se}from"./CategoryModal-k2zsC2hK.js";import{_ as Ie}from"./ExchangeRateConverter-ZwwFqeKM.js";import"./dynamic-import-helper-0gtGTknh.js";import"./exchange-rate--sifpuzz.js";const Me=["onSubmit"],ke={class:"hidden md:block"},qe={class:"block md:hidden"},Te={setup(Fe){const _=ie(),U=de(),t=Be(),y=Ve(),A=ue(),L=ce(),f=pe(),T=me(),{t:u}=ge(),R=xe();let g=q(!1),i=q(!1);const P="newExpense",I=q(!1),j=$(()=>({currentExpense:{expense_category_id:{required:m.withMessage(u("validation.required"),b)},expense_date:{required:m.withMessage(u("validation.required"),b)},amount:{required:m.withMessage(u("validation.required"),b),minValue:m.withMessage(u("validation.price_minvalue"),_e(.1)),maxLength:m.withMessage(u("validation.price_maxlength"),G(20))},notes:{maxLength:m.withMessage(u("validation.description_maxlength"),G(65e3))},currency_id:{required:m.withMessage(u("validation.required"),b)},exchange_rate:{required:ye(function(){return m.withMessage(u("validation.required"),b),t.showExchangeRate}),decimal:m.withMessage(u("validation.valid_exchange_rate"),fe)}}})),l=ve(j,t,{$scope:P}),M=$({get:()=>t.currentExpense.amount/100,set:a=>{t.currentExpense.amount=Math.round(a*100)}}),c=$(()=>f.name==="expenses.edit"),N=$(()=>c.value?u("expenses.edit_expense"):u("expenses.new_expense")),H=$(()=>c.value?`/reports/expenses/${f.params.id}/download-receipt`:"");t.resetCurrentExpenseData(),A.resetCustomFields(),X();function z(a,n){t.currentExpense.attachment_receipt=n}function O(){t.currentExpense.attachment_receipt=null,I.value=!0}function J(){L.openModal({title:u("settings.expense_category.add_category"),componentName:"CategoryModal",size:"sm"})}function K(a){t.currentExpense.selectedCurrency=R.currencies.find(n=>n.id===a)}async function Q(a){let n=await y.fetchCategories({search:a});if(n.data.data.length>0&&y.editCategory&&!n.data.data.find(p=>p.id==y.editCategory.id)){let p=Object.assign({},y.editCategory);n.data.data.unshift(p)}return n.data.data}async function W(a){let n=await _.fetchCustomers({search:a});if(n.data.data.length>0&&_.editCustomer&&!n.data.data.find(p=>p.id==_.editCustomer.id)){let p=Object.assign({},_.editCustomer);n.data.data.unshift(p)}return n.data.data}async function X(){if(c.value||(t.currentExpense.currency_id=U.selectedCompanyCurrency.id,t.currentExpense.selectedCurrency=U.selectedCompanyCurrency),i.value=!0,await t.fetchPaymentModes({limit:"all"}),c.value){const a=await t.fetchExpense(f.params.id);t.currentExpense.currency_id=t.currentExpense.selectedCurrency.id,a.data&&(!y.editCategory&&a.data.data.expense_category&&(y.editCategory=a.data.data.expense_category),!_.editCustomer&&a.data.data.customer&&(_.editCustomer=a.data.data.customer))}else f.query.customer&&(t.currentExpense.customer_id=f.query.customer);i.value=!1}async function Y(){if(l.value.$touch(),l.value.$invalid)return;g.value=!0;let a=t.currentExpense;try{c.value?await t.updateExpense({id:f.params.id,data:a,isAttachmentReceiptRemoved:I.value}):await t.addExpense(a),g.value=!1,t.currentExpense.attachment_receipt=null,I.value=!1,T.push("/admin/expenses")}catch(n){console.error(n),g.value=!1;return}}return Ee(()=>{t.resetCurrentExpenseData(),_.editCustomer=null,y.editCategory=null}),(a,n)=>{const E=d("BaseBreadcrumbItem"),p=d("BaseBreadcrumb"),B=d("BaseIcon"),k=d("BaseButton"),Z=d("BasePageHeader"),ee=d("BaseSelectAction"),V=d("BaseMultiselect"),x=d("BaseInputGroup"),te=d("BaseDatePicker"),ne=d("BaseMoney"),ae=d("BaseTextarea"),re=d("BaseFileUploader"),se=d("BaseInputGrid"),oe=d("BaseCard"),le=d("BasePage");return v(),$e(Ce,null,[r(Se),r(le,{class:"relative"},{default:o(()=>[F("form",{action:"",onSubmit:he(Y,["prevent"])},[r(Z,{title:e(N),class:"mb-5"},{actions:o(()=>[e(c)&&e(t).currentExpense.attachment_receipt_url?(v(),h(k,{key:0,href:e(H),tag:"a",variant:"primary-outline",type:"button",class:"mr-2"},{left:o(s=>[r(B,{name:"DownloadIcon",class:D(s.class)},null,8,["class"])]),default:o(()=>[w(" "+S(a.$t("expenses.download_receipt")),1)]),_:1},8,["href"])):C("",!0),F("div",ke,[r(k,{loading:e(g),"content-loading":e(i),disabled:e(g),variant:"primary",type:"submit"},{left:o(s=>[e(g)?C("",!0):(v(),h(B,{key:0,name:"SaveIcon",class:D(s.class)},null,8,["class"]))]),default:o(()=>[w(" "+S(e(c)?a.$t("expenses.update_expense"):a.$t("expenses.save_expense")),1)]),_:1},8,["loading","content-loading","disabled"])])]),default:o(()=>[r(p,null,{default:o(()=>[r(E,{title:a.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r(E,{title:a.$tc("expenses.expense",2),to:"/admin/expenses"},null,8,["title"]),r(E,{title:e(N),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(oe,null,{default:o(()=>[r(se,null,{default:o(()=>[r(x,{label:a.$t("expenses.category"),error:e(l).currentExpense.expense_category_id.$error&&e(l).currentExpense.expense_category_id.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[e(i)?C("",!0):(v(),h(V,{key:0,modelValue:e(t).currentExpense.expense_category_id,"onUpdate:modelValue":n[0]||(n[0]=s=>e(t).currentExpense.expense_category_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:Q,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",invalid:e(l).currentExpense.expense_category_id.$error,placeholder:a.$t("expenses.categories.select_a_category"),onInput:n[1]||(n[1]=s=>e(l).currentExpense.expense_category_id.$touch())},{action:o(()=>[r(ee,{onClick:J},{default:o(()=>[r(B,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),w(" "+S(a.$t("settings.expense_category.add_new_category")),1)]),_:1})]),_:1},8,["modelValue","content-loading","invalid","placeholder"]))]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.expense_date"),error:e(l).currentExpense.expense_date.$error&&e(l).currentExpense.expense_date.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(te,{modelValue:e(t).currentExpense.expense_date,"onUpdate:modelValue":n[2]||(n[2]=s=>e(t).currentExpense.expense_date=s),"content-loading":e(i),"calendar-button":!0,invalid:e(l).currentExpense.expense_date.$error,onInput:n[3]||(n[3]=s=>e(l).currentExpense.expense_date.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.amount"),error:e(l).currentExpense.amount.$error&&e(l).currentExpense.amount.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(ne,{key:e(t).currentExpense.selectedCurrency,modelValue:e(M),"onUpdate:modelValue":n[4]||(n[4]=s=>be(M)?M.value=s:null),class:"focus:border focus:border-solid focus:border-primary-500",invalid:e(l).currentExpense.amount.$error,currency:e(t).currentExpense.selectedCurrency,onInput:n[5]||(n[5]=s=>e(l).currentExpense.amount.$touch())},null,8,["modelValue","invalid","currency"])]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.currency"),"content-loading":e(i),error:e(l).currentExpense.currency_id.$error&&e(l).currentExpense.currency_id.$errors[0].$message,required:""},{default:o(()=>[r(V,{modelValue:e(t).currentExpense.currency_id,"onUpdate:modelValue":[n[6]||(n[6]=s=>e(t).currentExpense.currency_id=s),K],"value-prop":"id",label:"name","track-by":"name","content-loading":e(i),options:e(R).currencies,searchable:"","can-deselect":!1,placeholder:a.$t("customers.select_currency"),invalid:e(l).currentExpense.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(Ie,{store:e(t),"store-prop":"currentExpense",v:e(l).currentExpense,"is-loading":e(i),"is-edit":e(c),"customer-currency":e(t).currentExpense.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"]),r(x,{"content-loading":e(i),label:a.$t("expenses.customer")},{default:o(()=>[e(i)?C("",!0):(v(),h(V,{key:0,modelValue:e(t).currentExpense.customer_id,"onUpdate:modelValue":n[7]||(n[7]=s=>e(t).currentExpense.customer_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:W,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",placeholder:a.$t("customers.select_a_customer")},null,8,["modelValue","content-loading","placeholder"]))]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:a.$t("payments.payment_mode")},{default:o(()=>[r(V,{modelValue:e(t).currentExpense.payment_method_id,"onUpdate:modelValue":n[8]||(n[8]=s=>e(t).currentExpense.payment_method_id=s),"content-loading":e(i),label:"name","value-prop":"id","track-by":"name",options:e(t).paymentModes,placeholder:a.$t("payments.select_payment_mode"),searchable:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:a.$t("expenses.note"),error:e(l).currentExpense.notes.$error&&e(l).currentExpense.notes.$errors[0].$message},{default:o(()=>[r(ae,{modelValue:e(t).currentExpense.notes,"onUpdate:modelValue":n[9]||(n[9]=s=>e(t).currentExpense.notes=s),"content-loading":e(i),row:4,rows:"4",onInput:n[10]||(n[10]=s=>e(l).currentExpense.notes.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label","error"]),r(x,{label:a.$t("expenses.receipt")},{default:o(()=>[r(re,{modelValue:e(t).currentExpense.receiptFiles,"onUpdate:modelValue":n[11]||(n[11]=s=>e(t).currentExpense.receiptFiles=s),accept:"image/*,.doc,.docx,.pdf,.csv,.xlsx,.xls",onChange:z,onRemove:O},null,8,["modelValue"])]),_:1},8,["label"]),r(we,{"is-edit":e(c),class:"col-span-2","is-loading":e(i),type:"Expense",store:e(t),"store-prop":"currentExpense","custom-field-scope":P},null,8,["is-edit","is-loading","store"]),F("div",qe,[r(k,{loading:e(g),tabindex:6,variant:"primary",type:"submit",class:"flex justify-center w-full"},{left:o(s=>[e(g)?C("",!0):(v(),h(B,{key:0,name:"SaveIcon",class:D(s.class)},null,8,["class"]))]),default:o(()=>[w(" "+S(e(c)?a.$t("expenses.update_expense"):a.$t("expenses.save_expense")),1)]),_:1},8,["loading"])])]),_:1})]),_:1})],40,Me)]),_:1})],64)}}};export{Te as default}; diff --git a/public/build/assets/Create-W4ThzIMu.js b/public/build/assets/Create-W4ThzIMu.js new file mode 100644 index 00000000..a6e1dbd4 --- /dev/null +++ b/public/build/assets/Create-W4ThzIMu.js @@ -0,0 +1 @@ +import{ar as Z,as as ee,D as te,C as ne,e as ae,J as oe,f as se,K as le,g as y,l as c,h as V,i as re,G as ie,af as me,k as ue,O as ce,r as s,o as h,n as S,w as l,a as o,m as e,b as C,p as U,q as k,t as P,I as N,H as de,s as pe}from"./main-vzIkKseS.js";import{_ as _e}from"./ItemUnitModal-BC4Fg9D4.js";const ge=["onSubmit"],Be={setup(Ie){const n=Z(),T=ee(),v=te(),q=ne(),{t:d}=ae(),B=oe(),E=se(),G=le(),_=y(!1),b=y(q.selectedCompanySettings.tax_per_item);let r=y(!1);n.$reset(),H();const I=c({get:()=>n.currentItem.price/100,set:t=>{n.currentItem.price=Math.round(t*100)}}),$=c({get:()=>{var t,a;return(a=(t=n==null?void 0:n.currentItem)==null?void 0:t.taxes)==null?void 0:a.map(u=>{if(u)return{...u,tax_type_id:u.id,tax_name:u.name+" ("+u.percent+"%)"}})},set:t=>{n.currentItem.taxes=t}}),f=c(()=>B.name==="items.edit"),w=c(()=>f.value?d("items.edit_item"):d("items.new_item")),z=c(()=>T.taxTypes.map(t=>({...t,tax_type_id:t.id,tax_name:t.name+" ("+t.percent+"%)"}))),A=c(()=>b.value==="YES"),D=c(()=>({currentItem:{name:{required:V.withMessage(d("validation.required"),re),minLength:V.withMessage(d("validation.name_min_length",{count:3}),ie(3))},description:{maxLength:V.withMessage(d("validation.description_maxlength"),me(65e3))}}})),m=ue(D,n);async function L(){v.openModal({title:d("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",size:"sm"})}async function H(){if(r.value=!0,await n.fetchItemUnits({limit:"all"}),G.hasAbilities(ce.VIEW_TAX_TYPE)&&await T.fetchTaxTypes({limit:"all"}),f.value){let t=B.params.id;await n.fetchItem(t),n.currentItem.tax_per_item===1?b.value="YES":b.value="NO"}r.value=!1}async function R(){if(m.value.currentItem.$touch(),m.value.currentItem.$invalid)return!1;_.value=!0;try{let a={id:B.params.id,...n.currentItem};n.currentItem&&n.currentItem.taxes&&(a.taxes=n.currentItem.taxes.map(p=>({tax_type_id:p.tax_type_id,amount:I.value*p.percent,percent:p.percent,name:p.name,collective_tax:0}))),await(f.value?n.updateItem:n.addItem)(a),_.value=!1,E.push("/admin/items"),t()}catch{_.value=!1;return}function t(){v.closeModal(),setTimeout(()=>{n.resetCurrentItem(),v.$reset(),m.value.$reset()},300)}}return(t,a)=>{const u=s("BaseBreadcrumbItem"),p=s("BaseBreadcrumb"),Y=s("BasePageHeader"),O=s("BaseInput"),g=s("BaseInputGroup"),j=s("BaseMoney"),x=s("BaseIcon"),F=s("BaseSelectAction"),M=s("BaseMultiselect"),J=s("BaseTextarea"),K=s("BaseButton"),W=s("BaseInputGrid"),X=s("BaseCard"),Q=s("BasePage");return h(),S(Q,null,{default:l(()=>[o(Y,{title:e(w)},{default:l(()=>[o(p,null,{default:l(()=>[o(u,{title:t.$t("general.home"),to:"dashboard"},null,8,["title"]),o(u,{title:t.$tc("items.item",2),to:"/admin/items"},null,8,["title"]),o(u,{title:e(w),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(_e),C("form",{class:"grid lg:grid-cols-2 mt-6",action:"submit",onSubmit:pe(R,["prevent"])},[o(X,{class:"w-full"},{default:l(()=>[o(W,{layout:"one-column"},{default:l(()=>[o(g,{label:t.$t("items.name"),"content-loading":e(r),required:"",error:e(m).currentItem.name.$error&&e(m).currentItem.name.$errors[0].$message},{default:l(()=>[o(O,{modelValue:e(n).currentItem.name,"onUpdate:modelValue":a[0]||(a[0]=i=>e(n).currentItem.name=i),"content-loading":e(r),invalid:e(m).currentItem.name.$error,onInput:a[1]||(a[1]=i=>e(m).currentItem.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),o(g,{label:t.$t("items.price"),"content-loading":e(r)},{default:l(()=>[o(j,{modelValue:e(I),"onUpdate:modelValue":a[2]||(a[2]=i=>U(I)?I.value=i:null),"content-loading":e(r)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(g,{"content-loading":e(r),label:t.$t("items.unit")},{default:l(()=>[o(M,{modelValue:e(n).currentItem.unit_id,"onUpdate:modelValue":a[3]||(a[3]=i=>e(n).currentItem.unit_id=i),"content-loading":e(r),label:"name",options:e(n).itemUnits,"value-prop":"id",placeholder:t.$t("items.select_a_unit"),searchable:"","track-by":"name"},{action:l(()=>[o(F,{onClick:L},{default:l(()=>[o(x,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),k(" "+P(t.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),e(A)?(h(),S(g,{key:0,label:t.$t("items.taxes"),"content-loading":e(r)},{default:l(()=>[o(M,{modelValue:e($),"onUpdate:modelValue":a[4]||(a[4]=i=>U($)?$.value=i:null),"content-loading":e(r),options:e(z),mode:"tags",label:"tax_name",class:"w-full","value-prop":"id","can-deselect":!1,"can-clear":!1,searchable:"","track-by":"tax_name",object:""},null,8,["modelValue","content-loading","options"])]),_:1},8,["label","content-loading"])):N("",!0),o(g,{label:t.$t("items.description"),"content-loading":e(r),error:e(m).currentItem.description.$error&&e(m).currentItem.description.$errors[0].$message},{default:l(()=>[o(J,{modelValue:e(n).currentItem.description,"onUpdate:modelValue":a[5]||(a[5]=i=>e(n).currentItem.description=i),"content-loading":e(r),name:"description",row:2,rows:"2",onInput:a[6]||(a[6]=i=>e(m).currentItem.description.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading","error"]),C("div",null,[o(K,{"content-loading":e(r),type:"submit",loading:_.value},{left:l(i=>[_.value?N("",!0):(h(),S(x,{key:0,name:"SaveIcon",class:de(i.class)},null,8,["class"]))]),default:l(()=>[k(" "+P(e(f)?t.$t("items.update_item"):t.$t("items.save_item")),1)]),_:1},8,["content-loading","loading"])])]),_:1})]),_:1})],40,ge)]),_:1})}}};export{Be as default}; diff --git a/public/build/assets/Create-ay9iZL5d.js b/public/build/assets/Create-ay9iZL5d.js new file mode 100644 index 00000000..0ce09ee8 --- /dev/null +++ b/public/build/assets/Create-ay9iZL5d.js @@ -0,0 +1 @@ +import{J as le,f as ue,u as me,a6 as ie,ac as ce,C as de,D as ye,ao as pe,E as _e,a3 as ve,e as fe,g as S,F as Pe,l as I,h as $,i as w,aI as ge,ad as be,V as Be,k as $e,al as he,aB as Ie,r as u,o as M,c as Ce,a as r,w as s,b as h,m as e,n as k,H as G,I as N,q,t as P,p as Ve,s as Se,L as we}from"./main-vzIkKseS.js";import{_ as Me}from"./ExchangeRateConverter-ZwwFqeKM.js";import{u as qe}from"./payment-ALr-TD5m.js";import{_ as ke}from"./SelectNotePopup-DKlwyGyu.js";import{_ as Ne}from"./CreateCustomFields-hHeYNhLY.js";import{_ as Ue}from"./PaymentModeModal-OW7LJo93.js";import"./exchange-rate--sifpuzz.js";import"./NoteModal-rdu-Hccj.js";import"./dynamic-import-helper-0gtGTknh.js";const De=["onSubmit"],Ae={class:"absolute left-3.5"},Ee={class:"relative w-full"},Fe={class:"relative mt-6"},xe={class:"z-20 float-right text-sm font-semibold leading-5 text-primary-400"},Ge={class:"mb-4 text-sm font-medium text-gray-800"},We={setup(Le){const i=le(),L=ue(),t=qe();me();const C=ie();ce(),de();const R=ye(),U=pe();_e();const D=ve("utils"),{t:y}=fe();let g=S(!1),V=S(!1),p=S([]);const _=S(null),A="newEstimate",H=Pe(["customer","company","customerCustom","payment","paymentCustom"]),b=I({get:()=>t.currentPayment.amount/100,set:a=>{t.currentPayment.amount=Math.round(a*100)}}),l=I(()=>t.isFetchingInitialData),c=I(()=>i.name==="payments.edit"),E=I(()=>c.value?y("payments.edit_payment"):y("payments.new_payment")),j=I(()=>({currentPayment:{customer_id:{required:$.withMessage(y("validation.required"),w)},payment_date:{required:$.withMessage(y("validation.required"),w)},amount:{required:$.withMessage(y("validation.required"),w),between:$.withMessage(y("validation.payment_greater_than_due_amount"),ge(0,t.currentPayment.maxPayableAmount))},exchange_rate:{required:be(function(){return $.withMessage(y("validation.required"),w),t.showExchangeRate}),decimal:$.withMessage(y("validation.valid_exchange_rate"),Be)}}})),m=$e(j,t,{$scope:A});he(()=>{t.currentPayment.customer_id&&O(t.currentPayment.customer_id),i.query.customer&&(t.currentPayment.customer_id=i.query.customer)}),t.resetCurrentPayment(),i.query.customer&&(t.currentPayment.customer_id=i.query.customer),t.fetchPaymentInitialData(c.value),i.params.id&&!c.value&&J();async function z(){R.openModal({title:y("settings.payment_modes.add_payment_mode"),componentName:"PaymentModeModal"})}function T(a){t.currentPayment.notes=""+a.notes}async function J(){var n;let a=await U.fetchInvoice((n=i==null?void 0:i.params)==null?void 0:n.id);t.currentPayment.customer_id=a.data.data.customer.id,t.currentPayment.invoice_id=a.data.data.id}async function K(a){a&&(_.value=p.value.find(n=>n.id===a),b.value=_.value.due_amount/100,t.currentPayment.maxPayableAmount=_.value.due_amount)}function O(a){if(a){let n={customer_id:a,status:"DUE",limit:"all"};c.value&&(n.status=""),V.value=!0,Promise.all([U.fetchInvoices(n),C.fetchCustomer(a)]).then(async([d,v])=>{d&&(p.value=[...d.data.data]),v&&v.data&&(t.currentPayment.selectedCustomer=v.data.data,t.currentPayment.customer=v.data.data,t.currentPayment.currency=v.data.data.currency,c.value&&!C.editCustomer&&t.currentPayment.customer_id&&(C.editCustomer=v.data.data)),t.currentPayment.invoice_id&&(_.value=p.value.find(f=>f.id===t.currentPayment.invoice_id),t.currentPayment.maxPayableAmount=_.value.due_amount+t.currentPayment.amount,b.value===0&&(b.value=_.value.due_amount/100)),c.value&&(p.value=p.value.filter(f=>f.due_amount>0||f.id==t.currentPayment.invoice_id)),V.value=!1}).catch(d=>{V.value=!1,console.error(d,"error")})}}Ie(()=>{t.resetCurrentPayment(),p.value=[],C.editCustomer=null});async function Q(){if(m.value.$touch(),m.value.$invalid)return!1;g.value=!0;let a={...t.currentPayment},n=null;try{n=await(c.value?t.updatePayment:t.addPayment)(a),L.push(`/admin/payments/${n.data.data.id}/view`)}catch{g.value=!1}}function W(a){let n={userId:a};i.params.id&&(n.model_id=i.params.id),t.currentPayment.invoice_id=_.value=null,t.currentPayment.amount=0,p.value=[],t.getNextNumber(n,!0)}return(a,n)=>{const d=u("BaseBreadcrumbItem"),v=u("BaseBreadcrumb"),f=u("BaseIcon"),F=u("BaseButton"),X=u("BasePageHeader"),Y=u("BaseDatePicker"),B=u("BaseInputGroup"),Z=u("BaseInput"),ee=u("BaseCustomerSelectInput"),x=u("BaseMultiselect"),te=u("BaseMoney"),ae=u("BaseSelectAction"),ne=u("BaseInputGrid"),oe=u("BaseCustomInput"),re=u("BaseCard"),se=u("BasePage");return M(),Ce(we,null,[r(Ue),r(se,{class:"relative payment-create"},{default:s(()=>[h("form",{action:"",onSubmit:Se(Q,["prevent"])},[r(X,{title:e(E),class:"mb-5"},{actions:s(()=>[r(F,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"hidden sm:flex"},{left:s(o=>[e(g)?N("",!0):(M(),k(f,{key:0,name:"SaveIcon",class:G(o.class)},null,8,["class"]))]),default:s(()=>[q(" "+P(e(c)?a.$t("payments.update_payment"):a.$t("payments.save_payment")),1)]),_:1},8,["loading","disabled"])]),default:s(()=>[r(v,null,{default:s(()=>[r(d,{title:a.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r(d,{title:a.$tc("payments.payment",2),to:"/admin/payments"},null,8,["title"]),r(d,{title:e(E),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(re,null,{default:s(()=>[r(ne,null,{default:s(()=>[r(B,{label:a.$t("payments.date"),"content-loading":e(l),required:"",error:e(m).currentPayment.payment_date.$error&&e(m).currentPayment.payment_date.$errors[0].$message},{default:s(()=>[r(Y,{modelValue:e(t).currentPayment.payment_date,"onUpdate:modelValue":[n[0]||(n[0]=o=>e(t).currentPayment.payment_date=o),n[1]||(n[1]=o=>e(m).currentPayment.payment_date.$touch())],"content-loading":e(l),"calendar-button":!0,"calendar-button-icon":"calendar",invalid:e(m).currentPayment.payment_date.$error},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),r(B,{label:a.$t("payments.payment_number"),"content-loading":e(l),required:""},{default:s(()=>[r(Z,{modelValue:e(t).currentPayment.payment_number,"onUpdate:modelValue":n[2]||(n[2]=o=>e(t).currentPayment.payment_number=o),"content-loading":e(l)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(B,{label:a.$t("payments.customer"),error:e(m).currentPayment.customer_id.$error&&e(m).currentPayment.customer_id.$errors[0].$message,"content-loading":e(l),required:""},{default:s(()=>[e(l)?N("",!0):(M(),k(ee,{key:0,modelValue:e(t).currentPayment.customer_id,"onUpdate:modelValue":[n[3]||(n[3]=o=>e(t).currentPayment.customer_id=o),n[4]||(n[4]=o=>W(e(t).currentPayment.customer_id))],"content-loading":e(l),invalid:e(m).currentPayment.customer_id.$error,placeholder:a.$t("customers.select_a_customer"),"show-action":""},null,8,["modelValue","content-loading","invalid","placeholder"]))]),_:1},8,["label","error","content-loading"]),r(B,{"content-loading":e(l),label:a.$t("payments.invoice"),"help-text":_.value?`Due Amount: ${e(t).currentPayment.maxPayableAmount/100}`:""},{default:s(()=>[r(x,{modelValue:e(t).currentPayment.invoice_id,"onUpdate:modelValue":n[5]||(n[5]=o=>e(t).currentPayment.invoice_id=o),"content-loading":e(l),"value-prop":"id","track-by":"invoice_number",label:"invoice_number",options:e(p),loading:e(V),placeholder:a.$t("invoices.select_invoice"),onSelect:K},{singlelabel:s(({value:o})=>[h("div",Ae,P(o.invoice_number)+" ("+P(e(D).formatMoney(o.total,o.customer.currency))+") ",1)]),option:s(({option:o})=>[q(P(o.invoice_number)+" ("+P(e(D).formatMoney(o.total,o.customer.currency))+") ",1)]),_:1},8,["modelValue","content-loading","options","loading","placeholder"])]),_:1},8,["content-loading","label","help-text"]),r(B,{label:a.$t("payments.amount"),"content-loading":e(l),error:e(m).currentPayment.amount.$error&&e(m).currentPayment.amount.$errors[0].$message,required:""},{default:s(()=>[h("div",Ee,[r(te,{key:e(t).currentPayment.currency,modelValue:e(b),"onUpdate:modelValue":[n[6]||(n[6]=o=>Ve(b)?b.value=o:null),n[7]||(n[7]=o=>e(m).currentPayment.amount.$touch())],currency:e(t).currentPayment.currency,"content-loading":e(l),invalid:e(m).currentPayment.amount.$error},null,8,["modelValue","currency","content-loading","invalid"])])]),_:1},8,["label","content-loading","error"]),r(B,{"content-loading":e(l),label:a.$t("payments.payment_mode")},{default:s(()=>[r(x,{modelValue:e(t).currentPayment.payment_method_id,"onUpdate:modelValue":n[8]||(n[8]=o=>e(t).currentPayment.payment_method_id=o),"content-loading":e(l),label:"name","value-prop":"id","track-by":"name",options:e(t).paymentModes,placeholder:a.$t("payments.select_payment_mode"),searchable:""},{action:s(()=>[r(ae,{onClick:z},{default:s(()=>[r(f,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),q(" "+P(a.$t("settings.payment_modes.add_payment_mode")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(Me,{store:e(t),"store-prop":"currentPayment",v:e(m).currentPayment,"is-loading":e(l),"is-edit":e(c),"customer-currency":e(t).currentPayment.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"])]),_:1}),r(Ne,{type:"Payment","is-edit":e(c),"is-loading":e(l),store:e(t),"store-prop":"currentPayment","custom-field-scope":A,class:"mt-6"},null,8,["is-edit","is-loading","store"]),h("div",Fe,[h("div",xe,[r(ke,{type:"Payment",onSelect:T})]),h("label",Ge,P(a.$t("estimates.notes")),1),r(oe,{modelValue:e(t).currentPayment.notes,"onUpdate:modelValue":n[9]||(n[9]=o=>e(t).currentPayment.notes=o),"content-loading":e(l),fields:e(H),class:"mt-1"},null,8,["modelValue","content-loading","fields"])]),r(F,{loading:e(g),"content-loading":e(l),variant:"primary",type:"submit",class:"flex justify-center w-full mt-4 sm:hidden md:hidden"},{left:s(o=>[e(g)?N("",!0):(M(),k(f,{key:0,name:"SaveIcon",class:G(o.class)},null,8,["class"]))]),default:s(()=>[q(" "+P(e(c)?a.$t("payments.update_payment"):a.$t("payments.save_payment")),1)]),_:1},8,["loading","content-loading"])]),_:1})],40,De)]),_:1})],64)}}};export{We as default}; diff --git a/public/build/assets/Create-htsQOe0Y.js b/public/build/assets/Create-htsQOe0Y.js new file mode 100644 index 00000000..dbeb725b --- /dev/null +++ b/public/build/assets/Create-htsQOe0Y.js @@ -0,0 +1 @@ +import{e as A,J,f as K,C as O,g as w,l as b,h as c,i as v,G as C,j as Q,ad as W,k as X,r as i,o as B,n as V,w as u,a as o,m as e,b as h,c as Y,M as Z,L as x,H as ee,I as ae,q as te,t as oe,s as se}from"./main-vzIkKseS.js";import{V as ne}from"./index.esm-Ea-ZFYlS.js";import{u as re}from"./users-8F9xl7d2.js";const le=["onSubmit"],ue={class:"grid grid-cols-12"},ie={class:"space-y-6"},ge={setup(de){const t=re(),{t:d}=A(),q=J(),S=K(),k=O();let p=w(!1),r=w(!1);w([]);let y=w([]);const g=b(()=>q.name==="users.edit"),I=b(()=>g.value?d("users.edit_user"):d("users.new_user")),G=b(()=>({userData:{name:{required:c.withMessage(d("validation.required"),v),minLength:c.withMessage(d("validation.name_min_length",{count:3}),C(3))},email:{required:c.withMessage(d("validation.required"),v),email:c.withMessage(d("validation.email_incorrect"),Q)},password:{required:W(function(){return c.withMessage(d("validation.required"),v),!g.value}),minLength:c.withMessage(d("validation.password_min_length",{count:8}),C(8))},companies:{required:c.withMessage(d("validation.required"),v)}}})),L={role:{required:c.withMessage(d("validation.required"),v)}},s=X(G,t,{$scope:!0});N(),t.resetUserData();async function N(){var l;r.value=!0;try{g.value&&await t.fetchUser(q.params.id);let a=await k.fetchUserCompanies();(l=a==null?void 0:a.data)!=null&&l.data&&(y.value=a.data.data.map(m=>(m.role=null,m)))}catch{r.value=!1}r.value=!1}async function P(){if(s.value.$touch(),s.value.$invalid)return!0;try{p.value=!0;let l={...t.userData,companies:t.userData.companies.map(m=>({role:m.role,id:m.id}))};await(g.value?t.updateUser:t.addUser)(l),S.push("/admin/users"),p.value=!1}catch{p.value=!1}}return(l,a)=>{const m=i("BaseBreadcrumbItem"),E=i("BaseBreadcrumb"),H=i("BasePageHeader"),$=i("BaseInput"),f=i("BaseInputGroup"),M=i("BaseMultiselect"),R=i("BaseInputGrid"),j=i("BaseIcon"),F=i("BaseButton"),T=i("BaseCard"),z=i("BasePage");return B(),V(z,null,{default:u(()=>[o(H,{title:e(I)},{default:u(()=>[o(E,null,{default:u(()=>[o(m,{title:l.$t("general.home"),to:"dashboard"},null,8,["title"]),o(m,{title:l.$tc("users.user",2),to:"/admin/users"},null,8,["title"]),o(m,{title:e(I),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),h("form",{action:"",autocomplete:"off",onSubmit:se(P,["prevent"])},[h("div",ue,[o(T,{class:"mt-6 col-span-12 md:col-span-8"},{default:u(()=>[o(R,{layout:"one-column"},{default:u(()=>[o(f,{"content-loading":e(r),label:l.$t("users.name"),error:e(s).userData.name.$error&&e(s).userData.name.$errors[0].$message,required:""},{default:u(()=>[o($,{modelValue:e(t).userData.name,"onUpdate:modelValue":a[0]||(a[0]=n=>e(t).userData.name=n),modelModifiers:{trim:!0},"content-loading":e(r),invalid:e(s).userData.name.$error,onInput:a[1]||(a[1]=n=>e(s).userData.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),o(f,{"content-loading":e(r),label:l.$t("users.email"),error:e(s).userData.email.$error&&e(s).userData.email.$errors[0].$message,required:""},{default:u(()=>[o($,{modelValue:e(t).userData.email,"onUpdate:modelValue":a[2]||(a[2]=n=>e(t).userData.email=n),modelModifiers:{trim:!0},type:"email","content-loading":e(r),invalid:e(s).userData.email.$error,onInput:a[3]||(a[3]=n=>e(s).userData.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),o(f,{"content-loading":e(r),label:l.$t("users.companies"),error:e(s).userData.companies.$error&&e(s).userData.companies.$errors[0].$message,required:""},{default:u(()=>[o(M,{modelValue:e(t).userData.companies,"onUpdate:modelValue":a[4]||(a[4]=n=>e(t).userData.companies=n),mode:"tags",object:!0,autocomplete:"new-password",label:"name",options:e(y),"value-prop":"id",invalid:e(s).userData.companies.$error,"content-loading":e(r),searchable:"","can-deselect":!1,class:"w-full","track-by":"name"},null,8,["modelValue","options","invalid","content-loading"])]),_:1},8,["content-loading","label","error"]),(B(!0),Y(x,null,Z(e(t).userData.companies,(n,D)=>(B(),V(e(ne),{key:D,state:n,rules:L},{default:u(({v:_})=>[h("div",ie,[o(f,{"content-loading":e(r),label:l.$t("users.select_company_role",{company:n.name}),error:_.role.$error&&_.role.$errors[0].$message,required:""},{default:u(()=>[o(M,{modelValue:e(t).userData.companies[D].role,"onUpdate:modelValue":U=>e(t).userData.companies[D].role=U,"value-prop":"name","track-by":"id",autocomplete:"off","content-loading":e(r),label:"name",options:e(t).userData.companies[D].roles,"can-deselect":!1,invalid:_.role.$invalid,onChange:U=>_.role.$touch()},null,8,["modelValue","onUpdate:modelValue","content-loading","options","invalid","onChange"])]),_:2},1032,["content-loading","label","error"])])]),_:2},1032,["state"]))),128)),o(f,{"content-loading":e(r),label:l.$tc("users.password"),error:e(s).userData.password.$error&&e(s).userData.password.$errors[0].$message,required:!e(g)},{default:u(()=>[o($,{modelValue:e(t).userData.password,"onUpdate:modelValue":a[5]||(a[5]=n=>e(t).userData.password=n),name:"new-password",autocomplete:"new-password","content-loading":e(r),type:"password",invalid:e(s).userData.password.$error,onInput:a[6]||(a[6]=n=>e(s).userData.password.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error","required"]),o(f,{"content-loading":e(r),label:l.$t("users.phone")},{default:u(()=>[o($,{modelValue:e(t).userData.phone,"onUpdate:modelValue":a[7]||(a[7]=n=>e(t).userData.phone=n),modelModifiers:{trim:!0},"content-loading":e(r)},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"])]),_:1}),o(F,{"content-loading":e(r),type:"submit",loading:e(p),disabled:e(p),class:"mt-6"},{left:u(n=>[e(p)?ae("",!0):(B(),V(j,{key:0,name:"SaveIcon",class:ee(n.class)},null,8,["class"]))]),default:u(()=>[te(" "+oe(e(g)?l.$t("users.update_user"):l.$t("users.save_user")),1)]),_:1},8,["content-loading","loading","disabled"])]),_:1})])],40,le)]),_:1})}}};export{ge as default}; diff --git a/public/build/assets/Create-iSgr_dU6.js b/public/build/assets/Create-iSgr_dU6.js new file mode 100644 index 00000000..43549682 --- /dev/null +++ b/public/build/assets/Create-iSgr_dU6.js @@ -0,0 +1 @@ +import{a6 as oe,ac as re,E as se,C as le,e as ae,f as ie,J as ue,g as w,l as h,h as g,i as G,G as L,ad as j,j as de,Z as me,ae as ce,af as k,k as pe,r as p,o as f,n as _,w as i,b as m,a as r,H as N,q as T,t as $,m as e,ag as ge,I as y,p as S,c as A,s as be}from"./main-vzIkKseS.js";import{_ as Ce}from"./CreateCustomFields-hHeYNhLY.js";import"./dynamic-import-helper-0gtGTknh.js";const fe=["onSubmit"],_e={class:"flex items-center justify-end"},$e={class:"grid grid-cols-5 gap-4 mb-8"},ye={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},ve={class:"grid grid-cols-5 gap-4 mb-8"},Ve={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},we={class:"md:col-span-2"},he={class:"text-sm text-gray-500"},Be={class:"grid grid-cols-5 gap-4 mb-8"},Ie={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Me={class:"space-y-6"},xe={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},Ue={class:"p-1"},ke={key:0,class:"grid grid-cols-5 gap-4 mb-8"},Se={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},qe={class:"space-y-6"},ze={class:"grid grid-cols-5 gap-2 mb-8"},Le={key:0,class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Pe={class:"col-span-5 lg:col-span-4"},je={setup(Fe){const n=oe(),P=re(),q=se(),H=le(),F="customFields",{t:c}=ae(),R=ie(),O=ue();let s=w(!1),b=w(!1),C=w(!1);w(!1);const B=w(!1),V=h(()=>O.name==="customers.edit");let J=h(()=>n.isFetchingInitialSettings);const D=h(()=>V.value?c("customers.edit_customer"):c("customers.new_customer")),Z=h(()=>({currentCustomer:{name:{required:g.withMessage(c("validation.required"),G),minLength:g.withMessage(c("validation.name_min_length",{count:3}),L(3))},prefix:{minLength:g.withMessage(c("validation.name_min_length",{count:3}),L(3))},currency_id:{required:g.withMessage(c("validation.required"),G)},email:{required:g.withMessage(c("validation.required"),j(n.currentCustomer.enable_portal==!0)),email:g.withMessage(c("validation.email_incorrect"),de)},password:{required:g.withMessage(c("validation.required"),j(n.currentCustomer.enable_portal==!0&&!n.currentCustomer.password_added)),minLength:g.withMessage(c("validation.password_min_length",{count:8}),L(8))},confirm_password:{sameAsPassword:g.withMessage(c("validation.password_incorrect"),me(n.currentCustomer.password))},website:{url:g.withMessage(c("validation.invalid_url"),ce)},billing:{address_street_1:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),k(255))},address_street_2:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),k(255))}},shipping:{address_street_1:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),k(255))},address_street_2:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),k(255))}}}})),K=h(()=>`${window.location.origin}/${H.selectedCompany.slug}/customer/login`),a=pe(Z,n,{$scope:F});n.resetCurrentCustomer(),n.fetchCustomerInitialSettings(V.value);async function Q(){if(a.value.$touch(),a.value.$invalid)return!0;B.value=!0;let l={...n.currentCustomer},t=null;try{t=await(V.value?n.updateCustomer:n.addCustomer)(l)}catch{B.value=!1;return}R.push(`/admin/customers/${t.data.data.id}/view`)}return(l,t)=>{const I=p("BaseBreadcrumbItem"),W=p("BaseBreadcrumb-item"),X=p("BaseBreadcrumb"),v=p("BaseIcon"),E=p("BaseButton"),Y=p("BasePageHeader"),d=p("BaseInput"),u=p("BaseInputGroup"),z=p("BaseMultiselect"),M=p("BaseInputGrid"),x=p("BaseDivider"),ee=p("BaseSwitch"),U=p("BaseTextarea"),te=p("BaseCard"),ne=p("BasePage");return f(),_(ne,null,{default:i(()=>[m("form",{onSubmit:be(Q,["prevent"])},[r(Y,{title:e(D)},{actions:i(()=>[m("div",_e,[r(E,{type:"submit",loading:B.value,disabled:B.value},{left:i(o=>[r(v,{name:"SaveIcon",class:N(o.class)},null,8,["class"])]),default:i(()=>[T(" "+$(e(V)?l.$t("customers.update_customer"):l.$t("customers.save_customer")),1)]),_:1},8,["loading","disabled"])])]),default:i(()=>[r(X,null,{default:i(()=>[r(I,{title:l.$t("general.home"),to:"dashboard"},null,8,["title"]),r(I,{title:l.$tc("customers.customer",2),to:"/admin/customers"},null,8,["title"]),r(W,{title:e(D),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(te,{class:"mt-5"},{default:i(()=>[m("div",$e,[m("h6",ye,$(l.$t("customers.basic_info")),1),r(M,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{label:l.$t("customers.display_name"),required:"",error:e(a).currentCustomer.name.$error&&e(a).currentCustomer.name.$errors[0].$message,"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.name,"onUpdate:modelValue":t[0]||(t[0]=o=>e(n).currentCustomer.name=o),"content-loading":e(s),type:"text",name:"name",class:"",invalid:e(a).currentCustomer.name.$error,onInput:t[1]||(t[1]=o=>e(a).currentCustomer.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(u,{label:l.$t("customers.primary_contact_name"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.contact_name,"onUpdate:modelValue":t[2]||(t[2]=o=>e(n).currentCustomer.contact_name=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{error:e(a).currentCustomer.email.$error&&e(a).currentCustomer.email.$errors[0].$message,"content-loading":e(s),label:l.$t("customers.email")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.email,"onUpdate:modelValue":t[3]||(t[3]=o=>e(n).currentCustomer.email=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"email",invalid:e(a).currentCustomer.email.$error,onInput:t[4]||(t[4]=o=>e(a).currentCustomer.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["error","content-loading","label"]),r(u,{label:l.$t("customers.phone"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.phone,"onUpdate:modelValue":t[5]||(t[5]=o=>e(n).currentCustomer.phone=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.primary_currency"),"content-loading":e(s),error:e(a).currentCustomer.currency_id.$error&&e(a).currentCustomer.currency_id.$errors[0].$message,required:""},{default:i(()=>[r(z,{modelValue:e(n).currentCustomer.currency_id,"onUpdate:modelValue":t[6]||(t[6]=o=>e(n).currentCustomer.currency_id=o),"value-prop":"id",label:"name","track-by":"name","content-loading":e(s),options:e(q).currencies,searchable:"","can-deselect":!1,placeholder:l.$t("customers.select_currency"),invalid:e(a).currentCustomer.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(u,{error:e(a).currentCustomer.website.$error&&e(a).currentCustomer.website.$errors[0].$message,label:l.$t("customers.website"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.website,"onUpdate:modelValue":t[7]||(t[7]=o=>e(n).currentCustomer.website=o),"content-loading":e(s),type:"url",onInput:t[8]||(t[8]=o=>e(a).currentCustomer.website.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["error","label","content-loading"]),r(u,{label:l.$t("customers.prefix"),error:e(a).currentCustomer.prefix.$error&&e(a).currentCustomer.prefix.$errors[0].$message,"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.prefix,"onUpdate:modelValue":t[9]||(t[9]=o=>e(n).currentCustomer.prefix=o),"content-loading":e(s),type:"text",name:"name",class:"",invalid:e(a).currentCustomer.prefix.$error,onInput:t[10]||(t[10]=o=>e(a).currentCustomer.prefix.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"])]),_:1})]),r(x,{class:"mb-5 md:mb-8"}),m("div",ve,[m("h6",Ve,$(l.$t("customers.portal_access")),1),r(M,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[m("div",we,[m("p",he,$(l.$t("customers.portal_access_text")),1),r(ee,{modelValue:e(n).currentCustomer.enable_portal,"onUpdate:modelValue":t[11]||(t[11]=o=>e(n).currentCustomer.enable_portal=o),class:"mt-1 flex"},null,8,["modelValue"])]),e(n).currentCustomer.enable_portal?(f(),_(u,{key:0,"content-loading":e(s),label:l.$t("customers.portal_access_url"),class:"md:col-span-2","help-text":l.$t("customers.portal_access_url_help")},{default:i(()=>[r(ge,{token:e(K)},null,8,["token"])]),_:1},8,["content-loading","label","help-text"])):y("",!0),e(n).currentCustomer.enable_portal?(f(),_(u,{key:1,"content-loading":e(s),error:e(a).currentCustomer.password.$error&&e(a).currentCustomer.password.$errors[0].$message,label:l.$t("customers.password")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.password,"onUpdate:modelValue":t[14]||(t[14]=o=>e(n).currentCustomer.password=o),modelModifiers:{trim:!0},"content-loading":e(s),type:e(b)?"text":"password",name:"password",invalid:e(a).currentCustomer.password.$error,onInput:t[15]||(t[15]=o=>e(a).currentCustomer.password.$touch())},{right:i(()=>[e(b)?(f(),_(v,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[12]||(t[12]=o=>S(b)?b.value=!e(b):b=!e(b))})):(f(),_(v,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[13]||(t[13]=o=>S(b)?b.value=!e(b):b=!e(b))}))]),_:1},8,["modelValue","content-loading","type","invalid"])]),_:1},8,["content-loading","error","label"])):y("",!0),e(n).currentCustomer.enable_portal?(f(),_(u,{key:2,error:e(a).currentCustomer.confirm_password.$error&&e(a).currentCustomer.confirm_password.$errors[0].$message,"content-loading":e(s),label:"Confirm Password"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.confirm_password,"onUpdate:modelValue":t[18]||(t[18]=o=>e(n).currentCustomer.confirm_password=o),modelModifiers:{trim:!0},"content-loading":e(s),type:e(C)?"text":"password",name:"confirm_password",invalid:e(a).currentCustomer.confirm_password.$error,onInput:t[19]||(t[19]=o=>e(a).currentCustomer.confirm_password.$touch())},{right:i(()=>[e(C)?(f(),_(v,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[16]||(t[16]=o=>S(C)?C.value=!e(C):C=!e(C))})):(f(),_(v,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[17]||(t[17]=o=>S(C)?C.value=!e(C):C=!e(C))}))]),_:1},8,["modelValue","content-loading","type","invalid"])]),_:1},8,["error","content-loading"])):y("",!0)]),_:1})]),r(x,{class:"mb-5 md:mb-8"}),m("div",Be,[m("h6",Ie,$(l.$t("customers.billing_address")),1),e(n).currentCustomer.billing?(f(),_(M,{key:0,class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{label:l.$t("customers.name"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.name,"onUpdate:modelValue":t[20]||(t[20]=o=>e(n).currentCustomer.billing.name=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",class:"w-full",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.country"),"content-loading":e(s)},{default:i(()=>[r(z,{modelValue:e(n).currentCustomer.billing.country_id,"onUpdate:modelValue":t[21]||(t[21]=o=>e(n).currentCustomer.billing.country_id=o),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(s),options:e(q).countries,placeholder:l.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.state"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.state,"onUpdate:modelValue":t[22]||(t[22]=o=>e(n).currentCustomer.billing.state=o),"content-loading":e(s),name:"billing.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{"content-loading":e(s),label:l.$t("customers.city")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.city,"onUpdate:modelValue":t[23]||(t[23]=o=>e(n).currentCustomer.billing.city=o),"content-loading":e(s),name:"billing.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.address"),error:e(a).currentCustomer.billing.address_street_1.$error&&e(a).currentCustomer.billing.address_street_1.$errors[0].$message||e(a).currentCustomer.billing.address_street_2.$error&&e(a).currentCustomer.billing.address_street_2.$errors[0].$message,"content-loading":e(s)},{default:i(()=>[r(U,{modelValue:e(n).currentCustomer.billing.address_street_1,"onUpdate:modelValue":t[24]||(t[24]=o=>e(n).currentCustomer.billing.address_street_1=o),modelModifiers:{trim:!0},"content-loading":e(s),placeholder:l.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3",onInput:t[25]||(t[25]=o=>e(a).currentCustomer.billing.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),r(U,{modelValue:e(n).currentCustomer.billing.address_street_2,"onUpdate:modelValue":t[26]||(t[26]=o=>e(n).currentCustomer.billing.address_street_2=o),modelModifiers:{trim:!0},"content-loading":e(s),placeholder:l.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3",onInput:t[27]||(t[27]=o=>e(a).currentCustomer.billing.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","error","content-loading"]),m("div",Me,[r(u,{"content-loading":e(s),label:l.$t("customers.phone"),class:"text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.phone,"onUpdate:modelValue":t[28]||(t[28]=o=>e(n).currentCustomer.billing.phone=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.zip_code"),"content-loading":e(s),class:"mt-2 text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.zip,"onUpdate:modelValue":t[29]||(t[29]=o=>e(n).currentCustomer.billing.zip=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})):y("",!0)]),r(x,{class:"mb-5 md:mb-8"}),m("div",xe,[m("div",Ue,[r(E,{type:"button","content-loading":e(s),size:"sm",variant:"primary-outline",onClick:t[30]||(t[30]=o=>e(n).copyAddress(!0))},{left:i(o=>[r(v,{name:"DocumentDuplicateIcon",class:N(o.class)},null,8,["class"])]),default:i(()=>[T(" "+$(l.$t("customers.copy_billing_address")),1)]),_:1},8,["content-loading"])])]),e(n).currentCustomer.shipping?(f(),A("div",ke,[m("h6",Se,$(l.$t("customers.shipping_address")),1),r(M,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{"content-loading":e(s),label:l.$t("customers.name")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.name,"onUpdate:modelValue":t[31]||(t[31]=o=>e(n).currentCustomer.shipping.name=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.country"),"content-loading":e(s)},{default:i(()=>[r(z,{modelValue:e(n).currentCustomer.shipping.country_id,"onUpdate:modelValue":t[32]||(t[32]=o=>e(n).currentCustomer.shipping.country_id=o),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(s),options:e(q).countries,placeholder:l.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.state"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.state,"onUpdate:modelValue":t[33]||(t[33]=o=>e(n).currentCustomer.shipping.state=o),"content-loading":e(s),name:"shipping.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{"content-loading":e(s),label:l.$t("customers.city")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.city,"onUpdate:modelValue":t[34]||(t[34]=o=>e(n).currentCustomer.shipping.city=o),"content-loading":e(s),name:"shipping.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.address"),"content-loading":e(s),error:e(a).currentCustomer.shipping.address_street_1.$error&&e(a).currentCustomer.shipping.address_street_1.$errors[0].$message||e(a).currentCustomer.shipping.address_street_2.$error&&e(a).currentCustomer.shipping.address_street_2.$errors[0].$message},{default:i(()=>[r(U,{modelValue:e(n).currentCustomer.shipping.address_street_1,"onUpdate:modelValue":t[35]||(t[35]=o=>e(n).currentCustomer.shipping.address_street_1=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",placeholder:l.$t("general.street_1"),name:"shipping_street1",onInput:t[36]||(t[36]=o=>e(a).currentCustomer.shipping.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),r(U,{modelValue:e(n).currentCustomer.shipping.address_street_2,"onUpdate:modelValue":t[37]||(t[37]=o=>e(n).currentCustomer.shipping.address_street_2=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",placeholder:l.$t("general.street_2"),name:"shipping_street2",class:"mt-3","container-class":"mt-3",onInput:t[38]||(t[38]=o=>e(a).currentCustomer.shipping.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","content-loading","error"]),m("div",qe,[r(u,{"content-loading":e(s),label:l.$t("customers.phone"),class:"text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.phone,"onUpdate:modelValue":t[39]||(t[39]=o=>e(n).currentCustomer.shipping.phone=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.zip_code"),"content-loading":e(s),class:"mt-2 text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.zip,"onUpdate:modelValue":t[40]||(t[40]=o=>e(n).currentCustomer.shipping.zip=o),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})])):y("",!0),e(P).customFields.length>0?(f(),_(x,{key:1,class:"mb-5 md:mb-8"})):y("",!0),m("div",ze,[e(P).customFields.length>0?(f(),A("h6",Le,$(l.$t("settings.custom_fields.title")),1)):y("",!0),m("div",Pe,[r(Ce,{type:"Customer",store:e(n),"store-prop":"currentCustomer","is-edit":e(V),"is-loading":e(J),"custom-field-scope":F},null,8,["store","is-edit","is-loading"])])])]),_:1})],40,fe)]),_:1})}}};export{je as default}; diff --git a/public/build/assets/Create.6a1b616b.js b/public/build/assets/Create.6a1b616b.js deleted file mode 100644 index 2c7ead34..00000000 --- a/public/build/assets/Create.6a1b616b.js +++ /dev/null @@ -1 +0,0 @@ -var ae=Object.defineProperty;var G=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var N=(y,o,b)=>o in y?ae(y,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[o]=b,T=(y,o)=>{for(var b in o||(o={}))ie.call(o,b)&&N(y,b,o[b]);if(G)for(var b of G(o))ue.call(o,b)&&N(y,b,o[b]);return y};import{J as de,aN as me,G as ce,B,k as M,L as g,M as R,N as F,O as A,Q as pe,P as ge,R as be,S as q,T as Ce,r as p,o as _,l as $,w as i,h as m,f as r,m as O,i as H,t as v,u as e,j as V,x as L,e as J,U as fe}from"./vendor.fd3b1727.js";import{l as _e,m as $e,d as ye,b as ve,n as Ve}from"./main.fc26c84f.js";import{_ as we}from"./CreateCustomFields.5609a247.js";const he=["onSubmit"],Be={class:"flex items-center justify-end"},Me={class:"grid grid-cols-5 gap-4 mb-8"},Ie={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},xe={class:"grid grid-cols-5 gap-4 mb-8"},Ue={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},ke={class:"md:col-span-2"},Se={class:"text-sm text-gray-500"},qe={class:"grid grid-cols-5 gap-4 mb-8"},Le={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},ze={class:"space-y-6"},Pe={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},Fe={class:"p-1"},je={key:0,class:"grid grid-cols-5 gap-4 mb-8"},De={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Ee={class:"space-y-6"},Ge={class:"grid grid-cols-5 gap-2 mb-8"},Ne={key:0,class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Te={class:"col-span-5 lg:col-span-4"},Je={setup(y){const o=_e(),b=$e(),z=ye(),Q=ve(),j="customFields",{t:c}=de(),K=me(),W=ce();let s=B(!1),C=B(!1),f=B(!1);B(!1);const I=B(!1),h=M(()=>W.name==="customers.edit");let X=M(()=>o.isFetchingInitialSettings);const D=M(()=>h.value?c("customers.edit_customer"):c("customers.new_customer")),Y=M(()=>({currentCustomer:{name:{required:g.withMessage(c("validation.required"),R),minLength:g.withMessage(c("validation.name_min_length",{count:3}),F(3))},prefix:{minLength:g.withMessage(c("validation.name_min_length",{count:3}),F(3))},currency_id:{required:g.withMessage(c("validation.required"),R)},email:{required:g.withMessage(c("validation.required"),A(o.currentCustomer.enable_portal==!0)),email:g.withMessage(c("validation.email_incorrect"),pe)},password:{required:g.withMessage(c("validation.required"),A(o.currentCustomer.enable_portal==!0&&!o.currentCustomer.password_added)),minLength:g.withMessage(c("validation.password_min_length",{count:8}),F(8))},confirm_password:{sameAsPassword:g.withMessage(c("validation.password_incorrect"),ge(o.currentCustomer.password))},website:{url:g.withMessage(c("validation.invalid_url"),be)},billing:{address_street_1:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),q(255))},address_street_2:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),q(255))}},shipping:{address_street_1:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),q(255))},address_street_2:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),q(255))}}}})),Z=M(()=>`${window.location.origin}/${Q.selectedCompany.slug}/customer/login`),a=Ce(Y,o,{$scope:j});o.resetCurrentCustomer(),o.fetchCustomerInitialSettings(h.value);async function ee(){if(a.value.$touch(),a.value.$invalid)return!0;I.value=!0;let l=T({},o.currentCustomer),t=null;try{t=await(h.value?o.updateCustomer:o.addCustomer)(l)}catch{I.value=!1;return}K.push(`/admin/customers/${t.data.data.id}/view`)}return(l,t)=>{const x=p("BaseBreadcrumbItem"),te=p("BaseBreadcrumb-item"),oe=p("BaseBreadcrumb"),w=p("BaseIcon"),E=p("BaseButton"),ne=p("BasePageHeader"),d=p("BaseInput"),u=p("BaseInputGroup"),P=p("BaseMultiselect"),U=p("BaseInputGrid"),k=p("BaseDivider"),re=p("BaseSwitch"),S=p("BaseTextarea"),se=p("BaseCard"),le=p("BasePage");return _(),$(le,null,{default:i(()=>[m("form",{onSubmit:fe(ee,["prevent"])},[r(ne,{title:e(D)},{actions:i(()=>[m("div",Be,[r(E,{type:"submit",loading:I.value,disabled:I.value},{left:i(n=>[r(w,{name:"SaveIcon",class:O(n.class)},null,8,["class"])]),default:i(()=>[H(" "+v(e(h)?l.$t("customers.update_customer"):l.$t("customers.save_customer")),1)]),_:1},8,["loading","disabled"])])]),default:i(()=>[r(oe,null,{default:i(()=>[r(x,{title:l.$t("general.home"),to:"dashboard"},null,8,["title"]),r(x,{title:l.$tc("customers.customer",2),to:"/admin/customers"},null,8,["title"]),r(te,{title:e(D),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(se,{class:"mt-5"},{default:i(()=>[m("div",Me,[m("h6",Ie,v(l.$t("customers.basic_info")),1),r(U,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{label:l.$t("customers.display_name"),required:"",error:e(a).currentCustomer.name.$error&&e(a).currentCustomer.name.$errors[0].$message,"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.name,"onUpdate:modelValue":t[0]||(t[0]=n=>e(o).currentCustomer.name=n),"content-loading":e(s),type:"text",name:"name",class:"",invalid:e(a).currentCustomer.name.$error,onInput:t[1]||(t[1]=n=>e(a).currentCustomer.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(u,{label:l.$t("customers.primary_contact_name"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.contact_name,"onUpdate:modelValue":t[2]||(t[2]=n=>e(o).currentCustomer.contact_name=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{error:e(a).currentCustomer.email.$error&&e(a).currentCustomer.email.$errors[0].$message,"content-loading":e(s),label:l.$t("customers.email")},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.email,"onUpdate:modelValue":t[3]||(t[3]=n=>e(o).currentCustomer.email=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"email",invalid:e(a).currentCustomer.email.$error,onInput:t[4]||(t[4]=n=>e(a).currentCustomer.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["error","content-loading","label"]),r(u,{label:l.$t("customers.phone"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.phone,"onUpdate:modelValue":t[5]||(t[5]=n=>e(o).currentCustomer.phone=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.primary_currency"),"content-loading":e(s),error:e(a).currentCustomer.currency_id.$error&&e(a).currentCustomer.currency_id.$errors[0].$message,required:""},{default:i(()=>[r(P,{modelValue:e(o).currentCustomer.currency_id,"onUpdate:modelValue":t[6]||(t[6]=n=>e(o).currentCustomer.currency_id=n),"value-prop":"id",label:"name","track-by":"name","content-loading":e(s),options:e(z).currencies,searchable:"","can-deselect":!1,placeholder:l.$t("customers.select_currency"),invalid:e(a).currentCustomer.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(u,{error:e(a).currentCustomer.website.$error&&e(a).currentCustomer.website.$errors[0].$message,label:l.$t("customers.website"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.website,"onUpdate:modelValue":t[7]||(t[7]=n=>e(o).currentCustomer.website=n),"content-loading":e(s),type:"url",onInput:t[8]||(t[8]=n=>e(a).currentCustomer.website.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["error","label","content-loading"]),r(u,{label:l.$t("customers.prefix"),error:e(a).currentCustomer.prefix.$error&&e(a).currentCustomer.prefix.$errors[0].$message,"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.prefix,"onUpdate:modelValue":t[9]||(t[9]=n=>e(o).currentCustomer.prefix=n),"content-loading":e(s),type:"text",name:"name",class:"",invalid:e(a).currentCustomer.prefix.$error,onInput:t[10]||(t[10]=n=>e(a).currentCustomer.prefix.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"])]),_:1})]),r(k,{class:"mb-5 md:mb-8"}),m("div",xe,[m("h6",Ue,v(l.$t("customers.portal_access")),1),r(U,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[m("div",ke,[m("p",Se,v(l.$t("customers.portal_access_text")),1),r(re,{modelValue:e(o).currentCustomer.enable_portal,"onUpdate:modelValue":t[11]||(t[11]=n=>e(o).currentCustomer.enable_portal=n),class:"mt-1 flex"},null,8,["modelValue"])]),e(o).currentCustomer.enable_portal?(_(),$(u,{key:0,"content-loading":e(s),label:l.$t("customers.portal_access_url"),class:"md:col-span-2","help-text":l.$t("customers.portal_access_url_help")},{default:i(()=>[r(Ve,{token:e(Z)},null,8,["token"])]),_:1},8,["content-loading","label","help-text"])):V("",!0),e(o).currentCustomer.enable_portal?(_(),$(u,{key:1,"content-loading":e(s),error:e(a).currentCustomer.password.$error&&e(a).currentCustomer.password.$errors[0].$message,label:l.$t("customers.password")},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.password,"onUpdate:modelValue":t[14]||(t[14]=n=>e(o).currentCustomer.password=n),modelModifiers:{trim:!0},"content-loading":e(s),type:e(C)?"text":"password",name:"password",invalid:e(a).currentCustomer.password.$error,onInput:t[15]||(t[15]=n=>e(a).currentCustomer.password.$touch())},{right:i(()=>[e(C)?(_(),$(w,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[12]||(t[12]=n=>L(C)?C.value=!e(C):C=!e(C))})):(_(),$(w,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[13]||(t[13]=n=>L(C)?C.value=!e(C):C=!e(C))}))]),_:1},8,["modelValue","content-loading","type","invalid"])]),_:1},8,["content-loading","error","label"])):V("",!0),e(o).currentCustomer.enable_portal?(_(),$(u,{key:2,error:e(a).currentCustomer.confirm_password.$error&&e(a).currentCustomer.confirm_password.$errors[0].$message,"content-loading":e(s),label:"Confirm Password"},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.confirm_password,"onUpdate:modelValue":t[18]||(t[18]=n=>e(o).currentCustomer.confirm_password=n),modelModifiers:{trim:!0},"content-loading":e(s),type:e(f)?"text":"password",name:"confirm_password",invalid:e(a).currentCustomer.confirm_password.$error,onInput:t[19]||(t[19]=n=>e(a).currentCustomer.confirm_password.$touch())},{right:i(()=>[e(f)?(_(),$(w,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[16]||(t[16]=n=>L(f)?f.value=!e(f):f=!e(f))})):(_(),$(w,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[17]||(t[17]=n=>L(f)?f.value=!e(f):f=!e(f))}))]),_:1},8,["modelValue","content-loading","type","invalid"])]),_:1},8,["error","content-loading"])):V("",!0)]),_:1})]),r(k,{class:"mb-5 md:mb-8"}),m("div",qe,[m("h6",Le,v(l.$t("customers.billing_address")),1),e(o).currentCustomer.billing?(_(),$(U,{key:0,class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{label:l.$t("customers.name"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.billing.name,"onUpdate:modelValue":t[20]||(t[20]=n=>e(o).currentCustomer.billing.name=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",class:"w-full",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.country"),"content-loading":e(s)},{default:i(()=>[r(P,{modelValue:e(o).currentCustomer.billing.country_id,"onUpdate:modelValue":t[21]||(t[21]=n=>e(o).currentCustomer.billing.country_id=n),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(s),options:e(z).countries,placeholder:l.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.state"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.billing.state,"onUpdate:modelValue":t[22]||(t[22]=n=>e(o).currentCustomer.billing.state=n),"content-loading":e(s),name:"billing.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{"content-loading":e(s),label:l.$t("customers.city")},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.billing.city,"onUpdate:modelValue":t[23]||(t[23]=n=>e(o).currentCustomer.billing.city=n),"content-loading":e(s),name:"billing.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.address"),error:e(a).currentCustomer.billing.address_street_1.$error&&e(a).currentCustomer.billing.address_street_1.$errors[0].$message||e(a).currentCustomer.billing.address_street_2.$error&&e(a).currentCustomer.billing.address_street_2.$errors[0].$message,"content-loading":e(s)},{default:i(()=>[r(S,{modelValue:e(o).currentCustomer.billing.address_street_1,"onUpdate:modelValue":t[24]||(t[24]=n=>e(o).currentCustomer.billing.address_street_1=n),modelModifiers:{trim:!0},"content-loading":e(s),placeholder:l.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3",onInput:t[25]||(t[25]=n=>e(a).currentCustomer.billing.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),r(S,{modelValue:e(o).currentCustomer.billing.address_street_2,"onUpdate:modelValue":t[26]||(t[26]=n=>e(o).currentCustomer.billing.address_street_2=n),modelModifiers:{trim:!0},"content-loading":e(s),placeholder:l.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3",onInput:t[27]||(t[27]=n=>e(a).currentCustomer.billing.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","error","content-loading"]),m("div",ze,[r(u,{"content-loading":e(s),label:l.$t("customers.phone"),class:"text-left"},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.billing.phone,"onUpdate:modelValue":t[28]||(t[28]=n=>e(o).currentCustomer.billing.phone=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.zip_code"),"content-loading":e(s),class:"mt-2 text-left"},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.billing.zip,"onUpdate:modelValue":t[29]||(t[29]=n=>e(o).currentCustomer.billing.zip=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})):V("",!0)]),r(k,{class:"mb-5 md:mb-8"}),m("div",Pe,[m("div",Fe,[r(E,{type:"button","content-loading":e(s),size:"sm",variant:"primary-outline",onClick:t[30]||(t[30]=n=>e(o).copyAddress(!0))},{left:i(n=>[r(w,{name:"DocumentDuplicateIcon",class:O(n.class)},null,8,["class"])]),default:i(()=>[H(" "+v(l.$t("customers.copy_billing_address")),1)]),_:1},8,["content-loading"])])]),e(o).currentCustomer.shipping?(_(),J("div",je,[m("h6",De,v(l.$t("customers.shipping_address")),1),r(U,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{"content-loading":e(s),label:l.$t("customers.name")},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.shipping.name,"onUpdate:modelValue":t[31]||(t[31]=n=>e(o).currentCustomer.shipping.name=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.country"),"content-loading":e(s)},{default:i(()=>[r(P,{modelValue:e(o).currentCustomer.shipping.country_id,"onUpdate:modelValue":t[32]||(t[32]=n=>e(o).currentCustomer.shipping.country_id=n),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(s),options:e(z).countries,placeholder:l.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),r(u,{label:l.$t("customers.state"),"content-loading":e(s)},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.shipping.state,"onUpdate:modelValue":t[33]||(t[33]=n=>e(o).currentCustomer.shipping.state=n),"content-loading":e(s),name:"shipping.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{"content-loading":e(s),label:l.$t("customers.city")},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.shipping.city,"onUpdate:modelValue":t[34]||(t[34]=n=>e(o).currentCustomer.shipping.city=n),"content-loading":e(s),name:"shipping.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.address"),"content-loading":e(s),error:e(a).currentCustomer.shipping.address_street_1.$error&&e(a).currentCustomer.shipping.address_street_1.$errors[0].$message||e(a).currentCustomer.shipping.address_street_2.$error&&e(a).currentCustomer.shipping.address_street_2.$errors[0].$message},{default:i(()=>[r(S,{modelValue:e(o).currentCustomer.shipping.address_street_1,"onUpdate:modelValue":t[35]||(t[35]=n=>e(o).currentCustomer.shipping.address_street_1=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",placeholder:l.$t("general.street_1"),name:"shipping_street1",onInput:t[36]||(t[36]=n=>e(a).currentCustomer.shipping.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),r(S,{modelValue:e(o).currentCustomer.shipping.address_street_2,"onUpdate:modelValue":t[37]||(t[37]=n=>e(o).currentCustomer.shipping.address_street_2=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",placeholder:l.$t("general.street_2"),name:"shipping_street2",class:"mt-3","container-class":"mt-3",onInput:t[38]||(t[38]=n=>e(a).currentCustomer.shipping.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","content-loading","error"]),m("div",Ee,[r(u,{"content-loading":e(s),label:l.$t("customers.phone"),class:"text-left"},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.shipping.phone,"onUpdate:modelValue":t[39]||(t[39]=n=>e(o).currentCustomer.shipping.phone=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:l.$t("customers.zip_code"),"content-loading":e(s),class:"mt-2 text-left"},{default:i(()=>[r(d,{modelValue:e(o).currentCustomer.shipping.zip,"onUpdate:modelValue":t[40]||(t[40]=n=>e(o).currentCustomer.shipping.zip=n),modelModifiers:{trim:!0},"content-loading":e(s),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})])):V("",!0),e(b).customFields.length>0?(_(),$(k,{key:1,class:"mb-5 md:mb-8"})):V("",!0),m("div",Ge,[e(b).customFields.length>0?(_(),J("h6",Ne,v(l.$t("settings.custom_fields.title")),1)):V("",!0),m("div",Te,[r(we,{type:"Customer",store:e(o),"store-prop":"currentCustomer","is-edit":e(h),"is-loading":e(X),"custom-field-scope":j},null,8,["store","is-edit","is-loading"])])])]),_:1})],40,he)]),_:1})}}};export{Je as default}; diff --git a/public/build/assets/Create.6d36d723.js b/public/build/assets/Create.6d36d723.js deleted file mode 100644 index 1b4eac4f..00000000 --- a/public/build/assets/Create.6d36d723.js +++ /dev/null @@ -1 +0,0 @@ -var ce=Object.defineProperty;var R=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var L=(_,s,c)=>s in _?ce(_,s,{enumerable:!0,configurable:!0,writable:!0,value:c}):_[s]=c,T=(_,s)=>{for(var c in s||(s={}))de.call(s,c)&&L(_,c,s[c]);if(R)for(var c of R(s))ye.call(s,c)&&L(_,c,s[c]);return _};import{G as pe,aN as _e,ah as ve,J as fe,B as w,a0 as Pe,k as S,L as C,M as q,aX as ge,O as be,aP as Be,T as $e,a7 as he,b1 as Ce,r as m,o as k,e as Ie,f as r,w as l,h as I,u as e,l as j,m as z,j as U,i as N,t as b,x as Se,U as Ve,F as Me}from"./vendor.fd3b1727.js";import{_ as we}from"./ExchangeRateConverter.0aa9df3c.js";import{u as qe,l as ke,m as Ne,b as je,c as Ue,i as xe,d as De}from"./main.fc26c84f.js";import{u as Ae}from"./payment.505d9057.js";import{_ as Ee}from"./SelectNotePopup.332d8bb2.js";import{_ as Fe}from"./CreateCustomFields.5609a247.js";import{_ as Ge}from"./PaymentModeModal.ca34bfc6.js";import"./exchange-rate.e85a4793.js";import"./NoteModal.ecba55bc.js";const Re=["onSubmit"],Le={class:"absolute left-3.5"},Te={class:"relative w-full"},ze={class:"relative mt-6"},He={class:"z-20 float-right text-sm font-semibold leading-5 text-primary-400"},Je={class:"mb-4 text-sm font-medium text-gray-800"},nt={setup(_){const s=pe(),c=_e(),t=Ae();qe();const V=ke();Ne(),je();const H=Ue(),x=xe();De();const D=ve("utils"),{t:p}=fe();let B=w(!1),M=w(!1),v=w([]);const f=w(null),A="newEstimate",J=Pe(["customer","company","customerCustom","payment","paymentCustom"]),$=S({get:()=>t.currentPayment.amount/100,set:a=>{t.currentPayment.amount=Math.round(a*100)}}),u=S(()=>t.isFetchingInitialData),d=S(()=>s.name==="payments.edit"),E=S(()=>d.value?p("payments.edit_payment"):p("payments.new_payment")),O=S(()=>({currentPayment:{customer_id:{required:C.withMessage(p("validation.required"),q)},payment_date:{required:C.withMessage(p("validation.required"),q)},amount:{required:C.withMessage(p("validation.required"),q),between:C.withMessage(p("validation.payment_greater_than_due_amount"),ge(0,t.currentPayment.maxPayableAmount))},exchange_rate:{required:be(function(){return C.withMessage(p("validation.required"),q),t.showExchangeRate}),decimal:C.withMessage(p("validation.valid_exchange_rate"),Be)}}})),i=$e(O,t,{$scope:A});he(()=>{t.currentPayment.customer_id&&Y(t.currentPayment.customer_id),s.query.customer&&(t.currentPayment.customer_id=s.query.customer)}),t.resetCurrentPayment(),s.query.customer&&(t.currentPayment.customer_id=s.query.customer),t.fetchPaymentInitialData(d.value),s.params.id&&!d.value&&Q();async function X(){H.openModal({title:p("settings.payment_modes.add_payment_mode"),componentName:"PaymentModeModal"})}function K(a){t.currentPayment.notes=""+a.notes}async function Q(){var n;let a=await x.fetchInvoice((n=s==null?void 0:s.params)==null?void 0:n.id);t.currentPayment.customer_id=a.data.data.customer.id,t.currentPayment.invoice_id=a.data.data.id}async function W(a){a&&(f.value=v.value.find(n=>n.id===a),$.value=f.value.due_amount/100,t.currentPayment.maxPayableAmount=f.value.due_amount)}function Y(a){if(a){let n={customer_id:a,status:"DUE",limit:"all"};d.value&&(n.status=""),M.value=!0,Promise.all([x.fetchInvoices(n),V.fetchCustomer(a)]).then(async([y,P])=>{y&&(v.value=[...y.data.data]),P&&P.data&&(t.currentPayment.selectedCustomer=P.data.data,t.currentPayment.customer=P.data.data,t.currentPayment.currency=P.data.data.currency,d.value&&!V.editCustomer&&t.currentPayment.customer_id&&(V.editCustomer=P.data.data)),t.currentPayment.invoice_id&&(f.value=v.value.find(g=>g.id===t.currentPayment.invoice_id),t.currentPayment.maxPayableAmount=f.value.due_amount+t.currentPayment.amount,$.value===0&&($.value=f.value.due_amount/100)),d.value&&(v.value=v.value.filter(g=>g.due_amount>0||g.id==t.currentPayment.invoice_id)),M.value=!1}).catch(y=>{M.value=!1,console.error(y,"error")})}}Ce(()=>{t.resetCurrentPayment(),v.value=[],V.editCustomer=null});async function Z(){if(i.value.$touch(),i.value.$invalid)return!1;B.value=!0;let a=T({},t.currentPayment),n=null;try{n=await(d.value?t.updatePayment:t.addPayment)(a),c.push(`/admin/payments/${n.data.data.id}/view`)}catch{B.value=!1}}function ee(a){let n={userId:a};s.params.id&&(n.model_id=s.params.id),t.currentPayment.invoice_id=f.value=null,t.currentPayment.amount=0,v.value=[],t.getNextNumber(n,!0)}return(a,n)=>{const y=m("BaseBreadcrumbItem"),P=m("BaseBreadcrumb"),g=m("BaseIcon"),F=m("BaseButton"),te=m("BasePageHeader"),ae=m("BaseDatePicker"),h=m("BaseInputGroup"),ne=m("BaseInput"),oe=m("BaseCustomerSelectInput"),G=m("BaseMultiselect"),re=m("BaseMoney"),se=m("BaseSelectAction"),le=m("BaseInputGrid"),ue=m("BaseCustomInput"),me=m("BaseCard"),ie=m("BasePage");return k(),Ie(Me,null,[r(Ge),r(ie,{class:"relative payment-create"},{default:l(()=>[I("form",{action:"",onSubmit:Ve(Z,["prevent"])},[r(te,{title:e(E),class:"mb-5"},{actions:l(()=>[r(F,{loading:e(B),disabled:e(B),variant:"primary",type:"submit",class:"hidden sm:flex"},{left:l(o=>[e(B)?U("",!0):(k(),j(g,{key:0,name:"SaveIcon",class:z(o.class)},null,8,["class"]))]),default:l(()=>[N(" "+b(e(d)?a.$t("payments.update_payment"):a.$t("payments.save_payment")),1)]),_:1},8,["loading","disabled"])]),default:l(()=>[r(P,null,{default:l(()=>[r(y,{title:a.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r(y,{title:a.$tc("payments.payment",2),to:"/admin/payments"},null,8,["title"]),r(y,{title:e(E),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(me,null,{default:l(()=>[r(le,null,{default:l(()=>[r(h,{label:a.$t("payments.date"),"content-loading":e(u),required:"",error:e(i).currentPayment.payment_date.$error&&e(i).currentPayment.payment_date.$errors[0].$message},{default:l(()=>[r(ae,{modelValue:e(t).currentPayment.payment_date,"onUpdate:modelValue":[n[0]||(n[0]=o=>e(t).currentPayment.payment_date=o),n[1]||(n[1]=o=>e(i).currentPayment.payment_date.$touch())],"content-loading":e(u),"calendar-button":!0,"calendar-button-icon":"calendar",invalid:e(i).currentPayment.payment_date.$error},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),r(h,{label:a.$t("payments.payment_number"),"content-loading":e(u),required:""},{default:l(()=>[r(ne,{modelValue:e(t).currentPayment.payment_number,"onUpdate:modelValue":n[2]||(n[2]=o=>e(t).currentPayment.payment_number=o),"content-loading":e(u)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(h,{label:a.$t("payments.customer"),error:e(i).currentPayment.customer_id.$error&&e(i).currentPayment.customer_id.$errors[0].$message,"content-loading":e(u),required:""},{default:l(()=>[e(u)?U("",!0):(k(),j(oe,{key:0,modelValue:e(t).currentPayment.customer_id,"onUpdate:modelValue":[n[3]||(n[3]=o=>e(t).currentPayment.customer_id=o),n[4]||(n[4]=o=>ee(e(t).currentPayment.customer_id))],"content-loading":e(u),invalid:e(i).currentPayment.customer_id.$error,placeholder:a.$t("customers.select_a_customer"),"show-action":""},null,8,["modelValue","content-loading","invalid","placeholder"]))]),_:1},8,["label","error","content-loading"]),r(h,{"content-loading":e(u),label:a.$t("payments.invoice"),"help-text":f.value?`Due Amount: ${e(t).currentPayment.maxPayableAmount/100}`:""},{default:l(()=>[r(G,{modelValue:e(t).currentPayment.invoice_id,"onUpdate:modelValue":n[5]||(n[5]=o=>e(t).currentPayment.invoice_id=o),"content-loading":e(u),"value-prop":"id","track-by":"invoice_number",label:"invoice_number",options:e(v),loading:e(M),placeholder:a.$t("invoices.select_invoice"),onSelect:W},{singlelabel:l(({value:o})=>[I("div",Le,b(o.invoice_number)+" ("+b(e(D).formatMoney(o.total,o.customer.currency))+") ",1)]),option:l(({option:o})=>[N(b(o.invoice_number)+" ("+b(e(D).formatMoney(o.total,o.customer.currency))+") ",1)]),_:1},8,["modelValue","content-loading","options","loading","placeholder"])]),_:1},8,["content-loading","label","help-text"]),r(h,{label:a.$t("payments.amount"),"content-loading":e(u),error:e(i).currentPayment.amount.$error&&e(i).currentPayment.amount.$errors[0].$message,required:""},{default:l(()=>[I("div",Te,[r(re,{key:e(t).currentPayment.currency,modelValue:e($),"onUpdate:modelValue":[n[6]||(n[6]=o=>Se($)?$.value=o:null),n[7]||(n[7]=o=>e(i).currentPayment.amount.$touch())],currency:e(t).currentPayment.currency,"content-loading":e(u),invalid:e(i).currentPayment.amount.$error},null,8,["modelValue","currency","content-loading","invalid"])])]),_:1},8,["label","content-loading","error"]),r(h,{"content-loading":e(u),label:a.$t("payments.payment_mode")},{default:l(()=>[r(G,{modelValue:e(t).currentPayment.payment_method_id,"onUpdate:modelValue":n[8]||(n[8]=o=>e(t).currentPayment.payment_method_id=o),"content-loading":e(u),label:"name","value-prop":"id","track-by":"name",options:e(t).paymentModes,placeholder:a.$t("payments.select_payment_mode"),searchable:""},{action:l(()=>[r(se,{onClick:X},{default:l(()=>[r(g,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),N(" "+b(a.$t("settings.payment_modes.add_payment_mode")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(we,{store:e(t),"store-prop":"currentPayment",v:e(i).currentPayment,"is-loading":e(u),"is-edit":e(d),"customer-currency":e(t).currentPayment.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"])]),_:1}),r(Fe,{type:"Payment","is-edit":e(d),"is-loading":e(u),store:e(t),"store-prop":"currentPayment","custom-field-scope":A,class:"mt-6"},null,8,["is-edit","is-loading","store"]),I("div",ze,[I("div",He,[r(Ee,{type:"Payment",onSelect:K})]),I("label",Je,b(a.$t("estimates.notes")),1),r(ue,{modelValue:e(t).currentPayment.notes,"onUpdate:modelValue":n[9]||(n[9]=o=>e(t).currentPayment.notes=o),"content-loading":e(u),fields:e(J),class:"mt-1"},null,8,["modelValue","content-loading","fields"])]),r(F,{loading:e(B),"content-loading":e(u),variant:"primary",type:"submit",class:"flex justify-center w-full mt-4 sm:hidden md:hidden"},{left:l(o=>[e(B)?U("",!0):(k(),j(g,{key:0,name:"SaveIcon",class:z(o.class)},null,8,["class"]))]),default:l(()=>[N(" "+b(e(d)?a.$t("payments.update_payment"):a.$t("payments.save_payment")),1)]),_:1},8,["loading","content-loading"])]),_:1})],40,Re)]),_:1})],64)}}};export{nt as default}; diff --git a/public/build/assets/Create.701a2926.js b/public/build/assets/Create.701a2926.js deleted file mode 100644 index 18edce58..00000000 --- a/public/build/assets/Create.701a2926.js +++ /dev/null @@ -1 +0,0 @@ -var W=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var k=(m,a,o)=>a in m?W(m,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):m[a]=o,j=(m,a)=>{for(var o in a||(a={}))Z.call(a,o)&&k(m,o,a[o]);if(S)for(var o of S(a))x.call(a,o)&&k(m,o,a[o]);return m},N=(m,a)=>X(m,Y(a));import{J as ee,G as ae,aN as te,B as _,k as V,L as p,M as $,N as G,Q as oe,O as se,T as ne,r as d,o as w,l as h,w as u,f as s,u as e,h as y,e as re,y as le,F as ie,m as ue,j as de,i as me,t as ce,U as pe}from"./vendor.fd3b1727.js";import{b as ge}from"./main.fc26c84f.js";import{V as fe}from"./index.esm.7e25573e.js";import{u as ve}from"./users.bb63694b.js";const $e=["onSubmit"],De={class:"grid grid-cols-12"},be={class:"space-y-6"},ye={setup(m){const a=ve(),{t:o}=ee(),q=ae(),L=te(),P=ge();let g=_(!1),l=_(!1);_([]);let I=_([]);const f=V(()=>q.name==="users.edit"),M=V(()=>f.value?o("users.edit_user"):o("users.new_user")),E=V(()=>({userData:{name:{required:p.withMessage(o("validation.required"),$),minLength:p.withMessage(o("validation.name_min_length",{count:3}),G(3))},email:{required:p.withMessage(o("validation.required"),$),email:p.withMessage(o("validation.email_incorrect"),oe)},password:{required:se(function(){return p.withMessage(o("validation.required"),$),!f.value}),minLength:p.withMessage(o("validation.password_min_length",{count:8}),G(8))},companies:{required:p.withMessage(o("validation.required"),$)}}})),F={role:{required:p.withMessage(o("validation.required"),$)}},n=ne(E,a,{$scope:!0});R(),a.resetUserData();async function R(){var i;l.value=!0;try{f.value&&await a.fetchUser(q.params.id);let t=await P.fetchUserCompanies();((i=t==null?void 0:t.data)==null?void 0:i.data)&&(I.value=t.data.data.map(c=>(c.role=null,c)))}catch{l.value=!1}l.value=!1}async function T(){if(n.value.$touch(),n.value.$invalid)return!0;try{g.value=!0;let i=N(j({},a.userData),{companies:a.userData.companies.map(c=>({role:c.role,id:c.id}))});await(f.value?a.updateUser:a.addUser)(i),L.push("/admin/users"),g.value=!1}catch{g.value=!1}}return(i,t)=>{const c=d("BaseBreadcrumbItem"),H=d("BaseBreadcrumb"),z=d("BasePageHeader"),D=d("BaseInput"),v=d("BaseInputGroup"),U=d("BaseMultiselect"),A=d("BaseInputGrid"),J=d("BaseIcon"),O=d("BaseButton"),Q=d("BaseCard"),K=d("BasePage");return w(),h(K,null,{default:u(()=>[s(z,{title:e(M)},{default:u(()=>[s(H,null,{default:u(()=>[s(c,{title:i.$t("general.home"),to:"dashboard"},null,8,["title"]),s(c,{title:i.$tc("users.user",2),to:"/admin/users"},null,8,["title"]),s(c,{title:e(M),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),y("form",{action:"",autocomplete:"off",onSubmit:pe(T,["prevent"])},[y("div",De,[s(Q,{class:"mt-6 col-span-12 md:col-span-8"},{default:u(()=>[s(A,{layout:"one-column"},{default:u(()=>[s(v,{"content-loading":e(l),label:i.$t("users.name"),error:e(n).userData.name.$error&&e(n).userData.name.$errors[0].$message,required:""},{default:u(()=>[s(D,{modelValue:e(a).userData.name,"onUpdate:modelValue":t[0]||(t[0]=r=>e(a).userData.name=r),modelModifiers:{trim:!0},"content-loading":e(l),invalid:e(n).userData.name.$error,onInput:t[1]||(t[1]=r=>e(n).userData.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),s(v,{"content-loading":e(l),label:i.$t("users.email"),error:e(n).userData.email.$error&&e(n).userData.email.$errors[0].$message,required:""},{default:u(()=>[s(D,{modelValue:e(a).userData.email,"onUpdate:modelValue":t[2]||(t[2]=r=>e(a).userData.email=r),modelModifiers:{trim:!0},type:"email","content-loading":e(l),invalid:e(n).userData.email.$error,onInput:t[3]||(t[3]=r=>e(n).userData.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),s(v,{"content-loading":e(l),label:i.$t("users.companies"),error:e(n).userData.companies.$error&&e(n).userData.companies.$errors[0].$message,required:""},{default:u(()=>[s(U,{modelValue:e(a).userData.companies,"onUpdate:modelValue":t[4]||(t[4]=r=>e(a).userData.companies=r),mode:"tags",object:!0,autocomplete:"new-password",label:"name",options:e(I),"value-prop":"id",invalid:e(n).userData.companies.$error,"content-loading":e(l),searchable:"","can-deselect":!1,class:"w-full","track-by":"name"},null,8,["modelValue","options","invalid","content-loading"])]),_:1},8,["content-loading","label","error"]),(w(!0),re(ie,null,le(e(a).userData.companies,(r,b)=>(w(),h(e(fe),{key:b,state:r,rules:F},{default:u(({v:B})=>[y("div",be,[s(v,{"content-loading":e(l),label:i.$t("users.select_company_role",{company:r.name}),error:B.role.$error&&B.role.$errors[0].$message,required:""},{default:u(()=>[s(U,{modelValue:e(a).userData.companies[b].role,"onUpdate:modelValue":C=>e(a).userData.companies[b].role=C,"value-prop":"name","track-by":"id",autocomplete:"off","content-loading":e(l),label:"name",options:e(a).userData.companies[b].roles,"can-deselect":!1,invalid:B.role.$invalid,onChange:C=>B.role.$touch()},null,8,["modelValue","onUpdate:modelValue","content-loading","options","invalid","onChange"])]),_:2},1032,["content-loading","label","error"])])]),_:2},1032,["state"]))),128)),s(v,{"content-loading":e(l),label:i.$tc("users.password"),error:e(n).userData.password.$error&&e(n).userData.password.$errors[0].$message,required:!e(f)},{default:u(()=>[s(D,{modelValue:e(a).userData.password,"onUpdate:modelValue":t[5]||(t[5]=r=>e(a).userData.password=r),name:"new-password",autocomplete:"new-password","content-loading":e(l),type:"password",invalid:e(n).userData.password.$error,onInput:t[6]||(t[6]=r=>e(n).userData.password.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error","required"]),s(v,{"content-loading":e(l),label:i.$t("users.phone")},{default:u(()=>[s(D,{modelValue:e(a).userData.phone,"onUpdate:modelValue":t[7]||(t[7]=r=>e(a).userData.phone=r),modelModifiers:{trim:!0},"content-loading":e(l)},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"])]),_:1}),s(O,{"content-loading":e(l),type:"submit",loading:e(g),disabled:e(g),class:"mt-6"},{left:u(r=>[e(g)?de("",!0):(w(),h(J,{key:0,name:"SaveIcon",class:ue(r.class)},null,8,["class"]))]),default:u(()=>[me(" "+ce(e(f)?i.$t("users.update_user"):i.$t("users.save_user")),1)]),_:1},8,["content-loading","loading","disabled"])]),_:1})])],40,$e)]),_:1})}}};export{ye as default}; diff --git a/public/build/assets/Create.9313a497.js b/public/build/assets/Create.9313a497.js deleted file mode 100644 index 9c209545..00000000 --- a/public/build/assets/Create.9313a497.js +++ /dev/null @@ -1 +0,0 @@ -import{G as ie,aN as de,J as ue,B as q,k as b,L as m,M as $,b2 as ce,S as N,O as pe,aP as me,T as ge,b1 as xe,r as d,o as v,e as fe,f as r,w as o,h as F,u as e,l as h,m as U,i as w,t as S,j as C,x as _e,U as ye,F as ve}from"./vendor.fd3b1727.js";import{u as Ee}from"./expense.9bde13f4.js";import{u as be}from"./category.3bd14c85.js";import{l as $e,b as he,m as Ce,c as Be,d as Ve}from"./main.fc26c84f.js";import{_ as we}from"./CreateCustomFields.5609a247.js";import{_ as Se}from"./CategoryModal.cb867f43.js";import{_ as Me}from"./ExchangeRateConverter.0aa9df3c.js";import"./exchange-rate.e85a4793.js";const Ie=["onSubmit"],ke={class:"hidden md:block"},qe={class:"block md:hidden"},Ae={setup(Fe){const f=$e(),j=he(),t=Ee(),_=be(),G=Ce(),T=Be(),y=ie(),A=de(),{t:u}=ue(),D=Ve();let g=q(!1),i=q(!1);const R="newExpense",M=q(!1),L=b(()=>({currentExpense:{expense_category_id:{required:m.withMessage(u("validation.required"),$)},expense_date:{required:m.withMessage(u("validation.required"),$)},amount:{required:m.withMessage(u("validation.required"),$),minValue:m.withMessage(u("validation.price_minvalue"),ce(.1)),maxLength:m.withMessage(u("validation.price_maxlength"),N(20))},notes:{maxLength:m.withMessage(u("validation.description_maxlength"),N(65e3))},currency_id:{required:m.withMessage(u("validation.required"),$)},exchange_rate:{required:pe(function(){return m.withMessage(u("validation.required"),$),t.showExchangeRate}),decimal:m.withMessage(u("validation.valid_exchange_rate"),me)}}})),l=ge(L,t,{$scope:R}),I=b({get:()=>t.currentExpense.amount/100,set:a=>{t.currentExpense.amount=Math.round(a*100)}}),c=b(()=>y.name==="expenses.edit"),P=b(()=>c.value?u("expenses.edit_expense"):u("expenses.new_expense")),O=b(()=>c.value?`/reports/expenses/${y.params.id}/download-receipt`:"");t.resetCurrentExpenseData(),G.resetCustomFields(),X();function z(a,n){t.currentExpense.attachment_receipt=n}function H(){t.currentExpense.attachment_receipt=null,M.value=!0}function J(){T.openModal({title:u("settings.expense_category.add_category"),componentName:"CategoryModal",size:"sm"})}function K(a){t.currentExpense.selectedCurrency=D.currencies.find(n=>n.id===a)}async function Q(a){let n=await _.fetchCategories({search:a});if(n.data.data.length>0&&_.editCategory&&!n.data.data.find(p=>p.id==_.editCategory.id)){let p=Object.assign({},_.editCategory);n.data.data.unshift(p)}return n.data.data}async function W(a){let n=await f.fetchCustomers({search:a});if(n.data.data.length>0&&f.editCustomer&&!n.data.data.find(p=>p.id==f.editCustomer.id)){let p=Object.assign({},f.editCustomer);n.data.data.unshift(p)}return n.data.data}async function X(){if(c.value||(t.currentExpense.currency_id=j.selectedCompanyCurrency.id,t.currentExpense.selectedCurrency=j.selectedCompanyCurrency),i.value=!0,await t.fetchPaymentModes({limit:"all"}),c.value){const a=await t.fetchExpense(y.params.id);t.currentExpense.currency_id=t.currentExpense.selectedCurrency.id,a.data&&(!_.editCategory&&a.data.data.expense_category&&(_.editCategory=a.data.data.expense_category),!f.editCustomer&&a.data.data.customer&&(f.editCustomer=a.data.data.customer))}else y.query.customer&&(t.currentExpense.customer_id=y.query.customer);i.value=!1}async function Y(){if(l.value.$touch(),l.value.$invalid)return;g.value=!0;let a=t.currentExpense;try{c.value?await t.updateExpense({id:y.params.id,data:a,isAttachmentReceiptRemoved:M.value}):await t.addExpense(a),g.value=!1,t.currentExpense.attachment_receipt=null,M.value=!1,A.push("/admin/expenses")}catch(n){console.error(n),g.value=!1;return}}return xe(()=>{t.resetCurrentExpenseData(),f.editCustomer=null,_.editCategory=null}),(a,n)=>{const E=d("BaseBreadcrumbItem"),p=d("BaseBreadcrumb"),B=d("BaseIcon"),k=d("BaseButton"),Z=d("BasePageHeader"),ee=d("BaseSelectAction"),V=d("BaseMultiselect"),x=d("BaseInputGroup"),te=d("BaseDatePicker"),ne=d("BaseMoney"),ae=d("BaseTextarea"),re=d("BaseFileUploader"),se=d("BaseInputGrid"),oe=d("BaseCard"),le=d("BasePage");return v(),fe(ve,null,[r(Se),r(le,{class:"relative"},{default:o(()=>[F("form",{action:"",onSubmit:ye(Y,["prevent"])},[r(Z,{title:e(P),class:"mb-5"},{actions:o(()=>[e(c)&&e(t).currentExpense.attachment_receipt_url?(v(),h(k,{key:0,href:e(O),tag:"a",variant:"primary-outline",type:"button",class:"mr-2"},{left:o(s=>[r(B,{name:"DownloadIcon",class:U(s.class)},null,8,["class"])]),default:o(()=>[w(" "+S(a.$t("expenses.download_receipt")),1)]),_:1},8,["href"])):C("",!0),F("div",ke,[r(k,{loading:e(g),"content-loading":e(i),disabled:e(g),variant:"primary",type:"submit"},{left:o(s=>[e(g)?C("",!0):(v(),h(B,{key:0,name:"SaveIcon",class:U(s.class)},null,8,["class"]))]),default:o(()=>[w(" "+S(e(c)?a.$t("expenses.update_expense"):a.$t("expenses.save_expense")),1)]),_:1},8,["loading","content-loading","disabled"])])]),default:o(()=>[r(p,null,{default:o(()=>[r(E,{title:a.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r(E,{title:a.$tc("expenses.expense",2),to:"/admin/expenses"},null,8,["title"]),r(E,{title:e(P),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(oe,null,{default:o(()=>[r(se,null,{default:o(()=>[r(x,{label:a.$t("expenses.category"),error:e(l).currentExpense.expense_category_id.$error&&e(l).currentExpense.expense_category_id.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[e(i)?C("",!0):(v(),h(V,{key:0,modelValue:e(t).currentExpense.expense_category_id,"onUpdate:modelValue":n[0]||(n[0]=s=>e(t).currentExpense.expense_category_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:Q,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",invalid:e(l).currentExpense.expense_category_id.$error,placeholder:a.$t("expenses.categories.select_a_category"),onInput:n[1]||(n[1]=s=>e(l).currentExpense.expense_category_id.$touch())},{action:o(()=>[r(ee,{onClick:J},{default:o(()=>[r(B,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),w(" "+S(a.$t("settings.expense_category.add_new_category")),1)]),_:1})]),_:1},8,["modelValue","content-loading","invalid","placeholder"]))]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.expense_date"),error:e(l).currentExpense.expense_date.$error&&e(l).currentExpense.expense_date.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(te,{modelValue:e(t).currentExpense.expense_date,"onUpdate:modelValue":n[2]||(n[2]=s=>e(t).currentExpense.expense_date=s),"content-loading":e(i),"calendar-button":!0,invalid:e(l).currentExpense.expense_date.$error,onInput:n[3]||(n[3]=s=>e(l).currentExpense.expense_date.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.amount"),error:e(l).currentExpense.amount.$error&&e(l).currentExpense.amount.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(ne,{key:e(t).currentExpense.selectedCurrency,modelValue:e(I),"onUpdate:modelValue":n[4]||(n[4]=s=>_e(I)?I.value=s:null),class:"focus:border focus:border-solid focus:border-primary-500",invalid:e(l).currentExpense.amount.$error,currency:e(t).currentExpense.selectedCurrency,onInput:n[5]||(n[5]=s=>e(l).currentExpense.amount.$touch())},null,8,["modelValue","invalid","currency"])]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.currency"),"content-loading":e(i),error:e(l).currentExpense.currency_id.$error&&e(l).currentExpense.currency_id.$errors[0].$message,required:""},{default:o(()=>[r(V,{modelValue:e(t).currentExpense.currency_id,"onUpdate:modelValue":[n[6]||(n[6]=s=>e(t).currentExpense.currency_id=s),K],"value-prop":"id",label:"name","track-by":"name","content-loading":e(i),options:e(D).currencies,searchable:"","can-deselect":!1,placeholder:a.$t("customers.select_currency"),invalid:e(l).currentExpense.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(Me,{store:e(t),"store-prop":"currentExpense",v:e(l).currentExpense,"is-loading":e(i),"is-edit":e(c),"customer-currency":e(t).currentExpense.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"]),r(x,{"content-loading":e(i),label:a.$t("expenses.customer")},{default:o(()=>[e(i)?C("",!0):(v(),h(V,{key:0,modelValue:e(t).currentExpense.customer_id,"onUpdate:modelValue":n[7]||(n[7]=s=>e(t).currentExpense.customer_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:W,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",placeholder:a.$t("customers.select_a_customer")},null,8,["modelValue","content-loading","placeholder"]))]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:a.$t("payments.payment_mode")},{default:o(()=>[r(V,{modelValue:e(t).currentExpense.payment_method_id,"onUpdate:modelValue":n[8]||(n[8]=s=>e(t).currentExpense.payment_method_id=s),"content-loading":e(i),label:"name","value-prop":"id","track-by":"name",options:e(t).paymentModes,placeholder:a.$t("payments.select_payment_mode"),searchable:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:a.$t("expenses.note"),error:e(l).currentExpense.notes.$error&&e(l).currentExpense.notes.$errors[0].$message},{default:o(()=>[r(ae,{modelValue:e(t).currentExpense.notes,"onUpdate:modelValue":n[9]||(n[9]=s=>e(t).currentExpense.notes=s),"content-loading":e(i),row:4,rows:"4",onInput:n[10]||(n[10]=s=>e(l).currentExpense.notes.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label","error"]),r(x,{label:a.$t("expenses.receipt")},{default:o(()=>[r(re,{modelValue:e(t).currentExpense.receiptFiles,"onUpdate:modelValue":n[11]||(n[11]=s=>e(t).currentExpense.receiptFiles=s),accept:"image/*,.doc,.docx,.pdf,.csv,.xlsx,.xls",onChange:z,onRemove:H},null,8,["modelValue"])]),_:1},8,["label"]),r(we,{"is-edit":e(c),class:"col-span-2","is-loading":e(i),type:"Expense",store:e(t),"store-prop":"currentExpense","custom-field-scope":R},null,8,["is-edit","is-loading","store"]),F("div",qe,[r(k,{loading:e(g),tabindex:6,variant:"primary",type:"submit",class:"flex justify-center w-full"},{left:o(s=>[e(g)?C("",!0):(v(),h(B,{key:0,name:"SaveIcon",class:U(s.class)},null,8,["class"]))]),default:o(()=>[w(" "+S(e(c)?a.$t("expenses.update_expense"):a.$t("expenses.save_expense")),1)]),_:1},8,["loading"])])]),_:1})]),_:1})],40,Ie)]),_:1})],64)}}};export{Ae as default}; diff --git a/public/build/assets/Create.c6a28457.js b/public/build/assets/Create.c6a28457.js deleted file mode 100644 index e9275835..00000000 --- a/public/build/assets/Create.c6a28457.js +++ /dev/null @@ -1 +0,0 @@ -var oe=Object.defineProperty,se=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var P=(u,e,i)=>e in u?oe(u,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[e]=i,b=(u,e)=>{for(var i in e||(e={}))ie.call(e,i)&&P(u,i,e[i]);if(N)for(var i of N(e))re.call(e,i)&&P(u,i,e[i]);return u},h=(u,e)=>se(u,le(e));import{J as me,G as ue,aN as ce,B as T,k as p,L as x,M as de,N as pe,S as _e,T as ge,r as s,o as M,l as w,w as l,f as o,u as t,h as j,x as q,i as E,t as G,j as L,m as Ie,U as fe}from"./vendor.fd3b1727.js";import{p as ve,q as Be,c as be,b as $e,e as ye,g as Ve}from"./main.fc26c84f.js";import{_ as Se}from"./ItemUnitModal.f71b6bbd.js";const he=["onSubmit"],Ue={setup(u){const e=ve(),i=Be(),$=be(),z=$e(),{t:_}=me(),y=ue(),A=ce(),D=ye(),I=T(!1),V=T(z.selectedCompanySettings.tax_per_item);let r=T(!1);e.$reset(),J();const v=p({get:()=>e.currentItem.price/100,set:n=>{e.currentItem.price=Math.round(n*100)}}),S=p({get:()=>{var n,a;return(a=(n=e==null?void 0:e.currentItem)==null?void 0:n.taxes)==null?void 0:a.map(d=>{if(d)return h(b({},d),{tax_type_id:d.id,tax_name:d.name+" ("+d.percent+"%)"})})},set:n=>{e.currentItem.taxes=n}}),B=p(()=>y.name==="items.edit"),U=p(()=>B.value?_("items.edit_item"):_("items.new_item")),R=p(()=>i.taxTypes.map(n=>h(b({},n),{tax_type_id:n.id,tax_name:n.name+" ("+n.percent+"%)"}))),Y=p(()=>V.value==="YES"),H=p(()=>({currentItem:{name:{required:x.withMessage(_("validation.required"),de),minLength:x.withMessage(_("validation.name_min_length",{count:3}),pe(3))},description:{maxLength:x.withMessage(_("validation.description_maxlength"),_e(65e3))}}})),c=ge(H,e);async function F(){$.openModal({title:_("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",size:"sm"})}async function J(){if(r.value=!0,await e.fetchItemUnits({limit:"all"}),D.hasAbilities(Ve.VIEW_TAX_TYPE)&&await i.fetchTaxTypes({limit:"all"}),B.value){let n=y.params.id;await e.fetchItem(n),e.currentItem.tax_per_item===1?V.value="YES":V.value="NO"}r.value=!1}async function O(){if(c.value.currentItem.$touch(),c.value.currentItem.$invalid)return!1;I.value=!0;try{let a=b({id:y.params.id},e.currentItem);e.currentItem&&e.currentItem.taxes&&(a.taxes=e.currentItem.taxes.map(g=>({tax_type_id:g.tax_type_id,amount:v.value*g.percent,percent:g.percent,name:g.name,collective_tax:0}))),await(B.value?e.updateItem:e.addItem)(a),I.value=!1,A.push("/admin/items"),n()}catch{I.value=!1;return}function n(){$.closeModal(),setTimeout(()=>{e.resetCurrentItem(),$.$reset(),c.value.$reset()},300)}}return(n,a)=>{const d=s("BaseBreadcrumbItem"),g=s("BaseBreadcrumb"),W=s("BasePageHeader"),X=s("BaseInput"),f=s("BaseInputGroup"),K=s("BaseMoney"),C=s("BaseIcon"),Q=s("BaseSelectAction"),k=s("BaseMultiselect"),Z=s("BaseTextarea"),ee=s("BaseButton"),te=s("BaseInputGrid"),ne=s("BaseCard"),ae=s("BasePage");return M(),w(ae,null,{default:l(()=>[o(W,{title:t(U)},{default:l(()=>[o(g,null,{default:l(()=>[o(d,{title:n.$t("general.home"),to:"dashboard"},null,8,["title"]),o(d,{title:n.$tc("items.item",2),to:"/admin/items"},null,8,["title"]),o(d,{title:t(U),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(Se),j("form",{class:"grid lg:grid-cols-2 mt-6",action:"submit",onSubmit:fe(O,["prevent"])},[o(ne,{class:"w-full"},{default:l(()=>[o(te,{layout:"one-column"},{default:l(()=>[o(f,{label:n.$t("items.name"),"content-loading":t(r),required:"",error:t(c).currentItem.name.$error&&t(c).currentItem.name.$errors[0].$message},{default:l(()=>[o(X,{modelValue:t(e).currentItem.name,"onUpdate:modelValue":a[0]||(a[0]=m=>t(e).currentItem.name=m),"content-loading":t(r),invalid:t(c).currentItem.name.$error,onInput:a[1]||(a[1]=m=>t(c).currentItem.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),o(f,{label:n.$t("items.price"),"content-loading":t(r)},{default:l(()=>[o(K,{modelValue:t(v),"onUpdate:modelValue":a[2]||(a[2]=m=>q(v)?v.value=m:null),"content-loading":t(r)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(f,{"content-loading":t(r),label:n.$t("items.unit")},{default:l(()=>[o(k,{modelValue:t(e).currentItem.unit_id,"onUpdate:modelValue":a[3]||(a[3]=m=>t(e).currentItem.unit_id=m),"content-loading":t(r),label:"name",options:t(e).itemUnits,"value-prop":"id",placeholder:n.$t("items.select_a_unit"),searchable:"","track-by":"name"},{action:l(()=>[o(Q,{onClick:F},{default:l(()=>[o(C,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),E(" "+G(n.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),t(Y)?(M(),w(f,{key:0,label:n.$t("items.taxes"),"content-loading":t(r)},{default:l(()=>[o(k,{modelValue:t(S),"onUpdate:modelValue":a[4]||(a[4]=m=>q(S)?S.value=m:null),"content-loading":t(r),options:t(R),mode:"tags",label:"tax_name",class:"w-full","value-prop":"id","can-deselect":!1,"can-clear":!1,searchable:"","track-by":"tax_name",object:""},null,8,["modelValue","content-loading","options"])]),_:1},8,["label","content-loading"])):L("",!0),o(f,{label:n.$t("items.description"),"content-loading":t(r),error:t(c).currentItem.description.$error&&t(c).currentItem.description.$errors[0].$message},{default:l(()=>[o(Z,{modelValue:t(e).currentItem.description,"onUpdate:modelValue":a[5]||(a[5]=m=>t(e).currentItem.description=m),"content-loading":t(r),name:"description",row:2,rows:"2",onInput:a[6]||(a[6]=m=>t(c).currentItem.description.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading","error"]),j("div",null,[o(ee,{"content-loading":t(r),type:"submit",loading:I.value},{left:l(m=>[I.value?L("",!0):(M(),w(C,{key:0,name:"SaveIcon",class:Ie(m.class)},null,8,["class"]))]),default:l(()=>[E(" "+G(t(B)?n.$t("items.update_item"):n.$t("items.save_item")),1)]),_:1},8,["content-loading","loading"])])]),_:1})]),_:1})],40,he)]),_:1})}}};export{Ue as default}; diff --git a/public/build/assets/CreateCustomFields-hHeYNhLY.js b/public/build/assets/CreateCustomFields-hHeYNhLY.js new file mode 100644 index 00000000..d05e88df --- /dev/null +++ b/public/build/assets/CreateCustomFields-hHeYNhLY.js @@ -0,0 +1,7 @@ +import{e as T,h as E,ad as P,k as I,l as _,av as g,aw as s,r as f,o as a,n as m,w as v,a1 as D,m as n,ac as q,aC as V,z as h,c as y,a as L,L as F,M as O,I as S,a9 as b}from"./main-vzIkKseS.js";import{_ as w}from"./dynamic-import-helper-0gtGTknh.js";const x={props:{field:{type:Object,required:!0},customFieldScope:{type:String,required:!0},index:{type:Number,required:!0},store:{type:Object,required:!0},storeProp:{type:String,required:!0}},setup(e){const t=e,{t:p}=T(),l={value:{required:E.withMessage(p("validation.required"),P(t.field.is_required))}},u=I(l,_(()=>t.field),{$scope:t.customFieldScope}),r=_(()=>t.field.type?g(()=>w(Object.assign({"./types/DateTimeType.vue":()=>s(()=>import("./DateTimeType-hV9WZ_9z.js"),__vite__mapDeps([0,1,2])),"./types/DateType.vue":()=>s(()=>import("./DateType-AuJbnKst.js"),__vite__mapDeps([3,1,2])),"./types/DropdownType.vue":()=>s(()=>import("./DropdownType-dylq9kV9.js"),__vite__mapDeps([4,1,2])),"./types/InputType.vue":()=>s(()=>import("./InputType-L0rMrry9.js"),__vite__mapDeps([5,1,2])),"./types/NumberType.vue":()=>s(()=>import("./NumberType-LSMIEyWL.js"),__vite__mapDeps([6,1,2])),"./types/PhoneType.vue":()=>s(()=>import("./PhoneType-9SsFabB7.js"),__vite__mapDeps([7,1,2])),"./types/SwitchType.vue":()=>s(()=>import("./SwitchType-35txdira.js"),__vite__mapDeps([8,1,2])),"./types/TextAreaType.vue":()=>s(()=>import("./TextAreaType-G_tBc6oP.js"),__vite__mapDeps([9,1,2])),"./types/TimeType.vue":()=>s(()=>import("./TimeType-_QpZML6e.js"),__vite__mapDeps([10,1,2])),"./types/UrlType.vue":()=>s(()=>import("./UrlType-kbgsrP4R.js"),__vite__mapDeps([11,1,2]))}),`./types/${t.field.type}Type.vue`)):!1);return(i,o)=>{const d=f("BaseInputGroup");return a(),m(d,{label:e.field.label,required:!!e.field.is_required,error:n(u).value.$error&&n(u).value.$errors[0].$message},{default:v(()=>[(a(),m(D(n(r)),{modelValue:e.field.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.field.value=c),options:e.field.options,invalid:n(u).value.$error,placeholder:e.field.placeholder},null,8,["modelValue","options","invalid","placeholder"]))]),_:1},8,["label","required","error"])}}},A={key:0},C={props:{store:{type:Object,required:!0},storeProp:{type:String,required:!0},isEdit:{type:Boolean,default:!1},type:{type:String,default:null},gridLayout:{type:String,default:"two-column"},isLoading:{type:Boolean,default:null},customFieldScope:{type:String,required:!0}},setup(e){const t=e,p=q();u();function l(){t.isEdit&&t.store[t.storeProp].fields.forEach(r=>{const i=t.store[t.storeProp].customFields.findIndex(o=>o.id===r.custom_field_id);if(i>-1){let o=r.default_answer;o&&r.custom_field.type==="DateTime"&&(o=b(r.default_answer,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm")),t.store[t.storeProp].customFields[i]={...r,id:r.custom_field_id,value:o,label:r.custom_field.label,options:r.custom_field.options,is_required:r.custom_field.is_required,placeholder:r.custom_field.placeholder,order:r.custom_field.order}}})}async function u(){let i=(await p.fetchCustomFields({type:t.type,limit:"all"})).data.data;i.map(o=>o.value=o.default_answer),t.store[t.storeProp].customFields=V.sortBy(i,o=>o.order),l()}return h(()=>t.store[t.storeProp].fields,r=>{l()}),(r,i)=>{const o=f("BaseInputGrid");return e.store[e.storeProp]&&e.store[e.storeProp].customFields.length>0&&!e.isLoading?(a(),y("div",A,[L(o,{layout:e.gridLayout},{default:v(()=>[(a(!0),y(F,null,O(e.store[e.storeProp].customFields,(d,c)=>(a(),m(x,{key:d.id,"custom-field-scope":e.customFieldScope,store:e.store,"store-prop":e.storeProp,index:c,field:d},null,8,["custom-field-scope","store","store-prop","index","field"]))),128))]),_:1},8,["layout"])])):S("",!0)}}};export{C as _}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/DateTimeType-hV9WZ_9z.js","assets/main-vzIkKseS.js","assets/main-jjUNXUL3.css","assets/DateType-AuJbnKst.js","assets/DropdownType-dylq9kV9.js","assets/InputType-L0rMrry9.js","assets/NumberType-LSMIEyWL.js","assets/PhoneType-9SsFabB7.js","assets/SwitchType-35txdira.js","assets/TextAreaType-G_tBc6oP.js","assets/TimeType-_QpZML6e.js","assets/UrlType-kbgsrP4R.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} diff --git a/public/build/assets/CreateCustomFields.5609a247.js b/public/build/assets/CreateCustomFields.5609a247.js deleted file mode 100644 index a2ba6d41..00000000 --- a/public/build/assets/CreateCustomFields.5609a247.js +++ /dev/null @@ -1 +0,0 @@ -var D=Object.defineProperty,I=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&f(e,r,t[r]);if(y)for(var r of y(t))h.call(t,r)&&f(e,r,t[r]);return e},v=(e,t)=>I(e,g(t));import{J as j,L as w,O as V,T as L,k as T,aE as F,r as E,o as n,l as m,w as P,aj as O,u as c,_ as S,C as x,e as b,f as A,F as R,y as k,j as B,I as C}from"./vendor.fd3b1727.js";import{o as i,m as Y}from"./main.fc26c84f.js";function $(e){switch(e){case"./types/DateTimeType.vue":return i(()=>import("./DateTimeType.4faa64b8.js"),["assets/DateTimeType.4faa64b8.js","assets/vendor.fd3b1727.js"]);case"./types/DateType.vue":return i(()=>import("./DateType.074be010.js"),["assets/DateType.074be010.js","assets/vendor.fd3b1727.js"]);case"./types/DropdownType.vue":return i(()=>import("./DropdownType.f13bd479.js"),["assets/DropdownType.f13bd479.js","assets/vendor.fd3b1727.js"]);case"./types/InputType.vue":return i(()=>import("./InputType.22b7cbab.js"),["assets/InputType.22b7cbab.js","assets/vendor.fd3b1727.js"]);case"./types/NumberType.vue":return i(()=>import("./NumberType.5e07b641.js"),["assets/NumberType.5e07b641.js","assets/vendor.fd3b1727.js"]);case"./types/PhoneType.vue":return i(()=>import("./PhoneType.10fcbacc.js"),["assets/PhoneType.10fcbacc.js","assets/vendor.fd3b1727.js"]);case"./types/SwitchType.vue":return i(()=>import("./SwitchType.522fc982.js"),["assets/SwitchType.522fc982.js","assets/vendor.fd3b1727.js"]);case"./types/TextAreaType.vue":return i(()=>import("./TextAreaType.d6dd293e.js"),["assets/TextAreaType.d6dd293e.js","assets/vendor.fd3b1727.js"]);case"./types/TimeType.vue":return i(()=>import("./TimeType.3f06c579.js"),["assets/TimeType.3f06c579.js","assets/vendor.fd3b1727.js"]);case"./types/UrlType.vue":return i(()=>import("./UrlType.a77493a7.js"),["assets/UrlType.a77493a7.js","assets/vendor.fd3b1727.js"]);default:return new Promise(function(t,r){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+e)))})}}const M={props:{field:{type:Object,required:!0},customFieldScope:{type:String,required:!0},index:{type:Number,required:!0},store:{type:Object,required:!0},storeProp:{type:String,required:!0}},setup(e){const t=e,{t:r}=j(),d={value:{required:w.withMessage(r("validation.required"),V(t.field.is_required))}},a=L(d,T(()=>t.field),{$scope:t.customFieldScope}),o=T(()=>t.field.type?F(()=>$(`./types/${t.field.type}Type.vue`)):!1);return(u,s)=>{const l=E("BaseInputGroup");return n(),m(l,{label:e.field.label,required:!!e.field.is_required,error:c(a).value.$error&&c(a).value.$errors[0].$message},{default:P(()=>[(n(),m(O(c(o)),{modelValue:e.field.value,"onUpdate:modelValue":s[0]||(s[0]=p=>e.field.value=p),options:e.field.options,invalid:c(a).value.$error,placeholder:e.field.placeholder},null,8,["modelValue","options","invalid","placeholder"]))]),_:1},8,["label","required","error"])}}},N={key:0},J={props:{store:{type:Object,required:!0},storeProp:{type:String,required:!0},isEdit:{type:Boolean,default:!1},type:{type:String,default:null},gridLayout:{type:String,default:"two-column"},isLoading:{type:Boolean,default:null},customFieldScope:{type:String,required:!0}},setup(e){const t=e,r=Y();a();function d(){t.isEdit&&t.store[t.storeProp].fields.forEach(o=>{const u=t.store[t.storeProp].customFields.findIndex(s=>s.id===o.custom_field_id);if(u>-1){let s=o.default_answer;s&&o.custom_field.type==="DateTime"&&(s=C(o.default_answer,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm")),t.store[t.storeProp].customFields[u]=v(_({},o),{id:o.custom_field_id,value:s,label:o.custom_field.label,options:o.custom_field.options,is_required:o.custom_field.is_required,placeholder:o.custom_field.placeholder,order:o.custom_field.order})}})}async function a(){let u=(await r.fetchCustomFields({type:t.type,limit:"all"})).data.data;u.map(s=>s.value=s.default_answer),t.store[t.storeProp].customFields=S.sortBy(u,s=>s.order),d()}return x(()=>t.store[t.storeProp].fields,o=>{d()}),(o,u)=>{const s=E("BaseInputGrid");return e.store[e.storeProp]&&e.store[e.storeProp].customFields.length>0&&!e.isLoading?(n(),b("div",N,[A(s,{layout:e.gridLayout},{default:P(()=>[(n(!0),b(R,null,k(e.store[e.storeProp].customFields,(l,p)=>(n(),m(M,{key:l.id,"custom-field-scope":e.customFieldScope,store:e.store,"store-prop":e.storeProp,index:p,field:l},null,8,["custom-field-scope","store","store-prop","index","field"]))),128))]),_:1},8,["layout"])])):B("",!0)}}};export{J as _}; diff --git a/public/build/assets/CustomFieldsSetting-W-qITsqX.js b/public/build/assets/CustomFieldsSetting-W-qITsqX.js new file mode 100644 index 00000000..31497959 --- /dev/null +++ b/public/build/assets/CustomFieldsSetting-W-qITsqX.js @@ -0,0 +1,7 @@ +import{a5 as ne,u as re,e as G,ac as K,J as ue,K as ee,D as Y,a3 as te,r as i,o as C,n as F,w as r,a as s,m as e,O as L,q as D,t as w,I as A,g as U,c as j,au as ie,s as le,F as W,l as B,av as de,aw as g,h as q,i as k,ap as me,k as ce,b as O,p as Z,M as pe,H as z,L as _e,a1 as fe,a4 as ve}from"./main-vzIkKseS.js";import{_ as Ce}from"./dynamic-import-helper-0gtGTknh.js";const ye={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(M){const p=M,t=ne();re();const{t:u}=G(),v=K();ue();const _=ee(),d=Y();te("utils");async function m(y){await v.fetchCustomField(y),d.openModal({title:u("settings.custom_fields.edit_custom_field"),componentName:"CustomFieldModal",size:"sm",data:y,refreshData:p.loadData})}async function h(y){t.openDialog({title:u("general.are_you_sure"),message:u("settings.custom_fields.custom_field_confirm_delete"),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async b=>{b&&(await v.deleteCustomFields(y),p.loadData&&p.loadData())})}return(y,b)=>{const f=i("BaseIcon"),T=i("BaseDropdownItem"),I=i("BaseDropdown");return C(),F(I,null,{activator:r(()=>[s(f,{name:"DotsHorizontalIcon",class:"h-5 text-gray-500"})]),default:r(()=>[e(_).hasAbilities(e(L).EDIT_CUSTOM_FIELDS)?(C(),F(T,{key:0,onClick:b[0]||(b[0]=o=>m(M.row.id))},{default:r(()=>[s(f,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+w(y.$t("general.edit")),1)]),_:1})):A("",!0),e(_).hasAbilities(e(L).DELETE_CUSTOM_FIELDS)?(C(),F(T,{key:1,onClick:b[1]||(b[1]=o=>h(M.row.id))},{default:r(()=>[s(f,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+w(y.$t("general.delete")),1)]),_:1})):A("",!0)]),_:1})}}},be={class:"flex items-center mt-1"},ge={emits:["onAdd"],setup(M,{emit:p}){const t=U(null);function u(){if(t.value==null||t.value==""||t.value==null)return!0;p("onAdd",t.value),t.value=null}return(v,_)=>{const d=i("BaseInput"),m=i("BaseIcon");return C(),j("div",be,[s(d,{modelValue:t.value,"onUpdate:modelValue":_[0]||(_[0]=h=>t.value=h),type:"text",class:"w-full md:w-96",placeholder:v.$t("settings.custom_fields.press_enter_to_add"),onClick:u,onKeydown:ie(le(u,["prevent","stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),s(m,{name:"PlusCircleIcon",class:"ml-1 text-primary-500 cursor-pointer",onClick:u})])}}},Fe={class:"flex justify-between w-full"},$e=["onSubmit"],we={class:"overflow-y-auto max-h-[550px]"},Te={class:"px-4 md:px-8 py-8 overflow-y-auto sm:p-6"},Ie={class:"z-0 flex justify-end p-4 border-t border-solid border-gray-light border-modal-bg"},Be={setup(M){const p=Y(),t=K(),{t:u}=G();let v=U(!1);const _=W(["Customer","Invoice","Estimate","Expense","Payment"]),d=W([{label:"Text",value:"Input"},{label:"Textarea",value:"TextArea"},{label:"Phone",value:"Phone"},{label:"URL",value:"Url"},{label:"Number",value:"Number"},{label:"Select Field",value:"Dropdown"},{label:"Switch Toggle",value:"Switch"},{label:"Date",value:"Date"},{label:"Time",value:"Time"},{label:"Date & Time",value:"DateTime"}]);let m=U(d[0]);const h=B(()=>p.active&&p.componentName==="CustomFieldModal"),y=B(()=>m.value&&m.value.label==="Switch Toggle"),b=B(()=>m.value&&m.value.label==="Select Field"),f=B(()=>t.currentCustomField.type?de(()=>Ce(Object.assign({"../../custom-fields/types/DateTimeType.vue":()=>g(()=>import("./DateTimeType-hV9WZ_9z.js"),__vite__mapDeps([0,1,2])),"../../custom-fields/types/DateType.vue":()=>g(()=>import("./DateType-AuJbnKst.js"),__vite__mapDeps([3,1,2])),"../../custom-fields/types/DropdownType.vue":()=>g(()=>import("./DropdownType-dylq9kV9.js"),__vite__mapDeps([4,1,2])),"../../custom-fields/types/InputType.vue":()=>g(()=>import("./InputType-L0rMrry9.js"),__vite__mapDeps([5,1,2])),"../../custom-fields/types/NumberType.vue":()=>g(()=>import("./NumberType-LSMIEyWL.js"),__vite__mapDeps([6,1,2])),"../../custom-fields/types/PhoneType.vue":()=>g(()=>import("./PhoneType-9SsFabB7.js"),__vite__mapDeps([7,1,2])),"../../custom-fields/types/SwitchType.vue":()=>g(()=>import("./SwitchType-35txdira.js"),__vite__mapDeps([8,1,2])),"../../custom-fields/types/TextAreaType.vue":()=>g(()=>import("./TextAreaType-G_tBc6oP.js"),__vite__mapDeps([9,1,2])),"../../custom-fields/types/TimeType.vue":()=>g(()=>import("./TimeType-_QpZML6e.js"),__vite__mapDeps([10,1,2])),"../../custom-fields/types/UrlType.vue":()=>g(()=>import("./UrlType-kbgsrP4R.js"),__vite__mapDeps([11,1,2]))}),`../../custom-fields/types/${t.currentCustomField.type}Type.vue`)):!1),T=B({get:()=>t.currentCustomField.is_required===1,set:l=>{const a=l?1:0;t.currentCustomField.is_required=a}}),I=B(()=>({currentCustomField:{type:{required:q.withMessage(u("validation.required"),k)},name:{required:q.withMessage(u("validation.required"),k)},label:{required:q.withMessage(u("validation.required"),k)},model_type:{required:q.withMessage(u("validation.required"),k)},order:{required:q.withMessage(u("validation.required"),k),numeric:q.withMessage(u("validation.numbers_only"),me)},type:{required:q.withMessage(u("validation.required"),k)}}})),o=ce(I,B(()=>t));function V(){t.isEdit?m.value=d.find(l=>l.value==t.currentCustomField.type):(t.currentCustomField.model_type=_[0],t.currentCustomField.type=d[0].value,m.value=d[0])}async function x(){if(o.value.currentCustomField.$touch(),o.value.currentCustomField.$invalid)return!0;v.value=!0;let l={...t.currentCustomField};if(t.currentCustomField.options&&(l.options=t.currentCustomField.options.map(S=>S.name)),l.type=="Time"&&typeof l.default_answer=="object"){let S=l&&l.default_answer&&l.default_answer.HH?l.default_answer.HH:null,E=l&&l.default_answer&&l.default_answer.mm?l.default_answer.mm:null;l&&l.default_answer&&l.default_answer.ss&&l.default_answer.ss,l.default_answer=`${S}:${E}`}await(t.isEdit?t.updateCustomField:t.addCustomField)(l),v.value=!1,p.refreshData&&p.refreshData(),H()}function N(l){t.currentCustomField.options=[{name:l},...t.currentCustomField.options]}function c(l){if(t.isEdit&&t.currentCustomField.in_use)return;t.currentCustomField.options[l].name===t.currentCustomField.default_answer&&(t.currentCustomField.default_answer=null),t.currentCustomField.options.splice(l,1)}function R(l){t.currentCustomField.type=l.value}function H(){p.closeModal(),setTimeout(()=>{t.resetCurrentCustomField(),o.value.$reset()},300)}return(l,a)=>{const S=i("BaseIcon"),E=i("BaseInput"),$=i("BaseInputGroup"),J=i("BaseMultiselect"),se=i("BaseSwitch"),oe=i("BaseInputGrid"),X=i("BaseButton"),ae=i("BaseModal");return C(),F(ae,{show:e(h),onOpen:V},{header:r(()=>[O("div",Fe,[D(w(e(p).title)+" ",1),s(S,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:H})])]),default:r(()=>[O("form",{action:"",onSubmit:le(x,["prevent"])},[O("div",we,[O("div",Te,[s(oe,{layout:"one-column"},{default:r(()=>[s($,{label:l.$t("settings.custom_fields.name"),required:"",error:e(o).currentCustomField.name.$error&&e(o).currentCustomField.name.$errors[0].$message},{default:r(()=>[s(E,{ref:(n,P)=>{P.name=n},modelValue:e(t).currentCustomField.name,"onUpdate:modelValue":a[0]||(a[0]=n=>e(t).currentCustomField.name=n),invalid:e(o).currentCustomField.name.$error,onInput:a[1]||(a[1]=n=>e(o).currentCustomField.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),s($,{label:l.$t("settings.custom_fields.model"),error:e(o).currentCustomField.model_type.$error&&e(o).currentCustomField.model_type.$errors[0].$message,"help-text":e(t).currentCustomField.in_use?l.$t("settings.custom_fields.model_in_use"):"",required:""},{default:r(()=>[s(J,{modelValue:e(t).currentCustomField.model_type,"onUpdate:modelValue":a[2]||(a[2]=n=>e(t).currentCustomField.model_type=n),options:e(_),"can-deselect":!1,invalid:e(o).currentCustomField.model_type.$error,searchable:!0,disabled:e(t).currentCustomField.in_use,onInput:a[3]||(a[3]=n=>e(o).currentCustomField.model_type.$touch())},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),s($,{class:"flex items-center space-x-4",label:l.$t("settings.custom_fields.required")},{default:r(()=>[s(se,{modelValue:e(T),"onUpdate:modelValue":a[4]||(a[4]=n=>Z(T)?T.value=n:null)},null,8,["modelValue"])]),_:1},8,["label"]),s($,{label:l.$t("settings.custom_fields.type"),error:e(o).currentCustomField.type.$error&&e(o).currentCustomField.type.$errors[0].$message,"help-text":e(t).currentCustomField.in_use?l.$t("settings.custom_fields.type_in_use"):"",required:""},{default:r(()=>[s(J,{modelValue:e(m),"onUpdate:modelValue":[a[5]||(a[5]=n=>Z(m)?m.value=n:m=n),R],options:e(d),invalid:e(o).currentCustomField.type.$error,disabled:e(t).currentCustomField.in_use,searchable:!0,"can-deselect":!1,object:""},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),s($,{label:l.$t("settings.custom_fields.label"),required:"",error:e(o).currentCustomField.label.$error&&e(o).currentCustomField.label.$errors[0].$message},{default:r(()=>[s(E,{modelValue:e(t).currentCustomField.label,"onUpdate:modelValue":a[6]||(a[6]=n=>e(t).currentCustomField.label=n),invalid:e(o).currentCustomField.label.$error,onInput:a[7]||(a[7]=n=>e(o).currentCustomField.label.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),e(b)?(C(),F($,{key:0,label:l.$t("settings.custom_fields.options")},{default:r(()=>[s(ge,{onOnAdd:N}),(C(!0),j(_e,null,pe(e(t).currentCustomField.options,(n,P)=>(C(),j("div",{key:P,class:"flex items-center mt-5"},[s(E,{modelValue:n.name,"onUpdate:modelValue":Q=>n.name=Q,class:"w-64"},null,8,["modelValue","onUpdate:modelValue"]),s(S,{name:"MinusCircleIcon",class:z(["ml-1 cursor-pointer",e(t).currentCustomField.in_use?"text-gray-300":"text-red-300"]),onClick:Q=>c(P)},null,8,["class","onClick"])]))),128))]),_:1},8,["label"])):A("",!0),s($,{label:l.$t("settings.custom_fields.default_value"),class:"relative"},{default:r(()=>[(C(),F(fe(e(f)),{modelValue:e(t).currentCustomField.default_answer,"onUpdate:modelValue":a[8]||(a[8]=n=>e(t).currentCustomField.default_answer=n),options:e(t).currentCustomField.options,"default-date-time":e(t).currentCustomField.dateTimeValue},null,8,["modelValue","options","default-date-time"]))]),_:1},8,["label"]),e(y)?A("",!0):(C(),F($,{key:1,label:l.$t("settings.custom_fields.placeholder")},{default:r(()=>[s(E,{modelValue:e(t).currentCustomField.placeholder,"onUpdate:modelValue":a[9]||(a[9]=n=>e(t).currentCustomField.placeholder=n)},null,8,["modelValue"])]),_:1},8,["label"])),s($,{label:l.$t("settings.custom_fields.order"),error:e(o).currentCustomField.order.$error&&e(o).currentCustomField.order.$errors[0].$message,required:""},{default:r(()=>[s(E,{modelValue:e(t).currentCustomField.order,"onUpdate:modelValue":a[10]||(a[10]=n=>e(t).currentCustomField.order=n),type:"number",invalid:e(o).currentCustomField.order.$error,onInput:a[11]||(a[11]=n=>e(o).currentCustomField.order.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),_:1})])]),O("div",Ie,[s(X,{class:"mr-3",type:"button",variant:"primary-outline",onClick:H},{default:r(()=>[D(w(l.$t("general.cancel")),1)]),_:1}),s(X,{variant:"primary",loading:e(v),disabled:e(v),type:"submit"},{left:r(n=>[e(v)?A("",!0):(C(),F(S,{key:0,class:z(n.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[D(" "+w(e(t).isEdit?l.$t("general.update"):l.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,$e)]),_:1},8,["show"])}}},De={class:"text-xs text-gray-500"},Se={setup(M){const p=Y(),t=K(),u=ee(),v=te("utils"),{t:_}=G(),d=U(null),m=B(()=>[{key:"name",label:_("settings.custom_fields.name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"model_type",label:_("settings.custom_fields.model")},{key:"type",label:_("settings.custom_fields.type")},{key:"is_required",label:_("settings.custom_fields.required")},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function h({page:f,filter:T,sort:I}){let o={orderByField:I.fieldName||"created_at",orderBy:I.order||"desc",page:f},V=await t.fetchCustomFields(o);return{data:V.data.data,pagination:{totalPages:V.data.meta.last_page,currentPage:f,limit:5,totalCount:V.data.meta.total}}}function y(){p.openModal({title:_("settings.custom_fields.add_custom_field"),componentName:"CustomFieldModal",size:"sm",refreshData:d.value&&d.value.refresh})}async function b(){d.value&&d.value.refresh()}return(f,T)=>{const I=i("BaseIcon"),o=i("BaseButton"),V=i("BaseBadge"),x=i("BaseTable"),N=i("BaseSettingCard");return C(),F(N,{title:f.$t("settings.menu_title.custom_fields"),description:f.$t("settings.custom_fields.section_description")},{action:r(()=>[e(u).hasAbilities(e(L).CREATE_CUSTOM_FIELDS)?(C(),F(o,{key:0,variant:"primary-outline",onClick:y},{left:r(c=>[s(I,{class:z(c.class),name:"PlusIcon"},null,8,["class"]),D(" "+w(f.$t("settings.custom_fields.add_custom_field")),1)]),_:1})):A("",!0)]),default:r(()=>[s(Be),s(x,{ref:(c,R)=>{R.table=c,d.value=c},data:h,columns:e(m),class:"mt-16"},ve({"cell-name":r(({row:c})=>[D(w(c.data.name)+" ",1),O("span",De," ("+w(c.data.slug)+")",1)]),"cell-is_required":r(({row:c})=>[s(V,{"bg-color":e(v).getBadgeStatusColor(c.data.is_required?"YES":"NO").bgColor,color:e(v).getBadgeStatusColor(c.data.is_required?"YES":"NO").color},{default:r(()=>[D(w(c.data.is_required?f.$t("settings.custom_fields.yes"):f.$t("settings.custom_fields.no").replace("_"," ")),1)]),_:2},1032,["bg-color","color"])]),_:2},[e(u).hasAbilities([e(L).DELETE_CUSTOM_FIELDS,e(L).EDIT_CUSTOM_FIELDS])?{name:"cell-actions",fn:r(({row:c})=>[s(ye,{row:c.data,table:d.value,"load-data":b},null,8,["row","table"])])}:void 0]),1032,["columns"])]),_:1},8,["title","description"])}}};export{Se as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/DateTimeType-hV9WZ_9z.js","assets/main-vzIkKseS.js","assets/main-jjUNXUL3.css","assets/DateType-AuJbnKst.js","assets/DropdownType-dylq9kV9.js","assets/InputType-L0rMrry9.js","assets/NumberType-LSMIEyWL.js","assets/PhoneType-9SsFabB7.js","assets/SwitchType-35txdira.js","assets/TextAreaType-G_tBc6oP.js","assets/TimeType-_QpZML6e.js","assets/UrlType-kbgsrP4R.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} diff --git a/public/build/assets/CustomFieldsSetting.5910326d.js b/public/build/assets/CustomFieldsSetting.5910326d.js deleted file mode 100644 index 9e18dc65..00000000 --- a/public/build/assets/CustomFieldsSetting.5910326d.js +++ /dev/null @@ -1 +0,0 @@ -var ie=Object.defineProperty;var W=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var Z=(m,n,e)=>n in m?ie(m,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[n]=e,ee=(m,n)=>{for(var e in n||(n={}))de.call(n,e)&&Z(m,e,n[e]);if(W)for(var e of W(n))me.call(n,e)&&Z(m,e,n[e]);return m};import{J as H,G as ce,ah as te,r as d,o as C,l as F,w as u,f as l,u as t,i as B,t as $,j as M,B as L,e as z,aY as pe,U as se,a0 as le,k as D,aE as _e,L as k,M as A,aT as fe,T as ye,h as O,x as oe,y as ve,m as G,F as Ce,aj as be,V as ge}from"./vendor.fd3b1727.js";import{j as Fe,u as Te,m as K,e as ae,c as Y,g as U,o as T}from"./main.fc26c84f.js";const we={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(m){const n=m,e=Fe();Te();const{t:i}=H(),v=K();ce();const f=ae(),c=Y();te("utils");async function p(b){await v.fetchCustomField(b),c.openModal({title:i("settings.custom_fields.edit_custom_field"),componentName:"CustomFieldModal",size:"sm",data:b,refreshData:n.loadData})}async function V(b){e.openDialog({title:i("general.are_you_sure"),message:i("settings.custom_fields.custom_field_confirm_delete"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async g=>{g&&(await v.deleteCustomFields(b),n.loadData&&n.loadData())})}return(b,g)=>{const y=d("BaseIcon"),I=d("BaseDropdownItem"),h=d("BaseDropdown");return C(),F(h,null,{activator:u(()=>[l(y,{name:"DotsHorizontalIcon",class:"h-5 text-gray-500"})]),default:u(()=>[t(f).hasAbilities(t(U).EDIT_CUSTOM_FIELDS)?(C(),F(I,{key:0,onClick:g[0]||(g[0]=o=>p(m.row.id))},{default:u(()=>[l(y,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),B(" "+$(b.$t("general.edit")),1)]),_:1})):M("",!0),t(f).hasAbilities(t(U).DELETE_CUSTOM_FIELDS)?(C(),F(I,{key:1,onClick:g[1]||(g[1]=o=>V(m.row.id))},{default:u(()=>[l(y,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),B(" "+$(b.$t("general.delete")),1)]),_:1})):M("",!0)]),_:1})}}},$e={class:"flex items-center mt-1"},Ie={emits:["onAdd"],setup(m,{emit:n}){const e=L(null);function i(){if(e.value==null||e.value==""||e.value==null)return!0;n("onAdd",e.value),e.value=null}return(v,f)=>{const c=d("BaseInput"),p=d("BaseIcon");return C(),z("div",$e,[l(c,{modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=V=>e.value=V),type:"text",class:"w-full md:w-96",placeholder:v.$t("settings.custom_fields.press_enter_to_add"),onClick:i,onKeydown:pe(se(i,["prevent","stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),l(p,{name:"PlusCircleIcon",class:"ml-1 text-primary-500 cursor-pointer",onClick:i})])}}};function he(m){switch(m){case"../../custom-fields/types/DateTimeType.vue":return T(()=>import("./DateTimeType.4faa64b8.js"),["assets/DateTimeType.4faa64b8.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/DateType.vue":return T(()=>import("./DateType.074be010.js"),["assets/DateType.074be010.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/DropdownType.vue":return T(()=>import("./DropdownType.f13bd479.js"),["assets/DropdownType.f13bd479.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/InputType.vue":return T(()=>import("./InputType.22b7cbab.js"),["assets/InputType.22b7cbab.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/NumberType.vue":return T(()=>import("./NumberType.5e07b641.js"),["assets/NumberType.5e07b641.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/PhoneType.vue":return T(()=>import("./PhoneType.10fcbacc.js"),["assets/PhoneType.10fcbacc.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/SwitchType.vue":return T(()=>import("./SwitchType.522fc982.js"),["assets/SwitchType.522fc982.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/TextAreaType.vue":return T(()=>import("./TextAreaType.d6dd293e.js"),["assets/TextAreaType.d6dd293e.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/TimeType.vue":return T(()=>import("./TimeType.3f06c579.js"),["assets/TimeType.3f06c579.js","assets/vendor.fd3b1727.js"]);case"../../custom-fields/types/UrlType.vue":return T(()=>import("./UrlType.a77493a7.js"),["assets/UrlType.a77493a7.js","assets/vendor.fd3b1727.js"]);default:return new Promise(function(n,e){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(e.bind(null,new Error("Unknown variable dynamic import: "+m)))})}}const Be={class:"flex justify-between w-full"},De=["onSubmit"],Ve={class:"overflow-y-auto max-h-[550px]"},Se={class:"px-4 md:px-8 py-8 overflow-y-auto sm:p-6"},Ee={class:"z-0 flex justify-end p-4 border-t border-solid border-gray-light border-modal-bg"},qe={setup(m){const n=Y(),e=K(),{t:i}=H();let v=L(!1);const f=le(["Customer","Invoice","Estimate","Expense","Payment"]),c=le([{label:"Text",value:"Input"},{label:"Textarea",value:"TextArea"},{label:"Phone",value:"Phone"},{label:"URL",value:"Url"},{label:"Number",value:"Number"},{label:"Select Field",value:"Dropdown"},{label:"Switch Toggle",value:"Switch"},{label:"Date",value:"Date"},{label:"Time",value:"Time"},{label:"Date & Time",value:"DateTime"}]);let p=L(c[0]);const V=D(()=>n.active&&n.componentName==="CustomFieldModal"),b=D(()=>p.value&&p.value.label==="Switch Toggle"),g=D(()=>p.value&&p.value.label==="Select Field"),y=D(()=>e.currentCustomField.type?_e(()=>he(`../../custom-fields/types/${e.currentCustomField.type}Type.vue`)):!1),I=D({get:()=>e.currentCustomField.is_required===1,set:s=>{const a=s?1:0;e.currentCustomField.is_required=a}}),h=D(()=>({currentCustomField:{type:{required:k.withMessage(i("validation.required"),A)},name:{required:k.withMessage(i("validation.required"),A)},label:{required:k.withMessage(i("validation.required"),A)},model_type:{required:k.withMessage(i("validation.required"),A)},order:{required:k.withMessage(i("validation.required"),A),numeric:k.withMessage(i("validation.numbers_only"),fe)},type:{required:k.withMessage(i("validation.required"),A)}}})),o=ye(h,D(()=>e));function S(){e.isEdit?p.value=c.find(s=>s.value==e.currentCustomField.type):(e.currentCustomField.model_type=f[0],e.currentCustomField.type=c[0].value,p.value=c[0])}async function P(){if(o.value.currentCustomField.$touch(),o.value.currentCustomField.$invalid)return!0;v.value=!0;let s=ee({},e.currentCustomField);if(e.currentCustomField.options&&(s.options=e.currentCustomField.options.map(E=>E.name)),s.type=="Time"&&typeof s.default_answer=="object"){let E=s&&s.default_answer&&s.default_answer.HH?s.default_answer.HH:null,q=s&&s.default_answer&&s.default_answer.mm?s.default_answer.mm:null;s&&s.default_answer&&s.default_answer.ss&&s.default_answer.ss,s.default_answer=`${E}:${q}`}await(e.isEdit?e.updateCustomField:e.addCustomField)(s),v.value=!1,n.refreshData&&n.refreshData(),R()}function x(s){e.currentCustomField.options=[{name:s},...e.currentCustomField.options]}function _(s){if(e.isEdit&&e.currentCustomField.in_use)return;e.currentCustomField.options[s].name===e.currentCustomField.default_answer&&(e.currentCustomField.default_answer=null),e.currentCustomField.options.splice(s,1)}function N(s){e.currentCustomField.type=s.value}function R(){n.closeModal(),setTimeout(()=>{e.resetCurrentCustomField(),o.value.$reset()},300)}return(s,a)=>{const E=d("BaseIcon"),q=d("BaseInput"),w=d("BaseInputGroup"),J=d("BaseMultiselect"),re=d("BaseSwitch"),ne=d("BaseInputGrid"),X=d("BaseButton"),ue=d("BaseModal");return C(),F(ue,{show:t(V),onOpen:S},{header:u(()=>[O("div",Be,[B($(t(n).title)+" ",1),l(E,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:R})])]),default:u(()=>[O("form",{action:"",onSubmit:se(P,["prevent"])},[O("div",Ve,[O("div",Se,[l(ne,{layout:"one-column"},{default:u(()=>[l(w,{label:s.$t("settings.custom_fields.name"),required:"",error:t(o).currentCustomField.name.$error&&t(o).currentCustomField.name.$errors[0].$message},{default:u(()=>[l(q,{ref:(r,j)=>{j.name=r},modelValue:t(e).currentCustomField.name,"onUpdate:modelValue":a[0]||(a[0]=r=>t(e).currentCustomField.name=r),invalid:t(o).currentCustomField.name.$error,onInput:a[1]||(a[1]=r=>t(o).currentCustomField.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),l(w,{label:s.$t("settings.custom_fields.model"),error:t(o).currentCustomField.model_type.$error&&t(o).currentCustomField.model_type.$errors[0].$message,"help-text":t(e).currentCustomField.in_use?s.$t("settings.custom_fields.model_in_use"):"",required:""},{default:u(()=>[l(J,{modelValue:t(e).currentCustomField.model_type,"onUpdate:modelValue":a[2]||(a[2]=r=>t(e).currentCustomField.model_type=r),options:t(f),"can-deselect":!1,invalid:t(o).currentCustomField.model_type.$error,searchable:!0,disabled:t(e).currentCustomField.in_use,onInput:a[3]||(a[3]=r=>t(o).currentCustomField.model_type.$touch())},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),l(w,{class:"flex items-center space-x-4",label:s.$t("settings.custom_fields.required")},{default:u(()=>[l(re,{modelValue:t(I),"onUpdate:modelValue":a[4]||(a[4]=r=>oe(I)?I.value=r:null)},null,8,["modelValue"])]),_:1},8,["label"]),l(w,{label:s.$t("settings.custom_fields.type"),error:t(o).currentCustomField.type.$error&&t(o).currentCustomField.type.$errors[0].$message,"help-text":t(e).currentCustomField.in_use?s.$t("settings.custom_fields.type_in_use"):"",required:""},{default:u(()=>[l(J,{modelValue:t(p),"onUpdate:modelValue":[a[5]||(a[5]=r=>oe(p)?p.value=r:p=r),N],options:t(c),invalid:t(o).currentCustomField.type.$error,disabled:t(e).currentCustomField.in_use,searchable:!0,"can-deselect":!1,object:""},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),l(w,{label:s.$t("settings.custom_fields.label"),required:"",error:t(o).currentCustomField.label.$error&&t(o).currentCustomField.label.$errors[0].$message},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.label,"onUpdate:modelValue":a[6]||(a[6]=r=>t(e).currentCustomField.label=r),invalid:t(o).currentCustomField.label.$error,onInput:a[7]||(a[7]=r=>t(o).currentCustomField.label.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),t(g)?(C(),F(w,{key:0,label:s.$t("settings.custom_fields.options")},{default:u(()=>[l(Ie,{onOnAdd:x}),(C(!0),z(Ce,null,ve(t(e).currentCustomField.options,(r,j)=>(C(),z("div",{key:j,class:"flex items-center mt-5"},[l(q,{modelValue:r.name,"onUpdate:modelValue":Q=>r.name=Q,class:"w-64"},null,8,["modelValue","onUpdate:modelValue"]),l(E,{name:"MinusCircleIcon",class:G(["ml-1 cursor-pointer",t(e).currentCustomField.in_use?"text-gray-300":"text-red-300"]),onClick:Q=>_(j)},null,8,["class","onClick"])]))),128))]),_:1},8,["label"])):M("",!0),l(w,{label:s.$t("settings.custom_fields.default_value"),class:"relative"},{default:u(()=>[(C(),F(be(t(y)),{modelValue:t(e).currentCustomField.default_answer,"onUpdate:modelValue":a[8]||(a[8]=r=>t(e).currentCustomField.default_answer=r),options:t(e).currentCustomField.options,"default-date-time":t(e).currentCustomField.dateTimeValue},null,8,["modelValue","options","default-date-time"]))]),_:1},8,["label"]),t(b)?M("",!0):(C(),F(w,{key:1,label:s.$t("settings.custom_fields.placeholder")},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.placeholder,"onUpdate:modelValue":a[9]||(a[9]=r=>t(e).currentCustomField.placeholder=r)},null,8,["modelValue"])]),_:1},8,["label"])),l(w,{label:s.$t("settings.custom_fields.order"),error:t(o).currentCustomField.order.$error&&t(o).currentCustomField.order.$errors[0].$message,required:""},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.order,"onUpdate:modelValue":a[10]||(a[10]=r=>t(e).currentCustomField.order=r),type:"number",invalid:t(o).currentCustomField.order.$error,onInput:a[11]||(a[11]=r=>t(o).currentCustomField.order.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),_:1})])]),O("div",Ee,[l(X,{class:"mr-3",type:"button",variant:"primary-outline",onClick:R},{default:u(()=>[B($(s.$t("general.cancel")),1)]),_:1}),l(X,{variant:"primary",loading:t(v),disabled:t(v),type:"submit"},{left:u(r=>[t(v)?M("",!0):(C(),F(E,{key:0,class:G(r.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[B(" "+$(t(e).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,De)]),_:1},8,["show"])}}},ke={class:"text-xs text-gray-500"},Ue={setup(m){const n=Y(),e=K(),i=ae(),v=te("utils"),{t:f}=H(),c=L(null),p=D(()=>[{key:"name",label:f("settings.custom_fields.name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"model_type",label:f("settings.custom_fields.model")},{key:"type",label:f("settings.custom_fields.type")},{key:"is_required",label:f("settings.custom_fields.required")},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function V({page:y,filter:I,sort:h}){let o={orderByField:h.fieldName||"created_at",orderBy:h.order||"desc",page:y},S=await e.fetchCustomFields(o);return{data:S.data.data,pagination:{totalPages:S.data.meta.last_page,currentPage:y,limit:5,totalCount:S.data.meta.total}}}function b(){n.openModal({title:f("settings.custom_fields.add_custom_field"),componentName:"CustomFieldModal",size:"sm",refreshData:c.value&&c.value.refresh})}async function g(){c.value&&c.value.refresh()}return(y,I)=>{const h=d("BaseIcon"),o=d("BaseButton"),S=d("BaseBadge"),P=d("BaseTable"),x=d("BaseSettingCard");return C(),F(x,{title:y.$t("settings.menu_title.custom_fields"),description:y.$t("settings.custom_fields.section_description")},{action:u(()=>[t(i).hasAbilities(t(U).CREATE_CUSTOM_FIELDS)?(C(),F(o,{key:0,variant:"primary-outline",onClick:b},{left:u(_=>[l(h,{class:G(_.class),name:"PlusIcon"},null,8,["class"]),B(" "+$(y.$t("settings.custom_fields.add_custom_field")),1)]),_:1})):M("",!0)]),default:u(()=>[l(qe),l(P,{ref:(_,N)=>{N.table=_,c.value=_},data:V,columns:t(p),class:"mt-16"},ge({"cell-name":u(({row:_})=>[B($(_.data.name)+" ",1),O("span",ke," ("+$(_.data.slug)+")",1)]),"cell-is_required":u(({row:_})=>[l(S,{"bg-color":t(v).getBadgeStatusColor(_.data.is_required?"YES":"NO").bgColor,color:t(v).getBadgeStatusColor(_.data.is_required?"YES":"NO").color},{default:u(()=>[B($(_.data.is_required?y.$t("settings.custom_fields.yes"):y.$t("settings.custom_fields.no").replace("_"," ")),1)]),_:2},1032,["bg-color","color"])]),_:2},[t(i).hasAbilities([t(U).DELETE_CUSTOM_FIELDS,t(U).EDIT_CUSTOM_FIELDS])?{name:"cell-actions",fn:u(({row:_})=>[l(we,{row:_.data,table:c.value,"load-data":g},null,8,["row","table"])])}:void 0]),1032,["columns"])]),_:1},8,["title","description"])}}};export{Ue as default}; diff --git a/public/build/assets/CustomerIndexDropdown-dSzhysTu.js b/public/build/assets/CustomerIndexDropdown-dSzhysTu.js new file mode 100644 index 00000000..77671db3 --- /dev/null +++ b/public/build/assets/CustomerIndexDropdown-dSzhysTu.js @@ -0,0 +1 @@ +import{a6 as S,u as C,a5 as b,K as x,e as E,J as T,f as O,a3 as $,r as l,o as a,n as s,w as t,m as e,a as n,O as g,q as p,t as f,I as y}from"./main-vzIkKseS.js";const V={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(i){const w=i,_=S();C();const v=b(),m=x(),{t:u}=E(),h=T();O(),$("utils");function B(r){v.openDialog({title:u("general.are_you_sure"),message:u("customers.confirm_delete",1),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(c=>{c&&_.deleteCustomer({ids:[r]}).then(o=>{if(o.data.success)return w.loadData&&w.loadData(),!0})})}return(r,c)=>{const o=l("BaseIcon"),I=l("BaseButton"),d=l("BaseDropdownItem"),D=l("router-link"),k=l("BaseDropdown");return a(),s(k,{"content-loading":e(_).isFetchingViewData},{activator:t(()=>[e(h).name==="customers.view"?(a(),s(I,{key:0,variant:"primary"},{default:t(()=>[n(o,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),s(o,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[e(m).hasAbilities(e(g).EDIT_CUSTOMER)?(a(),s(D,{key:0,to:`/admin/customers/${i.row.id}/edit`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(h).name!=="customers.view"&&e(m).hasAbilities(e(g).VIEW_CUSTOMER)?(a(),s(D,{key:1,to:`customers/${i.row.id}/view`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(m).hasAbilities(e(g).DELETE_CUSTOMER)?(a(),s(d,{key:2,onClick:c[0]||(c[0]=N=>B(i.row.id))},{default:t(()=>[n(o,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.delete")),1)]),_:1})):y("",!0)]),_:1},8,["content-loading"])}}};export{V as _}; diff --git a/public/build/assets/CustomerIndexDropdown.44b8afc5.js b/public/build/assets/CustomerIndexDropdown.44b8afc5.js deleted file mode 100644 index 8f3ad9f4..00000000 --- a/public/build/assets/CustomerIndexDropdown.44b8afc5.js +++ /dev/null @@ -1 +0,0 @@ -import{l as S,u as b,j as C,e as x,g}from"./main.fc26c84f.js";import{J as E,G as j,aN as T,ah as N,r as l,o as a,l as s,w as t,u as e,f as n,i as f,t as p,j as y}from"./vendor.fd3b1727.js";const V={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(i){const w=i,_=S();b();const v=C(),m=x(),{t:u}=E(),h=j();T(),N("utils");function B(r){v.openDialog({title:u("general.are_you_sure"),message:u("customers.confirm_delete",1),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(c=>{c&&_.deleteCustomer({ids:[r]}).then(o=>{if(o.data.success)return w.loadData&&w.loadData(),!0})})}return(r,c)=>{const o=l("BaseIcon"),I=l("BaseButton"),d=l("BaseDropdownItem"),D=l("router-link"),k=l("BaseDropdown");return a(),s(k,{"content-loading":e(_).isFetchingViewData},{activator:t(()=>[e(h).name==="customers.view"?(a(),s(I,{key:0,variant:"primary"},{default:t(()=>[n(o,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),s(o,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[e(m).hasAbilities(e(g).EDIT_CUSTOMER)?(a(),s(D,{key:0,to:`/admin/customers/${i.row.id}/edit`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),f(" "+p(r.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(h).name!=="customers.view"&&e(m).hasAbilities(e(g).VIEW_CUSTOMER)?(a(),s(D,{key:1,to:`customers/${i.row.id}/view`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),f(" "+p(r.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(m).hasAbilities(e(g).DELETE_CUSTOMER)?(a(),s(d,{key:2,onClick:c[0]||(c[0]=$=>B(i.row.id))},{default:t(()=>[n(o,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),f(" "+p(r.$t("general.delete")),1)]),_:1})):y("",!0)]),_:1},8,["content-loading"])}}};export{V as _}; diff --git a/public/build/assets/CustomerSettings-x29BvxZg.js b/public/build/assets/CustomerSettings-x29BvxZg.js new file mode 100644 index 00000000..60b97211 --- /dev/null +++ b/public/build/assets/CustomerSettings-x29BvxZg.js @@ -0,0 +1 @@ +import{J as G,e as A,g as p,l as C,h as c,i as k,G as S,j as D,Z as L,k as P,r as v,o as g,c as O,a as u,w as i,b as V,t as h,m as e,p as _,n as y,H as j,I as z,q as H,s as J}from"./main-vzIkKseS.js";import{a as T,u as Z}from"./global-TrqB6NgK.js";import"./auth-KGSQmcys.js";const K=["onSubmit"],Q={class:"font-bold text-left"},W={class:"mt-2 text-sm leading-snug text-left text-gray-500",style:{"max-width":"680px"}},X={class:"grid gap-6 sm:grid-col-1 md:grid-cols-2 mt-6"},Y=V("span",null,null,-1),oe={setup(ee){const r=T();Z(),G();const{t:m,tm:U}=A();let f=p([]),d=p(!1),w=p(null),n=p(!1),l=p(!1);const b=p(!1);r.userForm.avatar&&f.value.push({image:r.userForm.avatar});const q=C(()=>({userForm:{name:{required:c.withMessage(m("validation.required"),k),minLength:c.withMessage(m("validation.name_min_length",{count:3}),S(3))},email:{required:c.withMessage(m("validation.required"),k),email:c.withMessage(m("validation.email_incorrect"),D)},password:{minLength:c.withMessage(m("validation.password_min_length",{count:8}),S(8))},confirm_password:{sameAsPassword:c.withMessage(m("validation.password_incorrect"),L(r.userForm.password))}}})),o=P(q,C(()=>r));function x(t,s){w.value=s}function M(){w.value=null,b.value=!0}function E(){if(o.value.userForm.$touch(),o.value.userForm.$invalid)return!0;d.value=!0;let t=new FormData;t.append("name",r.userForm.name),t.append("email",r.userForm.email),r.userForm.password!=null&&r.userForm.password!==void 0&&r.userForm.password!==""&&t.append("password",r.userForm.password),w.value&&t.append("customer_avatar",w.value),t.append("is_customer_avatar_removed",b.value),r.updateCurrentUser({data:t,message:U("settings.account_settings.updated_message")}).then(s=>{s.data.data&&(d.value=!1,r.$patch(B=>{B.userForm.password="",B.userForm.confirm_password=""}),w.value=null,b.value=!1)}).catch(s=>{d.value=!1})}return(t,s)=>{const B=v("BaseFileUploader"),F=v("BaseInputGroup"),I=v("BaseInput"),$=v("BaseIcon"),N=v("BaseButton"),R=v("BaseCard");return g(),O("form",{class:"relative h-full mt-4",onSubmit:J(E,["prevent"])},[u(R,null,{default:i(()=>[V("div",null,[V("h6",Q,h(t.$t("settings.account_settings.account_settings")),1),V("p",W,h(t.$t("settings.account_settings.section_description")),1)]),V("div",X,[u(F,{label:t.$tc("settings.account_settings.profile_picture")},{default:i(()=>[u(B,{modelValue:e(f),"onUpdate:modelValue":s[0]||(s[0]=a=>_(f)?f.value=a:f=a),avatar:!0,accept:"image/*",onChange:x,onRemove:M},null,8,["modelValue"])]),_:1},8,["label"]),Y,u(F,{label:t.$tc("settings.account_settings.name"),error:e(o).userForm.name.$error&&e(o).userForm.name.$errors[0].$message,required:""},{default:i(()=>[u(I,{modelValue:e(r).userForm.name,"onUpdate:modelValue":s[1]||(s[1]=a=>e(r).userForm.name=a),invalid:e(o).userForm.name.$error,onInput:s[2]||(s[2]=a=>e(o).userForm.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),u(F,{label:t.$tc("settings.account_settings.email"),error:e(o).userForm.email.$error&&e(o).userForm.email.$errors[0].$message,required:""},{default:i(()=>[u(I,{modelValue:e(r).userForm.email,"onUpdate:modelValue":s[3]||(s[3]=a=>e(r).userForm.email=a),invalid:e(o).userForm.email.$error,onInput:s[4]||(s[4]=a=>e(o).userForm.email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),u(F,{error:e(o).userForm.password.$error&&e(o).userForm.password.$errors[0].$message,label:t.$tc("settings.account_settings.password")},{default:i(()=>[u(I,{modelValue:e(r).userForm.password,"onUpdate:modelValue":s[7]||(s[7]=a=>e(r).userForm.password=a),type:e(n)?"text":"password",invalid:e(o).userForm.password.$error,onInput:s[8]||(s[8]=a=>e(o).userForm.password.$touch())},{right:i(()=>[e(n)?(g(),y($,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[5]||(s[5]=a=>_(n)?n.value=!e(n):n=!e(n))})):(g(),y($,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[6]||(s[6]=a=>_(n)?n.value=!e(n):n=!e(n))}))]),_:1},8,["modelValue","type","invalid"])]),_:1},8,["error","label"]),u(F,{label:t.$tc("settings.account_settings.confirm_password"),error:e(o).userForm.confirm_password.$error&&e(o).userForm.confirm_password.$errors[0].$message},{default:i(()=>[u(I,{modelValue:e(r).userForm.confirm_password,"onUpdate:modelValue":s[11]||(s[11]=a=>e(r).userForm.confirm_password=a),type:e(l)?"text":"password",invalid:e(o).userForm.confirm_password.$error,onInput:s[12]||(s[12]=a=>e(o).userForm.confirm_password.$touch())},{right:i(()=>[e(l)?(g(),y($,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[9]||(s[9]=a=>_(l)?l.value=!e(l):l=!e(l))})):(g(),y($,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[10]||(s[10]=a=>_(l)?l.value=!e(l):l=!e(l))}))]),_:1},8,["modelValue","type","invalid"])]),_:1},8,["label","error"])]),u(N,{loading:e(d),disabled:e(d),class:"mt-6"},{left:i(a=>[e(d)?z("",!0):(g(),y($,{key:0,name:"SaveIcon",class:j(a.class)},null,8,["class"]))]),default:i(()=>[H(" "+h(t.$t("general.save")),1)]),_:1},8,["loading","disabled"])]),_:1})],40,K)}}};export{oe as default}; diff --git a/public/build/assets/CustomerSettings.b26235a8.js b/public/build/assets/CustomerSettings.b26235a8.js deleted file mode 100644 index 0bd8c5f9..00000000 --- a/public/build/assets/CustomerSettings.b26235a8.js +++ /dev/null @@ -1 +0,0 @@ -import{G as R,J as G,B as p,k as C,L as c,M as k,N as S,Q as L,P,T as A,r as v,o as f,e as D,f as u,w as i,h as _,t as h,u as e,x as b,l as y,m as O,j as T,i as z,U as J}from"./vendor.fd3b1727.js";import{a as Q,u as H}from"./global.cf2a9bd7.js";import"./auth.75822dcb.js";import"./main.fc26c84f.js";const K=["onSubmit"],W={class:"font-bold text-left"},X={class:"mt-2 text-sm leading-snug text-left text-gray-500",style:{"max-width":"680px"}},Y={class:"grid gap-6 sm:grid-col-1 md:grid-cols-2 mt-6"},Z=_("span",null,null,-1),te={setup(ee){const r=Q();H(),R();const{t:m,tm:U}=G();let g=p([]),d=p(!1),w=p(null),n=p(!1),l=p(!1);const I=p(!1);r.userForm.avatar&&g.value.push({image:r.userForm.avatar});const x=C(()=>({userForm:{name:{required:c.withMessage(m("validation.required"),k),minLength:c.withMessage(m("validation.name_min_length",{count:3}),S(3))},email:{required:c.withMessage(m("validation.required"),k),email:c.withMessage(m("validation.email_incorrect"),L)},password:{minLength:c.withMessage(m("validation.password_min_length",{count:8}),S(8))},confirm_password:{sameAsPassword:c.withMessage(m("validation.password_incorrect"),P(r.userForm.password))}}})),o=A(x,C(()=>r));function M(t,s){w.value=s}function q(){w.value=null,I.value=!0}function N(){if(o.value.userForm.$touch(),o.value.userForm.$invalid)return!0;d.value=!0;let t=new FormData;t.append("name",r.userForm.name),t.append("email",r.userForm.email),r.userForm.password!=null&&r.userForm.password!==void 0&&r.userForm.password!==""&&t.append("password",r.userForm.password),w.value&&t.append("customer_avatar",w.value),t.append("is_customer_avatar_removed",I.value),r.updateCurrentUser({data:t,message:U("settings.account_settings.updated_message")}).then(s=>{s.data.data&&(d.value=!1,r.$patch(B=>{B.userForm.password="",B.userForm.confirm_password=""}),w.value=null,I.value=!1)}).catch(s=>{d.value=!1})}return(t,s)=>{const B=v("BaseFileUploader"),F=v("BaseInputGroup"),V=v("BaseInput"),$=v("BaseIcon"),j=v("BaseButton"),E=v("BaseCard");return f(),D("form",{class:"relative h-full mt-4",onSubmit:J(N,["prevent"])},[u(E,null,{default:i(()=>[_("div",null,[_("h6",W,h(t.$t("settings.account_settings.account_settings")),1),_("p",X,h(t.$t("settings.account_settings.section_description")),1)]),_("div",Y,[u(F,{label:t.$tc("settings.account_settings.profile_picture")},{default:i(()=>[u(B,{modelValue:e(g),"onUpdate:modelValue":s[0]||(s[0]=a=>b(g)?g.value=a:g=a),avatar:!0,accept:"image/*",onChange:M,onRemove:q},null,8,["modelValue"])]),_:1},8,["label"]),Z,u(F,{label:t.$tc("settings.account_settings.name"),error:e(o).userForm.name.$error&&e(o).userForm.name.$errors[0].$message,required:""},{default:i(()=>[u(V,{modelValue:e(r).userForm.name,"onUpdate:modelValue":s[1]||(s[1]=a=>e(r).userForm.name=a),invalid:e(o).userForm.name.$error,onInput:s[2]||(s[2]=a=>e(o).userForm.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),u(F,{label:t.$tc("settings.account_settings.email"),error:e(o).userForm.email.$error&&e(o).userForm.email.$errors[0].$message,required:""},{default:i(()=>[u(V,{modelValue:e(r).userForm.email,"onUpdate:modelValue":s[3]||(s[3]=a=>e(r).userForm.email=a),invalid:e(o).userForm.email.$error,onInput:s[4]||(s[4]=a=>e(o).userForm.email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),u(F,{error:e(o).userForm.password.$error&&e(o).userForm.password.$errors[0].$message,label:t.$tc("settings.account_settings.password")},{default:i(()=>[u(V,{modelValue:e(r).userForm.password,"onUpdate:modelValue":s[7]||(s[7]=a=>e(r).userForm.password=a),type:e(n)?"text":"password",invalid:e(o).userForm.password.$error,onInput:s[8]||(s[8]=a=>e(o).userForm.password.$touch())},{right:i(()=>[e(n)?(f(),y($,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[5]||(s[5]=a=>b(n)?n.value=!e(n):n=!e(n))})):(f(),y($,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[6]||(s[6]=a=>b(n)?n.value=!e(n):n=!e(n))}))]),_:1},8,["modelValue","type","invalid"])]),_:1},8,["error","label"]),u(F,{label:t.$tc("settings.account_settings.confirm_password"),error:e(o).userForm.confirm_password.$error&&e(o).userForm.confirm_password.$errors[0].$message},{default:i(()=>[u(V,{modelValue:e(r).userForm.confirm_password,"onUpdate:modelValue":s[11]||(s[11]=a=>e(r).userForm.confirm_password=a),type:e(l)?"text":"password",invalid:e(o).userForm.confirm_password.$error,onInput:s[12]||(s[12]=a=>e(o).userForm.confirm_password.$touch())},{right:i(()=>[e(l)?(f(),y($,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[9]||(s[9]=a=>b(l)?l.value=!e(l):l=!e(l))})):(f(),y($,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[10]||(s[10]=a=>b(l)?l.value=!e(l):l=!e(l))}))]),_:1},8,["modelValue","type","invalid"])]),_:1},8,["label","error"])]),u(j,{loading:e(d),disabled:e(d),class:"mt-6"},{left:i(a=>[e(d)?T("",!0):(f(),y($,{key:0,name:"SaveIcon",class:O(a.class)},null,8,["class"]))]),default:i(()=>[z(" "+h(t.$t("general.save")),1)]),_:1},8,["loading","disabled"])]),_:1})],40,K)}}};export{te as default}; diff --git a/public/build/assets/CustomizationSetting-VYZFiTwK.js b/public/build/assets/CustomizationSetting-VYZFiTwK.js new file mode 100644 index 00000000..4e5e5304 --- /dev/null +++ b/public/build/assets/CustomizationSetting-VYZFiTwK.js @@ -0,0 +1 @@ +import{e as Y,C as k,E as J,g as h,l as F,z as it,am as W,an as ot,r as c,o as S,c as C,b as d,t as v,a as t,w as r,s as A,H as T,q as U,L as G,M as lt,n as E,m as e,I as L,ao as mt,a3 as N,F as M,h as X,ad as Z,ap as tt,k as et,p as Q,aq as ut,ar as rt,D as dt,a5 as ct}from"./main-vzIkKseS.js";import{D as _t,d as pt}from"./DragIcon-szQ4f7me.js";import{u as gt}from"./payment-ALr-TD5m.js";import{_ as yt}from"./ItemUnitModal-BC4Fg9D4.js";const ft={class:"text-gray-900 text-lg font-medium"},vt={class:"mt-1 text-sm text-gray-500"},bt={class:"overflow-x-auto"},St={class:"w-full mt-6 table-fixed"},$t=d("colgroup",null,[d("col",{style:{width:"4%"}}),d("col",{style:{width:"45%"}}),d("col",{style:{width:"27%"}}),d("col",{style:{width:"24%"}})],-1),Bt=d("thead",null,[d("tr",null,[d("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}),d("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Component "),d("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Parameter "),d("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"})])],-1),ht={class:"relative"},zt={class:"text-gray-300 cursor-move handle align-middle"},Vt={class:"px-5 py-4"},It={class:"block text-sm not-italic font-medium text-primary-800 whitespace-nowrap mr-2 min-w-[200px]"},wt={class:"text-xs text-gray-500 mt-1"},xt={class:"px-5 py-4 text-left align-middle"},Ct={class:"px-5 py-4 text-right align-middle pt-10"},Dt=U(" Remove "),Ut={colspan:"2",class:"px-5 py-4"},Ft={class:"px-5 py-4 text-right align-middle",colspan:"2"},K={props:{type:{type:String,required:!0},typeStore:{type:Object,required:!0},defaultSeries:{type:String,default:"INV"}},setup(z){const u=z,{t:m}=Y(),p=k(),g=J(),l=h([]),a=h(!1),o=h([{label:m("settings.customization.series"),description:m("settings.customization.series_description"),name:"SERIES",paramLabel:m("settings.customization.series_param_label"),value:u.defaultSeries,inputDisabled:!1,inputType:"text",allowMultiple:!1},{label:m("settings.customization.sequence"),description:m("settings.customization.sequence_description"),name:"SEQUENCE",paramLabel:m("settings.customization.sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:m("settings.customization.delimiter"),description:m("settings.customization.delimiter_description"),name:"DELIMITER",paramLabel:m("settings.customization.delimiter_param_label"),value:"-",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:m("settings.customization.customer_series"),description:m("settings.customization.customer_series_description"),name:"CUSTOMER_SERIES",paramLabel:"",value:"",inputDisabled:!0,inputType:"text",allowMultiple:!1},{label:m("settings.customization.customer_sequence"),description:m("settings.customization.customer_sequence_description"),name:"CUSTOMER_SEQUENCE",paramLabel:m("settings.customization.customer_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:m("settings.customization.date_format"),description:m("settings.customization.date_format_description"),name:"DATE_FORMAT",paramLabel:m("settings.customization.date_format_param_label"),value:"Y",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:m("settings.customization.random_sequence"),description:m("settings.customization.random_sequence_description"),name:"RANDOM_SEQUENCE",paramLabel:m("settings.customization.random_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1}]),s=F(()=>o.value.filter(function(f){return!l.value.some(function(V){return f.allowMultiple?!1:f.name==V.name})})),_=h(""),n=h(!1),i=h(!1),y=F(()=>{let f="";return l.value.forEach(V=>{let q=`{{${V.name}`;V.value&&(q+=`:${V.value}`),f+=`${q}}}`}),f});it(l,f=>{D()}),$();async function $(){let f={format:p.selectedCompanySettings[`${u.type}_number_format`]};i.value=!0,(await g.fetchPlaceholders(f)).data.placeholders.forEach(q=>{let H=o.value.find(j=>j.name===q.name);const P=q.value??"";l.value.push({...H,value:P,id:W.raw()})}),i.value=!1,D()}function x(f){return l.value.find(V=>V.name===f.name)}function B(f){x(f)&&!f.allowMultiple||(l.value.push({...f,id:W.raw()}),D())}function b(f){l.value=l.value.filter(function(V){return f.id!==V.id})}function w(f,V){switch(V.name){case"SERIES":f.length>=6&&(f=f.substring(0,6));break;case"DELIMITER":f.length>=1&&(f=f.substring(0,1));break}setTimeout(()=>{V.value=f,D()},100)}const D=ot(()=>{O()},500);async function O(){if(!y.value){_.value="";return}let f={key:u.type,format:y.value};n.value=!0;let V=await u.typeStore.getNextNumber(f);n.value=!1,V.data&&(_.value=V.data.nextNumber)}async function st(){if(n.value||i.value)return;a.value=!0;let f={settings:{}};return f.settings[u.type+"_number_format"]=y.value,await p.updateCompanySettings({data:f,message:`settings.customization.${u.type}s.${u.type}_settings_updated`}),a.value=!1,!0}return(f,V)=>{const q=c("BaseInput"),H=c("BaseInputGroup"),P=c("BaseIcon"),j=c("BaseButton"),at=c("BaseDropdownItem"),nt=c("BaseDropdown");return S(),C(G,null,[d("h6",ft,v(f.$t(`settings.customization.${z.type}s.${z.type}_number_format`)),1),d("p",vt,v(f.$t(`settings.customization.${z.type}s.${z.type}_number_format_description`)),1),d("div",bt,[d("table",St,[$t,Bt,t(e(pt),{modelValue:l.value,"onUpdate:modelValue":V[1]||(V[1]=I=>l.value=I),class:"divide-y divide-gray-200","item-key":"id",tag:"tbody",handle:".handle",filter:".ignore-element"},{item:r(({element:I})=>[d("tr",ht,[d("td",zt,[t(_t)]),d("td",Vt,[d("label",It,v(I.label),1),d("p",wt,v(I.description),1)]),d("td",xt,[t(H,{label:I.paramLabel,class:"lg:col-span-3",required:""},{default:r(()=>[t(q,{modelValue:I.value,"onUpdate:modelValue":[R=>I.value=R,R=>w(R,I)],disabled:I.inputDisabled,type:I.inputType},null,8,["modelValue","onUpdate:modelValue","disabled","type"])]),_:2},1032,["label"])]),d("td",Ct,[t(j,{variant:"white",onClick:A(R=>b(I),["prevent"])},{left:r(R=>[t(P,{name:"XIcon",class:T(["!sm:m-0",R.class])},null,8,["class"])]),default:r(()=>[Dt]),_:2},1032,["onClick"])])])]),footer:r(()=>[d("tr",null,[d("td",Ut,[t(H,{label:f.$t(`settings.customization.${z.type}s.preview_${z.type}_number`)},{default:r(()=>[t(q,{modelValue:_.value,"onUpdate:modelValue":V[0]||(V[0]=I=>_.value=I),disabled:"",loading:n.value},null,8,["modelValue","loading"])]),_:1},8,["label"])]),d("td",Ft,[t(nt,{"wrapper-class":"flex items-center justify-end mt-5"},{activator:r(()=>[t(j,{variant:"primary-outline"},{left:r(I=>[t(P,{class:T(I.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[U(" "+v(f.$t("settings.customization.add_new_component")),1)]),_:1})]),default:r(()=>[(S(!0),C(G,null,lt(e(s),I=>(S(),E(at,{key:I.label,onClick:A(R=>B(I),["prevent"])},{default:r(()=>[U(v(I.label),1)]),_:2},1032,["onClick"]))),128))]),_:1})])])]),_:1},8,["modelValue"])])]),t(j,{loading:a.value,disabled:a.value,variant:"primary",type:"submit",class:"mt-4",onClick:st},{left:r(I=>[a.value?L("",!0):(S(),E(P,{key:0,class:T(I.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[U(" "+v(f.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],64)}}},Et={setup(z){const u=mt();return(m,p)=>(S(),E(K,{type:"invoice","type-store":e(u),"default-series":"INV"},null,8,["type-store"]))}},kt={class:"text-gray-900 text-lg font-medium"},Nt={class:"mt-1 text-sm text-gray-500"},Mt={setup(z){const{t:u,tm:m}=Y(),p=k(),g=J(),l=N("utils"),a=M({retrospective_edits:null});l.mergeSettings(a,{...p.selectedCompanySettings}),F(()=>g.config.retrospective_edits.map(s=>(s.title=u(s.key),s)));async function o(){let s={settings:{...a}};return await p.updateCompanySettings({data:s,message:"settings.customization.invoices.invoice_settings_updated"}),!0}return(s,_)=>{const n=c("BaseRadio"),i=c("BaseInputGroup");return S(),C(G,null,[d("h6",kt,v(s.$tc("settings.customization.invoices.retrospective_edits")),1),d("p",Nt,v(s.$t("settings.customization.invoices.retrospective_edits_description")),1),t(i,{required:""},{default:r(()=>[t(n,{id:"allow",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).retrospective_edits=y),o],label:s.$t("settings.customization.invoices.allow"),size:"sm",name:"filter",value:"allow",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_partial_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).retrospective_edits=y),o],label:s.$t("settings.customization.invoices.disable_on_invoice_partial_paid"),size:"sm",name:"filter",value:"disable_on_invoice_partial_paid",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).retrospective_edits=y),o],label:s.$t("settings.customization.invoices.disable_on_invoice_paid"),size:"sm",name:"filter",value:"disable_on_invoice_paid",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_sent",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[3]||(_[3]=y=>e(a).retrospective_edits=y),o],label:s.$t("settings.customization.invoices.disable_on_invoice_sent"),size:"sm",name:"filter",value:"disable_on_invoice_sent"},null,8,["modelValue","label"])]),_:1})],64)}}},Tt=["onSubmit"],qt={class:"text-gray-900 text-lg font-medium"},Gt={class:"mt-1 text-sm text-gray-500 mb-2"},Lt={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},Rt={setup(z){const{t:u}=Y(),m=k(),p=N("utils");let g=h(!1);const l=M({invoice_set_due_date_automatically:null,invoice_due_date_days:null});p.mergeSettings(l,{...m.selectedCompanySettings});const a=F({get:()=>l.invoice_set_due_date_automatically==="YES",set:async n=>{const i=n?"YES":"NO";l.invoice_set_due_date_automatically=i}}),o=F(()=>({dueDateSettings:{invoice_due_date_days:{required:X.withMessage(u("validation.required"),Z(a.value)),numeric:X.withMessage(u("validation.numbers_only"),tt)}}})),s=et(o,{dueDateSettings:l});async function _(){if(s.value.dueDateSettings.$touch(),s.value.dueDateSettings.$invalid)return!1;g.value=!0;let n={settings:{...l}};return a.value||delete n.settings.invoice_due_date_days,await m.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),g.value=!1,!0}return(n,i)=>{const y=c("BaseSwitchSection"),$=c("BaseInput"),x=c("BaseInputGroup"),B=c("BaseIcon"),b=c("BaseButton");return S(),C("form",{onSubmit:A(_,["prevent"])},[d("h6",qt,v(n.$t("settings.customization.invoices.due_date")),1),d("p",Gt,v(n.$t("settings.customization.invoices.due_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":i[0]||(i[0]=w=>Q(a)?a.value=w:null),title:n.$t("settings.customization.invoices.set_due_date_automatically"),description:n.$t("settings.customization.invoices.set_due_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?(S(),E(x,{key:0,label:n.$t("settings.customization.invoices.due_date_days"),error:e(s).dueDateSettings.invoice_due_date_days.$error&&e(s).dueDateSettings.invoice_due_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[d("div",Lt,[t($,{modelValue:e(l).invoice_due_date_days,"onUpdate:modelValue":i[1]||(i[1]=w=>e(l).invoice_due_date_days=w),invalid:e(s).dueDateSettings.invoice_due_date_days.$error,type:"number",onInput:i[2]||(i[2]=w=>e(s).dueDateSettings.invoice_due_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):L("",!0),t(b,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?L("",!0):(S(),E(B,{key:0,class:T(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[U(" "+v(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,Tt)}}},At=["onSubmit"],Yt={class:"text-gray-900 text-lg font-medium"},Ot={class:"mt-1 text-sm text-gray-500 mb-2"},Pt={setup(z){const u=k(),m=N("utils"),p=h(["customer","customerCustom","invoice","invoiceCustom","company"]),g=h(["billing","customer","customerCustom","invoiceCustom"]),l=h(["shipping","customer","customerCustom","invoiceCustom"]),a=h(["company","invoiceCustom"]);let o=h(!1);const s=M({invoice_mail_body:null,invoice_company_address_format:null,invoice_shipping_address_format:null,invoice_billing_address_format:null});m.mergeSettings(s,{...u.selectedCompanySettings});async function _(){o.value=!0;let n={settings:{...s}};return await u.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),o.value=!1,!0}return(n,i)=>{const y=c("BaseCustomInput"),$=c("BaseInputGroup"),x=c("BaseIcon"),B=c("BaseButton");return S(),C("form",{onSubmit:A(_,["prevent"])},[d("h6",Yt,v(n.$t("settings.customization.invoices.default_formats")),1),d("p",Ot,v(n.$t("settings.customization.invoices.default_formats_description")),1),t($,{label:n.$t("settings.customization.invoices.default_invoice_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_mail_body,"onUpdate:modelValue":i[0]||(i[0]=b=>e(s).invoice_mail_body=b),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t($,{label:n.$t("settings.customization.invoices.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_company_address_format,"onUpdate:modelValue":i[1]||(i[1]=b=>e(s).invoice_company_address_format=b),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t($,{label:n.$t("settings.customization.invoices.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_shipping_address_format,"onUpdate:modelValue":i[2]||(i[2]=b=>e(s).invoice_shipping_address_format=b),fields:l.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t($,{label:n.$t("settings.customization.invoices.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_billing_address_format,"onUpdate:modelValue":i[3]||(i[3]=b=>e(s).invoice_billing_address_format=b),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{loading:e(o),disabled:e(o),variant:"primary",type:"submit",class:"mt-4"},{left:r(b=>[e(o)?L("",!0):(S(),E(x,{key:0,class:T(b.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[U(" "+v(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,At)}}},jt={class:"divide-y divide-gray-200"},Qt={setup(z){const u=N("utils"),m=k(),p=M({invoice_email_attachment:null});u.mergeSettings(p,{...m.selectedCompanySettings});const g=F({get:()=>p.invoice_email_attachment==="YES",set:async l=>{const a=l?"YES":"NO";let o={settings:{invoice_email_attachment:a}};p.invoice_email_attachment=a,await m.updateCompanySettings({data:o,message:"general.setting_updated"})}});return(l,a)=>{const o=c("BaseDivider"),s=c("BaseSwitchSection");return S(),C(G,null,[t(Et),t(o,{class:"my-8"}),t(Rt),t(o,{class:"my-8"}),t(Mt),t(o,{class:"my-8"}),t(Pt),t(o,{class:"mt-6 mb-2"}),d("ul",jt,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>Q(g)?g.value=_:null),title:l.$t("settings.customization.invoices.invoice_email_attachment"),description:l.$t("settings.customization.invoices.invoice_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},Ht={setup(z){const u=ut();return(m,p)=>(S(),E(K,{type:"estimate","type-store":e(u),"default-series":"EST"},null,8,["type-store"]))}},Xt=["onSubmit"],Jt={class:"text-gray-900 text-lg font-medium"},Kt={class:"mt-1 text-sm text-gray-500 mb-2"},Wt={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},Zt={setup(z){const{t:u}=Y(),m=k(),p=N("utils");let g=h(!1);const l=M({estimate_set_expiry_date_automatically:null,estimate_expiry_date_days:null});p.mergeSettings(l,{...m.selectedCompanySettings});const a=F({get:()=>l.estimate_set_expiry_date_automatically==="YES",set:async n=>{const i=n?"YES":"NO";l.estimate_set_expiry_date_automatically=i}}),o=F(()=>({expiryDateSettings:{estimate_expiry_date_days:{required:X.withMessage(u("validation.required"),Z(a.value)),numeric:X.withMessage(u("validation.numbers_only"),tt)}}})),s=et(o,{expiryDateSettings:l});async function _(){if(s.value.expiryDateSettings.$touch(),s.value.expiryDateSettings.$invalid)return!1;g.value=!0;let n={settings:{...l}};return a.value||delete n.settings.estimate_expiry_date_days,await m.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),g.value=!1,!0}return(n,i)=>{const y=c("BaseSwitchSection"),$=c("BaseInput"),x=c("BaseInputGroup"),B=c("BaseIcon"),b=c("BaseButton");return S(),C("form",{onSubmit:A(_,["prevent"])},[d("h6",Jt,v(n.$t("settings.customization.estimates.expiry_date")),1),d("p",Kt,v(n.$t("settings.customization.estimates.expiry_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":i[0]||(i[0]=w=>Q(a)?a.value=w:null),title:n.$t("settings.customization.estimates.set_expiry_date_automatically"),description:n.$t("settings.customization.estimates.set_expiry_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?(S(),E(x,{key:0,label:n.$t("settings.customization.estimates.expiry_date_days"),error:e(s).expiryDateSettings.estimate_expiry_date_days.$error&&e(s).expiryDateSettings.estimate_expiry_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[d("div",Wt,[t($,{modelValue:e(l).estimate_expiry_date_days,"onUpdate:modelValue":i[1]||(i[1]=w=>e(l).estimate_expiry_date_days=w),invalid:e(s).expiryDateSettings.estimate_expiry_date_days.$error,type:"number",onInput:i[2]||(i[2]=w=>e(s).expiryDateSettings.estimate_expiry_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):L("",!0),t(b,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?L("",!0):(S(),E(B,{key:0,class:T(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[U(" "+v(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,Xt)}}},te=["onSubmit"],ee={class:"text-gray-900 text-lg font-medium"},se={class:"mt-1 text-sm text-gray-500 mb-2"},ae={setup(z){const u=k(),m=N("utils"),p=h(["customer","customerCustom","estimate","estimateCustom","company"]),g=h(["billing","customer","customerCustom","estimateCustom"]),l=h(["shipping","customer","customerCustom","estimateCustom"]),a=h(["company","estimateCustom"]);let o=h(!1);const s=M({estimate_mail_body:null,estimate_company_address_format:null,estimate_shipping_address_format:null,estimate_billing_address_format:null});m.mergeSettings(s,{...u.selectedCompanySettings});async function _(){o.value=!0;let n={settings:{...s}};return await u.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),o.value=!1,!0}return(n,i)=>{const y=c("BaseCustomInput"),$=c("BaseInputGroup"),x=c("BaseIcon"),B=c("BaseButton");return S(),C("form",{onSubmit:A(_,["prevent"])},[d("h6",ee,v(n.$t("settings.customization.estimates.default_formats")),1),d("p",se,v(n.$t("settings.customization.estimates.default_formats_description")),1),t($,{label:n.$t("settings.customization.estimates.default_estimate_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_mail_body,"onUpdate:modelValue":i[0]||(i[0]=b=>e(s).estimate_mail_body=b),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t($,{label:n.$t("settings.customization.estimates.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_company_address_format,"onUpdate:modelValue":i[1]||(i[1]=b=>e(s).estimate_company_address_format=b),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t($,{label:n.$t("settings.customization.estimates.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_shipping_address_format,"onUpdate:modelValue":i[2]||(i[2]=b=>e(s).estimate_shipping_address_format=b),fields:l.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t($,{label:n.$t("settings.customization.estimates.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_billing_address_format,"onUpdate:modelValue":i[3]||(i[3]=b=>e(s).estimate_billing_address_format=b),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{loading:e(o),disabled:e(o),variant:"primary",type:"submit",class:"mt-4"},{left:r(b=>[e(o)?L("",!0):(S(),E(x,{key:0,class:T(b.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[U(" "+v(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,te)}}},ne={class:"text-gray-900 text-lg font-medium"},ie={class:"mt-1 text-sm text-gray-500"},oe={setup(z){const{t:u,tm:m}=Y(),p=k(),g=J(),l=N("utils"),a=M({estimate_convert_action:null});l.mergeSettings(a,{...p.selectedCompanySettings}),F(()=>g.config.estimate_convert_action.map(s=>(s.title=u(s.key),s)));async function o(){let s={settings:{...a}};return await p.updateCompanySettings({data:s,message:"settings.customization.estimates.estimate_settings_updated"}),!0}return(s,_)=>{const n=c("BaseRadio"),i=c("BaseInputGroup");return S(),C(G,null,[d("h6",ne,v(s.$tc("settings.customization.estimates.convert_estimate_options")),1),d("p",ie,v(s.$t("settings.customization.estimates.convert_estimate_description")),1),t(i,{required:""},{default:r(()=>[t(n,{id:"no_action",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).estimate_convert_action=y),o],label:s.$t("settings.customization.estimates.no_action"),size:"sm",name:"filter",value:"no_action",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"delete_estimate",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).estimate_convert_action=y),o],label:s.$t("settings.customization.estimates.delete_estimate"),size:"sm",name:"filter",value:"delete_estimate",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"mark_estimate_as_accepted",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).estimate_convert_action=y),o],label:s.$t("settings.customization.estimates.mark_estimate_as_accepted"),size:"sm",name:"filter",value:"mark_estimate_as_accepted"},null,8,["modelValue","label"])]),_:1})],64)}}},le={class:"divide-y divide-gray-200"},me={setup(z){const u=N("utils"),m=k(),p=M({estimate_email_attachment:null});u.mergeSettings(p,{...m.selectedCompanySettings});const g=F({get:()=>p.estimate_email_attachment==="YES",set:async l=>{const a=l?"YES":"NO";let o={settings:{estimate_email_attachment:a}};p.estimate_email_attachment=a,await m.updateCompanySettings({data:o,message:"general.setting_updated"})}});return(l,a)=>{const o=c("BaseDivider"),s=c("BaseSwitchSection");return S(),C(G,null,[t(Ht),t(o,{class:"my-8"}),t(Zt),t(o,{class:"my-8"}),t(oe),t(o,{class:"my-8"}),t(ae),t(o,{class:"mt-6 mb-2"}),d("ul",le,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>Q(g)?g.value=_:null),title:l.$t("settings.customization.estimates.estimate_email_attachment"),description:l.$t("settings.customization.estimates.estimate_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ue={setup(z){const u=gt();return(m,p)=>(S(),E(K,{type:"payment","type-store":e(u),"default-series":"PAY"},null,8,["type-store"]))}},re=["onSubmit"],de={class:"text-gray-900 text-lg font-medium"},ce={class:"mt-1 text-sm text-gray-500 mb-2"},_e={setup(z){const u=k(),m=N("utils"),p=h(["customer","customerCustom","company","payment","paymentCustom"]),g=h(["billing","customer","customerCustom","paymentCustom"]),l=h(["company","paymentCustom"]);let a=h(!1);const o=M({payment_mail_body:null,payment_company_address_format:null,payment_from_customer_address_format:null});m.mergeSettings(o,{...u.selectedCompanySettings});async function s(){a.value=!0;let _={settings:{...o}};return await u.updateCompanySettings({data:_,message:"settings.customization.payments.payment_settings_updated"}),a.value=!1,!0}return(_,n)=>{const i=c("BaseCustomInput"),y=c("BaseInputGroup"),$=c("BaseIcon"),x=c("BaseButton");return S(),C("form",{onSubmit:A(s,["prevent"])},[d("h6",de,v(_.$t("settings.customization.payments.default_formats")),1),d("p",ce,v(_.$t("settings.customization.payments.default_formats_description")),1),t(y,{label:_.$t("settings.customization.payments.default_payment_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(i,{modelValue:e(o).payment_mail_body,"onUpdate:modelValue":n[0]||(n[0]=B=>e(o).payment_mail_body=B),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(i,{modelValue:e(o).payment_company_address_format,"onUpdate:modelValue":n[1]||(n[1]=B=>e(o).payment_company_address_format=B),fields:l.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.from_customer_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(i,{modelValue:e(o).payment_from_customer_address_format,"onUpdate:modelValue":n[2]||(n[2]=B=>e(o).payment_from_customer_address_format=B),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(x,{loading:e(a),disabled:e(a),variant:"primary",type:"submit",class:"mt-4"},{left:r(B=>[e(a)?L("",!0):(S(),E($,{key:0,class:T(B.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[U(" "+v(_.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,re)}}},pe={class:"divide-y divide-gray-200"},ge={setup(z){const u=N("utils"),m=k(),p=M({payment_email_attachment:null});u.mergeSettings(p,{...m.selectedCompanySettings});const g=F({get:()=>p.payment_email_attachment==="YES",set:async l=>{const a=l?"YES":"NO";let o={settings:{payment_email_attachment:a}};p.payment_email_attachment=a,await m.updateCompanySettings({data:o,message:"general.setting_updated"})}});return(l,a)=>{const o=c("BaseDivider"),s=c("BaseSwitchSection");return S(),C(G,null,[t(ue),t(o,{class:"my-8"}),t(_e),t(o,{class:"mt-6 mb-2"}),d("ul",pe,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>Q(g)?g.value=_:null),title:l.$t("settings.customization.payments.payment_email_attachment"),description:l.$t("settings.customization.payments.payment_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ye={class:"flex flex-wrap justify-end mt-2 lg:flex-nowrap"},fe={class:"inline-block"},ve={setup(z){const{t:u}=Y(),m=h(null),p=rt(),g=dt(),l=ct(),a=F(()=>[{key:"name",label:u("settings.customization.items.unit_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function o({page:i,filter:y,sort:$}){let x={orderByField:$.fieldName||"created_at",orderBy:$.order||"desc",page:i},B=await p.fetchItemUnits(x);return{data:B.data.data,pagination:{totalPages:B.data.meta.last_page,currentPage:i,totalCount:B.data.meta.total,limit:5}}}async function s(){g.openModal({title:u("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",refreshData:m.value.refresh,size:"sm"})}async function _(i){p.fetchItemUnit(i.data.id),g.openModal({title:u("settings.customization.items.edit_item_unit"),componentName:"ItemUnitModal",id:i.data.id,data:i.data,refreshData:m.value&&m.value.refresh})}function n(i){l.openDialog({title:u("general.are_you_sure"),message:u("settings.customization.items.item_unit_confirm_delete"),yesLabel:u("general.yes"),noLabel:u("general.no"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async y=>{y&&(await p.deleteItemUnit(i.data.id),m.value&&m.value.refresh())})}return(i,y)=>{const $=c("BaseIcon"),x=c("BaseButton"),B=c("BaseDropdownItem"),b=c("BaseDropdown"),w=c("BaseTable");return S(),C(G,null,[t(yt),d("div",ye,[t(x,{variant:"primary-outline",onClick:s},{left:r(D=>[t($,{class:T(D.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[U(" "+v(i.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),t(w,{ref:(D,O)=>{O.table=D,m.value=D},class:"mt-10",data:o,columns:e(a)},{"cell-actions":r(({row:D})=>[t(b,null,{activator:r(()=>[d("div",fe,[t($,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:r(()=>[t(B,{onClick:O=>_(D)},{default:r(()=>[t($,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),U(" "+v(i.$t("general.edit")),1)]),_:2},1032,["onClick"]),t(B,{onClick:O=>n(D)},{default:r(()=>[t($,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),U(" "+v(i.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])],64)}}},be={class:"relative"},ze={setup(z){return(u,m)=>{const p=c("BaseTab"),g=c("BaseTabGroup"),l=c("BaseCard");return S(),C("div",be,[t(l,{"container-class":"px-4 py-5 sm:px-8 sm:py-2"},{default:r(()=>[t(g,null,{default:r(()=>[t(p,{"tab-panel-container":"py-4 mt-px",title:u.$t("settings.customization.invoices.title")},{default:r(()=>[t(Qt)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:u.$t("settings.customization.estimates.title")},{default:r(()=>[t(me)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:u.$t("settings.customization.payments.title")},{default:r(()=>[t(ge)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:u.$t("settings.customization.items.title")},{default:r(()=>[t(ve)]),_:1},8,["title"])]),_:1})]),_:1})])}}};export{ze as default}; diff --git a/public/build/assets/CustomizationSetting.77479b06.js b/public/build/assets/CustomizationSetting.77479b06.js deleted file mode 100644 index bec6ef77..00000000 --- a/public/build/assets/CustomizationSetting.77479b06.js +++ /dev/null @@ -1 +0,0 @@ -var ut=Object.defineProperty,rt=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var ct=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var st=(v,o,i)=>o in v?ut(v,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):v[o]=i,x=(v,o)=>{for(var i in o||(o={}))ct.call(o,i)&&st(v,i,o[i]);if(et)for(var i of et(o))_t.call(o,i)&&st(v,i,o[i]);return v},W=(v,o)=>rt(v,dt(o));import{b as N,d as Z,i as pt,k as gt,p as yt,c as ft,j as vt}from"./main.fc26c84f.js";import{J as j,B as z,k as F,C as bt,H as at,$ as St,r as d,o as $,e as D,h as c,t as b,f as t,w as r,U as Y,m as G,i as k,F as L,y as $t,l as E,u as e,j as R,ah as M,a0 as T,L as X,O as nt,aT as it,T as ot,x as H}from"./vendor.fd3b1727.js";import{D as Bt,d as ht}from"./DragIcon.7c80aca9.js";import{u as zt}from"./payment.505d9057.js";import{_ as Vt}from"./ItemUnitModal.f71b6bbd.js";const It={class:"text-gray-900 text-lg font-medium"},xt={class:"mt-1 text-sm text-gray-500"},wt={class:"overflow-x-auto"},Ct={class:"w-full mt-6 table-fixed"},Dt=c("colgroup",null,[c("col",{style:{width:"4%"}}),c("col",{style:{width:"45%"}}),c("col",{style:{width:"27%"}}),c("col",{style:{width:"24%"}})],-1),Ut=c("thead",null,[c("tr",null,[c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Component "),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Parameter "),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"})])],-1),Ft={class:"relative"},kt={class:"text-gray-300 cursor-move handle align-middle"},Et={class:"px-5 py-4"},Nt={class:"block text-sm not-italic font-medium text-primary-800 whitespace-nowrap mr-2 min-w-[200px]"},Mt={class:"text-xs text-gray-500 mt-1"},Tt={class:"px-5 py-4 text-left align-middle"},Gt={class:"px-5 py-4 text-right align-middle pt-10"},qt=k(" Remove "),Lt={colspan:"2",class:"px-5 py-4"},Rt={class:"px-5 py-4 text-right align-middle",colspan:"2"},tt={props:{type:{type:String,required:!0},typeStore:{type:Object,required:!0},defaultSeries:{type:String,default:"INV"}},setup(v){const o=v,{t:i}=j(),p=N(),g=Z(),u=z([]),a=z(!1),m=z([{label:i("settings.customization.series"),description:i("settings.customization.series_description"),name:"SERIES",paramLabel:i("settings.customization.series_param_label"),value:o.defaultSeries,inputDisabled:!1,inputType:"text",allowMultiple:!1},{label:i("settings.customization.sequence"),description:i("settings.customization.sequence_description"),name:"SEQUENCE",paramLabel:i("settings.customization.sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:i("settings.customization.delimiter"),description:i("settings.customization.delimiter_description"),name:"DELIMITER",paramLabel:i("settings.customization.delimiter_param_label"),value:"-",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:i("settings.customization.customer_series"),description:i("settings.customization.customer_series_description"),name:"CUSTOMER_SERIES",paramLabel:"",value:"",inputDisabled:!0,inputType:"text",allowMultiple:!1},{label:i("settings.customization.customer_sequence"),description:i("settings.customization.customer_sequence_description"),name:"CUSTOMER_SEQUENCE",paramLabel:i("settings.customization.customer_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:i("settings.customization.date_format"),description:i("settings.customization.date_format_description"),name:"DATE_FORMAT",paramLabel:i("settings.customization.date_format_param_label"),value:"Y",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:i("settings.customization.random_sequence"),description:i("settings.customization.random_sequence_description"),name:"RANDOM_SEQUENCE",paramLabel:i("settings.customization.random_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1}]),s=F(()=>m.value.filter(function(f){return!u.value.some(function(V){return f.allowMultiple?!1:f.name==V.name})})),_=z(""),n=z(!1),l=z(!1),y=F(()=>{let f="";return u.value.forEach(V=>{let q=`{{${V.name}`;V.value&&(q+=`:${V.value}`),f+=`${q}}}`}),f});bt(u,f=>{U()}),B();async function B(){let f={format:p.selectedCompanySettings[`${o.type}_number_format`]};l.value=!0,(await g.fetchPlaceholders(f)).data.placeholders.forEach(q=>{var O;let J=m.value.find(K=>K.name===q.name);const Q=(O=q.value)!=null?O:"";u.value.push(W(x({},J),{value:Q,id:at.raw()}))}),l.value=!1,U()}function C(f){return u.value.find(V=>V.name===f.name)}function h(f){C(f)&&!f.allowMultiple||(u.value.push(W(x({},f),{id:at.raw()})),U())}function S(f){u.value=u.value.filter(function(V){return f.id!==V.id})}function w(f,V){switch(V.name){case"SERIES":f.length>=6&&(f=f.substring(0,6));break;case"DELIMITER":f.length>=1&&(f=f.substring(0,1));break}setTimeout(()=>{V.value=f,U()},100)}const U=St(()=>{P()},500);async function P(){if(!y.value){_.value="";return}let f={key:o.type,format:y.value};n.value=!0;let V=await o.typeStore.getNextNumber(f);n.value=!1,V.data&&(_.value=V.data.nextNumber)}async function lt(){if(n.value||l.value)return;a.value=!0;let f={settings:{}};return f.settings[o.type+"_number_format"]=y.value,await p.updateCompanySettings({data:f,message:`settings.customization.${o.type}s.${o.type}_settings_updated`}),a.value=!1,!0}return(f,V)=>{const q=d("BaseInput"),J=d("BaseInputGroup"),Q=d("BaseIcon"),O=d("BaseButton"),K=d("BaseDropdownItem"),mt=d("BaseDropdown");return $(),D(L,null,[c("h6",It,b(f.$t(`settings.customization.${v.type}s.${v.type}_number_format`)),1),c("p",xt,b(f.$t(`settings.customization.${v.type}s.${v.type}_number_format_description`)),1),c("div",wt,[c("table",Ct,[Dt,Ut,t(e(ht),{modelValue:u.value,"onUpdate:modelValue":V[1]||(V[1]=I=>u.value=I),class:"divide-y divide-gray-200","item-key":"id",tag:"tbody",handle:".handle",filter:".ignore-element"},{item:r(({element:I})=>[c("tr",Ft,[c("td",kt,[t(Bt)]),c("td",Et,[c("label",Nt,b(I.label),1),c("p",Mt,b(I.description),1)]),c("td",Tt,[t(J,{label:I.paramLabel,class:"lg:col-span-3",required:""},{default:r(()=>[t(q,{modelValue:I.value,"onUpdate:modelValue":[A=>I.value=A,A=>w(A,I)],disabled:I.inputDisabled,type:I.inputType},null,8,["modelValue","onUpdate:modelValue","disabled","type"])]),_:2},1032,["label"])]),c("td",Gt,[t(O,{variant:"white",onClick:Y(A=>S(I),["prevent"])},{left:r(A=>[t(Q,{name:"XIcon",class:G(["!sm:m-0",A.class])},null,8,["class"])]),default:r(()=>[qt]),_:2},1032,["onClick"])])])]),footer:r(()=>[c("tr",null,[c("td",Lt,[t(J,{label:f.$t(`settings.customization.${v.type}s.preview_${v.type}_number`)},{default:r(()=>[t(q,{modelValue:_.value,"onUpdate:modelValue":V[0]||(V[0]=I=>_.value=I),disabled:"",loading:n.value},null,8,["modelValue","loading"])]),_:1},8,["label"])]),c("td",Rt,[t(mt,{"wrapper-class":"flex items-center justify-end mt-5"},{activator:r(()=>[t(O,{variant:"primary-outline"},{left:r(I=>[t(Q,{class:G(I.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[k(" "+b(f.$t("settings.customization.add_new_component")),1)]),_:1})]),default:r(()=>[($(!0),D(L,null,$t(e(s),I=>($(),E(K,{key:I.label,onClick:Y(A=>h(I),["prevent"])},{default:r(()=>[k(b(I.label),1)]),_:2},1032,["onClick"]))),128))]),_:1})])])]),_:1},8,["modelValue"])])]),t(O,{loading:a.value,disabled:a.value,variant:"primary",type:"submit",class:"mt-4",onClick:lt},{left:r(I=>[a.value?R("",!0):($(),E(Q,{key:0,class:G(I.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[k(" "+b(f.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],64)}}},At={setup(v){const o=pt();return(i,p)=>($(),E(tt,{type:"invoice","type-store":e(o),"default-series":"INV"},null,8,["type-store"]))}},Yt={class:"text-gray-900 text-lg font-medium"},Ot={class:"mt-1 text-sm text-gray-500"},jt={setup(v){const{t:o,tm:i}=j(),p=N(),g=Z(),u=M("utils"),a=T({retrospective_edits:null});u.mergeSettings(a,x({},p.selectedCompanySettings)),F(()=>g.config.retrospective_edits.map(s=>(s.title=o(s.key),s)));async function m(){let s={settings:x({},a)};return await p.updateCompanySettings({data:s,message:"settings.customization.invoices.invoice_settings_updated"}),!0}return(s,_)=>{const n=d("BaseRadio"),l=d("BaseInputGroup");return $(),D(L,null,[c("h6",Yt,b(s.$tc("settings.customization.invoices.retrospective_edits")),1),c("p",Ot,b(s.$t("settings.customization.invoices.retrospective_edits_description")),1),t(l,{required:""},{default:r(()=>[t(n,{id:"allow",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.allow"),size:"sm",name:"filter",value:"allow",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_partial_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_partial_paid"),size:"sm",name:"filter",value:"disable_on_invoice_partial_paid",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_paid"),size:"sm",name:"filter",value:"disable_on_invoice_paid",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_sent",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[3]||(_[3]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_sent"),size:"sm",name:"filter",value:"disable_on_invoice_sent"},null,8,["modelValue","label"])]),_:1})],64)}}},Pt=["onSubmit"],Qt={class:"text-gray-900 text-lg font-medium"},Ht={class:"mt-1 text-sm text-gray-500 mb-2"},Jt={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},Xt={setup(v){const{t:o}=j(),i=N(),p=M("utils");let g=z(!1);const u=T({invoice_set_due_date_automatically:null,invoice_due_date_days:null});p.mergeSettings(u,x({},i.selectedCompanySettings));const a=F({get:()=>u.invoice_set_due_date_automatically==="YES",set:async n=>{const l=n?"YES":"NO";u.invoice_set_due_date_automatically=l}}),m=F(()=>({dueDateSettings:{invoice_due_date_days:{required:X.withMessage(o("validation.required"),nt(a.value)),numeric:X.withMessage(o("validation.numbers_only"),it)}}})),s=ot(m,{dueDateSettings:u});async function _(){if(s.value.dueDateSettings.$touch(),s.value.dueDateSettings.$invalid)return!1;g.value=!0;let n={settings:x({},u)};return a.value||delete n.settings.invoice_due_date_days,await i.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),g.value=!1,!0}return(n,l)=>{const y=d("BaseSwitchSection"),B=d("BaseInput"),C=d("BaseInputGroup"),h=d("BaseIcon"),S=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",Qt,b(n.$t("settings.customization.invoices.due_date")),1),c("p",Ht,b(n.$t("settings.customization.invoices.due_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":l[0]||(l[0]=w=>H(a)?a.value=w:null),title:n.$t("settings.customization.invoices.set_due_date_automatically"),description:n.$t("settings.customization.invoices.set_due_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?($(),E(C,{key:0,label:n.$t("settings.customization.invoices.due_date_days"),error:e(s).dueDateSettings.invoice_due_date_days.$error&&e(s).dueDateSettings.invoice_due_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[c("div",Jt,[t(B,{modelValue:e(u).invoice_due_date_days,"onUpdate:modelValue":l[1]||(l[1]=w=>e(u).invoice_due_date_days=w),invalid:e(s).dueDateSettings.invoice_due_date_days.$error,type:"number",onInput:l[2]||(l[2]=w=>e(s).dueDateSettings.invoice_due_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),t(S,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?R("",!0):($(),E(h,{key:0,class:G(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[k(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,Pt)}}},Kt=["onSubmit"],Wt={class:"text-gray-900 text-lg font-medium"},Zt={class:"mt-1 text-sm text-gray-500 mb-2"},te={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","invoice","invoiceCustom","company"]),g=z(["billing","customer","customerCustom","invoiceCustom"]),u=z(["shipping","customer","customerCustom","invoiceCustom"]),a=z(["company","invoiceCustom"]);let m=z(!1);const s=T({invoice_mail_body:null,invoice_company_address_format:null,invoice_shipping_address_format:null,invoice_billing_address_format:null});i.mergeSettings(s,x({},o.selectedCompanySettings));async function _(){m.value=!0;let n={settings:x({},s)};return await o.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),m.value=!1,!0}return(n,l)=>{const y=d("BaseCustomInput"),B=d("BaseInputGroup"),C=d("BaseIcon"),h=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",Wt,b(n.$t("settings.customization.invoices.default_formats")),1),c("p",Zt,b(n.$t("settings.customization.invoices.default_formats_description")),1),t(B,{label:n.$t("settings.customization.invoices.default_invoice_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_mail_body,"onUpdate:modelValue":l[0]||(l[0]=S=>e(s).invoice_mail_body=S),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_company_address_format,"onUpdate:modelValue":l[1]||(l[1]=S=>e(s).invoice_company_address_format=S),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_shipping_address_format,"onUpdate:modelValue":l[2]||(l[2]=S=>e(s).invoice_shipping_address_format=S),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_billing_address_format,"onUpdate:modelValue":l[3]||(l[3]=S=>e(s).invoice_billing_address_format=S),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(h,{loading:e(m),disabled:e(m),variant:"primary",type:"submit",class:"mt-4"},{left:r(S=>[e(m)?R("",!0):($(),E(C,{key:0,class:G(S.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[k(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,Kt)}}},ee={class:"divide-y divide-gray-200"},se={setup(v){const o=M("utils"),i=N(),p=T({invoice_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.invoice_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{invoice_email_attachment:a}};p.invoice_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(L,null,[t(At),t(m,{class:"my-8"}),t(Xt),t(m,{class:"my-8"}),t(jt),t(m,{class:"my-8"}),t(te),t(m,{class:"mt-6 mb-2"}),c("ul",ee,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.invoices.invoice_email_attachment"),description:u.$t("settings.customization.invoices.invoice_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ae={setup(v){const o=gt();return(i,p)=>($(),E(tt,{type:"estimate","type-store":e(o),"default-series":"EST"},null,8,["type-store"]))}},ne=["onSubmit"],ie={class:"text-gray-900 text-lg font-medium"},oe={class:"mt-1 text-sm text-gray-500 mb-2"},le={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},me={setup(v){const{t:o}=j(),i=N(),p=M("utils");let g=z(!1);const u=T({estimate_set_expiry_date_automatically:null,estimate_expiry_date_days:null});p.mergeSettings(u,x({},i.selectedCompanySettings));const a=F({get:()=>u.estimate_set_expiry_date_automatically==="YES",set:async n=>{const l=n?"YES":"NO";u.estimate_set_expiry_date_automatically=l}}),m=F(()=>({expiryDateSettings:{estimate_expiry_date_days:{required:X.withMessage(o("validation.required"),nt(a.value)),numeric:X.withMessage(o("validation.numbers_only"),it)}}})),s=ot(m,{expiryDateSettings:u});async function _(){if(s.value.expiryDateSettings.$touch(),s.value.expiryDateSettings.$invalid)return!1;g.value=!0;let n={settings:x({},u)};return a.value||delete n.settings.estimate_expiry_date_days,await i.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),g.value=!1,!0}return(n,l)=>{const y=d("BaseSwitchSection"),B=d("BaseInput"),C=d("BaseInputGroup"),h=d("BaseIcon"),S=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",ie,b(n.$t("settings.customization.estimates.expiry_date")),1),c("p",oe,b(n.$t("settings.customization.estimates.expiry_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":l[0]||(l[0]=w=>H(a)?a.value=w:null),title:n.$t("settings.customization.estimates.set_expiry_date_automatically"),description:n.$t("settings.customization.estimates.set_expiry_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?($(),E(C,{key:0,label:n.$t("settings.customization.estimates.expiry_date_days"),error:e(s).expiryDateSettings.estimate_expiry_date_days.$error&&e(s).expiryDateSettings.estimate_expiry_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[c("div",le,[t(B,{modelValue:e(u).estimate_expiry_date_days,"onUpdate:modelValue":l[1]||(l[1]=w=>e(u).estimate_expiry_date_days=w),invalid:e(s).expiryDateSettings.estimate_expiry_date_days.$error,type:"number",onInput:l[2]||(l[2]=w=>e(s).expiryDateSettings.estimate_expiry_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),t(S,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?R("",!0):($(),E(h,{key:0,class:G(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[k(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,ne)}}},ue=["onSubmit"],re={class:"text-gray-900 text-lg font-medium"},de={class:"mt-1 text-sm text-gray-500 mb-2"},ce={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","estimate","estimateCustom","company"]),g=z(["billing","customer","customerCustom","estimateCustom"]),u=z(["shipping","customer","customerCustom","estimateCustom"]),a=z(["company","estimateCustom"]);let m=z(!1);const s=T({estimate_mail_body:null,estimate_company_address_format:null,estimate_shipping_address_format:null,estimate_billing_address_format:null});i.mergeSettings(s,x({},o.selectedCompanySettings));async function _(){m.value=!0;let n={settings:x({},s)};return await o.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),m.value=!1,!0}return(n,l)=>{const y=d("BaseCustomInput"),B=d("BaseInputGroup"),C=d("BaseIcon"),h=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",re,b(n.$t("settings.customization.estimates.default_formats")),1),c("p",de,b(n.$t("settings.customization.estimates.default_formats_description")),1),t(B,{label:n.$t("settings.customization.estimates.default_estimate_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_mail_body,"onUpdate:modelValue":l[0]||(l[0]=S=>e(s).estimate_mail_body=S),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_company_address_format,"onUpdate:modelValue":l[1]||(l[1]=S=>e(s).estimate_company_address_format=S),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_shipping_address_format,"onUpdate:modelValue":l[2]||(l[2]=S=>e(s).estimate_shipping_address_format=S),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_billing_address_format,"onUpdate:modelValue":l[3]||(l[3]=S=>e(s).estimate_billing_address_format=S),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(h,{loading:e(m),disabled:e(m),variant:"primary",type:"submit",class:"mt-4"},{left:r(S=>[e(m)?R("",!0):($(),E(C,{key:0,class:G(S.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[k(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,ue)}}},_e={class:"text-gray-900 text-lg font-medium"},pe={class:"mt-1 text-sm text-gray-500"},ge={setup(v){const{t:o,tm:i}=j(),p=N(),g=Z(),u=M("utils"),a=T({estimate_convert_action:null});u.mergeSettings(a,x({},p.selectedCompanySettings)),F(()=>g.config.estimate_convert_action.map(s=>(s.title=o(s.key),s)));async function m(){let s={settings:x({},a)};return await p.updateCompanySettings({data:s,message:"settings.customization.estimates.estimate_settings_updated"}),!0}return(s,_)=>{const n=d("BaseRadio"),l=d("BaseInputGroup");return $(),D(L,null,[c("h6",_e,b(s.$tc("settings.customization.estimates.convert_estimate_options")),1),c("p",pe,b(s.$t("settings.customization.estimates.convert_estimate_description")),1),t(l,{required:""},{default:r(()=>[t(n,{id:"no_action",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.no_action"),size:"sm",name:"filter",value:"no_action",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"delete_estimate",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.delete_estimate"),size:"sm",name:"filter",value:"delete_estimate",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"mark_estimate_as_accepted",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.mark_estimate_as_accepted"),size:"sm",name:"filter",value:"mark_estimate_as_accepted"},null,8,["modelValue","label"])]),_:1})],64)}}},ye={class:"divide-y divide-gray-200"},fe={setup(v){const o=M("utils"),i=N(),p=T({estimate_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.estimate_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{estimate_email_attachment:a}};p.estimate_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(L,null,[t(ae),t(m,{class:"my-8"}),t(me),t(m,{class:"my-8"}),t(ge),t(m,{class:"my-8"}),t(ce),t(m,{class:"mt-6 mb-2"}),c("ul",ye,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.estimates.estimate_email_attachment"),description:u.$t("settings.customization.estimates.estimate_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ve={setup(v){const o=zt();return(i,p)=>($(),E(tt,{type:"payment","type-store":e(o),"default-series":"PAY"},null,8,["type-store"]))}},be=["onSubmit"],Se={class:"text-gray-900 text-lg font-medium"},$e={class:"mt-1 text-sm text-gray-500 mb-2"},Be={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","company","payment","paymentCustom"]),g=z(["billing","customer","customerCustom","paymentCustom"]),u=z(["company","paymentCustom"]);let a=z(!1);const m=T({payment_mail_body:null,payment_company_address_format:null,payment_from_customer_address_format:null});i.mergeSettings(m,x({},o.selectedCompanySettings));async function s(){a.value=!0;let _={settings:x({},m)};return await o.updateCompanySettings({data:_,message:"settings.customization.payments.payment_settings_updated"}),a.value=!1,!0}return(_,n)=>{const l=d("BaseCustomInput"),y=d("BaseInputGroup"),B=d("BaseIcon"),C=d("BaseButton");return $(),D("form",{onSubmit:Y(s,["prevent"])},[c("h6",Se,b(_.$t("settings.customization.payments.default_formats")),1),c("p",$e,b(_.$t("settings.customization.payments.default_formats_description")),1),t(y,{label:_.$t("settings.customization.payments.default_payment_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_mail_body,"onUpdate:modelValue":n[0]||(n[0]=h=>e(m).payment_mail_body=h),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_company_address_format,"onUpdate:modelValue":n[1]||(n[1]=h=>e(m).payment_company_address_format=h),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.from_customer_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_from_customer_address_format,"onUpdate:modelValue":n[2]||(n[2]=h=>e(m).payment_from_customer_address_format=h),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(C,{loading:e(a),disabled:e(a),variant:"primary",type:"submit",class:"mt-4"},{left:r(h=>[e(a)?R("",!0):($(),E(B,{key:0,class:G(h.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[k(" "+b(_.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,be)}}},he={class:"divide-y divide-gray-200"},ze={setup(v){const o=M("utils"),i=N(),p=T({payment_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.payment_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{payment_email_attachment:a}};p.payment_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(L,null,[t(ve),t(m,{class:"my-8"}),t(Be),t(m,{class:"mt-6 mb-2"}),c("ul",he,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.payments.payment_email_attachment"),description:u.$t("settings.customization.payments.payment_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},Ve={class:"flex flex-wrap justify-end mt-2 lg:flex-nowrap"},Ie={class:"inline-block"},xe={setup(v){const{t:o}=j(),i=z(null),p=yt(),g=ft(),u=vt(),a=F(()=>[{key:"name",label:o("settings.customization.items.unit_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function m({page:l,filter:y,sort:B}){let C={orderByField:B.fieldName||"created_at",orderBy:B.order||"desc",page:l},h=await p.fetchItemUnits(C);return{data:h.data.data,pagination:{totalPages:h.data.meta.last_page,currentPage:l,totalCount:h.data.meta.total,limit:5}}}async function s(){g.openModal({title:o("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",refreshData:i.value.refresh,size:"sm"})}async function _(l){p.fetchItemUnit(l.data.id),g.openModal({title:o("settings.customization.items.edit_item_unit"),componentName:"ItemUnitModal",id:l.data.id,data:l.data,refreshData:i.value&&i.value.refresh})}function n(l){u.openDialog({title:o("general.are_you_sure"),message:o("settings.customization.items.item_unit_confirm_delete"),yesLabel:o("general.yes"),noLabel:o("general.no"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async y=>{y&&(await p.deleteItemUnit(l.data.id),i.value&&i.value.refresh())})}return(l,y)=>{const B=d("BaseIcon"),C=d("BaseButton"),h=d("BaseDropdownItem"),S=d("BaseDropdown"),w=d("BaseTable");return $(),D(L,null,[t(Vt),c("div",Ve,[t(C,{variant:"primary-outline",onClick:s},{left:r(U=>[t(B,{class:G(U.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[k(" "+b(l.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),t(w,{ref:(U,P)=>{P.table=U,i.value=U},class:"mt-10",data:m,columns:e(a)},{"cell-actions":r(({row:U})=>[t(S,null,{activator:r(()=>[c("div",Ie,[t(B,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:r(()=>[t(h,{onClick:P=>_(U)},{default:r(()=>[t(B,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),k(" "+b(l.$t("general.edit")),1)]),_:2},1032,["onClick"]),t(h,{onClick:P=>n(U)},{default:r(()=>[t(B,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),k(" "+b(l.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])],64)}}},we={class:"relative"},Ne={setup(v){return(o,i)=>{const p=d("BaseTab"),g=d("BaseTabGroup"),u=d("BaseCard");return $(),D("div",we,[t(u,{"container-class":"px-4 py-5 sm:px-8 sm:py-2"},{default:r(()=>[t(g,null,{default:r(()=>[t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.invoices.title")},{default:r(()=>[t(se)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.estimates.title")},{default:r(()=>[t(fe)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.payments.title")},{default:r(()=>[t(ze)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.items.title")},{default:r(()=>[t(xe)]),_:1},8,["title"])]),_:1})]),_:1})])}}};export{Ne as default}; diff --git a/public/build/assets/Dashboard-AkFBE3Pt.js b/public/build/assets/Dashboard-AkFBE3Pt.js new file mode 100644 index 00000000..809e9828 --- /dev/null +++ b/public/build/assets/Dashboard-AkFBE3Pt.js @@ -0,0 +1 @@ +import{D as L,_ as M,a as I}from"./EstimateIcon-Jl2662IN.js";import{o as m,c as C,H as D,b as c,v as V,X as k,r as i,n as h,w as s,a as t,a0 as F,t as u,a1 as z,a3 as S,m as n,q as _,e as T,J as q,l as $}from"./main-vzIkKseS.js";import{u as v}from"./global-TrqB6NgK.js";import{h as A}from"./auth-KGSQmcys.js";import w from"./BaseTable-HYHVnjlk.js";const Z=c("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),N=c("path",{d:"M17.8 17.8C17.1635 17.8 16.5531 18.0529 16.103 18.503C15.6529 18.9531 15.4 19.5635 15.4 20.2V21.4H34.6V20.2C34.6 19.5635 34.3472 18.9531 33.8971 18.503C33.447 18.0529 32.8365 17.8 32.2 17.8H17.8Z",fill:"currentColor"},null,-1),O=c("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M34.6 23.8H15.4V29.8C15.4 30.4366 15.6529 31.047 16.103 31.4971C16.5531 31.9472 17.1635 32.2 17.8 32.2H32.2C32.8365 32.2 33.447 31.9472 33.8971 31.4971C34.3472 31.047 34.6 30.4366 34.6 29.8V23.8ZM17.8 28.6C17.8 28.2818 17.9265 27.9766 18.1515 27.7515C18.3765 27.5265 18.6818 27.4 19 27.4H20.2C20.5183 27.4 20.8235 27.5265 21.0486 27.7515C21.2736 27.9766 21.4 28.2818 21.4 28.6C21.4 28.9183 21.2736 29.2235 21.0486 29.4486C20.8235 29.6736 20.5183 29.8 20.2 29.8H19C18.6818 29.8 18.3765 29.6736 18.1515 29.4486C17.9265 29.2235 17.8 28.9183 17.8 28.6ZM23.8 27.4C23.4818 27.4 23.1765 27.5265 22.9515 27.7515C22.7265 27.9766 22.6 28.2818 22.6 28.6C22.6 28.9183 22.7265 29.2235 22.9515 29.4486C23.1765 29.6736 23.4818 29.8 23.8 29.8H25C25.3183 29.8 25.6235 29.6736 25.8486 29.4486C26.0736 29.2235 26.2 28.9183 26.2 28.6C26.2 28.2818 26.0736 27.9766 25.8486 27.7515C25.6235 27.5265 25.3183 27.4 25 27.4H23.8Z",fill:"currentColor"},null,-1),G=[Z,N,O],J={props:{colorClass:{type:String,default:"text-primary-500"}},setup(r){return(a,o)=>(m(),C("svg",{width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:D(r.colorClass)},G,2))}},{defineStore:R}=window.pinia,P=R({id:"dashboard",state:()=>({recentInvoices:[],recentEstimates:[],invoiceCount:0,estimateCount:0,paymentCount:0,totalDueAmount:[],isDashboardDataLoaded:!1}),actions:{loadData(r){const a=v();return new Promise((o,d)=>{V.get(`/api/v1/${a.companySlug}/customer/dashboard`,{data:r}).then(e=>{this.totalDueAmount=e.data.due_amount,this.estimateCount=e.data.estimate_count,this.invoiceCount=e.data.invoice_count,this.paymentCount=e.data.payment_count,this.recentInvoices=e.data.recentInvoices,this.recentEstimates=e.data.recentEstimates,a.getDashboardDataLoaded=!0,o(e)}).catch(e=>{A(e),d(e)})})}}}),X={},K={class:"flex items-center"};function Q(r,a){const o=i("BaseContentPlaceholdersText"),d=i("BaseContentPlaceholdersBox"),e=i("BaseContentPlaceholders");return m(),h(e,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:s(()=>[c("div",null,[t(o,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),t(o,{class:"h-3 w-28 xl:h-4",lines:1})]),c("div",K,[t(d,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const U=k(X,[["render",Q]]),W={},Y={class:"flex items-center"};function ee(r,a){const o=i("BaseContentPlaceholdersText"),d=i("BaseContentPlaceholdersBox"),e=i("BaseContentPlaceholders");return m(),h(e,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:s(()=>[c("div",null,[t(o,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),t(o,{class:"w-20 h-3 xl:h-4",lines:1})]),c("div",Y,[t(d,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const te=k(W,[["render",ee]]),ae={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},se={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},oe={class:"flex items-center"},g={props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:Object,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(r){return(a,o)=>{const d=i("router-link");return r.loading?r.large?(m(),h(U,{key:1})):(m(),h(te,{key:2})):(m(),h(d,{key:0,class:D(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":r.large}]),to:r.route},{default:s(()=>[c("div",null,[c("span",ae,[F(a.$slots,"default")]),c("span",se,u(r.label),1)]),c("div",oe,[(m(),h(z(r.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},ne={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},le={setup(r){S("utils");const a=v(),o=P();return o.loadData(),(d,e)=>{const f=i("BaseFormatMoney");return m(),C("div",ne,[t(g,{"icon-component":L,loading:!n(a).getDashboardDataLoaded,route:{name:"invoices.dashboard"},large:!0,label:d.$t("dashboard.cards.due_amount")},{default:s(()=>[t(f,{amount:n(o).totalDueAmount,currency:n(a).currency},null,8,["amount","currency"])]),_:1},8,["loading","route","label"]),t(g,{"icon-component":M,loading:!n(a).getDashboardDataLoaded,route:{name:"invoices.dashboard"},label:d.$t("dashboard.cards.invoices")},{default:s(()=>[_(u(n(o).invoiceCount),1)]),_:1},8,["loading","route","label"]),t(g,{"icon-component":I,loading:!n(a).getDashboardDataLoaded,route:{name:"estimates.dashboard"},label:d.$t("dashboard.cards.estimates")},{default:s(()=>[_(u(n(o).estimateCount),1)]),_:1},8,["loading","route","label"]),t(g,{"icon-component":J,loading:!n(a).getDashboardDataLoaded,route:{name:"payments.dashboard"},label:d.$t("dashboard.cards.payments")},{default:s(()=>[_(u(n(o).paymentCount),1)]),_:1},8,["loading","route","label"])])}}},ce={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},re={class:"due-invoices"},de={class:"relative z-10 flex items-center justify-between mb-3"},ie={class:"mb-0 text-xl font-semibold leading-normal"},ue={class:"recent-estimates"},me={class:"relative z-10 flex items-center justify-between mb-3"},_e={class:"mb-0 text-xl font-semibold leading-normal"},he={setup(r){const a=v(),o=P(),{tm:d,t:e}=T();S("utils"),q();const f=$(()=>[{key:"formattedDueDate",label:e("dashboard.recent_invoices_card.due_on")},{key:"invoice_number",label:e("invoices.number")},{key:"paid_status",label:e("invoices.status")},{key:"due_amount",label:e("dashboard.recent_invoices_card.amount_due")}]),E=$(()=>[{key:"formattedEstimateDate",label:e("dashboard.recent_estimate_card.date")},{key:"estimate_number",label:e("estimates.number")},{key:"status",label:e("estimates.status")},{key:"total",label:e("dashboard.recent_estimate_card.amount_due")}]);return(b,p)=>{const x=i("BaseButton"),y=i("router-link"),H=i("BasePaidStatusBadge"),B=i("BaseFormatMoney"),j=i("BaseEstimateStatusBadge");return m(),C("div",ce,[c("div",re,[c("div",de,[c("h6",ie,u(b.$t("dashboard.recent_invoices_card.title")),1),t(x,{size:"sm",variant:"primary-outline",onClick:p[0]||(p[0]=l=>b.$router.push({name:"invoices.dashboard"}))},{default:s(()=>[_(u(b.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),t(w,{data:n(o).recentInvoices,columns:n(f),loading:!n(a).getDashboardDataLoaded},{"cell-invoice_number":s(({row:l})=>[t(y,{to:{path:`/${n(a).companySlug}/customer/invoices/${l.data.id}/view`},class:"font-medium text-primary-500"},{default:s(()=>[_(u(l.data.invoice_number),1)]),_:2},1032,["to"])]),"cell-paid_status":s(({row:l})=>[t(H,{status:l.data.paid_status},{default:s(()=>[_(u(l.data.paid_status),1)]),_:2},1032,["status"])]),"cell-due_amount":s(({row:l})=>[t(B,{amount:l.data.due_amount,currency:n(a).currency},null,8,["amount","currency"])]),_:1},8,["data","columns","loading"])]),c("div",ue,[c("div",me,[c("h6",_e,u(b.$t("dashboard.recent_estimate_card.title")),1),t(x,{variant:"primary-outline",size:"sm",onClick:p[1]||(p[1]=l=>b.$router.push({name:"estimates.dashboard"}))},{default:s(()=>[_(u(b.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),t(w,{data:n(o).recentEstimates,columns:n(E),loading:!n(a).getDashboardDataLoaded},{"cell-estimate_number":s(({row:l})=>[t(y,{to:{path:`/${n(a).companySlug}/customer/estimates/${l.data.id}/view`},class:"font-medium text-primary-500"},{default:s(()=>[_(u(l.data.estimate_number),1)]),_:2},1032,["to"])]),"cell-status":s(({row:l})=>[t(j,{status:l.data.status,class:"px-3 py-1"},{default:s(()=>[_(u(l.data.status),1)]),_:2},1032,["status"])]),"cell-total":s(({row:l})=>[t(B,{amount:l.data.total,currency:n(a).currency},null,8,["amount","currency"])]),_:1},8,["data","columns","loading"])])])}}},ve={setup(r){return(a,o)=>{const d=i("BasePage");return m(),h(d,null,{default:s(()=>[t(le),t(he)]),_:1})}}};export{ve as default}; diff --git a/public/build/assets/Dashboard-kgGGyUGQ.js b/public/build/assets/Dashboard-kgGGyUGQ.js new file mode 100644 index 00000000..18e14b07 --- /dev/null +++ b/public/build/assets/Dashboard-kgGGyUGQ.js @@ -0,0 +1 @@ +import{D as F,_ as L,a as W}from"./EstimateIcon-Jl2662IN.js";import{o as c,c as C,H as j,b as t,X as T,r as i,n as p,w as r,a,a0 as R,t as h,a1 as z,a2 as q,v as H,$ as U,a3 as N,C as O,K as E,m as e,O as _,I as v,q as y,g as B,z as Z,e as J,l as V,a4 as M,J as K,f as X,W as Y}from"./main-vzIkKseS.js";import{_ as G}from"./LineChart-wa69n_NW.js";import{_ as Q}from"./InvoiceIndexDropdown-pu_jVPSm.js";import{_ as tt}from"./EstimateIndexDropdown-ZN9wO8Lw.js";const et=t("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),at=t("path",{d:"M28.2656 23.0547C27.3021 24.0182 26.1302 24.5 24.75 24.5C23.3698 24.5 22.1849 24.0182 21.1953 23.0547C20.2318 22.0651 19.75 20.8802 19.75 19.5C19.75 18.1198 20.2318 16.9479 21.1953 15.9844C22.1849 14.9948 23.3698 14.5 24.75 14.5C26.1302 14.5 27.3021 14.9948 28.2656 15.9844C29.2552 16.9479 29.75 18.1198 29.75 19.5C29.75 20.8802 29.2552 22.0651 28.2656 23.0547ZM28.2656 25.75C29.6979 25.75 30.9219 26.2708 31.9375 27.3125C32.9792 28.3281 33.5 29.5521 33.5 30.9844V32.625C33.5 33.1458 33.3177 33.5885 32.9531 33.9531C32.5885 34.3177 32.1458 34.5 31.625 34.5H17.875C17.3542 34.5 16.9115 34.3177 16.5469 33.9531C16.1823 33.5885 16 33.1458 16 32.625V30.9844C16 29.5521 16.5078 28.3281 17.5234 27.3125C18.5651 26.2708 19.8021 25.75 21.2344 25.75H21.8984C22.8099 26.1667 23.7604 26.375 24.75 26.375C25.7396 26.375 26.6901 26.1667 27.6016 25.75H28.2656Z",fill:"currentColor"},null,-1),st=[et,at],ot={props:{colorClass:{type:String,default:"text-primary-500"}},setup(d){return(o,s)=>(c(),C("svg",{width:"50",height:"50",viewBox:"0 0 50 50",class:j(d.colorClass),fill:"none",xmlns:"http://www.w3.org/2000/svg"},st,2))}},lt={},nt={class:"flex items-center"};function ct(d,o){const s=i("BaseContentPlaceholdersText"),n=i("BaseContentPlaceholdersBox"),u=i("BaseContentPlaceholders");return c(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:r(()=>[t("div",null,[a(s,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),a(s,{class:"h-3 w-28 xl:h-4",lines:1})]),t("div",nt,[a(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const rt=T(lt,[["render",ct]]),it={},dt={class:"flex items-center"};function ut(d,o){const s=i("BaseContentPlaceholdersText"),n=i("BaseContentPlaceholdersBox"),u=i("BaseContentPlaceholders");return c(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:r(()=>[t("div",null,[a(s,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),a(s,{class:"w-20 h-3 xl:h-4",lines:1})]),t("div",dt,[a(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const mt=T(it,[["render",ut]]),_t={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},ht={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},pt={class:"flex items-center"},D={props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:String,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(d){return(o,s)=>{const n=i("router-link");return d.loading?d.large?(c(),p(rt,{key:1})):(c(),p(mt,{key:2})):(c(),p(n,{key:0,class:j(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":d.large}]),to:d.route},{default:r(()=>[t("div",null,[t("span",_t,[R(o.$slots,"default")]),t("span",ht,h(d.label),1)]),t("div",pt,[(c(),p(z(d.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},S=(d=!1)=>(d?window.pinia.defineStore:q)({id:"dashboard",state:()=>({stats:{totalAmountDue:0,totalCustomerCount:0,totalInvoiceCount:0,totalEstimateCount:0},chartData:{months:[],invoiceTotals:[],expenseTotals:[],receiptTotals:[],netIncomeTotals:[]},totalSales:null,totalReceipts:null,totalExpenses:null,totalNetIncome:null,recentDueInvoices:[],recentEstimates:[],isDashboardDataLoaded:!1}),actions:{loadData(s){return new Promise((n,u)=>{H.get("/api/v1/dashboard",{params:s}).then(l=>{this.stats.totalAmountDue=l.data.total_amount_due,this.stats.totalCustomerCount=l.data.total_customer_count,this.stats.totalInvoiceCount=l.data.total_invoice_count,this.stats.totalEstimateCount=l.data.total_estimate_count,this.chartData&&l.data.chart_data&&(this.chartData.months=l.data.chart_data.months,this.chartData.invoiceTotals=l.data.chart_data.invoice_totals,this.chartData.expenseTotals=l.data.chart_data.expense_totals,this.chartData.receiptTotals=l.data.chart_data.receipt_totals,this.chartData.netIncomeTotals=l.data.chart_data.net_income_totals),this.totalSales=l.data.total_sales,this.totalReceipts=l.data.total_receipts,this.totalExpenses=l.data.total_expenses,this.totalNetIncome=l.data.total_net_income,this.recentDueInvoices=l.data.recent_due_invoices,this.recentEstimates=l.data.recent_estimates,this.isDashboardDataLoaded=!0,n(l)}).catch(l=>{U(l),u(l)})})}}})(),bt={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},xt={setup(d){N("utils");const o=S(),s=O(),n=E();return(u,l)=>{const f=i("BaseFormatMoney");return c(),C("div",bt,[e(n).hasAbilities(e(_).VIEW_INVOICE)?(c(),p(D,{key:0,"icon-component":F,loading:!e(o).isDashboardDataLoaded,route:"/admin/invoices",large:!0,label:u.$t("dashboard.cards.due_amount")},{default:r(()=>[a(f,{amount:e(o).stats.totalAmountDue,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(_).VIEW_CUSTOMER)?(c(),p(D,{key:1,"icon-component":ot,loading:!e(o).isDashboardDataLoaded,route:"/admin/customers",label:u.$t("dashboard.cards.customers")},{default:r(()=>[y(h(e(o).stats.totalCustomerCount),1)]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(_).VIEW_INVOICE)?(c(),p(D,{key:2,"icon-component":L,loading:!e(o).isDashboardDataLoaded,route:"/admin/invoices",label:u.$t("dashboard.cards.invoices")},{default:r(()=>[y(h(e(o).stats.totalInvoiceCount),1)]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(_).VIEW_ESTIMATE)?(c(),p(D,{key:3,"icon-component":W,loading:!e(o).isDashboardDataLoaded,route:"/admin/estimates",label:u.$t("dashboard.cards.estimates")},{default:r(()=>[y(h(e(o).stats.totalEstimateCount),1)]),_:1},8,["loading","label"])):v("",!0)])}}},ft={},gt={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-8"},yt={class:"flex items-center justify-between mb-2 xl:mb-4"},Ct={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},vt={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},wt={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},$t={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},Dt={class:"flex flex-col items-center justify-center col-span-3 p-6 border-t border-gray-200 border-solid lg:justify-end lg:items-end lg:col-span-1"};function Bt(d,o){const s=i("BaseContentPlaceholdersText"),n=i("BaseContentPlaceholdersBox"),u=i("BaseContentPlaceholders");return c(),p(u,{class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},{default:r(()=>[t("div",gt,[t("div",yt,[a(s,{class:"h-10 w-36",lines:1}),a(s,{class:"h-10 w-36 !mt-0",lines:1})]),a(n,{class:"h-80 xl:h-72 sm:w-full"})]),t("div",Ct,[t("div",vt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",wt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",$t,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",Dt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})])])]),_:1})}const Et=T(ft,[["render",Bt]]),It={key:0,class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},Tt={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-6"},St={class:"flex justify-between mt-1 mb-4 flex-col md:flex-row"},kt={class:"flex items-center sw-section-title h-10"},At={class:"w-full my-2 md:m-0 md:w-40 h-10"},Pt={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},Vt={class:"p-6"},Mt={class:"text-xs leading-5 lg:text-sm"},jt=t("br",null,null,-1),Nt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl"},Ot={class:"p-6"},Ft={class:"text-xs leading-5 lg:text-sm"},Lt=t("br",null,null,-1),Wt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-green-400"},Rt={class:"p-6"},zt={class:"text-xs leading-5 lg:text-sm"},qt=t("br",null,null,-1),Ht={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-red-400"},Ut={class:"col-span-3 p-6 border-t border-gray-200 border-solid lg:col-span-1"},Zt={class:"text-xs leading-5 lg:text-sm"},Jt=t("br",null,null,-1),Kt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-primary-500"},Xt={setup(d){const o=S(),s=O();N("utils");const n=E(),u=B(["This year","Previous year"]),l=B("This year");Z(l,b=>{b==="Previous year"?f({previous_year:!0}):f()},{immediate:!0});async function f(b){n.hasAbilities(_.DASHBOARD)&&await o.loadData(b)}return(b,w)=>{const I=i("BaseIcon"),g=i("BaseMultiselect"),x=i("BaseFormatMoney");return c(),C("div",null,[e(o).isDashboardDataLoaded?(c(),C("div",It,[t("div",Tt,[t("div",St,[t("h6",kt,[a(I,{name:"ChartSquareBarIcon",class:"text-primary-400 mr-1"}),y(" "+h(b.$t("dashboard.monthly_chart.title")),1)]),t("div",At,[a(g,{modelValue:l.value,"onUpdate:modelValue":w[0]||(w[0]=$=>l.value=$),options:u.value,"allow-empty":!1,"show-labels":!1,placeholder:b.$t("dashboard.select_year"),"can-deselect":!1},null,8,["modelValue","options","placeholder"])])]),a(G,{invoices:e(o).chartData.invoiceTotals,expenses:e(o).chartData.expenseTotals,receipts:e(o).chartData.receiptTotals,income:e(o).chartData.netIncomeTotals,labels:e(o).chartData.months,class:"sm:w-full"},null,8,["invoices","expenses","receipts","income","labels"])]),t("div",Pt,[t("div",Vt,[t("span",Mt,h(b.$t("dashboard.chart_info.total_sales")),1),jt,t("span",Nt,[a(x,{amount:e(o).totalSales,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Ot,[t("span",Ft,h(b.$t("dashboard.chart_info.total_receipts")),1),Lt,t("span",Wt,[a(x,{amount:e(o).totalReceipts,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Rt,[t("span",zt,h(b.$t("dashboard.chart_info.total_expense")),1),qt,t("span",Ht,[a(x,{amount:e(o).totalExpenses,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Ut,[t("span",Zt,h(b.$t("dashboard.chart_info.net_income")),1),Jt,t("span",Kt,[a(x,{amount:e(o).totalNetIncome,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])])])])):(c(),p(Et,{key:1}))])}}},Yt={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},Gt={key:0,class:"due-invoices"},Qt={class:"relative z-10 flex items-center justify-between mb-3"},te={class:"mb-0 text-xl font-semibold leading-normal"},ee={key:1,class:"recent-estimates"},ae={class:"relative z-10 flex items-center justify-between mb-3"},se={class:"mb-0 text-xl font-semibold leading-normal"},oe={setup(d){const o=S(),{t:s}=J(),n=E(),u=B(null),l=B(null),f=V(()=>[{key:"formattedDueDate",label:s("dashboard.recent_invoices_card.due_on")},{key:"user",label:s("dashboard.recent_invoices_card.customer")},{key:"due_amount",label:s("dashboard.recent_invoices_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]),b=V(()=>[{key:"formattedEstimateDate",label:s("dashboard.recent_estimate_card.date")},{key:"user",label:s("dashboard.recent_estimate_card.customer")},{key:"total",label:s("dashboard.recent_estimate_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]);function w(){return n.hasAbilities([_.DELETE_INVOICE,_.EDIT_INVOICE,_.VIEW_INVOICE,_.SEND_INVOICE])}function I(){return n.hasAbilities([_.CREATE_ESTIMATE,_.EDIT_ESTIMATE,_.VIEW_ESTIMATE,_.SEND_ESTIMATE])}return(g,x)=>{const $=i("BaseButton"),k=i("router-link"),A=i("BaseFormatMoney"),P=i("BaseTable");return c(),C("div",null,[t("div",Yt,[e(n).hasAbilities(e(_).VIEW_INVOICE)?(c(),C("div",Gt,[t("div",Qt,[t("h6",te,h(g.$t("dashboard.recent_invoices_card.title")),1),a($,{size:"sm",variant:"primary-outline",onClick:x[0]||(x[0]=m=>g.$router.push("/admin/invoices"))},{default:r(()=>[y(h(g.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),a(P,{data:e(o).recentDueInvoices,columns:e(f),loading:!e(o).isDashboardDataLoaded},M({"cell-user":r(({row:m})=>[a(k,{to:{path:`invoices/${m.data.id}/view`},class:"font-medium text-primary-500"},{default:r(()=>[y(h(m.data.customer.name),1)]),_:2},1032,["to"])]),"cell-due_amount":r(({row:m})=>[a(A,{amount:m.data.due_amount,currency:m.data.customer.currency},null,8,["amount","currency"])]),_:2},[w()?{name:"cell-actions",fn:r(({row:m})=>[a(Q,{row:m.data,table:u.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])])):v("",!0),e(n).hasAbilities(e(_).VIEW_ESTIMATE)?(c(),C("div",ee,[t("div",ae,[t("h6",se,h(g.$t("dashboard.recent_estimate_card.title")),1),a($,{variant:"primary-outline",size:"sm",onClick:x[1]||(x[1]=m=>g.$router.push("/admin/estimates"))},{default:r(()=>[y(h(g.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),a(P,{data:e(o).recentEstimates,columns:e(b),loading:!e(o).isDashboardDataLoaded},M({"cell-user":r(({row:m})=>[a(k,{to:{path:`estimates/${m.data.id}/view`},class:"font-medium text-primary-500"},{default:r(()=>[y(h(m.data.customer.name),1)]),_:2},1032,["to"])]),"cell-total":r(({row:m})=>[a(A,{amount:m.data.total,currency:m.data.customer.currency},null,8,["amount","currency"])]),_:2},[I()?{name:"cell-actions",fn:r(({row:m})=>[a(tt,{row:m,table:l.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])])):v("",!0)])])}}},de={setup(d){const o=K(),s=E(),n=X();return Y(()=>{o.meta.ability&&!s.hasAbilities(o.meta.ability)?n.push({name:"account.settings"}):o.meta.isOwner&&!s.currentUser.is_owner&&n.push({name:"account.settings"})}),(u,l)=>{const f=i("BasePage");return c(),p(f,null,{default:r(()=>[a(xt),a(Xt),a(oe)]),_:1})}}};export{de as default}; diff --git a/public/build/assets/Dashboard.79084651.js b/public/build/assets/Dashboard.79084651.js deleted file mode 100644 index d17c3a52..00000000 --- a/public/build/assets/Dashboard.79084651.js +++ /dev/null @@ -1 +0,0 @@ -import{D as L,_ as F,a as R}from"./EstimateIcon.a0aca522.js";import{o as c,e as C,m as j,h as t,r,l as p,w as i,f as a,g as W,t as _,aj as z,a as q,d as H,ah as V,u as e,j as v,i as y,B as D,C as U,J as Z,k as M,V as N,G,aN as J,D as Y}from"./vendor.fd3b1727.js";import{_ as T,h as K,b as O,e as E,g as h}from"./main.fc26c84f.js";import{_ as Q}from"./LineChart.2823de1b.js";import{_ as X}from"./InvoiceIndexDropdown.5aa0548b.js";import{_ as tt}from"./EstimateIndexDropdown.bae761c6.js";const et=t("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),at=t("path",{d:"M28.2656 23.0547C27.3021 24.0182 26.1302 24.5 24.75 24.5C23.3698 24.5 22.1849 24.0182 21.1953 23.0547C20.2318 22.0651 19.75 20.8802 19.75 19.5C19.75 18.1198 20.2318 16.9479 21.1953 15.9844C22.1849 14.9948 23.3698 14.5 24.75 14.5C26.1302 14.5 27.3021 14.9948 28.2656 15.9844C29.2552 16.9479 29.75 18.1198 29.75 19.5C29.75 20.8802 29.2552 22.0651 28.2656 23.0547ZM28.2656 25.75C29.6979 25.75 30.9219 26.2708 31.9375 27.3125C32.9792 28.3281 33.5 29.5521 33.5 30.9844V32.625C33.5 33.1458 33.3177 33.5885 32.9531 33.9531C32.5885 34.3177 32.1458 34.5 31.625 34.5H17.875C17.3542 34.5 16.9115 34.3177 16.5469 33.9531C16.1823 33.5885 16 33.1458 16 32.625V30.9844C16 29.5521 16.5078 28.3281 17.5234 27.3125C18.5651 26.2708 19.8021 25.75 21.2344 25.75H21.8984C22.8099 26.1667 23.7604 26.375 24.75 26.375C25.7396 26.375 26.6901 26.1667 27.6016 25.75H28.2656Z",fill:"currentColor"},null,-1),st=[et,at],ot={props:{colorClass:{type:String,default:"text-primary-500"}},setup(d){return(o,s)=>(c(),C("svg",{width:"50",height:"50",viewBox:"0 0 50 50",class:j(d.colorClass),fill:"none",xmlns:"http://www.w3.org/2000/svg"},st,2))}},lt={},nt={class:"flex items-center"};function ct(d,o){const s=r("BaseContentPlaceholdersText"),n=r("BaseContentPlaceholdersBox"),u=r("BaseContentPlaceholders");return c(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:i(()=>[t("div",null,[a(s,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),a(s,{class:"h-3 w-28 xl:h-4",lines:1})]),t("div",nt,[a(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var rt=T(lt,[["render",ct]]);const it={},dt={class:"flex items-center"};function ut(d,o){const s=r("BaseContentPlaceholdersText"),n=r("BaseContentPlaceholdersBox"),u=r("BaseContentPlaceholders");return c(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:i(()=>[t("div",null,[a(s,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),a(s,{class:"w-20 h-3 xl:h-4",lines:1})]),t("div",dt,[a(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var mt=T(it,[["render",ut]]);const _t={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},ht={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},pt={class:"flex items-center"},B={props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:String,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(d){return(o,s)=>{const n=r("router-link");return d.loading?d.large?(c(),p(rt,{key:1})):(c(),p(mt,{key:2})):(c(),p(n,{key:0,class:j(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":d.large}]),to:d.route},{default:i(()=>[t("div",null,[t("span",_t,[W(o.$slots,"default")]),t("span",ht,_(d.label),1)]),t("div",pt,[(c(),p(z(d.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},S=(d=!1)=>(d?window.pinia.defineStore:H)({id:"dashboard",state:()=>({stats:{totalAmountDue:0,totalCustomerCount:0,totalInvoiceCount:0,totalEstimateCount:0},chartData:{months:[],invoiceTotals:[],expenseTotals:[],receiptTotals:[],netIncomeTotals:[]},totalSales:null,totalReceipts:null,totalExpenses:null,totalNetIncome:null,recentDueInvoices:[],recentEstimates:[],isDashboardDataLoaded:!1}),actions:{loadData(s){return new Promise((n,u)=>{q.get("/api/v1/dashboard",{params:s}).then(l=>{this.stats.totalAmountDue=l.data.total_amount_due,this.stats.totalCustomerCount=l.data.total_customer_count,this.stats.totalInvoiceCount=l.data.total_invoice_count,this.stats.totalEstimateCount=l.data.total_estimate_count,this.chartData&&l.data.chart_data&&(this.chartData.months=l.data.chart_data.months,this.chartData.invoiceTotals=l.data.chart_data.invoice_totals,this.chartData.expenseTotals=l.data.chart_data.expense_totals,this.chartData.receiptTotals=l.data.chart_data.receipt_totals,this.chartData.netIncomeTotals=l.data.chart_data.net_income_totals),this.totalSales=l.data.total_sales,this.totalReceipts=l.data.total_receipts,this.totalExpenses=l.data.total_expenses,this.totalNetIncome=l.data.total_net_income,this.recentDueInvoices=l.data.recent_due_invoices,this.recentEstimates=l.data.recent_estimates,this.isDashboardDataLoaded=!0,n(l)}).catch(l=>{K(l),u(l)})})}}})(),bt={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},xt={setup(d){V("utils");const o=S(),s=O(),n=E();return(u,l)=>{const f=r("BaseFormatMoney");return c(),C("div",bt,[e(n).hasAbilities(e(h).VIEW_INVOICE)?(c(),p(B,{key:0,"icon-component":L,loading:!e(o).isDashboardDataLoaded,route:"/admin/invoices",large:!0,label:u.$t("dashboard.cards.due_amount")},{default:i(()=>[a(f,{amount:e(o).stats.totalAmountDue,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(h).VIEW_CUSTOMER)?(c(),p(B,{key:1,"icon-component":ot,loading:!e(o).isDashboardDataLoaded,route:"/admin/customers",label:u.$t("dashboard.cards.customers")},{default:i(()=>[y(_(e(o).stats.totalCustomerCount),1)]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(h).VIEW_INVOICE)?(c(),p(B,{key:2,"icon-component":F,loading:!e(o).isDashboardDataLoaded,route:"/admin/invoices",label:u.$t("dashboard.cards.invoices")},{default:i(()=>[y(_(e(o).stats.totalInvoiceCount),1)]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(h).VIEW_ESTIMATE)?(c(),p(B,{key:3,"icon-component":R,loading:!e(o).isDashboardDataLoaded,route:"/admin/estimates",label:u.$t("dashboard.cards.estimates")},{default:i(()=>[y(_(e(o).stats.totalEstimateCount),1)]),_:1},8,["loading","label"])):v("",!0)])}}},ft={},gt={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-8"},yt={class:"flex items-center justify-between mb-2 xl:mb-4"},Ct={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},vt={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},wt={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},$t={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},Dt={class:"flex flex-col items-center justify-center col-span-3 p-6 border-t border-gray-200 border-solid lg:justify-end lg:items-end lg:col-span-1"};function Et(d,o){const s=r("BaseContentPlaceholdersText"),n=r("BaseContentPlaceholdersBox"),u=r("BaseContentPlaceholders");return c(),p(u,{class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},{default:i(()=>[t("div",gt,[t("div",yt,[a(s,{class:"h-10 w-36",lines:1}),a(s,{class:"h-10 w-36 !mt-0",lines:1})]),a(n,{class:"h-80 xl:h-72 sm:w-full"})]),t("div",Ct,[t("div",vt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",wt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",$t,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",Dt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})])])]),_:1})}var Bt=T(ft,[["render",Et]]);const It={key:0,class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},Tt={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-6"},St={class:"flex justify-between mt-1 mb-4 flex-col md:flex-row"},kt={class:"flex items-center sw-section-title h-10"},At={class:"w-full my-2 md:m-0 md:w-40 h-10"},Pt={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},jt={class:"p-6"},Vt={class:"text-xs leading-5 lg:text-sm"},Mt=t("br",null,null,-1),Nt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl"},Ot={class:"p-6"},Lt={class:"text-xs leading-5 lg:text-sm"},Ft=t("br",null,null,-1),Rt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-green-400"},Wt={class:"p-6"},zt={class:"text-xs leading-5 lg:text-sm"},qt=t("br",null,null,-1),Ht={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-red-400"},Ut={class:"col-span-3 p-6 border-t border-gray-200 border-solid lg:col-span-1"},Zt={class:"text-xs leading-5 lg:text-sm"},Gt=t("br",null,null,-1),Jt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-primary-500"},Yt={setup(d){const o=S(),s=O();V("utils");const n=E(),u=D(["This year","Previous year"]),l=D("This year");U(l,b=>{b==="Previous year"?f({previous_year:!0}):f()},{immediate:!0});async function f(b){n.hasAbilities(h.DASHBOARD)&&await o.loadData(b)}return(b,w)=>{const I=r("BaseIcon"),g=r("BaseMultiselect"),x=r("BaseFormatMoney");return c(),C("div",null,[e(o).isDashboardDataLoaded?(c(),C("div",It,[t("div",Tt,[t("div",St,[t("h6",kt,[a(I,{name:"ChartSquareBarIcon",class:"text-primary-400 mr-1"}),y(" "+_(b.$t("dashboard.monthly_chart.title")),1)]),t("div",At,[a(g,{modelValue:l.value,"onUpdate:modelValue":w[0]||(w[0]=$=>l.value=$),options:u.value,"allow-empty":!1,"show-labels":!1,placeholder:b.$t("dashboard.select_year"),"can-deselect":!1},null,8,["modelValue","options","placeholder"])])]),a(Q,{invoices:e(o).chartData.invoiceTotals,expenses:e(o).chartData.expenseTotals,receipts:e(o).chartData.receiptTotals,income:e(o).chartData.netIncomeTotals,labels:e(o).chartData.months,class:"sm:w-full"},null,8,["invoices","expenses","receipts","income","labels"])]),t("div",Pt,[t("div",jt,[t("span",Vt,_(b.$t("dashboard.chart_info.total_sales")),1),Mt,t("span",Nt,[a(x,{amount:e(o).totalSales,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Ot,[t("span",Lt,_(b.$t("dashboard.chart_info.total_receipts")),1),Ft,t("span",Rt,[a(x,{amount:e(o).totalReceipts,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Wt,[t("span",zt,_(b.$t("dashboard.chart_info.total_expense")),1),qt,t("span",Ht,[a(x,{amount:e(o).totalExpenses,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Ut,[t("span",Zt,_(b.$t("dashboard.chart_info.net_income")),1),Gt,t("span",Jt,[a(x,{amount:e(o).totalNetIncome,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])])])])):(c(),p(Bt,{key:1}))])}}},Kt={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},Qt={key:0,class:"due-invoices"},Xt={class:"relative z-10 flex items-center justify-between mb-3"},te={class:"mb-0 text-xl font-semibold leading-normal"},ee={key:1,class:"recent-estimates"},ae={class:"relative z-10 flex items-center justify-between mb-3"},se={class:"mb-0 text-xl font-semibold leading-normal"},oe={setup(d){const o=S(),{t:s}=Z(),n=E(),u=D(null),l=D(null),f=M(()=>[{key:"formattedDueDate",label:s("dashboard.recent_invoices_card.due_on")},{key:"user",label:s("dashboard.recent_invoices_card.customer")},{key:"due_amount",label:s("dashboard.recent_invoices_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]),b=M(()=>[{key:"formattedEstimateDate",label:s("dashboard.recent_estimate_card.date")},{key:"user",label:s("dashboard.recent_estimate_card.customer")},{key:"total",label:s("dashboard.recent_estimate_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]);function w(){return n.hasAbilities([h.DELETE_INVOICE,h.EDIT_INVOICE,h.VIEW_INVOICE,h.SEND_INVOICE])}function I(){return n.hasAbilities([h.CREATE_ESTIMATE,h.EDIT_ESTIMATE,h.VIEW_ESTIMATE,h.SEND_ESTIMATE])}return(g,x)=>{const $=r("BaseButton"),k=r("router-link"),A=r("BaseFormatMoney"),P=r("BaseTable");return c(),C("div",null,[t("div",Kt,[e(n).hasAbilities(e(h).VIEW_INVOICE)?(c(),C("div",Qt,[t("div",Xt,[t("h6",te,_(g.$t("dashboard.recent_invoices_card.title")),1),a($,{size:"sm",variant:"primary-outline",onClick:x[0]||(x[0]=m=>g.$router.push("/admin/invoices"))},{default:i(()=>[y(_(g.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),a(P,{data:e(o).recentDueInvoices,columns:e(f),loading:!e(o).isDashboardDataLoaded},N({"cell-user":i(({row:m})=>[a(k,{to:{path:`invoices/${m.data.id}/view`},class:"font-medium text-primary-500"},{default:i(()=>[y(_(m.data.customer.name),1)]),_:2},1032,["to"])]),"cell-due_amount":i(({row:m})=>[a(A,{amount:m.data.due_amount,currency:m.data.customer.currency},null,8,["amount","currency"])]),_:2},[w()?{name:"cell-actions",fn:i(({row:m})=>[a(X,{row:m.data,table:u.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])])):v("",!0),e(n).hasAbilities(e(h).VIEW_ESTIMATE)?(c(),C("div",ee,[t("div",ae,[t("h6",se,_(g.$t("dashboard.recent_estimate_card.title")),1),a($,{variant:"primary-outline",size:"sm",onClick:x[1]||(x[1]=m=>g.$router.push("/admin/estimates"))},{default:i(()=>[y(_(g.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),a(P,{data:e(o).recentEstimates,columns:e(b),loading:!e(o).isDashboardDataLoaded},N({"cell-user":i(({row:m})=>[a(k,{to:{path:`estimates/${m.data.id}/view`},class:"font-medium text-primary-500"},{default:i(()=>[y(_(m.data.customer.name),1)]),_:2},1032,["to"])]),"cell-total":i(({row:m})=>[a(A,{amount:m.data.total,currency:m.data.customer.currency},null,8,["amount","currency"])]),_:2},[I()?{name:"cell-actions",fn:i(({row:m})=>[a(tt,{row:m,table:l.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])])):v("",!0)])])}}},ue={setup(d){const o=G(),s=E(),n=J();return Y(()=>{o.meta.ability&&!s.hasAbilities(o.meta.ability)?n.push({name:"account.settings"}):o.meta.isOwner&&!s.currentUser.is_owner&&n.push({name:"account.settings"})}),(u,l)=>{const f=r("BasePage");return c(),p(f,null,{default:i(()=>[a(xt),a(Yt),a(oe)]),_:1})}}};export{ue as default}; diff --git a/public/build/assets/Dashboard.905d2846.js b/public/build/assets/Dashboard.905d2846.js deleted file mode 100644 index 5317ed31..00000000 --- a/public/build/assets/Dashboard.905d2846.js +++ /dev/null @@ -1 +0,0 @@ -import{D as I,_ as L,a as M}from"./EstimateIcon.a0aca522.js";import{o as m,e as v,m as $,h as r,a as V,r as i,l as h,w as s,f as t,g as F,t as u,aj as T,ah as w,u as n,i as _,J as z,G as A,k as D}from"./vendor.fd3b1727.js";import{u as C}from"./global.cf2a9bd7.js";import{h as Z}from"./auth.75822dcb.js";import{_ as k}from"./main.fc26c84f.js";import S from"./BaseTable.c2b2d20a.js";const q=r("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),N=r("path",{d:"M17.8 17.8C17.1635 17.8 16.5531 18.0529 16.103 18.503C15.6529 18.9531 15.4 19.5635 15.4 20.2V21.4H34.6V20.2C34.6 19.5635 34.3472 18.9531 33.8971 18.503C33.447 18.0529 32.8365 17.8 32.2 17.8H17.8Z",fill:"currentColor"},null,-1),G=r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M34.6 23.8H15.4V29.8C15.4 30.4366 15.6529 31.047 16.103 31.4971C16.5531 31.9472 17.1635 32.2 17.8 32.2H32.2C32.8365 32.2 33.447 31.9472 33.8971 31.4971C34.3472 31.047 34.6 30.4366 34.6 29.8V23.8ZM17.8 28.6C17.8 28.2818 17.9265 27.9766 18.1515 27.7515C18.3765 27.5265 18.6818 27.4 19 27.4H20.2C20.5183 27.4 20.8235 27.5265 21.0486 27.7515C21.2736 27.9766 21.4 28.2818 21.4 28.6C21.4 28.9183 21.2736 29.2235 21.0486 29.4486C20.8235 29.6736 20.5183 29.8 20.2 29.8H19C18.6818 29.8 18.3765 29.6736 18.1515 29.4486C17.9265 29.2235 17.8 28.9183 17.8 28.6ZM23.8 27.4C23.4818 27.4 23.1765 27.5265 22.9515 27.7515C22.7265 27.9766 22.6 28.2818 22.6 28.6C22.6 28.9183 22.7265 29.2235 22.9515 29.4486C23.1765 29.6736 23.4818 29.8 23.8 29.8H25C25.3183 29.8 25.6235 29.6736 25.8486 29.4486C26.0736 29.2235 26.2 28.9183 26.2 28.6C26.2 28.2818 26.0736 27.9766 25.8486 27.7515C25.6235 27.5265 25.3183 27.4 25 27.4H23.8Z",fill:"currentColor"},null,-1),O=[q,N,G],J={props:{colorClass:{type:String,default:"text-primary-500"}},setup(c){return(a,o)=>(m(),v("svg",{width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:$(c.colorClass)},O,2))}},{defineStore:R}=window.pinia,P=R({id:"dashboard",state:()=>({recentInvoices:[],recentEstimates:[],invoiceCount:0,estimateCount:0,paymentCount:0,totalDueAmount:[],isDashboardDataLoaded:!1}),actions:{loadData(c){const a=C();return new Promise((o,d)=>{V.get(`/api/v1/${a.companySlug}/customer/dashboard`,{data:c}).then(e=>{this.totalDueAmount=e.data.due_amount,this.estimateCount=e.data.estimate_count,this.invoiceCount=e.data.invoice_count,this.paymentCount=e.data.payment_count,this.recentInvoices=e.data.recentInvoices,this.recentEstimates=e.data.recentEstimates,a.getDashboardDataLoaded=!0,o(e)}).catch(e=>{Z(e),d(e)})})}}}),K={},Q={class:"flex items-center"};function U(c,a){const o=i("BaseContentPlaceholdersText"),d=i("BaseContentPlaceholdersBox"),e=i("BaseContentPlaceholders");return m(),h(e,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:s(()=>[r("div",null,[t(o,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),t(o,{class:"h-3 w-28 xl:h-4",lines:1})]),r("div",Q,[t(d,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var W=k(K,[["render",U]]);const X={},Y={class:"flex items-center"};function ee(c,a){const o=i("BaseContentPlaceholdersText"),d=i("BaseContentPlaceholdersBox"),e=i("BaseContentPlaceholders");return m(),h(e,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:s(()=>[r("div",null,[t(o,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),t(o,{class:"w-20 h-3 xl:h-4",lines:1})]),r("div",Y,[t(d,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var te=k(X,[["render",ee]]);const ae={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},se={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},oe={class:"flex items-center"},f={props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:Object,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(c){return(a,o)=>{const d=i("router-link");return c.loading?c.large?(m(),h(W,{key:1})):(m(),h(te,{key:2})):(m(),h(d,{key:0,class:$(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":c.large}]),to:c.route},{default:s(()=>[r("div",null,[r("span",ae,[F(a.$slots,"default")]),r("span",se,u(c.label),1)]),r("div",oe,[(m(),h(T(c.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},ne={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},le={setup(c){w("utils");const a=C(),o=P();return o.loadData(),(d,e)=>{const g=i("BaseFormatMoney");return m(),v("div",ne,[t(f,{"icon-component":I,loading:!n(a).getDashboardDataLoaded,route:{name:"invoices.dashboard"},large:!0,label:d.$t("dashboard.cards.due_amount")},{default:s(()=>[t(g,{amount:n(o).totalDueAmount,currency:n(a).currency},null,8,["amount","currency"])]),_:1},8,["loading","route","label"]),t(f,{"icon-component":L,loading:!n(a).getDashboardDataLoaded,route:{name:"invoices.dashboard"},label:d.$t("dashboard.cards.invoices")},{default:s(()=>[_(u(n(o).invoiceCount),1)]),_:1},8,["loading","route","label"]),t(f,{"icon-component":M,loading:!n(a).getDashboardDataLoaded,route:{name:"estimates.dashboard"},label:d.$t("dashboard.cards.estimates")},{default:s(()=>[_(u(n(o).estimateCount),1)]),_:1},8,["loading","route","label"]),t(f,{"icon-component":J,loading:!n(a).getDashboardDataLoaded,route:{name:"payments.dashboard"},label:d.$t("dashboard.cards.payments")},{default:s(()=>[_(u(n(o).paymentCount),1)]),_:1},8,["loading","route","label"])])}}},re={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},ce={class:"due-invoices"},de={class:"relative z-10 flex items-center justify-between mb-3"},ie={class:"mb-0 text-xl font-semibold leading-normal"},ue={class:"recent-estimates"},me={class:"relative z-10 flex items-center justify-between mb-3"},_e={class:"mb-0 text-xl font-semibold leading-normal"},he={setup(c){const a=C(),o=P(),{tm:d,t:e}=z();w("utils"),A();const g=D(()=>[{key:"formattedDueDate",label:e("dashboard.recent_invoices_card.due_on")},{key:"invoice_number",label:e("invoices.number")},{key:"paid_status",label:e("invoices.status")},{key:"due_amount",label:e("dashboard.recent_invoices_card.amount_due")}]),j=D(()=>[{key:"formattedEstimateDate",label:e("dashboard.recent_estimate_card.date")},{key:"estimate_number",label:e("estimates.number")},{key:"status",label:e("estimates.status")},{key:"total",label:e("dashboard.recent_estimate_card.amount_due")}]);return(b,p)=>{const x=i("BaseButton"),y=i("router-link"),E=i("BasePaidStatusBadge"),B=i("BaseFormatMoney"),H=i("BaseEstimateStatusBadge");return m(),v("div",re,[r("div",ce,[r("div",de,[r("h6",ie,u(b.$t("dashboard.recent_invoices_card.title")),1),t(x,{size:"sm",variant:"primary-outline",onClick:p[0]||(p[0]=l=>b.$router.push({name:"invoices.dashboard"}))},{default:s(()=>[_(u(b.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),t(S,{data:n(o).recentInvoices,columns:n(g),loading:!n(a).getDashboardDataLoaded},{"cell-invoice_number":s(({row:l})=>[t(y,{to:{path:`/${n(a).companySlug}/customer/invoices/${l.data.id}/view`},class:"font-medium text-primary-500"},{default:s(()=>[_(u(l.data.invoice_number),1)]),_:2},1032,["to"])]),"cell-paid_status":s(({row:l})=>[t(E,{status:l.data.paid_status},{default:s(()=>[_(u(l.data.paid_status),1)]),_:2},1032,["status"])]),"cell-due_amount":s(({row:l})=>[t(B,{amount:l.data.due_amount,currency:n(a).currency},null,8,["amount","currency"])]),_:1},8,["data","columns","loading"])]),r("div",ue,[r("div",me,[r("h6",_e,u(b.$t("dashboard.recent_estimate_card.title")),1),t(x,{variant:"primary-outline",size:"sm",onClick:p[1]||(p[1]=l=>b.$router.push({name:"estimates.dashboard"}))},{default:s(()=>[_(u(b.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),t(S,{data:n(o).recentEstimates,columns:n(j),loading:!n(a).getDashboardDataLoaded},{"cell-estimate_number":s(({row:l})=>[t(y,{to:{path:`/${n(a).companySlug}/customer/estimates/${l.data.id}/view`},class:"font-medium text-primary-500"},{default:s(()=>[_(u(l.data.estimate_number),1)]),_:2},1032,["to"])]),"cell-status":s(({row:l})=>[t(H,{status:l.data.status,class:"px-3 py-1"},{default:s(()=>[_(u(l.data.status),1)]),_:2},1032,["status"])]),"cell-total":s(({row:l})=>[t(B,{amount:l.data.total,currency:n(a).currency},null,8,["amount","currency"])]),_:1},8,["data","columns","loading"])])])}}},xe={setup(c){return(a,o)=>{const d=i("BasePage");return m(),h(d,null,{default:s(()=>[t(le),t(he)]),_:1})}}};export{xe as default}; diff --git a/public/build/assets/DateTimeType-hV9WZ_9z.js b/public/build/assets/DateTimeType-hV9WZ_9z.js new file mode 100644 index 00000000..308c193c --- /dev/null +++ b/public/build/assets/DateTimeType-hV9WZ_9z.js @@ -0,0 +1 @@ +import{a9 as m,l as r,r as p,o as d,n as c,m as i,p as f}from"./main-vzIkKseS.js";const k={props:{modelValue:{type:String,default:m().format("YYYY-MM-DD hh:MM")}},emits:["update:modelValue"],setup(t,{emit:l}){const s=t,e=r({get:()=>s.modelValue,set:a=>{l("update:modelValue",a)}});return(a,o)=>{const n=p("BaseDatePicker");return d(),c(n,{modelValue:i(e),"onUpdate:modelValue":o[0]||(o[0]=u=>f(e)?e.value=u:null),"enable-time":""},null,8,["modelValue"])}}};export{k as default}; diff --git a/public/build/assets/DateTimeType.4faa64b8.js b/public/build/assets/DateTimeType.4faa64b8.js deleted file mode 100644 index c3095497..00000000 --- a/public/build/assets/DateTimeType.4faa64b8.js +++ /dev/null @@ -1 +0,0 @@ -import{I as r,k as d,r as m,o as p,l as c,u as f,x as i}from"./vendor.fd3b1727.js";const k={props:{modelValue:{type:String,default:r().format("YYYY-MM-DD hh:MM")}},emits:["update:modelValue"],setup(t,{emit:l}){const s=t,e=d({get:()=>s.modelValue,set:o=>{l("update:modelValue",o)}});return(o,a)=>{const u=m("BaseDatePicker");return p(),c(u,{modelValue:f(e),"onUpdate:modelValue":a[0]||(a[0]=n=>i(e)?e.value=n:null),"enable-time":""},null,8,["modelValue"])}}};export{k as default}; diff --git a/public/build/assets/DateType-AuJbnKst.js b/public/build/assets/DateType-AuJbnKst.js new file mode 100644 index 00000000..bce95791 --- /dev/null +++ b/public/build/assets/DateType-AuJbnKst.js @@ -0,0 +1 @@ +import{a9 as r,l as m,r as p,o as d,n as c,m as f,p as i}from"./main-vzIkKseS.js";const k={props:{modelValue:{type:[String,Date],default:r().format("YYYY-MM-DD")}},emits:["update:modelValue"],setup(t,{emit:l}){const s=t,e=m({get:()=>s.modelValue,set:a=>{l("update:modelValue",a)}});return(a,o)=>{const u=p("BaseDatePicker");return d(),c(u,{modelValue:f(e),"onUpdate:modelValue":o[0]||(o[0]=n=>i(e)?e.value=n:null)},null,8,["modelValue"])}}};export{k as default}; diff --git a/public/build/assets/DateType.074be010.js b/public/build/assets/DateType.074be010.js deleted file mode 100644 index f04b5b4e..00000000 --- a/public/build/assets/DateType.074be010.js +++ /dev/null @@ -1 +0,0 @@ -import{I as r,k as d,r as m,o as p,l as c,u as f,x as i}from"./vendor.fd3b1727.js";const k={props:{modelValue:{type:[String,Date],default:r().format("YYYY-MM-DD")}},emits:["update:modelValue"],setup(t,{emit:l}){const s=t,e=d({get:()=>s.modelValue,set:o=>{l("update:modelValue",o)}});return(o,a)=>{const u=m("BaseDatePicker");return p(),c(u,{modelValue:f(e),"onUpdate:modelValue":a[0]||(a[0]=n=>i(e)?e.value=n:null)},null,8,["modelValue"])}}};export{k as default}; diff --git a/public/build/assets/DragIcon-szQ4f7me.js b/public/build/assets/DragIcon-szQ4f7me.js new file mode 100644 index 00000000..c026da5f --- /dev/null +++ b/public/build/assets/DragIcon-szQ4f7me.js @@ -0,0 +1,10 @@ +import{ah as $r,aH as Br,aj as Kr,ak as Hr,X as Wr,o as Xr,c as Yr,b as Vr}from"./main-vzIkKseS.js";var Pr={exports:{}};/**! + * Sortable 1.14.0 + * @author RubaXa + * @author owenm + * @license MIT + */function gr(l,r){var n=Object.keys(l);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(l);r&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})),n.push.apply(n,i)}return n}function Kt(l){for(var r=1;r=0)&&(n[e]=l[e]);return n}function Qr(l,r){if(l==null)return{};var n=Jr(l,r),i,e;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(l);for(e=0;e=0)&&Object.prototype.propertyIsEnumerable.call(l,i)&&(n[i]=l[i])}return n}function Zr(l){return kr(l)||qr(l)||_r(l)||tn()}function kr(l){if(Array.isArray(l))return ir(l)}function qr(l){if(typeof Symbol<"u"&&l[Symbol.iterator]!=null||l["@@iterator"]!=null)return Array.from(l)}function _r(l,r){if(l){if(typeof l=="string")return ir(l,r);var n=Object.prototype.toString.call(l).slice(8,-1);if(n==="Object"&&l.constructor&&(n=l.constructor.name),n==="Map"||n==="Set")return Array.from(l);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(l,r)}}function ir(l,r){(r==null||r>l.length)&&(r=l.length);for(var n=0,i=new Array(r);n"&&(r=r.substring(1)),l)try{if(l.matches)return l.matches(r);if(l.msMatchesSelector)return l.msMatchesSelector(r);if(l.webkitMatchesSelector)return l.webkitMatchesSelector(r)}catch{return!1}return!1}}function nn(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function Ut(l,r,n,i){if(l){n=n||document;do{if(r!=null&&(r[0]===">"?l.parentNode===n&&He(l,r):He(l,r))||i&&l===n)return l;if(l===n)break}while(l=nn(l))}return null}var mr=/\s+/g;function lt(l,r,n){if(l&&r)if(l.classList)l.classList[n?"add":"remove"](r);else{var i=(" "+l.className+" ").replace(mr," ").replace(" "+r+" "," ");l.className=(i+(n?" "+r:"")).replace(mr," ")}}function L(l,r,n){var i=l&&l.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(l,""):l.currentStyle&&(n=l.currentStyle),r===void 0?n:n[r];!(r in i)&&r.indexOf("webkit")===-1&&(r="-webkit-"+r),i[r]=n+(typeof n=="string"?"":"px")}}function ee(l,r){var n="";if(typeof l=="string")n=l;else do{var i=L(l,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!r&&(l=l.parentNode));var e=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return e&&new e(n)}function Ar(l,r,n){if(l){var i=l.getElementsByTagName(r),e=0,f=i.length;if(n)for(;e=f:t=e<=f,!t)return i;if(i===Bt())break;i=Qt(i,!1)}return!1}function se(l,r,n,i){for(var e=0,f=0,t=l.children;f2&&arguments[2]!==void 0?arguments[2]:{},e=i.evt,f=Qr(i,cn);Ce.pluginEvent.bind(K)(r,n,Kt({dragEl:A,parentEl:ut,ghostEl:z,rootEl:ot,nextEl:te,lastDownEl:Ge,cloneEl:ct,cloneHidden:Jt,dragStarted:Se,putSortable:Et,activeSortable:K.active,originalEvent:e,oldIndex:le,oldDraggableIndex:Te,newIndex:Mt,newDraggableIndex:zt,hideGhostForTarget:wr,unhideGhostForTarget:Lr,cloneNowHidden:function(){Jt=!0},cloneNowShown:function(){Jt=!1},dispatchSortableEvent:function(o){It({sortable:n,name:o,originalEvent:e})}},f))};function It(l){ye(Kt({putSortable:Et,cloneEl:ct,targetEl:A,rootEl:ot,oldIndex:le,oldDraggableIndex:Te,newIndex:Mt,newDraggableIndex:zt},l))}var A,ut,z,ot,te,Ge,ct,Jt,le,Mt,Te,zt,Me,Et,ie=!1,We=!1,Xe=[],qt,wt,_e,tr,Er,xr,Se,oe,Ie,Pe=!1,Ne=!1,$e,xt,er=[],lr=!1,Ye=[],ze=typeof document<"u",je=Dr,Or=De||Xt?"cssFloat":"float",dn=ze&&!rn&&!Dr&&"draggable"in document.createElement("div"),Nr=function(){if(ze){if(Xt)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}}(),jr=function(r,n){var i=L(r),e=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),f=se(r,0,n),t=se(r,1,n),o=f&&L(f),a=t&&L(t),s=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+at(f).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+at(t).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(f&&o.float&&o.float!=="none"){var u=o.float==="left"?"left":"right";return t&&(a.clear==="both"||a.clear===u)?"vertical":"horizontal"}return f&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||s>=e&&i[Or]==="none"||t&&i[Or]==="none"&&s+c>e)?"vertical":"horizontal"},vn=function(r,n,i){var e=i?r.left:r.top,f=i?r.right:r.bottom,t=i?r.width:r.height,o=i?n.left:n.top,a=i?n.right:n.bottom,s=i?n.width:n.height;return e===o||f===a||e+t/2===o+s/2},hn=function(r,n){var i;return Xe.some(function(e){var f=e[Ot].options.emptyInsertThreshold;if(!(!f||cr(e))){var t=at(e),o=r>=t.left-f&&r<=t.right+f,a=n>=t.top-f&&n<=t.bottom+f;if(o&&a)return i=e}}),i},Fr=function(r){function n(f,t){return function(o,a,s,c){var u=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(f==null&&(t||u))return!0;if(f==null||f===!1)return!1;if(t&&f==="clone")return f;if(typeof f=="function")return n(f(o,a,s,c),t)(o,a,s,c);var d=(t?o:a).options.group.name;return f===!0||typeof f=="string"&&f===d||f.join&&f.indexOf(d)>-1}}var i={},e=r.group;(!e||Ue(e)!="object")&&(e={name:e}),i.name=e.name,i.checkPull=n(e.pull,!0),i.checkPut=n(e.put),i.revertClone=e.revertClone,r.group=i},wr=function(){!Nr&&z&&L(z,"display","none")},Lr=function(){!Nr&&z&&L(z,"display","")};ze&&document.addEventListener("click",function(l){if(We)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),We=!1,!1},!0);var _t=function(r){if(A){r=r.touches?r.touches[0]:r;var n=hn(r.clientX,r.clientY);if(n){var i={};for(var e in r)r.hasOwnProperty(e)&&(i[e]=r[e]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[Ot]._onDragOver(i)}}},gn=function(r){A&&A.parentNode[Ot]._isOutsideThisEl(r.target)};function K(l,r){if(!(l&&l.nodeType&&l.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(l));this.el=l,this.options=r=jt({},r),l[Ot]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(l.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return jr(l,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,o){t.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:K.supportPointer!==!1&&"PointerEvent"in window&&!xe,emptyInsertThreshold:5};Ce.initializePlugins(this,l,n);for(var i in n)!(i in r)&&(r[i]=n[i]);Fr(r);for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this));this.nativeDraggable=r.forceFallback?!1:dn,this.nativeDraggable&&(this.options.touchStartThreshold=1),r.supportPointer?Z(l,"pointerdown",this._onTapStart):(Z(l,"mousedown",this._onTapStart),Z(l,"touchstart",this._onTapStart)),this.nativeDraggable&&(Z(l,"dragover",this),Z(l,"dragenter",this)),Xe.push(this.el),r.store&&r.store.get&&this.sort(r.store.get(this)||[]),jt(this,sn())}K.prototype={constructor:K,_isOutsideThisEl:function(r){!this.el.contains(r)&&r!==this.el&&(oe=null)},_getDirection:function(r,n){return typeof this.options.direction=="function"?this.options.direction.call(this,r,n,A):this.options.direction},_onTapStart:function(r){if(r.cancelable){var n=this,i=this.el,e=this.options,f=e.preventOnFilter,t=r.type,o=r.touches&&r.touches[0]||r.pointerType&&r.pointerType==="touch"&&r,a=(o||r).target,s=r.target.shadowRoot&&(r.path&&r.path[0]||r.composedPath&&r.composedPath()[0])||a,c=e.filter;if(On(i),!A&&!(/mousedown|pointerdown/.test(t)&&r.button!==0||e.disabled)&&!s.isContentEditable&&!(!this.nativeDraggable&&xe&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=Ut(a,e.draggable,i,!1),!(a&&a.animated)&&Ge!==a)){if(le=dt(a),Te=dt(a,e.draggable),typeof c=="function"){if(c.call(this,r,a,this)){It({sortable:n,rootEl:s,name:"filter",targetEl:a,toEl:i,fromEl:i}),Dt("filter",n,{evt:r}),f&&r.cancelable&&r.preventDefault();return}}else if(c&&(c=c.split(",").some(function(u){if(u=Ut(s,u.trim(),i,!1),u)return It({sortable:n,rootEl:u,name:"filter",targetEl:a,fromEl:i,toEl:i}),Dt("filter",n,{evt:r}),!0}),c)){f&&r.cancelable&&r.preventDefault();return}e.handle&&!Ut(s,e.handle,i,!1)||this._prepareDragStart(r,o,a)}}},_prepareDragStart:function(r,n,i){var e=this,f=e.el,t=e.options,o=f.ownerDocument,a;if(i&&!A&&i.parentNode===f){var s=at(i);if(ot=f,A=i,ut=A.parentNode,te=A.nextSibling,Ge=i,Me=t.group,K.dragged=A,qt={target:A,clientX:(n||r).clientX,clientY:(n||r).clientY},Er=qt.clientX-s.left,xr=qt.clientY-s.top,this._lastX=(n||r).clientX,this._lastY=(n||r).clientY,A.style["will-change"]="all",a=function(){if(Dt("delayEnded",e,{evt:r}),K.eventCanceled){e._onDrop();return}e._disableDelayedDragEvents(),!pr&&e.nativeDraggable&&(A.draggable=!0),e._triggerDragStart(r,n),It({sortable:e,name:"choose",originalEvent:r}),lt(A,t.chosenClass,!0)},t.ignore.split(",").forEach(function(c){Ar(A,c.trim(),rr)}),Z(o,"dragover",_t),Z(o,"mousemove",_t),Z(o,"touchmove",_t),Z(o,"mouseup",e._onDrop),Z(o,"touchend",e._onDrop),Z(o,"touchcancel",e._onDrop),pr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,A.draggable=!0),Dt("delayStart",this,{evt:r}),t.delay&&(!t.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(De||Xt))){if(K.eventCanceled){this._onDrop();return}Z(o,"mouseup",e._disableDelayedDrag),Z(o,"touchend",e._disableDelayedDrag),Z(o,"touchcancel",e._disableDelayedDrag),Z(o,"mousemove",e._delayedDragTouchMoveHandler),Z(o,"touchmove",e._delayedDragTouchMoveHandler),t.supportPointer&&Z(o,"pointermove",e._delayedDragTouchMoveHandler),e._dragStartTimer=setTimeout(a,t.delay)}else a()}},_delayedDragTouchMoveHandler:function(r){var n=r.touches?r.touches[0]:r;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){A&&rr(A),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var r=this.el.ownerDocument;Q(r,"mouseup",this._disableDelayedDrag),Q(r,"touchend",this._disableDelayedDrag),Q(r,"touchcancel",this._disableDelayedDrag),Q(r,"mousemove",this._delayedDragTouchMoveHandler),Q(r,"touchmove",this._delayedDragTouchMoveHandler),Q(r,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(r,n){n=n||r.pointerType=="touch"&&r,!this.nativeDraggable||n?this.options.supportPointer?Z(document,"pointermove",this._onTouchMove):n?Z(document,"touchmove",this._onTouchMove):Z(document,"mousemove",this._onTouchMove):(Z(A,"dragend",this),Z(ot,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(r,n){if(ie=!1,ot&&A){Dt("dragStarted",this,{evt:n}),this.nativeDraggable&&Z(document,"dragover",gn);var i=this.options;!r&<(A,i.dragClass,!1),lt(A,i.ghostClass,!0),K.active=this,r&&this._appendGhost(),It({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(wt){this._lastX=wt.clientX,this._lastY=wt.clientY,wr();for(var r=document.elementFromPoint(wt.clientX,wt.clientY),n=r;r&&r.shadowRoot&&(r=r.shadowRoot.elementFromPoint(wt.clientX,wt.clientY),r!==n);)n=r;if(A.parentNode[Ot]._isOutsideThisEl(r),n)do{if(n[Ot]){var i=void 0;if(i=n[Ot]._onDragOver({clientX:wt.clientX,clientY:wt.clientY,target:r,rootEl:n}),i&&!this.options.dragoverBubble)break}r=n}while(n=n.parentNode);Lr()}},_onTouchMove:function(r){if(qt){var n=this.options,i=n.fallbackTolerance,e=n.fallbackOffset,f=r.touches?r.touches[0]:r,t=z&&ee(z,!0),o=z&&t&&t.a,a=z&&t&&t.d,s=je&&xt&&Sr(xt),c=(f.clientX-qt.clientX+e.x)/(o||1)+(s?s[0]-er[0]:0)/(o||1),u=(f.clientY-qt.clientY+e.y)/(a||1)+(s?s[1]-er[1]:0)/(a||1);if(!K.active&&!ie){if(i&&Math.max(Math.abs(f.clientX-this._lastX),Math.abs(f.clientY-this._lastY))=0&&(It({rootEl:ut,name:"add",toEl:ut,fromEl:ot,originalEvent:r}),It({sortable:this,name:"remove",toEl:ut,originalEvent:r}),It({rootEl:ut,name:"sort",toEl:ut,fromEl:ot,originalEvent:r}),It({sortable:this,name:"sort",toEl:ut,originalEvent:r})),Et&&Et.save()):Mt!==le&&Mt>=0&&(It({sortable:this,name:"update",toEl:ut,originalEvent:r}),It({sortable:this,name:"sort",toEl:ut,originalEvent:r})),K.active&&((Mt==null||Mt===-1)&&(Mt=le,zt=Te),It({sortable:this,name:"end",toEl:ut,originalEvent:r}),this.save()))),this._nulling()},_nulling:function(){Dt("nulling",this),ot=A=ut=z=te=ct=Ge=Jt=qt=wt=Se=Mt=zt=le=Te=oe=Ie=Et=Me=K.dragged=K.ghost=K.clone=K.active=null,Ye.forEach(function(r){r.checked=!0}),Ye.length=_e=tr=0},handleEvent:function(r){switch(r.type){case"drop":case"dragend":this._onDrop(r);break;case"dragenter":case"dragover":A&&(this._onDragOver(r),pn(r));break;case"selectstart":r.preventDefault();break}},toArray:function(){for(var r=[],n,i=this.el.children,e=0,f=i.length,t=this.options;ei.right+e||l.clientX<=i.right&&l.clientY>i.bottom&&l.clientX>=i.left:l.clientX>i.right&&l.clientY>i.top||l.clientX<=i.right&&l.clientY>i.bottom+e}function bn(l,r,n,i,e,f,t,o){var a=i?l.clientY:l.clientX,s=i?n.height:n.width,c=i?n.top:n.left,u=i?n.bottom:n.right,d=!1;if(!t){if(o&&$ec+s*f/2:au-$e)return-Ie}else if(a>c+s*(1-e)/2&&au-s*f/2)?a>c+s/2?1:-1:0}function En(l){return dt(A)1&&(V.forEach(function(o){f.addAnimationState({target:o,rect:Ct?at(o):t}),ke(o),o.fromRect=t,i.removeAnimationState(o)}),Ct=!1,Cn(!this.options.removeCloneOnHide,e))},dragOverCompleted:function(n){var i=n.sortable,e=n.isOwner,f=n.insertion,t=n.activeSortable,o=n.parentEl,a=n.putSortable,s=this.options;if(f){if(e&&t._hideClone(),pe=!1,s.animation&&V.length>1&&(Ct||!e&&!t.options.sort&&!a)){var c=at(et,!1,!0,!0);V.forEach(function(d){d!==et&&(br(d,c),o.appendChild(d))}),Ct=!0}if(!e)if(Ct||Le(),V.length>1){var u=we;t._showClone(i),t.options.animation&&!we&&u&&Rt.forEach(function(d){t.addAnimationState({target:d,rect:me}),d.fromRect=me,d.thisAnimationDuration=null})}else t._showClone(i)}},dragOverAnimationCapture:function(n){var i=n.dragRect,e=n.isOwner,f=n.activeSortable;if(V.forEach(function(o){o.thisAnimationDuration=null}),f.options.animation&&!e&&f.multiDrag.isMultiDrag){me=jt({},i);var t=ee(et,!0);me.top-=t.f,me.left-=t.e}},dragOverAnimationComplete:function(){Ct&&(Ct=!1,Le())},drop:function(n){var i=n.originalEvent,e=n.rootEl,f=n.parentEl,t=n.sortable,o=n.dispatchSortableEvent,a=n.oldIndex,s=n.putSortable,c=s||this.sortable;if(i){var u=this.options,d=f.children;if(!ae)if(u.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),lt(et,u.selectedClass,!~V.indexOf(et)),~V.indexOf(et))V.splice(V.indexOf(et),1),ge=null,ye({sortable:t,rootEl:e,name:"deselect",targetEl:et,originalEvt:i});else{if(V.push(et),ye({sortable:t,rootEl:e,name:"select",targetEl:et,originalEvt:i}),i.shiftKey&&ge&&t.el.contains(ge)){var v=dt(ge),h=dt(et);if(~v&&~h&&v!==h){var g,p;for(h>v?(p=v,g=h):(p=h,g=v+1);p1){var S=at(et),b=dt(et,":not(."+this.options.selectedClass+")");if(!pe&&u.animation&&(et.thisAnimationDuration=null),c.captureAnimationState(),!pe&&(u.animation&&(et.fromRect=S,V.forEach(function(x){if(x.thisAnimationDuration=null,x!==et){var P=Ct?at(x):S;x.fromRect=P,c.addAnimationState({target:x,rect:P})}})),Le(),V.forEach(function(x){d[b]?f.insertBefore(x,d[b]):f.appendChild(x),b++}),a===dt(et))){var I=!1;V.forEach(function(x){if(x.sortableIndex!==dt(x)){I=!0;return}}),I&&o("update")}V.forEach(function(x){ke(x)}),c.animateAll()}Lt=c}(e===f||s&&s.lastPutMode!=="clone")&&Rt.forEach(function(x){x.parentNode&&x.parentNode.removeChild(x)})}},nullingGlobal:function(){this.isMultiDrag=ae=!1,Rt.length=0},destroyGlobal:function(){this._deselectMultiDrag(),Q(document,"pointerup",this._deselectMultiDrag),Q(document,"mouseup",this._deselectMultiDrag),Q(document,"touchend",this._deselectMultiDrag),Q(document,"keydown",this._checkKeyDown),Q(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(n){if(!(typeof ae<"u"&&ae)&&Lt===this.sortable&&!(n&&Ut(n.target,this.options.draggable,this.sortable.el,!1))&&!(n&&n.button!==0))for(;V.length;){var i=V[0];lt(i,this.options.selectedClass,!1),V.shift(),ye({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:i,originalEvt:n})}},_checkKeyDown:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},jt(l,{pluginName:"multiDrag",utils:{select:function(n){var i=n.parentNode[Ot];!i||!i.options.multiDrag||~V.indexOf(n)||(Lt&&Lt!==i&&(Lt.multiDrag._deselectMultiDrag(),Lt=i),lt(n,i.options.selectedClass,!0),V.push(n))},deselect:function(n){var i=n.parentNode[Ot],e=V.indexOf(n);!i||!i.options.multiDrag||!~e||(lt(n,i.options.selectedClass,!1),V.splice(e,1))}},eventProperties:function(){var n=this,i=[],e=[];return V.forEach(function(f){i.push({multiDragElement:f,index:f.sortableIndex});var t;Ct&&f!==et?t=-1:Ct?t=dt(f,":not(."+n.options.selectedClass+")"):t=dt(f),e.push({multiDragElement:f,index:t})}),{items:Zr(V),clones:[].concat(Rt),oldIndicies:i,newIndicies:e}},optionListeners:{multiDragKey:function(n){return n=n.toLowerCase(),n==="ctrl"?n="Control":n.length>1&&(n=n.charAt(0).toUpperCase()+n.substr(1)),n}}})}function Cn(l,r){V.forEach(function(n,i){var e=r.children[n.sortableIndex+(l?Number(i):0)];e?r.insertBefore(n,e):r.appendChild(n)})}function Ir(l,r){Rt.forEach(function(n,i){var e=r.children[n.sortableIndex+(l?Number(i):0)];e?r.insertBefore(n,e):r.appendChild(n)})}function Le(){V.forEach(function(l){l!==et&&l.parentNode&&l.parentNode.removeChild(l)})}K.mount(new Tn);K.mount(hr,vr);const An=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:Dn,Sortable:K,Swap:In,default:K},Symbol.toStringTag,{value:"Module"})),Rn=$r(An);(function(l,r){(function(i,e){l.exports=e(Br,Rn)})(typeof self<"u"?self:Kr,function(n,i){return function(e){var f={};function t(o){if(f[o])return f[o].exports;var a=f[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=f,t.d=function(o,a,s){t.o(o,a)||Object.defineProperty(o,a,{enumerable:!0,get:s})},t.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},t.t=function(o,a){if(a&1&&(o=t(o)),a&8||a&4&&typeof o=="object"&&o&&o.__esModule)return o;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:o}),a&2&&typeof o!="string")for(var c in o)t.d(s,c,(function(u){return o[u]}).bind(null,c));return s},t.n=function(o){var a=o&&o.__esModule?function(){return o.default}:function(){return o};return t.d(a,"a",a),a},t.o=function(o,a){return Object.prototype.hasOwnProperty.call(o,a)},t.p="",t(t.s="fb15")}({"00ee":function(e,f,t){var o=t("b622"),a=o("toStringTag"),s={};s[a]="z",e.exports=String(s)==="[object z]"},"0366":function(e,f,t){var o=t("1c0b");e.exports=function(a,s,c){if(o(a),s===void 0)return a;switch(c){case 0:return function(){return a.call(s)};case 1:return function(u){return a.call(s,u)};case 2:return function(u,d){return a.call(s,u,d)};case 3:return function(u,d,v){return a.call(s,u,d,v)}}return function(){return a.apply(s,arguments)}}},"057f":function(e,f,t){var o=t("fc6a"),a=t("241c").f,s={}.toString,c=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(d){try{return a(d)}catch{return c.slice()}};e.exports.f=function(v){return c&&s.call(v)=="[object Window]"?u(v):a(o(v))}},"06cf":function(e,f,t){var o=t("83ab"),a=t("d1e7"),s=t("5c6c"),c=t("fc6a"),u=t("c04e"),d=t("5135"),v=t("0cfb"),h=Object.getOwnPropertyDescriptor;f.f=o?h:function(p,S){if(p=c(p),S=u(S,!0),v)try{return h(p,S)}catch{}if(d(p,S))return s(!a.f.call(p,S),p[S])}},"0cfb":function(e,f,t){var o=t("83ab"),a=t("d039"),s=t("cc12");e.exports=!o&&!a(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!=7})},"13d5":function(e,f,t){var o=t("23e7"),a=t("d58f").left,s=t("a640"),c=t("ae40"),u=s("reduce"),d=c("reduce",{1:0});o({target:"Array",proto:!0,forced:!u||!d},{reduce:function(h){return a(this,h,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(e,f,t){var o=t("c6b6"),a=t("9263");e.exports=function(s,c){var u=s.exec;if(typeof u=="function"){var d=u.call(s,c);if(typeof d!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return d}if(o(s)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return a.call(s,c)}},"159b":function(e,f,t){var o=t("da84"),a=t("fdbc"),s=t("17c2"),c=t("9112");for(var u in a){var d=o[u],v=d&&d.prototype;if(v&&v.forEach!==s)try{c(v,"forEach",s)}catch{v.forEach=s}}},"17c2":function(e,f,t){var o=t("b727").forEach,a=t("a640"),s=t("ae40"),c=a("forEach"),u=s("forEach");e.exports=!c||!u?function(v){return o(this,v,arguments.length>1?arguments[1]:void 0)}:[].forEach},"1be4":function(e,f,t){var o=t("d066");e.exports=o("document","documentElement")},"1c0b":function(e,f){e.exports=function(t){if(typeof t!="function")throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(e,f,t){var o=t("b622"),a=o("iterator"),s=!1;try{var c=0,u={next:function(){return{done:!!c++}},return:function(){s=!0}};u[a]=function(){return this},Array.from(u,function(){throw 2})}catch{}e.exports=function(d,v){if(!v&&!s)return!1;var h=!1;try{var g={};g[a]=function(){return{next:function(){return{done:h=!0}}}},d(g)}catch{}return h}},"1d80":function(e,f){e.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t}},"1dde":function(e,f,t){var o=t("d039"),a=t("b622"),s=t("2d00"),c=a("species");e.exports=function(u){return s>=51||!o(function(){var d=[],v=d.constructor={};return v[c]=function(){return{foo:1}},d[u](Boolean).foo!==1})}},"23cb":function(e,f,t){var o=t("a691"),a=Math.max,s=Math.min;e.exports=function(c,u){var d=o(c);return d<0?a(d+u,0):s(d,u)}},"23e7":function(e,f,t){var o=t("da84"),a=t("06cf").f,s=t("9112"),c=t("6eeb"),u=t("ce4e"),d=t("e893"),v=t("94ca");e.exports=function(h,g){var p=h.target,S=h.global,b=h.stat,I,x,P,O,w,U;if(S?x=o:b?x=o[p]||u(p,{}):x=(o[p]||{}).prototype,x)for(P in g){if(w=g[P],h.noTargetGet?(U=a(x,P),O=U&&U.value):O=x[P],I=v(S?P:p+(b?".":"#")+P,h.forced),!I&&O!==void 0){if(typeof w==typeof O)continue;d(w,O)}(h.sham||O&&O.sham)&&s(w,"sham",!0),c(x,P,w,h)}}},"241c":function(e,f,t){var o=t("ca84"),a=t("7839"),s=a.concat("length","prototype");f.f=Object.getOwnPropertyNames||function(u){return o(u,s)}},"25f0":function(e,f,t){var o=t("6eeb"),a=t("825a"),s=t("d039"),c=t("ad6d"),u="toString",d=RegExp.prototype,v=d[u],h=s(function(){return v.call({source:"a",flags:"b"})!="/a/b"}),g=v.name!=u;(h||g)&&o(RegExp.prototype,u,function(){var S=a(this),b=String(S.source),I=S.flags,x=String(I===void 0&&S instanceof RegExp&&!("flags"in d)?c.call(S):I);return"/"+b+"/"+x},{unsafe:!0})},"2ca0":function(e,f,t){var o=t("23e7"),a=t("06cf").f,s=t("50c4"),c=t("5a34"),u=t("1d80"),d=t("ab13"),v=t("c430"),h="".startsWith,g=Math.min,p=d("startsWith"),S=!v&&!p&&!!function(){var b=a(String.prototype,"startsWith");return b&&!b.writable}();o({target:"String",proto:!0,forced:!S&&!p},{startsWith:function(I){var x=String(u(this));c(I);var P=s(g(arguments.length>1?arguments[1]:void 0,x.length)),O=String(I);return h?h.call(x,O,P):x.slice(P,P+O.length)===O}})},"2d00":function(e,f,t){var o=t("da84"),a=t("342f"),s=o.process,c=s&&s.versions,u=c&&c.v8,d,v;u?(d=u.split("."),v=d[0]+d[1]):a&&(d=a.match(/Edge\/(\d+)/),(!d||d[1]>=74)&&(d=a.match(/Chrome\/(\d+)/),d&&(v=d[1]))),e.exports=v&&+v},"342f":function(e,f,t){var o=t("d066");e.exports=o("navigator","userAgent")||""},"35a1":function(e,f,t){var o=t("f5df"),a=t("3f8c"),s=t("b622"),c=s("iterator");e.exports=function(u){if(u!=null)return u[c]||u["@@iterator"]||a[o(u)]}},"37e8":function(e,f,t){var o=t("83ab"),a=t("9bf2"),s=t("825a"),c=t("df75");e.exports=o?Object.defineProperties:function(d,v){s(d);for(var h=c(v),g=h.length,p=0,S;g>p;)a.f(d,S=h[p++],v[S]);return d}},"3bbe":function(e,f,t){var o=t("861d");e.exports=function(a){if(!o(a)&&a!==null)throw TypeError("Can't set "+String(a)+" as a prototype");return a}},"3ca3":function(e,f,t){var o=t("6547").charAt,a=t("69f3"),s=t("7dd0"),c="String Iterator",u=a.set,d=a.getterFor(c);s(String,"String",function(v){u(this,{type:c,string:String(v),index:0})},function(){var h=d(this),g=h.string,p=h.index,S;return p>=g.length?{value:void 0,done:!0}:(S=o(g,p),h.index+=S.length,{value:S,done:!1})})},"3f8c":function(e,f){e.exports={}},4160:function(e,f,t){var o=t("23e7"),a=t("17c2");o({target:"Array",proto:!0,forced:[].forEach!=a},{forEach:a})},"428f":function(e,f,t){var o=t("da84");e.exports=o},"44ad":function(e,f,t){var o=t("d039"),a=t("c6b6"),s="".split;e.exports=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(c){return a(c)=="String"?s.call(c,""):Object(c)}:Object},"44d2":function(e,f,t){var o=t("b622"),a=t("7c73"),s=t("9bf2"),c=o("unscopables"),u=Array.prototype;u[c]==null&&s.f(u,c,{configurable:!0,value:a(null)}),e.exports=function(d){u[c][d]=!0}},"44e7":function(e,f,t){var o=t("861d"),a=t("c6b6"),s=t("b622"),c=s("match");e.exports=function(u){var d;return o(u)&&((d=u[c])!==void 0?!!d:a(u)=="RegExp")}},4930:function(e,f,t){var o=t("d039");e.exports=!!Object.getOwnPropertySymbols&&!o(function(){return!String(Symbol())})},"4d64":function(e,f,t){var o=t("fc6a"),a=t("50c4"),s=t("23cb"),c=function(u){return function(d,v,h){var g=o(d),p=a(g.length),S=s(h,p),b;if(u&&v!=v){for(;p>S;)if(b=g[S++],b!=b)return!0}else for(;p>S;S++)if((u||S in g)&&g[S]===v)return u||S||0;return!u&&-1}};e.exports={includes:c(!0),indexOf:c(!1)}},"4de4":function(e,f,t){var o=t("23e7"),a=t("b727").filter,s=t("1dde"),c=t("ae40"),u=s("filter"),d=c("filter");o({target:"Array",proto:!0,forced:!u||!d},{filter:function(h){return a(this,h,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(e,f,t){var o=t("0366"),a=t("7b0b"),s=t("9bdd"),c=t("e95a"),u=t("50c4"),d=t("8418"),v=t("35a1");e.exports=function(g){var p=a(g),S=typeof this=="function"?this:Array,b=arguments.length,I=b>1?arguments[1]:void 0,x=I!==void 0,P=v(p),O=0,w,U,T,M,j,Y;if(x&&(I=o(I,b>2?arguments[2]:void 0,2)),P!=null&&!(S==Array&&c(P)))for(M=P.call(p),j=M.next,U=new S;!(T=j.call(M)).done;O++)Y=x?s(M,I,[T.value,O],!0):T.value,d(U,O,Y);else for(w=u(p.length),U=new S(w);w>O;O++)Y=x?I(p[O],O):p[O],d(U,O,Y);return U.length=O,U}},"4fad":function(e,f,t){var o=t("23e7"),a=t("6f53").entries;o({target:"Object",stat:!0},{entries:function(c){return a(c)}})},"50c4":function(e,f,t){var o=t("a691"),a=Math.min;e.exports=function(s){return s>0?a(o(s),9007199254740991):0}},5135:function(e,f){var t={}.hasOwnProperty;e.exports=function(o,a){return t.call(o,a)}},5319:function(e,f,t){var o=t("d784"),a=t("825a"),s=t("7b0b"),c=t("50c4"),u=t("a691"),d=t("1d80"),v=t("8aa5"),h=t("14c3"),g=Math.max,p=Math.min,S=Math.floor,b=/\$([$&'`]|\d\d?|<[^>]*>)/g,I=/\$([$&'`]|\d\d?)/g,x=function(P){return P===void 0?P:String(P)};o("replace",2,function(P,O,w,U){var T=U.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,M=U.REPLACE_KEEPS_$0,j=T?"$":"$0";return[function(R,X){var N=d(this),$=R==null?void 0:R[P];return $!==void 0?$.call(R,N,X):O.call(String(N),R,X)},function(C,R){if(!T&&M||typeof R=="string"&&R.indexOf(j)===-1){var X=w(O,C,this,R);if(X.done)return X.value}var N=a(C),$=String(this),_=typeof R=="function";_||(R=String(R));var rt=N.global;if(rt){var yt=N.unicode;N.lastIndex=0}for(var st=[];;){var ft=h(N,$);if(ft===null||(st.push(ft),!rt))break;var pt=String(ft[0]);pt===""&&(N.lastIndex=v($,c(N.lastIndex),yt))}for(var mt="",ht=0,nt=0;nt=ht&&(mt+=$.slice(ht,At)+St,ht=At+it.length)}return mt+$.slice(ht)}];function Y(C,R,X,N,$,_){var rt=X+C.length,yt=N.length,st=I;return $!==void 0&&($=s($),st=b),O.call(_,st,function(ft,pt){var mt;switch(pt.charAt(0)){case"$":return"$";case"&":return C;case"`":return R.slice(0,X);case"'":return R.slice(rt);case"<":mt=$[pt.slice(1,-1)];break;default:var ht=+pt;if(ht===0)return ft;if(ht>yt){var nt=S(ht/10);return nt===0?ft:nt<=yt?N[nt-1]===void 0?pt.charAt(1):N[nt-1]+pt.charAt(1):ft}mt=N[ht-1]}return mt===void 0?"":mt})}})},5692:function(e,f,t){var o=t("c430"),a=t("c6cd");(e.exports=function(s,c){return a[s]||(a[s]=c!==void 0?c:{})})("versions",[]).push({version:"3.6.5",mode:o?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(e,f,t){var o=t("d066"),a=t("241c"),s=t("7418"),c=t("825a");e.exports=o("Reflect","ownKeys")||function(d){var v=a.f(c(d)),h=s.f;return h?v.concat(h(d)):v}},"5a34":function(e,f,t){var o=t("44e7");e.exports=function(a){if(o(a))throw TypeError("The method doesn't accept regular expressions");return a}},"5c6c":function(e,f){e.exports=function(t,o){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:o}}},"5db7":function(e,f,t){var o=t("23e7"),a=t("a2bf"),s=t("7b0b"),c=t("50c4"),u=t("1c0b"),d=t("65f0");o({target:"Array",proto:!0},{flatMap:function(h){var g=s(this),p=c(g.length),S;return u(h),S=d(g,0),S.length=a(S,g,g,p,0,1,h,arguments.length>1?arguments[1]:void 0),S}})},6547:function(e,f,t){var o=t("a691"),a=t("1d80"),s=function(c){return function(u,d){var v=String(a(u)),h=o(d),g=v.length,p,S;return h<0||h>=g?c?"":void 0:(p=v.charCodeAt(h),p<55296||p>56319||h+1===g||(S=v.charCodeAt(h+1))<56320||S>57343?c?v.charAt(h):p:c?v.slice(h,h+2):(p-55296<<10)+(S-56320)+65536)}};e.exports={codeAt:s(!1),charAt:s(!0)}},"65f0":function(e,f,t){var o=t("861d"),a=t("e8b5"),s=t("b622"),c=s("species");e.exports=function(u,d){var v;return a(u)&&(v=u.constructor,typeof v=="function"&&(v===Array||a(v.prototype))?v=void 0:o(v)&&(v=v[c],v===null&&(v=void 0))),new(v===void 0?Array:v)(d===0?0:d)}},"69f3":function(e,f,t){var o=t("7f9a"),a=t("da84"),s=t("861d"),c=t("9112"),u=t("5135"),d=t("f772"),v=t("d012"),h=a.WeakMap,g,p,S,b=function(T){return S(T)?p(T):g(T,{})},I=function(T){return function(M){var j;if(!s(M)||(j=p(M)).type!==T)throw TypeError("Incompatible receiver, "+T+" required");return j}};if(o){var x=new h,P=x.get,O=x.has,w=x.set;g=function(T,M){return w.call(x,T,M),M},p=function(T){return P.call(x,T)||{}},S=function(T){return O.call(x,T)}}else{var U=d("state");v[U]=!0,g=function(T,M){return c(T,U,M),M},p=function(T){return u(T,U)?T[U]:{}},S=function(T){return u(T,U)}}e.exports={set:g,get:p,has:S,enforce:b,getterFor:I}},"6eeb":function(e,f,t){var o=t("da84"),a=t("9112"),s=t("5135"),c=t("ce4e"),u=t("8925"),d=t("69f3"),v=d.get,h=d.enforce,g=String(String).split("String");(e.exports=function(p,S,b,I){var x=I?!!I.unsafe:!1,P=I?!!I.enumerable:!1,O=I?!!I.noTargetGet:!1;if(typeof b=="function"&&(typeof S=="string"&&!s(b,"name")&&a(b,"name",S),h(b).source=g.join(typeof S=="string"?S:"")),p===o){P?p[S]=b:c(S,b);return}else x?!O&&p[S]&&(P=!0):delete p[S];P?p[S]=b:a(p,S,b)})(Function.prototype,"toString",function(){return typeof this=="function"&&v(this).source||u(this)})},"6f53":function(e,f,t){var o=t("83ab"),a=t("df75"),s=t("fc6a"),c=t("d1e7").f,u=function(d){return function(v){for(var h=s(v),g=a(h),p=g.length,S=0,b=[],I;p>S;)I=g[S++],(!o||c.call(h,I))&&b.push(d?[I,h[I]]:h[I]);return b}};e.exports={entries:u(!0),values:u(!1)}},"73d9":function(e,f,t){var o=t("44d2");o("flatMap")},7418:function(e,f){f.f=Object.getOwnPropertySymbols},"746f":function(e,f,t){var o=t("428f"),a=t("5135"),s=t("e538"),c=t("9bf2").f;e.exports=function(u){var d=o.Symbol||(o.Symbol={});a(d,u)||c(d,u,{value:s.f(u)})}},7839:function(e,f){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(e,f,t){var o=t("1d80");e.exports=function(a){return Object(o(a))}},"7c73":function(e,f,t){var o=t("825a"),a=t("37e8"),s=t("7839"),c=t("d012"),u=t("1be4"),d=t("cc12"),v=t("f772"),h=">",g="<",p="prototype",S="script",b=v("IE_PROTO"),I=function(){},x=function(T){return g+S+h+T+g+"/"+S+h},P=function(T){T.write(x("")),T.close();var M=T.parentWindow.Object;return T=null,M},O=function(){var T=d("iframe"),M="java"+S+":",j;return T.style.display="none",u.appendChild(T),T.src=String(M),j=T.contentWindow.document,j.open(),j.write(x("document.F=Object")),j.close(),j.F},w,U=function(){try{w=document.domain&&new ActiveXObject("htmlfile")}catch{}U=w?P(w):O();for(var T=s.length;T--;)delete U[p][s[T]];return U()};c[b]=!0,e.exports=Object.create||function(M,j){var Y;return M!==null?(I[p]=o(M),Y=new I,I[p]=null,Y[b]=M):Y=U(),j===void 0?Y:a(Y,j)}},"7dd0":function(e,f,t){var o=t("23e7"),a=t("9ed3"),s=t("e163"),c=t("d2bb"),u=t("d44e"),d=t("9112"),v=t("6eeb"),h=t("b622"),g=t("c430"),p=t("3f8c"),S=t("ae93"),b=S.IteratorPrototype,I=S.BUGGY_SAFARI_ITERATORS,x=h("iterator"),P="keys",O="values",w="entries",U=function(){return this};e.exports=function(T,M,j,Y,C,R,X){a(j,M,Y);var N=function(nt){if(nt===C&&st)return st;if(!I&&nt in rt)return rt[nt];switch(nt){case P:return function(){return new j(this,nt)};case O:return function(){return new j(this,nt)};case w:return function(){return new j(this,nt)}}return function(){return new j(this)}},$=M+" Iterator",_=!1,rt=T.prototype,yt=rt[x]||rt["@@iterator"]||C&&rt[C],st=!I&&yt||N(C),ft=M=="Array"&&rt.entries||yt,pt,mt,ht;if(ft&&(pt=s(ft.call(new T)),b!==Object.prototype&&pt.next&&(!g&&s(pt)!==b&&(c?c(pt,b):typeof pt[x]!="function"&&d(pt,x,U)),u(pt,$,!0,!0),g&&(p[$]=U))),C==O&&yt&&yt.name!==O&&(_=!0,st=function(){return yt.call(this)}),(!g||X)&&rt[x]!==st&&d(rt,x,st),p[M]=st,C)if(mt={values:N(O),keys:R?st:N(P),entries:N(w)},X)for(ht in mt)(I||_||!(ht in rt))&&v(rt,ht,mt[ht]);else o({target:M,proto:!0,forced:I||_},mt);return mt}},"7f9a":function(e,f,t){var o=t("da84"),a=t("8925"),s=o.WeakMap;e.exports=typeof s=="function"&&/native code/.test(a(s))},"825a":function(e,f,t){var o=t("861d");e.exports=function(a){if(!o(a))throw TypeError(String(a)+" is not an object");return a}},"83ab":function(e,f,t){var o=t("d039");e.exports=!o(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},8418:function(e,f,t){var o=t("c04e"),a=t("9bf2"),s=t("5c6c");e.exports=function(c,u,d){var v=o(u);v in c?a.f(c,v,s(0,d)):c[v]=d}},"861d":function(e,f){e.exports=function(t){return typeof t=="object"?t!==null:typeof t=="function"}},8875:function(e,f,t){var o,a,s;(function(c,u){a=[],o=u,s=typeof o=="function"?o.apply(f,a):o,s!==void 0&&(e.exports=s)})(typeof self<"u"?self:this,function(){function c(){var u=Object.getOwnPropertyDescriptor(document,"currentScript");if(!u&&"currentScript"in document&&document.currentScript||u&&u.get!==c&&document.currentScript)return document.currentScript;try{throw new Error}catch(w){var d=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,v=/@([^@]*):(\d+):(\d+)\s*$/ig,h=d.exec(w.stack)||v.exec(w.stack),g=h&&h[1]||!1,p=h&&h[2]||!1,S=document.location.href.replace(document.location.hash,""),b,I,x,P=document.getElementsByTagName("script");g===S&&(b=document.documentElement.outerHTML,I=new RegExp("(?:[^\\n]+?\\n){0,"+(p-2)+"}[^<]*