ode-explorer 1.3.2-dev.202401161841 → 1.3.2-dev.202401171614

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.
@@ -1342,6 +1342,6 @@ void main()
1342
1342
  font-weight: ${r.weight};
1343
1343
  font-style: ${r.style};
1344
1344
  font-display: ${r.display};
1345
- }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=pN(e)),typeof e=="number"?fN(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const r=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&r<1&&(e+=(r*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${n} ${e}`}reset(){Object.assign(this,xn.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(r=>setTimeout(r,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=X.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};xp.availableFonts={},xp.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Td=xp;const ac=class _n extends xa{constructor(e="",r={}){super(Q.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=Q.from(i,{scaleMode:X.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new me,s.trim=new me,this.texture=s;const n="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(n,"svg"),l=document.createElementNS(n,"foreignObject"),c=document.createElementNS(a,"div"),h=document.createElementNS(a,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",o.appendChild(l),this.maxWidth=_n.defaultMaxWidth,this.maxHeight=_n.defaultMaxHeight,this._domElement=c,this._styleElement=h,this._svgRoot=o,this._foreignObject=l,this._foreignObject.appendChild(h),this._foreignObject.appendChild(c),this._image=i,this._loadImage=new Image,this._autoResolution=_n.defaultAutoResolution,this._resolution=_n.defaultResolution??X.RESOLUTION,this.text=e,this.style=r}measureText(e){var h,f;const{text:r,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:r,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:a,height:o}=n;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const l=Math.min(this.maxWidth,Math.ceil(a)),c=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),r!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(s)}),this._styleElement.textContent=(f=this._style)==null?void 0:f.toGlobalCSS()),{width:l+i.padding*2,height:c+i.padding*2}}async updateText(e=!0){const{style:r,_image:i,_loadImage:s}=this;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),!this.dirty&&e)return;const{width:n,height:a}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(l=>{s.onload=async()=>{if(o<this._updateID){l();return}await r.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),l()};const c=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(c)}`})}get source(){return this._image}updateTexture(){const{style:e,texture:r,_image:i,resolution:s}=this,{padding:n}=e,{baseTexture:a}=r;r.trim.width=r._frame.width=i.width/s,r.trim.height=r._frame.height=i.height/s,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-n*2,r.orig.height=r._frame.height-n*2,this._onTextureUpdate(),a.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,n,a,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},_n.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=r,(s=this._svgRoot)==null||s.remove(),this._svgRoot=r,(n=this._domElement)==null||n.remove(),this._domElement=r,(a=this._foreignObject)==null||a.remove(),this._foreignObject=r,(o=this._styleElement)==null||o.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const r=$i(this.scale.x)||1;this.scale.x=r*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const r=$i(this.scale.y)||1;this.scale.y=r*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof Td?(this.ownsStyle=!1,this._style=e):e instanceof ts?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Td.from(e)):(this.ownsStyle=!0,this._style=new Td(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};ac.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},ac.defaultMaxWidth=2024,ac.defaultMaxHeight=2024,ac.defaultAutoResolution=!0;const A4=E.forwardRef(({children:t},e)=>x.jsx("div",{ref:e,className:"actionbar",children:t})),$U=A4,C4=E.forwardRef((t,e)=>{const{isLoading:r,loadingIcon:i,loadingPosition:s="left",children:n,className:a,...o}=t,l=()=>{let h;return i?h=i:h=x.jsx(mE,{...o,"aria-label":"Loading"}),h},c=re("loading",{"is-loading":r},a);return x.jsxs("div",{className:c,role:"status",ref:e,children:[(!s||s==="left")&&l(),n,s==="right"&&l()]})}),Lw=C4,I4=E.forwardRef(({color:t="primary",type:e="button",size:r="md",children:i,isLoading:s,loadingIcon:n,loadingPosition:a,leftIcon:o,rightIcon:l,className:c,variant:h="filled",...f},u)=>{const d=re("btn",{[`btn-filled btn-${t}`]:h==="filled",[`btn-${h}-${t}`]:h==="outline"||h==="ghost","btn-icon":!i,"btn-loading":s,"btn-lg":r==="lg","btn-sm":r==="sm"},c);return x.jsx("button",{ref:u,className:d,type:e,...f,children:s?x.jsx(Lw,{isLoading:!0,loadingIcon:n,loadingPosition:a,children:i}):x.jsxs("span",{children:[o,i,l]})})}),tt=I4,R4=E.forwardRef(({icon:t,className:e,...r},i)=>{const s={...r,className:re("btn-icon btn-sm",e)};return x.jsx(tt,{ref:i,...s,children:t})}),Qs=R4,P4=E.forwardRef(({icon:t=x.jsx(gE,{}),onClick:e,className:r,...i},s)=>{const n=re("btn-search",r);return x.jsx(Qs,{ref:s,className:n,icon:t,onClick:e,...i})}),M4=P4,O4=E.forwardRef(({type:t="success",className:e="",children:r,button:i,isDismissible:s=!1,isToast:n=!1,isConfirm:a=!1,position:o="none",autoClose:l=!1,autoCloseDelay:c=3e3,onClose:h,onVisibilityChange:f},u)=>{const[d,p]=E.useState(!0),m=E.useRef(null),{t:g}=Ce(),v=E.useCallback(()=>{p(!1),h==null||h()},[h]);E.useImperativeHandle(u,()=>({show:_,hide:v,...m.current})),E.useLayoutEffect(()=>{f==null||f(d)},[d,f]),E.useEffect(()=>{l&&d&&setTimeout(()=>{v()},c)},[l,c,v,d]);const _=()=>{p(!0)},y={success:{icon:x.jsx(uE,{}),classModifier:"alert-success"},warning:{icon:x.jsx(dE,{}),classModifier:"alert-warning"},info:{icon:x.jsx(qy,{}),classModifier:"alert-info"},danger:{icon:x.jsx(fE,{}),classModifier:"alert-danger"}},b={"is-dismissible":s,"is-toast ":n},w={"is-confirm":a},S=re("alert gap-12",y[t].classModifier,b,w,o,e);return x.jsx(x.Fragment,{children:d?x.jsxs("div",{ref:m,className:S,role:"alert",children:[!a&&y[t].icon,x.jsx("div",{className:"alert-content small",children:r}),i&&x.jsxs("div",{className:"ms-12",children:[i," ",a&&x.jsx(tt,{onClick:v,children:g("close")})]}),(s||a)&&x.jsx("div",{className:"btn-close-container",children:x.jsx("button",{type:"button",className:"btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:v})}),l&&x.jsx("div",{className:"alert-progress",style:{transform:"scaleX(0)"}})]}):null})}),zi=O4,k4=E.forwardRef(({children:t,render:e,isFullscreen:r=!1},i)=>{const s=re("d-flex flex-wrap p-16 gap-8 border-bottom bg-white",{"justify-content-between":e,"mx-n16":!r,"z-3 top-0 start-0 end-0 position-fixed":r});return x.jsxs("div",{ref:i,className:s,children:[t,e?x.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:e()}):null]})}),GU=k4;function Bw({appCode:t}){return pb({queryKey:["conf"],queryFn:async()=>await Me.conf().getConf(t),suspense:!0})}function D4(t){return{getPreference:async()=>await Me.conf().getPreference(t),savePreference:async e=>await Me.conf().savePreference(t,JSON.stringify(e))}}function N4(){const[t,e]=E.useState(!1),{getPreference:r,savePreference:i}=D4("rgpdCookies");return E.useEffect(()=>{},[]),{showCookiesConsent:t,handleConsultCookies:()=>{document.location.href="/userbook/mon-compte",i({showInfoTip:!1}),e(!1)},handleCloseCookiesConsent:()=>{i({showInfoTip:!1}),e(!1)}}}function L4(){return pb({queryKey:["session"],queryFn:async()=>await Me.session().getSession(),suspense:!0})}const Fw=E.createContext(null);function zU({children:t,params:e}){const r=e.app,{t:i}=Ce(),s=i(r),n=L4(),a=Bw({appCode:r}),{showCookiesConsent:o,handleConsultCookies:l,handleCloseCookiesConsent:c}=N4(),h=(a==null?void 0:a.isSuccess)&&(n==null?void 0:n.isSuccess);E.useEffect(()=>{var u,d;(d=document.querySelector("html"))==null||d.setAttribute("lang",((u=n==null?void 0:n.data)==null?void 0:u.currentLanguage)||"fr")},[n==null?void 0:n.data]),E.useEffect(()=>{document.title=`${s}`},[r,n.data,s]);const f=E.useMemo(()=>{var u,d,p,m,g,v;return{appCode:r,applications:(u=a==null?void 0:a.data)==null?void 0:u.applications,confQuery:a,currentApp:(d=a==null?void 0:a.data)==null?void 0:d.currentApp,currentLanguage:(p=n==null?void 0:n.data)==null?void 0:p.currentLanguage,init:h,sessionQuery:n,user:(m=n==null?void 0:n.data)==null?void 0:m.user,userDescription:(g=n==null?void 0:n.data)==null?void 0:g.userDescription,userProfile:(v=n==null?void 0:n.data)==null?void 0:v.userProfile}},[r,a,h,n]);return x.jsxs(Fw.Provider,{value:f,children:[t,o&&x.jsx(zi,{type:"info",className:"m-12",isConfirm:!0,button:x.jsx(tt,{color:"tertiary",variant:"ghost",onClick:l,children:i("rgpd.cookies.banner.button.consult")}),onClose:c,children:i("rgpd.cookies.banner.text1")})]})}function Tt(){const t=E.useContext(Fw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}const Uw=E.createContext(null);function HU({children:t}){var e;const{appCode:r}=Tt(),i=Bw({appCode:r});E.useEffect(()=>{var n,a,o,l,c,h,f,u,d;const p=document.getElementById("favicon");p.href=`${(a=(n=i==null?void 0:i.data)==null?void 0:n.theme)==null?void 0:a.basePath}/img/illustrations/favicon.ico`;const m=(c=(l=(o=i==null?void 0:i.data)==null?void 0:o.theme)==null?void 0:l.bootstrapVersion)==null?void 0:c.split("-"),g=m?m[m.length-1]:void 0;[{data:"data-skin",value:(f=(h=i==null?void 0:i.data)==null?void 0:h.theme)==null?void 0:f.skinName},{data:"data-theme",value:(d=(u=i==null?void 0:i.data)==null?void 0:u.theme)==null?void 0:d.themeName},{data:"data-product",value:g}].forEach(v=>{var _;return(_=document.querySelector("html"))==null?void 0:_.setAttribute(v.data,v.value)})},[i==null?void 0:i.data]);const s=E.useMemo(()=>{var n;return{theme:(n=i==null?void 0:i.data)==null?void 0:n.theme}},[(e=i==null?void 0:i.data)==null?void 0:e.theme]);return x.jsx(Uw.Provider,{value:s,children:t})}function Om(){const t=E.useContext(Uw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}function B4(){var t;const{sessionQuery:e}=Tt(),r=new Set;return(t=e==null?void 0:e.data)==null?void 0:t.bookmarkedApps.filter(i=>{const s=r.has(i.displayName);return r.add(i.displayName),!s})}const F4=E.createContext(null);function U4(){return E.useContext(F4)}function Ay(...t){return e=>{j4(e,...t)}}function j4(t,...e){e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}const $4=(t,e)=>{const r=e==null?void 0:e.filter(i=>i.id===t&&i.available);return r&&r.length>0},jw={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};function fo(t){const e=U4(),[r,i]=E.useState();return E.useEffect(()=>{(async()=>{let s;if(e!=null&&e.hasWorkflow)if(typeof t=="string")s=await e.hasWorkflow(t);else throw"not.implemented.yet)";else typeof t=="string"?s=await Me.rights().sessionHasWorkflowRight(t):s=await Me.rights().sessionHasWorkflowRights(t);i(s)})()},[t,e]),r}const G4=()=>{const t=fo("fr.openent.zimbra.controllers.ZimbraController|view"),e=fo("fr.openent.zimbra.controllers.ZimbraController|preauth"),[r,i]=E.useState(0),[s,n]=E.useState(""),a=E.useCallback(async()=>{if(t)try{const l=await Me.http().get("/zimbra/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});l.status!==200&&i(0),i(l.count)}catch{console.error("error"),i(0)}else try{const l=await Me.http().get("/conversation/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});i(l.count)}catch{console.error("error"),i(0)}},[t]),o=E.useCallback(()=>{let l="";Me.http().get("/userbook/preference/zimbra").then(c=>{try{c.preference&&JSON.parse(c.preference).modeExpert&&e?l="/zimbra/preauth":l=window.location.origin+"/zimbra/zimbra"}catch{l="/zimbra/zimbra"}}),n(l)},[e]);return E.useEffect(()=>{(async()=>{try{await a()}catch(l){console.error(l)}})(),o()},[o,a]),{messages:r,msgLink:s,zimbraWorkflow:t}},z4=G4,Cy=["mousedown","touchstart"];function $w(t,e,r){const i=E.useRef();return E.useEffect(()=>{const s=n=>{const{target:a}=n??{};if(Array.isArray(r)){const o=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(l=>!!l&&!n.composedPath().includes(l))&&!o&&t()}else i.current&&!i.current.contains(a)&&t()};return(e||Cy).forEach(n=>{document.addEventListener(n,s)}),()=>{(e||Cy).forEach(n=>{document.removeEventListener(n,s)})}},[i,t,r,e]),i}function H4(t,e){const[r,i]=E.useState(t);return E.useEffect(()=>{const s=setTimeout(()=>{i(t)},e||500);return()=>{clearTimeout(s)}},[t,e]),r}const V4=(t,e)=>{const r=E.useId(),[i,s]=E.useState(!1),[n,a]=E.useState(-1),[o,l]=E.useState(null),{refs:c,floatingStyles:h}=US({placement:t,open:i,onOpenChange:s,whileElementsMounted:TS,middleware:[nS(4),AS({apply({rects:M,elements:I}){I.floating.style,`${M.reference.width}`}}),SS({padding:0})]}),f=E.useRef(null),u=E.useRef(null),d=E.useRef({});E.useEffect(()=>{i?f.current&&(f.current.focus(),a(0)):(a(-1),d.current={})},[i]),E.useEffect(()=>{if(n!==-1){const M=Object.values(d.current)[n];if(M){const I=M.getAttribute("id");l(I),M.focus()}}},[n]);const p=()=>{const M=Object.values(d.current).length;a(I=>(I+1)%M)},m=()=>{const M=Object.values(d.current).length;a(I=>(I-1+M)%M)},g=()=>{a(0)},v=()=>{const M=Object.values(d.current).length;a(M-1)},_=E.useCallback(()=>{s(!0)},[]),y=E.useCallback(()=>{u.current&&(u.current.focus(),s(!1))},[]),b=(M,I)=>{M&&(I.stopPropagation(),I.preventDefault())},w=E.useCallback(M=>{let I=!1;switch(M.code){case" ":case"Space":case"Enter":case"ArrowDown":case"Down":_(),I=!0;break;case"Esc":case"Escape":y(),I=!0;break;case"Up":case"ArrowUp":_(),I=!0;break}e==null||e(M),b(I,M)},[y,_]),S=M=>{const I=Object.values(d.current).findIndex(k=>k.id===M.currentTarget.getAttribute("id"));a(I)},T=E.useCallback((M,I)=>{let k=!1;if(M.shiftKey)M.key==="Tab"&&(y(),k=!0);else{switch(M.code){case"Escape":y();break;case" ":case"Space":case"Enter":n!==-1&&(Object.values(d.current)[n].getAttribute("role")==="menuitem"&&u.current&&(u.current.focus(),s(!1)),I==null||I()),k=!0;break;case"ArrowDown":case"Down":p(),k=!0;break;case"ArrowUp":case"Up":m(),k=!0;break;case"Home":g(),k=!0;break;case"End":v(),k=!0;break}b(k,M)}},[n,y]),C=E.useCallback(M=>{s(i!==!0),M.stopPropagation(),M.preventDefault()},[i]),A=E.useCallback(()=>{y()},[y]);return{isFocused:o,visible:i,itemRefs:d,triggerRef:u,menuRef:f,triggerProps:{ref:Ay(u,c.setReference),id:`dropdown-toggle-${r}`,"aria-haspopup":"menu","aria-controls":`dropdown-${r}`,"aria-expanded":!!i,className:`${i?"selected":""}`,onClick:C,onKeyDown:w,"aria-activedescendant":o},menuProps:{ref:Ay(f,c.setFloating),className:"dropdown-menu bg-white shadow rounded-4 p-8","aria-labelledby":`dropdown-toggle-${r}`,style:{...h}},itemProps:{onMenuItemMouseEnter:S,onMenuItemClick:A,onMenuItemKeyDown:T},setVisible:s}},W4=V4,X4=()=>{const[t,e]=E.useState(!1),[r,i]=E.useState([]),s=E.useRef(null),n=f=>{i(u=>[...u,f])},a=f=>{i(u=>u.filter(d=>d.name!==f.name))},o=()=>{i([])},l=f=>{const u=f.target.files;u&&[...u].forEach(d=>{n(d)})},c=f=>{f.preventDefault(),f.stopPropagation(),e(!0)},h=f=>{f.preventDefault(),f.stopPropagation(),e(!1)};return{inputRef:s,files:r,dragging:t,handleDragging:c,handleDragLeave:h,handleDrop:f=>{var u;h(f);const d=(u=f.dataTransfer)==null?void 0:u.files;d&&[...d].forEach(p=>{n(p)}),s!=null&&s.current&&d&&(s.current.files=d)},deleteFile:a,addFile:n,cleanFiles:o,handleOnChange:l}},Y4=X4,oc="top-right";function ru(){return{success:(t,e)=>Ta.custom(x.jsx(zi,{type:"success",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),error:(t,e)=>Ta.custom(x.jsx(zi,{type:"danger",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),info:(t,e)=>Ta.custom(x.jsx(zi,{type:"info",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),warning:(t,e)=>Ta.custom(x.jsx(zi,{type:"warning",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),loading:Ta.loading}}function Gw(){const[t,e]=E.useState(!1),r=E.useRef(null),i=()=>{e(!0)},s=()=>{e(!1)};return E.useEffect(()=>{const n=r.current;if(n)return n.addEventListener("mouseover",i),n.addEventListener("mouseout",s),()=>{n.removeEventListener("mouseover",i),n.removeEventListener("mouseout",s)}},[r]),[r,t]}function q4({src:t,placeholder:e}){const[r,i]=E.useState(t||e),s=E.useCallback(()=>{i(e)},[e]);return E.useEffect(()=>{i(t)},[t]),{imgSrc:r,onError:s}}function Z4(t,e){const r=E.useCallback(({code:i})=>{e.includes(i)&&t()},[t,e]);E.useEffect(()=>(window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}),[r])}function VU(){const t=document.querySelector("html");return()=>{t&&t.scrollIntoView()}}function K4(){const t=typeof document<"u",[e,r]=E.useState(()=>document.title);return E.useEffect(()=>{t&&r(document.title)},[t]),e}function Q4(t=!1){const[e,r]=E.useState(t),i=E.useCallback(()=>{r(s=>!s)},[]);return[e,i]}function J4(){const t=E.useRef(null),e='button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';return E.useEffect(()=>{const r=t.current,i=r.querySelectorAll(e)[0],s=r.querySelectorAll(e),n=t&&(s==null?void 0:s[s.length-1]),a=o=>{o.key==="Tab"&&(o.shiftKey?document.activeElement===i&&(n.focus(),o.preventDefault()):document.activeElement===n&&(i.focus(),o.preventDefault()))};if(r)return r.addEventListener("keydown",a),()=>{r.removeEventListener("keydown",a)}},[]),t}function e5({user:t,avatar:e}){const{t:r}=Ce(),i=K4(),[s,n]=E.useState(!0),[a,o]=Gw(),l=E.useId(),c=E.useId(),h=e,f=t==null?void 0:t.username,u=r("welcome",{username:t==null?void 0:t.firstName}),d=B4(),p=fo("net.atos.entng.community.controllers.CommunityController|view"),m=fo("org.entcore.conversation.controllers.ConversationController|view"),g=fo("fr.openent.searchengine.controllers.SearchEngineController|view"),v=E.useCallback(()=>{n(!s)},[s]),_=async()=>{await Me.session().logout(),window.location.href="/auth/login"};return E.useMemo(()=>({title:i,bookmarkedApps:d,appsRef:a,isAppsHovered:o,popoverAppsId:l,popoverSearchId:c,userAvatar:h,userName:f,welcomeUser:u,communityWorkflow:p,conversationWorflow:m,searchWorkflow:g,isCollapsed:s,toggleCollapsedNav:v,handleLogout:_}),[a,d,p,m,o,s,l,c,g,i,v,h,f,u])}function t5(){const[t,e]=E.useState(!1);E.useEffect(()=>{r()},[]);const r=E.useCallback(async()=>{const i=await Me.session().isAdml();e(i)},[]);return{isAdml:t}}const r5=()=>{var t;const{user:e,appCode:r}=Tt(),i=jw[r],s=(t=e.apps.find(l=>l.isExternal&&l.address.includes("library")&&l.name.includes("library")))==null?void 0:t.address.split("?");let n=s==null?void 0:s[0];n!=null&&n.endsWith("/")||(n=`${n}/`);const a=s==null?void 0:s[1],o=`application%5B0%5D=${i}&page=1&sort_field=views&sort_order=desc`;return{libraryUrl:`${n}search/?${a}&${o}`}},WU=r5;function km(){const t={"last-infos-widget":"ic-widget-actualites",birthday:"ic-star","calendar-widget":"ic-widget-calendar","carnet-de-bord":"ic-widget-carnet-de-bord","record-me":"ic-widget-microphone",mood:"ic-star","my-apps":"ic-widget-apps",notes:"ic-widget-notes","rss-widget":"ic-widget-rss","bookmark-widget":"ic-widget-signets",qwant:"ic-widget-qwant","qwant-junior":"ic-widget-qwant","agenda-widget":"ic-widget-agenda","cursus-widget":"ic-widget-aide-devoirs","maxicours-widget":"ic-widget-maxicours","school-widget":"ic-widget-schoolbook","universalis-widget":"ic-widget-universalis","briefme-widget":"ic-widget-briefme"};function e(o){let l="";switch(typeof o=="string"?l=o:l=(o==null?void 0:o.icon)!==void 0?o==null?void 0:o.icon.trim().toLowerCase():"placeholder",l&&l.length>0?l.endsWith("-large")&&(l=l.replace("-large","")):typeof o=="object"&&(l=(o==null?void 0:o.displayName)!==void 0?o==null?void 0:o.displayName.trim().toLowerCase():""),l){case"admin.title":l="admin";break;case"banques des savoirs":l="banquesavoir";break;case"collaborativewall":l="collaborative-wall";break;case"communautés":l="community";break;case"directory.user":l="userbook";break;case"emploi du temps":l="edt";break;case"formulaire":l="forms";break;case"messagerie":l="conversation";break;case"news":l="actualites";break;case"homeworks":case"cahier de texte":l="cahier-de-texte";break;case"diary":case"cahier de texte 2d":l="cahier-textes";break;case"scrapbook":l="scrap-book";break}return l}function r(o){return o&&(o.startsWith("/")||o.startsWith("http://")||o.startsWith("https://"))}function i(o){const l=e(o);return l?`color-app-${l}`:"color-app-placeholder"}function s(o){const l=e(o);return l?`bg-app-${l}`:"bg-app-placeholder"}function n(o){const l=e(o);return l?`bg-light-${l}`:"bg-light-placeholder"}function a(o){return t[o.platformConf.name]}return{getIconClass:i,getBackgroundIconClass:s,getBackgroundLightIconClass:n,getIconCode:e,getWidgetIconClass:a,isIconUrl:r}}function wa(){return["/assets/themes/edifice-bootstrap/images","/assets/themes/edifice-bootstrap/icons","/assets/themes/edifice-bootstrap/fonts"]}function zw(){const{user:t,userDescription:e,userProfile:r}=Tt(),{theme:i}=Om();function s(){let n=e==null?void 0:e.picture;return(!n||n==="no-avatar.jpg"||n==="no-avatar.svg")&&(n=`${i==null?void 0:i.basePath}/img/illustrations/no-avatar.svg`),n}return{user:{...t,type:r},avatar:s(),userDescription:e}}function XU(){const[t,e]=E.useState("pending"),{currentApp:r}=Tt();E.useEffect(()=>{i()},[]);const i=async()=>{if(!r){e("[Xiti] Error, currentApp is not defined.");return}try{await Me.analytics().trackPageLoad(window.location.pathname,r),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),e(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(s){console.error("[Xiti] Error Tracking Page Load",s),e(`[Xiti] Error Tracking Page Load: ${s}`)}};return{xitiStatus:t}}const i5=E.forwardRef(({src:t,alt:e,imgPlaceholder:r,ratio:i,objectFit:s,className:n,...a},o)=>{const[l]=wa(),c=r??`${l}/common/image-placeholder.png`,{imgSrc:h,onError:f}=q4({src:t,placeholder:c}),u={"ratio ratio-1x1":i==="1","ratio ratio-4x3":i==="4","ratio ratio-16x9":i==="16","ratio ratio-21x9":i==="21"},d={"object-fit-contain":s==="contain","object-fit-cover":s==="cover","object-fit-fill":s==="fill","object-fit-scale":s==="scale","object-fit-none":s==="none"},p=re({...u}),m=re({...d},n),g=x.jsx("img",{alt:e,onError:f,ref:o,src:h,className:m,...a});return i?x.jsx("div",{className:p,children:g}):g}),iu=i5,s5=E.forwardRef(({app:t,size:e="24",iconFit:r="contain",variant:i="square"},s)=>{const{isIconUrl:n,getIconCode:a}=km(),[,o]=wa(),l=i==="square",c=i==="rounded",h=i==="circle",f=r==="contain",u=r==="ratio",d={"icon-xs":e==="24","icon-sm":e==="40","icon-md":e==="48","icon-lg":e==="80","icon-xl":e==="160"},p={square:l,rounded:c,"rounded-circle":h},m={"icon-contain":f,"icon-ratio":u},g=typeof t=="string"?t:(t==null?void 0:t.icon)!==void 0?t.icon:"placeholder",v=typeof t!="string"&&(t==null?void 0:t.displayName)!==void 0?t.displayName:"",_=t?a(t):"",y=n(g),b=_||"placeholder",w=re("app-icon",{...d,...p,...m,[`bg-light-${b}`]:b&&!f,[`color-app-${b}`]:b});return y?x.jsx(iu,{src:g,alt:v,objectFit:"contain",width:e,height:e,className:"h-full"}):x.jsx("div",{className:w,style:{width:e+"px",height:e+"px"},children:x.jsx("svg",{ref:s,width:e,height:e,role:"img",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:x.jsx("use",{xlinkHref:`${o}/apps.svg#${b}`})})})}),Ho=s5,n5=E.forwardRef(({variant:t="square",size:e="md",alt:r,src:i,imgPlaceholder:s,className:n,...a},o)=>{const[l]=wa(),c=s||`${l}/avatar/no-avatar.svg`,h=re("avatar",{"avatar-xs":e==="xs","avatar-sm":e==="sm","avatar-md":e==="md","avatar-lg":e==="lg","avatar-xl":e==="xl",square:t==="square",rounded:t==="rounded","rounded-circle":t==="circle"},n);return x.jsx("div",{ref:o,className:h,children:x.jsx(iu,{src:i||c,alt:r,imgPlaceholder:c,...a})})}),ua=n5,a5=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("breadcrumb-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})}),Sd=a5,o5=E.forwardRef(({children:t,className:e},r)=>{const i=re("breadcrumb d-flex flex-nowrap align-items-center mb-0",e);return x.jsx("ol",{ref:r,className:i,children:t})}),l5=o5,c5=E.forwardRef(({children:t,app:e,className:r},i)=>{const{t:s}=Ce(),{getIconClass:n}=km(),a=re("d-flex align-items-center mb-0",n(e),r),o={"--edifice-breadcrumb-divider":"-"};return x.jsx("nav",{ref:i,className:a,"aria-label":s("breadcrumb"),style:o,children:t})}),h5=c5,u5=E.forwardRef(({level:t="h1",headingStyle:e="h1",children:r,className:i,...s},n)=>{const a=re(e,i);return x.jsx(t,{ref:n,className:a,...s,children:r})}),ur=u5,d5=E.forwardRef(({app:t,name:e},r)=>{const{t:i}=Ce();return x.jsx(h5,{app:t,ref:r,className:"mw-100",children:x.jsx(l5,{className:"gap-12 mw-100",children:e?x.jsxs(x.Fragment,{children:[x.jsx(Sd,{children:x.jsxs("a",{href:t==null?void 0:t.address,className:"d-flex",children:[x.jsx(Qs,{variant:"ghost",color:"tertiary",icon:x.jsx(pE,{}),"aria-label":i(t==null?void 0:t.displayName)}),x.jsx(Ho,{app:t,size:"40"})]})}),x.jsx(Sd,{className:"text-truncate",children:x.jsx(ur,{level:"h1",headingStyle:"h3",className:"text-truncate",children:e})})]}):x.jsxs(Sd,{className:"gap-12 d-flex align-items-center",children:[x.jsx(Ho,{app:t,size:"40"}),x.jsx(ur,{level:"h1",headingStyle:"h3",className:"d-none d-md-flex",children:i(t==null?void 0:t.displayName)})]})})})}),YU=d5,f5=({children:t,space:e=null,flexDirection:r="row"})=>{const i=re("card-body",{[`p-${e}`]:e,[`gap-${e}`]:e,"align-items-start":r==="column","flex-column":r==="column"});return x.jsx("div",{className:i,children:t})},p5=f5,Hw=E.createContext(null),Vw=()=>{const t=E.useContext(Hw);if(!t)throw new Error("Cannot be rendered outside the Card component");return t},m5=({children:t})=>x.jsx("div",{className:"card-footer gap-16",children:t}),g5=m5,v5=()=>{const{isSelectable:t,isClickable:e,onClick:r,onSelect:i}=Vw();return t||e?x.jsxs("div",{className:"card-header",children:[t?x.jsx(Qs,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:x.jsx(vE,{}),onClick:i,variant:"ghost"}):null,e?x.jsx("button",{onClick:r,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}):null]}):null},y5=v5,b5=({imageSrc:t,className:e,variant:r="medium"})=>{const{app:i}=Vw(),s=r==="landscape"?{width:"100%",height:"auto"}:null;return x.jsx("div",{className:re("card-image",r),children:t?x.jsx(iu,{alt:"",src:t,objectFit:"cover",className:re("h-full w-100",e)}):x.jsx(Ho,{app:i,iconFit:"ratio",size:"80",variant:"rounded",...s})})},x5=b5,_5=({children:t,className:e})=>{const r=re("card-text small text-break text-truncate text-truncate-1",e);return x.jsx("p",{className:r,children:t})},w5=_5,E5=({children:t,className:e})=>{const r=re("card-title body text-break text-truncate text-truncate-1",e);return x.jsx("h3",{className:r,children:x.jsx("strong",{children:t})})},T5=E5,S5=({userSrc:t,creatorName:e})=>t?x.jsx(ua,{alt:e||"",size:"xs",src:t,variant:"circle",width:"24",height:"24"}):x.jsx(xx,{}),A5=S5,C5=E.forwardRef(({app:t,isSelectable:e=!0,isClickable:r=!0,isSelected:i=!1,onClick:s,onSelect:n,children:a,className:o},l)=>{const{getIconCode:c}=km(),h=t?c(t):"placeholder",f=E.useMemo(()=>({app:t,appCode:h,isSelectable:e,isClickable:r,onClick:s,onSelect:n}),[t,h,e,r,s,n]);return x.jsx(Hw.Provider,{value:f,children:x.jsxs("div",{ref:l,className:re("card",{"is-selected":i,"c-pointer":r},o),children:[x.jsx(Ww.Header,{}),typeof a=="function"?a(h):a]})})}),Ww=Object.assign(C5,{Title:T5,Text:w5,Image:x5,Body:p5,User:A5,Footer:g5,Header:y5}),qU=Ww,I5=E.forwardRef(({label:t,disabled:e=!1,checked:r=!1,indeterminate:i=!1,...s},n)=>{const a=E.useRef(null);E.useImperativeHandle(n,()=>({...a.current})),E.useEffect(()=>{a.current.indeterminate=i},[a,i]);const o=E.useId(),l={type:"checkbox",checked:r,disabled:e,ref:a,className:re(s.className,"form-check-input c-pointer"),id:o},c={...s,...l};return x.jsxs("div",{className:"form-check d-flex align-items-center gap-8",children:[x.jsx("input",{...c}),t&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:t})]})}),Dm=I5,R5=({children:t,message:e,icon:r=null,placement:i="auto"})=>{const[s,n]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(null),{styles:h,attributes:f}=y2(s,a,{placement:i,modifiers:[{name:"arrow",options:{element:l}}]}),[u,d]=E.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"d-inline-block position-relative z-2",ref:n,onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},children:t}),u&&x.jsxs("div",{className:re("tooltip d-block show mb-12","bs-tooltip-auto"),ref:o,style:h.popper,...f.popper,children:[x.jsxs("div",{className:"tooltip-inner shadow-hover d-flex gap-8 align-items-center",children:[r&&r,x.jsx("div",{children:e})]}),x.jsx("div",{className:"tooltip-arrow",ref:c,style:h.arrow})]})]})},P5=R5,Xw=E.createContext(null),Ea=()=>{const t=E.useContext(Xw);if(!t)throw new Error("Cannot be rendered outside the Dropdown Component");return t},Yw=E.createContext(null),su=()=>{const t=E.useContext(Yw);if(!t)throw new Error("Cannot be rendered outside the FormControl component");return t},M5=({children:t})=>{const{status:e}=su(),r=re("form-text",{"is-invalid":e==="invalid",valid:e==="valid"});return x.jsx("p",{className:r,children:x.jsx("em",{children:t})})},O5=M5,k5=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",type:i="text",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=su(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("input",{ref:a,id:o,className:f,type:i,placeholder:e,required:l,readOnly:c,...n})}),da=k5,D5=E.forwardRef(({leftIcon:t,optionalText:e="Optional",requiredText:r="*",children:i,className:s},n)=>{const{id:a,isOptional:o,isRequired:l}=su(),c=re("form-label",{"has-icon":t},s),h=o&&!l,f=l&&!o;return E.useEffect(()=>{if(o&&l)throw new Error("Cannot be optional and required at the same time")},[o,l]),x.jsxs("label",{ref:n,htmlFor:a,className:c,children:[t,i,h&&x.jsxs("em",{className:"optional",children:["- ",e]}),f&&x.jsx("em",{className:"required",children:r})]})}),Nn=D5,N5=E.forwardRef(({children:t,className:e,id:r,isOptional:i,isReadOnly:s,isRequired:n,status:a,...o},l)=>{const c=E.useMemo(()=>({id:r,isOptional:i,isRequired:n,isReadOnly:s,status:a}),[r,i,s,n,a]);return x.jsx(Yw.Provider,{value:c,children:x.jsx("div",{ref:l,className:e,...o,children:t})})}),L5=Object.assign(N5,{Label:Nn,Input:da,Text:O5}),ft=L5,B5=({placeholder:t,value:e="",handleSearchInputChange:r})=>{const{triggerProps:i,itemProps:s,setVisible:n}=Ea(),a={...i,role:"combobox",onClick:()=>{e.length>2&&n(!0)},onChange:r};return E.useEffect(()=>{n(e.length>2)},[n,e]),x.jsx(ft,{className:"d-flex align-items-center",id:"search",children:x.jsx(da,{...a,className:"max-w-512",noValidationIcon:!0,placeholder:t,size:"md",type:"search",onKeyDown:s.onMenuItemKeyDown})})},F5=B5,U5=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h=r.includes(e),f={value:e,model:r,checked:h,readOnly:!0},u=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:d=>n.current[c]=d,role:"menuitemcheckbox","aria-checked":h,onMouseUp:()=>i(e),onKeyDown:d=>o(d,()=>i(e)),onMouseEnter:l,tabIndex:h?0:-1,className:u,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(Dm,{...f})]})})},j5=U5,$5=({type:t="action",icon:e,onClick:r,children:i,...s})=>{const{itemProps:n,itemRefs:a,isFocused:o}=Ea(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:c,onMenuItemClick:h}=n,f=()=>{r==null||r(),t==="action"&&h()},u=E.useId(),d=re("dropdown-item",{focus:o===u});return x.jsx("div",{id:u,role:"menuitem",ref:p=>a.current[u]=p,tabIndex:o===u?0:-1,className:d,"aria-current":o===u,onClick:f,onMouseEnter:c,onKeyDown:p=>l(p,r),...s,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center",children:[e,i]})})},G5=$5,z5=E.forwardRef(({children:t,block:e,...r},i)=>{const{menuProps:s,visible:n}=Ea(),{className:a,...o}=s,l={...o,...r},c=re({"w-100":e},a);return n?x.jsx("div",{ref:i,className:c,...l,children:t}):null}),H5=z5,V5=E.forwardRef(({label:t,children:e},r)=>x.jsxs("div",{ref:r,role:"group",children:[x.jsx("span",{className:"small px-4",children:x.jsx("strong",{children:t})}),e]})),W5=V5,X5=E.forwardRef(({model:t,icon:e,label:r=!1,disabled:i=!1,checked:s,...n},a)=>{const o=E.useId(),l={type:"radio",checked:s,disabled:i,ref:a,className:re(n.className,"form-check-input c-pointer",e&&"d-none"),id:o},c={...n,...l};return x.jsxs("div",{className:re("form-check d-flex align-items-center gap-8",e&&"ps-0"),children:[x.jsx("input",{...c}),e&&x.jsx("label",{htmlFor:c.id,className:re("c-pointer",t!==n.value&&"text-muted"),children:e}),!e&&r&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:r})]})}),_p=X5,Y5=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h={value:e,model:r,checked:e===r,readOnly:!0},f=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:u=>n.current[c]=u,role:"menuitemradio","aria-checked":e===r,onMouseUp:()=>i(e),onKeyDown:u=>o(u,()=>i(e)),onMouseEnter:l,tabIndex:e===r?0:-1,className:f,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(_p,{...h,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})},q5=Y5,Z5=()=>x.jsx("div",{role:"separator",className:"px-4",children:x.jsx("hr",{className:"m-0"})}),K5=Z5,Q5=E.forwardRef(({label:t,icon:e,variant:r,disabled:i=!1,size:s,badgeContent:n,...a},o)=>{const{triggerProps:l,block:c}=Ea(),{className:h,...f}=l,u={...f,...a},d=re("dropdown-toggle ",s,r,{"w-100":c},h);return x.jsxs("button",{ref:o,className:d,disabled:i,...u,children:[e||null,t,n?x.jsx("span",{className:"badge text-bg-secondary rounded-pill",children:n}):x.jsx(yE,{width:16,height:16,className:"dropdown-toggle-caret"})]})}),J5=Q5,e6=({children:t,block:e,overflow:r=!0,placement:i="bottom-start",extraTriggerKeyDownHandler:s})=>{const{visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,setVisible:f}=W4(i,s),u=$w(()=>f(!1)),d=E.useMemo(()=>({visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,block:e,setVisible:f}),[n,a,o,l,c,h,e,f]),p=re("dropdown",{"w-100":e,overflow:r});return x.jsx(Xw.Provider,{value:d,children:x.jsx("div",{ref:u,className:p,children:typeof t=="function"?t(o,h):t})})},t6=Object.assign(e6,{Trigger:J5,Menu:H5,Item:G5,Separator:K5,CheckboxItem:j5,RadioItem:q5,MenuGroup:W5}),ot=t6,Nm=({onSearchResultsChange:t,onSearchInputChange:e,options:r,value:i,isLoading:s,noResult:n,placeholder:a})=>{const{t:o}=Ce(),[l,c]=E.useState([]);E.useEffect(()=>{t(l)},[l]);const h=u=>{c([u])},f=()=>s?x.jsxs("div",{className:"d-flex align-items-center p-4",children:[x.jsx(Lw,{isLoading:s}),x.jsx("span",{className:"ps-4",children:o("explorer.search.pending")})]}):n?x.jsx("div",{className:"p-4",children:o("portal.no.result")}):r.map((u,d)=>x.jsxs(E.Fragment,{children:[x.jsx(ot.Item,{type:"select",onClick:()=>h(u.value),children:u.label}),d<r.length-1&&x.jsx(ot.Separator,{})]},d));return x.jsxs(ot,{block:!0,children:[x.jsx(Nm.Trigger,{placeholder:a,handleSearchInputChange:e,value:i}),x.jsx(ot.Menu,{children:f()})]})};Nm.Trigger=F5;const r6=Nm,i6=({imageSrc:t,imageAlt:e="",title:r,text:i,className:s})=>{const n=re("text",s);return x.jsxs("div",{className:"emptyscreen",children:[t&&x.jsx("div",{className:"emptyscreen-image mb-12",children:x.jsx("img",{className:"mx-auto",src:t,alt:e,width:"250",height:"250"})}),r&&x.jsx(ur,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:r}),i&&x.jsx("div",{className:n,children:i})]})},ZU=i6,s6=({children:t,className:e,...r})=>{const i=re("grid",e);return x.jsx("div",{className:i,...r,children:t})},n6=({sm:t,md:e,lg:r,xl:i,children:s,className:n,as:a,...o})=>{const l=a||"div",c=re({[`g-col-${t}`]:t,[e?`g-col-md-${e}`:""]:e,[r?`g-col-lg-${r}`:""]:r,[i?`g-col-xl-${i}`:""]:i},n);return x.jsx(l,{className:c,...o,children:s})};s6.Col=n6;const a6=E.forwardRef(({label:t,addButtonLabel:e="Add image",deleteButtonLabel:r="Delete image",src:i,className:s,app:n,onUploadImage:a,onDeleteImage:o},l)=>{const[c,h]=E.useState(i||""),{inputRef:f,files:u,deleteFile:d,handleOnChange:p,handleDragging:m,handleDragLeave:g,handleDrop:v}=Y4();E.useEffect(()=>{if(u.length>0){d(u[0]),h("");const w=u==null?void 0:u[0];if(!w)return;h(URL.createObjectURL(w)),a(w)}},[u]);const _=()=>{var w;(w=f.current)==null||w.click()},y=()=>{f.current&&(f.current.value=""),d(u[0]),h(""),o()},b=re("image-input",s);return x.jsxs(ft,{id:"image-input",className:b,onDragEnter:m,onDragOver:m,onDragLeave:g,onDrop:v,ref:l,children:[x.jsxs("div",{className:"image-input-actions gap-8",children:[x.jsx(Qs,{"aria-label":e,color:"tertiary",icon:x.jsx(lE,{}),onClick:_,type:"button",variant:"ghost"}),x.jsx(Qs,{"aria-label":r,color:"danger",disabled:!c,icon:x.jsx(cE,{width:"20",height:"20"}),onClick:y,type:"button",variant:"ghost"})]}),x.jsxs(ft.Label,{children:[x.jsx("span",{className:"visually-hidden",children:t}),x.jsx(da,{accept:"image/*",hidden:!0,onChange:p,ref:f,size:"sm",type:"file"}),c?x.jsx(ua,{alt:"",src:c,size:"xl"}):x.jsx(Ho,{app:n,iconFit:"ratio",size:"160",variant:"rounded"})]})]})}),qw=a6,o6=E.forwardRef(({position:t=!0,caption:e},r)=>{const[i]=wa(),s=`${i}/loading/screen-loading.gif`,n=re("top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-content-center align-items-center z-2000",{"position-fixed":!t,"position-static":t}),a=re("text-center pt-12",{"text-white":!t});return x.jsxs(x.Fragment,{children:[x.jsxs("div",{ref:r,className:n,children:[x.jsx("div",{className:"bg-white rounded-circle mx-auto w-25",children:x.jsx("img",{src:s,alt:"loading"})}),e&&x.jsx("div",{className:a,children:e})]}),!t&&x.jsx("div",{className:"modal-backdrop fade show"})]})}),KU=o6,l6=E.forwardRef(({src:t,is1d:e,translate:r="Retour accueil"},i)=>{const s=re("navbar-brand d-none d-md-block");return x.jsx("a",{ref:i,className:s,href:"/timeline/timeline","aria-label":r,children:x.jsx("img",{className:"logo",src:t,alt:`logo ${e?"ONE":"NEO"}`,width:"300",height:"52"})})}),Iy=l6,Zw=E.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""}),Kw=()=>{const t=E.useContext(Zw);if(!t)throw new Error("Cannot be rendered outside the Modal component");return t},c6=t=>{const{ariaDescriptionId:e}=Kw(),{children:r,className:i}=t,s=re("modal-body",i);return x.jsx("div",{id:e,className:s,children:r})},h6=c6,u6=t=>x.jsx("div",{className:"modal-footer",children:t.children}),d6=u6,f6=t=>{const{onModalClose:e,children:r}=t,{ariaLabelId:i,focusId:s}=Kw(),n=E.useRef(null);return E.useEffect(()=>{var a;s||(a=n.current)==null||a.focus()},[s]),x.jsxs("div",{className:"modal-header",children:[x.jsx("h2",{id:i,className:"modal-title",tabIndex:-1,children:r}),x.jsx(Qs,{ref:n,"aria-label":"Close",color:"tertiary",icon:x.jsx(Zy,{}),type:"button",variant:"ghost",title:"Delete",onClick:e,className:"btn-close"})]})},p6=f6,m6=t=>x.jsx("p",{className:"modal-subtitle",children:t.children}),g6=m6,v6=E.forwardRef((t,e)=>{const{id:r,isOpen:i,onModalClose:s,size:n="md",viewport:a=!1,scrollable:o=!1,focusId:l,children:c}=t,h=`aria_label_${r}`,f=`aria_desc_${r}`,u=$w(s),d=J4();Z4(s,["Escape"]),E.useEffect(()=>{if(i&&(document.body.style.overflow="hidden",l)){const _=document.getElementById(l);_==null||_.focus()}return()=>{document.body.style.overflow=""}},[l,i]);const p=re("modal fade",{"show d-block":i,"modal-scrollable":o,viewport:a,[`modal-${n}`]:n}),m=re("modal-dialog"),g={ariaLabelId:h,ariaDescriptionId:f,focusId:l},v=cx(i,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return x.jsx(Zw.Provider,{value:g,children:v((_,y)=>x.jsxs(x.Fragment,{children:[y&&x.jsx(of.div,{id:r,ref:e,role:"dialog","aria-modal":"true","aria-labelledby":h,"aria-describedby":f,className:p,style:_,tabIndex:-1,children:x.jsx("div",{id:`${r}_ref`,ref:b=>{u.current=b,y&&(d.current=b)},className:m,children:x.jsx("div",{className:"modal-content",children:c})})}),y&&x.jsx(of.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),y6=Object.assign(v6,{Header:p6,Subtitle:g6,Body:h6,Footer:d6}),je=y6,b6=({children:t,className:e})=>{const r=re("popover-body",e);return x.jsx("div",{className:r,children:t})},x6=({children:t,className:e})=>{const r=re("popover-footer p-8",e);return x.jsx("div",{className:r,children:t})},Qw=E.forwardRef(({children:t,className:e,id:r,isVisible:i,...s},n)=>{const a=re("popover d-block position-absolute top-100 start-50 translate-middle-x",e);return cx(i,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((o,l)=>l&&x.jsx(of.div,{ref:n,"aria-labelledby":r,className:a,role:"tooltip",style:o,...s,children:t}))}),_6=t=>x.jsx(ot.Trigger,{...t,"aria-haspopup":"listbox",role:"combobox"}),w6=_6,E6=({icon:t,options:e,overflow:r,block:i,variant:s,size:n,disabled:a,placeholderOption:o,onValueChange:l})=>{const[c,h]=E.useState(),{t:f}=Ce();E.useEffect(()=>{if(c){const d=typeof c=="object"?c.value:c;l==null||l(d)}},[c]);const u=typeof c=="object"?c.label:c;return x.jsxs(ot,{overflow:r,block:i,children:[x.jsx(w6,{icon:t,label:f(u||o),variant:s,size:n,disabled:a}),x.jsx(ot.Menu,{role:"listbox",children:e==null?void 0:e.map(d=>{const p=typeof d=="object"?d.value:d,m=typeof d=="object"?d.label:d;return x.jsx(ot.Item,{type:"action",onClick:()=>h(d),children:m},p)})})]})},Jw=E6,T6=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",height:i="md",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=su(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","textarea-height-lg":i==="lg","textarea-height-md":i==="md","textarea-height-sm":i==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("textarea",{ref:a,id:o,className:f,placeholder:e,required:l,readOnly:c,...n})}),eE=T6;function S6(t,e,r,i,s,n,a,o,l){const c=u=>{u.preventDefault(),s==null||s(t),u.stopPropagation()},h=u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),s==null||s(t),u.stopPropagation())},f=()=>{i(!r),r?n==null||n(t):a==null||a(t)};return{handleItemClick:c,handleItemKeyDown:h,handleItemFoldUnfoldClick:u=>{u.preventDefault(),f(),u.stopPropagation()},handleItemFoldUnfoldKeyDown:u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),f(),u.stopPropagation())},handleItemFocus:u=>{u.preventDefault(),o==null||o(t)},handleItemBlur:u=>{u.preventDefault(),l==null||l(t)}}}const A6=t=>{const{nodeId:e,label:r,children:i,section:s,selected:n,onItemSelect:a,onItemFold:o,onItemUnfold:l,onItemFocus:c,onItemBlur:h,selectedNodesIds:f}=t,[u,d]=E.useState(!1),{handleItemClick:p,handleItemKeyDown:m,handleItemFoldUnfoldClick:g,handleItemFoldUnfoldKeyDown:v,handleItemFocus:_,handleItemBlur:y}=S6(e,r,u,d,a,o,l,c,h);E.useEffect(()=>{if(f!=null&&f.length&&(f==null?void 0:f.length)>=1){const S=f[f.length-1];f.some(T=>T===e&&e!==S?(d(!0),T===e):(d(!1),!1))}else d(!1)},[e,f]);const b=s?16:12,w=()=>x.jsx("li",{id:`listitem_${e}`,role:"treeitem","aria-selected":n,"aria-expanded":u,children:x.jsxs("div",{children:[x.jsxs("div",{className:"action-container d-flex align-items-center gap-8 px-2",children:[x.jsxs("div",{className:`py-8 ${Array.isArray(i)?null:"invisible"}`,tabIndex:0,role:"button",onClick:g,onKeyDown:v,"aria-label":"fold/unfold button",children:[Array.isArray(i)&&!u&&x.jsx(Bm,{title:"RafterRight",width:b,height:b}),Array.isArray(i)&&u&&x.jsx(po,{title:"RafterDown",width:b,height:b}),!Array.isArray(i)&&x.jsx(Bm,{title:"RafterRight",width:b,height:b,"aria-hidden":"true"})]}),x.jsxs("div",{tabIndex:0,role:"button",className:"flex-fill d-flex align-items-center text-truncate gap-8 py-8",onClick:p,onKeyDown:m,onFocus:_,onBlur:y,children:[s&&x.jsx(bE,{title:"Folder",width:20,height:20}),x.jsx("span",{className:"text-truncate",children:r})]})]}),Array.isArray(i)&&x.jsx("ul",{role:"group",children:i})]})},e);return s?x.jsx("ul",{role:"tree",className:"m-0 p-0",children:w()}):w()},C6=A6,I6=E.forwardRef((t,e)=>{const{data:r,onTreeItemSelect:i,onTreeItemFold:s,onTreeItemUnfold:n,onTreeItemFocus:a,onTreeItemBlur:o,selectedNodesIds:l}=t,[c,h]=E.useState(null);E.useEffect(()=>{l!=null&&l.length&&(l==null?void 0:l.length)>=1?h(l[l.length-1]):h(null)},[l]);const f=E.useMemo(()=>({unselectAll(){h(null)},select(v){h(v),i==null||i(v)}}),[i]);E.useImperativeHandle(e,()=>f,[f]);const u=v=>{s==null||s(v)},d=v=>{n==null||n(v)},p=v=>{a==null||a(v)},m=v=>{o==null||o(v)},g=v=>x.jsx(C6,{nodeId:v.id,label:v.name,section:v.section,selectedNodesIds:l,selected:c===v.id,onItemSelect:f.select,onItemFold:u,onItemUnfold:d,onItemFocus:p,onItemBlur:m,children:Array.isArray(v.children)?v.children.map(_=>g(_)):null},v.id);return x.jsx("div",{className:"treeview",children:g(r)})}),QU=I6,R6=E.forwardRef(({children:t},e)=>x.jsx("span",{className:"visually-hidden",ref:e,children:t})),Hi=R6,P6=async t=>await Me.conf().getPreference(t),M6=async t=>await Me.conf().savePreference(t,JSON.stringify({showOnboardingTrash:!1})),O6=t=>{const[e,r]=E.useState(!0),[i,s]=E.useState(!1);return E.useEffect(()=>{(async()=>{const n=await P6(t);if(n){const{showOnboardingTrash:a}=n;s(a);return}s(!0)})()},[t]),{isOpen:e,setIsOpen:r,isOnboardingTrash:i,handleSavePreference:async()=>{await M6(t),r(!1)}}},k6=({id:t,items:e,modalOptions:r})=>{const[i]=wa(),[s,n]=E.useState(),[a,o]=E.useState(0),{isOpen:l,isOnboardingTrash:c,setIsOpen:h,handleSavePreference:f}=O6(t);E.useEffect(()=>{const v=document.createElement("link");return v.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",v.rel="stylesheet",v.type="text/css",document.head.appendChild(v),()=>{document.head.removeChild(v)}},[]);const{t:u}=Ce(),{title:d,prevText:p,closeText:m,nextText:g}=r;return c?rs.createPortal(x.jsxs(je,{id:"onboarding-modal",size:"md",isOpen:l,focusId:"nextButtonId",onModalClose:()=>h(!1),children:[x.jsx(je.Header,{onModalClose:()=>h(!1),children:u(d||"explorer.modal.onboarding.trash.title")}),x.jsx(je.Body,{children:x.jsx(Nx,{modules:[X2],onSwiper:v=>{n(v)},onSlideChange:v=>{o(v.progress)},pagination:{clickable:!0},children:e.map((v,_)=>x.jsxs(Lx,{children:[x.jsx(iu,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:`${i}/${v.src}`,alt:u(v.alt)}),x.jsx("p",{children:u(v.text)})]},_))})}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>h(!1),children:u("explorer.modal.onboarding.trash.later")}),a>0&&x.jsx(tt,{type:"button",color:"primary",variant:"outline",onClick:()=>s.slidePrev(),children:u(p||"explorer.modal.onboarding.trash.prev")}),a<1&&x.jsx(tt,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>s.slideNext(),children:u(g||"explorer.modal.onboarding.trash.next")}),a===1&&x.jsx(tt,{type:"button",color:"primary",variant:"filled",onClick:f,children:u(m||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null},JU=k6,D6=()=>{const{t}=Ce();return[{value:"bpr.activityType.classroomActivity",label:t("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:t("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:t("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:t("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:t("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:t("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:t("bpr.activityType.courseElement")},{value:"bpr.other",label:t("bpr.other")}]},N6=({control:t,selectedActivities:e,selectActivities:r})=>{const i=D6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(vh,{name:"activityType",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(ot,{block:!0,overflow:!0,children:[x.jsx(ot.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:e==null?void 0:e.length}),x.jsx(ot.Menu,{children:i.map((a,o)=>x.jsx(ot.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})},L6=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],Ry=({name:t,control:e,placeholderOption:r,validate:i})=>x.jsx(vh,{name:t,control:e,rules:{required:!0,validate:i},render:({field:{onChange:s}})=>x.jsx(Jw,{block:!0,size:"md",onValueChange:s,options:L6,"aria-required":!0,placeholderOption:r})}),B6=()=>{const{t}=Ce();return[{value:"de_DE",label:t("de_DE")},{value:"en_EN",label:t("en_EN")},{value:"ar_DZ",label:t("ar_DZ")},{value:"es_ES",label:t("es_ES")},{value:"fr_FR",label:t("fr_FR")},{value:"it_IT",label:t("it_IT")},{value:"ja_JP",label:t("ja_JP")},{value:"zh_CN",label:t("zh_CN")},{value:"pt_PT",label:t("pt_PT")},{value:"ru_RU",label:t("ru_RU")},{value:"bpr.other",label:t("bpr.other")}]},F6="bpr.form.publication.language",U6=({control:t})=>{const e=B6();return x.jsx("div",{className:"col",children:x.jsx(vh,{name:"language",control:t,rules:{required:!0},render:({field:{onChange:r}})=>x.jsx(Jw,{block:!0,size:"md",onValueChange:r,options:e,"aria-required":!0,placeholderOption:F6})})})},j6=()=>{const{t}=Ce(),[e]=wa();return x.jsxs(x.Fragment,{children:[x.jsxs("ul",{className:"mb-12",children:[x.jsxs("li",{children:[t("bpr.form.publication.licence.text.1"),x.jsx("img",{className:"ms-8 d-inline-block",src:`${e}/common/image-creative-commons.png`,alt:"licence creative commons"})]}),x.jsx("li",{children:t("bpr.form.publication.licence.text.2")})]}),x.jsx(zi,{type:"info",className:"mb-12",children:t("bpr.form.publication.licence.text.3")}),x.jsx(zi,{type:"warning",children:t("bpr.form.publication.licence.text.4")})]})},$6=()=>{const{t}=Ce();return[{value:"bpr.subjectArea.artActivity",label:t("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:t("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:t("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:t("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:t("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:t("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:t("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:t("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:t("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:t("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:t("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:t("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:t("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:t("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:t("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:t("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:t("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:t("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:t("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:t("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:t("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:t("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:t("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:t("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:t("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:t("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:t("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:t("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:t("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:t("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:t("bpr.subjectArea.technology")},{value:"bpr.other",label:t("bpr.other")}]},G6=({control:t,selectedSubjectAreas:e,selectSubjects:r})=>{const i=$6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(vh,{name:"subjectArea",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(ot,{block:!0,overflow:!0,children:[x.jsx(ot.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:e==null?void 0:e.length}),x.jsx(ot.Menu,{children:i.map((a,o)=>x.jsx(ot.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})};function Py({formData:t}){const{t:e}=Ce(),r=i=>i.match(/^\s/);return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.error.title")}),x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("strong",{children:e("bpr.form.publication.response.error.content")})}),x.jsxs("ul",{children:[r(t.title)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.title")})}),r(t.description)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.description")})})]})]})}function z6({result:t}){const{t:e}=Ce();return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.success.title")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.1")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.2")}),t.details.front_url&&x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("a",{className:"button right-magnet",href:t.details.front_url,target:"_blank",rel:"noreferrer",children:e("bpr.form.publication.response.success.button")})})]})}function H6({onSuccess:t,resource:e}){const{user:r,appCode:i}=Tt(),s=ru(),[n,a]=E.useState(e.thumbnail||""),{control:o,register:l,watch:c,setValue:h,handleSubmit:f,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m}}=Yy({mode:"onChange"}),[g,v]=E.useState([]),[_,y]=E.useState([]),b=(w,S,T)=>{let C=[...S];const A=C.findIndex(M=>M===w);S.includes(w)?C=S.filter((M,I)=>I!==A):C=[...S,w],T(C)};return{control:o,cover:n,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m},handleDeleteImage:()=>a(""),handlePublish:async w=>{const S=r?r==null?void 0:r.userId:"";try{let T=new Blob;typeof n=="string"?T=await Me.http().get(n,{responseType:"blob"}):n?T=await Me.http().get(URL.createObjectURL(n),{responseType:"blob"}):e.thumbnail&&(T=await Me.http().get(e.thumbnail,{responseType:"blob"}));const C=await Me.http().get(`/userbook/avatar/${S}?thumbnail=48x48`,{responseType:"blob"}),A=await Me.http().get(`/directory/user/${S}/attachment-school`,{responseType:"json"}),M=jw[i],I={activityType:g,age:[w.ageMin,w.ageMax],application:M,cover:T,description:w.description,keyWords:w.keyWords,language:w.language,licence:"CC-BY",resourceId:e.assetId,resourceEntId:e.assetId,subjectArea:_,teacherAvatar:C,title:w.title,userId:S,userStructureName:A.name||(r==null?void 0:r.structureNames[0])},k=await Me.resource(i).publish(I);k.success?s.success(x.jsx(z6,{result:k}),{duration:1e4}):s.error(x.jsx(Py,{formData:w})),t==null||t()}catch(T){console.error(T),s.error(x.jsx(Py,{formData:w}))}},handleSubmit:f,handleUploadImage:w=>a(w),register:l,selectActivities:w=>{b(w,g,v)},selectedActivities:g,selectedSubjectAreas:_,selectSubjects:w=>{b(w,_,y)},setValue:h,watch:c}}function e8({isOpen:t,resource:e,onSuccess:r,onCancel:i}){const{currentApp:s}=Tt(),{t:n}=Ce(),{control:a,cover:o,formState:{isDirty:l,isValid:c,isSubmitting:h},handleDeleteImage:f,handleSubmit:u,handleUploadImage:d,handlePublish:p,register:m,selectActivities:g,selectedActivities:v,selectedSubjectAreas:_,selectSubjects:y}=H6({resource:e,onSuccess:r}),b="bpr.form.publication.age.min",w="bpr.form.publication.age.max";return rs.createPortal(x.jsxs(je,{isOpen:t,onModalClose:i,id:"libraryModal",size:"lg",children:[x.jsx(je.Header,{onModalClose:i,children:n("bpr.publish")}),x.jsx(je.Subtitle,{children:n("bpr.form.tip")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.heading.general")}),x.jsxs("form",{id:"libraryModalForm",onSubmit:u(p),children:[x.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[x.jsxs("div",{style:{maxWidth:"160px"},children:[x.jsx("div",{className:"form-label",children:n("bpr.form.publication.cover.title")}),x.jsx(qw,{app:s,src:e.thumbnail,label:n("bpr.form.publication.cover.upload.label"),addButtonLabel:n("bpr.form.publication.cover.upload.add"),deleteButtonLabel:n("bpr.form.publication.cover.upload.remove"),onUploadImage:d,onDeleteImage:f,className:"align-self-center"}),!o&&x.jsx("p",{className:"form-text is-invalid",children:x.jsx("em",{children:n("bpr.form.publication.cover.upload.required.image")})})]}),x.jsxs("div",{className:"flex-fill",children:[x.jsxs(ft,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.title")}),x.jsx(da,{type:"text",defaultValue:e.name,...m("title",{required:!0}),placeholder:n("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ft,{id:"description",isRequired:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.description")}),x.jsx(eE,{...m("description",{required:!0}),placeholder:n("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.heading.infos")}),x.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[x.jsx(N6,{control:a,selectedActivities:v,selectActivities:g}),x.jsx(G6,{control:a,selectedSubjectAreas:_,selectSubjects:y}),x.jsx(U6,{control:a})]}),x.jsxs("div",{className:"mb-24",children:[x.jsx("label",{htmlFor:"",className:"form-label",children:n("bpr.form.publication.age")}),x.jsxs("div",{className:"d-flex gap-8",children:[x.jsx("div",{className:"col col-2",children:x.jsx(Ry,{control:a,name:"ageMin",placeholderOption:b,validate:(S,T)=>parseInt(S)<=parseInt(T.ageMax)})}),x.jsx("div",{className:"col col-2",children:x.jsx(Ry,{control:a,name:"ageMax",placeholderOption:w,validate:(S,T)=>parseInt(S)>=parseInt(T.ageMin)})})]})]}),x.jsx("div",{className:"mb-24",children:x.jsxs(ft,{id:"keywords",isOptional:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.keywords")}),x.jsx(da,{type:"text",...m("keyWords"),size:"md",placeholder:n("bpr.form.publication.keywords.placeholder")})]})}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.licence.text")}),x.jsx(j6,{})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:i,type:"button",variant:"ghost",children:n("cancel")}),x.jsx(tt,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:h,disabled:!o||h||!l||!c,children:n("bpr.form.submit")})]})]}),document.getElementById("portal"))}const My=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function V6(t,e){e?e={...My,...e}:e=My;const r=tE(e);return r.dispatch(t),r.toString()}const W6=Object.freeze(["prototype","__proto__","constructor"]);function tE(t){let e="",r=new Map;const i=s=>{e+=s};return{toString(){return e},getContext(){return r},dispatch(s){return t.replacer&&(s=t.replacer(s)),this[s===null?"null":typeof s](s)},object(s){if(s&&typeof s.toJSON=="function")return this.object(s.toJSON());const n=Object.prototype.toString.call(s);let a="";const o=n.length;o<10?a="unknown:["+n+"]":a=n.slice(8,o-1),a=a.toLowerCase();let l=null;if((l=r.get(s))===void 0)r.set(s,r.size);else return this.dispatch("[CIRCULAR:"+l+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return i("buffer:"),i(s.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this[a]?this[a](s):t.ignoreUnknown||this.unkown(s,a);else{let c=Object.keys(s);t.unorderedObjects&&(c=c.sort());let h=[];t.respectType!==!1&&!Oy(s)&&(h=W6),t.excludeKeys&&(c=c.filter(u=>!t.excludeKeys(u)),h=h.filter(u=>!t.excludeKeys(u))),i("object:"+(c.length+h.length)+":");const f=u=>{this.dispatch(u),i(":"),t.excludeValues||this.dispatch(s[u]),i(",")};for(const u of c)f(u);for(const u of h)f(u)}},array(s,n){if(n=n===void 0?t.unorderedArrays!==!1:n,i("array:"+s.length+":"),!n||s.length<=1){for(const l of s)this.dispatch(l);return}const a=new Map,o=s.map(l=>{const c=tE(t);c.dispatch(l);for(const[h,f]of c.getContext())a.set(h,f);return c.toString()});return r=a,o.sort(),this.array(o,!1)},date(s){return i("date:"+s.toJSON())},symbol(s){return i("symbol:"+s.toString())},unkown(s,n){if(i(n),!!s&&(i(":"),s&&typeof s.entries=="function"))return this.array(Array.from(s.entries()),!0)},error(s){return i("error:"+s.toString())},boolean(s){return i("bool:"+s)},string(s){i("string:"+s.length+":"),i(s)},function(s){i("fn:"),Oy(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this.object(s)},number(s){return i("number:"+s)},xml(s){return i("xml:"+s.toString())},null(){return i("Null")},undefined(){return i("Undefined")},regexp(s){return i("regex:"+s.toString())},uint8array(s){return i("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},uint8clampedarray(s){return i("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},int8array(s){return i("int8array:"),this.dispatch(Array.prototype.slice.call(s))},uint16array(s){return i("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},int16array(s){return i("int16array:"),this.dispatch(Array.prototype.slice.call(s))},uint32array(s){return i("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},int32array(s){return i("int32array:"),this.dispatch(Array.prototype.slice.call(s))},float32array(s){return i("float32array:"),this.dispatch(Array.prototype.slice.call(s))},float64array(s){return i("float64array:"),this.dispatch(Array.prototype.slice.call(s))},arraybuffer(s){return i("arraybuffer:"),this.dispatch(new Uint8Array(s))},url(s){return i("url:"+s.toString())},map(s){i("map:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},set(s){i("set:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},file(s){return i("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},blob(){if(t.ignoreUnknown)return i("[blob]");throw new Error(`Hashing Blob objects is currently not supported
1345
+ }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=pN(e)),typeof e=="number"?fN(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const r=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&r<1&&(e+=(r*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${n} ${e}`}reset(){Object.assign(this,xn.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(r=>setTimeout(r,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=X.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};xp.availableFonts={},xp.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Td=xp;const ac=class _n extends xa{constructor(e="",r={}){super(Q.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=Q.from(i,{scaleMode:X.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new me,s.trim=new me,this.texture=s;const n="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(n,"svg"),l=document.createElementNS(n,"foreignObject"),c=document.createElementNS(a,"div"),h=document.createElementNS(a,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",o.appendChild(l),this.maxWidth=_n.defaultMaxWidth,this.maxHeight=_n.defaultMaxHeight,this._domElement=c,this._styleElement=h,this._svgRoot=o,this._foreignObject=l,this._foreignObject.appendChild(h),this._foreignObject.appendChild(c),this._image=i,this._loadImage=new Image,this._autoResolution=_n.defaultAutoResolution,this._resolution=_n.defaultResolution??X.RESOLUTION,this.text=e,this.style=r}measureText(e){var h,f;const{text:r,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:r,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:a,height:o}=n;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const l=Math.min(this.maxWidth,Math.ceil(a)),c=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),r!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(s)}),this._styleElement.textContent=(f=this._style)==null?void 0:f.toGlobalCSS()),{width:l+i.padding*2,height:c+i.padding*2}}async updateText(e=!0){const{style:r,_image:i,_loadImage:s}=this;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),!this.dirty&&e)return;const{width:n,height:a}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(l=>{s.onload=async()=>{if(o<this._updateID){l();return}await r.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),l()};const c=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(c)}`})}get source(){return this._image}updateTexture(){const{style:e,texture:r,_image:i,resolution:s}=this,{padding:n}=e,{baseTexture:a}=r;r.trim.width=r._frame.width=i.width/s,r.trim.height=r._frame.height=i.height/s,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-n*2,r.orig.height=r._frame.height-n*2,this._onTextureUpdate(),a.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,n,a,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},_n.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=r,(s=this._svgRoot)==null||s.remove(),this._svgRoot=r,(n=this._domElement)==null||n.remove(),this._domElement=r,(a=this._foreignObject)==null||a.remove(),this._foreignObject=r,(o=this._styleElement)==null||o.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const r=$i(this.scale.x)||1;this.scale.x=r*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const r=$i(this.scale.y)||1;this.scale.y=r*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof Td?(this.ownsStyle=!1,this._style=e):e instanceof ts?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Td.from(e)):(this.ownsStyle=!0,this._style=new Td(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};ac.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},ac.defaultMaxWidth=2024,ac.defaultMaxHeight=2024,ac.defaultAutoResolution=!0;const A4=E.forwardRef(({children:t},e)=>x.jsx("div",{ref:e,className:"actionbar",children:t})),$U=A4,C4=E.forwardRef((t,e)=>{const{isLoading:r,loadingIcon:i,loadingPosition:s="left",children:n,className:a,...o}=t,l=()=>{let h;return i?h=i:h=x.jsx(mE,{...o,"aria-label":"Loading"}),h},c=re("loading",{"is-loading":r},a);return x.jsxs("div",{className:c,role:"status",ref:e,children:[(!s||s==="left")&&l(),n,s==="right"&&l()]})}),Lw=C4,I4=E.forwardRef(({color:t="primary",type:e="button",size:r="md",children:i,isLoading:s,loadingIcon:n,loadingPosition:a,leftIcon:o,rightIcon:l,className:c,variant:h="filled",...f},u)=>{const d=re("btn",{[`btn-filled btn-${t}`]:h==="filled",[`btn-${h}-${t}`]:h==="outline"||h==="ghost","btn-icon":!i,"btn-loading":s,"btn-lg":r==="lg","btn-sm":r==="sm"},c);return x.jsx("button",{ref:u,className:d,type:e,...f,children:s?x.jsx(Lw,{isLoading:!0,loadingIcon:n,loadingPosition:a,children:i}):x.jsxs("span",{children:[o,i,l]})})}),tt=I4,R4=E.forwardRef(({icon:t,className:e,...r},i)=>{const s={...r,className:re("btn-icon btn-sm",e)};return x.jsx(tt,{ref:i,...s,children:t})}),Qs=R4,P4=E.forwardRef(({icon:t=x.jsx(gE,{}),onClick:e,className:r,...i},s)=>{const n=re("btn-search",r);return x.jsx(Qs,{ref:s,className:n,icon:t,onClick:e,...i})}),M4=P4,O4=E.forwardRef(({type:t="success",className:e="",children:r,button:i,isDismissible:s=!1,isToast:n=!1,isConfirm:a=!1,position:o="none",autoClose:l=!1,autoCloseDelay:c=3e3,onClose:h,onVisibilityChange:f},u)=>{const[d,p]=E.useState(!0),m=E.useRef(null),{t:g}=Ce(),v=E.useCallback(()=>{p(!1),h==null||h()},[h]);E.useImperativeHandle(u,()=>({show:_,hide:v,...m.current})),E.useLayoutEffect(()=>{f==null||f(d)},[d,f]),E.useEffect(()=>{l&&d&&setTimeout(()=>{v()},c)},[l,c,v,d]);const _=()=>{p(!0)},y={success:{icon:x.jsx(uE,{}),classModifier:"alert-success"},warning:{icon:x.jsx(dE,{}),classModifier:"alert-warning"},info:{icon:x.jsx(qy,{}),classModifier:"alert-info"},danger:{icon:x.jsx(fE,{}),classModifier:"alert-danger"}},b={"is-dismissible":s,"is-toast ":n},w={"is-confirm":a},S=re("alert gap-12",y[t].classModifier,b,w,o,e);return x.jsx(x.Fragment,{children:d?x.jsxs("div",{ref:m,className:S,role:"alert",children:[!a&&y[t].icon,x.jsx("div",{className:"alert-content small",children:r}),i&&x.jsxs("div",{className:"ms-12",children:[i," ",a&&x.jsx(tt,{onClick:v,children:g("close")})]}),(s||a)&&x.jsx("div",{className:"btn-close-container",children:x.jsx("button",{type:"button",className:"btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:v})}),l&&x.jsx("div",{className:"alert-progress",style:{transform:"scaleX(0)"}})]}):null})}),zi=O4,k4=E.forwardRef(({children:t,render:e,isFullscreen:r=!1},i)=>{const s=re("d-flex flex-wrap p-16 gap-8 border-bottom bg-white",{"justify-content-between":e,"mx-n16":!r,"z-3 top-0 start-0 end-0 position-fixed":r});return x.jsxs("div",{ref:i,className:s,children:[t,e?x.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:e()}):null]})}),GU=k4;function Bw({appCode:t}){return pb({queryKey:["conf"],queryFn:async()=>await Me.conf().getConf(t),suspense:!0})}function D4(t){return{getPreference:async()=>await Me.conf().getPreference(t),savePreference:async e=>await Me.conf().savePreference(t,JSON.stringify(e))}}function N4(){const[t,e]=E.useState(!1),{getPreference:r,savePreference:i}=D4("rgpdCookies");return E.useEffect(()=>{(async()=>{const s=await r();e(s)})()},[]),{showCookiesConsent:t,handleConsultCookies:()=>{document.location.href="/userbook/mon-compte",i({showInfoTip:!1}),e(!1)},handleCloseCookiesConsent:()=>{i({showInfoTip:!1}),e(!1)}}}function L4(){return pb({queryKey:["session"],queryFn:async()=>await Me.session().getSession(),suspense:!0})}const Fw=E.createContext(null);function zU({children:t,params:e}){const r=e.app,{t:i}=Ce(),s=i(r),n=L4(),a=Bw({appCode:r}),{showCookiesConsent:o,handleConsultCookies:l,handleCloseCookiesConsent:c}=N4(),h=(a==null?void 0:a.isSuccess)&&(n==null?void 0:n.isSuccess);E.useEffect(()=>{var u,d;(d=document.querySelector("html"))==null||d.setAttribute("lang",((u=n==null?void 0:n.data)==null?void 0:u.currentLanguage)||"fr")},[n==null?void 0:n.data]),E.useEffect(()=>{document.title=`${s}`},[r,n.data,s]);const f=E.useMemo(()=>{var u,d,p,m,g,v;return{appCode:r,applications:(u=a==null?void 0:a.data)==null?void 0:u.applications,confQuery:a,currentApp:(d=a==null?void 0:a.data)==null?void 0:d.currentApp,currentLanguage:(p=n==null?void 0:n.data)==null?void 0:p.currentLanguage,init:h,sessionQuery:n,user:(m=n==null?void 0:n.data)==null?void 0:m.user,userDescription:(g=n==null?void 0:n.data)==null?void 0:g.userDescription,userProfile:(v=n==null?void 0:n.data)==null?void 0:v.userProfile}},[r,a,h,n]);return x.jsxs(Fw.Provider,{value:f,children:[t,o&&x.jsx(zi,{type:"info",className:"m-12",isConfirm:!0,button:x.jsx(tt,{color:"tertiary",variant:"ghost",onClick:l,children:i("rgpd.cookies.banner.button.consult")}),onClose:c,children:i("rgpd.cookies.banner.text1")})]})}function Tt(){const t=E.useContext(Fw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}const Uw=E.createContext(null);function HU({children:t}){var e;const{appCode:r}=Tt(),i=Bw({appCode:r});E.useEffect(()=>{var n,a,o,l,c,h,f,u,d;const p=document.getElementById("favicon");p.href=`${(a=(n=i==null?void 0:i.data)==null?void 0:n.theme)==null?void 0:a.basePath}/img/illustrations/favicon.ico`;const m=(c=(l=(o=i==null?void 0:i.data)==null?void 0:o.theme)==null?void 0:l.bootstrapVersion)==null?void 0:c.split("-"),g=m?m[m.length-1]:void 0;[{data:"data-skin",value:(f=(h=i==null?void 0:i.data)==null?void 0:h.theme)==null?void 0:f.skinName},{data:"data-theme",value:(d=(u=i==null?void 0:i.data)==null?void 0:u.theme)==null?void 0:d.themeName},{data:"data-product",value:g}].forEach(v=>{var _;return(_=document.querySelector("html"))==null?void 0:_.setAttribute(v.data,v.value)})},[i==null?void 0:i.data]);const s=E.useMemo(()=>{var n;return{theme:(n=i==null?void 0:i.data)==null?void 0:n.theme}},[(e=i==null?void 0:i.data)==null?void 0:e.theme]);return x.jsx(Uw.Provider,{value:s,children:t})}function Om(){const t=E.useContext(Uw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}function B4(){var t;const{sessionQuery:e}=Tt(),r=new Set;return(t=e==null?void 0:e.data)==null?void 0:t.bookmarkedApps.filter(i=>{const s=r.has(i.displayName);return r.add(i.displayName),!s})}const F4=E.createContext(null);function U4(){return E.useContext(F4)}function Ay(...t){return e=>{j4(e,...t)}}function j4(t,...e){e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}const $4=(t,e)=>{const r=e==null?void 0:e.filter(i=>i.id===t&&i.available);return r&&r.length>0},jw={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};function fo(t){const e=U4(),[r,i]=E.useState();return E.useEffect(()=>{(async()=>{let s;if(e!=null&&e.hasWorkflow)if(typeof t=="string")s=await e.hasWorkflow(t);else throw"not.implemented.yet)";else typeof t=="string"?s=await Me.rights().sessionHasWorkflowRight(t):s=await Me.rights().sessionHasWorkflowRights(t);i(s)})()},[t,e]),r}const G4=()=>{const t=fo("fr.openent.zimbra.controllers.ZimbraController|view"),e=fo("fr.openent.zimbra.controllers.ZimbraController|preauth"),[r,i]=E.useState(0),[s,n]=E.useState(""),a=E.useCallback(async()=>{if(t)try{const l=await Me.http().get("/zimbra/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});l.status!==200&&i(0),i(l.count)}catch{console.error("error"),i(0)}else try{const l=await Me.http().get("/conversation/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});i(l.count)}catch{console.error("error"),i(0)}},[t]),o=E.useCallback(()=>{let l="";Me.http().get("/userbook/preference/zimbra").then(c=>{try{c.preference&&JSON.parse(c.preference).modeExpert&&e?l="/zimbra/preauth":l=window.location.origin+"/zimbra/zimbra"}catch{l="/zimbra/zimbra"}}),n(l)},[e]);return E.useEffect(()=>{(async()=>{try{await a()}catch(l){console.error(l)}})(),o()},[o,a]),{messages:r,msgLink:s,zimbraWorkflow:t}},z4=G4,Cy=["mousedown","touchstart"];function $w(t,e,r){const i=E.useRef();return E.useEffect(()=>{const s=n=>{const{target:a}=n??{};if(Array.isArray(r)){const o=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(l=>!!l&&!n.composedPath().includes(l))&&!o&&t()}else i.current&&!i.current.contains(a)&&t()};return(e||Cy).forEach(n=>{document.addEventListener(n,s)}),()=>{(e||Cy).forEach(n=>{document.removeEventListener(n,s)})}},[i,t,r,e]),i}function H4(t,e){const[r,i]=E.useState(t);return E.useEffect(()=>{const s=setTimeout(()=>{i(t)},e||500);return()=>{clearTimeout(s)}},[t,e]),r}const V4=(t,e)=>{const r=E.useId(),[i,s]=E.useState(!1),[n,a]=E.useState(-1),[o,l]=E.useState(null),{refs:c,floatingStyles:h}=US({placement:t,open:i,onOpenChange:s,whileElementsMounted:TS,middleware:[nS(4),AS({apply({rects:M,elements:I}){I.floating.style,`${M.reference.width}`}}),SS({padding:0})]}),f=E.useRef(null),u=E.useRef(null),d=E.useRef({});E.useEffect(()=>{i?f.current&&(f.current.focus(),a(0)):(a(-1),d.current={})},[i]),E.useEffect(()=>{if(n!==-1){const M=Object.values(d.current)[n];if(M){const I=M.getAttribute("id");l(I),M.focus()}}},[n]);const p=()=>{const M=Object.values(d.current).length;a(I=>(I+1)%M)},m=()=>{const M=Object.values(d.current).length;a(I=>(I-1+M)%M)},g=()=>{a(0)},v=()=>{const M=Object.values(d.current).length;a(M-1)},_=E.useCallback(()=>{s(!0)},[]),y=E.useCallback(()=>{u.current&&(u.current.focus(),s(!1))},[]),b=(M,I)=>{M&&(I.stopPropagation(),I.preventDefault())},w=E.useCallback(M=>{let I=!1;switch(M.code){case" ":case"Space":case"Enter":case"ArrowDown":case"Down":_(),I=!0;break;case"Esc":case"Escape":y(),I=!0;break;case"Up":case"ArrowUp":_(),I=!0;break}e==null||e(M),b(I,M)},[y,_]),S=M=>{const I=Object.values(d.current).findIndex(k=>k.id===M.currentTarget.getAttribute("id"));a(I)},T=E.useCallback((M,I)=>{let k=!1;if(M.shiftKey)M.key==="Tab"&&(y(),k=!0);else{switch(M.code){case"Escape":y();break;case" ":case"Space":case"Enter":n!==-1&&(Object.values(d.current)[n].getAttribute("role")==="menuitem"&&u.current&&(u.current.focus(),s(!1)),I==null||I()),k=!0;break;case"ArrowDown":case"Down":p(),k=!0;break;case"ArrowUp":case"Up":m(),k=!0;break;case"Home":g(),k=!0;break;case"End":v(),k=!0;break}b(k,M)}},[n,y]),C=E.useCallback(M=>{s(i!==!0),M.stopPropagation(),M.preventDefault()},[i]),A=E.useCallback(()=>{y()},[y]);return{isFocused:o,visible:i,itemRefs:d,triggerRef:u,menuRef:f,triggerProps:{ref:Ay(u,c.setReference),id:`dropdown-toggle-${r}`,"aria-haspopup":"menu","aria-controls":`dropdown-${r}`,"aria-expanded":!!i,className:`${i?"selected":""}`,onClick:C,onKeyDown:w,"aria-activedescendant":o},menuProps:{ref:Ay(f,c.setFloating),className:"dropdown-menu bg-white shadow rounded-4 p-8","aria-labelledby":`dropdown-toggle-${r}`,style:{...h}},itemProps:{onMenuItemMouseEnter:S,onMenuItemClick:A,onMenuItemKeyDown:T},setVisible:s}},W4=V4,X4=()=>{const[t,e]=E.useState(!1),[r,i]=E.useState([]),s=E.useRef(null),n=f=>{i(u=>[...u,f])},a=f=>{i(u=>u.filter(d=>d.name!==f.name))},o=()=>{i([])},l=f=>{const u=f.target.files;u&&[...u].forEach(d=>{n(d)})},c=f=>{f.preventDefault(),f.stopPropagation(),e(!0)},h=f=>{f.preventDefault(),f.stopPropagation(),e(!1)};return{inputRef:s,files:r,dragging:t,handleDragging:c,handleDragLeave:h,handleDrop:f=>{var u;h(f);const d=(u=f.dataTransfer)==null?void 0:u.files;d&&[...d].forEach(p=>{n(p)}),s!=null&&s.current&&d&&(s.current.files=d)},deleteFile:a,addFile:n,cleanFiles:o,handleOnChange:l}},Y4=X4,oc="top-right";function ru(){return{success:(t,e)=>Ta.custom(x.jsx(zi,{type:"success",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),error:(t,e)=>Ta.custom(x.jsx(zi,{type:"danger",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),info:(t,e)=>Ta.custom(x.jsx(zi,{type:"info",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),warning:(t,e)=>Ta.custom(x.jsx(zi,{type:"warning",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),loading:Ta.loading}}function Gw(){const[t,e]=E.useState(!1),r=E.useRef(null),i=()=>{e(!0)},s=()=>{e(!1)};return E.useEffect(()=>{const n=r.current;if(n)return n.addEventListener("mouseover",i),n.addEventListener("mouseout",s),()=>{n.removeEventListener("mouseover",i),n.removeEventListener("mouseout",s)}},[r]),[r,t]}function q4({src:t,placeholder:e}){const[r,i]=E.useState(t||e),s=E.useCallback(()=>{i(e)},[e]);return E.useEffect(()=>{i(t)},[t]),{imgSrc:r,onError:s}}function Z4(t,e){const r=E.useCallback(({code:i})=>{e.includes(i)&&t()},[t,e]);E.useEffect(()=>(window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}),[r])}function VU(){const t=document.querySelector("html");return()=>{t&&t.scrollIntoView()}}function K4(){const t=typeof document<"u",[e,r]=E.useState(()=>document.title);return E.useEffect(()=>{t&&r(document.title)},[t]),e}function Q4(t=!1){const[e,r]=E.useState(t),i=E.useCallback(()=>{r(s=>!s)},[]);return[e,i]}function J4(){const t=E.useRef(null),e='button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';return E.useEffect(()=>{const r=t.current,i=r.querySelectorAll(e)[0],s=r.querySelectorAll(e),n=t&&(s==null?void 0:s[s.length-1]),a=o=>{o.key==="Tab"&&(o.shiftKey?document.activeElement===i&&(n.focus(),o.preventDefault()):document.activeElement===n&&(i.focus(),o.preventDefault()))};if(r)return r.addEventListener("keydown",a),()=>{r.removeEventListener("keydown",a)}},[]),t}function e5({user:t,avatar:e}){const{t:r}=Ce(),i=K4(),[s,n]=E.useState(!0),[a,o]=Gw(),l=E.useId(),c=E.useId(),h=e,f=t==null?void 0:t.username,u=r("welcome",{username:t==null?void 0:t.firstName}),d=B4(),p=fo("net.atos.entng.community.controllers.CommunityController|view"),m=fo("org.entcore.conversation.controllers.ConversationController|view"),g=fo("fr.openent.searchengine.controllers.SearchEngineController|view"),v=E.useCallback(()=>{n(!s)},[s]),_=async()=>{await Me.session().logout(),window.location.href="/auth/login"};return E.useMemo(()=>({title:i,bookmarkedApps:d,appsRef:a,isAppsHovered:o,popoverAppsId:l,popoverSearchId:c,userAvatar:h,userName:f,welcomeUser:u,communityWorkflow:p,conversationWorflow:m,searchWorkflow:g,isCollapsed:s,toggleCollapsedNav:v,handleLogout:_}),[a,d,p,m,o,s,l,c,g,i,v,h,f,u])}function t5(){const[t,e]=E.useState(!1);E.useEffect(()=>{r()},[]);const r=E.useCallback(async()=>{const i=await Me.session().isAdml();e(i)},[]);return{isAdml:t}}const r5=()=>{var t;const{user:e,appCode:r}=Tt(),i=jw[r],s=(t=e.apps.find(l=>l.isExternal&&l.address.includes("library")&&l.name.includes("library")))==null?void 0:t.address.split("?");let n=s==null?void 0:s[0];n!=null&&n.endsWith("/")||(n=`${n}/`);const a=s==null?void 0:s[1],o=`application%5B0%5D=${i}&page=1&sort_field=views&sort_order=desc`;return{libraryUrl:`${n}search/?${a}&${o}`}},WU=r5;function km(){const t={"last-infos-widget":"ic-widget-actualites",birthday:"ic-star","calendar-widget":"ic-widget-calendar","carnet-de-bord":"ic-widget-carnet-de-bord","record-me":"ic-widget-microphone",mood:"ic-star","my-apps":"ic-widget-apps",notes:"ic-widget-notes","rss-widget":"ic-widget-rss","bookmark-widget":"ic-widget-signets",qwant:"ic-widget-qwant","qwant-junior":"ic-widget-qwant","agenda-widget":"ic-widget-agenda","cursus-widget":"ic-widget-aide-devoirs","maxicours-widget":"ic-widget-maxicours","school-widget":"ic-widget-schoolbook","universalis-widget":"ic-widget-universalis","briefme-widget":"ic-widget-briefme"};function e(o){let l="";switch(typeof o=="string"?l=o:l=(o==null?void 0:o.icon)!==void 0?o==null?void 0:o.icon.trim().toLowerCase():"placeholder",l&&l.length>0?l.endsWith("-large")&&(l=l.replace("-large","")):typeof o=="object"&&(l=(o==null?void 0:o.displayName)!==void 0?o==null?void 0:o.displayName.trim().toLowerCase():""),l){case"admin.title":l="admin";break;case"banques des savoirs":l="banquesavoir";break;case"collaborativewall":l="collaborative-wall";break;case"communautés":l="community";break;case"directory.user":l="userbook";break;case"emploi du temps":l="edt";break;case"formulaire":l="forms";break;case"messagerie":l="conversation";break;case"news":l="actualites";break;case"homeworks":case"cahier de texte":l="cahier-de-texte";break;case"diary":case"cahier de texte 2d":l="cahier-textes";break;case"scrapbook":l="scrap-book";break}return l}function r(o){return o&&(o.startsWith("/")||o.startsWith("http://")||o.startsWith("https://"))}function i(o){const l=e(o);return l?`color-app-${l}`:"color-app-placeholder"}function s(o){const l=e(o);return l?`bg-app-${l}`:"bg-app-placeholder"}function n(o){const l=e(o);return l?`bg-light-${l}`:"bg-light-placeholder"}function a(o){return t[o.platformConf.name]}return{getIconClass:i,getBackgroundIconClass:s,getBackgroundLightIconClass:n,getIconCode:e,getWidgetIconClass:a,isIconUrl:r}}function wa(){return["/assets/themes/edifice-bootstrap/images","/assets/themes/edifice-bootstrap/icons","/assets/themes/edifice-bootstrap/fonts"]}function zw(){const{user:t,userDescription:e,userProfile:r}=Tt(),{theme:i}=Om();function s(){let n=e==null?void 0:e.picture;return(!n||n==="no-avatar.jpg"||n==="no-avatar.svg")&&(n=`${i==null?void 0:i.basePath}/img/illustrations/no-avatar.svg`),n}return{user:{...t,type:r},avatar:s(),userDescription:e}}function XU(){const[t,e]=E.useState("pending"),{currentApp:r}=Tt();E.useEffect(()=>{i()},[]);const i=async()=>{if(!r){e("[Xiti] Error, currentApp is not defined.");return}try{await Me.analytics().trackPageLoad(window.location.pathname,r),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),e(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(s){console.error("[Xiti] Error Tracking Page Load",s),e(`[Xiti] Error Tracking Page Load: ${s}`)}};return{xitiStatus:t}}const i5=E.forwardRef(({src:t,alt:e,imgPlaceholder:r,ratio:i,objectFit:s,className:n,...a},o)=>{const[l]=wa(),c=r??`${l}/common/image-placeholder.png`,{imgSrc:h,onError:f}=q4({src:t,placeholder:c}),u={"ratio ratio-1x1":i==="1","ratio ratio-4x3":i==="4","ratio ratio-16x9":i==="16","ratio ratio-21x9":i==="21"},d={"object-fit-contain":s==="contain","object-fit-cover":s==="cover","object-fit-fill":s==="fill","object-fit-scale":s==="scale","object-fit-none":s==="none"},p=re({...u}),m=re({...d},n),g=x.jsx("img",{alt:e,onError:f,ref:o,src:h,className:m,...a});return i?x.jsx("div",{className:p,children:g}):g}),iu=i5,s5=E.forwardRef(({app:t,size:e="24",iconFit:r="contain",variant:i="square"},s)=>{const{isIconUrl:n,getIconCode:a}=km(),[,o]=wa(),l=i==="square",c=i==="rounded",h=i==="circle",f=r==="contain",u=r==="ratio",d={"icon-xs":e==="24","icon-sm":e==="40","icon-md":e==="48","icon-lg":e==="80","icon-xl":e==="160"},p={square:l,rounded:c,"rounded-circle":h},m={"icon-contain":f,"icon-ratio":u},g=typeof t=="string"?t:(t==null?void 0:t.icon)!==void 0?t.icon:"placeholder",v=typeof t!="string"&&(t==null?void 0:t.displayName)!==void 0?t.displayName:"",_=t?a(t):"",y=n(g),b=_||"placeholder",w=re("app-icon",{...d,...p,...m,[`bg-light-${b}`]:b&&!f,[`color-app-${b}`]:b});return y?x.jsx(iu,{src:g,alt:v,objectFit:"contain",width:e,height:e,className:"h-full"}):x.jsx("div",{className:w,style:{width:e+"px",height:e+"px"},children:x.jsx("svg",{ref:s,width:e,height:e,role:"img",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:x.jsx("use",{xlinkHref:`${o}/apps.svg#${b}`})})})}),Ho=s5,n5=E.forwardRef(({variant:t="square",size:e="md",alt:r,src:i,imgPlaceholder:s,className:n,...a},o)=>{const[l]=wa(),c=s||`${l}/avatar/no-avatar.svg`,h=re("avatar",{"avatar-xs":e==="xs","avatar-sm":e==="sm","avatar-md":e==="md","avatar-lg":e==="lg","avatar-xl":e==="xl",square:t==="square",rounded:t==="rounded","rounded-circle":t==="circle"},n);return x.jsx("div",{ref:o,className:h,children:x.jsx(iu,{src:i||c,alt:r,imgPlaceholder:c,...a})})}),ua=n5,a5=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("breadcrumb-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})}),Sd=a5,o5=E.forwardRef(({children:t,className:e},r)=>{const i=re("breadcrumb d-flex flex-nowrap align-items-center mb-0",e);return x.jsx("ol",{ref:r,className:i,children:t})}),l5=o5,c5=E.forwardRef(({children:t,app:e,className:r},i)=>{const{t:s}=Ce(),{getIconClass:n}=km(),a=re("d-flex align-items-center mb-0",n(e),r),o={"--edifice-breadcrumb-divider":"-"};return x.jsx("nav",{ref:i,className:a,"aria-label":s("breadcrumb"),style:o,children:t})}),h5=c5,u5=E.forwardRef(({level:t="h1",headingStyle:e="h1",children:r,className:i,...s},n)=>{const a=re(e,i);return x.jsx(t,{ref:n,className:a,...s,children:r})}),ur=u5,d5=E.forwardRef(({app:t,name:e},r)=>{const{t:i}=Ce();return x.jsx(h5,{app:t,ref:r,className:"mw-100",children:x.jsx(l5,{className:"gap-12 mw-100",children:e?x.jsxs(x.Fragment,{children:[x.jsx(Sd,{children:x.jsxs("a",{href:t==null?void 0:t.address,className:"d-flex",children:[x.jsx(Qs,{variant:"ghost",color:"tertiary",icon:x.jsx(pE,{}),"aria-label":i(t==null?void 0:t.displayName)}),x.jsx(Ho,{app:t,size:"40"})]})}),x.jsx(Sd,{className:"text-truncate",children:x.jsx(ur,{level:"h1",headingStyle:"h3",className:"text-truncate",children:e})})]}):x.jsxs(Sd,{className:"gap-12 d-flex align-items-center",children:[x.jsx(Ho,{app:t,size:"40"}),x.jsx(ur,{level:"h1",headingStyle:"h3",className:"d-none d-md-flex",children:i(t==null?void 0:t.displayName)})]})})})}),YU=d5,f5=({children:t,space:e=null,flexDirection:r="row"})=>{const i=re("card-body",{[`p-${e}`]:e,[`gap-${e}`]:e,"align-items-start":r==="column","flex-column":r==="column"});return x.jsx("div",{className:i,children:t})},p5=f5,Hw=E.createContext(null),Vw=()=>{const t=E.useContext(Hw);if(!t)throw new Error("Cannot be rendered outside the Card component");return t},m5=({children:t})=>x.jsx("div",{className:"card-footer gap-16",children:t}),g5=m5,v5=()=>{const{isSelectable:t,isClickable:e,onClick:r,onSelect:i}=Vw();return t||e?x.jsxs("div",{className:"card-header",children:[t?x.jsx(Qs,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:x.jsx(vE,{}),onClick:i,variant:"ghost"}):null,e?x.jsx("button",{onClick:r,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}):null]}):null},y5=v5,b5=({imageSrc:t,className:e,variant:r="medium"})=>{const{app:i}=Vw(),s=r==="landscape"?{width:"100%",height:"auto"}:null;return x.jsx("div",{className:re("card-image",r),children:t?x.jsx(iu,{alt:"",src:t,objectFit:"cover",className:re("h-full w-100",e)}):x.jsx(Ho,{app:i,iconFit:"ratio",size:"80",variant:"rounded",...s})})},x5=b5,_5=({children:t,className:e})=>{const r=re("card-text small text-break text-truncate text-truncate-1",e);return x.jsx("p",{className:r,children:t})},w5=_5,E5=({children:t,className:e})=>{const r=re("card-title body text-break text-truncate text-truncate-1",e);return x.jsx("h3",{className:r,children:x.jsx("strong",{children:t})})},T5=E5,S5=({userSrc:t,creatorName:e})=>t?x.jsx(ua,{alt:e||"",size:"xs",src:t,variant:"circle",width:"24",height:"24"}):x.jsx(xx,{}),A5=S5,C5=E.forwardRef(({app:t,isSelectable:e=!0,isClickable:r=!0,isSelected:i=!1,onClick:s,onSelect:n,children:a,className:o},l)=>{const{getIconCode:c}=km(),h=t?c(t):"placeholder",f=E.useMemo(()=>({app:t,appCode:h,isSelectable:e,isClickable:r,onClick:s,onSelect:n}),[t,h,e,r,s,n]);return x.jsx(Hw.Provider,{value:f,children:x.jsxs("div",{ref:l,className:re("card",{"is-selected":i,"c-pointer":r},o),children:[x.jsx(Ww.Header,{}),typeof a=="function"?a(h):a]})})}),Ww=Object.assign(C5,{Title:T5,Text:w5,Image:x5,Body:p5,User:A5,Footer:g5,Header:y5}),qU=Ww,I5=E.forwardRef(({label:t,disabled:e=!1,checked:r=!1,indeterminate:i=!1,...s},n)=>{const a=E.useRef(null);E.useImperativeHandle(n,()=>({...a.current})),E.useEffect(()=>{a.current.indeterminate=i},[a,i]);const o=E.useId(),l={type:"checkbox",checked:r,disabled:e,ref:a,className:re(s.className,"form-check-input c-pointer"),id:o},c={...s,...l};return x.jsxs("div",{className:"form-check d-flex align-items-center gap-8",children:[x.jsx("input",{...c}),t&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:t})]})}),Dm=I5,R5=({children:t,message:e,icon:r=null,placement:i="auto"})=>{const[s,n]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(null),{styles:h,attributes:f}=y2(s,a,{placement:i,modifiers:[{name:"arrow",options:{element:l}}]}),[u,d]=E.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"d-inline-block position-relative z-2",ref:n,onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},children:t}),u&&x.jsxs("div",{className:re("tooltip d-block show mb-12","bs-tooltip-auto"),ref:o,style:h.popper,...f.popper,children:[x.jsxs("div",{className:"tooltip-inner shadow-hover d-flex gap-8 align-items-center",children:[r&&r,x.jsx("div",{children:e})]}),x.jsx("div",{className:"tooltip-arrow",ref:c,style:h.arrow})]})]})},P5=R5,Xw=E.createContext(null),Ea=()=>{const t=E.useContext(Xw);if(!t)throw new Error("Cannot be rendered outside the Dropdown Component");return t},Yw=E.createContext(null),su=()=>{const t=E.useContext(Yw);if(!t)throw new Error("Cannot be rendered outside the FormControl component");return t},M5=({children:t})=>{const{status:e}=su(),r=re("form-text",{"is-invalid":e==="invalid",valid:e==="valid"});return x.jsx("p",{className:r,children:x.jsx("em",{children:t})})},O5=M5,k5=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",type:i="text",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=su(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("input",{ref:a,id:o,className:f,type:i,placeholder:e,required:l,readOnly:c,...n})}),da=k5,D5=E.forwardRef(({leftIcon:t,optionalText:e="Optional",requiredText:r="*",children:i,className:s},n)=>{const{id:a,isOptional:o,isRequired:l}=su(),c=re("form-label",{"has-icon":t},s),h=o&&!l,f=l&&!o;return E.useEffect(()=>{if(o&&l)throw new Error("Cannot be optional and required at the same time")},[o,l]),x.jsxs("label",{ref:n,htmlFor:a,className:c,children:[t,i,h&&x.jsxs("em",{className:"optional",children:["- ",e]}),f&&x.jsx("em",{className:"required",children:r})]})}),Nn=D5,N5=E.forwardRef(({children:t,className:e,id:r,isOptional:i,isReadOnly:s,isRequired:n,status:a,...o},l)=>{const c=E.useMemo(()=>({id:r,isOptional:i,isRequired:n,isReadOnly:s,status:a}),[r,i,s,n,a]);return x.jsx(Yw.Provider,{value:c,children:x.jsx("div",{ref:l,className:e,...o,children:t})})}),L5=Object.assign(N5,{Label:Nn,Input:da,Text:O5}),ft=L5,B5=({placeholder:t,value:e="",handleSearchInputChange:r})=>{const{triggerProps:i,itemProps:s,setVisible:n}=Ea(),a={...i,role:"combobox",onClick:()=>{e.length>2&&n(!0)},onChange:r};return E.useEffect(()=>{n(e.length>2)},[n,e]),x.jsx(ft,{className:"d-flex align-items-center",id:"search",children:x.jsx(da,{...a,className:"max-w-512",noValidationIcon:!0,placeholder:t,size:"md",type:"search",onKeyDown:s.onMenuItemKeyDown})})},F5=B5,U5=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h=r.includes(e),f={value:e,model:r,checked:h,readOnly:!0},u=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:d=>n.current[c]=d,role:"menuitemcheckbox","aria-checked":h,onMouseUp:()=>i(e),onKeyDown:d=>o(d,()=>i(e)),onMouseEnter:l,tabIndex:h?0:-1,className:u,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(Dm,{...f})]})})},j5=U5,$5=({type:t="action",icon:e,onClick:r,children:i,...s})=>{const{itemProps:n,itemRefs:a,isFocused:o}=Ea(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:c,onMenuItemClick:h}=n,f=()=>{r==null||r(),t==="action"&&h()},u=E.useId(),d=re("dropdown-item",{focus:o===u});return x.jsx("div",{id:u,role:"menuitem",ref:p=>a.current[u]=p,tabIndex:o===u?0:-1,className:d,"aria-current":o===u,onClick:f,onMouseEnter:c,onKeyDown:p=>l(p,r),...s,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center",children:[e,i]})})},G5=$5,z5=E.forwardRef(({children:t,block:e,...r},i)=>{const{menuProps:s,visible:n}=Ea(),{className:a,...o}=s,l={...o,...r},c=re({"w-100":e},a);return n?x.jsx("div",{ref:i,className:c,...l,children:t}):null}),H5=z5,V5=E.forwardRef(({label:t,children:e},r)=>x.jsxs("div",{ref:r,role:"group",children:[x.jsx("span",{className:"small px-4",children:x.jsx("strong",{children:t})}),e]})),W5=V5,X5=E.forwardRef(({model:t,icon:e,label:r=!1,disabled:i=!1,checked:s,...n},a)=>{const o=E.useId(),l={type:"radio",checked:s,disabled:i,ref:a,className:re(n.className,"form-check-input c-pointer",e&&"d-none"),id:o},c={...n,...l};return x.jsxs("div",{className:re("form-check d-flex align-items-center gap-8",e&&"ps-0"),children:[x.jsx("input",{...c}),e&&x.jsx("label",{htmlFor:c.id,className:re("c-pointer",t!==n.value&&"text-muted"),children:e}),!e&&r&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:r})]})}),_p=X5,Y5=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h={value:e,model:r,checked:e===r,readOnly:!0},f=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:u=>n.current[c]=u,role:"menuitemradio","aria-checked":e===r,onMouseUp:()=>i(e),onKeyDown:u=>o(u,()=>i(e)),onMouseEnter:l,tabIndex:e===r?0:-1,className:f,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(_p,{...h,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})},q5=Y5,Z5=()=>x.jsx("div",{role:"separator",className:"px-4",children:x.jsx("hr",{className:"m-0"})}),K5=Z5,Q5=E.forwardRef(({label:t,icon:e,variant:r,disabled:i=!1,size:s,badgeContent:n,...a},o)=>{const{triggerProps:l,block:c}=Ea(),{className:h,...f}=l,u={...f,...a},d=re("dropdown-toggle ",s,r,{"w-100":c},h);return x.jsxs("button",{ref:o,className:d,disabled:i,...u,children:[e||null,t,n?x.jsx("span",{className:"badge text-bg-secondary rounded-pill",children:n}):x.jsx(yE,{width:16,height:16,className:"dropdown-toggle-caret"})]})}),J5=Q5,e6=({children:t,block:e,overflow:r=!0,placement:i="bottom-start",extraTriggerKeyDownHandler:s})=>{const{visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,setVisible:f}=W4(i,s),u=$w(()=>f(!1)),d=E.useMemo(()=>({visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,block:e,setVisible:f}),[n,a,o,l,c,h,e,f]),p=re("dropdown",{"w-100":e,overflow:r});return x.jsx(Xw.Provider,{value:d,children:x.jsx("div",{ref:u,className:p,children:typeof t=="function"?t(o,h):t})})},t6=Object.assign(e6,{Trigger:J5,Menu:H5,Item:G5,Separator:K5,CheckboxItem:j5,RadioItem:q5,MenuGroup:W5}),ot=t6,Nm=({onSearchResultsChange:t,onSearchInputChange:e,options:r,value:i,isLoading:s,noResult:n,placeholder:a})=>{const{t:o}=Ce(),[l,c]=E.useState([]);E.useEffect(()=>{t(l)},[l]);const h=u=>{c([u])},f=()=>s?x.jsxs("div",{className:"d-flex align-items-center p-4",children:[x.jsx(Lw,{isLoading:s}),x.jsx("span",{className:"ps-4",children:o("explorer.search.pending")})]}):n?x.jsx("div",{className:"p-4",children:o("portal.no.result")}):r.map((u,d)=>x.jsxs(E.Fragment,{children:[x.jsx(ot.Item,{type:"select",onClick:()=>h(u.value),children:u.label}),d<r.length-1&&x.jsx(ot.Separator,{})]},d));return x.jsxs(ot,{block:!0,children:[x.jsx(Nm.Trigger,{placeholder:a,handleSearchInputChange:e,value:i}),x.jsx(ot.Menu,{children:f()})]})};Nm.Trigger=F5;const r6=Nm,i6=({imageSrc:t,imageAlt:e="",title:r,text:i,className:s})=>{const n=re("text",s);return x.jsxs("div",{className:"emptyscreen",children:[t&&x.jsx("div",{className:"emptyscreen-image mb-12",children:x.jsx("img",{className:"mx-auto",src:t,alt:e,width:"250",height:"250"})}),r&&x.jsx(ur,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:r}),i&&x.jsx("div",{className:n,children:i})]})},ZU=i6,s6=({children:t,className:e,...r})=>{const i=re("grid",e);return x.jsx("div",{className:i,...r,children:t})},n6=({sm:t,md:e,lg:r,xl:i,children:s,className:n,as:a,...o})=>{const l=a||"div",c=re({[`g-col-${t}`]:t,[e?`g-col-md-${e}`:""]:e,[r?`g-col-lg-${r}`:""]:r,[i?`g-col-xl-${i}`:""]:i},n);return x.jsx(l,{className:c,...o,children:s})};s6.Col=n6;const a6=E.forwardRef(({label:t,addButtonLabel:e="Add image",deleteButtonLabel:r="Delete image",src:i,className:s,app:n,onUploadImage:a,onDeleteImage:o},l)=>{const[c,h]=E.useState(i||""),{inputRef:f,files:u,deleteFile:d,handleOnChange:p,handleDragging:m,handleDragLeave:g,handleDrop:v}=Y4();E.useEffect(()=>{if(u.length>0){d(u[0]),h("");const w=u==null?void 0:u[0];if(!w)return;h(URL.createObjectURL(w)),a(w)}},[u]);const _=()=>{var w;(w=f.current)==null||w.click()},y=()=>{f.current&&(f.current.value=""),d(u[0]),h(""),o()},b=re("image-input",s);return x.jsxs(ft,{id:"image-input",className:b,onDragEnter:m,onDragOver:m,onDragLeave:g,onDrop:v,ref:l,children:[x.jsxs("div",{className:"image-input-actions gap-8",children:[x.jsx(Qs,{"aria-label":e,color:"tertiary",icon:x.jsx(lE,{}),onClick:_,type:"button",variant:"ghost"}),x.jsx(Qs,{"aria-label":r,color:"danger",disabled:!c,icon:x.jsx(cE,{width:"20",height:"20"}),onClick:y,type:"button",variant:"ghost"})]}),x.jsxs(ft.Label,{children:[x.jsx("span",{className:"visually-hidden",children:t}),x.jsx(da,{accept:"image/*",hidden:!0,onChange:p,ref:f,size:"sm",type:"file"}),c?x.jsx(ua,{alt:"",src:c,size:"xl"}):x.jsx(Ho,{app:n,iconFit:"ratio",size:"160",variant:"rounded"})]})]})}),qw=a6,o6=E.forwardRef(({position:t=!0,caption:e},r)=>{const[i]=wa(),s=`${i}/loading/screen-loading.gif`,n=re("top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-content-center align-items-center z-2000",{"position-fixed":!t,"position-static":t}),a=re("text-center pt-12",{"text-white":!t});return x.jsxs(x.Fragment,{children:[x.jsxs("div",{ref:r,className:n,children:[x.jsx("div",{className:"bg-white rounded-circle mx-auto w-25",children:x.jsx("img",{src:s,alt:"loading"})}),e&&x.jsx("div",{className:a,children:e})]}),!t&&x.jsx("div",{className:"modal-backdrop fade show"})]})}),KU=o6,l6=E.forwardRef(({src:t,is1d:e,translate:r="Retour accueil"},i)=>{const s=re("navbar-brand d-none d-md-block");return x.jsx("a",{ref:i,className:s,href:"/timeline/timeline","aria-label":r,children:x.jsx("img",{className:"logo",src:t,alt:`logo ${e?"ONE":"NEO"}`,width:"300",height:"52"})})}),Iy=l6,Zw=E.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""}),Kw=()=>{const t=E.useContext(Zw);if(!t)throw new Error("Cannot be rendered outside the Modal component");return t},c6=t=>{const{ariaDescriptionId:e}=Kw(),{children:r,className:i}=t,s=re("modal-body",i);return x.jsx("div",{id:e,className:s,children:r})},h6=c6,u6=t=>x.jsx("div",{className:"modal-footer",children:t.children}),d6=u6,f6=t=>{const{onModalClose:e,children:r}=t,{ariaLabelId:i,focusId:s}=Kw(),n=E.useRef(null);return E.useEffect(()=>{var a;s||(a=n.current)==null||a.focus()},[s]),x.jsxs("div",{className:"modal-header",children:[x.jsx("h2",{id:i,className:"modal-title",tabIndex:-1,children:r}),x.jsx(Qs,{ref:n,"aria-label":"Close",color:"tertiary",icon:x.jsx(Zy,{}),type:"button",variant:"ghost",title:"Delete",onClick:e,className:"btn-close"})]})},p6=f6,m6=t=>x.jsx("p",{className:"modal-subtitle",children:t.children}),g6=m6,v6=E.forwardRef((t,e)=>{const{id:r,isOpen:i,onModalClose:s,size:n="md",viewport:a=!1,scrollable:o=!1,focusId:l,children:c}=t,h=`aria_label_${r}`,f=`aria_desc_${r}`,u=$w(s),d=J4();Z4(s,["Escape"]),E.useEffect(()=>{if(i&&(document.body.style.overflow="hidden",l)){const _=document.getElementById(l);_==null||_.focus()}return()=>{document.body.style.overflow=""}},[l,i]);const p=re("modal fade",{"show d-block":i,"modal-scrollable":o,viewport:a,[`modal-${n}`]:n}),m=re("modal-dialog"),g={ariaLabelId:h,ariaDescriptionId:f,focusId:l},v=cx(i,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return x.jsx(Zw.Provider,{value:g,children:v((_,y)=>x.jsxs(x.Fragment,{children:[y&&x.jsx(of.div,{id:r,ref:e,role:"dialog","aria-modal":"true","aria-labelledby":h,"aria-describedby":f,className:p,style:_,tabIndex:-1,children:x.jsx("div",{id:`${r}_ref`,ref:b=>{u.current=b,y&&(d.current=b)},className:m,children:x.jsx("div",{className:"modal-content",children:c})})}),y&&x.jsx(of.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),y6=Object.assign(v6,{Header:p6,Subtitle:g6,Body:h6,Footer:d6}),je=y6,b6=({children:t,className:e})=>{const r=re("popover-body",e);return x.jsx("div",{className:r,children:t})},x6=({children:t,className:e})=>{const r=re("popover-footer p-8",e);return x.jsx("div",{className:r,children:t})},Qw=E.forwardRef(({children:t,className:e,id:r,isVisible:i,...s},n)=>{const a=re("popover d-block position-absolute top-100 start-50 translate-middle-x",e);return cx(i,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((o,l)=>l&&x.jsx(of.div,{ref:n,"aria-labelledby":r,className:a,role:"tooltip",style:o,...s,children:t}))}),_6=t=>x.jsx(ot.Trigger,{...t,"aria-haspopup":"listbox",role:"combobox"}),w6=_6,E6=({icon:t,options:e,overflow:r,block:i,variant:s,size:n,disabled:a,placeholderOption:o,onValueChange:l})=>{const[c,h]=E.useState(),{t:f}=Ce();E.useEffect(()=>{if(c){const d=typeof c=="object"?c.value:c;l==null||l(d)}},[c]);const u=typeof c=="object"?c.label:c;return x.jsxs(ot,{overflow:r,block:i,children:[x.jsx(w6,{icon:t,label:f(u||o),variant:s,size:n,disabled:a}),x.jsx(ot.Menu,{role:"listbox",children:e==null?void 0:e.map(d=>{const p=typeof d=="object"?d.value:d,m=typeof d=="object"?d.label:d;return x.jsx(ot.Item,{type:"action",onClick:()=>h(d),children:m},p)})})]})},Jw=E6,T6=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",height:i="md",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=su(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","textarea-height-lg":i==="lg","textarea-height-md":i==="md","textarea-height-sm":i==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("textarea",{ref:a,id:o,className:f,placeholder:e,required:l,readOnly:c,...n})}),eE=T6;function S6(t,e,r,i,s,n,a,o,l){const c=u=>{u.preventDefault(),s==null||s(t),u.stopPropagation()},h=u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),s==null||s(t),u.stopPropagation())},f=()=>{i(!r),r?n==null||n(t):a==null||a(t)};return{handleItemClick:c,handleItemKeyDown:h,handleItemFoldUnfoldClick:u=>{u.preventDefault(),f(),u.stopPropagation()},handleItemFoldUnfoldKeyDown:u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),f(),u.stopPropagation())},handleItemFocus:u=>{u.preventDefault(),o==null||o(t)},handleItemBlur:u=>{u.preventDefault(),l==null||l(t)}}}const A6=t=>{const{nodeId:e,label:r,children:i,section:s,selected:n,onItemSelect:a,onItemFold:o,onItemUnfold:l,onItemFocus:c,onItemBlur:h,selectedNodesIds:f}=t,[u,d]=E.useState(!1),{handleItemClick:p,handleItemKeyDown:m,handleItemFoldUnfoldClick:g,handleItemFoldUnfoldKeyDown:v,handleItemFocus:_,handleItemBlur:y}=S6(e,r,u,d,a,o,l,c,h);E.useEffect(()=>{if(f!=null&&f.length&&(f==null?void 0:f.length)>=1){const S=f[f.length-1];f.some(T=>T===e&&e!==S?(d(!0),T===e):(d(!1),!1))}else d(!1)},[e,f]);const b=s?16:12,w=()=>x.jsx("li",{id:`listitem_${e}`,role:"treeitem","aria-selected":n,"aria-expanded":u,children:x.jsxs("div",{children:[x.jsxs("div",{className:"action-container d-flex align-items-center gap-8 px-2",children:[x.jsxs("div",{className:`py-8 ${Array.isArray(i)?null:"invisible"}`,tabIndex:0,role:"button",onClick:g,onKeyDown:v,"aria-label":"fold/unfold button",children:[Array.isArray(i)&&!u&&x.jsx(Bm,{title:"RafterRight",width:b,height:b}),Array.isArray(i)&&u&&x.jsx(po,{title:"RafterDown",width:b,height:b}),!Array.isArray(i)&&x.jsx(Bm,{title:"RafterRight",width:b,height:b,"aria-hidden":"true"})]}),x.jsxs("div",{tabIndex:0,role:"button",className:"flex-fill d-flex align-items-center text-truncate gap-8 py-8",onClick:p,onKeyDown:m,onFocus:_,onBlur:y,children:[s&&x.jsx(bE,{title:"Folder",width:20,height:20}),x.jsx("span",{className:"text-truncate",children:r})]})]}),Array.isArray(i)&&x.jsx("ul",{role:"group",children:i})]})},e);return s?x.jsx("ul",{role:"tree",className:"m-0 p-0",children:w()}):w()},C6=A6,I6=E.forwardRef((t,e)=>{const{data:r,onTreeItemSelect:i,onTreeItemFold:s,onTreeItemUnfold:n,onTreeItemFocus:a,onTreeItemBlur:o,selectedNodesIds:l}=t,[c,h]=E.useState(null);E.useEffect(()=>{l!=null&&l.length&&(l==null?void 0:l.length)>=1?h(l[l.length-1]):h(null)},[l]);const f=E.useMemo(()=>({unselectAll(){h(null)},select(v){h(v),i==null||i(v)}}),[i]);E.useImperativeHandle(e,()=>f,[f]);const u=v=>{s==null||s(v)},d=v=>{n==null||n(v)},p=v=>{a==null||a(v)},m=v=>{o==null||o(v)},g=v=>x.jsx(C6,{nodeId:v.id,label:v.name,section:v.section,selectedNodesIds:l,selected:c===v.id,onItemSelect:f.select,onItemFold:u,onItemUnfold:d,onItemFocus:p,onItemBlur:m,children:Array.isArray(v.children)?v.children.map(_=>g(_)):null},v.id);return x.jsx("div",{className:"treeview",children:g(r)})}),QU=I6,R6=E.forwardRef(({children:t},e)=>x.jsx("span",{className:"visually-hidden",ref:e,children:t})),Hi=R6,P6=async t=>await Me.conf().getPreference(t),M6=async t=>await Me.conf().savePreference(t,JSON.stringify({showOnboardingTrash:!1})),O6=t=>{const[e,r]=E.useState(!0),[i,s]=E.useState(!1);return E.useEffect(()=>{(async()=>{const n=await P6(t);if(n){const{showOnboardingTrash:a}=n;s(a);return}s(!0)})()},[t]),{isOpen:e,setIsOpen:r,isOnboardingTrash:i,handleSavePreference:async()=>{await M6(t),r(!1)}}},k6=({id:t,items:e,modalOptions:r})=>{const[i]=wa(),[s,n]=E.useState(),[a,o]=E.useState(0),{isOpen:l,isOnboardingTrash:c,setIsOpen:h,handleSavePreference:f}=O6(t);E.useEffect(()=>{const v=document.createElement("link");return v.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",v.rel="stylesheet",v.type="text/css",document.head.appendChild(v),()=>{document.head.removeChild(v)}},[]);const{t:u}=Ce(),{title:d,prevText:p,closeText:m,nextText:g}=r;return c?rs.createPortal(x.jsxs(je,{id:"onboarding-modal",size:"md",isOpen:l,focusId:"nextButtonId",onModalClose:()=>h(!1),children:[x.jsx(je.Header,{onModalClose:()=>h(!1),children:u(d||"explorer.modal.onboarding.trash.title")}),x.jsx(je.Body,{children:x.jsx(Nx,{modules:[X2],onSwiper:v=>{n(v)},onSlideChange:v=>{o(v.progress)},pagination:{clickable:!0},children:e.map((v,_)=>x.jsxs(Lx,{children:[x.jsx(iu,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:`${i}/${v.src}`,alt:u(v.alt)}),x.jsx("p",{children:u(v.text)})]},_))})}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>h(!1),children:u("explorer.modal.onboarding.trash.later")}),a>0&&x.jsx(tt,{type:"button",color:"primary",variant:"outline",onClick:()=>s.slidePrev(),children:u(p||"explorer.modal.onboarding.trash.prev")}),a<1&&x.jsx(tt,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>s.slideNext(),children:u(g||"explorer.modal.onboarding.trash.next")}),a===1&&x.jsx(tt,{type:"button",color:"primary",variant:"filled",onClick:f,children:u(m||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null},JU=k6,D6=()=>{const{t}=Ce();return[{value:"bpr.activityType.classroomActivity",label:t("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:t("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:t("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:t("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:t("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:t("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:t("bpr.activityType.courseElement")},{value:"bpr.other",label:t("bpr.other")}]},N6=({control:t,selectedActivities:e,selectActivities:r})=>{const i=D6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(vh,{name:"activityType",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(ot,{block:!0,overflow:!0,children:[x.jsx(ot.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:e==null?void 0:e.length}),x.jsx(ot.Menu,{children:i.map((a,o)=>x.jsx(ot.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})},L6=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],Ry=({name:t,control:e,placeholderOption:r,validate:i})=>x.jsx(vh,{name:t,control:e,rules:{required:!0,validate:i},render:({field:{onChange:s}})=>x.jsx(Jw,{block:!0,size:"md",onValueChange:s,options:L6,"aria-required":!0,placeholderOption:r})}),B6=()=>{const{t}=Ce();return[{value:"de_DE",label:t("de_DE")},{value:"en_EN",label:t("en_EN")},{value:"ar_DZ",label:t("ar_DZ")},{value:"es_ES",label:t("es_ES")},{value:"fr_FR",label:t("fr_FR")},{value:"it_IT",label:t("it_IT")},{value:"ja_JP",label:t("ja_JP")},{value:"zh_CN",label:t("zh_CN")},{value:"pt_PT",label:t("pt_PT")},{value:"ru_RU",label:t("ru_RU")},{value:"bpr.other",label:t("bpr.other")}]},F6="bpr.form.publication.language",U6=({control:t})=>{const e=B6();return x.jsx("div",{className:"col",children:x.jsx(vh,{name:"language",control:t,rules:{required:!0},render:({field:{onChange:r}})=>x.jsx(Jw,{block:!0,size:"md",onValueChange:r,options:e,"aria-required":!0,placeholderOption:F6})})})},j6=()=>{const{t}=Ce(),[e]=wa();return x.jsxs(x.Fragment,{children:[x.jsxs("ul",{className:"mb-12",children:[x.jsxs("li",{children:[t("bpr.form.publication.licence.text.1"),x.jsx("img",{className:"ms-8 d-inline-block",src:`${e}/common/image-creative-commons.png`,alt:"licence creative commons"})]}),x.jsx("li",{children:t("bpr.form.publication.licence.text.2")})]}),x.jsx(zi,{type:"info",className:"mb-12",children:t("bpr.form.publication.licence.text.3")}),x.jsx(zi,{type:"warning",children:t("bpr.form.publication.licence.text.4")})]})},$6=()=>{const{t}=Ce();return[{value:"bpr.subjectArea.artActivity",label:t("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:t("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:t("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:t("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:t("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:t("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:t("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:t("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:t("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:t("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:t("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:t("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:t("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:t("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:t("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:t("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:t("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:t("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:t("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:t("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:t("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:t("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:t("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:t("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:t("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:t("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:t("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:t("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:t("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:t("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:t("bpr.subjectArea.technology")},{value:"bpr.other",label:t("bpr.other")}]},G6=({control:t,selectedSubjectAreas:e,selectSubjects:r})=>{const i=$6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(vh,{name:"subjectArea",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(ot,{block:!0,overflow:!0,children:[x.jsx(ot.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:e==null?void 0:e.length}),x.jsx(ot.Menu,{children:i.map((a,o)=>x.jsx(ot.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})};function Py({formData:t}){const{t:e}=Ce(),r=i=>i.match(/^\s/);return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.error.title")}),x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("strong",{children:e("bpr.form.publication.response.error.content")})}),x.jsxs("ul",{children:[r(t.title)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.title")})}),r(t.description)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.description")})})]})]})}function z6({result:t}){const{t:e}=Ce();return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.success.title")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.1")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.2")}),t.details.front_url&&x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("a",{className:"button right-magnet",href:t.details.front_url,target:"_blank",rel:"noreferrer",children:e("bpr.form.publication.response.success.button")})})]})}function H6({onSuccess:t,resource:e}){const{user:r,appCode:i}=Tt(),s=ru(),[n,a]=E.useState(e.thumbnail||""),{control:o,register:l,watch:c,setValue:h,handleSubmit:f,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m}}=Yy({mode:"onChange"}),[g,v]=E.useState([]),[_,y]=E.useState([]),b=(w,S,T)=>{let C=[...S];const A=C.findIndex(M=>M===w);S.includes(w)?C=S.filter((M,I)=>I!==A):C=[...S,w],T(C)};return{control:o,cover:n,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m},handleDeleteImage:()=>a(""),handlePublish:async w=>{const S=r?r==null?void 0:r.userId:"";try{let T=new Blob;typeof n=="string"?T=await Me.http().get(n,{responseType:"blob"}):n?T=await Me.http().get(URL.createObjectURL(n),{responseType:"blob"}):e.thumbnail&&(T=await Me.http().get(e.thumbnail,{responseType:"blob"}));const C=await Me.http().get(`/userbook/avatar/${S}?thumbnail=48x48`,{responseType:"blob"}),A=await Me.http().get(`/directory/user/${S}/attachment-school`,{responseType:"json"}),M=jw[i],I={activityType:g,age:[w.ageMin,w.ageMax],application:M,cover:T,description:w.description,keyWords:w.keyWords,language:w.language,licence:"CC-BY",resourceId:e.assetId,resourceEntId:e.assetId,subjectArea:_,teacherAvatar:C,title:w.title,userId:S,userStructureName:A.name||(r==null?void 0:r.structureNames[0])},k=await Me.resource(i).publish(I);k.success?s.success(x.jsx(z6,{result:k}),{duration:1e4}):s.error(x.jsx(Py,{formData:w})),t==null||t()}catch(T){console.error(T),s.error(x.jsx(Py,{formData:w}))}},handleSubmit:f,handleUploadImage:w=>a(w),register:l,selectActivities:w=>{b(w,g,v)},selectedActivities:g,selectedSubjectAreas:_,selectSubjects:w=>{b(w,_,y)},setValue:h,watch:c}}function e8({isOpen:t,resource:e,onSuccess:r,onCancel:i}){const{currentApp:s}=Tt(),{t:n}=Ce(),{control:a,cover:o,formState:{isDirty:l,isValid:c,isSubmitting:h},handleDeleteImage:f,handleSubmit:u,handleUploadImage:d,handlePublish:p,register:m,selectActivities:g,selectedActivities:v,selectedSubjectAreas:_,selectSubjects:y}=H6({resource:e,onSuccess:r}),b="bpr.form.publication.age.min",w="bpr.form.publication.age.max";return rs.createPortal(x.jsxs(je,{isOpen:t,onModalClose:i,id:"libraryModal",size:"lg",children:[x.jsx(je.Header,{onModalClose:i,children:n("bpr.publish")}),x.jsx(je.Subtitle,{children:n("bpr.form.tip")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.heading.general")}),x.jsxs("form",{id:"libraryModalForm",onSubmit:u(p),children:[x.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[x.jsxs("div",{style:{maxWidth:"160px"},children:[x.jsx("div",{className:"form-label",children:n("bpr.form.publication.cover.title")}),x.jsx(qw,{app:s,src:e.thumbnail,label:n("bpr.form.publication.cover.upload.label"),addButtonLabel:n("bpr.form.publication.cover.upload.add"),deleteButtonLabel:n("bpr.form.publication.cover.upload.remove"),onUploadImage:d,onDeleteImage:f,className:"align-self-center"}),!o&&x.jsx("p",{className:"form-text is-invalid",children:x.jsx("em",{children:n("bpr.form.publication.cover.upload.required.image")})})]}),x.jsxs("div",{className:"flex-fill",children:[x.jsxs(ft,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.title")}),x.jsx(da,{type:"text",defaultValue:e.name,...m("title",{required:!0}),placeholder:n("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ft,{id:"description",isRequired:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.description")}),x.jsx(eE,{...m("description",{required:!0}),placeholder:n("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.heading.infos")}),x.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[x.jsx(N6,{control:a,selectedActivities:v,selectActivities:g}),x.jsx(G6,{control:a,selectedSubjectAreas:_,selectSubjects:y}),x.jsx(U6,{control:a})]}),x.jsxs("div",{className:"mb-24",children:[x.jsx("label",{htmlFor:"",className:"form-label",children:n("bpr.form.publication.age")}),x.jsxs("div",{className:"d-flex gap-8",children:[x.jsx("div",{className:"col col-2",children:x.jsx(Ry,{control:a,name:"ageMin",placeholderOption:b,validate:(S,T)=>parseInt(S)<=parseInt(T.ageMax)})}),x.jsx("div",{className:"col col-2",children:x.jsx(Ry,{control:a,name:"ageMax",placeholderOption:w,validate:(S,T)=>parseInt(S)>=parseInt(T.ageMin)})})]})]}),x.jsx("div",{className:"mb-24",children:x.jsxs(ft,{id:"keywords",isOptional:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.keywords")}),x.jsx(da,{type:"text",...m("keyWords"),size:"md",placeholder:n("bpr.form.publication.keywords.placeholder")})]})}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.licence.text")}),x.jsx(j6,{})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:i,type:"button",variant:"ghost",children:n("cancel")}),x.jsx(tt,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:h,disabled:!o||h||!l||!c,children:n("bpr.form.submit")})]})]}),document.getElementById("portal"))}const My=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function V6(t,e){e?e={...My,...e}:e=My;const r=tE(e);return r.dispatch(t),r.toString()}const W6=Object.freeze(["prototype","__proto__","constructor"]);function tE(t){let e="",r=new Map;const i=s=>{e+=s};return{toString(){return e},getContext(){return r},dispatch(s){return t.replacer&&(s=t.replacer(s)),this[s===null?"null":typeof s](s)},object(s){if(s&&typeof s.toJSON=="function")return this.object(s.toJSON());const n=Object.prototype.toString.call(s);let a="";const o=n.length;o<10?a="unknown:["+n+"]":a=n.slice(8,o-1),a=a.toLowerCase();let l=null;if((l=r.get(s))===void 0)r.set(s,r.size);else return this.dispatch("[CIRCULAR:"+l+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return i("buffer:"),i(s.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this[a]?this[a](s):t.ignoreUnknown||this.unkown(s,a);else{let c=Object.keys(s);t.unorderedObjects&&(c=c.sort());let h=[];t.respectType!==!1&&!Oy(s)&&(h=W6),t.excludeKeys&&(c=c.filter(u=>!t.excludeKeys(u)),h=h.filter(u=>!t.excludeKeys(u))),i("object:"+(c.length+h.length)+":");const f=u=>{this.dispatch(u),i(":"),t.excludeValues||this.dispatch(s[u]),i(",")};for(const u of c)f(u);for(const u of h)f(u)}},array(s,n){if(n=n===void 0?t.unorderedArrays!==!1:n,i("array:"+s.length+":"),!n||s.length<=1){for(const l of s)this.dispatch(l);return}const a=new Map,o=s.map(l=>{const c=tE(t);c.dispatch(l);for(const[h,f]of c.getContext())a.set(h,f);return c.toString()});return r=a,o.sort(),this.array(o,!1)},date(s){return i("date:"+s.toJSON())},symbol(s){return i("symbol:"+s.toString())},unkown(s,n){if(i(n),!!s&&(i(":"),s&&typeof s.entries=="function"))return this.array(Array.from(s.entries()),!0)},error(s){return i("error:"+s.toString())},boolean(s){return i("bool:"+s)},string(s){i("string:"+s.length+":"),i(s)},function(s){i("fn:"),Oy(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this.object(s)},number(s){return i("number:"+s)},xml(s){return i("xml:"+s.toString())},null(){return i("Null")},undefined(){return i("Undefined")},regexp(s){return i("regex:"+s.toString())},uint8array(s){return i("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},uint8clampedarray(s){return i("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},int8array(s){return i("int8array:"),this.dispatch(Array.prototype.slice.call(s))},uint16array(s){return i("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},int16array(s){return i("int16array:"),this.dispatch(Array.prototype.slice.call(s))},uint32array(s){return i("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},int32array(s){return i("int32array:"),this.dispatch(Array.prototype.slice.call(s))},float32array(s){return i("float32array:"),this.dispatch(Array.prototype.slice.call(s))},float64array(s){return i("float64array:"),this.dispatch(Array.prototype.slice.call(s))},arraybuffer(s){return i("arraybuffer:"),this.dispatch(new Uint8Array(s))},url(s){return i("url:"+s.toString())},map(s){i("map:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},set(s){i("set:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},file(s){return i("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},blob(){if(t.ignoreUnknown)return i("[blob]");throw new Error(`Hashing Blob objects is currently not supported
1346
1346
  Use "options.replacer" or "options.ignoreUnknown"
1347
1347
  `)},domwindow(){return i("domwindow")},bigint(s){return i("bigint:"+s.toString())},process(){return i("process")},timer(){return i("timer")},pipe(){return i("pipe")},tcp(){return i("tcp")},udp(){return i("udp")},tty(){return i("tty")},statwatcher(){return i("statwatcher")},securecontext(){return i("securecontext")},connection(){return i("connection")},zlib(){return i("zlib")},context(){return i("context")},nodescript(){return i("nodescript")},httpparser(){return i("httpparser")},dataview(){return i("dataview")},signal(){return i("signal")},fsevent(){return i("fsevent")},tlswrap(){return i("tlswrap")}}}const rE="[native code] }",X6=rE.length;function Oy(t){return typeof t!="function"?!1:Function.prototype.toString.call(t).slice(-X6)===rE}class Zi{constructor(e,r){e=this.words=e||[],this.sigBytes=r===void 0?e.length*4:r}toString(e){return(e||Y6).stringify(this)}concat(e){if(this.clamp(),this.sigBytes%4)for(let r=0;r<e.sigBytes;r++){const i=e.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=i<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<e.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=e.words[r>>>2];return this.sigBytes+=e.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new Zi([...this.words])}}const Y6={stringify(t){const e=[];for(let r=0;r<t.sigBytes;r++){const i=t.words[r>>>2]>>>24-r%4*8&255;e.push((i>>>4).toString(16),(i&15).toString(16))}return e.join("")}},q6={stringify(t){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[];for(let i=0;i<t.sigBytes;i+=3){const s=t.words[i>>>2]>>>24-i%4*8&255,n=t.words[i+1>>>2]>>>24-(i+1)%4*8&255,a=t.words[i+2>>>2]>>>24-(i+2)%4*8&255,o=s<<16|n<<8|a;for(let l=0;l<4&&i*8+l*6<t.sigBytes*8;l++)r.push(e.charAt(o>>>6*(3-l)&63))}return r.join("")}},Z6={parse(t){const e=t.length,r=[];for(let i=0;i<e;i++)r[i>>>2]|=(t.charCodeAt(i)&255)<<24-i%4*8;return new Zi(r,e)}},K6={parse(t){return Z6.parse(unescape(encodeURIComponent(t)))}};class Q6{constructor(){this._data=new Zi,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new Zi,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=K6.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_doProcessBlock(e,r){}_process(e){let r,i=this._data.sigBytes/(this.blockSize*4);e?i=Math.ceil(i):i=Math.max((i|0)-this._minBufferSize,0);const s=i*this.blockSize,n=Math.min(s*4,this._data.sigBytes);if(s){for(let a=0;a<s;a+=this.blockSize)this._doProcessBlock(this._data.words,a);r=this._data.words.splice(0,s),this._data.sigBytes-=n}return new Zi(r,n)}}class J6 extends Q6{update(e){return this._append(e),this._process(),this}finalize(e){e&&this._append(e)}}const ky=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],eU=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],fs=[];class tU extends J6{constructor(){super(...arguments),this._hash=new Zi([...ky])}reset(){super.reset(),this._hash=new Zi([...ky])}_doProcessBlock(e,r){const i=this._hash.words;let s=i[0],n=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],f=i[7];for(let u=0;u<64;u++){if(u<16)fs[u]=e[r+u]|0;else{const y=fs[u-15],b=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,w=fs[u-2],S=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;fs[u]=b+fs[u-7]+S+fs[u-16]}const d=l&c^~l&h,p=s&n^s&a^n&a,m=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),g=(l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25),v=f+g+d+eU[u]+fs[u],_=m+p;f=h,h=c,c=l,l=o+v|0,o=a,a=n,n=s,s=v+_|0}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+a|0,i[3]=i[3]+o|0,i[4]=i[4]+l|0,i[5]=i[5]+c|0,i[6]=i[6]+h|0,i[7]=i[7]+f|0}finalize(e){super.finalize(e);const r=this._nDataBytes*8,i=this._data.sigBytes*8;return this._data.words[i>>>5]|=128<<24-i%32,this._data.words[(i+64>>>9<<4)+14]=Math.floor(r/4294967296),this._data.words[(i+64>>>9<<4)+15]=r,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function rU(t){return new tU().finalize(t).toString(q6)}function iE(t,e={}){const r=typeof t=="string"?t:V6(t,e);return rU(r).slice(0,10)}var sE={};Object.defineProperty(sE,"__esModule",{value:!0});const iU=t=>{const e="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",r="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",i=e.split("").join("|"),s=new RegExp(`(${i})`,"g");function n(a){return r[e.indexOf(a)]||""}return t.replace(s,n)},sU=t=>t.split("").map(e=>`\\${e}`).join(""),Dy=(t,e,r=!1)=>{const i=iU(t).trim().toLowerCase(),s=sU(e);return r?i.replace(/\s+/g,e):i.replace(new RegExp(`[^a-z0-9${s}]+`,"g"),e).replace(new RegExp(`${s}+`,"g"),e).replace(new RegExp(`^${s}`,"g"),"").replace(new RegExp(`${s}$`,"g"),"")},qa=(t,e={delimiter:"-",prefix:""})=>{if(e.delimiter||(e.delimiter="-"),e.prefix||(e.prefix=""),!t||typeof t=="boolean")return"";const{delimiter:r,prefix:i}=e;if(typeof t=="boolean")return"";if(typeof t=="string"||typeof t=="number"){const s=Dy(i,r,!0),n=Dy(String(t),r);return s?`${s}${r}${n}`:n}return"children"in t?qa(t.children):"type"in t?qa(t.props.children,e):Symbol.iterator in t?qa(Array.from(t).map(s=>qa(s,{delimiter:r})).join(r),e):""};var nE=sE.default=qa;const nU=({watch:t,selectedResource:e})=>{const[r,i]=E.useState(""),[s,n]=E.useState(!!(e!=null&&e.public)||!1),a=E.useId(),o=t("title"),{t:l}=Ce(),c=ru(),h=`${iE({foo:`${o}${a}`})}-${nE(o)}`;E.useEffect(()=>{if(s){let d="";e&&e.slug?d=e.slug:d=h,i(d)}},[s,e,o,a,h]);function f(d){n(d)}function u(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${r}`),c.success(l("explorer.copy.clipboard"))}return{slug:r,uniqueId:a,isPublic:s,resourceName:o,onPublicChange:f,onCopyToClipBoard:u}},aU=({isUpdating:t,selectedResource:e})=>{const[r,i]=E.useState(t&&(e==null?void 0:e.thumbnail)||"");return{thumbnail:r,handleDeleteImage:()=>i(""),handleUploadImage:s=>i(s)}},oU=({appCode:t,isPublic:e,onCopyToClipBoard:r,onPublicChange:i,register:s,slug:n,resourceName:a})=>{const{t:o}=Ce();return x.jsxs(x.Fragment,{children:[x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:[o("explorer.resource.editModal.heading.access"),t]}),x.jsx(zi,{type:"info",children:o("explorer.resource.editModal.access.alert")}),x.jsxs(ft,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[x.jsx(ft.Input,{type:"checkbox",role:"switch",...s("enablePublic",{disabled:!e&&!a,onChange:l=>{i(l.target.checked)}}),className:"form-check-input mt-0",size:"md"}),x.jsx(ft.Label,{className:"form-check-label mb-0",children:o("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),e&&x.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[x.jsxs("p",{className:"text-break",children:[window.location.origin,window.location.pathname,"/pub/",n]}),x.jsx(tt,{color:"primary",disabled:!e,onClick:r,type:"button",leftIcon:x.jsx(hE,{}),variant:"ghost",className:"text-nowrap",children:o("explorer.resource.editModal.access.url.button")})]})]})},lU=({isOpen:t,actions:e,onCancel:r,onSuccess:i,...s})=>{var n,a,o,l,c,h;const{appCode:f,currentApp:u}=Tt(),{t:d}=Ce(),{mode:p}=s,m=E.useId(),g=p==="create",v=p==="update",{watch:_,register:y,handleSubmit:b,formState:{isSubmitting:w,isValid:S}}=Yy({mode:"onChange",defaultValues:{description:v?(n=s.selectedResource)==null?void 0:n.description:"",enablePublic:v?(a=s.selectedResource)==null?void 0:a.public:!1,title:v?(o=s.selectedResource)==null?void 0:o.name:""}}),{slug:T,uniqueId:C,isPublic:A,resourceName:M,onPublicChange:I,onCopyToClipBoard:k}=nU({watch:_,selectedResource:v?s.selectedResource:void 0}),R=ru(),{thumbnail:P,handleDeleteImage:O,handleUploadImage:N}=aU({isUpdating:v,selectedResource:v?s.selectedResource:void 0}),B=async function(L){var U,F;try{const j={description:L.description||"",name:L.title,public:L.enablePublic,thumbnail:P},z=`${iE({foo:`${L.title}${C}`})}-${nE(L.title)}`;g?await s.createResource.mutateAsync({...j,folder:((U=s.currentFolder)==null?void 0:U.id)==="default"?void 0:parseInt(((F=s.currentFolder)==null?void 0:F.id)||""),slug:L.enablePublic?z:"",application:f}):await s.updateResource.mutateAsync({...j,slug:L.enablePublic?s.selectedResource&&s.selectedResource.slug?s.selectedResource.slug:z:"",entId:s.selectedResource.assetId,trashed:s.selectedResource.trashed}),R.success(x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:d(g?"explorer.resource.created":"explorer.resource.updated")}),x.jsxs("p",{children:[d("title")," : ",L.title]}),x.jsxs("p",{children:[d("description")," : ",L.description]}),f==="blog"&&x.jsxs("p",{children:["Public:",L.enablePublic?d("explorer.enable.public.yes"):d("explorer.enable.public.no")]})]})),i()}catch(j){console.error(j)}};return rs.createPortal(x.jsxs(je,{id:`${p}-resource`,size:"lg",isOpen:t,onModalClose:r,children:[x.jsx(je.Header,{onModalClose:r,children:d(`explorer.resource.editModal.header.${g?"create":"edit"}`)}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:d("explorer.resource.editModal.heading.general")}),x.jsxs("form",{id:m,onSubmit:b(B),children:[x.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[x.jsx("div",{children:x.jsx(qw,{app:u,src:v&&((l=s.selectedResource)==null?void 0:l.thumbnail)||"",label:d("explorer.imagepicker.label"),addButtonLabel:d("explorer.imagepicker.button.add"),deleteButtonLabel:d("explorer.imagepicker.button.delete"),onUploadImage:N,onDeleteImage:O,className:"align-self-center mt-8"})}),x.jsxs("div",{className:"col",children:[x.jsxs(ft,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:d("title")}),x.jsx(da,{type:"text",defaultValue:v?(c=s.selectedResource)==null?void 0:c.name:"",...y("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:d("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ft,{id:"description",isOptional:!0,children:[x.jsx(Nn,{children:d("description")}),x.jsx(eE,{defaultValue:v?(h=s.selectedResource)==null?void 0:h.description:"",...y("description"),placeholder:d("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),f==="blog"&&$4("createPublic",e)&&x.jsx(oU,{appCode:f,isPublic:A,slug:T,onCopyToClipBoard:k,onPublicChange:I,register:y,resourceName:M})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:d("explorer.cancel")}),x.jsx(tt,{form:m,type:"submit",color:"primary",isLoading:w,variant:"filled",disabled:!S||w,children:d(g?"explorer.create":"save")})]})]}),document.getElementById("portal"))},t8=lU;function cU({radioPublicationValue:t,onRadioPublicationChange:e}){const{appCode:r}=Tt(),{t:i}=Ce(r);return x.jsxs(x.Fragment,{children:[x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("explorer.publication.steps")}),x.jsx(_p,{label:i("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:t,checked:t==="IMMEDIATE",onChange:s=>e(s.target.value)}),x.jsx(_p,{label:i("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:t==="RESTRAINT",model:t,onChange:s=>e(s.target.value)})]})}const hU={searchInputValue:"",searchResults:[],searchAPIResults:[],searchPending:!1,isLoading:!1};function uU(t,e){switch(e.type){case"onChange":return{...t,searchInputValue:e.payload};case"isSearching":return{...t,isLoading:e.payload};case"addResult":return{...t,searchResults:e.payload};case"addApiResult":return{...t,searchAPIResults:e.payload};case"updateSearchResult":return{...t,searchResults:e.payload};case"emptyResult":return{...t,searchResults:e.payload};default:throw new Error("Unhandled action type")}}const Ad=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],dU=({resource:t,shareRights:e,shareDispatch:r})=>{const[i,s]=E.useReducer(uU,hU),n=H4(i.searchInputValue,500),{isAdml:a}=t5(),{appCode:o}=Tt(),{t:l}=Ce();E.useEffect(()=>{h(n)},[n]);const c=f=>{const u=f.target.value;s({type:"onChange",payload:u})},h=async f=>{if(s({type:"isSearching",payload:!0}),!a&&f.length>=1||a&&f.length>=3){const u=await Me.share().searchShareSubjects(o,t.assetId,f);s({type:"addApiResult",payload:u});const d=u.filter(p=>!e.rights.find(m=>m.id===p.id)).filter(p=>!(p.type==="user"&&p.id===t.creatorId)).map(p=>{let m=p.displayName;return p.type==="user"&&p.profile?m=`${m} (${l(p.profile)})`:p.type==="group"&&p.structureName?m=`${m} (${p.structureName})`:p.type==="sharebookmark"&&(m=`${m} (${l("sharebookmark")})`),{value:p.id,label:m,icon:p.type==="sharebookmark"?wp:null}});s({type:"addResult",payload:d})}else s({type:"emptyResult",payload:[]}),Promise.resolve();s({type:"isSearching",payload:!1})};return{state:i,showSearchAdmlHint:()=>a&&i.searchInputValue.length<3,showSearchLoading:()=>i.searchPending&&i.searchInputValue.length>0,showSearchNoResults:()=>!i.searchPending&&!a&&n.length>0&&i.searchResults.length===0||!i.searchPending&&a&&n.length>3&&i.searchResults.length===0,handleSearchInputChange:c,handleSearchResultsChange:async f=>{const u=i.searchAPIResults.find(d=>d.id===f[0]);if(u){let d=[];if(u.type==="sharebookmark"){const p=await Me.directory().getBookMarkById(u.id);d.push({...p,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:Ad}),p==null||p.users.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"user",avatarUrl:"",directoryUrl:"",actions:Ad,isBookmarkMember:!0})}),p.groups.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"group",avatarUrl:"",directoryUrl:"",actions:Ad,isBookmarkMember:!0})})}else d=[{...u,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];r({type:"updateShareRights",payload:{...e,rights:[...e.rights,...d]}}),s({type:"updateSearchResult",payload:i.searchResults.filter(p=>p.value!==f[0])})}}}},fU={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function pU(t,e){switch(e.type){case"init":return{...t,...e.payload};case"deleteRow":return{...t,shareRights:e.payload};case"updateShareRights":return{...t,shareRights:e.payload};case"toggleRight":return{...t,shareRights:e.payload};case"isSharing":return{...t,isSharing:!0};default:throw new Error("Unhandled action type")}}function mU({onSuccess:t,resource:e,updateResource:r,shareResource:i}){const{appCode:s}=Tt(),{user:n,avatar:a}=zw(),[o,l]=E.useReducer(pU,fU);return E.useEffect(()=>{(async()=>{const c=await Me.share().getActionsForApp(s),h=await Me.share().getRightsForResource(s,e.assetId);l({type:"init",payload:{shareRightActions:c,shareRights:h}})})()},[]),{state:o,dispatch:l,currentIsAuthor:()=>!!(e&&e.creatorId===(n==null?void 0:n.userId)),myAvatar:a,handleDeleteRow:c=>{l({type:"deleteRow",payload:{...o.shareRights,rights:o.shareRights.rights.filter(h=>{var f,u;return h.id!==c.id&&!((f=c.users)!=null&&f.find(d=>d.id===h.id))&&!((u=c.groups)!=null&&u.find(d=>d.id===h.id))})}})},handleShare:async c=>{l({type:"isSharing",payload:!0});try{const h=e.rights.filter(u=>n&&u.includes(`user:${n.userId}`)).map(u=>u.split(":")[2]).filter(u=>!!u),f=[...o.shareRights.rights];if(h.length>0){const u=h.map(d=>({displayName:d,id:d}));f.push({actions:u,avatarUrl:"",directoryUrl:"",displayName:n.username,id:n.userId,type:"user"})}s==="blog"?await r.mutateAsync(c):await r.mutateAsync({entId:e.assetId||"",trashed:e.trashed||!1,name:e.name||"",thumbnail:e.thumbnail||"",description:e.description||"",public:e.public||!1,slug:e.slug||""}),await i.mutateAsync({resourceId:e.assetId,rights:f}),t==null||t()}catch(h){console.error("Failed to save share",h)}finally{l({type:"isSharing",payload:!1})}},toggleRight:(c,h)=>{var f,u;const{rights:d,...p}=o.shareRights,m=[...d],g=m.findIndex(_=>_.id===c.id),v=o.shareRightActions.filter(_=>_.id===h)[0];if(m[g].actions.findIndex(_=>_.id===h)>-1){let _=m[g].actions.filter(b=>b.id!==h);const y=o.shareRightActions.filter(b=>{var w;return(w=b.requires)==null?void 0:w.includes(h)});_=_.filter(b=>!y.find(w=>w.id===b.id)),m[g]={...m[g],actions:_}}else{const _=o.shareRightActions.filter(y=>{var b;return((b=v.requires)==null?void 0:b.includes(y.id))&&!m[g].actions.find(w=>w.id===y.id)});m[g]={...m[g],actions:[...m[g].actions,v,..._]}}c.type==="sharebookmark"&&((f=m[g].users)==null||f.forEach(_=>{const y=m.findIndex(b=>b.id===_.id);m[y]={...m[y],actions:m[g].actions}}),(u=m[g].groups)==null||u.forEach(_=>{const y=m.findIndex(b=>b.id===_.id);m[y]={...m[y],actions:m[g].actions}})),l({type:"toggleRight",payload:{rights:m,...p}})}}}function gU({resource:t}){const{assetId:e,description:r,thumbnail:i,name:s,public:n,trashed:a,slug:o,"publish-type":l}=t||{"publish-type":"",assetId:"",description:"",name:"",public:!1,slug:"",thumbnail:"",trashed:!1},[c,h]=E.useState(l||"RESTRAINT"),[f,u]=E.useState({description:r||"",entId:e,name:s,public:!!n,slug:o||"",thumbnail:i,trashed:a,"publish-type":l});return E.useEffect(()=>{c&&u(d=>({...d,"publish-type":c}))},[c]),{radioPublicationValue:c,shareBlogPayload:f,handleRadioPublicationChange:async d=>{h(d)}}}const vU=({shareRights:t,shareDispatch:e})=>{const r=ru(),{t:i}=Ce(),s=E.useRef(null),[n,a]=E.useState({name:"",id:E.useId()}),[o,l]=Q4(!1),[c,h]=E.useState(!1),f=()=>{l()},u=()=>{a(p=>{var m;return{...p,name:((m=s.current)==null?void 0:m.value)||""}})},d=async p=>{try{const m=await Me.directory().saveBookmarks(p,{users:t.rights.filter(g=>g.type==="user").map(g=>g.id),groups:t.rights.filter(g=>g.type==="group").map(g=>g.id),bookmarks:t.rights.filter(g=>g.type==="sharebookmark").map(g=>g.id)});r.success(i("explorer.bookmarked.status.saved")),e({type:"updateShareRights",payload:{...t,visibleBookmarks:[...t.visibleBookmarks,{displayName:p,id:m.id}]}}),a(g=>({...g,bookmarkId:g.id+new Date().getTime().toString()})),h(!1)}catch(m){console.error("Failed to save bookmark",m),r.error(i("explorer.bookmarked.status.error"))}};return{refBookmark:s,showBookmark:o,showBookmarkInput:c,bookmark:n,handleBookmarkChange:u,setBookmark:a,handleOnSave:()=>{var p;const m=((p=s.current)==null?void 0:p.value)||"";d(m)},toggleBookmark:f,toggleBookmarkInput:h}},yU=({bookmark:t,refBookmark:e,onBookmarkChange:r,onSave:i})=>{const{t:s}=Ce();return x.jsx("div",{className:"mt-16",children:x.jsxs(ft,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[x.jsx("div",{className:"flex-fill",children:x.jsx(ft.Input,{ref:e,onChange:r,placeholder:s("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},t.id)}),x.jsx(tt,{type:"button",color:"primary",variant:"ghost",disabled:t.name.length===0,leftIcon:x.jsx(oE,{}),onClick:i,className:"text-nowrap",children:s("explorer.modal.share.sharebookmark.save")})]})})},bU=(t,e)=>t.actions.filter(r=>e.id===r.id).length>0,xU=(t,e)=>t.isBookmarkMember&&e||!t.isBookmarkMember,_U=({shareRights:t,showBookmark:e,toggleBookmark:r,shareRightActions:i,toggleRight:s,onDeleteRow:n})=>{const{t:a}=Ce();return t==null?void 0:t.rights.map(o=>xU(o,e)&&x.jsxs("tr",{className:o.isBookmarkMember?"bg-light":"",children:[x.jsxs("td",{children:[o.type!=="sharebookmark"&&x.jsx(ua,{alt:a("explorer.modal.share.avatar.shared.alt"),size:"xs",src:o.avatarUrl,variant:"circle"}),o.type==="sharebookmark"&&x.jsx(wp,{})]}),x.jsx("td",{children:x.jsxs("div",{className:"d-flex",children:[o.type==="sharebookmark"&&x.jsx(tt,{color:"tertiary",rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:e?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:r,children:o.displayName}),o.type!=="sharebookmark"&&o.displayName]})}),i.map(l=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:bU(o,l),onChange:()=>s(o,l.id)})},l.displayName)),x.jsx("td",{children:!o.isBookmarkMember&&x.jsx(Qs,{"aria-label":"Delete",color:"tertiary",icon:x.jsx(Zy,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>n(o)})})]},o.id))};function r8({isOpen:t,resource:e,updateResource:r,shareResource:i,onSuccess:s,onCancel:n}){const{appCode:a}=Tt(),{radioPublicationValue:o,shareBlogPayload:l,handleRadioPublicationChange:c}=gU({resource:e}),{state:{isSharing:h,shareRights:f,shareRightActions:u},dispatch:d,myAvatar:p,currentIsAuthor:m,handleShare:g,toggleRight:v,handleDeleteRow:_}=mU({resource:e,updateResource:r,shareResource:i,onSuccess:s}),{state:{searchResults:y,searchInputValue:b},showSearchAdmlHint:w,showSearchLoading:S,showSearchNoResults:T,handleSearchInputChange:C,handleSearchResultsChange:A}=dU({resource:e,shareRights:f,shareDispatch:d}),{refBookmark:M,showBookmark:I,handleBookmarkChange:k,toggleBookmark:R,bookmark:P,handleOnSave:O,showBookmarkInput:N,toggleBookmarkInput:B}=vU({shareRights:f,shareDispatch:d}),{t:L}=Ce(),U=w()?L("explorer.search.adml.hint"):L("explorer.modal.share.search.placeholder");return rs.createPortal(x.jsxs(je,{id:"share_modal",size:"lg",isOpen:t,onModalClose:n,children:[x.jsx(je.Header,{onModalClose:n,children:L("share.title")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:L("explorer.modal.share.usersWithAccess")}),x.jsx("div",{className:"table-responsive",children:x.jsxs("table",{className:"table border align-middle mb-0",children:[x.jsx("thead",{className:"bg-secondary",children:x.jsxs("tr",{children:[x.jsx("th",{scope:"col",className:"w-32",children:x.jsx(Hi,{children:L("explorer.modal.share.avatar.shared.alt")})}),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:L("explorer.modal.share.search.placeholder")})}),u.map(F=>x.jsx("th",{scope:"col",className:"text-center text-white",children:L(F.displayName)},F.displayName)),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:L("close")})})]})}),x.jsxs("tbody",{children:[m()&&x.jsxs("tr",{children:[x.jsx("th",{scope:"row",children:x.jsx(ua,{alt:L("explorer.modal.share.avatar.me.alt"),size:"xs",src:p,variant:"circle"})}),x.jsx("td",{children:L("share.me")}),u.map(F=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:!0,disabled:!0})},F.displayName)),x.jsx("td",{})]}),x.jsx(_U,{showBookmark:I,shareRightActions:u,shareRights:f,onDeleteRow:_,toggleRight:v,toggleBookmark:R})]})]})}),x.jsxs("div",{className:"mt-16",children:[x.jsx(tt,{color:"tertiary",leftIcon:x.jsx(wp,{}),rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:N?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>B(!N),children:L("share.save.sharebookmark")}),N&&x.jsx(yU,{refBookmark:M,bookmark:P,onBookmarkChange:k,onSave:O})]}),x.jsx("hr",{}),x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[x.jsx("div",{className:"me-8",children:L("explorer.modal.share.search")}),x.jsx(P5,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:x.jsx(qy,{className:"c-pointer",height:"18"})})]}),x.jsx("div",{className:"row",children:x.jsx("div",{className:"col-10",children:x.jsx(r6,{value:b,placeholder:U,isLoading:S(),noResult:T(),options:y,onSearchInputChange:C,onSearchResultsChange:A})})}),a==="blog"&&x.jsx(cU,{radioPublicationValue:o,onRadioPublicationChange:c})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:n,children:L("explorer.cancel")}),x.jsx(tt,{type:"button",color:"primary",variant:"filled",isLoading:h,onClick:()=>g(l),disabled:h,children:L("share")})]})]}),document.getElementById("portal"))}function Cd({children:t}){return x.jsx("span",{className:"position-absolute badge rounded-pill bg-warning",children:t})}function Id({children:t,className:e,...r}){const i=re("navbar",e);return x.jsx("nav",{className:i,...r,children:t})}function Ny({children:t,className:e,...r}){const i=re("navbar-nav",e);return x.jsx("ul",{className:i,...r,children:t})}const Ge=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("nav-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})});function La({link:t,className:e,children:r,translate:i,...s}){const n=re("nav-link",e);return x.jsxs("a",{href:t,className:n,...s,children:[r,i&&x.jsx(Hi,{children:x.jsx("span",{className:"nav-text",children:i})})]})}const wU=()=>{const{t}=Ce();return x.jsx("div",{className:"widget-footer",children:x.jsx("div",{className:"widget-footer-action",children:x.jsx("a",{href:"/welcome",className:"link",children:t("plus")})})})},EU=({bookmarkedApps:t})=>{const{t:e}=Ce();return x.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!t.length&&x.jsx("div",{className:"text-dark",children:e("navbar.myapps.more")}),t.slice(0,6).map((r,i)=>x.jsx("a",{href:r.address,className:"bookmarked-app",children:x.jsx(Ho,{app:r,size:"32"})},i))]})};function Ly({isHelpOpen:t,setIsHelpOpen:e,parsedHeadline:r,parsedContent:i,error:s}){const{t:n}=Ce(),a=()=>{e(!1)};return t?rs.createPortal(x.jsxs(je,{id:"help-modal",isOpen:t,onModalClose:a,scrollable:!0,size:"lg",children:[x.jsx(je.Header,{onModalClose:a,children:n("navbar.help")}),x.jsx(je.Subtitle,{children:s?n("help.notfound.title"):r}),x.jsx(je.Body,{className:s?"d-flex":null,children:s?n("help.notfound.text"):i})]}),document.getElementById("portal")):null}function TU(){var t,e,r,i,s;const{appCode:n}=Tt(),{theme:a}=Om(),[o,l]=E.useState(""),[c,h]=E.useState(!0),[f,u]=E.useState(!1),[d,p]=E.useState(!1),m=a!=null&&a.is1d?"/help-1d":"/help-2d";E.useEffect(()=>{(async()=>{let y="";y=m+"/application/"+n+"/",!n&&window.location.pathname!=="/adapter"?y=m+"/application/portal/":window.location.pathname==="/adapter"?y=m+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?y=m+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(y=m+"/application/userbook/");try{const b=await fetch(y),w=await b.text();if(b.status===404){p(!0);return}l(w),p(!1)}catch(b){p(!0),console.error(b)}})()},[n,m]);const g=os(o,{replace:y=>{const b=y;if(b.attribs&&b.attribs.id==="TOC")return x.jsxs("nav",{id:"TOC",children:[x.jsx(tt,{onClick:()=>{h(!c)},children:x.jsx(xE,{})}),Pl(b.children,{replace:w=>{const S=w;if(S.attribs&&S.name==="ul")return x.jsx("ul",{id:"TOC-list",style:{display:c?"block":"none"},children:Pl(S.children,{replace:T=>{const C=T;if(C.attribs&&C.name==="a")return x.jsx("a",{...Au(C.attribs),children:x.jsx("span",{onClick:()=>{h(!1)},children:Pl(C.children)})})}})})}})]});if(b.attribs&&b.attribs.class==="section level2"){const w=Au(y.attribs);return x.jsx("div",{...w,className:"section level2",style:{display:b.attribs.id!=="présentation"?"none":"block"},children:Pl(b.children,{replace:S=>{const T=S;if(T.attribs&&T.name==="img"){const C=S.attribs.src;return x.jsx("img",{...Au(T.attribs),src:`${m}/${C}`,alt:""})}}})})}}}),v=(r=(e=(t=g==null?void 0:g.props)==null?void 0:t.children.find(y=>y.type==="body"))==null?void 0:e.props)==null?void 0:r.children,_=(s=(i=v==null?void 0:v.find(y=>y.type==="p"))==null?void 0:i.props)==null?void 0:s.children;return{html:o,visibility:c,isModalOpen:f,setIsModalOpen:u,parsedContent:v,parsedHeadline:_,error:d}}const SU=()=>{const[t,e]=Gw(),r=E.useRef(null),i=E.useId(),{t:s}=Ce();function n(){if(r.current){const a=r.current.value;window.location.href=`/searchengine#/${a}`}}return x.jsxs(Ge,{id:i,ref:t,className:"position-relative","aria-haspopup":"true","aria-expanded":e,children:[x.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[x.jsx(L2,{className:"icon search"}),x.jsx("span",{className:"nav-text",children:s("navbar.search")})]}),x.jsx(Qw,{id:i,isVisible:e,className:"d-none d-md-flex",children:x.jsxs(ft,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[x.jsx(ft.Input,{ref:r,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),x.jsx(M4,{type:"submit",size:"sm",onClick:n,"aria-label":s("navbar.search")})]})})]})},AU=SU,CU=({is1d:t=!1,src:e=""})=>{const{t:r}=Ce(),{messages:i,msgLink:s,zimbraWorkflow:n}=z4(),{user:a,avatar:o}=zw(),{currentLanguage:l}=Tt(),{isModalOpen:c,setIsModalOpen:h,parsedContent:f,parsedHeadline:u,error:d}=TU(),p=re("header",{"no-2d":t,"no-1d":!t}),{title:m,bookmarkedApps:g,appsRef:v,isAppsHovered:_,popoverAppsId:y,userAvatar:b,userName:w,welcomeUser:S,communityWorkflow:T,conversationWorflow:C,searchWorkflow:A,isCollapsed:M,toggleCollapsedNav:I,handleLogout:k}=e5({user:a,avatar:o}),R=i>0;return x.jsx("header",{className:p,children:t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"container-fluid",children:x.jsxs(Id,{children:[x.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:"/timeline/timeline",children:m}),x.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[x.jsx(ua,{alt:w,size:"sm",src:b,variant:"circle",width:"32",height:"32"}),x.jsx("span",{className:"navbar-text",children:S})]}),x.jsxs(Ny,{className:"gap-8","aria-hidden":"false","aria-label":r("navbar.main.navigation"),children:[C&&x.jsx(Ge,{children:x.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[x.jsx(k2,{className:"icon notification"}),R&&x.jsx(Cd,{children:i}),x.jsx(Hi,{children:r("navbar.messages")})]})}),x.jsx(Ge,{children:x.jsx(La,{link:"/userbook/mon-compte",className:"dropdown-item",translate:r("navbar.myaccount"),children:x.jsx(xx,{className:"icon user"})})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link",onClick:()=>{h(!0)},children:[x.jsx(M2,{className:"icon help"}),x.jsx(Hi,{children:r("navbar.help")})]}),x.jsx(Ly,{isHelpOpen:c,setIsHelpOpen:h,parsedContent:f,parsedHeadline:u,error:d})]}):null,x.jsx(Ge,{children:x.jsxs("button",{className:"nav-link",onClick:k,children:[x.jsx(Dg,{className:"icon logout"}),x.jsx(Hi,{children:r("navbar.disconnect")})]})}),x.jsx(Ge,{className:"d-md-none",children:x.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!M,"aria-label":r("navbar.secondary.navigation"),onClick:I,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),x.jsx(Id,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":r("navbar.secondary.navigation"),children:x.jsx("div",{className:"container-fluid",children:x.jsxs("div",{className:`collapse navbar-collapse ${M?"":"show"}`,id:"navbarCollapsed",children:[x.jsx(Iy,{is1d:!0,src:`${e}/img/illustrations/logo.png`,translate:r("navbar.home")}),x.jsxs(Ny,{className:"gap-8",children:[x.jsx(Ge,{children:x.jsxs("a",{href:"/timeline/timeline",className:"button",children:[x.jsx(R2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.whatsnew")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[x.jsx(F2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.classMembers")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/welcome",className:"button",children:[x.jsx(Ng,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.myapps")})]})})]})]})})})]}):x.jsx(Id,{className:"navbar-expand-md",children:x.jsxs("div",{className:"container-fluid",children:[x.jsx(Iy,{src:`${e}/img/illustrations/logo.png`}),x.jsx("a",{href:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:m}),x.jsxs("ul",{className:"navbar-nav",children:[x.jsx(Ge,{children:x.jsx(La,{link:"/timeline/timeline",translate:r("navbar.home"),children:x.jsx(E2,{color:"#fff"})})}),x.jsxs(Ge,{className:"position-relative",ref:v,id:y,"aria-haspopup":"true","aria-expanded":_,children:[x.jsx(La,{link:"/welcome",translate:r("navbar.applications"),children:x.jsx(Ng,{color:"#fff"})}),x.jsxs(Qw,{className:"top-100 widget",id:y,isVisible:_,children:[x.jsx(b6,{children:x.jsx(EU,{bookmarkedApps:g})}),x.jsx(x6,{className:"widget-footer border-top border-ghost",children:x.jsx(wU,{})})]})]}),C&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:"/conversation/conversation",translate:r("conversation"),children:[x.jsx(Lg,{color:"#fff"}),R&&x.jsx(Cd,{children:i})]})}),n&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:s,translate:r("conversation"),children:[x.jsx(Lg,{color:"#fff"}),R&&x.jsx(Cd,{children:i})]})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{h(!0)},children:[x.jsx(A2,{color:"#fff"}),x.jsx(Hi,{children:r("support")})]}),x.jsx(Ly,{isHelpOpen:c,setIsHelpOpen:h,parsedContent:f,parsedHeadline:u,error:d})]}):null,x.jsx(Ge,{children:x.jsxs("div",{className:"dropdown",children:[x.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!M,"aria-label":r("navbar.open.menu"),onClick:I,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),x.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${M?"":"show"}`,id:"dropdown-navbar",children:[T&&x.jsx(Ge,{children:x.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[x.jsx(x2,{className:"icon community"}),x.jsx("span",{className:"nav-text",children:r("navbar.community")})]})}),A?x.jsx(AU,{}):null,x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[x.jsx(ua,{alt:w,size:"sm",src:b,variant:"circle",className:"bg-white",width:"32",height:"32"}),x.jsx("span",{className:"nav-text",children:r("navbar.myaccount")})]})}),x.jsx(Ge,{children:x.jsx("hr",{className:"dropdown-divider"})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/auth/logout?callback=",className:"nav-link dropdown-item",children:[x.jsx(Dg,{className:"icon logout"}),x.jsx("span",{id:"logout-label",className:"nav-text",children:r("navbar.disconnect")})]})})]})]})})]})]})})})},IU=CU;function RU({children:t,className:e,...r}){const i=re("container-fluid",e);return x.jsx("main",{className:i,...r,children:t})}const PU=({children:t,...e})=>{const{theme:r}=Om();return x.jsxs(x.Fragment,{children:[x.jsx(IU,{is1d:r==null?void 0:r.is1d,src:r==null?void 0:r.basePath}),x.jsx(RU,{className:re("d-flex flex-column bg-white",{"rounded-4 border":r==null?void 0:r.is1d,"mt-24":r==null?void 0:r.is1d}),...e,children:t}),x.jsx(VT,{toastOptions:{position:"top-right"}})]})},i8=PU;V1.extend(ok);V1.extend(nk);export{GU as A,tt as B,qU as C,ot as D,ZU as E,ft as F,s6 as G,jU as H,Qs as I,Ho as J,ua as K,KU as L,je as M,xx as N,zU as O,P5 as P,NU as Q,V1 as R,M4 as S,QU as T,ok as U,re as V,Nn as W,t8 as X,r8 as Y,e8 as Z,Tt as a,pb as b,ru as c,hb as d,FU as e,zw as f,UU as g,da as h,Q4 as i,x as j,XU as k,$4 as l,YU as m,i8 as n,LE as o,BU as p,HU as q,Om as r,WU as s,iu as t,VU as u,wa as v,cx as w,of as x,$U as y,JU as z};
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 16/01/2024 18:41:58
1
+ ode-explorer=1.0-b2school-SNAPSHOT 17/01/2024 16:15:19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "1.3.2-dev.202401161841",
3
+ "version": "1.3.2-dev.202401171614",
4
4
  "description": "Open Digital Education Explorer",
5
5
  "homepage": "https://github.com/opendigitaleducation/explorer#readme",
6
6
  "bugs": {