"use strict";(self.webpackChunkuniweb_builder=self.webpackChunkuniweb_builder||[]).push([[93176],{21762:(e,t,n)=>{n.d(t,{Z:()=>hn});var r=n(11129),a=n.n(r);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s,u,m,d,f,g=n(71554),p=n(88609),h=n(71890),b=n(705),v=n(25389),w=n(70460),y=n(55863),x=n(11573),E=n(69415),N=n(67900),C=n(41068),k=n(71578),S=n(15626),A=n(19152),j=n(67658),O=n(37585),_=n(8591);function L(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function I(e){var t=e.tools,n=void 0===t?[]:t,r=e.id,l=void 0===r?"":r,i=e.width,o=void 0===i?"w-4":i,c=e.height,g=void 0===c?"h-4":c,p=n[0].icon,h="group-".concat(l);return a().createElement(_.ZP,{trigger:a().createElement("div",{id:l,tabIndex:"0",className:(0,N.tw)(s||(s=L(["flex items-center space-x-0 focus:outline-none ",""])),h)},a().createElement(p,{className:(0,N.tw)(u||(u=L([""," "," text-gray-500 ","-hover:text-gray-700"])),o,g,h)}),a().createElement(j.w4J,{className:(0,N.tw)(m||(m=L([""," "," scale-75 text-gray-400 ","-hover:(text-gray-600)"])),o,g,h)})),options:n.map((function(e){var t=e.icon,n=e.onClick,r=e.isActive,l=e.name,i=e.disabled,o=e.id;return a().createElement(_.J2.Button,{key:l},a().createElement("div",{id:o,onMouseDown:n,className:(0,N.tw)(d||(d=L(["w-7 h-7 p-1.5 text-gray-500 hover:(text-gray-700) ",""])),r?"bg-blue-100":""),disabled:i},a().createElement(t,{className:(0,N.tw)(f||(f=L(["w-full h-full"])))})))})),width:"w-7",menuClassName:"!shadow-md !divide-y-0 !space-y-0",attachToDocumentBody:!0,placement:"bottom",offset:[0,3]})}var T,M,z,P,R,H,B,D,U,Z,F,J,W,q,$,Q,Y,G,V,K,X,ee,te,ne,re,ae,le,ie,oe,ce,se,ue,me,de,fe,ge,pe,he,be,ve,we,ye,xe,Ee,Ne,Ce,ke,Se,Ae,je,Oe,_e,Le,Ie,Te,Me,ze,Pe,Re,He,Be,De,Ue,Ze,Fe=n(17710),Je=n(46248),We=n(8053);function qe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$e(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ye=function(e){var t=e.label,n=e.description,r=e.placement,l=void 0===r?"right-start":r;return n||t?a().createElement(Je.Z,{children:a().createElement("div",{className:(0,N.tw)(T||(T=Qe(["px-1.5 py-1 text-sm"])))},a().createElement("p",{className:(0,N.tw)(M||(M=Qe(["font-semibold mb-0.5"])))},t),a().createElement("div",{dangerouslySetInnerHTML:{__html:n}})),triggerElement:a().createElement("div",null,a().createElement(A.UYI,{className:(0,N.tw)(z||(z=Qe(["h-5 w-5 cursor-help text-gray-300 hover:text-gray-500"])))})),hideArrow:!0,tooltipConfig:{placement:l,delayHide:150,delayShow:0,trigger:"hover",offset:[0,8]}}):null},Ge=function(e){var t=e.editor,n=e.mode,l=e.setMode,i=e.statusMenu,o=e.actionMenu,c=e.label,s=e.description,u=e.isLocalStr,m="bg-blue-200 !text-gray-700",d="".concat("fullScreen"===n?"w-5 h-5":"w-4 h-4"," text-gray-500 hover:(text-gray-700)"),f=(0,We.NC)({en:"Bold",fr:"Gras"}),g=(0,We.NC)({en:"Italic",fr:"Italique"}),p=(0,We.NC)({en:"Underline",fr:"Souligner"}),h=(0,We.NC)({en:"Subscript",fr:"Subscript"}),b=(0,We.NC)({en:"Superscript",fr:"Superscript"}),v=(0,We.NC)({en:"Align left",fr:"Aligner à gauche"}),w=(0,We.NC)({en:"Align center",fr:"Aligner le centre"}),y=(0,We.NC)({en:"Align right",fr:"Aligner à droite"}),x=(0,We.NC)({en:"Align justify",fr:"Alignement justifié"}),E=(0,We.NC)({en:"Bullet list",fr:"Liste à puces"}),A=(0,We.NC)({en:"Ordered list",fr:"Liste ordonnée"}),_=(0,We.NC)({en:"Indent",fr:"Indentation"}),L=(0,We.NC)({en:"Outdent",fr:"Outdent"}),T=(0,We.NC)({en:"Horizontal line",fr:"Ligne horizontale"}),M=(0,We.NC)({en:"Add link",fr:"Ajouter un lien"}),z=(0,We.NC)({en:"Remove link",fr:"Supprimer le lien"}),ge=(0,We.NC)({en:"Insert a image",fr:"Insérer une image"}),pe=(0,We.NC)({en:"Inset a YouTube video",fr:"Insérer une vidéo YouTube"}),he=(0,We.NC)({en:"Enter YouTube URL",fr:"Entrez l'URL de YouTube"}),be=(0,We.NC)({en:"Clear format",fr:"Effacer le format"}),ve=(0,We.NC)({en:"Undo",fr:"Annuler"}),we=(0,We.NC)({en:"Redo",fr:"Refaire"}),ye=(0,r.useCallback)((function(){var e=t.getAttributes("link").href,n=window.prompt("URL",e);null!==n&&(""!==n?t.chain().focus().extendMarkRange("link").setLink({href:n}).run():t.chain().focus().extendMarkRange("link").unsetLink().run())}),[t]),xe=(0,r.useCallback)((function(){var e=window.prompt("URL");e&&t.chain().focus().setImage({src:e}).run()}),[t]),Ee=(0,r.useCallback)((function(){var e=prompt(he);e&&t.commands.setYoutubeVideo({src:e})}),[t]),Ne=[{icon:j.bbH,onClick:function(){return t.chain().focus().toggleUnderline().run()},isActive:t.isActive("underline"),name:"underline",id:"menubar_underline_btn",title:p},{icon:S.CT9,onClick:function(){return t.chain().focus().toggleSubscript().run()},isActive:t.isActive("subscript"),name:"subscript",id:"menubar_subscript_btn",title:h},{icon:S.fs1,onClick:function(){return t.chain().focus().toggleSuperscript().run()},isActive:t.isActive("superscript"),name:"superscript",id:"menubar_superscript_btn",title:b}],Ce=[{icon:j.q5Q,onClick:function(){return t.chain().focus().setTextAlign("left").run()},isActive:t.isActive({textAlign:"left"}),name:"align-left",id:"menubar_alignLeft_btn",title:v},{icon:j.Nw6,onClick:function(){return t.chain().focus().setTextAlign("center").run()},isActive:t.isActive({textAlign:"center"}),name:"align-center",id:"menubar_alignCenter_btn",title:w},{icon:j.oNu,onClick:function(){return t.chain().focus().setTextAlign("right").run()},isActive:t.isActive({textAlign:"right"}),name:"align-right",id:"menubar_alignRight_btn",title:y},{icon:k.Flk,onClick:function(){return t.chain().focus().setTextAlign("justify").run()},isActive:t.isActive({textAlign:"justify"}),name:"align-justify",id:"menubar_alignJustify_btn",title:x}],ke=[{icon:C.Wlb,onClick:ye,active:t.isActive("link"),name:"link",id:"menubar_link_btn",title:M},{icon:C.nL$,onClick:function(){return t.chain().focus().unsetLink().run()},disabled:!t.isActive("link"),name:"unlink",id:"menubar_unlink_btn",title:z}],Se="shrink"!==n,Ae="fullScreen"===n;return a().createElement("div",{id:"menubar",className:(0,N.tw)(P||(P=Qe(["flex justify-between items-center "," ",""])),Se?"":"hidden",Ae?"py-3 mb-2 sticky top-0 bg-white z-50":"divide-x")},"fullScreen"===n&&a().createElement("div",{className:(0,N.tw)(R||(R=Qe(["flex items-center space-x-2.5 my-1.5 mx-2 md:mx-3 lg:mx-4 flex-shrink-0 w-8 xl:w-48 2xl:w-56"])))},a().createElement("p",{className:(0,N.tw)(H||(H=Qe(["xl:block hidden font-medium truncate text-gray-700"]))),title:c},c),a().createElement(Ye,{description:s,label:c,placement:"bottom-start"})),a().createElement("div",{className:(0,N.tw)(B||(B=Qe(["flex items-center overflow-x-auto overscroll-none ",""])),Ae?"flex-grow ".concat(u?"max-w-[600px]":"max-w-[100px]"," mx-auto justify-between space-x-1 px-1"):"space-x-1 px-2")},a().createElement("button",{id:"menubar_bold_btn",onClick:function(){return t.chain().focus().toggleBold().run()},className:t.isActive("bold")?(0,N.tw)(D||(D=Qe(["",""])),m):"",title:f},a().createElement(j.DPm,{className:(0,N.tw)(U||(U=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_italic_btn",onClick:function(){return t.chain().focus().toggleItalic().run()},className:t.isActive("italic")?(0,N.tw)(Z||(Z=Qe(["",""])),m):"",title:g},a().createElement(j.ld6,{className:(0,N.tw)(F||(F=Qe(["",""])),d)})),u?a().createElement(a().Fragment,null,a().createElement(I,{tools:Ne,id:"menubar_inlineGroup_btn",width:Ae?"w-5":"w-4",height:Ae?"h-5":"w-4"}),a().createElement("div",{className:(0,N.tw)(J||(J=Qe(["w-[1px] h-[18px] bg-gray-300 !mx-2 flex-shrink-0"])))}),a().createElement(I,{tools:Ce,id:"menubar_alignGroup_btn",width:Ae?"w-5":"w-4",height:Ae?"h-5":"w-4"}),a().createElement("button",{id:"menubar_bulletList_btn",onClick:function(){return t.chain().focus().toggleBulletList().run()},className:t.isActive("bulletList")?(0,N.tw)(W||(W=Qe(["",""])),m):"",title:E},a().createElement(j.t5C,{className:(0,N.tw)(q||(q=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_orderedList_btn",onClick:function(){return t.chain().focus().toggleOrderedList().run()},className:t.isActive("orderedList")?(0,N.tw)($||($=Qe(["",""])),m):"",title:A},a().createElement(j.Bxc,{className:(0,N.tw)(Q||(Q=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_indent_btn",onClick:function(){t.can().liftListItem("listItem")?t.chain().focus().liftListItem("listItem").run():t.chain().focus().unsetBlockquote().run()},title:_},a().createElement(j.mFO,{className:(0,N.tw)(Y||(Y=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_outdent_btn",onClick:function(){t.can().sinkListItem("listItem")?t.chain().focus().sinkListItem("listItem").run():t.chain().focus().setBlockquote().run()},title:L},a().createElement(j.n5H,{className:(0,N.tw)(G||(G=Qe(["",""])),d)})),a().createElement("div",{className:(0,N.tw)(V||(V=Qe(["w-[1px] h-[18px] bg-gray-300 !mx-2 flex-shrink-0"])))}),a().createElement("button",{id:"menubar_line_btn",onClick:function(){return t.chain().focus().setHorizontalRule().run()},title:T},a().createElement(j.GxM,{className:(0,N.tw)(K||(K=Qe(["",""])),d)})),a().createElement(I,{tools:ke,id:"menubar_linkGroup_btn",width:Ae?"w-5":"w-4",height:Ae?"h-5":"w-4"}),a().createElement("button",{id:"menubar_image_btn",onClick:xe,title:ge},a().createElement(O.EaH,{className:(0,N.tw)(X||(X=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_ytb_btn",onClick:Ee,title:pe},a().createElement(j.RLq,{className:(0,N.tw)(ee||(ee=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_clear_btn",onClick:function(){t.chain().focus().unsetAllMarks().run(),t.chain().focus().clearNodes().run()},title:be},a().createElement(O.lc5,{className:(0,N.tw)(te||(te=Qe(["",""])),d)})),a().createElement("div",{className:(0,N.tw)(ne||(ne=Qe(["w-[1px] h-[18px] bg-gray-300 !mx-2 flex-shrink-0"])))}),a().createElement("button",{id:"menubar_undo_btn",onClick:function(){return t.chain().focus().undo().run()},title:ve},a().createElement(O.udz,{className:(0,N.tw)(re||(re=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_redo_btn",onClick:function(){return t.chain().focus().redo().run()},title:we},a().createElement(O.Q3t,{className:(0,N.tw)(ae||(ae=Qe(["",""])),d)}))):a().createElement(a().Fragment,null,a().createElement("button",{id:"menubar_underline_btn",onClick:function(){return t.chain().focus().toggleUnderline().run()},className:t.isActive("underline")?(0,N.tw)(le||(le=Qe(["",""])),m):"",title:p},a().createElement(j.bbH,{className:(0,N.tw)(ie||(ie=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_undo_btn",onClick:function(){return t.chain().focus().undo().run()},title:ve},a().createElement(O.udz,{className:(0,N.tw)(oe||(oe=Qe(["",""])),d)})),a().createElement("button",{id:"menubar_redo_btn",onClick:function(){return t.chain().focus().redo().run()},title:we},a().createElement(O.Q3t,{className:(0,N.tw)(ce||(ce=Qe(["",""])),d)})))),a().createElement("div",{className:(0,N.tw)(se||(se=Qe(["flex items-center my-1.5 flex-shrink-0 ",""])),Ae?"mx-2 md:mx-3 lg:mx-4 pl-2 md:pl-4 space-x-3 justify-between w-[120px] sm:w-32 md:w-36 xl:w-48 2xl:w-56":"w-28 justify-evenly")},a().createElement("div",{className:(0,N.tw)(ue||(ue=Qe(["flex items-center ",""])),Ae?"xl:space-x-3 md:space-x-2 space-x-1.5":"space-x-2")},i?(0,r.cloneElement)(i,{size:Ae?"lg":"md",id:"menubar_status_btn",onTriggerClick:function(){t&&t.commands.blur()}}):null,o?(0,r.cloneElement)(o,{handleShowLargeEditor:function(){l(Ae?"shrink":"fullScreen")},id:"menubar_action_btn",size:Ae?"lg":"md",position:Ae?"left":"right",mode:n,onTriggerClick:function(){t&&t.commands.blur()}}):null),Ae?a().createElement("button",{type:"button",className:(0,N.tw)(me||(me=Qe(["bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500"]))),onClick:function(){l("shrink")}},a().createElement("span",{className:(0,N.tw)(de||(de=Qe(["sr-only"])))},"Close panel"),a().createElement(Fe.fMW,{className:(0,N.tw)(fe||(fe=Qe(["h-6 w-6"]))),"aria-hidden":"true"})):null))},Ve=function(e){var t=e.editor,n=e.show,l=e.isLocalStr,i="text-blue-600 hover:(text-blue-500) focus:outline-none",o="text-gray-500 hover:(text-gray-700) focus:outline-none",c="w-4 h-4",s=n?"flex bg-gray-200 border rounded-md p-1.5 space-x-1 !shadow":"hidden",u=(0,r.useCallback)((function(){var e=t.getAttributes("link").href,n=window.prompt("URL",e);null!==n?""!==n?t.chain().focus().extendMarkRange("link").setLink({href:n}).run():t.chain().focus().extendMarkRange("link").unsetLink().run():t.chain().focus()}),[t]);return a().createElement(g.NM,{editor:t,shouldShow:function(e){var t=e.editor,n=e.state;return!t.isActive("horizontalRule")&&!t.isActive("image")&&!n.selection.empty}},a().createElement("div",{className:(0,N.tw)(ge||(ge=Qe(["",""])),s)},n&&a().createElement(a().Fragment,null,a().createElement("button",{id:"tippy_bold_btn",onClick:function(e){t.chain().focus().toggleBold().run()},className:t.isActive("bold")?(0,N.tw)(pe||(pe=Qe(["",""])),i):(0,N.tw)(he||(he=Qe(["",""])),o)},a().createElement(j.DPm,{className:(0,N.tw)(be||(be=Qe(["",""])),c)})),a().createElement("button",{id:"tippy_italic_btn",onClick:function(){return t.chain().focus().toggleItalic().run()},className:t.isActive("italic")?(0,N.tw)(ve||(ve=Qe(["",""])),i):(0,N.tw)(we||(we=Qe(["",""])),o)},a().createElement(j.ld6,{className:(0,N.tw)(ye||(ye=Qe(["",""])),c)})),a().createElement("button",{id:"tippy_underline_btn",onClick:function(){return t.chain().focus().toggleUnderline().run()},className:t.isActive("underline")?(0,N.tw)(xe||(xe=Qe(["",""])),i):(0,N.tw)(Ee||(Ee=Qe(["",""])),o)},a().createElement(j.bbH,{className:(0,N.tw)(Ne||(Ne=Qe(["",""])),c)})),l&&a().createElement(a().Fragment,null,a().createElement("button",{id:"tippy_subscript_btn",onClick:function(){return t.chain().focus().toggleSubscript().run()},className:t.isActive("subscript")?(0,N.tw)(Ce||(Ce=Qe(["",""])),i):(0,N.tw)(ke||(ke=Qe(["",""])),o)},a().createElement(S.CT9,{className:(0,N.tw)(Se||(Se=Qe(["",""])),c)})),a().createElement("button",{id:"tippy_superscript_btn",onClick:function(){return t.chain().focus().toggleSuperscript().run()},className:t.isActive("superscript")?(0,N.tw)(Ae||(Ae=Qe(["",""])),i):(0,N.tw)(je||(je=Qe(["",""])),o)},a().createElement(S.fs1,{className:(0,N.tw)(Oe||(Oe=Qe(["",""])),c)})),a().createElement("button",{onClick:u,className:t.isActive("link")?(0,N.tw)(_e||(_e=Qe(["",""])),i):(0,N.tw)(Le||(Le=Qe(["",""])),o)},a().createElement(C.Wlb,{className:(0,N.tw)(Ie||(Ie=Qe(["",""])),c)})),a().createElement("button",{id:"tippy_unsetAllMarks_btn",onClick:function(){t.chain().focus().unsetAllMarks().run()}},a().createElement(O.lc5,{className:(0,N.tw)(Te||(Te=Qe([""," text-gray-500 hover:(text-gray-700)"])),c)}))))))},Ke=(0,N.css)(Me||(Me=Qe(["\n .ProseMirror {\n ","\n }\n\n .ProseMirror-focused {\n outline-width: 0px;\n }\n\n a {\n ","\n }\n\n ol {\n list-style-type: decimal;\n ","\n\n ol {\n list-style-type: lower-roman;\n }\n }\n\n ul {\n list-style-type: disc;\n ","\n\n ul {\n list-style-type: circle;\n\n ul {\n list-style-type: square;\n }\n }\n }\n\n li {\n ","\n }\n\n blockquote {\n ","\n }\n"])),(0,N.apply)("px-2.5 py-2"),(0,N.apply)("text-link underline"),(0,N.apply)("pl-4"),(0,N.apply)("pl-4"),(0,N.apply)("ml-0"),(0,N.apply)("pl-3 border-l-2 border-gray-300")),Xe={basic:[p.Z.configure({blockQuote:!1,bulletList:!1,code:!1,codeBlock:!1,dropcursor:!1,hardBreak:!1,heading:!1,horizontalRule:!1,listItem:!1,orderedList:!1,strike:!1}),h.Z],full:[p.Z.configure({code:!1,codeBlock:!1,heading:!1,strike:!1}),h.Z,b.Z,v.Z,w.Z.configure({types:["paragraph"]}),y.Z.configure({openOnClick:!1}),x.ZP,E.Z.configure({width:384,height:216})]};function et(e){var t,n,l,i,o,c=e.value,s=e.actionMenu,u=e.statusMenu,m=e.onChange,d=e.refresh,f=e.description,p=e.label,h=e.isLocalStr,b=e.readOnly,v=e.lang,w=e.highlighted,y=(0,r.useRef)(null),x=qe((0,r.useState)(!1),2),E=x[0],C=x[1],k=qe((0,r.useState)("2.4rem"),2),S=k[0],j=k[1],O=qe((0,r.useState)(0),2),_=O[0],L=O[1],I=qe((0,r.useState)("shrink"),2),T=I[0],M=I[1],z=qe((0,r.useState)(!1),2),P=z[0],R=z[1],H=(0,g.jE)({extensions:h?Xe.full:Xe.basic,content:c,onFocus:function(e){e.editor,e.event,C(!0)},editable:!b});(0,r.useEffect)((function(){H&&H.getHTML()!==c&&H.commands.setContent(c)}),[H,c]),(0,r.useEffect)((function(){var e=function(e){var t=e.editor,n=e.event.relatedTarget;/^tippy.+btn$/g.test(null==n?void 0:n.id)||/^menubar.+btn$/g.test(null==n?void 0:n.id)||"menubar"!==(null==n?void 0:n.id)&&(m(t.getHTML(),d),C(!1))};return H&&(H.on("blur",e),H.getHTML()!==c&&H.commands.setContent(c)),function(){H&&H.off("blur",e)}}),[H,d]),(0,r.useEffect)((function(){var e,t,n,r=(null===(e=y.current)||void 0===e||null===(t=e.editorContentRef)||void 0===t||null===(n=t.current)||void 0===n?void 0:n.clientHeight)||0;L(r)}),[T,null===(t=y.current)||void 0===t||null===(n=t.editorContentRef)||void 0===n||null===(l=n.current)||void 0===l?void 0:l.clientHeight]);var B={shrink:"relative w-full bg-white overflow-hidden ".concat(null===N.twClass||void 0===N.twClass||null===(i=N.twClass.field)||void 0===i?void 0:i.border," ").concat(null===N.twClass||void 0===N.twClass||null===(o=N.twClass.field)||void 0===o?void 0:o.size," ").concat(E?"ring-2 ring-blue-400":""),fullScreen:"relative"},D={shrink:{},fullScreen:{height:S+2}},U={shrink:(0,N.css)(ze||(ze=Qe(["\n ","\n .ProseMirror {\n ","\n\n p + p {\n margin-top: 1em;\n }\n }\n "])),(0,N.apply)("text-sm"),(0,N.apply)(P?"":"max-h-[180px]")),fullScreen:(0,N.css)(Pe||(Pe=Qe(["\n ","\n .ProseMirror {\n ","\n\n * {\n line-height: 3.125ex;\n font-size: 18px;\n max-width: 60ch;\n ",";\n }\n\n p + p {\n margin-top: 3.125ex;\n }\n }\n "])),(0,N.apply)("text-base leading-relaxed"),(0,N.apply)("h-[78vh] md:w-[80vw] w-[90vw]"),(0,N.apply)("mx-auto"))};return a().createElement("div",{className:(0,N.tw)(Re||(Re=Qe(["",""])),B[T]),style:D[T],onMouseDown:function(){R(!0)},lang:v},a().createElement("div",{className:(0,N.tw)(He||(He=Qe(["",""])),{shrink:"flex items-center float-right space-x-1 relative z-10 py-2 pl-2 pr-3 h-9",fullScreen:"hidden"}[T])},u?(0,r.cloneElement)(u,{size:"md",onTriggerClick:function(){H&&H.commands.blur()}}):null,s?(0,r.cloneElement)(s,{handleShowLargeEditor:function(){j(_),M("fullScreen")},mode:T,onTriggerClick:function(){H&&H.commands.blur()}}):null),a().createElement("div",{className:(0,N.tw)(Be||(Be=Qe(["",""])),{shrink:"",fullScreen:"fixed md:w-[80vw] top-[10vh] md:left-[10vw] w-[90vw] left-[5vw] bg-white !shadow-2xl !rounded-lg z-50 overflow-auto overscroll-none"}[T]),style:{shrink:{width:"100%"}}[T]},H?a().createElement(Ge,{editor:H,statusMenu:u,actionMenu:s,mode:T,setMode:M,label:p,description:f,isLocalStr:h}):null,H&&!b?a().createElement("div",{className:(0,N.tw)(De||(De=Qe(["",""])),"shrink"!==T?"hidden w-0 h-0":"")},a().createElement(Ve,{editor:H,show:"shrink"===T,isLocalStr:h})):null,a().createElement(g.kg,{editor:H,className:(0,N.tw)(Ue||(Ue=Qe([""," "," ",""])),Ke,U[T],b?"cursor-not-allowed bg-gray-100":""),ref:y})),w&&"shrink"===T&&a().createElement(A.hF5,{className:(0,N.tw)(Ze||(Ze=Qe(["w-3 h-3 text-yellow-500 absolute top-0 left-0"])))}))}var tt,nt,rt,at,lt=n(20819),it=n(51867),ot=n(18755),ct=n(93696),st=(0,We.NC)({en:"Ready for review",fr:"Prêt pour la révision"}),ut=(0,We.NC)({en:"Do not review",fr:"Ne pas réviser"}),mt=(0,We.NC)({en:"In review",fr:"En révision"}),dt=(0,We.NC)({en:"Approved",fr:"Approuvé"}),ft=(0,We.NC)({en:"Rejected",fr:"Rejeté"}),gt=(0,We.NC)({en:"Machine translated",fr:"Traduit par machine"}),pt={pending:{name:"pending",label:st,icon:"div",iconClassName:"border border-gray-400 bg-white rounded-full",textColor:"text-gray-500",bgColor:"bg-white"},inProgress:{name:"inProgress",label:ut,icon:ct.Vu6,iconClassName:"bg-gray-200 text-gray-500 rounded-full p-1",textColor:"text-gray-500",bgColor:"bg-gray-200"},inReview:{name:"inReview",label:mt,icon:k.HZe,iconClassName:"bg-yellow-300 text-yellow-700 rounded-full p-0.5",textColor:"text-yellow-700",bgColor:"bg-yellow-300"},approved:{name:"approved",label:dt,icon:k.oFd,iconClassName:"bg-green-300 text-green-700 rounded-full p-0.5",textColor:"text-green-700",bgColor:"bg-green-300"},rejected:{name:"rejected",label:ft,icon:ot.q5L,iconClassName:"bg-red-300 text-red-700 rounded-full p-1",textColor:"text-red-700",bgColor:"bg-red-300"},machineTranslated:{name:"machineTranslated",label:gt,icon:j.LAw,iconClassName:"bg-blue-300 text-blue-700 rounded-full p-0.5",textColor:"text-blue-700",bgColor:"bg-blue-300"}};function ht(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bt,vt,wt,yt,xt,Et,Nt,Ct,kt,St,At,jt,Ot,_t,Lt,It,Tt,Mt,zt,Pt,Rt,Ht,Bt,Dt,Ut,Zt,Ft=function(e){var t=e.items,n=e.currentStatus,l=e.onItemClick,i=e.ItemWrapper;return t.map((function(e){var t=e.name,o=e.label,c=e.icon,s=e.iconClassName,u=n===t;return a().createElement(i,{key:t,as:r.Fragment},a().createElement("div",{className:(0,N.tw)(tt||(tt=ht(["flex items-center space-x-2.5 group-statusItem py-2 px-3 cursor-pointer ",""])),u?"bg-blue-500":"hover:bg-blue-100"),onClick:function(){l(t)}},a().createElement(c,{className:(0,N.tw)(nt||(nt=ht([""," w-5 h-5"])),s)}),a().createElement("p",{className:(0,N.tw)(rt||(rt=ht(["text-sm truncate ",""])),u?"text-white":"text-gray-700 group-statusItem-hover:text-gray-700")},o)))}))};function Jt(e){var t=e.open,n=void 0===t?void 0:t,r=e.onItemClick,l=e.ItemWrapper,i=void 0===l?"div":l,o=e.margin,c=void 0===o?"":o,s=e.currentStatus,u=void 0===s?"":s;return void 0!==n?n?a().createElement("div",{className:(0,N.tw)(at||(at=ht(["bg-white ring-1 ring-black ring-opacity-10 overflow-hidden divide-y w-48 rounded-md !shadow-md py-1.5 ",""])),c)},a().createElement(Ft,{items:Object.values(pt),currentStatus:u,onItemClick:r,ItemWrapper:i})):null:a().createElement(Ft,{items:Object.values(pt),currentStatus:u,onItemClick:r,ItemWrapper:i})}function Wt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $t(e){var t,n,l=e.id,i=void 0===l?"":l,o=e.size,c=void 0===o?"sm":o,s=e.position,u=void 0===s?"right":s,m=e.canAddNewLang,d=e.metaInfo,f=e.handleAddNewLang,g=e.handleTranslate,p=e.handleSetSource,h=e.handleUpdateStatus,b=e.handleShowLargeEditor,v=e.mode,w=void 0===v?"shrink":v,y=e.isRichText,x=e.singleLangMode,E=void 0!==x&&x,k=e.onTriggerClick,S=(0,We.NC)({en:"Show all languages",fr:"Afficher toutes les langues"}),A=(0,We.NC)({en:"Machine translate",fr:"Traduction automatique"}),O=(0,We.NC)({en:"Mark as source",fr:"Marquer comme source"}),L=(0,We.NC)({en:"Set review status",fr:"Définir le statut de la révision"}),I=(0,We.NC)({en:"Show toolbar",fr:"Afficher la barre d'outils"}),T=(0,We.NC)({en:"Show compact editor",fr:"Afficher l'éditeur compact"}),M=(0,We.NC)({en:"Show large editor",fr:"Afficher le grand éditeur"}),z=(0,We.NC)({en:"Close large editor",fr:"Fermer le grand éditeur"}),P=(t=(0,r.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qt(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),R=P[0],H=P[1],B={sm:"w-4",md:"w-5",lg:"w-[22px]"},D={sm:"h-4",md:"h-5",lg:"h-[22px]"},U=function(){},Z={toolbar:{shrink:I,fullScreen:T},editor:{shrink:M,fullScreen:z}},F={toolbar:{shrink:lt.sgt,fullScreen:lt.sgt},editor:{shrink:C.QpC,fullScreen:it.rsp}},J=a().createElement("div",{id:i,className:(0,N.tw)(bt||(bt=Wt(["flex items-center group-menu space-x-0.5 -mr-1"]))),onClick:function(){k&&k()}},a().createElement(Fe.Ws$,{className:(0,N.tw)(vt||(vt=Wt([""," "," text-gray-600 rounded-full p-0.5 border border-gray-600 group-menu-hover:text-gray-800 group-menu-hover:border-gray-800"])),B[c],D[c])}),a().createElement(Fe.kWQ,{className:(0,N.tw)(wt||(wt=Wt([""," "," text-gray-700 group-menu-hover:text-gray-900"])),{sm:"w-3.5",md:"w-4",lg:"w-[18px]"}[c],{sm:"h-3.5",md:"h-4",lg:"h-[18px]"}[c])}));if(E&&y)return U=F.editor[w],a().createElement("div",{className:(0,N.tw)(yt||(yt=Wt(["cursor-pointer "," ",""])),B.lg,D.lg),onClick:function(){b()}},a().createElement(U,{className:(0,N.tw)(xt||(xt=Wt(["w-full h-full text-gray-500 hover:text-gray-700"])))}));var W=[];if(y&&(U=F.editor[w],W.push(a().createElement(_.J2.Button,{as:"div",key:"showLargeEditor"},a().createElement("div",{className:(0,N.tw)(Et||(Et=Wt(["flex items-center space-x-2.5 px-3 py-2.5 hover:bg-blue-100 cursor-pointer group ",""])),m||!E?"border-b":""),onClick:function(){b()}},a().createElement(U,{className:(0,N.tw)(Nt||(Nt=Wt(["h-5 w-5 text-gray-500"])))}),a().createElement("span",{className:(0,N.tw)(Ct||(Ct=Wt(["truncate text-sm text-gray-700 group-hover:text-gray-900"])))},Z.editor[w]))))),m&&"fullScreen"!==w&&W.push(a().createElement(_.J2.Button,{as:"div",key:"addNewLang"},a().createElement("div",{id:"action_addNewLang_btn",className:(0,N.tw)(kt||(kt=Wt(["flex items-center space-x-2.5 px-3 py-2.5 hover:bg-blue-100 cursor-pointer group"]))),onClick:function(){f()}},a().createElement(Fe.HQD,{className:(0,N.tw)(St||(St=Wt(["h-5 w-5 rounded-full text-gray-500"])))}),a().createElement("span",{className:(0,N.tw)(At||(At=Wt(["truncate text-sm text-gray-700 group-hover:text-gray-900"])))},S)))),!E){var q=d.status,$=d.isSource;"fullScreen"!==w&&($?W.push(a().createElement(_.J2.Button,{as:"div",key:"translate"},a().createElement("div",{className:(0,N.tw)(jt||(jt=Wt(["flex items-center space-x-2.5 px-3 py-2.5 hover:bg-blue-100 cursor-pointer group"]))),onClick:g},a().createElement(j.LAw,{className:(0,N.tw)(Ot||(Ot=Wt(["h-5 w-5 text-gray-500"])))}),a().createElement("span",{className:(0,N.tw)(_t||(_t=Wt(["truncate text-sm text-gray-700 group-hover:text-gray-900"])))},A)))):W.push(a().createElement(_.J2.Button,{as:"div",key:"setSource"},a().createElement("div",{className:(0,N.tw)(Lt||(Lt=Wt(["flex items-center space-x-2.5 px-3 py-2.5 hover:bg-blue-100 cursor-pointer group"]))),onClick:p},a().createElement(Fe.jlo,{className:(0,N.tw)(It||(It=Wt(["h-5 w-5 text-gray-500"])))}),a().createElement("span",{className:(0,N.tw)(Tt||(Tt=Wt(["truncate text-sm text-gray-700 group-hover:text-gray-900"])))},O))))),W.push(a().createElement("div",{className:(0,N.tw)(Mt||(Mt=Wt(["relative"]))),key:"setReviewStatus",onMouseEnter:function(){H(!0)},onMouseLeave:function(){H(!1)}},a().createElement("div",{className:(0,N.tw)(zt||(zt=Wt(["flex items-center space-x-2.5 px-3 py-2.5 hover:bg-blue-100 cursor-pointer group ",""])),R?"bg-gray-200":"")},a().createElement(Fe.Vvo,{className:(0,N.tw)(Pt||(Pt=Wt(["h-5 w-5 text-gray-500"])))}),a().createElement("span",{className:(0,N.tw)(Rt||(Rt=Wt(["truncate text-sm text-gray-700 group-hover:text-gray-900"])))},L),a().createElement(Fe.yoF,{className:(0,N.tw)(Ht||(Ht=Wt(["h-4 w-4 text-gray-500 group-hover:text-gray-700 !ml-[18px] flex-shrink-0 ",""])),R?"text-gray-700":"")})),a().createElement("div",{className:(0,N.tw)(Bt||(Bt=Wt(["absolute left-full -top-1.5"])))},a().createElement(Jt,{open:R,ItemWrapper:_.J2.Button,margin:"right"===u?"-ml-2":"-ml-[25rem]",onItemClick:h,currentStatus:q}))))}return a().createElement(_.ZP,{trigger:J,options:W,width:"w-52",menuClassName:"!shadow-lg !divide-y-0",attachToDocumentBody:!0,placement:"bottom",offset:[-20,5]})}function Qt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Yt(e){var t=e.id,n=e.lang,r=e.handleUpdateStatus,l=e.metaInfo,i=e.size,o=void 0===i?"sm":i,c=e.isLocalStr,s=e.onTriggerClick,u={sm:"text-xs",md:"text-[13px]",lg:"text-[14px]"},m={sm:"font-semibold",md:"font-semibold",lg:"font-semibold"};if(c){var d=l.status,f=void 0===d?"pending":d,g=(null==pt?void 0:pt[f])||{},p=g.bgColor,h=void 0===p?"bg-white":p,b=g.textColor,v=void 0===b?"text-gray-500":b,w=a().createElement("div",{id:t,className:(0,N.tw)(Dt||(Dt=Qt(["flex items-center justify-center rounded-xl "," "," ",""])),h,{sm:"w-[26px]",md:"w-[29px]",lg:"w-[32px]"}[o],{sm:"h-[18px]",md:"h-[19px]",lg:"h-[22px]"}[o]),onClick:function(){s&&s()}},a().createElement("p",{className:(0,N.tw)(Ut||(Ut=Qt([""," "," ",""])),v,u[o],m[o])},n.toUpperCase()));return a().createElement(_.ZP,{trigger:w,options:a().createElement(Jt,{ItemWrapper:_.J2.Button,onItemClick:r,currentStatus:f}),width:"w-52",menuClassName:"overflow-hidden !shadow-lg",attachToDocumentBody:!0,placement:"bottom-end",offset:[80,5]})}return a().createElement("p",{className:(0,N.tw)(Zt||(Zt=Qt(["text-gray-500 "," ",""])),u[o],m[o])},n.toUpperCase())}var Gt=n(39252),Vt=n.n(Gt),Kt=n(19619),Xt=n.n(Kt),en=n(53563);Xt()(en.Z,{insert:"head",singleton:!1});const tn=en.Z.locals||{};var nn,rn,an,ln,on;function cn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function sn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?un(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mn(e){var t=e.value,n=e.actionMenu,l=e.statusMenu,i=e.onChange,o=e.readOnly,c=e.placeholder,s=e.lang,u=e.highlighted,m=(0,r.createRef)(null),d=sn((0,r.useState)(!1),2),f=d[0],g=d[1],p=sn((0,r.useState)(t),2),h=p[0],b=p[1];return(0,r.useEffect)((function(){h!==t&&b(t)}),[t,h]),a().createElement("div",{className:(0,N.tw)(nn||(nn=cn(["relative w-full bg-white overflow-hidden "," "," ",""])),N.twClass.field.border,N.twClass.field.size,f?"ring-2 ring-blue-400":"")+" field__text ".concat(tn.ContentEditable),lang:s},a().createElement("div",{className:(0,N.tw)(rn||(rn=cn(["flex items-center float-right space-x-1 relative z-10 p-2 h-9"])))},l&&(0,r.cloneElement)(l,{size:"md"}),n),a().createElement(Vt(),{innerRef:m,html:h,placeholder:c,className:(0,N.tw)(an||(an=cn([""," focus:(outline-none) "," ",""])),N.twClass.field.padding,o?"cursor-not-allowed !bg-gray-200":"",(0,N.css)({minHeight:"inherit"})),onBlur:function(){var e,t=(null==m||null===(e=m.current)||void 0===e?void 0:e.innerHTML)||"";t=(t=t.replace(/(<div><br><\/div>)+/g,"\n")).replace(/<[^>]+>/g,""),b(t),g(!1),i(t)},onFocus:function(){g(!0)},onPaste:function(e){e.preventDefault();var t=e.clipboardData?(e.originalEvent||e).clipboardData.getData("text/plain"):window.clipboardData?window.clipboardData.getData("Text"):"",n=document.getSelection().getRangeAt(0);n.deleteContents();var r=document.createTextNode(t);n.insertNode(r),n.selectNodeContents(r),n.collapse(!1);var a=window.getSelection();a.removeAllRanges(),a.addRange(n)},disabled:o}),u&&a().createElement(A.hF5,{className:(0,N.tw)(ln||(ln=cn(["w-3 h-3 text-yellow-500 absolute top-0 left-0"])))}))}function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach((function(t){gn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hn(e){var t,n,c=e.primaryLanguage,s=void 0===c?"en":c,u=e.validLanguages,m=void 0===u?["en","fr"]:u,d=e.value,f=e.onChange,g=e.isRichText,p=void 0!==g&&g,h=e.isLocalStr,b=void 0!==h&&h,v=e.fieldInfo,w=e.readOnly,y=void 0!==w&&w,x=e.placeholder,E=void 0===x?"":x,C=v.description,k=v.label,S=1===m.length,A=(t=(0,r.useState)({data:{},languages:[]}),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return pn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pn(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),j=A[0],O=A[1];(0,r.useEffect)((function(){var e=function(e,t,n){if(!e)return t?{data:l({},n,""),metadata:l({},n,{status:"pending",isSource:!0}),languages:[n]}:{data:l({},n,""),languages:[n]};if(!t){for(var r={},a=[],c=0,s=Object.entries(e);c<s.length;c++){var u=o(s[c],2),m=u[0],d=u[1];r[m]=d,a.push(m)}return{data:r,languages:a}}var f=function(){for(var t={},r={},a=[],l="",i=0,c=Object.entries(e);i<c.length;i++){var s=o(c[i],2),u=s[0],m=s[1];"@"===u?(r=m,Object.entries(m).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];a.includes(n)||a.push(n),r.isSource&&(l=n)}))):(t[u]=m,a.includes(u)||a.push(u))}Object.keys(r).length||(r[n]={status:"pending",isSource:!0}),Object.keys(t).length||(t[n]="",[n]in r||(r[n]={status:"pending"})),l&&!([l]in t)&&(t[l]="");var d=a.filter((function(e){return!t.hasOwnProperty(e)}));return{v:{metadata:r,data:t,languages:a,hiddenLanguages:d}}}();return"object"===i(f)?f.v:void 0}(d,b,s);O(e)}),[d]);var _,L,I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};f(b?fn(fn({},e),{},{"@":t}):e)},T=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:j,r=n.data,a=n.metadata;if(("<p></p>"!==t||r[e])&&t!==r[e]){var l=fn(fn({},r),{},gn({},e,t));if(b){var i,o=fn({},a);"machineTranslated"===(null===(i=o[e])||void 0===i?void 0:i.status)&&(o[e].status="pending"),I(l,o)}else I(l)}},M=function(){var e=m.filter((function(e){return!j.languages.includes(e)}));if(e.length){var t=e.reduce((function(e,t){return fn(fn({},e),{},gn({},t,""))}),P),n=e.reduce((function(e,t){return fn(fn({},e),{},gn({},t,{status:"pending"}))}),H);I(t,n)}else j.hiddenLanguages.length&&O(fn(fn({},j),{},{hiddenLanguages:[]}))},z=function(e,t){var n=j.data,r=fn({},j.metadata);[e]in r?r[e].status=t:r[e]={status:t},I(n,r)},P=j.data,R=j.languages,H=j.metadata,B=j.hiddenLanguages;return S?p?a().createElement(et,{lang:s,value:P[s],description:C,label:k,actionMenu:a().createElement($t,{canAddNewLang:!1,isRichText:p,singleLangMode:!0}),onChange:function(e,t){T(s,e,JSON.parse(t))},refresh:JSON.stringify(j),isLocalStr:b}):a().createElement(mn,{lang:s,value:P[s]||"",onChange:function(e){T(s,e)},placeholder:(null==E?void 0:E[s])||""}):Object.keys(P).length?a().createElement("div",{className:(0,N.tw)(on||(_=["w-full space-y-1.5"],L||(L=_.slice(0)),on=Object.freeze(Object.defineProperties(_,{raw:{value:Object.freeze(L)}}))))},R.sort((function(e,t){return e===s?-1:1})).map((function(e){if(null!=B&&B.includes(e))return null;var t=(null==H?void 0:H[e])||{},n=P[e]||"",r=y||1===R.length&&e===s&&(null==t||!t.status||"pending"===t.status)?null:a().createElement(Yt,{lang:e,metaInfo:t,handleUpdateStatus:function(t){z(e,t)},isLocalStr:b}),l=b&&!y?a().createElement($t,{canAddNewLang:R.length<m.length||(null==B?void 0:B.length),isRichText:p,metaInfo:t,handleAddNewLang:M,handleTranslate:function(){return function(e){var t=m.filter((function(t){return t!==e}))[0],n=j.data,r=j.metadata;t&&We.ZP.get("profiles.php",{params:{action:"translateData",text:n[e],sourceLang:e,targetLang:t}}).then((function(e){var a=e.data,l=fn(fn({},n),{},gn({},t,a)),i={};b&&(i=fn(fn({},r),{},gn({},t,{status:"machineTranslated"}))),I(l,i)}))}(e)},handleSetSource:function(){return function(e){var t=j.data,n=fn({},j.metadata);Object.values(n).forEach((function(e){delete e.isSource})),[e]in n?(n[e].isSource=!0,"machineTranslated"===n[e].status&&(n[e].status="pending")):n[e]={isSource:!0,status:"pending"},I(t,n)}(e)},handleUpdateStatus:function(t){z(e,t)}}):null,i=R.filter((function(e){return!(null!=B&&B.includes(e))})).length,o=t.isSource&&m.length>2&&i>1;return p?a().createElement(et,{key:e,lang:e,value:n,description:C,label:k,statusMenu:r,actionMenu:l,onChange:function(t,n){T(e,t,JSON.parse(n))},refresh:JSON.stringify(j),isLocalStr:b,readOnly:y,highlighted:o}):a().createElement(mn,{key:e,lang:e,value:n,statusMenu:r,actionMenu:l,onChange:function(t){T(e,t)},readOnly:y,placeholder:(null==E?void 0:E[e])||"",highlighted:o})}))):null}},5025:(e,t,n)=>{n.d(t,{Z:()=>Q});var r,a,l,i,o,c,s,u,m,d,f,g,p,h,b,v,w,y,x,E,N,C,k,S,A,j,O,_,L,I,T,M,z,P,R,H,B,D=n(11129),U=n.n(D),Z=n(67900),F=n(46248),J=n(19152);function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var $=function(e){var t=uniweb.localize({en:"<br /> The month is optional: <strong>yyyy</strong>/m. Or both month and day can be included: <strong>yyyy</strong>/m/d.",fr:"<br />Le mois est facultatif: <strong>aaa</strong>/m. Ou le mois et le jour peuvent être inclus: <strong>aaaa</strong>/m/j"}),n=uniweb.localize({en:"The day is optional: <strong>yyyy/m</strong>/d.",fr:"Le jour est facultatif: <strong>aaaa/m</strong>/j."}),l=e.content,i=e.fieldType,o={yearmonth:U().createElement("p",{dangerouslySetInnerHTML:{__html:n}}),year:U().createElement("p",{dangerouslySetInnerHTML:{__html:t}})};return U().createElement(F.Z,{children:U().createElement("div",{className:(0,Z.tw)(r||(r=q(["px-1.5 py-1 text-sm"])))},U().createElement("div",{dangerouslySetInnerHTML:{__html:l}}),o[i]),triggerElement:U().createElement("div",null,U().createElement(J.UYI,{size:"1.15rem",className:(0,Z.tw)(a||(a=q(["cursor-help text-gray-300 hover:text-gray-500 group-hover:text-gray-500"])))})),hideArrow:!0,tooltipConfig:{placement:"right-start",delayHide:150,delayShow:0,trigger:"hover",offset:[0,8]}})};const Q=function(e){var t,n,r=e.label,a=e.children,F=e.fieldErrors,J=e.required,Q=void 0!==J&&J,Y=e.description,G=e.verticalAlign,V=void 0===G?"center":G,K=e.labelStickers,X=void 0===K?[]:K,ee=e.extraInfo,te=void 0===ee?"":ee,ne=e.fieldType,re=void 0===ne?"string":ne,ae=e.fieldGroupMode,le=void 0===ae?"auto":ae,ie=e.containerClassNames,oe=void 0===ie?"":ie,ce=e.fullWidth,se=void 0!==ce&&ce,ue=e.css,me=void 0===ue?{}:ue,de=e.customTooltip,fe=void 0===de?null:de,ge=e.labelAlign,pe=void 0===ge?"right":ge,he=(t=(0,D.useState)(""),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),be=he[0],ve=he[1],we=(0,D.useRef)(null);(0,D.useEffect)((function(){var e;"start"===V&&((null===(e=we.current)||void 0===e?void 0:e.clientHeight)||0)<25&&ve("pt-[9px]")}),[we]);var ye=se?"auto":"22rem",xe=(0,Z.css)(l||(l=q(["\n max-width: ",";\n ",";\n "])),ye,(0,Z.apply)("xl:(mr-6) lg:(mr-4) md:(w-3/12 justify-end mb-0 pr-4 mr-2 ml-0) flex items-".concat(V," mx-auto mb-0.5 text-").concat(pe," ").concat(be))),Ee=(0,Z.css)(i||(i=q(["\n max-width: ",";\n ",";\n ",";\n "])),ye,(0,Z.apply)("lg:(mr-2) md:(w-7/12 justify-center mb-0 mr-0 ml-0 flex-shrink-0) flex items-".concat(V," mx-auto mb-0.5")),me.content),Ne="md:(flex items-".concat(V," ").concat(be," w-2/12 visible px-2) hidden");if(!le||"auto"===le)return U().createElement(U().Fragment,null,U().createElement("div",{className:(0,Z.tw)(o||(o=q(["md:flex group pt-2 max-w-3xl mx-auto "," ",""])),oe,te||null!=F&&F.length?"pb-1":"pb-2")},U().createElement("div",{className:(0,Z.tw)(c||(c=q(["",""])),xe)},r&&U().createElement(U().Fragment,null,U().createElement("label",{className:(0,Z.tw)(s||(s=q(["m-0 font-medium text-sm text-fieldLabelColor"]))),style:{wordBreak:"break-word"},ref:we},null!=X&&X.length?U().createElement("div",{className:(0,Z.tw)(u||(u=q(["inline-flex items-center space-x-1 mr-1"])))},X):null,r,Q&&U().createElement("span",{className:(0,Z.tw)(m||(m=q(["text-red-700 mx-0.5"])))},"*"))),fe,Y&&U().createElement("div",{className:(0,Z.tw)(d||(d=q(["md:(hidden) ml-2"])))},U().createElement($,{content:Y,fieldType:re}))),U().createElement("div",{className:(0,Z.tw)(f||(f=q(["",""])),Ee),style:{minHeight:"2.4rem"}},a),U().createElement("div",{className:(0,Z.tw)(g||(g=q(["",""])),Ne)},Y&&U().createElement($,{content:Y,fieldType:re}))),te?U().createElement("div",{className:(0,Z.tw)(p||(p=q(["md:(flex max-w-3xl mx-auto)"])))},U().createElement("div",{className:(0,Z.tw)(h||(h=q([""," invisible"])),xe)}),U().createElement("div",{className:(0,Z.tw)(b||(b=q([""," mb-1"])),Ee)},U().createElement("div",{className:(0,Z.tw)(v||(v=q(["w-full text-gray-500 text-sm"])))},te)),U().createElement("div",{className:(0,Z.tw)(w||(w=q(["",""])),Ne)})):null,null!=F&&F.length?U().createElement("div",{className:(0,Z.tw)(y||(y=q(["md:(flex max-w-3xl mx-auto)"])))},U().createElement("div",{className:(0,Z.tw)(x||(x=q([""," invisible"])),xe)}),U().createElement("div",{className:(0,Z.tw)(E||(E=q([""," mb-1"])),Ee)},U().createElement("ul",{className:(0,Z.tw)(N||(N=q(["w-full"])))},F.map((function(e,t){return U().createElement("li",{key:t,className:(0,Z.tw)(C||(C=q(["text-red-600 text-sm w-full"])))},e)})))),U().createElement("div",{className:(0,Z.tw)(k||(k=q(["",""])),Ne)})):null);if("compact"===le){var Ce=(0,Z.css)(S||(S=q(["\n max-width: ",";\n ",";\n "])),ye,(0,Z.apply)("flex items-".concat(V," mb-0.5 text-").concat(pe))),ke=(0,Z.css)(A||(A=q(["\n max-width: ",";\n ",";\n "])),ye,(0,Z.apply)("flex items-".concat(V," mb-0.5")));return U().createElement(U().Fragment,null,U().createElement("div",{className:(0,Z.tw)(j||(j=q(["pt-2 "," group ",""])),te||null!=F&&F.length?"pb-1":"pb-2",oe)},U().createElement("div",{className:(0,Z.tw)(O||(O=q(["",""])),Ce)},r&&U().createElement(U().Fragment,null,U().createElement("label",{className:(0,Z.tw)(_||(_=q(["m-0 font-medium text-sm text-fieldLabelColor"]))),style:{wordBreak:"break-word"}},null!=X&&X.length?U().createElement("div",{className:(0,Z.tw)(L||(L=q(["inline-flex items-center space-x-1 mr-1"])))},X):null,r,Q&&U().createElement("span",{className:(0,Z.tw)(I||(I=q(["text-red-700 mx-0.5"])))},"*"))),fe,Y&&U().createElement("div",{className:(0,Z.tw)(T||(T=q(["ml-2"])))},U().createElement($,{content:Y,fieldType:re}))),U().createElement("div",{className:(0,Z.tw)(M||(M=q(["",""])),ke),style:{minHeight:"2.4rem"}},a)),te?U().createElement("div",{className:(0,Z.tw)(z||(z=q([""," mb-1"])),ke)},U().createElement("div",{className:(0,Z.tw)(P||(P=q(["w-full text-gray-500 text-sm"])))},te)):null,F&&F.length?U().createElement("div",{className:(0,Z.tw)(R||(R=q([""," mb-1"])),ke)},U().createElement("ul",{className:(0,Z.tw)(H||(H=q(["w-full"])))},F.map((function(e,t){return U().createElement("li",{key:t,className:(0,Z.tw)(B||(B=q(["text-red-600 text-sm w-full"])))},e)})))):null)}}},4687:(e,t,n)=>{n.d(t,{Z:()=>s});var r,a=n(11129),l=n.n(a),i=n(64729),o=n(67900);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const s=(0,a.forwardRef)((function(e,t){var n,s,u=e.id,m=e.value,d=void 0===m?"":m,f=e.placeholder,g=void 0===f?"":f,p=e.onValueChange,h=void 0===p?null:p,b=e.onFocusChange,v=void 0===b?null:b,w=e.onKeyDown,y=void 0===w?null:w,x=e.hasError,E=void 0!==x&&x,N=e.className,C=void 0===N?"":N,k=e.handleOnChange,S=void 0===k?null:k,A=e.breakLineOnEnterClick,j=void 0!==A&&A,O=e.onRowChange,_=void 0===O?null:O,L=e.readOnly,I=void 0!==L&&L,T=e.rows,M=void 0===T?1:T,z=e.onBlur,P=(n=(0,a.useState)(d),s=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}(n,s)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(n,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),R=P[0],H=P[1];(0,a.useEffect)((function(){H(d)}),[d]);var B,D,U="px-2.5 outline-none resize-none text-fieldValueColor text-sm w-full rounded my-1 ".concat(C," ").concat(I?"bg-gray-100 cursor-not-allowed":"");return l().createElement(i.Z,{ref:t,id:u,className:(0,o.tw)(r||(B=["",""],D||(D=B.slice(0)),r=Object.freeze(Object.defineProperties(B,{raw:{value:Object.freeze(D)}}))),U),type:"string",onKeyDown:function(e){"Enter"===e.key&&(j||(e.preventDefault(),v&&v(!1),h&&h(R||void 0),y&&y(e)))},onResize:function(e){_&&_(Math.floor(e.target.clientHeight/20))},async:!!_,placeholder:g,value:R,onFocus:function(){v&&v(!0)},onChange:function(e){S?S(e.target.value):(H(e.target.value),E&&h&&h(e.target.value?e.target.value:void 0))},onBlur:function(){v&&v(!1),h&&h(R||void 0),z&&z()},readOnly:I,rows:M})}))},53563:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(9927),a=n.n(r)()((function(e){return e[1]}));a.push([e.id,".zYSX90cH9mEgyg\\+FPmbfPQ\\=\\= [contenteditable=true]:empty:before{content:attr(placeholder);display:block;color:#aaa}",""]),a.locals={ContentEditable:"zYSX90cH9mEgyg+FPmbfPQ=="};const l=a}}]);