mario-core 3.0.164-es-staging → 3.0.166-es-staging

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/{Dashboard-B5sU3O_R.js → Dashboard-Cg7iibvW.js} +1 -1
  2. package/dist/{Dashboard-DsVOk4qt.cjs → Dashboard-DfkDdWQL.cjs} +1 -1
  3. package/dist/{EmailTemplateDetail-25WBoyzR.js → EmailTemplateDetail-9OqWN5Ns.js} +33 -33
  4. package/dist/{EmailTemplateDetail-C_MKuV8v.cjs → EmailTemplateDetail-DqUrYn_k.cjs} +1 -1
  5. package/dist/{EmailTemplateList-d8sFipPP.cjs → EmailTemplateList-CAmeXXJh.cjs} +1 -1
  6. package/dist/{EmailTemplateList-CWuZUKD1.js → EmailTemplateList-VudCgM6Y.js} +8 -8
  7. package/dist/{FaqList-CawBMMEt.js → FaqList-DOmXyZh0.js} +17 -17
  8. package/dist/{FaqList-CKGmPw9f.cjs → FaqList-DWR5mtyK.cjs} +1 -1
  9. package/dist/{GalleryList-DER-t33I.cjs → GalleryList-CNrs4eMZ.cjs} +1 -1
  10. package/dist/{GalleryList-BjbRwjqu.js → GalleryList-Cl4LoJqV.js} +3 -3
  11. package/dist/Login--hajNRDy.cjs +1 -0
  12. package/dist/{Login-DQ6cEtqi.js → Login-BbV3JLR-.js} +250 -250
  13. package/dist/NotificationList-CLyjyCEl.cjs +8 -0
  14. package/dist/{NotificationList-6BJ2k4mL.js → NotificationList-Dxq3mjHp.js} +1336 -1359
  15. package/dist/{SkillList-DDZZjiLU.cjs → SkillList-C0UXcM5b.cjs} +1 -1
  16. package/dist/{SkillList-DkIAgTvA.js → SkillList-p8dHwSbj.js} +52 -52
  17. package/dist/{TeacherSelector-BYr9QnJV.js → TeacherSelector-BnLZ8Jvv.js} +1 -1
  18. package/dist/{TeacherSelector-CMQ58QBw.cjs → TeacherSelector-zvCgvTAs.cjs} +1 -1
  19. package/dist/{TheContent-BTHbxaJr.cjs → TheContent-B5Z_CFAG.cjs} +1 -1
  20. package/dist/{TheContent-CQNtArvX.js → TheContent-ChxdcxGb.js} +1 -1
  21. package/dist/UserContainer-B7K5JH3T.js +2238 -0
  22. package/dist/UserContainer-DburiL3p.cjs +3 -0
  23. package/dist/{UserDetail-HL63O5gd.js → UserDetail-0O-NsfbF.js} +58 -58
  24. package/dist/{UserDetail-DINv764h.cjs → UserDetail-DbLvkdOe.cjs} +1 -1
  25. package/dist/components/Alerts/EmptyDataAlert.d.ts +1 -1
  26. package/dist/components/Image/UploadImage.d.ts +1 -1
  27. package/dist/components/Inputs/FileInput.d.ts +1 -1
  28. package/dist/components/Inputs/SearchBoxContainer.d.ts +1 -1
  29. package/dist/components/Modals/NotificationLogoutModal.d.ts +1 -1
  30. package/dist/components/Modals/NotificationModal.d.ts +1 -1
  31. package/dist/components/Pagination/CustomPagination.d.ts +1 -1
  32. package/dist/components/Selectors/AcademicClassSelector.d.ts +1 -1
  33. package/dist/components/Selectors/CreatableSelector.d.ts +1 -1
  34. package/dist/components/Selectors/CustomSelector.d.ts +1 -1
  35. package/dist/components/Selectors/MailCategorySelectors.d.ts +1 -1
  36. package/dist/components/Selectors/QuestionCategorySelector.d.ts +1 -1
  37. package/dist/components/Selectors/QuestionTypeSelector.d.ts +1 -1
  38. package/dist/components/Selectors/StarRatingSelector.d.ts +1 -1
  39. package/dist/components/Selectors/SuggestionCategorySelector.d.ts +1 -1
  40. package/dist/components/Tabs/CustomTab.d.ts +1 -1
  41. package/dist/components/Tabs/TabsWithComponent.d.ts +1 -1
  42. package/dist/containers/Login/views/Dashboard.d.ts +1 -1
  43. package/dist/containers/Login/views/Login.d.ts +1 -1
  44. package/dist/containers/Login/views/block/BlockForgetPassword.d.ts +1 -1
  45. package/dist/containers/Login/views/block/BlockResetPassword.d.ts +2 -1
  46. package/dist/containers/Login/views/block/BlockTwoFactorLogin.d.ts +1 -1
  47. package/dist/containers/Login/views/block/ModalSelectGrade.d.ts +1 -1
  48. package/dist/containers/Login/views/block/QuoteContent.d.ts +1 -1
  49. package/dist/containers/Notifications/views/NotificationList.d.ts +1 -1
  50. package/dist/containers/Skill/components/SkillSelector.d.ts +1 -1
  51. package/dist/containers/User/components/DeleteBulkModel.d.ts +1 -1
  52. package/dist/containers/User/components/RemoveAssistant.d.ts +1 -1
  53. package/dist/containers/User/components/RemoveCounselor.d.ts +1 -1
  54. package/dist/containers/User/components/RemoveTeacher.d.ts +1 -1
  55. package/dist/containers/User/components/TeacherSelector.d.ts +1 -1
  56. package/dist/containers/User/views/AssignStudentList.d.ts +1 -1
  57. package/dist/containers/User/views/UserContainer.d.ts +1 -1
  58. package/dist/containers/User/views/UserDetail.d.ts +1 -1
  59. package/dist/containers/User/views/UserList.d.ts +1 -1
  60. package/dist/index-B3rBIMXj.js +21107 -0
  61. package/dist/index-CZIFY5ko.cjs +25 -0
  62. package/dist/index.d.ts +8 -9
  63. package/dist/{index.esm-C-EcSO9w.js → index.esm-iJKJbl0E.js} +1 -1
  64. package/dist/{index.esm-CUrVberN.cjs → index.esm-lLejk_rA.cjs} +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/index.modern.js +152 -162
  67. package/dist/layouts/TheContent.d.ts +1 -1
  68. package/dist/{mailCategoryService-CyAJ1EtZ.js → mailCategoryService-DwzZAJWg.js} +1 -1
  69. package/dist/{mailCategoryService-a_BJkP1X.cjs → mailCategoryService-e61jh7IC.cjs} +1 -1
  70. package/dist/mario-core.css +1 -1
  71. package/dist/redux/commons/action.d.ts +0 -1
  72. package/dist/services/accountService.d.ts +21 -13
  73. package/dist/services/classService.d.ts +1 -1
  74. package/dist/services/emailTemplateService.d.ts +5 -5
  75. package/dist/services/faqService.d.ts +5 -5
  76. package/dist/services/fileServices.d.ts +19 -13
  77. package/dist/services/galleryService.d.ts +1 -1
  78. package/dist/services/languageService.d.ts +1 -1
  79. package/dist/services/mailCategoryService.d.ts +1 -1
  80. package/dist/services/notificationService.d.ts +7 -7
  81. package/dist/services/questionCategoryService.d.ts +1 -1
  82. package/dist/services/schoolService.d.ts +1 -1
  83. package/dist/services/skillService.d.ts +5 -5
  84. package/dist/services/suggestionCategoryService.d.ts +1 -1
  85. package/dist/services/userService.d.ts +23 -20
  86. package/package.json +1 -1
  87. package/dist/Login-BJ1fWFhG.cjs +0 -1
  88. package/dist/NotificationList-D5l6aQw3.cjs +0 -8
  89. package/dist/UserContainer-CmjM2n9y.js +0 -2255
  90. package/dist/UserContainer-Db4RURfn.cjs +0 -3
  91. package/dist/index-BGq2Nos5.js +0 -21413
  92. package/dist/index-Di4rOYvb.cjs +0 -25
  93. package/dist/shared/gradeYear/GradeYearConfigProvider.d.ts +0 -8
  94. package/dist/shared/gradeYear/constants.d.ts +0 -2
  95. package/dist/shared/gradeYear/formatGradeLabel.d.ts +0 -36
  96. package/dist/shared/gradeYear/index.d.ts +0 -5
  97. package/dist/shared/gradeYear/types.d.ts +0 -24
  98. package/dist/shared/gradeYear/useGradeLabel.d.ts +0 -14
@@ -2,7 +2,7 @@ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as N, useRef as I, useCallback as h, useEffect as f } from "react";
3
3
  import { useSelector as k } from "react-redux";
4
4
  import { Row as T, Col as u, Navbar as C, NavbarBrand as y, Collapse as A, Nav as E, NavItem as g, NavLink as v } from "reactstrap";
5
- import { h as n, m as i, G as w } from "./index-BGq2Nos5.js";
5
+ import { h as n, m as i, G as w } from "./index-B3rBIMXj.js";
6
6
  import { Link as p } from "react-router-dom";
7
7
  const H = () => /* @__PURE__ */ a("div", { className: `${n["content-quote"]}`, children: [
8
8
  /* @__PURE__ */ a("div", { className: `${n["title-quote"]} d-block`, children: [
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),p=require("react-redux"),a=require("reactstrap"),s=require("./index-Di4rOYvb.cjs"),g=require("react-router-dom"),j=()=>e.jsxs("div",{className:`${s.styles["content-quote"]}`,children:[e.jsxs("div",{className:`${s.styles["title-quote"]} d-block`,children:[e.jsx("p",{children:"Powerful"}),e.jsx("p",{children:"Personalized"}),e.jsx("p",{children:"Learning"})]}),e.jsxs("div",{className:`${s.styles["descriptions-quote"]} d-block`,children:[e.jsx("p",{children:"Focus on what matters most to you and"}),e.jsx("p",{children:"make learning meaningful."})]})]}),x=({srcIcon:t,content:n})=>e.jsxs("div",{className:`${s.styles["content-icon"]}`,children:[e.jsx("div",{className:`${s.styles["title-icon"]}`,children:e.jsx("img",{src:s.getStaticFileUrl(t),alt:"icon"})}),e.jsx("div",{className:`${s.styles["descriptions-icon"]}`,dangerouslySetInnerHTML:{__html:n}})]},n),v=[{scrIcon:"images/ChatsTeardrop.svg",content:"<p>Understand yourself better through <span>helpful feedback</span>.</p>"},{scrIcon:"images/Student.svg",content:"<p>Create, explore, and share exciting <span>personalized</span> learning journeys.</p>"},{scrIcon:"images/Confetti.svg",content:"<p>Set, monitor, and achieve <span>your goals</span>.</p>"}],y=({})=>e.jsxs(a.Row,{className:`${s.styles["page-not-login"]}`,children:[e.jsx(a.Col,{md:12,children:e.jsx(j,{})}),e.jsx(a.Col,{md:12,className:`${s.styles["box-content-home-page"]} d-flex align-items-center`,children:v.map(t=>e.jsx(x,{srcIcon:t.scrIcon,content:t.content},t.content))})]}),N=10001,b=({data:t,duration:n=N})=>{const[c,m]=i.useState(t.length),r=i.useRef(null),d=i.useCallback(l=>l===c?`${s.styles.active} ${s.styles.show}`:"",[c]),h=i.useCallback(l=>c===0&&l===t.length-1||l===c-1?s.styles.behind:"",[c,t.length]),u=i.useCallback(()=>{r&&r.current&&clearInterval(r.current),r.current=setInterval(()=>{m(l=>l>=t.length-1?0:l+1)},n)},[n,t.length]);return i.useEffect(()=>(u(),()=>{r&&r.current&&clearInterval(r.current)}),[t.length,n]),e.jsx("div",{className:`${s.styles["bg-animate"]} position-absolute`,children:t.map((l,o)=>e.jsx("img",{alt:`Image ${o+1}`,className:`${h(o)} ${d(o)}`,src:s.getStaticFileUrl(l)},o))})};function f(t){return s.GenIcon({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z"}}]})(t)}const $="/admin/users/user-list",I="/home",k="/home",C="Dashboard",T="Mario Framework",S=["images/landing-page.jpg","images/landing-page2.jpg","images/landing-page3.jpg"],E=({version:t})=>{const n=p.useSelector(d=>d.common.user),[c,m]=i.useState(!1),r=()=>m(!c);return i.useEffect(()=>{n?document.title=C:document.title=T},[n]),e.jsxs("div",{className:`${s.styles.login} ${s.styles["red-background"]} position-relative`,children:[e.jsx("span",{className:`${s.styles["version-prod"]}`,children:`v ${t}`}),e.jsx(b,{data:S}),e.jsxs("div",{className:`${s.styles["login-content"]}`,children:[e.jsxs(a.Navbar,{light:!0,expand:"md",children:[e.jsx(a.NavbarBrand,{href:"/",className:`${s.styles["logo-home"]}`,children:e.jsx("img",{src:s.getStaticFileUrl("images/logo-white.svg"),alt:"mario"})}),e.jsx(f,{onClick:r,className:`${s.styles["hide-in-desktop"]} ${s.styles["hamburger-menu"]}`}),e.jsxs(a.Collapse,{isOpen:c,navbar:!0,className:`${s.styles["collapse-box"]}`,children:[e.jsxs(a.Nav,{className:`${s.styles["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,navbar:!0,children:[e.jsx(a.NavItem,{children:e.jsx(a.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"https://marioframework.com/software",target:"blank",children:"Learn More"})}),e.jsx(a.NavItem,{children:e.jsx(g.Link,{className:`${s.styles.contact} align-self-md-center`,to:"/contact",children:"Contact"})}),e.jsx(a.NavItem,{children:e.jsx(a.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"/privacy-policy",target:"blank",children:"Privacy Policy"})})]}),e.jsx("div",{className:`${s.styles["hide-in-mobile"]} d-flex justify-content-end`,children:n?e.jsx(g.Link,{to:n.roles.includes("Admin")?$:n.roles.includes("Teacher")?I:k,className:`${s.styles["btn-trans-border"]}`,children:"Dashboard"}):e.jsx(g.Link,{to:"/login",className:`${s.styles["btn-trans-border"]}`,children:"Login"})})]})]}),e.jsx("div",{className:"",children:e.jsx(y,{})}),e.jsx("div",{className:`${s.styles["digital-privacy-icon"]}`,children:e.jsx("a",{href:"https://cert.privo.com/#/companies/marioFrameworkLlc",target:"blank",children:e.jsx("img",{src:s.getStaticFileUrl("images/STUDENT1.png"),alt:"icon"})})})]})]})};exports.default=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),p=require("react-redux"),a=require("reactstrap"),s=require("./index-CZIFY5ko.cjs"),g=require("react-router-dom"),j=()=>e.jsxs("div",{className:`${s.styles["content-quote"]}`,children:[e.jsxs("div",{className:`${s.styles["title-quote"]} d-block`,children:[e.jsx("p",{children:"Powerful"}),e.jsx("p",{children:"Personalized"}),e.jsx("p",{children:"Learning"})]}),e.jsxs("div",{className:`${s.styles["descriptions-quote"]} d-block`,children:[e.jsx("p",{children:"Focus on what matters most to you and"}),e.jsx("p",{children:"make learning meaningful."})]})]}),x=({srcIcon:t,content:n})=>e.jsxs("div",{className:`${s.styles["content-icon"]}`,children:[e.jsx("div",{className:`${s.styles["title-icon"]}`,children:e.jsx("img",{src:s.getStaticFileUrl(t),alt:"icon"})}),e.jsx("div",{className:`${s.styles["descriptions-icon"]}`,dangerouslySetInnerHTML:{__html:n}})]},n),v=[{scrIcon:"images/ChatsTeardrop.svg",content:"<p>Understand yourself better through <span>helpful feedback</span>.</p>"},{scrIcon:"images/Student.svg",content:"<p>Create, explore, and share exciting <span>personalized</span> learning journeys.</p>"},{scrIcon:"images/Confetti.svg",content:"<p>Set, monitor, and achieve <span>your goals</span>.</p>"}],y=({})=>e.jsxs(a.Row,{className:`${s.styles["page-not-login"]}`,children:[e.jsx(a.Col,{md:12,children:e.jsx(j,{})}),e.jsx(a.Col,{md:12,className:`${s.styles["box-content-home-page"]} d-flex align-items-center`,children:v.map(t=>e.jsx(x,{srcIcon:t.scrIcon,content:t.content},t.content))})]}),N=10001,b=({data:t,duration:n=N})=>{const[c,m]=i.useState(t.length),r=i.useRef(null),d=i.useCallback(l=>l===c?`${s.styles.active} ${s.styles.show}`:"",[c]),h=i.useCallback(l=>c===0&&l===t.length-1||l===c-1?s.styles.behind:"",[c,t.length]),u=i.useCallback(()=>{r&&r.current&&clearInterval(r.current),r.current=setInterval(()=>{m(l=>l>=t.length-1?0:l+1)},n)},[n,t.length]);return i.useEffect(()=>(u(),()=>{r&&r.current&&clearInterval(r.current)}),[t.length,n]),e.jsx("div",{className:`${s.styles["bg-animate"]} position-absolute`,children:t.map((l,o)=>e.jsx("img",{alt:`Image ${o+1}`,className:`${h(o)} ${d(o)}`,src:s.getStaticFileUrl(l)},o))})};function f(t){return s.GenIcon({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z"}}]})(t)}const $="/admin/users/user-list",I="/home",k="/home",C="Dashboard",T="Mario Framework",S=["images/landing-page.jpg","images/landing-page2.jpg","images/landing-page3.jpg"],E=({version:t})=>{const n=p.useSelector(d=>d.common.user),[c,m]=i.useState(!1),r=()=>m(!c);return i.useEffect(()=>{n?document.title=C:document.title=T},[n]),e.jsxs("div",{className:`${s.styles.login} ${s.styles["red-background"]} position-relative`,children:[e.jsx("span",{className:`${s.styles["version-prod"]}`,children:`v ${t}`}),e.jsx(b,{data:S}),e.jsxs("div",{className:`${s.styles["login-content"]}`,children:[e.jsxs(a.Navbar,{light:!0,expand:"md",children:[e.jsx(a.NavbarBrand,{href:"/",className:`${s.styles["logo-home"]}`,children:e.jsx("img",{src:s.getStaticFileUrl("images/logo-white.svg"),alt:"mario"})}),e.jsx(f,{onClick:r,className:`${s.styles["hide-in-desktop"]} ${s.styles["hamburger-menu"]}`}),e.jsxs(a.Collapse,{isOpen:c,navbar:!0,className:`${s.styles["collapse-box"]}`,children:[e.jsxs(a.Nav,{className:`${s.styles["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,navbar:!0,children:[e.jsx(a.NavItem,{children:e.jsx(a.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"https://marioframework.com/software",target:"blank",children:"Learn More"})}),e.jsx(a.NavItem,{children:e.jsx(g.Link,{className:`${s.styles.contact} align-self-md-center`,to:"/contact",children:"Contact"})}),e.jsx(a.NavItem,{children:e.jsx(a.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"/privacy-policy",target:"blank",children:"Privacy Policy"})})]}),e.jsx("div",{className:`${s.styles["hide-in-mobile"]} d-flex justify-content-end`,children:n?e.jsx(g.Link,{to:n.roles.includes("Admin")?$:n.roles.includes("Teacher")?I:k,className:`${s.styles["btn-trans-border"]}`,children:"Dashboard"}):e.jsx(g.Link,{to:"/login",className:`${s.styles["btn-trans-border"]}`,children:"Login"})})]})]}),e.jsx("div",{className:"",children:e.jsx(y,{})}),e.jsx("div",{className:`${s.styles["digital-privacy-icon"]}`,children:e.jsx("a",{href:"https://cert.privo.com/#/companies/marioFrameworkLlc",target:"blank",children:e.jsx("img",{src:s.getStaticFileUrl("images/STUDENT1.png"),alt:"icon"})})})]})]})};exports.default=E;
@@ -1,16 +1,16 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import { Table as W, Row as A, Col as f, Input as V, FormGroup as X, Label as O, Button as Z } from "reactstrap";
2
+ import { Table as W, Row as A, Col as f, Input as V, FormGroup as X, Label as H, Button as Z } from "reactstrap";
3
3
  import { useNavigate as Y, useParams as ee } from "react-router-dom";
4
4
  import { Editor as te } from "@tinymce/tinymce-react";
5
5
  import { Formik as ae } from "formik";
6
- import { J as se, w as ne, s as k, c as x, K as ie, y as oe, h as d, Q as le, R as U, E as P, O as ce, P as re } from "./index-BGq2Nos5.js";
6
+ import { H as se, v as ne, s as w, c as x, J as ie, x as oe, h as d, Q as le, R as U, E as B, K as ce, O as re } from "./index-B3rBIMXj.js";
7
7
  import { useTranslation as K } from "react-i18next";
8
- import { useEffect as L, Fragment as me, useState as z, useCallback as B } from "react";
8
+ import { useEffect as L, Fragment as me, useState as z, useCallback as P } from "react";
9
9
  import de from "react-select";
10
10
  import { useDispatch as Q, useSelector as J } from "react-redux";
11
- import { a as ue, b as he, u as pe, c as fe } from "./mailCategoryService-CyAJ1EtZ.js";
11
+ import { a as ue, b as he, u as pe, c as fe } from "./mailCategoryService-DwzZAJWg.js";
12
12
  import * as D from "yup";
13
- const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline text-center cursor-pointer hover-opacity", title: "Delete", onClick: i, children: /* @__PURE__ */ e(se, {}) }), H = [
13
+ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline text-center cursor-pointer hover-opacity", title: "Delete", onClick: i, children: /* @__PURE__ */ e(se, {}) }), O = [
14
14
  { label: "$USER_FIRST_NAME$", meaning: "User first name" },
15
15
  { label: "$USER_LAST_NAME$", meaning: "User last name" },
16
16
  { label: "$PASSWORD$", meaning: "Password" },
@@ -24,7 +24,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
24
24
  className: l
25
25
  }) => {
26
26
  const { t: u } = K();
27
- let b = o ? [...H, { label: "$RESET_LINK$", meaning: "Reset link" }] : H;
27
+ let b = o ? [...O, { label: "$RESET_LINK$", meaning: "Reset link" }] : O;
28
28
  return /* @__PURE__ */ r(W, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
29
29
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
30
30
  /* @__PURE__ */ e("th", { className: `align-top ${l}`, children: u("params") }),
@@ -86,9 +86,9 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
86
86
  }, []), L(() => {
87
87
  i && j();
88
88
  }, [i]);
89
- const j = B(async () => {
89
+ const j = P(async () => {
90
90
  var n, s;
91
- l(k(!0));
91
+ l(w(!0));
92
92
  try {
93
93
  const a = await he(i);
94
94
  h({
@@ -111,24 +111,24 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
111
111
  })
112
112
  );
113
113
  }
114
- l(k(!1));
114
+ l(w(!1));
115
115
  }, [i]), M = (n) => o = n, F = (n) => {
116
116
  o && o.editor.execCommand(
117
117
  "mceInsertContent",
118
118
  !1,
119
119
  ` ${n.label}`
120
120
  );
121
- }, T = B(() => {
121
+ }, v = P(() => {
122
122
  u(Ie);
123
- }, []), $ = B(
123
+ }, []), $ = P(
124
124
  async (n) => {
125
125
  var s, a;
126
- l(k(!0));
126
+ l(w(!0));
127
127
  try {
128
128
  if (p && p.length) {
129
- const _ = (await v()).map((w) => ({
130
- key: w.data.key,
131
- name: w.data.name
129
+ const _ = (await T()).map((k) => ({
130
+ key: k.data.key,
131
+ name: k.data.name
132
132
  }));
133
133
  n.attachments = [...n.attachments, ..._];
134
134
  }
@@ -137,7 +137,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
137
137
  type: "success",
138
138
  message: `${i ? "Update" : "Create"} template successfully`
139
139
  })
140
- ), T();
140
+ ), v();
141
141
  } catch (t) {
142
142
  l(
143
143
  x({
@@ -146,7 +146,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
146
146
  })
147
147
  );
148
148
  }
149
- l(k(!1));
149
+ l(w(!1));
150
150
  },
151
151
  [i, p]
152
152
  ), g = () => {
@@ -169,7 +169,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
169
169
  for (const t of a)
170
170
  for (const c of t.files) {
171
171
  const { name: _ } = c;
172
- !I.includes(c) && !n.some((w) => w.name === _) && n.push({ name: _, inputId: t.id });
172
+ !I.includes(c) && !n.some((k) => k.name === _) && n.push({ name: _, inputId: t.id });
173
173
  }
174
174
  R(n);
175
175
  }, y = (n, s) => {
@@ -189,7 +189,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
189
189
  L(() => {
190
190
  N();
191
191
  }, [I]);
192
- const v = async () => {
192
+ const T = async () => {
193
193
  const n = document.getElementsByClassName(
194
194
  "input-attachment"
195
195
  ), s = [];
@@ -204,7 +204,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
204
204
  emailTemplateDetail: b,
205
205
  setEditorRef: M,
206
206
  addParams: F,
207
- backToList: T,
207
+ backToList: v,
208
208
  confirmData: $,
209
209
  edited: C,
210
210
  setEdited: E,
@@ -227,7 +227,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
227
227
  "detail-header": "_detail-header_oasq7_1",
228
228
  "form-check-disabled": "_form-check-disabled_oasq7_8",
229
229
  "active-status": "_active-status_oasq7_14"
230
- }, Se = "create_email_template", Te = "edit_email_template", Fe = () => {
230
+ }, Se = "create_email_template", ve = "edit_email_template", Fe = () => {
231
231
  const { id: i } = ee(), { t: o } = K(), { classFontSize: l } = oe(), {
232
232
  emailTemplateDetail: u,
233
233
  setEditorRef: b,
@@ -240,7 +240,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
240
240
  onAttachFile: p,
241
241
  fileUpload: R,
242
242
  removeAttachment: j
243
- } = _e(parseInt(i || "0")), M = i ? Te : Se, F = i ? "update" : "create", T = J(
243
+ } = _e(parseInt(i || "0")), M = i ? ve : Se, F = i ? "update" : "create", v = J(
244
244
  ($) => $.mailCategory.mailCategoryList
245
245
  );
246
246
  return /* @__PURE__ */ e(
@@ -257,7 +257,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
257
257
  values: g,
258
258
  touched: N,
259
259
  errors: y,
260
- setFieldValue: v,
260
+ setFieldValue: T,
261
261
  handleChange: n,
262
262
  handleBlur: s,
263
263
  handleSubmit: a
@@ -295,7 +295,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
295
295
  id: "disable-checkbox",
296
296
  checked: !g.isDisabled,
297
297
  onChange: () => {
298
- v(
298
+ T(
299
299
  "isDisabled",
300
300
  !g.isDisabled
301
301
  );
@@ -303,10 +303,10 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
303
303
  className: ` ${q["active-status"]}`
304
304
  }
305
305
  ),
306
- /* @__PURE__ */ e(O, { check: !0, for: "di-default-checkbox", className: ` ${d["custom-font-size"]}`, children: o("enabled") })
306
+ /* @__PURE__ */ e(H, { check: !0, for: "di-default-checkbox", className: ` ${d["custom-font-size"]}`, children: o("enabled") })
307
307
  ] })
308
308
  ] }),
309
- N.subject && y.subject && /* @__PURE__ */ e(P, { text: y.subject })
309
+ N.subject && y.subject && /* @__PURE__ */ e(B, { text: y.subject })
310
310
  ] }),
311
311
  /* @__PURE__ */ r(f, { md: 4, children: [
312
312
  /* @__PURE__ */ e(U, { className: ` ${d["custom-font-size"]}`, text: o("category") }),
@@ -314,13 +314,13 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
314
314
  ye,
315
315
  {
316
316
  onChange: (t) => {
317
- v("categoryId", t.value), S();
317
+ T("categoryId", t.value), S();
318
318
  },
319
319
  id: g.categoryId,
320
320
  className: ` ${d["custom-font-size"]}`
321
321
  }
322
322
  ),
323
- N.categoryId && y.categoryId && /* @__PURE__ */ e(P, { text: y.categoryId })
323
+ N.categoryId && y.categoryId && /* @__PURE__ */ e(B, { text: y.categoryId })
324
324
  ] })
325
325
  ] }),
326
326
  /* @__PURE__ */ r(A, { className: "mb-2", children: [
@@ -335,14 +335,14 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
335
335
  initialValue: u.body,
336
336
  init: ce.email,
337
337
  onEditorChange: (t) => {
338
- v(
338
+ T(
339
339
  "body",
340
340
  t
341
341
  ), S();
342
342
  }
343
343
  }
344
344
  ),
345
- N.body && y.body && /* @__PURE__ */ e(P, { text: y.body })
345
+ N.body && y.body && /* @__PURE__ */ e(B, { text: y.body })
346
346
  ] }),
347
347
  /* @__PURE__ */ e(f, { md: 12, children: /* @__PURE__ */ r(A, { children: [
348
348
  /* @__PURE__ */ e(f, { md: 3, children: /* @__PURE__ */ e(
@@ -365,7 +365,7 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
365
365
  G,
366
366
  {
367
367
  label: t.name,
368
- onRemove: () => v(
368
+ onRemove: () => T(
369
369
  "attachments",
370
370
  g.attachments.filter(
371
371
  (c) => c.name !== t.name
@@ -403,12 +403,12 @@ const ge = ({ onClick: i }) => /* @__PURE__ */ e("div", { className: "d-inline t
403
403
  ] }) })
404
404
  ] }) }),
405
405
  /* @__PURE__ */ r(f, { md: 4, children: [
406
- /* @__PURE__ */ e(O, { className: ` ${d["custom-font-size"]}`, children: o("mail_params") }),
406
+ /* @__PURE__ */ e(H, { className: ` ${d["custom-font-size"]}`, children: o("mail_params") }),
407
407
  /* @__PURE__ */ e(
408
408
  be,
409
409
  {
410
410
  onClick: (t) => h(t),
411
- isResetPasswordTemplate: g.categoryId == (T && T.length > 0 && T.filter(
411
+ isResetPasswordTemplate: g.categoryId == (v && v.length > 0 && v.filter(
412
412
  (t) => t.name == "Reset password"
413
413
  )[0].id),
414
414
  className: ` ${d["custom-font-size"]}`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("reactstrap"),F=require("react-router-dom"),U=require("@tinymce/tinymce-react"),B=require("formik"),s=require("./index-Di4rOYvb.cjs"),P=require("react-i18next"),h=require("react"),O=require("react-select"),D=require("react-redux"),A=require("./mailCategoryService-a_BJkP1X.cjs"),H=require("yup");function V(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const u=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(i,c,u.get?u:{enumerable:!0,get:()=>n[c]})}}return i.default=n,Object.freeze(i)}const R=V(H),G=({onClick:n})=>e.jsx("div",{className:"d-inline text-center cursor-pointer hover-opacity",title:"Delete",onClick:n,children:e.jsx(s.FaPlus,{})}),z=[{label:"$USER_FIRST_NAME$",meaning:"User first name"},{label:"$USER_LAST_NAME$",meaning:"User last name"},{label:"$PASSWORD$",meaning:"Password"},{label:"$USER_NAME$",meaning:"User name"},{label:"$USER_EMAIL$",meaning:"User email"},{label:"$MESSAGE$",meaning:"Message"},{label:"$DOMAIN$",meaning:"DOMAIN"}],K=({onClick:n,isResetPasswordTemplate:i,className:c})=>{const{t:u}=P.useTranslation();let y=i?[...z,{label:"$RESET_LINK$",meaning:"Reset link"}]:z;return e.jsxs(r.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`align-top ${c}`,children:u("params")}),e.jsx("th",{className:`align-top ${c}`,children:u("meaning")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:y.map(f=>e.jsxs("tr",{children:[e.jsx("td",{className:`align-middle ${c}`,children:f.label}),e.jsx("td",{className:`align-middle ${c}`,children:f.meaning}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(G,{onClick:()=>n(f)})})]},f.label))})]})},Q=n=>{const i=D.useDispatch(),c=D.useSelector(m=>m.mailCategory.mailCategoryList);h.useEffect(()=>{u()},[]);const u=async()=>{try{const m=await A.get$1();i(s.setMailCategory(m.data.items))}catch(m){console.error(m)}},{id:y,className:f}=n,S=c.map(m=>({id:m.id,value:m.id,label:m.name})),j=y&&S.find(m=>m.value===y)||null;return e.jsx(O,{options:S,className:f,value:j,...n})},M=({label:n,onRemove:i,className:c})=>e.jsxs(h.Fragment,{children:[e.jsx("span",{className:`mr-2 ${c}`,children:n}),e.jsx("i",{className:"fa fa-times text-danger cursor-pointer hover-opacity",onClick:i})]}),W={id:0,subject:"",categoryId:0,body:"",attachments:[],isDisabled:!1},X="/admin/email-template",Z="Email template detail",J=4194304,Y=n=>{let i;const c=D.useDispatch(),u=F.useNavigate(),[y,f]=h.useState(W),[S,j]=h.useState(!1),m=async()=>{localStorage.setItem(window.location.href,"true"),j(!0)},[x,$]=h.useState([]),[p,T]=h.useState([]);h.useEffect(()=>{document.title=Z,j(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),h.useEffect(()=>{n&&w()},[n]);const w=h.useCallback(async()=>{var o,l;c(s.setLoading(!0));try{const a=await A.getById(n);f({id:a.data.id,subject:a.data.subject,categoryId:a.data.category.id,body:a.data.body,attachments:a.data.attachments||[],isDisabled:a.data.isDisabled}),document.title=a.data.subject,i&&i.editor.execCommand("mceSetContent",!1,a.data.body)}catch(a){c(s.setAlert({type:"danger",message:((l=(o=a.response)==null?void 0:o.data)==null?void 0:l.title)||a.message}))}c(s.setLoading(!1))},[n]),k=o=>i=o,L=o=>{i&&i.editor.execCommand("mceInsertContent",!1,` ${o.label}`)},N=h.useCallback(()=>{u(X)},[]),E=h.useCallback(async o=>{var l,a;c(s.setLoading(!0));try{if(p&&p.length){const I=(await _()).map(v=>({key:v.data.key,name:v.data.name}));o.attachments=[...o.attachments,...I]}await(n?A.update:A.create)(o),c(s.setAlert({type:"success",message:`${n?"Update":"Create"} template successfully`})),N()}catch(t){c(s.setAlert({type:"danger",message:((a=(l=t.response)==null?void 0:l.data)==null?void 0:a.title)||t.message}))}c(s.setLoading(!1))},[n,p]),g=()=>{const o=document.getElementsByClassName("input-attachment"),l=document.createElement("input"),a=document.getElementById("email-detail");a==null||a.append(l),l.className="input-attachment",l.id=`inputAttachment-${o.length+1}`,l.type="file",l.style.display="none",l.setAttribute("multiple","multiple"),l.addEventListener("change",C),l.click()},C=()=>{const o=[];let l=0;const a=document.getElementsByClassName("input-attachment");for(const t of a)for(const d of t.files)l+=d.size,l>J&&(c(s.setAlert({type:"danger",message:"Max attachment size is 4MB"})),l-=d.size,t.remove());for(const t of a)for(const d of t.files){const{name:I}=d;!x.includes(d)&&!o.some(v=>v.name===I)&&o.push({name:I,inputId:t.id})}T(o)},b=(o,l)=>{if(p.filter(a=>a.inputId===o).length===1){const a=document.getElementById(o);a==null||a.remove();let t=p.filter(d=>d.inputId===o);p.filter(d=>d.inputId!==t.inputId),x.push(t),$([...x]),T([...p]);return}$([...x,l])};h.useEffect(()=>{C()},[x]);const _=async()=>{const o=document.getElementsByClassName("input-attachment"),l=[];for(const a of o)for(const t of a.files){const{name:d}=t,I=new FormData;I.append("file",t,d),l.push(s.systemEmailUpload(I))}return Promise.all(l)};return{emailTemplateDetail:y,setEditorRef:k,addParams:L,backToList:N,confirmData:E,edited:S,setEdited:j,setEditedTrue:m,onAttachFile:g,updateAttachment:C,fileUpload:p,removeAttachment:b}},ee=R.object({subject:R.string().required("Template subject is required"),categoryId:R.number().required("Template category is required").test("test category id","Template category is required",n=>n>=1),comment:R.string(),body:R.string().required("Template body is required")}),q={"detail-header":"_detail-header_oasq7_1","form-check-disabled":"_form-check-disabled_oasq7_8","active-status":"_active-status_oasq7_14"},te="create_email_template",se="edit_email_template",ae=()=>{const{id:n}=F.useParams(),{t:i}=P.useTranslation(),{classFontSize:c}=s.useClassFontSize(),{emailTemplateDetail:u,setEditorRef:y,addParams:f,backToList:S,confirmData:j,edited:m,setEdited:x,setEditedTrue:$,onAttachFile:p,fileUpload:T,removeAttachment:w}=Y(parseInt(n||"0")),k=n?se:te,L=n?"update":"create",N=D.useSelector(E=>E.mailCategory.mailCategoryList);return e.jsx(B.Formik,{initialValues:u,enableReinitialize:!0,validationSchema:ee,onSubmit:E=>{j(E),x(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:E=>{const{values:g,touched:C,errors:b,setFieldValue:_,handleChange:o,handleBlur:l,handleSubmit:a}=E;return e.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${s.styles[c]}`,id:"email-detail",children:[e.jsx(s.QuitPrompt,{when:m}),e.jsx("h5",{className:`mb-2 ${s.styles["custom-title-font-size"]}`,children:i(k)}),e.jsxs(r.Row,{className:"my-2",children:[e.jsxs(r.Col,{md:8,children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:i("mail_subject")}),e.jsxs("div",{className:`${q["detail-header"]}`,children:[e.jsx(r.Input,{placeholder:i("mail_subject_nm"),name:"subject",value:g.subject,onChange:t=>{o(t),$()},onBlur:l("subject"),className:`selector-input ${s.styles["custom-font-size"]}`}),e.jsxs(r.FormGroup,{check:!0,className:`${q["form-check-disabled"]}`,children:[e.jsx(r.Input,{type:"checkbox",id:"disable-checkbox",checked:!g.isDisabled,onChange:()=>{_("isDisabled",!g.isDisabled)},className:` ${q["active-status"]}`}),e.jsx(r.Label,{check:!0,for:"di-default-checkbox",className:` ${s.styles["custom-font-size"]}`,children:i("enabled")})]})]}),C.subject&&b.subject&&e.jsx(s.ErrorHandler,{text:b.subject})]}),e.jsxs(r.Col,{md:4,children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:i("category")}),e.jsx(Q,{onChange:t=>{_("categoryId",t.value),$()},id:g.categoryId,className:` ${s.styles["custom-font-size"]}`}),C.categoryId&&b.categoryId&&e.jsx(s.ErrorHandler,{text:b.categoryId})]})]}),e.jsxs(r.Row,{className:"mb-2",children:[e.jsx(r.Col,{md:8,children:e.jsxs(r.Row,{children:[e.jsxs(r.Col,{md:12,className:"mb-2",children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:i("mail_body")}),(u.body||!n)&&e.jsx(U.Editor,{ref:t=>y(t),tinymceScriptSrc:"./tinymce/tinymce.min.js",initialValue:u.body,init:s.editorConfig.email,onEditorChange:t=>{_("body",t),$()}}),C.body&&b.body&&e.jsx(s.ErrorHandler,{text:b.body})]}),e.jsx(r.Col,{md:12,children:e.jsxs(r.Row,{children:[e.jsx(r.Col,{md:3,children:e.jsx(r.Button,{color:"link",size:"sm",onClick:p,className:`pl-0 ${s.styles["custom-font-size"]}`,children:i("add_attachment")})}),e.jsx(r.Col,{md:12,children:e.jsxs(r.Row,{children:[g.attachments.map(t=>e.jsx(r.Col,{md:2,children:e.jsx(M,{label:t.name,onRemove:()=>_("attachments",g.attachments.filter(d=>d.name!==t.name)),className:` ${s.styles["custom-font-size"]}`})},t.key)),T.map((t,d)=>e.jsx(r.Col,{md:2,className:"d-flex align-items-center",children:e.jsx(M,{label:t.name,onRemove:()=>w(t.inputId,t.name),className:` ${s.styles["custom-font-size"]}`})},d))]})})]})})]})}),e.jsxs(r.Col,{md:4,children:[e.jsx(r.Label,{className:` ${s.styles["custom-font-size"]}`,children:i("mail_params")}),e.jsx(K,{onClick:t=>f(t),isResetPasswordTemplate:g.categoryId==(N&&N.length>0&&N.filter(t=>t.name=="Reset password")[0].id),className:` ${s.styles["custom-font-size"]}`})]})]}),e.jsx(s.DetailActionButtons,{confirmText:L,onConfirm:a,onCancel:S,className:` ${s.styles["custom-font-size"]}`})]})}})};exports.default=ae;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("reactstrap"),F=require("react-router-dom"),U=require("@tinymce/tinymce-react"),B=require("formik"),s=require("./index-CZIFY5ko.cjs"),P=require("react-i18next"),h=require("react"),O=require("react-select"),D=require("react-redux"),A=require("./mailCategoryService-e61jh7IC.cjs"),H=require("yup");function V(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const u=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(i,c,u.get?u:{enumerable:!0,get:()=>n[c]})}}return i.default=n,Object.freeze(i)}const R=V(H),G=({onClick:n})=>e.jsx("div",{className:"d-inline text-center cursor-pointer hover-opacity",title:"Delete",onClick:n,children:e.jsx(s.FaPlus,{})}),z=[{label:"$USER_FIRST_NAME$",meaning:"User first name"},{label:"$USER_LAST_NAME$",meaning:"User last name"},{label:"$PASSWORD$",meaning:"Password"},{label:"$USER_NAME$",meaning:"User name"},{label:"$USER_EMAIL$",meaning:"User email"},{label:"$MESSAGE$",meaning:"Message"},{label:"$DOMAIN$",meaning:"DOMAIN"}],K=({onClick:n,isResetPasswordTemplate:i,className:c})=>{const{t:u}=P.useTranslation();let y=i?[...z,{label:"$RESET_LINK$",meaning:"Reset link"}]:z;return e.jsxs(r.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`align-top ${c}`,children:u("params")}),e.jsx("th",{className:`align-top ${c}`,children:u("meaning")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:y.map(f=>e.jsxs("tr",{children:[e.jsx("td",{className:`align-middle ${c}`,children:f.label}),e.jsx("td",{className:`align-middle ${c}`,children:f.meaning}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(G,{onClick:()=>n(f)})})]},f.label))})]})},Q=n=>{const i=D.useDispatch(),c=D.useSelector(m=>m.mailCategory.mailCategoryList);h.useEffect(()=>{u()},[]);const u=async()=>{try{const m=await A.get$1();i(s.setMailCategory(m.data.items))}catch(m){console.error(m)}},{id:y,className:f}=n,S=c.map(m=>({id:m.id,value:m.id,label:m.name})),j=y&&S.find(m=>m.value===y)||null;return e.jsx(O,{options:S,className:f,value:j,...n})},M=({label:n,onRemove:i,className:c})=>e.jsxs(h.Fragment,{children:[e.jsx("span",{className:`mr-2 ${c}`,children:n}),e.jsx("i",{className:"fa fa-times text-danger cursor-pointer hover-opacity",onClick:i})]}),W={id:0,subject:"",categoryId:0,body:"",attachments:[],isDisabled:!1},X="/admin/email-template",Z="Email template detail",J=4194304,Y=n=>{let i;const c=D.useDispatch(),u=F.useNavigate(),[y,f]=h.useState(W),[S,j]=h.useState(!1),m=async()=>{localStorage.setItem(window.location.href,"true"),j(!0)},[x,$]=h.useState([]),[p,T]=h.useState([]);h.useEffect(()=>{document.title=Z,j(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),h.useEffect(()=>{n&&w()},[n]);const w=h.useCallback(async()=>{var o,l;c(s.setLoading(!0));try{const a=await A.getById(n);f({id:a.data.id,subject:a.data.subject,categoryId:a.data.category.id,body:a.data.body,attachments:a.data.attachments||[],isDisabled:a.data.isDisabled}),document.title=a.data.subject,i&&i.editor.execCommand("mceSetContent",!1,a.data.body)}catch(a){c(s.setAlert({type:"danger",message:((l=(o=a.response)==null?void 0:o.data)==null?void 0:l.title)||a.message}))}c(s.setLoading(!1))},[n]),k=o=>i=o,L=o=>{i&&i.editor.execCommand("mceInsertContent",!1,` ${o.label}`)},N=h.useCallback(()=>{u(X)},[]),E=h.useCallback(async o=>{var l,a;c(s.setLoading(!0));try{if(p&&p.length){const I=(await _()).map(v=>({key:v.data.key,name:v.data.name}));o.attachments=[...o.attachments,...I]}await(n?A.update:A.create)(o),c(s.setAlert({type:"success",message:`${n?"Update":"Create"} template successfully`})),N()}catch(t){c(s.setAlert({type:"danger",message:((a=(l=t.response)==null?void 0:l.data)==null?void 0:a.title)||t.message}))}c(s.setLoading(!1))},[n,p]),g=()=>{const o=document.getElementsByClassName("input-attachment"),l=document.createElement("input"),a=document.getElementById("email-detail");a==null||a.append(l),l.className="input-attachment",l.id=`inputAttachment-${o.length+1}`,l.type="file",l.style.display="none",l.setAttribute("multiple","multiple"),l.addEventListener("change",C),l.click()},C=()=>{const o=[];let l=0;const a=document.getElementsByClassName("input-attachment");for(const t of a)for(const d of t.files)l+=d.size,l>J&&(c(s.setAlert({type:"danger",message:"Max attachment size is 4MB"})),l-=d.size,t.remove());for(const t of a)for(const d of t.files){const{name:I}=d;!x.includes(d)&&!o.some(v=>v.name===I)&&o.push({name:I,inputId:t.id})}T(o)},b=(o,l)=>{if(p.filter(a=>a.inputId===o).length===1){const a=document.getElementById(o);a==null||a.remove();let t=p.filter(d=>d.inputId===o);p.filter(d=>d.inputId!==t.inputId),x.push(t),$([...x]),T([...p]);return}$([...x,l])};h.useEffect(()=>{C()},[x]);const _=async()=>{const o=document.getElementsByClassName("input-attachment"),l=[];for(const a of o)for(const t of a.files){const{name:d}=t,I=new FormData;I.append("file",t,d),l.push(s.systemEmailUpload(I))}return Promise.all(l)};return{emailTemplateDetail:y,setEditorRef:k,addParams:L,backToList:N,confirmData:E,edited:S,setEdited:j,setEditedTrue:m,onAttachFile:g,updateAttachment:C,fileUpload:p,removeAttachment:b}},ee=R.object({subject:R.string().required("Template subject is required"),categoryId:R.number().required("Template category is required").test("test category id","Template category is required",n=>n>=1),comment:R.string(),body:R.string().required("Template body is required")}),q={"detail-header":"_detail-header_oasq7_1","form-check-disabled":"_form-check-disabled_oasq7_8","active-status":"_active-status_oasq7_14"},te="create_email_template",se="edit_email_template",ae=()=>{const{id:n}=F.useParams(),{t:i}=P.useTranslation(),{classFontSize:c}=s.useClassFontSize(),{emailTemplateDetail:u,setEditorRef:y,addParams:f,backToList:S,confirmData:j,edited:m,setEdited:x,setEditedTrue:$,onAttachFile:p,fileUpload:T,removeAttachment:w}=Y(parseInt(n||"0")),k=n?se:te,L=n?"update":"create",N=D.useSelector(E=>E.mailCategory.mailCategoryList);return e.jsx(B.Formik,{initialValues:u,enableReinitialize:!0,validationSchema:ee,onSubmit:E=>{j(E),x(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:E=>{const{values:g,touched:C,errors:b,setFieldValue:_,handleChange:o,handleBlur:l,handleSubmit:a}=E;return e.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${s.styles[c]}`,id:"email-detail",children:[e.jsx(s.QuitPrompt,{when:m}),e.jsx("h5",{className:`mb-2 ${s.styles["custom-title-font-size"]}`,children:i(k)}),e.jsxs(r.Row,{className:"my-2",children:[e.jsxs(r.Col,{md:8,children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:i("mail_subject")}),e.jsxs("div",{className:`${q["detail-header"]}`,children:[e.jsx(r.Input,{placeholder:i("mail_subject_nm"),name:"subject",value:g.subject,onChange:t=>{o(t),$()},onBlur:l("subject"),className:`selector-input ${s.styles["custom-font-size"]}`}),e.jsxs(r.FormGroup,{check:!0,className:`${q["form-check-disabled"]}`,children:[e.jsx(r.Input,{type:"checkbox",id:"disable-checkbox",checked:!g.isDisabled,onChange:()=>{_("isDisabled",!g.isDisabled)},className:` ${q["active-status"]}`}),e.jsx(r.Label,{check:!0,for:"di-default-checkbox",className:` ${s.styles["custom-font-size"]}`,children:i("enabled")})]})]}),C.subject&&b.subject&&e.jsx(s.ErrorHandler,{text:b.subject})]}),e.jsxs(r.Col,{md:4,children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:i("category")}),e.jsx(Q,{onChange:t=>{_("categoryId",t.value),$()},id:g.categoryId,className:` ${s.styles["custom-font-size"]}`}),C.categoryId&&b.categoryId&&e.jsx(s.ErrorHandler,{text:b.categoryId})]})]}),e.jsxs(r.Row,{className:"mb-2",children:[e.jsx(r.Col,{md:8,children:e.jsxs(r.Row,{children:[e.jsxs(r.Col,{md:12,className:"mb-2",children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:i("mail_body")}),(u.body||!n)&&e.jsx(U.Editor,{ref:t=>y(t),tinymceScriptSrc:"./tinymce/tinymce.min.js",initialValue:u.body,init:s.editorConfig.email,onEditorChange:t=>{_("body",t),$()}}),C.body&&b.body&&e.jsx(s.ErrorHandler,{text:b.body})]}),e.jsx(r.Col,{md:12,children:e.jsxs(r.Row,{children:[e.jsx(r.Col,{md:3,children:e.jsx(r.Button,{color:"link",size:"sm",onClick:p,className:`pl-0 ${s.styles["custom-font-size"]}`,children:i("add_attachment")})}),e.jsx(r.Col,{md:12,children:e.jsxs(r.Row,{children:[g.attachments.map(t=>e.jsx(r.Col,{md:2,children:e.jsx(M,{label:t.name,onRemove:()=>_("attachments",g.attachments.filter(d=>d.name!==t.name)),className:` ${s.styles["custom-font-size"]}`})},t.key)),T.map((t,d)=>e.jsx(r.Col,{md:2,className:"d-flex align-items-center",children:e.jsx(M,{label:t.name,onRemove:()=>w(t.inputId,t.name),className:` ${s.styles["custom-font-size"]}`})},d))]})})]})})]})}),e.jsxs(r.Col,{md:4,children:[e.jsx(r.Label,{className:` ${s.styles["custom-font-size"]}`,children:i("mail_params")}),e.jsx(K,{onClick:t=>f(t),isResetPasswordTemplate:g.categoryId==(N&&N.length>0&&N.filter(t=>t.name=="Reset password")[0].id),className:` ${s.styles["custom-font-size"]}`})]})]}),e.jsx(s.DetailActionButtons,{confirmText:L,onConfirm:a,onCancel:S,className:` ${s.styles["custom-font-size"]}`})]})}})};exports.default=ae;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("reactstrap"),t=require("./index-Di4rOYvb.cjs"),L=require("date-fns"),h=require("react"),x=require("react-redux"),N=require("react-router-dom"),f=require("./mailCategoryService-a_BJkP1X.cjs"),b=require("react-i18next"),z="/admin/email-template",E="/admin/create-email-template",$="Email template list",v=()=>{const a=N.useNavigate(),p=x.useSelector(s=>s.emailTemplate.emailTemplateList),m=x.useSelector(s=>s.emailTemplate.totalItems),r=x.useSelector(s=>s.mailCategory.mailCategoryList),{filters:n,changeFilters:d}=t.useFilters(),l=x.useDispatch(),u=h.useCallback(async()=>{var s,c;l(t.setLoading(!0));try{const o=await f.get(n),{items:g,totalItems:T}=o.data;if(l(t.setEmailTemplateList({emailTemplateList:g,totalItems:T})),r&&r.length==0){const C=await f.get$1();l(t.setMailCategory(C.data.items))}}catch(o){l(t.setAlert({type:"danger",message:((c=(s=o.response)==null?void 0:s.data)==null?void 0:c.title)||o.message}))}l(t.setLoading(!1))},[l,n]),j=h.useCallback(s=>{var c,o;l(t.setLoading(!0));try{l(t.setModal({isOpen:!0,type:"warning",message:"Do you want to remove this email template?",onConfirm:async()=>{await f.remove(s),l(t.setAlert({type:"success",message:"Remove template successfully"})),d({currentPage:1})}}))}catch(g){l(t.setAlert({type:"danger",message:((o=(c=g.response)==null?void 0:c.data)==null?void 0:o.title)||g.message}))}l(t.setLoading(!1))},[n]),y=h.useCallback(s=>{const c=s?`${z}/${s}`:E;a(c)},[]);return h.useEffect(()=>{document.title=$},[]),h.useEffect(()=>{u()},[n]),{emailTemplateList:p,totalItems:m,filters:n,changeFilters:d,getData:u,removeData:j,goToDetail:y,mailCategoryList:r}},R="email_template",D=()=>{const{t:a}=b.useTranslation(),{classFontSize:p}=t.useClassFontSize(),{emailTemplateList:m,totalItems:r,filters:n,changeFilters:d,removeData:l,goToDetail:u,mailCategoryList:j}=v(),y=s=>{l(s)};return e.jsxs("div",{className:`fadeIn animated ${t.styles[p]}`,children:[e.jsx("h5",{className:`mb-2 ${t.styles["custom-title-font-size"]}`,children:a(R)}),e.jsxs(i.Row,{className:"my-2",children:[e.jsx(i.Col,{md:4,children:e.jsx(t.AddButton,{text:a("create_template"),onClick:()=>u(),className:` ${t.styles["custom-font-size"]}`})}),e.jsxs(i.Col,{md:4,className:`d-flex justify-content-end align-items-center ${t.styles["custom-font-size"]}`,children:[a("total_of_templates"),": ",r]})]}),e.jsxs(i.Row,{className:"mb-2",children:[e.jsxs(i.Col,{md:8,children:[m&&m.length>0?e.jsxs(i.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("template_name")}),e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("category_name")}),e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("created_date")}),e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("status")}),e.jsx("th",{className:`text-center ${t.styles["custom-font-size"]}`,children:a("action")})]})}),e.jsx("tbody",{children:m.map(s=>e.jsxs("tr",{children:[e.jsx("td",{className:"align-middle",children:e.jsx(t.LinkEditButton,{label:s.subject,onClick:()=>u(s.id),className:` ${t.styles["custom-font-size"]}`})}),e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:s.category.name}),e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:L.format(new Date(s.createdAt),t.DATE_RESULT)}),e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:s.isDisabled?a("disabled"):a("enabled")}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(t.DeleteButtonIcon,{onClick:()=>y(s.id)})})]},s.id))})]}):e.jsx(t.EmptyDataAlert,{label:a("template")}),e.jsx(i.Row,{className:"mt-2",children:e.jsx(i.Col,{md:12,children:e.jsx(t.CustomPagination,{filters:n,totalRecordCount:r,changePageSize:s=>d({pageSize:s}),changePage:s=>d({currentPage:s})})})})]}),e.jsx(i.Col,{md:4,children:e.jsxs(i.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("category_name")})})}),e.jsx("tbody",{children:j.map(s=>e.jsx("tr",{children:e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:s.name})},s.id))})]})})]})]})};exports.default=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("reactstrap"),t=require("./index-CZIFY5ko.cjs"),L=require("date-fns"),h=require("react"),x=require("react-redux"),N=require("react-router-dom"),f=require("./mailCategoryService-e61jh7IC.cjs"),b=require("react-i18next"),z="/admin/email-template",E="/admin/create-email-template",$="Email template list",v=()=>{const a=N.useNavigate(),p=x.useSelector(s=>s.emailTemplate.emailTemplateList),m=x.useSelector(s=>s.emailTemplate.totalItems),r=x.useSelector(s=>s.mailCategory.mailCategoryList),{filters:n,changeFilters:d}=t.useFilters(),l=x.useDispatch(),u=h.useCallback(async()=>{var s,c;l(t.setLoading(!0));try{const o=await f.get(n),{items:g,totalItems:T}=o.data;if(l(t.setEmailTemplateList({emailTemplateList:g,totalItems:T})),r&&r.length==0){const C=await f.get$1();l(t.setMailCategory(C.data.items))}}catch(o){l(t.setAlert({type:"danger",message:((c=(s=o.response)==null?void 0:s.data)==null?void 0:c.title)||o.message}))}l(t.setLoading(!1))},[l,n]),j=h.useCallback(s=>{var c,o;l(t.setLoading(!0));try{l(t.setModal({isOpen:!0,type:"warning",message:"Do you want to remove this email template?",onConfirm:async()=>{await f.remove(s),l(t.setAlert({type:"success",message:"Remove template successfully"})),d({currentPage:1})}}))}catch(g){l(t.setAlert({type:"danger",message:((o=(c=g.response)==null?void 0:c.data)==null?void 0:o.title)||g.message}))}l(t.setLoading(!1))},[n]),y=h.useCallback(s=>{const c=s?`${z}/${s}`:E;a(c)},[]);return h.useEffect(()=>{document.title=$},[]),h.useEffect(()=>{u()},[n]),{emailTemplateList:p,totalItems:m,filters:n,changeFilters:d,getData:u,removeData:j,goToDetail:y,mailCategoryList:r}},R="email_template",D=()=>{const{t:a}=b.useTranslation(),{classFontSize:p}=t.useClassFontSize(),{emailTemplateList:m,totalItems:r,filters:n,changeFilters:d,removeData:l,goToDetail:u,mailCategoryList:j}=v(),y=s=>{l(s)};return e.jsxs("div",{className:`fadeIn animated ${t.styles[p]}`,children:[e.jsx("h5",{className:`mb-2 ${t.styles["custom-title-font-size"]}`,children:a(R)}),e.jsxs(i.Row,{className:"my-2",children:[e.jsx(i.Col,{md:4,children:e.jsx(t.AddButton,{text:a("create_template"),onClick:()=>u(),className:` ${t.styles["custom-font-size"]}`})}),e.jsxs(i.Col,{md:4,className:`d-flex justify-content-end align-items-center ${t.styles["custom-font-size"]}`,children:[a("total_of_templates"),": ",r]})]}),e.jsxs(i.Row,{className:"mb-2",children:[e.jsxs(i.Col,{md:8,children:[m&&m.length>0?e.jsxs(i.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("template_name")}),e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("category_name")}),e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("created_date")}),e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("status")}),e.jsx("th",{className:`text-center ${t.styles["custom-font-size"]}`,children:a("action")})]})}),e.jsx("tbody",{children:m.map(s=>e.jsxs("tr",{children:[e.jsx("td",{className:"align-middle",children:e.jsx(t.LinkEditButton,{label:s.subject,onClick:()=>u(s.id),className:` ${t.styles["custom-font-size"]}`})}),e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:s.category.name}),e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:L.format(new Date(s.createdAt),t.DATE_RESULT)}),e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:s.isDisabled?a("disabled"):a("enabled")}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(t.DeleteButtonIcon,{onClick:()=>y(s.id)})})]},s.id))})]}):e.jsx(t.EmptyDataAlert,{label:a("template")}),e.jsx(i.Row,{className:"mt-2",children:e.jsx(i.Col,{md:12,children:e.jsx(t.CustomPagination,{filters:n,totalRecordCount:r,changePageSize:s=>d({pageSize:s}),changePage:s=>d({currentPage:s})})})})]}),e.jsx(i.Col,{md:4,children:e.jsxs(i.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{className:`align-top ${t.styles["custom-font-size"]}`,children:a("category_name")})})}),e.jsx("tbody",{children:j.map(s=>e.jsx("tr",{children:e.jsx("td",{className:`align-middle ${t.styles["custom-font-size"]}`,children:s.name})},s.id))})]})})]})]})};exports.default=D;
@@ -1,13 +1,13 @@
1
1
  import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
2
  import { Row as N, Col as u, Table as E } from "reactstrap";
3
- import { t as D, s as g, v as _, w as I, c as z, x as A, y as w, h as a, z as x, L as R, D as F, C as P, F as k, H as M } from "./index-BGq2Nos5.js";
3
+ import { u as D, s as g, t as _, v as I, c as z, w as A, x as w, h as a, y as x, L as R, D as F, z as P, C as k, F as M } from "./index-B3rBIMXj.js";
4
4
  import { format as S } from "date-fns";
5
5
  import { useCallback as L, useEffect as C } from "react";
6
6
  import { useSelector as $, useDispatch as j } from "react-redux";
7
7
  import { useNavigate as B } from "react-router-dom";
8
- import { g as U, a as H, r as O } from "./mailCategoryService-CyAJ1EtZ.js";
9
- import { useTranslation as q } from "react-i18next";
10
- const G = "/admin/email-template", J = "/admin/create-email-template", K = "Email template list", Q = () => {
8
+ import { g as U, a as O, r as q } from "./mailCategoryService-DwzZAJWg.js";
9
+ import { useTranslation as G } from "react-i18next";
10
+ const H = "/admin/email-template", J = "/admin/create-email-template", K = "Email template list", Q = () => {
11
11
  const s = B(), f = $(
12
12
  (e) => e.emailTemplate.emailTemplateList
13
13
  ), r = $(
@@ -22,7 +22,7 @@ const G = "/admin/email-template", J = "/admin/create-email-template", K = "Emai
22
22
  if (l(
23
23
  _({ emailTemplateList: p, totalItems: b })
24
24
  ), c && c.length == 0) {
25
- const v = await H();
25
+ const v = await O();
26
26
  l(I(v.data.items));
27
27
  }
28
28
  } catch (o) {
@@ -45,7 +45,7 @@ const G = "/admin/email-template", J = "/admin/create-email-template", K = "Emai
45
45
  type: "warning",
46
46
  message: "Do you want to remove this email template?",
47
47
  onConfirm: async () => {
48
- await O(e), l(
48
+ await q(e), l(
49
49
  z({
50
50
  type: "success",
51
51
  message: "Remove template successfully"
@@ -66,7 +66,7 @@ const G = "/admin/email-template", J = "/admin/create-email-template", K = "Emai
66
66
  },
67
67
  [m]
68
68
  ), T = L((e) => {
69
- const n = e ? `${G}/${e}` : J;
69
+ const n = e ? `${H}/${e}` : J;
70
70
  s(n);
71
71
  }, []);
72
72
  return C(() => {
@@ -84,7 +84,7 @@ const G = "/admin/email-template", J = "/admin/create-email-template", K = "Emai
84
84
  mailCategoryList: c
85
85
  };
86
86
  }, V = "email_template", ie = () => {
87
- const { t: s } = q(), { classFontSize: f } = w(), {
87
+ const { t: s } = G(), { classFontSize: f } = w(), {
88
88
  emailTemplateList: r,
89
89
  totalItems: c,
90
90
  filters: m,
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as h } from "react/jsx-runtime";
2
- import { forwardRef as M, useCallback as I, useEffect as v, useState as b, useRef as P } from "react";
2
+ import { forwardRef as P, useCallback as I, useEffect as v, useState as b, useRef as M } from "react";
3
3
  import { Row as S, Col as C, Input as R, Table as j } from "reactstrap";
4
- import { S as z, R as T, E as B, a as D, B as U, t as H, s as F, T as V, c as A, x as _, Q as O, z as G, L as J, C as K, F as W, H as X } from "./index-BGq2Nos5.js";
4
+ import { P as z, R as B, E as T, a as x, B as U, u as V, s as F, S as _, c as A, w as H, Q as O, y as G, L as J, z as K, C as W, F as X } from "./index-B3rBIMXj.js";
5
5
  import { Formik as Y } from "formik";
6
6
  import * as N from "yup";
7
7
  import { useSelector as $, useDispatch as k } from "react-redux";
@@ -51,7 +51,7 @@ const Z = N.object({
51
51
  setEditedFalse: m,
52
52
  children: /* @__PURE__ */ h(S, { children: [
53
53
  /* @__PURE__ */ h(C, { md: 12, children: [
54
- /* @__PURE__ */ t(T, { text: "Question" }),
54
+ /* @__PURE__ */ t(B, { text: "Question" }),
55
55
  /* @__PURE__ */ t(
56
56
  R,
57
57
  {
@@ -59,21 +59,21 @@ const Z = N.object({
59
59
  name: "question",
60
60
  placeholder: "Question",
61
61
  value: d.question,
62
- onChange: (x) => {
63
- y(x), i();
62
+ onChange: (D) => {
63
+ y(D), i();
64
64
  },
65
65
  onBlur: q("question")
66
66
  }
67
67
  ),
68
68
  u.question && l.question && /* @__PURE__ */ t(
69
- B,
69
+ T,
70
70
  {
71
71
  text: l.question
72
72
  }
73
73
  )
74
74
  ] }),
75
75
  /* @__PURE__ */ h(C, { md: 12, className: "pt-2", children: [
76
- /* @__PURE__ */ t(T, { text: "Answer" }),
76
+ /* @__PURE__ */ t(B, { text: "Answer" }),
77
77
  /* @__PURE__ */ t(
78
78
  R,
79
79
  {
@@ -82,14 +82,14 @@ const Z = N.object({
82
82
  name: "answer",
83
83
  placeholder: "Answer",
84
84
  value: d.answer,
85
- onChange: (x) => {
86
- y(x), i();
85
+ onChange: (D) => {
86
+ y(D), i();
87
87
  },
88
88
  onBlur: q("answer")
89
89
  }
90
90
  ),
91
91
  u.answer && l.answer && /* @__PURE__ */ t(
92
- B,
92
+ T,
93
93
  {
94
94
  text: l.answer
95
95
  }
@@ -101,13 +101,13 @@ const Z = N.object({
101
101
  }
102
102
  }
103
103
  );
104
- }, te = M(ee), E = `${U}/api/SystemFaq`, se = (e) => D.get(E, { params: e }), ae = (e) => D.get(`${E}/${e}`), ne = (e) => D.post(E, e), re = (e) => D.put(`${E}/${e.id}`, e), oe = (e) => D.delete(`${E}/${e}`), ie = "FAQ list", le = () => {
105
- const e = $((r) => r.faqs.faqList), a = $((r) => r.faqs.totalItems), { filters: o, changeFilters: g } = H(), s = k(), w = I(async () => {
104
+ }, te = P(ee), E = `${U}/api/SystemFaq`, se = (e) => x.get(E, { params: e }), ae = (e) => x.get(`${E}/${e}`), ne = (e) => x.post(E, e), re = (e) => x.put(`${E}/${e.id}`, e), oe = (e) => x.delete(`${E}/${e}`), ie = "FAQ list", le = () => {
105
+ const e = $((r) => r.faqs.faqList), a = $((r) => r.faqs.totalItems), { filters: o, changeFilters: g } = V(), s = k(), w = I(async () => {
106
106
  var r, c;
107
107
  s(F(!0));
108
108
  try {
109
109
  const i = await se(o), { items: m, totalItems: p } = i.data;
110
- s(V({ faqList: m, totalItems: p }));
110
+ s(_({ faqList: m, totalItems: p }));
111
111
  } catch (i) {
112
112
  s(
113
113
  A({
@@ -123,7 +123,7 @@ const Z = N.object({
123
123
  s(F(!0));
124
124
  try {
125
125
  s(
126
- _({
126
+ H({
127
127
  isOpen: !0,
128
128
  type: "warning",
129
129
  message: "Do you want to remove this FAQ?",
@@ -221,7 +221,7 @@ const Z = N.object({
221
221
  setEditedFalse: c
222
222
  };
223
223
  }, de = "FAQ", we = () => {
224
- const e = P(null), {
224
+ const e = M(null), {
225
225
  faqList: a,
226
226
  totalItems: o,
227
227
  filters: g,
@@ -244,7 +244,7 @@ const Z = N.object({
244
244
  m(n, () => {
245
245
  e && e.current && e.current.toggle(), w();
246
246
  }), y();
247
- }, x = (n) => {
247
+ }, D = (n) => {
248
248
  f(n);
249
249
  };
250
250
  return /* @__PURE__ */ h("div", { className: "fadeIn animated", children: [
@@ -298,7 +298,7 @@ const Z = N.object({
298
298
  /* @__PURE__ */ t("td", { className: "text-center align-middle", children: /* @__PURE__ */ t(
299
299
  K,
300
300
  {
301
- onClick: () => x(n.id)
301
+ onClick: () => D(n.id)
302
302
  }
303
303
  ) })
304
304
  ] }, n.id)) })
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),h=require("reactstrap"),s=require("./index-Di4rOYvb.cjs"),S=require("formik"),v=require("yup"),A=require("react-redux");function I(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const m=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,m.get?m:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const L=I(v),R=L.object({question:L.string().required("Question is required"),answer:L.string().required("Answer is required")}),Q=(t,a)=>{const{header:n,confirmText:m,onConfirm:r,faqDetail:y,onCancel:p,edited:i,setEdited:d,setEditedTrue:l,setEditedFalse:f}=t;return e.jsx(S.Formik,{initialValues:y,enableReinitialize:!0,validationSchema:R,onSubmit:(j,g)=>{r(j),g.resetForm()},children:j=>{const{values:g,touched:x,errors:c,handleChange:w,handleBlur:q,handleSubmit:D}=j;return e.jsx(s.CommonModal,{header:n,confirmText:m,onConfirm:D,onCancel:p,ref:a,edited:i,setEdited:d,setEditedFalse:f,children:e.jsxs(h.Row,{children:[e.jsxs(h.Col,{md:12,children:[e.jsx(s.RequiredLabel,{text:"Question"}),e.jsx(h.Input,{type:"textarea",name:"question",placeholder:"Question",value:g.question,onChange:C=>{w(C),l()},onBlur:q("question")}),x.question&&c.question&&e.jsx(s.ErrorHandler,{text:c.question})]}),e.jsxs(h.Col,{md:12,className:"pt-2",children:[e.jsx(s.RequiredLabel,{text:"Answer"}),e.jsx(h.Input,{type:"textarea",rows:5,name:"answer",placeholder:"Answer",value:g.answer,onChange:C=>{w(C),l()},onBlur:q("answer")}),x.answer&&c.answer&&e.jsx(s.ErrorHandler,{text:c.answer})]})]})})}})},N=u.forwardRef(Q),F=`${s.BASE_URL}/api/SystemFaq`,k=t=>s.api.get(F,{params:t}),T=t=>s.api.get(`${F}/${t}`),$=t=>s.api.post(F,t),B=t=>s.api.put(`${F}/${t.id}`,t),P=t=>s.api.delete(`${F}/${t}`),M="FAQ list",O=()=>{const t=A.useSelector(i=>i.faqs.faqList),a=A.useSelector(i=>i.faqs.totalItems),{filters:n,changeFilters:m}=s.useFilters(),r=A.useDispatch(),y=u.useCallback(async()=>{var i,d;r(s.setLoading(!0));try{const l=await k(n),{items:f,totalItems:j}=l.data;r(s.setFaqList({faqList:f,totalItems:j}))}catch(l){r(s.setAlert({type:"danger",message:((d=(i=l.response)==null?void 0:i.data)==null?void 0:d.title)||l.message}))}r(s.setLoading(!1))},[r,n]),p=u.useCallback(i=>{var d,l;r(s.setLoading(!0));try{r(s.setModal({isOpen:!0,type:"warning",message:"Do you want to remove this FAQ?",onConfirm:async()=>{await P(i),r(s.setAlert({type:"success",message:"Remove question successfully"})),m({currentPage:1})}}))}catch(f){r(s.setAlert({type:"danger",message:((l=(d=f.response)==null?void 0:d.data)==null?void 0:l.title)||f.message}))}r(s.setLoading(!1))},[n]);return u.useEffect(()=>{document.title=M},[]),u.useEffect(()=>{y()},[n]),{faqList:t,totalItems:a,filters:n,changeFilters:m,getData:y,removeData:p}},b={question:"",answer:""},_=()=>{const t=A.useDispatch(),[a,n]=u.useState(0),[m,r]=u.useState(b),[y,p]=u.useState(!1),i=async()=>{localStorage.setItem(window.location.href,"true"),p(!0)},d=async()=>{localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href),p(!1)};u.useEffect(()=>{a?f():r(b)},[a]),u.useEffect(()=>{d()},[]);const l=()=>{r(b),n(0)},f=u.useCallback(async()=>{var g,x;t(s.setLoading(!0));try{const c=await T(a);r(c.data)}catch(c){t(s.setAlert({type:"danger",message:((x=(g=c.response)==null?void 0:g.data)==null?void 0:x.title)||c.message}))}t(s.setLoading(!1))},[a]),j=u.useCallback(async(g,x)=>{var c,w;t(s.setLoading(!0));try{await(a?B:$)(g),t(s.setAlert({type:"success",message:`${a?"Update":"Create"} FAQ successfully`})),x&&x(),a&&n(0)}catch(q){t(s.setAlert({type:"danger",message:((w=(c=q.response)==null?void 0:c.data)==null?void 0:w.title)||q.message}))}t(s.setLoading(!1))},[a,m]);return{id:a,setId:n,faqDetail:m,confirmData:j,initValue:b,reset:l,edited:y,setEdited:p,setEditedTrue:i,setEditedFalse:d}},z="FAQ",U=()=>{const t=u.useRef(null),{faqList:a,totalItems:n,filters:m,changeFilters:r,getData:y,removeData:p}=O(),{id:i,setId:d,faqDetail:l,confirmData:f,reset:j,edited:g,setEdited:x,setEditedTrue:c,setEditedFalse:w}=_(),q=o=>{d(o||0),t&&t.current&&t.current.toggle()},D=o=>{f(o,()=>{t&&t.current&&t.current.toggle(),y()}),w()},C=o=>{p(o)},E=()=>j();return e.jsxs("div",{className:"fadeIn animated",children:[e.jsx(N,{ref:t,header:i?"Edit FAQ":"Create FAQ",confirmText:i?"Update":"Create",onConfirm:D,onCancel:E,faqDetail:l,edited:g,setEdited:x,setEditedTrue:c,setEditedFalse:w}),e.jsx(s.QuitPrompt,{when:g}),e.jsx("h5",{className:"mb-2",children:z}),e.jsxs(h.Row,{className:"my-2",children:[e.jsx(h.Col,{md:4,children:e.jsx(s.AddButton,{text:"Create FAQ",onClick:()=>q()})}),e.jsxs(h.Col,{md:4,className:"d-flex align-items-center justify-content-end",children:["Total of FAQs: ",n]})]}),e.jsxs(h.Row,{className:"mb-2",children:[e.jsx(h.Col,{md:8,children:a&&a.length>0?e.jsxs(h.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"align-top",children:"Question"}),e.jsx("th",{className:"align-top",children:"Answer"}),e.jsx("th",{className:"text-center",children:"Action"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{children:[e.jsx("td",{className:"align-middle",children:e.jsx(s.LinkEditButton,{label:o.question,onClick:()=>q(o.id)})}),e.jsx("td",{className:"align-middle",children:o.answer}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(s.DeleteButtonIcon,{onClick:()=>C(o.id)})})]},o.id))})]}):e.jsx(s.EmptyDataAlert,{label:"FAQ"})}),e.jsx(h.Col,{md:8,children:e.jsx(s.CustomPagination,{filters:m,totalRecordCount:n,changePageSize:o=>r({pageSize:o}),changePage:o=>r({currentPage:o})})})]})]})};exports.default=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),h=require("reactstrap"),s=require("./index-CZIFY5ko.cjs"),S=require("formik"),v=require("yup"),A=require("react-redux");function I(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const m=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,m.get?m:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const L=I(v),R=L.object({question:L.string().required("Question is required"),answer:L.string().required("Answer is required")}),Q=(t,a)=>{const{header:n,confirmText:m,onConfirm:r,faqDetail:y,onCancel:p,edited:i,setEdited:d,setEditedTrue:l,setEditedFalse:f}=t;return e.jsx(S.Formik,{initialValues:y,enableReinitialize:!0,validationSchema:R,onSubmit:(j,g)=>{r(j),g.resetForm()},children:j=>{const{values:g,touched:x,errors:c,handleChange:w,handleBlur:q,handleSubmit:D}=j;return e.jsx(s.CommonModal,{header:n,confirmText:m,onConfirm:D,onCancel:p,ref:a,edited:i,setEdited:d,setEditedFalse:f,children:e.jsxs(h.Row,{children:[e.jsxs(h.Col,{md:12,children:[e.jsx(s.RequiredLabel,{text:"Question"}),e.jsx(h.Input,{type:"textarea",name:"question",placeholder:"Question",value:g.question,onChange:C=>{w(C),l()},onBlur:q("question")}),x.question&&c.question&&e.jsx(s.ErrorHandler,{text:c.question})]}),e.jsxs(h.Col,{md:12,className:"pt-2",children:[e.jsx(s.RequiredLabel,{text:"Answer"}),e.jsx(h.Input,{type:"textarea",rows:5,name:"answer",placeholder:"Answer",value:g.answer,onChange:C=>{w(C),l()},onBlur:q("answer")}),x.answer&&c.answer&&e.jsx(s.ErrorHandler,{text:c.answer})]})]})})}})},N=u.forwardRef(Q),F=`${s.BASE_URL}/api/SystemFaq`,k=t=>s.api.get(F,{params:t}),T=t=>s.api.get(`${F}/${t}`),$=t=>s.api.post(F,t),B=t=>s.api.put(`${F}/${t.id}`,t),P=t=>s.api.delete(`${F}/${t}`),M="FAQ list",O=()=>{const t=A.useSelector(i=>i.faqs.faqList),a=A.useSelector(i=>i.faqs.totalItems),{filters:n,changeFilters:m}=s.useFilters(),r=A.useDispatch(),y=u.useCallback(async()=>{var i,d;r(s.setLoading(!0));try{const l=await k(n),{items:f,totalItems:j}=l.data;r(s.setFaqList({faqList:f,totalItems:j}))}catch(l){r(s.setAlert({type:"danger",message:((d=(i=l.response)==null?void 0:i.data)==null?void 0:d.title)||l.message}))}r(s.setLoading(!1))},[r,n]),p=u.useCallback(i=>{var d,l;r(s.setLoading(!0));try{r(s.setModal({isOpen:!0,type:"warning",message:"Do you want to remove this FAQ?",onConfirm:async()=>{await P(i),r(s.setAlert({type:"success",message:"Remove question successfully"})),m({currentPage:1})}}))}catch(f){r(s.setAlert({type:"danger",message:((l=(d=f.response)==null?void 0:d.data)==null?void 0:l.title)||f.message}))}r(s.setLoading(!1))},[n]);return u.useEffect(()=>{document.title=M},[]),u.useEffect(()=>{y()},[n]),{faqList:t,totalItems:a,filters:n,changeFilters:m,getData:y,removeData:p}},b={question:"",answer:""},_=()=>{const t=A.useDispatch(),[a,n]=u.useState(0),[m,r]=u.useState(b),[y,p]=u.useState(!1),i=async()=>{localStorage.setItem(window.location.href,"true"),p(!0)},d=async()=>{localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href),p(!1)};u.useEffect(()=>{a?f():r(b)},[a]),u.useEffect(()=>{d()},[]);const l=()=>{r(b),n(0)},f=u.useCallback(async()=>{var g,x;t(s.setLoading(!0));try{const c=await T(a);r(c.data)}catch(c){t(s.setAlert({type:"danger",message:((x=(g=c.response)==null?void 0:g.data)==null?void 0:x.title)||c.message}))}t(s.setLoading(!1))},[a]),j=u.useCallback(async(g,x)=>{var c,w;t(s.setLoading(!0));try{await(a?B:$)(g),t(s.setAlert({type:"success",message:`${a?"Update":"Create"} FAQ successfully`})),x&&x(),a&&n(0)}catch(q){t(s.setAlert({type:"danger",message:((w=(c=q.response)==null?void 0:c.data)==null?void 0:w.title)||q.message}))}t(s.setLoading(!1))},[a,m]);return{id:a,setId:n,faqDetail:m,confirmData:j,initValue:b,reset:l,edited:y,setEdited:p,setEditedTrue:i,setEditedFalse:d}},z="FAQ",U=()=>{const t=u.useRef(null),{faqList:a,totalItems:n,filters:m,changeFilters:r,getData:y,removeData:p}=O(),{id:i,setId:d,faqDetail:l,confirmData:f,reset:j,edited:g,setEdited:x,setEditedTrue:c,setEditedFalse:w}=_(),q=o=>{d(o||0),t&&t.current&&t.current.toggle()},D=o=>{f(o,()=>{t&&t.current&&t.current.toggle(),y()}),w()},C=o=>{p(o)},E=()=>j();return e.jsxs("div",{className:"fadeIn animated",children:[e.jsx(N,{ref:t,header:i?"Edit FAQ":"Create FAQ",confirmText:i?"Update":"Create",onConfirm:D,onCancel:E,faqDetail:l,edited:g,setEdited:x,setEditedTrue:c,setEditedFalse:w}),e.jsx(s.QuitPrompt,{when:g}),e.jsx("h5",{className:"mb-2",children:z}),e.jsxs(h.Row,{className:"my-2",children:[e.jsx(h.Col,{md:4,children:e.jsx(s.AddButton,{text:"Create FAQ",onClick:()=>q()})}),e.jsxs(h.Col,{md:4,className:"d-flex align-items-center justify-content-end",children:["Total of FAQs: ",n]})]}),e.jsxs(h.Row,{className:"mb-2",children:[e.jsx(h.Col,{md:8,children:a&&a.length>0?e.jsxs(h.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"align-top",children:"Question"}),e.jsx("th",{className:"align-top",children:"Answer"}),e.jsx("th",{className:"text-center",children:"Action"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{children:[e.jsx("td",{className:"align-middle",children:e.jsx(s.LinkEditButton,{label:o.question,onClick:()=>q(o.id)})}),e.jsx("td",{className:"align-middle",children:o.answer}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(s.DeleteButtonIcon,{onClick:()=>C(o.id)})})]},o.id))})]}):e.jsx(s.EmptyDataAlert,{label:"FAQ"})}),e.jsx(h.Col,{md:8,children:e.jsx(s.CustomPagination,{filters:m,totalRecordCount:n,changePageSize:o=>r({pageSize:o}),changePage:o=>r({currentPage:o})})})]})]})};exports.default=U;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("reactstrap"),t=require("react-redux"),r=require("./index-Di4rOYvb.cjs"),a=require("react"),d=require("react-i18next"),x=({targetMedia:s})=>{var o;const{t:i}=d.useTranslation();if(!s||s!=null&&s.isFolder)return e.jsx("div",{});const c=r.getTypeByExtension(s.extension),l=r.getFileUrl(s.key||"");return e.jsxs(n.Card,{className:"position-sticky",children:[e.jsx(n.CardHeader,{children:(s==null?void 0:s.name)||"Media name"}),c===r.MediaType.IMAGE&&e.jsx(n.CardImg,{className:"p-2",src:l,loading:"lazy"}),c===r.MediaType.VIDEO&&e.jsx("div",{className:"p-2",children:e.jsx("video",{id:s.key,width:"100%",height:"100%",controls:!0,children:e.jsx("source",{src:l})})}),c===r.MediaType.AUDIO&&e.jsx("div",{className:"p-2",children:e.jsx("audio",{controls:!0,className:"w-100",children:e.jsx("source",{src:l})})}),e.jsxs(n.CardBody,{children:[e.jsx(n.CardTitle,{tag:"h6",children:i("general_info")}),e.jsxs(n.CardText,{children:[i("file_extension"),": ",(o=s.extension)==null?void 0:o.toUpperCase()]})]})]})},u=a.memo(x),h="media_gallery",j=({isLibrary:s})=>{const{t:i}=d.useTranslation(),c=t.useSelector(l=>l.gallery.targetMedia);return e.jsxs("div",{className:"fadeIn animated",children:[!s&&e.jsx("h5",{className:"mb-2",children:i(h)}),e.jsxs(n.Row,{className:"mb-2",children:[e.jsx(n.Col,{md:8,children:e.jsx(r.MediaList,{height:"100vh",isLibrary:s})}),e.jsx(n.Col,{md:4,children:e.jsx(u,{targetMedia:c},c==null?void 0:c.key)})]})]})};exports.default=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("reactstrap"),t=require("react-redux"),r=require("./index-CZIFY5ko.cjs"),a=require("react"),d=require("react-i18next"),x=({targetMedia:s})=>{var o;const{t:i}=d.useTranslation();if(!s||s!=null&&s.isFolder)return e.jsx("div",{});const c=r.getTypeByExtension(s.extension),l=r.getFileUrl(s.key||"");return e.jsxs(n.Card,{className:"position-sticky",children:[e.jsx(n.CardHeader,{children:(s==null?void 0:s.name)||"Media name"}),c===r.MediaType.IMAGE&&e.jsx(n.CardImg,{className:"p-2",src:l,loading:"lazy"}),c===r.MediaType.VIDEO&&e.jsx("div",{className:"p-2",children:e.jsx("video",{id:s.key,width:"100%",height:"100%",controls:!0,children:e.jsx("source",{src:l})})}),c===r.MediaType.AUDIO&&e.jsx("div",{className:"p-2",children:e.jsx("audio",{controls:!0,className:"w-100",children:e.jsx("source",{src:l})})}),e.jsxs(n.CardBody,{children:[e.jsx(n.CardTitle,{tag:"h6",children:i("general_info")}),e.jsxs(n.CardText,{children:[i("file_extension"),": ",(o=s.extension)==null?void 0:o.toUpperCase()]})]})]})},u=a.memo(x),h="media_gallery",j=({isLibrary:s})=>{const{t:i}=d.useTranslation(),c=t.useSelector(l=>l.gallery.targetMedia);return e.jsxs("div",{className:"fadeIn animated",children:[!s&&e.jsx("h5",{className:"mb-2",children:i(h)}),e.jsxs(n.Row,{className:"mb-2",children:[e.jsx(n.Col,{md:8,children:e.jsx(r.MediaList,{height:"100vh",isLibrary:s})}),e.jsx(n.Col,{md:4,children:e.jsx(u,{targetMedia:c},c==null?void 0:c.key)})]})]})};exports.default=j;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
2
  import { Card as m, CardHeader as h, CardImg as t, CardBody as p, CardTitle as u, CardText as f, Row as y, Col as a } from "reactstrap";
3
3
  import { useSelector as x } from "react-redux";
4
- import { a9 as C, k as N, aa as c, ab as v } from "./index-BGq2Nos5.js";
4
+ import { a8 as C, k as N, a9 as c, aa as v } from "./index-B3rBIMXj.js";
5
5
  import k from "react";
6
6
  import { useTranslation as d } from "react-i18next";
7
7
  const I = ({ targetMedia: s }) => {
@@ -32,7 +32,7 @@ const I = ({ targetMedia: s }) => {
32
32
  ] })
33
33
  ] })
34
34
  ] });
35
- }, T = k.memo(I), _ = "media_gallery", A = ({ isLibrary: s }) => {
35
+ }, T = k.memo(I), _ = "media_gallery", B = ({ isLibrary: s }) => {
36
36
  const { t: r } = d(), l = x((n) => n.gallery.targetMedia);
37
37
  return /* @__PURE__ */ o("div", { className: "fadeIn animated", children: [
38
38
  !s && /* @__PURE__ */ e("h5", { className: "mb-2", children: r(_) }),
@@ -49,5 +49,5 @@ const I = ({ targetMedia: s }) => {
49
49
  ] });
50
50
  };
51
51
  export {
52
- A as default
52
+ B as default
53
53
  };