ode-explorer 1.3.2-dev.202401091744 → 1.3.2-dev.202401101530
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.
- package/dist/index.js +3 -3
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +219 -313
- package/lib/AppAction.js +26 -39
- package/lib/DeleteModal.js +31 -39
- package/lib/DisableModal.js +14 -14
- package/lib/EmptyScreenApp.js +27 -43
- package/lib/EmptyScreenError.js +9 -10
- package/lib/EmptyScreenNoContentInFolder.js +12 -14
- package/lib/EmptyScreenSearch.js +11 -13
- package/lib/EmptyScreenTrash.js +11 -13
- package/lib/FolderModal.js +86 -105
- package/lib/FoldersList.js +42 -55
- package/lib/Library.js +12 -15
- package/lib/MoveModal.js +53 -69
- package/lib/ResourcesList.js +190 -202
- package/lib/TrashModal.js +13 -13
- package/lib/index.js +2 -2
- package/lib/index2.js +1012 -1503
- package/lib/style.css +1 -410
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -218,7 +218,7 @@ to {
|
|
|
218
218
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
219
219
|
`)},domwindow(){return r("domwindow")},bigint(s){return r("bigint:"+s.toString())},process(){return r("process")},timer(){return r("timer")},pipe(){return r("pipe")},tcp(){return r("tcp")},udp(){return r("udp")},tty(){return r("tty")},statwatcher(){return r("statwatcher")},securecontext(){return r("securecontext")},connection(){return r("connection")},zlib(){return r("zlib")},context(){return r("context")},nodescript(){return r("nodescript")},httpparser(){return r("httpparser")},dataview(){return r("dataview")},signal(){return r("signal")},fsevent(){return r("fsevent")},tlswrap(){return r("tlswrap")}}}const N2="[native code] }",b8=N2.length;function b0(e){return typeof e!="function"?!1:Function.prototype.toString.call(e).slice(-b8)===N2}class Jr{constructor(t,n){t=this.words=t||[],this.sigBytes=n===void 0?t.length*4:n}toString(t){return(t||S8).stringify(this)}concat(t){if(this.clamp(),this.sigBytes%4)for(let n=0;n<t.sigBytes;n++){const r=t.words[n>>>2]>>>24-n%4*8&255;this.words[this.sigBytes+n>>>2]|=r<<24-(this.sigBytes+n)%4*8}else for(let n=0;n<t.sigBytes;n+=4)this.words[this.sigBytes+n>>>2]=t.words[n>>>2];return this.sigBytes+=t.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 Jr([...this.words])}}const S8={stringify(e){const t=[];for(let n=0;n<e.sigBytes;n++){const r=e.words[n>>>2]>>>24-n%4*8&255;t.push((r>>>4).toString(16),(r&15).toString(16))}return t.join("")}},E8={stringify(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[];for(let r=0;r<e.sigBytes;r+=3){const s=e.words[r>>>2]>>>24-r%4*8&255,i=e.words[r+1>>>2]>>>24-(r+1)%4*8&255,o=e.words[r+2>>>2]>>>24-(r+2)%4*8&255,l=s<<16|i<<8|o;for(let a=0;a<4&&r*8+a*6<e.sigBytes*8;a++)n.push(t.charAt(l>>>6*(3-a)&63))}return n.join("")}},C8={parse(e){const t=e.length,n=[];for(let r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new Jr(n,t)}},k8={parse(e){return C8.parse(unescape(encodeURIComponent(e)))}};class T8{constructor(){this._data=new Jr,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new Jr,this._nDataBytes=0}_append(t){typeof t=="string"&&(t=k8.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}_doProcessBlock(t,n){}_process(t){let n,r=this._data.sigBytes/(this.blockSize*4);t?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);const s=r*this.blockSize,i=Math.min(s*4,this._data.sigBytes);if(s){for(let o=0;o<s;o+=this.blockSize)this._doProcessBlock(this._data.words,o);n=this._data.words.splice(0,s),this._data.sigBytes-=i}return new Jr(n,i)}}class j8 extends T8{update(t){return this._append(t),this._process(),this}finalize(t){t&&this._append(t)}}const S0=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],P8=[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 O8 extends j8{constructor(){super(...arguments),this._hash=new Jr([...S0])}reset(){super.reset(),this._hash=new Jr([...S0])}_doProcessBlock(t,n){const r=this._hash.words;let s=r[0],i=r[1],o=r[2],l=r[3],a=r[4],u=r[5],c=r[6],f=r[7];for(let p=0;p<64;p++){if(p<16)fs[p]=t[n+p]|0;else{const v=fs[p-15],b=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,E=fs[p-2],T=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;fs[p]=b+fs[p-7]+T+fs[p-16]}const h=a&u^~a&c,y=s&i^s&o^i&o,w=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),x=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),g=f+x+h+P8[p]+fs[p],m=w+y;f=c,c=u,u=a,a=l+g|0,l=o,o=i,i=s,s=g+m|0}r[0]=r[0]+s|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+l|0,r[4]=r[4]+a|0,r[5]=r[5]+u|0,r[6]=r[6]+c|0,r[7]=r[7]+f|0}finalize(t){super.finalize(t);const n=this._nDataBytes*8,r=this._data.sigBytes*8;return this._data.words[r>>>5]|=128<<24-r%32,this._data.words[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),this._data.words[(r+64>>>9<<4)+15]=n,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function R8(e){return new O8().finalize(e).toString(E8)}function A2(e,t={}){const n=typeof e=="string"?e:w8(e,t);return R8(n).slice(0,10)}var I2={};Object.defineProperty(I2,"__esModule",{value:!0});const N8=e=>{const t="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",n="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",r=t.split("").join("|"),s=new RegExp(`(${r})`,"g");function i(o){return n[t.indexOf(o)]||""}return e.replace(s,i)},A8=e=>e.split("").map(t=>`\\${t}`).join(""),E0=(e,t,n=!1)=>{const r=N8(e).trim().toLowerCase(),s=A8(t);return n?r.replace(/\s+/g,t):r.replace(new RegExp(`[^a-z0-9${s}]+`,"g"),t).replace(new RegExp(`${s}+`,"g"),t).replace(new RegExp(`^${s}`,"g"),"").replace(new RegExp(`${s}$`,"g"),"")},Vo=(e,t={delimiter:"-",prefix:""})=>{if(t.delimiter||(t.delimiter="-"),t.prefix||(t.prefix=""),!e||typeof e=="boolean")return"";const{delimiter:n,prefix:r}=t;if(typeof e=="boolean")return"";if(typeof e=="string"||typeof e=="number"){const s=E0(r,n,!0),i=E0(String(e),n);return s?`${s}${n}${i}`:i}return"children"in e?Vo(e.children):"type"in e?Vo(e.props.children,t):Symbol.iterator in e?Vo(Array.from(e).map(s=>Vo(s,{delimiter:n})).join(n),t):""};var _2=I2.default=Vo,rg={},sg={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function n(r){return r.type===t.Tag||r.type===t.Script||r.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})(sg);var oe={},us=lt&<.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),la=lt&<.__assign||function(){return la=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},la.apply(this,arguments)};Object.defineProperty(oe,"__esModule",{value:!0});oe.cloneNode=oe.hasChildren=oe.isDocument=oe.isDirective=oe.isComment=oe.isText=oe.isCDATA=oe.isTag=oe.Element=oe.Document=oe.CDATA=oe.NodeWithChildren=oe.ProcessingInstruction=oe.Comment=oe.Text=oe.DataNode=oe.Node=void 0;var jt=sg,ig=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),og(this,t)},e}();oe.Node=ig;var pd=function(e){us(t,e);function t(n){var r=e.call(this)||this;return r.data=n,r}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(n){this.data=n},enumerable:!1,configurable:!0}),t}(ig);oe.DataNode=pd;var M2=function(e){us(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=jt.ElementType.Text,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(pd);oe.Text=M2;var L2=function(e){us(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=jt.ElementType.Comment,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(pd);oe.Comment=L2;var D2=function(e){us(t,e);function t(n,r){var s=e.call(this,r)||this;return s.name=n,s.type=jt.ElementType.Directive,s}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(pd);oe.ProcessingInstruction=D2;var hd=function(e){us(t,e);function t(n){var r=e.call(this)||this;return r.children=n,r}return Object.defineProperty(t.prototype,"firstChild",{get:function(){var n;return(n=this.children[0])!==null&&n!==void 0?n:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(n){this.children=n},enumerable:!1,configurable:!0}),t}(ig);oe.NodeWithChildren=hd;var F2=function(e){us(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=jt.ElementType.CDATA,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(hd);oe.CDATA=F2;var $2=function(e){us(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=jt.ElementType.Root,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(hd);oe.Document=$2;var z2=function(e){us(t,e);function t(n,r,s,i){s===void 0&&(s=[]),i===void 0&&(i=n==="script"?jt.ElementType.Script:n==="style"?jt.ElementType.Style:jt.ElementType.Tag);var o=e.call(this,s)||this;return o.name=n,o.attribs=r,o.type=i,o}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(n){this.name=n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var n=this;return Object.keys(this.attribs).map(function(r){var s,i;return{name:r,value:n.attribs[r],namespace:(s=n["x-attribsNamespace"])===null||s===void 0?void 0:s[r],prefix:(i=n["x-attribsPrefix"])===null||i===void 0?void 0:i[r]}})},enumerable:!1,configurable:!0}),t}(hd);oe.Element=z2;function B2(e){return(0,jt.isTag)(e)}oe.isTag=B2;function V2(e){return e.type===jt.ElementType.CDATA}oe.isCDATA=V2;function U2(e){return e.type===jt.ElementType.Text}oe.isText=U2;function H2(e){return e.type===jt.ElementType.Comment}oe.isComment=H2;function q2(e){return e.type===jt.ElementType.Directive}oe.isDirective=q2;function W2(e){return e.type===jt.ElementType.Root}oe.isDocument=W2;function I8(e){return Object.prototype.hasOwnProperty.call(e,"children")}oe.hasChildren=I8;function og(e,t){t===void 0&&(t=!1);var n;if(U2(e))n=new M2(e.data);else if(H2(e))n=new L2(e.data);else if(B2(e)){var r=t?Af(e.children):[],s=new z2(e.name,la({},e.attribs),r);r.forEach(function(a){return a.parent=s}),e.namespace!=null&&(s.namespace=e.namespace),e["x-attribsNamespace"]&&(s["x-attribsNamespace"]=la({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(s["x-attribsPrefix"]=la({},e["x-attribsPrefix"])),n=s}else if(V2(e)){var r=t?Af(e.children):[],i=new F2(r);r.forEach(function(u){return u.parent=i}),n=i}else if(W2(e)){var r=t?Af(e.children):[],o=new $2(r);r.forEach(function(u){return u.parent=o}),e["x-mode"]&&(o["x-mode"]=e["x-mode"]),n=o}else if(q2(e)){var l=new D2(e.name,e.data);e["x-name"]!=null&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}else throw new Error("Not implemented yet: ".concat(e.type));return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}oe.cloneNode=og;function Af(e){for(var t=e.map(function(r){return og(r,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}(function(e){var t=lt&<.__createBinding||(Object.create?function(l,a,u,c){c===void 0&&(c=u);var f=Object.getOwnPropertyDescriptor(a,u);(!f||("get"in f?!a.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return a[u]}}),Object.defineProperty(l,c,f)}:function(l,a,u,c){c===void 0&&(c=u),l[c]=a[u]}),n=lt&<.__exportStar||function(l,a){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(a,u)&&t(a,l,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=sg,s=oe;n(oe,e);var i={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function l(a,u,c){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof u=="function"&&(c=u,u=i),typeof a=="object"&&(u=a,a=void 0),this.callback=a??null,this.options=u??i,this.elementCB=c??null}return l.prototype.onparserinit=function(a){this.parser=a},l.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},l.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},l.prototype.onerror=function(a){this.handleCallback(a)},l.prototype.onclosetag=function(){this.lastNode=null;var a=this.tagStack.pop();this.options.withEndIndices&&(a.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(a)},l.prototype.onopentag=function(a,u){var c=this.options.xmlMode?r.ElementType.Tag:void 0,f=new s.Element(a,u,void 0,c);this.addNode(f),this.tagStack.push(f)},l.prototype.ontext=function(a){var u=this.lastNode;if(u&&u.type===r.ElementType.Text)u.data+=a,this.options.withEndIndices&&(u.endIndex=this.parser.endIndex);else{var c=new s.Text(a);this.addNode(c),this.lastNode=c}},l.prototype.oncomment=function(a){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=a;return}var u=new s.Comment(a);this.addNode(u),this.lastNode=u},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var a=new s.Text(""),u=new s.CDATA([a]);this.addNode(u),a.parent=u,this.lastNode=a},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(a,u){var c=new s.ProcessingInstruction(a,u);this.addNode(c)},l.prototype.handleCallback=function(a){if(typeof this.callback=="function")this.callback(a,this.dom);else if(a)throw a},l.prototype.addNode=function(a){var u=this.tagStack[this.tagStack.length-1],c=u.children[u.children.length-1];this.options.withStartIndices&&(a.startIndex=this.parser.startIndex),this.options.withEndIndices&&(a.endIndex=this.parser.endIndex),u.children.push(a),c&&(a.prev=c,c.next=a),a.parent=u,this.lastNode=null},l}();e.DomHandler=o,e.default=o})(rg);var C0="html",k0="head",tu="body",_8=/<([a-zA-Z]+[0-9]?)/,T0=/<head[^]*>/i,j0=/<body[^]*>/i,Oc=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},Eh=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},P0=typeof window=="object"&&window.DOMParser;if(typeof P0=="function"){var M8=new P0,L8="text/html";Eh=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),M8.parseFromString(e,L8)},Oc=Eh}if(typeof document=="object"&&document.implementation){var nu=document.implementation.createHTMLDocument();Oc=function(e,t){if(t){var n=nu.documentElement.querySelector(t);return n.innerHTML=e,nu}return nu.documentElement.innerHTML=e,nu}}var If=typeof document=="object"?document.createElement("template"):{},Ch;If.content&&(Ch=function(e){return If.innerHTML=e,If.content.childNodes});function D8(e){var t,n=e.match(_8);n&&n[1]&&(t=n[1].toLowerCase());var r,s,i;switch(t){case C0:return r=Eh(e),T0.test(e)||(s=r.querySelector(k0),s&&s.parentNode.removeChild(s)),j0.test(e)||(s=r.querySelector(tu),s&&s.parentNode.removeChild(s)),r.querySelectorAll(C0);case k0:case tu:return r=Oc(e),i=r.querySelectorAll(t),j0.test(e)&&T0.test(e)?i[0].parentNode.childNodes:i;default:return Ch?Ch(e):(s=Oc(e,tu).querySelector(tu),s.childNodes)}}var F8=D8,ag={},G2={};G2.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];var md=rg,$8=G2,O0=$8.CASE_SENSITIVE_TAG_NAMES,z8=md.Comment,B8=md.Element,V8=md.ProcessingInstruction,U8=md.Text,Q2={},_f;for(var Mf=0,H8=O0.length;Mf<H8;Mf++)_f=O0[Mf],Q2[_f.toLowerCase()]=_f;function q8(e){return Q2[e]}function K2(e){for(var t={},n,r=0,s=e.length;r<s;r++)n=e[r],t[n.name]=n.value;return t}function W8(e){e=e.toLowerCase();var t=q8(e);return t||e}function X2(e,t,n){t=t||null;for(var r=[],s,i=0,o=e.length;i<o;i++){var l=e[i],a;switch(l.nodeType){case 1:s=W8(l.nodeName),a=new B8(s,K2(l.attributes)),a.children=X2(s==="template"?l.content.childNodes:l.childNodes,a);break;case 3:a=new U8(l.nodeValue);break;case 8:a=new z8(l.nodeValue);break;default:continue}var u=r[i-1]||null;u&&(u.next=a),a.parent=t,a.prev=u,a.next=null,r.push(a)}return n&&(a=new V8(n.substring(0,n.indexOf(" ")).toLowerCase(),n),a.next=r[0]||null,a.parent=t,r.unshift(a),r[1]&&(r[1].prev=r[0])),r}ag.formatAttributes=K2;ag.formatDOM=X2;var G8=F8,Q8=ag,K8=Q8.formatDOM,X8=/<(![a-zA-Z\s]+)>/;function Y8(e){if(typeof e!="string")throw new TypeError("First argument must be a string");if(e==="")return[];var t=e.match(X8),n;return t&&t[1]&&(n=t[1]),K8(G8(e),null,n)}var J8=Y8,hn={},gd={},Z8=0;gd.SAME=Z8;var eA=1;gd.CAMELCASE=eA;gd.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(hn,"__esModule",{value:!0});function tA(e,t){return nA(e)||rA(e,t)||sA(e,t)||iA()}function nA(e){if(Array.isArray(e))return e}function rA(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],s=!0,i=!1,o,l;try{for(n=n.call(e);!(s=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));s=!0);}catch(a){i=!0,l=a}finally{try{!s&&n.return!=null&&n.return()}finally{if(i)throw l}}return r}}function sA(e,t){if(e){if(typeof e=="string")return R0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R0(e,t)}}function R0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
220
220
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Y2=0,cs=1,vd=2,yd=3,lg=4,J2=5,Z2=6;function oA(e){return Xe.hasOwnProperty(e)?Xe[e]:null}function pt(e,t,n,r,s,i,o){this.acceptsBooleans=t===vd||t===yd||t===lg,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Xe={},aA=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];aA.forEach(function(e){Xe[e]=new pt(e,Y2,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=tA(e,2),n=t[0],r=t[1];Xe[n]=new pt(n,cs,!1,r,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Xe[e]=new pt(e,vd,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Xe[e]=new pt(e,vd,!1,e,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(e){Xe[e]=new pt(e,yd,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Xe[e]=new pt(e,yd,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Xe[e]=new pt(e,lg,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Xe[e]=new pt(e,Z2,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Xe[e]=new pt(e,J2,!1,e.toLowerCase(),null,!1,!1)});var ug=/[\-\:]([a-z])/g,cg=function(t){return t[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(e){var t=e.replace(ug,cg);Xe[t]=new pt(t,cs,!1,e,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(e){var t=e.replace(ug,cg);Xe[t]=new pt(t,cs,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ug,cg);Xe[t]=new pt(t,cs,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Xe[e]=new pt(e,cs,!1,e.toLowerCase(),null,!1,!1)});var lA="xlinkHref";Xe[lA]=new pt("xlinkHref",cs,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Xe[e]=new pt(e,cs,!1,e.toLowerCase(),null,!0,!0)});var dg=gd,uA=dg.CAMELCASE,cA=dg.SAME,N0=dg.possibleStandardNames,dA=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",fA=dA+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",pA=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+fA+"]*$")),hA=Object.keys(N0).reduce(function(e,t){var n=N0[t];return n===cA?e[t]=t:n===uA?e[t.toLowerCase()]=t:e[t]=n,e},{});hn.BOOLEAN=yd;hn.BOOLEANISH_STRING=vd;hn.NUMERIC=J2;hn.OVERLOADED_BOOLEAN=lg;hn.POSITIVE_NUMERIC=Z2;hn.RESERVED=Y2;hn.STRING=cs;hn.getPropertyInfo=oA;hn.isCustomAttribute=pA;hn.possibleStandardNames=hA;var eS={},fg={exports:{}},A0=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,mA=/\n/g,gA=/^\s*/,vA=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yA=/^:\s*/,wA=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,xA=/^[;\s]*/,bA=/^\s+|\s+$/g,SA=`
|
|
221
|
-
`,I0="/",_0="*",gs="",EA="comment",CA="declaration",kA=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(y){var w=y.match(mA);w&&(n+=w.length);var x=y.lastIndexOf(SA);r=~x?y.length-x:r+y.length}function i(){var y={line:n,column:r};return function(w){return w.position=new o(y),u(),w}}function o(y){this.start=y,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(y){var w=new Error(t.source+":"+n+":"+r+": "+y);if(w.reason=y,w.filename=t.source,w.line=n,w.column=r,w.source=e,!t.silent)throw w}function a(y){var w=y.exec(e);if(w){var x=w[0];return s(x),e=e.slice(x.length),w}}function u(){a(gA)}function c(y){var w;for(y=y||[];w=f();)w!==!1&&y.push(w);return y}function f(){var y=i();if(!(I0!=e.charAt(0)||_0!=e.charAt(1))){for(var w=2;gs!=e.charAt(w)&&(_0!=e.charAt(w)||I0!=e.charAt(w+1));)++w;if(w+=2,gs===e.charAt(w-1))return l("End of comment missing");var x=e.slice(2,w-2);return r+=2,s(x),e=e.slice(w),r+=2,y({type:EA,comment:x})}}function p(){var y=i(),w=a(vA);if(w){if(f(),!a(yA))return l("property missing ':'");var x=a(wA),g=y({type:CA,property:M0(w[0].replace(A0,gs)),value:x?M0(x[0].replace(A0,gs)):gs});return a(xA),g}}function h(){var y=[];c(y);for(var w;w=p();)w!==!1&&(y.push(w),c(y));return y}return u(),h()};function M0(e){return e?e.replace(bA,gs):gs}var TA=kA;function tS(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,s=TA(e),i=typeof t=="function",o,l,a=0,u=s.length;a<u;a++)r=s[a],o=r.property,l=r.value,i?t(o,l,r):l&&(n||(n={}),n[o]=l);return n}fg.exports=tS;fg.exports.default=tS;var jA=fg.exports,wd={};wd.__esModule=!0;wd.camelCase=void 0;var PA=/^--[a-zA-Z0-9-]+$/,OA=/-([a-z])/g,RA=/^[^-]+$/,NA=/^-(webkit|moz|ms|o|khtml)-/,AA=/^-(ms)-/,IA=function(e){return!e||RA.test(e)||PA.test(e)},_A=function(e,t){return t.toUpperCase()},L0=function(e,t){return"".concat(t,"-")},MA=function(e,t){return t===void 0&&(t={}),IA(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(AA,L0):e=e.replace(NA,L0),e.replace(OA,_A))};wd.camelCase=MA;(function(e){var t=lt&<.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};e.__esModule=!0;var n=t(jA),r=wd;function s(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,u){a&&u&&(l[(0,r.camelCase)(a,o)]=u)}),l}e.default=s})(eS);var LA=S,DA=eS.default;function FA(e,t){if(!e||typeof e!="object")throw new TypeError("First argument must be an object");var n,r,s=typeof t=="function",i={},o={};for(n in e){if(r=e[n],s&&(i=t(n,r),i&&i.length===2)){o[i[0]]=i[1];continue}typeof r=="string"&&(o[r]=n)}return o}function $A(e,t){if(e.indexOf("-")===-1)return t&&typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zA={reactCompat:!0};function BA(e,t){if(e!=null)try{t.style=DA(e,zA)}catch{t.style={}}}var VA=LA.version.split(".")[0]>=16,nS=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function UA(e){return!nS.has(e.name)}var rS={PRESERVE_CUSTOM_ATTRIBUTES:VA,invertObject:FA,isCustomComponent:$A,setStyleProp:BA,canTextBeChildOfNode:UA,elementsWithNoTextChildren:nS},Uo=hn,D0=rS,HA=["checked","value"],qA=["input","select","textarea"],WA={reset:!0,submit:!0},sS=function(t,n){t=t||{};var r,s,i,o,l,a={},u=t.type&&WA[t.type];for(r in t){if(i=t[r],Uo.isCustomAttribute(r)){a[r]=i;continue}if(s=r.toLowerCase(),o=F0(s),o){switch(l=Uo.getPropertyInfo(o),HA.indexOf(o)!==-1&&qA.indexOf(n)!==-1&&!u&&(o=F0("default"+s)),a[o]=i,l&&l.type){case Uo.BOOLEAN:a[o]=!0;break;case Uo.OVERLOADED_BOOLEAN:i===""&&(a[o]=!0);break}continue}D0.PRESERVE_CUSTOM_ATTRIBUTES&&(a[r]=i)}return D0.setStyleProp(t.style,a),a};function F0(e){return Uo.possibleStandardNames[e]}var GA=S,QA=sS,Rc=rS,KA=Rc.setStyleProp,XA=Rc.canTextBeChildOfNode;function iS(e,t){t=t||{};for(var n=t.library||GA,r=n.cloneElement,s=n.createElement,i=n.isValidElement,o=[],l,a,u=typeof t.replace=="function",c,f,p,h=t.trim,y=0,w=e.length;y<w;y++){if(l=e[y],u&&(c=t.replace(l),i(c))){w>1&&(c=r(c,{key:c.key||y})),o.push(c);continue}if(l.type==="text"){if(a=!l.data.trim().length,a&&l.parent&&!XA(l.parent)||h&&a)continue;o.push(l.data);continue}switch(f=l.attribs,YA(l)?KA(f.style,f):f&&(f=QA(f,l.name)),p=null,l.type){case"script":case"style":l.children[0]&&(f.dangerouslySetInnerHTML={__html:l.children[0].data});break;case"tag":l.name==="textarea"&&l.children[0]?f.defaultValue=l.children[0].data:l.children&&l.children.length&&(p=iS(l.children,t));break;default:continue}w>1&&(f.key=y),o.push(s(l.name,f,p))}return o.length===1?o[0]:o}function YA(e){return Rc.PRESERVE_CUSTOM_ATTRIBUTES&&e.type==="tag"&&Rc.isCustomComponent(e.name,e.attribs)}var JA=iS,xd=rg,wi=J8,ZA=sS,oS=JA;wi=typeof wi.default=="function"?wi.default:wi;var eI={lowerCaseAttributeNames:!1};function Wn(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");return e===""?[]:(t=t||{},oS(wi(e,t.htmlparser2||eI),t))}Wn.domToReact=oS;Wn.htmlToDOM=wi;Wn.attributesToProps=ZA;Wn.Comment=xd.Comment;Wn.Element=xd.Element;Wn.ProcessingInstruction=xd.ProcessingInstruction;Wn.Text=xd.Text;var tI=Wn;Wn.default=Wn;const ds=il(tI);var ru=ds.domToReact;ds.htmlToDOM;var Lf=ds.attributesToProps;ds.Comment;ds.Element;ds.ProcessingInstruction;ds.Text;const aS=S.forwardRef(({children:e},t)=>d.jsx("div",{ref:t,className:"actionbar",children:e}));aS.displayName="ActionBar";const nI=aS,lS=S.forwardRef(({type:e="success",className:t="",children:n,button:r,isDismissible:s=!1,isToast:i=!1,autoClose:o=!1,autoCloseDelay:l=3e3,onClose:a,onVisibilityChange:u},c)=>{const[f,p]=S.useState(!0),h=S.useRef(null),y=S.useCallback(()=>{p(!1),a==null||a()},[a]);S.useImperativeHandle(c,()=>({show:w,hide:y,...h.current})),S.useLayoutEffect(()=>{u==null||u(f)},[f,u]),S.useEffect(()=>{o&&f&&setTimeout(()=>{y()},l)},[o,l,y,f]);const w=()=>{p(!0)},x={success:{icon:d.jsx(i5,{}),classModifier:"alert-success"},warning:{icon:d.jsx(wT,{}),classModifier:"alert-warning"},info:{icon:d.jsx(lb,{}),classModifier:"alert-info"},danger:{icon:d.jsx(_T,{}),classModifier:"alert-danger"}},g={"is-dismissible":s,"is-toast ":i},m=J("alert gap-12",x[e].classModifier,g,t);return d.jsx(d.Fragment,{children:f?d.jsxs("div",{ref:h,className:m,role:"alert",children:[x[e].icon,d.jsx("div",{className:"alert-content small",children:n}),r&&d.jsx("div",{className:"ms-12",children:r}),s&&d.jsx("div",{className:"btn-close-container",children:d.jsx("button",{type:"button",className:"btn btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:y})}),o&&d.jsx("div",{className:"alert-progress",style:{transform:"scaleX(0)"}})]}):null})});lS.displayName="Alert";const Vr=lS,uS=S.forwardRef(({children:e,render:t,isFullscreen:n=!1},r)=>{const s=J("d-flex flex-wrap p-16 gap-8 border-bottom bg-white",{"justify-content-between":t,"mx-n16":!n,"z-3 top-0 start-0 end-0 position-fixed":n});return d.jsxs("div",{ref:r,className:s,children:[e,t?d.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:t()}):null]})});uS.displayName="AppHeader";const cS=uS;function pg({appCode:e}){return Ih({queryKey:["conf"],queryFn:async()=>await ae.conf().getConf(e),suspense:!0})}function dS(){return Ih({queryKey:["session"],queryFn:async()=>await ae.session().getSession(),suspense:!0})}const hg=S.createContext(null);function fS({children:e,params:t}){const n=t.app,{t:r}=ue(),s=r(n),i=dS(),o=pg({appCode:n}),l=(o==null?void 0:o.isSuccess)&&(i==null?void 0:i.isSuccess);S.useEffect(()=>{var u,c;(c=document.querySelector("html"))==null||c.setAttribute("lang",((u=i==null?void 0:i.data)==null?void 0:u.currentLanguage)||"fr")},[i==null?void 0:i.data]),S.useEffect(()=>{document.title=`${s}`},[n,i.data,s]);const a=S.useMemo(()=>{var u,c,f,p,h,y;return{appCode:n,applications:(u=o==null?void 0:o.data)==null?void 0:u.applications,confQuery:o,currentApp:(c=o==null?void 0:o.data)==null?void 0:c.currentApp,currentLanguage:(f=i==null?void 0:i.data)==null?void 0:f.currentLanguage,init:l,sessionQuery:i,user:(p=i==null?void 0:i.data)==null?void 0:p.user,userDescription:(h=i==null?void 0:i.data)==null?void 0:h.userDescription,userProfile:(y=i==null?void 0:i.data)==null?void 0:y.userProfile}},[n,o,l,i]);return d.jsx(hg.Provider,{value:a,children:e})}function Te(){const e=S.useContext(hg);if(!e)throw new Error("Cannot be used outside of OdeClientProvider");return e}const mg=S.createContext(null);function pS({children:e}){var t;const{appCode:n}=Te(),r=pg({appCode:n});S.useEffect(()=>{var i,o,l,a,u,c,f,p,h;const y=document.getElementById("favicon");y.href=`${(o=(i=r==null?void 0:r.data)==null?void 0:i.theme)==null?void 0:o.basePath}/img/illustrations/favicon.ico`;const w=(u=(a=(l=r==null?void 0:r.data)==null?void 0:l.theme)==null?void 0:a.bootstrapVersion)==null?void 0:u.split("-"),x=w?w[w.length-1]:void 0;[{data:"data-skin",value:(f=(c=r==null?void 0:r.data)==null?void 0:c.theme)==null?void 0:f.skinName},{data:"data-theme",value:(h=(p=r==null?void 0:r.data)==null?void 0:p.theme)==null?void 0:h.themeName},{data:"data-product",value:x}].forEach(m=>{var v;return(v=document.querySelector("html"))==null?void 0:v.setAttribute(m.data,m.value)})},[r==null?void 0:r.data]);const s=S.useMemo(()=>{var i;return{theme:(i=r==null?void 0:r.data)==null?void 0:i.theme}},[(t=r==null?void 0:r.data)==null?void 0:t.theme]);return d.jsx(mg.Provider,{value:s,children:e})}function bd(){const e=S.useContext(mg);if(!e)throw new Error("Cannot be used outside of OdeClientProvider");return e}function hS(){var e;const{sessionQuery:t}=Te(),n=new Set;return(e=t==null?void 0:t.data)==null?void 0:e.bookmarkedApps.filter(s=>{const i=n.has(s.displayName);return n.add(s.displayName),!i})}function Oi(e){const[t,n]=S.useState();return S.useEffect(()=>{(async()=>{let r;typeof e=="string"?r=await ae.rights().sessionHasWorkflowRight(e):await ae.rights().sessionHasWorkflowRights(e),n(r)})()},[e]),t}const rI=()=>{const e=Oi("fr.openent.zimbra.controllers.ZimbraController|view"),t=Oi("fr.openent.zimbra.controllers.ZimbraController|preauth"),[n,r]=S.useState(0),[s,i]=S.useState(""),o=S.useCallback(async()=>{if(e)try{const a=await ae.http().get("/zimbra/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});a.status!==200&&r(0),r(a.count)}catch{console.error("error"),r(0)}else try{const a=await ae.http().get("/conversation/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});r(a.count)}catch{console.error("error"),r(0)}},[e]),l=S.useCallback(()=>{let a="";ae.http().get("/userbook/preference/zimbra").then(u=>{try{u.preference&&JSON.parse(u.preference).modeExpert&&t?a="/zimbra/preauth":a=window.location.origin+"/zimbra/zimbra"}catch{a="/zimbra/zimbra"}}),i(a)},[t]);return S.useEffect(()=>{(async()=>{try{await o()}catch(a){console.error(a)}})(),l()},[l,o]),{messages:n,msgLink:s,zimbraWorkflow:e}},mS=rI,$0=["mousedown","touchstart"];function gg(e,t,n){const r=S.useRef();return S.useEffect(()=>{const s=i=>{const{target:o}=i??{};if(Array.isArray(n)){const l=(o==null?void 0:o.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(o)&&o.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(o)&&e()};return(t||$0).forEach(i=>{document.addEventListener(i,s)}),()=>{(t||$0).forEach(i=>{document.removeEventListener(i,s)})}},[r,e,n,t]),r}const su="top-right";function ht(){return{success:(t,n)=>Oo.custom(d.jsx(Vr,{type:"success",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),error:(t,n)=>Oo.custom(d.jsx(Vr,{type:"danger",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),info:(t,n)=>Oo.custom(d.jsx(Vr,{type:"info",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),warning:(t,n)=>Oo.custom(d.jsx(Vr,{type:"warning",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),loading:Oo.loading}}function vg(){const[e,t]=S.useState(!1),n=S.useRef(null),r=()=>{t(!0)},s=()=>{t(!1)};return S.useEffect(()=>{const i=n.current;if(i)return i.addEventListener("mouseover",r),i.addEventListener("mouseout",s),()=>{i.removeEventListener("mouseover",r),i.removeEventListener("mouseout",s)}},[n]),[n,e]}function gS({src:e,placeholder:t}){const[n,r]=S.useState(e||t),s=S.useCallback(()=>{r(t)},[t]);return S.useEffect(()=>{r(e)},[e]),{imgSrc:n,onError:s}}function vS(e,t){const n=S.useCallback(({code:r})=>{t.includes(r)&&e()},[e,t]);S.useEffect(()=>(window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}),[n])}function yS(){const e=typeof document<"u",[t,n]=S.useState(()=>document.title);return S.useEffect(()=>{e&&n(document.title)},[e]),t}function yg(e=!1){const[t,n]=S.useState(e),r=S.useCallback(()=>{n(s=>!s)},[]);return[t,r]}function wS(e,t){const[n,r]=S.useState(e);return S.useEffect(()=>{const s=setTimeout(()=>{r(e)},t||500);return()=>{clearTimeout(s)}},[e,t]),n}function xS(){const e=S.useRef(null),t='button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';return S.useEffect(()=>{const n=e.current,r=n.querySelectorAll(t)[0],s=n.querySelectorAll(t),i=e&&(s==null?void 0:s[s.length-1]),o=l=>{l.key==="Tab"&&(l.shiftKey?document.activeElement===r&&(i.focus(),l.preventDefault()):document.activeElement===i&&(r.focus(),l.preventDefault()))};if(n)return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}},[]),e}function bS(){const e=document.querySelector("html");return()=>{e&&e.scrollIntoView()}}const sI=(e,t)=>{const[,n]=S.useState(!1),r=S.useCallback(o=>{o.preventDefault(),o.stopPropagation(),n(!0)},[]),s=o=>{o.preventDefault(),o.stopPropagation(),n(!1)};return{handleDragging:r,handleDragLeave:s,handleDrop:o=>{var l;s(o);const a=(l=o.dataTransfer)==null?void 0:l.files;t(a),e!=null&&e.current&&a&&(e.current.files=a)}}},SS=sI;function ES({user:e,avatar:t}){const{t:n}=ue(),r=yS(),[s,i]=S.useState(!0),[o,l]=vg(),a=S.useId(),u=S.useId(),c=t,f=e==null?void 0:e.username,p=n("welcome",{username:e==null?void 0:e.firstName}),h=hS(),y=Oi("net.atos.entng.community.controllers.CommunityController|view"),w=Oi("org.entcore.conversation.controllers.ConversationController|view"),x=Oi("fr.openent.searchengine.controllers.SearchEngineController|view"),g=S.useCallback(()=>{i(!s)},[s]),m=async()=>{await ae.session().logout(),window.location.href="/auth/login"};return S.useMemo(()=>({title:r,bookmarkedApps:h,appsRef:o,isAppsHovered:l,popoverAppsId:a,popoverSearchId:u,userAvatar:c,userName:f,welcomeUser:p,communityWorkflow:y,conversationWorflow:w,searchWorkflow:x,isCollapsed:s,toggleCollapsedNav:g,handleLogout:m}),[o,h,y,w,l,s,a,u,x,r,g,c,f,p])}function CS(){const[e,t]=S.useState(!1);S.useEffect(()=>{n()},[]);const n=S.useCallback(async()=>{const r=await ae.session().isAdml();t(r)},[]);return{isAdml:e}}const wg={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"},iI=()=>{var e;const{user:t,appCode:n}=Te(),r=wg[n],s=(e=t.apps.find(u=>u.isExternal&&u.address.includes("library")&&u.name.includes("library")))==null?void 0:e.address.split("?");let i=s==null?void 0:s[0];i!=null&&i.endsWith("/")||(i=`${i}/`);const o=s==null?void 0:s[1],l=`application%5B0%5D=${r}&page=1&sort_field=views&sort_order=desc`;return{libraryUrl:`${i}search/?${o}&${l}`}},oI=iI;function Sd(){const e={"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 t(l){let a="";switch(a=(l==null?void 0:l.icon)!==void 0?l==null?void 0:l.icon.trim().toLowerCase():"placeholder",a&&a.length>0?a.endsWith("-large")&&(a=a.replace("-large","")):a=(l==null?void 0:l.displayName)!==void 0?l==null?void 0:l.displayName.trim().toLowerCase():"",a){case"admin.title":a="admin";break;case"banques des savoirs":a="banquesavoir";break;case"collaborativewall":a="collaborative-wall";break;case"communautés":a="community";break;case"directory.user":a="userbook";break;case"emploi du temps":a="edt";break;case"messagerie":a="conversation";break;case"news":a="actualites";break;case"homeworks":case"cahier de texte":a="cahier-de-texte";break;case"diary":case"cahier de texte 2d":a="cahier-textes";break}return a}function n(l){return l&&(l.startsWith("/")||l.startsWith("http://")||l.startsWith("https://"))}function r(l){const a=t(l);return a?`color-app-${a}`:"color-app-placeholder"}function s(l){const a=t(l);return a?`bg-app-${a}`:"bg-app-placeholder"}function i(l){const a=t(l);return a?`bg-light-${a}`:"bg-light-placeholder"}function o(l){return e[l.platformConf.name]}return{getIconClass:r,getBackgroundIconClass:s,getBackgroundLightIconClass:i,getIconCode:t,getWidgetIconClass:o,isIconUrl:n}}function Ys(){return["/assets/themes/edifice-bootstrap/images","/assets/themes/edifice-bootstrap/icons","/assets/themes/edifice-bootstrap/fonts"]}function Ed(){const{user:e,userDescription:t,userProfile:n}=Te(),{theme:r}=bd();function s(){let i=t==null?void 0:t.picture;return(!i||i==="no-avatar.jpg"||i==="no-avatar.svg")&&(i=`${r==null?void 0:r.basePath}/img/illustrations/no-avatar.svg`),i}return{user:{...e,type:n},avatar:s(),userDescription:t}}function kS(){const[e,t]=S.useState("pending"),{currentApp:n}=Te();S.useEffect(()=>{r()},[]);const r=async()=>{if(!n){t("[Xiti] Error, currentApp is not defined.");return}try{await ae.analytics().trackPageLoad(window.location.pathname,n),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),t(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(s){console.error("[Xiti] Error Tracking Page Load",s),t(`[Xiti] Error Tracking Page Load: ${s}`)}};return{xitiStatus:e}}const TS=S.forwardRef(({src:e,alt:t,imgPlaceholder:n,ratio:r,objectFit:s,className:i,...o},l)=>{const[a]=Ys(),u=n??`${a}/common/image-placeholder.png`,{imgSrc:c,onError:f}=gS({src:e,placeholder:u}),p={"ratio ratio-1x1":r==="1","ratio ratio-4x3":r==="4","ratio ratio-16x9":r==="16","ratio ratio-21x9":r==="21"},h={"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"},y=J({...p}),w=J({...h},i),x=d.jsx("img",{alt:t,onError:f,ref:l,src:c,className:w,...o});return r?d.jsx("div",{className:y,children:x}):x});TS.displayName="Image";const ho=TS,jS=S.forwardRef(({app:e,size:t="24",iconFit:n="contain",variant:r="square"},s)=>{const{isIconUrl:i,getIconCode:o}=Sd(),[,l]=Ys(),a=r==="square",u=r==="rounded",c=r==="circle",f=n==="contain",p=n==="ratio",h={"icon-xs":t==="24","icon-sm":t==="40","icon-md":t==="48","icon-lg":t==="80","icon-xl":t==="160"},y={square:a,rounded:u,"rounded-circle":c},w={"icon-contain":f,"icon-ratio":p},x=(e==null?void 0:e.icon)!==void 0?e.icon:"placeholder",g=(e==null?void 0:e.displayName)!==void 0?e.displayName:"",m=e?o(e):"",v=i(x),b=m||"placeholder",E=J("app-icon",{...h,...y,...w,[`bg-light-${b}`]:b&&!f,[`color-app-${b}`]:b});return v?d.jsx(ho,{src:x,alt:g,objectFit:"contain",width:t,height:t,className:"h-full"}):d.jsx("div",{className:E,style:{width:t+"px",height:t+"px"},children:d.jsx("svg",{ref:s,width:t,height:t,role:"img",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:d.jsx("use",{xlinkHref:`${l}/apps.svg#${b}`})})})});jS.displayName="AppIcon";const qs=jS,PS=S.forwardRef(({variant:e="square",size:t="md",alt:n,src:r,imgPlaceholder:s,className:i,...o},l)=>{const[a]=Ys(),u=s||`${a}/avatar/no-avatar.svg`,w=J("avatar",{...{"avatar-xs":t==="xs","avatar-sm":t==="sm","avatar-md":t==="md","avatar-lg":t==="lg","avatar-xl":t==="xl"},...{square:e==="square",rounded:e==="rounded","rounded-circle":e==="circle"}},i);return d.jsx("div",{ref:l,className:w,children:d.jsx(ho,{src:r||u,alt:n,imgPlaceholder:u,...o})})});PS.displayName="Avatar";const Ws=PS,OS=S.forwardRef(({children:e,className:t,...n},r)=>{const s=J("breadcrumb-item",t);return d.jsx("li",{ref:r,className:s,...n,children:e})});OS.displayName="BreadcrumbItem";const Df=OS,RS=S.forwardRef(({children:e,className:t},n)=>{const r=J("breadcrumb d-flex flex-nowrap align-items-center mb-0",t);return d.jsx("ol",{ref:n,className:r,children:e})});RS.displayName="BreadcrumbList";const aI=RS,NS=S.forwardRef(({children:e,app:t,className:n},r)=>{const{t:s}=ue(),{getIconClass:i}=Sd(),o=J("d-flex align-items-center mb-0",i(t),n),l={"--edifice-breadcrumb-divider":"-"};return d.jsx("nav",{ref:r,className:o,"aria-label":s("breadcrumb"),style:l,children:e})});NS.displayName="BreadcrumbNav";const lI=NS,AS=S.forwardRef((e,t)=>{const{isLoading:n,loadingIcon:r,loadingPosition:s="left",children:i,...o}=e,l=()=>{let u;return r?u=r:u=d.jsx(UT,{...o,"aria-label":"Loading"}),u},a=J("loading",{"is-loading":n});return d.jsxs("div",{className:a,role:"status",ref:t,children:[(!s||s==="left")&&l(),i,s==="right"&&l()]})});AS.displayName="Loading";const xg=AS,IS=S.forwardRef(({color:e="primary",type:t="button",size:n="md",children:r,isLoading:s,loadingIcon:i,loadingPosition:o,leftIcon:l,rightIcon:a,className:u,variant:c="filled",...f},p)=>{const h=J("btn",{[`btn-filled btn-${e}`]:c==="filled",[`btn-${c}-${e}`]:c==="outline"||c==="ghost","btn-icon":!r,"btn-loading":s,"btn-lg":n==="lg","btn-sm":n==="sm"},u);return d.jsx("button",{ref:p,className:h,type:t,...f,children:s?d.jsx(xg,{isLoading:!0,loadingIcon:i,loadingPosition:o,children:r}):d.jsxs("span",{children:[l,r,a]})})});IS.displayName="Button";const ze=IS,_S=S.forwardRef(({icon:e,className:t,...n},r)=>{const s={...n,className:J("btn-icon btn-sm",t)};return d.jsx(ze,{ref:r,...s,children:e})});_S.displayName="IconButton";const hr=_S,MS=S.forwardRef(({icon:e=d.jsx(r5,{}),onClick:t,...n},r)=>{const s=J("btn-search");return d.jsx(hr,{ref:r,className:s,icon:e,...n,onClick:t})});MS.displayName="SearchButton";const bg=MS,LS=S.forwardRef(({level:e="h1",headingStyle:t="h1",children:n,className:r,...s},i)=>{const o=J(t,r);return d.jsx(e,{ref:i,className:o,...s,children:n})});LS.displayName="Heading";const an=LS,DS=S.forwardRef(({app:e,name:t},n)=>{const{t:r}=ue();return d.jsx(lI,{app:e,ref:n,className:"mw-100",children:d.jsx(aI,{className:"gap-12 mw-100",children:t?d.jsxs(d.Fragment,{children:[d.jsx(Df,{children:d.jsxs("a",{href:e==null?void 0:e.address,className:"d-flex",children:[d.jsx(hr,{variant:"ghost",color:"tertiary",icon:d.jsx(XT,{}),"aria-label":r(e==null?void 0:e.displayName)}),d.jsx(qs,{app:e,size:"40"})]})}),d.jsx(Df,{className:"text-truncate",children:d.jsx(an,{level:"h1",headingStyle:"h3",className:"text-truncate",children:t})})]}):d.jsxs(Df,{className:"gap-12 d-flex align-items-center",children:[d.jsx(qs,{app:e,size:"40"}),d.jsx(an,{level:"h1",headingStyle:"h3",className:"d-none d-md-flex",children:r(e==null?void 0:e.displayName)})]})})})});DS.displayName="Breadcrumb";const FS=DS,$S=({children:e,space:t=null,flexDirection:n="row"})=>{const r=J("card-body",{"p-8":t==="8","gap-8":t==="8","align-items-start":n==="column","flex-column":n==="column"});return d.jsx("div",{className:r,children:e})};$S.displayName="Card.Body";const uI=$S,Sg=S.createContext(null);Sg.displayName="CardContext";const zS=()=>{const e=S.useContext(Sg);if(!e)throw new Error("Cannot be rendered outside the Card component");return e},BS=({children:e})=>d.jsx("div",{className:"card-footer gap-16",children:e});BS.displayName="Card.Footer";const cI=BS,VS=()=>{const{isSelectable:e,isClickable:t,onClick:n,onSelect:r}=zS();return d.jsxs("div",{className:"card-header",children:[e?d.jsx(hr,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:d.jsx(qT,{}),onClick:r,variant:"ghost"}):null,t?d.jsx("button",{onClick:n,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}):null]})};VS.displayName="Card.Header";const dI=VS,US=({imageSrc:e,className:t,variant:n="medium"})=>{const{app:r}=zS(),s=n==="landscape"?{width:"100%",height:"auto"}:null;return d.jsx("div",{className:J("card-image",n),children:e?d.jsx(ho,{alt:"",src:e,objectFit:"cover",className:J("h-full",t)}):d.jsx(qs,{app:r,iconFit:"ratio",size:"80",variant:"rounded",...s})})};US.displayName="Card.Image";const fI=US,HS=({children:e,className:t})=>{const n=J("card-text small text-break text-truncate text-truncate-1",t);return d.jsx("p",{className:n,children:e})};HS.displayName="Card.Text";const pI=HS,qS=({children:e,className:t})=>{const n=J("card-title body text-break text-truncate text-truncate-1",t);return d.jsx("h3",{className:n,children:d.jsx("strong",{children:e})})};qS.displayName="Card.Title";const hI=qS,WS=({userSrc:e,creatorName:t})=>e?d.jsx(Ws,{alt:t||"",size:"xs",src:e,variant:"circle",width:"24",height:"24"}):d.jsx(p2,{});WS.displayName="Card.User";const mI=WS,GS=S.forwardRef(({app:e,isSelectable:t=!0,isClickable:n=!0,isSelected:r=!1,onClick:s,onSelect:i,children:o,className:l},a)=>{const{getIconCode:u}=Sd(),c=e?u(e):"placeholder",f=S.useMemo(()=>({app:e,appCode:c,isSelectable:t,isClickable:n,onClick:s,onSelect:i}),[e,c,t,n,s,i]);return d.jsx(Sg.Provider,{value:f,children:d.jsxs("div",{ref:a,className:J("card",{"is-selected":r},l),children:[d.jsx(QS.Header,{}),typeof o=="function"?o(c):o]})})});GS.displayName="Card";const QS=Object.assign(GS,{Title:hI,Text:pI,Image:fI,Body:uI,User:mI,Footer:cI,Header:dI}),gI=QS,KS=S.forwardRef(({label:e,disabled:t=!1,checked:n=!1,indeterminate:r=!1,...s},i)=>{const o=S.useRef(null);S.useImperativeHandle(i,()=>({...o.current})),S.useEffect(()=>{o.current.indeterminate=r},[o,r]);const l=S.useId(),a={type:"checkbox",checked:n,disabled:t,ref:o,className:J(s.className,"form-check-input c-pointer"),id:l},u={...s,...a};return d.jsxs("div",{className:"form-check d-flex align-items-center gap-8",children:[d.jsx("input",{...u}),e&&d.jsx("label",{className:"form-check-label",htmlFor:u.id,children:e})]})});KS.displayName="Checkbox";const Cd=KS,XS=S.createContext(null),mo=()=>{const e=S.useContext(XS);if(!e)throw new Error("Cannot be rendered outside the Dropdown Component");return e},YS=S.createContext(null),kd=()=>{const e=S.useContext(YS);if(!e)throw new Error("Cannot be rendered outside the FormControl component");return e},JS=({children:e})=>{const{status:t}=kd(),n=J("form-text",{"is-invalid":t==="invalid",valid:t==="valid"});return d.jsx("p",{className:n,children:d.jsx("em",{children:e})})};JS.displayName="Text";const ZS=JS,eE=S.forwardRef(({noValidationIcon:e,placeholder:t,size:n="md",type:r="text",className:s,...i},o)=>{const{id:l,isRequired:a,isReadOnly:u,status:c}=kd(),f=J({"form-control":!u,"form-control-lg":n==="lg","form-control-sm":n==="sm","is-invalid":c==="invalid","is-valid":c==="valid","form-control-plaintext":u,"no-validation-icon":e},s);return d.jsx("input",{ref:o,id:l,className:f,type:r,placeholder:t,required:a,readOnly:u,...i})});eE.displayName="Input";const rs=eE,tE=S.forwardRef(({leftIcon:e,optionalText:t="Optional",requiredText:n="*",children:r,className:s},i)=>{const{id:o,isOptional:l,isRequired:a}=kd(),u=J("form-label",{"has-icon":e},s),c=l&&!a,f=a&&!l;return S.useEffect(()=>{if(l&&a)throw new Error("Cannot be optional and required at the same time")},[l,a]),d.jsxs("label",{ref:i,htmlFor:o,className:u,children:[e,r,c&&d.jsxs("em",{className:"optional",children:["- ",t]}),f&&d.jsx("em",{className:"required",children:n})]})});tE.displayName="Label";const _s=tE,nE=S.forwardRef(({children:e,className:t,id:n,isOptional:r,isReadOnly:s,isRequired:i,status:o,...l},a)=>{const u=S.useMemo(()=>({id:n,isOptional:r,isRequired:i,isReadOnly:s,status:o}),[n,r,s,i,o]);return d.jsx(YS.Provider,{value:u,children:d.jsx("div",{ref:a,className:t,...l,children:e})})}),vI=Object.assign(nE,{Label:_s,Input:rs,Text:ZS});nE.displayName="FormControl";const Qe=vI,yI=({placeholder:e,value:t="",handleSearchInputChange:n})=>{const{triggerProps:r,itemProps:s,setVisible:i}=mo(),o={...r,role:"combobox",onClick:()=>{t.length>2&&i(!0)},onChange:n};return S.useEffect(()=>{i(t.length>2)},[i,t]),d.jsx(Qe,{className:"d-flex align-items-center",id:"search",children:d.jsx(rs,{...o,className:"max-w-512",noValidationIcon:!0,placeholder:e,size:"md",type:"search",onKeyDown:s.onMenuItemKeyDown})})},wI=yI,rE=({children:e,value:t,model:n,onChange:r})=>{const{itemProps:s,itemRefs:i,isFocused:o}=mo(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:a}=s,u=S.useId(),c=n.includes(t),f={value:t,model:n,checked:c,readOnly:!0},p=J("dropdown-item c-pointer",{focus:o===u});return d.jsx("div",{id:u,ref:h=>i.current[u]=h,role:"menuitemcheckbox","aria-checked":c,onMouseUp:()=>r(t),onKeyDown:h=>l(h,()=>r(t)),onMouseEnter:a,tabIndex:c?0:-1,className:p,children:d.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[e,d.jsx(Cd,{...f})]})})};rE.displayName="Dropdown.CheckboxItem";const xI=rE,sE=({type:e="action",icon:t,onClick:n,children:r,...s})=>{const{itemProps:i,itemRefs:o,isFocused:l}=mo(),{onMenuItemKeyDown:a,onMenuItemMouseEnter:u,onMenuItemClick:c}=i,f=()=>{n==null||n(),e==="action"&&c()},p=S.useId(),h=J("dropdown-item",{focus:l===p});return d.jsx("div",{id:p,role:"menuitem",ref:y=>o.current[p]=y,tabIndex:l===p?0:-1,className:h,"aria-current":l===p,onClick:f,onMouseEnter:u,onKeyDown:y=>a(y,n),...s,children:d.jsxs("div",{className:"d-flex gap-8 align-items-center",children:[t,r]})})};sE.displayName="Dropdown.Item";const bI=sE,iE=S.forwardRef(({children:e,block:t,...n},r)=>{const{menuProps:s,visible:i}=mo(),{className:o,...l}=s,a={...l,...n},u=J({"w-100":t},o);return i?d.jsx("div",{ref:r,className:u,...a,children:e}):null});iE.displayName="Dropdown.Menu";const SI=iE,oE=S.forwardRef(({label:e,children:t},n)=>d.jsxs("div",{ref:n,role:"group",children:[d.jsx("span",{className:"small px-4",children:d.jsx("strong",{children:e})}),t]}));oE.displayName="Dropdown.MenuGroup";const EI=oE,aE=S.forwardRef(({model:e,icon:t,label:n=!1,disabled:r=!1,checked:s,...i},o)=>{const l=S.useId(),a={type:"radio",checked:s,disabled:r,ref:o,className:J(i.className,"form-check-input c-pointer",t&&"d-none"),id:l},u={...i,...a};return d.jsxs("div",{className:J("form-check d-flex align-items-center gap-8",t&&"ps-0"),children:[d.jsx("input",{...u}),t&&d.jsx("label",{htmlFor:u.id,className:J("c-pointer",e!==i.value&&"text-muted"),children:t}),!t&&n&&d.jsx("label",{className:"form-check-label",htmlFor:u.id,children:n})]})});aE.displayName="Radio";const Nc=aE,lE=({children:e,value:t,model:n,onChange:r})=>{const{itemProps:s,itemRefs:i,isFocused:o}=mo(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:a}=s,u=S.useId(),f={value:t,model:n,checked:t===n,readOnly:!0},p=J("dropdown-item c-pointer",{focus:o===u});return d.jsx("div",{id:u,ref:h=>i.current[u]=h,role:"menuitemradio","aria-checked":t===n,onMouseUp:()=>r(t),onKeyDown:h=>l(h,()=>r(t)),onMouseEnter:a,tabIndex:t===n?0:-1,className:p,children:d.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[e,d.jsx(Nc,{...f,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})};lE.displayName="Dropdown.RadioItem";const CI=lE,uE=()=>d.jsx("div",{role:"separator",className:"px-4",children:d.jsx("hr",{className:"m-0"})});uE.displayName="Dropdown.Separator";const kI=uE,cE=S.forwardRef(({label:e,icon:t,variant:n,disabled:r=!1,size:s,badgeContent:i,...o},l)=>{const{triggerProps:a,block:u}=mo(),{className:c,...f}=a,p={...f,...o},h=J(s,n,{"w-100":u},c);return d.jsxs("button",{ref:l,className:h,disabled:r,...p,children:[t||null,e,i?d.jsx("span",{className:"badge text-bg-secondary rounded-pill",children:i}):d.jsx(ZT,{width:16,height:16,className:"dropdown-toggle-caret"})]})});cE.displayName="Dropdown.Trigger";const TI=cE,jI=e=>{const t=S.useId(),[n,r]=S.useState(!1),[s,i]=S.useState(-1),[o,l]=S.useState(null),{refs:a,floatingStyles:u}=ej({placement:e,open:n,onOpenChange:r,whileElementsMounted:$5,middleware:[x5(4),B5({apply({rects:A,elements:N}){Object.assign(N.floating.style,{minWidth:`${A.reference.width}px`})}}),z5({padding:0})]}),c=S.useRef(null),f=S.useRef(null),p=S.useRef({});S.useEffect(()=>{n?c.current&&(c.current.focus(),i(0)):(i(-1),p.current={})},[n]),S.useEffect(()=>{if(s!==-1){const A=Object.values(p.current)[s];if(A){const N=A.getAttribute("id");l(N),A.focus()}}},[s]);const h=()=>{const N=Object.values(p.current).length;i(M=>(M+1)%N)},y=()=>{const N=Object.values(p.current).length;i(M=>(M-1+N)%N)},w=()=>{i(0)},x=()=>{const N=Object.values(p.current).length;i(N-1)},g=S.useCallback(()=>{r(!0)},[]),m=S.useCallback(()=>{f.current&&(f.current.focus(),r(!1))},[]),v=(A,N)=>{A&&(N.stopPropagation(),N.preventDefault())},b=S.useCallback(A=>{let N=!1;switch(A.code){case" ":case"Space":case"Enter":case"ArrowDown":case"Down":g(),N=!0;break;case"Esc":case"Escape":m(),N=!0;break;case"Up":case"ArrowUp":g(),N=!0;break}v(N,A)},[m,g]),E=A=>{const M=Object.values(p.current).findIndex(D=>D.id===A.currentTarget.getAttribute("id"));i(M)},T=S.useCallback((A,N)=>{let M=!1;if(A.shiftKey)A.key==="Tab"&&(m(),M=!0);else{switch(A.code){case"Escape":m();break;case" ":case"Space":case"Enter":s!==-1&&(Object.values(p.current)[s].getAttribute("role")==="menuitem"&&f.current&&(f.current.focus(),r(!1)),N==null||N()),M=!0;break;case"ArrowDown":case"Down":h(),M=!0;break;case"ArrowUp":case"Up":y(),M=!0;break;case"Home":w(),M=!0;break;case"End":x(),M=!0;break}v(M,A)}},[s,m]),C=S.useCallback(A=>{r(n!==!0),A.stopPropagation(),A.preventDefault()},[n]),R=S.useCallback(()=>{m()},[m]);function j(A,...N){N.forEach(M=>{typeof M=="function"?M(A):M!=null&&(M.current=A)})}function L(...A){return N=>{j(N,...A)}}return{isFocused:o,visible:n,itemRefs:p,triggerRef:f,menuRef:c,triggerProps:{ref:L(f,a.setReference),id:`dropdown-toggle-${t}`,"aria-haspopup":"menu","aria-controls":`dropdown-${t}`,"aria-expanded":!!n,className:`dropdown-toggle ${n?"selected":""}`,onClick:C,onKeyDown:b,"aria-activedescendant":o},menuProps:{ref:L(c,a.setFloating),className:"dropdown-menu bg-white shadow rounded-4 p-8","aria-labelledby":`dropdown-toggle-${t}`,style:{...u}},itemProps:{onMenuItemMouseEnter:E,onMenuItemClick:R,onMenuItemKeyDown:T},setVisible:r}},dE=jI,fE=({children:e,block:t,overflow:n=!0,placement:r="bottom-start"})=>{const{visible:s,isFocused:i,triggerProps:o,menuProps:l,itemProps:a,itemRefs:u,setVisible:c}=dE(r),f=gg(()=>c(!1)),p=S.useMemo(()=>({visible:s,isFocused:i,triggerProps:o,menuProps:l,itemProps:a,itemRefs:u,block:t,setVisible:c}),[s,i,o,l,a,u,t,c]),h=J("dropdown",{"w-100":t,overflow:n});return d.jsx(XS.Provider,{value:p,children:d.jsx("div",{ref:f,className:h,children:typeof e=="function"?e(o,u):e})})};fE.displayName="Dropdown";const PI=Object.assign(fE,{Trigger:TI,Menu:SI,Item:bI,Separator:kI,CheckboxItem:xI,RadioItem:CI,MenuGroup:EI}),Ee=PI,Td=({onSearchResultsChange:e,onSearchInputChange:t,options:n,value:r,isLoading:s,noResult:i,placeholder:o})=>{const{t:l}=ue(),[a,u]=S.useState([]);S.useEffect(()=>{e(a)},[a]);const c=p=>{u([p])},f=()=>s?d.jsxs("div",{className:"d-flex align-items-center p-4",children:[d.jsx(xg,{isLoading:s}),d.jsx("span",{className:"ps-4",children:l("explorer.search.pending")})]}):i?d.jsx("div",{className:"p-4",children:l("portal.no.result")}):n.map((p,h)=>d.jsxs(S.Fragment,{children:[d.jsx(Ee.Item,{type:"select",onClick:()=>c(p.value),children:p.label}),h<n.length-1&&d.jsx(Ee.Separator,{})]},h));return d.jsxs(Ee,{block:!0,children:[d.jsx(Td.Trigger,{placeholder:o,handleSearchInputChange:t,value:r}),d.jsx(Ee.Menu,{children:f()})]})};Td.Trigger=wI;Td.displayName="Combobox";const pE=Td,hE=({imageSrc:e,imageAlt:t="",title:n,text:r})=>d.jsxs("div",{className:"emptyscreen",children:[e&&d.jsx("div",{className:"emptyscreen-image mb-12",children:d.jsx("img",{className:"mx-auto",src:e,alt:t,width:"250",height:"250"})}),n&&d.jsx(an,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:n}),r&&d.jsx("div",{className:"text",children:r})]});hE.displayName="EmptyScreen";const OI=hE,Ri=({children:e,className:t,...n})=>{const r=J("grid",t);return d.jsx("div",{className:r,...n,children:e})},Eg=({sm:e,md:t,lg:n,xl:r,children:s,className:i,as:o,...l})=>{const a=o||"div",u=J({[`g-col-${e}`]:e,[t?`g-col-md-${t}`:""]:t,[n?`g-col-lg-${n}`:""]:n,[r?`g-col-xl-${r}`:""]:r},i);return d.jsx(a,{className:u,...l,children:s})};Ri.displayName="Grid";Eg.displayName="Grid.Col";Ri.Col=Eg;const mE=S.forwardRef(({label:e,addButtonLabel:t="Add image",deleteButtonLabel:n="Delete image",src:r,className:s,app:i,onUploadImage:o,onDeleteImage:l},a)=>{const u=S.useRef(null),[c,f]=S.useState(r||""),p=b=>{f("");const E=b==null?void 0:b[0];E&&(f(URL.createObjectURL(E)),o(E))},h=()=>{var b;(b=u.current)==null||b.click()},y=()=>{u.current&&(u.current.value=""),f(""),l()},w=b=>{p(b.target.files)},x=J("image-input",s),{handleDragging:g,handleDragLeave:m,handleDrop:v}=SS(u,p);return d.jsxs(Qe,{id:"image-input",className:x,onDragEnter:g,onDragOver:g,onDragLeave:m,onDrop:v,ref:a,children:[d.jsxs("div",{className:"image-input-actions gap-8",children:[d.jsx(hr,{"aria-label":t,color:"tertiary",icon:d.jsx(AT,{}),onClick:h,type:"button",variant:"ghost"}),d.jsx(hr,{"aria-label":n,color:"danger",disabled:!c,icon:d.jsx(ab,{width:"20",height:"20"}),onClick:y,type:"button",variant:"ghost"})]}),d.jsxs(Qe.Label,{children:[d.jsx("span",{className:"visually-hidden",children:e}),d.jsx(rs,{accept:"image/*",hidden:!0,onChange:w,ref:u,size:"sm",type:"file"}),c?d.jsx(Ws,{alt:"",src:c,size:"xl"}):d.jsx(qs,{app:i,iconFit:"ratio",size:"160",variant:"rounded"})]})]})});mE.displayName="ImagePicker";const Cg=mE,gE=S.forwardRef(({text:e,textButton:t,src:n,alt:r,url:s},i)=>d.jsx(d.Fragment,{children:d.jsxs("div",{ref:i,className:"p-16",children:[d.jsx(ho,{width:"270",height:"140",loading:"lazy",className:"rounded",src:n,alt:r}),d.jsx("p",{className:"m-8",children:e}),d.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:d.jsx(ze,{rightIcon:d.jsx(ET,{}),className:"py-0 px-8",variant:"ghost",color:"primary",children:t})})]})}));gE.displayName="Library";const RI=gE,vE=S.forwardRef(({position:e=!0},t)=>{const[n]=Ys(),r=`${n}/loading/screen-loading.gif`,s=J("loading-screen top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-items-center z-2000",{"position-fixed":!e,"position-static":e});return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:t,className:s,children:d.jsx("div",{className:"bg-white rounded-circle mx-auto",children:d.jsx("img",{src:r,alt:"loading"})})}),!e&&d.jsx("div",{className:"modal-backdrop fade show"})]})});vE.displayName="LoadingScreen";const _t=vE,yE=S.forwardRef(({src:e,is1d:t,translate:n="Retour accueil"},r)=>{const s=J("navbar-brand d-none d-md-block"),i=`logo ${t?"ONE":"NEO"}`;return d.jsx("a",{ref:r,className:s,href:"/timeline/timeline","aria-label":n,children:d.jsx("img",{className:"logo",src:e,alt:i,width:"300",height:"52"})})});yE.displayName="Logo";const kh=yE,kg=S.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""});kg.displayName="ModalContext";const wE=()=>{const e=S.useContext(kg);if(!e)throw new Error("Cannot be rendered outside the Modal component");return e},xE=e=>{const{ariaDescriptionId:t}=wE(),{children:n,className:r}=e,s=J("modal-body",r);return d.jsx("div",{id:t,className:s,children:n})};xE.displayName="Modal.Body";const NI=xE,bE=e=>d.jsx("div",{className:"modal-footer",children:e.children});bE.displayName="Modal.Footer";const AI=bE,SE=e=>{const{onModalClose:t,children:n}=e,{ariaLabelId:r,focusId:s}=wE(),i=S.useRef(null);return S.useEffect(()=>{var o;s||(o=i.current)==null||o.focus()},[s]),d.jsxs("div",{className:"modal-header",children:[d.jsx("h2",{id:r,className:"modal-title",tabIndex:-1,children:n}),d.jsx(hr,{ref:i,"aria-label":"Close",color:"tertiary",icon:d.jsx(ob,{}),type:"button",variant:"ghost",title:"Delete",onClick:t,className:"btn-close"})]})};SE.displayName="Modal.Header";const II=SE,EE=e=>d.jsx("p",{className:"modal-subtitle",children:e.children});EE.displayName="Modal.Subtitle";const _I=EE,CE=S.forwardRef((e,t)=>{const{id:n,isOpen:r,onModalClose:s,size:i="md",viewport:o=!1,scrollable:l=!1,focusId:a,children:u}=e,c=`aria_label_${n}`,f=`aria_desc_${n}`,p=gg(s),h=xS();vS(s,["Escape"]),S.useEffect(()=>{if(r&&(document.body.style.overflow="hidden",a)){const m=document.getElementById(a);m==null||m.focus()}return()=>{document.body.style.overflow=""}},[a,r]);const y=J("modal fade",{"show d-block":r,"modal-scrollable":l,viewport:o,[`modal-${i}`]:i}),w=J("modal-dialog"),x={ariaLabelId:c,ariaDescriptionId:f,focusId:a},g=n2(r,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return d.jsx(kg.Provider,{value:x,children:g((m,v)=>d.jsxs(d.Fragment,{children:[v&&d.jsx(vh.div,{id:n,ref:t,role:"dialog","aria-modal":"true","aria-labelledby":c,"aria-describedby":f,className:y,style:m,tabIndex:-1,children:d.jsx("div",{id:`${n}_ref`,ref:b=>{p.current=b,v&&(h.current=b)},className:w,children:d.jsx("div",{className:"modal-content",children:u})})}),v&&d.jsx(vh.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),MI=Object.assign(CE,{Header:II,Subtitle:_I,Body:NI,Footer:AI});CE.displayName="Modal";const Re=MI,LI=({children:e,className:t})=>{const n=J("popover-header",t);return d.jsx("div",{className:n,children:e})},kE=({children:e,className:t})=>{const n=J("popover-body",t);return d.jsx("div",{className:n,children:e})},TE=({children:e,className:t})=>{const n=J("popover-footer p-8",t);return d.jsx("div",{className:n,children:e})},jd=S.forwardRef(({children:e,className:t,id:n,isVisible:r,...s},i)=>{const o=J("popover d-block position-absolute top-100 start-50 translate-middle-x",t);return n2(r,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((a,u)=>u&&d.jsx(vh.div,{ref:i,"aria-labelledby":n,className:o,role:"tooltip",style:a,...s,children:e}))});jd.displayName="Popover";const jE=e=>d.jsx(Ee.Trigger,{...e,"aria-haspopup":"listbox",role:"combobox"});jE.displayName="SelectTrigger";const DI=jE,PE=({icon:e,options:t,overflow:n,block:r,variant:s,size:i,disabled:o,placeholderOption:l,onValueChange:a})=>{const[u,c]=S.useState(),{t:f}=ue();S.useEffect(()=>{if(u){const h=typeof u=="object"?u.value:u;a==null||a(h)}},[u]);const p=typeof u=="object"?u.label:u;return d.jsxs(Ee,{overflow:n,block:r,children:[d.jsx(DI,{icon:e,label:f(p||l),variant:s,size:i,disabled:o}),d.jsx(Ee.Menu,{role:"listbox",children:t==null?void 0:t.map(h=>{const y=typeof h=="object"?h.value:h,w=typeof h=="object"?h.label:h;return d.jsx(Ee.Item,{onClick:()=>c(h),children:w},y)})})]})};PE.displayName="Select";const Tg=PE,FI=({children:e,message:t,icon:n=null,placement:r="auto"})=>{const[s,i]=S.useState(null),[o,l]=S.useState(null),[a,u]=S.useState(null),{styles:c,attributes:f}=ER(s,o,{placement:r,modifiers:[{name:"arrow",options:{element:a}}]}),[p,h]=S.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"d-inline-block position-relative z-2",ref:i,onMouseEnter:()=>{h(!0)},onMouseLeave:()=>{h(!1)},children:e}),p&&d.jsxs("div",{className:J("tooltip d-block show mb-12","bs-tooltip-auto"),ref:l,style:c.popper,...f.popper,children:[d.jsxs("div",{className:"tooltip-inner shadow-hover d-flex gap-8 align-items-center",children:[n&&n,d.jsx("div",{children:t})]}),d.jsx("div",{className:"tooltip-arrow",ref:u,style:c.arrow})]})]})},OE=FI,RE=S.forwardRef(({noValidationIcon:e,placeholder:t,size:n="md",height:r="md",className:s,...i},o)=>{const{id:l,isRequired:a,isReadOnly:u,status:c}=kd(),f=J({"form-control":!u,"form-control-lg":n==="lg","form-control-sm":n==="sm","textarea-height-lg":r==="lg","textarea-height-md":r==="md","textarea-height-sm":r==="sm","is-invalid":c==="invalid","is-valid":c==="valid","form-control-plaintext":u,"no-validation-icon":e},s);return d.jsx("textarea",{ref:o,id:l,className:f,placeholder:t,required:a,readOnly:u,...i})});RE.displayName="TextArea";const jg=RE;function $I(e,t,n,r,s,i,o,l,a){const u=x=>{x.preventDefault(),s==null||s(e),x.stopPropagation()},c=x=>{(x.code==="Enter"||x.code==="Space")&&(x.preventDefault(),s==null||s(e),x.stopPropagation())},f=()=>{r(!n),n?i==null||i(e):o==null||o(e)};return{handleItemClick:u,handleItemKeyDown:c,handleItemFoldUnfoldClick:x=>{x.preventDefault(),f(),x.stopPropagation()},handleItemFoldUnfoldKeyDown:x=>{(x.code==="Enter"||x.code==="Space")&&(x.preventDefault(),f(),x.stopPropagation())},handleItemFocus:x=>{x.preventDefault(),l==null||l(e)},handleItemBlur:x=>{x.preventDefault(),a==null||a(e)}}}const NE=e=>{const{nodeId:t,label:n,children:r,section:s,selected:i,onItemSelect:o,onItemFold:l,onItemUnfold:a,onItemFocus:u,onItemBlur:c,selectedNodesIds:f}=e,[p,h]=S.useState(!1),{handleItemClick:y,handleItemKeyDown:w,handleItemFoldUnfoldClick:x,handleItemFoldUnfoldKeyDown:g,handleItemFocus:m,handleItemBlur:v}=$I(t,n,p,h,o,l,a,u,c);S.useEffect(()=>{if(f!=null&&f.length&&(f==null?void 0:f.length)>=1){const T=f[f.length-1];f.some(C=>C===t&&t!==T?(h(!0),C===t):(h(!1),!1))}else h(!1)},[t,f]);const b=s?16:12,E=()=>d.jsx("li",{id:`listitem_${t}`,role:"treeitem","aria-selected":i,"aria-expanded":p,children:d.jsxs("div",{children:[d.jsxs("div",{className:"action-container d-flex align-items-center gap-8 px-2",children:[d.jsxs("div",{className:"py-8",tabIndex:0,role:"button",onClick:x,onKeyDown:g,"aria-label":"fold/unfold button",children:[Array.isArray(r)&&!p&&d.jsx(S1,{title:"RafterRight",width:b,height:b}),Array.isArray(r)&&p&&d.jsx(Na,{title:"RafterDown",width:b,height:b}),!Array.isArray(r)&&d.jsx(S1,{title:"RafterRight",width:b,height:b,"aria-hidden":"true",className:"opacity-0"})]}),d.jsxs("div",{tabIndex:0,role:"button",className:"flex-fill d-flex align-items-center text-truncate gap-8 py-8",onClick:y,onKeyDown:w,onFocus:m,onBlur:v,children:[s&&d.jsx($T,{title:"Folder",width:20,height:20}),d.jsx("span",{className:"text-truncate",children:n})]})]}),Array.isArray(r)&&d.jsx("ul",{role:"group",children:r})]})},t);return s?d.jsx("ul",{role:"tree",className:"m-0 p-0",children:E()}):E()};NE.displayName="TreeItem";const zI=NE,AE=S.forwardRef((e,t)=>{const{data:n,onTreeItemSelect:r,onTreeItemFold:s,onTreeItemUnfold:i,onTreeItemFocus:o,onTreeItemBlur:l,selectedNodesIds:a}=e,[u,c]=S.useState("default");S.useEffect(()=>{a!=null&&a.length&&(a==null?void 0:a.length)>=1?c(a[a.length-1]):c("")},[a]);const f=g=>{c(g),r==null||r(g)},p=g=>{s==null||s(g)},h=g=>{i==null||i(g)},y=g=>{o==null||o(g)},w=g=>{l==null||l(g)},x=g=>d.jsx(zI,{nodeId:g.id,label:g.name,section:g.section,selectedNodesIds:a,selected:u===g.id,onItemSelect:f,onItemFold:p,onItemUnfold:h,onItemFocus:y,onItemBlur:w,children:Array.isArray(g.children)?g.children.map(m=>x(m)):null},g.id);return d.jsx("div",{ref:t,id:"treeview",className:"treeview",children:x(n)})});AE.displayName="TreeView";const IE=AE,_E=S.forwardRef(({children:e},t)=>d.jsx("span",{className:"visually-hidden",ref:t,children:e}));_E.displayName="VisuallyHidden";const sr=_E,BI=async e=>await ae.conf().getPreference(e),VI=async e=>await ae.conf().savePreference(e,JSON.stringify({showOnboardingTrash:!1})),UI=e=>{const[t,n]=S.useState(!0),[r,s]=S.useState(!1);return S.useEffect(()=>{(async()=>{const o=await BI(e);if(o){const{showOnboardingTrash:l}=o;s(l);return}s(!0)})()},[e]),{isOpen:t,setIsOpen:n,isOnboardingTrash:r,handleSavePreference:async()=>{await VI(e),n(!1)}}},ME=({id:e,items:t,modalOptions:n})=>{const[r]=Ys(),[s,i]=S.useState(),[o,l]=S.useState(0),{isOpen:a,isOnboardingTrash:u,setIsOpen:c,handleSavePreference:f}=UI(e),{t:p}=ue(),{title:h,prevText:y,closeText:w,nextText:x}=n;return u?vr.createPortal(d.jsxs(Re,{id:"onboarding-modal",size:"md",isOpen:a,focusId:"nextButtonId",onModalClose:()=>c(!1),children:[d.jsx(Re.Header,{onModalClose:()=>c(!1),children:p(h||"explorer.modal.onboarding.trash.title")}),d.jsx(Re.Body,{children:d.jsx(P2,{modules:[JR],onSwiper:g=>{i(g)},onSlideChange:g=>{l(g.progress)},pagination:{clickable:!0},children:t.map((g,m)=>d.jsxs(O2,{children:[d.jsx(ho,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:`${r}/${g.src}`,alt:p(g.alt)}),d.jsx("p",{children:p(g.text)})]},m))})}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>c(!1),children:p("explorer.modal.onboarding.trash.later")}),o>0&&d.jsx(ze,{type:"button",color:"primary",variant:"outline",onClick:()=>s.slidePrev(),children:p(y||"explorer.modal.onboarding.trash.prev")}),o<1&&d.jsx(ze,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>s.slideNext(),children:p(x||"explorer.modal.onboarding.trash.next")}),o===1&&d.jsx(ze,{type:"button",color:"primary",variant:"filled",onClick:f,children:p(w||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null};ME.displayName="OnboardingModal";const HI=ME,qI=()=>{const{t:e}=ue();return[{value:"bpr.activityType.classroomActivity",label:e("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:e("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:e("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:e("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:e("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:e("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:e("bpr.activityType.courseElement")},{value:"bpr.other",label:e("bpr.other")}]},WI=({control:e,selectedActivities:t,selectActivities:n})=>{const r=qI(),{t:s}=ue();return d.jsx("div",{className:"col d-flex",children:d.jsx(Jc,{name:"activityType",control:e,rules:{required:!0},render:({field:{onChange:i}})=>d.jsxs(Ee,{block:!0,overflow:!0,children:[d.jsx(Ee.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:t==null?void 0:t.length}),d.jsx(Ee.Menu,{children:r.map((o,l)=>d.jsx(Ee.CheckboxItem,{value:o.value,model:t,onChange:()=>{n(o.value),i(o.value)},children:o.label},l))})]})})})},GI=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],z0=({name:e,control:t,placeholderOption:n,validate:r})=>d.jsx(Jc,{name:e,control:t,rules:{required:!0,validate:r},render:({field:{onChange:s}})=>d.jsx(Tg,{block:!0,size:"md",onValueChange:s,options:GI,"aria-required":!0,placeholderOption:n})}),QI=()=>{const{t:e}=ue();return[{value:"de_DE",label:e("de_DE")},{value:"en_EN",label:e("en_EN")},{value:"ar_DZ",label:e("ar_DZ")},{value:"es_ES",label:e("es_ES")},{value:"fr_FR",label:e("fr_FR")},{value:"it_IT",label:e("it_IT")},{value:"ja_JP",label:e("ja_JP")},{value:"zh_CN",label:e("zh_CN")},{value:"pt_PT",label:e("pt_PT")},{value:"ru_RU",label:e("ru_RU")},{value:"bpr.other",label:e("bpr.other")}]},KI="bpr.form.publication.language",XI=({control:e})=>{const t=QI();return d.jsx("div",{className:"col",children:d.jsx(Jc,{name:"language",control:e,rules:{required:!0},render:({field:{onChange:n}})=>d.jsx(Tg,{block:!0,size:"md",onValueChange:n,options:t,"aria-required":!0,placeholderOption:KI})})})},YI=()=>{const{t:e}=ue(),[t]=Ys();return d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"mb-12",children:[d.jsxs("li",{children:[e("bpr.form.publication.licence.text.1"),d.jsx("img",{className:"ms-8 d-inline-block",src:`${t}/common/image-creative-commons.png`,alt:"licence creative commons"})]}),d.jsx("li",{children:e("bpr.form.publication.licence.text.2")})]}),d.jsx(Vr,{type:"info",className:"mb-12",children:e("bpr.form.publication.licence.text.3")}),d.jsx(Vr,{type:"warning",children:e("bpr.form.publication.licence.text.4")})]})},JI=()=>{const{t:e}=ue();return[{value:"bpr.subjectArea.artActivity",label:e("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:e("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:e("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:e("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:e("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:e("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:e("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:e("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:e("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:e("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:e("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:e("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:e("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:e("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:e("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:e("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:e("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:e("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:e("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:e("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:e("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:e("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:e("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:e("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:e("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:e("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:e("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:e("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:e("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:e("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:e("bpr.subjectArea.technology")},{value:"bpr.other",label:e("bpr.other")}]},ZI=({control:e,selectedSubjectAreas:t,selectSubjects:n})=>{const r=JI(),{t:s}=ue();return d.jsx("div",{className:"col d-flex",children:d.jsx(Jc,{name:"subjectArea",control:e,rules:{required:!0},render:({field:{onChange:i}})=>d.jsxs(Ee,{block:!0,overflow:!0,children:[d.jsx(Ee.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:t==null?void 0:t.length}),d.jsx(Ee.Menu,{children:r.map((o,l)=>d.jsx(Ee.CheckboxItem,{value:o.value,model:t,onChange:()=>{n(o.value),i(o.value)},children:o.label},l))})]})})})};function B0({formData:e}){const{t}=ue(),n=r=>r.match(/^\s/);return d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"pt-24",children:t("bpr.form.publication.response.error.title")}),d.jsx("p",{className:"pt-24 pb-24",children:d.jsx("strong",{children:t("bpr.form.publication.response.error.content")})}),d.jsxs("ul",{children:[n(e.title)&&d.jsx("li",{className:"pt-2 pb-2",children:d.jsx("strong",{children:t("bpr.form.publication.response.empty.title")})}),n(e.description)&&d.jsx("li",{className:"pt-2 pb-2",children:d.jsx("strong",{children:t("bpr.form.publication.response.empty.description")})})]})]})}function e6({result:e}){const{t}=ue();return d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"pt-24",children:t("bpr.form.publication.response.success.title")}),d.jsx("p",{className:"pt-24",children:t("bpr.form.publication.response.success.content.1")}),d.jsx("p",{className:"pt-24",children:t("bpr.form.publication.response.success.content.2")}),e.details.front_url&&d.jsx("p",{className:"pt-24 pb-24",children:d.jsx("a",{className:"button right-magnet",href:e.details.front_url,target:"_blank",rel:"noreferrer",children:t("bpr.form.publication.response.success.button")})})]})}function t6({onSuccess:e,resource:t}){const{user:n,appCode:r}=Te(),s=ht(),[i,o]=S.useState(t.thumbnail||""),{control:l,register:a,watch:u,setValue:c,handleSubmit:f,formState:{errors:p,isSubmitting:h,isDirty:y,isValid:w}}=sb({mode:"onChange"}),[x,g]=S.useState([]),[m,v]=S.useState([]),b=(L,A,N)=>{let M=[...A];const D=M.findIndex(k=>k===L);A.includes(L)?M=A.filter((k,I)=>I!==D):M=[...A,L],N(M)};return{control:l,cover:i,formState:{errors:p,isSubmitting:h,isDirty:y,isValid:w},handleDeleteImage:()=>o(""),handlePublish:async L=>{const A=n?n==null?void 0:n.userId:"";try{let N=new Blob;typeof i=="string"?N=await ae.http().get(i,{responseType:"blob"}):i?N=await ae.http().get(URL.createObjectURL(i),{responseType:"blob"}):t.thumbnail&&(N=await ae.http().get(t.thumbnail,{responseType:"blob"}));const M=await ae.http().get(`/userbook/avatar/${A}?thumbnail=48x48`,{responseType:"blob"}),D=await ae.http().get(`/directory/user/${A}/attachment-school`,{responseType:"json"}),k=wg[r],I={activityType:x,age:[L.ageMin,L.ageMax],application:k,cover:N,description:L.description,keyWords:L.keyWords,language:L.language,licence:"CC-BY",resourceId:t.assetId,resourceEntId:t.assetId,subjectArea:m,teacherAvatar:M,title:L.title,userId:A,userStructureName:D.name||(n==null?void 0:n.structureNames[0])},z=await ae.resource(r).publish(I);z.success?s.success(d.jsx(e6,{result:z}),{duration:1e4}):s.error(d.jsx(B0,{formData:L})),e==null||e()}catch(N){console.error(N),s.error(d.jsx(B0,{formData:L}))}},handleSubmit:f,handleUploadImage:L=>o(L),register:a,selectActivities:L=>{b(L,x,g)},selectedActivities:x,selectedSubjectAreas:m,selectSubjects:L=>{b(L,m,v)},setValue:c,watch:u}}function n6({isOpen:e,resource:t,onSuccess:n,onCancel:r}){const{currentApp:s}=Te(),{t:i}=ue(),{control:o,cover:l,formState:{isDirty:a,isValid:u,isSubmitting:c},handleDeleteImage:f,handleSubmit:p,handleUploadImage:h,handlePublish:y,register:w,selectActivities:x,selectedActivities:g,selectedSubjectAreas:m,selectSubjects:v}=t6({resource:t,onSuccess:n}),b="bpr.form.publication.age.min",E="bpr.form.publication.age.max";return vr.createPortal(d.jsxs(Re,{isOpen:e,onModalClose:r,id:"libraryModal",size:"lg",children:[d.jsx(Re.Header,{onModalClose:r,children:i("bpr.publish")}),d.jsx(Re.Subtitle,{children:i("bpr.form.tip")}),d.jsxs(Re.Body,{children:[d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("bpr.form.publication.heading.general")}),d.jsxs("form",{id:"libraryModalForm",onSubmit:p(y),children:[d.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[d.jsxs("div",{style:{maxWidth:"160px"},children:[d.jsx("div",{className:"form-label",children:i("bpr.form.publication.cover.title")}),d.jsx(Cg,{app:s,src:t.thumbnail,label:i("bpr.form.publication.cover.upload.label"),addButtonLabel:i("bpr.form.publication.cover.upload.add"),deleteButtonLabel:i("bpr.form.publication.cover.upload.remove"),onUploadImage:h,onDeleteImage:f,className:"align-self-center"}),!l&&d.jsx("p",{className:"form-text is-invalid",children:d.jsx("em",{children:i("bpr.form.publication.cover.upload.required.image")})})]}),d.jsxs("div",{className:"flex-fill",children:[d.jsxs(Qe,{id:"title",className:"mb-16",isRequired:!0,children:[d.jsx(_s,{children:i("bpr.form.publication.title")}),d.jsx(rs,{type:"text",defaultValue:t.name,...w("title",{required:!0}),placeholder:i("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),d.jsxs(Qe,{id:"description",isRequired:!0,children:[d.jsx(_s,{children:i("bpr.form.publication.description")}),d.jsx(jg,{...w("description",{required:!0}),placeholder:i("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),d.jsx("hr",{}),d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("bpr.form.publication.heading.infos")}),d.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[d.jsx(WI,{control:o,selectedActivities:g,selectActivities:x}),d.jsx(ZI,{control:o,selectedSubjectAreas:m,selectSubjects:v}),d.jsx(XI,{control:o})]}),d.jsxs("div",{className:"mb-24",children:[d.jsx("label",{htmlFor:"",className:"form-label",children:i("bpr.form.publication.age")}),d.jsxs("div",{className:"d-flex gap-8",children:[d.jsx("div",{className:"col col-2",children:d.jsx(z0,{control:o,name:"ageMin",placeholderOption:b,validate:(T,C)=>parseInt(T)<=parseInt(C.ageMax)})}),d.jsx("div",{className:"col col-2",children:d.jsx(z0,{control:o,name:"ageMax",placeholderOption:E,validate:(T,C)=>parseInt(T)>=parseInt(C.ageMin)})})]})]}),d.jsx("div",{className:"mb-24",children:d.jsxs(Qe,{id:"keywords",isOptional:!0,children:[d.jsx(_s,{children:i("bpr.form.publication.keywords")}),d.jsx(rs,{type:"text",...w("keyWords"),size:"md",placeholder:i("bpr.form.publication.keywords.placeholder")})]})}),d.jsx("hr",{}),d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("bpr.form.publication.licence.text")}),d.jsx(YI,{})]})]}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:i("cancel")}),d.jsx(ze,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:c,disabled:!l||c||!a||!u,children:i("bpr.form.submit")})]})]}),document.getElementById("portal"))}const r6=({watch:e,selectedResource:t})=>{const[n,r]=S.useState(""),[s,i]=S.useState(!!(t!=null&&t.public)||!1),o=S.useId(),l=e("title"),{t:a}=ue(),u=ht(),c=`${A2({foo:`${l}${o}`})}-${_2(l)}`;S.useEffect(()=>{if(s){let h="";t&&t.slug?h=t.slug:h=c,r(h)}},[s,t,l,o,c]);function f(h){i(h)}function p(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${n}`),u.success(a("explorer.copy.clipboard"))}return{slug:n,uniqueId:o,isPublic:s,resourceName:l,onPublicChange:f,onCopyToClipBoard:p}},s6=({isUpdating:e,selectedResource:t})=>{const[n,r]=S.useState(e&&(t==null?void 0:t.thumbnail)||"");return{thumbnail:n,handleDeleteImage:()=>r(""),handleUploadImage:o=>r(o)}},i6=({appCode:e,isPublic:t,onCopyToClipBoard:n,onPublicChange:r,register:s,slug:i,resourceName:o})=>{const{t:l}=ue();return d.jsxs(d.Fragment,{children:[d.jsxs(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:[l("explorer.resource.editModal.heading.access"),e]}),d.jsx(Vr,{type:"info",children:l("explorer.resource.editModal.access.alert")}),d.jsxs(Qe,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[d.jsx(Qe.Input,{type:"checkbox",role:"switch",...s("enablePublic",{disabled:!t&&!o,onChange:a=>{r(a.target.checked)}}),className:"form-check-input mt-0",size:"md"}),d.jsx(Qe.Label,{className:"form-check-label mb-0",children:l("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),t&&d.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[d.jsxs("p",{className:"text-break",children:[window.location.origin,window.location.pathname,"/pub/",i]}),d.jsx(ze,{color:"primary",disabled:!t,onClick:n,type:"button",leftIcon:d.jsx(OT,{}),variant:"ghost",className:"text-nowrap",children:l("explorer.resource.editModal.access.url.button")})]})]})},Ac=(e,t)=>{const n=t==null?void 0:t.filter(r=>r.id===e&&r.available);return n&&n.length>0},o6=({isOpen:e,actions:t,onCancel:n,onSuccess:r,...s})=>{var i,o,l,a,u,c;const{appCode:f,currentApp:p}=Te(),{t:h}=ue(),{mode:y}=s,w=S.useId(),x=y==="create",g=y==="update",{watch:m,register:v,handleSubmit:b,formState:{isSubmitting:E,isValid:T}}=sb({mode:"onChange",defaultValues:{description:g?(i=s.selectedResource)==null?void 0:i.description:"",enablePublic:g?(o=s.selectedResource)==null?void 0:o.public:!1,title:g?(l=s.selectedResource)==null?void 0:l.name:""}}),{slug:C,uniqueId:R,isPublic:j,resourceName:L,onPublicChange:A,onCopyToClipBoard:N}=r6({watch:m,selectedResource:g?s.selectedResource:void 0}),M=ht(),{thumbnail:D,handleDeleteImage:k,handleUploadImage:I}=s6({isUpdating:g}),z=async function(_){var $,V;try{const ne={description:_.description||"",name:_.title,public:_.enablePublic,thumbnail:D},re=`${A2({foo:`${_.title}${R}`})}-${_2(_.title)}`;x?await s.createResource.mutateAsync({...ne,folder:(($=s.currentFolder)==null?void 0:$.id)==="default"?void 0:parseInt(((V=s.currentFolder)==null?void 0:V.id)||""),slug:_.enablePublic?re:"",app:f}):await s.updateResource.mutateAsync({...ne,slug:_.enablePublic?s.selectedResource&&s.selectedResource.slug?s.selectedResource.slug:re:"",entId:s.selectedResource.assetId,trashed:s.selectedResource.trashed}),M.success(d.jsxs(d.Fragment,{children:[d.jsx("strong",{children:h(x?"explorer.resource.created":"explorer.resource.updated")}),d.jsxs("p",{children:[h("title")," : ",_.title]}),d.jsxs("p",{children:[h("description")," : ",_.description]}),f===Ho.BLOG&&d.jsxs("p",{children:["Public:",_.enablePublic?h("explorer.enable.public.yes"):h("explorer.enable.public.no")]})]})),r()}catch(ne){console.error(ne)}};return vr.createPortal(d.jsxs(Re,{id:`${y}-resource`,size:"lg",isOpen:e,onModalClose:n,children:[d.jsx(Re.Header,{onModalClose:n,children:h(`explorer.resource.editModal.header.${x?"create":"edit"}`)}),d.jsxs(Re.Body,{children:[d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:h("explorer.resource.editModal.heading.general")}),d.jsxs("form",{id:w,onSubmit:b(z),children:[d.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[d.jsx("div",{children:d.jsx(Cg,{app:p,src:g&&((a=s.selectedResource)==null?void 0:a.thumbnail)||"",label:h("explorer.imagepicker.label"),addButtonLabel:h("explorer.imagepicker.button.add"),deleteButtonLabel:h("explorer.imagepicker.button.delete"),onUploadImage:I,onDeleteImage:k,className:"align-self-center mt-8"})}),d.jsxs("div",{className:"col",children:[d.jsxs(Qe,{id:"title",className:"mb-16",isRequired:!0,children:[d.jsx(_s,{children:h("title")}),d.jsx(rs,{type:"text",defaultValue:g?(u=s.selectedResource)==null?void 0:u.name:"",...v("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:h("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),d.jsxs(Qe,{id:"description",isOptional:!0,children:[d.jsx(_s,{children:h("description")}),d.jsx(jg,{defaultValue:g?(c=s.selectedResource)==null?void 0:c.description:"",...v("description"),placeholder:h("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),f===Ho.BLOG&&Ac({workflow:"createPublic",actions:t})&&d.jsx(i6,{appCode:f,isPublic:j,slug:C,onCopyToClipBoard:N,onPublicChange:A,register:v,resourceName:L})]})]}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{color:"tertiary",onClick:n,type:"button",variant:"ghost",children:h("explorer.cancel")}),d.jsx(ze,{form:w,type:"submit",color:"primary",isLoading:E,variant:"filled",disabled:!T||E,children:h(x?"explorer.create":"save")})]})]}),document.getElementById("portal"))},a6=o6;function l6({radioPublicationValue:e,onRadioPublicationChange:t}){const{appCode:n}=Te(),{t:r}=ue(n);return d.jsxs(d.Fragment,{children:[d.jsx("hr",{}),d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:r("explorer.publication.steps")}),d.jsx(Nc,{label:r("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:e,checked:e==="IMMEDIATE",onChange:s=>t(s.target.value)}),d.jsx(Nc,{label:r("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:e==="RESTRAINT",model:e,onChange:s=>t(s.target.value)})]})}const u6={searchInputValue:"",searchResults:[],searchAPIResults:[],searchPending:!1,isLoading:!1};function c6(e,t){switch(t.type){case"onChange":return{...e,searchInputValue:t.payload};case"isSearching":return{...e,isLoading:t.payload};case"addResult":return{...e,searchResults:t.payload};case"addApiResult":return{...e,searchAPIResults:t.payload};case"updateSearchResult":return{...e,searchResults:t.payload};case"emptyResult":return{...e,searchResults:t.payload};default:throw new Error("Unhandled action type")}}const Ff=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],d6=({resource:e,shareRights:t,shareDispatch:n})=>{const[r,s]=S.useReducer(c6,u6),i=wS(r.searchInputValue,500),{isAdml:o}=CS(),{appCode:l}=Te();S.useEffect(()=>{u(i)},[i]);const a=y=>{const w=y.target.value;s({type:"onChange",payload:w})},u=async y=>{if(s({type:"isSearching",payload:!0}),!o&&y.length>=1||o&&y.length>=3){const w=await ae.share().searchShareSubjects(l,e.assetId,y);s({type:"addApiResult",payload:w});const x=w.filter(g=>!t.rights.find(m=>m.id===g.id)).filter(g=>!(g.type==="user"&&g.id===e.creatorId)).map(g=>({value:g.id,label:g.displayName,icon:g.type==="sharebookmark"?Rm:null}));s({type:"addResult",payload:x})}else s({type:"emptyResult",payload:[]}),Promise.resolve();s({type:"isSearching",payload:!1})};return{state:r,showSearchAdmlHint:()=>o&&r.searchInputValue.length<3,showSearchLoading:()=>r.searchPending&&r.searchInputValue.length>0,showSearchNoResults:()=>!r.searchPending&&!o&&i.length>0&&r.searchResults.length===0||!r.searchPending&&o&&i.length>3&&r.searchResults.length===0,handleSearchInputChange:a,handleSearchResultsChange:async y=>{const w=r.searchAPIResults.find(x=>x.id===y[0]);if(w){let x=[];if(w.type==="sharebookmark"){const g=await ae.directory().getBookMarkById(w.id);x.push({...g,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:Ff}),g==null||g.users.filter(m=>!t.rights.find(v=>v.id===m.id)).forEach(m=>{x.push({...m,type:"user",avatarUrl:"",directoryUrl:"",actions:Ff,isBookmarkMember:!0})}),g.groups.filter(m=>!t.rights.find(v=>v.id===m.id)).forEach(m=>{x.push({...m,type:"group",avatarUrl:"",directoryUrl:"",actions:Ff,isBookmarkMember:!0})})}else x=[{...w,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];n({type:"updateShareRights",payload:{...t,rights:[...t.rights,...x]}}),s({type:"updateSearchResult",payload:r.searchResults.filter(g=>g.value!==y[0])})}}}},f6={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function p6(e,t){switch(t.type){case"init":return{...e,...t.payload};case"deleteRow":return{...e,shareRights:t.payload};case"updateShareRights":return{...e,shareRights:t.payload};case"toggleRight":return{...e,shareRights:t.payload};case"isSharing":return{...e,isSharing:!0};default:throw new Error("Unhandled action type")}}function h6({onSuccess:e,resource:t,updateResource:n,shareResource:r}){const{appCode:s}=Te(),{user:i,avatar:o}=Ed(),[l,a]=S.useReducer(p6,f6);return S.useEffect(()=>{(async()=>{const h=await ae.share().getActionsForApp(s),y=await ae.share().getRightsForResource(s,t.assetId);a({type:"init",payload:{shareRightActions:h,shareRights:y}})})()},[]),{state:l,dispatch:a,currentIsAuthor:()=>!!(t&&t.creatorId===(i==null?void 0:i.userId)),myAvatar:o,handleDeleteRow:h=>{a({type:"deleteRow",payload:{...l.shareRights,rights:l.shareRights.rights.filter(y=>{var w,x;return y.id!==h.id&&!((w=h.users)!=null&&w.find(g=>g.id===y.id))&&!((x=h.groups)!=null&&x.find(g=>g.id===y.id))})}})},handleShare:async h=>{a({type:"isSharing",payload:!0});try{const y=t.rights.filter(x=>i&&x.includes(`user:${i.userId}`)).map(x=>x.split(":")[2]).filter(x=>!!x),w=[...l.shareRights.rights];if(y.length>0){const x=y.map(g=>({displayName:g,id:g}));w.push({actions:x,avatarUrl:"",directoryUrl:"",displayName:i.username,id:i.userId,type:"user"})}s==="blog"?await n.mutateAsync(h):await n.mutateAsync({entId:t.assetId||"",trashed:t.trashed||!1,name:t.name||"",thumbnail:t.thumbnail||"",description:t.description||"",public:t.public||!1,slug:t.slug||""}),await r.mutateAsync({resourceId:t.assetId,rights:w}),e==null||e()}catch(y){console.error("Failed to save share",y)}finally{a({type:"isSharing",payload:!1})}},toggleRight:(h,y)=>{var w,x;const{rights:g,...m}=l.shareRights,v=[...g],b=v.findIndex(C=>C.id===h.id),E=l.shareRightActions.filter(C=>C.id===y)[0];if(v[b].actions.findIndex(C=>C.id===y)>-1){let C=v[b].actions.filter(j=>j.id!==y);const R=l.shareRightActions.filter(j=>{var L;return(L=j.requires)==null?void 0:L.includes(y)});C=C.filter(j=>!R.find(L=>L.id===j.id)),v[b]={...v[b],actions:C}}else{const C=l.shareRightActions.filter(R=>{var j;return((j=E.requires)==null?void 0:j.includes(R.id))&&!v[b].actions.find(L=>L.id===R.id)});v[b]={...v[b],actions:[...v[b].actions,E,...C]}}h.type==="sharebookmark"&&((w=v[b].users)==null||w.forEach(C=>{const R=v.findIndex(j=>j.id===C.id);v[R]={...v[R],actions:v[b].actions}}),(x=v[b].groups)==null||x.forEach(C=>{const R=v.findIndex(j=>j.id===C.id);v[R]={...v[R],actions:v[b].actions}})),a({type:"toggleRight",payload:{rights:v,...m}})}}}function m6({resource:e}){const{assetId:t,description:n,thumbnail:r,name:s,public:i,trashed:o,slug:l,"publish-type":a}=e||{"publish-type":"",assetId:"",description:"",name:"",public:!1,slug:"",thumbnail:"",trashed:!1},[u,c]=S.useState(a||"RESTRAINT"),[f,p]=S.useState({description:n||"",entId:t,name:s,public:!!i,slug:l||"",thumbnail:r,trashed:o,"publish-type":a});return S.useEffect(()=>{u&&p(y=>({...y,"publish-type":u}))},[u]),{radioPublicationValue:u,shareBlogPayload:f,handleRadioPublicationChange:async y=>{c(y)}}}const g6=({shareRights:e,shareDispatch:t})=>{const n=ht(),{t:r}=ue(),s=S.useRef(null),[i,o]=S.useState({name:"",id:S.useId()}),[l,a]=yg(!1),[u,c]=S.useState(!1),f=()=>{a()},p=()=>{o(w=>{var x;return{...w,name:((x=s.current)==null?void 0:x.value)||""}})},h=async w=>{try{const x=await ae.directory().saveBookmarks(w,{users:e.rights.filter(g=>g.type==="user").map(g=>g.id),groups:e.rights.filter(g=>g.type==="group").map(g=>g.id),bookmarks:e.rights.filter(g=>g.type==="sharebookmark").map(g=>g.id)});n.success(r("explorer.bookmarked.status.saved")),t({type:"updateShareRights",payload:{...e,visibleBookmarks:[...e.visibleBookmarks,{displayName:w,id:x.id}]}}),o(g=>({...g,bookmarkId:g.id+new Date().getTime().toString()})),c(!1)}catch(x){console.error("Failed to save bookmark",x),n.error(r("explorer.bookmarked.status.error"))}};return{refBookmark:s,showBookmark:l,showBookmarkInput:u,bookmark:i,handleBookmarkChange:p,setBookmark:o,handleOnSave:()=>{var w;const x=((w=s.current)==null?void 0:w.value)||"";h(x)},toggleBookmark:f,toggleBookmarkInput:c}},v6=({bookmark:e,refBookmark:t,onBookmarkChange:n,onSave:r})=>{const{t:s}=ue();return d.jsx("div",{className:"mt-16",children:d.jsxs(Qe,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[d.jsx("div",{className:"flex-fill",children:d.jsx(Qe.Input,{ref:t,onChange:n,placeholder:s("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},e.id)}),d.jsx(ze,{type:"button",color:"primary",variant:"ghost",disabled:e.name.length===0,leftIcon:d.jsx(t5,{}),onClick:r,className:"text-nowrap",children:s("explorer.modal.share.sharebookmark.save")})]})})},y6=(e,t)=>e.actions.filter(n=>t.id===n.id).length>0,w6=(e,t)=>e.isBookmarkMember&&t||!e.isBookmarkMember,x6=({shareRights:e,showBookmark:t,toggleBookmark:n,shareRightActions:r,toggleRight:s,onDeleteRow:i})=>{const{t:o}=ue();return e==null?void 0:e.rights.map(l=>w6(l,t)&&d.jsxs("tr",{className:l.isBookmarkMember?"bg-light":"",children:[d.jsxs("td",{children:[l.type!=="sharebookmark"&&d.jsx(Ws,{alt:o("explorer.modal.share.avatar.shared.alt"),size:"xs",src:l.avatarUrl,variant:"circle"}),l.type==="sharebookmark"&&d.jsx(Rm,{})]}),d.jsx("td",{children:d.jsxs("div",{className:"d-flex",children:[l.type==="sharebookmark"&&d.jsx(ze,{color:"tertiary",rightIcon:d.jsx(Na,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:t?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:n,children:l.displayName}),l.type!=="sharebookmark"&&l.displayName]})}),r.map(a=>d.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:d.jsx(Cd,{checked:y6(l,a),onChange:()=>s(l,a.id)})},a.displayName)),d.jsx("td",{children:!l.isBookmarkMember&&d.jsx(hr,{"aria-label":"Delete",color:"tertiary",icon:d.jsx(ob,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>i(l)})})]},l.id))};function b6({isOpen:e,resource:t,updateResource:n,shareResource:r,onSuccess:s,onCancel:i}){const{appCode:o}=Te(),{radioPublicationValue:l,shareBlogPayload:a,handleRadioPublicationChange:u}=m6({resource:t}),{state:{isSharing:c,shareRights:f,shareRightActions:p},dispatch:h,myAvatar:y,currentIsAuthor:w,handleShare:x,toggleRight:g,handleDeleteRow:m}=h6({resource:t,updateResource:n,shareResource:r,onSuccess:s}),{state:{searchResults:v,searchInputValue:b},showSearchAdmlHint:E,showSearchLoading:T,showSearchNoResults:C,handleSearchInputChange:R,handleSearchResultsChange:j}=d6({resource:t,shareRights:f,shareDispatch:h}),{refBookmark:L,showBookmark:A,handleBookmarkChange:N,toggleBookmark:M,bookmark:D,handleOnSave:k,showBookmarkInput:I,toggleBookmarkInput:z}=g6({shareRights:f,shareDispatch:h}),{t:_}=ue(),$=E()?_("explorer.search.adml.hint"):_("explorer.modal.share.search.placeholder");return vr.createPortal(d.jsxs(Re,{id:"share_modal",size:"lg",isOpen:e,onModalClose:i,children:[d.jsx(Re.Header,{onModalClose:i,children:_("share.title")}),d.jsxs(Re.Body,{children:[d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:_("explorer.modal.share.usersWithAccess")}),d.jsx("div",{className:"table-responsive",children:d.jsxs("table",{className:"table border align-middle mb-0",children:[d.jsx("thead",{className:"bg-secondary",children:d.jsxs("tr",{children:[d.jsx("th",{scope:"col",className:"w-32",children:d.jsx(sr,{children:_("explorer.modal.share.avatar.shared.alt")})}),d.jsx("th",{scope:"col",children:d.jsx(sr,{children:_("explorer.modal.share.search.placeholder")})}),p.map(V=>d.jsx("th",{scope:"col",className:"text-center text-white",children:_(V.displayName)},V.displayName)),d.jsx("th",{scope:"col",children:d.jsx(sr,{children:_("close")})})]})}),d.jsxs("tbody",{children:[w()&&d.jsxs("tr",{children:[d.jsx("th",{scope:"row",children:d.jsx(Ws,{alt:_("explorer.modal.share.avatar.me.alt"),size:"xs",src:y,variant:"circle"})}),d.jsx("td",{children:_("share.me")}),p.map(V=>d.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:d.jsx(Cd,{checked:!0,disabled:!0})},V.displayName)),d.jsx("td",{})]}),d.jsx(x6,{showBookmark:A,shareRightActions:p,shareRights:f,onDeleteRow:m,toggleRight:g,toggleBookmark:M})]})]})}),d.jsxs("div",{className:"mt-16",children:[d.jsx(ze,{color:"tertiary",leftIcon:d.jsx(Rm,{}),rightIcon:d.jsx(Na,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:I?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>z(!I),children:_("share.save.sharebookmark")}),I&&d.jsx(v6,{refBookmark:L,bookmark:D,onBookmarkChange:N,onSave:k})]}),d.jsx("hr",{}),d.jsxs(an,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[d.jsx("div",{className:"me-8",children:_("explorer.modal.share.search")}),d.jsx(OE,{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:d.jsx(lb,{className:"c-pointer",height:"18"})})]}),d.jsx("div",{className:"row",children:d.jsx("div",{className:"col-10",children:d.jsx(pE,{value:b,placeholder:$,isLoading:T(),noResult:C(),options:v,onSearchInputChange:R,onSearchResultsChange:j})})}),o==="blog"&&d.jsx(l6,{radioPublicationValue:l,onRadioPublicationChange:u})]}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{type:"button",color:"tertiary",variant:"ghost",onClick:i,children:_("explorer.cancel")}),d.jsx(ze,{type:"button",color:"primary",variant:"filled",isLoading:c,onClick:()=>x(a),disabled:c,children:_("share")})]})]}),document.getElementById("portal"))}function $f({children:e}){return d.jsx("span",{className:"position-absolute badge rounded-pill bg-warning",children:e})}function zf({children:e,className:t,...n}){const r=J("navbar",t);return d.jsx("nav",{className:r,...n,children:e})}function V0({children:e,className:t,...n}){const r=J("navbar-nav",t);return d.jsx("ul",{className:r,...n,children:e})}const _e=S.forwardRef(({children:e,className:t,...n},r)=>{const s=J("nav-item",t);return d.jsx("li",{ref:r,className:s,...n,children:e})});_e.displayName="NavItem";function Mo({link:e,className:t,children:n,translate:r,...s}){const i=J("nav-link",t);return d.jsxs("a",{href:e,className:i,...s,children:[n,r&&d.jsx(sr,{children:d.jsx("span",{className:"nav-text",children:r})})]})}const S6=()=>{const{t:e}=ue();return d.jsx("div",{className:"widget-footer",children:d.jsx("div",{className:"widget-footer-action",children:d.jsx("a",{href:"/welcome",className:"link",children:e("plus")})})})},E6=({bookmarkedApps:e})=>{const{t}=ue();return d.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!e.length&&d.jsx("div",{className:"text-dark",children:t("navbar.myapps.more")}),e.slice(0,6).map((n,r)=>d.jsx("a",{href:n.address,className:"bookmarked-app",children:d.jsx(qs,{app:n,size:"32"})},r))]})};function U0({isHelpOpen:e,setIsHelpOpen:t,parsedHeadline:n,parsedContent:r,error:s}){const{t:i}=ue(),o=()=>{t(!1)};return e?vr.createPortal(d.jsxs(Re,{id:"help-modal",isOpen:e,onModalClose:o,scrollable:!0,size:"lg",children:[d.jsx(Re.Header,{onModalClose:o,children:i("navbar.help")}),d.jsx(Re.Subtitle,{children:s?i("help.notfound.title"):n}),d.jsx(Re.Body,{className:s?"d-flex":null,children:s?i("help.notfound.text"):r})]}),document.getElementById("portal")):null}function C6(){var e;const{appCode:t}=Te(),{theme:n}=bd(),[r,s]=S.useState(""),[i,o]=S.useState(!0),[l,a]=S.useState(!1),[u,c]=S.useState(!1),f=n!=null&&n.is1d?"/help-1d":"/help-2d";S.useEffect(()=>{(async()=>{let x="";x=f+"/application/"+t+"/",!t&&window.location.pathname!=="/adapter"?x=f+"/application/portal/":window.location.pathname==="/adapter"?x=f+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?x=f+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(x=f+"/application/userbook/");try{const g=await fetch(x),m=await g.text();if(g.status===404){c(!0);return}s(m),c(!1)}catch(g){c(!0),console.error(g)}})()},[t,f]);const h=ds(r,{replace:x=>{const g=x;if(g.attribs&&g.attribs.id==="TOC")return d.jsxs("nav",{id:"TOC",children:[d.jsx(ze,{onClick:()=>{o(!i)},children:d.jsx(TT,{})}),ru(g.children,{replace:m=>{const v=m;if(v.attribs&&v.name==="ul")return d.jsx("ul",{id:"TOC-list",style:{display:i?"block":"none"},children:ru(v.children,{replace:b=>{const E=b;if(E.attribs&&E.name==="a")return d.jsx("a",{...Lf(E.attribs),children:d.jsx("span",{onClick:()=>{o(!1)},children:ru(E.children)})})}})})}})]});if(g.attribs&&g.attribs.class==="section level2"){const m=Lf(x.attribs);return d.jsx("div",{...m,className:"section level2",style:{display:g.attribs.id!=="présentation"?"none":"block"},children:ru(g.children,{replace:v=>{const b=v;if(b.attribs&&b.name==="img"){const E=v.attribs.src;return d.jsx("img",{...Lf(b.attribs),src:`${f}/${E}`,alt:""})}}})})}}}),y=(e=h==null?void 0:h.props)==null?void 0:e.children.find(x=>x.type==="body").props.children,w=y==null?void 0:y.find(x=>x.type==="p").props.children;return{html:r,visibility:i,isModalOpen:l,setIsModalOpen:a,parsedContent:y,parsedHeadline:w,error:u}}const LE=()=>{const[e,t]=vg(),n=S.useRef(null),r=S.useId(),{t:s}=ue();function i(){if(n.current){const o=n.current.value;window.location.href=`/searchengine#/${o}`}}return d.jsxs(_e,{id:r,ref:e,className:"position-relative","aria-haspopup":"true","aria-expanded":t,children:[d.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[d.jsx(BR,{className:"icon search"}),d.jsx("span",{className:"nav-text",children:s("navbar.search")})]}),d.jsx(jd,{id:r,isVisible:t,className:"d-none d-md-flex",children:d.jsxs(Qe,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[d.jsx(Qe.Input,{ref:n,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),d.jsx(bg,{type:"submit",size:"sm",onClick:i,"aria-label":s("navbar.search")})]})})]})};LE.displayName="SearchEngine";const k6=LE,DE=({is1d:e=!1,src:t=""})=>{const{t:n}=ue(),{messages:r,msgLink:s,zimbraWorkflow:i}=mS(),{user:o,avatar:l}=Ed(),{currentLanguage:a}=Te(),{isModalOpen:u,setIsModalOpen:c,parsedContent:f,parsedHeadline:p,error:h}=C6(),y=J("header",{"no-2d":e,"no-1d":!e}),{title:w,bookmarkedApps:x,appsRef:g,isAppsHovered:m,popoverAppsId:v,userAvatar:b,userName:E,welcomeUser:T,communityWorkflow:C,conversationWorflow:R,searchWorkflow:j,isCollapsed:L,toggleCollapsedNav:A,handleLogout:N}=ES({user:o,avatar:l}),M=r>0;return d.jsx("header",{className:y,children:e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"container-fluid",children:d.jsxs(zf,{children:[d.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:"/timeline/timeline",children:w}),d.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[d.jsx(Ws,{alt:E,size:"sm",src:b,variant:"circle",width:"32",height:"32"}),d.jsx("span",{className:"navbar-text",children:T})]}),d.jsxs(V0,{className:"gap-8","aria-hidden":"false","aria-label":n("navbar.main.navigation"),children:[R&&d.jsx(_e,{children:d.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[d.jsx(FR,{className:"icon notification"}),M&&d.jsx($f,{children:r}),d.jsx(sr,{children:n("navbar.messages")})]})}),d.jsx(_e,{children:d.jsx(Mo,{link:"/userbook/mon-compte",className:"dropdown-item",translate:n("navbar.myaccount"),children:d.jsx(p2,{className:"icon user"})})}),a==="fr"?d.jsxs(_e,{children:[d.jsxs("button",{className:"nav-link",onClick:()=>{c(!0)},children:[d.jsx(LR,{className:"icon help"}),d.jsx(sr,{children:n("navbar.help")})]}),d.jsx(U0,{isHelpOpen:u,setIsHelpOpen:c,parsedContent:f,parsedHeadline:p,error:h})]}):null,d.jsx(_e,{children:d.jsxs("button",{className:"nav-link",onClick:N,children:[d.jsx(d0,{className:"icon logout"}),d.jsx(sr,{children:n("navbar.disconnect")})]})}),d.jsx(_e,{className:"d-md-none",children:d.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!L,"aria-label":n("navbar.secondary.navigation"),onClick:A,children:d.jsx(Na,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),d.jsx(zf,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":n("navbar.secondary.navigation"),children:d.jsx("div",{className:"container-fluid",children:d.jsxs("div",{className:`collapse navbar-collapse ${L?"":"show"}`,id:"navbarCollapsed",children:[d.jsx(kh,{is1d:!0,src:`${t}/img/illustrations/logo.png`,translate:n("navbar.home")}),d.jsxs(V0,{className:"gap-8",children:[d.jsx(_e,{children:d.jsxs("a",{href:"/timeline/timeline",className:"button",children:[d.jsx(_R,{color:"#fff",className:"d-md-none"}),d.jsx("span",{className:"d-inline-block",children:n("portal.header.navigation.whatsnew")})]})}),d.jsx(_e,{children:d.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[d.jsx(UR,{color:"#fff",className:"d-md-none"}),d.jsx("span",{className:"d-inline-block",children:n("portal.header.navigation.classMembers")})]})}),d.jsx(_e,{children:d.jsxs("a",{href:"/welcome",className:"button",children:[d.jsx(f0,{color:"#fff",className:"d-md-none"}),d.jsx("span",{className:"d-inline-block",children:n("portal.header.navigation.myapps")})]})})]})]})})})]}):d.jsx(zf,{className:"navbar-expand-md",children:d.jsxs("div",{className:"container-fluid",children:[d.jsx(kh,{src:`${t}/img/illustrations/logo.png`}),d.jsx("a",{href:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:w}),d.jsxs("ul",{className:"navbar-nav",children:[d.jsx(_e,{children:d.jsx(Mo,{link:"/timeline/timeline",translate:n("navbar.home"),children:d.jsx(PR,{color:"#fff"})})}),d.jsxs(_e,{className:"position-relative",ref:g,id:v,"aria-haspopup":"true","aria-expanded":m,children:[d.jsx(Mo,{link:"/welcome",translate:n("navbar.applications"),children:d.jsx(f0,{color:"#fff"})}),d.jsxs(jd,{className:"top-100 widget",id:v,isVisible:m,children:[d.jsx(kE,{children:d.jsx(E6,{bookmarkedApps:x})}),d.jsx(TE,{className:"widget-footer border-top border-ghost",children:d.jsx(S6,{})})]})]}),R&&d.jsx(_e,{children:d.jsxs(Mo,{className:"position-relative",link:"/conversation/conversation",translate:n("conversation"),children:[d.jsx(p0,{color:"#fff"}),M&&d.jsx($f,{children:r})]})}),i&&d.jsx(_e,{children:d.jsxs(Mo,{className:"position-relative",link:s,translate:n("conversation"),children:[d.jsx(p0,{color:"#fff"}),M&&d.jsx($f,{children:r})]})}),a==="fr"?d.jsxs(_e,{children:[d.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{c(!0)},children:[d.jsx(NR,{color:"#fff"}),d.jsx(sr,{children:n("support")})]}),d.jsx(U0,{isHelpOpen:u,setIsHelpOpen:c,parsedContent:f,parsedHeadline:p,error:h})]}):null,d.jsx(_e,{children:d.jsxs("div",{className:"dropdown",children:[d.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!L,"aria-label":n("navbar.open.menu"),onClick:A,children:d.jsx(Na,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),d.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${L?"":"show"}`,id:"dropdown-navbar",children:[C&&d.jsx(_e,{children:d.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[d.jsx(kR,{className:"icon community"}),d.jsx("span",{className:"nav-text",children:n("navbar.community")})]})}),j?d.jsx(k6,{}):null,d.jsx(_e,{children:d.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[d.jsx(Ws,{alt:E,size:"sm",src:b,variant:"circle",className:"bg-white",width:"32",height:"32"}),d.jsx("span",{className:"nav-text",children:n("navbar.myaccount")})]})}),d.jsx(_e,{children:d.jsx("hr",{className:"dropdown-divider"})}),d.jsx(_e,{children:d.jsxs("a",{href:"/auth/logout?callback=",className:"nav-link dropdown-item",children:[d.jsx(d0,{className:"icon logout"}),d.jsx("span",{id:"logout-label",className:"nav-text",children:n("navbar.disconnect")})]})})]})]})})]})]})})})};DE.displayName="Header";const T6=DE;function FE({children:e,className:t,...n}){const r=J("container-fluid",t);return d.jsx("main",{className:r,...n,children:e})}FE.displayName="Main";const $E=({children:e,...t})=>{const{theme:n}=bd();return d.jsxs(d.Fragment,{children:[d.jsx(T6,{is1d:n==null?void 0:n.is1d,src:n==null?void 0:n.basePath}),d.jsx(FE,{className:J("d-flex flex-column bg-white",{"rounded-4 border":n==null?void 0:n.is1d,"mt-24":n==null?void 0:n.is1d}),...t,children:e}),d.jsx(Hj,{toastOptions:{position:"top-right"}})]})};$E.displayName="Layout";const zE=$E,j6=({children:e})=>d.jsx("div",{className:"widget-footer",children:d.jsx("div",{className:"widget-footer-action",children:d.jsx("a",{href:"/welcome",className:"link",children:e})})}),P6=({children:e})=>d.jsxs("div",{className:"widget-header",children:[d.jsx("div",{className:"subtitle",children:e}),d.jsx("div",{className:"widget-options",children:d.jsx("div",{className:"widget-handle",children:d.jsx("i",{className:"fas fa-grip-vertical"})})})]}),O6=({children:e})=>d.jsx("div",{className:"widget-body p-12 d-flex flex-wrap",children:e});function Sl({children:e}){return d.jsx("div",{className:"widget",children:e})}Sl.Header=P6;Sl.Body=O6;Sl.Footer=j6;Sl.displayName="Widget";const BE=({data:e})=>e.length>0?e.slice(0,6).map((t,n)=>d.jsx("a",{href:t.address,className:"bookmarked-app",children:d.jsx(qs,{app:t,size:"32"})},n)):d.jsx("div",{className:"text-dark mx-auto",children:d.jsx("a",{href:"/welcome",children:"Sélectionner vos applications favorites"})});BE.displayName="BookmarkedApps";const R6=BE,N6=Object.freeze(Object.defineProperty({__proto__:null,ActionBar:nI,Alert:Vr,AppHeader:cS,AppIcon:qs,Avatar:Ws,BookmarkedApps:R6,Breadcrumb:FS,Button:ze,Card:gI,Checkbox:Cd,Column:Eg,Combobox:pE,Dropdown:Ee,EmptyScreen:OI,FormControl:Qe,FormText:ZS,Grid:Ri,Heading:an,IconButton:hr,Image:ho,ImagePicker:Cg,Input:rs,Label:_s,Layout:zE,Library:RI,Loading:xg,LoadingScreen:_t,Logo:kh,Modal:Re,OdeClientContext:hg,OdeClientProvider:fS,OnboardingModal:HI,Popover:jd,PopoverBody:kE,PopoverFooter:TE,PopoverHeader:LI,PublishModal:n6,Radio:Nc,ResourceModal:a6,SearchButton:bg,Select:Tg,ShareModal:b6,TextArea:jg,ThemeContext:mg,ThemeProvider:pS,Tooltip:OE,TreeView:IE,VisuallyHidden:sr,Widget:Sl,isActionAvailable:Ac,libraryMaps:wg,useBookmark:hS,useClickOutside:gg,useConf:pg,useConversation:mS,useDebounce:wS,useDropdown:dE,useDropzone:SS,useHasWorkflow:Oi,useHeader:ES,useHover:vg,useImage:gS,useIsAdml:CS,useKeyPress:vS,useLibraryUrl:oI,useOdeClient:Te,useOdeIcons:Sd,useOdeTheme:bd,usePaths:Ys,useScrollToTop:bS,useSession:dS,useTitle:yS,useToast:ht,useToggle:yg,useTrapFocus:xS,useUser:Ed,useXitiTrackPageLoad:kS},Symbol.toStringTag,{value:"Module"}));var A6=function(){return null},VE,H0=vr;VE=H0.createRoot,H0.hydrateRoot;const ps=document.querySelector("[data-explorer-config]");let q0;function I6(){var e;if((e=ps==null?void 0:ps.dataset)!=null&&e.explorerConfig){const{explorerConfig:t}=ps.dataset;try{const n=JSON.parse(t);q0=Object.assign({},n)}catch(n){console.error("[Explorer Config] could not parse app params from root data attributes:",ps==null?void 0:ps.dataset,n)}}return q0}const W0=e=>{let t;const n=new Set,r=(a,u)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(p=>p(t,f))}},s=()=>t,l={setState:r,getState:s,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return t=e(r,s,l),l},_6=e=>e?W0(e):W0;var UE={exports:{}},HE={},qE={exports:{}},WE={};/**
|
|
221
|
+
`,I0="/",_0="*",gs="",EA="comment",CA="declaration",kA=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(y){var w=y.match(mA);w&&(n+=w.length);var x=y.lastIndexOf(SA);r=~x?y.length-x:r+y.length}function i(){var y={line:n,column:r};return function(w){return w.position=new o(y),u(),w}}function o(y){this.start=y,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(y){var w=new Error(t.source+":"+n+":"+r+": "+y);if(w.reason=y,w.filename=t.source,w.line=n,w.column=r,w.source=e,!t.silent)throw w}function a(y){var w=y.exec(e);if(w){var x=w[0];return s(x),e=e.slice(x.length),w}}function u(){a(gA)}function c(y){var w;for(y=y||[];w=f();)w!==!1&&y.push(w);return y}function f(){var y=i();if(!(I0!=e.charAt(0)||_0!=e.charAt(1))){for(var w=2;gs!=e.charAt(w)&&(_0!=e.charAt(w)||I0!=e.charAt(w+1));)++w;if(w+=2,gs===e.charAt(w-1))return l("End of comment missing");var x=e.slice(2,w-2);return r+=2,s(x),e=e.slice(w),r+=2,y({type:EA,comment:x})}}function p(){var y=i(),w=a(vA);if(w){if(f(),!a(yA))return l("property missing ':'");var x=a(wA),g=y({type:CA,property:M0(w[0].replace(A0,gs)),value:x?M0(x[0].replace(A0,gs)):gs});return a(xA),g}}function h(){var y=[];c(y);for(var w;w=p();)w!==!1&&(y.push(w),c(y));return y}return u(),h()};function M0(e){return e?e.replace(bA,gs):gs}var TA=kA;function tS(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,s=TA(e),i=typeof t=="function",o,l,a=0,u=s.length;a<u;a++)r=s[a],o=r.property,l=r.value,i?t(o,l,r):l&&(n||(n={}),n[o]=l);return n}fg.exports=tS;fg.exports.default=tS;var jA=fg.exports,wd={};wd.__esModule=!0;wd.camelCase=void 0;var PA=/^--[a-zA-Z0-9-]+$/,OA=/-([a-z])/g,RA=/^[^-]+$/,NA=/^-(webkit|moz|ms|o|khtml)-/,AA=/^-(ms)-/,IA=function(e){return!e||RA.test(e)||PA.test(e)},_A=function(e,t){return t.toUpperCase()},L0=function(e,t){return"".concat(t,"-")},MA=function(e,t){return t===void 0&&(t={}),IA(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(AA,L0):e=e.replace(NA,L0),e.replace(OA,_A))};wd.camelCase=MA;(function(e){var t=lt&<.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};e.__esModule=!0;var n=t(jA),r=wd;function s(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,u){a&&u&&(l[(0,r.camelCase)(a,o)]=u)}),l}e.default=s})(eS);var LA=S,DA=eS.default;function FA(e,t){if(!e||typeof e!="object")throw new TypeError("First argument must be an object");var n,r,s=typeof t=="function",i={},o={};for(n in e){if(r=e[n],s&&(i=t(n,r),i&&i.length===2)){o[i[0]]=i[1];continue}typeof r=="string"&&(o[r]=n)}return o}function $A(e,t){if(e.indexOf("-")===-1)return t&&typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zA={reactCompat:!0};function BA(e,t){if(e!=null)try{t.style=DA(e,zA)}catch{t.style={}}}var VA=LA.version.split(".")[0]>=16,nS=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function UA(e){return!nS.has(e.name)}var rS={PRESERVE_CUSTOM_ATTRIBUTES:VA,invertObject:FA,isCustomComponent:$A,setStyleProp:BA,canTextBeChildOfNode:UA,elementsWithNoTextChildren:nS},Uo=hn,D0=rS,HA=["checked","value"],qA=["input","select","textarea"],WA={reset:!0,submit:!0},sS=function(t,n){t=t||{};var r,s,i,o,l,a={},u=t.type&&WA[t.type];for(r in t){if(i=t[r],Uo.isCustomAttribute(r)){a[r]=i;continue}if(s=r.toLowerCase(),o=F0(s),o){switch(l=Uo.getPropertyInfo(o),HA.indexOf(o)!==-1&&qA.indexOf(n)!==-1&&!u&&(o=F0("default"+s)),a[o]=i,l&&l.type){case Uo.BOOLEAN:a[o]=!0;break;case Uo.OVERLOADED_BOOLEAN:i===""&&(a[o]=!0);break}continue}D0.PRESERVE_CUSTOM_ATTRIBUTES&&(a[r]=i)}return D0.setStyleProp(t.style,a),a};function F0(e){return Uo.possibleStandardNames[e]}var GA=S,QA=sS,Rc=rS,KA=Rc.setStyleProp,XA=Rc.canTextBeChildOfNode;function iS(e,t){t=t||{};for(var n=t.library||GA,r=n.cloneElement,s=n.createElement,i=n.isValidElement,o=[],l,a,u=typeof t.replace=="function",c,f,p,h=t.trim,y=0,w=e.length;y<w;y++){if(l=e[y],u&&(c=t.replace(l),i(c))){w>1&&(c=r(c,{key:c.key||y})),o.push(c);continue}if(l.type==="text"){if(a=!l.data.trim().length,a&&l.parent&&!XA(l.parent)||h&&a)continue;o.push(l.data);continue}switch(f=l.attribs,YA(l)?KA(f.style,f):f&&(f=QA(f,l.name)),p=null,l.type){case"script":case"style":l.children[0]&&(f.dangerouslySetInnerHTML={__html:l.children[0].data});break;case"tag":l.name==="textarea"&&l.children[0]?f.defaultValue=l.children[0].data:l.children&&l.children.length&&(p=iS(l.children,t));break;default:continue}w>1&&(f.key=y),o.push(s(l.name,f,p))}return o.length===1?o[0]:o}function YA(e){return Rc.PRESERVE_CUSTOM_ATTRIBUTES&&e.type==="tag"&&Rc.isCustomComponent(e.name,e.attribs)}var JA=iS,xd=rg,wi=J8,ZA=sS,oS=JA;wi=typeof wi.default=="function"?wi.default:wi;var e6={lowerCaseAttributeNames:!1};function Wn(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");return e===""?[]:(t=t||{},oS(wi(e,t.htmlparser2||e6),t))}Wn.domToReact=oS;Wn.htmlToDOM=wi;Wn.attributesToProps=ZA;Wn.Comment=xd.Comment;Wn.Element=xd.Element;Wn.ProcessingInstruction=xd.ProcessingInstruction;Wn.Text=xd.Text;var t6=Wn;Wn.default=Wn;const ds=il(t6);var ru=ds.domToReact;ds.htmlToDOM;var Lf=ds.attributesToProps;ds.Comment;ds.Element;ds.ProcessingInstruction;ds.Text;const aS=S.forwardRef(({children:e},t)=>d.jsx("div",{ref:t,className:"actionbar",children:e}));aS.displayName="ActionBar";const n6=aS,lS=S.forwardRef(({type:e="success",className:t="",children:n,button:r,isDismissible:s=!1,isToast:i=!1,autoClose:o=!1,autoCloseDelay:l=3e3,onClose:a,onVisibilityChange:u},c)=>{const[f,p]=S.useState(!0),h=S.useRef(null),y=S.useCallback(()=>{p(!1),a==null||a()},[a]);S.useImperativeHandle(c,()=>({show:w,hide:y,...h.current})),S.useLayoutEffect(()=>{u==null||u(f)},[f,u]),S.useEffect(()=>{o&&f&&setTimeout(()=>{y()},l)},[o,l,y,f]);const w=()=>{p(!0)},x={success:{icon:d.jsx(i5,{}),classModifier:"alert-success"},warning:{icon:d.jsx(wT,{}),classModifier:"alert-warning"},info:{icon:d.jsx(lb,{}),classModifier:"alert-info"},danger:{icon:d.jsx(_T,{}),classModifier:"alert-danger"}},g={"is-dismissible":s,"is-toast ":i},m=J("alert gap-12",x[e].classModifier,g,t);return d.jsx(d.Fragment,{children:f?d.jsxs("div",{ref:h,className:m,role:"alert",children:[x[e].icon,d.jsx("div",{className:"alert-content small",children:n}),r&&d.jsx("div",{className:"ms-12",children:r}),s&&d.jsx("div",{className:"btn-close-container",children:d.jsx("button",{type:"button",className:"btn btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:y})}),o&&d.jsx("div",{className:"alert-progress",style:{transform:"scaleX(0)"}})]}):null})});lS.displayName="Alert";const Vr=lS,uS=S.forwardRef(({children:e,render:t,isFullscreen:n=!1},r)=>{const s=J("d-flex flex-wrap p-16 gap-8 border-bottom bg-white",{"justify-content-between":t,"mx-n16":!n,"z-3 top-0 start-0 end-0 position-fixed":n});return d.jsxs("div",{ref:r,className:s,children:[e,t?d.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:t()}):null]})});uS.displayName="AppHeader";const cS=uS;function pg({appCode:e}){return Ih({queryKey:["conf"],queryFn:async()=>await ae.conf().getConf(e),suspense:!0})}function dS(){return Ih({queryKey:["session"],queryFn:async()=>await ae.session().getSession(),suspense:!0})}const hg=S.createContext(null);function fS({children:e,params:t}){const n=t.app,{t:r}=ue(),s=r(n),i=dS(),o=pg({appCode:n}),l=(o==null?void 0:o.isSuccess)&&(i==null?void 0:i.isSuccess);S.useEffect(()=>{var u,c;(c=document.querySelector("html"))==null||c.setAttribute("lang",((u=i==null?void 0:i.data)==null?void 0:u.currentLanguage)||"fr")},[i==null?void 0:i.data]),S.useEffect(()=>{document.title=`${s}`},[n,i.data,s]);const a=S.useMemo(()=>{var u,c,f,p,h,y;return{appCode:n,applications:(u=o==null?void 0:o.data)==null?void 0:u.applications,confQuery:o,currentApp:(c=o==null?void 0:o.data)==null?void 0:c.currentApp,currentLanguage:(f=i==null?void 0:i.data)==null?void 0:f.currentLanguage,init:l,sessionQuery:i,user:(p=i==null?void 0:i.data)==null?void 0:p.user,userDescription:(h=i==null?void 0:i.data)==null?void 0:h.userDescription,userProfile:(y=i==null?void 0:i.data)==null?void 0:y.userProfile}},[n,o,l,i]);return d.jsx(hg.Provider,{value:a,children:e})}function Te(){const e=S.useContext(hg);if(!e)throw new Error("Cannot be used outside of OdeClientProvider");return e}const mg=S.createContext(null);function pS({children:e}){var t;const{appCode:n}=Te(),r=pg({appCode:n});S.useEffect(()=>{var i,o,l,a,u,c,f,p,h;const y=document.getElementById("favicon");y.href=`${(o=(i=r==null?void 0:r.data)==null?void 0:i.theme)==null?void 0:o.basePath}/img/illustrations/favicon.ico`;const w=(u=(a=(l=r==null?void 0:r.data)==null?void 0:l.theme)==null?void 0:a.bootstrapVersion)==null?void 0:u.split("-"),x=w?w[w.length-1]:void 0;[{data:"data-skin",value:(f=(c=r==null?void 0:r.data)==null?void 0:c.theme)==null?void 0:f.skinName},{data:"data-theme",value:(h=(p=r==null?void 0:r.data)==null?void 0:p.theme)==null?void 0:h.themeName},{data:"data-product",value:x}].forEach(m=>{var v;return(v=document.querySelector("html"))==null?void 0:v.setAttribute(m.data,m.value)})},[r==null?void 0:r.data]);const s=S.useMemo(()=>{var i;return{theme:(i=r==null?void 0:r.data)==null?void 0:i.theme}},[(t=r==null?void 0:r.data)==null?void 0:t.theme]);return d.jsx(mg.Provider,{value:s,children:e})}function bd(){const e=S.useContext(mg);if(!e)throw new Error("Cannot be used outside of OdeClientProvider");return e}function hS(){var e;const{sessionQuery:t}=Te(),n=new Set;return(e=t==null?void 0:t.data)==null?void 0:e.bookmarkedApps.filter(s=>{const i=n.has(s.displayName);return n.add(s.displayName),!i})}function Oi(e){const[t,n]=S.useState();return S.useEffect(()=>{(async()=>{let r;typeof e=="string"?r=await ae.rights().sessionHasWorkflowRight(e):await ae.rights().sessionHasWorkflowRights(e),n(r)})()},[e]),t}const r6=()=>{const e=Oi("fr.openent.zimbra.controllers.ZimbraController|view"),t=Oi("fr.openent.zimbra.controllers.ZimbraController|preauth"),[n,r]=S.useState(0),[s,i]=S.useState(""),o=S.useCallback(async()=>{if(e)try{const a=await ae.http().get("/zimbra/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});a.status!==200&&r(0),r(a.count)}catch{console.error("error"),r(0)}else try{const a=await ae.http().get("/conversation/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});r(a.count)}catch{console.error("error"),r(0)}},[e]),l=S.useCallback(()=>{let a="";ae.http().get("/userbook/preference/zimbra").then(u=>{try{u.preference&&JSON.parse(u.preference).modeExpert&&t?a="/zimbra/preauth":a=window.location.origin+"/zimbra/zimbra"}catch{a="/zimbra/zimbra"}}),i(a)},[t]);return S.useEffect(()=>{(async()=>{try{await o()}catch(a){console.error(a)}})(),l()},[l,o]),{messages:n,msgLink:s,zimbraWorkflow:e}},mS=r6,$0=["mousedown","touchstart"];function gg(e,t,n){const r=S.useRef();return S.useEffect(()=>{const s=i=>{const{target:o}=i??{};if(Array.isArray(n)){const l=(o==null?void 0:o.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(o)&&o.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(o)&&e()};return(t||$0).forEach(i=>{document.addEventListener(i,s)}),()=>{(t||$0).forEach(i=>{document.removeEventListener(i,s)})}},[r,e,n,t]),r}const su="top-right";function ht(){return{success:(t,n)=>Oo.custom(d.jsx(Vr,{type:"success",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),error:(t,n)=>Oo.custom(d.jsx(Vr,{type:"danger",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),info:(t,n)=>Oo.custom(d.jsx(Vr,{type:"info",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),warning:(t,n)=>Oo.custom(d.jsx(Vr,{type:"warning",isToast:!0,isDismissible:n==null?void 0:n.isDismissible,className:"mb-12",children:t}),{duration:n==null?void 0:n.duration,position:(n==null?void 0:n.position)??su}),loading:Oo.loading}}function vg(){const[e,t]=S.useState(!1),n=S.useRef(null),r=()=>{t(!0)},s=()=>{t(!1)};return S.useEffect(()=>{const i=n.current;if(i)return i.addEventListener("mouseover",r),i.addEventListener("mouseout",s),()=>{i.removeEventListener("mouseover",r),i.removeEventListener("mouseout",s)}},[n]),[n,e]}function gS({src:e,placeholder:t}){const[n,r]=S.useState(e||t),s=S.useCallback(()=>{r(t)},[t]);return S.useEffect(()=>{r(e)},[e]),{imgSrc:n,onError:s}}function vS(e,t){const n=S.useCallback(({code:r})=>{t.includes(r)&&e()},[e,t]);S.useEffect(()=>(window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}),[n])}function yS(){const e=typeof document<"u",[t,n]=S.useState(()=>document.title);return S.useEffect(()=>{e&&n(document.title)},[e]),t}function yg(e=!1){const[t,n]=S.useState(e),r=S.useCallback(()=>{n(s=>!s)},[]);return[t,r]}function wS(e,t){const[n,r]=S.useState(e);return S.useEffect(()=>{const s=setTimeout(()=>{r(e)},t||500);return()=>{clearTimeout(s)}},[e,t]),n}function xS(){const e=S.useRef(null),t='button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';return S.useEffect(()=>{const n=e.current,r=n.querySelectorAll(t)[0],s=n.querySelectorAll(t),i=e&&(s==null?void 0:s[s.length-1]),o=l=>{l.key==="Tab"&&(l.shiftKey?document.activeElement===r&&(i.focus(),l.preventDefault()):document.activeElement===i&&(r.focus(),l.preventDefault()))};if(n)return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}},[]),e}function bS(){const e=document.querySelector("html");return()=>{e&&e.scrollIntoView()}}const s6=(e,t)=>{const[,n]=S.useState(!1),r=S.useCallback(o=>{o.preventDefault(),o.stopPropagation(),n(!0)},[]),s=o=>{o.preventDefault(),o.stopPropagation(),n(!1)};return{handleDragging:r,handleDragLeave:s,handleDrop:o=>{var l;s(o);const a=(l=o.dataTransfer)==null?void 0:l.files;t(a),e!=null&&e.current&&a&&(e.current.files=a)}}},SS=s6;function ES({user:e,avatar:t}){const{t:n}=ue(),r=yS(),[s,i]=S.useState(!0),[o,l]=vg(),a=S.useId(),u=S.useId(),c=t,f=e==null?void 0:e.username,p=n("welcome",{username:e==null?void 0:e.firstName}),h=hS(),y=Oi("net.atos.entng.community.controllers.CommunityController|view"),w=Oi("org.entcore.conversation.controllers.ConversationController|view"),x=Oi("fr.openent.searchengine.controllers.SearchEngineController|view"),g=S.useCallback(()=>{i(!s)},[s]),m=async()=>{await ae.session().logout(),window.location.href="/auth/login"};return S.useMemo(()=>({title:r,bookmarkedApps:h,appsRef:o,isAppsHovered:l,popoverAppsId:a,popoverSearchId:u,userAvatar:c,userName:f,welcomeUser:p,communityWorkflow:y,conversationWorflow:w,searchWorkflow:x,isCollapsed:s,toggleCollapsedNav:g,handleLogout:m}),[o,h,y,w,l,s,a,u,x,r,g,c,f,p])}function CS(){const[e,t]=S.useState(!1);S.useEffect(()=>{n()},[]);const n=S.useCallback(async()=>{const r=await ae.session().isAdml();t(r)},[]);return{isAdml:e}}const wg={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"},i6=()=>{var e;const{user:t,appCode:n}=Te(),r=wg[n],s=(e=t.apps.find(u=>u.isExternal&&u.address.includes("library")&&u.name.includes("library")))==null?void 0:e.address.split("?");let i=s==null?void 0:s[0];i!=null&&i.endsWith("/")||(i=`${i}/`);const o=s==null?void 0:s[1],l=`application%5B0%5D=${r}&page=1&sort_field=views&sort_order=desc`;return{libraryUrl:`${i}search/?${o}&${l}`}},o6=i6;function Sd(){const e={"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 t(l){let a="";switch(a=(l==null?void 0:l.icon)!==void 0?l==null?void 0:l.icon.trim().toLowerCase():"placeholder",a&&a.length>0?a.endsWith("-large")&&(a=a.replace("-large","")):a=(l==null?void 0:l.displayName)!==void 0?l==null?void 0:l.displayName.trim().toLowerCase():"",a){case"admin.title":a="admin";break;case"banques des savoirs":a="banquesavoir";break;case"collaborativewall":a="collaborative-wall";break;case"communautés":a="community";break;case"directory.user":a="userbook";break;case"emploi du temps":a="edt";break;case"messagerie":a="conversation";break;case"news":a="actualites";break;case"homeworks":case"cahier de texte":a="cahier-de-texte";break;case"diary":case"cahier de texte 2d":a="cahier-textes";break}return a}function n(l){return l&&(l.startsWith("/")||l.startsWith("http://")||l.startsWith("https://"))}function r(l){const a=t(l);return a?`color-app-${a}`:"color-app-placeholder"}function s(l){const a=t(l);return a?`bg-app-${a}`:"bg-app-placeholder"}function i(l){const a=t(l);return a?`bg-light-${a}`:"bg-light-placeholder"}function o(l){return e[l.platformConf.name]}return{getIconClass:r,getBackgroundIconClass:s,getBackgroundLightIconClass:i,getIconCode:t,getWidgetIconClass:o,isIconUrl:n}}function Ys(){return["/assets/themes/edifice-bootstrap/images","/assets/themes/edifice-bootstrap/icons","/assets/themes/edifice-bootstrap/fonts"]}function Ed(){const{user:e,userDescription:t,userProfile:n}=Te(),{theme:r}=bd();function s(){let i=t==null?void 0:t.picture;return(!i||i==="no-avatar.jpg"||i==="no-avatar.svg")&&(i=`${r==null?void 0:r.basePath}/img/illustrations/no-avatar.svg`),i}return{user:{...e,type:n},avatar:s(),userDescription:t}}function kS(){const[e,t]=S.useState("pending"),{currentApp:n}=Te();S.useEffect(()=>{r()},[]);const r=async()=>{if(!n){t("[Xiti] Error, currentApp is not defined.");return}try{await ae.analytics().trackPageLoad(window.location.pathname,n),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),t(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(s){console.error("[Xiti] Error Tracking Page Load",s),t(`[Xiti] Error Tracking Page Load: ${s}`)}};return{xitiStatus:e}}const TS=S.forwardRef(({src:e,alt:t,imgPlaceholder:n,ratio:r,objectFit:s,className:i,...o},l)=>{const[a]=Ys(),u=n??`${a}/common/image-placeholder.png`,{imgSrc:c,onError:f}=gS({src:e,placeholder:u}),p={"ratio ratio-1x1":r==="1","ratio ratio-4x3":r==="4","ratio ratio-16x9":r==="16","ratio ratio-21x9":r==="21"},h={"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"},y=J({...p}),w=J({...h},i),x=d.jsx("img",{alt:t,onError:f,ref:l,src:c,className:w,...o});return r?d.jsx("div",{className:y,children:x}):x});TS.displayName="Image";const ho=TS,jS=S.forwardRef(({app:e,size:t="24",iconFit:n="contain",variant:r="square"},s)=>{const{isIconUrl:i,getIconCode:o}=Sd(),[,l]=Ys(),a=r==="square",u=r==="rounded",c=r==="circle",f=n==="contain",p=n==="ratio",h={"icon-xs":t==="24","icon-sm":t==="40","icon-md":t==="48","icon-lg":t==="80","icon-xl":t==="160"},y={square:a,rounded:u,"rounded-circle":c},w={"icon-contain":f,"icon-ratio":p},x=(e==null?void 0:e.icon)!==void 0?e.icon:"placeholder",g=(e==null?void 0:e.displayName)!==void 0?e.displayName:"",m=e?o(e):"",v=i(x),b=m||"placeholder",E=J("app-icon",{...h,...y,...w,[`bg-light-${b}`]:b&&!f,[`color-app-${b}`]:b});return v?d.jsx(ho,{src:x,alt:g,objectFit:"contain",width:t,height:t,className:"h-full"}):d.jsx("div",{className:E,style:{width:t+"px",height:t+"px"},children:d.jsx("svg",{ref:s,width:t,height:t,role:"img",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:d.jsx("use",{xlinkHref:`${l}/apps.svg#${b}`})})})});jS.displayName="AppIcon";const qs=jS,PS=S.forwardRef(({variant:e="square",size:t="md",alt:n,src:r,imgPlaceholder:s,className:i,...o},l)=>{const[a]=Ys(),u=s||`${a}/avatar/no-avatar.svg`,w=J("avatar",{...{"avatar-xs":t==="xs","avatar-sm":t==="sm","avatar-md":t==="md","avatar-lg":t==="lg","avatar-xl":t==="xl"},...{square:e==="square",rounded:e==="rounded","rounded-circle":e==="circle"}},i);return d.jsx("div",{ref:l,className:w,children:d.jsx(ho,{src:r||u,alt:n,imgPlaceholder:u,...o})})});PS.displayName="Avatar";const Ws=PS,OS=S.forwardRef(({children:e,className:t,...n},r)=>{const s=J("breadcrumb-item",t);return d.jsx("li",{ref:r,className:s,...n,children:e})});OS.displayName="BreadcrumbItem";const Df=OS,RS=S.forwardRef(({children:e,className:t},n)=>{const r=J("breadcrumb d-flex flex-nowrap align-items-center mb-0",t);return d.jsx("ol",{ref:n,className:r,children:e})});RS.displayName="BreadcrumbList";const a6=RS,NS=S.forwardRef(({children:e,app:t,className:n},r)=>{const{t:s}=ue(),{getIconClass:i}=Sd(),o=J("d-flex align-items-center mb-0",i(t),n),l={"--edifice-breadcrumb-divider":"-"};return d.jsx("nav",{ref:r,className:o,"aria-label":s("breadcrumb"),style:l,children:e})});NS.displayName="BreadcrumbNav";const l6=NS,AS=S.forwardRef((e,t)=>{const{isLoading:n,loadingIcon:r,loadingPosition:s="left",children:i,...o}=e,l=()=>{let u;return r?u=r:u=d.jsx(UT,{...o,"aria-label":"Loading"}),u},a=J("loading",{"is-loading":n});return d.jsxs("div",{className:a,role:"status",ref:t,children:[(!s||s==="left")&&l(),i,s==="right"&&l()]})});AS.displayName="Loading";const xg=AS,IS=S.forwardRef(({color:e="primary",type:t="button",size:n="md",children:r,isLoading:s,loadingIcon:i,loadingPosition:o,leftIcon:l,rightIcon:a,className:u,variant:c="filled",...f},p)=>{const h=J("btn",{[`btn-filled btn-${e}`]:c==="filled",[`btn-${c}-${e}`]:c==="outline"||c==="ghost","btn-icon":!r,"btn-loading":s,"btn-lg":n==="lg","btn-sm":n==="sm"},u);return d.jsx("button",{ref:p,className:h,type:t,...f,children:s?d.jsx(xg,{isLoading:!0,loadingIcon:i,loadingPosition:o,children:r}):d.jsxs("span",{children:[l,r,a]})})});IS.displayName="Button";const ze=IS,_S=S.forwardRef(({icon:e,className:t,...n},r)=>{const s={...n,className:J("btn-icon btn-sm",t)};return d.jsx(ze,{ref:r,...s,children:e})});_S.displayName="IconButton";const hr=_S,MS=S.forwardRef(({icon:e=d.jsx(r5,{}),onClick:t,...n},r)=>{const s=J("btn-search");return d.jsx(hr,{ref:r,className:s,icon:e,...n,onClick:t})});MS.displayName="SearchButton";const bg=MS,LS=S.forwardRef(({level:e="h1",headingStyle:t="h1",children:n,className:r,...s},i)=>{const o=J(t,r);return d.jsx(e,{ref:i,className:o,...s,children:n})});LS.displayName="Heading";const an=LS,DS=S.forwardRef(({app:e,name:t},n)=>{const{t:r}=ue();return d.jsx(l6,{app:e,ref:n,className:"mw-100",children:d.jsx(a6,{className:"gap-12 mw-100",children:t?d.jsxs(d.Fragment,{children:[d.jsx(Df,{children:d.jsxs("a",{href:e==null?void 0:e.address,className:"d-flex",children:[d.jsx(hr,{variant:"ghost",color:"tertiary",icon:d.jsx(XT,{}),"aria-label":r(e==null?void 0:e.displayName)}),d.jsx(qs,{app:e,size:"40"})]})}),d.jsx(Df,{className:"text-truncate",children:d.jsx(an,{level:"h1",headingStyle:"h3",className:"text-truncate",children:t})})]}):d.jsxs(Df,{className:"gap-12 d-flex align-items-center",children:[d.jsx(qs,{app:e,size:"40"}),d.jsx(an,{level:"h1",headingStyle:"h3",className:"d-none d-md-flex",children:r(e==null?void 0:e.displayName)})]})})})});DS.displayName="Breadcrumb";const FS=DS,$S=({children:e,space:t=null,flexDirection:n="row"})=>{const r=J("card-body",{"p-8":t==="8","gap-8":t==="8","align-items-start":n==="column","flex-column":n==="column"});return d.jsx("div",{className:r,children:e})};$S.displayName="Card.Body";const u6=$S,Sg=S.createContext(null);Sg.displayName="CardContext";const zS=()=>{const e=S.useContext(Sg);if(!e)throw new Error("Cannot be rendered outside the Card component");return e},BS=({children:e})=>d.jsx("div",{className:"card-footer gap-16",children:e});BS.displayName="Card.Footer";const c6=BS,VS=()=>{const{isSelectable:e,isClickable:t,onClick:n,onSelect:r}=zS();return d.jsxs("div",{className:"card-header",children:[e?d.jsx(hr,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:d.jsx(qT,{}),onClick:r,variant:"ghost"}):null,t?d.jsx("button",{onClick:n,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}):null]})};VS.displayName="Card.Header";const d6=VS,US=({imageSrc:e,className:t,variant:n="medium"})=>{const{app:r}=zS(),s=n==="landscape"?{width:"100%",height:"auto"}:null;return d.jsx("div",{className:J("card-image",n),children:e?d.jsx(ho,{alt:"",src:e,objectFit:"cover",className:J("h-full",t)}):d.jsx(qs,{app:r,iconFit:"ratio",size:"80",variant:"rounded",...s})})};US.displayName="Card.Image";const f6=US,HS=({children:e,className:t})=>{const n=J("card-text small text-break text-truncate text-truncate-1",t);return d.jsx("p",{className:n,children:e})};HS.displayName="Card.Text";const p6=HS,qS=({children:e,className:t})=>{const n=J("card-title body text-break text-truncate text-truncate-1",t);return d.jsx("h3",{className:n,children:d.jsx("strong",{children:e})})};qS.displayName="Card.Title";const h6=qS,WS=({userSrc:e,creatorName:t})=>e?d.jsx(Ws,{alt:t||"",size:"xs",src:e,variant:"circle",width:"24",height:"24"}):d.jsx(p2,{});WS.displayName="Card.User";const m6=WS,GS=S.forwardRef(({app:e,isSelectable:t=!0,isClickable:n=!0,isSelected:r=!1,onClick:s,onSelect:i,children:o,className:l},a)=>{const{getIconCode:u}=Sd(),c=e?u(e):"placeholder",f=S.useMemo(()=>({app:e,appCode:c,isSelectable:t,isClickable:n,onClick:s,onSelect:i}),[e,c,t,n,s,i]);return d.jsx(Sg.Provider,{value:f,children:d.jsxs("div",{ref:a,className:J("card",{"is-selected":r},l),children:[d.jsx(QS.Header,{}),typeof o=="function"?o(c):o]})})});GS.displayName="Card";const QS=Object.assign(GS,{Title:h6,Text:p6,Image:f6,Body:u6,User:m6,Footer:c6,Header:d6}),g6=QS,KS=S.forwardRef(({label:e,disabled:t=!1,checked:n=!1,indeterminate:r=!1,...s},i)=>{const o=S.useRef(null);S.useImperativeHandle(i,()=>({...o.current})),S.useEffect(()=>{o.current.indeterminate=r},[o,r]);const l=S.useId(),a={type:"checkbox",checked:n,disabled:t,ref:o,className:J(s.className,"form-check-input c-pointer"),id:l},u={...s,...a};return d.jsxs("div",{className:"form-check d-flex align-items-center gap-8",children:[d.jsx("input",{...u}),e&&d.jsx("label",{className:"form-check-label",htmlFor:u.id,children:e})]})});KS.displayName="Checkbox";const Cd=KS,XS=S.createContext(null),mo=()=>{const e=S.useContext(XS);if(!e)throw new Error("Cannot be rendered outside the Dropdown Component");return e},YS=S.createContext(null),kd=()=>{const e=S.useContext(YS);if(!e)throw new Error("Cannot be rendered outside the FormControl component");return e},JS=({children:e})=>{const{status:t}=kd(),n=J("form-text",{"is-invalid":t==="invalid",valid:t==="valid"});return d.jsx("p",{className:n,children:d.jsx("em",{children:e})})};JS.displayName="Text";const ZS=JS,eE=S.forwardRef(({noValidationIcon:e,placeholder:t,size:n="md",type:r="text",className:s,...i},o)=>{const{id:l,isRequired:a,isReadOnly:u,status:c}=kd(),f=J({"form-control":!u,"form-control-lg":n==="lg","form-control-sm":n==="sm","is-invalid":c==="invalid","is-valid":c==="valid","form-control-plaintext":u,"no-validation-icon":e},s);return d.jsx("input",{ref:o,id:l,className:f,type:r,placeholder:t,required:a,readOnly:u,...i})});eE.displayName="Input";const rs=eE,tE=S.forwardRef(({leftIcon:e,optionalText:t="Optional",requiredText:n="*",children:r,className:s},i)=>{const{id:o,isOptional:l,isRequired:a}=kd(),u=J("form-label",{"has-icon":e},s),c=l&&!a,f=a&&!l;return S.useEffect(()=>{if(l&&a)throw new Error("Cannot be optional and required at the same time")},[l,a]),d.jsxs("label",{ref:i,htmlFor:o,className:u,children:[e,r,c&&d.jsxs("em",{className:"optional",children:["- ",t]}),f&&d.jsx("em",{className:"required",children:n})]})});tE.displayName="Label";const _s=tE,nE=S.forwardRef(({children:e,className:t,id:n,isOptional:r,isReadOnly:s,isRequired:i,status:o,...l},a)=>{const u=S.useMemo(()=>({id:n,isOptional:r,isRequired:i,isReadOnly:s,status:o}),[n,r,s,i,o]);return d.jsx(YS.Provider,{value:u,children:d.jsx("div",{ref:a,className:t,...l,children:e})})}),v6=Object.assign(nE,{Label:_s,Input:rs,Text:ZS});nE.displayName="FormControl";const Qe=v6,y6=({placeholder:e,value:t="",handleSearchInputChange:n})=>{const{triggerProps:r,itemProps:s,setVisible:i}=mo(),o={...r,role:"combobox",onClick:()=>{t.length>2&&i(!0)},onChange:n};return S.useEffect(()=>{i(t.length>2)},[i,t]),d.jsx(Qe,{className:"d-flex align-items-center",id:"search",children:d.jsx(rs,{...o,className:"max-w-512",noValidationIcon:!0,placeholder:e,size:"md",type:"search",onKeyDown:s.onMenuItemKeyDown})})},w6=y6,rE=({children:e,value:t,model:n,onChange:r})=>{const{itemProps:s,itemRefs:i,isFocused:o}=mo(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:a}=s,u=S.useId(),c=n.includes(t),f={value:t,model:n,checked:c,readOnly:!0},p=J("dropdown-item c-pointer",{focus:o===u});return d.jsx("div",{id:u,ref:h=>i.current[u]=h,role:"menuitemcheckbox","aria-checked":c,onMouseUp:()=>r(t),onKeyDown:h=>l(h,()=>r(t)),onMouseEnter:a,tabIndex:c?0:-1,className:p,children:d.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[e,d.jsx(Cd,{...f})]})})};rE.displayName="Dropdown.CheckboxItem";const x6=rE,sE=({type:e="action",icon:t,onClick:n,children:r,...s})=>{const{itemProps:i,itemRefs:o,isFocused:l}=mo(),{onMenuItemKeyDown:a,onMenuItemMouseEnter:u,onMenuItemClick:c}=i,f=()=>{n==null||n(),e==="action"&&c()},p=S.useId(),h=J("dropdown-item",{focus:l===p});return d.jsx("div",{id:p,role:"menuitem",ref:y=>o.current[p]=y,tabIndex:l===p?0:-1,className:h,"aria-current":l===p,onClick:f,onMouseEnter:u,onKeyDown:y=>a(y,n),...s,children:d.jsxs("div",{className:"d-flex gap-8 align-items-center",children:[t,r]})})};sE.displayName="Dropdown.Item";const b6=sE,iE=S.forwardRef(({children:e,block:t,...n},r)=>{const{menuProps:s,visible:i}=mo(),{className:o,...l}=s,a={...l,...n},u=J({"w-100":t},o);return i?d.jsx("div",{ref:r,className:u,...a,children:e}):null});iE.displayName="Dropdown.Menu";const S6=iE,oE=S.forwardRef(({label:e,children:t},n)=>d.jsxs("div",{ref:n,role:"group",children:[d.jsx("span",{className:"small px-4",children:d.jsx("strong",{children:e})}),t]}));oE.displayName="Dropdown.MenuGroup";const E6=oE,aE=S.forwardRef(({model:e,icon:t,label:n=!1,disabled:r=!1,checked:s,...i},o)=>{const l=S.useId(),a={type:"radio",checked:s,disabled:r,ref:o,className:J(i.className,"form-check-input c-pointer",t&&"d-none"),id:l},u={...i,...a};return d.jsxs("div",{className:J("form-check d-flex align-items-center gap-8",t&&"ps-0"),children:[d.jsx("input",{...u}),t&&d.jsx("label",{htmlFor:u.id,className:J("c-pointer",e!==i.value&&"text-muted"),children:t}),!t&&n&&d.jsx("label",{className:"form-check-label",htmlFor:u.id,children:n})]})});aE.displayName="Radio";const Nc=aE,lE=({children:e,value:t,model:n,onChange:r})=>{const{itemProps:s,itemRefs:i,isFocused:o}=mo(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:a}=s,u=S.useId(),f={value:t,model:n,checked:t===n,readOnly:!0},p=J("dropdown-item c-pointer",{focus:o===u});return d.jsx("div",{id:u,ref:h=>i.current[u]=h,role:"menuitemradio","aria-checked":t===n,onMouseUp:()=>r(t),onKeyDown:h=>l(h,()=>r(t)),onMouseEnter:a,tabIndex:t===n?0:-1,className:p,children:d.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[e,d.jsx(Nc,{...f,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})};lE.displayName="Dropdown.RadioItem";const C6=lE,uE=()=>d.jsx("div",{role:"separator",className:"px-4",children:d.jsx("hr",{className:"m-0"})});uE.displayName="Dropdown.Separator";const k6=uE,cE=S.forwardRef(({label:e,icon:t,variant:n,disabled:r=!1,size:s,badgeContent:i,...o},l)=>{const{triggerProps:a,block:u}=mo(),{className:c,...f}=a,p={...f,...o},h=J(s,n,{"w-100":u},c);return d.jsxs("button",{ref:l,className:h,disabled:r,...p,children:[t||null,e,i?d.jsx("span",{className:"badge text-bg-secondary rounded-pill",children:i}):d.jsx(ZT,{width:16,height:16,className:"dropdown-toggle-caret"})]})});cE.displayName="Dropdown.Trigger";const T6=cE,j6=e=>{const t=S.useId(),[n,r]=S.useState(!1),[s,i]=S.useState(-1),[o,l]=S.useState(null),{refs:a,floatingStyles:u}=ej({placement:e,open:n,onOpenChange:r,whileElementsMounted:$5,middleware:[x5(4),B5({apply({rects:A,elements:N}){Object.assign(N.floating.style,{minWidth:`${A.reference.width}px`})}}),z5({padding:0})]}),c=S.useRef(null),f=S.useRef(null),p=S.useRef({});S.useEffect(()=>{n?c.current&&(c.current.focus(),i(0)):(i(-1),p.current={})},[n]),S.useEffect(()=>{if(s!==-1){const A=Object.values(p.current)[s];if(A){const N=A.getAttribute("id");l(N),A.focus()}}},[s]);const h=()=>{const N=Object.values(p.current).length;i(M=>(M+1)%N)},y=()=>{const N=Object.values(p.current).length;i(M=>(M-1+N)%N)},w=()=>{i(0)},x=()=>{const N=Object.values(p.current).length;i(N-1)},g=S.useCallback(()=>{r(!0)},[]),m=S.useCallback(()=>{f.current&&(f.current.focus(),r(!1))},[]),v=(A,N)=>{A&&(N.stopPropagation(),N.preventDefault())},b=S.useCallback(A=>{let N=!1;switch(A.code){case" ":case"Space":case"Enter":case"ArrowDown":case"Down":g(),N=!0;break;case"Esc":case"Escape":m(),N=!0;break;case"Up":case"ArrowUp":g(),N=!0;break}v(N,A)},[m,g]),E=A=>{const M=Object.values(p.current).findIndex(D=>D.id===A.currentTarget.getAttribute("id"));i(M)},T=S.useCallback((A,N)=>{let M=!1;if(A.shiftKey)A.key==="Tab"&&(m(),M=!0);else{switch(A.code){case"Escape":m();break;case" ":case"Space":case"Enter":s!==-1&&(Object.values(p.current)[s].getAttribute("role")==="menuitem"&&f.current&&(f.current.focus(),r(!1)),N==null||N()),M=!0;break;case"ArrowDown":case"Down":h(),M=!0;break;case"ArrowUp":case"Up":y(),M=!0;break;case"Home":w(),M=!0;break;case"End":x(),M=!0;break}v(M,A)}},[s,m]),C=S.useCallback(A=>{r(n!==!0),A.stopPropagation(),A.preventDefault()},[n]),R=S.useCallback(()=>{m()},[m]);function j(A,...N){N.forEach(M=>{typeof M=="function"?M(A):M!=null&&(M.current=A)})}function L(...A){return N=>{j(N,...A)}}return{isFocused:o,visible:n,itemRefs:p,triggerRef:f,menuRef:c,triggerProps:{ref:L(f,a.setReference),id:`dropdown-toggle-${t}`,"aria-haspopup":"menu","aria-controls":`dropdown-${t}`,"aria-expanded":!!n,className:`dropdown-toggle ${n?"selected":""}`,onClick:C,onKeyDown:b,"aria-activedescendant":o},menuProps:{ref:L(c,a.setFloating),className:"dropdown-menu bg-white shadow rounded-4 p-8","aria-labelledby":`dropdown-toggle-${t}`,style:{...u}},itemProps:{onMenuItemMouseEnter:E,onMenuItemClick:R,onMenuItemKeyDown:T},setVisible:r}},dE=j6,fE=({children:e,block:t,overflow:n=!0,placement:r="bottom-start"})=>{const{visible:s,isFocused:i,triggerProps:o,menuProps:l,itemProps:a,itemRefs:u,setVisible:c}=dE(r),f=gg(()=>c(!1)),p=S.useMemo(()=>({visible:s,isFocused:i,triggerProps:o,menuProps:l,itemProps:a,itemRefs:u,block:t,setVisible:c}),[s,i,o,l,a,u,t,c]),h=J("dropdown",{"w-100":t,overflow:n});return d.jsx(XS.Provider,{value:p,children:d.jsx("div",{ref:f,className:h,children:typeof e=="function"?e(o,u):e})})};fE.displayName="Dropdown";const P6=Object.assign(fE,{Trigger:T6,Menu:S6,Item:b6,Separator:k6,CheckboxItem:x6,RadioItem:C6,MenuGroup:E6}),Ee=P6,Td=({onSearchResultsChange:e,onSearchInputChange:t,options:n,value:r,isLoading:s,noResult:i,placeholder:o})=>{const{t:l}=ue(),[a,u]=S.useState([]);S.useEffect(()=>{e(a)},[a]);const c=p=>{u([p])},f=()=>s?d.jsxs("div",{className:"d-flex align-items-center p-4",children:[d.jsx(xg,{isLoading:s}),d.jsx("span",{className:"ps-4",children:l("explorer.search.pending")})]}):i?d.jsx("div",{className:"p-4",children:l("portal.no.result")}):n.map((p,h)=>d.jsxs(S.Fragment,{children:[d.jsx(Ee.Item,{type:"select",onClick:()=>c(p.value),children:p.label}),h<n.length-1&&d.jsx(Ee.Separator,{})]},h));return d.jsxs(Ee,{block:!0,children:[d.jsx(Td.Trigger,{placeholder:o,handleSearchInputChange:t,value:r}),d.jsx(Ee.Menu,{children:f()})]})};Td.Trigger=w6;Td.displayName="Combobox";const pE=Td,hE=({imageSrc:e,imageAlt:t="",title:n,text:r})=>d.jsxs("div",{className:"emptyscreen",children:[e&&d.jsx("div",{className:"emptyscreen-image mb-12",children:d.jsx("img",{className:"mx-auto",src:e,alt:t,width:"250",height:"250"})}),n&&d.jsx(an,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:n}),r&&d.jsx("div",{className:"text",children:r})]});hE.displayName="EmptyScreen";const O6=hE,Ri=({children:e,className:t,...n})=>{const r=J("grid",t);return d.jsx("div",{className:r,...n,children:e})},Eg=({sm:e,md:t,lg:n,xl:r,children:s,className:i,as:o,...l})=>{const a=o||"div",u=J({[`g-col-${e}`]:e,[t?`g-col-md-${t}`:""]:t,[n?`g-col-lg-${n}`:""]:n,[r?`g-col-xl-${r}`:""]:r},i);return d.jsx(a,{className:u,...l,children:s})};Ri.displayName="Grid";Eg.displayName="Grid.Col";Ri.Col=Eg;const mE=S.forwardRef(({label:e,addButtonLabel:t="Add image",deleteButtonLabel:n="Delete image",src:r,className:s,app:i,onUploadImage:o,onDeleteImage:l},a)=>{const u=S.useRef(null),[c,f]=S.useState(r||""),p=b=>{f("");const E=b==null?void 0:b[0];E&&(f(URL.createObjectURL(E)),o(E))},h=()=>{var b;(b=u.current)==null||b.click()},y=()=>{u.current&&(u.current.value=""),f(""),l()},w=b=>{p(b.target.files)},x=J("image-input",s),{handleDragging:g,handleDragLeave:m,handleDrop:v}=SS(u,p);return d.jsxs(Qe,{id:"image-input",className:x,onDragEnter:g,onDragOver:g,onDragLeave:m,onDrop:v,ref:a,children:[d.jsxs("div",{className:"image-input-actions gap-8",children:[d.jsx(hr,{"aria-label":t,color:"tertiary",icon:d.jsx(AT,{}),onClick:h,type:"button",variant:"ghost"}),d.jsx(hr,{"aria-label":n,color:"danger",disabled:!c,icon:d.jsx(ab,{width:"20",height:"20"}),onClick:y,type:"button",variant:"ghost"})]}),d.jsxs(Qe.Label,{children:[d.jsx("span",{className:"visually-hidden",children:e}),d.jsx(rs,{accept:"image/*",hidden:!0,onChange:w,ref:u,size:"sm",type:"file"}),c?d.jsx(Ws,{alt:"",src:c,size:"xl"}):d.jsx(qs,{app:i,iconFit:"ratio",size:"160",variant:"rounded"})]})]})});mE.displayName="ImagePicker";const Cg=mE,gE=S.forwardRef(({text:e,textButton:t,src:n,alt:r,url:s},i)=>d.jsx(d.Fragment,{children:d.jsxs("div",{ref:i,className:"p-16",children:[d.jsx(ho,{width:"270",height:"140",loading:"lazy",className:"rounded",src:n,alt:r}),d.jsx("p",{className:"m-8",children:e}),d.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:d.jsx(ze,{rightIcon:d.jsx(ET,{}),className:"py-0 px-8",variant:"ghost",color:"primary",children:t})})]})}));gE.displayName="Library";const R6=gE,vE=S.forwardRef(({position:e=!0},t)=>{const[n]=Ys(),r=`${n}/loading/screen-loading.gif`,s=J("loading-screen top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-items-center z-2000",{"position-fixed":!e,"position-static":e});return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:t,className:s,children:d.jsx("div",{className:"bg-white rounded-circle mx-auto",children:d.jsx("img",{src:r,alt:"loading"})})}),!e&&d.jsx("div",{className:"modal-backdrop fade show"})]})});vE.displayName="LoadingScreen";const _t=vE,yE=S.forwardRef(({src:e,is1d:t,translate:n="Retour accueil"},r)=>{const s=J("navbar-brand d-none d-md-block"),i=`logo ${t?"ONE":"NEO"}`;return d.jsx("a",{ref:r,className:s,href:"/timeline/timeline","aria-label":n,children:d.jsx("img",{className:"logo",src:e,alt:i,width:"300",height:"52"})})});yE.displayName="Logo";const kh=yE,kg=S.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""});kg.displayName="ModalContext";const wE=()=>{const e=S.useContext(kg);if(!e)throw new Error("Cannot be rendered outside the Modal component");return e},xE=e=>{const{ariaDescriptionId:t}=wE(),{children:n,className:r}=e,s=J("modal-body",r);return d.jsx("div",{id:t,className:s,children:n})};xE.displayName="Modal.Body";const N6=xE,bE=e=>d.jsx("div",{className:"modal-footer",children:e.children});bE.displayName="Modal.Footer";const A6=bE,SE=e=>{const{onModalClose:t,children:n}=e,{ariaLabelId:r,focusId:s}=wE(),i=S.useRef(null);return S.useEffect(()=>{var o;s||(o=i.current)==null||o.focus()},[s]),d.jsxs("div",{className:"modal-header",children:[d.jsx("h2",{id:r,className:"modal-title",tabIndex:-1,children:n}),d.jsx(hr,{ref:i,"aria-label":"Close",color:"tertiary",icon:d.jsx(ob,{}),type:"button",variant:"ghost",title:"Delete",onClick:t,className:"btn-close"})]})};SE.displayName="Modal.Header";const I6=SE,EE=e=>d.jsx("p",{className:"modal-subtitle",children:e.children});EE.displayName="Modal.Subtitle";const _6=EE,CE=S.forwardRef((e,t)=>{const{id:n,isOpen:r,onModalClose:s,size:i="md",viewport:o=!1,scrollable:l=!1,focusId:a,children:u}=e,c=`aria_label_${n}`,f=`aria_desc_${n}`,p=gg(s),h=xS();vS(s,["Escape"]),S.useEffect(()=>{if(r&&(document.body.style.overflow="hidden",a)){const m=document.getElementById(a);m==null||m.focus()}return()=>{document.body.style.overflow=""}},[a,r]);const y=J("modal fade",{"show d-block":r,"modal-scrollable":l,viewport:o,[`modal-${i}`]:i}),w=J("modal-dialog"),x={ariaLabelId:c,ariaDescriptionId:f,focusId:a},g=n2(r,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return d.jsx(kg.Provider,{value:x,children:g((m,v)=>d.jsxs(d.Fragment,{children:[v&&d.jsx(vh.div,{id:n,ref:t,role:"dialog","aria-modal":"true","aria-labelledby":c,"aria-describedby":f,className:y,style:m,tabIndex:-1,children:d.jsx("div",{id:`${n}_ref`,ref:b=>{p.current=b,v&&(h.current=b)},className:w,children:d.jsx("div",{className:"modal-content",children:u})})}),v&&d.jsx(vh.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),M6=Object.assign(CE,{Header:I6,Subtitle:_6,Body:N6,Footer:A6});CE.displayName="Modal";const Re=M6,L6=({children:e,className:t})=>{const n=J("popover-header",t);return d.jsx("div",{className:n,children:e})},kE=({children:e,className:t})=>{const n=J("popover-body",t);return d.jsx("div",{className:n,children:e})},TE=({children:e,className:t})=>{const n=J("popover-footer p-8",t);return d.jsx("div",{className:n,children:e})},jd=S.forwardRef(({children:e,className:t,id:n,isVisible:r,...s},i)=>{const o=J("popover d-block position-absolute top-100 start-50 translate-middle-x",t);return n2(r,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((a,u)=>u&&d.jsx(vh.div,{ref:i,"aria-labelledby":n,className:o,role:"tooltip",style:a,...s,children:e}))});jd.displayName="Popover";const jE=e=>d.jsx(Ee.Trigger,{...e,"aria-haspopup":"listbox",role:"combobox"});jE.displayName="SelectTrigger";const D6=jE,PE=({icon:e,options:t,overflow:n,block:r,variant:s,size:i,disabled:o,placeholderOption:l,onValueChange:a})=>{const[u,c]=S.useState(),{t:f}=ue();S.useEffect(()=>{if(u){const h=typeof u=="object"?u.value:u;a==null||a(h)}},[u]);const p=typeof u=="object"?u.label:u;return d.jsxs(Ee,{overflow:n,block:r,children:[d.jsx(D6,{icon:e,label:f(p||l),variant:s,size:i,disabled:o}),d.jsx(Ee.Menu,{role:"listbox",children:t==null?void 0:t.map(h=>{const y=typeof h=="object"?h.value:h,w=typeof h=="object"?h.label:h;return d.jsx(Ee.Item,{onClick:()=>c(h),children:w},y)})})]})};PE.displayName="Select";const Tg=PE,F6=({children:e,message:t,icon:n=null,placement:r="auto"})=>{const[s,i]=S.useState(null),[o,l]=S.useState(null),[a,u]=S.useState(null),{styles:c,attributes:f}=ER(s,o,{placement:r,modifiers:[{name:"arrow",options:{element:a}}]}),[p,h]=S.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"d-inline-block position-relative z-2",ref:i,onMouseEnter:()=>{h(!0)},onMouseLeave:()=>{h(!1)},children:e}),p&&d.jsxs("div",{className:J("tooltip d-block show mb-12","bs-tooltip-auto"),ref:l,style:c.popper,...f.popper,children:[d.jsxs("div",{className:"tooltip-inner shadow-hover d-flex gap-8 align-items-center",children:[n&&n,d.jsx("div",{children:t})]}),d.jsx("div",{className:"tooltip-arrow",ref:u,style:c.arrow})]})]})},OE=F6,RE=S.forwardRef(({noValidationIcon:e,placeholder:t,size:n="md",height:r="md",className:s,...i},o)=>{const{id:l,isRequired:a,isReadOnly:u,status:c}=kd(),f=J({"form-control":!u,"form-control-lg":n==="lg","form-control-sm":n==="sm","textarea-height-lg":r==="lg","textarea-height-md":r==="md","textarea-height-sm":r==="sm","is-invalid":c==="invalid","is-valid":c==="valid","form-control-plaintext":u,"no-validation-icon":e},s);return d.jsx("textarea",{ref:o,id:l,className:f,placeholder:t,required:a,readOnly:u,...i})});RE.displayName="TextArea";const jg=RE;function $6(e,t,n,r,s,i,o,l,a){const u=x=>{x.preventDefault(),s==null||s(e),x.stopPropagation()},c=x=>{(x.code==="Enter"||x.code==="Space")&&(x.preventDefault(),s==null||s(e),x.stopPropagation())},f=()=>{r(!n),n?i==null||i(e):o==null||o(e)};return{handleItemClick:u,handleItemKeyDown:c,handleItemFoldUnfoldClick:x=>{x.preventDefault(),f(),x.stopPropagation()},handleItemFoldUnfoldKeyDown:x=>{(x.code==="Enter"||x.code==="Space")&&(x.preventDefault(),f(),x.stopPropagation())},handleItemFocus:x=>{x.preventDefault(),l==null||l(e)},handleItemBlur:x=>{x.preventDefault(),a==null||a(e)}}}const NE=e=>{const{nodeId:t,label:n,children:r,section:s,selected:i,onItemSelect:o,onItemFold:l,onItemUnfold:a,onItemFocus:u,onItemBlur:c,selectedNodesIds:f}=e,[p,h]=S.useState(!1),{handleItemClick:y,handleItemKeyDown:w,handleItemFoldUnfoldClick:x,handleItemFoldUnfoldKeyDown:g,handleItemFocus:m,handleItemBlur:v}=$6(t,n,p,h,o,l,a,u,c);S.useEffect(()=>{if(f!=null&&f.length&&(f==null?void 0:f.length)>=1){const T=f[f.length-1];f.some(C=>C===t&&t!==T?(h(!0),C===t):(h(!1),!1))}else h(!1)},[t,f]);const b=s?16:12,E=()=>d.jsx("li",{id:`listitem_${t}`,role:"treeitem","aria-selected":i,"aria-expanded":p,children:d.jsxs("div",{children:[d.jsxs("div",{className:"action-container d-flex align-items-center gap-8 px-2",children:[d.jsxs("div",{className:"py-8",tabIndex:0,role:"button",onClick:x,onKeyDown:g,"aria-label":"fold/unfold button",children:[Array.isArray(r)&&!p&&d.jsx(S1,{title:"RafterRight",width:b,height:b}),Array.isArray(r)&&p&&d.jsx(Na,{title:"RafterDown",width:b,height:b}),!Array.isArray(r)&&d.jsx(S1,{title:"RafterRight",width:b,height:b,"aria-hidden":"true",className:"opacity-0"})]}),d.jsxs("div",{tabIndex:0,role:"button",className:"flex-fill d-flex align-items-center text-truncate gap-8 py-8",onClick:y,onKeyDown:w,onFocus:m,onBlur:v,children:[s&&d.jsx($T,{title:"Folder",width:20,height:20}),d.jsx("span",{className:"text-truncate",children:n})]})]}),Array.isArray(r)&&d.jsx("ul",{role:"group",children:r})]})},t);return s?d.jsx("ul",{role:"tree",className:"m-0 p-0",children:E()}):E()};NE.displayName="TreeItem";const z6=NE,AE=S.forwardRef((e,t)=>{const{data:n,onTreeItemSelect:r,onTreeItemFold:s,onTreeItemUnfold:i,onTreeItemFocus:o,onTreeItemBlur:l,selectedNodesIds:a}=e,[u,c]=S.useState("default");S.useEffect(()=>{a!=null&&a.length&&(a==null?void 0:a.length)>=1?c(a[a.length-1]):c("")},[a]);const f=g=>{c(g),r==null||r(g)},p=g=>{s==null||s(g)},h=g=>{i==null||i(g)},y=g=>{o==null||o(g)},w=g=>{l==null||l(g)},x=g=>d.jsx(z6,{nodeId:g.id,label:g.name,section:g.section,selectedNodesIds:a,selected:u===g.id,onItemSelect:f,onItemFold:p,onItemUnfold:h,onItemFocus:y,onItemBlur:w,children:Array.isArray(g.children)?g.children.map(m=>x(m)):null},g.id);return d.jsx("div",{ref:t,id:"treeview",className:"treeview",children:x(n)})});AE.displayName="TreeView";const IE=AE,_E=S.forwardRef(({children:e},t)=>d.jsx("span",{className:"visually-hidden",ref:t,children:e}));_E.displayName="VisuallyHidden";const sr=_E,B6=async e=>await ae.conf().getPreference(e),V6=async e=>await ae.conf().savePreference(e,JSON.stringify({showOnboardingTrash:!1})),U6=e=>{const[t,n]=S.useState(!0),[r,s]=S.useState(!1);return S.useEffect(()=>{(async()=>{const o=await B6(e);if(o){const{showOnboardingTrash:l}=o;s(l);return}s(!0)})()},[e]),{isOpen:t,setIsOpen:n,isOnboardingTrash:r,handleSavePreference:async()=>{await V6(e),n(!1)}}},ME=({id:e,items:t,modalOptions:n})=>{const[r]=Ys(),[s,i]=S.useState(),[o,l]=S.useState(0),{isOpen:a,isOnboardingTrash:u,setIsOpen:c,handleSavePreference:f}=U6(e),{t:p}=ue(),{title:h,prevText:y,closeText:w,nextText:x}=n;return u?vr.createPortal(d.jsxs(Re,{id:"onboarding-modal",size:"md",isOpen:a,focusId:"nextButtonId",onModalClose:()=>c(!1),children:[d.jsx(Re.Header,{onModalClose:()=>c(!1),children:p(h||"explorer.modal.onboarding.trash.title")}),d.jsx(Re.Body,{children:d.jsx(P2,{modules:[JR],onSwiper:g=>{i(g)},onSlideChange:g=>{l(g.progress)},pagination:{clickable:!0},children:t.map((g,m)=>d.jsxs(O2,{children:[d.jsx(ho,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:`${r}/${g.src}`,alt:p(g.alt)}),d.jsx("p",{children:p(g.text)})]},m))})}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>c(!1),children:p("explorer.modal.onboarding.trash.later")}),o>0&&d.jsx(ze,{type:"button",color:"primary",variant:"outline",onClick:()=>s.slidePrev(),children:p(y||"explorer.modal.onboarding.trash.prev")}),o<1&&d.jsx(ze,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>s.slideNext(),children:p(x||"explorer.modal.onboarding.trash.next")}),o===1&&d.jsx(ze,{type:"button",color:"primary",variant:"filled",onClick:f,children:p(w||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null};ME.displayName="OnboardingModal";const H6=ME,q6=()=>{const{t:e}=ue();return[{value:"bpr.activityType.classroomActivity",label:e("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:e("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:e("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:e("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:e("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:e("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:e("bpr.activityType.courseElement")},{value:"bpr.other",label:e("bpr.other")}]},W6=({control:e,selectedActivities:t,selectActivities:n})=>{const r=q6(),{t:s}=ue();return d.jsx("div",{className:"col d-flex",children:d.jsx(Jc,{name:"activityType",control:e,rules:{required:!0},render:({field:{onChange:i}})=>d.jsxs(Ee,{block:!0,overflow:!0,children:[d.jsx(Ee.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:t==null?void 0:t.length}),d.jsx(Ee.Menu,{children:r.map((o,l)=>d.jsx(Ee.CheckboxItem,{value:o.value,model:t,onChange:()=>{n(o.value),i(o.value)},children:o.label},l))})]})})})},G6=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],z0=({name:e,control:t,placeholderOption:n,validate:r})=>d.jsx(Jc,{name:e,control:t,rules:{required:!0,validate:r},render:({field:{onChange:s}})=>d.jsx(Tg,{block:!0,size:"md",onValueChange:s,options:G6,"aria-required":!0,placeholderOption:n})}),Q6=()=>{const{t:e}=ue();return[{value:"de_DE",label:e("de_DE")},{value:"en_EN",label:e("en_EN")},{value:"ar_DZ",label:e("ar_DZ")},{value:"es_ES",label:e("es_ES")},{value:"fr_FR",label:e("fr_FR")},{value:"it_IT",label:e("it_IT")},{value:"ja_JP",label:e("ja_JP")},{value:"zh_CN",label:e("zh_CN")},{value:"pt_PT",label:e("pt_PT")},{value:"ru_RU",label:e("ru_RU")},{value:"bpr.other",label:e("bpr.other")}]},K6="bpr.form.publication.language",X6=({control:e})=>{const t=Q6();return d.jsx("div",{className:"col",children:d.jsx(Jc,{name:"language",control:e,rules:{required:!0},render:({field:{onChange:n}})=>d.jsx(Tg,{block:!0,size:"md",onValueChange:n,options:t,"aria-required":!0,placeholderOption:K6})})})},Y6=()=>{const{t:e}=ue(),[t]=Ys();return d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"mb-12",children:[d.jsxs("li",{children:[e("bpr.form.publication.licence.text.1"),d.jsx("img",{className:"ms-8 d-inline-block",src:`${t}/common/image-creative-commons.png`,alt:"licence creative commons"})]}),d.jsx("li",{children:e("bpr.form.publication.licence.text.2")})]}),d.jsx(Vr,{type:"info",className:"mb-12",children:e("bpr.form.publication.licence.text.3")}),d.jsx(Vr,{type:"warning",children:e("bpr.form.publication.licence.text.4")})]})},J6=()=>{const{t:e}=ue();return[{value:"bpr.subjectArea.artActivity",label:e("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:e("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:e("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:e("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:e("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:e("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:e("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:e("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:e("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:e("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:e("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:e("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:e("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:e("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:e("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:e("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:e("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:e("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:e("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:e("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:e("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:e("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:e("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:e("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:e("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:e("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:e("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:e("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:e("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:e("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:e("bpr.subjectArea.technology")},{value:"bpr.other",label:e("bpr.other")}]},Z6=({control:e,selectedSubjectAreas:t,selectSubjects:n})=>{const r=J6(),{t:s}=ue();return d.jsx("div",{className:"col d-flex",children:d.jsx(Jc,{name:"subjectArea",control:e,rules:{required:!0},render:({field:{onChange:i}})=>d.jsxs(Ee,{block:!0,overflow:!0,children:[d.jsx(Ee.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:t==null?void 0:t.length}),d.jsx(Ee.Menu,{children:r.map((o,l)=>d.jsx(Ee.CheckboxItem,{value:o.value,model:t,onChange:()=>{n(o.value),i(o.value)},children:o.label},l))})]})})})};function B0({formData:e}){const{t}=ue(),n=r=>r.match(/^\s/);return d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"pt-24",children:t("bpr.form.publication.response.error.title")}),d.jsx("p",{className:"pt-24 pb-24",children:d.jsx("strong",{children:t("bpr.form.publication.response.error.content")})}),d.jsxs("ul",{children:[n(e.title)&&d.jsx("li",{className:"pt-2 pb-2",children:d.jsx("strong",{children:t("bpr.form.publication.response.empty.title")})}),n(e.description)&&d.jsx("li",{className:"pt-2 pb-2",children:d.jsx("strong",{children:t("bpr.form.publication.response.empty.description")})})]})]})}function eI({result:e}){const{t}=ue();return d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"pt-24",children:t("bpr.form.publication.response.success.title")}),d.jsx("p",{className:"pt-24",children:t("bpr.form.publication.response.success.content.1")}),d.jsx("p",{className:"pt-24",children:t("bpr.form.publication.response.success.content.2")}),e.details.front_url&&d.jsx("p",{className:"pt-24 pb-24",children:d.jsx("a",{className:"button right-magnet",href:e.details.front_url,target:"_blank",rel:"noreferrer",children:t("bpr.form.publication.response.success.button")})})]})}function tI({onSuccess:e,resource:t}){const{user:n,appCode:r}=Te(),s=ht(),[i,o]=S.useState(t.thumbnail||""),{control:l,register:a,watch:u,setValue:c,handleSubmit:f,formState:{errors:p,isSubmitting:h,isDirty:y,isValid:w}}=sb({mode:"onChange"}),[x,g]=S.useState([]),[m,v]=S.useState([]),b=(L,A,N)=>{let M=[...A];const D=M.findIndex(k=>k===L);A.includes(L)?M=A.filter((k,I)=>I!==D):M=[...A,L],N(M)};return{control:l,cover:i,formState:{errors:p,isSubmitting:h,isDirty:y,isValid:w},handleDeleteImage:()=>o(""),handlePublish:async L=>{const A=n?n==null?void 0:n.userId:"";try{let N=new Blob;typeof i=="string"?N=await ae.http().get(i,{responseType:"blob"}):i?N=await ae.http().get(URL.createObjectURL(i),{responseType:"blob"}):t.thumbnail&&(N=await ae.http().get(t.thumbnail,{responseType:"blob"}));const M=await ae.http().get(`/userbook/avatar/${A}?thumbnail=48x48`,{responseType:"blob"}),D=await ae.http().get(`/directory/user/${A}/attachment-school`,{responseType:"json"}),k=wg[r],I={activityType:x,age:[L.ageMin,L.ageMax],application:k,cover:N,description:L.description,keyWords:L.keyWords,language:L.language,licence:"CC-BY",resourceId:t.assetId,resourceEntId:t.assetId,subjectArea:m,teacherAvatar:M,title:L.title,userId:A,userStructureName:D.name||(n==null?void 0:n.structureNames[0])},z=await ae.resource(r).publish(I);z.success?s.success(d.jsx(eI,{result:z}),{duration:1e4}):s.error(d.jsx(B0,{formData:L})),e==null||e()}catch(N){console.error(N),s.error(d.jsx(B0,{formData:L}))}},handleSubmit:f,handleUploadImage:L=>o(L),register:a,selectActivities:L=>{b(L,x,g)},selectedActivities:x,selectedSubjectAreas:m,selectSubjects:L=>{b(L,m,v)},setValue:c,watch:u}}function nI({isOpen:e,resource:t,onSuccess:n,onCancel:r}){const{currentApp:s}=Te(),{t:i}=ue(),{control:o,cover:l,formState:{isDirty:a,isValid:u,isSubmitting:c},handleDeleteImage:f,handleSubmit:p,handleUploadImage:h,handlePublish:y,register:w,selectActivities:x,selectedActivities:g,selectedSubjectAreas:m,selectSubjects:v}=tI({resource:t,onSuccess:n}),b="bpr.form.publication.age.min",E="bpr.form.publication.age.max";return vr.createPortal(d.jsxs(Re,{isOpen:e,onModalClose:r,id:"libraryModal",size:"lg",children:[d.jsx(Re.Header,{onModalClose:r,children:i("bpr.publish")}),d.jsx(Re.Subtitle,{children:i("bpr.form.tip")}),d.jsxs(Re.Body,{children:[d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("bpr.form.publication.heading.general")}),d.jsxs("form",{id:"libraryModalForm",onSubmit:p(y),children:[d.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[d.jsxs("div",{style:{maxWidth:"160px"},children:[d.jsx("div",{className:"form-label",children:i("bpr.form.publication.cover.title")}),d.jsx(Cg,{app:s,src:t.thumbnail,label:i("bpr.form.publication.cover.upload.label"),addButtonLabel:i("bpr.form.publication.cover.upload.add"),deleteButtonLabel:i("bpr.form.publication.cover.upload.remove"),onUploadImage:h,onDeleteImage:f,className:"align-self-center"}),!l&&d.jsx("p",{className:"form-text is-invalid",children:d.jsx("em",{children:i("bpr.form.publication.cover.upload.required.image")})})]}),d.jsxs("div",{className:"flex-fill",children:[d.jsxs(Qe,{id:"title",className:"mb-16",isRequired:!0,children:[d.jsx(_s,{children:i("bpr.form.publication.title")}),d.jsx(rs,{type:"text",defaultValue:t.name,...w("title",{required:!0}),placeholder:i("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),d.jsxs(Qe,{id:"description",isRequired:!0,children:[d.jsx(_s,{children:i("bpr.form.publication.description")}),d.jsx(jg,{...w("description",{required:!0}),placeholder:i("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),d.jsx("hr",{}),d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("bpr.form.publication.heading.infos")}),d.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[d.jsx(W6,{control:o,selectedActivities:g,selectActivities:x}),d.jsx(Z6,{control:o,selectedSubjectAreas:m,selectSubjects:v}),d.jsx(X6,{control:o})]}),d.jsxs("div",{className:"mb-24",children:[d.jsx("label",{htmlFor:"",className:"form-label",children:i("bpr.form.publication.age")}),d.jsxs("div",{className:"d-flex gap-8",children:[d.jsx("div",{className:"col col-2",children:d.jsx(z0,{control:o,name:"ageMin",placeholderOption:b,validate:(T,C)=>parseInt(T)<=parseInt(C.ageMax)})}),d.jsx("div",{className:"col col-2",children:d.jsx(z0,{control:o,name:"ageMax",placeholderOption:E,validate:(T,C)=>parseInt(T)>=parseInt(C.ageMin)})})]})]}),d.jsx("div",{className:"mb-24",children:d.jsxs(Qe,{id:"keywords",isOptional:!0,children:[d.jsx(_s,{children:i("bpr.form.publication.keywords")}),d.jsx(rs,{type:"text",...w("keyWords"),size:"md",placeholder:i("bpr.form.publication.keywords.placeholder")})]})}),d.jsx("hr",{}),d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("bpr.form.publication.licence.text")}),d.jsx(Y6,{})]})]}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:i("cancel")}),d.jsx(ze,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:c,disabled:!l||c||!a||!u,children:i("bpr.form.submit")})]})]}),document.getElementById("portal"))}const rI=({watch:e,selectedResource:t})=>{const[n,r]=S.useState(""),[s,i]=S.useState(!!(t!=null&&t.public)||!1),o=S.useId(),l=e("title"),{t:a}=ue(),u=ht(),c=`${A2({foo:`${l}${o}`})}-${_2(l)}`;S.useEffect(()=>{if(s){let h="";t&&t.slug?h=t.slug:h=c,r(h)}},[s,t,l,o,c]);function f(h){i(h)}function p(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${n}`),u.success(a("explorer.copy.clipboard"))}return{slug:n,uniqueId:o,isPublic:s,resourceName:l,onPublicChange:f,onCopyToClipBoard:p}},sI=({isUpdating:e,selectedResource:t})=>{const[n,r]=S.useState(e&&(t==null?void 0:t.thumbnail)||""),s=o=>r(o),i=()=>r("");return console.log({isUpdating:e},t==null?void 0:t.thumbnail),{thumbnail:n,handleDeleteImage:i,handleUploadImage:s}},iI=({appCode:e,isPublic:t,onCopyToClipBoard:n,onPublicChange:r,register:s,slug:i,resourceName:o})=>{const{t:l}=ue();return d.jsxs(d.Fragment,{children:[d.jsxs(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:[l("explorer.resource.editModal.heading.access"),e]}),d.jsx(Vr,{type:"info",children:l("explorer.resource.editModal.access.alert")}),d.jsxs(Qe,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[d.jsx(Qe.Input,{type:"checkbox",role:"switch",...s("enablePublic",{disabled:!t&&!o,onChange:a=>{r(a.target.checked)}}),className:"form-check-input mt-0",size:"md"}),d.jsx(Qe.Label,{className:"form-check-label mb-0",children:l("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),t&&d.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[d.jsxs("p",{className:"text-break",children:[window.location.origin,window.location.pathname,"/pub/",i]}),d.jsx(ze,{color:"primary",disabled:!t,onClick:n,type:"button",leftIcon:d.jsx(OT,{}),variant:"ghost",className:"text-nowrap",children:l("explorer.resource.editModal.access.url.button")})]})]})},Ac=(e,t)=>{const n=t==null?void 0:t.filter(r=>r.id===e&&r.available);return n&&n.length>0},oI=({isOpen:e,actions:t,onCancel:n,onSuccess:r,...s})=>{var i,o,l,a,u,c;const{appCode:f,currentApp:p}=Te(),{t:h}=ue(),{mode:y}=s,w=S.useId(),x=y==="create",g=y==="update",{watch:m,register:v,handleSubmit:b,formState:{isSubmitting:E,isValid:T}}=sb({mode:"onChange",defaultValues:{description:g?(i=s.selectedResource)==null?void 0:i.description:"",enablePublic:g?(o=s.selectedResource)==null?void 0:o.public:!1,title:g?(l=s.selectedResource)==null?void 0:l.name:""}}),{slug:C,uniqueId:R,isPublic:j,resourceName:L,onPublicChange:A,onCopyToClipBoard:N}=rI({watch:m,selectedResource:g?s.selectedResource:void 0}),M=ht(),{thumbnail:D,handleDeleteImage:k,handleUploadImage:I}=sI({isUpdating:g,selectedResource:g?s.selectedResource:void 0}),z=async function(_){var $,V;try{const ne={description:_.description||"",name:_.title,public:_.enablePublic,thumbnail:D},re=`${A2({foo:`${_.title}${R}`})}-${_2(_.title)}`;x?await s.createResource.mutateAsync({...ne,folder:(($=s.currentFolder)==null?void 0:$.id)==="default"?void 0:parseInt(((V=s.currentFolder)==null?void 0:V.id)||""),slug:_.enablePublic?re:"",app:f}):await s.updateResource.mutateAsync({...ne,slug:_.enablePublic?s.selectedResource&&s.selectedResource.slug?s.selectedResource.slug:re:"",entId:s.selectedResource.assetId,trashed:s.selectedResource.trashed}),M.success(d.jsxs(d.Fragment,{children:[d.jsx("strong",{children:h(x?"explorer.resource.created":"explorer.resource.updated")}),d.jsxs("p",{children:[h("title")," : ",_.title]}),d.jsxs("p",{children:[h("description")," : ",_.description]}),f===Ho.BLOG&&d.jsxs("p",{children:["Public:",_.enablePublic?h("explorer.enable.public.yes"):h("explorer.enable.public.no")]})]})),r()}catch(ne){console.error(ne)}};return vr.createPortal(d.jsxs(Re,{id:`${y}-resource`,size:"lg",isOpen:e,onModalClose:n,children:[d.jsx(Re.Header,{onModalClose:n,children:h(`explorer.resource.editModal.header.${x?"create":"edit"}`)}),d.jsxs(Re.Body,{children:[d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:h("explorer.resource.editModal.heading.general")}),d.jsxs("form",{id:w,onSubmit:b(z),children:[d.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[d.jsx("div",{children:d.jsx(Cg,{app:p,src:g&&((a=s.selectedResource)==null?void 0:a.thumbnail)||"",label:h("explorer.imagepicker.label"),addButtonLabel:h("explorer.imagepicker.button.add"),deleteButtonLabel:h("explorer.imagepicker.button.delete"),onUploadImage:I,onDeleteImage:k,className:"align-self-center mt-8"})}),d.jsxs("div",{className:"col",children:[d.jsxs(Qe,{id:"title",className:"mb-16",isRequired:!0,children:[d.jsx(_s,{children:h("title")}),d.jsx(rs,{type:"text",defaultValue:g?(u=s.selectedResource)==null?void 0:u.name:"",...v("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:h("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),d.jsxs(Qe,{id:"description",isOptional:!0,children:[d.jsx(_s,{children:h("description")}),d.jsx(jg,{defaultValue:g?(c=s.selectedResource)==null?void 0:c.description:"",...v("description"),placeholder:h("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),f===Ho.BLOG&&Ac("createPublic",t)&&d.jsx(iI,{appCode:f,isPublic:j,slug:C,onCopyToClipBoard:N,onPublicChange:A,register:v,resourceName:L})]})]}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{color:"tertiary",onClick:n,type:"button",variant:"ghost",children:h("explorer.cancel")}),d.jsx(ze,{form:w,type:"submit",color:"primary",isLoading:E,variant:"filled",disabled:!T||E,children:h(x?"explorer.create":"save")})]})]}),document.getElementById("portal"))},aI=oI;function lI({radioPublicationValue:e,onRadioPublicationChange:t}){const{appCode:n}=Te(),{t:r}=ue(n);return d.jsxs(d.Fragment,{children:[d.jsx("hr",{}),d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:r("explorer.publication.steps")}),d.jsx(Nc,{label:r("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:e,checked:e==="IMMEDIATE",onChange:s=>t(s.target.value)}),d.jsx(Nc,{label:r("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:e==="RESTRAINT",model:e,onChange:s=>t(s.target.value)})]})}const uI={searchInputValue:"",searchResults:[],searchAPIResults:[],searchPending:!1,isLoading:!1};function cI(e,t){switch(t.type){case"onChange":return{...e,searchInputValue:t.payload};case"isSearching":return{...e,isLoading:t.payload};case"addResult":return{...e,searchResults:t.payload};case"addApiResult":return{...e,searchAPIResults:t.payload};case"updateSearchResult":return{...e,searchResults:t.payload};case"emptyResult":return{...e,searchResults:t.payload};default:throw new Error("Unhandled action type")}}const Ff=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],dI=({resource:e,shareRights:t,shareDispatch:n})=>{const[r,s]=S.useReducer(cI,uI),i=wS(r.searchInputValue,500),{isAdml:o}=CS(),{appCode:l}=Te();S.useEffect(()=>{u(i)},[i]);const a=y=>{const w=y.target.value;s({type:"onChange",payload:w})},u=async y=>{if(s({type:"isSearching",payload:!0}),!o&&y.length>=1||o&&y.length>=3){const w=await ae.share().searchShareSubjects(l,e.assetId,y);s({type:"addApiResult",payload:w});const x=w.filter(g=>!t.rights.find(m=>m.id===g.id)).filter(g=>!(g.type==="user"&&g.id===e.creatorId)).map(g=>({value:g.id,label:g.displayName,icon:g.type==="sharebookmark"?Rm:null}));s({type:"addResult",payload:x})}else s({type:"emptyResult",payload:[]}),Promise.resolve();s({type:"isSearching",payload:!1})};return{state:r,showSearchAdmlHint:()=>o&&r.searchInputValue.length<3,showSearchLoading:()=>r.searchPending&&r.searchInputValue.length>0,showSearchNoResults:()=>!r.searchPending&&!o&&i.length>0&&r.searchResults.length===0||!r.searchPending&&o&&i.length>3&&r.searchResults.length===0,handleSearchInputChange:a,handleSearchResultsChange:async y=>{const w=r.searchAPIResults.find(x=>x.id===y[0]);if(w){let x=[];if(w.type==="sharebookmark"){const g=await ae.directory().getBookMarkById(w.id);x.push({...g,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:Ff}),g==null||g.users.filter(m=>!t.rights.find(v=>v.id===m.id)).forEach(m=>{x.push({...m,type:"user",avatarUrl:"",directoryUrl:"",actions:Ff,isBookmarkMember:!0})}),g.groups.filter(m=>!t.rights.find(v=>v.id===m.id)).forEach(m=>{x.push({...m,type:"group",avatarUrl:"",directoryUrl:"",actions:Ff,isBookmarkMember:!0})})}else x=[{...w,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];n({type:"updateShareRights",payload:{...t,rights:[...t.rights,...x]}}),s({type:"updateSearchResult",payload:r.searchResults.filter(g=>g.value!==y[0])})}}}},fI={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function pI(e,t){switch(t.type){case"init":return{...e,...t.payload};case"deleteRow":return{...e,shareRights:t.payload};case"updateShareRights":return{...e,shareRights:t.payload};case"toggleRight":return{...e,shareRights:t.payload};case"isSharing":return{...e,isSharing:!0};default:throw new Error("Unhandled action type")}}function hI({onSuccess:e,resource:t,updateResource:n,shareResource:r}){const{appCode:s}=Te(),{user:i,avatar:o}=Ed(),[l,a]=S.useReducer(pI,fI);return S.useEffect(()=>{(async()=>{const h=await ae.share().getActionsForApp(s),y=await ae.share().getRightsForResource(s,t.assetId);a({type:"init",payload:{shareRightActions:h,shareRights:y}})})()},[]),{state:l,dispatch:a,currentIsAuthor:()=>!!(t&&t.creatorId===(i==null?void 0:i.userId)),myAvatar:o,handleDeleteRow:h=>{a({type:"deleteRow",payload:{...l.shareRights,rights:l.shareRights.rights.filter(y=>{var w,x;return y.id!==h.id&&!((w=h.users)!=null&&w.find(g=>g.id===y.id))&&!((x=h.groups)!=null&&x.find(g=>g.id===y.id))})}})},handleShare:async h=>{a({type:"isSharing",payload:!0});try{const y=t.rights.filter(x=>i&&x.includes(`user:${i.userId}`)).map(x=>x.split(":")[2]).filter(x=>!!x),w=[...l.shareRights.rights];if(y.length>0){const x=y.map(g=>({displayName:g,id:g}));w.push({actions:x,avatarUrl:"",directoryUrl:"",displayName:i.username,id:i.userId,type:"user"})}s==="blog"?await n.mutateAsync(h):await n.mutateAsync({entId:t.assetId||"",trashed:t.trashed||!1,name:t.name||"",thumbnail:t.thumbnail||"",description:t.description||"",public:t.public||!1,slug:t.slug||""}),await r.mutateAsync({resourceId:t.assetId,rights:w}),e==null||e()}catch(y){console.error("Failed to save share",y)}finally{a({type:"isSharing",payload:!1})}},toggleRight:(h,y)=>{var w,x;const{rights:g,...m}=l.shareRights,v=[...g],b=v.findIndex(C=>C.id===h.id),E=l.shareRightActions.filter(C=>C.id===y)[0];if(v[b].actions.findIndex(C=>C.id===y)>-1){let C=v[b].actions.filter(j=>j.id!==y);const R=l.shareRightActions.filter(j=>{var L;return(L=j.requires)==null?void 0:L.includes(y)});C=C.filter(j=>!R.find(L=>L.id===j.id)),v[b]={...v[b],actions:C}}else{const C=l.shareRightActions.filter(R=>{var j;return((j=E.requires)==null?void 0:j.includes(R.id))&&!v[b].actions.find(L=>L.id===R.id)});v[b]={...v[b],actions:[...v[b].actions,E,...C]}}h.type==="sharebookmark"&&((w=v[b].users)==null||w.forEach(C=>{const R=v.findIndex(j=>j.id===C.id);v[R]={...v[R],actions:v[b].actions}}),(x=v[b].groups)==null||x.forEach(C=>{const R=v.findIndex(j=>j.id===C.id);v[R]={...v[R],actions:v[b].actions}})),a({type:"toggleRight",payload:{rights:v,...m}})}}}function mI({resource:e}){const{assetId:t,description:n,thumbnail:r,name:s,public:i,trashed:o,slug:l,"publish-type":a}=e||{"publish-type":"",assetId:"",description:"",name:"",public:!1,slug:"",thumbnail:"",trashed:!1},[u,c]=S.useState(a||"RESTRAINT"),[f,p]=S.useState({description:n||"",entId:t,name:s,public:!!i,slug:l||"",thumbnail:r,trashed:o,"publish-type":a});return S.useEffect(()=>{u&&p(y=>({...y,"publish-type":u}))},[u]),{radioPublicationValue:u,shareBlogPayload:f,handleRadioPublicationChange:async y=>{c(y)}}}const gI=({shareRights:e,shareDispatch:t})=>{const n=ht(),{t:r}=ue(),s=S.useRef(null),[i,o]=S.useState({name:"",id:S.useId()}),[l,a]=yg(!1),[u,c]=S.useState(!1),f=()=>{a()},p=()=>{o(w=>{var x;return{...w,name:((x=s.current)==null?void 0:x.value)||""}})},h=async w=>{try{const x=await ae.directory().saveBookmarks(w,{users:e.rights.filter(g=>g.type==="user").map(g=>g.id),groups:e.rights.filter(g=>g.type==="group").map(g=>g.id),bookmarks:e.rights.filter(g=>g.type==="sharebookmark").map(g=>g.id)});n.success(r("explorer.bookmarked.status.saved")),t({type:"updateShareRights",payload:{...e,visibleBookmarks:[...e.visibleBookmarks,{displayName:w,id:x.id}]}}),o(g=>({...g,bookmarkId:g.id+new Date().getTime().toString()})),c(!1)}catch(x){console.error("Failed to save bookmark",x),n.error(r("explorer.bookmarked.status.error"))}};return{refBookmark:s,showBookmark:l,showBookmarkInput:u,bookmark:i,handleBookmarkChange:p,setBookmark:o,handleOnSave:()=>{var w;const x=((w=s.current)==null?void 0:w.value)||"";h(x)},toggleBookmark:f,toggleBookmarkInput:c}},vI=({bookmark:e,refBookmark:t,onBookmarkChange:n,onSave:r})=>{const{t:s}=ue();return d.jsx("div",{className:"mt-16",children:d.jsxs(Qe,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[d.jsx("div",{className:"flex-fill",children:d.jsx(Qe.Input,{ref:t,onChange:n,placeholder:s("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},e.id)}),d.jsx(ze,{type:"button",color:"primary",variant:"ghost",disabled:e.name.length===0,leftIcon:d.jsx(t5,{}),onClick:r,className:"text-nowrap",children:s("explorer.modal.share.sharebookmark.save")})]})})},yI=(e,t)=>e.actions.filter(n=>t.id===n.id).length>0,wI=(e,t)=>e.isBookmarkMember&&t||!e.isBookmarkMember,xI=({shareRights:e,showBookmark:t,toggleBookmark:n,shareRightActions:r,toggleRight:s,onDeleteRow:i})=>{const{t:o}=ue();return e==null?void 0:e.rights.map(l=>wI(l,t)&&d.jsxs("tr",{className:l.isBookmarkMember?"bg-light":"",children:[d.jsxs("td",{children:[l.type!=="sharebookmark"&&d.jsx(Ws,{alt:o("explorer.modal.share.avatar.shared.alt"),size:"xs",src:l.avatarUrl,variant:"circle"}),l.type==="sharebookmark"&&d.jsx(Rm,{})]}),d.jsx("td",{children:d.jsxs("div",{className:"d-flex",children:[l.type==="sharebookmark"&&d.jsx(ze,{color:"tertiary",rightIcon:d.jsx(Na,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:t?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:n,children:l.displayName}),l.type!=="sharebookmark"&&l.displayName]})}),r.map(a=>d.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:d.jsx(Cd,{checked:yI(l,a),onChange:()=>s(l,a.id)})},a.displayName)),d.jsx("td",{children:!l.isBookmarkMember&&d.jsx(hr,{"aria-label":"Delete",color:"tertiary",icon:d.jsx(ob,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>i(l)})})]},l.id))};function bI({isOpen:e,resource:t,updateResource:n,shareResource:r,onSuccess:s,onCancel:i}){const{appCode:o}=Te(),{radioPublicationValue:l,shareBlogPayload:a,handleRadioPublicationChange:u}=mI({resource:t}),{state:{isSharing:c,shareRights:f,shareRightActions:p},dispatch:h,myAvatar:y,currentIsAuthor:w,handleShare:x,toggleRight:g,handleDeleteRow:m}=hI({resource:t,updateResource:n,shareResource:r,onSuccess:s}),{state:{searchResults:v,searchInputValue:b},showSearchAdmlHint:E,showSearchLoading:T,showSearchNoResults:C,handleSearchInputChange:R,handleSearchResultsChange:j}=dI({resource:t,shareRights:f,shareDispatch:h}),{refBookmark:L,showBookmark:A,handleBookmarkChange:N,toggleBookmark:M,bookmark:D,handleOnSave:k,showBookmarkInput:I,toggleBookmarkInput:z}=gI({shareRights:f,shareDispatch:h}),{t:_}=ue(),$=E()?_("explorer.search.adml.hint"):_("explorer.modal.share.search.placeholder");return vr.createPortal(d.jsxs(Re,{id:"share_modal",size:"lg",isOpen:e,onModalClose:i,children:[d.jsx(Re.Header,{onModalClose:i,children:_("share.title")}),d.jsxs(Re.Body,{children:[d.jsx(an,{headingStyle:"h4",level:"h3",className:"mb-16",children:_("explorer.modal.share.usersWithAccess")}),d.jsx("div",{className:"table-responsive",children:d.jsxs("table",{className:"table border align-middle mb-0",children:[d.jsx("thead",{className:"bg-secondary",children:d.jsxs("tr",{children:[d.jsx("th",{scope:"col",className:"w-32",children:d.jsx(sr,{children:_("explorer.modal.share.avatar.shared.alt")})}),d.jsx("th",{scope:"col",children:d.jsx(sr,{children:_("explorer.modal.share.search.placeholder")})}),p.map(V=>d.jsx("th",{scope:"col",className:"text-center text-white",children:_(V.displayName)},V.displayName)),d.jsx("th",{scope:"col",children:d.jsx(sr,{children:_("close")})})]})}),d.jsxs("tbody",{children:[w()&&d.jsxs("tr",{children:[d.jsx("th",{scope:"row",children:d.jsx(Ws,{alt:_("explorer.modal.share.avatar.me.alt"),size:"xs",src:y,variant:"circle"})}),d.jsx("td",{children:_("share.me")}),p.map(V=>d.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:d.jsx(Cd,{checked:!0,disabled:!0})},V.displayName)),d.jsx("td",{})]}),d.jsx(xI,{showBookmark:A,shareRightActions:p,shareRights:f,onDeleteRow:m,toggleRight:g,toggleBookmark:M})]})]})}),d.jsxs("div",{className:"mt-16",children:[d.jsx(ze,{color:"tertiary",leftIcon:d.jsx(Rm,{}),rightIcon:d.jsx(Na,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:I?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>z(!I),children:_("share.save.sharebookmark")}),I&&d.jsx(vI,{refBookmark:L,bookmark:D,onBookmarkChange:N,onSave:k})]}),d.jsx("hr",{}),d.jsxs(an,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[d.jsx("div",{className:"me-8",children:_("explorer.modal.share.search")}),d.jsx(OE,{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:d.jsx(lb,{className:"c-pointer",height:"18"})})]}),d.jsx("div",{className:"row",children:d.jsx("div",{className:"col-10",children:d.jsx(pE,{value:b,placeholder:$,isLoading:T(),noResult:C(),options:v,onSearchInputChange:R,onSearchResultsChange:j})})}),o==="blog"&&d.jsx(lI,{radioPublicationValue:l,onRadioPublicationChange:u})]}),d.jsxs(Re.Footer,{children:[d.jsx(ze,{type:"button",color:"tertiary",variant:"ghost",onClick:i,children:_("explorer.cancel")}),d.jsx(ze,{type:"button",color:"primary",variant:"filled",isLoading:c,onClick:()=>x(a),disabled:c,children:_("share")})]})]}),document.getElementById("portal"))}function $f({children:e}){return d.jsx("span",{className:"position-absolute badge rounded-pill bg-warning",children:e})}function zf({children:e,className:t,...n}){const r=J("navbar",t);return d.jsx("nav",{className:r,...n,children:e})}function V0({children:e,className:t,...n}){const r=J("navbar-nav",t);return d.jsx("ul",{className:r,...n,children:e})}const _e=S.forwardRef(({children:e,className:t,...n},r)=>{const s=J("nav-item",t);return d.jsx("li",{ref:r,className:s,...n,children:e})});_e.displayName="NavItem";function Mo({link:e,className:t,children:n,translate:r,...s}){const i=J("nav-link",t);return d.jsxs("a",{href:e,className:i,...s,children:[n,r&&d.jsx(sr,{children:d.jsx("span",{className:"nav-text",children:r})})]})}const SI=()=>{const{t:e}=ue();return d.jsx("div",{className:"widget-footer",children:d.jsx("div",{className:"widget-footer-action",children:d.jsx("a",{href:"/welcome",className:"link",children:e("plus")})})})},EI=({bookmarkedApps:e})=>{const{t}=ue();return d.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!e.length&&d.jsx("div",{className:"text-dark",children:t("navbar.myapps.more")}),e.slice(0,6).map((n,r)=>d.jsx("a",{href:n.address,className:"bookmarked-app",children:d.jsx(qs,{app:n,size:"32"})},r))]})};function U0({isHelpOpen:e,setIsHelpOpen:t,parsedHeadline:n,parsedContent:r,error:s}){const{t:i}=ue(),o=()=>{t(!1)};return e?vr.createPortal(d.jsxs(Re,{id:"help-modal",isOpen:e,onModalClose:o,scrollable:!0,size:"lg",children:[d.jsx(Re.Header,{onModalClose:o,children:i("navbar.help")}),d.jsx(Re.Subtitle,{children:s?i("help.notfound.title"):n}),d.jsx(Re.Body,{className:s?"d-flex":null,children:s?i("help.notfound.text"):r})]}),document.getElementById("portal")):null}function CI(){var e;const{appCode:t}=Te(),{theme:n}=bd(),[r,s]=S.useState(""),[i,o]=S.useState(!0),[l,a]=S.useState(!1),[u,c]=S.useState(!1),f=n!=null&&n.is1d?"/help-1d":"/help-2d";S.useEffect(()=>{(async()=>{let x="";x=f+"/application/"+t+"/",!t&&window.location.pathname!=="/adapter"?x=f+"/application/portal/":window.location.pathname==="/adapter"?x=f+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?x=f+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(x=f+"/application/userbook/");try{const g=await fetch(x),m=await g.text();if(g.status===404){c(!0);return}s(m),c(!1)}catch(g){c(!0),console.error(g)}})()},[t,f]);const h=ds(r,{replace:x=>{const g=x;if(g.attribs&&g.attribs.id==="TOC")return d.jsxs("nav",{id:"TOC",children:[d.jsx(ze,{onClick:()=>{o(!i)},children:d.jsx(TT,{})}),ru(g.children,{replace:m=>{const v=m;if(v.attribs&&v.name==="ul")return d.jsx("ul",{id:"TOC-list",style:{display:i?"block":"none"},children:ru(v.children,{replace:b=>{const E=b;if(E.attribs&&E.name==="a")return d.jsx("a",{...Lf(E.attribs),children:d.jsx("span",{onClick:()=>{o(!1)},children:ru(E.children)})})}})})}})]});if(g.attribs&&g.attribs.class==="section level2"){const m=Lf(x.attribs);return d.jsx("div",{...m,className:"section level2",style:{display:g.attribs.id!=="présentation"?"none":"block"},children:ru(g.children,{replace:v=>{const b=v;if(b.attribs&&b.name==="img"){const E=v.attribs.src;return d.jsx("img",{...Lf(b.attribs),src:`${f}/${E}`,alt:""})}}})})}}}),y=(e=h==null?void 0:h.props)==null?void 0:e.children.find(x=>x.type==="body").props.children,w=y==null?void 0:y.find(x=>x.type==="p").props.children;return{html:r,visibility:i,isModalOpen:l,setIsModalOpen:a,parsedContent:y,parsedHeadline:w,error:u}}const LE=()=>{const[e,t]=vg(),n=S.useRef(null),r=S.useId(),{t:s}=ue();function i(){if(n.current){const o=n.current.value;window.location.href=`/searchengine#/${o}`}}return d.jsxs(_e,{id:r,ref:e,className:"position-relative","aria-haspopup":"true","aria-expanded":t,children:[d.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[d.jsx(BR,{className:"icon search"}),d.jsx("span",{className:"nav-text",children:s("navbar.search")})]}),d.jsx(jd,{id:r,isVisible:t,className:"d-none d-md-flex",children:d.jsxs(Qe,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[d.jsx(Qe.Input,{ref:n,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),d.jsx(bg,{type:"submit",size:"sm",onClick:i,"aria-label":s("navbar.search")})]})})]})};LE.displayName="SearchEngine";const kI=LE,DE=({is1d:e=!1,src:t=""})=>{const{t:n}=ue(),{messages:r,msgLink:s,zimbraWorkflow:i}=mS(),{user:o,avatar:l}=Ed(),{currentLanguage:a}=Te(),{isModalOpen:u,setIsModalOpen:c,parsedContent:f,parsedHeadline:p,error:h}=CI(),y=J("header",{"no-2d":e,"no-1d":!e}),{title:w,bookmarkedApps:x,appsRef:g,isAppsHovered:m,popoverAppsId:v,userAvatar:b,userName:E,welcomeUser:T,communityWorkflow:C,conversationWorflow:R,searchWorkflow:j,isCollapsed:L,toggleCollapsedNav:A,handleLogout:N}=ES({user:o,avatar:l}),M=r>0;return d.jsx("header",{className:y,children:e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"container-fluid",children:d.jsxs(zf,{children:[d.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:"/timeline/timeline",children:w}),d.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[d.jsx(Ws,{alt:E,size:"sm",src:b,variant:"circle",width:"32",height:"32"}),d.jsx("span",{className:"navbar-text",children:T})]}),d.jsxs(V0,{className:"gap-8","aria-hidden":"false","aria-label":n("navbar.main.navigation"),children:[R&&d.jsx(_e,{children:d.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[d.jsx(FR,{className:"icon notification"}),M&&d.jsx($f,{children:r}),d.jsx(sr,{children:n("navbar.messages")})]})}),d.jsx(_e,{children:d.jsx(Mo,{link:"/userbook/mon-compte",className:"dropdown-item",translate:n("navbar.myaccount"),children:d.jsx(p2,{className:"icon user"})})}),a==="fr"?d.jsxs(_e,{children:[d.jsxs("button",{className:"nav-link",onClick:()=>{c(!0)},children:[d.jsx(LR,{className:"icon help"}),d.jsx(sr,{children:n("navbar.help")})]}),d.jsx(U0,{isHelpOpen:u,setIsHelpOpen:c,parsedContent:f,parsedHeadline:p,error:h})]}):null,d.jsx(_e,{children:d.jsxs("button",{className:"nav-link",onClick:N,children:[d.jsx(d0,{className:"icon logout"}),d.jsx(sr,{children:n("navbar.disconnect")})]})}),d.jsx(_e,{className:"d-md-none",children:d.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!L,"aria-label":n("navbar.secondary.navigation"),onClick:A,children:d.jsx(Na,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),d.jsx(zf,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":n("navbar.secondary.navigation"),children:d.jsx("div",{className:"container-fluid",children:d.jsxs("div",{className:`collapse navbar-collapse ${L?"":"show"}`,id:"navbarCollapsed",children:[d.jsx(kh,{is1d:!0,src:`${t}/img/illustrations/logo.png`,translate:n("navbar.home")}),d.jsxs(V0,{className:"gap-8",children:[d.jsx(_e,{children:d.jsxs("a",{href:"/timeline/timeline",className:"button",children:[d.jsx(_R,{color:"#fff",className:"d-md-none"}),d.jsx("span",{className:"d-inline-block",children:n("portal.header.navigation.whatsnew")})]})}),d.jsx(_e,{children:d.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[d.jsx(UR,{color:"#fff",className:"d-md-none"}),d.jsx("span",{className:"d-inline-block",children:n("portal.header.navigation.classMembers")})]})}),d.jsx(_e,{children:d.jsxs("a",{href:"/welcome",className:"button",children:[d.jsx(f0,{color:"#fff",className:"d-md-none"}),d.jsx("span",{className:"d-inline-block",children:n("portal.header.navigation.myapps")})]})})]})]})})})]}):d.jsx(zf,{className:"navbar-expand-md",children:d.jsxs("div",{className:"container-fluid",children:[d.jsx(kh,{src:`${t}/img/illustrations/logo.png`}),d.jsx("a",{href:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:w}),d.jsxs("ul",{className:"navbar-nav",children:[d.jsx(_e,{children:d.jsx(Mo,{link:"/timeline/timeline",translate:n("navbar.home"),children:d.jsx(PR,{color:"#fff"})})}),d.jsxs(_e,{className:"position-relative",ref:g,id:v,"aria-haspopup":"true","aria-expanded":m,children:[d.jsx(Mo,{link:"/welcome",translate:n("navbar.applications"),children:d.jsx(f0,{color:"#fff"})}),d.jsxs(jd,{className:"top-100 widget",id:v,isVisible:m,children:[d.jsx(kE,{children:d.jsx(EI,{bookmarkedApps:x})}),d.jsx(TE,{className:"widget-footer border-top border-ghost",children:d.jsx(SI,{})})]})]}),R&&d.jsx(_e,{children:d.jsxs(Mo,{className:"position-relative",link:"/conversation/conversation",translate:n("conversation"),children:[d.jsx(p0,{color:"#fff"}),M&&d.jsx($f,{children:r})]})}),i&&d.jsx(_e,{children:d.jsxs(Mo,{className:"position-relative",link:s,translate:n("conversation"),children:[d.jsx(p0,{color:"#fff"}),M&&d.jsx($f,{children:r})]})}),a==="fr"?d.jsxs(_e,{children:[d.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{c(!0)},children:[d.jsx(NR,{color:"#fff"}),d.jsx(sr,{children:n("support")})]}),d.jsx(U0,{isHelpOpen:u,setIsHelpOpen:c,parsedContent:f,parsedHeadline:p,error:h})]}):null,d.jsx(_e,{children:d.jsxs("div",{className:"dropdown",children:[d.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!L,"aria-label":n("navbar.open.menu"),onClick:A,children:d.jsx(Na,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),d.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${L?"":"show"}`,id:"dropdown-navbar",children:[C&&d.jsx(_e,{children:d.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[d.jsx(kR,{className:"icon community"}),d.jsx("span",{className:"nav-text",children:n("navbar.community")})]})}),j?d.jsx(kI,{}):null,d.jsx(_e,{children:d.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[d.jsx(Ws,{alt:E,size:"sm",src:b,variant:"circle",className:"bg-white",width:"32",height:"32"}),d.jsx("span",{className:"nav-text",children:n("navbar.myaccount")})]})}),d.jsx(_e,{children:d.jsx("hr",{className:"dropdown-divider"})}),d.jsx(_e,{children:d.jsxs("a",{href:"/auth/logout?callback=",className:"nav-link dropdown-item",children:[d.jsx(d0,{className:"icon logout"}),d.jsx("span",{id:"logout-label",className:"nav-text",children:n("navbar.disconnect")})]})})]})]})})]})]})})})};DE.displayName="Header";const TI=DE;function FE({children:e,className:t,...n}){const r=J("container-fluid",t);return d.jsx("main",{className:r,...n,children:e})}FE.displayName="Main";const $E=({children:e,...t})=>{const{theme:n}=bd();return d.jsxs(d.Fragment,{children:[d.jsx(TI,{is1d:n==null?void 0:n.is1d,src:n==null?void 0:n.basePath}),d.jsx(FE,{className:J("d-flex flex-column bg-white",{"rounded-4 border":n==null?void 0:n.is1d,"mt-24":n==null?void 0:n.is1d}),...t,children:e}),d.jsx(Hj,{toastOptions:{position:"top-right"}})]})};$E.displayName="Layout";const zE=$E,jI=({children:e})=>d.jsx("div",{className:"widget-footer",children:d.jsx("div",{className:"widget-footer-action",children:d.jsx("a",{href:"/welcome",className:"link",children:e})})}),PI=({children:e})=>d.jsxs("div",{className:"widget-header",children:[d.jsx("div",{className:"subtitle",children:e}),d.jsx("div",{className:"widget-options",children:d.jsx("div",{className:"widget-handle",children:d.jsx("i",{className:"fas fa-grip-vertical"})})})]}),OI=({children:e})=>d.jsx("div",{className:"widget-body p-12 d-flex flex-wrap",children:e});function Sl({children:e}){return d.jsx("div",{className:"widget",children:e})}Sl.Header=PI;Sl.Body=OI;Sl.Footer=jI;Sl.displayName="Widget";const BE=({data:e})=>e.length>0?e.slice(0,6).map((t,n)=>d.jsx("a",{href:t.address,className:"bookmarked-app",children:d.jsx(qs,{app:t,size:"32"})},n)):d.jsx("div",{className:"text-dark mx-auto",children:d.jsx("a",{href:"/welcome",children:"Sélectionner vos applications favorites"})});BE.displayName="BookmarkedApps";const RI=BE,NI=Object.freeze(Object.defineProperty({__proto__:null,ActionBar:n6,Alert:Vr,AppHeader:cS,AppIcon:qs,Avatar:Ws,BookmarkedApps:RI,Breadcrumb:FS,Button:ze,Card:g6,Checkbox:Cd,Column:Eg,Combobox:pE,Dropdown:Ee,EmptyScreen:O6,FormControl:Qe,FormText:ZS,Grid:Ri,Heading:an,IconButton:hr,Image:ho,ImagePicker:Cg,Input:rs,Label:_s,Layout:zE,Library:R6,Loading:xg,LoadingScreen:_t,Logo:kh,Modal:Re,OdeClientContext:hg,OdeClientProvider:fS,OnboardingModal:H6,Popover:jd,PopoverBody:kE,PopoverFooter:TE,PopoverHeader:L6,PublishModal:nI,Radio:Nc,ResourceModal:aI,SearchButton:bg,Select:Tg,ShareModal:bI,TextArea:jg,ThemeContext:mg,ThemeProvider:pS,Tooltip:OE,TreeView:IE,VisuallyHidden:sr,Widget:Sl,isActionAvailable:Ac,libraryMaps:wg,useBookmark:hS,useClickOutside:gg,useConf:pg,useConversation:mS,useDebounce:wS,useDropdown:dE,useDropzone:SS,useHasWorkflow:Oi,useHeader:ES,useHover:vg,useImage:gS,useIsAdml:CS,useKeyPress:vS,useLibraryUrl:o6,useOdeClient:Te,useOdeIcons:Sd,useOdeTheme:bd,usePaths:Ys,useScrollToTop:bS,useSession:dS,useTitle:yS,useToast:ht,useToggle:yg,useTrapFocus:xS,useUser:Ed,useXitiTrackPageLoad:kS},Symbol.toStringTag,{value:"Module"}));var AI=function(){return null},VE,H0=vr;VE=H0.createRoot,H0.hydrateRoot;const ps=document.querySelector("[data-explorer-config]");let q0;function II(){var e;if((e=ps==null?void 0:ps.dataset)!=null&&e.explorerConfig){const{explorerConfig:t}=ps.dataset;try{const n=JSON.parse(t);q0=Object.assign({},n)}catch(n){console.error("[Explorer Config] could not parse app params from root data attributes:",ps==null?void 0:ps.dataset,n)}}return q0}const W0=e=>{let t;const n=new Set,r=(a,u)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(p=>p(t,f))}},s=()=>t,l={setState:r,getState:s,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return t=e(r,s,l),l},_I=e=>e?W0(e):W0;var UE={exports:{}},HE={},qE={exports:{}},WE={};/**
|
|
222
222
|
* @license React
|
|
223
223
|
* use-sync-external-store-shim.production.min.js
|
|
224
224
|
*
|
|
@@ -226,7 +226,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
226
226
|
*
|
|
227
227
|
* This source code is licensed under the MIT license found in the
|
|
228
228
|
* LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/var ao=S;function
|
|
229
|
+
*/var ao=S;function MI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var LI=typeof Object.is=="function"?Object.is:MI,DI=ao.useState,FI=ao.useEffect,$I=ao.useLayoutEffect,zI=ao.useDebugValue;function BI(e,t){var n=t(),r=DI({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return $I(function(){s.value=n,s.getSnapshot=t,Bf(s)&&i({inst:s})},[e,n,t]),FI(function(){return Bf(s)&&i({inst:s}),e(function(){Bf(s)&&i({inst:s})})},[e]),zI(n),n}function Bf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!LI(e,n)}catch{return!0}}function VI(e,t){return t()}var UI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?VI:BI;WE.useSyncExternalStore=ao.useSyncExternalStore!==void 0?ao.useSyncExternalStore:UI;qE.exports=WE;var HI=qE.exports;/**
|
|
230
230
|
* @license React
|
|
231
231
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
232
232
|
*
|
|
@@ -234,4 +234,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
234
234
|
*
|
|
235
235
|
* This source code is licensed under the MIT license found in the
|
|
236
236
|
* LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/var Pd=S,q6=H6;function W6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var G6=typeof Object.is=="function"?Object.is:W6,Q6=q6.useSyncExternalStore,K6=Pd.useRef,X6=Pd.useEffect,Y6=Pd.useMemo,J6=Pd.useDebugValue;HE.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=K6(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=Y6(function(){function a(h){if(!u){if(u=!0,c=h,h=r(h),s!==void 0&&o.hasValue){var y=o.value;if(s(y,h))return f=y}return f=h}if(y=f,G6(c,h))return y;var w=r(h);return s!==void 0&&s(y,w)?y:(c=h,f=w)}var u=!1,c,f,p=n===void 0?null:n;return[function(){return a(t())},p===null?void 0:function(){return a(p())}]},[t,n,r,s]);var l=Q6(e,i[0],i[1]);return X6(function(){o.hasValue=!0,o.value=l},[l]),J6(l),l};UE.exports=HE;var Z6=UE.exports;const e_=il(Z6),{useDebugValue:t_}=ee,{useSyncExternalStoreWithSelector:n_}=e_;function r_(e,t=e.getState,n){const r=n_(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return t_(r),r}const G0=e=>{const t=typeof e=="function"?_6(e):e,n=(r,s)=>r_(t,r,s);return Object.assign(n,t),n},s_=e=>e?G0(e):G0,GE=async e=>{const t=await ae.resource(e.app).searchContext(e);return{...t,folders:t.folders.filter(n=>!n.trashed)}},i_=async({searchParams:e,name:t,parentId:n})=>{const r={name:t,parentId:n,app:e.app,type:e.types[0]};return await ae.resource(e.app).createFolder(r)},o_=async({folderId:e,searchParams:t,parentId:n,name:r})=>{const s={folderId:e,name:r,parentId:n,app:t.app,type:t.types[0]};return await ae.resource(t.app).updateFolder(s)},a_=async({searchParams:e,resourceIds:t,useAssetIds:n,folderIds:r})=>{const s={application:e.app,resourceType:e.types[0],resourceIds:t,folderIds:r};return await ae.resource(e.app).trashAll(s,n)},l_=async({searchParams:e,resourceIds:t,useAssetIds:n,folderIds:r})=>{const s={application:e.app,resourceType:e.types[0],resourceIds:t,folderIds:r};return await ae.resource(e.app).deleteAll(s,n)},u_=async({searchParams:e,resourceIds:t,folderIds:n,useAssetIds:r})=>{const s={application:e.app,resourceType:e.types[0],resourceIds:t,folderIds:n};return await ae.resource(e.app).restoreAll(s,r)},c_=async({searchParams:e,resourceIds:t,folderId:n,folderIds:r,useAssetIds:s})=>{const i={application:e.app,folderId:n,resourceIds:t,folderIds:r};return await ae.resource(e.app).moveToFolder(i,s)},d_=async({app:e,resourceId:t,rights:n})=>await ae.share().saveRights(e,t,n),f_=async({app:e,params:t})=>await ae.resource(e).update(t),p_=async e=>await ae.rights().sessionHasWorkflowRights(e),h_=({searchParams:e,assetId:t})=>ae.resource(e.app).gotoView(t),m_=({searchParams:e,params:t})=>ae.resource(e.app).create(t),g_=({searchParams:e,assetId:t})=>ae.resource(e.app).gotoPrint(t);function Pg(e){return e.filter((t,n)=>e.indexOf(t)===n)}function Wa(e,t){var r,s;let n;return(t==null?void 0:t.id)===e?t:((r=t==null?void 0:t.children)!=null&&r.length&&((s=t==null?void 0:t.children)==null||s.every(i=>(n=Wa(e,i),n===void 0))),n)}function v_(e,t){var r;const n=Wa(e,t);return(r=n==null?void 0:n.folder)!=null&&r.ancestors?[...(n==null?void 0:n.folder.ancestors)||[],e]:e===Mt.BIN?[Mt.BIN]:[Mt.DEFAULT]}function QE(e,t){return t.id===e&&t.children?t.children.length>0:t.children?t.children.some(n=>QE(t.id,n)):!1}function El(e,t){return KE(e,t)||e}function KE(e,t,n){var s;const r=t(e,n);if((s=r==null?void 0:r.children)!=null&&s.length){const i=[];for(const o of(r==null?void 0:r.children)||[]){const l=KE(o,t,r);l&&i.push(l)}return{...r,children:i}}return r}class Od{constructor(t){ei(this,"id");ei(this,"name");ei(this,"childNumber");ei(this,"section",!1);ei(this,"children",[]);this.folder=t,this.id=t.id,this.name=t.name,this.childNumber=t.childNumber}}const XE=(e,t,n)=>El(e,r=>(r.id===n&&(r.children=t==null?void 0:t.map(s=>new Od(s))),r)),Ye=s_()((e,t)=>({config:null,searchConfig:{minLength:1},searchParams:{app:"",types:[],filters:{folder:"default",owner:void 0,shared:void 0,public:void 0},orders:{updatedAt:"desc"},pagination:{startIdx:0,pageSize:48,maxIdx:0},trashed:!1},treeData:{id:Mt.DEFAULT,name:Pt("explorer.filters.mine"),section:!0,children:[]},selectedNodesIds:["default"],currentFolder:{id:"default"},selectedFolders:[],selectedResources:[],folderIds:[],resourceIds:[],resourceIsTrash:!1,resourceActionDisable:!1,status:void 0,updaters:{setConfig:n=>e({config:n}),setSearchConfig:n=>e(r=>({searchConfig:{...r.searchConfig,...n}})),setTreeData:n=>e(()=>({treeData:n})),setSearchParams:n=>{e(r=>{const{searchParams:s}=r;return s.search!==n.search?n.search?{...r,selectedFolders:[],selectedNodesIds:[],selectedResources:[],currentFolder:void 0,searchParams:{...s,...n,trashed:!1,filters:{...s.filters,folder:void 0}}}:{...r,selectedFolders:[],selectedNodesIds:["default"],selectedResources:[],currentFolder:{id:"default"},searchParams:{...s,...n,trashed:!1,filters:{...s.filters}}}:{searchParams:{...s,...n}}})},setSelectedFolders:n=>e(()=>({selectedFolders:n})),setSelectedResources:n=>e(()=>({selectedResources:n})),setFolderIds:n=>e(()=>({folderIds:n})),setResourceIds:n=>e(()=>({resourceIds:n})),setResourceIsTrash:n=>e(()=>({resourceIsTrash:n})),setResourceActionDisable:n=>e(()=>({resourceActionDisable:n})),setCurrentFolder:n=>e(()=>({currentFolder:n})),clearSelectedItems:()=>e(()=>({selectedFolders:[],selectedResources:[]})),clearSelectedIds:()=>e(()=>({resourceIds:[],folderIds:[]})),openResource:n=>{try{const{searchParams:r}=t();h_({searchParams:r,assetId:n.assetId})}catch(r){console.error("explorer open failed: ",r)}},printSelectedResource:()=>{try{const{searchParams:n,selectedResources:r,resourceIds:s}=t();if(r.length!==1)throw new Error("Cannot open more than 1 resource");const i=r.find(o=>o.id===s[0]);g_({searchParams:n,assetId:i.assetId})}catch(n){console.error("explorer print failed: ",n)}},openFolder:({folderId:n,folder:r})=>{const{searchParams:s,treeData:i}=t(),o=s.filters.folder,l=v_(n,i),a=Pg([...l,n]);o!==n&&e(u=>({...u,folderIds:[],resourceIds:[],selectedNodesIds:a,currentFolder:r||{id:n},searchParams:{...s,search:void 0,filters:{...s.filters,folder:n},trashed:n===Mt.BIN}}))},foldTreeItem:()=>e(n=>({...n,status:"fold"})),unfoldTreeItem:async(n,r)=>{const{treeData:s,searchParams:i}=t();if(e(o=>({...o,status:"unfold"})),!QE(n,s)){await r.prefetchInfiniteQuery({queryKey:["prefetchContext",{folderId:n,trashed:!1}],queryFn:async()=>await GE({...i,filters:{...i.filters,folder:n}})});const o=r.getQueryData(["prefetchContext",{folderId:n,trashed:!1}]);e(l=>{var a;return{...l,treeData:XE(s,(a=o==null?void 0:o.pages[0])==null?void 0:a.folders,n||Mt.DEFAULT)}})}},selectTreeItem:n=>{const{treeData:r}=t(),{openFolder:s}=t().updaters,i=Wa(n,r);bS()(),e(l=>({...l,searchParams:{...l.searchParams,search:void 0},status:"select",selectedResources:[]})),s({folder:i,folderId:n})},gotoPreviousFolder:()=>{const{selectedNodesIds:n,treeData:r}=t(),{openFolder:s}=t().updaters,i=n.length;if(i<2)return;const o=Wa(n[i-2],r);s({folder:o,folderId:(o==null?void 0:o.id)||Mt.DEFAULT})},goToTrash:()=>e(n=>({...n,selectedNodesIds:[],selectedResources:[],resourceIds:[],folderIds:[],status:"select",searchParams:{...n.searchParams,search:void 0,filters:{folder:Mt.BIN},trashed:!0},currentFolder:{id:Mt.BIN}}))}})),Rt=()=>Ye(e=>e.searchParams),Og=()=>Ye(e=>e.selectedNodesIds),go=()=>Ye(e=>e.treeData),u7=()=>Ye(e=>e.selectedFolders),c7=()=>Ye(e=>e.selectedResources),y_=()=>Ye(e=>e.searchConfig),Rd=()=>Ye(e=>e.folderIds),Nd=()=>Ye(e=>e.resourceIds),Ad=()=>Ye(e=>e.selectedResources.map(t=>t.assetId)),Id=()=>Ye(e=>e.selectedResources.filter(t=>t.assetId===t.id)),Cl=()=>Ye(e=>e.currentFolder),mt=()=>Ye(e=>e.updaters),Rg=()=>{const e=Cl();return(e==null?void 0:e.id)===Mt.BIN},w_=()=>Ye(e=>e.resourceIsTrash),x_=()=>Ye(e=>e.resourceActionDisable),b_=()=>{const e=Cl();return(e==null?void 0:e.id)==="default"},S_=()=>Og().length>1,E_=()=>Ye(e=>e.status),YE=()=>{const e=Rt(),[t,n]=S.useState(""),r=y_(),s=E_(),i=S.useRef(null),{setSearchParams:o}=mt(),l=c=>{const f=c.target.value;n(f.toString())},a=c=>{(c.key==="Enter"||c.key==="Return")&&(c.preventDefault(),o({search:t||void 0}))},u=c=>{c.preventDefault(),o({search:t||void 0})};return S.useEffect(()=>{const f=t.length==0||t.length>=r.minLength?{search:t||void 0}:{};o({...e,...f})},[t,r.minLength]),S.useEffect(()=>{s==="select"&&n("")},[s]),S.useEffect(()=>{n(()=>{var c;return((c=e.search)==null?void 0:c.toString())??""})},[e]),{formRef:i,inputSearch:t,handleInputSearchChange:l,handleKeyPress:a,handleSearchSubmit:u}};function C_(){const{appCode:e}=Te(),{gotoPreviousFolder:t}=mt(),{t:n}=ue(),{inputSearch:r}=YE(),s=Og(),i=Rg(),o=Cl(),l=n("explorer.tree.trash"),a=n("explorer.tree.search"),u=n("explorer.filters.mine",{ns:e}),c=(o==null?void 0:o.name)||u;return d.jsx("div",{className:"py-16",children:s.length>1&&!i?d.jsxs("div",{className:"d-flex align-items-center gap-8",children:[d.jsx(hr,{icon:d.jsx(bT,{}),variant:"ghost",color:"tertiary","aria-label":n("back"),className:"ms-n16",onClick:t}),d.jsx("p",{className:"body py-8 text-truncate",children:d.jsx("strong",{children:c})})]}):d.jsx("h2",{className:"body py-8 fw-bold",children:r.length!==0?a:i?l:u})})}const k_=()=>{const e=x_(),{clearSelectedIds:t,setResourceActionDisable:n,clearSelectedItems:r}=mt();return{isActionDisableModalOpen:e,onActionDisableCancel:()=>{t(),r(),n(!1)}}},T_=()=>{const e=w_(),{clearSelectedIds:t,setResourceIsTrash:n,clearSelectedItems:r}=mt();return{isTrashedModalOpen:e,onTrashedCancel:()=>{t(),r(),n(!1)}}};function j_(e,{parentId:t,newFolder:n}){return El(e,r=>{var s;if(r.id===t){const i=[...((s=r.folder)==null?void 0:s.ancestors)||[]],o=Pg([...i,r.id]);return{...r,children:[...r.children||[],new Od({...n,ancestors:o})]}}else return r})}function P_(e,{folders:t}){return El(e,n=>{if(!t.includes(n.id))return n})}function O_(e,{destinationId:t,folders:n}){return El(e,(r,s)=>{var i,o;if(t===r.id){const l=[...((i=r.folder)==null?void 0:i.ancestors)||[]],a=Pg([...l,r.id]),u=[...r.children||[]],c=((o=r.children)==null?void 0:o.map(p=>p.id))||[];for(const p of n)if(!c.includes(p)){const h=Wa(p,e);h&&u.push({...h,folder:{...h==null?void 0:h.folder,ancestors:a}})}return{...r,children:u}}else return n.includes(r.id)&&t!==(s==null?void 0:s.id)?void 0:r})}function R_(e,{folderId:t,newFolder:n}){return El(e,r=>r.id===t?new Od(n):r)}const N_=()=>{const e=Ye(t=>t.config);return Ih({queryKey:["actions"],queryFn:async()=>{const t=e.actions.map(r=>r.workflow);return await p_(t)},select:t=>e.actions.map(n=>({...n,available:t[n.workflow]})),staleTime:1/0,enabled:!!e})},A_=()=>{const e=Ye(o=>o.config),t=Rt(),{filters:n,trashed:r,search:s}=t,i=["context",{folderId:n.folder,filters:n,trashed:r,search:s}];return Y4({queryKey:i,queryFn:async({pageParam:o})=>await GE({...t,app:e==null?void 0:e.app,types:e==null?void 0:e.types,pagination:{...t.pagination,startIdx:o}}),initialPageParam:0,enabled:!!e,retry:!1,getNextPageParam:o=>o.pagination.startIdx+o.pagination.pageSize})},d7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),s=Rd(),i=Ad(),o=Nd(),l=Id().length>0,a=l?i:o,{clearSelectedItems:u,clearSelectedIds:c,setTreeData:f,setSearchParams:p}=mt(),{filters:h,trashed:y}=n,w=["context",{folderId:h.folder,filters:h,trashed:y}];return mr({mutationFn:async()=>await a_({searchParams:n,folderIds:s,resourceIds:a,useAssetIds:l}),onError(x){typeof x=="string"&&e.error(Pt(x))},onSuccess:async x=>{if(await t.cancelQueries({queryKey:w}),t.getQueryData(w))return e.success(Pt("explorer.trash.title")),t.setQueryData(w,m=>{var v;if(m){const b={...m,pages:m==null?void 0:m.pages.map(T=>{var C;return{...T,folders:T.folders.filter(R=>!s.includes(R.id)),pagination:{...T.pagination,maxIdx:((C=T==null?void 0:T.pagination)==null?void 0:C.maxIdx)-x.resources.length},resources:T.resources.filter(R=>l?!i.includes(R.assetId):!a.includes(R.id))}})},E=P_(r,{folders:s});return f(E),p({...n,pagination:{...n.pagination,maxIdx:((v=n.pagination)==null?void 0:v.maxIdx)-x.resources.length}}),b}})},onSettled:()=>{u(),c()}})},f7=()=>{const e=ht(),t=pn(),n=Rt(),r=Rd(),s=Ad(),i=Nd(),o=Id().length>0,l=o?s:i,{setFolderIds:a,setResourceIds:u,setSelectedResources:c,setSelectedFolders:f}=mt(),{filters:p,trashed:h}=n,y=["context",{folderId:p.folder,filters:p,trashed:h}];return mr({mutationFn:async()=>await u_({searchParams:n,folderIds:r,resourceIds:l,useAssetIds:o}),onError(w){typeof w=="string"&&e.error(Pt(w))},onSuccess:async()=>{if(await t.cancelQueries({queryKey:y}),t.getQueryData(y))return e.success(Pt("explorer.trash.toast")),t.setQueryData(y,x=>{if(x)return{...x,pages:x==null?void 0:x.pages.map(g=>({...g,folders:g.folders.filter(m=>!r.includes(m.id)),resources:g.resources.filter(m=>o?!s.includes(m.assetId):!l.includes(m.id))}))}})},onSettled:()=>{u([]),c([]),a([]),f([])}})},p7=()=>{const e=ht(),t=pn(),n=Rt(),r=Rd(),s=Ad(),i=Nd(),o=Id().length>0,l=o?s:i,{clearSelectedItems:a,clearSelectedIds:u}=mt(),{filters:c,trashed:f}=n,p=["context",{folderId:c.folder,filters:c,trashed:f}];return mr({mutationFn:async()=>await l_({searchParams:n,folderIds:r,resourceIds:l,useAssetIds:o}),onError(h){typeof h=="string"&&e.error(Pt(h))},onSuccess:async()=>{if(await t.cancelQueries({queryKey:p}),t.getQueryData(p))return e.success(Pt("explorer.removed.from.trash")),t.setQueryData(p,y=>{if(y)return{...y,pages:y==null?void 0:y.pages.map(x=>({...x,folders:x.folders.filter(g=>!r.includes(g.id)),resources:x.resources.filter(g=>o?!s.includes(g.assetId):!l.includes(g.id))}))}})},onSettled:()=>{a(),u()}})},h7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),s=Rd(),i=Ad(),o=Nd(),l=Id().length>0,a=l?i:o,{clearSelectedIds:u,clearSelectedItems:c,setTreeData:f,setSearchParams:p}=mt(),{filters:h,trashed:y}=n,w=["context",{folderId:h.folder,filters:h,trashed:y}];return mr({mutationFn:async x=>await c_({searchParams:n,folderId:x,folderIds:s,resourceIds:a,useAssetIds:l}),onError(x){typeof x=="string"&&e.error(Pt(x))},onSuccess:async(x,g)=>{if(t.getQueryData(w))return t.setQueryData(w,v=>{var b;if(v){const E=O_(r,{destinationId:g,folders:s}),T={...v,pages:v==null?void 0:v.pages.map(C=>{var R;return{...C,folders:C.folders.filter(j=>!s.includes(j.id)),pagination:{...C.pagination,maxIdx:((R=C.pagination)==null?void 0:R.maxIdx)-x.resources.length},resources:C.resources.filter(j=>l?!i.includes(j.assetId):!a.includes(j.id))}})};return f(E),p({...n,pagination:{...n.pagination,maxIdx:((b=n.pagination)==null?void 0:b.maxIdx)-x.resources.length}}),T}})},onSettled:()=>{c(),u()}})},m7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),{setTreeData:s}=mt(),{filters:i,trashed:o}=n,l=["context",{folderId:i.folder,filters:i,trashed:o}];return mr({mutationFn:async({name:a,parentId:u})=>await i_({searchParams:n,name:a,parentId:u}),onError(a){typeof a=="string"&&e.error(Pt(a))},onSuccess:async(a,u)=>{await t.cancelQueries({queryKey:l});const c=t.getQueryData(l),f={...a,parentId:u.parentId,children:[],rights:[`creator:${a==null?void 0:a.creator_id}`]};if(c)return t.setQueryData(l,p=>{if(p){const h={...p,pages:p==null?void 0:p.pages.map(w=>({...w,folders:[...w.folders,f]}))},y=j_(r,{parentId:u.parentId,newFolder:f});return s(y),h}})}})},g7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),{setFolderIds:s,setSelectedFolders:i,setTreeData:o}=mt(),{filters:l,trashed:a}=n,u=["context",{folderId:l.folder,filters:l,trashed:a}];return mr({mutationFn:async({folderId:c,name:f,parentId:p})=>await o_({searchParams:n,folderId:c,parentId:p,name:f}),onError(c){typeof c=="string"&&e.error(Pt(c))},onSuccess:async(c,f)=>{if(await t.cancelQueries({queryKey:u}),t.getQueryData(u))return t.setQueryData(u,h=>{if(h){const y={...h,pages:h==null?void 0:h.pages.map(x=>({...x,folders:x.folders.map(g=>g.id===c.id?{...c,parentId:f.parentId,rights:g.rights}:g)}))},w=R_(r,{folderId:f.folderId,newFolder:c});return o(w),y}})},onSettled:()=>{s([]),i([])}})},v7=()=>{const e=ht(),t=pn(),n=Rt(),{setResourceIds:r,setSelectedResources:s}=mt(),{filters:i,trashed:o,app:l}=n,a=["context",{folderId:i.folder,filters:i,trashed:o}];return mr({mutationFn:async({resourceId:u,rights:c})=>await d_({app:l,resourceId:u,rights:c}),onError(u){typeof u=="string"&&e.error(Pt("explorer.shared.status.error"))},onSuccess:async(u,c)=>{if(await t.cancelQueries({queryKey:a}),t.getQueryData(a))return e.success(Pt("explorer.shared.status.saved")),t.setQueryData(a,p=>{if(p)return{...p,pages:p==null?void 0:p.pages.map(h=>({...h,resources:h.resources.map(y=>{if(y.assetId===(c==null?void 0:c.resourceId)){let w=[`creator:${y.creatorId}`];return(c==null?void 0:c.rights.length)>=1&&(w=[...w,...c.rights.flatMap(x=>x.actions.map(g=>`${x.type}:${x.id}:${g.id}`))]),{...y,rights:w}}else return y})}))}})},onSettled:()=>{r([]),s([])}})},y7=()=>{const e=ht(),t=pn(),n=Rt(),{filters:r,trashed:s,app:i}=n,o=["context",{folderId:r.folder,filters:r,trashed:s}];return mr({mutationFn:async l=>await f_({app:i,params:l}),onError(l){typeof l=="string"&&e.error(Pt(l))},onSuccess:async(l,a)=>{if(await t.cancelQueries({queryKey:o}),t.getQueryData(o))return t.setQueryData(o,c=>{if(c)return{...c,pages:c==null?void 0:c.pages.map(f=>({...f,resources:f.resources.map(p=>{if(p.assetId===(a==null?void 0:a.entId)){const{name:h,thumbnail:y,public:w,description:x,slug:g,...m}=a;return{...p,...m,name:h,thumbnail:typeof y=="string"?y:URL.createObjectURL(y),public:w,description:x,slug:g}}else return p})}))}})}})},w7=()=>{const e=ht(),t=pn(),n=Rt(),{user:r}=Ed(),{appCode:s}=Te(),i=["context",{folderId:n.filters.folder,filters:n.filters,trashed:n.trashed}];return mr({mutationFn:async o=>await m_({searchParams:n,params:o}),onError(o){typeof o=="string"&&e.error(Pt(o))},onSuccess:async(o,l)=>{var f,p,h;await t.cancelQueries({queryKey:i});const a=t.getQueryData(i),{thumbnail:u}=l,c={...l,thumbnail:u?URL.createObjectURL(u):"",application:s,assetId:o._id||o.entId||"",id:o._id||o.entId||"",creatorId:r==null?void 0:r.userId,creatorName:r==null?void 0:r.username,createdAt:Date.now(),slug:l.slug||"",modifiedAt:((f=o.modified)==null?void 0:f.$date)||"",modifierId:((p=o.author)==null?void 0:p.userId)||"",modifierName:((h=o.author)==null?void 0:h.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${r==null?void 0:r.userId}`]};if(a)return t.setQueryData(i,y=>{if(y)return{...y,pages:y==null?void 0:y.pages.map(w=>({...w,resources:[c,...w.resources]}))}})}})},I_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenApp.js"),[])),__=S.lazy(async()=>await Ot(()=>import("./EmptyScreenSearch.js"),[])),M_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenError.js"),[])),L_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenNoContentInFolder.js"),[])),D_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenTrash.js"),[])),F_=S.lazy(async()=>await Ot(()=>import("./FoldersList.js"),[])),$_=S.lazy(async()=>await Ot(()=>import("./ResourcesList.js"),[])),z_=()=>{const e=b_(),t=Rg(),n=S_(),r=Rt(),s=Cl(),i=go(),o=ht(),{appCode:l}=Te(),{t:a}=ue(),{setSearchParams:u,setSearchConfig:c,setTreeData:f}=mt(),{data:p,isError:h,error:y,isLoading:w,isFetching:x,fetchNextPage:g}=A_(),m=(p==null?void 0:p.pages[0].folders.length)===0,v=(p==null?void 0:p.pages[0].resources.length)===0,b=m&&v;return S.useEffect(()=>{var E,T,C;if(p){const R=[...((E=p==null?void 0:p.pages[0])==null?void 0:E.folders)??[]];(T=p==null?void 0:p.pages[0])!=null&&T.searchConfig&&c(p.pages[0].searchConfig),r.search||((s==null?void 0:s.id)==="default"?f({id:Mt.DEFAULT,section:!0,children:R.map(j=>new Od(j)),name:a("explorer.filters.mine",{ns:l})}):f(XE(i,R,r.filters.folder||Mt.DEFAULT))),u({...r,pagination:(C=p==null?void 0:p.pages[(p==null?void 0:p.pages.length)-1])==null?void 0:C.pagination})}},[p]),S.useEffect(()=>{y&&typeof y=="string"&&o.error(a(y))},[y]),w?d.jsx(_t,{}):h?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(M_,{})}):r.search&&b?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(__,{})}):e&&b?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(I_,{})}):n&&b&&!t?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(L_,{})}):t&&(p==null?void 0:p.pages[0].resources.length)===0?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(D_,{})}):d.jsxs(S.Suspense,{fallback:d.jsx(_t,{}),children:[d.jsx(F_,{data:p,isFetching:x}),d.jsx($_,{data:p,isFetching:x,fetchNextPage:g})]})},B_=()=>{const{appCode:e,currentApp:t}=Te(),{t:n}=ue(),[r,s]=S.useState(""),i=c=>{if(c==="0"){s("");return}s(c)},o=Cl(),l=Rt(),{setSearchParams:a}=mt();S.useEffect(()=>{const c=()=>r.includes("1")?!0:void 0,f=()=>r.includes("2")?!0:void 0,p=()=>r.includes("7")?!0:void 0;a({...l,filters:{owner:c(),public:p(),shared:f(),folder:o?o.id:"default"}})},[o,a,r]);const u=[{label:n("explorer.filter.all",{ns:e}),value:"0"},{label:n("explorer.filter.owner",{ns:e}),value:"1"},{label:n("explorer.filter.shared",{ns:e}),value:"2"},...(t==null?void 0:t.displayName)==Ho.EXERCIZER?[{label:"Exercices interactifs",value:"3"}]:[],...(t==null?void 0:t.displayName)==Ho.EXERCIZER?[{label:"Exercices à rendre",value:"4"}]:[],...(t==null?void 0:t.displayName)=="pages"?[{label:"Projets publics",value:"5"}]:[],...(t==null?void 0:t.displayName)=="pages"?[{label:"Projets internes",value:"6"}]:[],...(t==null?void 0:t.displayName)==Ho.BLOG?[{label:n("explorer.filter.public",{ns:e}),value:"7"}]:[]];return{selectedFilters:r,options:u,handleOnSelectFilter:i}},V_=()=>{const{appCode:e}=Te(),{t}=ue(),{selectedFilters:n,options:r,handleOnSelectFilter:s}=B_(),{formRef:i,inputSearch:o,handleInputSearchChange:l,handleKeyPress:a,handleSearchSubmit:u}=YE(),c=n.length>0?n.length:void 0;return d.jsxs("form",{noValidate:!0,className:"bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8",ref:i,children:[d.jsxs(Qe,{id:"search",className:"input-group",children:[d.jsx(rs,{type:"search",placeholder:t("explorer.label.search",{ns:e}),size:"lg",noValidationIcon:!0,value:o,onChange:l,onKeyDown:a}),d.jsx(bg,{type:"submit","aria-label":t("explorer.label.search",{ns:e}),onClick:u})]}),d.jsxs(Ee,{placement:"bottom-end",children:[d.jsx(Ee.Trigger,{label:t("explorer.filters"),icon:d.jsx(DT,{width:20}),variant:"ghost",badgeContent:c}),d.jsx(Ee.Menu,{children:r.map(f=>f.value==="0"?d.jsxs(S.Fragment,{children:[d.jsx(Ee.RadioItem,{value:f.value,model:n,onChange:()=>s(f.value),children:f.label}),d.jsx(Ee.Separator,{})]},"0"):d.jsx(Ee.RadioItem,{value:f.value,model:n,onChange:()=>s(f.value),children:f.label},f.value))})]})]})},U_=({id:e,selected:t,onSelect:n})=>{const{t:r}=ue();return d.jsx("div",{className:"treeview",children:d.jsx("ul",{role:"tree",className:"m-0 p-0",children:d.jsx("li",{id:e,role:"treeitem","aria-selected":t,children:d.jsx("div",{children:d.jsx("div",{className:"action-container",children:d.jsx("div",{onClick:n,role:"button",tabIndex:0,children:d.jsxs("div",{className:"d-flex align-items-center gap-8 py-8 ps-24",children:[d.jsx(ab,{width:"20",height:"20"}),d.jsx("span",{children:r("explorer.tree.trash")})]})})})})})})})},H_=S.lazy(async()=>await Ot(()=>import("./FolderModal.js"),[])),q_=()=>{const e=pn(),[t,n]=yg(),r=go(),s=Rg(),i=Og(),{appCode:o}=Te(),{t:l}=ue(["common",o]),{goToTrash:a,selectTreeItem:u,unfoldTreeItem:c,foldTreeItem:f,clearSelectedItems:p,clearSelectedIds:h}=mt(),y=async x=>{await c(x,e)},w=()=>{p(),h(),n()};return d.jsxs(d.Fragment,{children:[d.jsx(IE,{data:r,selectedNodesIds:i,onTreeItemSelect:u,onTreeItemFold:f,onTreeItemUnfold:y}),d.jsx(U_,{id:Mt.BIN,selected:s,onSelect:a}),d.jsx("div",{className:"d-grid my-16",children:d.jsx(ze,{disabled:s,type:"button",color:"primary",variant:"outline",leftIcon:d.jsx(GT,{}),onClick:w,children:l("explorer.folder.new")})}),d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:t&&d.jsx(H_,{edit:!1,isOpen:t,onSuccess:n,onCancel:n})})]})};const W_=S.lazy(async()=>({default:(await Ot(()=>Promise.resolve().then(()=>N6),void 0)).OnboardingModal})),G_=S.lazy(async()=>await Ot(()=>import("./AppAction.js"),[])),Q_=S.lazy(async()=>await Ot(()=>import("./Library.js"),[])),K_=S.lazy(async()=>await Ot(()=>import("./ActionBarContainer.js"),[])),X_=S.lazy(async()=>await Ot(()=>import("./DisableModal.js"),[])),Y_=S.lazy(async()=>await Ot(()=>import("./TrashModal.js"),[])),J_=({config:e})=>{const t=Rt(),{setConfig:n,setSearchParams:r}=mt();S.useEffect(()=>{n(e||{}),r({...t,app:e.app,types:e.types})},[e]);const{currentApp:s}=Te(),{data:i}=N_(),{isTrashedModalOpen:o,onTrashedCancel:l}=T_(),{isActionDisableModalOpen:a,onActionDisableCancel:u}=k_();kS();const c=Ac("publish",i),f=Ac("create",i);return e&&d.jsxs(d.Fragment,{children:[d.jsx(cS,{render:()=>f?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(G_,{})}):null,children:d.jsx(FS,{app:s})}),d.jsxs(Ri,{className:"flex-grow-1",children:[d.jsx(Ri.Col,{sm:"3",lg:"2",xl:"3",className:"border-end pt-16 pe-16 d-none d-lg-block",as:"aside",children:d.jsxs(S.Suspense,{fallback:d.jsx(_t,{}),children:[d.jsx(q_,{}),c&&d.jsx(Q_,{})]})}),d.jsxs(Ri.Col,{sm:"4",md:"8",lg:"6",xl:"9",children:[d.jsx(V_,{}),d.jsx(C_,{}),d.jsx(z_,{})]}),d.jsxs(S.Suspense,{fallback:d.jsx(_t,{}),children:[d.jsx(K_,{}),d.jsx(W_,{id:"showOnboardingTrash",items:[{src:"onboarding/illu-trash-menu.svg",alt:"explorer.modal.onboarding.trash.screen1.alt",text:"explorer.modal.onboarding.trash.screen1.title"},{src:"onboarding/illu-trash-notif.svg",alt:"explorer.modal.onboarding.trash.screen2.alt",text:"explorer.modal.onboarding.trash.screen2.alt"},{src:"onboarding/illu-trash-delete.svg",alt:"explorer.modal.onboarding.trash.screen3.alt",text:"explorer.modal.onboarding.trash.screen3.title"}],modalOptions:{title:"explorer.modal.onboarding.trash.title",prevText:"explorer.modal.onboarding.trash.prev",nextText:"explorer.modal.onboarding.trash.next",closeText:"explorer.modal.onboarding.trash.close"}}),o&&d.jsx(Y_,{isOpen:o,onCancel:l}),a&&d.jsx(X_,{isOpen:a,onCancel:u})]})]})]})};function Z_(){const{init:e}=Te(),t=I6();return e?d.jsx(zE,{children:d.jsx(J_,{config:t})}):d.jsx(_t,{position:!1})}const e7=document.getElementById("root"),t7=new _4({queryCache:new Ay({onError:e=>{typeof e=="string"&&e==="0090"&&window.location.replace("/auth/login")}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});VE(e7).render(d.jsx(S.StrictMode,{children:d.jsxs($4,{client:t7,children:[d.jsx(fS,{params:{app:"blog"},children:d.jsx(pS,{children:d.jsx(Z_,{})})}),d.jsx(A6,{initialIsOpen:!1})]})}));export{Qe as $,nI as A,ze as B,vr as C,gI as D,OI as E,i7 as F,l7 as G,bS as H,ho as I,qs as J,Ws as K,_t as L,Re as M,p2 as N,a7 as O,o7 as P,lt as Q,il as R,GT as S,OE as T,Rt as U,J as V,ee as W,m7 as X,g7 as Y,sb as Z,Ot as _,Te as a,_s as a0,rs as a1,p7 as a2,d7 as a3,h7 as a4,pn as a5,go as a6,IE as a7,N6 as a8,ue as b,mt as c,N_ as d,Cl as e,w7 as f,bd as g,oI as h,RI as i,d as j,Ys as k,Ed as l,Rg as m,Ye as n,Nd as o,c7 as p,u7 as q,S as r,Rd as s,f7 as t,yg as u,w_ as v,v7 as w,y7 as x,n2 as y,vh as z};
|
|
237
|
+
*/var Pd=S,qI=HI;function WI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var GI=typeof Object.is=="function"?Object.is:WI,QI=qI.useSyncExternalStore,KI=Pd.useRef,XI=Pd.useEffect,YI=Pd.useMemo,JI=Pd.useDebugValue;HE.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=KI(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=YI(function(){function a(h){if(!u){if(u=!0,c=h,h=r(h),s!==void 0&&o.hasValue){var y=o.value;if(s(y,h))return f=y}return f=h}if(y=f,GI(c,h))return y;var w=r(h);return s!==void 0&&s(y,w)?y:(c=h,f=w)}var u=!1,c,f,p=n===void 0?null:n;return[function(){return a(t())},p===null?void 0:function(){return a(p())}]},[t,n,r,s]);var l=QI(e,i[0],i[1]);return XI(function(){o.hasValue=!0,o.value=l},[l]),JI(l),l};UE.exports=HE;var ZI=UE.exports;const e_=il(ZI),{useDebugValue:t_}=ee,{useSyncExternalStoreWithSelector:n_}=e_;function r_(e,t=e.getState,n){const r=n_(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return t_(r),r}const G0=e=>{const t=typeof e=="function"?_I(e):e,n=(r,s)=>r_(t,r,s);return Object.assign(n,t),n},s_=e=>e?G0(e):G0,GE=async e=>{const t=await ae.resource(e.app).searchContext(e);return{...t,folders:t.folders.filter(n=>!n.trashed)}},i_=async({searchParams:e,name:t,parentId:n})=>{const r={name:t,parentId:n,app:e.app,type:e.types[0]};return await ae.resource(e.app).createFolder(r)},o_=async({folderId:e,searchParams:t,parentId:n,name:r})=>{const s={folderId:e,name:r,parentId:n,app:t.app,type:t.types[0]};return await ae.resource(t.app).updateFolder(s)},a_=async({searchParams:e,resourceIds:t,useAssetIds:n,folderIds:r})=>{const s={application:e.app,resourceType:e.types[0],resourceIds:t,folderIds:r};return await ae.resource(e.app).trashAll(s,n)},l_=async({searchParams:e,resourceIds:t,useAssetIds:n,folderIds:r})=>{const s={application:e.app,resourceType:e.types[0],resourceIds:t,folderIds:r};return await ae.resource(e.app).deleteAll(s,n)},u_=async({searchParams:e,resourceIds:t,folderIds:n,useAssetIds:r})=>{const s={application:e.app,resourceType:e.types[0],resourceIds:t,folderIds:n};return await ae.resource(e.app).restoreAll(s,r)},c_=async({searchParams:e,resourceIds:t,folderId:n,folderIds:r,useAssetIds:s})=>{const i={application:e.app,folderId:n,resourceIds:t,folderIds:r};return await ae.resource(e.app).moveToFolder(i,s)},d_=async({app:e,resourceId:t,rights:n})=>await ae.share().saveRights(e,t,n),f_=async({app:e,params:t})=>await ae.resource(e).update(t),p_=async e=>await ae.rights().sessionHasWorkflowRights(e),h_=({searchParams:e,assetId:t})=>ae.resource(e.app).gotoView(t),m_=({searchParams:e,params:t})=>ae.resource(e.app).create(t),g_=({searchParams:e,assetId:t})=>ae.resource(e.app).gotoPrint(t);function Pg(e){return e.filter((t,n)=>e.indexOf(t)===n)}function Wa(e,t){var r,s;let n;return(t==null?void 0:t.id)===e?t:((r=t==null?void 0:t.children)!=null&&r.length&&((s=t==null?void 0:t.children)==null||s.every(i=>(n=Wa(e,i),n===void 0))),n)}function v_(e,t){var r;const n=Wa(e,t);return(r=n==null?void 0:n.folder)!=null&&r.ancestors?[...(n==null?void 0:n.folder.ancestors)||[],e]:e===Mt.BIN?[Mt.BIN]:[Mt.DEFAULT]}function QE(e,t){return t.id===e&&t.children?t.children.length>0:t.children?t.children.some(n=>QE(t.id,n)):!1}function El(e,t){return KE(e,t)||e}function KE(e,t,n){var s;const r=t(e,n);if((s=r==null?void 0:r.children)!=null&&s.length){const i=[];for(const o of(r==null?void 0:r.children)||[]){const l=KE(o,t,r);l&&i.push(l)}return{...r,children:i}}return r}class Od{constructor(t){ei(this,"id");ei(this,"name");ei(this,"childNumber");ei(this,"section",!1);ei(this,"children",[]);this.folder=t,this.id=t.id,this.name=t.name,this.childNumber=t.childNumber}}const XE=(e,t,n)=>El(e,r=>(r.id===n&&(r.children=t==null?void 0:t.map(s=>new Od(s))),r)),Ye=s_()((e,t)=>({config:null,searchConfig:{minLength:1},searchParams:{app:"",types:[],filters:{folder:"default",owner:void 0,shared:void 0,public:void 0},orders:{updatedAt:"desc"},pagination:{startIdx:0,pageSize:48,maxIdx:0},trashed:!1},treeData:{id:Mt.DEFAULT,name:Pt("explorer.filters.mine"),section:!0,children:[]},selectedNodesIds:["default"],currentFolder:{id:"default"},selectedFolders:[],selectedResources:[],folderIds:[],resourceIds:[],resourceIsTrash:!1,resourceActionDisable:!1,status:void 0,updaters:{setConfig:n=>e({config:n}),setSearchConfig:n=>e(r=>({searchConfig:{...r.searchConfig,...n}})),setTreeData:n=>e(()=>({treeData:n})),setSearchParams:n=>{e(r=>{const{searchParams:s}=r;return s.search!==n.search?n.search?{...r,selectedFolders:[],selectedNodesIds:[],selectedResources:[],currentFolder:void 0,searchParams:{...s,...n,trashed:!1,filters:{...s.filters,folder:void 0}}}:{...r,selectedFolders:[],selectedNodesIds:["default"],selectedResources:[],currentFolder:{id:"default"},searchParams:{...s,...n,trashed:!1,filters:{...s.filters}}}:{searchParams:{...s,...n}}})},setSelectedFolders:n=>e(()=>({selectedFolders:n})),setSelectedResources:n=>e(()=>({selectedResources:n})),setFolderIds:n=>e(()=>({folderIds:n})),setResourceIds:n=>e(()=>({resourceIds:n})),setResourceIsTrash:n=>e(()=>({resourceIsTrash:n})),setResourceActionDisable:n=>e(()=>({resourceActionDisable:n})),setCurrentFolder:n=>e(()=>({currentFolder:n})),clearSelectedItems:()=>e(()=>({selectedFolders:[],selectedResources:[]})),clearSelectedIds:()=>e(()=>({resourceIds:[],folderIds:[]})),openResource:n=>{try{const{searchParams:r}=t();h_({searchParams:r,assetId:n.assetId})}catch(r){console.error("explorer open failed: ",r)}},printSelectedResource:()=>{try{const{searchParams:n,selectedResources:r,resourceIds:s}=t();if(r.length!==1)throw new Error("Cannot open more than 1 resource");const i=r.find(o=>o.id===s[0]);g_({searchParams:n,assetId:i.assetId})}catch(n){console.error("explorer print failed: ",n)}},openFolder:({folderId:n,folder:r})=>{const{searchParams:s,treeData:i}=t(),o=s.filters.folder,l=v_(n,i),a=Pg([...l,n]);o!==n&&e(u=>({...u,folderIds:[],resourceIds:[],selectedNodesIds:a,currentFolder:r||{id:n},searchParams:{...s,search:void 0,filters:{...s.filters,folder:n},trashed:n===Mt.BIN}}))},foldTreeItem:()=>e(n=>({...n,status:"fold"})),unfoldTreeItem:async(n,r)=>{const{treeData:s,searchParams:i}=t();if(e(o=>({...o,status:"unfold"})),!QE(n,s)){await r.prefetchInfiniteQuery({queryKey:["prefetchContext",{folderId:n,trashed:!1}],queryFn:async()=>await GE({...i,filters:{...i.filters,folder:n}})});const o=r.getQueryData(["prefetchContext",{folderId:n,trashed:!1}]);e(l=>{var a;return{...l,treeData:XE(s,(a=o==null?void 0:o.pages[0])==null?void 0:a.folders,n||Mt.DEFAULT)}})}},selectTreeItem:n=>{const{treeData:r}=t(),{openFolder:s}=t().updaters,i=Wa(n,r);bS()(),e(l=>({...l,searchParams:{...l.searchParams,search:void 0},status:"select",selectedResources:[]})),s({folder:i,folderId:n})},gotoPreviousFolder:()=>{const{selectedNodesIds:n,treeData:r}=t(),{openFolder:s}=t().updaters,i=n.length;if(i<2)return;const o=Wa(n[i-2],r);s({folder:o,folderId:(o==null?void 0:o.id)||Mt.DEFAULT})},goToTrash:()=>e(n=>({...n,selectedNodesIds:[],selectedResources:[],resourceIds:[],folderIds:[],status:"select",searchParams:{...n.searchParams,search:void 0,filters:{folder:Mt.BIN},trashed:!0},currentFolder:{id:Mt.BIN}}))}})),Rt=()=>Ye(e=>e.searchParams),Og=()=>Ye(e=>e.selectedNodesIds),go=()=>Ye(e=>e.treeData),u7=()=>Ye(e=>e.selectedFolders),c7=()=>Ye(e=>e.selectedResources),y_=()=>Ye(e=>e.searchConfig),Rd=()=>Ye(e=>e.folderIds),Nd=()=>Ye(e=>e.resourceIds),Ad=()=>Ye(e=>e.selectedResources.map(t=>t.assetId)),Id=()=>Ye(e=>e.selectedResources.filter(t=>t.assetId===t.id)),Cl=()=>Ye(e=>e.currentFolder),mt=()=>Ye(e=>e.updaters),Rg=()=>{const e=Cl();return(e==null?void 0:e.id)===Mt.BIN},w_=()=>Ye(e=>e.resourceIsTrash),x_=()=>Ye(e=>e.resourceActionDisable),b_=()=>{const e=Cl();return(e==null?void 0:e.id)==="default"},S_=()=>Og().length>1,E_=()=>Ye(e=>e.status),YE=()=>{const e=Rt(),[t,n]=S.useState(""),r=y_(),s=E_(),i=S.useRef(null),{setSearchParams:o}=mt(),l=c=>{const f=c.target.value;n(f.toString())},a=c=>{(c.key==="Enter"||c.key==="Return")&&(c.preventDefault(),o({search:t||void 0}))},u=c=>{c.preventDefault(),o({search:t||void 0})};return S.useEffect(()=>{const f=t.length==0||t.length>=r.minLength?{search:t||void 0}:{};o({...e,...f})},[t,r.minLength]),S.useEffect(()=>{s==="select"&&n("")},[s]),S.useEffect(()=>{n(()=>{var c;return((c=e.search)==null?void 0:c.toString())??""})},[e]),{formRef:i,inputSearch:t,handleInputSearchChange:l,handleKeyPress:a,handleSearchSubmit:u}};function C_(){const{appCode:e}=Te(),{gotoPreviousFolder:t}=mt(),{t:n}=ue(),{inputSearch:r}=YE(),s=Og(),i=Rg(),o=Cl(),l=n("explorer.tree.trash"),a=n("explorer.tree.search"),u=n("explorer.filters.mine",{ns:e}),c=(o==null?void 0:o.name)||u;return d.jsx("div",{className:"py-16",children:s.length>1&&!i?d.jsxs("div",{className:"d-flex align-items-center gap-8",children:[d.jsx(hr,{icon:d.jsx(bT,{}),variant:"ghost",color:"tertiary","aria-label":n("back"),className:"ms-n16",onClick:t}),d.jsx("p",{className:"body py-8 text-truncate",children:d.jsx("strong",{children:c})})]}):d.jsx("h2",{className:"body py-8 fw-bold",children:r.length!==0?a:i?l:u})})}const k_=()=>{const e=x_(),{clearSelectedIds:t,setResourceActionDisable:n,clearSelectedItems:r}=mt();return{isActionDisableModalOpen:e,onActionDisableCancel:()=>{t(),r(),n(!1)}}},T_=()=>{const e=w_(),{clearSelectedIds:t,setResourceIsTrash:n,clearSelectedItems:r}=mt();return{isTrashedModalOpen:e,onTrashedCancel:()=>{t(),r(),n(!1)}}};function j_(e,{parentId:t,newFolder:n}){return El(e,r=>{var s;if(r.id===t){const i=[...((s=r.folder)==null?void 0:s.ancestors)||[]],o=Pg([...i,r.id]);return{...r,children:[...r.children||[],new Od({...n,ancestors:o})]}}else return r})}function P_(e,{folders:t}){return El(e,n=>{if(!t.includes(n.id))return n})}function O_(e,{destinationId:t,folders:n}){return El(e,(r,s)=>{var i,o;if(t===r.id){const l=[...((i=r.folder)==null?void 0:i.ancestors)||[]],a=Pg([...l,r.id]),u=[...r.children||[]],c=((o=r.children)==null?void 0:o.map(p=>p.id))||[];for(const p of n)if(!c.includes(p)){const h=Wa(p,e);h&&u.push({...h,folder:{...h==null?void 0:h.folder,ancestors:a}})}return{...r,children:u}}else return n.includes(r.id)&&t!==(s==null?void 0:s.id)?void 0:r})}function R_(e,{folderId:t,newFolder:n}){return El(e,r=>r.id===t?new Od(n):r)}const N_=()=>{const e=Ye(t=>t.config);return Ih({queryKey:["actions"],queryFn:async()=>{const t=e==null?void 0:e.actions.map(r=>r.workflow);return await p_(t)},select:t=>e==null?void 0:e.actions.map(n=>({...n,available:t[n.workflow]})),staleTime:1/0,enabled:!!e})},A_=()=>{const e=Ye(o=>o.config),t=Rt(),{filters:n,trashed:r,search:s}=t,i=["context",{folderId:n.folder,filters:n,trashed:r,search:s}];return Y4({queryKey:i,queryFn:async({pageParam:o})=>await GE({...t,app:e==null?void 0:e.app,types:e==null?void 0:e.types,pagination:{...t.pagination,startIdx:o}}),initialPageParam:0,enabled:!!e,retry:!1,getNextPageParam:o=>o.pagination.startIdx+o.pagination.pageSize})},d7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),s=Rd(),i=Ad(),o=Nd(),l=Id().length>0,a=l?i:o,{clearSelectedItems:u,clearSelectedIds:c,setTreeData:f,setSearchParams:p}=mt(),{filters:h,trashed:y}=n,w=["context",{folderId:h.folder,filters:h,trashed:y}];return mr({mutationFn:async()=>await a_({searchParams:n,folderIds:s,resourceIds:a,useAssetIds:l}),onError(x){typeof x=="string"&&e.error(Pt(x))},onSuccess:async x=>{if(await t.cancelQueries({queryKey:w}),t.getQueryData(w))return e.success(Pt("explorer.trash.title")),t.setQueryData(w,m=>{var v;if(m){const b={...m,pages:m==null?void 0:m.pages.map(T=>{var C;return{...T,folders:T.folders.filter(R=>!s.includes(R.id)),pagination:{...T.pagination,maxIdx:((C=T==null?void 0:T.pagination)==null?void 0:C.maxIdx)-x.resources.length},resources:T.resources.filter(R=>l?!i.includes(R.assetId):!a.includes(R.id))}})},E=P_(r,{folders:s});return f(E),p({...n,pagination:{...n.pagination,maxIdx:((v=n.pagination)==null?void 0:v.maxIdx)-x.resources.length}}),b}})},onSettled:()=>{u(),c()}})},f7=()=>{const e=ht(),t=pn(),n=Rt(),r=Rd(),s=Ad(),i=Nd(),o=Id().length>0,l=o?s:i,{setFolderIds:a,setResourceIds:u,setSelectedResources:c,setSelectedFolders:f}=mt(),{filters:p,trashed:h}=n,y=["context",{folderId:p.folder,filters:p,trashed:h}];return mr({mutationFn:async()=>await u_({searchParams:n,folderIds:r,resourceIds:l,useAssetIds:o}),onError(w){typeof w=="string"&&e.error(Pt(w))},onSuccess:async()=>{if(await t.cancelQueries({queryKey:y}),t.getQueryData(y))return e.success(Pt("explorer.trash.toast")),t.setQueryData(y,x=>{if(x)return{...x,pages:x==null?void 0:x.pages.map(g=>({...g,folders:g.folders.filter(m=>!r.includes(m.id)),resources:g.resources.filter(m=>o?!s.includes(m.assetId):!l.includes(m.id))}))}})},onSettled:()=>{u([]),c([]),a([]),f([])}})},p7=()=>{const e=ht(),t=pn(),n=Rt(),r=Rd(),s=Ad(),i=Nd(),o=Id().length>0,l=o?s:i,{clearSelectedItems:a,clearSelectedIds:u}=mt(),{filters:c,trashed:f}=n,p=["context",{folderId:c.folder,filters:c,trashed:f}];return mr({mutationFn:async()=>await l_({searchParams:n,folderIds:r,resourceIds:l,useAssetIds:o}),onError(h){typeof h=="string"&&e.error(Pt(h))},onSuccess:async()=>{if(await t.cancelQueries({queryKey:p}),t.getQueryData(p))return e.success(Pt("explorer.removed.from.trash")),t.setQueryData(p,y=>{if(y)return{...y,pages:y==null?void 0:y.pages.map(x=>({...x,folders:x.folders.filter(g=>!r.includes(g.id)),resources:x.resources.filter(g=>o?!s.includes(g.assetId):!l.includes(g.id))}))}})},onSettled:()=>{a(),u()}})},h7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),s=Rd(),i=Ad(),o=Nd(),l=Id().length>0,a=l?i:o,{clearSelectedIds:u,clearSelectedItems:c,setTreeData:f,setSearchParams:p}=mt(),{filters:h,trashed:y}=n,w=["context",{folderId:h.folder,filters:h,trashed:y}];return mr({mutationFn:async x=>await c_({searchParams:n,folderId:x,folderIds:s,resourceIds:a,useAssetIds:l}),onError(x){typeof x=="string"&&e.error(Pt(x))},onSuccess:async(x,g)=>{if(t.getQueryData(w))return t.setQueryData(w,v=>{var b;if(v){const E=O_(r,{destinationId:g,folders:s}),T={...v,pages:v==null?void 0:v.pages.map(C=>{var R;return{...C,folders:C.folders.filter(j=>!s.includes(j.id)),pagination:{...C.pagination,maxIdx:((R=C.pagination)==null?void 0:R.maxIdx)-x.resources.length},resources:C.resources.filter(j=>l?!i.includes(j.assetId):!a.includes(j.id))}})};return f(E),p({...n,pagination:{...n.pagination,maxIdx:((b=n.pagination)==null?void 0:b.maxIdx)-x.resources.length}}),T}})},onSettled:()=>{c(),u()}})},m7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),{setTreeData:s}=mt(),{filters:i,trashed:o}=n,l=["context",{folderId:i.folder,filters:i,trashed:o}];return mr({mutationFn:async({name:a,parentId:u})=>await i_({searchParams:n,name:a,parentId:u}),onError(a){typeof a=="string"&&e.error(Pt(a))},onSuccess:async(a,u)=>{await t.cancelQueries({queryKey:l});const c=t.getQueryData(l),f={...a,parentId:u.parentId,children:[],rights:[`creator:${a==null?void 0:a.creator_id}`]};if(c)return t.setQueryData(l,p=>{if(p){const h={...p,pages:p==null?void 0:p.pages.map(w=>({...w,folders:[...w.folders,f]}))},y=j_(r,{parentId:u.parentId,newFolder:f});return s(y),h}})}})},g7=()=>{const e=ht(),t=pn(),n=Rt(),r=go(),{setFolderIds:s,setSelectedFolders:i,setTreeData:o}=mt(),{filters:l,trashed:a}=n,u=["context",{folderId:l.folder,filters:l,trashed:a}];return mr({mutationFn:async({folderId:c,name:f,parentId:p})=>await o_({searchParams:n,folderId:c,parentId:p,name:f}),onError(c){typeof c=="string"&&e.error(Pt(c))},onSuccess:async(c,f)=>{if(await t.cancelQueries({queryKey:u}),t.getQueryData(u))return t.setQueryData(u,h=>{if(h){const y={...h,pages:h==null?void 0:h.pages.map(x=>({...x,folders:x.folders.map(g=>g.id===c.id?{...c,parentId:f.parentId,rights:g.rights}:g)}))},w=R_(r,{folderId:f.folderId,newFolder:c});return o(w),y}})},onSettled:()=>{s([]),i([])}})},v7=()=>{const e=ht(),t=pn(),n=Rt(),{setResourceIds:r,setSelectedResources:s}=mt(),{filters:i,trashed:o,app:l}=n,a=["context",{folderId:i.folder,filters:i,trashed:o}];return mr({mutationFn:async({resourceId:u,rights:c})=>await d_({app:l,resourceId:u,rights:c}),onError(u){typeof u=="string"&&e.error(Pt("explorer.shared.status.error"))},onSuccess:async(u,c)=>{if(await t.cancelQueries({queryKey:a}),t.getQueryData(a))return e.success(Pt("explorer.shared.status.saved")),t.setQueryData(a,p=>{if(p)return{...p,pages:p==null?void 0:p.pages.map(h=>({...h,resources:h.resources.map(y=>{if(y.assetId===(c==null?void 0:c.resourceId)){let w=[`creator:${y.creatorId}`];return(c==null?void 0:c.rights.length)>=1&&(w=[...w,...c.rights.flatMap(x=>x.actions.map(g=>`${x.type}:${x.id}:${g.id}`))]),{...y,rights:w}}else return y})}))}})},onSettled:()=>{r([]),s([])}})},y7=()=>{const e=ht(),t=pn(),n=Rt(),{filters:r,trashed:s,app:i}=n,o=["context",{folderId:r.folder,filters:r,trashed:s}];return mr({mutationFn:async l=>await f_({app:i,params:l}),onError(l){typeof l=="string"&&e.error(Pt(l))},onSuccess:async(l,a)=>{if(await t.cancelQueries({queryKey:o}),t.getQueryData(o))return t.setQueryData(o,c=>{if(c)return{...c,pages:c==null?void 0:c.pages.map(f=>({...f,resources:f.resources.map(p=>{if(p.assetId===(a==null?void 0:a.entId)){const{name:h,thumbnail:y,public:w,description:x,slug:g,...m}=a;return{...p,...m,name:h,thumbnail:typeof y=="string"?y:URL.createObjectURL(y),public:w,description:x,slug:g}}else return p})}))}})}})},w7=()=>{const e=ht(),t=pn(),n=Rt(),{user:r}=Ed(),{appCode:s}=Te(),i=["context",{folderId:n.filters.folder,filters:n.filters,trashed:n.trashed}];return mr({mutationFn:async o=>await m_({searchParams:n,params:o}),onError(o){typeof o=="string"&&e.error(Pt(o))},onSuccess:async(o,l)=>{var f,p,h;await t.cancelQueries({queryKey:i});const a=t.getQueryData(i),{thumbnail:u}=l,c={...l,thumbnail:u?URL.createObjectURL(u):"",application:s,assetId:o._id||o.entId||"",id:o._id||o.entId||"",creatorId:r==null?void 0:r.userId,creatorName:r==null?void 0:r.username,createdAt:Date.now(),slug:l.slug||"",modifiedAt:((f=o.modified)==null?void 0:f.$date)||"",modifierId:((p=o.author)==null?void 0:p.userId)||"",modifierName:((h=o.author)==null?void 0:h.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${r==null?void 0:r.userId}`]};if(a)return t.setQueryData(i,y=>{if(y)return{...y,pages:y==null?void 0:y.pages.map(w=>({...w,resources:[c,...w.resources]}))}})}})},I_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenApp.js"),[])),__=S.lazy(async()=>await Ot(()=>import("./EmptyScreenSearch.js"),[])),M_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenError.js"),[])),L_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenNoContentInFolder.js"),[])),D_=S.lazy(async()=>await Ot(()=>import("./EmptyScreenTrash.js"),[])),F_=S.lazy(async()=>await Ot(()=>import("./FoldersList.js"),[])),$_=S.lazy(async()=>await Ot(()=>import("./ResourcesList.js"),[])),z_=()=>{const e=b_(),t=Rg(),n=S_(),r=Rt(),s=Cl(),i=go(),o=ht(),{appCode:l}=Te(),{t:a}=ue(),{setSearchParams:u,setSearchConfig:c,setTreeData:f}=mt(),{data:p,isError:h,error:y,isLoading:w,isFetching:x,fetchNextPage:g}=A_(),m=(p==null?void 0:p.pages[0].folders.length)===0,v=(p==null?void 0:p.pages[0].resources.length)===0,b=m&&v;return S.useEffect(()=>{var E,T,C;if(p){const R=[...((E=p==null?void 0:p.pages[0])==null?void 0:E.folders)??[]];(T=p==null?void 0:p.pages[0])!=null&&T.searchConfig&&c(p.pages[0].searchConfig),r.search||((s==null?void 0:s.id)==="default"?f({id:Mt.DEFAULT,section:!0,children:R.map(j=>new Od(j)),name:a("explorer.filters.mine",{ns:l})}):f(XE(i,R,r.filters.folder||Mt.DEFAULT))),u({...r,pagination:(C=p==null?void 0:p.pages[(p==null?void 0:p.pages.length)-1])==null?void 0:C.pagination})}},[p]),S.useEffect(()=>{y&&typeof y=="string"&&o.error(a(y))},[y]),w?d.jsx(_t,{}):h?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(M_,{})}):r.search&&b?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(__,{})}):e&&b?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(I_,{})}):n&&b&&!t?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(L_,{})}):t&&(p==null?void 0:p.pages[0].resources.length)===0?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(D_,{})}):d.jsxs(S.Suspense,{fallback:d.jsx(_t,{}),children:[d.jsx(F_,{data:p,isFetching:x}),d.jsx($_,{data:p,isFetching:x,fetchNextPage:g})]})},B_=()=>{const{appCode:e,currentApp:t}=Te(),{t:n}=ue(),[r,s]=S.useState(""),i=c=>{if(c==="0"){s("");return}s(c)},o=Cl(),l=Rt(),{setSearchParams:a}=mt();S.useEffect(()=>{const c=()=>r.includes("1")?!0:void 0,f=()=>r.includes("2")?!0:void 0,p=()=>r.includes("7")?!0:void 0;a({...l,filters:{owner:c(),public:p(),shared:f(),folder:o?o.id:"default"}})},[o,a,r]);const u=[{label:n("explorer.filter.all",{ns:e}),value:"0"},{label:n("explorer.filter.owner",{ns:e}),value:"1"},{label:n("explorer.filter.shared",{ns:e}),value:"2"},...(t==null?void 0:t.displayName)==Ho.EXERCIZER?[{label:"Exercices interactifs",value:"3"}]:[],...(t==null?void 0:t.displayName)==Ho.EXERCIZER?[{label:"Exercices à rendre",value:"4"}]:[],...(t==null?void 0:t.displayName)=="pages"?[{label:"Projets publics",value:"5"}]:[],...(t==null?void 0:t.displayName)=="pages"?[{label:"Projets internes",value:"6"}]:[],...(t==null?void 0:t.displayName)==Ho.BLOG?[{label:n("explorer.filter.public",{ns:e}),value:"7"}]:[]];return{selectedFilters:r,options:u,handleOnSelectFilter:i}},V_=()=>{const{appCode:e}=Te(),{t}=ue(),{selectedFilters:n,options:r,handleOnSelectFilter:s}=B_(),{formRef:i,inputSearch:o,handleInputSearchChange:l,handleKeyPress:a,handleSearchSubmit:u}=YE(),c=n.length>0?n.length:void 0;return d.jsxs("form",{noValidate:!0,className:"bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8",ref:i,children:[d.jsxs(Qe,{id:"search",className:"input-group",children:[d.jsx(rs,{type:"search",placeholder:t("explorer.label.search",{ns:e}),size:"lg",noValidationIcon:!0,value:o,onChange:l,onKeyDown:a}),d.jsx(bg,{type:"submit","aria-label":t("explorer.label.search",{ns:e}),onClick:u})]}),d.jsxs(Ee,{placement:"bottom-end",children:[d.jsx(Ee.Trigger,{label:t("explorer.filters"),icon:d.jsx(DT,{width:20}),variant:"ghost",badgeContent:c}),d.jsx(Ee.Menu,{children:r.map(f=>f.value==="0"?d.jsxs(S.Fragment,{children:[d.jsx(Ee.RadioItem,{value:f.value,model:n,onChange:()=>s(f.value),children:f.label}),d.jsx(Ee.Separator,{})]},"0"):d.jsx(Ee.RadioItem,{value:f.value,model:n,onChange:()=>s(f.value),children:f.label},f.value))})]})]})},U_=({id:e,selected:t,onSelect:n})=>{const{t:r}=ue();return d.jsx("div",{className:"treeview",children:d.jsx("ul",{role:"tree",className:"m-0 p-0",children:d.jsx("li",{id:e,role:"treeitem","aria-selected":t,children:d.jsx("div",{children:d.jsx("div",{className:"action-container",children:d.jsx("div",{onClick:n,role:"button",tabIndex:0,children:d.jsxs("div",{className:"d-flex align-items-center gap-8 py-8 ps-24",children:[d.jsx(ab,{width:"20",height:"20"}),d.jsx("span",{children:r("explorer.tree.trash")})]})})})})})})})},H_=S.lazy(async()=>await Ot(()=>import("./FolderModal.js"),[])),q_=()=>{const e=pn(),[t,n]=yg(),r=go(),s=Rg(),i=Og(),{appCode:o}=Te(),{t:l}=ue(["common",o]),{goToTrash:a,selectTreeItem:u,unfoldTreeItem:c,foldTreeItem:f,clearSelectedItems:p,clearSelectedIds:h}=mt(),y=async x=>{await c(x,e)},w=()=>{p(),h(),n()};return d.jsxs(d.Fragment,{children:[d.jsx(IE,{data:r,selectedNodesIds:i,onTreeItemSelect:u,onTreeItemFold:f,onTreeItemUnfold:y}),d.jsx(U_,{id:Mt.BIN,selected:s,onSelect:a}),d.jsx("div",{className:"d-grid my-16",children:d.jsx(ze,{disabled:s,type:"button",color:"primary",variant:"outline",leftIcon:d.jsx(GT,{}),onClick:w,children:l("explorer.folder.new")})}),d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:t&&d.jsx(H_,{edit:!1,isOpen:t,onSuccess:n,onCancel:n})})]})};const W_=S.lazy(async()=>({default:(await Ot(()=>Promise.resolve().then(()=>NI),void 0)).OnboardingModal})),G_=S.lazy(async()=>await Ot(()=>import("./AppAction.js"),[])),Q_=S.lazy(async()=>await Ot(()=>import("./Library.js"),[])),K_=S.lazy(async()=>await Ot(()=>import("./ActionBarContainer.js"),[])),X_=S.lazy(async()=>await Ot(()=>import("./DisableModal.js"),[])),Y_=S.lazy(async()=>await Ot(()=>import("./TrashModal.js"),[])),J_=({config:e})=>{const t=Rt(),{setConfig:n,setSearchParams:r}=mt();S.useEffect(()=>{n(e||{}),r({...t,app:e.app,types:e.types})},[e]);const{currentApp:s}=Te(),{data:i}=N_(),{isTrashedModalOpen:o,onTrashedCancel:l}=T_(),{isActionDisableModalOpen:a,onActionDisableCancel:u}=k_();kS();const c=Ac("publish",i),f=Ac("create",i);return e&&d.jsxs(d.Fragment,{children:[d.jsx(cS,{render:()=>f?d.jsx(S.Suspense,{fallback:d.jsx(_t,{}),children:d.jsx(G_,{})}):null,children:d.jsx(FS,{app:s})}),d.jsxs(Ri,{className:"flex-grow-1",children:[d.jsx(Ri.Col,{sm:"3",lg:"2",xl:"3",className:"border-end pt-16 pe-16 d-none d-lg-block",as:"aside",children:d.jsxs(S.Suspense,{fallback:d.jsx(_t,{}),children:[d.jsx(q_,{}),c&&d.jsx(Q_,{})]})}),d.jsxs(Ri.Col,{sm:"4",md:"8",lg:"6",xl:"9",children:[d.jsx(V_,{}),d.jsx(C_,{}),d.jsx(z_,{})]}),d.jsxs(S.Suspense,{fallback:d.jsx(_t,{}),children:[d.jsx(K_,{}),d.jsx(W_,{id:"showOnboardingTrash",items:[{src:"onboarding/illu-trash-menu.svg",alt:"explorer.modal.onboarding.trash.screen1.alt",text:"explorer.modal.onboarding.trash.screen1.title"},{src:"onboarding/illu-trash-notif.svg",alt:"explorer.modal.onboarding.trash.screen2.alt",text:"explorer.modal.onboarding.trash.screen2.alt"},{src:"onboarding/illu-trash-delete.svg",alt:"explorer.modal.onboarding.trash.screen3.alt",text:"explorer.modal.onboarding.trash.screen3.title"}],modalOptions:{title:"explorer.modal.onboarding.trash.title",prevText:"explorer.modal.onboarding.trash.prev",nextText:"explorer.modal.onboarding.trash.next",closeText:"explorer.modal.onboarding.trash.close"}}),o&&d.jsx(Y_,{isOpen:o,onCancel:l}),a&&d.jsx(X_,{isOpen:a,onCancel:u})]})]})]})};function Z_(){const{init:e}=Te(),t=II();return e?d.jsx(zE,{children:d.jsx(J_,{config:t})}):d.jsx(_t,{position:!1})}const e7=document.getElementById("root"),t7=new _4({queryCache:new Ay({onError:e=>{typeof e=="string"&&e==="0090"&&window.location.replace("/auth/login")}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});VE(e7).render(d.jsx(S.StrictMode,{children:d.jsxs($4,{client:t7,children:[d.jsx(fS,{params:{app:"blog"},children:d.jsx(pS,{children:d.jsx(Z_,{})})}),d.jsx(AI,{initialIsOpen:!1})]})}));export{Qe as $,n6 as A,ze as B,vr as C,g6 as D,O6 as E,i7 as F,l7 as G,bS as H,ho as I,qs as J,Ws as K,_t as L,Re as M,p2 as N,a7 as O,o7 as P,lt as Q,il as R,GT as S,OE as T,Rt as U,J as V,ee as W,m7 as X,g7 as Y,sb as Z,Ot as _,Te as a,_s as a0,rs as a1,p7 as a2,d7 as a3,h7 as a4,pn as a5,go as a6,IE as a7,NI as a8,ue as b,mt as c,N_ as d,Cl as e,w7 as f,bd as g,o6 as h,R6 as i,d as j,Ys as k,Ed as l,Rg as m,Ye as n,Nd as o,c7 as p,u7 as q,S as r,Rd as s,f7 as t,yg as u,w_ as v,v7 as w,y7 as x,n2 as y,vh as z};
|