jamespot-react-core 1.1.188 → 1.1.189

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.
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[435],{435:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>M,Audience:()=>x,Avatar:()=>g,CommentsBloc:()=>Ll,DisplayForm:()=>Al,EditorsPortal:()=>He,Empty:()=>Ol,JRCInputTinyMCEWithExt:()=>$l,JRCInputTinyMCEWithExtRaw:()=>Fl,MarkdownModal:()=>Ut,ModalAudience:()=>Pl,TwoColLayout:()=>Ql,WidgetList:()=>ot,WidgetWrapperCore:()=>El});var i=n(594),l=n.n(i),o=n(196),a=n.n(o),r=n(493),s=n(228),c=n(497),d=n(996),u=n(683);const m=d.j.getLazyComponent("Icon"),g=e=>{var t;const n=(0,o.useTheme)(),i=(0,u.GV)(c.Bx.selectors.selectNetworkPublic);return e.uri===(null==i?void 0:i.uri)?l().createElement(m,{name:"icon-fs-wall",size:8*(null!==(t=e.size)&&void 0!==t?t:3),color:n.color.primary,variant:"circle"}):l().createElement(s.JRCAvatar,Object.assign({},e))},p=d.j.getLazyComponent("FlexBox"),f=d.j.getLazyComponent("ModalContent"),E=d.j.getLazyComponent("ModalLayout"),h=d.j.getLazyComponent("StyledHref"),b=d.j.getLazyComponent("Tooltip"),v=d.j.getLazyComponent("Typography"),y=a().div`
1
+ "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[435],{435:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>M,Audience:()=>x,Avatar:()=>g,CommentsBloc:()=>Ll,DisplayForm:()=>Al,EditorsPortal:()=>He,Empty:()=>Ol,JRCInputTinyMCEWithExt:()=>$l,JRCInputTinyMCEWithExtRaw:()=>Fl,MarkdownModal:()=>Ut,ModalAudience:()=>Pl,TwoColLayout:()=>Ql,WidgetList:()=>ot,WidgetWrapperCore:()=>El});var i=n(594),l=n.n(i),o=n(196),a=n.n(o),r=n(493),s=n(272),c=n(448),d=n(996),u=n(683);const m=d.j.getLazyComponent("Icon"),g=e=>{var t;const n=(0,o.useTheme)(),i=(0,u.GV)(c.Bx.selectors.selectNetworkPublic);return e.uri===(null==i?void 0:i.uri)?l().createElement(m,{name:"icon-fs-wall",size:8*(null!==(t=e.size)&&void 0!==t?t:3),color:n.color.primary,variant:"circle"}):l().createElement(s.JRCAvatar,Object.assign({},e))},p=d.j.getLazyComponent("FlexBox"),f=d.j.getLazyComponent("ModalContent"),E=d.j.getLazyComponent("ModalLayout"),h=d.j.getLazyComponent("StyledHref"),b=d.j.getLazyComponent("Tooltip"),v=d.j.getLazyComponent("Typography"),y=a().div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -107,6 +107,9 @@
107
107
  align-items: center;
108
108
  justify-content: center;
109
109
  background-color: ${e=>e.isActive?e.theme.color.grey2:e.theme.color.white};
110
+
111
+ ${(0,s.DashedFocusBorder)()}
112
+
110
113
  &:hover {
111
114
  background-color: ${e=>e.theme.color.grey2};
112
115
  }
@@ -145,7 +148,7 @@
145
148
  flex: 1;
146
149
  display: flex;
147
150
  align-items: center;
148
- `,d.j.getLazyComponent("Button")),X=d.j.getLazyComponent("Icon"),K=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(D,null,l().createElement($,null),l().createElement(V,null,"Popup"),l().createElement($,null,l().createElement(Y,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(X,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(D,null,l().createElement(Q,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var Z=n(939);const ee=d.j.getLazyComponent("WidgetArticleTitleEditor"),te=d.j.getLazyComponent("WidgetArticleTextEditor"),ne=d.j.getLazyComponent("WidgetArticleGalleryEditor"),ie=d.j.getLazyComponent("WidgetArticleAttachmentEditor"),le=d.j.getLazyComponent("WidgetArticleSliderEditor"),oe=d.j.getLazyComponent("WidgetArticleImageEditor"),ae=d.j.getLazyComponent("WidgetButtonEditor"),re=d.j.getLazyComponent("WidgetCheckListEditor"),se=d.j.getLazyComponent("WidgetQuickSurveyEditor"),ce=d.j.getLazyComponent("WidgetDatasourceTableEditor"),de=d.j.getLazyComponent("WidgetExcelDatasourceTableEditor"),ue=d.j.getLazyComponent("WidgetPresenceEditor"),me=d.j.getLazyComponent("WidgetEmailsImapEditor"),ge=d.j.getLazyComponent("WidgetContactCardDavEditor"),pe=d.j.getLazyComponent("WidgetCalendarCalDavEditor"),fe=({uniqid:e})=>{var t,n,i,o,a,r;const d=(0,u.jL)(),m=(0,u.GV)(c.x0.selectors.selectToken),g=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),G.shallowEqual),p=(0,u.GV)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),G.shallowEqual),f=e=>{var t;return null===(t=c.qn.selectors.selectHook(Z.M.getState(),e))||void 0===t?void 0:t.isActive},E=t=>{g&&d(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),d(c.cr.slice.actions.flushEditor({uniqid:e})),p&&p(t)},h=(t,n)=>{d(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},b=t=>{d(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},v=null==g?void 0:g.widget;return v?(0,w.ensureWidgetArticleButtonType)(v)?l().createElement(ae,Object.assign({},v.content,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:()=>E({})})):(0,w.ensureWidgetArticleGalleryType)(v)?l().createElement(ne,{token:m,content:v.content,onChange:t=>d((0,c.vR)(e,t,!1)),onSave:E,onStateChange:h}):(0,w.ensureWidgetArticleAttachmentType)(v)?l().createElement(ie,{token:m,content:v.content,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h,onOpen:b}):(0,w.ensureWidgetArticleImageType)(v)?l().createElement(oe,{content:v.content,token:m,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h}):(0,w.ensureWidgetArticleSliderType)(v)?void 0!==m?l().createElement(le,{slides:null!==(t=v.content.slides)&&void 0!==t?t:[],loop:null!==(n=v.content.loop)&&void 0!==n&&n,useDots:null===(i=v.content.useDots)||void 0===i||i,onChange:t=>{d((0,c.vR)(e,t,!1))},token:m,onSave:E}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,w.ensureWidgetArticleTitleType)(v)?l().createElement(ee,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content,onOpen:b}):(0,w.ensureWidgetArticleTextType)(v)?l().createElement(te,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content}):(0,w.ensureWidgetPresenceType)(v)?l().createElement(ue,Object.assign({onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h},v.content)):(0,w.ensureWidgetCheckListType)(v)?l().createElement(re,{token:m,uniqid:v.uniqid,content:Object.assign(Object.assign({},v.content),{arr:null===(o=v.content.arr)||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,w.ensureWidgetQuickSurveyType)(v)?l().createElement(se,{token:m,uniqid:v.uniqid,content:v.content,onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,w.ensureWidgetExcelDatasourceTableType)(v)?l().createElement(de,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(a=v.content.limit)&&void 0!==a?a:20,hook:{isActive:f},handlers:{jamespot:{datasource:k().datasource,network:k().network,filebank:k().filebank,wedoc:k().wedoc},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>d(c.y8.actions.error({label:e}))})):(0,w.ensureWidgetEmailsImapType)(v)?l().createElement(me,null):(0,w.ensureWidgetContactCardDavType)(v)?l().createElement(ge,null):(0,w.ensureWidgetCalendarCalDavType)(v)?l().createElement(pe,null):(0,w.ensureWidgetDatasourceTableType)(v)?l().createElement(ce,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(r=v.content.limit)&&void 0!==r?r:20,hook:{isActive:f},handlers:{jamespot:{datasource:k().datasource,network:k().network,application:k().application,filebank:k().filebank},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>{d(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},Ee=d.j.getLazyComponent("Icon"),he=({uniqid:e,position:t})=>{const n=(0,u.jL)(),i=(0,o.useTheme)();return l().createElement($,null,l().createElement(Y,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(Ee,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:i.color.lavender})))};var be=n(655);const ve=d.j.getLazyComponent("InputColorRaw"),ye=a().label`
151
+ `,d.j.getLazyComponent("Button")),X=d.j.getLazyComponent("Icon"),K=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(D,null,l().createElement($,null),l().createElement(V,null,"Popup"),l().createElement($,null,l().createElement(Y,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(X,{name:"icon-times",color:"grey2",size:26.75})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(D,null,l().createElement(Q,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var Z=n(939);const ee=d.j.getLazyComponent("WidgetArticleTitleEditor"),te=d.j.getLazyComponent("WidgetArticleTextEditor"),ne=d.j.getLazyComponent("WidgetArticleGalleryEditor"),ie=d.j.getLazyComponent("WidgetArticleAttachmentEditor"),le=d.j.getLazyComponent("WidgetArticleSliderEditor"),oe=d.j.getLazyComponent("WidgetArticleImageEditor"),ae=d.j.getLazyComponent("WidgetButtonEditor"),re=d.j.getLazyComponent("WidgetCheckListEditor"),se=d.j.getLazyComponent("WidgetQuickSurveyEditor"),ce=d.j.getLazyComponent("WidgetDatasourceTableEditor"),de=d.j.getLazyComponent("WidgetExcelDatasourceTableEditor"),ue=d.j.getLazyComponent("WidgetPresenceEditor"),me=d.j.getLazyComponent("WidgetEmailsImapEditor"),ge=d.j.getLazyComponent("WidgetContactCardDavEditor"),pe=d.j.getLazyComponent("WidgetCalendarCalDavEditor"),fe=({uniqid:e})=>{var t,n,i,o,a,r;const d=(0,u.jL)(),m=(0,u.GV)(c.x0.selectors.selectToken),g=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),G.shallowEqual),p=(0,u.GV)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),G.shallowEqual),f=e=>{var t;return null===(t=c.qn.selectors.selectHook(Z.M.getState(),e))||void 0===t?void 0:t.isActive},E=t=>{g&&d(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),d(c.cr.slice.actions.flushEditor({uniqid:e})),p&&p(t)},h=(t,n)=>{d(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},b=t=>{d(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},v=null==g?void 0:g.widget;return v?(0,w.ensureWidgetArticleButtonType)(v)?l().createElement(ae,Object.assign({},v.content,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:()=>E({})})):(0,w.ensureWidgetArticleGalleryType)(v)?l().createElement(ne,{token:m,content:v.content,onChange:t=>d((0,c.vR)(e,t,!1)),onSave:E,onStateChange:h}):(0,w.ensureWidgetArticleAttachmentType)(v)?l().createElement(ie,{token:m,content:v.content,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h,onOpen:b}):(0,w.ensureWidgetArticleImageType)(v)?l().createElement(oe,{content:v.content,token:m,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h}):(0,w.ensureWidgetArticleSliderType)(v)?void 0!==m?l().createElement(le,{slides:null!==(t=v.content.slides)&&void 0!==t?t:[],loop:null!==(n=v.content.loop)&&void 0!==n&&n,useDots:null===(i=v.content.useDots)||void 0===i||i,onChange:t=>{d((0,c.vR)(e,t,!1))},token:m,onSave:E}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,w.ensureWidgetArticleTitleType)(v)?l().createElement(ee,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content,onOpen:b}):(0,w.ensureWidgetArticleTextType)(v)?l().createElement(te,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content}):(0,w.ensureWidgetPresenceType)(v)?l().createElement(ue,Object.assign({onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h},v.content)):(0,w.ensureWidgetCheckListType)(v)?l().createElement(re,{token:m,uniqid:v.uniqid,content:Object.assign(Object.assign({},v.content),{arr:null===(o=v.content.arr)||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,w.ensureWidgetQuickSurveyType)(v)?l().createElement(se,{token:m,uniqid:v.uniqid,content:v.content,onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,w.ensureWidgetExcelDatasourceTableType)(v)?l().createElement(de,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(a=v.content.limit)&&void 0!==a?a:20,hook:{isActive:f},handlers:{jamespot:{datasource:k().datasource,network:k().network,filebank:k().filebank,wedoc:k().wedoc},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>d(c.y8.actions.error({label:e}))})):(0,w.ensureWidgetEmailsImapType)(v)?l().createElement(me,null):(0,w.ensureWidgetContactCardDavType)(v)?l().createElement(ge,null):(0,w.ensureWidgetCalendarCalDavType)(v)?l().createElement(pe,null):(0,w.ensureWidgetDatasourceTableType)(v)?l().createElement(ce,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(r=v.content.limit)&&void 0!==r?r:20,hook:{isActive:f},handlers:{jamespot:{datasource:k().datasource,network:k().network,application:k().application,filebank:k().filebank},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>{d(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},Ee=d.j.getLazyComponent("Icon"),he=({uniqid:e,position:t})=>{const n=(0,u.jL)(),i=(0,o.useTheme)();return l().createElement($,null,l().createElement(Y,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(Ee,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:i.color.lavender,size:26.75})))};var be=n(655);const ve=d.j.getLazyComponent("InputColorRaw"),ye=a().label`
149
152
  margin-left: 2px;
150
153
  margin-right: 2px;
151
154
  margin-bottom: 8px;
@@ -155,7 +158,7 @@
155
158
  `,Ce=a().fieldset`
156
159
  margin: 12px 0px !important;
157
160
  width: 100% !important;
158
- `,xe=({label:e,initialValue:t,handleChange:n})=>{const i=(0,o.useTheme)(),a=[{name:(0,r.useIntl)().formatMessage({id:"GLOBAL_Platform_Color"}),colors:[i.color.primary,i.color.secondary,i.color.headerColor,i.color.lavender,i.color.orange,i.color.green,i.color.navy,i.color.overseas]}];return l().createElement(Ce,null,l().createElement(ye,null,l().createElement(r.FormattedMessage,{id:e})),l().createElement(ve,{palettes:a,label:e,initialValue:null!=t?t:i.color.primary,name:"background-color",onChange:n}))},we=d.j.getLazyComponent("InputNumber"),ke=({label:e,initialValue:t,handleChange:n})=>{const i=(0,r.useIntl)(),{control:o,watch:a}=(0,be.useForm)({defaultValues:{value:null!=t?t:"0"},criteriaMode:"all"});return l().useEffect((()=>{const e=a((e=>{var t;n(null!==(t=e.value)&&void 0!==t?t:"")}));return()=>e.unsubscribe()}),[a,n]),l().createElement(we,{label:e,name:"value",width:"100%",control:o,placeholder:i.formatMessage({id:e})})},We=d.j.getLazyComponent("InputSelect"),Le=({label:e,options:t=[],initialValue:n,required:o=!1,handleChange:a})=>{const s=(0,r.useIntl)(),c=(0,i.useMemo)((()=>n&&t.find((e=>e.value===n))?t.find((e=>e.value===n)):t[0]),[n,t]),{control:d,watch:u}=(0,be.useForm)({defaultValues:{select:c},criteriaMode:"all"});return l().useEffect((()=>{const e=u((e=>{a(e.select.value)}));return()=>e.unsubscribe()}),[u,a]),l().createElement(We,{options:t,label:e,components:{Option:e=>l().createElement("span",null,s.formatMessage({id:e.option.label}))},getSearch:e=>s.formatMessage({id:e.label}),rules:{required:o},hideDeleteIcon:!0,required:o,control:d,name:"select"})},_e=d.j.getLazyComponent("InputText"),qe=({uniqid:e})=>{var t;const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),d=(0,o.useTheme)(),m=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),G.shallowEqual),{control:g,watch:p}=(0,be.useForm)({defaultValues:{text:null!==(t=null==s?void 0:s.title.replace(/&/g,"&"))&&void 0!==t?t:""},criteriaMode:"all"});(0,i.useEffect)((()=>{const t=p((t=>{a(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))}));return()=>t.unsubscribe()}),[p,e,a]);const f=(0,i.useMemo)((()=>({color:m&&m.color?String(m.color):d.color.black,backgroundColor:m&&m["background-color"]?String(m["background-color"]):"transparent",fontSize:m&&m["font-size"]?String(m["font-size"]):"24",fontWeight:m&&m["font-weight"]?String(m["font-weight"]):"medium",textAlign:m&&m["text-align"]?String(m["text-align"]):"left"})),[m,d]),E=(0,i.useCallback)(((t,n)=>{a(c.x0.slice.actions.setWidgetTitleStyle({uniqid:e,styles:{[t]:n}}))}),[a,e]);return s?l().createElement(l().Fragment,null,l().createElement(_e,{name:"text",label:"WIDGET_Title",width:"100%",control:g,placeholder:n.formatMessage({id:"WIDGET_Title"})}),l().createElement(xe,{label:"STYLE_Text_Color",initialValue:f.color,handleChange:e=>E("color",e)}),l().createElement(xe,{label:"STYLE_Background_Color",initialValue:f.backgroundColor,handleChange:e=>E("background-color",e)}),l().createElement(ke,{label:"STYLE_Text_Size",initialValue:f.fontSize,handleChange:e=>E("font-size",e)}),l().createElement(Le,{label:"STYLE_Font_Weight",initialValue:f.fontWeight,options:[{label:n.formatMessage({id:"STYLE_Font_Weight_Normal"}),value:"normal"},{label:n.formatMessage({id:"STYLE_Font_Weight_Medium"}),value:"medium"},{label:n.formatMessage({id:"STYLE_Font_Weight_Bold"}),value:"bold"}],required:!1,handleChange:e=>E("font-weight",e)}),l().createElement(Le,{label:"STYLE_Text_Align",initialValue:f.textAlign,options:[{label:n.formatMessage({id:"STYLE_Text_Align_Left"}),value:"left"},{label:n.formatMessage({id:"STYLE_Text_Align_Center"}),value:"center"},{label:n.formatMessage({id:"STYLE_Text_Align_Justify"}),value:"justify"},{label:n.formatMessage({id:"STYLE_Text_Align_Right"}),value:"right"}],required:!1,handleChange:e=>E("text-align",e)})):l().createElement(l().Fragment,null)},je=d.j.getLazyComponent("Loader"),Se=({uniqid:e})=>{var t;const n=null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),G.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(P,null,l().createElement(je,{size:"l"})))},Me=({uniqid:e})=>{var t;const n=(0,r.useIntl)();return(null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),G.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(U,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Te=d.j.getLazyComponent("Button"),Ie=({uniqid:e,mode:t})=>{const n=(0,r.useIntl)(),i=(0,u.jL)(),o=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),G.shallowEqual),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),G.shallowEqual);return l().createElement(Te,{color:"valid",onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;a&&o&&l&&("view"==t&&k().widget.updateWidget({uri:a,uniqid:e,title:o.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},Ae=({uniqid:e})=>{const t=(0,o.useTheme)(),n=(0,u.jL)(),a=(0,r.useIntl)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),G.shallowEqual),d=(0,i.useMemo)((()=>({color:s&&s.color?String(s.color):t.color.black,backgroundColor:s&&s["background-color"]?String(s["background-color"]):t.color.white,padding:s&&s.padding?String(s.padding):"0",borderRadius:s&&s["border-radius"]?String(s["border-radius"]):"0",borderColor:s["border-color"]?String(s["border-color"]):t.color.black,borderWidth:s["border-width"]?String(s["border-width"]):"0",borderStyle:s["border-style"]?String(s["border-style"]):"none"})),[s,t]),m=(0,i.useCallback)(((t,i)=>{n(c.x0.slice.actions.setWidgetWrapperStyle({uniqid:e,styles:{[t]:i}}))}),[e,n]);return l().createElement(l().Fragment,null,l().createElement(xe,{label:"STYLE_Background_Color",initialValue:d.backgroundColor,handleChange:e=>m("background-color",e)}),l().createElement(xe,{label:"STYLE_Text_Color",initialValue:d.color,handleChange:e=>m("color",e)}),l().createElement("hr",null),l().createElement(ke,{label:"STYLE_Padding",initialValue:d.padding,handleChange:e=>m("padding",String(e))}),l().createElement(ke,{label:"STYLE_Radius",initialValue:d.borderRadius,handleChange:e=>m("border-radius",String(e))}),l().createElement(Le,{label:"STYLE_Border_Style",initialValue:d.borderStyle,options:[{label:a.formatMessage({id:"STYLE_Border_Style_None"}),value:"none"},{label:a.formatMessage({id:"STYLE_Border_Style_Solid"}),value:"solid"},{label:a.formatMessage({id:"STYLE_Border_Style_Dashed"}),value:"dashed"},{label:a.formatMessage({id:"STYLE_Border_Style_Dotted"}),value:"dotted"}],required:!1,handleChange:e=>{m("border-style",e),"none"!==e&&m("border-color",t.color.black),"none"!==e&&m("border-width","1")}}),"none"!==s["border-style"]&&l().createElement(xe,{label:"STYLE_Border_Color",initialValue:d.borderColor,handleChange:e=>m("border-color",e)}),"none"!==s["border-style"]&&l().createElement(ke,{label:"STYLE_Border_Width",initialValue:d.borderWidth,handleChange:e=>m("border-width",e)}))},Oe=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,r.useIntl)(),o=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),G.shallowEqual),a=c.x0.definition(null==o?void 0:o.name),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e)),G.shallowEqual),d=(0,i.useCallback)((n=>{t(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(n)}))}),[e,t]);return l().createElement(Le,{handleChange:d,required:!0,label:"WIDGET_Display_Level_Select",initialValue:s?String(s):"3",options:[{label:n.formatMessage({id:"WIDGET_Display_Level_1"}),value:"1"},{label:n.formatMessage({id:"WIDGET_Display_Level_2"}),value:"2"},{label:n.formatMessage({id:"WIDGET_Display_Level_3"}),value:"3"},{label:n.formatMessage({id:"WIDGET_Display_Level_4"}),value:"4"}].filter((e=>Array.isArray(a.displayLevel)?a.displayLevel.includes(Number(e.value)):[]))})},Ge=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],ze=d.j.getLazyComponent("Icon"),De=d.j.getLazyComponent("Tooltip"),$e=({uniqid:e,position:t})=>{const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,o.useTheme)(),d=(0,i.useRef)(null),m=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),G.shallowEqual),g=c.x0.definition(null==m?void 0:m.name),p=(0,i.useMemo)((()=>void 0!==g.displayLevel&&Array.isArray(g.displayLevel)&&0!==g.displayLevel.length),[g]),f=(0,i.useMemo)((()=>[{name:"widget-title",label:n.formatMessage({id:"PANEL_Title"}),enable:g.panel.useWrapper,icon:"icon-font"},{name:"widget-selection",label:n.formatMessage({id:"PANEL_Widget_Selection"}),enable:g.panel.useSelection,icon:"icon-sliders"},{name:"widget-settings",label:n.formatMessage({id:"PANEL_Widget_Settings"}),enable:g.panel.useEditor,icon:"icon-pen"},{name:"widget-level",label:n.formatMessage({id:"PANEL_Widget_Level"}),enable:p,icon:"icon-edit"}]),[g,n,p]),E=(0,i.useMemo)((()=>g.panel.useEditor?f.find((e=>"widget-settings"===e.name)):f.filter((e=>e.enable))[0]),[g,f]),[h,b]=(0,i.useState)(E);return(0,i.useEffect)((()=>{setTimeout((()=>{d&&d.current&&(d.current.className=d.current.className+" animate")}),0)}),[]),m?l().createElement(F,null,l().createElement(R,{ref:d,position:t},l().createElement(N,null,f.map((e=>e.enable?l().createElement(De,{key:e.name,position:"left",description:e.label},l().createElement(Y,{isActive:h&&h.name===e.name,onClick:()=>b(e)},l().createElement(ze,{name:e.icon,color:h&&h.name===e.name?s.color.white:s.color.lavender}))):l().createElement(l().Fragment,null)))),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(D,null,l().createElement(he,{uniqid:e,position:m.position}),l().createElement(V,null,l().createElement("h3",null,h?h.label:n.formatMessage({id:g.label}))),l().createElement($,null,l().createElement(Y,{onClick:()=>{a(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(ze,{name:"icon-times",color:s.color.lavender})))),l().createElement(B,null,l().createElement(H,null,h&&"widget-settings"===h.name&&g.panel.useEditor&&l().createElement(fe,{uniqid:m.uniqid}),h&&"widget-title"===h.name&&g.panel.useWrapper&&l().createElement(qe,{uniqid:m.uniqid}),h&&"widget-selection"===h.name&&l().createElement(Ae,{uniqid:e}),h&&"widget-level"===h.name&&p&&l().createElement(Oe,{uniqid:e})),l().createElement(Se,{uniqid:e}),l().createElement(Me,{uniqid:e}),Ge.includes(m.name)&&l().createElement(Ie,{uniqid:e,mode:m.mode})))),(null==m?void 0:m.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},Ve=a().div`
161
+ `,xe=({label:e,initialValue:t,handleChange:n})=>{const i=(0,o.useTheme)(),a=[{name:(0,r.useIntl)().formatMessage({id:"GLOBAL_Platform_Color"}),colors:[i.color.primary,i.color.secondary,i.color.headerColor,i.color.lavender,i.color.orange,i.color.green,i.color.navy,i.color.overseas]}];return l().createElement(Ce,null,l().createElement(ye,null,l().createElement(r.FormattedMessage,{id:e})),l().createElement(ve,{palettes:a,label:e,initialValue:null!=t?t:i.color.primary,name:"background-color",onChange:n}))},we=d.j.getLazyComponent("InputNumber"),ke=({label:e,initialValue:t,handleChange:n})=>{const i=(0,r.useIntl)(),{control:o,watch:a}=(0,be.useForm)({defaultValues:{value:null!=t?t:"0"},criteriaMode:"all"});return l().useEffect((()=>{const e=a((e=>{var t;n(null!==(t=e.value)&&void 0!==t?t:"")}));return()=>e.unsubscribe()}),[a,n]),l().createElement(we,{label:e,name:"value",width:"100%",control:o,placeholder:i.formatMessage({id:e})})},We=d.j.getLazyComponent("InputSelect"),Le=({label:e,options:t=[],initialValue:n,required:o=!1,handleChange:a})=>{const s=(0,r.useIntl)(),c=(0,i.useMemo)((()=>n&&t.find((e=>e.value===n))?t.find((e=>e.value===n)):t[0]),[n,t]),{control:d,watch:u}=(0,be.useForm)({defaultValues:{select:c},criteriaMode:"all"});return l().useEffect((()=>{const e=u((e=>{a(e.select.value)}));return()=>e.unsubscribe()}),[u,a]),l().createElement(We,{options:t,label:e,components:{Option:e=>l().createElement("span",null,s.formatMessage({id:e.option.label}))},getSearch:e=>s.formatMessage({id:e.label}),rules:{required:o},hideDeleteIcon:!0,required:o,control:d,name:"select"})},_e=d.j.getLazyComponent("InputText"),qe=({uniqid:e})=>{var t;const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),d=(0,o.useTheme)(),m=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),G.shallowEqual),{control:g,watch:p}=(0,be.useForm)({defaultValues:{text:null!==(t=null==s?void 0:s.title.replace(/&/g,"&"))&&void 0!==t?t:""},criteriaMode:"all"});(0,i.useEffect)((()=>{const t=p((t=>{a(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))}));return()=>t.unsubscribe()}),[p,e,a]);const f=(0,i.useMemo)((()=>({color:m&&m.color?String(m.color):d.color.black,backgroundColor:m&&m["background-color"]?String(m["background-color"]):"transparent",fontSize:m&&m["font-size"]?String(m["font-size"]):"24",fontWeight:m&&m["font-weight"]?String(m["font-weight"]):"medium",textAlign:m&&m["text-align"]?String(m["text-align"]):"left"})),[m,d]),E=(0,i.useCallback)(((t,n)=>{a(c.x0.slice.actions.setWidgetTitleStyle({uniqid:e,styles:{[t]:n}}))}),[a,e]);return s?l().createElement(l().Fragment,null,l().createElement(_e,{name:"text",label:"WIDGET_Title",width:"100%",control:g,placeholder:n.formatMessage({id:"WIDGET_Title"})}),l().createElement(xe,{label:"STYLE_Text_Color",initialValue:f.color,handleChange:e=>E("color",e)}),l().createElement(xe,{label:"STYLE_Background_Color",initialValue:f.backgroundColor,handleChange:e=>E("background-color",e)}),l().createElement(ke,{label:"STYLE_Text_Size",initialValue:f.fontSize,handleChange:e=>E("font-size",e)}),l().createElement(Le,{label:"STYLE_Font_Weight",initialValue:f.fontWeight,options:[{label:n.formatMessage({id:"STYLE_Font_Weight_Normal"}),value:"normal"},{label:n.formatMessage({id:"STYLE_Font_Weight_Medium"}),value:"medium"},{label:n.formatMessage({id:"STYLE_Font_Weight_Bold"}),value:"bold"}],required:!1,handleChange:e=>E("font-weight",e)}),l().createElement(Le,{label:"STYLE_Text_Align",initialValue:f.textAlign,options:[{label:n.formatMessage({id:"STYLE_Text_Align_Left"}),value:"left"},{label:n.formatMessage({id:"STYLE_Text_Align_Center"}),value:"center"},{label:n.formatMessage({id:"STYLE_Text_Align_Justify"}),value:"justify"},{label:n.formatMessage({id:"STYLE_Text_Align_Right"}),value:"right"}],required:!1,handleChange:e=>E("text-align",e)})):l().createElement(l().Fragment,null)},je=d.j.getLazyComponent("Loader"),Se=({uniqid:e})=>{var t;const n=null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),G.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(P,null,l().createElement(je,{size:"l"})))},Me=({uniqid:e})=>{var t;const n=(0,r.useIntl)();return(null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),G.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(U,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Te=d.j.getLazyComponent("Button"),Ie=({uniqid:e,mode:t})=>{const n=(0,r.useIntl)(),i=(0,u.jL)(),o=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),G.shallowEqual),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),G.shallowEqual);return l().createElement(Te,{color:"valid",onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;a&&o&&l&&("view"==t&&k().widget.updateWidget({uri:a,uniqid:e,title:o.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},Ae=({uniqid:e})=>{const t=(0,o.useTheme)(),n=(0,u.jL)(),a=(0,r.useIntl)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),G.shallowEqual),d=(0,i.useMemo)((()=>({color:s&&s.color?String(s.color):t.color.black,backgroundColor:s&&s["background-color"]?String(s["background-color"]):t.color.white,padding:s&&s.padding?String(s.padding):"0",borderRadius:s&&s["border-radius"]?String(s["border-radius"]):"0",borderColor:s["border-color"]?String(s["border-color"]):t.color.black,borderWidth:s["border-width"]?String(s["border-width"]):"0",borderStyle:s["border-style"]?String(s["border-style"]):"none"})),[s,t]),m=(0,i.useCallback)(((t,i)=>{n(c.x0.slice.actions.setWidgetWrapperStyle({uniqid:e,styles:{[t]:i}}))}),[e,n]);return l().createElement(l().Fragment,null,l().createElement(xe,{label:"STYLE_Background_Color",initialValue:d.backgroundColor,handleChange:e=>m("background-color",e)}),l().createElement(xe,{label:"STYLE_Text_Color",initialValue:d.color,handleChange:e=>m("color",e)}),l().createElement("hr",null),l().createElement(ke,{label:"STYLE_Padding",initialValue:d.padding,handleChange:e=>m("padding",String(e))}),l().createElement(ke,{label:"STYLE_Radius",initialValue:d.borderRadius,handleChange:e=>m("border-radius",String(e))}),l().createElement(Le,{label:"STYLE_Border_Style",initialValue:d.borderStyle,options:[{label:a.formatMessage({id:"STYLE_Border_Style_None"}),value:"none"},{label:a.formatMessage({id:"STYLE_Border_Style_Solid"}),value:"solid"},{label:a.formatMessage({id:"STYLE_Border_Style_Dashed"}),value:"dashed"},{label:a.formatMessage({id:"STYLE_Border_Style_Dotted"}),value:"dotted"}],required:!1,handleChange:e=>{m("border-style",e),"none"!==e&&m("border-color",t.color.black),"none"!==e&&m("border-width","1")}}),"none"!==s["border-style"]&&l().createElement(xe,{label:"STYLE_Border_Color",initialValue:d.borderColor,handleChange:e=>m("border-color",e)}),"none"!==s["border-style"]&&l().createElement(ke,{label:"STYLE_Border_Width",initialValue:d.borderWidth,handleChange:e=>m("border-width",e)}))},Oe=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,r.useIntl)(),o=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),G.shallowEqual),a=c.x0.definition(null==o?void 0:o.name),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e)),G.shallowEqual),d=(0,i.useCallback)((n=>{t(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(n)}))}),[e,t]);return l().createElement(Le,{handleChange:d,required:!0,label:"WIDGET_Display_Level_Select",initialValue:s?String(s):"3",options:[{label:n.formatMessage({id:"WIDGET_Display_Level_1"}),value:"1"},{label:n.formatMessage({id:"WIDGET_Display_Level_2"}),value:"2"},{label:n.formatMessage({id:"WIDGET_Display_Level_3"}),value:"3"},{label:n.formatMessage({id:"WIDGET_Display_Level_4"}),value:"4"}].filter((e=>Array.isArray(a.displayLevel)?a.displayLevel.includes(Number(e.value)):[]))})},Ge=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],ze=d.j.getLazyComponent("Icon"),De=d.j.getLazyComponent("Tooltip"),$e=({uniqid:e,position:t})=>{const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,o.useTheme)(),d=(0,i.useRef)(null),m=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),G.shallowEqual),g=c.x0.definition(null==m?void 0:m.name),p=(0,i.useMemo)((()=>void 0!==g.displayLevel&&Array.isArray(g.displayLevel)&&0!==g.displayLevel.length),[g]),f=(0,i.useMemo)((()=>[{name:"widget-title",label:n.formatMessage({id:"PANEL_Title"}),enable:g.panel.useWrapper,icon:"icon-font"},{name:"widget-selection",label:n.formatMessage({id:"PANEL_Widget_Selection"}),enable:g.panel.useSelection,icon:"icon-sliders"},{name:"widget-settings",label:n.formatMessage({id:"PANEL_Widget_Settings"}),enable:g.panel.useEditor,icon:"icon-pen"},{name:"widget-level",label:n.formatMessage({id:"PANEL_Widget_Level"}),enable:p,icon:"icon-edit"}]),[g,n,p]),E=(0,i.useMemo)((()=>g.panel.useEditor?f.find((e=>"widget-settings"===e.name)):f.filter((e=>e.enable))[0]),[g,f]),[h,b]=(0,i.useState)(E);return(0,i.useEffect)((()=>{setTimeout((()=>{d&&d.current&&(d.current.className=d.current.className+" animate")}),0)}),[]),m?l().createElement(F,null,l().createElement(R,{ref:d,position:t},l().createElement(N,null,f.map((e=>e.enable?l().createElement(De,{key:e.name,position:"left",description:e.label},l().createElement(Y,{isActive:h&&h.name===e.name,onClick:()=>b(e)},l().createElement(ze,{name:e.icon,color:h&&h.name===e.name?s.color.white:s.color.lavender}))):l().createElement(l().Fragment,null)))),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(D,null,l().createElement(he,{uniqid:e,position:m.position}),l().createElement(V,null,l().createElement("h3",null,h?h.label:n.formatMessage({id:g.label}))),l().createElement($,null,l().createElement(Y,{onClick:()=>{a(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(ze,{name:"icon-times",color:s.color.lavender,size:26.75})))),l().createElement(B,null,l().createElement(H,null,h&&"widget-settings"===h.name&&g.panel.useEditor&&l().createElement(fe,{uniqid:m.uniqid}),h&&"widget-title"===h.name&&g.panel.useWrapper&&l().createElement(qe,{uniqid:m.uniqid}),h&&"widget-selection"===h.name&&l().createElement(Ae,{uniqid:e}),h&&"widget-level"===h.name&&p&&l().createElement(Oe,{uniqid:e})),l().createElement(Se,{uniqid:e}),l().createElement(Me,{uniqid:e}),Ge.includes(m.name)&&l().createElement(Ie,{uniqid:e,mode:m.mode})))),(null==m?void 0:m.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},Ve=a().div`
159
162
  position: absolute;
160
163
  inset: 0;
161
164
  pointer-events: none;
@@ -173,7 +176,7 @@
173
176
  `,Be=a().div`
174
177
  width: ${440}px;
175
178
  pointer-events: none;
176
- `,He=()=>{const e=(0,u.GV)(c.cr.selectors.selectEditors,G.shallowEqual);return l().createElement(Ve,{className:"editor-portal-wrapper"},e.map(((e,t)=>"left"===e.position?l().createElement(z,{isActive:!1,key:t},l().createElement(Re,null,l().createElement($e,{uniqid:e.uniqid,position:e.position}),l().createElement(Fe,{isActive:void 0!==e.popup},l().createElement(K,{uniqid:e.uniqid})),l().createElement(Be,null))):l().createElement(z,{isActive:!1,key:t},l().createElement(Re,null,l().createElement(Be,null),l().createElement(Fe,{isActive:void 0!==e.popup},l().createElement(K,{uniqid:e.uniqid})),l().createElement($e,{uniqid:e.uniqid,position:e.position}))))))},Pe=d.j.getLazyComponent("ThemeProvider"),Ue=()=>{const e=document.getElementById("react-portals"),t=(0,i.useMemo)((()=>e&&(e=>{let t=document.getElementById("react-portals");return t||(t=document.createElement("div"),t.id=(0,O.A)(),e.appendChild(t)),t})(e)),[e]);return t?(0,A.createPortal)(l().createElement(Pe,null,l().createElement(He,null)),t):null},Ne=a().div`
179
+ `,He=()=>{const e=(0,u.jL)();(0,i.useEffect)((()=>{const t=()=>{e(c.cr.slice.actions.flushAllEditor())};return window.addEventListener("NGWidgetEditorFlushAll",t),()=>{window.removeEventListener("NGWidgetEditorFlushAll",t)}}),[e]);const t=(0,u.GV)(c.cr.selectors.selectEditors,G.shallowEqual);return l().createElement(Ve,{className:"editor-portal-wrapper"},t.map((e=>l().createElement(z,{isActive:!1,key:e.uniqid},l().createElement(Re,null,"left"===e.position?l().createElement(l().Fragment,null,l().createElement($e,{uniqid:e.uniqid,position:e.position}),l().createElement(Fe,{isActive:void 0!==e.popup},l().createElement(K,{uniqid:e.uniqid})),l().createElement(Be,null)):l().createElement(l().Fragment,null,l().createElement(Be,null),l().createElement(Fe,{isActive:void 0!==e.popup},l().createElement(K,{uniqid:e.uniqid})),l().createElement($e,{uniqid:e.uniqid,position:e.position})))))))},Pe=d.j.getLazyComponent("ThemeProvider"),Ue=()=>{const e=document.getElementById("react-portals"),t=(0,i.useMemo)((()=>e&&(e=>{let t=document.getElementById("react-portals");return t||(t=document.createElement("div"),t.id=(0,O.A)(),e.appendChild(t)),t})(e)),[e]);return t?(0,A.createPortal)(l().createElement(Pe,null,l().createElement(He,null)),t):null},Ne=a().div`
177
180
  display: flex;
178
181
  flex-direction: row;
179
182
  flex-wrap: wrap;
@@ -491,7 +494,7 @@
491
494
  display: flex;
492
495
  justify-content: center;
493
496
  align-items: center;
494
- `,ri={username:"",password:"",hostname:"",imapPort:993,imapMailbox:"",cardDavAddressBook:"",calDavCalendar:"",provider:""},si=({handleCallback:e})=>{const t=(0,r.useIntl)(),n=(0,G.useDispatch)(),[o,a]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1),{control:m,reset:g,setValue:p,getValues:f,watch:E,formState:{isValid:h}}=(0,be.useForm)({defaultValues:ri,criteriaMode:"all"}),[b,v]=(0,i.useState)([]),y=E(),C=(0,i.useCallback)((()=>{k().office.getConfiguration().then((({result:e})=>g(e)))}),[g]);(0,i.useEffect)((()=>{o&&(u(!0),k().office.getProviders().then((({result:e})=>v(e))).catch((e=>n(c.y8.actions.error({label:e.errorMsg})))).finally((()=>{u(!1),C()})))}),[o,n,C]),(0,i.useEffect)((()=>{1===b.length&&p("provider",b[0].id)}),[b,p]);const x=()=>a(!1);return l().createElement(l().Fragment,null,l().createElement(oi,null,l().createElement(Kn,{label:t.formatMessage({id:"Office_Set_Configuration"}),onClick:()=>a(!0)})),l().createElement(Qn,{open:o,radius:"small",closeHandler:x},l().createElement(Xn,{overflow:"scroll",title:t.formatMessage({id:"Office_Set_Configuration"}),onClickIconClose:x},d?l().createElement(s.JRCLoader,{size:"s"}):l().createElement(l().Fragment,null,0===b.length&&l().createElement(ai,null,t.formatMessage({id:"Office_No_Providers"})),l().createElement(li,{isLocked:0===b.length},b.length>1&&l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_Provider"})),b.length>1&&l().createElement(ci,{label:"OfficeHook_Conf_Select_Provider",initialValue:{label:b[0].label,value:b[0].id},options:b.map((e=>({label:e.label,value:e.id}))),handleChange:e=>{f("provider")!==e&&g(),p("provider",e)}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Settings"})),l().createElement(Zn,{control:m,name:"hostname",width:"400",placeholder:t.formatMessage({id:"OfficeHook_Conf_IMap_Hostname"}),rules:{required:!0}}),l().createElement(Zn,{control:m,name:"username",width:"400",placeholder:t.formatMessage({id:"OfficeHook_Conf_Username"}),rules:{required:!0}}),l().createElement(ni,{control:m,name:"password",width:"400",placeholder:t.formatMessage({id:"OfficeHook_Conf_Password"}),rules:{required:!0}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_IMap_Mailbox"})),l().createElement(ei,{control:m,name:"imapPort",width:"400",placeholder:t.formatMessage({id:"OfficeHook_Conf_IMap_Port"}),rules:{required:!0}}),l().createElement(Zn,{control:m,name:"imapMailbox",width:"400",placeholder:t.formatMessage({id:"OfficeHook_Conf_IMap_Mailbox"}),rules:{required:!0}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CalDav_Calendar"})),l().createElement(Zn,{control:m,name:"calDavCalendar",width:"400",placeholder:t.formatMessage({id:"OfficeHook_Conf_CalDav_Calendar"}),rules:{required:!0}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CardDav_Address_Book"})),l().createElement(Zn,{control:m,name:"cardDavAddressBook",width:"400",placeholder:t.formatMessage({id:"OfficeHook_Conf_CardDav_Address_Book"}),rules:{required:!0}})),l().createElement(Kn,{label:t.formatMessage({id:"OfficeHook_Conf_Prompt_Submit"}),loader:d,disabled:d||0===b.length||!h,onClick:()=>{d||(u(!0),k().office.setConfiguration(y).then((({result:e})=>{window.location.reload()})).catch((e=>n(c.y8.actions.error({label:e.errorMsg})))).finally((()=>{a(!1),u(!1),g()})))}})))))},ci=({label:e,initialValue:t,options:n,handleChange:o})=>{const{control:a,watch:r}=(0,be.useForm)({defaultValues:{provider:t},criteriaMode:"all"});return(0,i.useEffect)((()=>{const e=r((e=>{e.provider&&e.provider.value&&o(e.provider.value)}));return()=>e.unsubscribe()}),[r,o]),l().createElement(ti,{label:e,name:"provider",options:null!=n?n:[],getValue:e=>e.value,getLabel:"label",getSearch:"label",control:a,rules:{required:!0}})},di=a().div`
497
+ `,ri={username:"",password:"",hostname:"",imapPort:993,imapMailbox:"",cardDavAddressBook:"",calDavCalendar:"",provider:""},si=()=>{const e=(0,r.useIntl)(),t=(0,G.useDispatch)(),n=(0,s.useAbortController)(),[o,a]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1),{control:m,reset:g,setValue:p,getValues:f,watch:E,formState:{isValid:h}}=(0,be.useForm)({defaultValues:ri,criteriaMode:"all"}),[b,v]=(0,i.useState)([]),y=E(),C=(0,i.useCallback)((e=>{k().office.getConfiguration().then((({result:t})=>{var n;g(Object.assign(Object.assign({},t),{provider:e.includes(null!==(n=t.provider)&&void 0!==n?n:"")?t.provider:e[0]}))}))}),[g]);(0,i.useEffect)((()=>{o&&(u(!0),k().office.getProviders({signal:n.signal}).then((({result:e})=>{n.signal.aborted||(v(e),C(e.map((e=>e.id))))})).catch((e=>{n.signal.aborted||t(c.y8.actions.error({label:e.errorMsg}))})).finally((()=>{u(!1)})))}),[o,n.signal,t,C]),(0,i.useEffect)((()=>{1===b.length&&p("provider",b[0].id)}),[b,p]);const x=()=>a(!1);return l().createElement(l().Fragment,null,l().createElement(oi,null,l().createElement(Kn,{label:e.formatMessage({id:"Office_Set_Configuration"}),onClick:()=>a(!0)})),l().createElement(Qn,{open:o,radius:"small",closeHandler:x},l().createElement(Xn,{overflow:"scroll",title:e.formatMessage({id:"Office_Set_Configuration"}),onClickIconClose:x},d?l().createElement(s.JRCLoader,{size:"s"}):l().createElement(l().Fragment,null,0===b.length&&l().createElement(ai,null,e.formatMessage({id:"Office_No_Providers"})),l().createElement(li,{isLocked:0===b.length},b.length>1&&l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_Provider"})),b.length>1&&l().createElement(ci,{label:"OfficeHook_Conf_Select_Provider",initialValue:{label:b[0].label,value:b[0].id},options:b.map((e=>({label:e.label,value:e.id}))),handleChange:e=>{f("provider")!==e&&g(),p("provider",e)}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Settings"})),l().createElement(Zn,{control:m,name:"hostname",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Hostname"}),rules:{required:!0}}),l().createElement(Zn,{control:m,name:"username",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Username"}),rules:{required:!0}}),l().createElement(ni,{control:m,name:"password",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Password"}),rules:{required:!0}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_IMap_Mailbox"})),l().createElement(ei,{control:m,name:"imapPort",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Port"}),rules:{required:!0}}),l().createElement(Zn,{control:m,name:"imapMailbox",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Mailbox"}),rules:{required:!0}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CalDav_Calendar"})),l().createElement(Zn,{control:m,name:"calDavCalendar",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CalDav_Calendar"}),rules:{required:!0}}),l().createElement(ii,{size:"s"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CardDav_Address_Book"})),l().createElement(Zn,{control:m,name:"cardDavAddressBook",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CardDav_Address_Book"}),rules:{required:!0}})),l().createElement(Kn,{label:e.formatMessage({id:"OfficeHook_Conf_Prompt_Submit"}),loader:d,disabled:d||0===b.length||!h,onClick:()=>{d||(u(!0),k().office.setConfiguration(y).then((()=>window.location.reload())).catch((e=>t(c.y8.actions.error({label:e.errorMsg})))).finally((()=>{a(!1),u(!1),g()})))}})))))},ci=({label:e,initialValue:t,options:n,handleChange:o})=>{const{control:a,watch:r}=(0,be.useForm)({defaultValues:{provider:t},criteriaMode:"all"});return(0,i.useEffect)((()=>{const e=r((e=>{e.provider&&e.provider.value&&o(e.provider.value)}));return()=>e.unsubscribe()}),[r,o]),l().createElement(ti,{label:e,name:"provider",options:null!=n?n:[],getValue:e=>e.value,getLabel:"label",getSearch:"label",control:a,rules:{required:!0}})},di=a().div`
495
498
  padding: ${e=>e.theme.space.md}px;
496
499
  padding-right: 0px;
497
500
  `,ui=a().div`
@@ -535,12 +538,12 @@
535
538
  display: flex;
536
539
  flex-direction: column;
537
540
  padding: ${e=>e.padding};
538
- `,Li=({uniqid:e,children:t})=>{const n=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),G.shallowEqual),o=(0,i.useMemo)((()=>({padding:n&&n.padding?String(n.padding):"0"})),[n]);return l().createElement(Wi,{padding:o.padding},t)},_i=d.j.getLazyComponent("WidgetContactCardDav"),qi=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(void 0),[g,p]=(0,i.useState)(!1),f=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),G.shallowEqual),[E,h]=(0,i.useState)([]),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ri),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{m(e.dav_address_book_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((()=>{k().office.davAddressBookGetContacts({limit:10}).then((({result:e})=>{h(e),p(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!g)return;if(!r)return;if(f!==w.WIDGET_LEVEL_3)return;const e=setInterval(x,4e3);return()=>clearInterval(e)}),[r,x,g,f]),(0,i.useEffect)((()=>{y(!0),k().office.isConfigurationValid().then((({result:e})=>v(e))).catch(b).finally((()=>y(!1)))}),[v,f,C,y,b]),(0,i.useEffect)((()=>{if(r)return f===w.WIDGET_LEVEL_1?(y(!0),void C()):void x()}),[r,C,y,x,f]),r&&f&&f!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(f,null!=d?d:"")):l().createElement(ki,{header:()=>l().createElement(l().Fragment,null,l().createElement(yi,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Li,{uniqid:o},r&&l().createElement(_i,{contactCardList:E}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(si,{handleCallback:v}))})},ji=d.j.getLazyComponent("ButtonDropdown"),Si=d.j.getLazyComponent("Tooltip"),Mi=a().div`
541
+ `,Li=({uniqid:e,children:t})=>{const n=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),G.shallowEqual),o=(0,i.useMemo)((()=>({padding:n&&n.padding?String(n.padding):"0"})),[n]);return l().createElement(Wi,{padding:o.padding},t)},_i=d.j.getLazyComponent("WidgetContactCardDav"),qi=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(void 0),[g,p]=(0,i.useState)(!1),f=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),G.shallowEqual),[E,h]=(0,i.useState)([]),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ri),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{m(e.dav_address_book_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((()=>{k().office.davAddressBookGetContacts({limit:10}).then((({result:e})=>{h(e),p(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!g)return;if(!r)return;if(f!==w.WIDGET_LEVEL_3)return;const e=setInterval(x,4e3);return()=>clearInterval(e)}),[r,x,g,f]),(0,i.useEffect)((()=>{y(!0),k().office.isConfigurationValid().then((({result:e})=>v(e))).catch(b).finally((()=>y(!1)))}),[v,f,C,y,b]),(0,i.useEffect)((()=>{if(r)return f===w.WIDGET_LEVEL_1?(y(!0),void C()):void x()}),[r,C,y,x,f]),r&&f&&f!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(f,null!=d?d:"")):l().createElement(ki,{header:()=>l().createElement(l().Fragment,null,l().createElement(yi,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Li,{uniqid:o},r&&l().createElement(_i,{contactCardList:E}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(si,null))})},ji=d.j.getLazyComponent("ButtonDropdown"),Si=d.j.getLazyComponent("Tooltip"),Mi=a().div`
539
542
  margin-right: ${e=>e.theme.space.sm}px;
540
543
  button {
541
544
  background: ${e=>e.theme.color.white};
542
545
  }
543
- `,Ti=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,G.useDispatch)(),a=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(ri).finally(n)}}];return l().createElement(Ei,{uniqid:e,dropdown:()=>t&&l().createElement(Mi,null,l().createElement(Si,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(ji,{small:!0,smallOpenDirection:"left",options:a,icon:"icon-edit",label:"",color:"primary",variant:"outlined"})))})},Ii=d.j.getLazyComponent("WidgetCalendarCalDav"),Ai=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,d]=(0,i.useState)(void 0),[m,g]=(0,i.useState)(!1),p=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),G.shallowEqual),{moment:f}=(0,s.useMoment)(),[E,h]=(0,i.useState)(void 0),[b,v]=(0,i.useState)([]),y=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ri),t?window.location.reload():(d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),C=(0,i.useCallback)((e=>{d(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),x=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),W=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{h(e.dav_calendar_url)})).finally((()=>x(!1)))}),[x]),L=(0,i.useCallback)((()=>{k().office.davCalendarGetEvents({limit:10,dateStart:f().format("YYYY-MM-DD hh:mm:ss"),dateEnd:f(f()).add(1,"M").format("YYYY-MM-DD hh:mm:ss")}).then((({result:e})=>{v(e),g(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>x(!1)))}),[x,a,o,f]);return(0,i.useEffect)((()=>{if(!m)return;if(!r)return;if(p!==w.WIDGET_LEVEL_3)return;const e=setInterval(L,6e4);return()=>clearInterval(e)}),[r,L,m,p]),(0,i.useEffect)((()=>{x(!0),k().office.isConfigurationValid().then((({result:e})=>C(e))).catch(y)}),[y,x,C]),(0,i.useEffect)((()=>{if(r)return p===w.WIDGET_LEVEL_1?(x(!0),void W()):void L()}),[r,W,x,L,f,p]),r&&p&&p!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(p,null!=E?E:"")):l().createElement(ki,{header:()=>l().createElement(l().Fragment,null,l().createElement(Ti,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>y(void 0,!0)})),scrollable:()=>l().createElement(Li,{uniqid:o},r&&l().createElement(Ii,{calendarListEvent:b}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(si,{handleCallback:C}))})},Oi=d.j.getLazyComponent("ButtonDropdown"),Gi=d.j.getLazyComponent("Tooltip"),zi=a().div`
546
+ `,Ti=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,G.useDispatch)(),a=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(ri).finally(n)}}];return l().createElement(Ei,{uniqid:e,dropdown:()=>t&&l().createElement(Mi,null,l().createElement(Si,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(ji,{small:!0,smallOpenDirection:"left",options:a,icon:"icon-edit",label:"",color:"primary",variant:"outlined"})))})},Ii=d.j.getLazyComponent("WidgetCalendarCalDav"),Ai=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,d]=(0,i.useState)(void 0),[m,g]=(0,i.useState)(!1),p=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),G.shallowEqual),{moment:f}=(0,s.useMoment)(),[E,h]=(0,i.useState)(void 0),[b,v]=(0,i.useState)([]),y=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ri),t?window.location.reload():(d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),C=(0,i.useCallback)((e=>{d(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),x=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),W=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{h(e.dav_calendar_url)})).finally((()=>x(!1)))}),[x]),L=(0,i.useCallback)((()=>{k().office.davCalendarGetEvents({limit:10,dateStart:f().format("YYYY-MM-DD hh:mm:ss"),dateEnd:f(f()).add(1,"M").format("YYYY-MM-DD hh:mm:ss")}).then((({result:e})=>{v(e),g(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>x(!1)))}),[x,a,o,f]);return(0,i.useEffect)((()=>{if(!m)return;if(!r)return;if(p!==w.WIDGET_LEVEL_3)return;const e=setInterval(L,6e4);return()=>clearInterval(e)}),[r,L,m,p]),(0,i.useEffect)((()=>{x(!0),k().office.isConfigurationValid().then((({result:e})=>C(e))).catch(y)}),[y,x,C]),(0,i.useEffect)((()=>{if(r)return p===w.WIDGET_LEVEL_1?(x(!0),void W()):void L()}),[r,W,x,L,f,p]),r&&p&&p!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(p,null!=E?E:"")):l().createElement(ki,{header:()=>l().createElement(l().Fragment,null,l().createElement(Ti,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>y(void 0,!0)})),scrollable:()=>l().createElement(Li,{uniqid:o},r&&l().createElement(Ii,{calendarListEvent:b}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(si,null))})},Oi=d.j.getLazyComponent("ButtonDropdown"),Gi=d.j.getLazyComponent("Tooltip"),zi=a().div`
544
547
  margin-right: ${e=>e.theme.space.sm}px;
545
548
  button {
546
549
  background: ${e=>e.theme.color.white};
@@ -548,7 +551,7 @@
548
551
  `,Di=a().div`
549
552
  font-size: ${e=>e.theme.size.sm+4}px;
550
553
  color: ${e=>e.color};
551
- `,$i=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,u.jL)(),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetChipCount(t,e)),G.shallowEqual),s=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(ri).finally(n)}}];return l().createElement(Ei,{uniqid:e,dropdown:()=>t&&l().createElement(zi,null,l().createElement(Gi,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(Oi,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-edit",label:"",color:"primary",variant:"outlined"}))),subHeader:e=>t&&0!==a&&l().createElement(Di,{color:e},"(",i.formatMessage({id:"WIDGET_Email_IMAP_Unread_Emails"},{count:a}),")")})},Vi=d.j.getLazyComponent("WidgetEmailsImap"),Fi=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(!1),[g,p]=(0,i.useState)([]),[f,E]=(0,i.useState)(void 0),h=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e.uniqid)),G.shallowEqual),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ri),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((()=>{k().office.imapInboxGetUnreadEmailsCount().then((({result:e})=>{a(c.x0.slice.actions.setWidgetChipCount({uniqid:o,count:e})),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))})).catch(b)}),[a,o,b]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{E(e.imap_inbox_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),W=(0,i.useCallback)((()=>{k().office.imapInboxGetEmails({limit:10}).then((({result:e})=>{p(e),m(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!d)return;if(!r)return;if(h===w.WIDGET_LEVEL_1)return;const e=setInterval((()=>{h===w.WIDGET_LEVEL_2&&v(),h===w.WIDGET_LEVEL_3&&(v(),W())}),6e4);return()=>clearInterval(e)}),[r,W,d,v,h]),(0,i.useEffect)((()=>{k().office.isConfigurationValid().then((({result:e})=>x(e))).catch(b)}),[x,b]),(0,i.useEffect)((()=>{if(r){if(h===w.WIDGET_LEVEL_1)return y(!0),void C();if(h===w.WIDGET_LEVEL_2)return y(!0),v(),void C();y(!0),v(),W()}}),[r,h,C,W,y,v,a]),r&&h&&h!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(h,null!=f?f:"")):l().createElement(ki,{header:()=>l().createElement(l().Fragment,null,l().createElement($i,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Li,{uniqid:o},void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(si,{handleCallback:x}),r&&l().createElement(Vi,{emailList:g}))})},Ri=a().div`
554
+ `,$i=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,u.jL)(),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetChipCount(t,e)),G.shallowEqual),s=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(ri).finally(n)}}];return l().createElement(Ei,{uniqid:e,dropdown:()=>t&&l().createElement(zi,null,l().createElement(Gi,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(Oi,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-edit",label:"",color:"primary",variant:"outlined"}))),subHeader:e=>t&&0!==a&&l().createElement(Di,{color:e},"(",i.formatMessage({id:"WIDGET_Email_IMAP_Unread_Emails"},{count:a}),")")})},Vi=d.j.getLazyComponent("WidgetEmailsImap"),Fi=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(!1),[g,p]=(0,i.useState)([]),[f,E]=(0,i.useState)(void 0),h=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e.uniqid)),G.shallowEqual),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ri),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((()=>{k().office.imapInboxGetUnreadEmailsCount().then((({result:e})=>{a(c.x0.slice.actions.setWidgetChipCount({uniqid:o,count:e})),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))})).catch(b)}),[a,o,b]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{E(e.imap_inbox_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),W=(0,i.useCallback)((()=>{k().office.imapInboxGetEmails({limit:10}).then((({result:e})=>{p(e),m(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!d)return;if(!r)return;if(h===w.WIDGET_LEVEL_1)return;const e=setInterval((()=>{h===w.WIDGET_LEVEL_2&&v(),h===w.WIDGET_LEVEL_3&&(v(),W())}),6e4);return()=>clearInterval(e)}),[r,W,d,v,h]),(0,i.useEffect)((()=>{k().office.isConfigurationValid().then((({result:e})=>x(e))).catch(b)}),[x,b]),(0,i.useEffect)((()=>{if(r){if(h===w.WIDGET_LEVEL_1)return y(!0),void C();if(h===w.WIDGET_LEVEL_2)return y(!0),v(),void C();y(!0),v(),W()}}),[r,h,C,W,y,v,a]),r&&h&&h!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(h,null!=f?f:"")):l().createElement(ki,{header:()=>l().createElement(l().Fragment,null,l().createElement($i,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Li,{uniqid:o},void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(si,null),r&&l().createElement(Vi,{emailList:g}))})},Ri=a().div`
552
555
  padding: ${e=>e.theme.space.md}px;
553
556
  border-bottom: 1px solid ${e=>e.theme.color.grey1};
554
557
  `,Bi=({uniqid:e})=>{var t;const n=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),G.shallowEqual);return l().createElement(l().Fragment,null,n&&"string"==typeof n.title&&0!==n.title.length&&l().createElement(Ri,null,l().createElement(s.JRCHtml,{__html:null!==(t=n.title)&&void 0!==t?t:""})))},Hi=({uniqid:e})=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),o=(0,u.GV)((t=>{var n;return null===(n=c.x0.selectors.selectWidget(t,e))||void 0===n?void 0:n.title}),G.shallowEqual),{control:a,watch:d}=(0,be.useForm)({defaultValues:{widgetTitle:o},criteriaMode:"all"});return(0,i.useEffect)((()=>{const t=d((t=>{n(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.widgetTitle}))}));return()=>t.unsubscribe()}),[d,n,e]),l().createElement(s.JRCInputText,{name:"widgetTitle",control:a,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},Pi=d.j.getLazyComponent("Button"),Ui=d.j.getLazyComponent("ModalLayout"),Ni=d.j.getLazyComponent("ModalContent"),Yi=a().div`
@@ -599,7 +602,7 @@
599
602
  }
600
603
 
601
604
  ${(0,s.DashedFocusBorder)()}
602
- `,dl=({uniqid:e,name:t})=>{const n=(0,u.jL)(),o=(0,r.useIntl)(),a=(0,u.GV)((t=>{var n;return null===(n=c.x0.selectors.selectWidgetState(t,e))||void 0===n?void 0:n.initialized})),d=(0,i.useCallback)((()=>{a&&n(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))}),[n,e,a,t]),m=c.x0.definition(t);return a?l().createElement(cl,{onClick:d},l().createElement(s.JRCHtml,{__html:`${o.formatMessage({id:"WIDGET_Set_Widget"})} <b>${o.formatMessage({id:m.label})}</b>`})):l().createElement(l().Fragment,null)},ul=d.j.getLazyComponent("WidgetIcon"),ml=a().a`
605
+ `,dl=({uniqid:e,name:t})=>{const n=(0,u.jL)(),o=(0,r.useIntl)(),a=(0,u.GV)((t=>{var n;return null===(n=c.x0.selectors.selectWidgetState(t,e))||void 0===n?void 0:n.initialized})),d=(0,i.useCallback)((()=>{a&&(n(c.cr.slice.actions.flushAllEditor()),n(c.cr.slice.actions.registerEditor({uniqid:e,name:t})))}),[n,e,a,t]),m=c.x0.definition(t);return a?l().createElement(cl,{onClick:d},l().createElement(s.JRCHtml,{__html:`${o.formatMessage({id:"WIDGET_Set_Widget"})} <b>${o.formatMessage({id:m.label})}</b>`})):l().createElement(l().Fragment,null)},ul=d.j.getLazyComponent("WidgetIcon"),ml=a().a`
603
606
  position: absolute;
604
607
  top: 0;
605
608
  right: 0;
@@ -624,7 +627,7 @@
624
627
  border-width: ${e=>e.borderWidth}px;
625
628
  border-radius: ${e=>e.borderRadius}px;
626
629
  overflow: ${e=>e.overflow};
627
- `,fl=l().forwardRef((({uniqid:e,onClick:t,children:n})=>{const a=(0,o.useTheme)(),r=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),G.shallowEqual),s=(0,i.useMemo)((()=>({color:r&&r.color?String(r.color):a.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):a.color.white,borderRadius:r&&r["border-radius"]?String(r["border-radius"]):"0",borderColor:r["border-color"]?String(r["border-color"]):a.color.black,borderWidth:r["border-width"]?String(r["border-width"]):"0",borderStyle:r["border-style"]?String(r["border-style"]):"none"})),[r,a]);return l().createElement(pl,{onClick:t,backgroundColor:s.backgroundColor,borderColor:s.borderColor,borderStyle:s.borderStyle,borderRadius:s.borderRadius,overflow:Number(s.borderRadius)>0?"hidden":"initial",borderWidth:s.borderWidth},n)})),El=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:a,width:r,onWidgetUpdate:s,cannotDisplayComponent:d,dataCy:m})=>{const g=(0,u.jL)(),p=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),f=(0,u.GV)((t=>t.widgets.editableMap[e]),G.shallowEqual),E=(0,u.GV)((e=>e.widgets.currentEditableWidgetId),G.shallowEqual),h=(0,u.GV)((t=>t.widgets.currentEditableWidgetId===e),G.shallowEqual),{ref:b,isComponentVisible:v,setIsComponentVisible:y}=(0,st.xv)(!1);if((0,i.useEffect)((()=>{t&&g(c.x0.slice.actions.registerWidgetObject({uniqid:e,object:t}))}),[]),(0,i.useEffect)((()=>{n&&g(c.x0.slice.actions.registerWidget({uniqid:e,widget:n}))}),[]),(0,i.useEffect)((()=>{v||e===E&&g(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[v]),(0,i.useEffect)((()=>{v!==h&&y(h)}),[h]),void 0===p)return l().createElement(l().Fragment,null,"This widget cannot be displayed");const C=p.widget,x=()=>{"edit"===a?k():(0,w.ensureWidgetArticleButtonType)(C)&&"link"===C.content.openingType&&C.content.openingTypeLink&&window.open(C.content.openingTypeLink.url,C.content.openingTypeLink.target)},k=()=>{if("view"===a)return;const{widget:e}=p;g(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return o&&"view"!==a?l().createElement(fl,{uniqid:e,ref:b,onClick:()=>{y(!0),f&&(g(c.x0.slice.actions.setEditableIndex({index:f.index})),g(c.x0.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(el,{dataCy:m,width:r,widget:Object.assign(Object.assign({},p.widget),p.title&&{title:p.title}),inplace:o,mode:a,onClick:x,levelFallback:(e,t)=>e<=2&&l().createElement(gl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(il,{uniqid:e,mode:a}),"edit"===a&&l().createElement(dl,{uniqid:e,name:n.widget.name}),l().createElement(sl,{name:p.widget.name,uniqid:p.widget.uniqid,inplace:o})):l().createElement(fl,{uniqid:e,onClick:k},l().createElement(el,{dataCy:m,widget:Object.assign(Object.assign({},p.widget),p.title&&{title:p.title}),inplace:o,mode:a,width:r,onClick:x,onWidgetUpdate:s,cannotDisplayComponent:d,levelFallback:(e,t)=>e<=2&&l().createElement(gl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(il,{uniqid:e,mode:a}),l().createElement(sl,{name:p.widget.name,uniqid:p.widget.uniqid,inplace:o}))},hl=El,bl=a().div`
630
+ `,fl=({uniqid:e,onClick:t,children:n})=>{const a=(0,o.useTheme)(),r=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),G.shallowEqual),s=(0,i.useMemo)((()=>({color:r&&r.color?String(r.color):a.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):a.color.white,borderRadius:r&&r["border-radius"]?String(r["border-radius"]):"0",borderColor:r["border-color"]?String(r["border-color"]):a.color.black,borderWidth:r["border-width"]?String(r["border-width"]):"0",borderStyle:r["border-style"]?String(r["border-style"]):"none"})),[r,a]);return l().createElement(pl,{onClick:t,backgroundColor:s.backgroundColor,borderColor:s.borderColor,borderStyle:s.borderStyle,borderRadius:s.borderRadius,overflow:Number(s.borderRadius)>0?"hidden":"initial",borderWidth:s.borderWidth},n)},El=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:a,width:r,onWidgetUpdate:s,cannotDisplayComponent:d,dataCy:m})=>{const g=(0,u.jL)(),p=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),f=(0,u.GV)((t=>t.widgets.editableMap[e]),G.shallowEqual),E=(0,u.GV)((e=>e.widgets.currentEditableWidgetId),G.shallowEqual),h=(0,u.GV)((t=>t.widgets.currentEditableWidgetId===e),G.shallowEqual),{isComponentVisible:b,setIsComponentVisible:v}=(0,st.xv)(!1);(0,i.useEffect)((()=>{t&&g(c.x0.slice.actions.registerWidgetObject({uniqid:e,object:t}))}),[]),(0,i.useEffect)((()=>{n&&g(c.x0.slice.actions.registerWidget({uniqid:e,widget:n}))}),[]),(0,i.useEffect)((()=>{b||e===E&&g(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[b]),(0,i.useEffect)((()=>{b!==h&&v(h)}),[h]);const y=(0,i.useCallback)((()=>{if(void 0===p||"view"===a)return;g(c.cr.slice.actions.flushAllEditor());const{widget:e}=p;g(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[g,a,p]);return void 0===p?l().createElement(l().Fragment,null,"This widget cannot be displayed"):o&&"view"!==a?l().createElement(fl,{uniqid:e,onClick:()=>{v(!0),f&&(g(c.x0.slice.actions.setEditableIndex({index:f.index})),g(c.x0.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(el,{dataCy:m,width:r,widget:Object.assign(Object.assign({},p.widget),p.title&&{title:p.title}),inplace:o,mode:a,levelFallback:(e,t)=>e<=2&&l().createElement(gl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(il,{uniqid:e,mode:a}),"edit"===a&&l().createElement(dl,{uniqid:e,name:n.widget.name}),l().createElement(sl,{name:p.widget.name,uniqid:p.widget.uniqid,inplace:o})):l().createElement(fl,{uniqid:e,onClick:y},l().createElement(el,{dataCy:m,widget:Object.assign(Object.assign({},p.widget),p.title&&{title:p.title}),inplace:o,mode:a,width:r,onWidgetUpdate:s,cannotDisplayComponent:d,levelFallback:(e,t)=>e<=2&&l().createElement(gl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(il,{uniqid:e,mode:a}),l().createElement(sl,{name:p.widget.name,uniqid:p.widget.uniqid,inplace:o}))},hl=El,bl=a().div`
628
631
  border-radius: ${e=>e.theme.space.sm}px;
629
632
  border: 1px solid ${e=>e.theme.color.grey1};
630
633
  background-color: ${e=>e.theme.color.white};
@@ -648,4 +651,4 @@
648
651
  `,Tl=(0,i.forwardRef)(((e,t)=>e.onSubmit?l().createElement(Ml,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t,"data-cy":e.dataCy},e.children):l().createElement(Sl,{stretch:e.stretch,ref:t,"data-cy":e.dataCy},e.children))),Il=a().div`
649
652
  ${e=>e.stretch&&"\n flex: 1;\n"}
650
653
  `,Al=(0,i.forwardRef)(((e,t)=>{const n=(0,i.useRef)(null),[o,a]=(0,_l.SC)(e.fields,e.type,e.forceMandatory),r=(0,be.useForm)({defaultValues:Object.assign(Object.assign({},a),e.defaultValues),criteriaMode:"all"}),{handleSubmit:s,control:c,reset:d}=r,u=ql(r,["handleSubmit","control","reset"]),m=(0,i.useCallback)((e=>{const t={};return Object.keys(e).forEach((n=>{var i;const l=null===(i=o.find((e=>e.name===n)))||void 0===i?void 0:i.widget;switch(null==l?void 0:l.type){case"audience":t[n]=e[n].map((e=>e.uri)).join(",");break;case"taxonomy":t[n]=e[n].map((e=>e.title)).join(",");break;case"toggle":t[n]=e[n]?"1":"0";break;default:t[n]=e[n]}})),t}),[o]);return(0,i.useImperativeHandle)(t,(()=>Object.assign(Object.assign({},u),{handleSubmit:s,control:c,reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),d()},getFormattedValues:()=>m(u.getValues())})),[]),l().createElement(Tl,{dataCy:e.dataCy,stretch:e.stretch,onSubmit:e.onSubmit?s(e.onSubmit):void 0,ref:n},l().createElement(Il,{stretch:e.stretch},o.map((t=>{var{Input:n}=t,i=ql(t,["Input"]);return l().createElement(n,Object.assign({key:i.name,control:c},i,{dataCy:`${e.dataCy}-${i.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(c)),e.buttons)})),Ol=()=>l().createElement(l().Fragment,null);var Gl=n(286);const zl=()=>{const[e,t]=(0,i.useState)(),n=(0,r.useIntl)(),l=(0,i.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),o=(0,i.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:n=>{e.reject(n),t(void 0)},resolve:n=>{e.resolve(n),t(void 0)}}))}),[]),a=(0,i.useCallback)(((e,t)=>new Promise(((n,i)=>{o({reject:i,resolve:n,text:e,capability:t})}))),[o]),c=(0,i.useMemo)((()=>({develop:e=>a(e,"develop"),summarize:e=>a(e,"summarize"),tldr:e=>a(e,"tldr"),en:e=>a(e,"en"),es:e=>a(e,"es"),formal:e=>a(e,"formal"),funny:e=>a(e,"funny")})),[a]);return{query:e,ext:(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.jia(c,n)),[n,c]),isActive:l}},Dl=d.j.getLazyComponent("InputTinyMCE"),$l=e=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),a=(0,o.useTheme)(),s=(0,u.GV)(c.Kx.selectors.selectAll),{query:d,ext:m,isActive:g}=zl(),{open:p,onInsert:f,close:E,ext:h,isActive:b}=Rt(),v=(0,i.useMemo)((()=>[...b?[h]:[],...g?[m]:[]]),[m,h,g,b]),y=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),C=(0,i.useMemo)((()=>(0,Ft.X)(s,a,y)),[s,y,a]),x=(0,i.useMemo)((()=>Gl.p9),[]);return l().createElement(l().Fragment,null,x&&l().createElement(Dl,Object.assign({commonOptions:x,additionalExtensions:v,mentionsQueries:C},e)),g&&l().createElement(M,{query:d}),b&&l().createElement(Ut,{onInsert:f,open:p,close:E}))},Vl=d.j.getLazyComponent("InputTinyMCERaw"),Fl=e=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),a=(0,o.useTheme)(),s=(0,u.GV)(c.Kx.selectors.selectAll),{query:d,ext:m,isActive:g}=zl(),{open:p,onInsert:f,close:E,ext:h,isActive:b}=Rt(),v=(0,i.useMemo)((()=>[...b?[h]:[],...g?[m]:[]]),[m,h,g,b]),y=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),C=(0,i.useMemo)((()=>(0,Ft.X)(s,a,y)),[s,y,a]),x=(0,i.useMemo)((()=>Gl.p9),[]);return l().createElement(l().Fragment,null,x&&l().createElement(Vl,Object.assign({commonOptions:x,additionalExtensions:v,mentionsQueries:C},e)),g&&l().createElement(M,{query:d}),b&&l().createElement(Ut,{onInsert:f,open:p,close:E}))},Rl=d.j.getLazyComponent("InputAudience"),Bl=d.j.getLazyComponent("Message"),Hl=d.j.getLazyComponent("Modal"),Pl=({open:e,closeHandler:t,title:n,control:i,warningMessage:o,onSubmit:a,name:s="publishTo"})=>{const d=(0,r.useIntl)(),m=(0,u.GV)(c.Bx.selectors.selectNetworkPublic);return l().createElement(Hl,{open:e,closeHandler:t,title:null!=n?n:d.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),a()}}]},l().createElement(Bl,{variant:"warning",message:null!=o?o:d.formatMessage({id:"FORM_Audience_Empty"})}),l().createElement(Rl,{asyncPromise:e=>k().audience.autocomplete(e),searchable:!0,control:i,multiple:!0,placeholder:d.formatMessage({id:"GLOBAL_Audience"}),name:s,defaultCustomOptions:m?[{uri:m.uri,title:m.title,resetOptions:!0,icon:"icon-fs-wall"}]:[]}))};var Ul=n(737);const Nl=d.j.getLazyComponent("Container"),Yl=d.j.getLazyComponent("AppColumn"),Jl=d.j.getLazyComponent("MainColumn");function Ql({extensionRoute:e,routes:t,description:n,mode:o="center"}){var a;const s=(0,r.useIntl)(),{pathname:c}=(0,Ul.useLocation)(),d=(0,i.useMemo)((()=>Object.values(t)),[t]),[u,m]=(0,i.useState)(null===(a=null==d?void 0:d[0])||void 0===a?void 0:a.key),g=d.map((t=>Object.assign(Object.assign({},t),{label:s.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?s.formatMessage({id:t.group}):void 0})));return(0,i.useEffect)((()=>{const t=d.find((t=>{var n;return`/ng/rr/${e}/${t.path}`===c||(null===(n=t.paths)||void 0===n?void 0:n.reduce(((t,n)=>{const i=`/ng/rr/${e}/${n}`,l=null!==(0,Ul.matchPath)(i,c);return t||l}),!1))}));t&&m(t.key)}),[c,d,e]),l().createElement(i.Suspense,{fallback:l().createElement(l().Fragment,null)},l().createElement(Nl,{mode:o},l().createElement(Yl,{mode:o,description:n,tabs:g,activeTab:u||""}),l().createElement(Jl,{mode:o,flex:!0},l().createElement(Ul.Outlet,null))))}}}]);
651
- //# sourceMappingURL=435.8fff25978e742bb78f49.chunk.js.map
654
+ //# sourceMappingURL=435.ea8eca2f117abb78e1db.chunk.js.map