ode-explorer 2.0.0-develop-integration.202501091206 → 2.0.0-develop.202501091533

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 CHANGED
@@ -6,7 +6,7 @@ var Wp=tt=>{throw TypeError(tt)};var n3=(tt,et)=>()=>(et||tt((et={exports:{}}).e
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var l$3=Symbol.for("react.element"),n$6=Symbol.for("react.portal"),p$6=Symbol.for("react.fragment"),q$3=Symbol.for("react.strict_mode"),r$2=Symbol.for("react.profiler"),t$3=Symbol.for("react.provider"),u$3=Symbol.for("react.context"),v$4=Symbol.for("react.forward_ref"),w$2=Symbol.for("react.suspense"),x$2=Symbol.for("react.memo"),y$2=Symbol.for("react.lazy"),z$2=Symbol.iterator;function A$3(tt){return tt===null||typeof tt!="object"?null:(tt=z$2&&tt[z$2]||tt["@@iterator"],typeof tt=="function"?tt:null)}var B$2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$4=Object.assign,D$3={};function E$2(tt,et,rt){this.props=tt,this.context=et,this.refs=D$3,this.updater=rt||B$2}E$2.prototype.isReactComponent={};E$2.prototype.setState=function(tt,et){if(typeof tt!="object"&&typeof tt!="function"&&tt!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,tt,et,"setState")};E$2.prototype.forceUpdate=function(tt){this.updater.enqueueForceUpdate(this,tt,"forceUpdate")};function F$2(){}F$2.prototype=E$2.prototype;function G$3(tt,et,rt){this.props=tt,this.context=et,this.refs=D$3,this.updater=rt||B$2}var H$4=G$3.prototype=new F$2;H$4.constructor=G$3;C$4(H$4,E$2.prototype);H$4.isPureReactComponent=!0;var I$2=Array.isArray,J$2=Object.prototype.hasOwnProperty,K$4={current:null},L$2={key:!0,ref:!0,__self:!0,__source:!0};function M$4(tt,et,rt){var nt,st={},ot=null,at=null;if(et!=null)for(nt in et.ref!==void 0&&(at=et.ref),et.key!==void 0&&(ot=""+et.key),et)J$2.call(et,nt)&&!L$2.hasOwnProperty(nt)&&(st[nt]=et[nt]);var lt=arguments.length-2;if(lt===1)st.children=rt;else if(1<lt){for(var ut=Array(lt),ct=0;ct<lt;ct++)ut[ct]=arguments[ct+2];st.children=ut}if(tt&&tt.defaultProps)for(nt in lt=tt.defaultProps,lt)st[nt]===void 0&&(st[nt]=lt[nt]);return{$$typeof:l$3,type:tt,key:ot,ref:at,props:st,_owner:K$4.current}}function N$3(tt,et){return{$$typeof:l$3,type:tt.type,key:et,ref:tt.ref,props:tt.props,_owner:tt._owner}}function O$3(tt){return typeof tt=="object"&&tt!==null&&tt.$$typeof===l$3}function escape$2(tt){var et={"=":"=0",":":"=2"};return"$"+tt.replace(/[=:]/g,function(rt){return et[rt]})}var P$3=/\/+/g;function Q$3(tt,et){return typeof tt=="object"&&tt!==null&&tt.key!=null?escape$2(""+tt.key):et.toString(36)}function R$2(tt,et,rt,nt,st){var ot=typeof tt;(ot==="undefined"||ot==="boolean")&&(tt=null);var at=!1;if(tt===null)at=!0;else switch(ot){case"string":case"number":at=!0;break;case"object":switch(tt.$$typeof){case l$3:case n$6:at=!0}}if(at)return at=tt,st=st(at),tt=nt===""?"."+Q$3(at,0):nt,I$2(st)?(rt="",tt!=null&&(rt=tt.replace(P$3,"$&/")+"/"),R$2(st,et,rt,"",function(ct){return ct})):st!=null&&(O$3(st)&&(st=N$3(st,rt+(!st.key||at&&at.key===st.key?"":(""+st.key).replace(P$3,"$&/")+"/")+tt)),et.push(st)),1;if(at=0,nt=nt===""?".":nt+":",I$2(tt))for(var lt=0;lt<tt.length;lt++){ot=tt[lt];var ut=nt+Q$3(ot,lt);at+=R$2(ot,et,rt,ut,st)}else if(ut=A$3(tt),typeof ut=="function")for(tt=ut.call(tt),lt=0;!(ot=tt.next()).done;)ot=ot.value,ut=nt+Q$3(ot,lt++),at+=R$2(ot,et,rt,ut,st);else if(ot==="object")throw et=String(tt),Error("Objects are not valid as a React child (found: "+(et==="[object Object]"?"object with keys {"+Object.keys(tt).join(", ")+"}":et)+"). If you meant to render a collection of children, use an array instead.");return at}function S$3(tt,et,rt){if(tt==null)return tt;var nt=[],st=0;return R$2(tt,nt,"","",function(ot){return et.call(rt,ot,st++)}),nt}function T$3(tt){if(tt._status===-1){var et=tt._result;et=et(),et.then(function(rt){(tt._status===0||tt._status===-1)&&(tt._status=1,tt._result=rt)},function(rt){(tt._status===0||tt._status===-1)&&(tt._status=2,tt._result=rt)}),tt._status===-1&&(tt._status=0,tt._result=et)}if(tt._status===1)return tt._result.default;throw tt._result}var U$3={current:null},V$3={transition:null},W$4={ReactCurrentDispatcher:U$3,ReactCurrentBatchConfig:V$3,ReactCurrentOwner:K$4};function X$2(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$3,forEach:function(tt,et,rt){S$3(tt,function(){et.apply(this,arguments)},rt)},count:function(tt){var et=0;return S$3(tt,function(){et++}),et},toArray:function(tt){return S$3(tt,function(et){return et})||[]},only:function(tt){if(!O$3(tt))throw Error("React.Children.only expected to receive a single React element child.");return tt}};react_production_min.Component=E$2;react_production_min.Fragment=p$6;react_production_min.Profiler=r$2;react_production_min.PureComponent=G$3;react_production_min.StrictMode=q$3;react_production_min.Suspense=w$2;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$4;react_production_min.act=X$2;react_production_min.cloneElement=function(tt,et,rt){if(tt==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+tt+".");var nt=C$4({},tt.props),st=tt.key,ot=tt.ref,at=tt._owner;if(et!=null){if(et.ref!==void 0&&(ot=et.ref,at=K$4.current),et.key!==void 0&&(st=""+et.key),tt.type&&tt.type.defaultProps)var lt=tt.type.defaultProps;for(ut in et)J$2.call(et,ut)&&!L$2.hasOwnProperty(ut)&&(nt[ut]=et[ut]===void 0&&lt!==void 0?lt[ut]:et[ut])}var ut=arguments.length-2;if(ut===1)nt.children=rt;else if(1<ut){lt=Array(ut);for(var ct=0;ct<ut;ct++)lt[ct]=arguments[ct+2];nt.children=lt}return{$$typeof:l$3,type:tt.type,key:st,ref:ot,props:nt,_owner:at}};react_production_min.createContext=function(tt){return tt={$$typeof:u$3,_currentValue:tt,_currentValue2:tt,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},tt.Provider={$$typeof:t$3,_context:tt},tt.Consumer=tt};react_production_min.createElement=M$4;react_production_min.createFactory=function(tt){var et=M$4.bind(null,tt);return et.type=tt,et};react_production_min.createRef=function(){return{current:null}};react_production_min.forwardRef=function(tt){return{$$typeof:v$4,render:tt}};react_production_min.isValidElement=O$3;react_production_min.lazy=function(tt){return{$$typeof:y$2,_payload:{_status:-1,_result:tt},_init:T$3}};react_production_min.memo=function(tt,et){return{$$typeof:x$2,type:tt,compare:et===void 0?null:et}};react_production_min.startTransition=function(tt){var et=V$3.transition;V$3.transition={};try{tt()}finally{V$3.transition=et}};react_production_min.unstable_act=X$2;react_production_min.useCallback=function(tt,et){return U$3.current.useCallback(tt,et)};react_production_min.useContext=function(tt){return U$3.current.useContext(tt)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(tt){return U$3.current.useDeferredValue(tt)};react_production_min.useEffect=function(tt,et){return U$3.current.useEffect(tt,et)};react_production_min.useId=function(){return U$3.current.useId()};react_production_min.useImperativeHandle=function(tt,et,rt){return U$3.current.useImperativeHandle(tt,et,rt)};react_production_min.useInsertionEffect=function(tt,et){return U$3.current.useInsertionEffect(tt,et)};react_production_min.useLayoutEffect=function(tt,et){return U$3.current.useLayoutEffect(tt,et)};react_production_min.useMemo=function(tt,et){return U$3.current.useMemo(tt,et)};react_production_min.useReducer=function(tt,et,rt){return U$3.current.useReducer(tt,et,rt)};react_production_min.useRef=function(tt){return U$3.current.useRef(tt)};react_production_min.useState=function(tt){return U$3.current.useState(tt)};react_production_min.useSyncExternalStore=function(tt,et,rt){return U$3.current.useSyncExternalStore(tt,et,rt)};react_production_min.useTransition=function(){return U$3.current.useTransition()};react_production_min.version="18.3.1";react.exports=react_production_min;var reactExports=react.exports;const React$4=getDefaultExportFromCjs(reactExports),React$5=_mergeNamespaces({__proto__:null,default:React$4},[reactExports]);/**
9
+ */var l$3=Symbol.for("react.element"),n$5=Symbol.for("react.portal"),p$6=Symbol.for("react.fragment"),q$3=Symbol.for("react.strict_mode"),r$2=Symbol.for("react.profiler"),t$3=Symbol.for("react.provider"),u$3=Symbol.for("react.context"),v$4=Symbol.for("react.forward_ref"),w$2=Symbol.for("react.suspense"),x$2=Symbol.for("react.memo"),y$2=Symbol.for("react.lazy"),z$2=Symbol.iterator;function A$3(tt){return tt===null||typeof tt!="object"?null:(tt=z$2&&tt[z$2]||tt["@@iterator"],typeof tt=="function"?tt:null)}var B$2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$4=Object.assign,D$3={};function E$2(tt,et,rt){this.props=tt,this.context=et,this.refs=D$3,this.updater=rt||B$2}E$2.prototype.isReactComponent={};E$2.prototype.setState=function(tt,et){if(typeof tt!="object"&&typeof tt!="function"&&tt!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,tt,et,"setState")};E$2.prototype.forceUpdate=function(tt){this.updater.enqueueForceUpdate(this,tt,"forceUpdate")};function F$2(){}F$2.prototype=E$2.prototype;function G$3(tt,et,rt){this.props=tt,this.context=et,this.refs=D$3,this.updater=rt||B$2}var H$4=G$3.prototype=new F$2;H$4.constructor=G$3;C$4(H$4,E$2.prototype);H$4.isPureReactComponent=!0;var I$2=Array.isArray,J$2=Object.prototype.hasOwnProperty,K$4={current:null},L$2={key:!0,ref:!0,__self:!0,__source:!0};function M$4(tt,et,rt){var nt,st={},ot=null,at=null;if(et!=null)for(nt in et.ref!==void 0&&(at=et.ref),et.key!==void 0&&(ot=""+et.key),et)J$2.call(et,nt)&&!L$2.hasOwnProperty(nt)&&(st[nt]=et[nt]);var lt=arguments.length-2;if(lt===1)st.children=rt;else if(1<lt){for(var ut=Array(lt),ct=0;ct<lt;ct++)ut[ct]=arguments[ct+2];st.children=ut}if(tt&&tt.defaultProps)for(nt in lt=tt.defaultProps,lt)st[nt]===void 0&&(st[nt]=lt[nt]);return{$$typeof:l$3,type:tt,key:ot,ref:at,props:st,_owner:K$4.current}}function N$3(tt,et){return{$$typeof:l$3,type:tt.type,key:et,ref:tt.ref,props:tt.props,_owner:tt._owner}}function O$3(tt){return typeof tt=="object"&&tt!==null&&tt.$$typeof===l$3}function escape$2(tt){var et={"=":"=0",":":"=2"};return"$"+tt.replace(/[=:]/g,function(rt){return et[rt]})}var P$3=/\/+/g;function Q$3(tt,et){return typeof tt=="object"&&tt!==null&&tt.key!=null?escape$2(""+tt.key):et.toString(36)}function R$2(tt,et,rt,nt,st){var ot=typeof tt;(ot==="undefined"||ot==="boolean")&&(tt=null);var at=!1;if(tt===null)at=!0;else switch(ot){case"string":case"number":at=!0;break;case"object":switch(tt.$$typeof){case l$3:case n$5:at=!0}}if(at)return at=tt,st=st(at),tt=nt===""?"."+Q$3(at,0):nt,I$2(st)?(rt="",tt!=null&&(rt=tt.replace(P$3,"$&/")+"/"),R$2(st,et,rt,"",function(ct){return ct})):st!=null&&(O$3(st)&&(st=N$3(st,rt+(!st.key||at&&at.key===st.key?"":(""+st.key).replace(P$3,"$&/")+"/")+tt)),et.push(st)),1;if(at=0,nt=nt===""?".":nt+":",I$2(tt))for(var lt=0;lt<tt.length;lt++){ot=tt[lt];var ut=nt+Q$3(ot,lt);at+=R$2(ot,et,rt,ut,st)}else if(ut=A$3(tt),typeof ut=="function")for(tt=ut.call(tt),lt=0;!(ot=tt.next()).done;)ot=ot.value,ut=nt+Q$3(ot,lt++),at+=R$2(ot,et,rt,ut,st);else if(ot==="object")throw et=String(tt),Error("Objects are not valid as a React child (found: "+(et==="[object Object]"?"object with keys {"+Object.keys(tt).join(", ")+"}":et)+"). If you meant to render a collection of children, use an array instead.");return at}function S$3(tt,et,rt){if(tt==null)return tt;var nt=[],st=0;return R$2(tt,nt,"","",function(ot){return et.call(rt,ot,st++)}),nt}function T$3(tt){if(tt._status===-1){var et=tt._result;et=et(),et.then(function(rt){(tt._status===0||tt._status===-1)&&(tt._status=1,tt._result=rt)},function(rt){(tt._status===0||tt._status===-1)&&(tt._status=2,tt._result=rt)}),tt._status===-1&&(tt._status=0,tt._result=et)}if(tt._status===1)return tt._result.default;throw tt._result}var U$3={current:null},V$3={transition:null},W$4={ReactCurrentDispatcher:U$3,ReactCurrentBatchConfig:V$3,ReactCurrentOwner:K$4};function X$2(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$3,forEach:function(tt,et,rt){S$3(tt,function(){et.apply(this,arguments)},rt)},count:function(tt){var et=0;return S$3(tt,function(){et++}),et},toArray:function(tt){return S$3(tt,function(et){return et})||[]},only:function(tt){if(!O$3(tt))throw Error("React.Children.only expected to receive a single React element child.");return tt}};react_production_min.Component=E$2;react_production_min.Fragment=p$6;react_production_min.Profiler=r$2;react_production_min.PureComponent=G$3;react_production_min.StrictMode=q$3;react_production_min.Suspense=w$2;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$4;react_production_min.act=X$2;react_production_min.cloneElement=function(tt,et,rt){if(tt==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+tt+".");var nt=C$4({},tt.props),st=tt.key,ot=tt.ref,at=tt._owner;if(et!=null){if(et.ref!==void 0&&(ot=et.ref,at=K$4.current),et.key!==void 0&&(st=""+et.key),tt.type&&tt.type.defaultProps)var lt=tt.type.defaultProps;for(ut in et)J$2.call(et,ut)&&!L$2.hasOwnProperty(ut)&&(nt[ut]=et[ut]===void 0&&lt!==void 0?lt[ut]:et[ut])}var ut=arguments.length-2;if(ut===1)nt.children=rt;else if(1<ut){lt=Array(ut);for(var ct=0;ct<ut;ct++)lt[ct]=arguments[ct+2];nt.children=lt}return{$$typeof:l$3,type:tt.type,key:st,ref:ot,props:nt,_owner:at}};react_production_min.createContext=function(tt){return tt={$$typeof:u$3,_currentValue:tt,_currentValue2:tt,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},tt.Provider={$$typeof:t$3,_context:tt},tt.Consumer=tt};react_production_min.createElement=M$4;react_production_min.createFactory=function(tt){var et=M$4.bind(null,tt);return et.type=tt,et};react_production_min.createRef=function(){return{current:null}};react_production_min.forwardRef=function(tt){return{$$typeof:v$4,render:tt}};react_production_min.isValidElement=O$3;react_production_min.lazy=function(tt){return{$$typeof:y$2,_payload:{_status:-1,_result:tt},_init:T$3}};react_production_min.memo=function(tt,et){return{$$typeof:x$2,type:tt,compare:et===void 0?null:et}};react_production_min.startTransition=function(tt){var et=V$3.transition;V$3.transition={};try{tt()}finally{V$3.transition=et}};react_production_min.unstable_act=X$2;react_production_min.useCallback=function(tt,et){return U$3.current.useCallback(tt,et)};react_production_min.useContext=function(tt){return U$3.current.useContext(tt)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(tt){return U$3.current.useDeferredValue(tt)};react_production_min.useEffect=function(tt,et){return U$3.current.useEffect(tt,et)};react_production_min.useId=function(){return U$3.current.useId()};react_production_min.useImperativeHandle=function(tt,et,rt){return U$3.current.useImperativeHandle(tt,et,rt)};react_production_min.useInsertionEffect=function(tt,et){return U$3.current.useInsertionEffect(tt,et)};react_production_min.useLayoutEffect=function(tt,et){return U$3.current.useLayoutEffect(tt,et)};react_production_min.useMemo=function(tt,et){return U$3.current.useMemo(tt,et)};react_production_min.useReducer=function(tt,et,rt){return U$3.current.useReducer(tt,et,rt)};react_production_min.useRef=function(tt){return U$3.current.useRef(tt)};react_production_min.useState=function(tt){return U$3.current.useState(tt)};react_production_min.useSyncExternalStore=function(tt,et,rt){return U$3.current.useSyncExternalStore(tt,et,rt)};react_production_min.useTransition=function(){return U$3.current.useTransition()};react_production_min.version="18.3.1";react.exports=react_production_min;var reactExports=react.exports;const React$4=getDefaultExportFromCjs(reactExports),React$5=_mergeNamespaces({__proto__:null,default:React$4},[reactExports]);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ var Wp=tt=>{throw TypeError(tt)};var n3=(tt,et)=>()=>(et||tt((et={exports:{}}).e
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var f$4=reactExports,k$3=Symbol.for("react.element"),l$2=Symbol.for("react.fragment"),m$4=Object.prototype.hasOwnProperty,n$5=f$4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$5={key:!0,ref:!0,__self:!0,__source:!0};function q$2(tt,et,rt){var nt,st={},ot=null,at=null;rt!==void 0&&(ot=""+rt),et.key!==void 0&&(ot=""+et.key),et.ref!==void 0&&(at=et.ref);for(nt in et)m$4.call(et,nt)&&!p$5.hasOwnProperty(nt)&&(st[nt]=et[nt]);if(tt&&tt.defaultProps)for(nt in et=tt.defaultProps,et)st[nt]===void 0&&(st[nt]=et[nt]);return{$$typeof:k$3,type:tt,key:ot,ref:at,props:st,_owner:n$5.current}}reactJsxRuntime_production_min.Fragment=l$2;reactJsxRuntime_production_min.jsx=q$2;reactJsxRuntime_production_min.jsxs=q$2;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports;const consoleLogger={type:"logger",log(tt){this.output("log",tt)},warn(tt){this.output("warn",tt)},error(tt){this.output("error",tt)},output(tt,et){console&&console[tt]&&console[tt].apply(console,et)}};class Logger{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(et,rt)}init(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=rt.prefix||"i18next:",this.logger=et||consoleLogger,this.options=rt,this.debug=rt.debug}log(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"log","",!0)}warn(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"warn","",!0)}error(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"error","")}deprecate(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"warn","WARNING DEPRECATED: ",!0)}forward(et,rt,nt,st){return st&&!this.debug?null:(typeof et[0]=="string"&&(et[0]=`${nt}${this.prefix} ${et[0]}`),this.logger[rt](et))}create(et){return new Logger(this.logger,{prefix:`${this.prefix}:${et}:`,...this.options})}clone(et){return et=et||this.options,et.prefix=et.prefix||this.prefix,new Logger(this.logger,et)}}var baseLogger=new Logger;let EventEmitter$1=class{constructor(){this.observers={}}on(et,rt){return et.split(" ").forEach(nt=>{this.observers[nt]||(this.observers[nt]=new Map);const st=this.observers[nt].get(rt)||0;this.observers[nt].set(rt,st+1)}),this}off(et,rt){if(this.observers[et]){if(!rt){delete this.observers[et];return}this.observers[et].delete(rt)}}emit(et){for(var rt=arguments.length,nt=new Array(rt>1?rt-1:0),st=1;st<rt;st++)nt[st-1]=arguments[st];this.observers[et]&&Array.from(this.observers[et].entries()).forEach(at=>{let[lt,ut]=at;for(let ct=0;ct<ut;ct++)lt(...nt)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(at=>{let[lt,ut]=at;for(let ct=0;ct<ut;ct++)lt.apply(lt,[et,...nt])})}};function defer(){let tt,et;const rt=new Promise((nt,st)=>{tt=nt,et=st});return rt.resolve=tt,rt.reject=et,rt}function makeString(tt){return tt==null?"":""+tt}function copy(tt,et,rt){tt.forEach(nt=>{et[nt]&&(rt[nt]=et[nt])})}const lastOfPathSeparatorRegExp=/###/g;function getLastOfPath(tt,et,rt){function nt(lt){return lt&&lt.indexOf("###")>-1?lt.replace(lastOfPathSeparatorRegExp,"."):lt}function st(){return!tt||typeof tt=="string"}const ot=typeof et!="string"?et:et.split(".");let at=0;for(;at<ot.length-1;){if(st())return{};const lt=nt(ot[at]);!tt[lt]&&rt&&(tt[lt]=new rt),Object.prototype.hasOwnProperty.call(tt,lt)?tt=tt[lt]:tt={},++at}return st()?{}:{obj:tt,k:nt(ot[at])}}function setPath(tt,et,rt){const{obj:nt,k:st}=getLastOfPath(tt,et,Object);nt[st]=rt}function pushPath(tt,et,rt,nt){const{obj:st,k:ot}=getLastOfPath(tt,et,Object);st[ot]=st[ot]||[],st[ot].push(rt)}function getPath(tt,et){const{obj:rt,k:nt}=getLastOfPath(tt,et);if(rt)return rt[nt]}function getPathWithDefaults(tt,et,rt){const nt=getPath(tt,rt);return nt!==void 0?nt:getPath(et,rt)}function deepExtend(tt,et,rt){for(const nt in et)nt!=="__proto__"&&nt!=="constructor"&&(nt in tt?typeof tt[nt]=="string"||tt[nt]instanceof String||typeof et[nt]=="string"||et[nt]instanceof String?rt&&(tt[nt]=et[nt]):deepExtend(tt[nt],et[nt],rt):tt[nt]=et[nt]);return tt}function regexEscape(tt){return tt.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escape$1(tt){return typeof tt=="string"?tt.replace(/[&<>"'\/]/g,et=>_entityMap[et]):tt}class RegExpCache{constructor(et){this.capacity=et,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(et){const rt=this.regExpMap.get(et);if(rt!==void 0)return rt;const nt=new RegExp(et);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(et,nt),this.regExpQueue.push(et),nt}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20);function looksLikeObjectPath(tt,et,rt){et=et||"",rt=rt||"";const nt=chars.filter(at=>et.indexOf(at)<0&&rt.indexOf(at)<0);if(nt.length===0)return!0;const st=looksLikeObjectPathRegExpCache.getRegExp(`(${nt.map(at=>at==="?"?"\\?":at).join("|")})`);let ot=!st.test(tt);if(!ot){const at=tt.indexOf(rt);at>0&&!st.test(tt.substring(0,at))&&(ot=!0)}return ot}function deepFind(tt,et){let rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!tt)return;if(tt[et])return tt[et];const nt=et.split(rt);let st=tt;for(let ot=0;ot<nt.length;){if(!st||typeof st!="object")return;let at,lt="";for(let ut=ot;ut<nt.length;++ut)if(ut!==ot&&(lt+=rt),lt+=nt[ut],at=st[lt],at!==void 0){ot+=ut-ot+1;break}st=at}return st}function getCleanedCode(tt){return tt&&tt.indexOf("_")>0?tt.replace("_","-"):tt}class ResourceStore extends EventEmitter$1{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=et||{},this.options=rt,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(et){this.options.ns.indexOf(et)<0&&this.options.ns.push(et)}removeNamespaces(et){const rt=this.options.ns.indexOf(et);rt>-1&&this.options.ns.splice(rt,1)}getResource(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const ot=st.keySeparator!==void 0?st.keySeparator:this.options.keySeparator,at=st.ignoreJSONStructure!==void 0?st.ignoreJSONStructure:this.options.ignoreJSONStructure;let lt;et.indexOf(".")>-1?lt=et.split("."):(lt=[et,rt],nt&&(Array.isArray(nt)?lt.push(...nt):typeof nt=="string"&&ot?lt.push(...nt.split(ot)):lt.push(nt)));const ut=getPath(this.data,lt);return ut||!at||typeof nt!="string"?ut:deepFind(this.data&&this.data[et]&&this.data[et][rt],nt,ot)}addResource(et,rt,nt,st){let ot=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const at=ot.keySeparator!==void 0?ot.keySeparator:this.options.keySeparator;let lt=[et,rt];nt&&(lt=lt.concat(at?nt.split(at):nt)),et.indexOf(".")>-1&&(lt=et.split("."),st=rt,rt=lt[1]),this.addNamespaces(rt),setPath(this.data,lt,st),ot.silent||this.emit("added",et,rt,nt,st)}addResources(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const ot in nt)(typeof nt[ot]=="string"||Object.prototype.toString.apply(nt[ot])==="[object Array]")&&this.addResource(et,rt,ot,nt[ot],{silent:!0});st.silent||this.emit("added",et,rt,nt)}addResourceBundle(et,rt,nt,st,ot){let at=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},lt=[et,rt];et.indexOf(".")>-1&&(lt=et.split("."),st=nt,nt=rt,rt=lt[1]),this.addNamespaces(rt);let ut=getPath(this.data,lt)||{};st?deepExtend(ut,nt,ot):ut={...ut,...nt},setPath(this.data,lt,ut),at.silent||this.emit("added",et,rt,nt)}removeResourceBundle(et,rt){this.hasResourceBundle(et,rt)&&delete this.data[et][rt],this.removeNamespaces(rt),this.emit("removed",et,rt)}hasResourceBundle(et,rt){return this.getResource(et,rt)!==void 0}getResourceBundle(et,rt){return rt||(rt=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(et,rt)}:this.getResource(et,rt)}getDataByLanguage(et){return this.data[et]}hasLanguageSomeTranslations(et){const rt=this.getDataByLanguage(et);return!!(rt&&Object.keys(rt)||[]).find(st=>rt[st]&&Object.keys(rt[st]).length>0)}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(tt){this.processors[tt.name]=tt},handle(tt,et,rt,nt,st){return tt.forEach(ot=>{this.processors[ot]&&(et=this.processors[ot].process(et,rt,nt,st))}),et}};const checkedLoadedFor={};class Translator extends EventEmitter$1{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],et,this),this.options=rt,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator")}changeLanguage(et){et&&(this.language=et)}exists(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(et==null)return!1;const nt=this.resolve(et,rt);return nt&&nt.res!==void 0}extractFromKey(et,rt){let nt=rt.nsSeparator!==void 0?rt.nsSeparator:this.options.nsSeparator;nt===void 0&&(nt=":");const st=rt.keySeparator!==void 0?rt.keySeparator:this.options.keySeparator;let ot=rt.ns||this.options.defaultNS||[];const at=nt&&et.indexOf(nt)>-1,lt=!this.options.userDefinedKeySeparator&&!rt.keySeparator&&!this.options.userDefinedNsSeparator&&!rt.nsSeparator&&!looksLikeObjectPath(et,nt,st);if(at&&!lt){const ut=et.match(this.interpolator.nestingRegexp);if(ut&&ut.length>0)return{key:et,namespaces:ot};const ct=et.split(nt);(nt!==st||nt===st&&this.options.ns.indexOf(ct[0])>-1)&&(ot=ct.shift()),et=ct.join(st)}return typeof ot=="string"&&(ot=[ot]),{key:et,namespaces:ot}}translate(et,rt,nt){if(typeof rt!="object"&&this.options.overloadTranslationOptionHandler&&(rt=this.options.overloadTranslationOptionHandler(arguments)),typeof rt=="object"&&(rt={...rt}),rt||(rt={}),et==null)return"";Array.isArray(et)||(et=[String(et)]);const st=rt.returnDetails!==void 0?rt.returnDetails:this.options.returnDetails,ot=rt.keySeparator!==void 0?rt.keySeparator:this.options.keySeparator,{key:at,namespaces:lt}=this.extractFromKey(et[et.length-1],rt),ut=lt[lt.length-1],ct=rt.lng||this.language,dt=rt.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(ct&&ct.toLowerCase()==="cimode"){if(dt){const Rt=rt.nsSeparator||this.options.nsSeparator;return st?{res:`${ut}${Rt}${at}`,usedKey:at,exactUsedKey:at,usedLng:ct,usedNS:ut,usedParams:this.getUsedParamsDetails(rt)}:`${ut}${Rt}${at}`}return st?{res:at,usedKey:at,exactUsedKey:at,usedLng:ct,usedNS:ut,usedParams:this.getUsedParamsDetails(rt)}:at}const ht=this.resolve(et,rt);let mt=ht&&ht.res;const xt=ht&&ht.usedKey||at,yt=ht&&ht.exactUsedKey||at,vt=Object.prototype.toString.apply(mt),Et=["[object Number]","[object Function]","[object RegExp]"],bt=rt.joinArrays!==void 0?rt.joinArrays:this.options.joinArrays,St=!this.i18nFormat||this.i18nFormat.handleAsObject;if(St&&mt&&(typeof mt!="string"&&typeof mt!="boolean"&&typeof mt!="number")&&Et.indexOf(vt)<0&&!(typeof bt=="string"&&vt==="[object Array]")){if(!rt.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Rt=this.options.returnedObjectHandler?this.options.returnedObjectHandler(xt,mt,{...rt,ns:lt}):`key '${at} (${this.language})' returned an object instead of string.`;return st?(ht.res=Rt,ht.usedParams=this.getUsedParamsDetails(rt),ht):Rt}if(ot){const Rt=vt==="[object Array]",Ct=Rt?[]:{},Pt=Rt?yt:xt;for(const It in mt)if(Object.prototype.hasOwnProperty.call(mt,It)){const jt=`${Pt}${ot}${It}`;Ct[It]=this.translate(jt,{...rt,joinArrays:!1,ns:lt}),Ct[It]===jt&&(Ct[It]=mt[It])}mt=Ct}}else if(St&&typeof bt=="string"&&vt==="[object Array]")mt=mt.join(bt),mt&&(mt=this.extendTranslation(mt,et,rt,nt));else{let Rt=!1,Ct=!1;const Pt=rt.count!==void 0&&typeof rt.count!="string",It=Translator.hasDefaultValue(rt),jt=Pt?this.pluralResolver.getSuffix(ct,rt.count,rt):"",Dt=rt.ordinal&&Pt?this.pluralResolver.getSuffix(ct,rt.count,{ordinal:!1}):"",Vt=Pt&&!rt.ordinal&&rt.count===0&&this.pluralResolver.shouldUseIntlApi(),Ft=Vt&&rt[`defaultValue${this.options.pluralSeparator}zero`]||rt[`defaultValue${jt}`]||rt[`defaultValue${Dt}`]||rt.defaultValue;!this.isValidLookup(mt)&&It&&(Rt=!0,mt=Ft),this.isValidLookup(mt)||(Ct=!0,mt=at);const Nt=(rt.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Ct?void 0:mt,Lt=It&&Ft!==mt&&this.options.updateMissing;if(Ct||Rt||Lt){if(this.logger.log(Lt?"updateKey":"missingKey",ct,ut,at,Lt?Ft:mt),ot){const $t=this.resolve(at,{...rt,keySeparator:!1});$t&&$t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Mt=[];const zt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,rt.lng||this.language);if(this.options.saveMissingTo==="fallback"&&zt&&zt[0])for(let $t=0;$t<zt.length;$t++)Mt.push(zt[$t]);else this.options.saveMissingTo==="all"?Mt=this.languageUtils.toResolveHierarchy(rt.lng||this.language):Mt.push(rt.lng||this.language);const Gt=($t,Ut,Bt)=>{const Yt=It&&Bt!==mt?Bt:Nt;this.options.missingKeyHandler?this.options.missingKeyHandler($t,ut,Ut,Yt,Lt,rt):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing($t,ut,Ut,Yt,Lt,rt),this.emit("missingKey",$t,ut,Ut,mt)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Pt?Mt.forEach($t=>{const Ut=this.pluralResolver.getSuffixes($t,rt);Vt&&rt[`defaultValue${this.options.pluralSeparator}zero`]&&Ut.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ut.push(`${this.options.pluralSeparator}zero`),Ut.forEach(Bt=>{Gt([$t],at+Bt,rt[`defaultValue${Bt}`]||Ft)})}):Gt(Mt,at,Ft))}mt=this.extendTranslation(mt,et,rt,ht,nt),Ct&&mt===at&&this.options.appendNamespaceToMissingKey&&(mt=`${ut}:${at}`),(Ct||Rt)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?mt=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${ut}:${at}`:at,Rt?mt:void 0):mt=this.options.parseMissingKeyHandler(mt))}return st?(ht.res=mt,ht.usedParams=this.getUsedParamsDetails(rt),ht):mt}extendTranslation(et,rt,nt,st,ot){var at=this;if(this.i18nFormat&&this.i18nFormat.parse)et=this.i18nFormat.parse(et,{...this.options.interpolation.defaultVariables,...nt},nt.lng||this.language||st.usedLng,st.usedNS,st.usedKey,{resolved:st});else if(!nt.skipInterpolation){nt.interpolation&&this.interpolator.init({...nt,interpolation:{...this.options.interpolation,...nt.interpolation}});const ct=typeof et=="string"&&(nt&&nt.interpolation&&nt.interpolation.skipOnVariables!==void 0?nt.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let dt;if(ct){const mt=et.match(this.interpolator.nestingRegexp);dt=mt&&mt.length}let ht=nt.replace&&typeof nt.replace!="string"?nt.replace:nt;if(this.options.interpolation.defaultVariables&&(ht={...this.options.interpolation.defaultVariables,...ht}),et=this.interpolator.interpolate(et,ht,nt.lng||this.language,nt),ct){const mt=et.match(this.interpolator.nestingRegexp),xt=mt&&mt.length;dt<xt&&(nt.nest=!1)}!nt.lng&&this.options.compatibilityAPI!=="v1"&&st&&st.res&&(nt.lng=st.usedLng),nt.nest!==!1&&(et=this.interpolator.nest(et,function(){for(var mt=arguments.length,xt=new Array(mt),yt=0;yt<mt;yt++)xt[yt]=arguments[yt];return ot&&ot[0]===xt[0]&&!nt.context?(at.logger.warn(`It seems you are nesting recursively key: ${xt[0]} in key: ${rt[0]}`),null):at.translate(...xt,rt)},nt)),nt.interpolation&&this.interpolator.reset()}const lt=nt.postProcess||this.options.postProcess,ut=typeof lt=="string"?[lt]:lt;return et!=null&&ut&&ut.length&&nt.applyPostProcessor!==!1&&(et=postProcessor.handle(ut,et,rt,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...st,usedParams:this.getUsedParamsDetails(nt)},...nt}:nt,this)),et}resolve(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt,st,ot,at,lt;return typeof et=="string"&&(et=[et]),et.forEach(ut=>{if(this.isValidLookup(nt))return;const ct=this.extractFromKey(ut,rt),dt=ct.key;st=dt;let ht=ct.namespaces;this.options.fallbackNS&&(ht=ht.concat(this.options.fallbackNS));const mt=rt.count!==void 0&&typeof rt.count!="string",xt=mt&&!rt.ordinal&&rt.count===0&&this.pluralResolver.shouldUseIntlApi(),yt=rt.context!==void 0&&(typeof rt.context=="string"||typeof rt.context=="number")&&rt.context!=="",vt=rt.lngs?rt.lngs:this.languageUtils.toResolveHierarchy(rt.lng||this.language,rt.fallbackLng);ht.forEach(Et=>{this.isValidLookup(nt)||(lt=Et,!checkedLoadedFor[`${vt[0]}-${Et}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(lt)&&(checkedLoadedFor[`${vt[0]}-${Et}`]=!0,this.logger.warn(`key "${st}" for languages "${vt.join(", ")}" won't get resolved as namespace "${lt}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),vt.forEach(bt=>{if(this.isValidLookup(nt))return;at=bt;const St=[dt];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(St,dt,bt,Et,rt);else{let Rt;mt&&(Rt=this.pluralResolver.getSuffix(bt,rt.count,rt));const Ct=`${this.options.pluralSeparator}zero`,Pt=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(mt&&(St.push(dt+Rt),rt.ordinal&&Rt.indexOf(Pt)===0&&St.push(dt+Rt.replace(Pt,this.options.pluralSeparator)),xt&&St.push(dt+Ct)),yt){const It=`${dt}${this.options.contextSeparator}${rt.context}`;St.push(It),mt&&(St.push(It+Rt),rt.ordinal&&Rt.indexOf(Pt)===0&&St.push(It+Rt.replace(Pt,this.options.pluralSeparator)),xt&&St.push(It+Ct))}}let wt;for(;wt=St.pop();)this.isValidLookup(nt)||(ot=wt,nt=this.getResource(bt,Et,wt,rt))}))})}),{res:nt,usedKey:st,exactUsedKey:ot,usedLng:at,usedNS:lt}}isValidLookup(et){return et!==void 0&&!(!this.options.returnNull&&et===null)&&!(!this.options.returnEmptyString&&et==="")}getResource(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(et,rt,nt,st):this.resourceStore.getResource(et,rt,nt,st)}getUsedParamsDetails(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const rt=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],nt=et.replace&&typeof et.replace!="string";let st=nt?et.replace:et;if(nt&&typeof et.count<"u"&&(st.count=et.count),this.options.interpolation.defaultVariables&&(st={...this.options.interpolation.defaultVariables,...st}),!nt){st={...st};for(const ot of rt)delete st[ot]}return st}static hasDefaultValue(et){const rt="defaultValue";for(const nt in et)if(Object.prototype.hasOwnProperty.call(et,nt)&&rt===nt.substring(0,rt.length)&&et[nt]!==void 0)return!0;return!1}}function capitalize$2(tt){return tt.charAt(0).toUpperCase()+tt.slice(1)}class LanguageUtil{constructor(et){this.options=et,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(et){if(et=getCleanedCode(et),!et||et.indexOf("-")<0)return null;const rt=et.split("-");return rt.length===2||(rt.pop(),rt[rt.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(rt.join("-"))}getLanguagePartFromCode(et){if(et=getCleanedCode(et),!et||et.indexOf("-")<0)return et;const rt=et.split("-");return this.formatLanguageCode(rt[0])}formatLanguageCode(et){if(typeof et=="string"&&et.indexOf("-")>-1){const rt=["hans","hant","latn","cyrl","cans","mong","arab"];let nt=et.split("-");return this.options.lowerCaseLng?nt=nt.map(st=>st.toLowerCase()):nt.length===2?(nt[0]=nt[0].toLowerCase(),nt[1]=nt[1].toUpperCase(),rt.indexOf(nt[1].toLowerCase())>-1&&(nt[1]=capitalize$2(nt[1].toLowerCase()))):nt.length===3&&(nt[0]=nt[0].toLowerCase(),nt[1].length===2&&(nt[1]=nt[1].toUpperCase()),nt[0]!=="sgn"&&nt[2].length===2&&(nt[2]=nt[2].toUpperCase()),rt.indexOf(nt[1].toLowerCase())>-1&&(nt[1]=capitalize$2(nt[1].toLowerCase())),rt.indexOf(nt[2].toLowerCase())>-1&&(nt[2]=capitalize$2(nt[2].toLowerCase()))),nt.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?et.toLowerCase():et}isSupportedCode(et){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(et=this.getLanguagePartFromCode(et)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(et)>-1}getBestMatchFromCodes(et){if(!et)return null;let rt;return et.forEach(nt=>{if(rt)return;const st=this.formatLanguageCode(nt);(!this.options.supportedLngs||this.isSupportedCode(st))&&(rt=st)}),!rt&&this.options.supportedLngs&&et.forEach(nt=>{if(rt)return;const st=this.getLanguagePartFromCode(nt);if(this.isSupportedCode(st))return rt=st;rt=this.options.supportedLngs.find(ot=>{if(ot===st)return ot;if(!(ot.indexOf("-")<0&&st.indexOf("-")<0)&&ot.indexOf(st)===0)return ot})}),rt||(rt=this.getFallbackCodes(this.options.fallbackLng)[0]),rt}getFallbackCodes(et,rt){if(!et)return[];if(typeof et=="function"&&(et=et(rt)),typeof et=="string"&&(et=[et]),Object.prototype.toString.apply(et)==="[object Array]")return et;if(!rt)return et.default||[];let nt=et[rt];return nt||(nt=et[this.getScriptPartFromCode(rt)]),nt||(nt=et[this.formatLanguageCode(rt)]),nt||(nt=et[this.getLanguagePartFromCode(rt)]),nt||(nt=et.default),nt||[]}toResolveHierarchy(et,rt){const nt=this.getFallbackCodes(rt||this.options.fallbackLng||[],et),st=[],ot=at=>{at&&(this.isSupportedCode(at)?st.push(at):this.logger.warn(`rejecting language code not found in supportedLngs: ${at}`))};return typeof et=="string"&&(et.indexOf("-")>-1||et.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&ot(this.formatLanguageCode(et)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&ot(this.getScriptPartFromCode(et)),this.options.load!=="currentOnly"&&ot(this.getLanguagePartFromCode(et))):typeof et=="string"&&ot(this.formatLanguageCode(et)),nt.forEach(at=>{st.indexOf(at)<0&&ot(this.formatLanguageCode(at))}),st}}let sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(tt){return+(tt>1)},2:function(tt){return+(tt!=1)},3:function(tt){return 0},4:function(tt){return tt%10==1&&tt%100!=11?0:tt%10>=2&&tt%10<=4&&(tt%100<10||tt%100>=20)?1:2},5:function(tt){return tt==0?0:tt==1?1:tt==2?2:tt%100>=3&&tt%100<=10?3:tt%100>=11?4:5},6:function(tt){return tt==1?0:tt>=2&&tt<=4?1:2},7:function(tt){return tt==1?0:tt%10>=2&&tt%10<=4&&(tt%100<10||tt%100>=20)?1:2},8:function(tt){return tt==1?0:tt==2?1:tt!=8&&tt!=11?2:3},9:function(tt){return+(tt>=2)},10:function(tt){return tt==1?0:tt==2?1:tt<7?2:tt<11?3:4},11:function(tt){return tt==1||tt==11?0:tt==2||tt==12?1:tt>2&&tt<20?2:3},12:function(tt){return+(tt%10!=1||tt%100==11)},13:function(tt){return+(tt!==0)},14:function(tt){return tt==1?0:tt==2?1:tt==3?2:3},15:function(tt){return tt%10==1&&tt%100!=11?0:tt%10>=2&&(tt%100<10||tt%100>=20)?1:2},16:function(tt){return tt%10==1&&tt%100!=11?0:tt!==0?1:2},17:function(tt){return tt==1||tt%10==1&&tt%100!=11?0:1},18:function(tt){return tt==0?0:tt==1?1:2},19:function(tt){return tt==1?0:tt==0||tt%100>1&&tt%100<11?1:tt%100>10&&tt%100<20?2:3},20:function(tt){return tt==1?0:tt==0||tt%100>0&&tt%100<20?1:2},21:function(tt){return tt%100==1?1:tt%100==2?2:tt%100==3||tt%100==4?3:0},22:function(tt){return tt==1?0:tt==2?1:(tt<0||tt>10)&&tt%10==0?2:3}};const nonIntlVersions=["v1","v2","v3"],intlVersions=["v4"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){const tt={};return sets.forEach(et=>{et.lngs.forEach(rt=>{tt[rt]={numbers:et.nr,plurals:_rulesPluralsTypes[et.fc]}})}),tt}class PluralResolver{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=et,this.options=rt,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||intlVersions.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}addRule(et,rt){this.rules[et]=rt}getRule(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(getCleanedCode(et==="dev"?"en":et),{type:rt.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[et]||this.rules[this.languageUtils.getLanguagePartFromCode(et)]}needsPlural(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const nt=this.getRule(et,rt);return this.shouldUseIntlApi()?nt&&nt.resolvedOptions().pluralCategories.length>1:nt&&nt.numbers.length>1}getPluralFormsOfKey(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(et,nt).map(st=>`${rt}${st}`)}getSuffixes(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const nt=this.getRule(et,rt);return nt?this.shouldUseIntlApi()?nt.resolvedOptions().pluralCategories.sort((st,ot)=>suffixesOrder[st]-suffixesOrder[ot]).map(st=>`${this.options.prepend}${rt.ordinal?`ordinal${this.options.prepend}`:""}${st}`):nt.numbers.map(st=>this.getSuffix(et,st,rt)):[]}getSuffix(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const st=this.getRule(et,nt);return st?this.shouldUseIntlApi()?`${this.options.prepend}${nt.ordinal?`ordinal${this.options.prepend}`:""}${st.select(rt)}`:this.getSuffixRetroCompatible(st,rt):(this.logger.warn(`no plural rule found for: ${et}`),"")}getSuffixRetroCompatible(et,rt){const nt=et.noAbs?et.plurals(rt):et.plurals(Math.abs(rt));let st=et.numbers[nt];this.options.simplifyPluralSuffix&&et.numbers.length===2&&et.numbers[0]===1&&(st===2?st="plural":st===1&&(st=""));const ot=()=>this.options.prepend&&st.toString()?this.options.prepend+st.toString():st.toString();return this.options.compatibilityJSON==="v1"?st===1?"":typeof st=="number"?`_plural_${st.toString()}`:ot():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&et.numbers.length===2&&et.numbers[0]===1?ot():this.options.prepend&&nt.toString()?this.options.prepend+nt.toString():nt.toString()}shouldUseIntlApi(){return!nonIntlVersions.includes(this.options.compatibilityJSON)}}function deepFindWithDefaults(tt,et,rt){let nt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",st=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ot=getPathWithDefaults(tt,et,rt);return!ot&&st&&typeof rt=="string"&&(ot=deepFind(tt,rt,nt),ot===void 0&&(ot=deepFind(et,rt,nt))),ot}class Interpolator{constructor(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("interpolator"),this.options=et,this.format=et.interpolation&&et.interpolation.format||(rt=>rt),this.init(et)}init(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};et.interpolation||(et.interpolation={escapeValue:!0});const rt=et.interpolation;this.escape=rt.escape!==void 0?rt.escape:escape$1,this.escapeValue=rt.escapeValue!==void 0?rt.escapeValue:!0,this.useRawValueToEscape=rt.useRawValueToEscape!==void 0?rt.useRawValueToEscape:!1,this.prefix=rt.prefix?regexEscape(rt.prefix):rt.prefixEscaped||"{{",this.suffix=rt.suffix?regexEscape(rt.suffix):rt.suffixEscaped||"}}",this.formatSeparator=rt.formatSeparator?rt.formatSeparator:rt.formatSeparator||",",this.unescapePrefix=rt.unescapeSuffix?"":rt.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":rt.unescapeSuffix||"",this.nestingPrefix=rt.nestingPrefix?regexEscape(rt.nestingPrefix):rt.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=rt.nestingSuffix?regexEscape(rt.nestingSuffix):rt.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=rt.nestingOptionsSeparator?rt.nestingOptionsSeparator:rt.nestingOptionsSeparator||",",this.maxReplaces=rt.maxReplaces?rt.maxReplaces:1e3,this.alwaysFormat=rt.alwaysFormat!==void 0?rt.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const et=(rt,nt)=>rt&&rt.source===nt?(rt.lastIndex=0,rt):new RegExp(nt,"g");this.regexp=et(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=et(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=et(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(et,rt,nt,st){let ot,at,lt;const ut=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function ct(yt){return yt.replace(/\$/g,"$$$$")}const dt=yt=>{if(yt.indexOf(this.formatSeparator)<0){const St=deepFindWithDefaults(rt,ut,yt,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(St,void 0,nt,{...st,...rt,interpolationkey:yt}):St}const vt=yt.split(this.formatSeparator),Et=vt.shift().trim(),bt=vt.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(rt,ut,Et,this.options.keySeparator,this.options.ignoreJSONStructure),bt,nt,{...st,...rt,interpolationkey:Et})};this.resetRegExp();const ht=st&&st.missingInterpolationHandler||this.options.missingInterpolationHandler,mt=st&&st.interpolation&&st.interpolation.skipOnVariables!==void 0?st.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:yt=>ct(yt)},{regex:this.regexp,safeValue:yt=>this.escapeValue?ct(this.escape(yt)):ct(yt)}].forEach(yt=>{for(lt=0;ot=yt.regex.exec(et);){const vt=ot[1].trim();if(at=dt(vt),at===void 0)if(typeof ht=="function"){const bt=ht(et,ot,st);at=typeof bt=="string"?bt:""}else if(st&&Object.prototype.hasOwnProperty.call(st,vt))at="";else if(mt){at=ot[0];continue}else this.logger.warn(`missed to pass in variable ${vt} for interpolating ${et}`),at="";else typeof at!="string"&&!this.useRawValueToEscape&&(at=makeString(at));const Et=yt.safeValue(at);if(et=et.replace(ot[0],Et),mt?(yt.regex.lastIndex+=at.length,yt.regex.lastIndex-=ot[0].length):yt.regex.lastIndex=0,lt++,lt>=this.maxReplaces)break}}),et}nest(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},st,ot,at;function lt(ut,ct){const dt=this.nestingOptionsSeparator;if(ut.indexOf(dt)<0)return ut;const ht=ut.split(new RegExp(`${dt}[ ]*{`));let mt=`{${ht[1]}`;ut=ht[0],mt=this.interpolate(mt,at);const xt=mt.match(/'/g),yt=mt.match(/"/g);(xt&&xt.length%2===0&&!yt||yt.length%2!==0)&&(mt=mt.replace(/'/g,'"'));try{at=JSON.parse(mt),ct&&(at={...ct,...at})}catch(vt){return this.logger.warn(`failed parsing options string in nesting for key ${ut}`,vt),`${ut}${dt}${mt}`}return delete at.defaultValue,ut}for(;st=this.nestingRegexp.exec(et);){let ut=[];at={...nt},at=at.replace&&typeof at.replace!="string"?at.replace:at,at.applyPostProcessor=!1,delete at.defaultValue;let ct=!1;if(st[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(st[1])){const dt=st[1].split(this.formatSeparator).map(ht=>ht.trim());st[1]=dt.shift(),ut=dt,ct=!0}if(ot=rt(lt.call(this,st[1].trim(),at),at),ot&&st[0]===et&&typeof ot!="string")return ot;typeof ot!="string"&&(ot=makeString(ot)),ot||(this.logger.warn(`missed to resolve ${st[1]} for nesting ${et}`),ot=""),ct&&(ot=ut.reduce((dt,ht)=>this.format(dt,ht,nt.lng,{...nt,interpolationkey:st[1].trim()}),ot.trim())),et=et.replace(st[0],ot),this.regexp.lastIndex=0}return et}}function parseFormatStr(tt){let et=tt.toLowerCase().trim();const rt={};if(tt.indexOf("(")>-1){const nt=tt.split("(");et=nt[0].toLowerCase().trim();const st=nt[1].substring(0,nt[1].length-1);et==="currency"&&st.indexOf(":")<0?rt.currency||(rt.currency=st.trim()):et==="relativetime"&&st.indexOf(":")<0?rt.range||(rt.range=st.trim()):st.split(";").forEach(at=>{if(!at)return;const[lt,...ut]=at.split(":"),ct=ut.join(":").trim().replace(/^'+|'+$/g,"");rt[lt.trim()]||(rt[lt.trim()]=ct),ct==="false"&&(rt[lt.trim()]=!1),ct==="true"&&(rt[lt.trim()]=!0),isNaN(ct)||(rt[lt.trim()]=parseInt(ct,10))})}return{formatName:et,formatOptions:rt}}function createCachedFormatter(tt){const et={};return function(nt,st,ot){const at=st+JSON.stringify(ot);let lt=et[at];return lt||(lt=tt(getCleanedCode(st),ot),et[at]=lt),lt(nt)}}class Formatter{constructor(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("formatter"),this.options=et,this.formats={number:createCachedFormatter((rt,nt)=>{const st=new Intl.NumberFormat(rt,{...nt});return ot=>st.format(ot)}),currency:createCachedFormatter((rt,nt)=>{const st=new Intl.NumberFormat(rt,{...nt,style:"currency"});return ot=>st.format(ot)}),datetime:createCachedFormatter((rt,nt)=>{const st=new Intl.DateTimeFormat(rt,{...nt});return ot=>st.format(ot)}),relativetime:createCachedFormatter((rt,nt)=>{const st=new Intl.RelativeTimeFormat(rt,{...nt});return ot=>st.format(ot,nt.range||"day")}),list:createCachedFormatter((rt,nt)=>{const st=new Intl.ListFormat(rt,{...nt});return ot=>st.format(ot)})},this.init(et)}init(et){const nt=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=nt.formatSeparator?nt.formatSeparator:nt.formatSeparator||","}add(et,rt){this.formats[et.toLowerCase().trim()]=rt}addCached(et,rt){this.formats[et.toLowerCase().trim()]=createCachedFormatter(rt)}format(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return rt.split(this.formatSeparator).reduce((lt,ut)=>{const{formatName:ct,formatOptions:dt}=parseFormatStr(ut);if(this.formats[ct]){let ht=lt;try{const mt=st&&st.formatParams&&st.formatParams[st.interpolationkey]||{},xt=mt.locale||mt.lng||st.locale||st.lng||nt;ht=this.formats[ct](lt,xt,{...dt,...st,...mt})}catch(mt){this.logger.warn(mt)}return ht}else this.logger.warn(`there was no format function for ${ct}`);return lt},et)}}function removePending(tt,et){tt.pending[et]!==void 0&&(delete tt.pending[et],tt.pendingCount--)}class Connector extends EventEmitter$1{constructor(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=et,this.store=rt,this.services=nt,this.languageUtils=nt.languageUtils,this.options=st,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=st.maxParallelReads||10,this.readingCalls=0,this.maxRetries=st.maxRetries>=0?st.maxRetries:5,this.retryTimeout=st.retryTimeout>=1?st.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(nt,st.backend,st)}queueLoad(et,rt,nt,st){const ot={},at={},lt={},ut={};return et.forEach(ct=>{let dt=!0;rt.forEach(ht=>{const mt=`${ct}|${ht}`;!nt.reload&&this.store.hasResourceBundle(ct,ht)?this.state[mt]=2:this.state[mt]<0||(this.state[mt]===1?at[mt]===void 0&&(at[mt]=!0):(this.state[mt]=1,dt=!1,at[mt]===void 0&&(at[mt]=!0),ot[mt]===void 0&&(ot[mt]=!0),ut[ht]===void 0&&(ut[ht]=!0)))}),dt||(lt[ct]=!0)}),(Object.keys(ot).length||Object.keys(at).length)&&this.queue.push({pending:at,pendingCount:Object.keys(at).length,loaded:{},errors:[],callback:st}),{toLoad:Object.keys(ot),pending:Object.keys(at),toLoadLanguages:Object.keys(lt),toLoadNamespaces:Object.keys(ut)}}loaded(et,rt,nt){const st=et.split("|"),ot=st[0],at=st[1];rt&&this.emit("failedLoading",ot,at,rt),nt&&this.store.addResourceBundle(ot,at,nt),this.state[et]=rt?-1:2;const lt={};this.queue.forEach(ut=>{pushPath(ut.loaded,[ot],at),removePending(ut,et),rt&&ut.errors.push(rt),ut.pendingCount===0&&!ut.done&&(Object.keys(ut.loaded).forEach(ct=>{lt[ct]||(lt[ct]={});const dt=ut.loaded[ct];dt.length&&dt.forEach(ht=>{lt[ct][ht]===void 0&&(lt[ct][ht]=!0)})}),ut.done=!0,ut.errors.length?ut.callback(ut.errors):ut.callback())}),this.emit("loaded",lt),this.queue=this.queue.filter(ut=>!ut.done)}read(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,ot=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,at=arguments.length>5?arguments[5]:void 0;if(!et.length)return at(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:et,ns:rt,fcName:nt,tried:st,wait:ot,callback:at});return}this.readingCalls++;const lt=(ct,dt)=>{if(this.readingCalls--,this.waitingReads.length>0){const ht=this.waitingReads.shift();this.read(ht.lng,ht.ns,ht.fcName,ht.tried,ht.wait,ht.callback)}if(ct&&dt&&st<this.maxRetries){setTimeout(()=>{this.read.call(this,et,rt,nt,st+1,ot*2,at)},ot);return}at(ct,dt)},ut=this.backend[nt].bind(this.backend);if(ut.length===2){try{const ct=ut(et,rt);ct&&typeof ct.then=="function"?ct.then(dt=>lt(null,dt)).catch(lt):lt(null,ct)}catch(ct){lt(ct)}return}return ut(et,rt,lt)}prepareLoading(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},st=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),st&&st();typeof et=="string"&&(et=this.languageUtils.toResolveHierarchy(et)),typeof rt=="string"&&(rt=[rt]);const ot=this.queueLoad(et,rt,nt,st);if(!ot.toLoad.length)return ot.pending.length||st(),null;ot.toLoad.forEach(at=>{this.loadOne(at)})}load(et,rt,nt){this.prepareLoading(et,rt,{},nt)}reload(et,rt,nt){this.prepareLoading(et,rt,{reload:!0},nt)}loadOne(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const nt=et.split("|"),st=nt[0],ot=nt[1];this.read(st,ot,"read",void 0,void 0,(at,lt)=>{at&&this.logger.warn(`${rt}loading namespace ${ot} for language ${st} failed`,at),!at&&lt&&this.logger.log(`${rt}loaded namespace ${ot} for language ${st}`,lt),this.loaded(et,at,lt)})}saveMissing(et,rt,nt,st,ot){let at=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},lt=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(rt)){this.logger.warn(`did not save key "${nt}" as the namespace "${rt}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(nt==null||nt==="")){if(this.backend&&this.backend.create){const ut={...at,isUpdate:ot},ct=this.backend.create.bind(this.backend);if(ct.length<6)try{let dt;ct.length===5?dt=ct(et,rt,nt,st,ut):dt=ct(et,rt,nt,st),dt&&typeof dt.then=="function"?dt.then(ht=>lt(null,ht)).catch(lt):lt(null,dt)}catch(dt){lt(dt)}else ct(et,rt,nt,st,lt,ut)}!et||!et[0]||this.store.addResource(et[0],rt,nt,st)}}}function get$2(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(et){let rt={};if(typeof et[1]=="object"&&(rt=et[1]),typeof et[1]=="string"&&(rt.defaultValue=et[1]),typeof et[2]=="string"&&(rt.tDescription=et[2]),typeof et[2]=="object"||typeof et[3]=="object"){const nt=et[3]||et[2];Object.keys(nt).forEach(st=>{rt[st]=nt[st]})}return rt},interpolation:{escapeValue:!0,format:tt=>tt,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(tt){return typeof tt.ns=="string"&&(tt.ns=[tt.ns]),typeof tt.fallbackLng=="string"&&(tt.fallbackLng=[tt.fallbackLng]),typeof tt.fallbackNS=="string"&&(tt.fallbackNS=[tt.fallbackNS]),tt.supportedLngs&&tt.supportedLngs.indexOf("cimode")<0&&(tt.supportedLngs=tt.supportedLngs.concat(["cimode"])),tt}function noop$5(){}function bindMemberFunctions(tt){Object.getOwnPropertyNames(Object.getPrototypeOf(tt)).forEach(rt=>{typeof tt[rt]=="function"&&(tt[rt]=tt[rt].bind(tt))})}class I18n extends EventEmitter$1{constructor(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rt=arguments.length>1?arguments[1]:void 0;if(super(),this.options=transformOptions(et),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),rt&&!this.isInitialized&&!et.isClone){if(!this.options.initImmediate)return this.init(et,rt),this;setTimeout(()=>{this.init(et,rt)},0)}}init(){var et=this;let rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},nt=arguments.length>1?arguments[1]:void 0;typeof rt=="function"&&(nt=rt,rt={}),!rt.defaultNS&&rt.defaultNS!==!1&&rt.ns&&(typeof rt.ns=="string"?rt.defaultNS=rt.ns:rt.ns.indexOf("translation")<0&&(rt.defaultNS=rt.ns[0]));const st=get$2();this.options={...st,...this.options,...transformOptions(rt)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...st.interpolation,...this.options.interpolation}),rt.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=rt.keySeparator),rt.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=rt.nsSeparator);function ot(dt){return dt?typeof dt=="function"?new dt:dt:null}if(!this.options.isClone){this.modules.logger?baseLogger.init(ot(this.modules.logger),this.options):baseLogger.init(null,this.options);let dt;this.modules.formatter?dt=this.modules.formatter:typeof Intl<"u"&&(dt=Formatter);const ht=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const mt=this.services;mt.logger=baseLogger,mt.resourceStore=this.store,mt.languageUtils=ht,mt.pluralResolver=new PluralResolver(ht,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),dt&&(!this.options.interpolation.format||this.options.interpolation.format===st.interpolation.format)&&(mt.formatter=ot(dt),mt.formatter.init(mt,this.options),this.options.interpolation.format=mt.formatter.format.bind(mt.formatter)),mt.interpolator=new Interpolator(this.options),mt.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},mt.backendConnector=new Connector(ot(this.modules.backend),mt.resourceStore,mt,this.options),mt.backendConnector.on("*",function(xt){for(var yt=arguments.length,vt=new Array(yt>1?yt-1:0),Et=1;Et<yt;Et++)vt[Et-1]=arguments[Et];et.emit(xt,...vt)}),this.modules.languageDetector&&(mt.languageDetector=ot(this.modules.languageDetector),mt.languageDetector.init&&mt.languageDetector.init(mt,this.options.detection,this.options)),this.modules.i18nFormat&&(mt.i18nFormat=ot(this.modules.i18nFormat),mt.i18nFormat.init&&mt.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(xt){for(var yt=arguments.length,vt=new Array(yt>1?yt-1:0),Et=1;Et<yt;Et++)vt[Et-1]=arguments[Et];et.emit(xt,...vt)}),this.modules.external.forEach(xt=>{xt.init&&xt.init(this)})}if(this.format=this.options.interpolation.format,nt||(nt=noop$5),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const dt=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);dt.length>0&&dt[0]!=="dev"&&(this.options.lng=dt[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(dt=>{this[dt]=function(){return et.store[dt](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(dt=>{this[dt]=function(){return et.store[dt](...arguments),et}});const ut=defer(),ct=()=>{const dt=(ht,mt)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),ut.resolve(mt),nt(ht,mt)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return dt(null,this.t.bind(this));this.changeLanguage(this.options.lng,dt)};return this.options.resources||!this.options.initImmediate?ct():setTimeout(ct,0),ut}loadResources(et){let nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$5;const st=typeof et=="string"?et:this.language;if(typeof et=="function"&&(nt=et),!this.options.resources||this.options.partialBundledLanguages){if(st&&st.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return nt();const ot=[],at=lt=>{if(!lt||lt==="cimode")return;this.services.languageUtils.toResolveHierarchy(lt).forEach(ct=>{ct!=="cimode"&&ot.indexOf(ct)<0&&ot.push(ct)})};st?at(st):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(ut=>at(ut)),this.options.preload&&this.options.preload.forEach(lt=>at(lt)),this.services.backendConnector.load(ot,this.options.ns,lt=>{!lt&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),nt(lt)})}else nt(null)}reloadResources(et,rt,nt){const st=defer();return et||(et=this.languages),rt||(rt=this.options.ns),nt||(nt=noop$5),this.services.backendConnector.reload(et,rt,ot=>{st.resolve(),nt(ot)}),st}use(et){if(!et)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!et.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return et.type==="backend"&&(this.modules.backend=et),(et.type==="logger"||et.log&&et.warn&&et.error)&&(this.modules.logger=et),et.type==="languageDetector"&&(this.modules.languageDetector=et),et.type==="i18nFormat"&&(this.modules.i18nFormat=et),et.type==="postProcessor"&&postProcessor.addPostProcessor(et),et.type==="formatter"&&(this.modules.formatter=et),et.type==="3rdParty"&&this.modules.external.push(et),this}setResolvedLanguage(et){if(!(!et||!this.languages)&&!(["cimode","dev"].indexOf(et)>-1))for(let rt=0;rt<this.languages.length;rt++){const nt=this.languages[rt];if(!(["cimode","dev"].indexOf(nt)>-1)&&this.store.hasLanguageSomeTranslations(nt)){this.resolvedLanguage=nt;break}}}changeLanguage(et,rt){var nt=this;this.isLanguageChangingTo=et;const st=defer();this.emit("languageChanging",et);const ot=ut=>{this.language=ut,this.languages=this.services.languageUtils.toResolveHierarchy(ut),this.resolvedLanguage=void 0,this.setResolvedLanguage(ut)},at=(ut,ct)=>{ct?(ot(ct),this.translator.changeLanguage(ct),this.isLanguageChangingTo=void 0,this.emit("languageChanged",ct),this.logger.log("languageChanged",ct)):this.isLanguageChangingTo=void 0,st.resolve(function(){return nt.t(...arguments)}),rt&&rt(ut,function(){return nt.t(...arguments)})},lt=ut=>{!et&&!ut&&this.services.languageDetector&&(ut=[]);const ct=typeof ut=="string"?ut:this.services.languageUtils.getBestMatchFromCodes(ut);ct&&(this.language||ot(ct),this.translator.language||this.translator.changeLanguage(ct),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(ct)),this.loadResources(ct,dt=>{at(dt,ct)})};return!et&&this.services.languageDetector&&!this.services.languageDetector.async?lt(this.services.languageDetector.detect()):!et&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(lt):this.services.languageDetector.detect(lt):lt(et),st}getFixedT(et,rt,nt){var st=this;const ot=function(at,lt){let ut;if(typeof lt!="object"){for(var ct=arguments.length,dt=new Array(ct>2?ct-2:0),ht=2;ht<ct;ht++)dt[ht-2]=arguments[ht];ut=st.options.overloadTranslationOptionHandler([at,lt].concat(dt))}else ut={...lt};ut.lng=ut.lng||ot.lng,ut.lngs=ut.lngs||ot.lngs,ut.ns=ut.ns||ot.ns,ut.keyPrefix=ut.keyPrefix||nt||ot.keyPrefix;const mt=st.options.keySeparator||".";let xt;return ut.keyPrefix&&Array.isArray(at)?xt=at.map(yt=>`${ut.keyPrefix}${mt}${yt}`):xt=ut.keyPrefix?`${ut.keyPrefix}${mt}${at}`:at,st.t(xt,ut)};return typeof et=="string"?ot.lng=et:ot.lngs=et,ot.ns=rt,ot.keyPrefix=nt,ot}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(et){this.options.defaultNS=et}hasLoadedNamespace(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const nt=rt.lng||this.resolvedLanguage||this.languages[0],st=this.options?this.options.fallbackLng:!1,ot=this.languages[this.languages.length-1];if(nt.toLowerCase()==="cimode")return!0;const at=(lt,ut)=>{const ct=this.services.backendConnector.state[`${lt}|${ut}`];return ct===-1||ct===2};if(rt.precheck){const lt=rt.precheck(this,at);if(lt!==void 0)return lt}return!!(this.hasResourceBundle(nt,et)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||at(nt,et)&&(!st||at(ot,et)))}loadNamespaces(et,rt){const nt=defer();return this.options.ns?(typeof et=="string"&&(et=[et]),et.forEach(st=>{this.options.ns.indexOf(st)<0&&this.options.ns.push(st)}),this.loadResources(st=>{nt.resolve(),rt&&rt(st)}),nt):(rt&&rt(),Promise.resolve())}loadLanguages(et,rt){const nt=defer();typeof et=="string"&&(et=[et]);const st=this.options.preload||[],ot=et.filter(at=>st.indexOf(at)<0);return ot.length?(this.options.preload=st.concat(ot),this.loadResources(at=>{nt.resolve(),rt&&rt(at)}),nt):(rt&&rt(),Promise.resolve())}dir(et){if(et||(et=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!et)return"rtl";const rt=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],nt=this.services&&this.services.languageUtils||new LanguageUtil(get$2());return rt.indexOf(nt.getLanguagePartFromCode(et))>-1||et.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rt=arguments.length>1?arguments[1]:void 0;return new I18n(et,rt)}cloneInstance(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$5;const nt=et.forkResourceStore;nt&&delete et.forkResourceStore;const st={...this.options,...et,isClone:!0},ot=new I18n(st);return(et.debug!==void 0||et.prefix!==void 0)&&(ot.logger=ot.logger.clone(et)),["store","services","language"].forEach(lt=>{ot[lt]=this[lt]}),ot.services={...this.services},ot.services.utils={hasLoadedNamespace:ot.hasLoadedNamespace.bind(ot)},nt&&(ot.store=new ResourceStore(this.store.data,st),ot.services.resourceStore=ot.store),ot.translator=new Translator(ot.services,st),ot.translator.on("*",function(lt){for(var ut=arguments.length,ct=new Array(ut>1?ut-1:0),dt=1;dt<ut;dt++)ct[dt-1]=arguments[dt];ot.emit(lt,...ct)}),ot.init(st,rt),ot.translator.options=st,ot.translator.backendConnector.services.utils={hasLoadedNamespace:ot.hasLoadedNamespace.bind(ot)},ot}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;instance.createInstance;instance.dir;instance.init;instance.loadResources;instance.reloadResources;instance.use;instance.changeLanguage;instance.getFixedT;const t$2=instance.t;instance.exists;instance.setDefaultNamespace;instance.hasLoadedNamespace;instance.loadNamespaces;instance.loadLanguages;function _typeof$2(tt){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$2(tt)}var arr=[],each$1=arr.forEach,slice=arr.slice;function defaults$6(tt){return each$1.call(slice.call(arguments,1),function(et){if(et)for(var rt in et)tt[rt]===void 0&&(tt[rt]=et[rt])}),tt}function hasXMLHttpRequest(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_typeof$2(XMLHttpRequest))==="object"}function isPromise(tt){return!!tt&&typeof tt.then=="function"}function makePromise(tt){return isPromise(tt)?tt:Promise.resolve(tt)}function commonjsRequire(tt){throw new Error('Could not dynamically require "'+tt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var getFetch$1={exports:{}},browserPonyfill={exports:{}},hasRequiredBrowserPonyfill;function requireBrowserPonyfill(){return hasRequiredBrowserPonyfill||(hasRequiredBrowserPonyfill=1,function(tt,et){var rt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof commonjsGlobal<"u"&&commonjsGlobal,nt=function(){function ot(){this.fetch=!1,this.DOMException=rt.DOMException}return ot.prototype=rt,new ot}();(function(ot){(function(at){var lt=typeof ot<"u"&&ot||typeof self<"u"&&self||typeof lt<"u"&&lt,ut={searchParams:"URLSearchParams"in lt,iterable:"Symbol"in lt&&"iterator"in Symbol,blob:"FileReader"in lt&&"Blob"in lt&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in lt,arrayBuffer:"ArrayBuffer"in lt};function ct(Mt){return Mt&&DataView.prototype.isPrototypeOf(Mt)}if(ut.arrayBuffer)var dt=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ht=ArrayBuffer.isView||function(Mt){return Mt&&dt.indexOf(Object.prototype.toString.call(Mt))>-1};function mt(Mt){if(typeof Mt!="string"&&(Mt=String(Mt)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(Mt)||Mt==="")throw new TypeError('Invalid character in header field name: "'+Mt+'"');return Mt.toLowerCase()}function xt(Mt){return typeof Mt!="string"&&(Mt=String(Mt)),Mt}function yt(Mt){var zt={next:function(){var Gt=Mt.shift();return{done:Gt===void 0,value:Gt}}};return ut.iterable&&(zt[Symbol.iterator]=function(){return zt}),zt}function vt(Mt){this.map={},Mt instanceof vt?Mt.forEach(function(zt,Gt){this.append(Gt,zt)},this):Array.isArray(Mt)?Mt.forEach(function(zt){this.append(zt[0],zt[1])},this):Mt&&Object.getOwnPropertyNames(Mt).forEach(function(zt){this.append(zt,Mt[zt])},this)}vt.prototype.append=function(Mt,zt){Mt=mt(Mt),zt=xt(zt);var Gt=this.map[Mt];this.map[Mt]=Gt?Gt+", "+zt:zt},vt.prototype.delete=function(Mt){delete this.map[mt(Mt)]},vt.prototype.get=function(Mt){return Mt=mt(Mt),this.has(Mt)?this.map[Mt]:null},vt.prototype.has=function(Mt){return this.map.hasOwnProperty(mt(Mt))},vt.prototype.set=function(Mt,zt){this.map[mt(Mt)]=xt(zt)},vt.prototype.forEach=function(Mt,zt){for(var Gt in this.map)this.map.hasOwnProperty(Gt)&&Mt.call(zt,this.map[Gt],Gt,this)},vt.prototype.keys=function(){var Mt=[];return this.forEach(function(zt,Gt){Mt.push(Gt)}),yt(Mt)},vt.prototype.values=function(){var Mt=[];return this.forEach(function(zt){Mt.push(zt)}),yt(Mt)},vt.prototype.entries=function(){var Mt=[];return this.forEach(function(zt,Gt){Mt.push([Gt,zt])}),yt(Mt)},ut.iterable&&(vt.prototype[Symbol.iterator]=vt.prototype.entries);function Et(Mt){if(Mt.bodyUsed)return Promise.reject(new TypeError("Already read"));Mt.bodyUsed=!0}function bt(Mt){return new Promise(function(zt,Gt){Mt.onload=function(){zt(Mt.result)},Mt.onerror=function(){Gt(Mt.error)}})}function St(Mt){var zt=new FileReader,Gt=bt(zt);return zt.readAsArrayBuffer(Mt),Gt}function wt(Mt){var zt=new FileReader,Gt=bt(zt);return zt.readAsText(Mt),Gt}function Rt(Mt){for(var zt=new Uint8Array(Mt),Gt=new Array(zt.length),$t=0;$t<zt.length;$t++)Gt[$t]=String.fromCharCode(zt[$t]);return Gt.join("")}function Ct(Mt){if(Mt.slice)return Mt.slice(0);var zt=new Uint8Array(Mt.byteLength);return zt.set(new Uint8Array(Mt)),zt.buffer}function Pt(){return this.bodyUsed=!1,this._initBody=function(Mt){this.bodyUsed=this.bodyUsed,this._bodyInit=Mt,Mt?typeof Mt=="string"?this._bodyText=Mt:ut.blob&&Blob.prototype.isPrototypeOf(Mt)?this._bodyBlob=Mt:ut.formData&&FormData.prototype.isPrototypeOf(Mt)?this._bodyFormData=Mt:ut.searchParams&&URLSearchParams.prototype.isPrototypeOf(Mt)?this._bodyText=Mt.toString():ut.arrayBuffer&&ut.blob&&ct(Mt)?(this._bodyArrayBuffer=Ct(Mt.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ut.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Mt)||ht(Mt))?this._bodyArrayBuffer=Ct(Mt):this._bodyText=Mt=Object.prototype.toString.call(Mt):this._bodyText="",this.headers.get("content-type")||(typeof Mt=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):ut.searchParams&&URLSearchParams.prototype.isPrototypeOf(Mt)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ut.blob&&(this.blob=function(){var Mt=Et(this);if(Mt)return Mt;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var Mt=Et(this);return Mt||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(St)}),this.text=function(){var Mt=Et(this);if(Mt)return Mt;if(this._bodyBlob)return wt(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Rt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},ut.formData&&(this.formData=function(){return this.text().then(Vt)}),this.json=function(){return this.text().then(JSON.parse)},this}var It=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function jt(Mt){var zt=Mt.toUpperCase();return It.indexOf(zt)>-1?zt:Mt}function Dt(Mt,zt){if(!(this instanceof Dt))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');zt=zt||{};var Gt=zt.body;if(Mt instanceof Dt){if(Mt.bodyUsed)throw new TypeError("Already read");this.url=Mt.url,this.credentials=Mt.credentials,zt.headers||(this.headers=new vt(Mt.headers)),this.method=Mt.method,this.mode=Mt.mode,this.signal=Mt.signal,!Gt&&Mt._bodyInit!=null&&(Gt=Mt._bodyInit,Mt.bodyUsed=!0)}else this.url=String(Mt);if(this.credentials=zt.credentials||this.credentials||"same-origin",(zt.headers||!this.headers)&&(this.headers=new vt(zt.headers)),this.method=jt(zt.method||this.method||"GET"),this.mode=zt.mode||this.mode||null,this.signal=zt.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Gt)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(Gt),(this.method==="GET"||this.method==="HEAD")&&(zt.cache==="no-store"||zt.cache==="no-cache")){var $t=/([?&])_=[^&]*/;if($t.test(this.url))this.url=this.url.replace($t,"$1_="+new Date().getTime());else{var Ut=/\?/;this.url+=(Ut.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Dt.prototype.clone=function(){return new Dt(this,{body:this._bodyInit})};function Vt(Mt){var zt=new FormData;return Mt.trim().split("&").forEach(function(Gt){if(Gt){var $t=Gt.split("="),Ut=$t.shift().replace(/\+/g," "),Bt=$t.join("=").replace(/\+/g," ");zt.append(decodeURIComponent(Ut),decodeURIComponent(Bt))}}),zt}function Ft(Mt){var zt=new vt,Gt=Mt.replace(/\r?\n[\t ]+/g," ");return Gt.split("\r").map(function($t){return $t.indexOf(`
17
+ */var f$4=reactExports,k$3=Symbol.for("react.element"),l$2=Symbol.for("react.fragment"),m$4=Object.prototype.hasOwnProperty,n$4=f$4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$5={key:!0,ref:!0,__self:!0,__source:!0};function q$2(tt,et,rt){var nt,st={},ot=null,at=null;rt!==void 0&&(ot=""+rt),et.key!==void 0&&(ot=""+et.key),et.ref!==void 0&&(at=et.ref);for(nt in et)m$4.call(et,nt)&&!p$5.hasOwnProperty(nt)&&(st[nt]=et[nt]);if(tt&&tt.defaultProps)for(nt in et=tt.defaultProps,et)st[nt]===void 0&&(st[nt]=et[nt]);return{$$typeof:k$3,type:tt,key:ot,ref:at,props:st,_owner:n$4.current}}reactJsxRuntime_production_min.Fragment=l$2;reactJsxRuntime_production_min.jsx=q$2;reactJsxRuntime_production_min.jsxs=q$2;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports;const consoleLogger={type:"logger",log(tt){this.output("log",tt)},warn(tt){this.output("warn",tt)},error(tt){this.output("error",tt)},output(tt,et){console&&console[tt]&&console[tt].apply(console,et)}};class Logger{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(et,rt)}init(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=rt.prefix||"i18next:",this.logger=et||consoleLogger,this.options=rt,this.debug=rt.debug}log(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"log","",!0)}warn(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"warn","",!0)}error(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"error","")}deprecate(){for(var et=arguments.length,rt=new Array(et),nt=0;nt<et;nt++)rt[nt]=arguments[nt];return this.forward(rt,"warn","WARNING DEPRECATED: ",!0)}forward(et,rt,nt,st){return st&&!this.debug?null:(typeof et[0]=="string"&&(et[0]=`${nt}${this.prefix} ${et[0]}`),this.logger[rt](et))}create(et){return new Logger(this.logger,{prefix:`${this.prefix}:${et}:`,...this.options})}clone(et){return et=et||this.options,et.prefix=et.prefix||this.prefix,new Logger(this.logger,et)}}var baseLogger=new Logger;let EventEmitter$1=class{constructor(){this.observers={}}on(et,rt){return et.split(" ").forEach(nt=>{this.observers[nt]||(this.observers[nt]=new Map);const st=this.observers[nt].get(rt)||0;this.observers[nt].set(rt,st+1)}),this}off(et,rt){if(this.observers[et]){if(!rt){delete this.observers[et];return}this.observers[et].delete(rt)}}emit(et){for(var rt=arguments.length,nt=new Array(rt>1?rt-1:0),st=1;st<rt;st++)nt[st-1]=arguments[st];this.observers[et]&&Array.from(this.observers[et].entries()).forEach(at=>{let[lt,ut]=at;for(let ct=0;ct<ut;ct++)lt(...nt)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(at=>{let[lt,ut]=at;for(let ct=0;ct<ut;ct++)lt.apply(lt,[et,...nt])})}};function defer(){let tt,et;const rt=new Promise((nt,st)=>{tt=nt,et=st});return rt.resolve=tt,rt.reject=et,rt}function makeString(tt){return tt==null?"":""+tt}function copy(tt,et,rt){tt.forEach(nt=>{et[nt]&&(rt[nt]=et[nt])})}const lastOfPathSeparatorRegExp=/###/g;function getLastOfPath(tt,et,rt){function nt(lt){return lt&&lt.indexOf("###")>-1?lt.replace(lastOfPathSeparatorRegExp,"."):lt}function st(){return!tt||typeof tt=="string"}const ot=typeof et!="string"?et:et.split(".");let at=0;for(;at<ot.length-1;){if(st())return{};const lt=nt(ot[at]);!tt[lt]&&rt&&(tt[lt]=new rt),Object.prototype.hasOwnProperty.call(tt,lt)?tt=tt[lt]:tt={},++at}return st()?{}:{obj:tt,k:nt(ot[at])}}function setPath(tt,et,rt){const{obj:nt,k:st}=getLastOfPath(tt,et,Object);nt[st]=rt}function pushPath(tt,et,rt,nt){const{obj:st,k:ot}=getLastOfPath(tt,et,Object);st[ot]=st[ot]||[],st[ot].push(rt)}function getPath(tt,et){const{obj:rt,k:nt}=getLastOfPath(tt,et);if(rt)return rt[nt]}function getPathWithDefaults(tt,et,rt){const nt=getPath(tt,rt);return nt!==void 0?nt:getPath(et,rt)}function deepExtend(tt,et,rt){for(const nt in et)nt!=="__proto__"&&nt!=="constructor"&&(nt in tt?typeof tt[nt]=="string"||tt[nt]instanceof String||typeof et[nt]=="string"||et[nt]instanceof String?rt&&(tt[nt]=et[nt]):deepExtend(tt[nt],et[nt],rt):tt[nt]=et[nt]);return tt}function regexEscape(tt){return tt.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escape$1(tt){return typeof tt=="string"?tt.replace(/[&<>"'\/]/g,et=>_entityMap[et]):tt}class RegExpCache{constructor(et){this.capacity=et,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(et){const rt=this.regExpMap.get(et);if(rt!==void 0)return rt;const nt=new RegExp(et);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(et,nt),this.regExpQueue.push(et),nt}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20);function looksLikeObjectPath(tt,et,rt){et=et||"",rt=rt||"";const nt=chars.filter(at=>et.indexOf(at)<0&&rt.indexOf(at)<0);if(nt.length===0)return!0;const st=looksLikeObjectPathRegExpCache.getRegExp(`(${nt.map(at=>at==="?"?"\\?":at).join("|")})`);let ot=!st.test(tt);if(!ot){const at=tt.indexOf(rt);at>0&&!st.test(tt.substring(0,at))&&(ot=!0)}return ot}function deepFind(tt,et){let rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!tt)return;if(tt[et])return tt[et];const nt=et.split(rt);let st=tt;for(let ot=0;ot<nt.length;){if(!st||typeof st!="object")return;let at,lt="";for(let ut=ot;ut<nt.length;++ut)if(ut!==ot&&(lt+=rt),lt+=nt[ut],at=st[lt],at!==void 0){ot+=ut-ot+1;break}st=at}return st}function getCleanedCode(tt){return tt&&tt.indexOf("_")>0?tt.replace("_","-"):tt}class ResourceStore extends EventEmitter$1{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=et||{},this.options=rt,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(et){this.options.ns.indexOf(et)<0&&this.options.ns.push(et)}removeNamespaces(et){const rt=this.options.ns.indexOf(et);rt>-1&&this.options.ns.splice(rt,1)}getResource(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const ot=st.keySeparator!==void 0?st.keySeparator:this.options.keySeparator,at=st.ignoreJSONStructure!==void 0?st.ignoreJSONStructure:this.options.ignoreJSONStructure;let lt;et.indexOf(".")>-1?lt=et.split("."):(lt=[et,rt],nt&&(Array.isArray(nt)?lt.push(...nt):typeof nt=="string"&&ot?lt.push(...nt.split(ot)):lt.push(nt)));const ut=getPath(this.data,lt);return ut||!at||typeof nt!="string"?ut:deepFind(this.data&&this.data[et]&&this.data[et][rt],nt,ot)}addResource(et,rt,nt,st){let ot=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const at=ot.keySeparator!==void 0?ot.keySeparator:this.options.keySeparator;let lt=[et,rt];nt&&(lt=lt.concat(at?nt.split(at):nt)),et.indexOf(".")>-1&&(lt=et.split("."),st=rt,rt=lt[1]),this.addNamespaces(rt),setPath(this.data,lt,st),ot.silent||this.emit("added",et,rt,nt,st)}addResources(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const ot in nt)(typeof nt[ot]=="string"||Object.prototype.toString.apply(nt[ot])==="[object Array]")&&this.addResource(et,rt,ot,nt[ot],{silent:!0});st.silent||this.emit("added",et,rt,nt)}addResourceBundle(et,rt,nt,st,ot){let at=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},lt=[et,rt];et.indexOf(".")>-1&&(lt=et.split("."),st=nt,nt=rt,rt=lt[1]),this.addNamespaces(rt);let ut=getPath(this.data,lt)||{};st?deepExtend(ut,nt,ot):ut={...ut,...nt},setPath(this.data,lt,ut),at.silent||this.emit("added",et,rt,nt)}removeResourceBundle(et,rt){this.hasResourceBundle(et,rt)&&delete this.data[et][rt],this.removeNamespaces(rt),this.emit("removed",et,rt)}hasResourceBundle(et,rt){return this.getResource(et,rt)!==void 0}getResourceBundle(et,rt){return rt||(rt=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(et,rt)}:this.getResource(et,rt)}getDataByLanguage(et){return this.data[et]}hasLanguageSomeTranslations(et){const rt=this.getDataByLanguage(et);return!!(rt&&Object.keys(rt)||[]).find(st=>rt[st]&&Object.keys(rt[st]).length>0)}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(tt){this.processors[tt.name]=tt},handle(tt,et,rt,nt,st){return tt.forEach(ot=>{this.processors[ot]&&(et=this.processors[ot].process(et,rt,nt,st))}),et}};const checkedLoadedFor={};class Translator extends EventEmitter$1{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],et,this),this.options=rt,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator")}changeLanguage(et){et&&(this.language=et)}exists(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(et==null)return!1;const nt=this.resolve(et,rt);return nt&&nt.res!==void 0}extractFromKey(et,rt){let nt=rt.nsSeparator!==void 0?rt.nsSeparator:this.options.nsSeparator;nt===void 0&&(nt=":");const st=rt.keySeparator!==void 0?rt.keySeparator:this.options.keySeparator;let ot=rt.ns||this.options.defaultNS||[];const at=nt&&et.indexOf(nt)>-1,lt=!this.options.userDefinedKeySeparator&&!rt.keySeparator&&!this.options.userDefinedNsSeparator&&!rt.nsSeparator&&!looksLikeObjectPath(et,nt,st);if(at&&!lt){const ut=et.match(this.interpolator.nestingRegexp);if(ut&&ut.length>0)return{key:et,namespaces:ot};const ct=et.split(nt);(nt!==st||nt===st&&this.options.ns.indexOf(ct[0])>-1)&&(ot=ct.shift()),et=ct.join(st)}return typeof ot=="string"&&(ot=[ot]),{key:et,namespaces:ot}}translate(et,rt,nt){if(typeof rt!="object"&&this.options.overloadTranslationOptionHandler&&(rt=this.options.overloadTranslationOptionHandler(arguments)),typeof rt=="object"&&(rt={...rt}),rt||(rt={}),et==null)return"";Array.isArray(et)||(et=[String(et)]);const st=rt.returnDetails!==void 0?rt.returnDetails:this.options.returnDetails,ot=rt.keySeparator!==void 0?rt.keySeparator:this.options.keySeparator,{key:at,namespaces:lt}=this.extractFromKey(et[et.length-1],rt),ut=lt[lt.length-1],ct=rt.lng||this.language,dt=rt.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(ct&&ct.toLowerCase()==="cimode"){if(dt){const Rt=rt.nsSeparator||this.options.nsSeparator;return st?{res:`${ut}${Rt}${at}`,usedKey:at,exactUsedKey:at,usedLng:ct,usedNS:ut,usedParams:this.getUsedParamsDetails(rt)}:`${ut}${Rt}${at}`}return st?{res:at,usedKey:at,exactUsedKey:at,usedLng:ct,usedNS:ut,usedParams:this.getUsedParamsDetails(rt)}:at}const ht=this.resolve(et,rt);let mt=ht&&ht.res;const xt=ht&&ht.usedKey||at,yt=ht&&ht.exactUsedKey||at,vt=Object.prototype.toString.apply(mt),Et=["[object Number]","[object Function]","[object RegExp]"],bt=rt.joinArrays!==void 0?rt.joinArrays:this.options.joinArrays,St=!this.i18nFormat||this.i18nFormat.handleAsObject;if(St&&mt&&(typeof mt!="string"&&typeof mt!="boolean"&&typeof mt!="number")&&Et.indexOf(vt)<0&&!(typeof bt=="string"&&vt==="[object Array]")){if(!rt.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Rt=this.options.returnedObjectHandler?this.options.returnedObjectHandler(xt,mt,{...rt,ns:lt}):`key '${at} (${this.language})' returned an object instead of string.`;return st?(ht.res=Rt,ht.usedParams=this.getUsedParamsDetails(rt),ht):Rt}if(ot){const Rt=vt==="[object Array]",Ct=Rt?[]:{},Pt=Rt?yt:xt;for(const It in mt)if(Object.prototype.hasOwnProperty.call(mt,It)){const jt=`${Pt}${ot}${It}`;Ct[It]=this.translate(jt,{...rt,joinArrays:!1,ns:lt}),Ct[It]===jt&&(Ct[It]=mt[It])}mt=Ct}}else if(St&&typeof bt=="string"&&vt==="[object Array]")mt=mt.join(bt),mt&&(mt=this.extendTranslation(mt,et,rt,nt));else{let Rt=!1,Ct=!1;const Pt=rt.count!==void 0&&typeof rt.count!="string",It=Translator.hasDefaultValue(rt),jt=Pt?this.pluralResolver.getSuffix(ct,rt.count,rt):"",Dt=rt.ordinal&&Pt?this.pluralResolver.getSuffix(ct,rt.count,{ordinal:!1}):"",Vt=Pt&&!rt.ordinal&&rt.count===0&&this.pluralResolver.shouldUseIntlApi(),Ft=Vt&&rt[`defaultValue${this.options.pluralSeparator}zero`]||rt[`defaultValue${jt}`]||rt[`defaultValue${Dt}`]||rt.defaultValue;!this.isValidLookup(mt)&&It&&(Rt=!0,mt=Ft),this.isValidLookup(mt)||(Ct=!0,mt=at);const Nt=(rt.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Ct?void 0:mt,Lt=It&&Ft!==mt&&this.options.updateMissing;if(Ct||Rt||Lt){if(this.logger.log(Lt?"updateKey":"missingKey",ct,ut,at,Lt?Ft:mt),ot){const $t=this.resolve(at,{...rt,keySeparator:!1});$t&&$t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Mt=[];const zt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,rt.lng||this.language);if(this.options.saveMissingTo==="fallback"&&zt&&zt[0])for(let $t=0;$t<zt.length;$t++)Mt.push(zt[$t]);else this.options.saveMissingTo==="all"?Mt=this.languageUtils.toResolveHierarchy(rt.lng||this.language):Mt.push(rt.lng||this.language);const Gt=($t,Ut,Bt)=>{const Yt=It&&Bt!==mt?Bt:Nt;this.options.missingKeyHandler?this.options.missingKeyHandler($t,ut,Ut,Yt,Lt,rt):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing($t,ut,Ut,Yt,Lt,rt),this.emit("missingKey",$t,ut,Ut,mt)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Pt?Mt.forEach($t=>{const Ut=this.pluralResolver.getSuffixes($t,rt);Vt&&rt[`defaultValue${this.options.pluralSeparator}zero`]&&Ut.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ut.push(`${this.options.pluralSeparator}zero`),Ut.forEach(Bt=>{Gt([$t],at+Bt,rt[`defaultValue${Bt}`]||Ft)})}):Gt(Mt,at,Ft))}mt=this.extendTranslation(mt,et,rt,ht,nt),Ct&&mt===at&&this.options.appendNamespaceToMissingKey&&(mt=`${ut}:${at}`),(Ct||Rt)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?mt=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${ut}:${at}`:at,Rt?mt:void 0):mt=this.options.parseMissingKeyHandler(mt))}return st?(ht.res=mt,ht.usedParams=this.getUsedParamsDetails(rt),ht):mt}extendTranslation(et,rt,nt,st,ot){var at=this;if(this.i18nFormat&&this.i18nFormat.parse)et=this.i18nFormat.parse(et,{...this.options.interpolation.defaultVariables,...nt},nt.lng||this.language||st.usedLng,st.usedNS,st.usedKey,{resolved:st});else if(!nt.skipInterpolation){nt.interpolation&&this.interpolator.init({...nt,interpolation:{...this.options.interpolation,...nt.interpolation}});const ct=typeof et=="string"&&(nt&&nt.interpolation&&nt.interpolation.skipOnVariables!==void 0?nt.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let dt;if(ct){const mt=et.match(this.interpolator.nestingRegexp);dt=mt&&mt.length}let ht=nt.replace&&typeof nt.replace!="string"?nt.replace:nt;if(this.options.interpolation.defaultVariables&&(ht={...this.options.interpolation.defaultVariables,...ht}),et=this.interpolator.interpolate(et,ht,nt.lng||this.language,nt),ct){const mt=et.match(this.interpolator.nestingRegexp),xt=mt&&mt.length;dt<xt&&(nt.nest=!1)}!nt.lng&&this.options.compatibilityAPI!=="v1"&&st&&st.res&&(nt.lng=st.usedLng),nt.nest!==!1&&(et=this.interpolator.nest(et,function(){for(var mt=arguments.length,xt=new Array(mt),yt=0;yt<mt;yt++)xt[yt]=arguments[yt];return ot&&ot[0]===xt[0]&&!nt.context?(at.logger.warn(`It seems you are nesting recursively key: ${xt[0]} in key: ${rt[0]}`),null):at.translate(...xt,rt)},nt)),nt.interpolation&&this.interpolator.reset()}const lt=nt.postProcess||this.options.postProcess,ut=typeof lt=="string"?[lt]:lt;return et!=null&&ut&&ut.length&&nt.applyPostProcessor!==!1&&(et=postProcessor.handle(ut,et,rt,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...st,usedParams:this.getUsedParamsDetails(nt)},...nt}:nt,this)),et}resolve(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt,st,ot,at,lt;return typeof et=="string"&&(et=[et]),et.forEach(ut=>{if(this.isValidLookup(nt))return;const ct=this.extractFromKey(ut,rt),dt=ct.key;st=dt;let ht=ct.namespaces;this.options.fallbackNS&&(ht=ht.concat(this.options.fallbackNS));const mt=rt.count!==void 0&&typeof rt.count!="string",xt=mt&&!rt.ordinal&&rt.count===0&&this.pluralResolver.shouldUseIntlApi(),yt=rt.context!==void 0&&(typeof rt.context=="string"||typeof rt.context=="number")&&rt.context!=="",vt=rt.lngs?rt.lngs:this.languageUtils.toResolveHierarchy(rt.lng||this.language,rt.fallbackLng);ht.forEach(Et=>{this.isValidLookup(nt)||(lt=Et,!checkedLoadedFor[`${vt[0]}-${Et}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(lt)&&(checkedLoadedFor[`${vt[0]}-${Et}`]=!0,this.logger.warn(`key "${st}" for languages "${vt.join(", ")}" won't get resolved as namespace "${lt}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),vt.forEach(bt=>{if(this.isValidLookup(nt))return;at=bt;const St=[dt];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(St,dt,bt,Et,rt);else{let Rt;mt&&(Rt=this.pluralResolver.getSuffix(bt,rt.count,rt));const Ct=`${this.options.pluralSeparator}zero`,Pt=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(mt&&(St.push(dt+Rt),rt.ordinal&&Rt.indexOf(Pt)===0&&St.push(dt+Rt.replace(Pt,this.options.pluralSeparator)),xt&&St.push(dt+Ct)),yt){const It=`${dt}${this.options.contextSeparator}${rt.context}`;St.push(It),mt&&(St.push(It+Rt),rt.ordinal&&Rt.indexOf(Pt)===0&&St.push(It+Rt.replace(Pt,this.options.pluralSeparator)),xt&&St.push(It+Ct))}}let wt;for(;wt=St.pop();)this.isValidLookup(nt)||(ot=wt,nt=this.getResource(bt,Et,wt,rt))}))})}),{res:nt,usedKey:st,exactUsedKey:ot,usedLng:at,usedNS:lt}}isValidLookup(et){return et!==void 0&&!(!this.options.returnNull&&et===null)&&!(!this.options.returnEmptyString&&et==="")}getResource(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(et,rt,nt,st):this.resourceStore.getResource(et,rt,nt,st)}getUsedParamsDetails(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const rt=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],nt=et.replace&&typeof et.replace!="string";let st=nt?et.replace:et;if(nt&&typeof et.count<"u"&&(st.count=et.count),this.options.interpolation.defaultVariables&&(st={...this.options.interpolation.defaultVariables,...st}),!nt){st={...st};for(const ot of rt)delete st[ot]}return st}static hasDefaultValue(et){const rt="defaultValue";for(const nt in et)if(Object.prototype.hasOwnProperty.call(et,nt)&&rt===nt.substring(0,rt.length)&&et[nt]!==void 0)return!0;return!1}}function capitalize$2(tt){return tt.charAt(0).toUpperCase()+tt.slice(1)}class LanguageUtil{constructor(et){this.options=et,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(et){if(et=getCleanedCode(et),!et||et.indexOf("-")<0)return null;const rt=et.split("-");return rt.length===2||(rt.pop(),rt[rt.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(rt.join("-"))}getLanguagePartFromCode(et){if(et=getCleanedCode(et),!et||et.indexOf("-")<0)return et;const rt=et.split("-");return this.formatLanguageCode(rt[0])}formatLanguageCode(et){if(typeof et=="string"&&et.indexOf("-")>-1){const rt=["hans","hant","latn","cyrl","cans","mong","arab"];let nt=et.split("-");return this.options.lowerCaseLng?nt=nt.map(st=>st.toLowerCase()):nt.length===2?(nt[0]=nt[0].toLowerCase(),nt[1]=nt[1].toUpperCase(),rt.indexOf(nt[1].toLowerCase())>-1&&(nt[1]=capitalize$2(nt[1].toLowerCase()))):nt.length===3&&(nt[0]=nt[0].toLowerCase(),nt[1].length===2&&(nt[1]=nt[1].toUpperCase()),nt[0]!=="sgn"&&nt[2].length===2&&(nt[2]=nt[2].toUpperCase()),rt.indexOf(nt[1].toLowerCase())>-1&&(nt[1]=capitalize$2(nt[1].toLowerCase())),rt.indexOf(nt[2].toLowerCase())>-1&&(nt[2]=capitalize$2(nt[2].toLowerCase()))),nt.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?et.toLowerCase():et}isSupportedCode(et){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(et=this.getLanguagePartFromCode(et)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(et)>-1}getBestMatchFromCodes(et){if(!et)return null;let rt;return et.forEach(nt=>{if(rt)return;const st=this.formatLanguageCode(nt);(!this.options.supportedLngs||this.isSupportedCode(st))&&(rt=st)}),!rt&&this.options.supportedLngs&&et.forEach(nt=>{if(rt)return;const st=this.getLanguagePartFromCode(nt);if(this.isSupportedCode(st))return rt=st;rt=this.options.supportedLngs.find(ot=>{if(ot===st)return ot;if(!(ot.indexOf("-")<0&&st.indexOf("-")<0)&&ot.indexOf(st)===0)return ot})}),rt||(rt=this.getFallbackCodes(this.options.fallbackLng)[0]),rt}getFallbackCodes(et,rt){if(!et)return[];if(typeof et=="function"&&(et=et(rt)),typeof et=="string"&&(et=[et]),Object.prototype.toString.apply(et)==="[object Array]")return et;if(!rt)return et.default||[];let nt=et[rt];return nt||(nt=et[this.getScriptPartFromCode(rt)]),nt||(nt=et[this.formatLanguageCode(rt)]),nt||(nt=et[this.getLanguagePartFromCode(rt)]),nt||(nt=et.default),nt||[]}toResolveHierarchy(et,rt){const nt=this.getFallbackCodes(rt||this.options.fallbackLng||[],et),st=[],ot=at=>{at&&(this.isSupportedCode(at)?st.push(at):this.logger.warn(`rejecting language code not found in supportedLngs: ${at}`))};return typeof et=="string"&&(et.indexOf("-")>-1||et.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&ot(this.formatLanguageCode(et)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&ot(this.getScriptPartFromCode(et)),this.options.load!=="currentOnly"&&ot(this.getLanguagePartFromCode(et))):typeof et=="string"&&ot(this.formatLanguageCode(et)),nt.forEach(at=>{st.indexOf(at)<0&&ot(this.formatLanguageCode(at))}),st}}let sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(tt){return+(tt>1)},2:function(tt){return+(tt!=1)},3:function(tt){return 0},4:function(tt){return tt%10==1&&tt%100!=11?0:tt%10>=2&&tt%10<=4&&(tt%100<10||tt%100>=20)?1:2},5:function(tt){return tt==0?0:tt==1?1:tt==2?2:tt%100>=3&&tt%100<=10?3:tt%100>=11?4:5},6:function(tt){return tt==1?0:tt>=2&&tt<=4?1:2},7:function(tt){return tt==1?0:tt%10>=2&&tt%10<=4&&(tt%100<10||tt%100>=20)?1:2},8:function(tt){return tt==1?0:tt==2?1:tt!=8&&tt!=11?2:3},9:function(tt){return+(tt>=2)},10:function(tt){return tt==1?0:tt==2?1:tt<7?2:tt<11?3:4},11:function(tt){return tt==1||tt==11?0:tt==2||tt==12?1:tt>2&&tt<20?2:3},12:function(tt){return+(tt%10!=1||tt%100==11)},13:function(tt){return+(tt!==0)},14:function(tt){return tt==1?0:tt==2?1:tt==3?2:3},15:function(tt){return tt%10==1&&tt%100!=11?0:tt%10>=2&&(tt%100<10||tt%100>=20)?1:2},16:function(tt){return tt%10==1&&tt%100!=11?0:tt!==0?1:2},17:function(tt){return tt==1||tt%10==1&&tt%100!=11?0:1},18:function(tt){return tt==0?0:tt==1?1:2},19:function(tt){return tt==1?0:tt==0||tt%100>1&&tt%100<11?1:tt%100>10&&tt%100<20?2:3},20:function(tt){return tt==1?0:tt==0||tt%100>0&&tt%100<20?1:2},21:function(tt){return tt%100==1?1:tt%100==2?2:tt%100==3||tt%100==4?3:0},22:function(tt){return tt==1?0:tt==2?1:(tt<0||tt>10)&&tt%10==0?2:3}};const nonIntlVersions=["v1","v2","v3"],intlVersions=["v4"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){const tt={};return sets.forEach(et=>{et.lngs.forEach(rt=>{tt[rt]={numbers:et.nr,plurals:_rulesPluralsTypes[et.fc]}})}),tt}class PluralResolver{constructor(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=et,this.options=rt,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||intlVersions.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}addRule(et,rt){this.rules[et]=rt}getRule(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(getCleanedCode(et==="dev"?"en":et),{type:rt.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[et]||this.rules[this.languageUtils.getLanguagePartFromCode(et)]}needsPlural(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const nt=this.getRule(et,rt);return this.shouldUseIntlApi()?nt&&nt.resolvedOptions().pluralCategories.length>1:nt&&nt.numbers.length>1}getPluralFormsOfKey(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(et,nt).map(st=>`${rt}${st}`)}getSuffixes(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const nt=this.getRule(et,rt);return nt?this.shouldUseIntlApi()?nt.resolvedOptions().pluralCategories.sort((st,ot)=>suffixesOrder[st]-suffixesOrder[ot]).map(st=>`${this.options.prepend}${rt.ordinal?`ordinal${this.options.prepend}`:""}${st}`):nt.numbers.map(st=>this.getSuffix(et,st,rt)):[]}getSuffix(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const st=this.getRule(et,nt);return st?this.shouldUseIntlApi()?`${this.options.prepend}${nt.ordinal?`ordinal${this.options.prepend}`:""}${st.select(rt)}`:this.getSuffixRetroCompatible(st,rt):(this.logger.warn(`no plural rule found for: ${et}`),"")}getSuffixRetroCompatible(et,rt){const nt=et.noAbs?et.plurals(rt):et.plurals(Math.abs(rt));let st=et.numbers[nt];this.options.simplifyPluralSuffix&&et.numbers.length===2&&et.numbers[0]===1&&(st===2?st="plural":st===1&&(st=""));const ot=()=>this.options.prepend&&st.toString()?this.options.prepend+st.toString():st.toString();return this.options.compatibilityJSON==="v1"?st===1?"":typeof st=="number"?`_plural_${st.toString()}`:ot():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&et.numbers.length===2&&et.numbers[0]===1?ot():this.options.prepend&&nt.toString()?this.options.prepend+nt.toString():nt.toString()}shouldUseIntlApi(){return!nonIntlVersions.includes(this.options.compatibilityJSON)}}function deepFindWithDefaults(tt,et,rt){let nt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",st=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ot=getPathWithDefaults(tt,et,rt);return!ot&&st&&typeof rt=="string"&&(ot=deepFind(tt,rt,nt),ot===void 0&&(ot=deepFind(et,rt,nt))),ot}class Interpolator{constructor(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("interpolator"),this.options=et,this.format=et.interpolation&&et.interpolation.format||(rt=>rt),this.init(et)}init(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};et.interpolation||(et.interpolation={escapeValue:!0});const rt=et.interpolation;this.escape=rt.escape!==void 0?rt.escape:escape$1,this.escapeValue=rt.escapeValue!==void 0?rt.escapeValue:!0,this.useRawValueToEscape=rt.useRawValueToEscape!==void 0?rt.useRawValueToEscape:!1,this.prefix=rt.prefix?regexEscape(rt.prefix):rt.prefixEscaped||"{{",this.suffix=rt.suffix?regexEscape(rt.suffix):rt.suffixEscaped||"}}",this.formatSeparator=rt.formatSeparator?rt.formatSeparator:rt.formatSeparator||",",this.unescapePrefix=rt.unescapeSuffix?"":rt.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":rt.unescapeSuffix||"",this.nestingPrefix=rt.nestingPrefix?regexEscape(rt.nestingPrefix):rt.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=rt.nestingSuffix?regexEscape(rt.nestingSuffix):rt.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=rt.nestingOptionsSeparator?rt.nestingOptionsSeparator:rt.nestingOptionsSeparator||",",this.maxReplaces=rt.maxReplaces?rt.maxReplaces:1e3,this.alwaysFormat=rt.alwaysFormat!==void 0?rt.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const et=(rt,nt)=>rt&&rt.source===nt?(rt.lastIndex=0,rt):new RegExp(nt,"g");this.regexp=et(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=et(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=et(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(et,rt,nt,st){let ot,at,lt;const ut=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function ct(yt){return yt.replace(/\$/g,"$$$$")}const dt=yt=>{if(yt.indexOf(this.formatSeparator)<0){const St=deepFindWithDefaults(rt,ut,yt,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(St,void 0,nt,{...st,...rt,interpolationkey:yt}):St}const vt=yt.split(this.formatSeparator),Et=vt.shift().trim(),bt=vt.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(rt,ut,Et,this.options.keySeparator,this.options.ignoreJSONStructure),bt,nt,{...st,...rt,interpolationkey:Et})};this.resetRegExp();const ht=st&&st.missingInterpolationHandler||this.options.missingInterpolationHandler,mt=st&&st.interpolation&&st.interpolation.skipOnVariables!==void 0?st.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:yt=>ct(yt)},{regex:this.regexp,safeValue:yt=>this.escapeValue?ct(this.escape(yt)):ct(yt)}].forEach(yt=>{for(lt=0;ot=yt.regex.exec(et);){const vt=ot[1].trim();if(at=dt(vt),at===void 0)if(typeof ht=="function"){const bt=ht(et,ot,st);at=typeof bt=="string"?bt:""}else if(st&&Object.prototype.hasOwnProperty.call(st,vt))at="";else if(mt){at=ot[0];continue}else this.logger.warn(`missed to pass in variable ${vt} for interpolating ${et}`),at="";else typeof at!="string"&&!this.useRawValueToEscape&&(at=makeString(at));const Et=yt.safeValue(at);if(et=et.replace(ot[0],Et),mt?(yt.regex.lastIndex+=at.length,yt.regex.lastIndex-=ot[0].length):yt.regex.lastIndex=0,lt++,lt>=this.maxReplaces)break}}),et}nest(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},st,ot,at;function lt(ut,ct){const dt=this.nestingOptionsSeparator;if(ut.indexOf(dt)<0)return ut;const ht=ut.split(new RegExp(`${dt}[ ]*{`));let mt=`{${ht[1]}`;ut=ht[0],mt=this.interpolate(mt,at);const xt=mt.match(/'/g),yt=mt.match(/"/g);(xt&&xt.length%2===0&&!yt||yt.length%2!==0)&&(mt=mt.replace(/'/g,'"'));try{at=JSON.parse(mt),ct&&(at={...ct,...at})}catch(vt){return this.logger.warn(`failed parsing options string in nesting for key ${ut}`,vt),`${ut}${dt}${mt}`}return delete at.defaultValue,ut}for(;st=this.nestingRegexp.exec(et);){let ut=[];at={...nt},at=at.replace&&typeof at.replace!="string"?at.replace:at,at.applyPostProcessor=!1,delete at.defaultValue;let ct=!1;if(st[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(st[1])){const dt=st[1].split(this.formatSeparator).map(ht=>ht.trim());st[1]=dt.shift(),ut=dt,ct=!0}if(ot=rt(lt.call(this,st[1].trim(),at),at),ot&&st[0]===et&&typeof ot!="string")return ot;typeof ot!="string"&&(ot=makeString(ot)),ot||(this.logger.warn(`missed to resolve ${st[1]} for nesting ${et}`),ot=""),ct&&(ot=ut.reduce((dt,ht)=>this.format(dt,ht,nt.lng,{...nt,interpolationkey:st[1].trim()}),ot.trim())),et=et.replace(st[0],ot),this.regexp.lastIndex=0}return et}}function parseFormatStr(tt){let et=tt.toLowerCase().trim();const rt={};if(tt.indexOf("(")>-1){const nt=tt.split("(");et=nt[0].toLowerCase().trim();const st=nt[1].substring(0,nt[1].length-1);et==="currency"&&st.indexOf(":")<0?rt.currency||(rt.currency=st.trim()):et==="relativetime"&&st.indexOf(":")<0?rt.range||(rt.range=st.trim()):st.split(";").forEach(at=>{if(!at)return;const[lt,...ut]=at.split(":"),ct=ut.join(":").trim().replace(/^'+|'+$/g,"");rt[lt.trim()]||(rt[lt.trim()]=ct),ct==="false"&&(rt[lt.trim()]=!1),ct==="true"&&(rt[lt.trim()]=!0),isNaN(ct)||(rt[lt.trim()]=parseInt(ct,10))})}return{formatName:et,formatOptions:rt}}function createCachedFormatter(tt){const et={};return function(nt,st,ot){const at=st+JSON.stringify(ot);let lt=et[at];return lt||(lt=tt(getCleanedCode(st),ot),et[at]=lt),lt(nt)}}class Formatter{constructor(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("formatter"),this.options=et,this.formats={number:createCachedFormatter((rt,nt)=>{const st=new Intl.NumberFormat(rt,{...nt});return ot=>st.format(ot)}),currency:createCachedFormatter((rt,nt)=>{const st=new Intl.NumberFormat(rt,{...nt,style:"currency"});return ot=>st.format(ot)}),datetime:createCachedFormatter((rt,nt)=>{const st=new Intl.DateTimeFormat(rt,{...nt});return ot=>st.format(ot)}),relativetime:createCachedFormatter((rt,nt)=>{const st=new Intl.RelativeTimeFormat(rt,{...nt});return ot=>st.format(ot,nt.range||"day")}),list:createCachedFormatter((rt,nt)=>{const st=new Intl.ListFormat(rt,{...nt});return ot=>st.format(ot)})},this.init(et)}init(et){const nt=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=nt.formatSeparator?nt.formatSeparator:nt.formatSeparator||","}add(et,rt){this.formats[et.toLowerCase().trim()]=rt}addCached(et,rt){this.formats[et.toLowerCase().trim()]=createCachedFormatter(rt)}format(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return rt.split(this.formatSeparator).reduce((lt,ut)=>{const{formatName:ct,formatOptions:dt}=parseFormatStr(ut);if(this.formats[ct]){let ht=lt;try{const mt=st&&st.formatParams&&st.formatParams[st.interpolationkey]||{},xt=mt.locale||mt.lng||st.locale||st.lng||nt;ht=this.formats[ct](lt,xt,{...dt,...st,...mt})}catch(mt){this.logger.warn(mt)}return ht}else this.logger.warn(`there was no format function for ${ct}`);return lt},et)}}function removePending(tt,et){tt.pending[et]!==void 0&&(delete tt.pending[et],tt.pendingCount--)}class Connector extends EventEmitter$1{constructor(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=et,this.store=rt,this.services=nt,this.languageUtils=nt.languageUtils,this.options=st,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=st.maxParallelReads||10,this.readingCalls=0,this.maxRetries=st.maxRetries>=0?st.maxRetries:5,this.retryTimeout=st.retryTimeout>=1?st.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(nt,st.backend,st)}queueLoad(et,rt,nt,st){const ot={},at={},lt={},ut={};return et.forEach(ct=>{let dt=!0;rt.forEach(ht=>{const mt=`${ct}|${ht}`;!nt.reload&&this.store.hasResourceBundle(ct,ht)?this.state[mt]=2:this.state[mt]<0||(this.state[mt]===1?at[mt]===void 0&&(at[mt]=!0):(this.state[mt]=1,dt=!1,at[mt]===void 0&&(at[mt]=!0),ot[mt]===void 0&&(ot[mt]=!0),ut[ht]===void 0&&(ut[ht]=!0)))}),dt||(lt[ct]=!0)}),(Object.keys(ot).length||Object.keys(at).length)&&this.queue.push({pending:at,pendingCount:Object.keys(at).length,loaded:{},errors:[],callback:st}),{toLoad:Object.keys(ot),pending:Object.keys(at),toLoadLanguages:Object.keys(lt),toLoadNamespaces:Object.keys(ut)}}loaded(et,rt,nt){const st=et.split("|"),ot=st[0],at=st[1];rt&&this.emit("failedLoading",ot,at,rt),nt&&this.store.addResourceBundle(ot,at,nt),this.state[et]=rt?-1:2;const lt={};this.queue.forEach(ut=>{pushPath(ut.loaded,[ot],at),removePending(ut,et),rt&&ut.errors.push(rt),ut.pendingCount===0&&!ut.done&&(Object.keys(ut.loaded).forEach(ct=>{lt[ct]||(lt[ct]={});const dt=ut.loaded[ct];dt.length&&dt.forEach(ht=>{lt[ct][ht]===void 0&&(lt[ct][ht]=!0)})}),ut.done=!0,ut.errors.length?ut.callback(ut.errors):ut.callback())}),this.emit("loaded",lt),this.queue=this.queue.filter(ut=>!ut.done)}read(et,rt,nt){let st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,ot=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,at=arguments.length>5?arguments[5]:void 0;if(!et.length)return at(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:et,ns:rt,fcName:nt,tried:st,wait:ot,callback:at});return}this.readingCalls++;const lt=(ct,dt)=>{if(this.readingCalls--,this.waitingReads.length>0){const ht=this.waitingReads.shift();this.read(ht.lng,ht.ns,ht.fcName,ht.tried,ht.wait,ht.callback)}if(ct&&dt&&st<this.maxRetries){setTimeout(()=>{this.read.call(this,et,rt,nt,st+1,ot*2,at)},ot);return}at(ct,dt)},ut=this.backend[nt].bind(this.backend);if(ut.length===2){try{const ct=ut(et,rt);ct&&typeof ct.then=="function"?ct.then(dt=>lt(null,dt)).catch(lt):lt(null,ct)}catch(ct){lt(ct)}return}return ut(et,rt,lt)}prepareLoading(et,rt){let nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},st=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),st&&st();typeof et=="string"&&(et=this.languageUtils.toResolveHierarchy(et)),typeof rt=="string"&&(rt=[rt]);const ot=this.queueLoad(et,rt,nt,st);if(!ot.toLoad.length)return ot.pending.length||st(),null;ot.toLoad.forEach(at=>{this.loadOne(at)})}load(et,rt,nt){this.prepareLoading(et,rt,{},nt)}reload(et,rt,nt){this.prepareLoading(et,rt,{reload:!0},nt)}loadOne(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const nt=et.split("|"),st=nt[0],ot=nt[1];this.read(st,ot,"read",void 0,void 0,(at,lt)=>{at&&this.logger.warn(`${rt}loading namespace ${ot} for language ${st} failed`,at),!at&&lt&&this.logger.log(`${rt}loaded namespace ${ot} for language ${st}`,lt),this.loaded(et,at,lt)})}saveMissing(et,rt,nt,st,ot){let at=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},lt=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(rt)){this.logger.warn(`did not save key "${nt}" as the namespace "${rt}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(nt==null||nt==="")){if(this.backend&&this.backend.create){const ut={...at,isUpdate:ot},ct=this.backend.create.bind(this.backend);if(ct.length<6)try{let dt;ct.length===5?dt=ct(et,rt,nt,st,ut):dt=ct(et,rt,nt,st),dt&&typeof dt.then=="function"?dt.then(ht=>lt(null,ht)).catch(lt):lt(null,dt)}catch(dt){lt(dt)}else ct(et,rt,nt,st,lt,ut)}!et||!et[0]||this.store.addResource(et[0],rt,nt,st)}}}function get$2(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(et){let rt={};if(typeof et[1]=="object"&&(rt=et[1]),typeof et[1]=="string"&&(rt.defaultValue=et[1]),typeof et[2]=="string"&&(rt.tDescription=et[2]),typeof et[2]=="object"||typeof et[3]=="object"){const nt=et[3]||et[2];Object.keys(nt).forEach(st=>{rt[st]=nt[st]})}return rt},interpolation:{escapeValue:!0,format:tt=>tt,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(tt){return typeof tt.ns=="string"&&(tt.ns=[tt.ns]),typeof tt.fallbackLng=="string"&&(tt.fallbackLng=[tt.fallbackLng]),typeof tt.fallbackNS=="string"&&(tt.fallbackNS=[tt.fallbackNS]),tt.supportedLngs&&tt.supportedLngs.indexOf("cimode")<0&&(tt.supportedLngs=tt.supportedLngs.concat(["cimode"])),tt}function noop$5(){}function bindMemberFunctions(tt){Object.getOwnPropertyNames(Object.getPrototypeOf(tt)).forEach(rt=>{typeof tt[rt]=="function"&&(tt[rt]=tt[rt].bind(tt))})}class I18n extends EventEmitter$1{constructor(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rt=arguments.length>1?arguments[1]:void 0;if(super(),this.options=transformOptions(et),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),rt&&!this.isInitialized&&!et.isClone){if(!this.options.initImmediate)return this.init(et,rt),this;setTimeout(()=>{this.init(et,rt)},0)}}init(){var et=this;let rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},nt=arguments.length>1?arguments[1]:void 0;typeof rt=="function"&&(nt=rt,rt={}),!rt.defaultNS&&rt.defaultNS!==!1&&rt.ns&&(typeof rt.ns=="string"?rt.defaultNS=rt.ns:rt.ns.indexOf("translation")<0&&(rt.defaultNS=rt.ns[0]));const st=get$2();this.options={...st,...this.options,...transformOptions(rt)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...st.interpolation,...this.options.interpolation}),rt.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=rt.keySeparator),rt.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=rt.nsSeparator);function ot(dt){return dt?typeof dt=="function"?new dt:dt:null}if(!this.options.isClone){this.modules.logger?baseLogger.init(ot(this.modules.logger),this.options):baseLogger.init(null,this.options);let dt;this.modules.formatter?dt=this.modules.formatter:typeof Intl<"u"&&(dt=Formatter);const ht=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const mt=this.services;mt.logger=baseLogger,mt.resourceStore=this.store,mt.languageUtils=ht,mt.pluralResolver=new PluralResolver(ht,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),dt&&(!this.options.interpolation.format||this.options.interpolation.format===st.interpolation.format)&&(mt.formatter=ot(dt),mt.formatter.init(mt,this.options),this.options.interpolation.format=mt.formatter.format.bind(mt.formatter)),mt.interpolator=new Interpolator(this.options),mt.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},mt.backendConnector=new Connector(ot(this.modules.backend),mt.resourceStore,mt,this.options),mt.backendConnector.on("*",function(xt){for(var yt=arguments.length,vt=new Array(yt>1?yt-1:0),Et=1;Et<yt;Et++)vt[Et-1]=arguments[Et];et.emit(xt,...vt)}),this.modules.languageDetector&&(mt.languageDetector=ot(this.modules.languageDetector),mt.languageDetector.init&&mt.languageDetector.init(mt,this.options.detection,this.options)),this.modules.i18nFormat&&(mt.i18nFormat=ot(this.modules.i18nFormat),mt.i18nFormat.init&&mt.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(xt){for(var yt=arguments.length,vt=new Array(yt>1?yt-1:0),Et=1;Et<yt;Et++)vt[Et-1]=arguments[Et];et.emit(xt,...vt)}),this.modules.external.forEach(xt=>{xt.init&&xt.init(this)})}if(this.format=this.options.interpolation.format,nt||(nt=noop$5),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const dt=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);dt.length>0&&dt[0]!=="dev"&&(this.options.lng=dt[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(dt=>{this[dt]=function(){return et.store[dt](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(dt=>{this[dt]=function(){return et.store[dt](...arguments),et}});const ut=defer(),ct=()=>{const dt=(ht,mt)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),ut.resolve(mt),nt(ht,mt)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return dt(null,this.t.bind(this));this.changeLanguage(this.options.lng,dt)};return this.options.resources||!this.options.initImmediate?ct():setTimeout(ct,0),ut}loadResources(et){let nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$5;const st=typeof et=="string"?et:this.language;if(typeof et=="function"&&(nt=et),!this.options.resources||this.options.partialBundledLanguages){if(st&&st.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return nt();const ot=[],at=lt=>{if(!lt||lt==="cimode")return;this.services.languageUtils.toResolveHierarchy(lt).forEach(ct=>{ct!=="cimode"&&ot.indexOf(ct)<0&&ot.push(ct)})};st?at(st):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(ut=>at(ut)),this.options.preload&&this.options.preload.forEach(lt=>at(lt)),this.services.backendConnector.load(ot,this.options.ns,lt=>{!lt&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),nt(lt)})}else nt(null)}reloadResources(et,rt,nt){const st=defer();return et||(et=this.languages),rt||(rt=this.options.ns),nt||(nt=noop$5),this.services.backendConnector.reload(et,rt,ot=>{st.resolve(),nt(ot)}),st}use(et){if(!et)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!et.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return et.type==="backend"&&(this.modules.backend=et),(et.type==="logger"||et.log&&et.warn&&et.error)&&(this.modules.logger=et),et.type==="languageDetector"&&(this.modules.languageDetector=et),et.type==="i18nFormat"&&(this.modules.i18nFormat=et),et.type==="postProcessor"&&postProcessor.addPostProcessor(et),et.type==="formatter"&&(this.modules.formatter=et),et.type==="3rdParty"&&this.modules.external.push(et),this}setResolvedLanguage(et){if(!(!et||!this.languages)&&!(["cimode","dev"].indexOf(et)>-1))for(let rt=0;rt<this.languages.length;rt++){const nt=this.languages[rt];if(!(["cimode","dev"].indexOf(nt)>-1)&&this.store.hasLanguageSomeTranslations(nt)){this.resolvedLanguage=nt;break}}}changeLanguage(et,rt){var nt=this;this.isLanguageChangingTo=et;const st=defer();this.emit("languageChanging",et);const ot=ut=>{this.language=ut,this.languages=this.services.languageUtils.toResolveHierarchy(ut),this.resolvedLanguage=void 0,this.setResolvedLanguage(ut)},at=(ut,ct)=>{ct?(ot(ct),this.translator.changeLanguage(ct),this.isLanguageChangingTo=void 0,this.emit("languageChanged",ct),this.logger.log("languageChanged",ct)):this.isLanguageChangingTo=void 0,st.resolve(function(){return nt.t(...arguments)}),rt&&rt(ut,function(){return nt.t(...arguments)})},lt=ut=>{!et&&!ut&&this.services.languageDetector&&(ut=[]);const ct=typeof ut=="string"?ut:this.services.languageUtils.getBestMatchFromCodes(ut);ct&&(this.language||ot(ct),this.translator.language||this.translator.changeLanguage(ct),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(ct)),this.loadResources(ct,dt=>{at(dt,ct)})};return!et&&this.services.languageDetector&&!this.services.languageDetector.async?lt(this.services.languageDetector.detect()):!et&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(lt):this.services.languageDetector.detect(lt):lt(et),st}getFixedT(et,rt,nt){var st=this;const ot=function(at,lt){let ut;if(typeof lt!="object"){for(var ct=arguments.length,dt=new Array(ct>2?ct-2:0),ht=2;ht<ct;ht++)dt[ht-2]=arguments[ht];ut=st.options.overloadTranslationOptionHandler([at,lt].concat(dt))}else ut={...lt};ut.lng=ut.lng||ot.lng,ut.lngs=ut.lngs||ot.lngs,ut.ns=ut.ns||ot.ns,ut.keyPrefix=ut.keyPrefix||nt||ot.keyPrefix;const mt=st.options.keySeparator||".";let xt;return ut.keyPrefix&&Array.isArray(at)?xt=at.map(yt=>`${ut.keyPrefix}${mt}${yt}`):xt=ut.keyPrefix?`${ut.keyPrefix}${mt}${at}`:at,st.t(xt,ut)};return typeof et=="string"?ot.lng=et:ot.lngs=et,ot.ns=rt,ot.keyPrefix=nt,ot}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(et){this.options.defaultNS=et}hasLoadedNamespace(et){let rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const nt=rt.lng||this.resolvedLanguage||this.languages[0],st=this.options?this.options.fallbackLng:!1,ot=this.languages[this.languages.length-1];if(nt.toLowerCase()==="cimode")return!0;const at=(lt,ut)=>{const ct=this.services.backendConnector.state[`${lt}|${ut}`];return ct===-1||ct===2};if(rt.precheck){const lt=rt.precheck(this,at);if(lt!==void 0)return lt}return!!(this.hasResourceBundle(nt,et)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||at(nt,et)&&(!st||at(ot,et)))}loadNamespaces(et,rt){const nt=defer();return this.options.ns?(typeof et=="string"&&(et=[et]),et.forEach(st=>{this.options.ns.indexOf(st)<0&&this.options.ns.push(st)}),this.loadResources(st=>{nt.resolve(),rt&&rt(st)}),nt):(rt&&rt(),Promise.resolve())}loadLanguages(et,rt){const nt=defer();typeof et=="string"&&(et=[et]);const st=this.options.preload||[],ot=et.filter(at=>st.indexOf(at)<0);return ot.length?(this.options.preload=st.concat(ot),this.loadResources(at=>{nt.resolve(),rt&&rt(at)}),nt):(rt&&rt(),Promise.resolve())}dir(et){if(et||(et=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!et)return"rtl";const rt=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],nt=this.services&&this.services.languageUtils||new LanguageUtil(get$2());return rt.indexOf(nt.getLanguagePartFromCode(et))>-1||et.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rt=arguments.length>1?arguments[1]:void 0;return new I18n(et,rt)}cloneInstance(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$5;const nt=et.forkResourceStore;nt&&delete et.forkResourceStore;const st={...this.options,...et,isClone:!0},ot=new I18n(st);return(et.debug!==void 0||et.prefix!==void 0)&&(ot.logger=ot.logger.clone(et)),["store","services","language"].forEach(lt=>{ot[lt]=this[lt]}),ot.services={...this.services},ot.services.utils={hasLoadedNamespace:ot.hasLoadedNamespace.bind(ot)},nt&&(ot.store=new ResourceStore(this.store.data,st),ot.services.resourceStore=ot.store),ot.translator=new Translator(ot.services,st),ot.translator.on("*",function(lt){for(var ut=arguments.length,ct=new Array(ut>1?ut-1:0),dt=1;dt<ut;dt++)ct[dt-1]=arguments[dt];ot.emit(lt,...ct)}),ot.init(st,rt),ot.translator.options=st,ot.translator.backendConnector.services.utils={hasLoadedNamespace:ot.hasLoadedNamespace.bind(ot)},ot}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;instance.createInstance;instance.dir;instance.init;instance.loadResources;instance.reloadResources;instance.use;instance.changeLanguage;instance.getFixedT;const t$2=instance.t;instance.exists;instance.setDefaultNamespace;instance.hasLoadedNamespace;instance.loadNamespaces;instance.loadLanguages;function _typeof$2(tt){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$2(tt)}var arr=[],each$1=arr.forEach,slice=arr.slice;function defaults$6(tt){return each$1.call(slice.call(arguments,1),function(et){if(et)for(var rt in et)tt[rt]===void 0&&(tt[rt]=et[rt])}),tt}function hasXMLHttpRequest(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_typeof$2(XMLHttpRequest))==="object"}function isPromise(tt){return!!tt&&typeof tt.then=="function"}function makePromise(tt){return isPromise(tt)?tt:Promise.resolve(tt)}function commonjsRequire(tt){throw new Error('Could not dynamically require "'+tt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var getFetch$1={exports:{}},browserPonyfill={exports:{}},hasRequiredBrowserPonyfill;function requireBrowserPonyfill(){return hasRequiredBrowserPonyfill||(hasRequiredBrowserPonyfill=1,function(tt,et){var rt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof commonjsGlobal<"u"&&commonjsGlobal,nt=function(){function ot(){this.fetch=!1,this.DOMException=rt.DOMException}return ot.prototype=rt,new ot}();(function(ot){(function(at){var lt=typeof ot<"u"&&ot||typeof self<"u"&&self||typeof lt<"u"&&lt,ut={searchParams:"URLSearchParams"in lt,iterable:"Symbol"in lt&&"iterator"in Symbol,blob:"FileReader"in lt&&"Blob"in lt&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in lt,arrayBuffer:"ArrayBuffer"in lt};function ct(Mt){return Mt&&DataView.prototype.isPrototypeOf(Mt)}if(ut.arrayBuffer)var dt=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ht=ArrayBuffer.isView||function(Mt){return Mt&&dt.indexOf(Object.prototype.toString.call(Mt))>-1};function mt(Mt){if(typeof Mt!="string"&&(Mt=String(Mt)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(Mt)||Mt==="")throw new TypeError('Invalid character in header field name: "'+Mt+'"');return Mt.toLowerCase()}function xt(Mt){return typeof Mt!="string"&&(Mt=String(Mt)),Mt}function yt(Mt){var zt={next:function(){var Gt=Mt.shift();return{done:Gt===void 0,value:Gt}}};return ut.iterable&&(zt[Symbol.iterator]=function(){return zt}),zt}function vt(Mt){this.map={},Mt instanceof vt?Mt.forEach(function(zt,Gt){this.append(Gt,zt)},this):Array.isArray(Mt)?Mt.forEach(function(zt){this.append(zt[0],zt[1])},this):Mt&&Object.getOwnPropertyNames(Mt).forEach(function(zt){this.append(zt,Mt[zt])},this)}vt.prototype.append=function(Mt,zt){Mt=mt(Mt),zt=xt(zt);var Gt=this.map[Mt];this.map[Mt]=Gt?Gt+", "+zt:zt},vt.prototype.delete=function(Mt){delete this.map[mt(Mt)]},vt.prototype.get=function(Mt){return Mt=mt(Mt),this.has(Mt)?this.map[Mt]:null},vt.prototype.has=function(Mt){return this.map.hasOwnProperty(mt(Mt))},vt.prototype.set=function(Mt,zt){this.map[mt(Mt)]=xt(zt)},vt.prototype.forEach=function(Mt,zt){for(var Gt in this.map)this.map.hasOwnProperty(Gt)&&Mt.call(zt,this.map[Gt],Gt,this)},vt.prototype.keys=function(){var Mt=[];return this.forEach(function(zt,Gt){Mt.push(Gt)}),yt(Mt)},vt.prototype.values=function(){var Mt=[];return this.forEach(function(zt){Mt.push(zt)}),yt(Mt)},vt.prototype.entries=function(){var Mt=[];return this.forEach(function(zt,Gt){Mt.push([Gt,zt])}),yt(Mt)},ut.iterable&&(vt.prototype[Symbol.iterator]=vt.prototype.entries);function Et(Mt){if(Mt.bodyUsed)return Promise.reject(new TypeError("Already read"));Mt.bodyUsed=!0}function bt(Mt){return new Promise(function(zt,Gt){Mt.onload=function(){zt(Mt.result)},Mt.onerror=function(){Gt(Mt.error)}})}function St(Mt){var zt=new FileReader,Gt=bt(zt);return zt.readAsArrayBuffer(Mt),Gt}function wt(Mt){var zt=new FileReader,Gt=bt(zt);return zt.readAsText(Mt),Gt}function Rt(Mt){for(var zt=new Uint8Array(Mt),Gt=new Array(zt.length),$t=0;$t<zt.length;$t++)Gt[$t]=String.fromCharCode(zt[$t]);return Gt.join("")}function Ct(Mt){if(Mt.slice)return Mt.slice(0);var zt=new Uint8Array(Mt.byteLength);return zt.set(new Uint8Array(Mt)),zt.buffer}function Pt(){return this.bodyUsed=!1,this._initBody=function(Mt){this.bodyUsed=this.bodyUsed,this._bodyInit=Mt,Mt?typeof Mt=="string"?this._bodyText=Mt:ut.blob&&Blob.prototype.isPrototypeOf(Mt)?this._bodyBlob=Mt:ut.formData&&FormData.prototype.isPrototypeOf(Mt)?this._bodyFormData=Mt:ut.searchParams&&URLSearchParams.prototype.isPrototypeOf(Mt)?this._bodyText=Mt.toString():ut.arrayBuffer&&ut.blob&&ct(Mt)?(this._bodyArrayBuffer=Ct(Mt.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ut.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Mt)||ht(Mt))?this._bodyArrayBuffer=Ct(Mt):this._bodyText=Mt=Object.prototype.toString.call(Mt):this._bodyText="",this.headers.get("content-type")||(typeof Mt=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):ut.searchParams&&URLSearchParams.prototype.isPrototypeOf(Mt)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ut.blob&&(this.blob=function(){var Mt=Et(this);if(Mt)return Mt;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var Mt=Et(this);return Mt||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(St)}),this.text=function(){var Mt=Et(this);if(Mt)return Mt;if(this._bodyBlob)return wt(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Rt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},ut.formData&&(this.formData=function(){return this.text().then(Vt)}),this.json=function(){return this.text().then(JSON.parse)},this}var It=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function jt(Mt){var zt=Mt.toUpperCase();return It.indexOf(zt)>-1?zt:Mt}function Dt(Mt,zt){if(!(this instanceof Dt))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');zt=zt||{};var Gt=zt.body;if(Mt instanceof Dt){if(Mt.bodyUsed)throw new TypeError("Already read");this.url=Mt.url,this.credentials=Mt.credentials,zt.headers||(this.headers=new vt(Mt.headers)),this.method=Mt.method,this.mode=Mt.mode,this.signal=Mt.signal,!Gt&&Mt._bodyInit!=null&&(Gt=Mt._bodyInit,Mt.bodyUsed=!0)}else this.url=String(Mt);if(this.credentials=zt.credentials||this.credentials||"same-origin",(zt.headers||!this.headers)&&(this.headers=new vt(zt.headers)),this.method=jt(zt.method||this.method||"GET"),this.mode=zt.mode||this.mode||null,this.signal=zt.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Gt)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(Gt),(this.method==="GET"||this.method==="HEAD")&&(zt.cache==="no-store"||zt.cache==="no-cache")){var $t=/([?&])_=[^&]*/;if($t.test(this.url))this.url=this.url.replace($t,"$1_="+new Date().getTime());else{var Ut=/\?/;this.url+=(Ut.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Dt.prototype.clone=function(){return new Dt(this,{body:this._bodyInit})};function Vt(Mt){var zt=new FormData;return Mt.trim().split("&").forEach(function(Gt){if(Gt){var $t=Gt.split("="),Ut=$t.shift().replace(/\+/g," "),Bt=$t.join("=").replace(/\+/g," ");zt.append(decodeURIComponent(Ut),decodeURIComponent(Bt))}}),zt}function Ft(Mt){var zt=new vt,Gt=Mt.replace(/\r?\n[\t ]+/g," ");return Gt.split("\r").map(function($t){return $t.indexOf(`
18
18
  `)===0?$t.substr(1,$t.length):$t}).forEach(function($t){var Ut=$t.split(":"),Bt=Ut.shift().trim();if(Bt){var Yt=Ut.join(":").trim();zt.append(Bt,Yt)}}),zt}Pt.call(Dt.prototype);function Ht(Mt,zt){if(!(this instanceof Ht))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');zt||(zt={}),this.type="default",this.status=zt.status===void 0?200:zt.status,this.ok=this.status>=200&&this.status<300,this.statusText=zt.statusText===void 0?"":""+zt.statusText,this.headers=new vt(zt.headers),this.url=zt.url||"",this._initBody(Mt)}Pt.call(Ht.prototype),Ht.prototype.clone=function(){return new Ht(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new vt(this.headers),url:this.url})},Ht.error=function(){var Mt=new Ht(null,{status:0,statusText:""});return Mt.type="error",Mt};var Nt=[301,302,303,307,308];Ht.redirect=function(Mt,zt){if(Nt.indexOf(zt)===-1)throw new RangeError("Invalid status code");return new Ht(null,{status:zt,headers:{location:Mt}})},at.DOMException=lt.DOMException;try{new at.DOMException}catch{at.DOMException=function(zt,Gt){this.message=zt,this.name=Gt;var $t=Error(zt);this.stack=$t.stack},at.DOMException.prototype=Object.create(Error.prototype),at.DOMException.prototype.constructor=at.DOMException}function Lt(Mt,zt){return new Promise(function(Gt,$t){var Ut=new Dt(Mt,zt);if(Ut.signal&&Ut.signal.aborted)return $t(new at.DOMException("Aborted","AbortError"));var Bt=new XMLHttpRequest;function Yt(){Bt.abort()}Bt.onload=function(){var Xt={status:Bt.status,statusText:Bt.statusText,headers:Ft(Bt.getAllResponseHeaders()||"")};Xt.url="responseURL"in Bt?Bt.responseURL:Xt.headers.get("X-Request-URL");var rr="response"in Bt?Bt.response:Bt.responseText;setTimeout(function(){Gt(new Ht(rr,Xt))},0)},Bt.onerror=function(){setTimeout(function(){$t(new TypeError("Network request failed"))},0)},Bt.ontimeout=function(){setTimeout(function(){$t(new TypeError("Network request failed"))},0)},Bt.onabort=function(){setTimeout(function(){$t(new at.DOMException("Aborted","AbortError"))},0)};function Zt(Xt){try{return Xt===""&&lt.location.href?lt.location.href:Xt}catch{return Xt}}Bt.open(Ut.method,Zt(Ut.url),!0),Ut.credentials==="include"?Bt.withCredentials=!0:Ut.credentials==="omit"&&(Bt.withCredentials=!1),"responseType"in Bt&&(ut.blob?Bt.responseType="blob":ut.arrayBuffer&&Ut.headers.get("Content-Type")&&Ut.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(Bt.responseType="arraybuffer")),zt&&typeof zt.headers=="object"&&!(zt.headers instanceof vt)?Object.getOwnPropertyNames(zt.headers).forEach(function(Xt){Bt.setRequestHeader(Xt,xt(zt.headers[Xt]))}):Ut.headers.forEach(function(Xt,rr){Bt.setRequestHeader(rr,Xt)}),Ut.signal&&(Ut.signal.addEventListener("abort",Yt),Bt.onreadystatechange=function(){Bt.readyState===4&&Ut.signal.removeEventListener("abort",Yt)}),Bt.send(typeof Ut._bodyInit>"u"?null:Ut._bodyInit)})}return Lt.polyfill=!0,lt.fetch||(lt.fetch=Lt,lt.Headers=vt,lt.Request=Dt,lt.Response=Ht),at.Headers=vt,at.Request=Dt,at.Response=Ht,at.fetch=Lt,at})({})})(nt),nt.fetch.ponyfill=!0,delete nt.fetch.polyfill;var st=rt.fetch?rt:nt;et=st.fetch,et.default=st.fetch,et.fetch=st.fetch,et.Headers=st.Headers,et.Request=st.Request,et.Response=st.Response,tt.exports=et}(browserPonyfill,browserPonyfill.exports)),browserPonyfill.exports}(function(tt,et){var rt;if(typeof fetch=="function"&&(typeof commonjsGlobal<"u"&&commonjsGlobal.fetch?rt=commonjsGlobal.fetch:typeof window<"u"&&window.fetch?rt=window.fetch:rt=fetch),typeof commonjsRequire<"u"&&(typeof window>"u"||typeof window.document>"u")){var nt=rt||requireBrowserPonyfill();nt.default&&(nt=nt.default),et.default=nt,tt.exports=et.default}})(getFetch$1,getFetch$1.exports);var getFetchExports=getFetch$1.exports;const getFetch=getDefaultExportFromCjs(getFetchExports),fetchNode=_mergeNamespaces({__proto__:null,default:getFetch},[getFetchExports]);function _typeof$1(tt){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$1(tt)}var fetchApi;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?fetchApi=global.fetch:typeof window<"u"&&window.fetch?fetchApi=window.fetch:fetchApi=fetch);var XmlHttpRequestApi;hasXMLHttpRequest()&&(typeof global<"u"&&global.XMLHttpRequest?XmlHttpRequestApi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(XmlHttpRequestApi=window.XMLHttpRequest));var ActiveXObjectApi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ActiveXObjectApi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ActiveXObjectApi=window.ActiveXObject));!fetchApi&&fetchNode&&!XmlHttpRequestApi&&!ActiveXObjectApi&&(fetchApi=getFetch||fetchNode);typeof fetchApi!="function"&&(fetchApi=void 0);var addQueryString=function(et,rt){if(rt&&_typeof$1(rt)==="object"){var nt="";for(var st in rt)nt+="&"+encodeURIComponent(st)+"="+encodeURIComponent(rt[st]);if(!nt)return et;et=et+(et.indexOf("?")!==-1?"&":"?")+nt.slice(1)}return et},fetchIt=function(et,rt,nt){var st=function(at){if(!at.ok)return nt(at.statusText||"Error",{status:at.status});at.text().then(function(lt){nt(null,{status:at.status,data:lt})}).catch(nt)};typeof fetch=="function"?fetch(et,rt).then(st).catch(nt):fetchApi(et,rt).then(st).catch(nt)},omitFetchOptions=!1,requestWithFetch=function(et,rt,nt,st){et.queryStringParams&&(rt=addQueryString(rt,et.queryStringParams));var ot=defaults$6({},typeof et.customHeaders=="function"?et.customHeaders():et.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(ot["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),nt&&(ot["Content-Type"]="application/json");var at=typeof et.requestOptions=="function"?et.requestOptions(nt):et.requestOptions,lt=defaults$6({method:nt?"POST":"GET",body:nt?et.stringify(nt):void 0,headers:ot},omitFetchOptions?{}:at);try{fetchIt(rt,lt,st)}catch(ut){if(!at||Object.keys(at).length===0||!ut.message||ut.message.indexOf("not implemented")<0)return st(ut);try{Object.keys(at).forEach(function(ct){delete lt[ct]}),fetchIt(rt,lt,st),omitFetchOptions=!0}catch(ct){st(ct)}}},requestWithXmlHttpRequest=function(et,rt,nt,st){nt&&_typeof$1(nt)==="object"&&(nt=addQueryString("",nt).slice(1)),et.queryStringParams&&(rt=addQueryString(rt,et.queryStringParams));try{var ot;XmlHttpRequestApi?ot=new XmlHttpRequestApi:ot=new ActiveXObjectApi("MSXML2.XMLHTTP.3.0"),ot.open(nt?"POST":"GET",rt,1),et.crossDomain||ot.setRequestHeader("X-Requested-With","XMLHttpRequest"),ot.withCredentials=!!et.withCredentials,nt&&ot.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),ot.overrideMimeType&&ot.overrideMimeType("application/json");var at=et.customHeaders;if(at=typeof at=="function"?at():at,at)for(var lt in at)ot.setRequestHeader(lt,at[lt]);ot.onreadystatechange=function(){ot.readyState>3&&st(ot.status>=400?ot.statusText:null,{status:ot.status,data:ot.responseText})},ot.send(nt)}catch(ut){console&&console.log(ut)}},request=function(et,rt,nt,st){if(typeof nt=="function"&&(st=nt,nt=void 0),st=st||function(){},fetchApi&&rt.indexOf("file:")!==0)return requestWithFetch(et,rt,nt,st);if(hasXMLHttpRequest()||typeof ActiveXObject=="function")return requestWithXmlHttpRequest(et,rt,nt,st);st(new Error("No fetch and no xhr implementation found!"))};function _typeof(tt){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof(tt)}function _classCallCheck(tt,et){if(!(tt instanceof et))throw new TypeError("Cannot call a class as a function")}function _defineProperties(tt,et){for(var rt=0;rt<et.length;rt++){var nt=et[rt];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(tt,_toPropertyKey(nt.key),nt)}}function _createClass(tt,et,rt){return _defineProperties(tt.prototype,et),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _defineProperty(tt,et,rt){return et=_toPropertyKey(et),et in tt?Object.defineProperty(tt,et,{value:rt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=rt,tt}function _toPropertyKey(tt){var et=_toPrimitive(tt,"string");return _typeof(et)==="symbol"?et:String(et)}function _toPrimitive(tt,et){if(_typeof(tt)!=="object"||tt===null)return tt;var rt=tt[Symbol.toPrimitive];if(rt!==void 0){var nt=rt.call(tt,et);if(_typeof(nt)!=="object")return nt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(tt)}var getDefaults$1=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(rt){return JSON.parse(rt)},stringify:JSON.stringify,parsePayload:function(rt,nt,st){return _defineProperty({},nt,st||"")},parseLoadPayload:function(rt,nt){},request,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Backend=function(){function tt(et){var rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck(this,tt),this.services=et,this.options=rt,this.allOptions=nt,this.type="backend",this.init(et,rt,nt)}return _createClass(tt,[{key:"init",value:function(rt){var nt=this,st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=rt,this.options=defaults$6(st,this.options||{},getDefaults$1()),this.allOptions=ot,this.services&&this.options.reloadInterval&&setInterval(function(){return nt.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(rt,nt,st){this._readAny(rt,rt,nt,nt,st)}},{key:"read",value:function(rt,nt,st){this._readAny([rt],rt,[nt],nt,st)}},{key:"_readAny",value:function(rt,nt,st,ot,at){var lt=this,ut=this.options.loadPath;typeof this.options.loadPath=="function"&&(ut=this.options.loadPath(rt,st)),ut=makePromise(ut),ut.then(function(ct){if(!ct)return at(null,{});var dt=lt.services.interpolator.interpolate(ct,{lng:rt.join("+"),ns:st.join("+")});lt.loadUrl(dt,at,nt,ot)})}},{key:"loadUrl",value:function(rt,nt,st,ot){var at=this,lt=typeof st=="string"?[st]:st,ut=typeof ot=="string"?[ot]:ot,ct=this.options.parseLoadPayload(lt,ut);this.options.request(this.options,rt,ct,function(dt,ht){if(ht&&(ht.status>=500&&ht.status<600||!ht.status))return nt("failed loading "+rt+"; status code: "+ht.status,!0);if(ht&&ht.status>=400&&ht.status<500)return nt("failed loading "+rt+"; status code: "+ht.status,!1);if(!ht&&dt&&dt.message&&dt.message.indexOf("Failed to fetch")>-1)return nt("failed loading "+rt+": "+dt.message,!0);if(dt)return nt(dt,!1);var mt,xt;try{typeof ht.data=="string"?mt=at.options.parse(ht.data,st,ot):mt=ht.data}catch{xt="failed parsing "+rt+" to json"}if(xt)return nt(xt,!1);nt(null,mt)})}},{key:"create",value:function(rt,nt,st,ot,at){var lt=this;if(this.options.addPath){typeof rt=="string"&&(rt=[rt]);var ut=this.options.parsePayload(nt,st,ot),ct=0,dt=[],ht=[];rt.forEach(function(mt){var xt=lt.options.addPath;typeof lt.options.addPath=="function"&&(xt=lt.options.addPath(mt,nt));var yt=lt.services.interpolator.interpolate(xt,{lng:mt,ns:nt});lt.options.request(lt.options,yt,ut,function(vt,Et){ct+=1,dt.push(vt),ht.push(Et),ct===rt.length&&typeof at=="function"&&at(dt,ht)})})}}},{key:"reload",value:function(){var rt=this,nt=this.services,st=nt.backendConnector,ot=nt.languageUtils,at=nt.logger,lt=st.language;if(!(lt&&lt.toLowerCase()==="cimode")){var ut=[],ct=function(ht){var mt=ot.toResolveHierarchy(ht);mt.forEach(function(xt){ut.indexOf(xt)<0&&ut.push(xt)})};ct(lt),this.allOptions.preload&&this.allOptions.preload.forEach(function(dt){return ct(dt)}),ut.forEach(function(dt){rt.allOptions.ns.forEach(function(ht){st.read(dt,ht,"read",null,null,function(mt,xt){mt&&at.warn("loading namespace ".concat(ht," for language ").concat(dt," failed"),mt),!mt&&xt&&at.log("loaded namespace ".concat(ht," for language ").concat(dt),xt),st.loaded("".concat(dt,"|").concat(ht),mt,xt)})})})}}}]),tt}();Backend.type="backend";function warn(){if(console&&console.warn){for(var tt=arguments.length,et=new Array(tt),rt=0;rt<tt;rt++)et[rt]=arguments[rt];typeof et[0]=="string"&&(et[0]=`react-i18next:: ${et[0]}`),console.warn(...et)}}const alreadyWarned={};function warnOnce(){for(var tt=arguments.length,et=new Array(tt),rt=0;rt<tt;rt++)et[rt]=arguments[rt];typeof et[0]=="string"&&alreadyWarned[et[0]]||(typeof et[0]=="string"&&(alreadyWarned[et[0]]=new Date),warn(...et))}const loadedClb=(tt,et)=>()=>{if(tt.isInitialized)et();else{const rt=()=>{setTimeout(()=>{tt.off("initialized",rt)},0),et()};tt.on("initialized",rt)}};function loadNamespaces(tt,et,rt){tt.loadNamespaces(et,loadedClb(tt,rt))}function loadLanguages(tt,et,rt,nt){typeof rt=="string"&&(rt=[rt]),rt.forEach(st=>{tt.options.ns.indexOf(st)<0&&tt.options.ns.push(st)}),tt.loadLanguages(et,loadedClb(tt,nt))}function oldI18nextHasLoadedNamespace(tt,et){let rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const nt=et.languages[0],st=et.options?et.options.fallbackLng:!1,ot=et.languages[et.languages.length-1];if(nt.toLowerCase()==="cimode")return!0;const at=(lt,ut)=>{const ct=et.services.backendConnector.state[`${lt}|${ut}`];return ct===-1||ct===2};return rt.bindI18n&&rt.bindI18n.indexOf("languageChanging")>-1&&et.services.backendConnector.backend&&et.isLanguageChangingTo&&!at(et.isLanguageChangingTo,tt)?!1:!!(et.hasResourceBundle(nt,tt)||!et.services.backendConnector.backend||et.options.resources&&!et.options.partialBundledLanguages||at(nt,tt)&&(!st||at(ot,tt)))}function hasLoadedNamespace(tt,et){let rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!et.languages||!et.languages.length?(warnOnce("i18n.languages were undefined or empty",et.languages),!0):et.options.ignoreJSONStructure!==void 0?et.hasLoadedNamespace(tt,{lng:rt.lng,precheck:(st,ot)=>{if(rt.bindI18n&&rt.bindI18n.indexOf("languageChanging")>-1&&st.services.backendConnector.backend&&st.isLanguageChangingTo&&!ot(st.isLanguageChangingTo,tt))return!1}}):oldI18nextHasLoadedNamespace(tt,et,rt)}const matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},unescapeHtmlEntity=tt=>htmlEntities[tt],unescape$1=tt=>tt.replace(matchHtmlEntity,unescapeHtmlEntity);let defaultOptions$2={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1};function setDefaults(){let tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions$2={...defaultOptions$2,...tt}}function getDefaults(){return defaultOptions$2}let i18nInstance;function setI18n(tt){i18nInstance=tt}function getI18n(){return i18nInstance}const initReactI18next={type:"3rdParty",init(tt){setDefaults(tt.options.react),setI18n(tt)}},I18nContext=reactExports.createContext();class ReportNamespaces{constructor(){this.usedNamespaces={}}addUsedNamespaces(et){et.forEach(rt=>{this.usedNamespaces[rt]||(this.usedNamespaces[rt]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const usePrevious$1=(tt,et)=>{const rt=reactExports.useRef();return reactExports.useEffect(()=>{rt.current=tt},[tt,et]),rt.current};function alwaysNewT(tt,et,rt,nt){return tt.getFixedT(et,rt,nt)}function useMemoizedT(tt,et,rt,nt){return reactExports.useCallback(alwaysNewT(tt,et,rt,nt),[tt,et,rt,nt])}function useTranslation(tt){let et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:rt}=et,{i18n:nt,defaultNS:st}=reactExports.useContext(I18nContext)||{},ot=rt||nt||getI18n();if(ot&&!ot.reportNamespaces&&(ot.reportNamespaces=new ReportNamespaces),!ot){warnOnce("You will need to pass in an i18next instance by using initReactI18next");const Rt=(Pt,It)=>typeof It=="string"?It:It&&typeof It=="object"&&typeof It.defaultValue=="string"?It.defaultValue:Array.isArray(Pt)?Pt[Pt.length-1]:Pt,Ct=[Rt,{},!1];return Ct.t=Rt,Ct.i18n={},Ct.ready=!1,Ct}ot.options.react&&ot.options.react.wait!==void 0&&warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const at={...getDefaults(),...ot.options.react,...et},{useSuspense:lt,keyPrefix:ut}=at;let ct=tt||st||ot.options&&ot.options.defaultNS;ct=typeof ct=="string"?[ct]:ct||["translation"],ot.reportNamespaces.addUsedNamespaces&&ot.reportNamespaces.addUsedNamespaces(ct);const dt=(ot.isInitialized||ot.initializedStoreOnce)&&ct.every(Rt=>hasLoadedNamespace(Rt,ot,at)),ht=useMemoizedT(ot,et.lng||null,at.nsMode==="fallback"?ct:ct[0],ut),mt=()=>ht,xt=()=>alwaysNewT(ot,et.lng||null,at.nsMode==="fallback"?ct:ct[0],ut),[yt,vt]=reactExports.useState(mt);let Et=ct.join();et.lng&&(Et=`${et.lng}${Et}`);const bt=usePrevious$1(Et),St=reactExports.useRef(!0);reactExports.useEffect(()=>{const{bindI18n:Rt,bindI18nStore:Ct}=at;St.current=!0,!dt&&!lt&&(et.lng?loadLanguages(ot,et.lng,ct,()=>{St.current&&vt(xt)}):loadNamespaces(ot,ct,()=>{St.current&&vt(xt)})),dt&&bt&&bt!==Et&&St.current&&vt(xt);function Pt(){St.current&&vt(xt)}return Rt&&ot&&ot.on(Rt,Pt),Ct&&ot&&ot.store.on(Ct,Pt),()=>{St.current=!1,Rt&&ot&&Rt.split(" ").forEach(It=>ot.off(It,Pt)),Ct&&ot&&Ct.split(" ").forEach(It=>ot.store.off(It,Pt))}},[ot,Et]),reactExports.useEffect(()=>{St.current&&dt&&vt(mt)},[ot,ut,dt]);const wt=[yt,ot,dt];if(wt.t=yt,wt.i18n=ot,wt.ready=dt,dt||!dt&&!lt)return wt;throw new Promise(Rt=>{et.lng?loadLanguages(ot,et.lng,ct,()=>Rt()):loadNamespaces(ot,ct,()=>Rt())})}instance.use(Backend).use(initReactI18next).init({backend:{loadPath:(tt,et)=>et.map(nt=>nt==="common"?"/i18n":`/${nt}/i18n`),parse:tt=>JSON.parse(tt)},defaultNS:"common",ns:["common"],fallbackLng:"fr",lng:"fr",interpolation:{escapeValue:!1,prefix:"[[",suffix:"]]"},debug:!1,react:{useSuspense:!1}});var reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
19
19
  * @license React
20
20
  * scheduler.production.min.js
@@ -47,7 +47,7 @@ Error generating stack: `+ot.message+`
47
47
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(et){return et instanceof this?et:new this(et)}static concat(et,...rt){const nt=new this(et);return rt.forEach(st=>nt.set(st)),nt}static accessor(et){const nt=(this[$internals]=this[$internals]={accessors:{}}).accessors,st=this.prototype;function ot(at){const lt=normalizeHeader(at);nt[lt]||(buildAccessors(st,at),nt[lt]=!0)}return utils$4.isArray(et)?et.forEach(ot):ot(et),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$4.reduceDescriptors(AxiosHeaders.prototype,({value:tt},et)=>{let rt=et[0].toUpperCase()+et.slice(1);return{get:()=>tt,set(nt){this[rt]=nt}}});utils$4.freezeMethods(AxiosHeaders);function transformData(tt,et){const rt=this||defaults$5,nt=et||rt,st=AxiosHeaders.from(nt.headers);let ot=nt.data;return utils$4.forEach(tt,function(lt){ot=lt.call(rt,ot,st.normalize(),et?et.status:void 0)}),st.normalize(),ot}function isCancel(tt){return!!(tt&&tt.__CANCEL__)}function CanceledError(tt,et,rt){AxiosError.call(this,tt??"canceled",AxiosError.ERR_CANCELED,et,rt),this.name="CanceledError"}utils$4.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(tt,et,rt){const nt=rt.config.validateStatus;!rt.status||!nt||nt(rt.status)?tt(rt):et(new AxiosError("Request failed with status code "+rt.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(rt.status/100)-4],rt.config,rt.request,rt))}function parseProtocol(tt){const et=/^([-+\w]{1,25})(:?\/\/|:)/.exec(tt);return et&&et[1]||""}function speedometer(tt,et){tt=tt||10;const rt=new Array(tt),nt=new Array(tt);let st=0,ot=0,at;return et=et!==void 0?et:1e3,function(ut){const ct=Date.now(),dt=nt[ot];at||(at=ct),rt[st]=ut,nt[st]=ct;let ht=ot,mt=0;for(;ht!==st;)mt+=rt[ht++],ht=ht%tt;if(st=(st+1)%tt,st===ot&&(ot=(ot+1)%tt),ct-at<et)return;const xt=dt&&ct-dt;return xt?Math.round(mt*1e3/xt):void 0}}function throttle(tt,et){let rt=0,nt=1e3/et,st,ot;const at=(ct,dt=Date.now())=>{rt=dt,st=null,ot&&(clearTimeout(ot),ot=null),tt.apply(null,ct)};return[(...ct)=>{const dt=Date.now(),ht=dt-rt;ht>=nt?at(ct,dt):(st=ct,ot||(ot=setTimeout(()=>{ot=null,at(st)},nt-ht)))},()=>st&&at(st)]}const progressEventReducer=(tt,et,rt=3)=>{let nt=0;const st=speedometer(50,250);return throttle(ot=>{const at=ot.loaded,lt=ot.lengthComputable?ot.total:void 0,ut=at-nt,ct=st(ut),dt=at<=lt;nt=at;const ht={loaded:at,total:lt,progress:lt?at/lt:void 0,bytes:ut,rate:ct||void 0,estimated:ct&&lt&&dt?(lt-at)/ct:void 0,event:ot,lengthComputable:lt!=null,[et?"download":"upload"]:!0};tt(ht)},rt)},progressEventDecorator=(tt,et)=>{const rt=tt!=null;return[nt=>et[0]({lengthComputable:rt,total:tt,loaded:nt}),et[1]]},asyncDecorator=tt=>(...et)=>utils$4.asap(()=>tt(...et)),isURLSameOrigin=platform.hasStandardBrowserEnv?((tt,et)=>rt=>(rt=new URL(rt,platform.origin),tt.protocol===rt.protocol&&tt.host===rt.host&&(et||tt.port===rt.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(tt,et,rt,nt,st,ot){const at=[tt+"="+encodeURIComponent(et)];utils$4.isNumber(rt)&&at.push("expires="+new Date(rt).toGMTString()),utils$4.isString(nt)&&at.push("path="+nt),utils$4.isString(st)&&at.push("domain="+st),ot===!0&&at.push("secure"),document.cookie=at.join("; ")},read(tt){const et=document.cookie.match(new RegExp("(^|;\\s*)("+tt+")=([^;]*)"));return et?decodeURIComponent(et[3]):null},remove(tt){this.write(tt,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(tt){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(tt)}function combineURLs(tt,et){return et?tt.replace(/\/?\/$/,"")+"/"+et.replace(/^\/+/,""):tt}function buildFullPath(tt,et){return tt&&!isAbsoluteURL(et)?combineURLs(tt,et):et}const headersToObject=tt=>tt instanceof AxiosHeaders?{...tt}:tt;function mergeConfig$1(tt,et){et=et||{};const rt={};function nt(ct,dt,ht,mt){return utils$4.isPlainObject(ct)&&utils$4.isPlainObject(dt)?utils$4.merge.call({caseless:mt},ct,dt):utils$4.isPlainObject(dt)?utils$4.merge({},dt):utils$4.isArray(dt)?dt.slice():dt}function st(ct,dt,ht,mt){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return nt(void 0,ct,ht,mt)}else return nt(ct,dt,ht,mt)}function ot(ct,dt){if(!utils$4.isUndefined(dt))return nt(void 0,dt)}function at(ct,dt){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return nt(void 0,ct)}else return nt(void 0,dt)}function lt(ct,dt,ht){if(ht in et)return nt(ct,dt);if(ht in tt)return nt(void 0,ct)}const ut={url:ot,method:ot,data:ot,baseURL:at,transformRequest:at,transformResponse:at,paramsSerializer:at,timeout:at,timeoutMessage:at,withCredentials:at,withXSRFToken:at,adapter:at,responseType:at,xsrfCookieName:at,xsrfHeaderName:at,onUploadProgress:at,onDownloadProgress:at,decompress:at,maxContentLength:at,maxBodyLength:at,beforeRedirect:at,transport:at,httpAgent:at,httpsAgent:at,cancelToken:at,socketPath:at,responseEncoding:at,validateStatus:lt,headers:(ct,dt,ht)=>st(headersToObject(ct),headersToObject(dt),ht,!0)};return utils$4.forEach(Object.keys(Object.assign({},tt,et)),function(dt){const ht=ut[dt]||st,mt=ht(tt[dt],et[dt],dt);utils$4.isUndefined(mt)&&ht!==lt||(rt[dt]=mt)}),rt}const resolveConfig=tt=>{const et=mergeConfig$1({},tt);let{data:rt,withXSRFToken:nt,xsrfHeaderName:st,xsrfCookieName:ot,headers:at,auth:lt}=et;et.headers=at=AxiosHeaders.from(at),et.url=buildURL(buildFullPath(et.baseURL,et.url),tt.params,tt.paramsSerializer),lt&&at.set("Authorization","Basic "+btoa((lt.username||"")+":"+(lt.password?unescape(encodeURIComponent(lt.password)):"")));let ut;if(utils$4.isFormData(rt)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)at.setContentType(void 0);else if((ut=at.getContentType())!==!1){const[ct,...dt]=ut?ut.split(";").map(ht=>ht.trim()).filter(Boolean):[];at.setContentType([ct||"multipart/form-data",...dt].join("; "))}}if(platform.hasStandardBrowserEnv&&(nt&&utils$4.isFunction(nt)&&(nt=nt(et)),nt||nt!==!1&&isURLSameOrigin(et.url))){const ct=st&&ot&&cookies.read(ot);ct&&at.set(st,ct)}return et},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(tt){return new Promise(function(rt,nt){const st=resolveConfig(tt);let ot=st.data;const at=AxiosHeaders.from(st.headers).normalize();let{responseType:lt,onUploadProgress:ut,onDownloadProgress:ct}=st,dt,ht,mt,xt,yt;function vt(){xt&&xt(),yt&&yt(),st.cancelToken&&st.cancelToken.unsubscribe(dt),st.signal&&st.signal.removeEventListener("abort",dt)}let Et=new XMLHttpRequest;Et.open(st.method.toUpperCase(),st.url,!0),Et.timeout=st.timeout;function bt(){if(!Et)return;const wt=AxiosHeaders.from("getAllResponseHeaders"in Et&&Et.getAllResponseHeaders()),Ct={data:!lt||lt==="text"||lt==="json"?Et.responseText:Et.response,status:Et.status,statusText:Et.statusText,headers:wt,config:tt,request:Et};settle(function(It){rt(It),vt()},function(It){nt(It),vt()},Ct),Et=null}"onloadend"in Et?Et.onloadend=bt:Et.onreadystatechange=function(){!Et||Et.readyState!==4||Et.status===0&&!(Et.responseURL&&Et.responseURL.indexOf("file:")===0)||setTimeout(bt)},Et.onabort=function(){Et&&(nt(new AxiosError("Request aborted",AxiosError.ECONNABORTED,tt,Et)),Et=null)},Et.onerror=function(){nt(new AxiosError("Network Error",AxiosError.ERR_NETWORK,tt,Et)),Et=null},Et.ontimeout=function(){let Rt=st.timeout?"timeout of "+st.timeout+"ms exceeded":"timeout exceeded";const Ct=st.transitional||transitionalDefaults;st.timeoutErrorMessage&&(Rt=st.timeoutErrorMessage),nt(new AxiosError(Rt,Ct.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,tt,Et)),Et=null},ot===void 0&&at.setContentType(null),"setRequestHeader"in Et&&utils$4.forEach(at.toJSON(),function(Rt,Ct){Et.setRequestHeader(Ct,Rt)}),utils$4.isUndefined(st.withCredentials)||(Et.withCredentials=!!st.withCredentials),lt&&lt!=="json"&&(Et.responseType=st.responseType),ct&&([mt,yt]=progressEventReducer(ct,!0),Et.addEventListener("progress",mt)),ut&&Et.upload&&([ht,xt]=progressEventReducer(ut),Et.upload.addEventListener("progress",ht),Et.upload.addEventListener("loadend",xt)),(st.cancelToken||st.signal)&&(dt=wt=>{Et&&(nt(!wt||wt.type?new CanceledError(null,tt,Et):wt),Et.abort(),Et=null)},st.cancelToken&&st.cancelToken.subscribe(dt),st.signal&&(st.signal.aborted?dt():st.signal.addEventListener("abort",dt)));const St=parseProtocol(st.url);if(St&&platform.protocols.indexOf(St)===-1){nt(new AxiosError("Unsupported protocol "+St+":",AxiosError.ERR_BAD_REQUEST,tt));return}Et.send(ot||null)})},composeSignals=(tt,et)=>{const{length:rt}=tt=tt?tt.filter(Boolean):[];if(et||rt){let nt=new AbortController,st;const ot=function(ct){if(!st){st=!0,lt();const dt=ct instanceof Error?ct:this.reason;nt.abort(dt instanceof AxiosError?dt:new CanceledError(dt instanceof Error?dt.message:dt))}};let at=et&&setTimeout(()=>{at=null,ot(new AxiosError(`timeout ${et} of ms exceeded`,AxiosError.ETIMEDOUT))},et);const lt=()=>{tt&&(at&&clearTimeout(at),at=null,tt.forEach(ct=>{ct.unsubscribe?ct.unsubscribe(ot):ct.removeEventListener("abort",ot)}),tt=null)};tt.forEach(ct=>ct.addEventListener("abort",ot));const{signal:ut}=nt;return ut.unsubscribe=()=>utils$4.asap(lt),ut}},streamChunk=function*(tt,et){let rt=tt.byteLength;if(rt<et){yield tt;return}let nt=0,st;for(;nt<rt;)st=nt+et,yield tt.slice(nt,st),nt=st},readBytes=async function*(tt,et){for await(const rt of readStream(tt))yield*streamChunk(rt,et)},readStream=async function*(tt){if(tt[Symbol.asyncIterator]){yield*tt;return}const et=tt.getReader();try{for(;;){const{done:rt,value:nt}=await et.read();if(rt)break;yield nt}}finally{await et.cancel()}},trackStream=(tt,et,rt,nt)=>{const st=readBytes(tt,et);let ot=0,at,lt=ut=>{at||(at=!0,nt&&nt(ut))};return new ReadableStream({async pull(ut){try{const{done:ct,value:dt}=await st.next();if(ct){lt(),ut.close();return}let ht=dt.byteLength;if(rt){let mt=ot+=ht;rt(mt)}ut.enqueue(new Uint8Array(dt))}catch(ct){throw lt(ct),ct}},cancel(ut){return lt(ut),st.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(tt=>et=>tt.encode(et))(new TextEncoder):async tt=>new Uint8Array(await new Response(tt).arrayBuffer())),test=(tt,...et)=>{try{return!!tt(...et)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let tt=!1;const et=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return tt=!0,"half"}}).headers.has("Content-Type");return tt&&!et}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$4.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(tt=>tt.body)};isFetchSupported&&(tt=>{["text","arrayBuffer","blob","formData","stream"].forEach(et=>{!resolvers[et]&&(resolvers[et]=utils$4.isFunction(tt[et])?rt=>rt[et]():(rt,nt)=>{throw new AxiosError(`Response type '${et}' is not supported`,AxiosError.ERR_NOT_SUPPORT,nt)})})})(new Response);const getBodyLength=async tt=>{if(tt==null)return 0;if(utils$4.isBlob(tt))return tt.size;if(utils$4.isSpecCompliantForm(tt))return(await new Request(platform.origin,{method:"POST",body:tt}).arrayBuffer()).byteLength;if(utils$4.isArrayBufferView(tt)||utils$4.isArrayBuffer(tt))return tt.byteLength;if(utils$4.isURLSearchParams(tt)&&(tt=tt+""),utils$4.isString(tt))return(await encodeText(tt)).byteLength},resolveBodyLength=async(tt,et)=>{const rt=utils$4.toFiniteNumber(tt.getContentLength());return rt??getBodyLength(et)},fetchAdapter=isFetchSupported&&(async tt=>{let{url:et,method:rt,data:nt,signal:st,cancelToken:ot,timeout:at,onDownloadProgress:lt,onUploadProgress:ut,responseType:ct,headers:dt,withCredentials:ht="same-origin",fetchOptions:mt}=resolveConfig(tt);ct=ct?(ct+"").toLowerCase():"text";let xt=composeSignals([st,ot&&ot.toAbortSignal()],at),yt;const vt=xt&&xt.unsubscribe&&(()=>{xt.unsubscribe()});let Et;try{if(ut&&supportsRequestStream&&rt!=="get"&&rt!=="head"&&(Et=await resolveBodyLength(dt,nt))!==0){let Ct=new Request(et,{method:"POST",body:nt,duplex:"half"}),Pt;if(utils$4.isFormData(nt)&&(Pt=Ct.headers.get("content-type"))&&dt.setContentType(Pt),Ct.body){const[It,jt]=progressEventDecorator(Et,progressEventReducer(asyncDecorator(ut)));nt=trackStream(Ct.body,DEFAULT_CHUNK_SIZE,It,jt)}}utils$4.isString(ht)||(ht=ht?"include":"omit");const bt="credentials"in Request.prototype;yt=new Request(et,{...mt,signal:xt,method:rt.toUpperCase(),headers:dt.normalize().toJSON(),body:nt,duplex:"half",credentials:bt?ht:void 0});let St=await fetch(yt);const wt=supportsResponseStream&&(ct==="stream"||ct==="response");if(supportsResponseStream&&(lt||wt&&vt)){const Ct={};["status","statusText","headers"].forEach(Dt=>{Ct[Dt]=St[Dt]});const Pt=utils$4.toFiniteNumber(St.headers.get("content-length")),[It,jt]=lt&&progressEventDecorator(Pt,progressEventReducer(asyncDecorator(lt),!0))||[];St=new Response(trackStream(St.body,DEFAULT_CHUNK_SIZE,It,()=>{jt&&jt(),vt&&vt()}),Ct)}ct=ct||"text";let Rt=await resolvers[utils$4.findKey(resolvers,ct)||"text"](St,tt);return!wt&&vt&&vt(),await new Promise((Ct,Pt)=>{settle(Ct,Pt,{data:Rt,headers:AxiosHeaders.from(St.headers),status:St.status,statusText:St.statusText,config:tt,request:yt})})}catch(bt){throw vt&&vt(),bt&&bt.name==="TypeError"&&/fetch/i.test(bt.message)?Object.assign(new AxiosError("Network Error",AxiosError.ERR_NETWORK,tt,yt),{cause:bt.cause||bt}):AxiosError.from(bt,bt&&bt.code,tt,yt)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$4.forEach(knownAdapters,(tt,et)=>{if(tt){try{Object.defineProperty(tt,"name",{value:et})}catch{}Object.defineProperty(tt,"adapterName",{value:et})}});const renderReason=tt=>`- ${tt}`,isResolvedHandle=tt=>utils$4.isFunction(tt)||tt===null||tt===!1,adapters={getAdapter:tt=>{tt=utils$4.isArray(tt)?tt:[tt];const{length:et}=tt;let rt,nt;const st={};for(let ot=0;ot<et;ot++){rt=tt[ot];let at;if(nt=rt,!isResolvedHandle(rt)&&(nt=knownAdapters[(at=String(rt)).toLowerCase()],nt===void 0))throw new AxiosError(`Unknown adapter '${at}'`);if(nt)break;st[at||"#"+ot]=nt}if(!nt){const ot=Object.entries(st).map(([lt,ut])=>`adapter ${lt} `+(ut===!1?"is not supported by the environment":"is not available in the build"));let at=et?ot.length>1?`since :
48
48
  `+ot.map(renderReason).join(`
49
49
  `):" "+renderReason(ot[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+at,"ERR_NOT_SUPPORT")}return nt},adapters:knownAdapters};function throwIfCancellationRequested(tt){if(tt.cancelToken&&tt.cancelToken.throwIfRequested(),tt.signal&&tt.signal.aborted)throw new CanceledError(null,tt)}function dispatchRequest(tt){return throwIfCancellationRequested(tt),tt.headers=AxiosHeaders.from(tt.headers),tt.data=transformData.call(tt,tt.transformRequest),["post","put","patch"].indexOf(tt.method)!==-1&&tt.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(tt.adapter||defaults$5.adapter)(tt).then(function(nt){return throwIfCancellationRequested(tt),nt.data=transformData.call(tt,tt.transformResponse,nt),nt.headers=AxiosHeaders.from(nt.headers),nt},function(nt){return isCancel(nt)||(throwIfCancellationRequested(tt),nt&&nt.response&&(nt.response.data=transformData.call(tt,tt.transformResponse,nt.response),nt.response.headers=AxiosHeaders.from(nt.response.headers))),Promise.reject(nt)})}const VERSION="1.7.9",validators$1={};["object","boolean","number","function","string","symbol"].forEach((tt,et)=>{validators$1[tt]=function(nt){return typeof nt===tt||"a"+(et<1?"n ":" ")+tt}});const deprecatedWarnings={};validators$1.transitional=function(et,rt,nt){function st(ot,at){return"[Axios v"+VERSION+"] Transitional option '"+ot+"'"+at+(nt?". "+nt:"")}return(ot,at,lt)=>{if(et===!1)throw new AxiosError(st(at," has been removed"+(rt?" in "+rt:"")),AxiosError.ERR_DEPRECATED);return rt&&!deprecatedWarnings[at]&&(deprecatedWarnings[at]=!0,console.warn(st(at," has been deprecated since v"+rt+" and will be removed in the near future"))),et?et(ot,at,lt):!0}};validators$1.spelling=function(et){return(rt,nt)=>(console.warn(`${nt} is likely a misspelling of ${et}`),!0)};function assertOptions(tt,et,rt){if(typeof tt!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const nt=Object.keys(tt);let st=nt.length;for(;st-- >0;){const ot=nt[st],at=et[ot];if(at){const lt=tt[ot],ut=lt===void 0||at(lt,ot,tt);if(ut!==!0)throw new AxiosError("option "+ot+" must be "+ut,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(rt!==!0)throw new AxiosError("Unknown option "+ot,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(et){this.defaults=et,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(et,rt){try{return await this._request(et,rt)}catch(nt){if(nt instanceof Error){let st={};Error.captureStackTrace?Error.captureStackTrace(st):st=new Error;const ot=st.stack?st.stack.replace(/^.+\n/,""):"";try{nt.stack?ot&&!String(nt.stack).endsWith(ot.replace(/^.+\n.+\n/,""))&&(nt.stack+=`
50
- `+ot):nt.stack=ot}catch{}}throw nt}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:nt,paramsSerializer:st,headers:ot}=rt;nt!==void 0&&validator.assertOptions(nt,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),st!=null&&(utils$4.isFunction(st)?rt.paramsSerializer={serialize:st}:validator.assertOptions(st,{encode:validators.function,serialize:validators.function},!0)),validator.assertOptions(rt,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),rt.method=(rt.method||this.defaults.method||"get").toLowerCase();let at=ot&&utils$4.merge(ot.common,ot[rt.method]);ot&&utils$4.forEach(["delete","get","head","post","put","patch","common"],yt=>{delete ot[yt]}),rt.headers=AxiosHeaders.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(vt){typeof vt.runWhen=="function"&&vt.runWhen(rt)===!1||(ut=ut&&vt.synchronous,lt.unshift(vt.fulfilled,vt.rejected))});const ct=[];this.interceptors.response.forEach(function(vt){ct.push(vt.fulfilled,vt.rejected)});let dt,ht=0,mt;if(!ut){const yt=[dispatchRequest.bind(this),void 0];for(yt.unshift.apply(yt,lt),yt.push.apply(yt,ct),mt=yt.length,dt=Promise.resolve(rt);ht<mt;)dt=dt.then(yt[ht++],yt[ht++]);return dt}mt=lt.length;let xt=rt;for(ht=0;ht<mt;){const yt=lt[ht++],vt=lt[ht++];try{xt=yt(xt)}catch(Et){vt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(yt){return Promise.reject(yt)}for(ht=0,mt=ct.length;ht<mt;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url);return buildURL(rt,et.params,et.paramsSerializer)}}utils$4.forEach(["delete","get","head","options"],function(et){Axios.prototype[et]=function(rt,nt){return this.request(mergeConfig$1(nt||{},{method:et,url:rt,data:(nt||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(nt){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:nt?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios.prototype[et]=rt(),Axios.prototype[et+"Form"]=rt(!0)});class CancelToken{constructor(et){if(typeof et!="function")throw new TypeError("executor must be a function.");let rt;this.promise=new Promise(function(ot){rt=ot});const nt=this;this.promise.then(st=>{if(!nt._listeners)return;let ot=nt._listeners.length;for(;ot-- >0;)nt._listeners[ot](st);nt._listeners=null}),this.promise.then=st=>{let ot;const at=new Promise(lt=>{nt.subscribe(lt),ot=lt}).then(st);return at.cancel=function(){nt.unsubscribe(ot)},at},et(function(ot,at,lt){nt.reason||(nt.reason=new CanceledError(ot,at,lt),rt(nt.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(et){if(this.reason){et(this.reason);return}this._listeners?this._listeners.push(et):this._listeners=[et]}unsubscribe(et){if(!this._listeners)return;const rt=this._listeners.indexOf(et);rt!==-1&&this._listeners.splice(rt,1)}toAbortSignal(){const et=new AbortController,rt=nt=>{et.abort(nt)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new CancelToken(function(st){et=st}),cancel:et}}}function spread(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([tt,et])=>{HttpStatusCode[et]=tt});function createInstance(tt){const et=new Axios(tt),rt=bind$3(Axios.prototype.request,et);return utils$4.extend(rt,Axios.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(st){return createInstance(mergeConfig$1(tt,st))},rt}const axios=createInstance(defaults$5);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;function m$2(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$3=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,nt=et,st=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(nt))+" "+st[ot]};let s$3=class{static isLocalURL(et){return et.length>0&&et.charAt(0)==="/"}static startWithHttp(et){return/^https?:\/\//gi.test(et)}static toCounter(et){return et>999?`${Number(et/1e3).toFixed(1)} k`:""+et}static generateVirtualId(){return"xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}};const s$2=(tt,et)=>{const rt="virtualID";if(!Object.hasOwnProperty.apply(tt,[rt])){const nt=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:nt,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,nt,st){return nt>st&&(et=Math.round(et*st/nt),nt=st),et>rt&&(nt=Math.round(nt*rt/et),et=rt),{height:et,width:nt}}static renameFileNameExtension(et,rt){const nt=et.split(".");return nt.pop(),nt.join(".")+"."+rt}static resizeImage(et,rt,nt,st,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const mt=this.changeDimension(ht,st,dt,nt);dt=mt.width,ht=mt.height;const xt=ut.getContext("2d");return xt&&(ut.width=dt,ut.height=ht,xt.fillStyle="white",xt.fillRect(0,0,ut.width,ut.height),xt.imageSmoothingEnabled&&xt.imageSmoothingQuality&&(xt.imageSmoothingQuality="high"),xt.drawImage(et,0,0,dt,ht)),new Promise((yt,vt)=>{ut.toBlob(Et=>{Et?yt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):vt()},ct,lt)})}static async resizeImageFile(et,rt=1440,nt=1440,st=80){if(!et)throw Error("Image resizer: file not found!");if(!et.type||!et.type.startsWith("image/"))throw Error("Image resizer: the file given is not an image.");const ot="jpeg";return new Promise(at=>{const lt=new Image;lt.setAttribute("style","max-width: none;"),lt.src=URL.createObjectURL(et),lt.onload=async()=>{const ut=await this.resizeImage(lt,this.renameFileNameExtension(et.name,ot),rt,nt,ot,st);at(ut)},lt.onerror=ut=>{throw Error("Image Loading Error: "+ut)}})}};const e$3={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};var p$2=Object.defineProperty,d$2=(tt,et,rt)=>et in tt?p$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$4=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$4(this,"wordExtensions",new Set),n$4(this,"excelExtensions",new Set),n$4(this,"pptExtensions",new Set),n$4(this,"fileExtensionMap",new Map),n$4(this,"csvContentType",new Set),n$4(this,"csvExtensions",new Set),n$4(this,"txtExtensions",new Set),n$4(this,"mdExtensions",new Set),n$4(this,"PDF","application/pdf"),n$4(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.mdExtensions.add("md"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.fileExtensionMap.set("md","text/markdown"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){return this.fileExtensionMap.has(et)?this.fileExtensionMap.get(et)??null:null}getExtensionForContentType(et){for(const rt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(rt)||"").toLowerCase()==(et||"").toLowerCase())return rt;return null}isWordLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.wordExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.excelExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.excelExtensions.has(rt):!1}isCsvLike(et,rt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&rt?this.csvExtensions.has(rt):!1}isPowerpointLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.pptExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.txtExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.mdExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$4(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$3=tt=>{if(tt>0){let et=Math.floor(tt/1e3),rt=Math.floor(et/60);return et=et%60,rt=rt%60,e$2(rt)+":"+e$2(et)}return"00:00"},e$2=tt=>tt.toString().padStart(2,"0"),o$2=()=>MediaRecorder.isTypeSupported?["video/webm;codecs=vp9",'video/mp4; codecs="avc1.424028, mp4a.40.2"',"video/webm;codecs=vp8,opus","video/webm"].find(tt=>MediaRecorder.isTypeSupported(tt)?!0:(console.error(`${tt} is not Supported`),!1))||"video/ogg":"video/webm;codecs=vp8,opus";var v$2=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$2=(tt,et,rt)=>T$1(tt,typeof et!="symbol"?et+"":et,rt);const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP$1={ADMIN:"admin",ARCHIVE:"archive",AUTH:"auth",CAS:"cas",COMMUNICATION:"communication",CONVERSATION:"conversation",DIRECTORY:"directory",USERBOOK:"userbook",INFRA:"infra",PORTAL:"portal",TIMELINE:"timeline",WORKSPACE:"workspace",EXPLORER:"explorer",VIDEO:"video",MINDMAP:"mindmap",SCRAPBOOK:"scrapbook",COLLABORATIVEWALL:"collaborativewall",WIKI:"wiki"};class Subscription{constructor(et,rt){n$2(this,"revoke"),this._channel=et,this.revoke=this.setReceiver(nt=>rt==null?void 0:rt(nt.data))}setReceiver(et){var rt;return(rt=this._channel)==null||rt.addEventListener("message",et),()=>{this._channel&&(this._channel.removeEventListener("message",et),this._channel.close(),delete this._channel)}}}class Subject{constructor(){n$2(this,"publishChannels",new Map)}getChannelName(et){return"Subject:"+et}getPublishChannel(et){const rt=this.getChannelName(et);let nt=this.publishChannels.get(rt);return nt||(nt=this.newChannel(et),this.publishChannels.set(rt,nt)),nt}newChannel(et){const rt=this.getChannelName(et),nt=new BroadcastChannel(rt);return nt.addEventListener("messageerror",st=>console.log(st.data)),nt}publish(et,rt){typeof et=="string"&&this.getPublishChannel(et).postMessage(rt)}subscribe(et,rt){if(typeof et=="string"){const nt=this.newChannel(et);return new Subscription(nt,rt)}else return new Subscription}}const ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady",APPCONF_READY:"appConfReady"};class Promisified{constructor(){n$2(this,"_resolution"),n$2(this,"_rejection"),n$2(this,"_promise",new Promise((et,rt)=>{this._resolution=et,this._rejection=rt}))}get promise(){return this._promise}resolve(et){this._resolution&&this._resolution(et)}reject(et){this._rejection&&this._rejection(et)}}class NotifyFramework{constructor(){n$2(this,"promises",{}),n$2(this,"subject",new Subject)}asyncData(et){return typeof this.promises[et]>"u"&&(this.promises[et]=new Promisified),this.promises[et]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}onAppConfReady(){return this.asyncData(ASYNC_DATA_NAME.APPCONF_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework,loadedScripts$1={};class Http{constructor(et){n$2(this,"axios"),n$2(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);return et.headers&&(rt.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams)),rt}else return this.axios.defaults}toCdnUrl(et){const rt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((rt==null?void 0:rt.length)>0&&et!=="/conf/public"){const nt=""+et;(nt.startsWith("/infra/public")||nt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(nt))&&(et=rt+nt)}return et}mapAxiosError(et,rt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!rt||rt.disableNotifications,this._latestResponse}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}get(et,rt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}post(et,rt,nt){return this.axios.post(et,rt,this.toAxiosConfig(nt)).then(st=>this.mapAxiosResponse(st,nt)).catch(st=>this.mapAxiosError(st,nt))}postFile(et,rt,nt){const st=this.toAxiosConfig(nt);return st.headers&&st.headers["Content-Type"]&&delete st.headers["Content-Type"],this.axios.post(et,rt,st).then(ot=>this.mapAxiosResponse(ot,nt)).catch(ot=>this.mapAxiosError(ot,nt))}postJson(et,rt,nt){const st=this.toAxiosConfig();return st.headers&&(st.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(nt)).then(ot=>this.mapAxiosResponse(ot,nt)).catch(ot=>this.mapAxiosError(ot,nt))}put(et,rt,nt){return this.axios.put(et,rt,this.toAxiosConfig(nt)).then(st=>this.mapAxiosResponse(st,nt)).catch(st=>this.mapAxiosError(st,nt))}putJson(et,rt,nt){const st=this.toAxiosConfig(nt);return st.headers&&(st.headers["Content-Type"]="application/json"),this.axios.put(et,rt,st).then(ot=>this.mapAxiosResponse(ot,nt)).catch(ot=>this.mapAxiosError(ot,nt))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(nt=>this.mapAxiosResponse(nt)).catch(nt=>this.mapAxiosError(nt))}getScript(et,rt,nt){const st=nt??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${st.split(".")[0]}={};${at};return ${st};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,rt).then(nt=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){n$2(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const http$2=transport.http;class Session{constructor(){n$2(this,"_me",null),n$2(this,"_currentLanguage",""),n$2(this,"_notLoggedIn",!0),n$2(this,"_description"),n$2(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.isResponseError()||typeof et=="string")throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var rt;return et===void 0||((rt=this._me)==null?void 0:rt.authorizedActions.findIndex(nt=>nt.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const nt=rt.right||rt,st=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[nt]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return st&&ot}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){n$2(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,nt,st){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof nt<"u"&&ot.append("rememberMe",""+nt),typeof st<"u"&&ot.append("secureLocation",""+st),transport.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){n$2(this,"_conf"),n$2(this,"_loaded"),n$2(this,"skinName",""),n$2(this,"themeName",""),n$2(this,"skin","raw"),n$2(this,"themeUrl","/assets/themes/raw/default/"),n$2(this,"templateOverrides",{}),n$2(this,"portalTemplate","/assets/themes/raw/portal.html"),n$2(this,"basePath",""),n$2(this,"logoutCallback","/"),n$2(this,"skins",[]),n$2(this,"is1D",!1),n$2(this,"is2D",!1),n$2(this,"_onSkinReady",notify.onSkinReady()),n$2(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var rt,nt;const st=await this.listSkins();this.is1D=((rt=st.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((nt=st.find(ot=>ot.child===this.skin))==null?void 0:nt.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,nt)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(st=>{this.skin=st.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${st.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${st.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(ot=>{this.templateOverrides=ot,this._onOverrideReady.resolve(ot),rt()}).catch(ot=>{if(transport.http.latestResponse.status===404)rt();else throw ot})}).catch(st=>{this._onSkinReady.reject(st),this._onOverrideReady.reject(st),nt()})})}loadConnected(et){return new Promise((rt,nt)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(st=>{this.templateOverrides=st,this._onOverrideReady.resolve(st),rt()}).catch(st=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(st),this._onOverrideReady.reject(st);else throw st})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(rt=>{this.skinName=rt.skinName,this.themeName=rt.themeName,this.themeUrl=rt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=rt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const rt=et.overriding.find(nt=>nt.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(nt=>nt.group===rt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){const et=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et==null?void 0:et.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,rt){et=et??"";let nt=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(let st in rt)typeof rt[st]<"u"&&(nt=nt.replace(new RegExp("\\${"+st+"}","g"),""+rt[st]));return nt}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,rt){this.loadBundle(session.session.currentLanguage,et,rt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises$1[rt]}loadBundle(et,rt,nt){const st=promises$1[rt];if(st)nt&&st.then(nt).catch(nt);else{const ot=new Promisified;promises$1[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),transport.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle$1,lt),typeof nt=="function"&&nt(),ot.resolve()}).catch(lt=>{typeof nt=="function"&&nt(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(nt=>{this.loadBundle(nt,et+"/"+nt+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(nt=>this.loadBundlePromise(rt,nt+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}removeAccents(et){for(var rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class UserPreferences{constructor(){n$2(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(nt=>{try{return JSON.parse(nt.preference)}catch{return rt??{}}}).then(nt=>(this.data[et]=nt??{},nt))}update(et,rt){return rt!==void 0&&(this.data[et]=rt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){n$2(this,"_me",null),n$2(this,"_keepOpenOnLogout",!1),n$2(this,"_preferences",new UserPreferences),n$2(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(rt=>{rt&&this.setCurrentModel(rt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const rt=JSON.parse(et.preference);let nt;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,nt={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",nt);return}else nt=rt;nt||(nt={bookmarks:[],applications:[]});let st=!0;const ot=[];nt.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){let ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),st=!1}),ot.forEach(at=>{let lt=nt.bookmarks.indexOf(at);lt!==-1&&nt.bookmarks.splice(lt,1)}),st||transport.http.putJson("/userbook/preference/apps",nt)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){n$2(this,"_publicConf",{}),n$2(this,"_currentApp"),n$2(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,rt=!1){rt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(nt=>{if(nt!=null&&nt.prefix){const st=nt.prefix.replace("/","");this._appConf[st]=nt}else nt!=null&&nt.name&&nt.name.toLowerCase()==et&&(rt=nt)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){n$2(this,"_status","void"),n$2(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,rt){return this.initialize().promise.then(nt=>!rt||nt.type===et||nt.type==="multiple"?nt[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var rt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(rt=this._params)==null||rt.resolve(et[0]),this._status="ready"}).catch(et=>{var rt;throw this._status="failed",(rt=this._params)==null||rt.reject(),et})),this._params}async initializeXiti(et){if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,nt=session.session.description;let st;for(let ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){st=dt;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:nt.profiles&&nt.profiles.length>0?ut[nt.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){n$2(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$2(this,"School",{}),n$2(this,"User",new User)}async initialize(et,rt){if(!et){const st=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${st(lt)}${st(ut)}`}const nt=et;this.Platform.deploymentTag=et,typeof rt=="string"&&rt.length>0&&(this.Platform.cdnDomain=rt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(nt),notify.onSessionReady().promise.then(st=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(nt)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var _$2;(_$2=session==null?void 0:session.session)==null||_$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",EXPLORER:"explorer",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",SEARCH_RESULTED:"searchResulted",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},nt){this.set(`${et}:main`,nt),this.set(`${et}:${rt}`,nt)}findService(et,rt){return this.lookupService(et,rt)}findMainService({application:et},rt){return this.lookupService({application:et,resourceType:"main"},rt)}isRegistered({application:et,resourceType:rt}){return this.get(`${et}:${rt}`)!==void 0}lookupService({application:et,resourceType:rt},nt){const st=this.get(`${et}:${rt}`);if(st===void 0)throw`Service not found: ${et}:${rt}`;return st(nt)}}const f$3=class{constructor(et){n$2(this,"checkHttpResponse",rt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return rt}),this.context=et}get http(){return this.context.http()}async copy(et){const rt=await this.http.post("/archive/duplicate",{application:et.application,resourceId:et.resourceId});return this.checkHttpResponse(rt)}async publish(et){const rt=new FormData;return rt.append("title",et.title),rt.append("cover",et.cover),rt.append("coverName",et.cover.name),rt.append("coverType",et.cover.type),rt.append("teacherAvatar",et.teacherAvatar),rt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),rt.append("teacherAvatarType",et.teacherAvatar.type),rt.append("language",et.language),et.activityType.forEach(nt=>{rt.append("activityType[]",nt)}),et.subjectArea.forEach(nt=>{rt.append("subjectArea[]",nt)}),et.age.forEach(nt=>{rt.append("age[]",nt.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(nt=>{rt.append("keyWords[]",nt.trim())}),rt.append("licence",et.licence),rt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),rt.append("application",et.application?et.application:""),rt.append("resourceId",et.resourceId),rt.append("teacherSchool",et.userStructureName),await this.http.post("/appregistry/library/resource",rt,{headers:{"Content-Type":"multipart/form-data"}})}async createContext(et){const rt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchContext(et){const rt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchResource(et){const rt=await this.http.get(`/explorer/resources/${et.id}`,{queryParams:this.getResourceParams(et)});return this.checkHttpResponse(rt)}async createFolder(et){const rt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async updateFolder(et){const rt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async moveToFolder(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const nt=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(nt)}async listSubfolders(et){const rt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(rt)}async deleteAll(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const nt=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(nt)}async trashAll({resourceType:et,...rt},nt=!1){rt.resourceIds=nt?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const st=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(st)}async restoreAll({resourceType:et,...rt},nt=!1){rt.resourceIds=nt?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const st=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(st)}async mapAssetIdToIds({application:et,assetIds:rt}){const nt=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(st=>{const ot=nt.resources.find(at=>at.assetId===st);if(ot===void 0)throw"explorer.assetid.notfound";return ot.id})}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const rt=await fetch(et).then(nt=>nt.blob());return`/workspace/document/${(await this.context.workspace().saveFile(rt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){const rt={application:et.application,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,trashed:et.trashed};if(et.types.length>0&&(rt.resource_type=et.types[0]),et.orders&&Object.entries(et.orders).length){const[[nt,st]]=Object.entries(et.orders);rt.order_by=`${nt}:${st}`}return et.filters&&Object.assign(rt,et.filters),typeof et.search=="string"&&(rt.search=et.search),typeof et.asset_id<"u"&&(rt.asset_id=[...et.asset_id]),typeof et.id<"u"&&(rt.id=et.id),rt}getResourceParams(et){return{application:et.application}}createFolderToBodyParams(et){return{application:et.application,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};n$2(f$3,"registry",new ServiceRegistry),n$2(f$3,"register",f$3.registry.register.bind(f$3.registry)),n$2(f$3,"findService",f$3.registry.findService.bind(f$3.registry)),n$2(f$3,"findMainService",f$3.registry.findMainService.bind(f$3.registry)),n$2(f$3,"isRegistered",f$3.registry.isRegistered.bind(f$3.registry));let ResourceService=f$3;const APP$2="scrapbook",RESOURCE$1="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),nt=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(nt),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$2}getFormUrl(et){return et?`/scrapbook?folderid=${et}#/create-scrapbook/`:"/scrapbook#/create-scrapbook/"}getViewUrl(et){return`/scrapbook#/view-scrapbook/${et}`}getPrintUrl(et){return`/scrapbook/print#/print-scrapbook/${et}`}getEditUrl(et){return`/scrapbook#/edit-scrapbook/${et}`}getExportUrl(et){return`/scrapbook/exportHtml/${et}`}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new ScrapbookResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,nt){if(mutexPromise[et]&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const st=rt();mutexPromise[et]=st;const ot=await st;return nt(ot)&&(globalCache[et]=ot),ot}catch(st){throw console.error(`Failed to retrieve value for: ${et}`,st),st}}clearCache(et){if(et)delete globalCache[et];else for(const rt in globalCache)globalCache.hasOwnProperty(rt)&&delete globalCache[rt]}async httpGet(et,rt){return this.fromCacheIfPossible(et,async()=>{const nt=await this.http.get(et,rt),st={...this.http.latestResponse};return{value:nt,response:st}},({response:nt})=>!(nt.status<200||nt.status>=300))}async httpGetJson(et,rt){const{response:nt,value:st}=await this.httpGet(et,rt);if(nt.status<200||nt.status>=300)throw`Bad http status (${nt.status}) for url: ${et}`;return st}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get cdnDomain(){return configure.Platform.cdnDomain}get notify(){return this.context.notify()}async getConf(et){const[rt,nt]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[st,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:nt===void 0}),this.getWebAppConf({app:et,applications:nt??[]})]),at={app:et,applications:nt??[],conf:rt,currentApp:ot,theme:st};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:nt}=await this.cache.httpGet(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.APP_NOT_FOUND;return nt}getCdnUrl(){}async savePreference(et,rt){this.http.putJson(`/userbook/preference/${et}`,rt)}async getPreference(et){const rt=await this.http.get(`/userbook/preference/${et}`);return this.http.isResponseError()||typeof rt=="string"?{}:JSON.parse(rt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getApplicationsList(){const et=await this.http.get("/applications-list");if(!(this.http.isResponseError()||typeof et=="string"))return et.apps}async getWebAppConf({app:et,applications:rt}){return rt.find(nt=>{if(nt!=null&&nt.prefix)return(nt==null?void 0:nt.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:nt}){const{value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}}),ot=nt?null:st,at=rt==null?void 0:rt.overriding.find(mt=>ot===null||mt.child===ot.themeName),lt=(ot==null?void 0:ot.skinName)||at.skins[0],ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at.child}/skins/${lt}/`,ct=at.skins,dt=at.bootstrapVersion.split("-").slice(-1)[0],ht=at.parent==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"/",skin:at.child,skinName:lt,skins:ct,themeName:at.child,themeUrl:ut,npmTheme:at.npmTheme??void 0}}async getLogoutCallback(et){const{response:rt,value:nt}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return nt.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,nt="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${nt}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,rt){return rt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:rt})=>({id:et,displayName:rt,members:[]}))}async getBookMarkById(et){const{groups:rt,id:nt,name:st,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:nt,displayName:st,groups:rt.map(({name:at,id:lt})=>({displayName:at,id:lt})),users:ot.map(({displayName:at,id:lt,profile:ut})=>({profile:ut,displayName:at,firstName:"",lastName:"",login:"",id:lt}))}}async saveBookmarks(et,{bookmarks:rt,groups:nt,users:st}){this.cache.clearCache("/directory/sharebookmark/all");const ot=st.map(ht=>typeof ht=="string"?ht:ht.id),at=nt.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:mt,groups:xt,id:yt,users:vt}=await this.getBookMarkById(ht),Et=vt.map(St=>St.id),bt=xt.map(St=>St.id);return{displayName:mt,id:yt,members:[...bt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,mt)=>[...ht,...mt],[]),ct={name:et,members:[...ot,...at,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",ct);return{id:dt,displayName:et,members:ct.members}}}const loadedScripts={};class HttpService{constructor(et,rt){n$2(this,"axios"),n$2(this,"baseUrl"),n$2(this,"headers",{}),n$2(this,"_latestResponse"),this.context=et,this.axios=axios.create(rt)}fixBaseUrl(et){return et.startsWith("http://")||et.startsWith("https://")?et:this.baseUrl?this.baseUrl.endsWith("/")||et.startsWith("/")?`${this.baseUrl}${et}`:`${this.baseUrl}/${et}`:et}useBaseUrl(et){return this.baseUrl=et,this}useHeaders(et){return this.headers=et,this}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);et.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams));const nt=rt.headers??{};return rt.headers={...nt,...this.headers},rt}else return this.axios.defaults}toCdnUrl(et){et=this.fixBaseUrl(et);const rt=this.context.conf().getCdnUrl()||"";if(rt.length>0&&et!=="/conf/public"){const nt=""+et;(nt.startsWith("/infra/public")||nt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(nt))&&(et=rt+nt)}return et}mapAxiosError(et,rt){et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN};const{status:nt,statusText:st,headers:ot,data:at}=this._latestResponse;return rt!=null&&rt.disableNotifications||notify.events().publish(LAYER_NAME.TRANSPORT,{name:EVENT_NAME.ERROR_OCCURED,data:{params:rt,response:{status:nt,statusText:st,headers:ot},payload:at}}),at}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}async get(et,rt){try{const nt=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){throw this.mapAxiosError(nt,rt)}}async post(et,rt,nt){try{const st=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(nt));return this.mapAxiosResponse(st,nt)}catch(st){throw this.mapAxiosError(st,nt)}}async postFile(et,rt,nt){const st=this.toAxiosConfig(nt);st.headers&&st.headers["Content-Type"]&&delete st.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...st,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,nt)}catch(ot){throw this.mapAxiosError(ot,nt)}}async postJson(et,rt,nt){const st=this.toAxiosConfig();st.headers&&(st.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(nt));return this.mapAxiosResponse(ot,nt)}catch(ot){throw this.mapAxiosError(ot,nt)}}async put(et,rt,nt){try{const st=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(nt));return this.mapAxiosResponse(st,nt)}catch(st){throw this.mapAxiosError(st,nt)}}async putFile(et,rt,nt){try{const st=this.toAxiosConfig(nt);st.headers&&st.headers["Content-Type"]&&delete st.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...st,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,nt)}catch(st){throw this.mapAxiosError(st,nt)}}async putJson(et,rt,nt){const st=this.toAxiosConfig(nt);st.headers&&(st.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,st);return this.mapAxiosResponse(ot,nt)}catch(ot){throw this.mapAxiosError(ot,nt)}}async delete(et,rt){try{const nt=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){throw this.mapAxiosError(nt,rt)}}async deleteJson(et,rt){try{const nt=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(nt)}catch(nt){throw this.mapAxiosError(nt)}}getScript(et,rt,nt){const st=nt??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${st.split(".")[0]}={};${at};return ${st};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts[et]?Promise.resolve():this.getScript(et,rt).then(nt=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const rt=et.split(":");if(rt.length===2){if(rt[0]==="creator")return{id:rt[1],right:"creator",type:"creator"}}else return rt.length===3?{id:rt[1],right:rt[2],type:rt[0]}:void 0}parseResourceRights(et){return et.map(rt=>this.parseResourceRight(rt)).filter(rt=>rt!==void 0)}hasResourceRight({id:et,groupIds:rt},nt,st){const ot=st.map(at=>typeof at=="string"?this.parseResourceRight(at):at).filter(at=>at!==void 0);for(const at of ot)if(at.id===et&&at.type==="creator"||at.id===et&&at.type==="user"&&at.right===nt||rt.includes(at.id)&&at.type==="group"&&at.right===nt)return!0;return!1}async sessionHasResourceRight(et,rt){try{const nt=await this.session.getUser();return!!nt&&this.hasResourceRight({groupIds:nt.groupsIds,id:nt.userId},et,rt)}catch(nt){return console.error(`Unexpected error ${nt} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const nt of et)if(await this.sessionHasResourceRight(nt,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let nt=0;for(const st of rt)await this.sessionHasResourceRight(et,st)&&nt++;return nt===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const nt of et){let st=0;for(const ot of rt)await this.sessionHasResourceRight(nt,ot)&&st++;if(st===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(nt=>nt===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(nt=>nt.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const nt=await this.session.getUser();for(const st of et)rt[st]=!!nt&&this.hasWorkflowRight(st,nt.authorizedActions.map(ot=>ot.name))}catch(nt){console.error(`Unexpected error ${nt} in sessionHasWorkflowRights()`);for(const st of et)rt[st]=!1}return rt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get conf(){return this.context.conf()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[rt,nt,st,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:nt,currentLanguage:rt,userDescription:st,userProfile:ot,bookmarkedApps:at}}login(et,rt,nt,st){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof nt<"u"&&ot.append("rememberMe",""+nt),typeof st<"u"&&ot.append("secureLocation",""+st),this.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}async logout(){const et=await this.conf.getLogoutCallback();return this.http.get("/auth/logout?callback="+et).finally(()=>{})}async latestQuotaAndUsage(et){const rt={quota:0,storage:0};if(!et)return rt;try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(nt){return console.error(nt),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let nt;return rt?nt=await this.loadUserLanguage():nt=await this.loadDefaultLanguage(),nt}catch(nt){console.error(nt)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:rt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(!(et.status<200||et.status>=300)&&typeof rt=="object")return rt;throw ERROR_CODE.NOT_LOGGED_IN}hasWorkflow({workflowName:et,user:rt}){return et===void 0||(rt==null?void 0:rt.authorizedActions.findIndex(nt=>nt.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,nt]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...nt,profiles:rt}}catch(rt){return console.error(rt),{}}}async getBookmarks(et){if(!et)return[];const rt=await this.http.get("/userbook/preference/apps");rt.preference||(rt.preference=null);const nt=JSON.parse(rt.preference);let st;st=nt,st||(st={bookmarks:[],applications:[]});const ot=[];return st.bookmarks.forEach((at,lt)=>{const ut=((et==null?void 0:et.apps)||[]).find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);ot.push(ct)}}),ot}async getUserProfile(et={}){var rt,nt;const{options:st={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,st);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((nt=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:nt.type)||["Guest"]}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}async getWebApp(et){const rt=await this.getUser();return rt==null?void 0:rt.apps.find(nt=>{var st;return nt!=null&&nt.prefix?(nt==null?void 0:nt.prefix.replace("/",""))===et||!1:nt!=null&&nt.address&&((st=nt.address)==null?void 0:st.split("/")[1])===et||!1})}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,rt,nt){const st=StringUtils.removeAccents(nt).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${nt}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const mt=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),yt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ht||"").toLowerCase();return yt.includes(st)||xt.includes(st)||mt.includes(st)||vt.includes(st)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),lt=ot.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(st)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group",structureName:ut.structureName}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(st)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...at,...lt]}async getShareMapping(et){const rt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const nt of Object.keys(rt))if(nt.includes(".")){const st=nt.split(".")[1],ot=rt[nt];delete rt[nt],rt[st]=ot}return rt}getActionsAvailableFor({id:et,type:rt},nt,st){const ot=(rt==="user"?nt.users.checked[et]:nt.groups.checked[et])||[],at=Object.keys(st),lt=[];for(const ut of at)st[ut].filter(ct=>ot.includes(ct)).length>0&&lt.push(ut);return lt}async getRightsForResource(et,rt){const nt=await this.directory.getBookMarks(),st=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(st),at=await this.getShareMapping(et),lt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(ot.users.checked).map(xt=>ot.users.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"user"},ot,at);return{id:xt.id,type:"user",displayName:xt.username,profile:xt.profile,avatarUrl:this.directory.getAvatarUrl(xt.id,"user"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"user"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"group"},ot,at);return{id:xt.id,type:"group",displayName:xt.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(xt.id,"group"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"group"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:yt,name:vt})=>({displayName:xt||vt,id:yt})),mt=ot.users.visibles.map(({id:xt,profile:yt,username:vt,firstName:Et,lastName:bt,login:St})=>({displayName:vt,firstName:Et,lastName:bt,login:St,profile:yt,id:xt}));return{rights:dt,visibleBookmarks:nt,visibleGroups:ht,visibleUsers:mt}}async saveRights(et,rt,nt){const st=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of nt){const ut=lt.actions.map(dt=>st[dt.id]).reduce((dt,ht)=>Array.isArray(ht)?[...dt,...ht]:dt,[]),ct=[...new Set(ut)];ct.length>0&&(lt.type==="user"?ot.users[lt.id]=ct:lt.type==="group"?ot.groups[lt.id]=ct:ot.bookmarks[lt.id]=ct)}const at=`/${et}/share/resource/${rt}`;return this.cache.clearCache(`/${et}/share/json/${rt}?search=`),await this.http.putJson(at,ot)}async getActionsForApp(et){const rt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),nt=await this.getShareMapping(et);return Object.keys(rt).map(st=>{const ot=rt[st];return{displayName:st,id:st,priority:ot.priority,requires:ot.requires}}).filter(st=>{var ot;return((ot=nt[st.id])==null?void 0:ot.length)>0}).sort((st,ot)=>st.priority-ot.priority)}}const defaultMappers={csv:function({type:tt,extension:et}){return a$2.INSTANCE.isCsvLike(tt,et)},doc:function({type:tt,extension:et}){return a$2.INSTANCE.isWordLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("wordprocessing")!==-1},xls:function({type:tt,extension:et}){return a$2.INSTANCE.isExcelLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("spreadsheet")!==-1||tt.indexOf("ms-excel")!==-1},img:function({type:tt}){return tt.indexOf("image")!==-1},pdf:function({type:tt}){return tt.indexOf("pdf")!==-1||tt==="application/x-download"},ppt:function({type:tt,extension:et}){return a$2.INSTANCE.isPowerpointLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("presentation")!==-1||tt.indexOf("powerpoint")!==-1},txt:function({type:tt,extension:et}){return a$2.INSTANCE.isTxtLike(tt,et)},md:function({type:tt,extension:et}){return a$2.INSTANCE.isMdLike(tt,et)},video:function({type:tt}){return tt.indexOf("video")!==-1},audio:function({type:tt}){return tt.indexOf("audio")!==-1},zip:function({type:tt}){return tt.indexOf("zip")!==-1||tt.indexOf("rar")!==-1||tt.indexOf("tar")!==-1||tt.indexOf("7z")!==-1}},w$1=class nm{static getRole(et){var rt,nt;return nm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(nt=et.metadata)==null?void 0:nt.extension)}static role(et,rt=!1,nt){if(nt&&(nt=nt.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const st={type:et,previewRole:rt,extension:nt};for(const ot of this.roleMappers){const at=ot(st);if(at)return at}return"unknown"}};n$2(w$1,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=w$1;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",nt=rt.split("."),st=et.type||"application/octet-stream",ot=nt.length>1?nt[nt.length-1]:"",at={"content-type":st,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(st,!1,ot)},lt=rt.replace("."+at.extension,""),ut=at.extension?lt+"."+at.extension:lt;return{basename:lt,fullname:ut,metadata:at}}async saveFile(et,rt){const{fullname:nt,metadata:st}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,nt);const at=[];((rt==null?void 0:rt.visibility)==="public"||(rt==null?void 0:rt.visibility)==="protected")&&at.push(`${rt.visibility}=true`),rt!=null&&rt.application&&at.push(`application=${rt.application}`),st.role==="img"&&at.push("quality=1"),rt!=null&&rt.parentId&&at.push(`parentId=${rt.parentId}`);const lt=await this.http.postFile(`/workspace/document?${at.join("&")}`,ot);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return lt}async updateFile(et,rt,nt){const{fullname:st,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,st);const lt=[];ot.role==="img"&&lt.push("quality=1"),nt!=null&&nt.alt&&lt.push(`alt=${nt.alt}`),nt!=null&&nt.legend&&lt.push(`legend=${nt.legend}`),nt!=null&&nt.name&&lt.push(`name=${nt.name}`);const ut=await this.http.putFile(`/workspace/document/${et}?${lt.join("&")}`,at);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return ut}async deleteFile(et){const rt=et.map(nt=>nt._id);if(rt.length==0)Promise.resolve(null);else if(await this.http.deleteJson("/workspace/documents",{ids:rt}),this.http.isResponseError())throw this.http.latestResponse.statusText}async acceptDocuments(et){const rt=await this.context.session().getUser();return nt=>nt.deleted&&nt.trasher?(rt==null?void 0:rt.userId)==nt.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],nt=await this.acceptDocuments(et);return rt.filter(nt)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,nt="protected"){const st=[];if(et.forEach(ot=>{(nt==="public"&&!ot.public||!ot.public&&!ot.protected)&&st.push(ot)}),st.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:nt,ids:st.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return st.forEach((at,lt)=>{const ut=et.findIndex(ct=>ct._id===at._id);0<=ut&&ut<et.length&&(et[ut]=ot[lt])}),et.filter(at=>!!at)}return et}getThumbnailUrl(et,rt=0,nt=0){var st,ot;const at=rt>0||nt>0?`${rt}x${nt}`:"120x120";if(typeof et=="string")return et.includes("data:image")||et.includes("thumbnail")?et:`${et}${et.includes("?")?"&":"?"}thumbnail=${at}`;{const lt=`/workspace/${et.public?"pub/":""}document/${et._id}?thumbnail=`,ut=et.thumbnails;if((ot=(st=et.metadata)==null?void 0:st["content-type"])!=null&&ot.includes("video")){const ct=ut&&Object.keys(ut).length>0?Object.keys(ut)[0]:null;return ct?lt+ct:null}else return lt+at}}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,rt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${rt}/i18n`)])}translate(et,rt){et=et??"";let nt=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(let st in rt)typeof rt[st]<"u"&&(nt=nt.replace(new RegExp("\\${"+st+"}","g"),""+rt[st]));return nt}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,nt){this.loadBundle(et,rt,nt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,nt){const st=promises[rt];if(st)nt&&st.then(nt).catch(nt);else{const ot=new Promisified;promises[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),this.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle,lt),typeof nt=="function"&&nt(),ot.resolve()}).catch(lt=>{typeof nt=="function"&&nt(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(nt=>{this.loadBundle(nt,et+"/"+nt+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(nt=>this.loadBundlePromise(rt,nt+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(var rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}let ATTag;class AnalyticsService{constructor(tt){this.context=tt}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(tt,et){const[rt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!rt||!ATInternet)return;let nt=rt.LIBELLE_SERVICE.default||null;for(const st in rt.LIBELLE_SERVICE)if(st!=="default"&&tt.indexOf(st)>=0){nt=rt.LIBELLE_SERVICE[st];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:nt,TYPE:rt.TYPE,OUTIL:rt.OUTIL,UAI:rt.STRUCT_UAI,PROJET:rt.PROJET,EXPLOITANT:rt.EXPLOITANT,PLATEFORME:rt.PLATFORME,PROFIL:rt.PROFILE},!0),ATTag.identifiedVisitor.set({id:rt.ID_PERSO,category:rt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:rt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(tt){const[et,rt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return rt!=null&&rt.active&&(et.xiti=await this.getXitiTrackingParams(rt,tt)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(tt,et){if(!tt.structureMap||!et)return;const rt=await this.session.getUser(),nt=await this.session.getUserProfile();let st;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){st=dt;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:nt&&nt.length>0?ut[nt[0]]??"":""}}}const C$2=class q0{constructor(et){this.context=et}get http(){return this.context.http()}get conf(){return this.context.conf()}async getVideoConf(){var et;const rt=await this.conf.getPublicConf(APP$1.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??q0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??q0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(nt=>nt.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:nt,duration:st}){if(!et.file)throw new Error("Invalid video file.");if(!et.filename)throw new Error("Invalid video filename");const ot=`${et.browser.name} ${et.browser.version}`,at=new FormData;at.append("device",et.device||""),at.append("browser",ot),at.append("url",et.url),at.append("app",rt),at.append("file",et.file,et.filename),at.append("weight",""+et.file.size),at.append("captation",""+nt);let lt=`/video/encode?captation=${nt}`;st&&(lt+=`&duration=${st}`);const ut=await this.http.post(lt,at,{headers:{"Content-Type":"multipart/form-data"}});if(ut.state=="running"){let ct=0,dt=1;do{const ht=dt+ct;await new Promise(xt=>setTimeout(xt,ht*1e3)),ct=dt,dt=Math.min(8,ht);const mt=await this.http.get(`/video/status/${ut.processid}`);if(mt.state=="succeed")return mt.videoworkspaceid&&mt.videosize&&this.context.data().trackVideoSave(mt.videoworkspaceid,Math.round(st),mt.videosize,nt,et.url,ot,et.device),mt;if(mt.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};n$2(C$2,"MAX_WEIGHT",50),n$2(C$2,"MAX_DURATION",3);let VideoService=C$2;class EmbedderService{constructor(et){this.context=et}get http(){return this.context.http()}async getDefault(){return this.http.get("/infra/embed/default")}async getCustom(){return this.http.get("/infra/embed/custom")}getProviderFromUrl(et,rt){for(const nt of et)if(this.isUrlFromProvider(rt,nt))return nt}urlIsFromPattern(et,rt){const nt=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),st=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(nt)||[],lt=[];return(rt.match(st)||[]).forEach((ut,ct)=>{ut.includes("ignore")||lt.push(at[ct])}),lt.forEach(ut=>{if(!et.includes(ut)){ot=!1;return}}),ot}isUrlFromProvider(et,rt){typeof rt.url=="string"&&(rt.url=[rt.url]);for(const nt of rt.url)if(this.urlIsFromPattern(et,nt))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const nt of et.url)if(this.urlIsFromPattern(rt,nt)){const st=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=nt.match(st)||[];let at=et.embed;for(const lt of ot){let ut=nt.split(lt)[0];const ct=ut.split("}");ct.length>1&&(ut=ct[ct.length-1]);let dt=rt.split(ut)[1];if(!dt)continue;const ht=nt.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const mt=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(mt,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){n$2(this,"_cache"),this.context=et,this._cache=new CacheService(this.context)}getApplication(){return this.APP}getResourceType(){return this.RESOURCE}httpGet(et,rt){return this._cache.httpGetJson(et,rt)}dataToResource({modified:et,...rt}){const nt=typeof et=="string"?et:et!=null&&et.$date?""+et.$date:"";return{application:this.RESOURCE,name:rt.title,creatorId:rt.owner,creatorName:rt.ownerName,thumbnail:rt.icon,assetId:rt._id,modifiedAt:nt,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","actualites"),n$2(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{var rt;return et.thread_icon?rt=et.thread_icon+"?thumbnail=48x48":rt="/img/icons/glyphicons_036_file.png",this.dataToResource({title:et.title+" ["+et.thread_title+"]",ownerName:et.username,owner:et.owner,icon:rt,path:"/actualites#/view/thread/"+et.thread_id+"/info/"+et._id,_id:`${et.thread_id}#${et._id}`,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class BlogBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","blog"),n$2(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const nt=await this.httpGet("/blog/linker"),st=[];nt.forEach(ot=>{ot.thumbnail?ot.thumbnail=ot.thumbnail+"?thumbnail=48x48":ot.thumbnail="/img/illustrations/blog.svg";const at=ot.fetchPosts.map(lt=>this.dataToResource({owner:ot.author.userId,ownerName:ot.author.username,title:lt.title+" ["+ot.title+"]",_id:`${ot._id}#${lt._id}`,icon:ot.thumbnail,path:`/blog/id/${ot._id}/post/${lt._id}`,shared:!!(ot.shared&&ot.shared.length>=0),modified:ot.modified}));st.push(...at)}),et(st)}catch(nt){rt(nt)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","collaborativewall"),n$2(this,"RESOURCE","collaborativewall")}async loadResources(){return(await this.httpGet("/collaborativewall/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.icon?et.icon:"/img/illustrations/collaborative-wall-default.png",path:"/collaborativewall#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class CommunityBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","community"),n$2(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{var rt;return typeof et.thumbnail>"u"||et.thumbnail===""?rt="/img/icons/glyphicons_036_file.png":rt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:et.name,icon:rt,path:"/community#/view/"+et.id,_id:et.id,owner:"",ownerName:"",shared:!!(et.shared&&et.shared.length>=0),modified:et.name})})}}class ExercizerBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","exercizer"),n$2(this,"RESOURCE","exercizer")}async loadResources(){return(await this.httpGet("/exercizer/subjects-scheduled")).map(et=>{const rt=et.picture?et.picture+"?thumbnail=48x48":"/img/illustrations/exercizer.svg";let nt,st=!1,ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(st=!0,nt=ot.groupList[0].name):ot.userList.length>0?(st=!0,nt=ot.userList[0].name):nt="",ot.groupList.length+ot.userList.length>1&&(nt+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:nt,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:st,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","formulaire"),n$2(this,"RESOURCE","formulaire")}async loadResources(){return(await this.httpGet("/formulaire/forms/linker")).map(et=>(et.picture||(et.picture="/formulaire/public/img/logo.svg"),this.dataToResource({_id:""+et.id,icon:et.picture,title:et.title,ownerName:et.owner_name,owner:et.owner_id,path:et.is_public?`${window.location.origin}/formulaire-public#/form/${et.public_key}`:`${window.location.origin}/formulaire#/form/${et.id}/${et.rgpd?"rgpd":"new"}`,shared:!!(et.shared&&et.shared.length>=0),modified:""+et.date_modification})))}}class ForumBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","forum"),n$2(this,"RESOURCE","forum")}async loadResources(){return(await this.httpGet("/forum/categories")).map(et=>this.dataToResource({_id:et._id,title:et.name,icon:et.icon||"/img/illustrations/forum.svg",path:"/forum#/view/"+et._id,ownerName:et.owner.displayName,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class HomeworksBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","homeworks"),n$2(this,"RESOURCE","homeworks")}async loadResources(){return(await this.httpGet("/homeworks/list")).filter(et=>et.owner&&et.trashed===0).map(et=>this.dataToResource({title:et.title,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/homeworks.svg",path:"/homeworks#/view-homeworks/"+et._id,_id:""+et._id,shared:typeof et.shared<"u",modified:et.modified}))}}class MagnetoBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","magneto"),n$2(this,"RESOURCE","magneto")}async loadResources(){const{all:et}=await this.httpGet("/magneto/boards/editable");return et.map(rt=>this.dataToResource({_id:rt._id,title:rt.title,icon:rt.imageUrl,owner:rt.ownerId,ownerName:rt.ownerName,path:`/magneto#/board/${rt._id}/view`,shared:!!(rt.shared&&rt.shared.length>=0),modified:""+rt.modificationDate}))}}class MindmapBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","mindmap"),n$2(this,"RESOURCE","mindmap")}async loadResources(){return(await this.httpGet("/mindmap/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/mindmap-default.png",path:"/mindmap#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class PagesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","pages"),n$2(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(nt=>{var st;const ot=nt.thumbnail?nt.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:nt.title,owner:nt.owner.userId,ownerName:nt.owner.displayName,icon:ot,path:"/pages#/website/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})),(st=nt.pages)==null||st.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:nt.owner.userId,ownerName:nt.owner.displayName,icon:ot,path:"/pages#/website/"+nt._id+"/"+at.titleLink,_id:nt._id+"/"+at.titleLink,shared:typeof nt.shared<"u",modified:nt.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","poll"),n$2(this,"RESOURCE","poll")}async loadResources(){return(await this.httpGet("/poll/list/all")).map(et=>{const rt=et.icon?et.icon+"?thumbnail=48x48":"/img/icons/glyphicons_036_file.png";return this.dataToResource({title:et.question,ownerName:et.owner.displayName,icon:rt,path:"/poll#/view/"+et._id,_id:et._id,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class ScrapbookBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","scrapbook"),n$2(this,"RESOURCE","scrapbook")}async loadResources(){return(await this.httpGet("/scrapbook/list/all")).map(et=>{const rt=et.icon||"/img/illustrations/scrapbook.svg";return this.dataToResource({title:et.name,owner:et.owner.userId,ownerName:et.owner.displayName,icon:rt,path:"/scrapbook#/view-scrapbook/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class TimelinegeneratorBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","timelinegenerator"),n$2(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const nt=(await this.httpGet("/timelinegenerator/timelines")).map(st=>{const ot=st.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:st.headline,ownerName:st.owner.displayName,owner:st.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})});et(nt)}catch(nt){rt(nt)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","wiki"),n$2(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let nt;return typeof et.thumbnail>"u"||et.thumbnail===""?nt="/img/icons/glyphicons_036_file.png":nt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:nt,path:"/wiki#/view/"+et._id+"/"+rt._id,_id:`${et._id}#${rt._id}`,shared:typeof et.shared<"u",modified:rt.modified})})).flat()}}class WorkspaceBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","workspace"),n$2(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(nt,st)=>{try{let ot="/workspace/documents?filter=all&hierarchical=true";rt&&rt.length?ot+=`&search=${et}`:et&&et.length&&(ot+=`&search=${et}`);const at=(await this.httpGet(ot)).filter(lt=>!lt.deleted).map(lt=>{const ut=lt.metadata["content-type"]&&lt.metadata["content-type"].indexOf("image")!==-1?`/workspace/document/${lt._id}?thumbnail=120x120`:"/img/icons/unknown-large.png";return this.dataToResource({title:lt.name,ownerName:lt.ownerName,owner:lt.owner,icon:ut,path:`/workspace/document/${lt._id}`,_id:lt._id,shared:!!(lt.shared&&lt.shared.length>=0),modified:lt.modified})});nt(at)}catch(ot){st(ot)}})}}const y$1=class{static async initialize(et,rt){const nt=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[st,ot]=await Promise.all([nt.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&st!=null&&st.length&&(this.resourceProducingApps=st.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(st){console.warn("Failed to load resource-producing apps:",st)}}return this.resourceProducingApps}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const nt={application:et,resourceType:rt};this.registry.register(nt,st=>this.serviceFor(st,et,rt))})}static serviceFor(et,rt,nt){let st;switch(nt){case"timelinegenerator":st=new TimelinegeneratorBehaviour(et);break;case"workspace":st=new WorkspaceBehaviour(et);break;case"blog":st=new BlogBehaviour(et);break;case"actualites":st=new ActualitesBehaviour(et);break;case"wiki":st=new WikiBehaviour(et);break;case"pages":st=new PagesBehaviour(et);break;case"poll":st=new PollBehaviour(et);break;case"community":st=new CommunityBehaviour(et);break;case"mindmap":st=new MindmapBehaviour(et);break;case"forum":st=new ForumBehaviour(et);break;case"homeworks":st=new HomeworksBehaviour(et);break;case"scrapbook":st=new ScrapbookBehaviour(et);break;case"collaborativewall":st=new CollaborativewallBehaviour(et);break;case"exercizer":st=new ExercizerBehaviour(et);break;case"formulaire":st=new FormulaireBehaviour(et);break;case"magneto":st=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return st.APP=rt,st}};n$2(y$1,"registry",new ServiceRegistry),n$2(y$1,"findBehaviour",y$1.registry.findService.bind(y$1.registry)),n$2(y$1,"hasBehaviour",y$1.registry.isRegistered.bind(y$1.registry)),n$2(y$1,"resourceProducingApps",[]);let SnipletsService=y$1;const SEND_ALL="*";class WebBroker{constructor(et){n$2(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(nt=>SEND_ALL===nt||et.data["event-type"]===nt)>=0&&this.http.post("/infra/event/web/store",et.data,{disableNotifications:!0})}initialize(et){if(et===void 0||et.send===void 0||et.send.length>0){const rt=(et==null?void 0:et.send)??[SEND_ALL];this.subscription=this.events.subscribe(LAYER_NAME.WEB_DATA,nt=>this.dispatchEvent(nt,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){n$2(this,"_webBroker"),n$2(this,"app"),n$2(this,"user"),n$2(this,"profile"),this.odeServices=et}get conf(){return this.odeServices.conf()}get notify(){return this.odeServices.notify()}async initialize(){try{const{app:et}=await this.notify.onAppConfReady().promise;this.app=et,this.user=await this.odeServices.session().getUser(),this.profile=await this.odeServices.session().getUserProfile();const{["data-service"]:rt}=await this.conf.getPublicConf(et);this._webBroker=new WebBroker(this.odeServices).initialize(rt==null?void 0:rt.web)}catch{console.log("DataService not initialized, usage data unavailable.")}}predestroy(){this._webBroker&&(this._webBroker.destroy(),delete this._webBroker)}trackWebEvent(et){this.notify.events().publish(LAYER_NAME.WEB_DATA,{name:EVENT_NAME.DATA_TRACKED,data:et})}addUserInfos(et){return this.user&&(et.userId=this.user.userId,et.structure=this.user.structureNames[0]),this.profile&&(et.profil=this.profile[0]),et}trackVideoSave(et,rt,nt,st,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:"video",video_id:et,browser:at,duration:Math.round(rt),weight:nt,source:st?"CAPTURED":"UPLOADED",url:ot});this.app&&(ut["override-module"]=this.app),lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,nt,st,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:st,source:rt?"CAPTURED":"UPLOADED",url:nt});this.app&&(at["override-module"]=this.app),ot&&(at.device_type=ot),this.trackWebEvent(at)}trackSpeechAndText(et){const rt=this.addUserInfos({"event-type":"SPEECH_AND_TEXT",function:et});this.app&&(rt.module=this.app),this.trackWebEvent(rt)}trackAccessLibraryFromExplorer(){const et=this.addUserInfos({"event-type":"ACCESS_LIBRARY_FROM_EXPLORER"});this.app&&(et.module=this.app),this.trackWebEvent(et)}}class ReactionsService{constructor(et,rt,nt){this.context=et,this.module=rt,this.resourceType=nt}get http(){return this.context.http()}async loadAvailableReactions(){try{const{"reaction-types":et}=await this.context.conf().getPublicConf("audience");return Array.isArray(et)?et:void 0}catch{console.error("Audience configuration not found");return}}async loadReactionSummaries(et){const rt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt.reactionsByResource}async loadReactionDetails(et,rt,nt){const st=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${nt}`);return this.http.isResponseError()?void 0:st}async deleteReaction(et){await this.http.delete(`/audience/reactions/${this.module}/${this.resourceType}/${et}`)}async updateReaction(et,rt){await this.http.putJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}async createReaction(et,rt){await this.http.postJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}}class ViewsService{constructor(et,rt,nt){this.context=et,this.module=rt,this.resourceType=nt}get http(){return this.context.http()}async getCounters(et){const rt=await this.http.get(`/audience/views/count/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt}async getDetails(et){const rt=await this.http.get(`/audience/views/details/${this.module}/${this.resourceType}/${et}`);return this.http.isResponseError()?void 0:rt}trigger(et){return this.http.post(`/audience/views/${this.module}/${this.resourceType}/${et}`)}}class AudienceService{constructor(et,rt,nt){this.context=et,this.module=rt,this.resourceType=nt}get views(){return new ViewsService(this.context,this.module,this.resourceType)}get reactions(){return new ReactionsService(this.context,this.module,this.resourceType)}}class OdeServices{constructor(){n$2(this,"_analytics"),n$2(this,"_cache"),n$2(this,"_conf"),n$2(this,"_data"),n$2(this,"_directory"),n$2(this,"_http"),n$2(this,"_idiom"),n$2(this,"_notify"),n$2(this,"_rights"),n$2(this,"_session"),n$2(this,"_share"),n$2(this,"_video"),n$2(this,"_workspace"),n$2(this,"_embedder"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._data=new DataService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._notify=NotifyFrameworkFactory.instance(),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._video=new VideoService(this),this._workspace=new WorkspaceService(this),this._embedder=new EmbedderService(this)}initialize(){return this._data.initialize(),this}analytics(){return this._analytics}audience(et,rt){return new AudienceService(this,et,rt)}cache(){return this._cache}conf(){return this._conf}data(){return this._data}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}notify(){return this._notify}resource(et,rt){return rt?ResourceService.findService({application:et,resourceType:rt},this):ResourceService.findMainService({application:et},this)}behaviour(et,rt){return SnipletsService.findBehaviour({application:et,resourceType:rt},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}video(){return this._video}workspace(){return this._workspace}embedder(){return this._embedder}}const ACTION={SEARCH:"search",CREATE:"create",CREATE_PUBLIC:"createPublic",OPEN:"open",EDIT:"edit",MANAGE:"manage",UPD_PROPS:"properties",COMMENT:"comment",DELETE:"delete",TRASH:"trash",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PAGES_LIST:"pages_list",DISTRIBUTE:"distribute",REGISTER:"register",PUBLISH:"publish",PUBLISH_MOODLE:"publish_moodle"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={ASC:"asc",DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(nt=>nt.id===tt&&nt.available);return rt&&rt.length>0},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){n$2(this,"_initialized"),n$2(this,"_widgets",[]),n$2(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(nt=>{var st;nt&&nt.widgets?(nt.widgets.forEach(ot=>{this._widgets.push(new Widget(ot))}),this.loadUserPrefs().then(()=>{var ot;(ot=this._initialized)==null||ot.resolve()}).catch(ot=>{var at;(at=this._initialized)==null||at.reject()})):(st=this._initialized)==null||st.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(rt=>rt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().publish(LAYER_NAME.WIDGETS,{name:EVENT_NAME.USERPREF_CHANGED})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const rt=configure.Platform.theme,nt=[];rt.listSkins().then(st=>{var ot;const at=((ot=st.find(ut=>ut.child===rt.skin))==null?void 0:ot.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,ct)=>{const dt=ut.platformConf.name;return at.indexOf(dt)!==-1?!1:(this._userPrefs[dt]||(this._userPrefs[dt]={index:defaultWidgetOrder[dt]??999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[dt].show=!0,this._userPrefs[dt].index=defaultWidgetOrder[dt]??999),ut.platformConf.i18n&&nt.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[dt]),!0)});const lt=new Idiom;this._widgets=this._widgets.sort((ut,ct)=>{const dt=lt.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ht=lt.translate(`timeline.settings.${ct.platformConf.name}`).toLowerCase();return dt<ht?-1:dt>ht?1:0})})}}class Widget{constructor(et){n$2(this,"_schoolConf",{}),n$2(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){this._userPref=et,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework,SvgIconFolder=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.057 5.5A.057.057 0 0 0 3 5.557v13.03h18V7.875h-8.697a1 1 0 0 1-1-1c0-.759-.615-1.374-1.374-1.374zM1 5.557C1 4.42 1.92 3.5 3.057 3.5h6.872c1.515 0 2.797.999 3.223 2.374H21a2 2 0 0 1 2 2v10.714a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2z",clipRule:"evenodd"})]}),SvgIconRafterDown=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.012 7.871a1.5 1.5 0 0 1 2.117.141L12 14.722l5.871-6.71a1.5 1.5 0 1 1 2.258 1.976l-7 8a1.5 1.5 0 0 1-2.258 0l-7-8a1.5 1.5 0 0 1 .141-2.117",clipRule:"evenodd"})]}),TreeNode=({node:tt,showIcon:et,selectedNodeId:rt,expandedNodes:nt,siblingsNodes:st,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=nt.has(tt.id),dt=st==null?void 0:st.current.has(tt.id),ht=rt===tt.id,mt=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":mt,"py-4":!tt.section}),arrow:clsx({"py-4":!tt.section,"py-8":tt.section,invisible:!Array.isArray(tt.children)||tt.children.length===0}),button:clsx("flex-fill d-flex align-items-center text-truncate gap-8",{"py-8":tt.section})},yt=tt.section?16:12,{t:vt}=useTranslation(),{setNodeRef:Et}=useDroppable({id:reactExports.useId(),data:{id:tt.id,name:tt.name,isTreeview:!0,accepts:["folder","resource"]}}),bt=jt=>at==null?void 0:at(jt),St=jt=>lt==null?void 0:lt(jt),wt=jt=>ut==null?void 0:ut(jt),Rt=jt=>{(jt.code==="Enter"||jt.code==="Space")&&(jt.preventDefault(),jt.stopPropagation(),at==null||at(tt.id))},Ct=jt=>{(jt.code==="Enter"||jt.code==="Space")&&(jt.preventDefault(),jt.stopPropagation(),lt==null||lt(tt.id))},Pt=jt=>jsxRuntimeExports.jsx(jt?SvgIconRafterDown:SvgIconRafterRight,{title:vt("foldUnfold"),width:yt,height:yt}),It=()=>{var jt;const Dt=!((jt=st==null?void 0:st.current)!=null&&jt.has(tt.id)),Vt=Array.isArray(tt.children)&&tt.children.length>0;return dt||Dt&&Vt};return jsxRuntimeExports.jsx("li",{ref:Et,id:`treeitem-${tt.id}`,role:"treeitem","aria-selected":ht&&ht,"aria-expanded":ct&&ct,children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:xt.action,children:[jsxRuntimeExports.jsx("div",{className:xt.arrow,tabIndex:0,role:"button",onClick:()=>St(tt.id),onKeyDown:Ct,"aria-label":vt("foldUnfold"),children:It()&&Pt(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>bt(tt.id),onKeyDown:Rt,children:[tt.section&&et&&jsxRuntimeExports.jsx(SvgIconFolder,{title:vt("folder"),width:20,height:20}),jsxRuntimeExports.jsx("span",{className:"text-truncate",children:tt.name})]}),tt.section&&ut&&jsxRuntimeExports.jsx("button",{className:"tree-btn mx-8",onClick:()=>wt(tt.id),children:jsxRuntimeExports.jsx(SvgIconPlus,{height:16,width:16})})]}),Array.isArray(tt.children)&&!!tt.children.length&&ct&&jsxRuntimeExports.jsx("ul",{role:"group",children:tt.children.map(jt=>jsxRuntimeExports.jsx(TreeNode,{node:jt,selectedNodeId:rt,expandedNodes:nt,siblingsNodes:st,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},jt.id))})]})},tt.id)};var __defProp$1=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp$1(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,__publicField=(tt,et,rt)=>__defNormalProp(tt,typeof et!="symbol"?et+"":et,rt);function findTreeNode(tt,et){if(et(tt))return tt;if(Array.isArray(tt.children))for(const rt of tt.children){const nt=findTreeNode(rt,et);if(nt)return nt}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const nt=findNodeById(rt,et);if(nt)return nt}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const nt=findNodeById(rt,et);if(nt)return nt}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,nt=>{var st;if(nt.id===et){const ot=[...((st=nt.folder)==null?void 0:st.ancestors)||[]],at=arrayUnique([...ot,nt.id]);return{...nt,children:[...nt.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return nt})}function arrayUnique(tt){return tt.filter((et,rt)=>tt.indexOf(et)===rt)}function deleteNode(tt,{folders:et}){return modifyNode(tt,rt=>{if(!et.includes(rt.id))return rt})}const findParentNode=(tt,et)=>{if(tt.children)for(const rt of tt.children){if(rt.id===et)return tt;const nt=findParentNode(rt,et);if(nt)return nt}};function getAncestors(tt,et){var rt;const nt=findNodeById(tt,et);return(rt=nt==null?void 0:nt.folder)!=null&&rt.ancestors?[...(nt==null?void 0:nt.folder.ancestors)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function modifyNode(tt,et){return doModify(tt,et)||tt}function doModify(tt,et,rt){var nt;const st=et(tt,rt);if((nt=st==null?void 0:st.children)!=null&&nt.length){const ot=[];for(const at of(st==null?void 0:st.children)||[]){const lt=doModify(at,et,st);lt&&ot.push(lt)}return{...st,children:ot}}return st}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(nt,st)=>{var ot,at;if(et===nt.id){const lt=[...((ot=nt.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,nt.id]),ct=[...nt.children||[]],dt=((at=nt.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const mt=findNodeById(nt,ht);mt&&ct.push({...mt,folder:{...mt==null?void 0:mt.folder,ancestors:ut}})}return{...nt,children:ct}}else return rt.includes(nt.id)&&et!==(st==null?void 0:st.id)?void 0:nt})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,nt=>(nt.id===rt&&(nt.children=et==null?void 0:et.map(st=>new TreeNodeFolderWrapper(st))),nt));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,nt=>nt.id===et?new TreeNodeFolderWrapper(rt):nt)}function findPathById(tt,et){let rt=[];function nt(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(nt(lt,at.concat(ot.id)))return!0}return!1}function st(ot){if(Array.isArray(ot)){for(const at of ot)if(nt(at,[]))break}else nt(ot,[])}return st(tt),rt}class TreeNodeFolderWrapper{constructor(et){__publicField(this,"id"),__publicField(this,"name"),__publicField(this,"childNumber"),__publicField(this,"section",!1),__publicField(this,"children",[]),this.folder=et,this.id=et.id,this.name=et.name,this.childNumber=et.childNumber}}const useTreeView=({data:tt,ref:et,externalSelectedNodeId:rt,draggedNode:nt,allExpandedNodes:st,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),mt=reactExports.useRef(new Set),[xt,yt]=reactExports.useState(void 0),vt=ut??rt;function Et(Ft){var Ht;Array.isArray(Ft)?Ft.forEach(Nt=>{const Lt=new Set(mt.current);Ft.filter(({id:Mt})=>Mt!==Nt.id).some(Mt=>Mt.children&&Mt.children.length>0)&&Lt.add(Nt.id),Nt.children&&Nt.children.length>0&&Nt.children.forEach(Mt=>{var zt;const Gt=(zt=Nt.children)==null?void 0:zt.filter(({id:$t})=>$t!==Mt.id);Gt!=null&&Gt.some($t=>$t.children&&$t.children.length>0)&&Lt.add(Mt.id),Et(Mt)})}):(Ht=Ft.children)==null||Ht.forEach(Nt=>{var Lt;const Mt=new Set(mt.current),zt=(Lt=Ft.children)==null?void 0:Lt.filter(Gt=>Gt.id!==Nt.id);zt!=null&&zt.some(Gt=>Gt.children&&Gt.children.length>0)&&(Mt.add(Nt.id),mt.current=Mt),Et(Nt)})}const bt=Ft=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Ft&&(tt.forEach(Nt=>{Ht.add(Nt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{nt!=null&&nt.isOver&&nt.isTreeview?(nt.overId&&Vt(nt.overId),yt(nt.overId)):yt(void 0)},[nt]);const St=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Ft){jt(Ft)},allExpandedNodes(){bt(st)}}),[]);reactExports.useImperativeHandle(et,()=>St,[St]),reactExports.useEffect(()=>{bt(st)},[]),reactExports.useEffect(()=>{rt&&!st?(wt(rt),ct(rt)):ct(void 0)},[rt]);const wt=Ft=>{if(!findNodeById(tt,vt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Ft)},Rt=Ft=>{const Ht=new Set(dt),Nt=findPathById(tt,Ft),Lt=Array.from(Ht);Nt.forEach(Mt=>{const zt=Lt.indexOf(Mt);zt>-1&&Lt.splice(zt,1),Lt.push(Mt)}),Ht.clear(),Lt.forEach(Mt=>Ht.add(Mt)),Ht.forEach(Mt=>ot==null?void 0:ot(Mt)),ht(Ht)},Ct=Ft=>{const Ht=new Set(dt);Ht.delete(Ft),Ht.forEach(Nt=>at==null?void 0:at(Nt)),ht(Ht)},Pt=Ft=>{dt.has(Ft)?Ct(Ft):Rt(Ft)},It=Ft=>{vt!==Ft&&ct(Ft)},jt=Ft=>{It(Ft),Rt(Ft),lt==null||lt(Ft)},Dt=Ft=>{Pt(Ft)},Vt=Ft=>{findNodeById(tt,rt)&&Rt(Ft)};return{selectedNodeId:vt,expandedNodes:dt,siblingsNodes:mt,draggedNodeId:xt,handleItemClick:jt,handleFoldUnfold:Dt}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:nt,onTreeItemUnfold:st,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:mt,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:nt,onTreeItemFold:ot,onTreeItemUnfold:st});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(bt=>jsxRuntimeExports.jsx(TreeNode,{node:bt,showIcon:ut,selectedNodeId:ht,expandedNodes:mt,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:mt,siblingsNodes:xt,showIcon:ut,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et})})})}),EdificeClientContext=reactExports.createContext(null);function useEdificeClient(){const tt=reactExports.useContext(EdificeClientContext);if(!tt)throw new Error("Cannot be used outside of EdificeClientProvider");return tt}function useBookmark(){var tt;const{sessionQuery:et}=useEdificeClient(),rt=new Set;return(tt=et==null?void 0:et.data)==null?void 0:tt.bookmarkedApps.filter(nt=>{const st=rt.has(nt.displayName);return rt.add(nt.displayName),!st})}function useDebounce(tt,et){const[rt,nt]=reactExports.useState(tt);return reactExports.useEffect(()=>{const st=setTimeout(()=>{nt(tt)},et);return()=>{clearTimeout(st)}},[tt,et]),rt}function useMediaQuery(tt){const et=reactExports.useCallback(st=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",st),()=>{ot.removeEventListener("change",st)}},[tt]),rt=()=>window.matchMedia(tt).matches,nt=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,nt)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),nt=reactExports.useCallback(st=>rt(typeof st=="boolean"?st:ot=>!ot),[]);return[et,nt]}function useBreakpoint(){return{xs:useMediaQuery("only screen and (min-width: 0)"),sm:useMediaQuery("only screen and (min-width: 375px)"),md:useMediaQuery("only screen and (min-width: 768px)"),lg:useMediaQuery("only screen and (min-width: 1024px)"),xl:useMediaQuery("only screen and (min-width: 1280px)"),xxl:useMediaQuery("only screen and (min-width: 1400px)")}}var uaParser={exports:{}};(function(tt,et){(function(rt,nt){var st="1.0.40",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",mt="model",xt="name",yt="type",vt="vendor",Et="version",bt="architecture",St="console",wt="mobile",Rt="tablet",Ct="smarttv",Pt="wearable",It="embedded",jt=500,Dt="Amazon",Vt="Apple",Ft="ASUS",Ht="BlackBerry",Nt="Browser",Lt="Chrome",Mt="Edge",zt="Firefox",Gt="Google",$t="Huawei",Ut="LG",Bt="Microsoft",Yt="Motorola",Zt="Opera",Xt="Samsung",rr="Sharp",cr="Sony",ur="Xiaomi",mr="Zebra",vr="Facebook",Er="Chromium OS",br="Mac OS",hr=" Browser",Ar=function(jr,Ir){var Pr={};for(var Vr in jr)Ir[Vr]&&Ir[Vr].length%2===0?Pr[Vr]=Ir[Vr].concat(jr[Vr]):Pr[Vr]=jr[Vr];return Pr},Cr=function(jr){for(var Ir={},Pr=0;Pr<jr.length;Pr++)Ir[jr[Pr].toUpperCase()]=jr[Pr];return Ir},Ur=function(jr,Ir){return typeof jr===dt?Sr(Ir).indexOf(Sr(jr))!==-1:!1},Sr=function(jr){return jr.toLowerCase()},kr=function(jr){return typeof jr===dt?jr.replace(/[^\d\.]/g,ot).split(".")[0]:nt},Zr=function(jr,Ir){if(typeof jr===dt)return jr=jr.replace(/^\s\s*/,ot),typeof Ir===ut?jr:jr.substring(0,jt)},qt=function(jr,Ir){for(var Pr=0,Vr,Xn,An,Hr,Lr,os;Pr<Ir.length&&!Lr;){var Ms=Ir[Pr],Xo=Ir[Pr+1];for(Vr=Xn=0;Vr<Ms.length&&!Lr&&Ms[Vr];)if(Lr=Ms[Vr++].exec(jr),Lr)for(An=0;An<Xo.length;An++)os=Lr[++Xn],Hr=Xo[An],typeof Hr===ct&&Hr.length>0?Hr.length===2?typeof Hr[1]==lt?this[Hr[0]]=Hr[1].call(this,os):this[Hr[0]]=Hr[1]:Hr.length===3?typeof Hr[1]===lt&&!(Hr[1].exec&&Hr[1].test)?this[Hr[0]]=os?Hr[1].call(this,os,Hr[2]):nt:this[Hr[0]]=os?os.replace(Hr[1],Hr[2]):nt:Hr.length===4&&(this[Hr[0]]=os?Hr[3].call(this,os.replace(Hr[1],Hr[2])):nt):this[Hr]=os||nt;Pr+=2}},er=function(jr,Ir){for(var Pr in Ir)if(typeof Ir[Pr]===ct&&Ir[Pr].length>0){for(var Vr=0;Vr<Ir[Pr].length;Vr++)if(Ur(Ir[Pr][Vr],jr))return Pr===at?nt:Pr}else if(Ur(Ir[Pr],jr))return Pr===at?nt:Pr;return Ir.hasOwnProperty("*")?Ir["*"]:jr},nr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},yr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},xr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Et,[xt,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Et,[xt,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[xt,Et],[/opios[\/ ]+([\w\.]+)/i],[Et,[xt,Zt+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,Zt+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,Zt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Et,[xt,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Et,[xt,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[xt,Et],[/quark(?:pc)?\/([-\w\.]+)/i],[Et,[xt,"Quark"]],[/\bddg\/([\w\.]+)/i],[Et,[xt,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Et,[xt,"UC"+Nt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Et,[xt,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Et,[xt,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Et,[xt,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Et,[xt,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Et,[xt,"Smart Lenovo "+Nt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Nt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,zt+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,Zt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,Zt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+hr]],[/fxios\/([\w\.-]+)/i],[Et,[xt,zt]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+hr],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,Xt+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Et,[xt,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[xt,"Sogou Mobile"],Et],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[xt,Et],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[xt],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Et,xt],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[xt,vr],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[xt,Et],[/\bgsa\/([\w\.]+) .*safari\//i],[Et,[xt,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Et,[xt,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[Et,[xt,Lt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,Lt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Nt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[xt,Et],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[Et,[xt,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[Et,xt],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[xt,[Et,er,nr]],[/(webkit|khtml)\/([\w\.]+)/i],[xt,Et],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[xt,"Netscape"],Et],[/(wolvic|librewolf)\/([\w\.]+)/i],[xt,Et],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Et,[xt,zt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[bt,"amd64"]],[/(ia32(?=;))/i],[[bt,Sr]],[/((?:i[346]|x)86)[;\)]/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/windows (ce|mobile); ppc;/i],[[bt,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[bt,/ower/,ot,Sr]],[/(sun4\w)[;\)]/i],[[bt,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[bt,Sr]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[mt,[vt,Xt],[yt,Rt]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[mt,[vt,Xt],[yt,wt]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[mt,[vt,Vt],[yt,wt]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[mt,[vt,Vt],[yt,Rt]],[/(macintosh);/i],[mt,[vt,Vt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[mt,[vt,rr],[yt,wt]],[/(?:honor)([-\w ]+)[;\)]/i],[mt,[vt,"Honor"],[yt,wt]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[mt,[vt,$t],[yt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[mt,[vt,$t],[yt,wt]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[mt,/_/g," "],[vt,ur],[yt,wt]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[mt,/_/g," "],[vt,ur],[yt,Rt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[mt,[vt,"OPPO"],[yt,wt]],[/\b(opd2\d{3}a?) bui/i],[mt,[vt,"OPPO"],[yt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[mt,[vt,"Vivo"],[yt,wt]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[mt,[vt,"Realme"],[yt,wt]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[mt,[vt,Yt],[yt,wt]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[mt,[vt,Yt],[yt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[mt,[vt,Ut],[yt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[mt,[vt,Ut],[yt,wt]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[mt,[vt,"Lenovo"],[yt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[mt,/_/g," "],[vt,"Nokia"],[yt,wt]],[/(pixel c)\b/i],[mt,[vt,Gt],[yt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[mt,[vt,Gt],[yt,wt]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[mt,[vt,cr],[yt,wt]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[mt,"Xperia Tablet"],[vt,cr],[yt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[mt,[vt,"OnePlus"],[yt,wt]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[mt,[vt,Dt],[yt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[mt,/(.+)/g,"Fire Phone $1"],[vt,Dt],[yt,wt]],[/(playbook);[-\w\),; ]+(rim)/i],[mt,vt,[yt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[mt,[vt,Ht],[yt,wt]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[mt,[vt,Ft],[yt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[mt,[vt,Ft],[yt,wt]],[/(nexus 9)/i],[mt,[vt,"HTC"],[yt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[vt,[mt,/_/g," "],[yt,wt]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[mt,[vt,"TCL"],[yt,Rt]],[/(itel) ((\w+))/i],[[vt,Sr],mt,[yt,er,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[mt,[vt,"Acer"],[yt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[mt,[vt,"Meizu"],[yt,wt]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[mt,[vt,"Ulefone"],[yt,wt]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[mt,[vt,"Energizer"],[yt,wt]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[mt,[vt,"Cat"],[yt,wt]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[mt,[vt,"Smartfren"],[yt,wt]],[/droid.+; (a(?:015|06[35]|142p?))/i],[mt,[vt,"Nothing"],[yt,wt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[vt,mt,[yt,wt]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[vt,mt,[yt,Rt]],[/(surface duo)/i],[mt,[vt,Bt],[yt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[mt,[vt,"Fairphone"],[yt,wt]],[/(u304aa)/i],[mt,[vt,"AT&T"],[yt,wt]],[/\bsie-(\w*)/i],[mt,[vt,"Siemens"],[yt,wt]],[/\b(rct\w+) b/i],[mt,[vt,"RCA"],[yt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[mt,[vt,"Dell"],[yt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[mt,[vt,"Verizon"],[yt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[mt,[vt,"Barnes & Noble"],[yt,Rt]],[/\b(tm\d{3}\w+) b/i],[mt,[vt,"NuVision"],[yt,Rt]],[/\b(k88) b/i],[mt,[vt,"ZTE"],[yt,Rt]],[/\b(nx\d{3}j) b/i],[mt,[vt,"ZTE"],[yt,wt]],[/\b(gen\d{3}) b.+49h/i],[mt,[vt,"Swiss"],[yt,wt]],[/\b(zur\d{3}) b/i],[mt,[vt,"Swiss"],[yt,Rt]],[/\b((zeki)?tb.*\b) b/i],[mt,[vt,"Zeki"],[yt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[vt,"Dragon Touch"],mt,[yt,Rt]],[/\b(ns-?\w{0,9}) b/i],[mt,[vt,"Insignia"],[yt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[mt,[vt,"NextBook"],[yt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[vt,"Voice"],mt,[yt,wt]],[/\b(lvtel\-)?(v1[12]) b/i],[[vt,"LvTel"],mt,[yt,wt]],[/\b(ph-1) /i],[mt,[vt,"Essential"],[yt,wt]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[mt,[vt,"Envizen"],[yt,Rt]],[/\b(trio[-\w\. ]+) b/i],[mt,[vt,"MachSpeed"],[yt,Rt]],[/\btu_(1491) b/i],[mt,[vt,"Rotor"],[yt,Rt]],[/(shield[\w ]+) b/i],[mt,[vt,"Nvidia"],[yt,Rt]],[/(sprint) (\w+)/i],[vt,mt,[yt,wt]],[/(kin\.[onetw]{3})/i],[[mt,/\./g," "],[vt,Bt],[yt,wt]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[mt,[vt,mr],[yt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[mt,[vt,mr],[yt,wt]],[/smart-tv.+(samsung)/i],[vt,[yt,Ct]],[/hbbtv.+maple;(\d+)/i],[[mt,/^/,"SmartTV"],[vt,Xt],[yt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[vt,Ut],[yt,Ct]],[/(apple) ?tv/i],[vt,[mt,Vt+" TV"],[yt,Ct]],[/crkey/i],[[mt,Lt+"cast"],[vt,Gt],[yt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[mt,[vt,Dt],[yt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[mt,[vt,rr],[yt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[mt,[vt,cr],[yt,Ct]],[/(mitv-\w{5}) bui/i],[mt,[vt,ur],[yt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[vt,mt,[yt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[vt,Zr],[mt,Zr],[yt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[yt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[vt,mt,[yt,St]],[/droid.+; (shield) bui/i],[mt,[vt,"Nvidia"],[yt,St]],[/(playstation [345portablevi]+)/i],[mt,[vt,cr],[yt,St]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[mt,[vt,Bt],[yt,St]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[mt,[vt,Xt],[yt,Pt]],[/((pebble))app/i],[vt,mt,[yt,Pt]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[mt,[vt,Vt],[yt,Pt]],[/droid.+; (glass) \d/i],[mt,[vt,Gt],[yt,Pt]],[/droid.+; (wt63?0{2,3})\)/i],[mt,[vt,mr],[yt,Pt]],[/droid.+; (glass) \d/i],[mt,[vt,Gt],[yt,Pt]],[/(pico) (4|neo3(?: link|pro)?)/i],[vt,mt,[yt,Pt]],[/; (quest( \d| pro)?)/i],[mt,[vt,vr],[yt,Pt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[vt,[yt,It]],[/(aeobc)\b/i],[mt,[vt,Dt],[yt,It]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[mt,[yt,wt]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[mt,[yt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[yt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[yt,wt]],[/(android[-\w\. ]{0,9});.+buil/i],[mt,[vt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,Mt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[xt,Et],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Et,[xt,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[xt,Et],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,er,yr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,er,yr],[xt,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Et,/_/g,"."],[xt,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[xt,br],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,zt+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Et,[xt,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Et,[xt,"watchOS"]],[/crkey\/([\d\.]+)/i],[Et,[xt,Lt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,Er],Et],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[xt,Et],[/(sunos) ?([\w\.\d]*)/i],[[xt,"Solaris"],Et],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[xt,Et]]},dr=function(jr,Ir){if(typeof jr===ct&&(Ir=jr,jr=nt),!(this instanceof dr))return new dr(jr,Ir).getResult();var Pr=typeof rt!==ut&&rt.navigator?rt.navigator:nt,Vr=jr||(Pr&&Pr.userAgent?Pr.userAgent:ot),Xn=Pr&&Pr.userAgentData?Pr.userAgentData:nt,An=Ir?Ar(xr,Ir):xr,Hr=Pr&&Pr.userAgent==Vr;return this.getBrowser=function(){var Lr={};return Lr[xt]=nt,Lr[Et]=nt,qt.call(Lr,Vr,An.browser),Lr[ht]=kr(Lr[Et]),Hr&&Pr&&Pr.brave&&typeof Pr.brave.isBrave==lt&&(Lr[xt]="Brave"),Lr},this.getCPU=function(){var Lr={};return Lr[bt]=nt,qt.call(Lr,Vr,An.cpu),Lr},this.getDevice=function(){var Lr={};return Lr[vt]=nt,Lr[mt]=nt,Lr[yt]=nt,qt.call(Lr,Vr,An.device),Hr&&!Lr[yt]&&Xn&&Xn.mobile&&(Lr[yt]=wt),Hr&&Lr[mt]=="Macintosh"&&Pr&&typeof Pr.standalone!==ut&&Pr.maxTouchPoints&&Pr.maxTouchPoints>2&&(Lr[mt]="iPad",Lr[yt]=Rt),Lr},this.getEngine=function(){var Lr={};return Lr[xt]=nt,Lr[Et]=nt,qt.call(Lr,Vr,An.engine),Lr},this.getOS=function(){var Lr={};return Lr[xt]=nt,Lr[Et]=nt,qt.call(Lr,Vr,An.os),Hr&&!Lr[xt]&&Xn&&Xn.platform&&Xn.platform!="Unknown"&&(Lr[xt]=Xn.platform.replace(/chrome os/i,Er).replace(/macos/i,br)),Lr},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Vr},this.setUA=function(Lr){return Vr=typeof Lr===dt&&Lr.length>jt?Zr(Lr,jt):Lr,this},this.setUA(Vr),this};dr.VERSION=st,dr.BROWSER=Cr([xt,Et,ht]),dr.CPU=Cr([bt]),dr.DEVICE=Cr([mt,vt,yt,St,wt,Ct,Rt,Pt,It]),dr.ENGINE=dr.OS=Cr([xt,Et]),tt.exports&&(et=tt.exports=dr),et.UAParser=dr;var _r=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(_r&&!_r.ua){var Fr=new dr;_r.ua=Fr.getResult(),_r.ua.get=function(){return Fr.getUA()},_r.ua.set=function(jr){Fr.setUA(jr);var Ir=Fr.getResult();for(var Pr in Ir)_r.ua[Pr]=Ir[Pr]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,nt;const st=new UAParser(tt),ot=st.getOS(),at=st.getDevice(),lt=st.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((nt=at.model)==null?void 0:nt.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}const MockedDataContext=reactExports.createContext(null);function useMockedData(){return reactExports.useContext(MockedDataContext)}function useHasWorkflow(tt){const et=useMockedData(),[rt,nt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;if(et!=null&&et.hasWorkflow)if(typeof tt=="string")st=await et.hasWorkflow(tt);else throw"not.implemented.yet)";else typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt);nt(st)})()},[tt,et]),rt}function useCantoo(){const tt=useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo");return reactExports.useEffect(()=>{tt&&!document.getElementById("cantoo-edifice-script")&&(async()=>{const et=await odeServices.http().get("/optionalFeature/cantoo");if(et&&et.scriptPath){const rt=document.createElement("script");rt.id="cantoo-edifice-script",rt.src=et.scriptPath,rt.async=!0,document.body.appendChild(rt)}})()},[tt]),null}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$2(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:nt,fetchStatus:st,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(nt){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||st&&st!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:nt,predicate:st,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(nt&&et.state.status!==nt||st&&!st(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject$1(rt)?Object.keys(rt).sort().reduce((nt,st)=>(nt[st]=rt[st],nt),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject$1(tt)&&isPlainObject$1(et)){const nt=rt?tt:Object.keys(tt),st=nt.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&nt.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return st===at&&ut===st?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject$1(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const nt=[...tt,et];return rt&&nt.length>rt?nt.slice(1):nt}function addToStart(tt,et,rt=0){const nt=[et,...tt];return rt&&nt.length>rt?nt.slice(0,-1):nt}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var $a,Fo,Gl,qp,FocusManager=(qp=class extends Subscribable{constructor(){super();Nr(this,$a);Nr(this,Fo);Nr(this,Gl);Rr(this,Gl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Fo)||this.setEventListener(Kt(this,Gl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Fo))==null||et.call(this),Rr(this,Fo,void 0))}setEventListener(et){var rt;Rr(this,Gl,et),(rt=Kt(this,Fo))==null||rt.call(this),Rr(this,Fo,et(nt=>{typeof nt=="boolean"?this.setFocused(nt):this.onFocus()}))}setFocused(et){Kt(this,$a)!==et&&(Rr(this,$a,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,$a)=="boolean"?Kt(this,$a):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},$a=new WeakMap,Fo=new WeakMap,Gl=new WeakMap,qp),focusManager=new FocusManager,Wl,Bo,Xl,Xp,OnlineManager=(Xp=class extends Subscribable{constructor(){super();Nr(this,Wl,!0);Nr(this,Bo);Nr(this,Xl);Rr(this,Xl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),nt=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",nt,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",nt)}}})}onSubscribe(){Kt(this,Bo)||this.setEventListener(Kt(this,Xl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Bo))==null||et.call(this),Rr(this,Bo,void 0))}setEventListener(et){var rt;Rr(this,Xl,et),(rt=Kt(this,Bo))==null||rt.call(this),Rr(this,Bo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Wl)!==et&&(Rr(this,Wl,et),this.listeners.forEach(nt=>{nt(et)}))}isOnline(){return Kt(this,Wl)}},Wl=new WeakMap,Bo=new WeakMap,Xl=new WeakMap,Xp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((st,ot)=>{tt=st,et=ot});rt.status="pending",rt.catch(()=>{});function nt(st){Object.assign(rt,st),delete rt.resolve,delete rt.reject}return rt.resolve=st=>{nt({status:"fulfilled",value:st}),tt(st)},rt.reject=st=>{nt({status:"rejected",reason:st}),et(st)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,nt=!1,st;const ot=pendingThenable(),at=vt=>{var Et;nt||(mt(new CancelledError(vt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=vt=>{var Et;nt||(nt=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),st==null||st(),ot.resolve(vt))},mt=vt=>{var Et;nt||(nt=!0,(Et=tt.onError)==null||Et.call(tt,vt),st==null||st(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;st=bt=>{(nt||ct())&&vt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;st=void 0,nt||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(nt)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(bt){vt=Promise.reject(bt)}Promise.resolve(vt).then(ht).catch(bt=>{var Pt;if(nt)return;const St=tt.retry??(isServer?0:3),wt=tt.retryDelay??defaultRetryDelay,Rt=typeof wt=="function"?wt(rt,bt):wt,Ct=St===!0||typeof St=="number"&&rt<St||typeof St=="function"&&St(rt,bt);if(et||!Ct){mt(bt);return}rt++,(Pt=tt.onFail)==null||Pt.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?mt(bt):yt()})})};return{promise:ot,cancel:at,continue:()=>(st==null||st(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},nt=lt=>{lt()},st=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):st(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&st(()=>{nt(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{nt=lt},setScheduler:lt=>{st=lt}}}var notifyManager=createNotifyManager(),xl,Yp,Removable=(Yp=class{constructor(){Nr(this,xl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Rr(this,xl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,xl)&&(clearTimeout(Kt(this,xl)),Rr(this,xl,void 0))}},xl=new WeakMap,Yp),Yl,Kl,Hs,hs,ju,yl,Qs,So,Kp,Query=(Kp=class extends Removable{constructor(et){super();Nr(this,Qs);Nr(this,Yl);Nr(this,Kl);Nr(this,Hs);Nr(this,hs);Nr(this,ju);Nr(this,yl);Rr(this,yl,!1),Rr(this,ju,et.defaultOptions),this.setOptions(et.options),this.observers=[],Rr(this,Hs,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Rr(this,Yl,getDefaultState$1(this.options)),this.state=et.state??Kt(this,Yl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,hs))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,ju),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,Hs).remove(this)}setData(et,rt){const nt=replaceData(this.state.data,et,this.options);return zr(this,Qs,So).call(this,{data:nt,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),nt}setState(et,rt){zr(this,Qs,So).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var nt,st;const rt=(nt=Kt(this,hs))==null?void 0:nt.promise;return(st=Kt(this,hs))==null||st.cancel(et),rt?rt.then(noop$2).catch(noop$2):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,Yl))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(nt=>nt.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,hs))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(nt=>nt.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,hs))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,Hs).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,hs)&&(Kt(this,yl)?Kt(this,hs).cancel({revert:!0}):Kt(this,hs).cancelRetry()),this.scheduleGc()),Kt(this,Hs).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||zr(this,Qs,So).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,hs))return Kt(this,hs).continueRetry(),Kt(this,hs).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(mt=>mt.options.queryFn);ht&&this.setOptions(ht.options)}const nt=new AbortController,st=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Rr(this,yl,!0),nt.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),mt={queryKey:this.queryKey,meta:this.meta};return st(mt),Rr(this,yl,!1),this.options.persister?this.options.persister(ht,mt,this):ht(mt)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};st(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Rr(this,Kl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&zr(this,Qs,So).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var mt,xt,yt,vt;isCancelledError(ht)&&ht.silent||zr(this,Qs,So).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(mt=Kt(this,Hs).config).onError)==null||xt.call(mt,ht,this),(vt=(yt=Kt(this,Hs).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Rr(this,hs,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:nt.abort.bind(nt),onSuccess:ht=>{var mt,xt,yt,vt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(mt=Kt(this,Hs).config).onSuccess)==null||xt.call(mt,ht,this),(vt=(yt=Kt(this,Hs).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,mt)=>{zr(this,Qs,So).call(this,{type:"failed",failureCount:ht,error:mt})},onPause:()=>{zr(this,Qs,So).call(this,{type:"pause"})},onContinue:()=>{zr(this,Qs,So).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,hs).start()}},Yl=new WeakMap,Kl=new WeakMap,Hs=new WeakMap,hs=new WeakMap,ju=new WeakMap,yl=new WeakMap,Qs=new WeakSet,So=function(et){const rt=nt=>{switch(et.type){case"failed":return{...nt,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...nt,fetchStatus:"paused"};case"continue":return{...nt,fetchStatus:"fetching"};case"fetch":return{...nt,...fetchState(nt.data,this.options),fetchMeta:et.meta??null};case"success":return{...nt,data:et.data,dataUpdateCount:nt.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const st=et.error;return isCancelledError(st)&&st.revert&&Kt(this,Kl)?{...Kt(this,Kl),fetchStatus:"idle"}:{...nt,error:st,errorUpdateCount:nt.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:nt.fetchFailureCount+1,fetchFailureReason:st,fetchStatus:"idle",status:"error"};case"invalidate":return{...nt,isInvalidated:!0};case"setState":return{...nt,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(nt=>{nt.onQueryUpdate()}),Kt(this,Hs).notify({query:this,type:"updated",action:et})})},Kp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,nt=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?nt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var fo,Qp,QueryCache=(Qp=class extends Subscribable{constructor(et={}){super();Nr(this,fo);this.config=et,Rr(this,fo,new Map)}build(et,rt,nt){const st=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(st,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:st,queryHash:ot,options:et.defaultQueryOptions(rt),state:nt,defaultOptions:et.getQueryDefaults(st)}),this.add(at)),at}add(et){Kt(this,fo).has(et.queryHash)||(Kt(this,fo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,fo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,fo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,fo).get(et)}getAll(){return[...Kt(this,fo).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(nt=>matchQuery(rt,nt))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(nt=>matchQuery(et,nt)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},fo=new WeakMap,Qp),po,gs,El,mo,No,Zp,Mutation=(Zp=class extends Removable{constructor(et){super();Nr(this,mo);Nr(this,po);Nr(this,gs);Nr(this,El);this.mutationId=et.mutationId,Rr(this,gs,et.mutationCache),Rr(this,po,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,po).includes(et)||(Kt(this,po).push(et),this.clearGcTimeout(),Kt(this,gs).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Rr(this,po,Kt(this,po).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,gs).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,po).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,gs).remove(this))}continue(){var et;return((et=Kt(this,El))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var st,ot,at,lt,ut,ct,dt,ht,mt,xt,yt,vt,Et,bt,St,wt,Rt,Ct,Pt,It;Rr(this,El,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(jt,Dt)=>{zr(this,mo,No).call(this,{type:"failed",failureCount:jt,error:Dt})},onPause:()=>{zr(this,mo,No).call(this,{type:"pause"})},onContinue:()=>{zr(this,mo,No).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,gs).canRun(this)}));const rt=this.state.status==="pending",nt=!Kt(this,El).canStart();try{if(!rt){zr(this,mo,No).call(this,{type:"pending",variables:et,isPaused:nt}),await((ot=(st=Kt(this,gs).config).onMutate)==null?void 0:ot.call(st,et,this));const Dt=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Dt!==this.state.context&&zr(this,mo,No).call(this,{type:"pending",context:Dt,variables:et,isPaused:nt})}const jt=await Kt(this,El).start();return await((ct=(ut=Kt(this,gs).config).onSuccess)==null?void 0:ct.call(ut,jt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,jt,et,this.state.context)),await((xt=(mt=Kt(this,gs).config).onSettled)==null?void 0:xt.call(mt,jt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,jt,null,et,this.state.context)),zr(this,mo,No).call(this,{type:"success",data:jt}),jt}catch(jt){try{throw await((bt=(Et=Kt(this,gs).config).onError)==null?void 0:bt.call(Et,jt,et,this.state.context,this)),await((wt=(St=this.options).onError)==null?void 0:wt.call(St,jt,et,this.state.context)),await((Ct=(Rt=Kt(this,gs).config).onSettled)==null?void 0:Ct.call(Rt,void 0,jt,this.state.variables,this.state.context,this)),await((It=(Pt=this.options).onSettled)==null?void 0:It.call(Pt,void 0,jt,et,this.state.context)),jt}finally{zr(this,mo,No).call(this,{type:"error",error:jt})}}finally{Kt(this,gs).runNext(this)}}},po=new WeakMap,gs=new WeakMap,El=new WeakMap,mo=new WeakSet,No=function(et){const rt=nt=>{switch(et.type){case"failed":return{...nt,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...nt,isPaused:!0};case"continue":return{...nt,isPaused:!1};case"pending":return{...nt,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...nt,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...nt,data:void 0,error:et.error,failureCount:nt.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,po).forEach(nt=>{nt.onMutationUpdate(et)}),Kt(this,gs).notify({mutation:this,type:"updated",action:et})})},Zp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var js,Mu,Jp,MutationCache=(Jp=class extends Subscribable{constructor(et={}){super();Nr(this,js);Nr(this,Mu);this.config=et,Rr(this,js,new Map),Rr(this,Mu,Date.now())}build(et,rt,nt){const st=new Mutation({mutationCache:this,mutationId:++R1(this,Mu)._,options:et.defaultMutationOptions(rt),state:nt});return this.add(st),st}add(et){const rt=scopeFor(et),nt=Kt(this,js).get(rt)??[];nt.push(et),Kt(this,js).set(rt,nt),this.notify({type:"added",mutation:et})}remove(et){var nt;const rt=scopeFor(et);if(Kt(this,js).has(rt)){const st=(nt=Kt(this,js).get(rt))==null?void 0:nt.filter(ot=>ot!==et);st&&(st.length===0?Kt(this,js).delete(rt):Kt(this,js).set(rt,st))}this.notify({type:"removed",mutation:et})}canRun(et){var nt;const rt=(nt=Kt(this,js).get(scopeFor(et)))==null?void 0:nt.find(st=>st.state.status==="pending");return!rt||rt===et}runNext(et){var nt;const rt=(nt=Kt(this,js).get(scopeFor(et)))==null?void 0:nt.find(st=>st!==et&&st.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,js).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(nt=>matchMutation(rt,nt))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$2))))}},js=new WeakMap,Mu=new WeakMap,Jp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,mt,xt,yt;const nt=et.options,st=(mt=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:mt.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((yt=et.state.data)==null?void 0:yt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let vt=!1;const Et=wt=>{Object.defineProperty(wt,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),St=async(wt,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&wt.pages.length)return Promise.resolve(wt);const Pt={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(Pt);const It=await bt(Pt),{maxPages:jt}=et.options,Dt=Ct?addToStart:addToEnd;return{pages:Dt(wt.pages,It,jt),pageParams:Dt(wt.pageParams,Rt,jt)}};if(st&&ot.length){const wt=st==="backward",Rt=wt?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},Pt=Rt(nt,Ct);lt=await St(Ct,Pt,wt)}else{const wt=tt??ot.length;do{const Rt=ut===0?at[0]??nt.initialPageParam:getNextPageParam(nt,lt);if(ut>0&&Rt==null)break;lt=await St(lt,Rt),ut++}while(ut<wt)}return lt};et.options.persister?et.fetchFn=()=>{var vt,Et;return(Et=(vt=et.options).persister)==null?void 0:Et.call(vt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const nt=et.length-1;return et.length>0?tt.getNextPageParam(et[nt],et,rt[nt],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var nt;return et.length>0?(nt=tt.getPreviousPageParam)==null?void 0:nt.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var Hn,zo,Uo,Ql,Zl,Ho,Jl,eu,em,QueryClient=(em=class{constructor(tt={}){Nr(this,Hn);Nr(this,zo);Nr(this,Uo);Nr(this,Ql);Nr(this,Zl);Nr(this,Ho);Nr(this,Jl);Nr(this,eu);Rr(this,Hn,tt.queryCache||new QueryCache),Rr(this,zo,tt.mutationCache||new MutationCache),Rr(this,Uo,tt.defaultOptions||{}),Rr(this,Ql,new Map),Rr(this,Zl,new Map),Rr(this,Ho,0)}mount(){R1(this,Ho)._++,Kt(this,Ho)===1&&(Rr(this,Jl,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,Hn).onFocus())})),Rr(this,eu,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,Hn).onOnline())})))}unmount(){var tt,et;R1(this,Ho)._--,Kt(this,Ho)===0&&((tt=Kt(this,Jl))==null||tt.call(this),Rr(this,Jl,void 0),(et=Kt(this,eu))==null||et.call(this),Rr(this,eu,void 0))}isFetching(tt){return Kt(this,Hn).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,zo).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,Hn).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,Hn).build(this,et),nt=rt.state.data;return nt===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(nt))}getQueriesData(tt){return Kt(this,Hn).findAll(tt).map(({queryKey:et,state:rt})=>{const nt=rt.data;return[et,nt]})}setQueryData(tt,et,rt){const nt=this.defaultQueryOptions({queryKey:tt}),st=Kt(this,Hn).get(nt.queryHash),ot=st==null?void 0:st.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,Hn).build(this,nt).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,Hn).findAll(tt).map(({queryKey:nt})=>[nt,this.setQueryData(nt,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,Hn).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,Hn);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,Hn),nt={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(st=>{st.reset()}),this.refetchQueries(nt,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},nt=notifyManager.batch(()=>Kt(this,Hn).findAll(tt).map(st=>st.cancel(rt)));return Promise.all(nt).then(noop$2).catch(noop$2)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,Hn).findAll(tt).forEach(nt=>{nt.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},nt=notifyManager.batch(()=>Kt(this,Hn).findAll(tt).filter(st=>!st.isDisabled()).map(st=>{let ot=st.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$2)),st.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(nt).then(noop$2)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,Hn).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$2).catch(noop$2)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$2).catch(noop$2)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,zo).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,Hn)}getMutationCache(){return Kt(this,zo)}getDefaultOptions(){return Kt(this,Uo)}setDefaultOptions(tt){Rr(this,Uo,tt)}setQueryDefaults(tt,et){Kt(this,Ql).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,Ql).values()],rt={};return et.forEach(nt=>{partialMatchKey(tt,nt.queryKey)&&Object.assign(rt,nt.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,Zl).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,Zl).values()];let rt={};return et.forEach(nt=>{partialMatchKey(tt,nt.mutationKey)&&(rt={...rt,...nt.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Uo).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Uo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,Hn).clear(),Kt(this,zo).clear()}},Hn=new WeakMap,zo=new WeakMap,Uo=new WeakMap,Ql=new WeakMap,Zl=new WeakMap,Ho=new WeakMap,Jl=new WeakMap,eu=new WeakMap,em),Ss,Wr,Ou,xs,wl,tu,Vo,go,$u,ru,nu,Sl,_l,Go,su,Qr,Ru,X0,Y0,K0,Q0,Z0,J0,_h,sm,tm,QueryObserver=(tm=class extends Subscribable{constructor(et,rt){super();Nr(this,Qr);Nr(this,Ss);Nr(this,Wr);Nr(this,Ou);Nr(this,xs);Nr(this,wl);Nr(this,tu);Nr(this,Vo);Nr(this,go);Nr(this,$u);Nr(this,ru);Nr(this,nu);Nr(this,Sl);Nr(this,_l);Nr(this,Go);Nr(this,su,new Set);this.options=rt,Rr(this,Ss,et),Rr(this,go,null),Rr(this,Vo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Vo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Wr).addObserver(this),shouldFetchOnMount(Kt(this,Wr),this.options)?zr(this,Qr,Ru).call(this):this.updateResult(),zr(this,Qr,Q0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Wr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Wr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,zr(this,Qr,Z0).call(this),zr(this,Qr,J0).call(this),Kt(this,Wr).removeObserver(this)}setOptions(et,rt){const nt=this.options,st=Kt(this,Wr);if(this.options=Kt(this,Ss).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Wr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");zr(this,Qr,_h).call(this),Kt(this,Wr).setOptions(this.options),nt._defaulted&&!shallowEqualObjects(this.options,nt)&&Kt(this,Ss).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Wr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Wr),st,this.options,nt)&&zr(this,Qr,Ru).call(this),this.updateResult(rt),ot&&(Kt(this,Wr)!==st||resolveEnabled(this.options.enabled,Kt(this,Wr))!==resolveEnabled(nt.enabled,Kt(this,Wr))||resolveStaleTime(this.options.staleTime,Kt(this,Wr))!==resolveStaleTime(nt.staleTime,Kt(this,Wr)))&&zr(this,Qr,X0).call(this);const at=zr(this,Qr,Y0).call(this);ot&&(Kt(this,Wr)!==st||resolveEnabled(this.options.enabled,Kt(this,Wr))!==resolveEnabled(nt.enabled,Kt(this,Wr))||at!==Kt(this,Go))&&zr(this,Qr,K0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Ss).getQueryCache().build(Kt(this,Ss),et),nt=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,nt)&&(Rr(this,xs,nt),Rr(this,tu,this.options),Rr(this,wl,Kt(this,Wr).state)),nt}getCurrentResult(){return Kt(this,xs)}trackResult(et,rt){const nt={};return Object.keys(et).forEach(st=>{Object.defineProperty(nt,st,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(st),rt==null||rt(st),et[st])})}),nt}trackProp(et){Kt(this,su).add(et)}getCurrentQuery(){return Kt(this,Wr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Ss).defaultQueryOptions(et),nt=Kt(this,Ss).getQueryCache().build(Kt(this,Ss),rt);return nt.fetch().then(()=>this.createResult(nt,rt))}fetch(et){return zr(this,Qr,Ru).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,xs)))}createResult(et,rt){var jt;const nt=Kt(this,Wr),st=this.options,ot=Kt(this,xs),at=Kt(this,wl),lt=Kt(this,tu),ct=et!==nt?et.state:Kt(this,Ou),{state:dt}=et;let ht={...dt},mt=!1,xt;if(rt._optimisticResults){const Dt=this.hasListeners(),Vt=!Dt&&shouldFetchOnMount(et,rt),Ft=Dt&&shouldFetchOptionally(et,nt,rt,st);(Vt||Ft)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:yt,errorUpdatedAt:vt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,$u))xt=Kt(this,ru);else try{Rr(this,$u,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Rr(this,ru,xt),Rr(this,go,null)}catch(Dt){Rr(this,go,Dt)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Dt;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Dt=ot.data;else if(Dt=typeof rt.placeholderData=="function"?rt.placeholderData((jt=Kt(this,nu))==null?void 0:jt.state.data,Kt(this,nu)):rt.placeholderData,rt.select&&Dt!==void 0)try{Dt=rt.select(Dt),Rr(this,go,null)}catch(Vt){Rr(this,go,Vt)}Dt!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Dt,rt),mt=!0)}Kt(this,go)&&(yt=Kt(this,go),xt=Kt(this,ru),vt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",St=Et==="pending",wt=Et==="error",Rt=St&&bt,Ct=xt!==void 0,It={status:Et,fetchStatus:ht.fetchStatus,isPending:St,isSuccess:Et==="success",isError:wt,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:yt,errorUpdatedAt:vt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!St,isLoadingError:wt&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:mt,isRefetchError:wt&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Vo)};if(this.options.experimental_prefetchInRender){const Dt=Ht=>{It.status==="error"?Ht.reject(It.error):It.data!==void 0&&Ht.resolve(It.data)},Vt=()=>{const Ht=Rr(this,Vo,It.promise=pendingThenable());Dt(Ht)},Ft=Kt(this,Vo);switch(Ft.status){case"pending":et.queryHash===nt.queryHash&&Dt(Ft);break;case"fulfilled":(It.status==="error"||It.data!==Ft.value)&&Vt();break;case"rejected":(It.status!=="error"||It.error!==Ft.reason)&&Vt();break}}return It}updateResult(et){const rt=Kt(this,xs),nt=this.createResult(Kt(this,Wr),this.options);if(Rr(this,wl,Kt(this,Wr).state),Rr(this,tu,this.options),Kt(this,wl).data!==void 0&&Rr(this,nu,Kt(this,Wr)),shallowEqualObjects(nt,rt))return;Rr(this,xs,nt);const st={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,su).size)return!0;const ut=new Set(lt??Kt(this,su));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,xs)).some(ct=>{const dt=ct;return Kt(this,xs)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(st.listeners=!0),zr(this,Qr,sm).call(this,{...st,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&zr(this,Qr,Q0).call(this)}},Ss=new WeakMap,Wr=new WeakMap,Ou=new WeakMap,xs=new WeakMap,wl=new WeakMap,tu=new WeakMap,Vo=new WeakMap,go=new WeakMap,$u=new WeakMap,ru=new WeakMap,nu=new WeakMap,Sl=new WeakMap,_l=new WeakMap,Go=new WeakMap,su=new WeakMap,Qr=new WeakSet,Ru=function(et){zr(this,Qr,_h).call(this);let rt=Kt(this,Wr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$2)),rt},X0=function(){zr(this,Qr,Z0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Wr));if(isServer||Kt(this,xs).isStale||!isValidTimeout(et))return;const nt=timeUntilStale(Kt(this,xs).dataUpdatedAt,et)+1;Rr(this,Sl,setTimeout(()=>{Kt(this,xs).isStale||this.updateResult()},nt))},Y0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Wr)):this.options.refetchInterval)??!1},K0=function(et){zr(this,Qr,J0).call(this),Rr(this,Go,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Wr))===!1||!isValidTimeout(Kt(this,Go))||Kt(this,Go)===0)&&Rr(this,_l,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&zr(this,Qr,Ru).call(this)},Kt(this,Go)))},Q0=function(){zr(this,Qr,X0).call(this),zr(this,Qr,K0).call(this,zr(this,Qr,Y0).call(this))},Z0=function(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Rr(this,Sl,void 0))},J0=function(){Kt(this,_l)&&(clearInterval(Kt(this,_l)),Rr(this,_l,void 0))},_h=function(){const et=Kt(this,Ss).getQueryCache().build(Kt(this,Ss),this.options);if(et===Kt(this,Wr))return;const rt=Kt(this,Wr);Rr(this,Wr,et),Rr(this,Ou,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},sm=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,xs))}),Kt(this,Ss).getQueryCache().notify({query:Kt(this,Wr),type:"observerResultsUpdated"})})},tm);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const nt=typeof rt=="function"?rt(tt):rt;return nt==="always"||nt!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,nt){return(tt!==et||resolveEnabled(nt.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var yt,vt;const{state:rt}=tt,nt=super.createResult(tt,et),{isFetching:st,isRefetching:ot,isError:at,isRefetchError:lt}=nt,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=st&&ut==="forward",ht=at&&ut==="backward",mt=st&&ut==="backward";return{...nt,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:mt,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!mt}}},Wo,qo,_s,Ro,To,T1,e2,rm,MutationObserver$1=(rm=class extends Subscribable{constructor(rt,nt){super();Nr(this,To);Nr(this,Wo);Nr(this,qo);Nr(this,_s);Nr(this,Ro);Rr(this,Wo,rt),this.setOptions(nt),this.bindMethods(),zr(this,To,T1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var st;const nt=this.options;this.options=Kt(this,Wo).defaultMutationOptions(rt),shallowEqualObjects(this.options,nt)||Kt(this,Wo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,_s),observer:this}),nt!=null&&nt.mutationKey&&this.options.mutationKey&&hashKey(nt.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((st=Kt(this,_s))==null?void 0:st.state.status)==="pending"&&Kt(this,_s).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,_s))==null||rt.removeObserver(this)}onMutationUpdate(rt){zr(this,To,T1).call(this),zr(this,To,e2).call(this,rt)}getCurrentResult(){return Kt(this,qo)}reset(){var rt;(rt=Kt(this,_s))==null||rt.removeObserver(this),Rr(this,_s,void 0),zr(this,To,T1).call(this),zr(this,To,e2).call(this)}mutate(rt,nt){var st;return Rr(this,Ro,nt),(st=Kt(this,_s))==null||st.removeObserver(this),Rr(this,_s,Kt(this,Wo).getMutationCache().build(Kt(this,Wo),this.options)),Kt(this,_s).addObserver(this),Kt(this,_s).execute(rt)}},Wo=new WeakMap,qo=new WeakMap,_s=new WeakMap,Ro=new WeakMap,To=new WeakSet,T1=function(){var nt;const rt=((nt=Kt(this,_s))==null?void 0:nt.state)??getDefaultState();Rr(this,qo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},e2=function(rt){notifyManager.batch(()=>{var nt,st,ot,at,lt,ut,ct,dt;if(Kt(this,Ro)&&this.hasListeners()){const ht=Kt(this,qo).variables,mt=Kt(this,qo).context;(rt==null?void 0:rt.type)==="success"?((st=(nt=Kt(this,Ro)).onSuccess)==null||st.call(nt,rt.data,ht,mt),(at=(ot=Kt(this,Ro)).onSettled)==null||at.call(ot,rt.data,null,ht,mt)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Ro)).onError)==null||ut.call(lt,rt.error,ht,mt),(dt=(ct=Kt(this,Ro)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,mt))}this.listeners.forEach(ht=>{ht(Kt(this,qo))})})},rm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop$1(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:nt})=>tt.isError&&!et.isReset()&&!tt.isFetching&&nt&&shouldThrowError(rt,[tt.error,nt]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,mt,xt,yt;const nt=useQueryClient(),st=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=nt.defaultQueryOptions(tt);(ht=(dt=nt.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=st?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!nt.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(nt,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=st?noop$1:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,st]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:nt.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(mt=nt.getDefaultOptions().queries)==null?void 0:mt._experimental_afterQuery)==null||xt.call(mt,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,st)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=nt.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop$1).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[nt]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{nt.setOptions(tt)},[nt,tt]);const st=reactExports.useSyncExternalStore(reactExports.useCallback(at=>nt.subscribe(notifyManager.batchCalls(at)),[nt]),()=>nt.getCurrentResult(),()=>nt.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{nt.mutate(at,lt).catch(noop$1)},[nt]);if(st.error&&shouldThrowError(nt.options.throwOnError,[st.error]))throw st.error;return{...st,mutate:ot,mutateAsync:st.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}function useConf({appCode:tt}){return useQuery({queryKey:["conf"],queryFn:async()=>await odeServices.conf().getConf(tt)})}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,nt]=reactExports.useState(0),[st,ot]=reactExports.useState(""),at={unread:!0,_:new Date().getTime()},lt=async()=>{const ct=tt?"/zimbra/count/INBOX":"/conversation/count/INBOX";try{const{count:dt}=await odeServices.http().get(ct,{queryParams:at});nt(dt??0)}catch(dt){console.error(dt),nt(0)}},ut=async()=>{const ct="/zimbra/zimbra";try{const{preference:dt}=await odeServices.http().get("/userbook/preference/zimbra"),ht=dt?JSON.parse(dt).modeExpert:!1;ot(ht&&et?"/zimbra/preauth":window.location.origin+ct)}catch(dt){console.error(dt),ot(window.location.origin+ct)}};return reactExports.useEffect(()=>{lt()},[]),reactExports.useEffect(()=>{ut()},[]),{messages:rt,msgLink:st,zimbraWorkflow:tt}};var dayjs_min={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){var rt=1e3,nt=6e4,st=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",mt="quarter",xt="year",yt="date",vt="Invalid Date",Et=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,St={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Lt){var Mt=["th","st","nd","rd"],zt=Lt%100;return"["+Lt+(Mt[(zt-20)%10]||Mt[zt]||Mt[0])+"]"}},wt=function(Lt,Mt,zt){var Gt=String(Lt);return!Gt||Gt.length>=Mt?Lt:""+Array(Mt+1-Gt.length).join(zt)+Lt},Rt={s:wt,z:function(Lt){var Mt=-Lt.utcOffset(),zt=Math.abs(Mt),Gt=Math.floor(zt/60),$t=zt%60;return(Mt<=0?"+":"-")+wt(Gt,2,"0")+":"+wt($t,2,"0")},m:function Lt(Mt,zt){if(Mt.date()<zt.date())return-Lt(zt,Mt);var Gt=12*(zt.year()-Mt.year())+(zt.month()-Mt.month()),$t=Mt.clone().add(Gt,ht),Ut=zt-$t<0,Bt=Mt.clone().add(Gt+(Ut?-1:1),ht);return+(-(Gt+(zt-$t)/(Ut?$t-Bt:Bt-$t))||0)},a:function(Lt){return Lt<0?Math.ceil(Lt)||0:Math.floor(Lt)},p:function(Lt){return{M:ht,y:xt,w:dt,d:ct,D:yt,h:ut,m:lt,s:at,ms:ot,Q:mt}[Lt]||String(Lt||"").toLowerCase().replace(/s$/,"")},u:function(Lt){return Lt===void 0}},Ct="en",Pt={};Pt[Ct]=St;var It="$isDayjsObject",jt=function(Lt){return Lt instanceof Ht||!(!Lt||!Lt[It])},Dt=function Lt(Mt,zt,Gt){var $t;if(!Mt)return Ct;if(typeof Mt=="string"){var Ut=Mt.toLowerCase();Pt[Ut]&&($t=Ut),zt&&(Pt[Ut]=zt,$t=Ut);var Bt=Mt.split("-");if(!$t&&Bt.length>1)return Lt(Bt[0])}else{var Yt=Mt.name;Pt[Yt]=Mt,$t=Yt}return!Gt&&$t&&(Ct=$t),$t||!Gt&&Ct},Vt=function(Lt,Mt){if(jt(Lt))return Lt.clone();var zt=typeof Mt=="object"?Mt:{};return zt.date=Lt,zt.args=arguments,new Ht(zt)},Ft=Rt;Ft.l=Dt,Ft.i=jt,Ft.w=function(Lt,Mt){return Vt(Lt,{locale:Mt.$L,utc:Mt.$u,x:Mt.$x,$offset:Mt.$offset})};var Ht=function(){function Lt(zt){this.$L=Dt(zt.locale,null,!0),this.parse(zt),this.$x=this.$x||zt.x||{},this[It]=!0}var Mt=Lt.prototype;return Mt.parse=function(zt){this.$d=function(Gt){var $t=Gt.date,Ut=Gt.utc;if($t===null)return new Date(NaN);if(Ft.u($t))return new Date;if($t instanceof Date)return new Date($t);if(typeof $t=="string"&&!/Z$/i.test($t)){var Bt=$t.match(Et);if(Bt){var Yt=Bt[2]-1||0,Zt=(Bt[7]||"0").substring(0,3);return Ut?new Date(Date.UTC(Bt[1],Yt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Zt)):new Date(Bt[1],Yt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Zt)}}return new Date($t)}(zt),this.init()},Mt.init=function(){var zt=this.$d;this.$y=zt.getFullYear(),this.$M=zt.getMonth(),this.$D=zt.getDate(),this.$W=zt.getDay(),this.$H=zt.getHours(),this.$m=zt.getMinutes(),this.$s=zt.getSeconds(),this.$ms=zt.getMilliseconds()},Mt.$utils=function(){return Ft},Mt.isValid=function(){return this.$d.toString()!==vt},Mt.isSame=function(zt,Gt){var $t=Vt(zt);return this.startOf(Gt)<=$t&&$t<=this.endOf(Gt)},Mt.isAfter=function(zt,Gt){return Vt(zt)<this.startOf(Gt)},Mt.isBefore=function(zt,Gt){return this.endOf(Gt)<Vt(zt)},Mt.$g=function(zt,Gt,$t){return Ft.u(zt)?this[Gt]:this.set($t,zt)},Mt.unix=function(){return Math.floor(this.valueOf()/1e3)},Mt.valueOf=function(){return this.$d.getTime()},Mt.startOf=function(zt,Gt){var $t=this,Ut=!!Ft.u(Gt)||Gt,Bt=Ft.p(zt),Yt=function(Er,br){var hr=Ft.w($t.$u?Date.UTC($t.$y,br,Er):new Date($t.$y,br,Er),$t);return Ut?hr:hr.endOf(ct)},Zt=function(Er,br){return Ft.w($t.toDate()[Er].apply($t.toDate("s"),(Ut?[0,0,0,0]:[23,59,59,999]).slice(br)),$t)},Xt=this.$W,rr=this.$M,cr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Ut?Yt(1,0):Yt(31,11);case ht:return Ut?Yt(1,rr):Yt(0,rr+1);case dt:var mr=this.$locale().weekStart||0,vr=(Xt<mr?Xt+7:Xt)-mr;return Yt(Ut?cr-vr:cr+(6-vr),rr);case ct:case yt:return Zt(ur+"Hours",0);case ut:return Zt(ur+"Minutes",1);case lt:return Zt(ur+"Seconds",2);case at:return Zt(ur+"Milliseconds",3);default:return this.clone()}},Mt.endOf=function(zt){return this.startOf(zt,!1)},Mt.$set=function(zt,Gt){var $t,Ut=Ft.p(zt),Bt="set"+(this.$u?"UTC":""),Yt=($t={},$t[ct]=Bt+"Date",$t[yt]=Bt+"Date",$t[ht]=Bt+"Month",$t[xt]=Bt+"FullYear",$t[ut]=Bt+"Hours",$t[lt]=Bt+"Minutes",$t[at]=Bt+"Seconds",$t[ot]=Bt+"Milliseconds",$t)[Ut],Zt=Ut===ct?this.$D+(Gt-this.$W):Gt;if(Ut===ht||Ut===xt){var Xt=this.clone().set(yt,1);Xt.$d[Yt](Zt),Xt.init(),this.$d=Xt.set(yt,Math.min(this.$D,Xt.daysInMonth())).$d}else Yt&&this.$d[Yt](Zt);return this.init(),this},Mt.set=function(zt,Gt){return this.clone().$set(zt,Gt)},Mt.get=function(zt){return this[Ft.p(zt)]()},Mt.add=function(zt,Gt){var $t,Ut=this;zt=Number(zt);var Bt=Ft.p(Gt),Yt=function(rr){var cr=Vt(Ut);return Ft.w(cr.date(cr.date()+Math.round(rr*zt)),Ut)};if(Bt===ht)return this.set(ht,this.$M+zt);if(Bt===xt)return this.set(xt,this.$y+zt);if(Bt===ct)return Yt(1);if(Bt===dt)return Yt(7);var Zt=($t={},$t[lt]=nt,$t[ut]=st,$t[at]=rt,$t)[Bt]||1,Xt=this.$d.getTime()+zt*Zt;return Ft.w(Xt,this)},Mt.subtract=function(zt,Gt){return this.add(-1*zt,Gt)},Mt.format=function(zt){var Gt=this,$t=this.$locale();if(!this.isValid())return $t.invalidDate||vt;var Ut=zt||"YYYY-MM-DDTHH:mm:ssZ",Bt=Ft.z(this),Yt=this.$H,Zt=this.$m,Xt=this.$M,rr=$t.weekdays,cr=$t.months,ur=$t.meridiem,mr=function(br,hr,Ar,Cr){return br&&(br[hr]||br(Gt,Ut))||Ar[hr].slice(0,Cr)},vr=function(br){return Ft.s(Yt%12||12,br,"0")},Er=ur||function(br,hr,Ar){var Cr=br<12?"AM":"PM";return Ar?Cr.toLowerCase():Cr};return Ut.replace(bt,function(br,hr){return hr||function(Ar){switch(Ar){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Ft.s(Gt.$y,4,"0");case"M":return Xt+1;case"MM":return Ft.s(Xt+1,2,"0");case"MMM":return mr($t.monthsShort,Xt,cr,3);case"MMMM":return mr(cr,Xt);case"D":return Gt.$D;case"DD":return Ft.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr($t.weekdaysMin,Gt.$W,rr,2);case"ddd":return mr($t.weekdaysShort,Gt.$W,rr,3);case"dddd":return rr[Gt.$W];case"H":return String(Yt);case"HH":return Ft.s(Yt,2,"0");case"h":return vr(1);case"hh":return vr(2);case"a":return Er(Yt,Zt,!0);case"A":return Er(Yt,Zt,!1);case"m":return String(Zt);case"mm":return Ft.s(Zt,2,"0");case"s":return String(Gt.$s);case"ss":return Ft.s(Gt.$s,2,"0");case"SSS":return Ft.s(Gt.$ms,3,"0");case"Z":return Bt}return null}(br)||Bt.replace(":","")})},Mt.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Mt.diff=function(zt,Gt,$t){var Ut,Bt=this,Yt=Ft.p(Gt),Zt=Vt(zt),Xt=(Zt.utcOffset()-this.utcOffset())*nt,rr=this-Zt,cr=function(){return Ft.m(Bt,Zt)};switch(Yt){case xt:Ut=cr()/12;break;case ht:Ut=cr();break;case mt:Ut=cr()/3;break;case dt:Ut=(rr-Xt)/6048e5;break;case ct:Ut=(rr-Xt)/864e5;break;case ut:Ut=rr/st;break;case lt:Ut=rr/nt;break;case at:Ut=rr/rt;break;default:Ut=rr}return $t?Ut:Ft.a(Ut)},Mt.daysInMonth=function(){return this.endOf(ht).$D},Mt.$locale=function(){return Pt[this.$L]},Mt.locale=function(zt,Gt){if(!zt)return this.$L;var $t=this.clone(),Ut=Dt(zt,Gt,!0);return Ut&&($t.$L=Ut),$t},Mt.clone=function(){return Ft.w(this.$d,this)},Mt.toDate=function(){return new Date(this.valueOf())},Mt.toJSON=function(){return this.isValid()?this.toISOString():null},Mt.toISOString=function(){return this.$d.toISOString()},Mt.toString=function(){return this.$d.toUTCString()},Lt}(),Nt=Ht.prototype;return Vt.prototype=Nt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",yt]].forEach(function(Lt){Nt[Lt[1]]=function(Mt){return this.$g(Mt,Lt[0],Lt[1])}}),Vt.extend=function(Lt,Mt){return Lt.$i||(Lt(Mt,Ht,Vt),Lt.$i=!0),Vt},Vt.locale=Dt,Vt.isDayjs=jt,Vt.unix=function(Lt){return Vt(1e3*Lt)},Vt.en=Pt[Ct],Vt.Ls=Pt,Vt.p={},Vt})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},nt=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,st=/\d\d/,ot=/\d\d?/,at=/\d*[^-_:/,()\s\d]+/,lt={},ut=function(vt){return(vt=+vt)+(vt>68?1900:2e3)},ct=function(vt){return function(Et){this[vt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(vt){(this.zone||(this.zone={})).offset=function(Et){if(!Et||Et==="Z")return 0;var bt=Et.match(/([+-]|\d\d)/g),St=60*bt[1]+(+bt[2]||0);return St===0?0:bt[0]==="+"?-St:St}(vt)}],ht=function(vt){var Et=lt[vt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},mt=function(vt,Et){var bt,St=lt.meridiem;if(St){for(var wt=1;wt<=24;wt+=1)if(vt.indexOf(St(wt,0,Et))>-1){bt=wt>12;break}}else bt=vt===(Et?"pm":"PM");return bt},xt={A:[at,function(vt){this.afternoon=mt(vt,!1)}],a:[at,function(vt){this.afternoon=mt(vt,!0)}],S:[/\d/,function(vt){this.milliseconds=100*+vt}],SS:[st,function(vt){this.milliseconds=10*+vt}],SSS:[/\d{3}/,function(vt){this.milliseconds=+vt}],s:[ot,ct("seconds")],ss:[ot,ct("seconds")],m:[ot,ct("minutes")],mm:[ot,ct("minutes")],H:[ot,ct("hours")],h:[ot,ct("hours")],HH:[ot,ct("hours")],hh:[ot,ct("hours")],D:[ot,ct("day")],DD:[st,ct("day")],Do:[at,function(vt){var Et=lt.ordinal,bt=vt.match(/\d+/);if(this.day=bt[0],Et)for(var St=1;St<=31;St+=1)Et(St).replace(/\[|\]/g,"")===vt&&(this.day=St)}],M:[ot,ct("month")],MM:[st,ct("month")],MMM:[at,function(vt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(St){return St.slice(0,3)})).indexOf(vt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(vt){var Et=ht("months").indexOf(vt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[st,function(vt){this.year=ut(vt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function yt(vt){var Et,bt;Et=vt,bt=lt&&lt.formats;for(var St=(vt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Dt,Vt,Ft){var Ht=Ft&&Ft.toUpperCase();return Vt||bt[Ft]||rt[Ft]||bt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Nt,Lt,Mt){return Lt||Mt.slice(1)})})).match(nt),wt=St.length,Rt=0;Rt<wt;Rt+=1){var Ct=St[Rt],Pt=xt[Ct],It=Pt&&Pt[0],jt=Pt&&Pt[1];St[Rt]=jt?{regex:It,parser:jt}:Ct.replace(/^\[|\]$/g,"")}return function(Dt){for(var Vt={},Ft=0,Ht=0;Ft<wt;Ft+=1){var Nt=St[Ft];if(typeof Nt=="string")Ht+=Nt.length;else{var Lt=Nt.regex,Mt=Nt.parser,zt=Dt.slice(Ht),Gt=Lt.exec(zt)[0];Mt.call(Vt,Gt),Dt=Dt.replace(Gt,"")}}return function($t){var Ut=$t.afternoon;if(Ut!==void 0){var Bt=$t.hours;Ut?Bt<12&&($t.hours+=12):Bt===12&&($t.hours=0),delete $t.afternoon}}(Vt),Vt}}return function(vt,Et,bt){bt.p.customParseFormat=!0,vt&&vt.parseTwoDigitYear&&(ut=vt.parseTwoDigitYear);var St=Et.prototype,wt=St.parse;St.parse=function(Rt){var Ct=Rt.date,Pt=Rt.utc,It=Rt.args;this.$u=Pt;var jt=It[1];if(typeof jt=="string"){var Dt=It[2]===!0,Vt=It[3]===!0,Ft=Dt||Vt,Ht=It[2];Vt&&(Ht=It[2]),lt=this.$locale(),!Dt&&Ht&&(lt=bt.Ls[Ht]),this.$d=function(zt,Gt,$t){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*zt);var Ut=yt(Gt)(zt),Bt=Ut.year,Yt=Ut.month,Zt=Ut.day,Xt=Ut.hours,rr=Ut.minutes,cr=Ut.seconds,ur=Ut.milliseconds,mr=Ut.zone,vr=new Date,Er=Zt||(Bt||Yt?1:vr.getDate()),br=Bt||vr.getFullYear(),hr=0;Bt&&!Yt||(hr=Yt>0?Yt-1:vr.getMonth());var Ar=Xt||0,Cr=rr||0,Ur=cr||0,Sr=ur||0;return mr?new Date(Date.UTC(br,hr,Er,Ar,Cr,Ur,Sr+60*mr.offset*1e3)):$t?new Date(Date.UTC(br,hr,Er,Ar,Cr,Ur,Sr)):new Date(br,hr,Er,Ar,Cr,Ur,Sr)}catch{return new Date("")}}(Ct,jt,Pt),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$L),Ft&&Ct!=this.format(jt)&&(this.$d=new Date("")),lt={}}else if(jt instanceof Array)for(var Nt=jt.length,Lt=1;Lt<=Nt;Lt+=1){It[1]=jt[Lt-1];var Mt=bt.apply(this,It);if(Mt.isValid()){this.$d=Mt.$d,this.$L=Mt.$L,this.init();break}Lt===Nt&&(this.$d=new Date(""))}else wt.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(nt,st,ot){var at=st.prototype,lt=at.format;ot.en.formats=rt,at.format=function(ut){ut===void 0&&(ut="YYYY-MM-DDTHH:mm:ssZ");var ct=this.$locale().formats,dt=function(ht,mt){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,yt,vt){var Et=vt&&vt.toUpperCase();return yt||mt[vt]||rt[vt]||mt[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(bt,St,wt){return St||wt.slice(1)})})}(ut,ct===void 0?{}:ct);return lt.call(this,dt)}}})})(localizedFormat$1);var localizedFormatExports=localizedFormat$1.exports;const localizedFormat=getDefaultExportFromCjs(localizedFormatExports);var relativeTime$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){return function(rt,nt,st){rt=rt||{};var ot=nt.prototype,at={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function lt(ct,dt,ht,mt){return ot.fromToBase(ct,dt,ht,mt)}st.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,mt,xt){for(var yt,vt,Et,bt=ht.$locale().relativeTime||at,St=rt.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],wt=St.length,Rt=0;Rt<wt;Rt+=1){var Ct=St[Rt];Ct.d&&(yt=mt?st(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var Pt=(rt.rounding||Math.round)(Math.abs(yt));if(Et=yt>0,Pt<=Ct.r||!Ct.r){Pt<=1&&Rt>0&&(Ct=St[Rt-1]);var It=bt[Ct.l];xt&&(Pt=xt(""+Pt)),vt=typeof It=="string"?It.replace("%d",Pt):It(Pt,dt,Ct.l,Et);break}}if(dt)return vt;var jt=Et?bt.future:bt.past;return typeof jt=="function"?jt(vt):jt.replace("%s",vt)},ot.to=function(ct,dt){return lt(ct,dt,this,!0)},ot.from=function(ct,dt){return lt(ct,dt,this)};var ut=function(ct){return ct.$u?st.utc():st()};ot.toNow=function(ct){return this.to(ut(this),ct)},ot.fromNow=function(ct){return this.from(ut(this),ct)}}})})(relativeTime$1);var relativeTimeExports=relativeTime$1.exports;const relativeTime=getDefaultExportFromCjs(relativeTimeExports);var de$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var st=nt(rt),ot={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function at(ut,ct,dt){var ht=ot[dt];return Array.isArray(ht)&&(ht=ht[ct?0:1]),ht.replace("%d",ut)}var lt={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(ut){return ut+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:at,m:at,mm:at,h:at,hh:at,d:at,dd:at,M:at,MM:at,y:at,yy:at}};return st.default.locale(lt,null,!0),lt})})(de$1);var es={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(at){return at+"º"}};return st.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(at){return""+at+(at===1?"er":"")}};return st.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(at){return at+"º"}};return st.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(at){return at+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return st.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),et=reactExports.useCallback((st,ot)=>{if(st.length<11)return dayjs(st,["YYYY-MM-DD"],ot);if(st.split("").findIndex(at=>"0">at||at>"9")<0)return dayjs(Number.parseInt(st)).locale(tt);{let at=dayjs(st).locale(tt);return at.isValid()||(at=dayjs(st,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),at}},[tt]),rt=reactExports.useCallback(st=>{let ot=dayjs();try{return typeof st>"u"?"":(typeof st=="string"?ot=et(st):typeof st=="number"?ot=dayjs(st).locale(tt):typeof st.$date=="number"?ot=dayjs(new Date(st.$date)).locale(tt):typeof st.$date=="string"&&(ot=et(st.$date)),ot.isValid()?ot.fromNow():"")}catch(at){return console.error(at),""}},[tt,et]),nt=reactExports.useCallback((st,ot="short")=>{let at=dayjs();try{if(typeof st>"u")return"";typeof st=="string"?at=et(st):typeof st=="number"?at=dayjs(st).locale(tt):typeof st.$date=="number"?at=dayjs(new Date(st.$date)).locale(tt):typeof st.$date=="string"&&(at=et(st.$date));let lt="";switch(ot){case"short":lt="L";break;case"long":lt="LL";break;case"abbr":lt="ll";break;default:lt=ot}return at.isValid()?at.locale(tt).format(lt):""}catch(lt){return console.error(lt),""}},[tt,et]);return{fromNow:rt,formatDate:nt}}const EdificeThemeContext=reactExports.createContext(null);function useEdificeTheme(){const tt=reactExports.useContext(EdificeThemeContext);if(!tt)throw new Error("Cannot be used outside of EdificeThemeProvider");return tt}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),nt=()=>{et(!0)},st=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",nt),ot.addEventListener("mouseout",st),()=>{ot.removeEventListener("mouseover",nt),ot.removeEventListener("mouseout",st)}},[rt]),[rt,tt]}function useHeader({user:tt,avatar:et}){const{appCode:rt}=useEdificeClient(),{t:nt}=useTranslation(),{theme:st}=useEdificeTheme(),ot=nt(rt),[at,lt]=reactExports.useState(!0),[ut,ct]=useHover(),dt=reactExports.useId(),ht=reactExports.useId(),mt=et,xt=tt==null?void 0:tt.username,yt=nt("welcome",{username:tt==null?void 0:tt.firstName}),vt=useBookmark(),Et=useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"),bt=useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"),St=useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"),wt=reactExports.useCallback(()=>{lt(!at)},[at]),Rt=async()=>{await odeServices.session().logout(),window.location.href=(st==null?void 0:st.logoutCallback)??"/auth/login"};return reactExports.useMemo(()=>({title:ot,bookmarkedApps:vt,appsRef:ut,isAppsHovered:ct,popoverAppsId:dt,popoverSearchId:ht,userAvatar:mt,userName:xt,welcomeUser:yt,communityWorkflow:Et,conversationWorflow:bt,searchWorkflow:St,isCollapsed:at,toggleCollapsedNav:wt,handleLogout:Rt}),[ut,vt,Et,bt,ct,at,dt,ht,St,ot,wt,mt,xt,yt])}let e$1={data:""},t$1=tt=>typeof window=="object"?((tt?tt.querySelector("#_goober"):window._goober)||Object.assign((tt||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:tt||e$1,l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$1=(tt,et)=>{let rt="",nt="",st="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":nt+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?nt+=o$1(at,et?et.replace(/([^,])+/g,lt=>ot.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,lt):lt?lt+" "+ut:ut)):ot):at!=null&&(ot=/^--/.test(ot)?ot:ot.replace(/[A-Z]/g,"-$&").toLowerCase(),st+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&st?et+"{"+st+"}":st)+nt},c$2={},s$1=tt=>{if(typeof tt=="object"){let et="";for(let rt in tt)et+=rt+s$1(tt[rt]);return et}return tt},i$2=(tt,et,rt,nt,st)=>{let ot=s$1(tt),at=c$2[ot]||(c$2[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$2[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,mt=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?mt.shift():dt[3]?(ht=dt[3].replace(n$1," ").trim(),mt.unshift(mt[0][ht]=mt[0][ht]||{})):mt[0][dt[1]]=dt[2].replace(n$1," ").trim();return mt[0]})(tt);c$2[at]=o$1(st?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$2.g?c$2.g:null;return rt&&(c$2.g=c$2[at]),((ut,ct,dt,ht)=>{ht?ct.data=ct.data.replace(ht,ut):ct.data.indexOf(ut)===-1&&(ct.data=dt?ut+ct.data:ct.data+ut)})(c$2[at],et,nt,lt),at},p$1=(tt,et,rt)=>tt.reduce((nt,st,ot)=>{let at=et[ot];if(at&&at.call){let lt=at(rt),ut=lt&&lt.props&&lt.props.className||/^go/.test(lt)&&lt;at=ut?"."+ut:lt&&typeof lt=="object"?lt.props?"":o$1(lt,""):lt===!1?"":lt}return nt+st+(at??"")},"");function u$2(tt){let et=this||{},rt=tt.call?tt(et.p):tt;return i$2(rt.unshift?rt.raw?p$1(rt,[].slice.call(arguments,1),et.p):rt.reduce((nt,st)=>Object.assign(nt,st&&st.call?st(et.p):st),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$2.bind({g:1});let h$2=u$2.bind({k:1});function m$1(tt,et,rt,nt){o$1.p=et,d$1=tt,f$2=rt,g$1=nt}function j$2(tt,et){let rt=this||{};return function(){let nt=arguments;function st(ot,at){let lt=Object.assign({},ot),ut=lt.className||st.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$2.apply(rt,nt)+(ut?" "+ut:"");let ct=tt;return tt[0]&&(ct=lt.as||tt,delete lt.as),g$1&&ct[0]&&g$1(lt),d$1(ct,lt)}return st}}var W$2=tt=>typeof tt=="function",f$1=(tt,et)=>W$2(tt)?tt(et):tt,F$1=(()=>{let tt=0;return()=>(++tt).toString()})(),S$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),J$1=20,U$1=(tt,et)=>{switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,J$1)};case 1:return{...tt,toasts:tt.toasts.map(ot=>ot.id===et.toast.id?{...ot,...et.toast}:ot)};case 2:let{toast:rt}=et;return U$1(tt,{type:tt.toasts.find(ot=>ot.id===rt.id)?1:0,toast:rt});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(ot=>ot.id===nt||nt===void 0?{...ot,dismissed:!0,visible:!1}:ot)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(ot=>ot.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let st=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(ot=>({...ot,pauseDuration:ot.pauseDuration+st}))}}},A$1=[],P$1={toasts:[],pausedAt:void 0},u$1=tt=>{P$1=U$1(P$1,tt),A$1.forEach(et=>{et(P$1)})},Q$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},D$1=(tt={})=>{let[et,rt]=reactExports.useState(P$1);reactExports.useEffect(()=>(A$1.push(rt),()=>{let st=A$1.indexOf(rt);st>-1&&A$1.splice(st,1)}),[et]);let nt=et.toasts.map(st=>{var ot,at,lt;return{...tt,...tt[st.type],...st,removeDelay:st.removeDelay||((ot=tt[st.type])==null?void 0:ot.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:st.duration||((at=tt[st.type])==null?void 0:at.duration)||(tt==null?void 0:tt.duration)||Q$1[st.type],style:{...tt.style,...(lt=tt[st.type])==null?void 0:lt.style,...st.style}}});return{...et,toasts:nt}},Y$1=(tt,et="blank",rt)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:et,ariaProps:{role:"status","aria-live":"polite"},message:tt,pauseDuration:0,...rt,id:(rt==null?void 0:rt.id)||F$1()}),h$1=tt=>(et,rt)=>{let nt=Y$1(et,tt,rt);return u$1({type:2,toast:nt}),nt.id},c$1=(tt,et)=>h$1("blank")(tt,et);c$1.error=h$1("error");c$1.success=h$1("success");c$1.loading=h$1("loading");c$1.custom=h$1("custom");c$1.dismiss=tt=>{u$1({type:3,toastId:tt})};c$1.remove=tt=>u$1({type:4,toastId:tt});c$1.promise=(tt,et,rt)=>{let nt=c$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(st=>{let ot=et.success?f$1(et.success,st):void 0;return ot?c$1.success(ot,{id:nt,...rt,...rt==null?void 0:rt.success}):c$1.dismiss(nt),st}).catch(st=>{let ot=et.error?f$1(et.error,st):void 0;ot?c$1.error(ot,{id:nt,...rt,...rt==null?void 0:rt.error}):c$1.dismiss(nt)}),tt};var q$1=(tt,et)=>{u$1({type:1,toast:{id:tt,height:et}})},G$1=()=>{u$1({type:5,time:Date.now()})},x$1=new Map,K$2=1e3,Z$1=(tt,et=K$2)=>{if(x$1.has(tt))return;let rt=setTimeout(()=>{x$1.delete(tt),u$1({type:4,toastId:tt})},et);x$1.set(tt,rt)},O$1=tt=>{let{toasts:et,pausedAt:rt}=D$1(tt);reactExports.useEffect(()=>{if(rt)return;let ot=Date.now(),at=et.map(lt=>{if(lt.duration===1/0)return;let ut=(lt.duration||0)+lt.pauseDuration-(ot-lt.createdAt);if(ut<0){lt.visible&&c$1.dismiss(lt.id);return}return setTimeout(()=>c$1.dismiss(lt.id),ut)});return()=>{at.forEach(lt=>lt&&clearTimeout(lt))}},[et,rt]);let nt=reactExports.useCallback(()=>{rt&&u$1({type:6,time:Date.now()})},[rt]),st=reactExports.useCallback((ot,at)=>{let{reverseOrder:lt=!1,gutter:ut=8,defaultPosition:ct}=at||{},dt=et.filter(xt=>(xt.position||ct)===(ot.position||ct)&&xt.height),ht=dt.findIndex(xt=>xt.id===ot.id),mt=dt.filter((xt,yt)=>yt<ht&&xt.visible).length;return dt.filter(xt=>xt.visible).slice(...lt?[mt+1]:[0,mt]).reduce((xt,yt)=>xt+(yt.height||0)+ut,0)},[et]);return reactExports.useEffect(()=>{et.forEach(ot=>{if(ot.dismissed)Z$1(ot.id,ot.removeDelay);else{let at=x$1.get(ot.id);at&&(clearTimeout(at),x$1.delete(ot.id))}})},[et]),{toasts:et,handlers:{updateHeight:q$1,startPause:G$1,endPause:nt,calculateOffset:st}}},te$1=h$2`
50
+ `+ot):nt.stack=ot}catch{}}throw nt}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:nt,paramsSerializer:st,headers:ot}=rt;nt!==void 0&&validator.assertOptions(nt,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),st!=null&&(utils$4.isFunction(st)?rt.paramsSerializer={serialize:st}:validator.assertOptions(st,{encode:validators.function,serialize:validators.function},!0)),validator.assertOptions(rt,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),rt.method=(rt.method||this.defaults.method||"get").toLowerCase();let at=ot&&utils$4.merge(ot.common,ot[rt.method]);ot&&utils$4.forEach(["delete","get","head","post","put","patch","common"],yt=>{delete ot[yt]}),rt.headers=AxiosHeaders.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(vt){typeof vt.runWhen=="function"&&vt.runWhen(rt)===!1||(ut=ut&&vt.synchronous,lt.unshift(vt.fulfilled,vt.rejected))});const ct=[];this.interceptors.response.forEach(function(vt){ct.push(vt.fulfilled,vt.rejected)});let dt,ht=0,mt;if(!ut){const yt=[dispatchRequest.bind(this),void 0];for(yt.unshift.apply(yt,lt),yt.push.apply(yt,ct),mt=yt.length,dt=Promise.resolve(rt);ht<mt;)dt=dt.then(yt[ht++],yt[ht++]);return dt}mt=lt.length;let xt=rt;for(ht=0;ht<mt;){const yt=lt[ht++],vt=lt[ht++];try{xt=yt(xt)}catch(Et){vt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(yt){return Promise.reject(yt)}for(ht=0,mt=ct.length;ht<mt;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url);return buildURL(rt,et.params,et.paramsSerializer)}}utils$4.forEach(["delete","get","head","options"],function(et){Axios.prototype[et]=function(rt,nt){return this.request(mergeConfig$1(nt||{},{method:et,url:rt,data:(nt||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(nt){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:nt?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios.prototype[et]=rt(),Axios.prototype[et+"Form"]=rt(!0)});class CancelToken{constructor(et){if(typeof et!="function")throw new TypeError("executor must be a function.");let rt;this.promise=new Promise(function(ot){rt=ot});const nt=this;this.promise.then(st=>{if(!nt._listeners)return;let ot=nt._listeners.length;for(;ot-- >0;)nt._listeners[ot](st);nt._listeners=null}),this.promise.then=st=>{let ot;const at=new Promise(lt=>{nt.subscribe(lt),ot=lt}).then(st);return at.cancel=function(){nt.unsubscribe(ot)},at},et(function(ot,at,lt){nt.reason||(nt.reason=new CanceledError(ot,at,lt),rt(nt.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(et){if(this.reason){et(this.reason);return}this._listeners?this._listeners.push(et):this._listeners=[et]}unsubscribe(et){if(!this._listeners)return;const rt=this._listeners.indexOf(et);rt!==-1&&this._listeners.splice(rt,1)}toAbortSignal(){const et=new AbortController,rt=nt=>{et.abort(nt)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new CancelToken(function(st){et=st}),cancel:et}}}function spread(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([tt,et])=>{HttpStatusCode[et]=tt});function createInstance(tt){const et=new Axios(tt),rt=bind$3(Axios.prototype.request,et);return utils$4.extend(rt,Axios.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(st){return createInstance(mergeConfig$1(tt,st))},rt}const axios=createInstance(defaults$5);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;function m$2(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$3=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,nt=et,st=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(nt))+" "+st[ot]};let s$3=class{static isLocalURL(et){return et.length>0&&et.charAt(0)==="/"}static startWithHttp(et){return/^https?:\/\//gi.test(et)}static toCounter(et){return et>999?`${Number(et/1e3).toFixed(1)} k`:""+et}static generateVirtualId(){return"xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}};const s$2=(tt,et)=>{const rt="virtualID";if(!Object.hasOwnProperty.apply(tt,[rt])){const nt=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:nt,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,nt,st){return nt>st&&(et=Math.round(et*st/nt),nt=st),et>rt&&(nt=Math.round(nt*rt/et),et=rt),{height:et,width:nt}}static renameFileNameExtension(et,rt){const nt=et.split(".");return nt.pop(),nt.join(".")+"."+rt}static resizeImage(et,rt,nt,st,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const mt=this.changeDimension(ht,st,dt,nt);dt=mt.width,ht=mt.height;const xt=ut.getContext("2d");return xt&&(ut.width=dt,ut.height=ht,xt.fillStyle="white",xt.fillRect(0,0,ut.width,ut.height),xt.imageSmoothingEnabled&&xt.imageSmoothingQuality&&(xt.imageSmoothingQuality="high"),xt.drawImage(et,0,0,dt,ht)),new Promise((yt,vt)=>{ut.toBlob(Et=>{Et?yt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):vt()},ct,lt)})}static async resizeImageFile(et,rt=1440,nt=1440,st=80){if(!et)throw Error("Image resizer: file not found!");if(!et.type||!et.type.startsWith("image/"))throw Error("Image resizer: the file given is not an image.");const ot="jpeg";return new Promise(at=>{const lt=new Image;lt.setAttribute("style","max-width: none;"),lt.src=URL.createObjectURL(et),lt.onload=async()=>{const ut=await this.resizeImage(lt,this.renameFileNameExtension(et.name,ot),rt,nt,ot,st);at(ut)},lt.onerror=ut=>{throw Error("Image Loading Error: "+ut)}})}};const e$3={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};var p$2=Object.defineProperty,d$2=(tt,et,rt)=>et in tt?p$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$3=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$4=class{constructor(){n$3(this,"wordExtensions",new Set),n$3(this,"excelExtensions",new Set),n$3(this,"pptExtensions",new Set),n$3(this,"fileExtensionMap",new Map),n$3(this,"csvContentType",new Set),n$3(this,"csvExtensions",new Set),n$3(this,"txtExtensions",new Set),n$3(this,"mdExtensions",new Set),n$3(this,"PDF","application/pdf"),n$3(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.mdExtensions.add("md"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.fileExtensionMap.set("md","text/markdown"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){return this.fileExtensionMap.has(et)?this.fileExtensionMap.get(et)??null:null}getExtensionForContentType(et){for(const rt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(rt)||"").toLowerCase()==(et||"").toLowerCase())return rt;return null}isWordLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.wordExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.excelExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.excelExtensions.has(rt):!1}isCsvLike(et,rt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&rt?this.csvExtensions.has(rt):!1}isPowerpointLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.pptExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.txtExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const nt=this.getExtensionForContentType(et);return nt?this.mdExtensions.has(nt):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$3(o$4,"INSTANCE",new o$4);let a$2=o$4;const n$2=tt=>{if(tt>0){let et=Math.floor(tt/1e3),rt=Math.floor(et/60);return et=et%60,rt=rt%60,e$2(rt)+":"+e$2(et)}return"00:00"},e$2=tt=>tt.toString().padStart(2,"0"),o$3=()=>MediaRecorder.isTypeSupported?["video/webm;codecs=vp9",'video/mp4; codecs="avc1.424028, mp4a.40.2"',"video/webm;codecs=vp8,opus","video/webm"].find(tt=>MediaRecorder.isTypeSupported(tt)?!0:(console.error(`${tt} is not Supported`),!1))||"video/ogg":"video/webm;codecs=vp8,opus";var v$2=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,o$2=(tt,et,rt)=>T$1(tt,typeof et!="symbol"?et+"":et,rt);const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP$1={ADMIN:"admin",ARCHIVE:"archive",AUTH:"auth",CAS:"cas",COMMUNICATION:"communication",CONVERSATION:"conversation",DIRECTORY:"directory",USERBOOK:"userbook",INFRA:"infra",PORTAL:"portal",TIMELINE:"timeline",WORKSPACE:"workspace",EXPLORER:"explorer",VIDEO:"video",MINDMAP:"mindmap",SCRAPBOOK:"scrapbook",COLLABORATIVEWALL:"collaborativewall",WIKI:"wiki"};class Subscription{constructor(et,rt){o$2(this,"revoke"),this._channel=et,this.revoke=this.setReceiver(nt=>rt==null?void 0:rt(nt.data))}setReceiver(et){var rt;return(rt=this._channel)==null||rt.addEventListener("message",et),()=>{this._channel&&(this._channel.removeEventListener("message",et),this._channel.close(),delete this._channel)}}}class Subject{constructor(){o$2(this,"publishChannels",new Map)}getChannelName(et){return"Subject:"+et}getPublishChannel(et){const rt=this.getChannelName(et);let nt=this.publishChannels.get(rt);return nt||(nt=this.newChannel(et),this.publishChannels.set(rt,nt)),nt}newChannel(et){const rt=this.getChannelName(et),nt=new BroadcastChannel(rt);return nt.addEventListener("messageerror",st=>console.log(st.data)),nt}publish(et,rt){typeof et=="string"&&this.getPublishChannel(et).postMessage(rt)}subscribe(et,rt){if(typeof et=="string"){const nt=this.newChannel(et);return new Subscription(nt,rt)}else return new Subscription}}const ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady",APPCONF_READY:"appConfReady"};class Promisified{constructor(){o$2(this,"_resolution"),o$2(this,"_rejection"),o$2(this,"_promise",new Promise((et,rt)=>{this._resolution=et,this._rejection=rt}))}get promise(){return this._promise}resolve(et){this._resolution&&this._resolution(et)}reject(et){this._rejection&&this._rejection(et)}}class NotifyFramework{constructor(){o$2(this,"promises",{}),o$2(this,"subject",new Subject)}asyncData(et){return typeof this.promises[et]>"u"&&(this.promises[et]=new Promisified),this.promises[et]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}onAppConfReady(){return this.asyncData(ASYNC_DATA_NAME.APPCONF_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework,loadedScripts$1={};class Http{constructor(et){o$2(this,"axios"),o$2(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);return et.headers&&(rt.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams)),rt}else return this.axios.defaults}toCdnUrl(et){const rt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((rt==null?void 0:rt.length)>0&&et!=="/conf/public"){const nt=""+et;(nt.startsWith("/infra/public")||nt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(nt))&&(et=rt+nt)}return et}mapAxiosError(et,rt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!rt||rt.disableNotifications,this._latestResponse}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}get(et,rt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}post(et,rt,nt){return this.axios.post(et,rt,this.toAxiosConfig(nt)).then(st=>this.mapAxiosResponse(st,nt)).catch(st=>this.mapAxiosError(st,nt))}postFile(et,rt,nt){const st=this.toAxiosConfig(nt);return st.headers&&st.headers["Content-Type"]&&delete st.headers["Content-Type"],this.axios.post(et,rt,st).then(ot=>this.mapAxiosResponse(ot,nt)).catch(ot=>this.mapAxiosError(ot,nt))}postJson(et,rt,nt){const st=this.toAxiosConfig();return st.headers&&(st.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(nt)).then(ot=>this.mapAxiosResponse(ot,nt)).catch(ot=>this.mapAxiosError(ot,nt))}put(et,rt,nt){return this.axios.put(et,rt,this.toAxiosConfig(nt)).then(st=>this.mapAxiosResponse(st,nt)).catch(st=>this.mapAxiosError(st,nt))}putJson(et,rt,nt){const st=this.toAxiosConfig(nt);return st.headers&&(st.headers["Content-Type"]="application/json"),this.axios.put(et,rt,st).then(ot=>this.mapAxiosResponse(ot,nt)).catch(ot=>this.mapAxiosError(ot,nt))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(nt=>this.mapAxiosResponse(nt)).catch(nt=>this.mapAxiosError(nt))}getScript(et,rt,nt){const st=nt??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${st.split(".")[0]}={};${at};return ${st};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,rt).then(nt=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){o$2(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const http$2=transport.http;class Session{constructor(){o$2(this,"_me",null),o$2(this,"_currentLanguage",""),o$2(this,"_notLoggedIn",!0),o$2(this,"_description"),o$2(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.isResponseError()||typeof et=="string")throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var rt;return et===void 0||((rt=this._me)==null?void 0:rt.authorizedActions.findIndex(nt=>nt.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const nt=rt.right||rt,st=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[nt]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return st&&ot}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){o$2(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,nt,st){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof nt<"u"&&ot.append("rememberMe",""+nt),typeof st<"u"&&ot.append("secureLocation",""+st),transport.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){o$2(this,"_conf"),o$2(this,"_loaded"),o$2(this,"skinName",""),o$2(this,"themeName",""),o$2(this,"skin","raw"),o$2(this,"themeUrl","/assets/themes/raw/default/"),o$2(this,"templateOverrides",{}),o$2(this,"portalTemplate","/assets/themes/raw/portal.html"),o$2(this,"basePath",""),o$2(this,"logoutCallback","/"),o$2(this,"skins",[]),o$2(this,"is1D",!1),o$2(this,"is2D",!1),o$2(this,"_onSkinReady",notify.onSkinReady()),o$2(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var rt,nt;const st=await this.listSkins();this.is1D=((rt=st.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((nt=st.find(ot=>ot.child===this.skin))==null?void 0:nt.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,nt)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(st=>{this.skin=st.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${st.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${st.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(ot=>{this.templateOverrides=ot,this._onOverrideReady.resolve(ot),rt()}).catch(ot=>{if(transport.http.latestResponse.status===404)rt();else throw ot})}).catch(st=>{this._onSkinReady.reject(st),this._onOverrideReady.reject(st),nt()})})}loadConnected(et){return new Promise((rt,nt)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(st=>{this.templateOverrides=st,this._onOverrideReady.resolve(st),rt()}).catch(st=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(st),this._onOverrideReady.reject(st);else throw st})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(rt=>{this.skinName=rt.skinName,this.themeName=rt.themeName,this.themeUrl=rt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=rt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const rt=et.overriding.find(nt=>nt.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(nt=>nt.group===rt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){const et=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et==null?void 0:et.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,rt){et=et??"";let nt=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(let st in rt)typeof rt[st]<"u"&&(nt=nt.replace(new RegExp("\\${"+st+"}","g"),""+rt[st]));return nt}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,rt){this.loadBundle(session.session.currentLanguage,et,rt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises$1[rt]}loadBundle(et,rt,nt){const st=promises$1[rt];if(st)nt&&st.then(nt).catch(nt);else{const ot=new Promisified;promises$1[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),transport.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle$1,lt),typeof nt=="function"&&nt(),ot.resolve()}).catch(lt=>{typeof nt=="function"&&nt(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(nt=>{this.loadBundle(nt,et+"/"+nt+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(nt=>this.loadBundlePromise(rt,nt+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}removeAccents(et){for(var rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class UserPreferences{constructor(){o$2(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(nt=>{try{return JSON.parse(nt.preference)}catch{return rt??{}}}).then(nt=>(this.data[et]=nt??{},nt))}update(et,rt){return rt!==void 0&&(this.data[et]=rt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){o$2(this,"_me",null),o$2(this,"_keepOpenOnLogout",!1),o$2(this,"_preferences",new UserPreferences),o$2(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(rt=>{rt&&this.setCurrentModel(rt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const rt=JSON.parse(et.preference);let nt;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,nt={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",nt);return}else nt=rt;nt||(nt={bookmarks:[],applications:[]});let st=!0;const ot=[];nt.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){let ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),st=!1}),ot.forEach(at=>{let lt=nt.bookmarks.indexOf(at);lt!==-1&&nt.bookmarks.splice(lt,1)}),st||transport.http.putJson("/userbook/preference/apps",nt)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){o$2(this,"_publicConf",{}),o$2(this,"_currentApp"),o$2(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,rt=!1){rt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(nt=>{if(nt!=null&&nt.prefix){const st=nt.prefix.replace("/","");this._appConf[st]=nt}else nt!=null&&nt.name&&nt.name.toLowerCase()==et&&(rt=nt)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){o$2(this,"_status","void"),o$2(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,rt){return this.initialize().promise.then(nt=>!rt||nt.type===et||nt.type==="multiple"?nt[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var rt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(rt=this._params)==null||rt.resolve(et[0]),this._status="ready"}).catch(et=>{var rt;throw this._status="failed",(rt=this._params)==null||rt.reject(),et})),this._params}async initializeXiti(et){if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,nt=session.session.description;let st;for(let ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){st=dt;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:nt.profiles&&nt.profiles.length>0?ut[nt.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){o$2(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),o$2(this,"School",{}),o$2(this,"User",new User)}async initialize(et,rt){if(!et){const st=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${st(lt)}${st(ut)}`}const nt=et;this.Platform.deploymentTag=et,typeof rt=="string"&&rt.length>0&&(this.Platform.cdnDomain=rt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(nt),notify.onSessionReady().promise.then(st=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(nt)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var _$2;(_$2=session==null?void 0:session.session)==null||_$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",EXPLORER:"explorer",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",SEARCH_RESULTED:"searchResulted",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},nt){this.set(`${et}:main`,nt),this.set(`${et}:${rt}`,nt)}findService(et,rt){return this.lookupService(et,rt)}findMainService({application:et},rt){return this.lookupService({application:et,resourceType:"main"},rt)}isRegistered({application:et,resourceType:rt}){return this.get(`${et}:${rt}`)!==void 0}lookupService({application:et,resourceType:rt},nt){const st=this.get(`${et}:${rt}`);if(st===void 0)throw`Service not found: ${et}:${rt}`;return st(nt)}}const f$3=class{constructor(et){o$2(this,"checkHttpResponse",rt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return rt}),this.context=et}get http(){return this.context.http()}async copy(et){const rt=await this.http.post("/archive/duplicate",{application:et.application,resourceId:et.resourceId});return this.checkHttpResponse(rt)}async publish(et){const rt=new FormData;return rt.append("title",et.title),rt.append("cover",et.cover),rt.append("coverName",et.cover.name),rt.append("coverType",et.cover.type),rt.append("teacherAvatar",et.teacherAvatar),rt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),rt.append("teacherAvatarType",et.teacherAvatar.type),rt.append("language",et.language),et.activityType.forEach(nt=>{rt.append("activityType[]",nt)}),et.subjectArea.forEach(nt=>{rt.append("subjectArea[]",nt)}),et.age.forEach(nt=>{rt.append("age[]",nt.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(nt=>{rt.append("keyWords[]",nt.trim())}),rt.append("licence",et.licence),rt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),rt.append("application",et.application?et.application:""),rt.append("resourceId",et.resourceId),rt.append("teacherSchool",et.userStructureName),await this.http.post("/appregistry/library/resource",rt,{headers:{"Content-Type":"multipart/form-data"}})}async createContext(et){const rt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchContext(et){const rt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchResource(et){const rt=await this.http.get(`/explorer/resources/${et.id}`,{queryParams:this.getResourceParams(et)});return this.checkHttpResponse(rt)}async createFolder(et){const rt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async updateFolder(et){const rt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async moveToFolder(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const nt=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(nt)}async listSubfolders(et){const rt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(rt)}async deleteAll(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const nt=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(nt)}async trashAll({resourceType:et,...rt},nt=!1){rt.resourceIds=nt?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const st=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(st)}async restoreAll({resourceType:et,...rt},nt=!1){rt.resourceIds=nt?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const st=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(st)}async mapAssetIdToIds({application:et,assetIds:rt}){const nt=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(st=>{const ot=nt.resources.find(at=>at.assetId===st);if(ot===void 0)throw"explorer.assetid.notfound";return ot.id})}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const rt=await fetch(et).then(nt=>nt.blob());return`/workspace/document/${(await this.context.workspace().saveFile(rt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){const rt={application:et.application,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,trashed:et.trashed};if(et.types.length>0&&(rt.resource_type=et.types[0]),et.orders&&Object.entries(et.orders).length){const[[nt,st]]=Object.entries(et.orders);rt.order_by=`${nt}:${st}`}return et.filters&&Object.assign(rt,et.filters),typeof et.search=="string"&&(rt.search=et.search),typeof et.asset_id<"u"&&(rt.asset_id=[...et.asset_id]),typeof et.id<"u"&&(rt.id=et.id),rt}getResourceParams(et){return{application:et.application}}createFolderToBodyParams(et){return{application:et.application,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};o$2(f$3,"registry",new ServiceRegistry),o$2(f$3,"register",f$3.registry.register.bind(f$3.registry)),o$2(f$3,"findService",f$3.registry.findService.bind(f$3.registry)),o$2(f$3,"findMainService",f$3.registry.findMainService.bind(f$3.registry)),o$2(f$3,"isRegistered",f$3.registry.isRegistered.bind(f$3.registry));let ResourceService=f$3;const APP$2="scrapbook",RESOURCE$1="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),nt=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(nt),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$2}getFormUrl(et){return et?`/scrapbook?folderid=${et}#/create-scrapbook/`:"/scrapbook#/create-scrapbook/"}getViewUrl(et){return`/scrapbook#/view-scrapbook/${et}`}getPrintUrl(et){return`/scrapbook/print#/print-scrapbook/${et}`}getEditUrl(et){return`/scrapbook#/edit-scrapbook/${et}`}getExportUrl(et){return`/scrapbook/exportHtml/${et}`}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new ScrapbookResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,nt){if(mutexPromise[et]&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const st=rt();mutexPromise[et]=st;const ot=await st;return nt(ot)&&(globalCache[et]=ot),ot}catch(st){throw console.error(`Failed to retrieve value for: ${et}`,st),st}}clearCache(et){if(et)delete globalCache[et];else for(const rt in globalCache)globalCache.hasOwnProperty(rt)&&delete globalCache[rt]}async httpGet(et,rt){return this.fromCacheIfPossible(et,async()=>{const nt=await this.http.get(et,rt),st={...this.http.latestResponse};return{value:nt,response:st}},({response:nt})=>!(nt.status<200||nt.status>=300))}async httpGetJson(et,rt){const{response:nt,value:st}=await this.httpGet(et,rt);if(nt.status<200||nt.status>=300)throw`Bad http status (${nt.status}) for url: ${et}`;return st}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get cdnDomain(){return configure.Platform.cdnDomain}get notify(){return this.context.notify()}async getConf(et){const[rt,nt]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[st,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:nt===void 0}),this.getWebAppConf({app:et,applications:nt??[]})]),at={app:et,applications:nt??[],conf:rt,currentApp:ot,theme:st};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:nt}=await this.cache.httpGet(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.APP_NOT_FOUND;return nt}getCdnUrl(){}async savePreference(et,rt){this.http.putJson(`/userbook/preference/${et}`,rt)}async getPreference(et){const rt=await this.http.get(`/userbook/preference/${et}`);return this.http.isResponseError()||typeof rt=="string"?{}:JSON.parse(rt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getApplicationsList(){const et=await this.http.get("/applications-list");if(!(this.http.isResponseError()||typeof et=="string"))return et.apps}async getWebAppConf({app:et,applications:rt}){return rt.find(nt=>{if(nt!=null&&nt.prefix)return(nt==null?void 0:nt.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:nt}){const{value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}}),ot=nt?null:st,at=rt==null?void 0:rt.overriding.find(mt=>ot===null||mt.child===ot.themeName),lt=(ot==null?void 0:ot.skinName)||at.skins[0],ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at.child}/skins/${lt}/`,ct=at.skins,dt=at.bootstrapVersion.split("-").slice(-1)[0],ht=at.parent==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"/",skin:at.child,skinName:lt,skins:ct,themeName:at.child,themeUrl:ut,npmTheme:at.npmTheme??void 0}}async getLogoutCallback(et){const{response:rt,value:nt}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return nt.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,nt="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${nt}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,rt){return rt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:rt})=>({id:et,displayName:rt,members:[]}))}async getBookMarkById(et){const{groups:rt,id:nt,name:st,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:nt,displayName:st,groups:rt.map(({name:at,id:lt})=>({displayName:at,id:lt})),users:ot.map(({displayName:at,id:lt,profile:ut})=>({profile:ut,displayName:at,firstName:"",lastName:"",login:"",id:lt}))}}async saveBookmarks(et,{bookmarks:rt,groups:nt,users:st}){this.cache.clearCache("/directory/sharebookmark/all");const ot=st.map(ht=>typeof ht=="string"?ht:ht.id),at=nt.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:mt,groups:xt,id:yt,users:vt}=await this.getBookMarkById(ht),Et=vt.map(St=>St.id),bt=xt.map(St=>St.id);return{displayName:mt,id:yt,members:[...bt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,mt)=>[...ht,...mt],[]),ct={name:et,members:[...ot,...at,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",ct);return{id:dt,displayName:et,members:ct.members}}}const loadedScripts={};class HttpService{constructor(et,rt){o$2(this,"axios"),o$2(this,"baseUrl"),o$2(this,"headers",{}),o$2(this,"_latestResponse"),this.context=et,this.axios=axios.create(rt)}fixBaseUrl(et){return et.startsWith("http://")||et.startsWith("https://")?et:this.baseUrl?this.baseUrl.endsWith("/")||et.startsWith("/")?`${this.baseUrl}${et}`:`${this.baseUrl}/${et}`:et}useBaseUrl(et){return this.baseUrl=et,this}useHeaders(et){return this.headers=et,this}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);et.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams));const nt=rt.headers??{};return rt.headers={...nt,...this.headers},rt}else return this.axios.defaults}toCdnUrl(et){et=this.fixBaseUrl(et);const rt=this.context.conf().getCdnUrl()||"";if(rt.length>0&&et!=="/conf/public"){const nt=""+et;(nt.startsWith("/infra/public")||nt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(nt))&&(et=rt+nt)}return et}mapAxiosError(et,rt){et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN};const{status:nt,statusText:st,headers:ot,data:at}=this._latestResponse;return rt!=null&&rt.disableNotifications||notify.events().publish(LAYER_NAME.TRANSPORT,{name:EVENT_NAME.ERROR_OCCURED,data:{params:rt,response:{status:nt,statusText:st,headers:ot},payload:at}}),at}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}async get(et,rt){try{const nt=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){throw this.mapAxiosError(nt,rt)}}async post(et,rt,nt){try{const st=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(nt));return this.mapAxiosResponse(st,nt)}catch(st){throw this.mapAxiosError(st,nt)}}async postFile(et,rt,nt){const st=this.toAxiosConfig(nt);st.headers&&st.headers["Content-Type"]&&delete st.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...st,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,nt)}catch(ot){throw this.mapAxiosError(ot,nt)}}async postJson(et,rt,nt){const st=this.toAxiosConfig();st.headers&&(st.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(nt));return this.mapAxiosResponse(ot,nt)}catch(ot){throw this.mapAxiosError(ot,nt)}}async put(et,rt,nt){try{const st=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(nt));return this.mapAxiosResponse(st,nt)}catch(st){throw this.mapAxiosError(st,nt)}}async putFile(et,rt,nt){try{const st=this.toAxiosConfig(nt);st.headers&&st.headers["Content-Type"]&&delete st.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...st,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,nt)}catch(st){throw this.mapAxiosError(st,nt)}}async putJson(et,rt,nt){const st=this.toAxiosConfig(nt);st.headers&&(st.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,st);return this.mapAxiosResponse(ot,nt)}catch(ot){throw this.mapAxiosError(ot,nt)}}async delete(et,rt){try{const nt=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){throw this.mapAxiosError(nt,rt)}}async deleteJson(et,rt){try{const nt=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(nt)}catch(nt){throw this.mapAxiosError(nt)}}getScript(et,rt,nt){const st=nt??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${st.split(".")[0]}={};${at};return ${st};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts[et]?Promise.resolve():this.getScript(et,rt).then(nt=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const rt=et.split(":");if(rt.length===2){if(rt[0]==="creator")return{id:rt[1],right:"creator",type:"creator"}}else return rt.length===3?{id:rt[1],right:rt[2],type:rt[0]}:void 0}parseResourceRights(et){return et.map(rt=>this.parseResourceRight(rt)).filter(rt=>rt!==void 0)}hasResourceRight({id:et,groupIds:rt},nt,st){const ot=st.map(at=>typeof at=="string"?this.parseResourceRight(at):at).filter(at=>at!==void 0);for(const at of ot)if(at.id===et&&at.type==="creator"||at.id===et&&at.type==="user"&&at.right===nt||rt.includes(at.id)&&at.type==="group"&&at.right===nt)return!0;return!1}async sessionHasResourceRight(et,rt){try{const nt=await this.session.getUser();return!!nt&&this.hasResourceRight({groupIds:nt.groupsIds,id:nt.userId},et,rt)}catch(nt){return console.error(`Unexpected error ${nt} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const nt of et)if(await this.sessionHasResourceRight(nt,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let nt=0;for(const st of rt)await this.sessionHasResourceRight(et,st)&&nt++;return nt===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const nt of et){let st=0;for(const ot of rt)await this.sessionHasResourceRight(nt,ot)&&st++;if(st===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(nt=>nt===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(nt=>nt.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const nt=await this.session.getUser();for(const st of et)rt[st]=!!nt&&this.hasWorkflowRight(st,nt.authorizedActions.map(ot=>ot.name))}catch(nt){console.error(`Unexpected error ${nt} in sessionHasWorkflowRights()`);for(const st of et)rt[st]=!1}return rt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get conf(){return this.context.conf()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[rt,nt,st,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:nt,currentLanguage:rt,userDescription:st,userProfile:ot,bookmarkedApps:at}}login(et,rt,nt,st){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof nt<"u"&&ot.append("rememberMe",""+nt),typeof st<"u"&&ot.append("secureLocation",""+st),this.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}async logout(){const et=await this.conf.getLogoutCallback();return this.http.get("/auth/logout?callback="+et).finally(()=>{})}async latestQuotaAndUsage(et){const rt={quota:0,storage:0};if(!et)return rt;try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(nt){return console.error(nt),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let nt;return rt?nt=await this.loadUserLanguage():nt=await this.loadDefaultLanguage(),nt}catch(nt){console.error(nt)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:rt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(!(et.status<200||et.status>=300)&&typeof rt=="object")return rt;throw ERROR_CODE.NOT_LOGGED_IN}hasWorkflow({workflowName:et,user:rt}){return et===void 0||(rt==null?void 0:rt.authorizedActions.findIndex(nt=>nt.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,nt]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...nt,profiles:rt}}catch(rt){return console.error(rt),{}}}async getBookmarks(et){if(!et)return[];const rt=await this.http.get("/userbook/preference/apps");rt.preference||(rt.preference=null);const nt=JSON.parse(rt.preference);let st;st=nt,st||(st={bookmarks:[],applications:[]});const ot=[];return st.bookmarks.forEach((at,lt)=>{const ut=((et==null?void 0:et.apps)||[]).find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);ot.push(ct)}}),ot}async getUserProfile(et={}){var rt,nt;const{options:st={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,st);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((nt=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:nt.type)||["Guest"]}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}async getWebApp(et){const rt=await this.getUser();return rt==null?void 0:rt.apps.find(nt=>{var st;return nt!=null&&nt.prefix?(nt==null?void 0:nt.prefix.replace("/",""))===et||!1:nt!=null&&nt.address&&((st=nt.address)==null?void 0:st.split("/")[1])===et||!1})}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,rt,nt){const st=StringUtils.removeAccents(nt).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${nt}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const mt=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),yt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ht||"").toLowerCase();return yt.includes(st)||xt.includes(st)||mt.includes(st)||vt.includes(st)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),lt=ot.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(st)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group",structureName:ut.structureName}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(st)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...at,...lt]}async getShareMapping(et){const rt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const nt of Object.keys(rt))if(nt.includes(".")){const st=nt.split(".")[1],ot=rt[nt];delete rt[nt],rt[st]=ot}return rt}getActionsAvailableFor({id:et,type:rt},nt,st){const ot=(rt==="user"?nt.users.checked[et]:nt.groups.checked[et])||[],at=Object.keys(st),lt=[];for(const ut of at)st[ut].filter(ct=>ot.includes(ct)).length>0&&lt.push(ut);return lt}async getRightsForResource(et,rt){const nt=await this.directory.getBookMarks(),st=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(st),at=await this.getShareMapping(et),lt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(ot.users.checked).map(xt=>ot.users.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"user"},ot,at);return{id:xt.id,type:"user",displayName:xt.username,profile:xt.profile,avatarUrl:this.directory.getAvatarUrl(xt.id,"user"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"user"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"group"},ot,at);return{id:xt.id,type:"group",displayName:xt.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(xt.id,"group"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"group"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:yt,name:vt})=>({displayName:xt||vt,id:yt})),mt=ot.users.visibles.map(({id:xt,profile:yt,username:vt,firstName:Et,lastName:bt,login:St})=>({displayName:vt,firstName:Et,lastName:bt,login:St,profile:yt,id:xt}));return{rights:dt,visibleBookmarks:nt,visibleGroups:ht,visibleUsers:mt}}async saveRights(et,rt,nt){const st=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of nt){const ut=lt.actions.map(dt=>st[dt.id]).reduce((dt,ht)=>Array.isArray(ht)?[...dt,...ht]:dt,[]),ct=[...new Set(ut)];ct.length>0&&(lt.type==="user"?ot.users[lt.id]=ct:lt.type==="group"?ot.groups[lt.id]=ct:ot.bookmarks[lt.id]=ct)}const at=`/${et}/share/resource/${rt}`;return this.cache.clearCache(`/${et}/share/json/${rt}?search=`),await this.http.putJson(at,ot)}async getActionsForApp(et){const rt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),nt=await this.getShareMapping(et);return Object.keys(rt).map(st=>{const ot=rt[st];return{displayName:st,id:st,priority:ot.priority,requires:ot.requires}}).filter(st=>{var ot;return((ot=nt[st.id])==null?void 0:ot.length)>0}).sort((st,ot)=>st.priority-ot.priority)}}const defaultMappers={csv:function({type:tt,extension:et}){return a$2.INSTANCE.isCsvLike(tt,et)},doc:function({type:tt,extension:et}){return a$2.INSTANCE.isWordLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("wordprocessing")!==-1},xls:function({type:tt,extension:et}){return a$2.INSTANCE.isExcelLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("spreadsheet")!==-1||tt.indexOf("ms-excel")!==-1},img:function({type:tt}){return tt.indexOf("image")!==-1},pdf:function({type:tt}){return tt.indexOf("pdf")!==-1||tt==="application/x-download"},ppt:function({type:tt,extension:et}){return a$2.INSTANCE.isPowerpointLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("presentation")!==-1||tt.indexOf("powerpoint")!==-1},txt:function({type:tt,extension:et}){return a$2.INSTANCE.isTxtLike(tt,et)},md:function({type:tt,extension:et}){return a$2.INSTANCE.isMdLike(tt,et)},video:function({type:tt}){return tt.indexOf("video")!==-1},audio:function({type:tt}){return tt.indexOf("audio")!==-1},zip:function({type:tt}){return tt.indexOf("zip")!==-1||tt.indexOf("rar")!==-1||tt.indexOf("tar")!==-1||tt.indexOf("7z")!==-1}},w$1=class nm{static getRole(et){var rt,nt;return nm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(nt=et.metadata)==null?void 0:nt.extension)}static role(et,rt=!1,nt){if(nt&&(nt=nt.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const st={type:et,previewRole:rt,extension:nt};for(const ot of this.roleMappers){const at=ot(st);if(at)return at}return"unknown"}};o$2(w$1,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=w$1;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",nt=rt.split("."),st=et.type||"application/octet-stream",ot=nt.length>1?nt[nt.length-1]:"",at={"content-type":st,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(st,!1,ot)},lt=rt.replace("."+at.extension,""),ut=at.extension?lt+"."+at.extension:lt;return{basename:lt,fullname:ut,metadata:at}}async saveFile(et,rt){const{fullname:nt,metadata:st}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,nt);const at=[];((rt==null?void 0:rt.visibility)==="public"||(rt==null?void 0:rt.visibility)==="protected")&&at.push(`${rt.visibility}=true`),rt!=null&&rt.application&&at.push(`application=${rt.application}`),st.role==="img"&&at.push("quality=1"),rt!=null&&rt.parentId&&at.push(`parentId=${rt.parentId}`);const lt=await this.http.postFile(`/workspace/document?${at.join("&")}`,ot);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return lt}async updateFile(et,rt,nt){const{fullname:st,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,st);const lt=[];ot.role==="img"&&lt.push("quality=1"),nt!=null&&nt.alt&&lt.push(`alt=${nt.alt}`),nt!=null&&nt.legend&&lt.push(`legend=${nt.legend}`),nt!=null&&nt.name&&lt.push(`name=${nt.name}`);const ut=await this.http.putFile(`/workspace/document/${et}?${lt.join("&")}`,at);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return ut}async deleteFile(et){const rt=et.map(nt=>nt._id);if(rt.length==0)Promise.resolve(null);else if(await this.http.deleteJson("/workspace/documents",{ids:rt}),this.http.isResponseError())throw this.http.latestResponse.statusText}async acceptDocuments(et){const rt=await this.context.session().getUser();return nt=>nt.deleted&&nt.trasher?(rt==null?void 0:rt.userId)==nt.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],nt=await this.acceptDocuments(et);return rt.filter(nt)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,nt="protected"){const st=[];if(et.forEach(ot=>{(nt==="public"&&!ot.public||!ot.public&&!ot.protected)&&st.push(ot)}),st.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:nt,ids:st.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return st.forEach((at,lt)=>{const ut=et.findIndex(ct=>ct._id===at._id);0<=ut&&ut<et.length&&(et[ut]=ot[lt])}),et.filter(at=>!!at)}return et}getThumbnailUrl(et,rt=0,nt=0){var st,ot;const at=rt>0||nt>0?`${rt}x${nt}`:"120x120";if(typeof et=="string")return et.includes("data:image")||et.includes("thumbnail")?et:`${et}${et.includes("?")?"&":"?"}thumbnail=${at}`;{const lt=`/workspace/${et.public?"pub/":""}document/${et._id}?thumbnail=`,ut=et.thumbnails;if((ot=(st=et.metadata)==null?void 0:st["content-type"])!=null&&ot.includes("video")){const ct=ut&&Object.keys(ut).length>0?Object.keys(ut)[0]:null;return ct?lt+ct:null}else return lt+at}}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,rt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${rt}/i18n`)])}translate(et,rt){et=et??"";let nt=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(let st in rt)typeof rt[st]<"u"&&(nt=nt.replace(new RegExp("\\${"+st+"}","g"),""+rt[st]));return nt}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,nt){this.loadBundle(et,rt,nt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,nt){const st=promises[rt];if(st)nt&&st.then(nt).catch(nt);else{const ot=new Promisified;promises[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),this.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle,lt),typeof nt=="function"&&nt(),ot.resolve()}).catch(lt=>{typeof nt=="function"&&nt(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(nt=>{this.loadBundle(nt,et+"/"+nt+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(nt=>this.loadBundlePromise(rt,nt+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(var rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}let ATTag;class AnalyticsService{constructor(tt){this.context=tt}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(tt,et){const[rt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!rt||!ATInternet)return;let nt=rt.LIBELLE_SERVICE.default||null;for(const st in rt.LIBELLE_SERVICE)if(st!=="default"&&tt.indexOf(st)>=0){nt=rt.LIBELLE_SERVICE[st];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:nt,TYPE:rt.TYPE,OUTIL:rt.OUTIL,UAI:rt.STRUCT_UAI,PROJET:rt.PROJET,EXPLOITANT:rt.EXPLOITANT,PLATEFORME:rt.PLATFORME,PROFIL:rt.PROFILE},!0),ATTag.identifiedVisitor.set({id:rt.ID_PERSO,category:rt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:rt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(tt){const[et,rt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return rt!=null&&rt.active&&(et.xiti=await this.getXitiTrackingParams(rt,tt)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(tt,et){if(!tt.structureMap||!et)return;const rt=await this.session.getUser(),nt=await this.session.getUserProfile();let st;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){st=dt;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:nt&&nt.length>0?ut[nt[0]]??"":""}}}const C$2=class q0{constructor(et){this.context=et}get http(){return this.context.http()}get conf(){return this.context.conf()}async getVideoConf(){var et;const rt=await this.conf.getPublicConf(APP$1.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??q0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??q0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(nt=>nt.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:nt,duration:st}){if(!et.file)throw new Error("Invalid video file.");if(!et.filename)throw new Error("Invalid video filename");const ot=`${et.browser.name} ${et.browser.version}`,at=new FormData;at.append("device",et.device||""),at.append("browser",ot),at.append("url",et.url),at.append("app",rt),at.append("file",et.file,et.filename),at.append("weight",""+et.file.size),at.append("captation",""+nt);let lt=`/video/encode?captation=${nt}`;st&&(lt+=`&duration=${st}`);const ut=await this.http.post(lt,at,{headers:{"Content-Type":"multipart/form-data"}});if(ut.state=="running"){let ct=0,dt=1;do{const ht=dt+ct;await new Promise(xt=>setTimeout(xt,ht*1e3)),ct=dt,dt=Math.min(8,ht);const mt=await this.http.get(`/video/status/${ut.processid}`);if(mt.state=="succeed")return mt.videoworkspaceid&&mt.videosize&&this.context.data().trackVideoSave(mt.videoworkspaceid,Math.round(st),mt.videosize,nt,et.url,ot,et.device),mt;if(mt.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};o$2(C$2,"MAX_WEIGHT",50),o$2(C$2,"MAX_DURATION",3);let VideoService=C$2;class EmbedderService{constructor(et){this.context=et}get http(){return this.context.http()}async getDefault(){return this.http.get("/infra/embed/default")}async getCustom(){return this.http.get("/infra/embed/custom")}getProviderFromUrl(et,rt){for(const nt of et)if(this.isUrlFromProvider(rt,nt))return nt}urlIsFromPattern(et,rt){const nt=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),st=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(nt)||[],lt=[];return(rt.match(st)||[]).forEach((ut,ct)=>{ut.includes("ignore")||lt.push(at[ct])}),lt.forEach(ut=>{if(!et.includes(ut)){ot=!1;return}}),ot}isUrlFromProvider(et,rt){typeof rt.url=="string"&&(rt.url=[rt.url]);for(const nt of rt.url)if(this.urlIsFromPattern(et,nt))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const nt of et.url)if(this.urlIsFromPattern(rt,nt)){const st=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=nt.match(st)||[];let at=et.embed;for(const lt of ot){let ut=nt.split(lt)[0];const ct=ut.split("}");ct.length>1&&(ut=ct[ct.length-1]);let dt=rt.split(ut)[1];if(!dt)continue;const ht=nt.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const mt=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(mt,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){o$2(this,"_cache"),this.context=et,this._cache=new CacheService(this.context)}getApplication(){return this.APP}getResourceType(){return this.RESOURCE}httpGet(et,rt){return this._cache.httpGetJson(et,rt)}dataToResource({modified:et,...rt}){const nt=typeof et=="string"?et:et!=null&&et.$date?""+et.$date:"";return{application:this.RESOURCE,name:rt.title,creatorId:rt.owner,creatorName:rt.ownerName,thumbnail:rt.icon,assetId:rt._id,modifiedAt:nt,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","actualites"),o$2(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{var rt;return et.thread_icon?rt=et.thread_icon+"?thumbnail=48x48":rt="/img/icons/glyphicons_036_file.png",this.dataToResource({title:et.title+" ["+et.thread_title+"]",ownerName:et.username,owner:et.owner,icon:rt,path:"/actualites#/view/thread/"+et.thread_id+"/info/"+et._id,_id:`${et.thread_id}#${et._id}`,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class BlogBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","blog"),o$2(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const nt=await this.httpGet("/blog/linker"),st=[];nt.forEach(ot=>{ot.thumbnail?ot.thumbnail=ot.thumbnail+"?thumbnail=48x48":ot.thumbnail="/img/illustrations/blog.svg";const at=ot.fetchPosts.map(lt=>this.dataToResource({owner:ot.author.userId,ownerName:ot.author.username,title:lt.title+" ["+ot.title+"]",_id:`${ot._id}#${lt._id}`,icon:ot.thumbnail,path:`/blog/id/${ot._id}/post/${lt._id}`,shared:!!(ot.shared&&ot.shared.length>=0),modified:ot.modified}));st.push(...at)}),et(st)}catch(nt){rt(nt)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","collaborativewall"),o$2(this,"RESOURCE","collaborativewall")}async loadResources(){return(await this.httpGet("/collaborativewall/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.icon?et.icon:"/img/illustrations/collaborative-wall-default.png",path:"/collaborativewall#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class CommunityBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","community"),o$2(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{var rt;return typeof et.thumbnail>"u"||et.thumbnail===""?rt="/img/icons/glyphicons_036_file.png":rt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:et.name,icon:rt,path:"/community#/view/"+et.id,_id:et.id,owner:"",ownerName:"",shared:!!(et.shared&&et.shared.length>=0),modified:et.name})})}}class ExercizerBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","exercizer"),o$2(this,"RESOURCE","exercizer")}async loadResources(){return(await this.httpGet("/exercizer/subjects-scheduled")).map(et=>{const rt=et.picture?et.picture+"?thumbnail=48x48":"/img/illustrations/exercizer.svg";let nt,st=!1,ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(st=!0,nt=ot.groupList[0].name):ot.userList.length>0?(st=!0,nt=ot.userList[0].name):nt="",ot.groupList.length+ot.userList.length>1&&(nt+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:nt,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:st,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","formulaire"),o$2(this,"RESOURCE","formulaire")}async loadResources(){return(await this.httpGet("/formulaire/forms/linker")).map(et=>(et.picture||(et.picture="/formulaire/public/img/logo.svg"),this.dataToResource({_id:""+et.id,icon:et.picture,title:et.title,ownerName:et.owner_name,owner:et.owner_id,path:et.is_public?`${window.location.origin}/formulaire-public#/form/${et.public_key}`:`${window.location.origin}/formulaire#/form/${et.id}/${et.rgpd?"rgpd":"new"}`,shared:!!(et.shared&&et.shared.length>=0),modified:""+et.date_modification})))}}class ForumBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","forum"),o$2(this,"RESOURCE","forum")}async loadResources(){return(await this.httpGet("/forum/categories")).map(et=>this.dataToResource({_id:et._id,title:et.name,icon:et.icon||"/img/illustrations/forum.svg",path:"/forum#/view/"+et._id,ownerName:et.owner.displayName,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class HomeworksBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","homeworks"),o$2(this,"RESOURCE","homeworks")}async loadResources(){return(await this.httpGet("/homeworks/list")).filter(et=>et.owner&&et.trashed===0).map(et=>this.dataToResource({title:et.title,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/homeworks.svg",path:"/homeworks#/view-homeworks/"+et._id,_id:""+et._id,shared:typeof et.shared<"u",modified:et.modified}))}}class MagnetoBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","magneto"),o$2(this,"RESOURCE","magneto")}async loadResources(){const{all:et}=await this.httpGet("/magneto/boards/editable");return et.map(rt=>this.dataToResource({_id:rt._id,title:rt.title,icon:rt.imageUrl,owner:rt.ownerId,ownerName:rt.ownerName,path:`/magneto#/board/${rt._id}/view`,shared:!!(rt.shared&&rt.shared.length>=0),modified:""+rt.modificationDate}))}}class MindmapBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","mindmap"),o$2(this,"RESOURCE","mindmap")}async loadResources(){return(await this.httpGet("/mindmap/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/mindmap-default.png",path:"/mindmap#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class PagesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","pages"),o$2(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(nt=>{var st;const ot=nt.thumbnail?nt.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:nt.title,owner:nt.owner.userId,ownerName:nt.owner.displayName,icon:ot,path:"/pages#/website/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})),(st=nt.pages)==null||st.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:nt.owner.userId,ownerName:nt.owner.displayName,icon:ot,path:"/pages#/website/"+nt._id+"/"+at.titleLink,_id:nt._id+"/"+at.titleLink,shared:typeof nt.shared<"u",modified:nt.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","poll"),o$2(this,"RESOURCE","poll")}async loadResources(){return(await this.httpGet("/poll/list/all")).map(et=>{const rt=et.icon?et.icon+"?thumbnail=48x48":"/img/icons/glyphicons_036_file.png";return this.dataToResource({title:et.question,ownerName:et.owner.displayName,icon:rt,path:"/poll#/view/"+et._id,_id:et._id,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class ScrapbookBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","scrapbook"),o$2(this,"RESOURCE","scrapbook")}async loadResources(){return(await this.httpGet("/scrapbook/list/all")).map(et=>{const rt=et.icon||"/img/illustrations/scrapbook.svg";return this.dataToResource({title:et.name,owner:et.owner.userId,ownerName:et.owner.displayName,icon:rt,path:"/scrapbook#/view-scrapbook/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class TimelinegeneratorBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","timelinegenerator"),o$2(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const nt=(await this.httpGet("/timelinegenerator/timelines")).map(st=>{const ot=st.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:st.headline,ownerName:st.owner.displayName,owner:st.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})});et(nt)}catch(nt){rt(nt)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","wiki"),o$2(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let nt;return typeof et.thumbnail>"u"||et.thumbnail===""?nt="/img/icons/glyphicons_036_file.png":nt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:nt,path:"/wiki#/view/"+et._id+"/"+rt._id,_id:`${et._id}#${rt._id}`,shared:typeof et.shared<"u",modified:rt.modified})})).flat()}}class WorkspaceBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),o$2(this,"APP","workspace"),o$2(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(nt,st)=>{try{let ot="/workspace/documents?filter=all&hierarchical=true";rt&&rt.length?ot+=`&search=${et}`:et&&et.length&&(ot+=`&search=${et}`);const at=(await this.httpGet(ot)).filter(lt=>!lt.deleted).map(lt=>{const ut=lt.metadata["content-type"]&&lt.metadata["content-type"].indexOf("image")!==-1?`/workspace/document/${lt._id}?thumbnail=120x120`:"/img/icons/unknown-large.png";return this.dataToResource({title:lt.name,ownerName:lt.ownerName,owner:lt.owner,icon:ut,path:`/workspace/document/${lt._id}`,_id:lt._id,shared:!!(lt.shared&&lt.shared.length>=0),modified:lt.modified})});nt(at)}catch(ot){st(ot)}})}}const y$1=class{static async initialize(et,rt){const nt=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[st,ot]=await Promise.all([nt.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&st!=null&&st.length&&(this.resourceProducingApps=st.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(st){console.warn("Failed to load resource-producing apps:",st)}}return this.resourceProducingApps}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const nt={application:et,resourceType:rt};this.registry.register(nt,st=>this.serviceFor(st,et,rt))})}static serviceFor(et,rt,nt){let st;switch(nt){case"timelinegenerator":st=new TimelinegeneratorBehaviour(et);break;case"workspace":st=new WorkspaceBehaviour(et);break;case"blog":st=new BlogBehaviour(et);break;case"actualites":st=new ActualitesBehaviour(et);break;case"wiki":st=new WikiBehaviour(et);break;case"pages":st=new PagesBehaviour(et);break;case"poll":st=new PollBehaviour(et);break;case"community":st=new CommunityBehaviour(et);break;case"mindmap":st=new MindmapBehaviour(et);break;case"forum":st=new ForumBehaviour(et);break;case"homeworks":st=new HomeworksBehaviour(et);break;case"scrapbook":st=new ScrapbookBehaviour(et);break;case"collaborativewall":st=new CollaborativewallBehaviour(et);break;case"exercizer":st=new ExercizerBehaviour(et);break;case"formulaire":st=new FormulaireBehaviour(et);break;case"magneto":st=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return st.APP=rt,st}};o$2(y$1,"registry",new ServiceRegistry),o$2(y$1,"findBehaviour",y$1.registry.findService.bind(y$1.registry)),o$2(y$1,"hasBehaviour",y$1.registry.isRegistered.bind(y$1.registry)),o$2(y$1,"resourceProducingApps",[]);let SnipletsService=y$1;const SEND_ALL="*";class WebBroker{constructor(et){o$2(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(nt=>SEND_ALL===nt||et.data["event-type"]===nt)>=0&&this.http.post("/infra/event/web/store",et.data,{disableNotifications:!0})}initialize(et){if(et===void 0||et.send===void 0||et.send.length>0){const rt=(et==null?void 0:et.send)??[SEND_ALL];this.subscription=this.events.subscribe(LAYER_NAME.WEB_DATA,nt=>this.dispatchEvent(nt,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){o$2(this,"_webBroker"),o$2(this,"app"),o$2(this,"user"),o$2(this,"profile"),this.odeServices=et}get conf(){return this.odeServices.conf()}get notify(){return this.odeServices.notify()}async initialize(){try{const{app:et}=await this.notify.onAppConfReady().promise;this.app=et,this.user=await this.odeServices.session().getUser(),this.profile=await this.odeServices.session().getUserProfile();const{["data-service"]:rt}=await this.conf.getPublicConf(et);this._webBroker=new WebBroker(this.odeServices).initialize(rt==null?void 0:rt.web)}catch{console.log("DataService not initialized, usage data unavailable.")}}predestroy(){this._webBroker&&(this._webBroker.destroy(),delete this._webBroker)}trackWebEvent(et){this.notify.events().publish(LAYER_NAME.WEB_DATA,{name:EVENT_NAME.DATA_TRACKED,data:et})}addUserInfos(et){return this.user&&(et.userId=this.user.userId,et.structure=this.user.structureNames[0]),this.profile&&(et.profil=this.profile[0]),et}trackVideoSave(et,rt,nt,st,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:"video",video_id:et,browser:at,duration:Math.round(rt),weight:nt,source:st?"CAPTURED":"UPLOADED",url:ot});this.app&&(ut["override-module"]=this.app),lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,nt,st,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:st,source:rt?"CAPTURED":"UPLOADED",url:nt});this.app&&(at["override-module"]=this.app),ot&&(at.device_type=ot),this.trackWebEvent(at)}trackSpeechAndText(et){const rt=this.addUserInfos({"event-type":"SPEECH_AND_TEXT",function:et});this.app&&(rt.module=this.app),this.trackWebEvent(rt)}trackAccessLibraryFromExplorer(){const et=this.addUserInfos({"event-type":"ACCESS_LIBRARY_FROM_EXPLORER"});this.app&&(et.module=this.app),this.trackWebEvent(et)}}class ReactionsService{constructor(et,rt,nt){this.context=et,this.module=rt,this.resourceType=nt}get http(){return this.context.http()}async loadAvailableReactions(){try{const{"reaction-types":et}=await this.context.conf().getPublicConf("audience");return Array.isArray(et)?et:void 0}catch{console.error("Audience configuration not found");return}}async loadReactionSummaries(et){const rt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt.reactionsByResource}async loadReactionDetails(et,rt,nt){const st=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${nt}`);return this.http.isResponseError()?void 0:st}async deleteReaction(et){await this.http.delete(`/audience/reactions/${this.module}/${this.resourceType}/${et}`)}async updateReaction(et,rt){await this.http.putJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}async createReaction(et,rt){await this.http.postJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}}class ViewsService{constructor(et,rt,nt){this.context=et,this.module=rt,this.resourceType=nt}get http(){return this.context.http()}async getCounters(et){const rt=await this.http.get(`/audience/views/count/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt}async getDetails(et){const rt=await this.http.get(`/audience/views/details/${this.module}/${this.resourceType}/${et}`);return this.http.isResponseError()?void 0:rt}trigger(et){return this.http.post(`/audience/views/${this.module}/${this.resourceType}/${et}`)}}class AudienceService{constructor(et,rt,nt){this.context=et,this.module=rt,this.resourceType=nt}get views(){return new ViewsService(this.context,this.module,this.resourceType)}get reactions(){return new ReactionsService(this.context,this.module,this.resourceType)}}class OdeServices{constructor(){o$2(this,"_analytics"),o$2(this,"_cache"),o$2(this,"_conf"),o$2(this,"_data"),o$2(this,"_directory"),o$2(this,"_http"),o$2(this,"_idiom"),o$2(this,"_notify"),o$2(this,"_rights"),o$2(this,"_session"),o$2(this,"_share"),o$2(this,"_video"),o$2(this,"_workspace"),o$2(this,"_embedder"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._data=new DataService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._notify=NotifyFrameworkFactory.instance(),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._video=new VideoService(this),this._workspace=new WorkspaceService(this),this._embedder=new EmbedderService(this)}initialize(){return this._data.initialize(),this}analytics(){return this._analytics}audience(et,rt){return new AudienceService(this,et,rt)}cache(){return this._cache}conf(){return this._conf}data(){return this._data}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}notify(){return this._notify}resource(et,rt){return rt?ResourceService.findService({application:et,resourceType:rt},this):ResourceService.findMainService({application:et},this)}behaviour(et,rt){return SnipletsService.findBehaviour({application:et,resourceType:rt},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}video(){return this._video}workspace(){return this._workspace}embedder(){return this._embedder}}const ACTION={SEARCH:"search",CREATE:"create",CREATE_PUBLIC:"createPublic",OPEN:"open",EDIT:"edit",MANAGE:"manage",UPD_PROPS:"properties",COMMENT:"comment",DELETE:"delete",TRASH:"trash",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PAGES_LIST:"pages_list",DISTRIBUTE:"distribute",REGISTER:"register",PUBLISH:"publish",PUBLISH_MOODLE:"publish_moodle"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={ASC:"asc",DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(nt=>nt.id===tt&&nt.available);return rt&&rt.length>0},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){o$2(this,"_initialized"),o$2(this,"_widgets",[]),o$2(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(nt=>{var st;nt&&nt.widgets?(nt.widgets.forEach(ot=>{this._widgets.push(new Widget(ot))}),this.loadUserPrefs().then(()=>{var ot;(ot=this._initialized)==null||ot.resolve()}).catch(ot=>{var at;(at=this._initialized)==null||at.reject()})):(st=this._initialized)==null||st.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(rt=>rt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().publish(LAYER_NAME.WIDGETS,{name:EVENT_NAME.USERPREF_CHANGED})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const rt=configure.Platform.theme,nt=[];rt.listSkins().then(st=>{var ot;const at=((ot=st.find(ut=>ut.child===rt.skin))==null?void 0:ot.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,ct)=>{const dt=ut.platformConf.name;return at.indexOf(dt)!==-1?!1:(this._userPrefs[dt]||(this._userPrefs[dt]={index:defaultWidgetOrder[dt]??999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[dt].show=!0,this._userPrefs[dt].index=defaultWidgetOrder[dt]??999),ut.platformConf.i18n&&nt.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[dt]),!0)});const lt=new Idiom;this._widgets=this._widgets.sort((ut,ct)=>{const dt=lt.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ht=lt.translate(`timeline.settings.${ct.platformConf.name}`).toLowerCase();return dt<ht?-1:dt>ht?1:0})})}}class Widget{constructor(et){o$2(this,"_schoolConf",{}),o$2(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){this._userPref=et,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework,SvgIconFolder=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.057 5.5A.057.057 0 0 0 3 5.557v13.03h18V7.875h-8.697a1 1 0 0 1-1-1c0-.759-.615-1.374-1.374-1.374zM1 5.557C1 4.42 1.92 3.5 3.057 3.5h6.872c1.515 0 2.797.999 3.223 2.374H21a2 2 0 0 1 2 2v10.714a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2z",clipRule:"evenodd"})]}),SvgIconRafterDown=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.012 7.871a1.5 1.5 0 0 1 2.117.141L12 14.722l5.871-6.71a1.5 1.5 0 1 1 2.258 1.976l-7 8a1.5 1.5 0 0 1-2.258 0l-7-8a1.5 1.5 0 0 1 .141-2.117",clipRule:"evenodd"})]}),TreeNode=({node:tt,showIcon:et,selectedNodeId:rt,expandedNodes:nt,siblingsNodes:st,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=nt.has(tt.id),dt=st==null?void 0:st.current.has(tt.id),ht=rt===tt.id,mt=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":mt,"py-4":!tt.section}),arrow:clsx({"py-4":!tt.section,"py-8":tt.section,invisible:!Array.isArray(tt.children)||tt.children.length===0}),button:clsx("flex-fill d-flex align-items-center text-truncate gap-8",{"py-8":tt.section})},yt=tt.section?16:12,{t:vt}=useTranslation(),{setNodeRef:Et}=useDroppable({id:reactExports.useId(),data:{id:tt.id,name:tt.name,isTreeview:!0,accepts:["folder","resource"]}}),bt=jt=>at==null?void 0:at(jt),St=jt=>lt==null?void 0:lt(jt),wt=jt=>ut==null?void 0:ut(jt),Rt=jt=>{(jt.code==="Enter"||jt.code==="Space")&&(jt.preventDefault(),jt.stopPropagation(),at==null||at(tt.id))},Ct=jt=>{(jt.code==="Enter"||jt.code==="Space")&&(jt.preventDefault(),jt.stopPropagation(),lt==null||lt(tt.id))},Pt=jt=>jsxRuntimeExports.jsx(jt?SvgIconRafterDown:SvgIconRafterRight,{title:vt("foldUnfold"),width:yt,height:yt}),It=()=>{var jt;const Dt=!((jt=st==null?void 0:st.current)!=null&&jt.has(tt.id)),Vt=Array.isArray(tt.children)&&tt.children.length>0;return dt||Dt&&Vt};return jsxRuntimeExports.jsx("li",{ref:Et,id:`treeitem-${tt.id}`,role:"treeitem","aria-selected":ht&&ht,"aria-expanded":ct&&ct,children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:xt.action,children:[jsxRuntimeExports.jsx("div",{className:xt.arrow,tabIndex:0,role:"button",onClick:()=>St(tt.id),onKeyDown:Ct,"aria-label":vt("foldUnfold"),children:It()&&Pt(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>bt(tt.id),onKeyDown:Rt,children:[tt.section&&et&&jsxRuntimeExports.jsx(SvgIconFolder,{title:vt("folder"),width:20,height:20}),jsxRuntimeExports.jsx("span",{className:"text-truncate",children:tt.name})]}),tt.section&&ut&&jsxRuntimeExports.jsx("button",{className:"tree-btn mx-8",onClick:()=>wt(tt.id),children:jsxRuntimeExports.jsx(SvgIconPlus,{height:16,width:16})})]}),Array.isArray(tt.children)&&!!tt.children.length&&ct&&jsxRuntimeExports.jsx("ul",{role:"group",children:tt.children.map(jt=>jsxRuntimeExports.jsx(TreeNode,{node:jt,selectedNodeId:rt,expandedNodes:nt,siblingsNodes:st,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},jt.id))})]})},tt.id)};var __defProp$1=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp$1(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,__publicField=(tt,et,rt)=>__defNormalProp(tt,typeof et!="symbol"?et+"":et,rt);function findTreeNode(tt,et){if(et(tt))return tt;if(Array.isArray(tt.children))for(const rt of tt.children){const nt=findTreeNode(rt,et);if(nt)return nt}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const nt=findNodeById(rt,et);if(nt)return nt}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const nt=findNodeById(rt,et);if(nt)return nt}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,nt=>{var st;if(nt.id===et){const ot=[...((st=nt.folder)==null?void 0:st.ancestors)||[]],at=arrayUnique([...ot,nt.id]);return{...nt,children:[...nt.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return nt})}function arrayUnique(tt){return tt.filter((et,rt)=>tt.indexOf(et)===rt)}function deleteNode(tt,{folders:et}){return modifyNode(tt,rt=>{if(!et.includes(rt.id))return rt})}const findParentNode=(tt,et)=>{if(tt.children)for(const rt of tt.children){if(rt.id===et)return tt;const nt=findParentNode(rt,et);if(nt)return nt}};function getAncestors(tt,et){var rt;const nt=findNodeById(tt,et);return(rt=nt==null?void 0:nt.folder)!=null&&rt.ancestors?[...(nt==null?void 0:nt.folder.ancestors)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function modifyNode(tt,et){return doModify(tt,et)||tt}function doModify(tt,et,rt){var nt;const st=et(tt,rt);if((nt=st==null?void 0:st.children)!=null&&nt.length){const ot=[];for(const at of(st==null?void 0:st.children)||[]){const lt=doModify(at,et,st);lt&&ot.push(lt)}return{...st,children:ot}}return st}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(nt,st)=>{var ot,at;if(et===nt.id){const lt=[...((ot=nt.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,nt.id]),ct=[...nt.children||[]],dt=((at=nt.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const mt=findNodeById(nt,ht);mt&&ct.push({...mt,folder:{...mt==null?void 0:mt.folder,ancestors:ut}})}return{...nt,children:ct}}else return rt.includes(nt.id)&&et!==(st==null?void 0:st.id)?void 0:nt})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,nt=>(nt.id===rt&&(nt.children=et==null?void 0:et.map(st=>new TreeNodeFolderWrapper(st))),nt));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,nt=>nt.id===et?new TreeNodeFolderWrapper(rt):nt)}function findPathById(tt,et){let rt=[];function nt(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(nt(lt,at.concat(ot.id)))return!0}return!1}function st(ot){if(Array.isArray(ot)){for(const at of ot)if(nt(at,[]))break}else nt(ot,[])}return st(tt),rt}class TreeNodeFolderWrapper{constructor(et){__publicField(this,"id"),__publicField(this,"name"),__publicField(this,"childNumber"),__publicField(this,"section",!1),__publicField(this,"children",[]),this.folder=et,this.id=et.id,this.name=et.name,this.childNumber=et.childNumber}}const useTreeView=({data:tt,ref:et,externalSelectedNodeId:rt,draggedNode:nt,allExpandedNodes:st,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),mt=reactExports.useRef(new Set),[xt,yt]=reactExports.useState(void 0),vt=ut??rt;function Et(Ft){var Ht;Array.isArray(Ft)?Ft.forEach(Nt=>{const Lt=new Set(mt.current);Ft.filter(({id:Mt})=>Mt!==Nt.id).some(Mt=>Mt.children&&Mt.children.length>0)&&Lt.add(Nt.id),Nt.children&&Nt.children.length>0&&Nt.children.forEach(Mt=>{var zt;const Gt=(zt=Nt.children)==null?void 0:zt.filter(({id:$t})=>$t!==Mt.id);Gt!=null&&Gt.some($t=>$t.children&&$t.children.length>0)&&Lt.add(Mt.id),Et(Mt)})}):(Ht=Ft.children)==null||Ht.forEach(Nt=>{var Lt;const Mt=new Set(mt.current),zt=(Lt=Ft.children)==null?void 0:Lt.filter(Gt=>Gt.id!==Nt.id);zt!=null&&zt.some(Gt=>Gt.children&&Gt.children.length>0)&&(Mt.add(Nt.id),mt.current=Mt),Et(Nt)})}const bt=Ft=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Ft&&(tt.forEach(Nt=>{Ht.add(Nt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{nt!=null&&nt.isOver&&nt.isTreeview?(nt.overId&&Vt(nt.overId),yt(nt.overId)):yt(void 0)},[nt]);const St=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Ft){jt(Ft)},allExpandedNodes(){bt(st)}}),[]);reactExports.useImperativeHandle(et,()=>St,[St]),reactExports.useEffect(()=>{bt(st)},[]),reactExports.useEffect(()=>{rt&&!st?(wt(rt),ct(rt)):ct(void 0)},[rt]);const wt=Ft=>{if(!findNodeById(tt,vt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Ft)},Rt=Ft=>{const Ht=new Set(dt),Nt=findPathById(tt,Ft),Lt=Array.from(Ht);Nt.forEach(Mt=>{const zt=Lt.indexOf(Mt);zt>-1&&Lt.splice(zt,1),Lt.push(Mt)}),Ht.clear(),Lt.forEach(Mt=>Ht.add(Mt)),Ht.forEach(Mt=>ot==null?void 0:ot(Mt)),ht(Ht)},Ct=Ft=>{const Ht=new Set(dt);Ht.delete(Ft),Ht.forEach(Nt=>at==null?void 0:at(Nt)),ht(Ht)},Pt=Ft=>{dt.has(Ft)?Ct(Ft):Rt(Ft)},It=Ft=>{vt!==Ft&&ct(Ft)},jt=Ft=>{It(Ft),Rt(Ft),lt==null||lt(Ft)},Dt=Ft=>{Pt(Ft)},Vt=Ft=>{findNodeById(tt,rt)&&Rt(Ft)};return{selectedNodeId:vt,expandedNodes:dt,siblingsNodes:mt,draggedNodeId:xt,handleItemClick:jt,handleFoldUnfold:Dt}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:nt,onTreeItemUnfold:st,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:mt,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:nt,onTreeItemFold:ot,onTreeItemUnfold:st});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(bt=>jsxRuntimeExports.jsx(TreeNode,{node:bt,showIcon:ut,selectedNodeId:ht,expandedNodes:mt,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:mt,siblingsNodes:xt,showIcon:ut,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et})})})}),EdificeClientContext=reactExports.createContext(null);function useEdificeClient(){const tt=reactExports.useContext(EdificeClientContext);if(!tt)throw new Error("Cannot be used outside of EdificeClientProvider");return tt}function useBookmark(){var tt;const{sessionQuery:et}=useEdificeClient(),rt=new Set;return(tt=et==null?void 0:et.data)==null?void 0:tt.bookmarkedApps.filter(nt=>{const st=rt.has(nt.displayName);return rt.add(nt.displayName),!st})}function useDebounce(tt,et){const[rt,nt]=reactExports.useState(tt);return reactExports.useEffect(()=>{const st=setTimeout(()=>{nt(tt)},et);return()=>{clearTimeout(st)}},[tt,et]),rt}function useMediaQuery(tt){const et=reactExports.useCallback(st=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",st),()=>{ot.removeEventListener("change",st)}},[tt]),rt=()=>window.matchMedia(tt).matches,nt=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,nt)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),nt=reactExports.useCallback(st=>rt(typeof st=="boolean"?st:ot=>!ot),[]);return[et,nt]}function useBreakpoint(){return{xs:useMediaQuery("only screen and (min-width: 0)"),sm:useMediaQuery("only screen and (min-width: 375px)"),md:useMediaQuery("only screen and (min-width: 768px)"),lg:useMediaQuery("only screen and (min-width: 1024px)"),xl:useMediaQuery("only screen and (min-width: 1280px)"),xxl:useMediaQuery("only screen and (min-width: 1400px)")}}var uaParser={exports:{}};(function(tt,et){(function(rt,nt){var st="1.0.40",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",mt="model",xt="name",yt="type",vt="vendor",Et="version",bt="architecture",St="console",wt="mobile",Rt="tablet",Ct="smarttv",Pt="wearable",It="embedded",jt=500,Dt="Amazon",Vt="Apple",Ft="ASUS",Ht="BlackBerry",Nt="Browser",Lt="Chrome",Mt="Edge",zt="Firefox",Gt="Google",$t="Huawei",Ut="LG",Bt="Microsoft",Yt="Motorola",Zt="Opera",Xt="Samsung",rr="Sharp",cr="Sony",ur="Xiaomi",mr="Zebra",vr="Facebook",Er="Chromium OS",br="Mac OS",hr=" Browser",Ar=function(jr,Ir){var Pr={};for(var Vr in jr)Ir[Vr]&&Ir[Vr].length%2===0?Pr[Vr]=Ir[Vr].concat(jr[Vr]):Pr[Vr]=jr[Vr];return Pr},Cr=function(jr){for(var Ir={},Pr=0;Pr<jr.length;Pr++)Ir[jr[Pr].toUpperCase()]=jr[Pr];return Ir},Ur=function(jr,Ir){return typeof jr===dt?Sr(Ir).indexOf(Sr(jr))!==-1:!1},Sr=function(jr){return jr.toLowerCase()},kr=function(jr){return typeof jr===dt?jr.replace(/[^\d\.]/g,ot).split(".")[0]:nt},Zr=function(jr,Ir){if(typeof jr===dt)return jr=jr.replace(/^\s\s*/,ot),typeof Ir===ut?jr:jr.substring(0,jt)},qt=function(jr,Ir){for(var Pr=0,Vr,Xn,An,Hr,Lr,os;Pr<Ir.length&&!Lr;){var Ms=Ir[Pr],Xo=Ir[Pr+1];for(Vr=Xn=0;Vr<Ms.length&&!Lr&&Ms[Vr];)if(Lr=Ms[Vr++].exec(jr),Lr)for(An=0;An<Xo.length;An++)os=Lr[++Xn],Hr=Xo[An],typeof Hr===ct&&Hr.length>0?Hr.length===2?typeof Hr[1]==lt?this[Hr[0]]=Hr[1].call(this,os):this[Hr[0]]=Hr[1]:Hr.length===3?typeof Hr[1]===lt&&!(Hr[1].exec&&Hr[1].test)?this[Hr[0]]=os?Hr[1].call(this,os,Hr[2]):nt:this[Hr[0]]=os?os.replace(Hr[1],Hr[2]):nt:Hr.length===4&&(this[Hr[0]]=os?Hr[3].call(this,os.replace(Hr[1],Hr[2])):nt):this[Hr]=os||nt;Pr+=2}},er=function(jr,Ir){for(var Pr in Ir)if(typeof Ir[Pr]===ct&&Ir[Pr].length>0){for(var Vr=0;Vr<Ir[Pr].length;Vr++)if(Ur(Ir[Pr][Vr],jr))return Pr===at?nt:Pr}else if(Ur(Ir[Pr],jr))return Pr===at?nt:Pr;return Ir.hasOwnProperty("*")?Ir["*"]:jr},nr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},yr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},xr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Et,[xt,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Et,[xt,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[xt,Et],[/opios[\/ ]+([\w\.]+)/i],[Et,[xt,Zt+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,Zt+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,Zt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Et,[xt,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Et,[xt,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[xt,Et],[/quark(?:pc)?\/([-\w\.]+)/i],[Et,[xt,"Quark"]],[/\bddg\/([\w\.]+)/i],[Et,[xt,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Et,[xt,"UC"+Nt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Et,[xt,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Et,[xt,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Et,[xt,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Et,[xt,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Et,[xt,"Smart Lenovo "+Nt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Nt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,zt+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,Zt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,Zt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+hr]],[/fxios\/([\w\.-]+)/i],[Et,[xt,zt]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+hr],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,Xt+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Et,[xt,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[xt,"Sogou Mobile"],Et],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[xt,Et],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[xt],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Et,xt],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[xt,vr],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[xt,Et],[/\bgsa\/([\w\.]+) .*safari\//i],[Et,[xt,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Et,[xt,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[Et,[xt,Lt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,Lt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Nt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[xt,Et],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[Et,[xt,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[Et,xt],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[xt,[Et,er,nr]],[/(webkit|khtml)\/([\w\.]+)/i],[xt,Et],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[xt,"Netscape"],Et],[/(wolvic|librewolf)\/([\w\.]+)/i],[xt,Et],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Et,[xt,zt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[bt,"amd64"]],[/(ia32(?=;))/i],[[bt,Sr]],[/((?:i[346]|x)86)[;\)]/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/windows (ce|mobile); ppc;/i],[[bt,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[bt,/ower/,ot,Sr]],[/(sun4\w)[;\)]/i],[[bt,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[bt,Sr]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[mt,[vt,Xt],[yt,Rt]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[mt,[vt,Xt],[yt,wt]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[mt,[vt,Vt],[yt,wt]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[mt,[vt,Vt],[yt,Rt]],[/(macintosh);/i],[mt,[vt,Vt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[mt,[vt,rr],[yt,wt]],[/(?:honor)([-\w ]+)[;\)]/i],[mt,[vt,"Honor"],[yt,wt]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[mt,[vt,$t],[yt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[mt,[vt,$t],[yt,wt]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[mt,/_/g," "],[vt,ur],[yt,wt]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[mt,/_/g," "],[vt,ur],[yt,Rt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[mt,[vt,"OPPO"],[yt,wt]],[/\b(opd2\d{3}a?) bui/i],[mt,[vt,"OPPO"],[yt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[mt,[vt,"Vivo"],[yt,wt]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[mt,[vt,"Realme"],[yt,wt]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[mt,[vt,Yt],[yt,wt]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[mt,[vt,Yt],[yt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[mt,[vt,Ut],[yt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[mt,[vt,Ut],[yt,wt]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[mt,[vt,"Lenovo"],[yt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[mt,/_/g," "],[vt,"Nokia"],[yt,wt]],[/(pixel c)\b/i],[mt,[vt,Gt],[yt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[mt,[vt,Gt],[yt,wt]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[mt,[vt,cr],[yt,wt]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[mt,"Xperia Tablet"],[vt,cr],[yt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[mt,[vt,"OnePlus"],[yt,wt]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[mt,[vt,Dt],[yt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[mt,/(.+)/g,"Fire Phone $1"],[vt,Dt],[yt,wt]],[/(playbook);[-\w\),; ]+(rim)/i],[mt,vt,[yt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[mt,[vt,Ht],[yt,wt]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[mt,[vt,Ft],[yt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[mt,[vt,Ft],[yt,wt]],[/(nexus 9)/i],[mt,[vt,"HTC"],[yt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[vt,[mt,/_/g," "],[yt,wt]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[mt,[vt,"TCL"],[yt,Rt]],[/(itel) ((\w+))/i],[[vt,Sr],mt,[yt,er,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[mt,[vt,"Acer"],[yt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[mt,[vt,"Meizu"],[yt,wt]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[mt,[vt,"Ulefone"],[yt,wt]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[mt,[vt,"Energizer"],[yt,wt]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[mt,[vt,"Cat"],[yt,wt]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[mt,[vt,"Smartfren"],[yt,wt]],[/droid.+; (a(?:015|06[35]|142p?))/i],[mt,[vt,"Nothing"],[yt,wt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[vt,mt,[yt,wt]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[vt,mt,[yt,Rt]],[/(surface duo)/i],[mt,[vt,Bt],[yt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[mt,[vt,"Fairphone"],[yt,wt]],[/(u304aa)/i],[mt,[vt,"AT&T"],[yt,wt]],[/\bsie-(\w*)/i],[mt,[vt,"Siemens"],[yt,wt]],[/\b(rct\w+) b/i],[mt,[vt,"RCA"],[yt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[mt,[vt,"Dell"],[yt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[mt,[vt,"Verizon"],[yt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[mt,[vt,"Barnes & Noble"],[yt,Rt]],[/\b(tm\d{3}\w+) b/i],[mt,[vt,"NuVision"],[yt,Rt]],[/\b(k88) b/i],[mt,[vt,"ZTE"],[yt,Rt]],[/\b(nx\d{3}j) b/i],[mt,[vt,"ZTE"],[yt,wt]],[/\b(gen\d{3}) b.+49h/i],[mt,[vt,"Swiss"],[yt,wt]],[/\b(zur\d{3}) b/i],[mt,[vt,"Swiss"],[yt,Rt]],[/\b((zeki)?tb.*\b) b/i],[mt,[vt,"Zeki"],[yt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[vt,"Dragon Touch"],mt,[yt,Rt]],[/\b(ns-?\w{0,9}) b/i],[mt,[vt,"Insignia"],[yt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[mt,[vt,"NextBook"],[yt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[vt,"Voice"],mt,[yt,wt]],[/\b(lvtel\-)?(v1[12]) b/i],[[vt,"LvTel"],mt,[yt,wt]],[/\b(ph-1) /i],[mt,[vt,"Essential"],[yt,wt]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[mt,[vt,"Envizen"],[yt,Rt]],[/\b(trio[-\w\. ]+) b/i],[mt,[vt,"MachSpeed"],[yt,Rt]],[/\btu_(1491) b/i],[mt,[vt,"Rotor"],[yt,Rt]],[/(shield[\w ]+) b/i],[mt,[vt,"Nvidia"],[yt,Rt]],[/(sprint) (\w+)/i],[vt,mt,[yt,wt]],[/(kin\.[onetw]{3})/i],[[mt,/\./g," "],[vt,Bt],[yt,wt]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[mt,[vt,mr],[yt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[mt,[vt,mr],[yt,wt]],[/smart-tv.+(samsung)/i],[vt,[yt,Ct]],[/hbbtv.+maple;(\d+)/i],[[mt,/^/,"SmartTV"],[vt,Xt],[yt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[vt,Ut],[yt,Ct]],[/(apple) ?tv/i],[vt,[mt,Vt+" TV"],[yt,Ct]],[/crkey/i],[[mt,Lt+"cast"],[vt,Gt],[yt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[mt,[vt,Dt],[yt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[mt,[vt,rr],[yt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[mt,[vt,cr],[yt,Ct]],[/(mitv-\w{5}) bui/i],[mt,[vt,ur],[yt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[vt,mt,[yt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[vt,Zr],[mt,Zr],[yt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[yt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[vt,mt,[yt,St]],[/droid.+; (shield) bui/i],[mt,[vt,"Nvidia"],[yt,St]],[/(playstation [345portablevi]+)/i],[mt,[vt,cr],[yt,St]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[mt,[vt,Bt],[yt,St]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[mt,[vt,Xt],[yt,Pt]],[/((pebble))app/i],[vt,mt,[yt,Pt]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[mt,[vt,Vt],[yt,Pt]],[/droid.+; (glass) \d/i],[mt,[vt,Gt],[yt,Pt]],[/droid.+; (wt63?0{2,3})\)/i],[mt,[vt,mr],[yt,Pt]],[/droid.+; (glass) \d/i],[mt,[vt,Gt],[yt,Pt]],[/(pico) (4|neo3(?: link|pro)?)/i],[vt,mt,[yt,Pt]],[/; (quest( \d| pro)?)/i],[mt,[vt,vr],[yt,Pt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[vt,[yt,It]],[/(aeobc)\b/i],[mt,[vt,Dt],[yt,It]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[mt,[yt,wt]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[mt,[yt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[yt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[yt,wt]],[/(android[-\w\. ]{0,9});.+buil/i],[mt,[vt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,Mt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[xt,Et],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Et,[xt,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[xt,Et],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,er,yr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,er,yr],[xt,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Et,/_/g,"."],[xt,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[xt,br],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,zt+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Et,[xt,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Et,[xt,"watchOS"]],[/crkey\/([\d\.]+)/i],[Et,[xt,Lt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,Er],Et],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[xt,Et],[/(sunos) ?([\w\.\d]*)/i],[[xt,"Solaris"],Et],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[xt,Et]]},dr=function(jr,Ir){if(typeof jr===ct&&(Ir=jr,jr=nt),!(this instanceof dr))return new dr(jr,Ir).getResult();var Pr=typeof rt!==ut&&rt.navigator?rt.navigator:nt,Vr=jr||(Pr&&Pr.userAgent?Pr.userAgent:ot),Xn=Pr&&Pr.userAgentData?Pr.userAgentData:nt,An=Ir?Ar(xr,Ir):xr,Hr=Pr&&Pr.userAgent==Vr;return this.getBrowser=function(){var Lr={};return Lr[xt]=nt,Lr[Et]=nt,qt.call(Lr,Vr,An.browser),Lr[ht]=kr(Lr[Et]),Hr&&Pr&&Pr.brave&&typeof Pr.brave.isBrave==lt&&(Lr[xt]="Brave"),Lr},this.getCPU=function(){var Lr={};return Lr[bt]=nt,qt.call(Lr,Vr,An.cpu),Lr},this.getDevice=function(){var Lr={};return Lr[vt]=nt,Lr[mt]=nt,Lr[yt]=nt,qt.call(Lr,Vr,An.device),Hr&&!Lr[yt]&&Xn&&Xn.mobile&&(Lr[yt]=wt),Hr&&Lr[mt]=="Macintosh"&&Pr&&typeof Pr.standalone!==ut&&Pr.maxTouchPoints&&Pr.maxTouchPoints>2&&(Lr[mt]="iPad",Lr[yt]=Rt),Lr},this.getEngine=function(){var Lr={};return Lr[xt]=nt,Lr[Et]=nt,qt.call(Lr,Vr,An.engine),Lr},this.getOS=function(){var Lr={};return Lr[xt]=nt,Lr[Et]=nt,qt.call(Lr,Vr,An.os),Hr&&!Lr[xt]&&Xn&&Xn.platform&&Xn.platform!="Unknown"&&(Lr[xt]=Xn.platform.replace(/chrome os/i,Er).replace(/macos/i,br)),Lr},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Vr},this.setUA=function(Lr){return Vr=typeof Lr===dt&&Lr.length>jt?Zr(Lr,jt):Lr,this},this.setUA(Vr),this};dr.VERSION=st,dr.BROWSER=Cr([xt,Et,ht]),dr.CPU=Cr([bt]),dr.DEVICE=Cr([mt,vt,yt,St,wt,Ct,Rt,Pt,It]),dr.ENGINE=dr.OS=Cr([xt,Et]),tt.exports&&(et=tt.exports=dr),et.UAParser=dr;var _r=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(_r&&!_r.ua){var Fr=new dr;_r.ua=Fr.getResult(),_r.ua.get=function(){return Fr.getUA()},_r.ua.set=function(jr){Fr.setUA(jr);var Ir=Fr.getResult();for(var Pr in Ir)_r.ua[Pr]=Ir[Pr]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,nt;const st=new UAParser(tt),ot=st.getOS(),at=st.getDevice(),lt=st.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((nt=at.model)==null?void 0:nt.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}const MockedDataContext=reactExports.createContext(null);function useMockedData(){return reactExports.useContext(MockedDataContext)}function useHasWorkflow(tt){const et=useMockedData(),[rt,nt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;if(et!=null&&et.hasWorkflow)if(typeof tt=="string")st=await et.hasWorkflow(tt);else throw"not.implemented.yet)";else typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt);nt(st)})()},[tt,et]),rt}function useCantoo(){const tt=useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo");return reactExports.useEffect(()=>{tt&&!document.getElementById("cantoo-edifice-script")&&(async()=>{const et=await odeServices.http().get("/optionalFeature/cantoo");if(et&&et.scriptPath){const rt=document.createElement("script");rt.id="cantoo-edifice-script",rt.src=et.scriptPath,rt.async=!0,document.body.appendChild(rt)}})()},[tt]),null}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$2(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:nt,fetchStatus:st,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(nt){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||st&&st!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:nt,predicate:st,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(nt&&et.state.status!==nt||st&&!st(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject$1(rt)?Object.keys(rt).sort().reduce((nt,st)=>(nt[st]=rt[st],nt),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject$1(tt)&&isPlainObject$1(et)){const nt=rt?tt:Object.keys(tt),st=nt.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&nt.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return st===at&&ut===st?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject$1(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const nt=[...tt,et];return rt&&nt.length>rt?nt.slice(1):nt}function addToStart(tt,et,rt=0){const nt=[et,...tt];return rt&&nt.length>rt?nt.slice(0,-1):nt}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var $a,Fo,Gl,qp,FocusManager=(qp=class extends Subscribable{constructor(){super();Nr(this,$a);Nr(this,Fo);Nr(this,Gl);Rr(this,Gl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Fo)||this.setEventListener(Kt(this,Gl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Fo))==null||et.call(this),Rr(this,Fo,void 0))}setEventListener(et){var rt;Rr(this,Gl,et),(rt=Kt(this,Fo))==null||rt.call(this),Rr(this,Fo,et(nt=>{typeof nt=="boolean"?this.setFocused(nt):this.onFocus()}))}setFocused(et){Kt(this,$a)!==et&&(Rr(this,$a,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,$a)=="boolean"?Kt(this,$a):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},$a=new WeakMap,Fo=new WeakMap,Gl=new WeakMap,qp),focusManager=new FocusManager,Wl,Bo,Xl,Xp,OnlineManager=(Xp=class extends Subscribable{constructor(){super();Nr(this,Wl,!0);Nr(this,Bo);Nr(this,Xl);Rr(this,Xl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),nt=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",nt,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",nt)}}})}onSubscribe(){Kt(this,Bo)||this.setEventListener(Kt(this,Xl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Bo))==null||et.call(this),Rr(this,Bo,void 0))}setEventListener(et){var rt;Rr(this,Xl,et),(rt=Kt(this,Bo))==null||rt.call(this),Rr(this,Bo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Wl)!==et&&(Rr(this,Wl,et),this.listeners.forEach(nt=>{nt(et)}))}isOnline(){return Kt(this,Wl)}},Wl=new WeakMap,Bo=new WeakMap,Xl=new WeakMap,Xp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((st,ot)=>{tt=st,et=ot});rt.status="pending",rt.catch(()=>{});function nt(st){Object.assign(rt,st),delete rt.resolve,delete rt.reject}return rt.resolve=st=>{nt({status:"fulfilled",value:st}),tt(st)},rt.reject=st=>{nt({status:"rejected",reason:st}),et(st)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,nt=!1,st;const ot=pendingThenable(),at=vt=>{var Et;nt||(mt(new CancelledError(vt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=vt=>{var Et;nt||(nt=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),st==null||st(),ot.resolve(vt))},mt=vt=>{var Et;nt||(nt=!0,(Et=tt.onError)==null||Et.call(tt,vt),st==null||st(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;st=bt=>{(nt||ct())&&vt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;st=void 0,nt||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(nt)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(bt){vt=Promise.reject(bt)}Promise.resolve(vt).then(ht).catch(bt=>{var Pt;if(nt)return;const St=tt.retry??(isServer?0:3),wt=tt.retryDelay??defaultRetryDelay,Rt=typeof wt=="function"?wt(rt,bt):wt,Ct=St===!0||typeof St=="number"&&rt<St||typeof St=="function"&&St(rt,bt);if(et||!Ct){mt(bt);return}rt++,(Pt=tt.onFail)==null||Pt.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?mt(bt):yt()})})};return{promise:ot,cancel:at,continue:()=>(st==null||st(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},nt=lt=>{lt()},st=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):st(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&st(()=>{nt(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{nt=lt},setScheduler:lt=>{st=lt}}}var notifyManager=createNotifyManager(),xl,Yp,Removable=(Yp=class{constructor(){Nr(this,xl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Rr(this,xl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,xl)&&(clearTimeout(Kt(this,xl)),Rr(this,xl,void 0))}},xl=new WeakMap,Yp),Yl,Kl,Hs,hs,ju,yl,Qs,So,Kp,Query=(Kp=class extends Removable{constructor(et){super();Nr(this,Qs);Nr(this,Yl);Nr(this,Kl);Nr(this,Hs);Nr(this,hs);Nr(this,ju);Nr(this,yl);Rr(this,yl,!1),Rr(this,ju,et.defaultOptions),this.setOptions(et.options),this.observers=[],Rr(this,Hs,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Rr(this,Yl,getDefaultState$1(this.options)),this.state=et.state??Kt(this,Yl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,hs))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,ju),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,Hs).remove(this)}setData(et,rt){const nt=replaceData(this.state.data,et,this.options);return zr(this,Qs,So).call(this,{data:nt,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),nt}setState(et,rt){zr(this,Qs,So).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var nt,st;const rt=(nt=Kt(this,hs))==null?void 0:nt.promise;return(st=Kt(this,hs))==null||st.cancel(et),rt?rt.then(noop$2).catch(noop$2):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,Yl))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(nt=>nt.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,hs))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(nt=>nt.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,hs))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,Hs).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,hs)&&(Kt(this,yl)?Kt(this,hs).cancel({revert:!0}):Kt(this,hs).cancelRetry()),this.scheduleGc()),Kt(this,Hs).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||zr(this,Qs,So).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,hs))return Kt(this,hs).continueRetry(),Kt(this,hs).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(mt=>mt.options.queryFn);ht&&this.setOptions(ht.options)}const nt=new AbortController,st=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Rr(this,yl,!0),nt.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),mt={queryKey:this.queryKey,meta:this.meta};return st(mt),Rr(this,yl,!1),this.options.persister?this.options.persister(ht,mt,this):ht(mt)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};st(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Rr(this,Kl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&zr(this,Qs,So).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var mt,xt,yt,vt;isCancelledError(ht)&&ht.silent||zr(this,Qs,So).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(mt=Kt(this,Hs).config).onError)==null||xt.call(mt,ht,this),(vt=(yt=Kt(this,Hs).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Rr(this,hs,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:nt.abort.bind(nt),onSuccess:ht=>{var mt,xt,yt,vt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(mt=Kt(this,Hs).config).onSuccess)==null||xt.call(mt,ht,this),(vt=(yt=Kt(this,Hs).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,mt)=>{zr(this,Qs,So).call(this,{type:"failed",failureCount:ht,error:mt})},onPause:()=>{zr(this,Qs,So).call(this,{type:"pause"})},onContinue:()=>{zr(this,Qs,So).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,hs).start()}},Yl=new WeakMap,Kl=new WeakMap,Hs=new WeakMap,hs=new WeakMap,ju=new WeakMap,yl=new WeakMap,Qs=new WeakSet,So=function(et){const rt=nt=>{switch(et.type){case"failed":return{...nt,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...nt,fetchStatus:"paused"};case"continue":return{...nt,fetchStatus:"fetching"};case"fetch":return{...nt,...fetchState(nt.data,this.options),fetchMeta:et.meta??null};case"success":return{...nt,data:et.data,dataUpdateCount:nt.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const st=et.error;return isCancelledError(st)&&st.revert&&Kt(this,Kl)?{...Kt(this,Kl),fetchStatus:"idle"}:{...nt,error:st,errorUpdateCount:nt.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:nt.fetchFailureCount+1,fetchFailureReason:st,fetchStatus:"idle",status:"error"};case"invalidate":return{...nt,isInvalidated:!0};case"setState":return{...nt,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(nt=>{nt.onQueryUpdate()}),Kt(this,Hs).notify({query:this,type:"updated",action:et})})},Kp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,nt=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?nt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var fo,Qp,QueryCache=(Qp=class extends Subscribable{constructor(et={}){super();Nr(this,fo);this.config=et,Rr(this,fo,new Map)}build(et,rt,nt){const st=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(st,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:st,queryHash:ot,options:et.defaultQueryOptions(rt),state:nt,defaultOptions:et.getQueryDefaults(st)}),this.add(at)),at}add(et){Kt(this,fo).has(et.queryHash)||(Kt(this,fo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,fo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,fo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,fo).get(et)}getAll(){return[...Kt(this,fo).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(nt=>matchQuery(rt,nt))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(nt=>matchQuery(et,nt)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},fo=new WeakMap,Qp),po,gs,El,mo,No,Zp,Mutation=(Zp=class extends Removable{constructor(et){super();Nr(this,mo);Nr(this,po);Nr(this,gs);Nr(this,El);this.mutationId=et.mutationId,Rr(this,gs,et.mutationCache),Rr(this,po,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,po).includes(et)||(Kt(this,po).push(et),this.clearGcTimeout(),Kt(this,gs).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Rr(this,po,Kt(this,po).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,gs).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,po).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,gs).remove(this))}continue(){var et;return((et=Kt(this,El))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var st,ot,at,lt,ut,ct,dt,ht,mt,xt,yt,vt,Et,bt,St,wt,Rt,Ct,Pt,It;Rr(this,El,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(jt,Dt)=>{zr(this,mo,No).call(this,{type:"failed",failureCount:jt,error:Dt})},onPause:()=>{zr(this,mo,No).call(this,{type:"pause"})},onContinue:()=>{zr(this,mo,No).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,gs).canRun(this)}));const rt=this.state.status==="pending",nt=!Kt(this,El).canStart();try{if(!rt){zr(this,mo,No).call(this,{type:"pending",variables:et,isPaused:nt}),await((ot=(st=Kt(this,gs).config).onMutate)==null?void 0:ot.call(st,et,this));const Dt=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Dt!==this.state.context&&zr(this,mo,No).call(this,{type:"pending",context:Dt,variables:et,isPaused:nt})}const jt=await Kt(this,El).start();return await((ct=(ut=Kt(this,gs).config).onSuccess)==null?void 0:ct.call(ut,jt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,jt,et,this.state.context)),await((xt=(mt=Kt(this,gs).config).onSettled)==null?void 0:xt.call(mt,jt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,jt,null,et,this.state.context)),zr(this,mo,No).call(this,{type:"success",data:jt}),jt}catch(jt){try{throw await((bt=(Et=Kt(this,gs).config).onError)==null?void 0:bt.call(Et,jt,et,this.state.context,this)),await((wt=(St=this.options).onError)==null?void 0:wt.call(St,jt,et,this.state.context)),await((Ct=(Rt=Kt(this,gs).config).onSettled)==null?void 0:Ct.call(Rt,void 0,jt,this.state.variables,this.state.context,this)),await((It=(Pt=this.options).onSettled)==null?void 0:It.call(Pt,void 0,jt,et,this.state.context)),jt}finally{zr(this,mo,No).call(this,{type:"error",error:jt})}}finally{Kt(this,gs).runNext(this)}}},po=new WeakMap,gs=new WeakMap,El=new WeakMap,mo=new WeakSet,No=function(et){const rt=nt=>{switch(et.type){case"failed":return{...nt,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...nt,isPaused:!0};case"continue":return{...nt,isPaused:!1};case"pending":return{...nt,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...nt,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...nt,data:void 0,error:et.error,failureCount:nt.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,po).forEach(nt=>{nt.onMutationUpdate(et)}),Kt(this,gs).notify({mutation:this,type:"updated",action:et})})},Zp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var js,Mu,Jp,MutationCache=(Jp=class extends Subscribable{constructor(et={}){super();Nr(this,js);Nr(this,Mu);this.config=et,Rr(this,js,new Map),Rr(this,Mu,Date.now())}build(et,rt,nt){const st=new Mutation({mutationCache:this,mutationId:++R1(this,Mu)._,options:et.defaultMutationOptions(rt),state:nt});return this.add(st),st}add(et){const rt=scopeFor(et),nt=Kt(this,js).get(rt)??[];nt.push(et),Kt(this,js).set(rt,nt),this.notify({type:"added",mutation:et})}remove(et){var nt;const rt=scopeFor(et);if(Kt(this,js).has(rt)){const st=(nt=Kt(this,js).get(rt))==null?void 0:nt.filter(ot=>ot!==et);st&&(st.length===0?Kt(this,js).delete(rt):Kt(this,js).set(rt,st))}this.notify({type:"removed",mutation:et})}canRun(et){var nt;const rt=(nt=Kt(this,js).get(scopeFor(et)))==null?void 0:nt.find(st=>st.state.status==="pending");return!rt||rt===et}runNext(et){var nt;const rt=(nt=Kt(this,js).get(scopeFor(et)))==null?void 0:nt.find(st=>st!==et&&st.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,js).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(nt=>matchMutation(rt,nt))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$2))))}},js=new WeakMap,Mu=new WeakMap,Jp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,mt,xt,yt;const nt=et.options,st=(mt=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:mt.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((yt=et.state.data)==null?void 0:yt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let vt=!1;const Et=wt=>{Object.defineProperty(wt,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),St=async(wt,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&wt.pages.length)return Promise.resolve(wt);const Pt={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(Pt);const It=await bt(Pt),{maxPages:jt}=et.options,Dt=Ct?addToStart:addToEnd;return{pages:Dt(wt.pages,It,jt),pageParams:Dt(wt.pageParams,Rt,jt)}};if(st&&ot.length){const wt=st==="backward",Rt=wt?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},Pt=Rt(nt,Ct);lt=await St(Ct,Pt,wt)}else{const wt=tt??ot.length;do{const Rt=ut===0?at[0]??nt.initialPageParam:getNextPageParam(nt,lt);if(ut>0&&Rt==null)break;lt=await St(lt,Rt),ut++}while(ut<wt)}return lt};et.options.persister?et.fetchFn=()=>{var vt,Et;return(Et=(vt=et.options).persister)==null?void 0:Et.call(vt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const nt=et.length-1;return et.length>0?tt.getNextPageParam(et[nt],et,rt[nt],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var nt;return et.length>0?(nt=tt.getPreviousPageParam)==null?void 0:nt.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var Hn,zo,Uo,Ql,Zl,Ho,Jl,eu,em,QueryClient=(em=class{constructor(tt={}){Nr(this,Hn);Nr(this,zo);Nr(this,Uo);Nr(this,Ql);Nr(this,Zl);Nr(this,Ho);Nr(this,Jl);Nr(this,eu);Rr(this,Hn,tt.queryCache||new QueryCache),Rr(this,zo,tt.mutationCache||new MutationCache),Rr(this,Uo,tt.defaultOptions||{}),Rr(this,Ql,new Map),Rr(this,Zl,new Map),Rr(this,Ho,0)}mount(){R1(this,Ho)._++,Kt(this,Ho)===1&&(Rr(this,Jl,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,Hn).onFocus())})),Rr(this,eu,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,Hn).onOnline())})))}unmount(){var tt,et;R1(this,Ho)._--,Kt(this,Ho)===0&&((tt=Kt(this,Jl))==null||tt.call(this),Rr(this,Jl,void 0),(et=Kt(this,eu))==null||et.call(this),Rr(this,eu,void 0))}isFetching(tt){return Kt(this,Hn).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,zo).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,Hn).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,Hn).build(this,et),nt=rt.state.data;return nt===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(nt))}getQueriesData(tt){return Kt(this,Hn).findAll(tt).map(({queryKey:et,state:rt})=>{const nt=rt.data;return[et,nt]})}setQueryData(tt,et,rt){const nt=this.defaultQueryOptions({queryKey:tt}),st=Kt(this,Hn).get(nt.queryHash),ot=st==null?void 0:st.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,Hn).build(this,nt).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,Hn).findAll(tt).map(({queryKey:nt})=>[nt,this.setQueryData(nt,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,Hn).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,Hn);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,Hn),nt={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(st=>{st.reset()}),this.refetchQueries(nt,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},nt=notifyManager.batch(()=>Kt(this,Hn).findAll(tt).map(st=>st.cancel(rt)));return Promise.all(nt).then(noop$2).catch(noop$2)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,Hn).findAll(tt).forEach(nt=>{nt.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},nt=notifyManager.batch(()=>Kt(this,Hn).findAll(tt).filter(st=>!st.isDisabled()).map(st=>{let ot=st.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$2)),st.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(nt).then(noop$2)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,Hn).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$2).catch(noop$2)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$2).catch(noop$2)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,zo).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,Hn)}getMutationCache(){return Kt(this,zo)}getDefaultOptions(){return Kt(this,Uo)}setDefaultOptions(tt){Rr(this,Uo,tt)}setQueryDefaults(tt,et){Kt(this,Ql).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,Ql).values()],rt={};return et.forEach(nt=>{partialMatchKey(tt,nt.queryKey)&&Object.assign(rt,nt.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,Zl).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,Zl).values()];let rt={};return et.forEach(nt=>{partialMatchKey(tt,nt.mutationKey)&&(rt={...rt,...nt.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Uo).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Uo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,Hn).clear(),Kt(this,zo).clear()}},Hn=new WeakMap,zo=new WeakMap,Uo=new WeakMap,Ql=new WeakMap,Zl=new WeakMap,Ho=new WeakMap,Jl=new WeakMap,eu=new WeakMap,em),Ss,Wr,Ou,xs,wl,tu,Vo,go,$u,ru,nu,Sl,_l,Go,su,Qr,Ru,X0,Y0,K0,Q0,Z0,J0,_h,sm,tm,QueryObserver=(tm=class extends Subscribable{constructor(et,rt){super();Nr(this,Qr);Nr(this,Ss);Nr(this,Wr);Nr(this,Ou);Nr(this,xs);Nr(this,wl);Nr(this,tu);Nr(this,Vo);Nr(this,go);Nr(this,$u);Nr(this,ru);Nr(this,nu);Nr(this,Sl);Nr(this,_l);Nr(this,Go);Nr(this,su,new Set);this.options=rt,Rr(this,Ss,et),Rr(this,go,null),Rr(this,Vo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Vo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Wr).addObserver(this),shouldFetchOnMount(Kt(this,Wr),this.options)?zr(this,Qr,Ru).call(this):this.updateResult(),zr(this,Qr,Q0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Wr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Wr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,zr(this,Qr,Z0).call(this),zr(this,Qr,J0).call(this),Kt(this,Wr).removeObserver(this)}setOptions(et,rt){const nt=this.options,st=Kt(this,Wr);if(this.options=Kt(this,Ss).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Wr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");zr(this,Qr,_h).call(this),Kt(this,Wr).setOptions(this.options),nt._defaulted&&!shallowEqualObjects(this.options,nt)&&Kt(this,Ss).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Wr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Wr),st,this.options,nt)&&zr(this,Qr,Ru).call(this),this.updateResult(rt),ot&&(Kt(this,Wr)!==st||resolveEnabled(this.options.enabled,Kt(this,Wr))!==resolveEnabled(nt.enabled,Kt(this,Wr))||resolveStaleTime(this.options.staleTime,Kt(this,Wr))!==resolveStaleTime(nt.staleTime,Kt(this,Wr)))&&zr(this,Qr,X0).call(this);const at=zr(this,Qr,Y0).call(this);ot&&(Kt(this,Wr)!==st||resolveEnabled(this.options.enabled,Kt(this,Wr))!==resolveEnabled(nt.enabled,Kt(this,Wr))||at!==Kt(this,Go))&&zr(this,Qr,K0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Ss).getQueryCache().build(Kt(this,Ss),et),nt=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,nt)&&(Rr(this,xs,nt),Rr(this,tu,this.options),Rr(this,wl,Kt(this,Wr).state)),nt}getCurrentResult(){return Kt(this,xs)}trackResult(et,rt){const nt={};return Object.keys(et).forEach(st=>{Object.defineProperty(nt,st,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(st),rt==null||rt(st),et[st])})}),nt}trackProp(et){Kt(this,su).add(et)}getCurrentQuery(){return Kt(this,Wr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Ss).defaultQueryOptions(et),nt=Kt(this,Ss).getQueryCache().build(Kt(this,Ss),rt);return nt.fetch().then(()=>this.createResult(nt,rt))}fetch(et){return zr(this,Qr,Ru).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,xs)))}createResult(et,rt){var jt;const nt=Kt(this,Wr),st=this.options,ot=Kt(this,xs),at=Kt(this,wl),lt=Kt(this,tu),ct=et!==nt?et.state:Kt(this,Ou),{state:dt}=et;let ht={...dt},mt=!1,xt;if(rt._optimisticResults){const Dt=this.hasListeners(),Vt=!Dt&&shouldFetchOnMount(et,rt),Ft=Dt&&shouldFetchOptionally(et,nt,rt,st);(Vt||Ft)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:yt,errorUpdatedAt:vt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,$u))xt=Kt(this,ru);else try{Rr(this,$u,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Rr(this,ru,xt),Rr(this,go,null)}catch(Dt){Rr(this,go,Dt)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Dt;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Dt=ot.data;else if(Dt=typeof rt.placeholderData=="function"?rt.placeholderData((jt=Kt(this,nu))==null?void 0:jt.state.data,Kt(this,nu)):rt.placeholderData,rt.select&&Dt!==void 0)try{Dt=rt.select(Dt),Rr(this,go,null)}catch(Vt){Rr(this,go,Vt)}Dt!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Dt,rt),mt=!0)}Kt(this,go)&&(yt=Kt(this,go),xt=Kt(this,ru),vt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",St=Et==="pending",wt=Et==="error",Rt=St&&bt,Ct=xt!==void 0,It={status:Et,fetchStatus:ht.fetchStatus,isPending:St,isSuccess:Et==="success",isError:wt,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:yt,errorUpdatedAt:vt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!St,isLoadingError:wt&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:mt,isRefetchError:wt&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Vo)};if(this.options.experimental_prefetchInRender){const Dt=Ht=>{It.status==="error"?Ht.reject(It.error):It.data!==void 0&&Ht.resolve(It.data)},Vt=()=>{const Ht=Rr(this,Vo,It.promise=pendingThenable());Dt(Ht)},Ft=Kt(this,Vo);switch(Ft.status){case"pending":et.queryHash===nt.queryHash&&Dt(Ft);break;case"fulfilled":(It.status==="error"||It.data!==Ft.value)&&Vt();break;case"rejected":(It.status!=="error"||It.error!==Ft.reason)&&Vt();break}}return It}updateResult(et){const rt=Kt(this,xs),nt=this.createResult(Kt(this,Wr),this.options);if(Rr(this,wl,Kt(this,Wr).state),Rr(this,tu,this.options),Kt(this,wl).data!==void 0&&Rr(this,nu,Kt(this,Wr)),shallowEqualObjects(nt,rt))return;Rr(this,xs,nt);const st={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,su).size)return!0;const ut=new Set(lt??Kt(this,su));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,xs)).some(ct=>{const dt=ct;return Kt(this,xs)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(st.listeners=!0),zr(this,Qr,sm).call(this,{...st,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&zr(this,Qr,Q0).call(this)}},Ss=new WeakMap,Wr=new WeakMap,Ou=new WeakMap,xs=new WeakMap,wl=new WeakMap,tu=new WeakMap,Vo=new WeakMap,go=new WeakMap,$u=new WeakMap,ru=new WeakMap,nu=new WeakMap,Sl=new WeakMap,_l=new WeakMap,Go=new WeakMap,su=new WeakMap,Qr=new WeakSet,Ru=function(et){zr(this,Qr,_h).call(this);let rt=Kt(this,Wr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$2)),rt},X0=function(){zr(this,Qr,Z0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Wr));if(isServer||Kt(this,xs).isStale||!isValidTimeout(et))return;const nt=timeUntilStale(Kt(this,xs).dataUpdatedAt,et)+1;Rr(this,Sl,setTimeout(()=>{Kt(this,xs).isStale||this.updateResult()},nt))},Y0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Wr)):this.options.refetchInterval)??!1},K0=function(et){zr(this,Qr,J0).call(this),Rr(this,Go,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Wr))===!1||!isValidTimeout(Kt(this,Go))||Kt(this,Go)===0)&&Rr(this,_l,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&zr(this,Qr,Ru).call(this)},Kt(this,Go)))},Q0=function(){zr(this,Qr,X0).call(this),zr(this,Qr,K0).call(this,zr(this,Qr,Y0).call(this))},Z0=function(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Rr(this,Sl,void 0))},J0=function(){Kt(this,_l)&&(clearInterval(Kt(this,_l)),Rr(this,_l,void 0))},_h=function(){const et=Kt(this,Ss).getQueryCache().build(Kt(this,Ss),this.options);if(et===Kt(this,Wr))return;const rt=Kt(this,Wr);Rr(this,Wr,et),Rr(this,Ou,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},sm=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,xs))}),Kt(this,Ss).getQueryCache().notify({query:Kt(this,Wr),type:"observerResultsUpdated"})})},tm);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const nt=typeof rt=="function"?rt(tt):rt;return nt==="always"||nt!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,nt){return(tt!==et||resolveEnabled(nt.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var yt,vt;const{state:rt}=tt,nt=super.createResult(tt,et),{isFetching:st,isRefetching:ot,isError:at,isRefetchError:lt}=nt,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=st&&ut==="forward",ht=at&&ut==="backward",mt=st&&ut==="backward";return{...nt,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:mt,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!mt}}},Wo,qo,_s,Ro,To,T1,e2,rm,MutationObserver$1=(rm=class extends Subscribable{constructor(rt,nt){super();Nr(this,To);Nr(this,Wo);Nr(this,qo);Nr(this,_s);Nr(this,Ro);Rr(this,Wo,rt),this.setOptions(nt),this.bindMethods(),zr(this,To,T1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var st;const nt=this.options;this.options=Kt(this,Wo).defaultMutationOptions(rt),shallowEqualObjects(this.options,nt)||Kt(this,Wo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,_s),observer:this}),nt!=null&&nt.mutationKey&&this.options.mutationKey&&hashKey(nt.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((st=Kt(this,_s))==null?void 0:st.state.status)==="pending"&&Kt(this,_s).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,_s))==null||rt.removeObserver(this)}onMutationUpdate(rt){zr(this,To,T1).call(this),zr(this,To,e2).call(this,rt)}getCurrentResult(){return Kt(this,qo)}reset(){var rt;(rt=Kt(this,_s))==null||rt.removeObserver(this),Rr(this,_s,void 0),zr(this,To,T1).call(this),zr(this,To,e2).call(this)}mutate(rt,nt){var st;return Rr(this,Ro,nt),(st=Kt(this,_s))==null||st.removeObserver(this),Rr(this,_s,Kt(this,Wo).getMutationCache().build(Kt(this,Wo),this.options)),Kt(this,_s).addObserver(this),Kt(this,_s).execute(rt)}},Wo=new WeakMap,qo=new WeakMap,_s=new WeakMap,Ro=new WeakMap,To=new WeakSet,T1=function(){var nt;const rt=((nt=Kt(this,_s))==null?void 0:nt.state)??getDefaultState();Rr(this,qo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},e2=function(rt){notifyManager.batch(()=>{var nt,st,ot,at,lt,ut,ct,dt;if(Kt(this,Ro)&&this.hasListeners()){const ht=Kt(this,qo).variables,mt=Kt(this,qo).context;(rt==null?void 0:rt.type)==="success"?((st=(nt=Kt(this,Ro)).onSuccess)==null||st.call(nt,rt.data,ht,mt),(at=(ot=Kt(this,Ro)).onSettled)==null||at.call(ot,rt.data,null,ht,mt)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Ro)).onError)==null||ut.call(lt,rt.error,ht,mt),(dt=(ct=Kt(this,Ro)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,mt))}this.listeners.forEach(ht=>{ht(Kt(this,qo))})})},rm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop$1(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:nt})=>tt.isError&&!et.isReset()&&!tt.isFetching&&nt&&shouldThrowError(rt,[tt.error,nt]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,mt,xt,yt;const nt=useQueryClient(),st=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=nt.defaultQueryOptions(tt);(ht=(dt=nt.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=st?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!nt.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(nt,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=st?noop$1:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,st]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:nt.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(mt=nt.getDefaultOptions().queries)==null?void 0:mt._experimental_afterQuery)==null||xt.call(mt,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,st)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=nt.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop$1).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[nt]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{nt.setOptions(tt)},[nt,tt]);const st=reactExports.useSyncExternalStore(reactExports.useCallback(at=>nt.subscribe(notifyManager.batchCalls(at)),[nt]),()=>nt.getCurrentResult(),()=>nt.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{nt.mutate(at,lt).catch(noop$1)},[nt]);if(st.error&&shouldThrowError(nt.options.throwOnError,[st.error]))throw st.error;return{...st,mutate:ot,mutateAsync:st.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}function useConf({appCode:tt}){return useQuery({queryKey:["conf"],queryFn:async()=>await odeServices.conf().getConf(tt)})}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,nt]=reactExports.useState(0),[st,ot]=reactExports.useState(""),at={unread:!0,_:new Date().getTime()},lt=async()=>{const ct=tt?"/zimbra/count/INBOX":"/conversation/count/INBOX";try{const{count:dt}=await odeServices.http().get(ct,{queryParams:at});nt(dt??0)}catch(dt){console.error(dt),nt(0)}},ut=async()=>{const ct="/zimbra/zimbra";try{const{preference:dt}=await odeServices.http().get("/userbook/preference/zimbra"),ht=dt?JSON.parse(dt).modeExpert:!1;ot(ht&&et?"/zimbra/preauth":window.location.origin+ct)}catch(dt){console.error(dt),ot(window.location.origin+ct)}};return reactExports.useEffect(()=>{lt()},[]),reactExports.useEffect(()=>{ut()},[]),{messages:rt,msgLink:st,zimbraWorkflow:tt}};var dayjs_min={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){var rt=1e3,nt=6e4,st=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",mt="quarter",xt="year",yt="date",vt="Invalid Date",Et=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,St={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Lt){var Mt=["th","st","nd","rd"],zt=Lt%100;return"["+Lt+(Mt[(zt-20)%10]||Mt[zt]||Mt[0])+"]"}},wt=function(Lt,Mt,zt){var Gt=String(Lt);return!Gt||Gt.length>=Mt?Lt:""+Array(Mt+1-Gt.length).join(zt)+Lt},Rt={s:wt,z:function(Lt){var Mt=-Lt.utcOffset(),zt=Math.abs(Mt),Gt=Math.floor(zt/60),$t=zt%60;return(Mt<=0?"+":"-")+wt(Gt,2,"0")+":"+wt($t,2,"0")},m:function Lt(Mt,zt){if(Mt.date()<zt.date())return-Lt(zt,Mt);var Gt=12*(zt.year()-Mt.year())+(zt.month()-Mt.month()),$t=Mt.clone().add(Gt,ht),Ut=zt-$t<0,Bt=Mt.clone().add(Gt+(Ut?-1:1),ht);return+(-(Gt+(zt-$t)/(Ut?$t-Bt:Bt-$t))||0)},a:function(Lt){return Lt<0?Math.ceil(Lt)||0:Math.floor(Lt)},p:function(Lt){return{M:ht,y:xt,w:dt,d:ct,D:yt,h:ut,m:lt,s:at,ms:ot,Q:mt}[Lt]||String(Lt||"").toLowerCase().replace(/s$/,"")},u:function(Lt){return Lt===void 0}},Ct="en",Pt={};Pt[Ct]=St;var It="$isDayjsObject",jt=function(Lt){return Lt instanceof Ht||!(!Lt||!Lt[It])},Dt=function Lt(Mt,zt,Gt){var $t;if(!Mt)return Ct;if(typeof Mt=="string"){var Ut=Mt.toLowerCase();Pt[Ut]&&($t=Ut),zt&&(Pt[Ut]=zt,$t=Ut);var Bt=Mt.split("-");if(!$t&&Bt.length>1)return Lt(Bt[0])}else{var Yt=Mt.name;Pt[Yt]=Mt,$t=Yt}return!Gt&&$t&&(Ct=$t),$t||!Gt&&Ct},Vt=function(Lt,Mt){if(jt(Lt))return Lt.clone();var zt=typeof Mt=="object"?Mt:{};return zt.date=Lt,zt.args=arguments,new Ht(zt)},Ft=Rt;Ft.l=Dt,Ft.i=jt,Ft.w=function(Lt,Mt){return Vt(Lt,{locale:Mt.$L,utc:Mt.$u,x:Mt.$x,$offset:Mt.$offset})};var Ht=function(){function Lt(zt){this.$L=Dt(zt.locale,null,!0),this.parse(zt),this.$x=this.$x||zt.x||{},this[It]=!0}var Mt=Lt.prototype;return Mt.parse=function(zt){this.$d=function(Gt){var $t=Gt.date,Ut=Gt.utc;if($t===null)return new Date(NaN);if(Ft.u($t))return new Date;if($t instanceof Date)return new Date($t);if(typeof $t=="string"&&!/Z$/i.test($t)){var Bt=$t.match(Et);if(Bt){var Yt=Bt[2]-1||0,Zt=(Bt[7]||"0").substring(0,3);return Ut?new Date(Date.UTC(Bt[1],Yt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Zt)):new Date(Bt[1],Yt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Zt)}}return new Date($t)}(zt),this.init()},Mt.init=function(){var zt=this.$d;this.$y=zt.getFullYear(),this.$M=zt.getMonth(),this.$D=zt.getDate(),this.$W=zt.getDay(),this.$H=zt.getHours(),this.$m=zt.getMinutes(),this.$s=zt.getSeconds(),this.$ms=zt.getMilliseconds()},Mt.$utils=function(){return Ft},Mt.isValid=function(){return this.$d.toString()!==vt},Mt.isSame=function(zt,Gt){var $t=Vt(zt);return this.startOf(Gt)<=$t&&$t<=this.endOf(Gt)},Mt.isAfter=function(zt,Gt){return Vt(zt)<this.startOf(Gt)},Mt.isBefore=function(zt,Gt){return this.endOf(Gt)<Vt(zt)},Mt.$g=function(zt,Gt,$t){return Ft.u(zt)?this[Gt]:this.set($t,zt)},Mt.unix=function(){return Math.floor(this.valueOf()/1e3)},Mt.valueOf=function(){return this.$d.getTime()},Mt.startOf=function(zt,Gt){var $t=this,Ut=!!Ft.u(Gt)||Gt,Bt=Ft.p(zt),Yt=function(Er,br){var hr=Ft.w($t.$u?Date.UTC($t.$y,br,Er):new Date($t.$y,br,Er),$t);return Ut?hr:hr.endOf(ct)},Zt=function(Er,br){return Ft.w($t.toDate()[Er].apply($t.toDate("s"),(Ut?[0,0,0,0]:[23,59,59,999]).slice(br)),$t)},Xt=this.$W,rr=this.$M,cr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Ut?Yt(1,0):Yt(31,11);case ht:return Ut?Yt(1,rr):Yt(0,rr+1);case dt:var mr=this.$locale().weekStart||0,vr=(Xt<mr?Xt+7:Xt)-mr;return Yt(Ut?cr-vr:cr+(6-vr),rr);case ct:case yt:return Zt(ur+"Hours",0);case ut:return Zt(ur+"Minutes",1);case lt:return Zt(ur+"Seconds",2);case at:return Zt(ur+"Milliseconds",3);default:return this.clone()}},Mt.endOf=function(zt){return this.startOf(zt,!1)},Mt.$set=function(zt,Gt){var $t,Ut=Ft.p(zt),Bt="set"+(this.$u?"UTC":""),Yt=($t={},$t[ct]=Bt+"Date",$t[yt]=Bt+"Date",$t[ht]=Bt+"Month",$t[xt]=Bt+"FullYear",$t[ut]=Bt+"Hours",$t[lt]=Bt+"Minutes",$t[at]=Bt+"Seconds",$t[ot]=Bt+"Milliseconds",$t)[Ut],Zt=Ut===ct?this.$D+(Gt-this.$W):Gt;if(Ut===ht||Ut===xt){var Xt=this.clone().set(yt,1);Xt.$d[Yt](Zt),Xt.init(),this.$d=Xt.set(yt,Math.min(this.$D,Xt.daysInMonth())).$d}else Yt&&this.$d[Yt](Zt);return this.init(),this},Mt.set=function(zt,Gt){return this.clone().$set(zt,Gt)},Mt.get=function(zt){return this[Ft.p(zt)]()},Mt.add=function(zt,Gt){var $t,Ut=this;zt=Number(zt);var Bt=Ft.p(Gt),Yt=function(rr){var cr=Vt(Ut);return Ft.w(cr.date(cr.date()+Math.round(rr*zt)),Ut)};if(Bt===ht)return this.set(ht,this.$M+zt);if(Bt===xt)return this.set(xt,this.$y+zt);if(Bt===ct)return Yt(1);if(Bt===dt)return Yt(7);var Zt=($t={},$t[lt]=nt,$t[ut]=st,$t[at]=rt,$t)[Bt]||1,Xt=this.$d.getTime()+zt*Zt;return Ft.w(Xt,this)},Mt.subtract=function(zt,Gt){return this.add(-1*zt,Gt)},Mt.format=function(zt){var Gt=this,$t=this.$locale();if(!this.isValid())return $t.invalidDate||vt;var Ut=zt||"YYYY-MM-DDTHH:mm:ssZ",Bt=Ft.z(this),Yt=this.$H,Zt=this.$m,Xt=this.$M,rr=$t.weekdays,cr=$t.months,ur=$t.meridiem,mr=function(br,hr,Ar,Cr){return br&&(br[hr]||br(Gt,Ut))||Ar[hr].slice(0,Cr)},vr=function(br){return Ft.s(Yt%12||12,br,"0")},Er=ur||function(br,hr,Ar){var Cr=br<12?"AM":"PM";return Ar?Cr.toLowerCase():Cr};return Ut.replace(bt,function(br,hr){return hr||function(Ar){switch(Ar){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Ft.s(Gt.$y,4,"0");case"M":return Xt+1;case"MM":return Ft.s(Xt+1,2,"0");case"MMM":return mr($t.monthsShort,Xt,cr,3);case"MMMM":return mr(cr,Xt);case"D":return Gt.$D;case"DD":return Ft.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr($t.weekdaysMin,Gt.$W,rr,2);case"ddd":return mr($t.weekdaysShort,Gt.$W,rr,3);case"dddd":return rr[Gt.$W];case"H":return String(Yt);case"HH":return Ft.s(Yt,2,"0");case"h":return vr(1);case"hh":return vr(2);case"a":return Er(Yt,Zt,!0);case"A":return Er(Yt,Zt,!1);case"m":return String(Zt);case"mm":return Ft.s(Zt,2,"0");case"s":return String(Gt.$s);case"ss":return Ft.s(Gt.$s,2,"0");case"SSS":return Ft.s(Gt.$ms,3,"0");case"Z":return Bt}return null}(br)||Bt.replace(":","")})},Mt.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Mt.diff=function(zt,Gt,$t){var Ut,Bt=this,Yt=Ft.p(Gt),Zt=Vt(zt),Xt=(Zt.utcOffset()-this.utcOffset())*nt,rr=this-Zt,cr=function(){return Ft.m(Bt,Zt)};switch(Yt){case xt:Ut=cr()/12;break;case ht:Ut=cr();break;case mt:Ut=cr()/3;break;case dt:Ut=(rr-Xt)/6048e5;break;case ct:Ut=(rr-Xt)/864e5;break;case ut:Ut=rr/st;break;case lt:Ut=rr/nt;break;case at:Ut=rr/rt;break;default:Ut=rr}return $t?Ut:Ft.a(Ut)},Mt.daysInMonth=function(){return this.endOf(ht).$D},Mt.$locale=function(){return Pt[this.$L]},Mt.locale=function(zt,Gt){if(!zt)return this.$L;var $t=this.clone(),Ut=Dt(zt,Gt,!0);return Ut&&($t.$L=Ut),$t},Mt.clone=function(){return Ft.w(this.$d,this)},Mt.toDate=function(){return new Date(this.valueOf())},Mt.toJSON=function(){return this.isValid()?this.toISOString():null},Mt.toISOString=function(){return this.$d.toISOString()},Mt.toString=function(){return this.$d.toUTCString()},Lt}(),Nt=Ht.prototype;return Vt.prototype=Nt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",yt]].forEach(function(Lt){Nt[Lt[1]]=function(Mt){return this.$g(Mt,Lt[0],Lt[1])}}),Vt.extend=function(Lt,Mt){return Lt.$i||(Lt(Mt,Ht,Vt),Lt.$i=!0),Vt},Vt.locale=Dt,Vt.isDayjs=jt,Vt.unix=function(Lt){return Vt(1e3*Lt)},Vt.en=Pt[Ct],Vt.Ls=Pt,Vt.p={},Vt})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},nt=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,st=/\d\d/,ot=/\d\d?/,at=/\d*[^-_:/,()\s\d]+/,lt={},ut=function(vt){return(vt=+vt)+(vt>68?1900:2e3)},ct=function(vt){return function(Et){this[vt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(vt){(this.zone||(this.zone={})).offset=function(Et){if(!Et||Et==="Z")return 0;var bt=Et.match(/([+-]|\d\d)/g),St=60*bt[1]+(+bt[2]||0);return St===0?0:bt[0]==="+"?-St:St}(vt)}],ht=function(vt){var Et=lt[vt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},mt=function(vt,Et){var bt,St=lt.meridiem;if(St){for(var wt=1;wt<=24;wt+=1)if(vt.indexOf(St(wt,0,Et))>-1){bt=wt>12;break}}else bt=vt===(Et?"pm":"PM");return bt},xt={A:[at,function(vt){this.afternoon=mt(vt,!1)}],a:[at,function(vt){this.afternoon=mt(vt,!0)}],S:[/\d/,function(vt){this.milliseconds=100*+vt}],SS:[st,function(vt){this.milliseconds=10*+vt}],SSS:[/\d{3}/,function(vt){this.milliseconds=+vt}],s:[ot,ct("seconds")],ss:[ot,ct("seconds")],m:[ot,ct("minutes")],mm:[ot,ct("minutes")],H:[ot,ct("hours")],h:[ot,ct("hours")],HH:[ot,ct("hours")],hh:[ot,ct("hours")],D:[ot,ct("day")],DD:[st,ct("day")],Do:[at,function(vt){var Et=lt.ordinal,bt=vt.match(/\d+/);if(this.day=bt[0],Et)for(var St=1;St<=31;St+=1)Et(St).replace(/\[|\]/g,"")===vt&&(this.day=St)}],M:[ot,ct("month")],MM:[st,ct("month")],MMM:[at,function(vt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(St){return St.slice(0,3)})).indexOf(vt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(vt){var Et=ht("months").indexOf(vt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[st,function(vt){this.year=ut(vt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function yt(vt){var Et,bt;Et=vt,bt=lt&&lt.formats;for(var St=(vt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Dt,Vt,Ft){var Ht=Ft&&Ft.toUpperCase();return Vt||bt[Ft]||rt[Ft]||bt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Nt,Lt,Mt){return Lt||Mt.slice(1)})})).match(nt),wt=St.length,Rt=0;Rt<wt;Rt+=1){var Ct=St[Rt],Pt=xt[Ct],It=Pt&&Pt[0],jt=Pt&&Pt[1];St[Rt]=jt?{regex:It,parser:jt}:Ct.replace(/^\[|\]$/g,"")}return function(Dt){for(var Vt={},Ft=0,Ht=0;Ft<wt;Ft+=1){var Nt=St[Ft];if(typeof Nt=="string")Ht+=Nt.length;else{var Lt=Nt.regex,Mt=Nt.parser,zt=Dt.slice(Ht),Gt=Lt.exec(zt)[0];Mt.call(Vt,Gt),Dt=Dt.replace(Gt,"")}}return function($t){var Ut=$t.afternoon;if(Ut!==void 0){var Bt=$t.hours;Ut?Bt<12&&($t.hours+=12):Bt===12&&($t.hours=0),delete $t.afternoon}}(Vt),Vt}}return function(vt,Et,bt){bt.p.customParseFormat=!0,vt&&vt.parseTwoDigitYear&&(ut=vt.parseTwoDigitYear);var St=Et.prototype,wt=St.parse;St.parse=function(Rt){var Ct=Rt.date,Pt=Rt.utc,It=Rt.args;this.$u=Pt;var jt=It[1];if(typeof jt=="string"){var Dt=It[2]===!0,Vt=It[3]===!0,Ft=Dt||Vt,Ht=It[2];Vt&&(Ht=It[2]),lt=this.$locale(),!Dt&&Ht&&(lt=bt.Ls[Ht]),this.$d=function(zt,Gt,$t){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*zt);var Ut=yt(Gt)(zt),Bt=Ut.year,Yt=Ut.month,Zt=Ut.day,Xt=Ut.hours,rr=Ut.minutes,cr=Ut.seconds,ur=Ut.milliseconds,mr=Ut.zone,vr=new Date,Er=Zt||(Bt||Yt?1:vr.getDate()),br=Bt||vr.getFullYear(),hr=0;Bt&&!Yt||(hr=Yt>0?Yt-1:vr.getMonth());var Ar=Xt||0,Cr=rr||0,Ur=cr||0,Sr=ur||0;return mr?new Date(Date.UTC(br,hr,Er,Ar,Cr,Ur,Sr+60*mr.offset*1e3)):$t?new Date(Date.UTC(br,hr,Er,Ar,Cr,Ur,Sr)):new Date(br,hr,Er,Ar,Cr,Ur,Sr)}catch{return new Date("")}}(Ct,jt,Pt),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$L),Ft&&Ct!=this.format(jt)&&(this.$d=new Date("")),lt={}}else if(jt instanceof Array)for(var Nt=jt.length,Lt=1;Lt<=Nt;Lt+=1){It[1]=jt[Lt-1];var Mt=bt.apply(this,It);if(Mt.isValid()){this.$d=Mt.$d,this.$L=Mt.$L,this.init();break}Lt===Nt&&(this.$d=new Date(""))}else wt.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(nt,st,ot){var at=st.prototype,lt=at.format;ot.en.formats=rt,at.format=function(ut){ut===void 0&&(ut="YYYY-MM-DDTHH:mm:ssZ");var ct=this.$locale().formats,dt=function(ht,mt){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,yt,vt){var Et=vt&&vt.toUpperCase();return yt||mt[vt]||rt[vt]||mt[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(bt,St,wt){return St||wt.slice(1)})})}(ut,ct===void 0?{}:ct);return lt.call(this,dt)}}})})(localizedFormat$1);var localizedFormatExports=localizedFormat$1.exports;const localizedFormat=getDefaultExportFromCjs(localizedFormatExports);var relativeTime$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt()})(commonjsGlobal,function(){return function(rt,nt,st){rt=rt||{};var ot=nt.prototype,at={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function lt(ct,dt,ht,mt){return ot.fromToBase(ct,dt,ht,mt)}st.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,mt,xt){for(var yt,vt,Et,bt=ht.$locale().relativeTime||at,St=rt.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],wt=St.length,Rt=0;Rt<wt;Rt+=1){var Ct=St[Rt];Ct.d&&(yt=mt?st(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var Pt=(rt.rounding||Math.round)(Math.abs(yt));if(Et=yt>0,Pt<=Ct.r||!Ct.r){Pt<=1&&Rt>0&&(Ct=St[Rt-1]);var It=bt[Ct.l];xt&&(Pt=xt(""+Pt)),vt=typeof It=="string"?It.replace("%d",Pt):It(Pt,dt,Ct.l,Et);break}}if(dt)return vt;var jt=Et?bt.future:bt.past;return typeof jt=="function"?jt(vt):jt.replace("%s",vt)},ot.to=function(ct,dt){return lt(ct,dt,this,!0)},ot.from=function(ct,dt){return lt(ct,dt,this)};var ut=function(ct){return ct.$u?st.utc():st()};ot.toNow=function(ct){return this.to(ut(this),ct)},ot.fromNow=function(ct){return this.from(ut(this),ct)}}})})(relativeTime$1);var relativeTimeExports=relativeTime$1.exports;const relativeTime=getDefaultExportFromCjs(relativeTimeExports);var de$1={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var st=nt(rt),ot={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function at(ut,ct,dt){var ht=ot[dt];return Array.isArray(ht)&&(ht=ht[ct?0:1]),ht.replace("%d",ut)}var lt={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(ut){return ut+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:at,m:at,mm:at,h:at,hh:at,d:at,dd:at,M:at,MM:at,y:at,yy:at}};return st.default.locale(lt,null,!0),lt})})(de$1);var es={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(at){return at+"º"}};return st.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(at){return""+at+(at===1?"er":"")}};return st.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(at){return at+"º"}};return st.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,nt){tt.exports=nt(dayjs_minExports)})(commonjsGlobal,function(rt){function nt(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var st=nt(rt),ot={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(at){return at+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return st.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),et=reactExports.useCallback((st,ot)=>{if(st.length<11)return dayjs(st,["YYYY-MM-DD"],ot);if(st.split("").findIndex(at=>"0">at||at>"9")<0)return dayjs(Number.parseInt(st)).locale(tt);{let at=dayjs(st).locale(tt);return at.isValid()||(at=dayjs(st,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),at}},[tt]),rt=reactExports.useCallback(st=>{let ot=dayjs();try{return typeof st>"u"?"":(typeof st=="string"?ot=et(st):typeof st=="number"?ot=dayjs(st).locale(tt):typeof st.$date=="number"?ot=dayjs(new Date(st.$date)).locale(tt):typeof st.$date=="string"&&(ot=et(st.$date)),ot.isValid()?ot.fromNow():"")}catch(at){return console.error(at),""}},[tt,et]),nt=reactExports.useCallback((st,ot="short")=>{let at=dayjs();try{if(typeof st>"u")return"";typeof st=="string"?at=et(st):typeof st=="number"?at=dayjs(st).locale(tt):typeof st.$date=="number"?at=dayjs(new Date(st.$date)).locale(tt):typeof st.$date=="string"&&(at=et(st.$date));let lt="";switch(ot){case"short":lt="L";break;case"long":lt="LL";break;case"abbr":lt="ll";break;default:lt=ot}return at.isValid()?at.locale(tt).format(lt):""}catch(lt){return console.error(lt),""}},[tt,et]);return{fromNow:rt,formatDate:nt}}const EdificeThemeContext=reactExports.createContext(null);function useEdificeTheme(){const tt=reactExports.useContext(EdificeThemeContext);if(!tt)throw new Error("Cannot be used outside of EdificeThemeProvider");return tt}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),nt=()=>{et(!0)},st=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",nt),ot.addEventListener("mouseout",st),()=>{ot.removeEventListener("mouseover",nt),ot.removeEventListener("mouseout",st)}},[rt]),[rt,tt]}function useHeader({user:tt,avatar:et}){const{appCode:rt}=useEdificeClient(),{t:nt}=useTranslation(),{theme:st}=useEdificeTheme(),ot=nt(rt),[at,lt]=reactExports.useState(!0),[ut,ct]=useHover(),dt=reactExports.useId(),ht=reactExports.useId(),mt=et,xt=tt==null?void 0:tt.username,yt=nt("welcome",{username:tt==null?void 0:tt.firstName}),vt=useBookmark(),Et=useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"),bt=useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"),St=useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"),wt=reactExports.useCallback(()=>{lt(!at)},[at]),Rt=async()=>{await odeServices.session().logout(),window.location.href=(st==null?void 0:st.logoutCallback)??"/auth/login"};return reactExports.useMemo(()=>({title:ot,bookmarkedApps:vt,appsRef:ut,isAppsHovered:ct,popoverAppsId:dt,popoverSearchId:ht,userAvatar:mt,userName:xt,welcomeUser:yt,communityWorkflow:Et,conversationWorflow:bt,searchWorkflow:St,isCollapsed:at,toggleCollapsedNav:wt,handleLogout:Rt}),[ut,vt,Et,bt,ct,at,dt,ht,St,ot,wt,mt,xt,yt])}let e$1={data:""},t$1=tt=>typeof window=="object"?((tt?tt.querySelector("#_goober"):window._goober)||Object.assign((tt||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:tt||e$1,l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$1=(tt,et)=>{let rt="",nt="",st="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":nt+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?nt+=o$1(at,et?et.replace(/([^,])+/g,lt=>ot.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,lt):lt?lt+" "+ut:ut)):ot):at!=null&&(ot=/^--/.test(ot)?ot:ot.replace(/[A-Z]/g,"-$&").toLowerCase(),st+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&st?et+"{"+st+"}":st)+nt},c$2={},s$1=tt=>{if(typeof tt=="object"){let et="";for(let rt in tt)et+=rt+s$1(tt[rt]);return et}return tt},i$2=(tt,et,rt,nt,st)=>{let ot=s$1(tt),at=c$2[ot]||(c$2[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$2[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,mt=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?mt.shift():dt[3]?(ht=dt[3].replace(n$1," ").trim(),mt.unshift(mt[0][ht]=mt[0][ht]||{})):mt[0][dt[1]]=dt[2].replace(n$1," ").trim();return mt[0]})(tt);c$2[at]=o$1(st?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$2.g?c$2.g:null;return rt&&(c$2.g=c$2[at]),((ut,ct,dt,ht)=>{ht?ct.data=ct.data.replace(ht,ut):ct.data.indexOf(ut)===-1&&(ct.data=dt?ut+ct.data:ct.data+ut)})(c$2[at],et,nt,lt),at},p$1=(tt,et,rt)=>tt.reduce((nt,st,ot)=>{let at=et[ot];if(at&&at.call){let lt=at(rt),ut=lt&&lt.props&&lt.props.className||/^go/.test(lt)&&lt;at=ut?"."+ut:lt&&typeof lt=="object"?lt.props?"":o$1(lt,""):lt===!1?"":lt}return nt+st+(at??"")},"");function u$2(tt){let et=this||{},rt=tt.call?tt(et.p):tt;return i$2(rt.unshift?rt.raw?p$1(rt,[].slice.call(arguments,1),et.p):rt.reduce((nt,st)=>Object.assign(nt,st&&st.call?st(et.p):st),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$2.bind({g:1});let h$2=u$2.bind({k:1});function m$1(tt,et,rt,nt){o$1.p=et,d$1=tt,f$2=rt,g$1=nt}function j$2(tt,et){let rt=this||{};return function(){let nt=arguments;function st(ot,at){let lt=Object.assign({},ot),ut=lt.className||st.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$2.apply(rt,nt)+(ut?" "+ut:"");let ct=tt;return tt[0]&&(ct=lt.as||tt,delete lt.as),g$1&&ct[0]&&g$1(lt),d$1(ct,lt)}return st}}var W$2=tt=>typeof tt=="function",f$1=(tt,et)=>W$2(tt)?tt(et):tt,F$1=(()=>{let tt=0;return()=>(++tt).toString()})(),S$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),J$1=20,U$1=(tt,et)=>{switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,J$1)};case 1:return{...tt,toasts:tt.toasts.map(ot=>ot.id===et.toast.id?{...ot,...et.toast}:ot)};case 2:let{toast:rt}=et;return U$1(tt,{type:tt.toasts.find(ot=>ot.id===rt.id)?1:0,toast:rt});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(ot=>ot.id===nt||nt===void 0?{...ot,dismissed:!0,visible:!1}:ot)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(ot=>ot.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let st=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(ot=>({...ot,pauseDuration:ot.pauseDuration+st}))}}},A$1=[],P$1={toasts:[],pausedAt:void 0},u$1=tt=>{P$1=U$1(P$1,tt),A$1.forEach(et=>{et(P$1)})},Q$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},D$1=(tt={})=>{let[et,rt]=reactExports.useState(P$1);reactExports.useEffect(()=>(A$1.push(rt),()=>{let st=A$1.indexOf(rt);st>-1&&A$1.splice(st,1)}),[et]);let nt=et.toasts.map(st=>{var ot,at,lt;return{...tt,...tt[st.type],...st,removeDelay:st.removeDelay||((ot=tt[st.type])==null?void 0:ot.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:st.duration||((at=tt[st.type])==null?void 0:at.duration)||(tt==null?void 0:tt.duration)||Q$1[st.type],style:{...tt.style,...(lt=tt[st.type])==null?void 0:lt.style,...st.style}}});return{...et,toasts:nt}},Y$1=(tt,et="blank",rt)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:et,ariaProps:{role:"status","aria-live":"polite"},message:tt,pauseDuration:0,...rt,id:(rt==null?void 0:rt.id)||F$1()}),h$1=tt=>(et,rt)=>{let nt=Y$1(et,tt,rt);return u$1({type:2,toast:nt}),nt.id},c$1=(tt,et)=>h$1("blank")(tt,et);c$1.error=h$1("error");c$1.success=h$1("success");c$1.loading=h$1("loading");c$1.custom=h$1("custom");c$1.dismiss=tt=>{u$1({type:3,toastId:tt})};c$1.remove=tt=>u$1({type:4,toastId:tt});c$1.promise=(tt,et,rt)=>{let nt=c$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(st=>{let ot=et.success?f$1(et.success,st):void 0;return ot?c$1.success(ot,{id:nt,...rt,...rt==null?void 0:rt.success}):c$1.dismiss(nt),st}).catch(st=>{let ot=et.error?f$1(et.error,st):void 0;ot?c$1.error(ot,{id:nt,...rt,...rt==null?void 0:rt.error}):c$1.dismiss(nt)}),tt};var q$1=(tt,et)=>{u$1({type:1,toast:{id:tt,height:et}})},G$1=()=>{u$1({type:5,time:Date.now()})},x$1=new Map,K$2=1e3,Z$1=(tt,et=K$2)=>{if(x$1.has(tt))return;let rt=setTimeout(()=>{x$1.delete(tt),u$1({type:4,toastId:tt})},et);x$1.set(tt,rt)},O$1=tt=>{let{toasts:et,pausedAt:rt}=D$1(tt);reactExports.useEffect(()=>{if(rt)return;let ot=Date.now(),at=et.map(lt=>{if(lt.duration===1/0)return;let ut=(lt.duration||0)+lt.pauseDuration-(ot-lt.createdAt);if(ut<0){lt.visible&&c$1.dismiss(lt.id);return}return setTimeout(()=>c$1.dismiss(lt.id),ut)});return()=>{at.forEach(lt=>lt&&clearTimeout(lt))}},[et,rt]);let nt=reactExports.useCallback(()=>{rt&&u$1({type:6,time:Date.now()})},[rt]),st=reactExports.useCallback((ot,at)=>{let{reverseOrder:lt=!1,gutter:ut=8,defaultPosition:ct}=at||{},dt=et.filter(xt=>(xt.position||ct)===(ot.position||ct)&&xt.height),ht=dt.findIndex(xt=>xt.id===ot.id),mt=dt.filter((xt,yt)=>yt<ht&&xt.visible).length;return dt.filter(xt=>xt.visible).slice(...lt?[mt+1]:[0,mt]).reduce((xt,yt)=>xt+(yt.height||0)+ut,0)},[et]);return reactExports.useEffect(()=>{et.forEach(ot=>{if(ot.dismissed)Z$1(ot.id,ot.removeDelay);else{let at=x$1.get(ot.id);at&&(clearTimeout(at),x$1.delete(ot.id))}})},[et]),{toasts:et,handlers:{updateHeight:q$1,startPause:G$1,endPause:nt,calculateOffset:st}}},te$1=h$2`
51
51
  from {
52
52
  transform: scale(0) rotate(45deg);
53
53
  opacity: 0;
@@ -225,7 +225,7 @@ to {
225
225
  }
226
226
  `,v$1=16,De$1=({reverseOrder:tt,position:et="top-center",toastOptions:rt,gutter:nt,children:st,containerStyle:ot,containerClassName:at})=>{let{toasts:lt,handlers:ut}=O$1(rt);return reactExports.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:v$1,left:v$1,right:v$1,bottom:v$1,pointerEvents:"none",...ot},className:at,onMouseEnter:ut.startPause,onMouseLeave:ut.endPause},lt.map(ct=>{let dt=ct.position||et,ht=ut.calculateOffset(ct,{reverseOrder:tt,gutter:nt,defaultPosition:et}),mt=Ee$1(dt,ht);return reactExports.createElement(ve$1,{id:ct.id,key:ct.id,onHeightUpdate:ut.updateHeight,className:ct.visible?Re$1:"",style:mt},ct.type==="custom"?f$1(ct.message,ct):st?st(ct):reactExports.createElement(C$1,{toast:ct,position:dt}))}))},kt=c$1;const SvgIconAlertCircle=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 6a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V7a1 1 0 0 1 1-1M11 16a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1",clipRule:"evenodd"})]}),SvgIconError=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3 12a9 9 0 1 1 18 0 9 9 0 0 1-18 0m9-11C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1M8.293 15.707a1 1 0 0 1 0-1.414L10.586 12 8.293 9.707a1 1 0 0 1 1.414-1.414L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414 0",clipRule:"evenodd"})]}),SvgIconSuccessOutline=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.59 8.192a1 1 0 0 1 .218 1.397l-4.375 6a1 1 0 0 1-1.584.042L8.224 12.4a1 1 0 0 1 1.552-1.261l1.806 2.223 3.61-4.951a1 1 0 0 1 1.397-.219",clipRule:"evenodd"})]}),Alert=reactExports.forwardRef(({type:tt="success",className:et="",children:rt,button:nt,isDismissible:st=!1,isToast:ot=!1,isConfirm:at=!1,position:lt="none",autoClose:ut=!1,autoCloseDelay:ct=3e3,onClose:dt,onVisibilityChange:ht},mt)=>{const[xt,yt]=reactExports.useState(!0),vt=reactExports.useRef(null),{t:Et}=useTranslation(),bt=reactExports.useCallback(()=>{yt(!1),dt==null||dt()},[dt]);reactExports.useImperativeHandle(mt,()=>({show:St,hide:bt,...vt.current})),reactExports.useLayoutEffect(()=>{ht==null||ht(xt)},[xt,ht]),reactExports.useEffect(()=>{ut&&xt&&setTimeout(()=>{bt()},ct)},[ut,ct,bt,xt]);const St=()=>{yt(!0)},wt={success:{icon:jsxRuntimeExports.jsx(SvgIconSuccessOutline,{}),classModifier:"alert-success"},warning:{icon:jsxRuntimeExports.jsx(SvgIconAlertCircle,{}),classModifier:"alert-warning"},info:{icon:jsxRuntimeExports.jsx(SvgIconInfoCircle,{}),classModifier:"alert-info"},danger:{icon:jsxRuntimeExports.jsx(SvgIconError,{}),classModifier:"alert-danger"}},Rt={"is-dismissible":st,"is-toast ":ot},Ct={"is-confirm":at},Pt=clsx("alert gap-12",wt[tt].classModifier,Rt,Ct,lt,et);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:xt?jsxRuntimeExports.jsxs("div",{ref:vt,className:Pt,role:"alert",children:[!at&&wt[tt].icon,jsxRuntimeExports.jsx("div",{className:"alert-content small",children:rt}),nt&&jsxRuntimeExports.jsxs("div",{className:"ms-12",children:[nt," ",at&&jsxRuntimeExports.jsx(Button,{onClick:bt,children:Et("close")})]}),(st||at)&&jsxRuntimeExports.jsx("div",{className:"btn-close-container",children:jsxRuntimeExports.jsx("button",{type:"button",className:"btn-close","data-bs-dismiss":"alert","aria-label":Et("close"),onClick:bt})}),ut&&jsxRuntimeExports.jsx("div",{className:"alert-progress",style:{transform:"scaleX(0)"}})]}):null})}),DEFAULT_POSITION="top-right";function useToast(){return{success:(tt,et)=>kt.custom(jsxRuntimeExports.jsx(Alert,{type:"success",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),error:(tt,et)=>kt.custom(jsxRuntimeExports.jsx(Alert,{type:"danger",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),info:(tt,et)=>kt.custom(jsxRuntimeExports.jsx(Alert,{type:"info",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),warning:(tt,et)=>kt.custom(jsxRuntimeExports.jsx(Alert,{type:"warning",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),loading:kt.loading,dismiss:tt=>kt.dismiss(tt),remove:tt=>kt.remove(tt)}}const useHttpErrorToast=tt=>{const et=reactExports.useRef(),rt=useToast(),{t:nt}=useTranslation();return reactExports.useEffect(()=>{const st=odeServices.notify().events().subscribe(LAYER_NAME.TRANSPORT,ot=>{var at,lt;et.current=nt(((lt=(at=ot==null?void 0:ot.data)==null?void 0:at.payload)==null?void 0:lt.error)||ot.data.response.statusText),rt.error(React$4.createElement("div",{children:[et.current]}),tt)});return()=>st.revoke()},[nt,rt]),et.current};function useIsAdml(){const[tt,et]=reactExports.useState(!1);reactExports.useEffect(()=>{rt()},[]);const rt=reactExports.useCallback(async()=>{const nt=await odeServices.session().isAdml();et(nt)},[]);return{isAdml:tt}}function useKeyPress(tt,et){const rt=reactExports.useCallback(({code:nt})=>{et.includes(nt)&&tt()},[tt,et]);reactExports.useEffect(()=>(window.addEventListener("keydown",rt),()=>{window.removeEventListener("keydown",rt)}),[rt])}const useLibraryUrl=()=>{var tt;const{user:et,appCode:rt}=useEdificeClient(),nt=e$3[rt],st=et==null?void 0:et.apps.find(ct=>ct.isExternal&&ct.address.includes("library"));if(!st)return null;const ot=(tt=st.address)==null?void 0:tt.split("?");if(!ot||ot.length<2)return null;let at=ot[0];at.endsWith("/")||(at=`${at}/`);const lt=ot==null?void 0:ot[1],ut=`application%5B0%5D=${nt}&page=1&sort_field=views&sort_order=desc`;return`${at}search/?${lt}&${ut}`};function useScrollToTop(){const tt=document.querySelector("html");return()=>{tt&&tt.scrollIntoView()}}function useSession(){return useQuery({queryKey:["session"],queryFn:async()=>await odeServices.session().getSession()})}function useToggle(tt=!1){const[et,rt]=reactExports.useState(tt),nt=reactExports.useCallback(()=>{rt(st=>!st)},[]);return[et,nt]}function useTrapFocus(){const tt=reactExports.useRef(null),et='button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';return reactExports.useEffect(()=>{const rt=tt.current,nt=rt.querySelectorAll(et)[0],st=rt.querySelectorAll(et),ot=tt&&(st==null?void 0:st[st.length-1]),at=lt=>{lt.key==="Tab"&&(lt.shiftKey?document.activeElement===nt&&(ot.focus(),lt.preventDefault()):document.activeElement===ot&&(nt.focus(),lt.preventDefault()))};if(rt)return rt.addEventListener("keydown",at),()=>{rt.removeEventListener("keydown",at)}},[]),tt}function useUser(){const{user:tt,userDescription:et}=useEdificeClient(),{theme:rt}=useEdificeTheme();function nt(){let st=et==null?void 0:et.picture;return(!st||st==="no-avatar.jpg"||st==="no-avatar.svg")&&(st=`${rt==null?void 0:rt.basePath}/img/illustrations/no-avatar.svg`),st}return{user:tt,avatar:nt(),userDescription:et}}const useWorkspaceFile=()=>({createOrUpdate:async({alt:tt,uri:et,blob:rt,legend:nt,parentId:st,application:ot,visibility:at})=>{const lt=/\/workspace\/document\/([0-9a-fA-F-]+)/,ut=(et??"").match(lt);if(ut&&ut.length===2){const ct=ut[1],dt=await odeServices.workspace().searchDocuments({filter:"all",id:ct,limit:1}),ht=dt.length?dt[0].name:void 0;await odeServices.workspace().updateFile(ct,rt,{alt:tt,legend:nt,name:ht});const mt=(await odeServices.workspace().searchDocuments({filter:"all",id:ct,limit:1}))[0];return{file:mt,src:`/workspace/${mt.public?"pub/":""}document/${ct}`}}else{const ct=await odeServices.workspace().saveFile(rt,{application:ot,parentId:st,visibility:at});return`/workspace/${ct.public?"pub/":""}document/${ct._id}`}},create:async(tt,et)=>await odeServices.workspace().saveFile(tt,et),remove:async tt=>!tt||Array.isArray(tt)&&tt.length===0?Promise.resolve():await odeServices.workspace().deleteFile(Array.isArray(tt)?tt:[tt])}),useUpload=(tt,et="media-library")=>{const[rt,nt]=reactExports.useState({}),{browser:st,device:ot}=useBrowserInfo(navigator.userAgent),{create:at}=useWorkspaceFile(),lt=reactExports.useCallback(yt=>rt[s$2(yt)],[rt]),ut=(yt,vt)=>{nt(Et=>{const bt=s$2(yt);return{...Et,[bt]:vt}})},ct=yt=>{nt(vt=>{const Et=s$2(yt),{[Et]:bt,...St}=vt;return St})};async function dt(yt,vt){ut(yt,"loading");try{let Et;return et==="media-library"&&yt.type.includes("video")?Et=await mt(yt,{filename:yt.name,...vt}):Et=await at(yt,{application:et,visibility:tt}),ut(yt,"success"),Et}catch(Et){return console.error(Et),ut(yt,"error"),null}}async function ht(yt,vt){ut(yt,"loading");try{let Et;if(yt.type.includes("video"))Et=await mt(yt,vt);else throw new Error(ERROR_CODE.NOT_SUPPORTED);return ut(yt,"success"),Et}catch(Et){return console.error(Et),ut(yt,"error"),null}}const mt=async(yt,vt)=>{const Et={data:{device:ot.type,browser:{name:st.name,version:st.version},url:window.location.hostname,file:yt,filename:(vt==null?void 0:vt.filename)??"filename",weight:yt.size},appCode:et,captation:!(yt instanceof File),duration:(vt==null?void 0:vt.duration)??0},bt=await odeServices.video().upload(Et);if(bt.state==="succeed")return{_id:bt.videoworkspaceid,file:bt.videoid,name:Et.data.filename,eType:"file",eParent:"",children:[],created:new Date,_shared:[],_isShared:!1,owner:{userId:"",displayName:""}};throw bt.state==="error"?new Error(bt.code||"Error while uploading video"):new Error("Video encoding is still running")};function xt(yt,vt,Et){return s$2(vt,s$2(yt)),dt(vt,Et)}return{getUploadStatus:lt,setUploadStatus:ut,clearUploadStatus:ct,uploadFile:dt,uploadAlternateFile:xt,uploadBlob:ht}},useUploadFiles=({handleOnChange:tt,visibility:et,application:rt})=>{const[nt,st]=reactExports.useState([]),[ot,at]=reactExports.useState(void 0),{files:lt,deleteFile:ut,replaceFileAt:ct}=useDropzoneContext(),{remove:dt,createOrUpdate:ht}=useWorkspaceFile(),{getUploadStatus:mt,setUploadStatus:xt,clearUploadStatus:yt,uploadFile:vt,uploadAlternateFile:Et}=useUpload(et,rt),bt=reactExports.useCallback(Pt=>{Pt.forEach(async(It,jt)=>{if(It==null)return;let Dt;if(It.type.startsWith("image"))try{const Vt=await p$3.resizeImageFile(It);Dt=await Et(It,Vt),ct(jt,Vt)}catch(Vt){console.error(Vt)}Dt||(Dt=await vt(It)),Dt&&st(Vt=>[...Vt,Dt])})},[Et,vt,ct]);reactExports.useEffect(()=>{let Pt=0;const It=lt.map(jt=>{if(Pt>=5)return null;const Dt=mt(jt);return Dt==="loading"&&Pt++,Dt?null:jt});It.forEach(jt=>jt&&xt(jt,"idle")),bt(It)},[lt,nt,mt,xt,bt]),reactExports.useEffect(()=>{const Pt=St(lt,nt);tt(Pt)},[nt]);const St=(Pt,It)=>{const jt=Pt.reduce((Dt,Vt,Ft)=>(Dt[Vt.name]=Ft,Dt),{});return It.sort((Dt,Vt)=>jt[Dt.name]-jt[Vt.name])};async function wt(Pt){const It=nt.find(jt=>jt.name===Pt.name);It&&(await dt(It),yt(Pt),st(jt=>jt.filter(Dt=>Dt.name!==(It==null?void 0:It.name)))),ut(Pt)}async function Rt({blob:Pt,legend:It,altText:jt}){if(ot)try{const Dt=await ht({blob:Pt,legend:It,alt:jt,uri:Ct(ot)});Dt&&typeof Dt=="object"&&st(Vt=>Vt.map(Ft=>Ft._id===Dt.file._id?{...Dt.file,title:It,alt:jt}:Ft))}finally{at(void 0)}}const Ct=(Pt,It)=>{const jt=`/workspace/${Pt!=null&&Pt.public?"pub/":""}document/${Pt==null?void 0:Pt._id}`;return Pt?It?m$2(jt):jt:""};return{files:lt,getUploadStatus:mt,clearUploadStatus:yt,uploadedFiles:nt,editingImage:ot,setEditingImage:at,getUrl:Ct,updateImage:Rt,uploadFile:vt,removeFile:wt}};function useWorkspaceSearch(tt,et,rt,nt){const st=useMockedData(),ot=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listDocuments"),at=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listFolders");function lt(ht,mt){switch(mt.type){case"update":{const xt=findNodeById(ht,mt.folderId);return xt&&(xt.children=mt.subfolders.map(yt=>({id:yt._id||"",name:yt.name})),xt.files=mt.files),{...ht}}default:throw Error("[useWorkspaceSearch] Unknown action type: "+mt.type)}}const[ut,ct]=reactExports.useReducer(lt,{id:tt,name:et,section:!0}),dt=reactExports.useCallback(async ht=>{var mt;if(ot&&at){const xt=ht===tt?"":ht,yt=st!=null&&st.listWorkspaceDocuments?await((mt=st==null?void 0:st.listWorkspaceDocuments)==null?void 0:mt.call(st).then(bt=>bt.map(St=>{const wt={...St,_id:""+Math.round(Math.random()*9999)};return wt.name=St.eType=="folder"?"folder id="+wt._id:"file id="+wt._id,wt}))):await odeServices.workspace().listDocuments(rt,xt),vt=[],Et=[];yt.filter(bt=>{if(!nt||bt.eType==="folder")return!0;const St=DocumentHelper.getRole(bt);return typeof nt=="string"?nt===St:Array.isArray(nt)?nt.findIndex(wt=>wt===St)>=0:!1}).forEach(bt=>{bt.eType==="folder"?vt.push(bt):Et.push(bt)}),ct({folderId:ht,subfolders:vt,files:Et,type:"update"})}},[ot,at,tt,st,rt,nt]);return{root:ut,loadContent:dt}}function useXitiTrackPageLoad(){const[tt,et]=reactExports.useState("pending"),{currentApp:rt}=useEdificeClient();reactExports.useEffect(()=>{nt()},[]);const nt=async()=>{if(!rt){et("[Xiti] Error, currentApp is not defined.");return}try{await odeServices.analytics().trackPageLoad(window.location.pathname,rt),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),et(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(st){console.error("[Xiti] Error Tracking Page Load",st),et(`[Xiti] Error Tracking Page Load: ${st}`)}};return{xitiStatus:tt}}function useZendeskGuide(){const{currentLanguage:tt}=useEdificeClient(),{userDescription:et}=useUser(),{isAdml:rt}=useIsAdml(),{theme:nt}=useEdificeTheme(),st=window.innerWidth<=768,ot=useHasWorkflow("net.atos.entng.support.controllers.DisplayController|view"),[at,lt]=reactExports.useState(""),[ut,ct]=reactExports.useState(void 0),dt=()=>{const ht=at.split("/");let mt="",xt="";if(ut!=null&&ut.labels&&Object.keys(ut==null?void 0:ut.labels).length>0&&ht.length>1){for(let yt=1;yt<ht.length;yt++)ht[yt].length>0&&ht[yt].match(/\d/)==null&&(mt.length===0?mt=ht[yt]:mt=mt+"/"+ht[yt]);ut!=null&&ut.labels&&Object.prototype.hasOwnProperty.call(ut==null?void 0:ut.labels,mt)?xt=ut==null?void 0:ut.labels[mt]:ut!=null&&ut.default&&String(ut.default).length>0&&(xt=ut==null?void 0:ut.default)}else ut!=null&&ut.default&&String(ut==null?void 0:ut.default).length>0&&(xt=ut==null?void 0:ut.default);if(ht.includes("collaborativewall")&&ht.includes("id")&&st&&window.zE("webWidget","hide"),xt.includes("${adml}")&&(rt?xt=xt.replace("${adml}","adml"):xt=xt.replace("/${adml}","")),xt.includes("${profile}")){const yt=et==null?void 0:et.profiles;xt=xt.replace("${profile}",yt[0].toLowerCase())}xt.includes("${theme")&&(nt!=null&&nt.is1d?xt=xt.replace("${theme}","1D"):xt=xt.replace("${theme}","2D")),window.zE("webWidget","helpCenter:setSuggestions",{labels:[xt]})};return reactExports.useEffect(()=>{window.location.pathname!==at&&lt(window.location.pathname),!(ut===void 0||Object.keys(ut).length===0)&&dt()},[window.location.pathname,ut]),reactExports.useEffect(()=>{document.getElementById("ze-snippet")||ot===void 0||(async()=>{const ht=await odeServices.http().get("/zendeskGuide/config");if(ht&&ht.key&&ht.key!==""){const mt=document.createElement("script");mt.id="ze-snippet",mt.src=`https://static.zdassets.com/ekr/snippet.js?key=${ht.key}`,document.body.appendChild(mt).onload=()=>{tt==="es"?window.zE(function(){window.zE.setLocale("es-419")}):window.zE(function(){window.zE.setLocale("fr")}),Object.keys(ht.module).length>0&&ct(ht.module),window.zE("webWidget","show"),window.zE("webWidget","updateSettings",{webWidget:{color:{theme:ht.color||"#ffc400"},zIndex:3,launcher:{mobile:{labelVisible:!0}},contactForm:{suppress:!ot},helpCenter:{messageButton:{"*":"Assistance ENT","es-419":"Asistencia ENT"}}}}),window.addEventListener("scroll",()=>{window.zE("webWidget","updateSettings",{webWidget:{launcher:{mobile:{labelVisible:window.scrollY<=5}}}})}),window.zE("webWidget:on","open",function(){ot&&window.zE("webWidget","updateSettings",{webWidget:{contactForm:{suppress:!1}}})}),window.zE("webWidget:on","userEvent",function(xt){const yt=xt.category,vt=xt.action,Et=xt.properties;vt==="Contact Form Shown"&&yt==="Zendesk Web Widget"&&Et&&Et.name==="contact-form"&&ot&&(window.zE("webWidget","updateSettings",{webWidget:{contactForm:{suppress:!0}}}),window.zE("webWidget","close"),window.open("/support","_blank"))})}}})()},[ot]),null}const ComboboxTrigger=({placeholder:tt,value:et="",searchMinLength:rt=3,handleSearchInputChange:nt})=>{const{triggerProps:st,itemProps:ot,setVisible:at}=useDropdownContext(),lt={...st,role:"combobox",onClick:()=>{et.length>=rt&&at(!0)},onChange:nt};return reactExports.useEffect(()=>{at(et.length>=rt)},[at,et,rt]),jsxRuntimeExports.jsx(FormControl,{className:"d-flex align-items-center",id:"search",children:jsxRuntimeExports.jsx(Input,{...lt,className:"max-w-512",noValidationIcon:!0,placeholder:tt,size:"md",type:"search",onKeyDown:ot.onMenuItemKeyDown})})},Combobox=({onSearchResultsChange:tt,onSearchInputChange:et,options:rt,value:nt,isLoading:st,noResult:ot,searchMinLength:at,placeholder:lt})=>{const{t:ut}=useTranslation(),[ct,dt]=reactExports.useState([]);reactExports.useEffect(()=>{tt(ct)},[ct]);const ht=xt=>{dt([xt])},mt=()=>st?jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center p-4",children:[jsxRuntimeExports.jsx(Loading,{isLoading:st}),jsxRuntimeExports.jsx("span",{className:"ps-4",children:ut("explorer.search.pending")})]}):ot?jsxRuntimeExports.jsx("div",{className:"p-4",children:ut("portal.no.result")}):rt.map((xt,yt)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{type:"select",icon:xt.icon,onClick:()=>ht(xt.value),children:xt.label}),yt<rt.length-1&&jsxRuntimeExports.jsx(Dropdown.Separator,{})]},yt));return jsxRuntimeExports.jsxs(Dropdown,{block:!0,children:[jsxRuntimeExports.jsx(Combobox.Trigger,{placeholder:lt,searchMinLength:at,handleSearchInputChange:et,value:nt}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:mt()})]})};Combobox.Trigger=ComboboxTrigger;const Grid=({children:tt,className:et,...rt})=>{const nt=clsx("grid",et);return jsxRuntimeExports.jsx("div",{className:nt,...rt,children:tt})},Column=({sm:tt,md:et,lg:rt,xl:nt,children:st,className:ot,as:at,...lt})=>{const ut=at||"div",ct=clsx({[`g-col-${tt}`]:tt,[et?`g-col-md-${et}`:""]:et,[rt?`g-col-lg-${rt}`:""]:rt,[nt?`g-col-xl-${nt}`:""]:nt},ot);return jsxRuntimeExports.jsx(ut,{className:ct,...lt,children:st})};Grid.Col=Column;const SvgIconCommunity=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M19.935 17.51q1.088 0 1.868.792.78.794.78 1.898 0 1.106-.78 1.898-.78.793-1.844.793t-1.869-.793a2.52 2.52 0 0 1-.78-1.922q0-.432.19-.936l-3.997-2.931q-1.16 1.2-2.79 1.2-1.633 0-2.791-1.176-1.16-1.177-1.183-2.86 0-.215.071-.624l-3.168-1.057a1.25 1.25 0 0 1-.852.337q-.567 0-.946-.385a1.32 1.32 0 0 1-.378-.96q0-.578.378-.938.38-.36.946-.384.474 0 .804.312.33.313.45.745l3.192 1.08a3.8 3.8 0 0 1 1.443-1.56 3.84 3.84 0 0 1 2.033-.577q1.23 0 2.27.745l4.706-4.781q-.378-.72-.378-1.321 0-1.106.78-1.898.78-.793 1.869-.793t1.844.793q.758.792.78 1.898a2.42 2.42 0 0 1-.78 1.873q-.804.77-1.868.793-.616 0-1.3-.408l-4.707 4.805q.734 1.056.733 2.306 0 .888-.402 1.753l3.997 2.907q.78-.624 1.679-.624"})]}),SvgIconDisconnect=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M22.996 13.153q0 2.09-.873 3.987a10.6 10.6 0 0 1-2.336 3.292q-1.462 1.393-3.516 2.21t-4.26.817-4.287-.817-3.49-2.21a12.3 12.3 0 0 1-2.362-3.291A8.1 8.1 0 0 1 1 13.153q0-2.451 1.155-4.589t3.234-3.627q.616-.433 1.386-.337t1.181.673q.462.553.36 1.273-.104.72-.72 1.13a7 7 0 0 0-2.155 2.426 6.38 6.38 0 0 0-.18 5.717 7 7 0 0 0 1.566 2.186q.975.913 2.335 1.466a7.5 7.5 0 0 0 2.85.552 7.3 7.3 0 0 0 2.823-.552 8.3 8.3 0 0 0 2.36-1.466 6.04 6.04 0 0 0 1.567-2.186q.538-1.274.564-2.666 0-1.635-.77-3.051T16.4 7.675a1.75 1.75 0 0 1-.719-1.129q-.128-.697.36-1.273.436-.577 1.206-.673t1.36.337q2.079 1.466 3.234 3.627a9.6 9.6 0 0 1 1.155 4.589M13.833 2.846v8.6q0 .698-.54 1.202-.538.505-1.283.505t-1.309-.505q-.564-.505-.539-1.201v-8.6q0-.697.54-1.202.538-.504 1.308-.504t1.284.504.539 1.201"})]}),SvgIconHome=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M20.584 13.536v7.458q0 .42-.294.699a1.06 1.06 0 0 1-.667.307H13.91v-5.978h-3.817V22H4.383a.85.85 0 0 1-.668-.307 1.16 1.16 0 0 1-.293-.699v-7.569l8.567-7.375 8.568 7.375q.027.027.027.111m3.31-1.09-.908 1.146a.54.54 0 0 1-.32.168h-.054a.6.6 0 0 1-.32-.084L11.989 4.682 1.687 13.676a.5.5 0 0 1-.347.084.54.54 0 0 1-.32-.168l-.935-1.145a.52.52 0 0 1-.08-.363.6.6 0 0 1 .16-.335l10.703-9.33q.48-.42 1.121-.419.64 0 1.148.419l3.63 3.156V2.56q0-.224.133-.363a.46.46 0 0 1 .347-.14h2.856q.214 0 .347.14a.5.5 0 0 1 .134.363v6.34l3.256 2.85q.16.111.16.335 0 .223-.107.363"})]}),SvgIconMyApps=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.898 22.555c-.072-.145-.096-1.37-.048-2.691l.048-2.402h5.261v5.26l-2.595.049c-1.994.048-2.594 0-2.666-.216m7.76 0c-.049-.145-.073-1.37-.049-2.691l.072-2.402h5.238v5.26l-2.571.049c-2.018.048-2.595 0-2.69-.216m7.759 0c-.048-.145-.072-1.37-.048-2.691l.072-2.402h5.237v5.26l-2.57.049c-1.994.048-2.595 0-2.691-.216m-15.52-7.76c-.071-.168-.095-1.37-.047-2.69l.048-2.403h5.261v5.261l-2.595.048c-1.994.048-2.594 0-2.666-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.238v5.261l-2.571.048c-2.018.048-2.595 0-2.69-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.237v5.261l-2.57.048c-1.994.048-2.595 0-2.691-.216M1.897 7.011c-.071-.144-.095-1.345-.047-2.666l.048-2.402h5.261V7.18l-2.595.072c-1.994.048-2.594 0-2.666-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.238V7.18l-2.571.072c-2.018.048-2.595 0-2.69-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.237V7.18l-2.57.072c-1.994.048-2.595 0-2.691-.24"})]}),SvgIconNeoMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m.5 21.257 7.46-8.216 4.052 2.403 4.052-2.403 7.46 8.216zm0-2.738V8.573l5.848 3.531zm0-12.084V3.048h23.024v3.387l-11.512 6.847zm17.176 5.67 5.848-3.532v9.946z"})]}),SvgIconNewRelease=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M13.07 13.07V6.54h-2.14v6.53zm0 4.4v-2.2h-2.14v2.2zM24 12l-2.65 3.01.35 4.04-3.93.86-2.04 3.48L12 21.8l-3.73 1.6-2.04-3.42-3.93-.92.35-4.04L0 12l2.65-3.06-.35-3.99 3.93-.86L8.27.6 12 2.2 15.73.6l2.04 3.48 3.93.86L21.34 9z"})]}),SvgIconOneMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.051 12.366a456 456 0 0 1-2.746-1.822A6.5 6.5 0 0 1 .74 9.067q-.737-.94-.737-1.745a2.7 2.7 0 0 1 .141-.905c.098-.286.242-.542.424-.752Q1.12 5 2.15 5h19.7c.541-.016 1.071.195 1.507.6q.636.6.636 1.446 0 1.01-.657 1.93a6.2 6.2 0 0 1-1.632 1.567q-5.037 3.338-6.267 4.156l-.242.167-.323.222q-.436.303-.724.487-.288.183-.696.415a4 4 0 0 1-.77.345 2.2 2.2 0 0 1-.67.115h-.026a2.2 2.2 0 0 1-.67-.116 4 4 0 0 1-.77-.344q-.41-.23-.697-.415a30 30 0 0 1-.723-.487q-.433-.3-.565-.389-1.215-.817-3.51-2.334m10.943 3.962q2.276-1.578 6.667-4.416c.478-.306.927-.68 1.339-1.113v10.16q0 .845-.63 1.446c-.437.405-.97.614-1.512.594H2.149c-.545.02-1.08-.192-1.52-.601C.21 21.996 0 21.52 0 20.95V10.8c.416.437.871.81 1.356 1.113q4.848 3.148 6.656 4.416.768.537 1.243.837a7.7 7.7 0 0 0 1.265.614c.475.198.97.303 1.47.313h.026c.5-.01.995-.115 1.47-.313a7.7 7.7 0 0 0 1.265-.614q.48-.3 1.243-.837",clipRule:"evenodd"})]}),SvgIconUserbook=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M0 24.58V.53h24.05v4.28h-2.62V7.1h2.62v4.28h-2.62v2.35h2.62V18h-2.62v2.3h2.62v4.29H0zm4.64-6.85h12.12V14l-4.5-2.67q.9-.46 1.4-1.3t.53-1.85q0-1.4-1.01-2.43T10.7 4.72 8.25 5.75 7.24 8.18q0 1.03.53 1.85t1.4 1.3L4.63 14v3.73z"})]});var updateQueue=makeQueue(),raf=tt=>schedule(tt,updateQueue),writeQueue=makeQueue();raf.write=tt=>schedule(tt,writeQueue);var onStartQueue=makeQueue();raf.onStart=tt=>schedule(tt,onStartQueue);var onFrameQueue=makeQueue();raf.onFrame=tt=>schedule(tt,onFrameQueue);var onFinishQueue=makeQueue();raf.onFinish=tt=>schedule(tt,onFinishQueue);var timeouts=[];raf.setTimeout=(tt,et)=>{const rt=raf.now()+et,nt=()=>{const ot=timeouts.findIndex(at=>at.cancel==nt);~ot&&timeouts.splice(ot,1),pendingCount-=~ot?1:0},st={time:rt,handler:tt,cancel:nt};return timeouts.splice(findTimeout(rt),0,st),pendingCount+=1,start$3(),st};var findTimeout=tt=>~(~timeouts.findIndex(et=>et.time>tt)||~timeouts.length);raf.cancel=tt=>{onStartQueue.delete(tt),onFrameQueue.delete(tt),onFinishQueue.delete(tt),updateQueue.delete(tt),writeQueue.delete(tt)};raf.sync=tt=>{sync=!0,raf.batchedUpdates(tt),sync=!1};raf.throttle=tt=>{let et;function rt(){try{tt(...et)}finally{et=null}}function nt(...st){et=st,raf.onStart(rt)}return nt.handler=tt,nt.cancel=()=>{onStartQueue.delete(rt),et=null},nt};var nativeRaf=typeof window<"u"?window.requestAnimationFrame:()=>{};raf.use=tt=>nativeRaf=tt;raf.now=typeof performance<"u"?()=>performance.now():Date.now;raf.batchedUpdates=tt=>tt();raf.catch=console.error;raf.frameLoop="always";raf.advance=()=>{raf.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):update$1()};var ts=-1,pendingCount=0,sync=!1;function schedule(tt,et){sync?(et.delete(tt),tt(0)):(et.add(tt),start$3())}function start$3(){ts<0&&(ts=0,raf.frameLoop!=="demand"&&nativeRaf(loop$1))}function stop$3(){ts=-1}function loop$1(){~ts&&(nativeRaf(loop$1),raf.batchedUpdates(update$1))}function update$1(){const tt=ts;ts=raf.now();const et=findTimeout(ts);if(et&&(eachSafely(timeouts.splice(0,et),rt=>rt.handler()),pendingCount-=et),!pendingCount){stop$3();return}onStartQueue.flush(),updateQueue.flush(tt?Math.min(64,ts-tt):16.667),onFrameQueue.flush(),writeQueue.flush(),onFinishQueue.flush()}function makeQueue(){let tt=new Set,et=tt;return{add(rt){pendingCount+=et==tt&&!tt.has(rt)?1:0,tt.add(rt)},delete(rt){return pendingCount-=et==tt&&tt.has(rt)?1:0,tt.delete(rt)},flush(rt){et.size&&(tt=new Set,pendingCount-=et.size,eachSafely(et,nt=>nt(rt)&&tt.add(nt)),pendingCount+=tt.size,et=tt)}}}function eachSafely(tt,et){tt.forEach(rt=>{try{et(rt)}catch(nt){raf.catch(nt)}})}var __defProp=Object.defineProperty,__export=(tt,et)=>{for(var rt in et)__defProp(tt,rt,{get:et[rt],enumerable:!0})},globals_exports={};__export(globals_exports,{assign:()=>assign$1,colors:()=>colors,createStringInterpolator:()=>createStringInterpolator,skipAnimation:()=>skipAnimation,to:()=>to,willAdvance:()=>willAdvance});function noop(){}var defineHidden=(tt,et,rt)=>Object.defineProperty(tt,et,{value:rt,writable:!0,configurable:!0}),is$2={arr:Array.isArray,obj:tt=>!!tt&&tt.constructor.name==="Object",fun:tt=>typeof tt=="function",str:tt=>typeof tt=="string",num:tt=>typeof tt=="number",und:tt=>tt===void 0};function isEqual(tt,et){if(is$2.arr(tt)){if(!is$2.arr(et)||tt.length!==et.length)return!1;for(let rt=0;rt<tt.length;rt++)if(tt[rt]!==et[rt])return!1;return!0}return tt===et}var each=(tt,et)=>tt.forEach(et);function eachProp(tt,et,rt){if(is$2.arr(tt)){for(let nt=0;nt<tt.length;nt++)et.call(rt,tt[nt],`${nt}`);return}for(const nt in tt)tt.hasOwnProperty(nt)&&et.call(rt,tt[nt],nt)}var toArray=tt=>is$2.und(tt)?[]:is$2.arr(tt)?tt:[tt];function flush(tt,et){if(tt.size){const rt=Array.from(tt);tt.clear(),each(rt,et)}}var flushCalls=(tt,...et)=>flush(tt,rt=>rt(...et)),isSSR=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),createStringInterpolator,to,colors=null,skipAnimation=!1,willAdvance=noop,assign$1=tt=>{tt.to&&(to=tt.to),tt.now&&(raf.now=tt.now),tt.colors!==void 0&&(colors=tt.colors),tt.skipAnimation!=null&&(skipAnimation=tt.skipAnimation),tt.createStringInterpolator&&(createStringInterpolator=tt.createStringInterpolator),tt.requestAnimationFrame&&raf.use(tt.requestAnimationFrame),tt.batchedUpdates&&(raf.batchedUpdates=tt.batchedUpdates),tt.willAdvance&&(willAdvance=tt.willAdvance),tt.frameLoop&&(raf.frameLoop=tt.frameLoop)},startQueue=new Set,currentFrame=[],prevFrame=[],priority=0,frameLoop={get idle(){return!startQueue.size&&!currentFrame.length},start(tt){priority>tt.priority?(startQueue.add(tt),raf.onStart(flushStartQueue)):(startSafely(tt),raf(advance))},advance,sort(tt){if(priority)raf.onFrame(()=>frameLoop.sort(tt));else{const et=currentFrame.indexOf(tt);~et&&(currentFrame.splice(et,1),startUnsafely(tt))}},clear(){currentFrame=[],startQueue.clear()}};function flushStartQueue(){startQueue.forEach(startSafely),startQueue.clear(),raf(advance)}function startSafely(tt){currentFrame.includes(tt)||startUnsafely(tt)}function startUnsafely(tt){currentFrame.splice(findIndex(currentFrame,et=>et.priority>tt.priority),0,tt)}function advance(tt){const et=prevFrame;for(let rt=0;rt<currentFrame.length;rt++){const nt=currentFrame[rt];priority=nt.priority,nt.idle||(willAdvance(nt),nt.advance(tt),nt.idle||et.push(nt))}return priority=0,prevFrame=currentFrame,prevFrame.length=0,currentFrame=et,currentFrame.length>0}function findIndex(tt,et){const rt=tt.findIndex(et);return rt<0?tt.length:rt}var clamp=(tt,et,rt)=>Math.min(Math.max(rt,tt),et),colors2={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},NUMBER="[-+]?\\d*\\.?\\d+",PERCENTAGE=NUMBER+"%";function call(...tt){return"\\(\\s*("+tt.join(")\\s*,\\s*(")+")\\s*\\)"}var rgb=new RegExp("rgb"+call(NUMBER,NUMBER,NUMBER)),rgba=new RegExp("rgba"+call(NUMBER,NUMBER,NUMBER,NUMBER)),hsl=new RegExp("hsl"+call(NUMBER,PERCENTAGE,PERCENTAGE)),hsla=new RegExp("hsla"+call(NUMBER,PERCENTAGE,PERCENTAGE,NUMBER)),hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6=/^#([0-9a-fA-F]{6})$/,hex8=/^#([0-9a-fA-F]{8})$/;function normalizeColor(tt){let et;return typeof tt=="number"?tt>>>0===tt&&tt>=0&&tt<=4294967295?tt:null:(et=hex6.exec(tt))?parseInt(et[1]+"ff",16)>>>0:colors&&colors[tt]!==void 0?colors[tt]:(et=rgb.exec(tt))?(parse255(et[1])<<24|parse255(et[2])<<16|parse255(et[3])<<8|255)>>>0:(et=rgba.exec(tt))?(parse255(et[1])<<24|parse255(et[2])<<16|parse255(et[3])<<8|parse1(et[4]))>>>0:(et=hex3.exec(tt))?parseInt(et[1]+et[1]+et[2]+et[2]+et[3]+et[3]+"ff",16)>>>0:(et=hex8.exec(tt))?parseInt(et[1],16)>>>0:(et=hex4.exec(tt))?parseInt(et[1]+et[1]+et[2]+et[2]+et[3]+et[3]+et[4]+et[4],16)>>>0:(et=hsl.exec(tt))?(hslToRgb(parse360(et[1]),parsePercentage(et[2]),parsePercentage(et[3]))|255)>>>0:(et=hsla.exec(tt))?(hslToRgb(parse360(et[1]),parsePercentage(et[2]),parsePercentage(et[3]))|parse1(et[4]))>>>0:null}function hue2rgb(tt,et,rt){return rt<0&&(rt+=1),rt>1&&(rt-=1),rt<1/6?tt+(et-tt)*6*rt:rt<1/2?et:rt<2/3?tt+(et-tt)*(2/3-rt)*6:tt}function hslToRgb(tt,et,rt){const nt=rt<.5?rt*(1+et):rt+et-rt*et,st=2*rt-nt,ot=hue2rgb(st,nt,tt+1/3),at=hue2rgb(st,nt,tt),lt=hue2rgb(st,nt,tt-1/3);return Math.round(ot*255)<<24|Math.round(at*255)<<16|Math.round(lt*255)<<8}function parse255(tt){const et=parseInt(tt,10);return et<0?0:et>255?255:et}function parse360(tt){return(parseFloat(tt)%360+360)%360/360}function parse1(tt){const et=parseFloat(tt);return et<0?0:et>1?255:Math.round(et*255)}function parsePercentage(tt){const et=parseFloat(tt);return et<0?0:et>100?1:et/100}function colorToRgba(tt){let et=normalizeColor(tt);if(et===null)return tt;et=et||0;const rt=(et&4278190080)>>>24,nt=(et&16711680)>>>16,st=(et&65280)>>>8,ot=(et&255)/255;return`rgba(${rt}, ${nt}, ${st}, ${ot})`}var createInterpolator=(tt,et,rt)=>{if(is$2.fun(tt))return tt;if(is$2.arr(tt))return createInterpolator({range:tt,output:et,extrapolate:rt});if(is$2.str(tt.output[0]))return createStringInterpolator(tt);const nt=tt,st=nt.output,ot=nt.range||[0,1],at=nt.extrapolateLeft||nt.extrapolate||"extend",lt=nt.extrapolateRight||nt.extrapolate||"extend",ut=nt.easing||(ct=>ct);return ct=>{const dt=findRange(ct,ot);return interpolate(ct,ot[dt],ot[dt+1],st[dt],st[dt+1],ut,at,lt,nt.map)}};function interpolate(tt,et,rt,nt,st,ot,at,lt,ut){let ct=ut?ut(tt):tt;if(ct<et){if(at==="identity")return ct;at==="clamp"&&(ct=et)}if(ct>rt){if(lt==="identity")return ct;lt==="clamp"&&(ct=rt)}return nt===st?nt:et===rt?tt<=et?nt:st:(et===-1/0?ct=-ct:rt===1/0?ct=ct-et:ct=(ct-et)/(rt-et),ct=ot(ct),nt===-1/0?ct=-ct:st===1/0?ct=ct+nt:ct=ct*(st-nt)+nt,ct)}function findRange(tt,et){for(var rt=1;rt<et.length-1&&!(et[rt]>=tt);++rt);return rt-1}var steps=(tt,et="end")=>rt=>{rt=et==="end"?Math.min(rt,.999):Math.max(rt,.001);const nt=rt*tt,st=et==="end"?Math.floor(nt):Math.ceil(nt);return clamp(0,1,st/tt)},c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*Math.PI/3,c5=2*Math.PI/4.5,bounceOut=tt=>tt<1/2.75?7.5625*tt*tt:tt<2/2.75?7.5625*(tt-=1.5/2.75)*tt+.75:tt<2.5/2.75?7.5625*(tt-=2.25/2.75)*tt+.9375:7.5625*(tt-=2.625/2.75)*tt+.984375,easings={linear:tt=>tt,easeInQuad:tt=>tt*tt,easeOutQuad:tt=>1-(1-tt)*(1-tt),easeInOutQuad:tt=>tt<.5?2*tt*tt:1-Math.pow(-2*tt+2,2)/2,easeInCubic:tt=>tt*tt*tt,easeOutCubic:tt=>1-Math.pow(1-tt,3),easeInOutCubic:tt=>tt<.5?4*tt*tt*tt:1-Math.pow(-2*tt+2,3)/2,easeInQuart:tt=>tt*tt*tt*tt,easeOutQuart:tt=>1-Math.pow(1-tt,4),easeInOutQuart:tt=>tt<.5?8*tt*tt*tt*tt:1-Math.pow(-2*tt+2,4)/2,easeInQuint:tt=>tt*tt*tt*tt*tt,easeOutQuint:tt=>1-Math.pow(1-tt,5),easeInOutQuint:tt=>tt<.5?16*tt*tt*tt*tt*tt:1-Math.pow(-2*tt+2,5)/2,easeInSine:tt=>1-Math.cos(tt*Math.PI/2),easeOutSine:tt=>Math.sin(tt*Math.PI/2),easeInOutSine:tt=>-(Math.cos(Math.PI*tt)-1)/2,easeInExpo:tt=>tt===0?0:Math.pow(2,10*tt-10),easeOutExpo:tt=>tt===1?1:1-Math.pow(2,-10*tt),easeInOutExpo:tt=>tt===0?0:tt===1?1:tt<.5?Math.pow(2,20*tt-10)/2:(2-Math.pow(2,-20*tt+10))/2,easeInCirc:tt=>1-Math.sqrt(1-Math.pow(tt,2)),easeOutCirc:tt=>Math.sqrt(1-Math.pow(tt-1,2)),easeInOutCirc:tt=>tt<.5?(1-Math.sqrt(1-Math.pow(2*tt,2)))/2:(Math.sqrt(1-Math.pow(-2*tt+2,2))+1)/2,easeInBack:tt=>c3*tt*tt*tt-c1*tt*tt,easeOutBack:tt=>1+c3*Math.pow(tt-1,3)+c1*Math.pow(tt-1,2),easeInOutBack:tt=>tt<.5?Math.pow(2*tt,2)*((c2+1)*2*tt-c2)/2:(Math.pow(2*tt-2,2)*((c2+1)*(tt*2-2)+c2)+2)/2,easeInElastic:tt=>tt===0?0:tt===1?1:-Math.pow(2,10*tt-10)*Math.sin((tt*10-10.75)*c4),easeOutElastic:tt=>tt===0?0:tt===1?1:Math.pow(2,-10*tt)*Math.sin((tt*10-.75)*c4)+1,easeInOutElastic:tt=>tt===0?0:tt===1?1:tt<.5?-(Math.pow(2,20*tt-10)*Math.sin((20*tt-11.125)*c5))/2:Math.pow(2,-20*tt+10)*Math.sin((20*tt-11.125)*c5)/2+1,easeInBounce:tt=>1-bounceOut(1-tt),easeOutBounce:bounceOut,easeInOutBounce:tt=>tt<.5?(1-bounceOut(1-2*tt))/2:(1+bounceOut(2*tt-1))/2,steps},$get=Symbol.for("FluidValue.get"),$observers=Symbol.for("FluidValue.observers"),hasFluidValue=tt=>!!(tt&&tt[$get]),getFluidValue=tt=>tt&&tt[$get]?tt[$get]():tt,getFluidObservers=tt=>tt[$observers]||null;function callFluidObserver(tt,et){tt.eventObserved?tt.eventObserved(et):tt(et)}function callFluidObservers(tt,et){const rt=tt[$observers];rt&&rt.forEach(nt=>{callFluidObserver(nt,et)})}var FluidValue=class{constructor(tt){if(!tt&&!(tt=this.get))throw Error("Unknown getter");setFluidGetter(this,tt)}},setFluidGetter=(tt,et)=>setHidden(tt,$get,et);function addFluidObserver(tt,et){if(tt[$get]){let rt=tt[$observers];rt||setHidden(tt,$observers,rt=new Set),rt.has(et)||(rt.add(et),tt.observerAdded&&tt.observerAdded(rt.size,et))}return et}function removeFluidObserver(tt,et){const rt=tt[$observers];if(rt&&rt.has(et)){const nt=rt.size-1;nt?rt.delete(et):tt[$observers]=null,tt.observerRemoved&&tt.observerRemoved(nt,et)}}var setHidden=(tt,et,rt)=>Object.defineProperty(tt,et,{value:rt,writable:!0,configurable:!0}),numberRegex=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,colorRegex=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,unitRegex=new RegExp(`(${numberRegex.source})(%|[a-z]+)`,"i"),rgbaRegex=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,variableToRgba=tt=>{const[et,rt]=parseCSSVariable(tt);if(!et||isSSR())return tt;const nt=window.getComputedStyle(document.documentElement).getPropertyValue(et);if(nt)return nt.trim();if(rt&&rt.startsWith("--")){const st=window.getComputedStyle(document.documentElement).getPropertyValue(rt);return st||tt}else{if(rt&&cssVariableRegex.test(rt))return variableToRgba(rt);if(rt)return rt}return tt},parseCSSVariable=tt=>{const et=cssVariableRegex.exec(tt);if(!et)return[,];const[,rt,nt]=et;return[rt,nt]},namedColorRegex,rgbaRound=(tt,et,rt,nt,st)=>`rgba(${Math.round(et)}, ${Math.round(rt)}, ${Math.round(nt)}, ${st})`,createStringInterpolator2=tt=>{namedColorRegex||(namedColorRegex=colors?new RegExp(`(${Object.keys(colors).join("|")})(?!\\w)`,"g"):/^\b$/);const et=tt.output.map(ot=>getFluidValue(ot).replace(cssVariableRegex,variableToRgba).replace(colorRegex,colorToRgba).replace(namedColorRegex,colorToRgba)),rt=et.map(ot=>ot.match(numberRegex).map(Number)),st=rt[0].map((ot,at)=>rt.map(lt=>{if(!(at in lt))throw Error('The arity of each "output" value must be equal');return lt[at]})).map(ot=>createInterpolator({...tt,output:ot}));return ot=>{var ut;const at=!unitRegex.test(et[0])&&((ut=et.find(ct=>unitRegex.test(ct)))==null?void 0:ut.replace(numberRegex,""));let lt=0;return et[0].replace(numberRegex,()=>`${st[lt++](ot)}${at||""}`).replace(rgbaRegex,rgbaRound)}},prefix="react-spring: ",once=tt=>{const et=tt;let rt=!1;if(typeof et!="function")throw new TypeError(`${prefix}once requires a function parameter`);return(...nt)=>{rt||(et(...nt),rt=!0)}},warnInterpolate=once(console.warn);function deprecateInterpolate(){warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var warnDirectCall=once(console.warn);function deprecateDirectCall(){warnDirectCall(`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function isAnimatedString(tt){return is$2.str(tt)&&(tt[0]=="#"||/\d/.test(tt)||!isSSR()&&cssVariableRegex.test(tt)||tt in(colors||{}))}var useIsomorphicLayoutEffect$1=isSSR()?reactExports.useEffect:reactExports.useLayoutEffect,useIsMounted=()=>{const tt=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>(tt.current=!0,()=>{tt.current=!1}),[]),tt};function useForceUpdate(){const tt=reactExports.useState()[1],et=useIsMounted();return()=>{et.current&&tt(Math.random())}}function useMemoOne(tt,et){const[rt]=reactExports.useState(()=>({inputs:et,result:tt()})),nt=reactExports.useRef(),st=nt.current;let ot=st;return ot?ot.inputs&&areInputsEqual(et,ot.inputs)||(ot={inputs:et,result:tt()}):ot=rt,reactExports.useEffect(()=>{nt.current=ot,st==rt&&(rt.inputs=rt.result=void 0)},[ot]),ot.result}function areInputsEqual(tt,et){if(tt.length!==et.length)return!1;for(let rt=0;rt<tt.length;rt++)if(tt[rt]!==et[rt])return!1;return!0}var useOnce=tt=>reactExports.useEffect(tt,emptyDeps),emptyDeps=[];function usePrev(tt){const et=reactExports.useRef();return reactExports.useEffect(()=>{et.current=tt}),et.current}var $node=Symbol.for("Animated:node"),isAnimated=tt=>!!tt&&tt[$node]===tt,getAnimated=tt=>tt&&tt[$node],setAnimated=(tt,et)=>defineHidden(tt,$node,et),getPayload=tt=>tt&&tt[$node]&&tt[$node].getPayload(),Animated=class{constructor(){setAnimated(this,this)}getPayload(){return this.payload||[]}},AnimatedValue=class extends Animated{constructor(tt){super(),this._value=tt,this.done=!0,this.durationProgress=0,is$2.num(this._value)&&(this.lastPosition=this._value)}static create(tt){return new AnimatedValue(tt)}getPayload(){return[this]}getValue(){return this._value}setValue(tt,et){return is$2.num(tt)&&(this.lastPosition=tt,et&&(tt=Math.round(tt/et)*et,this.done&&(this.lastPosition=tt))),this._value===tt?!1:(this._value=tt,!0)}reset(){const{done:tt}=this;this.done=!1,is$2.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,tt&&(this.lastVelocity=null),this.v0=null)}},AnimatedString=class extends AnimatedValue{constructor(tt){super(0),this._string=null,this._toString=createInterpolator({output:[tt,tt]})}static create(tt){return new AnimatedString(tt)}getValue(){const tt=this._string;return tt??(this._string=this._toString(this._value))}setValue(tt){if(is$2.str(tt)){if(tt==this._string)return!1;this._string=tt,this._value=1}else if(super.setValue(tt))this._string=null;else return!1;return!0}reset(tt){tt&&(this._toString=createInterpolator({output:[this.getValue(),tt]})),this._value=0,super.reset()}},TreeContext={dependencies:null},AnimatedObject=class extends Animated{constructor(tt){super(),this.source=tt,this.setValue(tt)}getValue(tt){const et={};return eachProp(this.source,(rt,nt)=>{isAnimated(rt)?et[nt]=rt.getValue(tt):hasFluidValue(rt)?et[nt]=getFluidValue(rt):tt||(et[nt]=rt)}),et}setValue(tt){this.source=tt,this.payload=this._makePayload(tt)}reset(){this.payload&&each(this.payload,tt=>tt.reset())}_makePayload(tt){if(tt){const et=new Set;return eachProp(tt,this._addToPayload,et),Array.from(et)}}_addToPayload(tt){TreeContext.dependencies&&hasFluidValue(tt)&&TreeContext.dependencies.add(tt);const et=getPayload(tt);et&&each(et,rt=>this.add(rt))}},AnimatedArray=class extends AnimatedObject{constructor(tt){super(tt)}static create(tt){return new AnimatedArray(tt)}getValue(){return this.source.map(tt=>tt.getValue())}setValue(tt){const et=this.getPayload();return tt.length==et.length?et.map((rt,nt)=>rt.setValue(tt[nt])).some(Boolean):(super.setValue(tt.map(makeAnimated)),!0)}};function makeAnimated(tt){return(isAnimatedString(tt)?AnimatedString:AnimatedValue).create(tt)}function getAnimatedType(tt){const et=getAnimated(tt);return et?et.constructor:is$2.arr(tt)?AnimatedArray:isAnimatedString(tt)?AnimatedString:AnimatedValue}var withAnimated=(tt,et)=>{const rt=!is$2.fun(tt)||tt.prototype&&tt.prototype.isReactComponent;return reactExports.forwardRef((nt,st)=>{const ot=reactExports.useRef(null),at=rt&&reactExports.useCallback(yt=>{ot.current=updateRef(st,yt)},[st]),[lt,ut]=getAnimatedState(nt,et),ct=useForceUpdate(),dt=()=>{const yt=ot.current;if(rt&&!yt)return;(yt?et.applyAnimatedValues(yt,lt.getValue(!0)):!1)===!1&&ct()},ht=new PropsObserver(dt,ut),mt=reactExports.useRef();useIsomorphicLayoutEffect$1(()=>(mt.current=ht,each(ut,yt=>addFluidObserver(yt,ht)),()=>{mt.current&&(each(mt.current.deps,yt=>removeFluidObserver(yt,mt.current)),raf.cancel(mt.current.update))})),reactExports.useEffect(dt,[]),useOnce(()=>()=>{const yt=mt.current;each(yt.deps,vt=>removeFluidObserver(vt,yt))});const xt=et.getComponentProps(lt.getValue());return reactExports.createElement(tt,{...xt,ref:at})})},PropsObserver=class{constructor(tt,et){this.update=tt,this.deps=et}eventObserved(tt){tt.type=="change"&&raf.write(this.update)}};function getAnimatedState(tt,et){const rt=new Set;return TreeContext.dependencies=rt,tt.style&&(tt={...tt,style:et.createAnimatedStyle(tt.style)}),tt=new AnimatedObject(tt),TreeContext.dependencies=null,[tt,rt]}function updateRef(tt,et){return tt&&(is$2.fun(tt)?tt(et):tt.current=et),et}var cacheKey=Symbol.for("AnimatedComponent"),createHost=(tt,{applyAnimatedValues:et=()=>!1,createAnimatedStyle:rt=st=>new AnimatedObject(st),getComponentProps:nt=st=>st}={})=>{const st={applyAnimatedValues:et,createAnimatedStyle:rt,getComponentProps:nt},ot=at=>{const lt=getDisplayName(at)||"Anonymous";return is$2.str(at)?at=ot[at]||(ot[at]=withAnimated(at,st)):at=at[cacheKey]||(at[cacheKey]=withAnimated(at,st)),at.displayName=`Animated(${lt})`,at};return eachProp(tt,(at,lt)=>{is$2.arr(tt)&&(lt=getDisplayName(at)),ot[lt]=ot(at)}),{animated:ot}},getDisplayName=tt=>is$2.str(tt)?tt:tt&&is$2.str(tt.displayName)?tt.displayName:is$2.fun(tt)&&tt.name||null;function callProp(tt,...et){return is$2.fun(tt)?tt(...et):tt}var matchProp=(tt,et)=>tt===!0||!!(et&&tt&&(is$2.fun(tt)?tt(et):toArray(tt).includes(et))),resolveProp=(tt,et)=>is$2.obj(tt)?et&&tt[et]:tt,getDefaultProp=(tt,et)=>tt.default===!0?tt[et]:tt.default?tt.default[et]:void 0,noopTransform=tt=>tt,getDefaultProps=(tt,et=noopTransform)=>{let rt=DEFAULT_PROPS;tt.default&&tt.default!==!0&&(tt=tt.default,rt=Object.keys(tt));const nt={};for(const st of rt){const ot=et(tt[st],st);is$2.und(ot)||(nt[st]=ot)}return nt},DEFAULT_PROPS=["config","onProps","onStart","onChange","onPause","onResume","onRest"],RESERVED_PROPS={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function getForwardProps(tt){const et={};let rt=0;if(eachProp(tt,(nt,st)=>{RESERVED_PROPS[st]||(et[st]=nt,rt++)}),rt)return et}function inferTo(tt){const et=getForwardProps(tt);if(et){const rt={to:et};return eachProp(tt,(nt,st)=>st in et||(rt[st]=nt)),rt}return{...tt}}function computeGoal(tt){return tt=getFluidValue(tt),is$2.arr(tt)?tt.map(computeGoal):isAnimatedString(tt)?globals_exports.createStringInterpolator({range:[0,1],output:[tt,tt]})(1):tt}function hasProps(tt){for(const et in tt)return!0;return!1}function isAsyncTo(tt){return is$2.fun(tt)||is$2.arr(tt)&&is$2.obj(tt[0])}function detachRefs(tt,et){var rt;(rt=tt.ref)==null||rt.delete(tt),et==null||et.delete(tt)}function replaceRef(tt,et){var rt;et&&tt.ref!==et&&((rt=tt.ref)==null||rt.delete(tt),et.add(tt),tt.ref=et)}var config$1={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},defaults$4={...config$1.default,mass:1,damping:1,easing:easings.linear,clamp:!1},AnimationConfig=class{constructor(){this.velocity=0,Object.assign(this,defaults$4)}};function mergeConfig(tt,et,rt){rt&&(rt={...rt},sanitizeConfig(rt,et),et={...rt,...et}),sanitizeConfig(tt,et),Object.assign(tt,et);for(const at in defaults$4)tt[at]==null&&(tt[at]=defaults$4[at]);let{frequency:nt,damping:st}=tt;const{mass:ot}=tt;return is$2.und(nt)||(nt<.01&&(nt=.01),st<0&&(st=0),tt.tension=Math.pow(2*Math.PI/nt,2)*ot,tt.friction=4*Math.PI*st*ot/nt),tt}function sanitizeConfig(tt,et){if(!is$2.und(et.decay))tt.duration=void 0;else{const rt=!is$2.und(et.tension)||!is$2.und(et.friction);(rt||!is$2.und(et.frequency)||!is$2.und(et.damping)||!is$2.und(et.mass))&&(tt.duration=void 0,tt.decay=void 0),rt&&(tt.frequency=void 0)}}var emptyArray=[],Animation=class{constructor(){this.changed=!1,this.values=emptyArray,this.toValues=null,this.fromValues=emptyArray,this.config=new AnimationConfig,this.immediate=!1}};function scheduleProps(tt,{key:et,props:rt,defaultProps:nt,state:st,actions:ot}){return new Promise((at,lt)=>{let ut,ct,dt=matchProp(rt.cancel??(nt==null?void 0:nt.cancel),et);if(dt)xt();else{is$2.und(rt.pause)||(st.paused=matchProp(rt.pause,et));let yt=nt==null?void 0:nt.pause;yt!==!0&&(yt=st.paused||matchProp(yt,et)),ut=callProp(rt.delay||0,et),yt?(st.resumeQueue.add(mt),ot.pause()):(ot.resume(),mt())}function ht(){st.resumeQueue.add(mt),st.timeouts.delete(ct),ct.cancel(),ut=ct.time-raf.now()}function mt(){ut>0&&!globals_exports.skipAnimation?(st.delayed=!0,ct=raf.setTimeout(xt,ut),st.pauseQueue.add(ht),st.timeouts.add(ct)):xt()}function xt(){st.delayed&&(st.delayed=!1),st.pauseQueue.delete(ht),st.timeouts.delete(ct),tt<=(st.cancelId||0)&&(dt=!0);try{ot.start({...rt,callId:tt,cancel:dt},at)}catch(yt){lt(yt)}}})}var getCombinedResult=(tt,et)=>et.length==1?et[0]:et.some(rt=>rt.cancelled)?getCancelledResult(tt.get()):et.every(rt=>rt.noop)?getNoopResult(tt.get()):getFinishedResult(tt.get(),et.every(rt=>rt.finished)),getNoopResult=tt=>({value:tt,noop:!0,finished:!0,cancelled:!1}),getFinishedResult=(tt,et,rt=!1)=>({value:tt,finished:et,cancelled:rt}),getCancelledResult=tt=>({value:tt,cancelled:!0,finished:!1});function runAsync(tt,et,rt,nt){const{callId:st,parentId:ot,onRest:at}=et,{asyncTo:lt,promise:ut}=rt;return!ot&&tt===lt&&!et.reset?ut:rt.promise=(async()=>{rt.asyncId=st,rt.asyncTo=tt;const ct=getDefaultProps(et,(Et,bt)=>bt==="onRest"?void 0:Et);let dt,ht;const mt=new Promise((Et,bt)=>(dt=Et,ht=bt)),xt=Et=>{const bt=st<=(rt.cancelId||0)&&getCancelledResult(nt)||st!==rt.asyncId&&getFinishedResult(nt,!1);if(bt)throw Et.result=bt,ht(Et),Et},yt=(Et,bt)=>{const St=new BailSignal,wt=new SkipAnimationSignal;return(async()=>{if(globals_exports.skipAnimation)throw stopAsync(rt),wt.result=getFinishedResult(nt,!1),ht(wt),wt;xt(St);const Rt=is$2.obj(Et)?{...Et}:{...bt,to:Et};Rt.parentId=st,eachProp(ct,(Pt,It)=>{is$2.und(Rt[It])&&(Rt[It]=Pt)});const Ct=await nt.start(Rt);return xt(St),rt.paused&&await new Promise(Pt=>{rt.resumeQueue.add(Pt)}),Ct})()};let vt;if(globals_exports.skipAnimation)return stopAsync(rt),getFinishedResult(nt,!1);try{let Et;is$2.arr(tt)?Et=(async bt=>{for(const St of bt)await yt(St)})(tt):Et=Promise.resolve(tt(yt,nt.stop.bind(nt))),await Promise.all([Et.then(dt),mt]),vt=getFinishedResult(nt.get(),!0,!1)}catch(Et){if(Et instanceof BailSignal)vt=Et.result;else if(Et instanceof SkipAnimationSignal)vt=Et.result;else throw Et}finally{st==rt.asyncId&&(rt.asyncId=ot,rt.asyncTo=ot?lt:void 0,rt.promise=ot?ut:void 0)}return is$2.fun(at)&&raf.batchedUpdates(()=>{at(vt,nt,nt.item)}),vt})()}function stopAsync(tt,et){flush(tt.timeouts,rt=>rt.cancel()),tt.pauseQueue.clear(),tt.resumeQueue.clear(),tt.asyncId=tt.asyncTo=tt.promise=void 0,et&&(tt.cancelId=et)}var BailSignal=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},SkipAnimationSignal=class extends Error{constructor(){super("SkipAnimationSignal")}},isFrameValue=tt=>tt instanceof FrameValue,nextId=1,FrameValue=class extends FluidValue{constructor(){super(...arguments),this.id=nextId++,this._priority=0}get priority(){return this._priority}set priority(tt){this._priority!=tt&&(this._priority=tt,this._onPriorityChange(tt))}get(){const tt=getAnimated(this);return tt&&tt.getValue()}to(...tt){return globals_exports.to(this,tt)}interpolate(...tt){return deprecateInterpolate(),globals_exports.to(this,tt)}toJSON(){return this.get()}observerAdded(tt){tt==1&&this._attach()}observerRemoved(tt){tt==0&&this._detach()}_attach(){}_detach(){}_onChange(tt,et=!1){callFluidObservers(this,{type:"change",parent:this,value:tt,idle:et})}_onPriorityChange(tt){this.idle||frameLoop.sort(this),callFluidObservers(this,{type:"priority",parent:this,priority:tt})}},$P=Symbol.for("SpringPhase"),HAS_ANIMATED=1,IS_ANIMATING=2,IS_PAUSED=4,hasAnimated=tt=>(tt[$P]&HAS_ANIMATED)>0,isAnimating=tt=>(tt[$P]&IS_ANIMATING)>0,isPaused=tt=>(tt[$P]&IS_PAUSED)>0,setActiveBit=(tt,et)=>et?tt[$P]|=IS_ANIMATING|HAS_ANIMATED:tt[$P]&=-3,setPausedBit=(tt,et)=>et?tt[$P]|=IS_PAUSED:tt[$P]&=-5,SpringValue=class extends FrameValue{constructor(tt,et){if(super(),this.animation=new Animation,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!is$2.und(tt)||!is$2.und(et)){const rt=is$2.obj(tt)?{...tt}:{...et,from:tt};is$2.und(rt.default)&&(rt.default=!0),this.start(rt)}}get idle(){return!(isAnimating(this)||this._state.asyncTo)||isPaused(this)}get goal(){return getFluidValue(this.animation.to)}get velocity(){const tt=getAnimated(this);return tt instanceof AnimatedValue?tt.lastVelocity||0:tt.getPayload().map(et=>et.lastVelocity||0)}get hasAnimated(){return hasAnimated(this)}get isAnimating(){return isAnimating(this)}get isPaused(){return isPaused(this)}get isDelayed(){return this._state.delayed}advance(tt){let et=!0,rt=!1;const nt=this.animation;let{toValues:st}=nt;const{config:ot}=nt,at=getPayload(nt.to);!at&&hasFluidValue(nt.to)&&(st=toArray(getFluidValue(nt.to))),nt.values.forEach((ct,dt)=>{if(ct.done)return;const ht=ct.constructor==AnimatedString?1:at?at[dt].lastPosition:st[dt];let mt=nt.immediate,xt=ht;if(!mt){if(xt=ct.lastPosition,ot.tension<=0){ct.done=!0;return}let yt=ct.elapsedTime+=tt;const vt=nt.fromValues[dt],Et=ct.v0!=null?ct.v0:ct.v0=is$2.arr(ot.velocity)?ot.velocity[dt]:ot.velocity;let bt;const St=ot.precision||(vt==ht?.005:Math.min(1,Math.abs(ht-vt)*.001));if(is$2.und(ot.duration))if(ot.decay){const wt=ot.decay===!0?.998:ot.decay,Rt=Math.exp(-(1-wt)*yt);xt=vt+Et/(1-wt)*(1-Rt),mt=Math.abs(ct.lastPosition-xt)<=St,bt=Et*Rt}else{bt=ct.lastVelocity==null?Et:ct.lastVelocity;const wt=ot.restVelocity||St/10,Rt=ot.clamp?0:ot.bounce,Ct=!is$2.und(Rt),Pt=vt==ht?ct.v0>0:vt<ht;let It,jt=!1;const Dt=1,Vt=Math.ceil(tt/Dt);for(let Ft=0;Ft<Vt&&(It=Math.abs(bt)>wt,!(!It&&(mt=Math.abs(ht-xt)<=St,mt)));++Ft){Ct&&(jt=xt==ht||xt>ht==Pt,jt&&(bt=-bt*Rt,xt=ht));const Ht=-ot.tension*1e-6*(xt-ht),Nt=-ot.friction*.001*bt,Lt=(Ht+Nt)/ot.mass;bt=bt+Lt*Dt,xt=xt+bt*Dt}}else{let wt=1;ot.duration>0&&(this._memoizedDuration!==ot.duration&&(this._memoizedDuration=ot.duration,ct.durationProgress>0&&(ct.elapsedTime=ot.duration*ct.durationProgress,yt=ct.elapsedTime+=tt)),wt=(ot.progress||0)+yt/this._memoizedDuration,wt=wt>1?1:wt<0?0:wt,ct.durationProgress=wt),xt=vt+ot.easing(wt)*(ht-vt),bt=(xt-ct.lastPosition)/tt,mt=wt==1}ct.lastVelocity=bt,Number.isNaN(xt)&&(console.warn("Got NaN while animating:",this),mt=!0)}at&&!at[dt].done&&(mt=!1),mt?ct.done=!0:et=!1,ct.setValue(xt,ot.round)&&(rt=!0)});const lt=getAnimated(this),ut=lt.getValue();if(et){const ct=getFluidValue(nt.to);(ut!==ct||rt)&&!ot.decay?(lt.setValue(ct),this._onChange(ct)):rt&&ot.decay&&this._onChange(ut),this._stop()}else rt&&this._onChange(ut)}set(tt){return raf.batchedUpdates(()=>{this._stop(),this._focus(tt),this._set(tt)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(isAnimating(this)){const{to:tt,config:et}=this.animation;raf.batchedUpdates(()=>{this._onStart(),et.decay||this._set(tt,!1),this._stop()})}return this}update(tt){return(this.queue||(this.queue=[])).push(tt),this}start(tt,et){let rt;return is$2.und(tt)?(rt=this.queue||[],this.queue=[]):rt=[is$2.obj(tt)?tt:{...et,to:tt}],Promise.all(rt.map(nt=>this._update(nt))).then(nt=>getCombinedResult(this,nt))}stop(tt){const{to:et}=this.animation;return this._focus(this.get()),stopAsync(this._state,tt&&this._lastCallId),raf.batchedUpdates(()=>this._stop(et,tt)),this}reset(){this._update({reset:!0})}eventObserved(tt){tt.type=="change"?this._start():tt.type=="priority"&&(this.priority=tt.priority+1)}_prepareNode(tt){const et=this.key||"";let{to:rt,from:nt}=tt;rt=is$2.obj(rt)?rt[et]:rt,(rt==null||isAsyncTo(rt))&&(rt=void 0),nt=is$2.obj(nt)?nt[et]:nt,nt==null&&(nt=void 0);const st={to:rt,from:nt};return hasAnimated(this)||(tt.reverse&&([rt,nt]=[nt,rt]),nt=getFluidValue(nt),is$2.und(nt)?getAnimated(this)||this._set(rt):this._set(nt)),st}_update({...tt},et){const{key:rt,defaultProps:nt}=this;tt.default&&Object.assign(nt,getDefaultProps(tt,(at,lt)=>/^on/.test(lt)?resolveProp(at,rt):at)),mergeActiveFn(this,tt,"onProps"),sendEvent(this,"onProps",tt,this);const st=this._prepareNode(tt);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const ot=this._state;return scheduleProps(++this._lastCallId,{key:rt,props:tt,defaultProps:nt,state:ot,actions:{pause:()=>{isPaused(this)||(setPausedBit(this,!0),flushCalls(ot.pauseQueue),sendEvent(this,"onPause",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},resume:()=>{isPaused(this)&&(setPausedBit(this,!1),isAnimating(this)&&this._resume(),flushCalls(ot.resumeQueue),sendEvent(this,"onResume",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},start:this._merge.bind(this,st)}}).then(at=>{if(tt.loop&&at.finished&&!(et&&at.noop)){const lt=createLoopUpdate(tt);if(lt)return this._update(lt,!0)}return at})}_merge(tt,et,rt){if(et.cancel)return this.stop(!0),rt(getCancelledResult(this));const nt=!is$2.und(tt.to),st=!is$2.und(tt.from);if(nt||st)if(et.callId>this._lastToId)this._lastToId=et.callId;else return rt(getCancelledResult(this));const{key:ot,defaultProps:at,animation:lt}=this,{to:ut,from:ct}=lt;let{to:dt=ut,from:ht=ct}=tt;st&&!nt&&(!et.default||is$2.und(dt))&&(dt=ht),et.reverse&&([dt,ht]=[ht,dt]);const mt=!isEqual(ht,ct);mt&&(lt.from=ht),ht=getFluidValue(ht);const xt=!isEqual(dt,ut);xt&&this._focus(dt);const yt=isAsyncTo(et.to),{config:vt}=lt,{decay:Et,velocity:bt}=vt;(nt||st)&&(vt.velocity=0),et.config&&!yt&&mergeConfig(vt,callProp(et.config,ot),et.config!==at.config?callProp(at.config,ot):void 0);let St=getAnimated(this);if(!St||is$2.und(dt))return rt(getFinishedResult(this,!0));const wt=is$2.und(et.reset)?st&&!et.default:!is$2.und(ht)&&matchProp(et.reset,ot),Rt=wt?ht:this.get(),Ct=computeGoal(dt),Pt=is$2.num(Ct)||is$2.arr(Ct)||isAnimatedString(Ct),It=!yt&&(!Pt||matchProp(at.immediate||et.immediate,ot));if(xt){const Ft=getAnimatedType(dt);if(Ft!==St.constructor)if(It)St=this._set(Ct);else throw Error(`Cannot animate between ${St.constructor.name} and ${Ft.name}, as the "to" prop suggests`)}const jt=St.constructor;let Dt=hasFluidValue(dt),Vt=!1;if(!Dt){const Ft=wt||!hasAnimated(this)&&mt;(xt||Ft)&&(Vt=isEqual(computeGoal(Rt),Ct),Dt=!Vt),(!isEqual(lt.immediate,It)&&!It||!isEqual(vt.decay,Et)||!isEqual(vt.velocity,bt))&&(Dt=!0)}if(Vt&&isAnimating(this)&&(lt.changed&&!wt?Dt=!0:Dt||this._stop(ut)),!yt&&((Dt||hasFluidValue(ut))&&(lt.values=St.getPayload(),lt.toValues=hasFluidValue(dt)?null:jt==AnimatedString?[1]:toArray(Ct)),lt.immediate!=It&&(lt.immediate=It,!It&&!wt&&this._set(ut)),Dt)){const{onRest:Ft}=lt;each(ACTIVE_EVENTS,Nt=>mergeActiveFn(this,et,Nt));const Ht=getFinishedResult(this,checkFinished(this,ut));flushCalls(this._pendingCalls,Ht),this._pendingCalls.add(rt),lt.changed&&raf.batchedUpdates(()=>{var Nt;lt.changed=!wt,Ft==null||Ft(Ht,this),wt?callProp(at.onRest,Ht):(Nt=lt.onStart)==null||Nt.call(lt,Ht,this)})}wt&&this._set(Rt),yt?rt(runAsync(et.to,et,this._state,this)):Dt?this._start():isAnimating(this)&&!xt?this._pendingCalls.add(rt):rt(getNoopResult(Rt))}_focus(tt){const et=this.animation;tt!==et.to&&(getFluidObservers(this)&&this._detach(),et.to=tt,getFluidObservers(this)&&this._attach())}_attach(){let tt=0;const{to:et}=this.animation;hasFluidValue(et)&&(addFluidObserver(et,this),isFrameValue(et)&&(tt=et.priority+1)),this.priority=tt}_detach(){const{to:tt}=this.animation;hasFluidValue(tt)&&removeFluidObserver(tt,this)}_set(tt,et=!0){const rt=getFluidValue(tt);if(!is$2.und(rt)){const nt=getAnimated(this);if(!nt||!isEqual(rt,nt.getValue())){const st=getAnimatedType(rt);!nt||nt.constructor!=st?setAnimated(this,st.create(rt)):nt.setValue(rt),nt&&raf.batchedUpdates(()=>{this._onChange(rt,et)})}}return getAnimated(this)}_onStart(){const tt=this.animation;tt.changed||(tt.changed=!0,sendEvent(this,"onStart",getFinishedResult(this,checkFinished(this,tt.to)),this))}_onChange(tt,et){et||(this._onStart(),callProp(this.animation.onChange,tt,this)),callProp(this.defaultProps.onChange,tt,this),super._onChange(tt,et)}_start(){const tt=this.animation;getAnimated(this).reset(getFluidValue(tt.to)),tt.immediate||(tt.fromValues=tt.values.map(et=>et.lastPosition)),isAnimating(this)||(setActiveBit(this,!0),isPaused(this)||this._resume())}_resume(){globals_exports.skipAnimation?this.finish():frameLoop.start(this)}_stop(tt,et){if(isAnimating(this)){setActiveBit(this,!1);const rt=this.animation;each(rt.values,st=>{st.done=!0}),rt.toValues&&(rt.onChange=rt.onPause=rt.onResume=void 0),callFluidObservers(this,{type:"idle",parent:this});const nt=et?getCancelledResult(this.get()):getFinishedResult(this.get(),checkFinished(this,tt??rt.to));flushCalls(this._pendingCalls,nt),rt.changed&&(rt.changed=!1,sendEvent(this,"onRest",nt,this))}}};function checkFinished(tt,et){const rt=computeGoal(et),nt=computeGoal(tt.get());return isEqual(nt,rt)}function createLoopUpdate(tt,et=tt.loop,rt=tt.to){const nt=callProp(et);if(nt){const st=nt!==!0&&inferTo(nt),ot=(st||tt).reverse,at=!st||st.reset;return createUpdate({...tt,loop:et,default:!1,pause:void 0,to:!ot||isAsyncTo(rt)?rt:void 0,from:at?tt.from:void 0,reset:at,...st})}}function createUpdate(tt){const{to:et,from:rt}=tt=inferTo(tt),nt=new Set;return is$2.obj(et)&&findDefined(et,nt),is$2.obj(rt)&&findDefined(rt,nt),tt.keys=nt.size?Array.from(nt):null,tt}function declareUpdate(tt){const et=createUpdate(tt);return is$2.und(et.default)&&(et.default=getDefaultProps(et)),et}function findDefined(tt,et){eachProp(tt,(rt,nt)=>rt!=null&&et.add(nt))}var ACTIVE_EVENTS=["onStart","onRest","onChange","onPause","onResume"];function mergeActiveFn(tt,et,rt){tt.animation[rt]=et[rt]!==getDefaultProp(et,rt)?resolveProp(et[rt],tt.key):void 0}function sendEvent(tt,et,...rt){var nt,st,ot,at;(st=(nt=tt.animation)[et])==null||st.call(nt,...rt),(at=(ot=tt.defaultProps)[et])==null||at.call(ot,...rt)}var BATCHED_EVENTS=["onStart","onChange","onRest"],nextId2=1,Controller$1=class{constructor(et,rt){this.id=nextId2++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),rt&&(this._flush=rt),et&&this.start({default:!0,...et})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(et=>et.idle&&!et.isDelayed&&!et.isPaused)}get item(){return this._item}set item(et){this._item=et}get(){const et={};return this.each((rt,nt)=>et[nt]=rt.get()),et}set(et){for(const rt in et){const nt=et[rt];is$2.und(nt)||this.springs[rt].set(nt)}}update(et){return et&&this.queue.push(createUpdate(et)),this}start(et){let{queue:rt}=this;return et?rt=toArray(et).map(createUpdate):this.queue=[],this._flush?this._flush(this,rt):(prepareKeys(this,rt),flushUpdateQueue(this,rt))}stop(et,rt){if(et!==!!et&&(rt=et),rt){const nt=this.springs;each(toArray(rt),st=>nt[st].stop(!!et))}else stopAsync(this._state,this._lastAsyncId),this.each(nt=>nt.stop(!!et));return this}pause(et){if(is$2.und(et))this.start({pause:!0});else{const rt=this.springs;each(toArray(et),nt=>rt[nt].pause())}return this}resume(et){if(is$2.und(et))this.start({pause:!1});else{const rt=this.springs;each(toArray(et),nt=>rt[nt].resume())}return this}each(et){eachProp(this.springs,et)}_onFrame(){const{onStart:et,onChange:rt,onRest:nt}=this._events,st=this._active.size>0,ot=this._changed.size>0;(st&&!this._started||ot&&!this._started)&&(this._started=!0,flush(et,([ut,ct])=>{ct.value=this.get(),ut(ct,this,this._item)}));const at=!st&&this._started,lt=ot||at&&nt.size?this.get():null;ot&&rt.size&&flush(rt,([ut,ct])=>{ct.value=lt,ut(ct,this,this._item)}),at&&(this._started=!1,flush(nt,([ut,ct])=>{ct.value=lt,ut(ct,this,this._item)}))}eventObserved(et){if(et.type=="change")this._changed.add(et.parent),et.idle||this._active.add(et.parent);else if(et.type=="idle")this._active.delete(et.parent);else return;raf.onFrame(this._onFrame)}};function flushUpdateQueue(tt,et){return Promise.all(et.map(rt=>flushUpdate(tt,rt))).then(rt=>getCombinedResult(tt,rt))}async function flushUpdate(tt,et,rt){const{keys:nt,to:st,from:ot,loop:at,onRest:lt,onResolve:ut}=et,ct=is$2.obj(et.default)&&et.default;at&&(et.loop=!1),st===!1&&(et.to=null),ot===!1&&(et.from=null);const dt=is$2.arr(st)||is$2.fun(st)?st:void 0;dt?(et.to=void 0,et.onRest=void 0,ct&&(ct.onRest=void 0)):each(BATCHED_EVENTS,vt=>{const Et=et[vt];if(is$2.fun(Et)){const bt=tt._events[vt];et[vt]=({finished:St,cancelled:wt})=>{const Rt=bt.get(Et);Rt?(St||(Rt.finished=!1),wt&&(Rt.cancelled=!0)):bt.set(Et,{value:null,finished:St||!1,cancelled:wt||!1})},ct&&(ct[vt]=et[vt])}});const ht=tt._state;et.pause===!ht.paused?(ht.paused=et.pause,flushCalls(et.pause?ht.pauseQueue:ht.resumeQueue)):ht.paused&&(et.pause=!0);const mt=(nt||Object.keys(tt.springs)).map(vt=>tt.springs[vt].start(et)),xt=et.cancel===!0||getDefaultProp(et,"cancel")===!0;(dt||xt&&ht.asyncId)&&mt.push(scheduleProps(++tt._lastAsyncId,{props:et,state:ht,actions:{pause:noop,resume:noop,start(vt,Et){xt?(stopAsync(ht,tt._lastAsyncId),Et(getCancelledResult(tt))):(vt.onRest=lt,Et(runAsync(dt,vt,ht,tt)))}}})),ht.paused&&await new Promise(vt=>{ht.resumeQueue.add(vt)});const yt=getCombinedResult(tt,await Promise.all(mt));if(at&&yt.finished&&!(rt&&yt.noop)){const vt=createLoopUpdate(et,at,st);if(vt)return prepareKeys(tt,[vt]),flushUpdate(tt,vt,!0)}return ut&&raf.batchedUpdates(()=>ut(yt,tt,tt.item)),yt}function getSprings(tt,et){const rt={...tt.springs};return et&&each(toArray(et),nt=>{is$2.und(nt.keys)&&(nt=createUpdate(nt)),is$2.obj(nt.to)||(nt={...nt,to:void 0}),prepareSprings(rt,nt,st=>createSpring(st))}),setSprings(tt,rt),rt}function setSprings(tt,et){eachProp(et,(rt,nt)=>{tt.springs[nt]||(tt.springs[nt]=rt,addFluidObserver(rt,tt))})}function createSpring(tt,et){const rt=new SpringValue;return rt.key=tt,et&&addFluidObserver(rt,et),rt}function prepareSprings(tt,et,rt){et.keys&&each(et.keys,nt=>{(tt[nt]||(tt[nt]=rt(nt)))._prepareNode(et)})}function prepareKeys(tt,et){each(et,rt=>{prepareSprings(tt.springs,rt,nt=>createSpring(nt,tt))})}var SpringContext=({children:tt,...et})=>{const rt=reactExports.useContext(ctx),nt=et.pause||!!rt.pause,st=et.immediate||!!rt.immediate;et=useMemoOne(()=>({pause:nt,immediate:st}),[nt,st]);const{Provider:ot}=ctx;return reactExports.createElement(ot,{value:et},tt)},ctx=makeContext(SpringContext,{});SpringContext.Provider=ctx.Provider;SpringContext.Consumer=ctx.Consumer;function makeContext(tt,et){return Object.assign(tt,reactExports.createContext(et)),tt.Provider._context=tt,tt.Consumer._context=tt,tt}var SpringRef=()=>{const tt=[],et=function(nt){deprecateDirectCall();const st=[];return each(tt,(ot,at)=>{if(is$2.und(nt))st.push(ot.start());else{const lt=rt(nt,ot,at);lt&&st.push(ot.start(lt))}}),st};et.current=tt,et.add=function(nt){tt.includes(nt)||tt.push(nt)},et.delete=function(nt){const st=tt.indexOf(nt);~st&&tt.splice(st,1)},et.pause=function(){return each(tt,nt=>nt.pause(...arguments)),this},et.resume=function(){return each(tt,nt=>nt.resume(...arguments)),this},et.set=function(nt){each(tt,(st,ot)=>{const at=is$2.fun(nt)?nt(ot,st):nt;at&&st.set(at)})},et.start=function(nt){const st=[];return each(tt,(ot,at)=>{if(is$2.und(nt))st.push(ot.start());else{const lt=this._getProps(nt,ot,at);lt&&st.push(ot.start(lt))}}),st},et.stop=function(){return each(tt,nt=>nt.stop(...arguments)),this},et.update=function(nt){return each(tt,(st,ot)=>st.update(this._getProps(nt,st,ot))),this};const rt=function(nt,st,ot){return is$2.fun(nt)?nt(ot,st):nt};return et._getProps=rt,et};function useSprings(tt,et,rt){const nt=is$2.fun(et)&&et;nt&&!rt&&(rt=[]);const st=reactExports.useMemo(()=>nt||arguments.length==3?SpringRef():void 0,[]),ot=reactExports.useRef(0),at=useForceUpdate(),lt=reactExports.useMemo(()=>({ctrls:[],queue:[],flush(bt,St){const wt=getSprings(bt,St);return ot.current>0&&!lt.queue.length&&!Object.keys(wt).some(Ct=>!bt.springs[Ct])?flushUpdateQueue(bt,St):new Promise(Ct=>{setSprings(bt,wt),lt.queue.push(()=>{Ct(flushUpdateQueue(bt,St))}),at()})}}),[]),ut=reactExports.useRef([...lt.ctrls]),ct=[],dt=usePrev(tt)||0;reactExports.useMemo(()=>{each(ut.current.slice(tt,dt),bt=>{detachRefs(bt,st),bt.stop(!0)}),ut.current.length=tt,ht(dt,tt)},[tt]),reactExports.useMemo(()=>{ht(0,Math.min(dt,tt))},rt);function ht(bt,St){for(let wt=bt;wt<St;wt++){const Rt=ut.current[wt]||(ut.current[wt]=new Controller$1(null,lt.flush)),Ct=nt?nt(wt,Rt):et[wt];Ct&&(ct[wt]=declareUpdate(Ct))}}const mt=ut.current.map((bt,St)=>getSprings(bt,ct[St])),xt=reactExports.useContext(SpringContext),yt=usePrev(xt),vt=xt!==yt&&hasProps(xt);useIsomorphicLayoutEffect$1(()=>{ot.current++,lt.ctrls=ut.current;const{queue:bt}=lt;bt.length&&(lt.queue=[],each(bt,St=>St())),each(ut.current,(St,wt)=>{st==null||st.add(St),vt&&St.start({default:xt});const Rt=ct[wt];Rt&&(replaceRef(St,Rt.ref),St.ref?St.queue.push(Rt):St.start(Rt))})}),useOnce(()=>()=>{each(lt.ctrls,bt=>bt.stop(!0))});const Et=mt.map(bt=>({...bt}));return st?[Et,st]:Et}function useSpring(tt,et){const rt=is$2.fun(tt),[[nt],st]=useSprings(1,rt?tt:[tt],rt?[]:et);return rt||arguments.length==2?[nt,st]:nt}function useTransition(tt,et,rt){const nt=is$2.fun(et)&&et,{reset:st,sort:ot,trail:at=0,expires:lt=!0,exitBeforeEnter:ut=!1,onDestroyed:ct,ref:dt,config:ht}=nt?nt():et,mt=reactExports.useMemo(()=>nt||arguments.length==3?SpringRef():void 0,[]),xt=toArray(tt),yt=[],vt=reactExports.useRef(null),Et=st?null:vt.current;useIsomorphicLayoutEffect$1(()=>{vt.current=yt}),useOnce(()=>(each(yt,Lt=>{mt==null||mt.add(Lt.ctrl),Lt.ctrl.ref=mt}),()=>{each(vt.current,Lt=>{Lt.expired&&clearTimeout(Lt.expirationId),detachRefs(Lt.ctrl,mt),Lt.ctrl.stop(!0)})}));const bt=getKeys(xt,nt?nt():et,Et),St=st&&vt.current||[];useIsomorphicLayoutEffect$1(()=>each(St,({ctrl:Lt,item:Mt,key:zt})=>{detachRefs(Lt,mt),callProp(ct,Mt,zt)}));const wt=[];if(Et&&each(Et,(Lt,Mt)=>{Lt.expired?(clearTimeout(Lt.expirationId),St.push(Lt)):(Mt=wt[Mt]=bt.indexOf(Lt.key),~Mt&&(yt[Mt]=Lt))}),each(xt,(Lt,Mt)=>{yt[Mt]||(yt[Mt]={key:bt[Mt],item:Lt,phase:"mount",ctrl:new Controller$1},yt[Mt].ctrl.item=Lt)}),wt.length){let Lt=-1;const{leave:Mt}=nt?nt():et;each(wt,(zt,Gt)=>{const $t=Et[Gt];~zt?(Lt=yt.indexOf($t),yt[Lt]={...$t,item:xt[zt]}):Mt&&yt.splice(++Lt,0,$t)})}is$2.fun(ot)&&yt.sort((Lt,Mt)=>ot(Lt.item,Mt.item));let Rt=-at;const Ct=useForceUpdate(),Pt=getDefaultProps(et),It=new Map,jt=reactExports.useRef(new Map),Dt=reactExports.useRef(!1);each(yt,(Lt,Mt)=>{const zt=Lt.key,Gt=Lt.phase,$t=nt?nt():et;let Ut,Bt;const Yt=callProp($t.delay||0,zt);if(Gt=="mount")Ut=$t.enter,Bt="enter";else{const cr=bt.indexOf(zt)<0;if(Gt!="leave")if(cr)Ut=$t.leave,Bt="leave";else if(Ut=$t.update)Bt="update";else return;else if(!cr)Ut=$t.enter,Bt="enter";else return}if(Ut=callProp(Ut,Lt.item,Mt),Ut=is$2.obj(Ut)?inferTo(Ut):{to:Ut},!Ut.config){const cr=ht||Pt.config;Ut.config=callProp(cr,Lt.item,Mt,Bt)}Rt+=at;const Zt={...Pt,delay:Yt+Rt,ref:dt,immediate:$t.immediate,reset:!1,...Ut};if(Bt=="enter"&&is$2.und(Zt.from)){const cr=nt?nt():et,ur=is$2.und(cr.initial)||Et?cr.from:cr.initial;Zt.from=callProp(ur,Lt.item,Mt)}const{onResolve:Xt}=Zt;Zt.onResolve=cr=>{callProp(Xt,cr);const ur=vt.current,mr=ur.find(vr=>vr.key===zt);if(mr&&!(cr.cancelled&&mr.phase!="update")&&mr.ctrl.idle){const vr=ur.every(Er=>Er.ctrl.idle);if(mr.phase=="leave"){const Er=callProp(lt,mr.item);if(Er!==!1){const br=Er===!0?0:Er;if(mr.expired=!0,!vr&&br>0){br<=2147483647&&(mr.expirationId=setTimeout(Ct,br));return}}}vr&&ur.some(Er=>Er.expired)&&(jt.current.delete(mr),ut&&(Dt.current=!0),Ct())}};const rr=getSprings(Lt.ctrl,Zt);Bt==="leave"&&ut?jt.current.set(Lt,{phase:Bt,springs:rr,payload:Zt}):It.set(Lt,{phase:Bt,springs:rr,payload:Zt})});const Vt=reactExports.useContext(SpringContext),Ft=usePrev(Vt),Ht=Vt!==Ft&&hasProps(Vt);useIsomorphicLayoutEffect$1(()=>{Ht&&each(yt,Lt=>{Lt.ctrl.start({default:Vt})})},[Vt]),each(It,(Lt,Mt)=>{if(jt.current.size){const zt=yt.findIndex(Gt=>Gt.key===Mt.key);yt.splice(zt,1)}}),useIsomorphicLayoutEffect$1(()=>{each(jt.current.size?jt.current:It,({phase:Lt,payload:Mt},zt)=>{const{ctrl:Gt}=zt;zt.phase=Lt,mt==null||mt.add(Gt),Ht&&Lt=="enter"&&Gt.start({default:Vt}),Mt&&(replaceRef(Gt,Mt.ref),(Gt.ref||mt)&&!Dt.current?Gt.update(Mt):(Gt.start(Mt),Dt.current&&(Dt.current=!1)))})},st?void 0:rt);const Nt=Lt=>reactExports.createElement(reactExports.Fragment,null,yt.map((Mt,zt)=>{const{springs:Gt}=It.get(Mt)||Mt.ctrl,$t=Lt({...Gt},Mt.item,Mt,zt);return $t&&$t.type?reactExports.createElement($t.type,{...$t.props,key:is$2.str(Mt.key)||is$2.num(Mt.key)?Mt.key:Mt.ctrl.id,ref:$t.ref}):$t}));return mt?[Nt,mt]:Nt}var nextKey=1;function getKeys(tt,{key:et,keys:rt=et},nt){if(rt===null){const st=new Set;return tt.map(ot=>{const at=nt&&nt.find(lt=>lt.item===ot&&lt.phase!=="leave"&&!st.has(lt));return at?(st.add(at),at.key):nextKey++})}return is$2.und(rt)?tt:is$2.fun(rt)?tt.map(rt):toArray(rt)}var Interpolation=class extends FrameValue{constructor(tt,et){super(),this.source=tt,this.idle=!0,this._active=new Set,this.calc=createInterpolator(...et);const rt=this._get(),nt=getAnimatedType(rt);setAnimated(this,nt.create(rt))}advance(tt){const et=this._get(),rt=this.get();isEqual(et,rt)||(getAnimated(this).setValue(et),this._onChange(et,this.idle)),!this.idle&&checkIdle(this._active)&&becomeIdle(this)}_get(){const tt=is$2.arr(this.source)?this.source.map(getFluidValue):toArray(getFluidValue(this.source));return this.calc(...tt)}_start(){this.idle&&!checkIdle(this._active)&&(this.idle=!1,each(getPayload(this),tt=>{tt.done=!1}),globals_exports.skipAnimation?(raf.batchedUpdates(()=>this.advance()),becomeIdle(this)):frameLoop.start(this))}_attach(){let tt=1;each(toArray(this.source),et=>{hasFluidValue(et)&&addFluidObserver(et,this),isFrameValue(et)&&(et.idle||this._active.add(et),tt=Math.max(tt,et.priority+1))}),this.priority=tt,this._start()}_detach(){each(toArray(this.source),tt=>{hasFluidValue(tt)&&removeFluidObserver(tt,this)}),this._active.clear(),becomeIdle(this)}eventObserved(tt){tt.type=="change"?tt.idle?this.advance():(this._active.add(tt.parent),this._start()):tt.type=="idle"?this._active.delete(tt.parent):tt.type=="priority"&&(this.priority=toArray(this.source).reduce((et,rt)=>Math.max(et,(isFrameValue(rt)?rt.priority:0)+1),0))}};function isIdle(tt){return tt.idle!==!1}function checkIdle(tt){return!tt.size||Array.from(tt).every(isIdle)}function becomeIdle(tt){tt.idle||(tt.idle=!0,each(getPayload(tt),et=>{et.done=!0}),callFluidObservers(tt,{type:"idle",parent:tt}))}globals_exports.assign({createStringInterpolator:createStringInterpolator2,to:(tt,et)=>new Interpolation(tt,et)});var isCustomPropRE=/^--/;function dangerousStyleValue(tt,et){return et==null||typeof et=="boolean"||et===""?"":typeof et=="number"&&et!==0&&!isCustomPropRE.test(tt)&&!(isUnitlessNumber.hasOwnProperty(tt)&&isUnitlessNumber[tt])?et+"px":(""+et).trim()}var attributeCache={};function applyAnimatedValues(tt,et){if(!tt.nodeType||!tt.setAttribute)return!1;const rt=tt.nodeName==="filter"||tt.parentNode&&tt.parentNode.nodeName==="filter",{className:nt,style:st,children:ot,scrollTop:at,scrollLeft:lt,viewBox:ut,...ct}=et,dt=Object.values(ct),ht=Object.keys(ct).map(mt=>rt||tt.hasAttribute(mt)?mt:attributeCache[mt]||(attributeCache[mt]=mt.replace(/([A-Z])/g,xt=>"-"+xt.toLowerCase())));ot!==void 0&&(tt.textContent=ot);for(const mt in st)if(st.hasOwnProperty(mt)){const xt=dangerousStyleValue(mt,st[mt]);isCustomPropRE.test(mt)?tt.style.setProperty(mt,xt):tt.style[mt]=xt}ht.forEach((mt,xt)=>{tt.setAttribute(mt,dt[xt])}),nt!==void 0&&(tt.className=nt),at!==void 0&&(tt.scrollTop=at),lt!==void 0&&(tt.scrollLeft=lt),ut!==void 0&&tt.setAttribute("viewBox",ut)}var isUnitlessNumber={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},prefixKey=(tt,et)=>tt+et.charAt(0).toUpperCase()+et.substring(1),prefixes=["Webkit","Ms","Moz","O"];isUnitlessNumber=Object.keys(isUnitlessNumber).reduce((tt,et)=>(prefixes.forEach(rt=>tt[prefixKey(rt,et)]=tt[et]),tt),isUnitlessNumber);var domTransforms=/^(matrix|translate|scale|rotate|skew)/,pxTransforms=/^(translate)/,degTransforms=/^(rotate|skew)/,addUnit=(tt,et)=>is$2.num(tt)&&tt!==0?tt+et:tt,isValueIdentity=(tt,et)=>is$2.arr(tt)?tt.every(rt=>isValueIdentity(rt,et)):is$2.num(tt)?tt===et:parseFloat(tt)===et,AnimatedStyle=class extends AnimatedObject{constructor({x:tt,y:et,z:rt,...nt}){const st=[],ot=[];(tt||et||rt)&&(st.push([tt||0,et||0,rt||0]),ot.push(at=>[`translate3d(${at.map(lt=>addUnit(lt,"px")).join(",")})`,isValueIdentity(at,0)])),eachProp(nt,(at,lt)=>{if(lt==="transform")st.push([at||""]),ot.push(ut=>[ut,ut===""]);else if(domTransforms.test(lt)){if(delete nt[lt],is$2.und(at))return;const ut=pxTransforms.test(lt)?"px":degTransforms.test(lt)?"deg":"";st.push(toArray(at)),ot.push(lt==="rotate3d"?([ct,dt,ht,mt])=>[`rotate3d(${ct},${dt},${ht},${addUnit(mt,ut)})`,isValueIdentity(mt,0)]:ct=>[`${lt}(${ct.map(dt=>addUnit(dt,ut)).join(",")})`,isValueIdentity(ct,lt.startsWith("scale")?1:0)])}}),st.length&&(nt.transform=new FluidTransform(st,ot)),super(nt)}},FluidTransform=class extends FluidValue{constructor(tt,et){super(),this.inputs=tt,this.transforms=et,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let tt="",et=!0;return each(this.inputs,(rt,nt)=>{const st=getFluidValue(rt[0]),[ot,at]=this.transforms[nt](is$2.arr(st)?st:rt.map(getFluidValue));tt+=" "+ot,et=et&&at}),et?"none":tt}observerAdded(tt){tt==1&&each(this.inputs,et=>each(et,rt=>hasFluidValue(rt)&&addFluidObserver(rt,this)))}observerRemoved(tt){tt==0&&each(this.inputs,et=>each(et,rt=>hasFluidValue(rt)&&removeFluidObserver(rt,this)))}eventObserved(tt){tt.type=="change"&&(this._value=null),callFluidObservers(this,tt)}},primitives=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];globals_exports.assign({batchedUpdates:reactDomExports.unstable_batchedUpdates,createStringInterpolator:createStringInterpolator2,colors:colors2});var host=createHost(primitives,{applyAnimatedValues,createAnimatedStyle:tt=>new AnimatedStyle(tt),getComponentProps:({scrollTop:tt,scrollLeft:et,...rt})=>rt}),animated=host.animated;const ModalContext=reactExports.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""}),useModalContext=()=>{const tt=reactExports.useContext(ModalContext);if(!tt)throw new Error("Cannot be rendered outside the Modal component");return tt},ModalBody=tt=>{const{ariaDescriptionId:et}=useModalContext(),{children:rt,className:nt}=tt,st=clsx("modal-body",nt);return jsxRuntimeExports.jsx("div",{id:et,className:st,children:rt})},ModalFooter=tt=>jsxRuntimeExports.jsx("div",{className:"modal-footer",children:tt.children}),SvgIconClose=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.222 4.222a1.1 1.1 0 0 1 1.556 0l14 14a1.1 1.1 0 1 1-1.556 1.556l-14-14a1.1 1.1 0 0 1 0-1.556",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M19.778 4.222a1.1 1.1 0 0 1 0 1.556l-14 14a1.1 1.1 0 1 1-1.556-1.556l14-14a1.1 1.1 0 0 1 1.556 0",clipRule:"evenodd"})]}),ModalHeader=tt=>{const{onModalClose:et,children:rt}=tt,{ariaLabelId:nt,focusId:st}=useModalContext(),ot=reactExports.useRef(null),{t:at}=useTranslation();return reactExports.useEffect(()=>{var lt;st||(lt=ot.current)==null||lt.focus()},[st]),jsxRuntimeExports.jsxs("div",{className:"modal-header",children:[jsxRuntimeExports.jsx("h2",{id:nt,className:"modal-title",tabIndex:-1,children:rt}),jsxRuntimeExports.jsx(IconButton,{ref:ot,"aria-label":at("close"),color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconClose,{}),type:"button",variant:"ghost",title:at("close"),onClick:et,className:"btn-close"})]})},ModalSubtitle=tt=>jsxRuntimeExports.jsx("p",{className:"modal-subtitle",children:tt.children}),Root$1=reactExports.forwardRef((tt,et)=>{const{id:rt,isOpen:nt,onModalClose:st,size:ot="md",viewport:at=!1,scrollable:lt=!1,focusId:ut,children:ct}=tt,dt=`aria_label_${rt}`,ht=`aria_desc_${rt}`,mt=useClickOutside(st),xt=useTrapFocus();useKeyPress(st,["Escape"]),reactExports.useEffect(()=>{if(nt&&(document.body.style.overflow="hidden",ut)){const St=document.getElementById(ut);St==null||St.focus()}return()=>{document.body.style.overflow=""}},[ut,nt]);const yt=clsx("modal fade",{"show d-block":nt,"modal-scrollable":lt,viewport:at,[`modal-${ot}`]:ot}),vt=clsx("modal-dialog"),Et={ariaLabelId:dt,ariaDescriptionId:ht,focusId:ut},bt=useTransition(nt,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return jsxRuntimeExports.jsx(ModalContext.Provider,{value:Et,children:bt((St,wt)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[wt&&jsxRuntimeExports.jsx(animated.div,{id:rt,ref:et,role:"dialog","aria-modal":"true","aria-labelledby":dt,"aria-describedby":ht,className:yt,style:St,tabIndex:-1,children:jsxRuntimeExports.jsx("div",{id:`${rt}_ref`,ref:Rt=>{mt.current=Rt,wt&&(xt.current=Rt)},className:vt,children:jsxRuntimeExports.jsx("div",{className:"modal-content",children:ct})})}),wt&&jsxRuntimeExports.jsx(animated.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),Modal=Object.assign(Root$1,{Header:ModalHeader,Subtitle:ModalSubtitle,Body:ModalBody,Footer:ModalFooter});function Help({isHelpOpen:tt,setIsHelpOpen:et,parsedHeadline:rt,parsedContent:nt,error:st}){const{t:ot}=useTranslation(),at=()=>{et(!1)};return tt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"help-modal",isOpen:tt,onModalClose:at,scrollable:!0,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:at,children:ot("navbar.help")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:st?ot("help.notfound.title"):rt}),jsxRuntimeExports.jsx(Modal.Body,{className:st?"d-flex":null,children:st?ot("help.notfound.text"):nt})]}),document.getElementById("portal")):null}function Navbar({children:tt,className:et,...rt}){const nt=clsx("navbar",et);return jsxRuntimeExports.jsx("nav",{className:nt,...rt,children:tt})}function NavBarNav({children:tt,className:et,...rt}){const nt=clsx("navbar-nav",et);return jsxRuntimeExports.jsx("ul",{className:nt,...rt,children:tt})}const NavItem=reactExports.forwardRef(({children:tt,className:et,...rt},nt)=>{const st=clsx("nav-item",et);return jsxRuntimeExports.jsx("li",{ref:nt,className:st,...rt,children:tt})}),VisuallyHidden=reactExports.forwardRef(({children:tt},et)=>jsxRuntimeExports.jsx("span",{className:"visually-hidden",ref:et,children:tt}));function NavLink({link:tt,className:et,children:rt,translate:nt,...st}){const ot=clsx("nav-link",et);return jsxRuntimeExports.jsxs("a",{href:tt,className:ot,...st,children:[rt,nt&&jsxRuntimeExports.jsx(VisuallyHidden,{children:jsxRuntimeExports.jsx("span",{className:"nav-text",children:nt})})]})}const SvgIconSearch=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.27 11.552a7.75 7.75 0 0 1 0-4.156Q1.84 5.33 3.42 3.792a7.9 7.9 0 0 1 2.716-1.777q1.53-.6 3.161-.6 1.605 0 3.136.6 1.53.6 2.716 1.777a7.9 7.9 0 0 1 1.902 2.86 7.8 7.8 0 0 1 .518 3.29 7.65 7.65 0 0 1-.889 3.171q.692.192 1.21.697l4.297 4.156q.864.84.864 2.042t-.864 2.042-2.099.841-2.099-.84l-4.272-4.18a2.42 2.42 0 0 1-.74-1.178 8.3 8.3 0 0 1-3.68.84q-1.63 0-3.16-.6a8.1 8.1 0 0 1-2.717-1.753 7.85 7.85 0 0 1-2.149-3.628m2.495-2.066q0 2.235 1.605 3.796 1.63 1.56 3.926 1.561 2.272 0 3.877-1.561 1.605-1.562 1.63-3.796t-1.63-3.796q-1.63-1.585-3.877-1.585-2.272 0-3.926 1.585-1.605 1.561-1.605 3.796"})]}),PopoverBody=({children:tt,className:et})=>{const rt=clsx("popover-body",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},PopoverFooter=({children:tt,className:et})=>{const rt=clsx("popover-footer p-8",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},Popover=reactExports.forwardRef(({children:tt,className:et,id:rt,isVisible:nt,...st},ot)=>{const at=clsx("popover d-block position-absolute top-100 start-50 translate-middle-x",et);return useTransition(nt,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((lt,ut)=>ut&&jsxRuntimeExports.jsx(animated.div,{ref:ot,"aria-labelledby":rt,className:at,role:"tooltip",style:lt,...st,children:tt}))}),SearchEngine=()=>{const[tt,et]=useHover(),rt=reactExports.useRef(null),nt=reactExports.useId(),{t:st}=useTranslation();function ot(){if(rt.current){const at=rt.current.value;window.location.href=`/searchengine#/${at}`}}return jsxRuntimeExports.jsxs(NavItem,{id:nt,ref:tt,className:"position-relative","aria-haspopup":"true","aria-expanded":et,children:[jsxRuntimeExports.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconSearch,{className:"icon search"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:st("navbar.search")})]}),jsxRuntimeExports.jsx(Popover,{id:nt,isVisible:et,className:"d-none d-md-flex",children:jsxRuntimeExports.jsxs(FormControl,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[jsxRuntimeExports.jsx(FormControl.Input,{ref:rt,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),jsxRuntimeExports.jsx(SearchButton,{type:"submit",size:"sm",onClick:ot,"aria-label":st("navbar.search")})]})})]})},WidgetAppsFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"widget-footer",children:jsxRuntimeExports.jsx("div",{className:"widget-footer-action",children:jsxRuntimeExports.jsx("a",{href:"/welcome",className:"link",children:tt("plus")})})})},WidgetAppsBody=({bookmarkedApps:tt})=>{const{t:et}=useTranslation();return jsxRuntimeExports.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!tt.length&&jsxRuntimeExports.jsx("div",{className:"text-dark",children:et("navbar.myapps.more")}),tt.slice(0,6).map((rt,nt)=>jsxRuntimeExports.jsx("a",{href:rt.address,className:"bookmarked-app",children:jsxRuntimeExports.jsx(AppIcon,{app:rt,size:"32"})},nt))]})};var lib$3={},lib$2={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.Doctype=tt.CDATA=tt.Tag=tt.Style=tt.Script=tt.Comment=tt.Directive=tt.Text=tt.Root=tt.isTag=tt.ElementType=void 0;var et;(function(nt){nt.Root="root",nt.Text="text",nt.Directive="directive",nt.Comment="comment",nt.Script="script",nt.Style="style",nt.Tag="tag",nt.CDATA="cdata",nt.Doctype="doctype"})(et=tt.ElementType||(tt.ElementType={}));function rt(nt){return nt.type===et.Tag||nt.type===et.Script||nt.type===et.Style}tt.isTag=rt,tt.Root=et.Root,tt.Text=et.Text,tt.Directive=et.Directive,tt.Comment=et.Comment,tt.Script=et.Script,tt.Style=et.Style,tt.Tag=et.Tag,tt.CDATA=et.CDATA,tt.Doctype=et.Doctype})(lib$2);var node={},__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,rt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(nt,st){nt.__proto__=st}||function(nt,st){for(var ot in st)Object.prototype.hasOwnProperty.call(st,ot)&&(nt[ot]=st[ot])},tt(et,rt)};return function(et,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Class extends value "+String(rt)+" is not a constructor or null");tt(et,rt);function nt(){this.constructor=et}et.prototype=rt===null?Object.create(rt):(nt.prototype=rt.prototype,new nt)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(tt){for(var et,rt=1,nt=arguments.length;rt<nt;rt++){et=arguments[rt];for(var st in et)Object.prototype.hasOwnProperty.call(et,st)&&(tt[st]=et[st])}return tt},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.CDATA=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=lib$2,Node$2=function(){function tt(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(tt.prototype,"parentNode",{get:function(){return this.parent},set:function(et){this.parent=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"previousSibling",{get:function(){return this.prev},set:function(et){this.prev=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"nextSibling",{get:function(){return this.next},set:function(et){this.next=et},enumerable:!1,configurable:!0}),tt.prototype.cloneNode=function(et){return et===void 0&&(et=!1),cloneNode(this,et)},tt}();node.Node=Node$2;var DataNode=function(tt){__extends(et,tt);function et(rt){var nt=tt.call(this)||this;return nt.data=rt,nt}return Object.defineProperty(et.prototype,"nodeValue",{get:function(){return this.data},set:function(rt){this.data=rt},enumerable:!1,configurable:!0}),et}(Node$2);node.DataNode=DataNode;var Text$2=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Text,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),et}(DataNode);node.Text=Text$2;var Comment$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Comment,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),et}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(tt){__extends(et,tt);function et(rt,nt){var st=tt.call(this,nt)||this;return st.name=rt,st.type=domelementtype_1.ElementType.Directive,st}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),et}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(tt){__extends(et,tt);function et(rt){var nt=tt.call(this)||this;return nt.children=rt,nt}return Object.defineProperty(et.prototype,"firstChild",{get:function(){var rt;return(rt=this.children[0])!==null&&rt!==void 0?rt:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"childNodes",{get:function(){return this.children},set:function(rt){this.children=rt},enumerable:!1,configurable:!0}),et}(Node$2);node.NodeWithChildren=NodeWithChildren;var CDATA=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.CDATA,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.CDATA=CDATA;var Document=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Root,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Document=Document;var Element$2=function(tt){__extends(et,tt);function et(rt,nt,st,ot){st===void 0&&(st=[]),ot===void 0&&(ot=rt==="script"?domelementtype_1.ElementType.Script:rt==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var at=tt.call(this,st)||this;return at.name=rt,at.attribs=nt,at.type=ot,at}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"tagName",{get:function(){return this.name},set:function(rt){this.name=rt},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"attributes",{get:function(){var rt=this;return Object.keys(this.attribs).map(function(nt){var st,ot;return{name:nt,value:rt.attribs[nt],namespace:(st=rt["x-attribsNamespace"])===null||st===void 0?void 0:st[nt],prefix:(ot=rt["x-attribsPrefix"])===null||ot===void 0?void 0:ot[nt]}})},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Element=Element$2;function isTag(tt){return(0,domelementtype_1.isTag)(tt)}node.isTag=isTag;function isCDATA(tt){return tt.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(tt){return tt.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(tt){return tt.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(tt){return tt.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(tt){return tt.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(tt){return Object.prototype.hasOwnProperty.call(tt,"children")}node.hasChildren=hasChildren;function cloneNode(tt,et){et===void 0&&(et=!1);var rt;if(isText(tt))rt=new Text$2(tt.data);else if(isComment(tt))rt=new Comment$1(tt.data);else if(isTag(tt)){var nt=et?cloneChildren(tt.children):[],st=new Element$2(tt.name,__assign({},tt.attribs),nt);nt.forEach(function(ut){return ut.parent=st}),tt.namespace!=null&&(st.namespace=tt.namespace),tt["x-attribsNamespace"]&&(st["x-attribsNamespace"]=__assign({},tt["x-attribsNamespace"])),tt["x-attribsPrefix"]&&(st["x-attribsPrefix"]=__assign({},tt["x-attribsPrefix"])),rt=st}else if(isCDATA(tt)){var nt=et?cloneChildren(tt.children):[],ot=new CDATA(nt);nt.forEach(function(ct){return ct.parent=ot}),rt=ot}else if(isDocument(tt)){var nt=et?cloneChildren(tt.children):[],at=new Document(nt);nt.forEach(function(ct){return ct.parent=at}),tt["x-mode"]&&(at["x-mode"]=tt["x-mode"]),rt=at}else if(isDirective(tt)){var lt=new ProcessingInstruction$1(tt.name,tt.data);tt["x-name"]!=null&&(lt["x-name"]=tt["x-name"],lt["x-publicId"]=tt["x-publicId"],lt["x-systemId"]=tt["x-systemId"]),rt=lt}else throw new Error("Not implemented yet: ".concat(tt.type));return rt.startIndex=tt.startIndex,rt.endIndex=tt.endIndex,tt.sourceCodeLocation!=null&&(rt.sourceCodeLocation=tt.sourceCodeLocation),rt}node.cloneNode=cloneNode;function cloneChildren(tt){for(var et=tt.map(function(nt){return cloneNode(nt,!0)}),rt=1;rt<et.length;rt++)et[rt].prev=et[rt-1],et[rt-1].next=et[rt];return et}(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(lt,ut,ct,dt){dt===void 0&&(dt=ct);var ht=Object.getOwnPropertyDescriptor(ut,ct);(!ht||("get"in ht?!ut.__esModule:ht.writable||ht.configurable))&&(ht={enumerable:!0,get:function(){return ut[ct]}}),Object.defineProperty(lt,dt,ht)}:function(lt,ut,ct,dt){dt===void 0&&(dt=ct),lt[dt]=ut[ct]}),rt=commonjsGlobal&&commonjsGlobal.__exportStar||function(lt,ut){for(var ct in lt)ct!=="default"&&!Object.prototype.hasOwnProperty.call(ut,ct)&&et(ut,lt,ct)};Object.defineProperty(tt,"__esModule",{value:!0}),tt.DomHandler=void 0;var nt=lib$2,st=node;rt(node,tt);var ot={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},at=function(){function lt(ut,ct,dt){this.dom=[],this.root=new st.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof ct=="function"&&(dt=ct,ct=ot),typeof ut=="object"&&(ct=ut,ut=void 0),this.callback=ut??null,this.options=ct??ot,this.elementCB=dt??null}return lt.prototype.onparserinit=function(ut){this.parser=ut},lt.prototype.onreset=function(){this.dom=[],this.root=new st.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},lt.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},lt.prototype.onerror=function(ut){this.handleCallback(ut)},lt.prototype.onclosetag=function(){this.lastNode=null;var ut=this.tagStack.pop();this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(ut)},lt.prototype.onopentag=function(ut,ct){var dt=this.options.xmlMode?nt.ElementType.Tag:void 0,ht=new st.Element(ut,ct,void 0,dt);this.addNode(ht),this.tagStack.push(ht)},lt.prototype.ontext=function(ut){var ct=this.lastNode;if(ct&&ct.type===nt.ElementType.Text)ct.data+=ut,this.options.withEndIndices&&(ct.endIndex=this.parser.endIndex);else{var dt=new st.Text(ut);this.addNode(dt),this.lastNode=dt}},lt.prototype.oncomment=function(ut){if(this.lastNode&&this.lastNode.type===nt.ElementType.Comment){this.lastNode.data+=ut;return}var ct=new st.Comment(ut);this.addNode(ct),this.lastNode=ct},lt.prototype.oncommentend=function(){this.lastNode=null},lt.prototype.oncdatastart=function(){var ut=new st.Text(""),ct=new st.CDATA([ut]);this.addNode(ct),ut.parent=ct,this.lastNode=ut},lt.prototype.oncdataend=function(){this.lastNode=null},lt.prototype.onprocessinginstruction=function(ut,ct){var dt=new st.ProcessingInstruction(ut,ct);this.addNode(dt)},lt.prototype.handleCallback=function(ut){if(typeof this.callback=="function")this.callback(ut,this.dom);else if(ut)throw ut},lt.prototype.addNode=function(ut){var ct=this.tagStack[this.tagStack.length-1],dt=ct.children[ct.children.length-1];this.options.withStartIndices&&(ut.startIndex=this.parser.startIndex),this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),ct.children.push(ut),dt&&(ut.prev=dt,dt.next=ut),ut.parent=ct,this.lastNode=null},lt}();tt.DomHandler=at,tt.default=at})(lib$3);var HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head[^]*>/i,BODY_TAG_REGEX=/<body[^]*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},DOMParser$1=typeof window=="object"&&window.DOMParser;if(typeof DOMParser$1=="function"){var domParser=new DOMParser$1,mimeType="text/html";parseFromString=function(tt,et){return et&&(tt="<"+et+">"+tt+"</"+et+">"),domParser.parseFromString(tt,mimeType)},parseFromDocument=parseFromString}if(typeof document=="object"&&document.implementation){var doc=document.implementation.createHTMLDocument();parseFromDocument=function(tt,et){if(et){var rt=doc.documentElement.querySelector(et);return rt.innerHTML=tt,doc}return doc.documentElement.innerHTML=tt,doc}}var template=typeof document=="object"?document.createElement("template"):{},parseFromTemplate;template.content&&(parseFromTemplate=function(tt){return template.innerHTML=tt,template.content.childNodes});function domparser$1(tt){var et,rt=tt.match(FIRST_TAG_REGEX);rt&&rt[1]&&(et=rt[1].toLowerCase());var nt,st,ot;switch(et){case HTML:return nt=parseFromString(tt),HEAD_TAG_REGEX.test(tt)||(st=nt.querySelector(HEAD),st&&st.parentNode.removeChild(st)),BODY_TAG_REGEX.test(tt)||(st=nt.querySelector(BODY),st&&st.parentNode.removeChild(st)),nt.querySelectorAll(HTML);case HEAD:case BODY:return nt=parseFromDocument(tt),ot=nt.querySelectorAll(et),BODY_TAG_REGEX.test(tt)&&HEAD_TAG_REGEX.test(tt)?ot[0].parentNode.childNodes:ot;default:return parseFromTemplate?parseFromTemplate(tt):(st=parseFromDocument(tt,BODY).querySelector(BODY),st.childNodes)}}var domparser_1=domparser$1,utilities$5={},constants$1={};constants$1.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 domhandler$1=lib$3,constants=constants$1,CASE_SENSITIVE_TAG_NAMES=constants.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler$1.Comment,Element$1=domhandler$1.Element,ProcessingInstruction=domhandler$1.ProcessingInstruction,Text$1=domhandler$1.Text,caseSensitiveTagNamesMap={},tagName;for(var i$1=0,len=CASE_SENSITIVE_TAG_NAMES.length;i$1<len;i$1++)tagName=CASE_SENSITIVE_TAG_NAMES[i$1],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(tt){return caseSensitiveTagNamesMap[tt]}function formatAttributes(tt){for(var et={},rt,nt=0,st=tt.length;nt<st;nt++)rt=tt[nt],et[rt.name]=rt.value;return et}function formatTagName(tt){tt=tt.toLowerCase();var et=getCaseSensitiveTagName(tt);return et||tt}function formatDOM$1(tt,et,rt){et=et||null;for(var nt=[],st,ot=0,at=tt.length;ot<at;ot++){var lt=tt[ot],ut;switch(lt.nodeType){case 1:st=formatTagName(lt.nodeName),ut=new Element$1(st,formatAttributes(lt.attributes)),ut.children=formatDOM$1(st==="template"?lt.content.childNodes:lt.childNodes,ut);break;case 3:ut=new Text$1(lt.nodeValue);break;case 8:ut=new Comment(lt.nodeValue);break;default:continue}var ct=nt[ot-1]||null;ct&&(ct.next=ut),ut.parent=et,ut.prev=ct,ut.next=null,nt.push(ut)}return rt&&(ut=new ProcessingInstruction(rt.substring(0,rt.indexOf(" ")).toLowerCase(),rt),ut.next=nt[0]||null,ut.parent=et,nt.unshift(ut),nt[1]&&(nt[1].prev=nt[0])),nt}utilities$5.formatAttributes=formatAttributes;utilities$5.formatDOM=formatDOM$1;var domparser=domparser_1,utilities$4=utilities$5,formatDOM=utilities$4.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(tt){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(tt==="")return[];var et=tt.match(DIRECTIVE_REGEX),rt;return et&&et[1]&&(rt=et[1]),formatDOM(domparser(tt),null,rt)}var htmlToDom=HTMLDOMParser,lib$1={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.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(lib$1,"__esModule",{value:!0});function _slicedToArray(tt,et){return _arrayWithHoles(tt)||_iterableToArrayLimit(tt,et)||_unsupportedIterableToArray(tt,et)||_nonIterableRest()}function _arrayWithHoles(tt){if(Array.isArray(tt))return tt}function _iterableToArrayLimit(tt,et){var rt=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(rt!=null){var nt=[],st=!0,ot=!1,at,lt;try{for(rt=rt.call(tt);!(st=(at=rt.next()).done)&&(nt.push(at.value),!(et&&nt.length===et));st=!0);}catch(ut){ot=!0,lt=ut}finally{try{!st&&rt.return!=null&&rt.return()}finally{if(ot)throw lt}}return nt}}function _unsupportedIterableToArray(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray(tt,et);var rt=Object.prototype.toString.call(tt).slice(8,-1);if(rt==="Object"&&tt.constructor&&(rt=tt.constructor.name),rt==="Map"||rt==="Set")return Array.from(tt);if(rt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(rt))return _arrayLikeToArray(tt,et)}}function _arrayLikeToArray(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var rt=0,nt=new Array(et);rt<et;rt++)nt[rt]=tt[rt];return nt}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
227
227
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var RESERVED=0,STRING=1,BOOLEANISH_STRING=2,BOOLEAN=3,OVERLOADED_BOOLEAN=4,NUMERIC=5,POSITIVE_NUMERIC=6;function getPropertyInfo(tt){return properties.hasOwnProperty(tt)?properties[tt]:null}function PropertyInfoRecord(tt,et,rt,nt,st,ot,at){this.acceptsBooleans=et===BOOLEANISH_STRING||et===BOOLEAN||et===OVERLOADED_BOOLEAN,this.attributeName=nt,this.attributeNamespace=st,this.mustUseProperty=rt,this.propertyName=tt,this.type=et,this.sanitizeURL=ot,this.removeEmptyString=at}var properties={},reservedProps=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];reservedProps.forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,RESERVED,!1,tt,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(tt){var et=_slicedToArray(tt,2),rt=et[0],nt=et[1];properties[rt]=new PropertyInfoRecord(rt,STRING,!1,nt,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt,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(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!1,tt.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!0,tt,null,!1,!1)});["capture","download"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,OVERLOADED_BOOLEAN,!1,tt,null,!1,!1)});["cols","rows","size","span"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,POSITIVE_NUMERIC,!1,tt,null,!1,!1)});["rowSpan","start"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,NUMERIC,!1,tt.toLowerCase(),null,!1,!1)});var CAMELIZE=/[\-\:]([a-z])/g,capitalize$1=function tt(et){return et[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(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!1,!1)});var xlinkHref="xlinkHref";properties[xlinkHref]=new PropertyInfoRecord("xlinkHref",STRING,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!0,!0)});var _require=possibleStandardNamesOptimized$1,CAMELCASE=_require.CAMELCASE,SAME=_require.SAME,possibleStandardNamesOptimized=_require.possibleStandardNames,ATTRIBUTE_NAME_START_CHAR=":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",ATTRIBUTE_NAME_CHAR=ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",isCustomAttribute=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+ATTRIBUTE_NAME_CHAR+"]*$")),possibleStandardNames=Object.keys(possibleStandardNamesOptimized).reduce(function(tt,et){var rt=possibleStandardNamesOptimized[et];return rt===SAME?tt[et]=et:rt===CAMELCASE?tt[et.toLowerCase()]=et:tt[et]=rt,tt},{});lib$1.BOOLEAN=BOOLEAN;lib$1.BOOLEANISH_STRING=BOOLEANISH_STRING;lib$1.NUMERIC=NUMERIC;lib$1.OVERLOADED_BOOLEAN=OVERLOADED_BOOLEAN;lib$1.POSITIVE_NUMERIC=POSITIVE_NUMERIC;lib$1.RESERVED=RESERVED;lib$1.STRING=STRING;lib$1.getPropertyInfo=getPropertyInfo;lib$1.isCustomAttribute=isCustomAttribute;lib$1.possibleStandardNames=possibleStandardNames;var cjs={},styleToObject={exports:{}},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
228
- `,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(!tt)return[];et=et||{};var rt=1,nt=1;function st(yt){var vt=yt.match(NEWLINE_REGEX);vt&&(rt+=vt.length);var Et=yt.lastIndexOf(NEWLINE);nt=~Et?yt.length-Et:nt+yt.length}function ot(){var yt={line:rt,column:nt};return function(vt){return vt.position=new at(yt),ct(),vt}}function at(yt){this.start=yt,this.end={line:rt,column:nt},this.source=et.source}at.prototype.content=tt;function lt(yt){var vt=new Error(et.source+":"+rt+":"+nt+": "+yt);if(vt.reason=yt,vt.filename=et.source,vt.line=rt,vt.column=nt,vt.source=tt,!et.silent)throw vt}function ut(yt){var vt=yt.exec(tt);if(vt){var Et=vt[0];return st(Et),tt=tt.slice(Et.length),vt}}function ct(){ut(WHITESPACE_REGEX)}function dt(yt){var vt;for(yt=yt||[];vt=ht();)vt!==!1&&yt.push(vt);return yt}function ht(){var yt=ot();if(!(FORWARD_SLASH!=tt.charAt(0)||ASTERISK!=tt.charAt(1))){for(var vt=2;EMPTY_STRING!=tt.charAt(vt)&&(ASTERISK!=tt.charAt(vt)||FORWARD_SLASH!=tt.charAt(vt+1));)++vt;if(vt+=2,EMPTY_STRING===tt.charAt(vt-1))return lt("End of comment missing");var Et=tt.slice(2,vt-2);return nt+=2,st(Et),tt=tt.slice(vt),nt+=2,yt({type:TYPE_COMMENT,comment:Et})}}function mt(){var yt=ot(),vt=ut(PROPERTY_REGEX);if(vt){if(ht(),!ut(COLON_REGEX))return lt("property missing ':'");var Et=ut(VALUE_REGEX),bt=yt({type:TYPE_DECLARATION,property:trim(vt[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:Et?trim(Et[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return ut(SEMICOLON_REGEX),bt}}function xt(){var yt=[];dt(yt);for(var vt;vt=mt();)vt!==!1&&(yt.push(vt),dt(yt));return yt}return ct(),xt()};function trim(tt){return tt?tt.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var parse$2=inlineStyleParser;function StyleToObject(tt,et){var rt=null;if(!tt||typeof tt!="string")return rt;for(var nt,st=parse$2(tt),ot=typeof et=="function",at,lt,ut=0,ct=st.length;ut<ct;ut++)nt=st[ut],at=nt.property,lt=nt.value,ot?et(at,lt,nt):lt&&(rt||(rt={}),rt[at]=lt);return rt}styleToObject.exports=StyleToObject;styleToObject.exports.default=StyleToObject;var styleToObjectExports=styleToObject.exports,utilities$3={};utilities$3.__esModule=!0;utilities$3.camelCase=void 0;var CUSTOM_PROPERTY_REGEX=/^--[a-zA-Z0-9-]+$/,HYPHEN_REGEX=/-([a-z])/g,NO_HYPHEN_REGEX=/^[^-]+$/,VENDOR_PREFIX_REGEX=/^-(webkit|moz|ms|o|khtml)-/,MS_VENDOR_PREFIX_REGEX=/^-(ms)-/,skipCamelCase=function(tt){return!tt||NO_HYPHEN_REGEX.test(tt)||CUSTOM_PROPERTY_REGEX.test(tt)},capitalize=function(tt,et){return et.toUpperCase()},trimHyphen=function(tt,et){return"".concat(et,"-")},camelCase=function(tt,et){return et===void 0&&(et={}),skipCamelCase(tt)?tt:(tt=tt.toLowerCase(),et.reactCompat?tt=tt.replace(MS_VENDOR_PREFIX_REGEX,trimHyphen):tt=tt.replace(VENDOR_PREFIX_REGEX,trimHyphen),tt.replace(HYPHEN_REGEX,capitalize))};utilities$3.camelCase=camelCase;(function(tt){var et=commonjsGlobal&&commonjsGlobal.__importDefault||function(ot){return ot&&ot.__esModule?ot:{default:ot}};tt.__esModule=!0;var rt=et(styleToObjectExports),nt=utilities$3;function st(ot,at){var lt={};return!ot||typeof ot!="string"||(0,rt.default)(ot,function(ut,ct){ut&&ct&&(lt[(0,nt.camelCase)(ut,at)]=ct)}),lt}tt.default=st})(cjs);var React$3=reactExports,styleToJS=cjs.default;function invertObject(tt,et){if(!tt||typeof tt!="object")throw new TypeError("First argument must be an object");var rt=typeof et=="function",nt={},st={};for(var ot in tt){var at=tt[ot];if(rt&&(nt=et(ot,at),nt&&nt.length===2)){st[nt[0]]=nt[1];continue}typeof at=="string"&&(st[at]=ot)}return st}var RESERVED_SVG_MATHML_ELEMENTS=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function isCustomComponent(tt,et){return tt.indexOf("-")===-1?et&&typeof et.is=="string":!RESERVED_SVG_MATHML_ELEMENTS.has(tt)}var STYLE_TO_JS_OPTIONS={reactCompat:!0};function setStyleProp$1(tt,et){if(tt!=null)try{et.style=styleToJS(tt,STYLE_TO_JS_OPTIONS)}catch{et.style={}}}var PRESERVE_CUSTOM_ATTRIBUTES=React$3.version.split(".")[0]>=16,ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function canTextBeChildOfNode$1(tt){return!ELEMENTS_WITH_NO_TEXT_CHILDREN.has(tt.name)}function returnFirstArg(tt){return tt}var utilities$2={PRESERVE_CUSTOM_ATTRIBUTES,ELEMENTS_WITH_NO_TEXT_CHILDREN,invertObject,isCustomComponent,setStyleProp:setStyleProp$1,canTextBeChildOfNode:canTextBeChildOfNode$1,returnFirstArg},reactProperty=lib$1,utilities$1=utilities$2,UNCONTROLLED_COMPONENT_ATTRIBUTES=["checked","value"],UNCONTROLLED_COMPONENT_NAMES=["input","select","textarea"],VALUE_ONLY_INPUTS={reset:!0,submit:!0},attributesToProps$3=function tt(et,rt){et=et||{};var nt,st,ot,at,lt,ut={},ct=et.type&&VALUE_ONLY_INPUTS[et.type];for(nt in et){if(ot=et[nt],reactProperty.isCustomAttribute(nt)){ut[nt]=ot;continue}if(st=nt.toLowerCase(),at=getPropName(st),at){switch(lt=reactProperty.getPropertyInfo(at),UNCONTROLLED_COMPONENT_ATTRIBUTES.indexOf(at)!==-1&&UNCONTROLLED_COMPONENT_NAMES.indexOf(rt)!==-1&&!ct&&(at=getPropName("default"+st)),ut[at]=ot,lt&&lt.type){case reactProperty.BOOLEAN:ut[at]=!0;break;case reactProperty.OVERLOADED_BOOLEAN:ot===""&&(ut[at]=!0);break}continue}utilities$1.PRESERVE_CUSTOM_ATTRIBUTES&&(ut[nt]=ot)}return utilities$1.setStyleProp(et.style,ut),ut};function getPropName(tt){return reactProperty.possibleStandardNames[tt]}var React$2=reactExports,attributesToProps$2=attributesToProps$3,utilities=utilities$2,setStyleProp=utilities.setStyleProp,canTextBeChildOfNode=utilities.canTextBeChildOfNode;function domToReact$2(tt,et){et=et||{};for(var rt=et.library||React$2,nt=rt.cloneElement,st=rt.createElement,ot=rt.isValidElement,at=[],lt,ut,ct=typeof et.replace=="function",dt=et.transform||utilities.returnFirstArg,ht,mt,xt,yt=et.trim,vt=0,Et=tt.length;vt<Et;vt++){if(lt=tt[vt],ct&&(ht=et.replace(lt),ot(ht))){Et>1&&(ht=nt(ht,{key:ht.key||vt})),at.push(dt(ht,lt,vt));continue}if(lt.type==="text"){if(ut=!lt.data.trim().length,ut&&lt.parent&&!canTextBeChildOfNode(lt.parent)||yt&&ut)continue;at.push(dt(lt.data,lt,vt));continue}switch(mt=lt.attribs,skipAttributesToProps(lt)?setStyleProp(mt.style,mt):mt&&(mt=attributesToProps$2(mt,lt.name)),xt=null,lt.type){case"script":case"style":lt.children[0]&&(mt.dangerouslySetInnerHTML={__html:lt.children[0].data});break;case"tag":lt.name==="textarea"&&lt.children[0]?mt.defaultValue=lt.children[0].data:lt.children&&lt.children.length&&(xt=domToReact$2(lt.children,et));break;default:continue}Et>1&&(mt.key=vt),at.push(dt(st(lt.name,mt,xt),lt,vt))}return at.length===1?at[0]:at}function skipAttributesToProps(tt){return utilities.PRESERVE_CUSTOM_ATTRIBUTES&&tt.type==="tag"&&utilities.isCustomComponent(tt.name,tt.attribs)}var domToReact_1=domToReact$2,domhandler=lib$3,htmlToDOM=htmlToDom,attributesToProps$1=attributesToProps$3,domToReact$1=domToReact_1;htmlToDOM=typeof htmlToDOM.default=="function"?htmlToDOM.default:htmlToDOM;var domParserOptions={lowerCaseAttributeNames:!1};function HTMLReactParser(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");return tt===""?[]:(et=et||{},domToReact$1(htmlToDOM(tt,et.htmlparser2||domParserOptions),et))}HTMLReactParser.domToReact=domToReact$1;HTMLReactParser.htmlToDOM=htmlToDOM;HTMLReactParser.attributesToProps=attributesToProps$1;HTMLReactParser.Comment=domhandler.Comment;HTMLReactParser.Element=domhandler.Element;HTMLReactParser.ProcessingInstruction=domhandler.ProcessingInstruction;HTMLReactParser.Text=domhandler.Text;var htmlReactParser=HTMLReactParser;HTMLReactParser.default=HTMLReactParser;const HTMLReactParser$1=getDefaultExportFromCjs(htmlReactParser);var domToReact=HTMLReactParser$1.domToReact;HTMLReactParser$1.htmlToDOM;var attributesToProps=HTMLReactParser$1.attributesToProps;HTMLReactParser$1.Comment;HTMLReactParser$1.Element;HTMLReactParser$1.ProcessingInstruction;HTMLReactParser$1.Text;const SvgIconBurgerMenu=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M21 5c0 .828-.711 1.5-1.588 1.5H4.588C3.711 6.5 3 5.828 3 5s.711-1.5 1.588-1.5h14.824C20.289 3.5 21 4.172 21 5M21 12c0 .828-.711 1.5-1.588 1.5H4.588C3.711 13.5 3 12.828 3 12s.711-1.5 1.588-1.5h14.824c.877 0 1.588.672 1.588 1.5M21 19c0 .828-.711 1.5-1.588 1.5H4.588C3.711 20.5 3 19.828 3 19s.711-1.5 1.588-1.5h14.824c.877 0 1.588.672 1.588 1.5",clipRule:"evenodd"})]});function useHelp(){var tt,et,rt,nt,st;const{appCode:ot}=useEdificeClient(),{theme:at}=useEdificeTheme(),[lt,ut]=reactExports.useState(""),[ct,dt]=reactExports.useState(!0),[ht,mt]=reactExports.useState(!1),[xt,yt]=reactExports.useState(!1),vt=at!=null&&at.is1d?"/help-1d":"/help-2d";reactExports.useEffect(()=>{(async()=>{let wt="";wt=vt+"/application/"+ot+"/",!ot&&window.location.pathname!=="/adapter"?wt=vt+"/application/portal/":window.location.pathname==="/adapter"?wt=vt+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?wt=vt+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(wt=vt+"/application/userbook/");try{const Rt=await fetch(wt),Ct=await Rt.text();if(Rt.status===404){yt(!0);return}ut(Ct),yt(!1)}catch(Rt){yt(!0),console.error(Rt)}})()},[ot,vt]);const Et=HTMLReactParser$1(lt,{replace:wt=>{const Rt=wt;if(Rt.attribs&&Rt.attribs.id==="TOC")return jsxRuntimeExports.jsxs("nav",{id:"TOC",children:[jsxRuntimeExports.jsx(Button,{onClick:()=>{dt(!ct)},children:jsxRuntimeExports.jsx(SvgIconBurgerMenu,{})}),domToReact(Rt.children,{replace:Ct=>{const Pt=Ct;if(Pt.attribs&&Pt.name==="ul")return jsxRuntimeExports.jsx("ul",{id:"TOC-list",style:{display:ct?"block":"none"},children:domToReact(Pt.children,{replace:It=>{const jt=It;if(jt.attribs&&jt.name==="a")return jsxRuntimeExports.jsx("a",{...attributesToProps(jt.attribs),children:jsxRuntimeExports.jsx("span",{onClick:()=>{dt(!1)},children:domToReact(jt.children)})})}})})}})]});if(Rt.attribs&&Rt.attribs.class==="section level2"){const Ct=attributesToProps(wt.attribs);return jsxRuntimeExports.jsx("div",{...Ct,className:"section level2",style:{display:Rt.attribs.id!=="présentation"?"none":"block"},children:domToReact(Rt.children,{replace:Pt=>{const It=Pt;if(It.attribs&&It.name==="img"){const jt=Pt.attribs.src;return jsxRuntimeExports.jsx("img",{...attributesToProps(It.attribs),src:`${vt}/${jt}`,alt:""})}}})})}}}),bt=(rt=(et=(tt=Et==null?void 0:Et.props)==null?void 0:tt.children.find(wt=>wt.type==="body"))==null?void 0:et.props)==null?void 0:rt.children,St=(st=(nt=bt==null?void 0:bt.find(wt=>wt.type==="p"))==null?void 0:nt.props)==null?void 0:st.children;return{html:lt,visibility:ct,isModalOpen:ht,setIsModalOpen:mt,parsedContent:bt,parsedHeadline:St,error:xt}}const Header=({is1d:tt=!1,src:et=""})=>{const{t:rt}=useTranslation(),{messages:nt,msgLink:st,zimbraWorkflow:ot}=useConversation(),{user:at,avatar:lt}=useUser(),{currentLanguage:ut,currentApp:ct}=useEdificeClient(),dt=useHasWorkflow("org.entcore.portal.controllers.PortalController|oldHelpEnable")||!1,{isModalOpen:ht,setIsModalOpen:mt,parsedContent:xt,parsedHeadline:yt,error:vt}=useHelp(),Et=clsx("header",{"no-2d":tt,"no-1d":!tt}),{title:bt,bookmarkedApps:St,appsRef:wt,isAppsHovered:Rt,popoverAppsId:Ct,userAvatar:Pt,userName:It,welcomeUser:jt,communityWorkflow:Dt,conversationWorflow:Vt,searchWorkflow:Ft,isCollapsed:Ht,toggleCollapsedNav:Nt,handleLogout:Lt}=useHeader({user:at,avatar:lt}),Mt=nt>0,{theme:zt}=useEdificeTheme();return jsxRuntimeExports.jsx("header",{className:Et,children:tt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"container-fluid",children:jsxRuntimeExports.jsxs(Navbar,{children:[jsxRuntimeExports.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:ct?ct.address:"/timeline/timeline",children:bt}),jsxRuntimeExports.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[jsxRuntimeExports.jsx(Avatar,{alt:It,size:"sm",src:Pt,variant:"circle",width:"32",height:"32"}),jsxRuntimeExports.jsx("span",{className:"navbar-text",children:jt})]}),jsxRuntimeExports.jsxs(NavBarNav,{className:"gap-8","aria-hidden":"false","aria-label":rt("navbar.main.navigation"),children:[Vt&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[jsxRuntimeExports.jsx(SvgIconOneMessaging,{className:"icon notification"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"danger"},className:"position-absolute",children:nt}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.messages")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx(NavLink,{link:"/userbook/mon-compte",className:"dropdown-item",translate:rt("navbar.myaccount"),children:jsxRuntimeExports.jsx(SvgIconOneProfile,{className:"icon user"})})}),ut==="fr"&&dt?jsxRuntimeExports.jsxs(NavItem,{children:[jsxRuntimeExports.jsxs("button",{className:"nav-link",onClick:()=>{mt(!0)},children:[jsxRuntimeExports.jsx(SvgIconAssistance,{className:"icon help"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.help")})]}),jsxRuntimeExports.jsx(Help,{isHelpOpen:ht,setIsHelpOpen:mt,parsedContent:xt,parsedHeadline:yt,error:vt})]}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("button",{className:"nav-link",onClick:Lt,children:[jsxRuntimeExports.jsx(SvgIconDisconnect,{className:"icon logout"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.disconnect")})]})}),jsxRuntimeExports.jsx(NavItem,{className:"d-md-none",children:jsxRuntimeExports.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!Ht,"aria-label":rt("navbar.secondary.navigation"),onClick:Nt,children:jsxRuntimeExports.jsx(SvgIconRafterDown,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),jsxRuntimeExports.jsx(Navbar,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":rt("navbar.secondary.navigation"),children:jsxRuntimeExports.jsx("div",{className:"container-fluid",children:jsxRuntimeExports.jsxs("div",{className:`collapse navbar-collapse ${Ht?"":"show"}`,id:"navbarCollapsed",children:[jsxRuntimeExports.jsx(Logo,{is1d:!0,src:`${et}/img/illustrations/logo.png`,translate:rt("navbar.home")}),jsxRuntimeExports.jsxs(NavBarNav,{className:"gap-8",children:[jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/timeline/timeline",className:"button",children:[jsxRuntimeExports.jsx(SvgIconNewRelease,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.whatsnew")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[jsxRuntimeExports.jsx(SvgIconUserbook,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.classMembers")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/welcome",className:"button",children:[jsxRuntimeExports.jsx(SvgIconMyApps,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.myapps")})]})})]})]})})})]}):jsxRuntimeExports.jsx(Navbar,{className:"navbar-expand-md",children:jsxRuntimeExports.jsxs("div",{className:"container-fluid",children:[jsxRuntimeExports.jsx(Logo,{src:`${et}/img/illustrations/logo.png`}),jsxRuntimeExports.jsx("a",{href:ct?ct.address:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:bt}),jsxRuntimeExports.jsxs("ul",{className:"navbar-nav",children:[jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx(NavLink,{link:"/timeline/timeline",translate:rt("navbar.home"),children:jsxRuntimeExports.jsx(SvgIconHome,{color:"#fff"})})}),jsxRuntimeExports.jsxs(NavItem,{className:"position-relative",ref:wt,id:Ct,"aria-haspopup":"true","aria-expanded":Rt,children:[jsxRuntimeExports.jsx(NavLink,{link:"/welcome",translate:rt("navbar.applications"),children:jsxRuntimeExports.jsx(SvgIconMyApps,{color:"#fff"})}),jsxRuntimeExports.jsxs(Popover,{className:"top-100 widget",id:Ct,isVisible:Rt,children:[jsxRuntimeExports.jsx(PopoverBody,{children:jsxRuntimeExports.jsx(WidgetAppsBody,{bookmarkedApps:St})}),jsxRuntimeExports.jsx(PopoverFooter,{className:"widget-footer border-top border-ghost",children:jsxRuntimeExports.jsx(WidgetAppsFooter,{})})]})]}),Vt&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs(NavLink,{className:"position-relative",link:"/conversation/conversation",translate:rt("conversation"),children:[jsxRuntimeExports.jsx(SvgIconNeoMessaging,{color:"#fff"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"warning"},className:"position-absolute",children:nt})]})}),ot&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs(NavLink,{className:"position-relative",link:st,translate:rt("conversation"),children:[jsxRuntimeExports.jsx(SvgIconNeoMessaging,{color:"#fff"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"warning"},className:"position-absolute",children:nt})]})}),ut==="fr"&&dt?jsxRuntimeExports.jsxs(NavItem,{children:[jsxRuntimeExports.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{mt(!0)},children:[jsxRuntimeExports.jsx(SvgIconAssistance,{color:"#fff"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("support")})]}),jsxRuntimeExports.jsx(Help,{isHelpOpen:ht,setIsHelpOpen:mt,parsedContent:xt,parsedHeadline:yt,error:vt})]}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("div",{className:"dropdown",children:[jsxRuntimeExports.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!Ht,"aria-label":rt("navbar.open.menu"),onClick:Nt,children:jsxRuntimeExports.jsx(SvgIconRafterDown,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),jsxRuntimeExports.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${Ht?"":"show"}`,id:"dropdown-navbar",children:[Dt&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconCommunity,{className:"icon community"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:rt("navbar.community")})]})}),Ft?jsxRuntimeExports.jsx(SearchEngine,{}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(Avatar,{alt:It,size:"sm",src:Pt,variant:"circle",className:"bg-white",width:"32",height:"32"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:rt("navbar.myaccount")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx("hr",{className:"dropdown-divider"})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/auth/logout?callback="+((zt==null?void 0:zt.logoutCallback)??"/"),className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconDisconnect,{className:"icon logout"}),jsxRuntimeExports.jsx("span",{id:"logout-label",className:"nav-text",children:rt("navbar.disconnect")})]})})]})]})})]})]})})})};function usePreferences(tt){return{getPreference:async()=>await odeServices.conf().getPreference(tt),savePreference:async et=>await odeServices.conf().savePreference(tt,JSON.stringify(et))}}function useCookiesConsent(){const[tt,et]=reactExports.useState(!1),{getPreference:rt,savePreference:nt}=usePreferences("rgpdCookies");return reactExports.useEffect(()=>{(async()=>{const st=await rt();et(st===null?!0:st.showInfoTip)})()},[]),{showCookiesConsent:tt,handleConsultCookies:()=>{document.location.href="/userbook/mon-compte",nt({showInfoTip:!1}),et(!1)},handleCloseCookiesConsent:()=>{nt({showInfoTip:!1}),et(!1)}}}const Layout=({children:tt,headless:et=!1,...rt})=>{const{theme:nt}=useEdificeTheme(),{t:st}=useTranslation(),{showCookiesConsent:ot,handleConsultCookies:at,handleCloseCookiesConsent:lt}=useCookiesConsent();useZendeskGuide(),useCantoo();const ut=clsx("d-flex flex-column bg-white",{"container-fluid":!et,"rounded-4 border":(nt==null?void 0:nt.is1d)&&!et,"mt-24":(nt==null?void 0:nt.is1d)&&!et}),ct=et?null:jsxRuntimeExports.jsx(Header,{is1d:nt==null?void 0:nt.is1d,src:nt==null?void 0:nt.basePath}),dt=ot&&jsxRuntimeExports.jsx(Alert,{type:"info",className:"m-12 rgpd",isConfirm:!0,position:"bottom-right",button:jsxRuntimeExports.jsx(Button,{color:"tertiary",variant:"ghost",onClick:at,children:st("rgpd.cookies.banner.button.consult")}),onClose:lt,children:st("rgpd.cookies.banner.text1")}),ht=jsxRuntimeExports.jsx(De$1,{containerClassName:"toaster-container",toastOptions:{position:"top-right"}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ct,jsxRuntimeExports.jsx("main",{className:ut,...rt,children:tt}),ht,dt]})},Toolbar=reactExports.forwardRef(({items:tt,variant:et="default",align:rt="space",isBlock:nt=!1,ariaControls:st,className:ot},at)=>{const[lt,ut]=reactExports.useState(0),[ct,dt]=reactExports.useState([]),[ht,mt]=reactExports.useState(),[xt,yt]=reactExports.useState(),vt=reactExports.useRef(),Et=clsx("toolbar z-1000 bg-white",ot,{default:et==="default","no-shadow":et==="no-shadow","d-flex":nt,"d-inline-flex":!nt,"overflow-x-auto":nt,"justify-content-start":rt==="left","justify-content-between":rt==="space","justify-content-center":rt==="center","justify-content-end":rt==="right"});reactExports.useEffect(()=>{var Pt;const It=(Pt=vt.current)==null?void 0:Pt.querySelectorAll("button"),jt=[];let Dt=!1;It==null||It.forEach(Vt=>{Vt.disabled||(Dt||(mt(Vt),Dt=!0),yt(Vt),jt.push(Vt))}),dt(jt),ut(tt.findIndex(Vt=>(Vt.type==="button"||Vt.type==="icon")&&!Vt.props.disabled))},[tt]);const bt=Pt=>{Pt.target.classList.add("focus")},St=Pt=>{Pt.target.classList.remove("focus")},wt=Pt=>{var It,jt;const Dt=ct.indexOf(Pt.currentTarget);switch(Pt.code){case"ArrowLeft":Pt.currentTarget===ht?xt==null||xt.focus():(It=ct[Dt-1])==null||It.focus();break;case"ArrowRight":Pt.currentTarget===xt?ht==null||ht.focus():(jt=ct[Dt+1])==null||jt.focus();break}},Rt=Pt=>{var It;return typeof Pt.tooltip=="string"?Pt.tooltip:(It=Pt.tooltip)==null?void 0:It.message},Ct=Pt=>{var It;return typeof Pt.tooltip!="string"?(It=Pt.tooltip)==null?void 0:It.position:"top"};return jsxRuntimeExports.jsx("div",{ref:mergeRefs(at,vt),className:Et,role:"toolbar","aria-label":"Text Formatting","aria-controls":st,onFocus:bt,onBlur:St,children:tt.map((Pt,It)=>{if(Pt.visibility==="hide")return null;switch(Pt.type){case"divider":return jsxRuntimeExports.jsx("div",{className:"toolbar-divider"},Pt.name??It);case"button":return jsxRuntimeExports.jsx(Tooltip,{message:Rt(Pt),placement:Ct(Pt),children:reactExports.createElement(Button,{...Pt.props,key:Pt.name??It,color:Pt.props.color?Pt.props.color:"tertiary",variant:"ghost",tabIndex:It===lt?0:-1,onKeyDown:wt})},Pt.name??It);case"icon":return jsxRuntimeExports.jsx(Tooltip,{message:Rt(Pt),placement:Ct(Pt),children:reactExports.createElement(IconButton,{...Pt.props,key:Pt.name??It,color:Pt.props.color?Pt.props.color:"tertiary",variant:Pt.props.variant?Pt.props.variant:"ghost",tabIndex:It===lt?0:-1,onKeyDown:wt})},Pt.name??It);case"dropdown":return reactExports.createElement(Dropdown,{...Pt.props,key:Pt.name??It,extraTriggerKeyDownHandler:wt,overflow:Pt.overflow});case"primary":return jsxRuntimeExports.jsx(Tooltip,{message:Rt(Pt),placement:Ct(Pt),children:jsxRuntimeExports.jsx(Button,{...Pt.props,variant:"filled",color:"primary",tabIndex:It===lt?0:-1,onKeyDown:wt})},Pt.name??It)}return null})})}),loadingScreen="/assets/js/ode-explorer/screen-loading.gif",LoadingScreen=reactExports.forwardRef(({position:tt=!0,caption:et},rt)=>{const nt=clsx("top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-content-center align-items-center z-2000",{"position-fixed":!tt,"position-static":tt}),st=clsx("text-center pt-12",{"text-white":!tt});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{ref:rt,className:nt,children:[jsxRuntimeExports.jsx("div",{className:"bg-white rounded-circle mx-auto w-25",children:jsxRuntimeExports.jsx("img",{src:loadingScreen,alt:"loading"})}),et&&jsxRuntimeExports.jsx("div",{className:st,children:et})]}),!tt&&jsxRuntimeExports.jsx("div",{className:"modal-backdrop fade show"})]})}),TabsContext=reactExports.createContext(null);function useTabsContext(){const tt=reactExports.useContext(TabsContext);if(!tt)throw new Error("Tabs compound components cannot be rendered outside the Tabs component");return tt}const useTabs=({defaultId:tt,items:et,onChange:rt})=>{const[nt,st]=reactExports.useState(tt||""),[ot,at]=reactExports.useState(0),[lt,ut]=reactExports.useState(0),ct=reactExports.useRef([]),dt=reactExports.useCallback(yt=>{st(yt)},[]);reactExports.useEffect(()=>{const yt=et.find(vt=>vt.id===nt);yt&&(rt==null||rt(yt))},[nt]),reactExports.useEffect(()=>{function yt(){var vt;if(((vt=document==null?void 0:document.activeElement)==null?void 0:vt.tagName)!=="INPUT"){const Et=et.findIndex(St=>St.id===nt);Et===-1&&tt&&st(tt);const bt=ct.current[Et];bt&&(bt.focus(),ut((bt==null?void 0:bt.offsetLeft)??0),at((bt==null?void 0:bt.clientWidth)??0))}}return yt(),window.addEventListener("resize",yt),()=>window.removeEventListener("resize",yt)},[nt,et,tt]);const ht=reactExports.useCallback(yt=>{var vt,Et,bt;const St=et.findIndex(wt=>wt.id===yt);yt===((vt=et[0])==null?void 0:vt.id)?st((Et=et[et.length-1])==null?void 0:Et.id):st((bt=et[St-1])==null?void 0:bt.id)},[et]),mt=reactExports.useCallback(yt=>{var vt,Et,bt;const St=et.findIndex(wt=>wt.id===yt);yt===((vt=et[et.length-1])==null?void 0:vt.id)?st((Et=et[0])==null?void 0:Et.id):st((bt=et[St+1])==null?void 0:bt.id)},[et]),xt=reactExports.useCallback(yt=>{var vt,Et;switch(yt.code){case"ArrowLeft":ht(nt);break;case"ArrowRight":mt(nt);break;case"Home":st((vt=et[0])==null?void 0:vt.id);break;case"End":st((Et=et[et.length-1])==null?void 0:Et.id);break}},[nt,et,mt,ht]);return{activeTab:nt,setSelectedTab:dt,tabsRef:ct,tabUnderlineLeft:lt,tabUnderlineWidth:ot,onKeyDown:xt}},TabsItem=({icon:tt,label:et,id:rt,order:nt})=>{const{activeTab:st,setSelectedTab:ot,onKeyDown:at,tabsRef:lt}=useTabsContext(),{t:ut}=useTranslation(),ct=clsx("nav-link d-inline-flex gap-8 border-0",st===rt?"selected":"");return jsxRuntimeExports.jsx("li",{className:"nav-item flex-shrink-0",role:"presentation",children:jsxRuntimeExports.jsxs("button",{ref:dt=>lt.current[nt]=dt,type:"button",id:`tab-${rt}`,className:ct,onClick:()=>ot(rt),onKeyDown:dt=>at(dt),role:"tab","aria-controls":`tabpanel-${rt}`,"aria-selected":st===rt,tabIndex:st===rt?0:-1,children:[tt,jsxRuntimeExports.jsx("small",{children:ut(et)})]})})},TabsList=tt=>{const{items:et,tabUnderlineLeft:rt,tabUnderlineWidth:nt}=useTabsContext(),{className:st,...ot}=tt,at=clsx("position-relative flex-shrink-0 overflow-x-auto",st);return jsxRuntimeExports.jsxs("div",{className:at,...ot,children:[jsxRuntimeExports.jsx("ul",{className:"nav nav-tabs flex-nowrap",role:"tablist",children:et.map((lt,ut)=>jsxRuntimeExports.jsx(Tabs.Item,{order:ut,...lt},lt.id))}),jsxRuntimeExports.jsx("span",{className:"nav-slide",style:{left:rt,width:nt}})]})},TabsPanel=({children:tt,currentItem:et})=>{const{activeTab:rt}=useTabsContext();return jsxRuntimeExports.jsx("div",{className:"tab-content d-flex flex-fill w-100",children:jsxRuntimeExports.jsx("div",{className:`tab-pane flex-fill w-100 fade ${rt===(et==null?void 0:et.id)?"show active":""}`,id:`tabpanel-${et==null?void 0:et.id}`,role:"tabpanel","aria-labelledby":`tab-${et==null?void 0:et.id}`,tabIndex:0,children:tt})})},Tabs=({defaultId:tt,items:et,onChange:rt,children:nt})=>{const{activeTab:st,setSelectedTab:ot,tabsRef:at,tabUnderlineLeft:lt,tabUnderlineWidth:ut,onKeyDown:ct}=useTabs({defaultId:tt,items:et,onChange:rt}),dt=reactExports.useMemo(()=>({activeTab:st,items:et,setSelectedTab:ot,tabsRef:at,tabUnderlineLeft:lt,tabUnderlineWidth:ut,onKeyDown:ct}),[st,et,ct,ot,lt,ut,at]),ht=et.find(mt=>mt.id===st);return jsxRuntimeExports.jsx(TabsContext.Provider,{value:dt,children:typeof nt=="function"?nt(ht):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tabs.List,{}),jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:ht,children:ht==null?void 0:ht.content})]})})};Tabs.Item=TabsItem;Tabs.Panel=TabsPanel;Tabs.List=TabsList;const TextArea=reactExports.forwardRef(({noValidationIcon:tt,placeholder:et,size:rt="md",height:nt="md",className:st,...ot},at)=>{const{id:lt,isRequired:ut,isReadOnly:ct,status:dt}=useFormControl(),ht=clsx({"form-control":!ct,"form-control-lg":rt==="lg","form-control-sm":rt==="sm","textarea-height-lg":nt==="lg","textarea-height-md":nt==="md","textarea-height-sm":nt==="sm","is-invalid":dt==="invalid","is-valid":dt==="valid","form-control-plaintext":ct,"no-validation-icon":tt},st);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("textarea",{ref:at,id:lt,className:ht,placeholder:et,required:ut,readOnly:ct,...ot})})}),useMediaLibrary=()=>{const tt=reactExports.useRef(null),[et,rt]=reactExports.useState(),{remove:nt}=useWorkspaceFile();return{ref:tt,libraryMedia:et,setLibraryMedia:rt,onCancel:async st=>{var ot,at;(ot=tt.current)!=null&&ot.type&&st&&st.length>0&&await nt(st),(at=tt.current)==null||at.hide()},onSuccess:st=>{var ot,at,lt,ut;let ct;switch((ot=tt.current)==null?void 0:ot.type){case"video":{if(typeof st=="object")ct=st[0];else{const dt=new DOMParser().parseFromString(st,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(at=tt.current)==null||at.hide(),ct=ht}break}case"embedder":{const dt=new DOMParser().parseFromString(st,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(lt=tt.current)==null||lt.hide(),ct=ht;break}case"audio":{st.length===void 0?ct=st:ct=st[0];break}case"hyperlink":{ct=st;break}case"image":{ct=`/workspace/document/${st[0]._id}`;break}default:ct=st[0]}(ut=tt.current)==null||ut.hide(),rt(ct)},onTabChange:async(st,ot)=>{var at;(at=tt.current)!=null&&at.type&&ot&&ot.length>0&&await nt(ot)}}},useResourceSearch=tt=>{const[et,rt]=reactExports.useState([]);reactExports.useEffect(()=>{(async()=>(await SnipletsService.initialize(odeServices,tt),await SnipletsService.registerBehaviours(tt),rt(SnipletsService.resourceProducingApps)))()},[]);const nt=reactExports.useCallback(async st=>{const[ot]=st.types;return await odeServices.behaviour(tt,ot).loadResources(st)},[tt]);return{resourceApplications:et,loadResources:nt}};function isObject$3(tt){return tt!==null&&typeof tt=="object"&&"constructor"in tt&&tt.constructor===Object}function extend$2(tt,et){tt===void 0&&(tt={}),et===void 0&&(et={}),Object.keys(et).forEach(rt=>{typeof tt[rt]>"u"?tt[rt]=et[rt]:isObject$3(et[rt])&&isObject$3(tt[rt])&&Object.keys(et[rt]).length>0&&extend$2(tt[rt],et[rt])})}const ssrDocument={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function getDocument(){const tt=typeof document<"u"?document:{};return extend$2(tt,ssrDocument),tt}const ssrWindow={document:ssrDocument,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function tt(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(tt){return typeof setTimeout>"u"?(tt(),null):setTimeout(tt,0)},cancelAnimationFrame(tt){typeof setTimeout>"u"||clearTimeout(tt)}};function getWindow(){const tt=typeof window<"u"?window:{};return extend$2(tt,ssrWindow),tt}function deleteProps(tt){const et=tt;Object.keys(et).forEach(rt=>{try{et[rt]=null}catch{}try{delete et[rt]}catch{}})}function nextTick(tt,et){return et===void 0&&(et=0),setTimeout(tt,et)}function now(){return Date.now()}function getComputedStyle$1(tt){const et=getWindow();let rt;return et.getComputedStyle&&(rt=et.getComputedStyle(tt,null)),!rt&&tt.currentStyle&&(rt=tt.currentStyle),rt||(rt=tt.style),rt}function getTranslate(tt,et){et===void 0&&(et="x");const rt=getWindow();let nt,st,ot;const at=getComputedStyle$1(tt);return rt.WebKitCSSMatrix?(st=at.transform||at.webkitTransform,st.split(",").length>6&&(st=st.split(", ").map(lt=>lt.replace(",",".")).join(", ")),ot=new rt.WebKitCSSMatrix(st==="none"?"":st)):(ot=at.MozTransform||at.OTransform||at.MsTransform||at.msTransform||at.transform||at.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),nt=ot.toString().split(",")),et==="x"&&(rt.WebKitCSSMatrix?st=ot.m41:nt.length===16?st=parseFloat(nt[12]):st=parseFloat(nt[4])),et==="y"&&(rt.WebKitCSSMatrix?st=ot.m42:nt.length===16?st=parseFloat(nt[13]):st=parseFloat(nt[5])),st||0}function isObject$2(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"}function isNode(tt){return typeof window<"u"&&typeof window.HTMLElement<"u"?tt instanceof HTMLElement:tt&&(tt.nodeType===1||tt.nodeType===11)}function extend$1(){const tt=Object(arguments.length<=0?void 0:arguments[0]),et=["__proto__","constructor","prototype"];for(let rt=1;rt<arguments.length;rt+=1){const nt=rt<0||arguments.length<=rt?void 0:arguments[rt];if(nt!=null&&!isNode(nt)){const st=Object.keys(Object(nt)).filter(ot=>et.indexOf(ot)<0);for(let ot=0,at=st.length;ot<at;ot+=1){const lt=st[ot],ut=Object.getOwnPropertyDescriptor(nt,lt);ut!==void 0&&ut.enumerable&&(isObject$2(tt[lt])&&isObject$2(nt[lt])?nt[lt].__swiper__?tt[lt]=nt[lt]:extend$1(tt[lt],nt[lt]):!isObject$2(tt[lt])&&isObject$2(nt[lt])?(tt[lt]={},nt[lt].__swiper__?tt[lt]=nt[lt]:extend$1(tt[lt],nt[lt])):tt[lt]=nt[lt])}}}return tt}function setCSSProperty(tt,et,rt){tt.style.setProperty(et,rt)}function animateCSSModeScroll(tt){let{swiper:et,targetPosition:rt,side:nt}=tt;const st=getWindow(),ot=-et.translate;let at=null,lt;const ut=et.params.speed;et.wrapperEl.style.scrollSnapType="none",st.cancelAnimationFrame(et.cssModeFrameID);const ct=rt>ot?"next":"prev",dt=(mt,xt)=>ct==="next"&&mt>=xt||ct==="prev"&&mt<=xt,ht=()=>{lt=new Date().getTime(),at===null&&(at=lt);const mt=Math.max(Math.min((lt-at)/ut,1),0),xt=.5-Math.cos(mt*Math.PI)/2;let yt=ot+xt*(rt-ot);if(dt(yt,rt)&&(yt=rt),et.wrapperEl.scrollTo({[nt]:yt}),dt(yt,rt)){et.wrapperEl.style.overflow="hidden",et.wrapperEl.style.scrollSnapType="",setTimeout(()=>{et.wrapperEl.style.overflow="",et.wrapperEl.scrollTo({[nt]:yt})}),st.cancelAnimationFrame(et.cssModeFrameID);return}et.cssModeFrameID=st.requestAnimationFrame(ht)};ht()}function elementChildren(tt,et){return et===void 0&&(et=""),[...tt.children].filter(rt=>rt.matches(et))}function createElement(tt,et){et===void 0&&(et=[]);const rt=document.createElement(tt);return rt.classList.add(...Array.isArray(et)?et:[et]),rt}function elementPrevAll(tt,et){const rt=[];for(;tt.previousElementSibling;){const nt=tt.previousElementSibling;et?nt.matches(et)&&rt.push(nt):rt.push(nt),tt=nt}return rt}function elementNextAll(tt,et){const rt=[];for(;tt.nextElementSibling;){const nt=tt.nextElementSibling;et?nt.matches(et)&&rt.push(nt):rt.push(nt),tt=nt}return rt}function elementStyle(tt,et){return getWindow().getComputedStyle(tt,null).getPropertyValue(et)}function elementIndex(tt){let et=tt,rt;if(et){for(rt=0;(et=et.previousSibling)!==null;)et.nodeType===1&&(rt+=1);return rt}}function elementParents(tt,et){const rt=[];let nt=tt.parentElement;for(;nt;)et?nt.matches(et)&&rt.push(nt):rt.push(nt),nt=nt.parentElement;return rt}function elementOuterSize(tt,et,rt){const nt=getWindow();return tt[et==="width"?"offsetWidth":"offsetHeight"]+parseFloat(nt.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-right":"margin-top"))+parseFloat(nt.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-left":"margin-bottom"))}function createElementIfNotDefined(tt,et,rt,nt){return tt.params.createElements&&Object.keys(nt).forEach(st=>{if(!rt[st]&&rt.auto===!0){let ot=elementChildren(tt.el,`.${nt[st]}`)[0];ot||(ot=createElement("div",nt[st]),ot.className=nt[st],tt.el.append(ot)),rt[st]=ot,et[st]=ot}}),rt}function classesToSelector(tt){return tt===void 0&&(tt=""),`.${tt.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function Pagination(tt){let{swiper:et,extendParams:rt,on:nt,emit:st}=tt;const ot="swiper-pagination";rt({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:St=>St,formatFractionTotal:St=>St,bulletClass:`${ot}-bullet`,bulletActiveClass:`${ot}-bullet-active`,modifierClass:`${ot}-`,currentClass:`${ot}-current`,totalClass:`${ot}-total`,hiddenClass:`${ot}-hidden`,progressbarFillClass:`${ot}-progressbar-fill`,progressbarOppositeClass:`${ot}-progressbar-opposite`,clickableClass:`${ot}-clickable`,lockClass:`${ot}-lock`,horizontalClass:`${ot}-horizontal`,verticalClass:`${ot}-vertical`,paginationDisabledClass:`${ot}-disabled`}}),et.pagination={el:null,bullets:[]};let at,lt=0;const ut=St=>(Array.isArray(St)?St:[St]).filter(wt=>!!wt);function ct(){return!et.params.pagination.el||!et.pagination.el||Array.isArray(et.pagination.el)&&et.pagination.el.length===0}function dt(St,wt){const{bulletActiveClass:Rt}=et.params.pagination;St&&(St=St[`${wt==="prev"?"previous":"next"}ElementSibling`],St&&(St.classList.add(`${Rt}-${wt}`),St=St[`${wt==="prev"?"previous":"next"}ElementSibling`],St&&St.classList.add(`${Rt}-${wt}-${wt}`)))}function ht(St){const wt=St.target.closest(classesToSelector(et.params.pagination.bulletClass));if(!wt)return;St.preventDefault();const Rt=elementIndex(wt)*et.params.slidesPerGroup;if(et.params.loop){if(et.realIndex===Rt)return;const Ct=et.realIndex,Pt=et.getSlideIndexByData(Rt),It=et.getSlideIndexByData(et.realIndex),jt=Dt=>{const Vt=et.activeIndex;et.loopFix({direction:Dt,activeSlideIndex:Pt,slideTo:!1});const Ft=et.activeIndex;Vt===Ft&&et.slideToLoop(Ct,0,!1,!0)};if(Pt>et.slides.length-et.loopedSlides)jt(Pt>It?"next":"prev");else if(et.params.centeredSlides){const Dt=et.params.slidesPerView==="auto"?et.slidesPerViewDynamic():Math.ceil(parseFloat(et.params.slidesPerView,10));Pt<Math.floor(Dt/2)&&jt("prev")}et.slideToLoop(Rt)}else et.slideTo(Rt)}function mt(){const St=et.rtl,wt=et.params.pagination;if(ct())return;let Rt=et.pagination.el;Rt=ut(Rt);let Ct,Pt;const It=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length,jt=et.params.loop?Math.ceil(It/et.params.slidesPerGroup):et.snapGrid.length;if(et.params.loop?(Pt=et.previousRealIndex||0,Ct=et.params.slidesPerGroup>1?Math.floor(et.realIndex/et.params.slidesPerGroup):et.realIndex):typeof et.snapIndex<"u"?(Ct=et.snapIndex,Pt=et.previousSnapIndex):(Pt=et.previousIndex||0,Ct=et.activeIndex||0),wt.type==="bullets"&&et.pagination.bullets&&et.pagination.bullets.length>0){const Dt=et.pagination.bullets;let Vt,Ft,Ht;if(wt.dynamicBullets&&(at=elementOuterSize(Dt[0],et.isHorizontal()?"width":"height"),Rt.forEach(Nt=>{Nt.style[et.isHorizontal()?"width":"height"]=`${at*(wt.dynamicMainBullets+4)}px`}),wt.dynamicMainBullets>1&&Pt!==void 0&&(lt+=Ct-(Pt||0),lt>wt.dynamicMainBullets-1?lt=wt.dynamicMainBullets-1:lt<0&&(lt=0)),Vt=Math.max(Ct-lt,0),Ft=Vt+(Math.min(Dt.length,wt.dynamicMainBullets)-1),Ht=(Ft+Vt)/2),Dt.forEach(Nt=>{const Lt=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(Mt=>`${wt.bulletActiveClass}${Mt}`)].map(Mt=>typeof Mt=="string"&&Mt.includes(" ")?Mt.split(" "):Mt).flat();Nt.classList.remove(...Lt)}),Rt.length>1)Dt.forEach(Nt=>{const Lt=elementIndex(Nt);Lt===Ct?Nt.classList.add(...wt.bulletActiveClass.split(" ")):et.isElement&&Nt.setAttribute("part","bullet"),wt.dynamicBullets&&(Lt>=Vt&&Lt<=Ft&&Nt.classList.add(...`${wt.bulletActiveClass}-main`.split(" ")),Lt===Vt&&dt(Nt,"prev"),Lt===Ft&&dt(Nt,"next"))});else{const Nt=Dt[Ct];if(Nt&&Nt.classList.add(...wt.bulletActiveClass.split(" ")),et.isElement&&Dt.forEach((Lt,Mt)=>{Lt.setAttribute("part",Mt===Ct?"bullet-active":"bullet")}),wt.dynamicBullets){const Lt=Dt[Vt],Mt=Dt[Ft];for(let zt=Vt;zt<=Ft;zt+=1)Dt[zt]&&Dt[zt].classList.add(...`${wt.bulletActiveClass}-main`.split(" "));dt(Lt,"prev"),dt(Mt,"next")}}if(wt.dynamicBullets){const Nt=Math.min(Dt.length,wt.dynamicMainBullets+4),Lt=(at*Nt-at)/2-Ht*at,Mt=St?"right":"left";Dt.forEach(zt=>{zt.style[et.isHorizontal()?Mt:"top"]=`${Lt}px`})}}Rt.forEach((Dt,Vt)=>{if(wt.type==="fraction"&&(Dt.querySelectorAll(classesToSelector(wt.currentClass)).forEach(Ft=>{Ft.textContent=wt.formatFractionCurrent(Ct+1)}),Dt.querySelectorAll(classesToSelector(wt.totalClass)).forEach(Ft=>{Ft.textContent=wt.formatFractionTotal(jt)})),wt.type==="progressbar"){let Ft;wt.progressbarOpposite?Ft=et.isHorizontal()?"vertical":"horizontal":Ft=et.isHorizontal()?"horizontal":"vertical";const Ht=(Ct+1)/jt;let Nt=1,Lt=1;Ft==="horizontal"?Nt=Ht:Lt=Ht,Dt.querySelectorAll(classesToSelector(wt.progressbarFillClass)).forEach(Mt=>{Mt.style.transform=`translate3d(0,0,0) scaleX(${Nt}) scaleY(${Lt})`,Mt.style.transitionDuration=`${et.params.speed}ms`})}wt.type==="custom"&&wt.renderCustom?(Dt.innerHTML=wt.renderCustom(et,Ct+1,jt),Vt===0&&st("paginationRender",Dt)):(Vt===0&&st("paginationRender",Dt),st("paginationUpdate",Dt)),et.params.watchOverflow&&et.enabled&&Dt.classList[et.isLocked?"add":"remove"](wt.lockClass)})}function xt(){const St=et.params.pagination;if(ct())return;const wt=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length;let Rt=et.pagination.el;Rt=ut(Rt);let Ct="";if(St.type==="bullets"){let Pt=et.params.loop?Math.ceil(wt/et.params.slidesPerGroup):et.snapGrid.length;et.params.freeMode&&et.params.freeMode.enabled&&Pt>wt&&(Pt=wt);for(let It=0;It<Pt;It+=1)St.renderBullet?Ct+=St.renderBullet.call(et,It,St.bulletClass):Ct+=`<${St.bulletElement} ${et.isElement?'part="bullet"':""} class="${St.bulletClass}"></${St.bulletElement}>`}St.type==="fraction"&&(St.renderFraction?Ct=St.renderFraction.call(et,St.currentClass,St.totalClass):Ct=`<span class="${St.currentClass}"></span> / <span class="${St.totalClass}"></span>`),St.type==="progressbar"&&(St.renderProgressbar?Ct=St.renderProgressbar.call(et,St.progressbarFillClass):Ct=`<span class="${St.progressbarFillClass}"></span>`),et.pagination.bullets=[],Rt.forEach(Pt=>{St.type!=="custom"&&(Pt.innerHTML=Ct||""),St.type==="bullets"&&et.pagination.bullets.push(...Pt.querySelectorAll(classesToSelector(St.bulletClass)))}),St.type!=="custom"&&st("paginationRender",Rt[0])}function yt(){et.params.pagination=createElementIfNotDefined(et,et.originalParams.pagination,et.params.pagination,{el:"swiper-pagination"});const St=et.params.pagination;if(!St.el)return;let wt;typeof St.el=="string"&&et.isElement&&(wt=et.el.querySelector(St.el)),!wt&&typeof St.el=="string"&&(wt=[...document.querySelectorAll(St.el)]),wt||(wt=St.el),!(!wt||wt.length===0)&&(et.params.uniqueNavElements&&typeof St.el=="string"&&Array.isArray(wt)&&wt.length>1&&(wt=[...et.el.querySelectorAll(St.el)],wt.length>1&&(wt=wt.filter(Rt=>elementParents(Rt,".swiper")[0]===et.el)[0])),Array.isArray(wt)&&wt.length===1&&(wt=wt[0]),Object.assign(et.pagination,{el:wt}),wt=ut(wt),wt.forEach(Rt=>{St.type==="bullets"&&St.clickable&&Rt.classList.add(...(St.clickableClass||"").split(" ")),Rt.classList.add(St.modifierClass+St.type),Rt.classList.add(et.isHorizontal()?St.horizontalClass:St.verticalClass),St.type==="bullets"&&St.dynamicBullets&&(Rt.classList.add(`${St.modifierClass}${St.type}-dynamic`),lt=0,St.dynamicMainBullets<1&&(St.dynamicMainBullets=1)),St.type==="progressbar"&&St.progressbarOpposite&&Rt.classList.add(St.progressbarOppositeClass),St.clickable&&Rt.addEventListener("click",ht),et.enabled||Rt.classList.add(St.lockClass)}))}function vt(){const St=et.params.pagination;if(ct())return;let wt=et.pagination.el;wt&&(wt=ut(wt),wt.forEach(Rt=>{Rt.classList.remove(St.hiddenClass),Rt.classList.remove(St.modifierClass+St.type),Rt.classList.remove(et.isHorizontal()?St.horizontalClass:St.verticalClass),St.clickable&&(Rt.classList.remove(...(St.clickableClass||"").split(" ")),Rt.removeEventListener("click",ht))})),et.pagination.bullets&&et.pagination.bullets.forEach(Rt=>Rt.classList.remove(...St.bulletActiveClass.split(" ")))}nt("changeDirection",()=>{if(!et.pagination||!et.pagination.el)return;const St=et.params.pagination;let{el:wt}=et.pagination;wt=ut(wt),wt.forEach(Rt=>{Rt.classList.remove(St.horizontalClass,St.verticalClass),Rt.classList.add(et.isHorizontal()?St.horizontalClass:St.verticalClass)})}),nt("init",()=>{et.params.pagination.enabled===!1?bt():(yt(),xt(),mt())}),nt("activeIndexChange",()=>{typeof et.snapIndex>"u"&&mt()}),nt("snapIndexChange",()=>{mt()}),nt("snapGridLengthChange",()=>{xt(),mt()}),nt("destroy",()=>{vt()}),nt("enable disable",()=>{let{el:St}=et.pagination;St&&(St=ut(St),St.forEach(wt=>wt.classList[et.enabled?"remove":"add"](et.params.pagination.lockClass)))}),nt("lock unlock",()=>{mt()}),nt("click",(St,wt)=>{const Rt=wt.target,Ct=ut(et.pagination.el);if(et.params.pagination.el&&et.params.pagination.hideOnClick&&Ct&&Ct.length>0&&!Rt.classList.contains(et.params.pagination.bulletClass)){if(et.navigation&&(et.navigation.nextEl&&Rt===et.navigation.nextEl||et.navigation.prevEl&&Rt===et.navigation.prevEl))return;const Pt=Ct[0].classList.contains(et.params.pagination.hiddenClass);st(Pt===!0?"paginationShow":"paginationHide"),Ct.forEach(It=>It.classList.toggle(et.params.pagination.hiddenClass))}});const Et=()=>{et.el.classList.remove(et.params.pagination.paginationDisabledClass);let{el:St}=et.pagination;St&&(St=ut(St),St.forEach(wt=>wt.classList.remove(et.params.pagination.paginationDisabledClass))),yt(),xt(),mt()},bt=()=>{et.el.classList.add(et.params.pagination.paginationDisabledClass);let{el:St}=et.pagination;St&&(St=ut(St),St.forEach(wt=>wt.classList.add(et.params.pagination.paginationDisabledClass))),vt()};Object.assign(et.pagination,{enable:Et,disable:bt,render:xt,update:mt,init:yt,destroy:vt})}let support;function calcSupport(){const tt=getWindow(),et=getDocument();return{smoothScroll:et.documentElement&&et.documentElement.style&&"scrollBehavior"in et.documentElement.style,touch:!!("ontouchstart"in tt||tt.DocumentTouch&&et instanceof tt.DocumentTouch)}}function getSupport(){return support||(support=calcSupport()),support}let deviceCached;function calcDevice(tt){let{userAgent:et}=tt===void 0?{}:tt;const rt=getSupport(),nt=getWindow(),st=nt.navigator.platform,ot=et||nt.navigator.userAgent,at={ios:!1,android:!1},lt=nt.screen.width,ut=nt.screen.height,ct=ot.match(/(Android);?[\s\/]+([\d.]+)?/);let dt=ot.match(/(iPad).*OS\s([\d_]+)/);const ht=ot.match(/(iPod)(.*OS\s([\d_]+))?/),mt=!dt&&ot.match(/(iPhone\sOS|iOS)\s([\d_]+)/),xt=st==="Win32";let yt=st==="MacIntel";const vt=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!dt&&yt&&rt.touch&&vt.indexOf(`${lt}x${ut}`)>=0&&(dt=ot.match(/(Version)\/([\d.]+)/),dt||(dt=[0,1,"13_0_0"]),yt=!1),ct&&!xt&&(at.os="android",at.android=!0),(dt||mt||ht)&&(at.os="ios",at.ios=!0),at}function getDevice(tt){return tt===void 0&&(tt={}),deviceCached||(deviceCached=calcDevice(tt)),deviceCached}let browser;function calcBrowser(){const tt=getWindow();let et=!1;function rt(){const nt=tt.navigator.userAgent.toLowerCase();return nt.indexOf("safari")>=0&&nt.indexOf("chrome")<0&&nt.indexOf("android")<0}if(rt()){const nt=String(tt.navigator.userAgent);if(nt.includes("Version/")){const[st,ot]=nt.split("Version/")[1].split(" ")[0].split(".").map(at=>Number(at));et=st<16||st===16&&ot<2}}return{isSafari:et||rt(),needPerspectiveFix:et,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(tt.navigator.userAgent)}}function getBrowser(){return browser||(browser=calcBrowser()),browser}function Resize(tt){let{swiper:et,on:rt,emit:nt}=tt;const st=getWindow();let ot=null,at=null;const lt=()=>{!et||et.destroyed||!et.initialized||(nt("beforeResize"),nt("resize"))},ut=()=>{!et||et.destroyed||!et.initialized||(ot=new ResizeObserver(ht=>{at=st.requestAnimationFrame(()=>{const{width:mt,height:xt}=et;let yt=mt,vt=xt;ht.forEach(Et=>{let{contentBoxSize:bt,contentRect:St,target:wt}=Et;wt&&wt!==et.el||(yt=St?St.width:(bt[0]||bt).inlineSize,vt=St?St.height:(bt[0]||bt).blockSize)}),(yt!==mt||vt!==xt)&&lt()})}),ot.observe(et.el))},ct=()=>{at&&st.cancelAnimationFrame(at),ot&&ot.unobserve&&et.el&&(ot.unobserve(et.el),ot=null)},dt=()=>{!et||et.destroyed||!et.initialized||nt("orientationchange")};rt("init",()=>{if(et.params.resizeObserver&&typeof st.ResizeObserver<"u"){ut();return}st.addEventListener("resize",lt),st.addEventListener("orientationchange",dt)}),rt("destroy",()=>{ct(),st.removeEventListener("resize",lt),st.removeEventListener("orientationchange",dt)})}function Observer(tt){let{swiper:et,extendParams:rt,on:nt,emit:st}=tt;const ot=[],at=getWindow(),lt=function(dt,ht){ht===void 0&&(ht={});const mt=at.MutationObserver||at.WebkitMutationObserver,xt=new mt(yt=>{if(et.__preventObserver__)return;if(yt.length===1){st("observerUpdate",yt[0]);return}const vt=function(){st("observerUpdate",yt[0])};at.requestAnimationFrame?at.requestAnimationFrame(vt):at.setTimeout(vt,0)});xt.observe(dt,{attributes:typeof ht.attributes>"u"?!0:ht.attributes,childList:typeof ht.childList>"u"?!0:ht.childList,characterData:typeof ht.characterData>"u"?!0:ht.characterData}),ot.push(xt)},ut=()=>{if(et.params.observer){if(et.params.observeParents){const dt=elementParents(et.hostEl);for(let ht=0;ht<dt.length;ht+=1)lt(dt[ht])}lt(et.hostEl,{childList:et.params.observeSlideChildren}),lt(et.wrapperEl,{attributes:!1})}},ct=()=>{ot.forEach(dt=>{dt.disconnect()}),ot.splice(0,ot.length)};rt({observer:!1,observeParents:!1,observeSlideChildren:!1}),nt("init",ut),nt("destroy",ct)}var eventsEmitter={on(tt,et,rt){const nt=this;if(!nt.eventsListeners||nt.destroyed||typeof et!="function")return nt;const st=rt?"unshift":"push";return tt.split(" ").forEach(ot=>{nt.eventsListeners[ot]||(nt.eventsListeners[ot]=[]),nt.eventsListeners[ot][st](et)}),nt},once(tt,et,rt){const nt=this;if(!nt.eventsListeners||nt.destroyed||typeof et!="function")return nt;function st(){nt.off(tt,st),st.__emitterProxy&&delete st.__emitterProxy;for(var ot=arguments.length,at=new Array(ot),lt=0;lt<ot;lt++)at[lt]=arguments[lt];et.apply(nt,at)}return st.__emitterProxy=et,nt.on(tt,st,rt)},onAny(tt,et){const rt=this;if(!rt.eventsListeners||rt.destroyed||typeof tt!="function")return rt;const nt=et?"unshift":"push";return rt.eventsAnyListeners.indexOf(tt)<0&&rt.eventsAnyListeners[nt](tt),rt},offAny(tt){const et=this;if(!et.eventsListeners||et.destroyed||!et.eventsAnyListeners)return et;const rt=et.eventsAnyListeners.indexOf(tt);return rt>=0&&et.eventsAnyListeners.splice(rt,1),et},off(tt,et){const rt=this;return!rt.eventsListeners||rt.destroyed||!rt.eventsListeners||tt.split(" ").forEach(nt=>{typeof et>"u"?rt.eventsListeners[nt]=[]:rt.eventsListeners[nt]&&rt.eventsListeners[nt].forEach((st,ot)=>{(st===et||st.__emitterProxy&&st.__emitterProxy===et)&&rt.eventsListeners[nt].splice(ot,1)})}),rt},emit(){const tt=this;if(!tt.eventsListeners||tt.destroyed||!tt.eventsListeners)return tt;let et,rt,nt;for(var st=arguments.length,ot=new Array(st),at=0;at<st;at++)ot[at]=arguments[at];return typeof ot[0]=="string"||Array.isArray(ot[0])?(et=ot[0],rt=ot.slice(1,ot.length),nt=tt):(et=ot[0].events,rt=ot[0].data,nt=ot[0].context||tt),rt.unshift(nt),(Array.isArray(et)?et:et.split(" ")).forEach(ut=>{tt.eventsAnyListeners&&tt.eventsAnyListeners.length&&tt.eventsAnyListeners.forEach(ct=>{ct.apply(nt,[ut,...rt])}),tt.eventsListeners&&tt.eventsListeners[ut]&&tt.eventsListeners[ut].forEach(ct=>{ct.apply(nt,rt)})}),tt}};function updateSize(){const tt=this;let et,rt;const nt=tt.el;typeof tt.params.width<"u"&&tt.params.width!==null?et=tt.params.width:et=nt.clientWidth,typeof tt.params.height<"u"&&tt.params.height!==null?rt=tt.params.height:rt=nt.clientHeight,!(et===0&&tt.isHorizontal()||rt===0&&tt.isVertical())&&(et=et-parseInt(elementStyle(nt,"padding-left")||0,10)-parseInt(elementStyle(nt,"padding-right")||0,10),rt=rt-parseInt(elementStyle(nt,"padding-top")||0,10)-parseInt(elementStyle(nt,"padding-bottom")||0,10),Number.isNaN(et)&&(et=0),Number.isNaN(rt)&&(rt=0),Object.assign(tt,{width:et,height:rt,size:tt.isHorizontal()?et:rt}))}function updateSlides(){const tt=this;function et(Ft){return tt.isHorizontal()?Ft:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[Ft]}function rt(Ft,Ht){return parseFloat(Ft.getPropertyValue(et(Ht))||0)}const nt=tt.params,{wrapperEl:st,slidesEl:ot,size:at,rtlTranslate:lt,wrongRTL:ut}=tt,ct=tt.virtual&&nt.virtual.enabled,dt=ct?tt.virtual.slides.length:tt.slides.length,ht=elementChildren(ot,`.${tt.params.slideClass}, swiper-slide`),mt=ct?tt.virtual.slides.length:ht.length;let xt=[];const yt=[],vt=[];let Et=nt.slidesOffsetBefore;typeof Et=="function"&&(Et=nt.slidesOffsetBefore.call(tt));let bt=nt.slidesOffsetAfter;typeof bt=="function"&&(bt=nt.slidesOffsetAfter.call(tt));const St=tt.snapGrid.length,wt=tt.slidesGrid.length;let Rt=nt.spaceBetween,Ct=-Et,Pt=0,It=0;if(typeof at>"u")return;typeof Rt=="string"&&Rt.indexOf("%")>=0?Rt=parseFloat(Rt.replace("%",""))/100*at:typeof Rt=="string"&&(Rt=parseFloat(Rt)),tt.virtualSize=-Rt,ht.forEach(Ft=>{lt?Ft.style.marginLeft="":Ft.style.marginRight="",Ft.style.marginBottom="",Ft.style.marginTop=""}),nt.centeredSlides&&nt.cssMode&&(setCSSProperty(st,"--swiper-centered-offset-before",""),setCSSProperty(st,"--swiper-centered-offset-after",""));const jt=nt.grid&&nt.grid.rows>1&&tt.grid;jt&&tt.grid.initSlides(mt);let Dt;const Vt=nt.slidesPerView==="auto"&&nt.breakpoints&&Object.keys(nt.breakpoints).filter(Ft=>typeof nt.breakpoints[Ft].slidesPerView<"u").length>0;for(let Ft=0;Ft<mt;Ft+=1){Dt=0;let Ht;if(ht[Ft]&&(Ht=ht[Ft]),jt&&tt.grid.updateSlide(Ft,Ht,mt,et),!(ht[Ft]&&elementStyle(Ht,"display")==="none")){if(nt.slidesPerView==="auto"){Vt&&(ht[Ft].style[et("width")]="");const Nt=getComputedStyle(Ht),Lt=Ht.style.transform,Mt=Ht.style.webkitTransform;if(Lt&&(Ht.style.transform="none"),Mt&&(Ht.style.webkitTransform="none"),nt.roundLengths)Dt=tt.isHorizontal()?elementOuterSize(Ht,"width"):elementOuterSize(Ht,"height");else{const zt=rt(Nt,"width"),Gt=rt(Nt,"padding-left"),$t=rt(Nt,"padding-right"),Ut=rt(Nt,"margin-left"),Bt=rt(Nt,"margin-right"),Yt=Nt.getPropertyValue("box-sizing");if(Yt&&Yt==="border-box")Dt=zt+Ut+Bt;else{const{clientWidth:Zt,offsetWidth:Xt}=Ht;Dt=zt+Gt+$t+Ut+Bt+(Xt-Zt)}}Lt&&(Ht.style.transform=Lt),Mt&&(Ht.style.webkitTransform=Mt),nt.roundLengths&&(Dt=Math.floor(Dt))}else Dt=(at-(nt.slidesPerView-1)*Rt)/nt.slidesPerView,nt.roundLengths&&(Dt=Math.floor(Dt)),ht[Ft]&&(ht[Ft].style[et("width")]=`${Dt}px`);ht[Ft]&&(ht[Ft].swiperSlideSize=Dt),vt.push(Dt),nt.centeredSlides?(Ct=Ct+Dt/2+Pt/2+Rt,Pt===0&&Ft!==0&&(Ct=Ct-at/2-Rt),Ft===0&&(Ct=Ct-at/2-Rt),Math.abs(Ct)<1/1e3&&(Ct=0),nt.roundLengths&&(Ct=Math.floor(Ct)),It%nt.slidesPerGroup===0&&xt.push(Ct),yt.push(Ct)):(nt.roundLengths&&(Ct=Math.floor(Ct)),(It-Math.min(tt.params.slidesPerGroupSkip,It))%tt.params.slidesPerGroup===0&&xt.push(Ct),yt.push(Ct),Ct=Ct+Dt+Rt),tt.virtualSize+=Dt+Rt,Pt=Dt,It+=1}}if(tt.virtualSize=Math.max(tt.virtualSize,at)+bt,lt&&ut&&(nt.effect==="slide"||nt.effect==="coverflow")&&(st.style.width=`${tt.virtualSize+Rt}px`),nt.setWrapperSize&&(st.style[et("width")]=`${tt.virtualSize+Rt}px`),jt&&tt.grid.updateWrapperSize(Dt,xt,et),!nt.centeredSlides){const Ft=[];for(let Ht=0;Ht<xt.length;Ht+=1){let Nt=xt[Ht];nt.roundLengths&&(Nt=Math.floor(Nt)),xt[Ht]<=tt.virtualSize-at&&Ft.push(Nt)}xt=Ft,Math.floor(tt.virtualSize-at)-Math.floor(xt[xt.length-1])>1&&xt.push(tt.virtualSize-at)}if(ct&&nt.loop){const Ft=vt[0]+Rt;if(nt.slidesPerGroup>1){const Ht=Math.ceil((tt.virtual.slidesBefore+tt.virtual.slidesAfter)/nt.slidesPerGroup),Nt=Ft*nt.slidesPerGroup;for(let Lt=0;Lt<Ht;Lt+=1)xt.push(xt[xt.length-1]+Nt)}for(let Ht=0;Ht<tt.virtual.slidesBefore+tt.virtual.slidesAfter;Ht+=1)nt.slidesPerGroup===1&&xt.push(xt[xt.length-1]+Ft),yt.push(yt[yt.length-1]+Ft),tt.virtualSize+=Ft}if(xt.length===0&&(xt=[0]),Rt!==0){const Ft=tt.isHorizontal()&&lt?"marginLeft":et("marginRight");ht.filter((Ht,Nt)=>!nt.cssMode||nt.loop?!0:Nt!==ht.length-1).forEach(Ht=>{Ht.style[Ft]=`${Rt}px`})}if(nt.centeredSlides&&nt.centeredSlidesBounds){let Ft=0;vt.forEach(Nt=>{Ft+=Nt+(Rt||0)}),Ft-=Rt;const Ht=Ft-at;xt=xt.map(Nt=>Nt<=0?-Et:Nt>Ht?Ht+bt:Nt)}if(nt.centerInsufficientSlides){let Ft=0;if(vt.forEach(Ht=>{Ft+=Ht+(Rt||0)}),Ft-=Rt,Ft<at){const Ht=(at-Ft)/2;xt.forEach((Nt,Lt)=>{xt[Lt]=Nt-Ht}),yt.forEach((Nt,Lt)=>{yt[Lt]=Nt+Ht})}}if(Object.assign(tt,{slides:ht,snapGrid:xt,slidesGrid:yt,slidesSizesGrid:vt}),nt.centeredSlides&&nt.cssMode&&!nt.centeredSlidesBounds){setCSSProperty(st,"--swiper-centered-offset-before",`${-xt[0]}px`),setCSSProperty(st,"--swiper-centered-offset-after",`${tt.size/2-vt[vt.length-1]/2}px`);const Ft=-tt.snapGrid[0],Ht=-tt.slidesGrid[0];tt.snapGrid=tt.snapGrid.map(Nt=>Nt+Ft),tt.slidesGrid=tt.slidesGrid.map(Nt=>Nt+Ht)}if(mt!==dt&&tt.emit("slidesLengthChange"),xt.length!==St&&(tt.params.watchOverflow&&tt.checkOverflow(),tt.emit("snapGridLengthChange")),yt.length!==wt&&tt.emit("slidesGridLengthChange"),nt.watchSlidesProgress&&tt.updateSlidesOffset(),!ct&&!nt.cssMode&&(nt.effect==="slide"||nt.effect==="fade")){const Ft=`${nt.containerModifierClass}backface-hidden`,Ht=tt.el.classList.contains(Ft);mt<=nt.maxBackfaceHiddenSlides?Ht||tt.el.classList.add(Ft):Ht&&tt.el.classList.remove(Ft)}}function updateAutoHeight(tt){const et=this,rt=[],nt=et.virtual&&et.params.virtual.enabled;let st=0,ot;typeof tt=="number"?et.setTransition(tt):tt===!0&&et.setTransition(et.params.speed);const at=lt=>nt?et.slides[et.getSlideIndexByData(lt)]:et.slides[lt];if(et.params.slidesPerView!=="auto"&&et.params.slidesPerView>1)if(et.params.centeredSlides)(et.visibleSlides||[]).forEach(lt=>{rt.push(lt)});else for(ot=0;ot<Math.ceil(et.params.slidesPerView);ot+=1){const lt=et.activeIndex+ot;if(lt>et.slides.length&&!nt)break;rt.push(at(lt))}else rt.push(at(et.activeIndex));for(ot=0;ot<rt.length;ot+=1)if(typeof rt[ot]<"u"){const lt=rt[ot].offsetHeight;st=lt>st?lt:st}(st||st===0)&&(et.wrapperEl.style.height=`${st}px`)}function updateSlidesOffset(){const tt=this,et=tt.slides,rt=tt.isElement?tt.isHorizontal()?tt.wrapperEl.offsetLeft:tt.wrapperEl.offsetTop:0;for(let nt=0;nt<et.length;nt+=1)et[nt].swiperSlideOffset=(tt.isHorizontal()?et[nt].offsetLeft:et[nt].offsetTop)-rt-tt.cssOverflowAdjustment()}function updateSlidesProgress(tt){tt===void 0&&(tt=this&&this.translate||0);const et=this,rt=et.params,{slides:nt,rtlTranslate:st,snapGrid:ot}=et;if(nt.length===0)return;typeof nt[0].swiperSlideOffset>"u"&&et.updateSlidesOffset();let at=-tt;st&&(at=tt),nt.forEach(ut=>{ut.classList.remove(rt.slideVisibleClass)}),et.visibleSlidesIndexes=[],et.visibleSlides=[];let lt=rt.spaceBetween;typeof lt=="string"&&lt.indexOf("%")>=0?lt=parseFloat(lt.replace("%",""))/100*et.size:typeof lt=="string"&&(lt=parseFloat(lt));for(let ut=0;ut<nt.length;ut+=1){const ct=nt[ut];let dt=ct.swiperSlideOffset;rt.cssMode&&rt.centeredSlides&&(dt-=nt[0].swiperSlideOffset);const ht=(at+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),mt=(at-ot[0]+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),xt=-(at-dt),yt=xt+et.slidesSizesGrid[ut];(xt>=0&&xt<et.size-1||yt>1&&yt<=et.size||xt<=0&&yt>=et.size)&&(et.visibleSlides.push(ct),et.visibleSlidesIndexes.push(ut),nt[ut].classList.add(rt.slideVisibleClass)),ct.progress=st?-ht:ht,ct.originalProgress=st?-mt:mt}}function updateProgress(tt){const et=this;if(typeof tt>"u"){const dt=et.rtlTranslate?-1:1;tt=et&&et.translate&&et.translate*dt||0}const rt=et.params,nt=et.maxTranslate()-et.minTranslate();let{progress:st,isBeginning:ot,isEnd:at,progressLoop:lt}=et;const ut=ot,ct=at;if(nt===0)st=0,ot=!0,at=!0;else{st=(tt-et.minTranslate())/nt;const dt=Math.abs(tt-et.minTranslate())<1,ht=Math.abs(tt-et.maxTranslate())<1;ot=dt||st<=0,at=ht||st>=1,dt&&(st=0),ht&&(st=1)}if(rt.loop){const dt=et.getSlideIndexByData(0),ht=et.getSlideIndexByData(et.slides.length-1),mt=et.slidesGrid[dt],xt=et.slidesGrid[ht],yt=et.slidesGrid[et.slidesGrid.length-1],vt=Math.abs(tt);vt>=mt?lt=(vt-mt)/yt:lt=(vt+yt-xt)/yt,lt>1&&(lt-=1)}Object.assign(et,{progress:st,progressLoop:lt,isBeginning:ot,isEnd:at}),(rt.watchSlidesProgress||rt.centeredSlides&&rt.autoHeight)&&et.updateSlidesProgress(tt),ot&&!ut&&et.emit("reachBeginning toEdge"),at&&!ct&&et.emit("reachEnd toEdge"),(ut&&!ot||ct&&!at)&&et.emit("fromEdge"),et.emit("progress",st)}function updateSlidesClasses(){const tt=this,{slides:et,params:rt,slidesEl:nt,activeIndex:st}=tt,ot=tt.virtual&&rt.virtual.enabled,at=ut=>elementChildren(nt,`.${rt.slideClass}${ut}, swiper-slide${ut}`)[0];et.forEach(ut=>{ut.classList.remove(rt.slideActiveClass,rt.slideNextClass,rt.slidePrevClass)});let lt;if(ot)if(rt.loop){let ut=st-tt.virtual.slidesBefore;ut<0&&(ut=tt.virtual.slides.length+ut),ut>=tt.virtual.slides.length&&(ut-=tt.virtual.slides.length),lt=at(`[data-swiper-slide-index="${ut}"]`)}else lt=at(`[data-swiper-slide-index="${st}"]`);else lt=et[st];if(lt){lt.classList.add(rt.slideActiveClass);let ut=elementNextAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ut&&(ut=et[0]),ut&&ut.classList.add(rt.slideNextClass);let ct=elementPrevAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ct===0&&(ct=et[et.length-1]),ct&&ct.classList.add(rt.slidePrevClass)}tt.emitSlidesClasses()}const processLazyPreloader=(tt,et)=>{if(!tt||tt.destroyed||!tt.params)return;const rt=()=>tt.isElement?"swiper-slide":`.${tt.params.slideClass}`,nt=et.closest(rt());if(nt){let st=nt.querySelector(`.${tt.params.lazyPreloaderClass}`);!st&&tt.isElement&&(nt.shadowRoot?st=nt.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{nt.shadowRoot&&(st=nt.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`),st&&st.remove())})),st&&st.remove()}},unlazy=(tt,et)=>{if(!tt.slides[et])return;const rt=tt.slides[et].querySelector('[loading="lazy"]');rt&&rt.removeAttribute("loading")},preload=tt=>{if(!tt||tt.destroyed||!tt.params)return;let et=tt.params.lazyPreloadPrevNext;const rt=tt.slides.length;if(!rt||!et||et<0)return;et=Math.min(et,rt);const nt=tt.params.slidesPerView==="auto"?tt.slidesPerViewDynamic():Math.ceil(tt.params.slidesPerView),st=tt.activeIndex;if(tt.params.grid&&tt.params.grid.rows>1){const at=st,lt=[at-et];lt.push(...Array.from({length:et}).map((ut,ct)=>at+nt+ct)),tt.slides.forEach((ut,ct)=>{lt.includes(ut.column)&&unlazy(tt,ct)});return}const ot=st+nt-1;if(tt.params.rewind||tt.params.loop)for(let at=st-et;at<=ot+et;at+=1){const lt=(at%rt+rt)%rt;(lt<st||lt>ot)&&unlazy(tt,lt)}else for(let at=Math.max(st-et,0);at<=Math.min(ot+et,rt-1);at+=1)at!==st&&(at>ot||at<st)&&unlazy(tt,at)};function getActiveIndexByTranslate(tt){const{slidesGrid:et,params:rt}=tt,nt=tt.rtlTranslate?tt.translate:-tt.translate;let st;for(let ot=0;ot<et.length;ot+=1)typeof et[ot+1]<"u"?nt>=et[ot]&&nt<et[ot+1]-(et[ot+1]-et[ot])/2?st=ot:nt>=et[ot]&&nt<et[ot+1]&&(st=ot+1):nt>=et[ot]&&(st=ot);return rt.normalizeSlideIndex&&(st<0||typeof st>"u")&&(st=0),st}function updateActiveIndex(tt){const et=this,rt=et.rtlTranslate?et.translate:-et.translate,{snapGrid:nt,params:st,activeIndex:ot,realIndex:at,snapIndex:lt}=et;let ut=tt,ct;const dt=mt=>{let xt=mt-et.virtual.slidesBefore;return xt<0&&(xt=et.virtual.slides.length+xt),xt>=et.virtual.slides.length&&(xt-=et.virtual.slides.length),xt};if(typeof ut>"u"&&(ut=getActiveIndexByTranslate(et)),nt.indexOf(rt)>=0)ct=nt.indexOf(rt);else{const mt=Math.min(st.slidesPerGroupSkip,ut);ct=mt+Math.floor((ut-mt)/st.slidesPerGroup)}if(ct>=nt.length&&(ct=nt.length-1),ut===ot){ct!==lt&&(et.snapIndex=ct,et.emit("snapIndexChange")),et.params.loop&&et.virtual&&et.params.virtual.enabled&&(et.realIndex=dt(ut));return}let ht;et.virtual&&st.virtual.enabled&&st.loop?ht=dt(ut):et.slides[ut]?ht=parseInt(et.slides[ut].getAttribute("data-swiper-slide-index")||ut,10):ht=ut,Object.assign(et,{previousSnapIndex:lt,snapIndex:ct,previousRealIndex:at,realIndex:ht,previousIndex:ot,activeIndex:ut}),et.initialized&&preload(et),et.emit("activeIndexChange"),et.emit("snapIndexChange"),(et.initialized||et.params.runCallbacksOnInit)&&(at!==ht&&et.emit("realIndexChange"),et.emit("slideChange"))}function updateClickedSlide(tt,et){const rt=this,nt=rt.params;let st=tt.closest(`.${nt.slideClass}, swiper-slide`);!st&&rt.isElement&&et&&et.length>1&&et.includes(tt)&&[...et.slice(et.indexOf(tt)+1,et.length)].forEach(lt=>{!st&&lt.matches&&lt.matches(`.${nt.slideClass}, swiper-slide`)&&(st=lt)});let ot=!1,at;if(st){for(let lt=0;lt<rt.slides.length;lt+=1)if(rt.slides[lt]===st){ot=!0,at=lt;break}}if(st&&ot)rt.clickedSlide=st,rt.virtual&&rt.params.virtual.enabled?rt.clickedIndex=parseInt(st.getAttribute("data-swiper-slide-index"),10):rt.clickedIndex=at;else{rt.clickedSlide=void 0,rt.clickedIndex=void 0;return}nt.slideToClickedSlide&&rt.clickedIndex!==void 0&&rt.clickedIndex!==rt.activeIndex&&rt.slideToClickedSlide()}var update={updateSize,updateSlides,updateAutoHeight,updateSlidesOffset,updateSlidesProgress,updateProgress,updateSlidesClasses,updateActiveIndex,updateClickedSlide};function getSwiperTranslate(tt){tt===void 0&&(tt=this.isHorizontal()?"x":"y");const et=this,{params:rt,rtlTranslate:nt,translate:st,wrapperEl:ot}=et;if(rt.virtualTranslate)return nt?-st:st;if(rt.cssMode)return st;let at=getTranslate(ot,tt);return at+=et.cssOverflowAdjustment(),nt&&(at=-at),at||0}function setTranslate(tt,et){const rt=this,{rtlTranslate:nt,params:st,wrapperEl:ot,progress:at}=rt;let lt=0,ut=0;const ct=0;rt.isHorizontal()?lt=nt?-tt:tt:ut=tt,st.roundLengths&&(lt=Math.floor(lt),ut=Math.floor(ut)),rt.previousTranslate=rt.translate,rt.translate=rt.isHorizontal()?lt:ut,st.cssMode?ot[rt.isHorizontal()?"scrollLeft":"scrollTop"]=rt.isHorizontal()?-lt:-ut:st.virtualTranslate||(rt.isHorizontal()?lt-=rt.cssOverflowAdjustment():ut-=rt.cssOverflowAdjustment(),ot.style.transform=`translate3d(${lt}px, ${ut}px, ${ct}px)`);let dt;const ht=rt.maxTranslate()-rt.minTranslate();ht===0?dt=0:dt=(tt-rt.minTranslate())/ht,dt!==at&&rt.updateProgress(tt),rt.emit("setTranslate",rt.translate,et)}function minTranslate(){return-this.snapGrid[0]}function maxTranslate(){return-this.snapGrid[this.snapGrid.length-1]}function translateTo(tt,et,rt,nt,st){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),nt===void 0&&(nt=!0);const ot=this,{params:at,wrapperEl:lt}=ot;if(ot.animating&&at.preventInteractionOnTransition)return!1;const ut=ot.minTranslate(),ct=ot.maxTranslate();let dt;if(nt&&tt>ut?dt=ut:nt&&tt<ct?dt=ct:dt=tt,ot.updateProgress(dt),at.cssMode){const ht=ot.isHorizontal();if(et===0)lt[ht?"scrollLeft":"scrollTop"]=-dt;else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:-dt,side:ht?"left":"top"}),!0;lt.scrollTo({[ht?"left":"top"]:-dt,behavior:"smooth"})}return!0}return et===0?(ot.setTransition(0),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,st),ot.emit("transitionEnd"))):(ot.setTransition(et),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,st),ot.emit("transitionStart")),ot.animating||(ot.animating=!0,ot.onTranslateToWrapperTransitionEnd||(ot.onTranslateToWrapperTransitionEnd=function(mt){!ot||ot.destroyed||mt.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd),ot.onTranslateToWrapperTransitionEnd=null,delete ot.onTranslateToWrapperTransitionEnd,rt&&ot.emit("transitionEnd"))}),ot.wrapperEl.addEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd))),!0}var translate={getTranslate:getSwiperTranslate,setTranslate,minTranslate,maxTranslate,translateTo};function setTransition(tt,et){const rt=this;rt.params.cssMode||(rt.wrapperEl.style.transitionDuration=`${tt}ms`,rt.wrapperEl.style.transitionDelay=tt===0?"0ms":""),rt.emit("setTransition",tt,et)}function transitionEmit(tt){let{swiper:et,runCallbacks:rt,direction:nt,step:st}=tt;const{activeIndex:ot,previousIndex:at}=et;let lt=nt;if(lt||(ot>at?lt="next":ot<at?lt="prev":lt="reset"),et.emit(`transition${st}`),rt&&ot!==at){if(lt==="reset"){et.emit(`slideResetTransition${st}`);return}et.emit(`slideChangeTransition${st}`),lt==="next"?et.emit(`slideNextTransition${st}`):et.emit(`slidePrevTransition${st}`)}}function transitionStart(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:nt}=rt;nt.cssMode||(nt.autoHeight&&rt.updateAutoHeight(),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"Start"}))}function transitionEnd(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:nt}=rt;rt.animating=!1,!nt.cssMode&&(rt.setTransition(0),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"End"}))}var transition={setTransition,transitionStart,transitionEnd};function slideTo(tt,et,rt,nt,st){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const ot=this;let at=tt;at<0&&(at=0);const{params:lt,snapGrid:ut,slidesGrid:ct,previousIndex:dt,activeIndex:ht,rtlTranslate:mt,wrapperEl:xt,enabled:yt}=ot;if(ot.animating&&lt.preventInteractionOnTransition||!yt&&!nt&&!st)return!1;const vt=Math.min(ot.params.slidesPerGroupSkip,at);let Et=vt+Math.floor((at-vt)/ot.params.slidesPerGroup);Et>=ut.length&&(Et=ut.length-1);const bt=-ut[Et];if(lt.normalizeSlideIndex)for(let wt=0;wt<ct.length;wt+=1){const Rt=-Math.floor(bt*100),Ct=Math.floor(ct[wt]*100),Pt=Math.floor(ct[wt+1]*100);typeof ct[wt+1]<"u"?Rt>=Ct&&Rt<Pt-(Pt-Ct)/2?at=wt:Rt>=Ct&&Rt<Pt&&(at=wt+1):Rt>=Ct&&(at=wt)}if(ot.initialized&&at!==ht&&(!ot.allowSlideNext&&(mt?bt>ot.translate&&bt>ot.minTranslate():bt<ot.translate&&bt<ot.minTranslate())||!ot.allowSlidePrev&&bt>ot.translate&&bt>ot.maxTranslate()&&(ht||0)!==at))return!1;at!==(dt||0)&&rt&&ot.emit("beforeSlideChangeStart"),ot.updateProgress(bt);let St;if(at>ht?St="next":at<ht?St="prev":St="reset",mt&&-bt===ot.translate||!mt&&bt===ot.translate)return ot.updateActiveIndex(at),lt.autoHeight&&ot.updateAutoHeight(),ot.updateSlidesClasses(),lt.effect!=="slide"&&ot.setTranslate(bt),St!=="reset"&&(ot.transitionStart(rt,St),ot.transitionEnd(rt,St)),!1;if(lt.cssMode){const wt=ot.isHorizontal(),Rt=mt?bt:-bt;if(et===0){const Ct=ot.virtual&&ot.params.virtual.enabled;Ct&&(ot.wrapperEl.style.scrollSnapType="none",ot._immediateVirtual=!0),Ct&&!ot._cssModeVirtualInitialSet&&ot.params.initialSlide>0?(ot._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{xt[wt?"scrollLeft":"scrollTop"]=Rt})):xt[wt?"scrollLeft":"scrollTop"]=Rt,Ct&&requestAnimationFrame(()=>{ot.wrapperEl.style.scrollSnapType="",ot._immediateVirtual=!1})}else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:Rt,side:wt?"left":"top"}),!0;xt.scrollTo({[wt?"left":"top"]:Rt,behavior:"smooth"})}return!0}return ot.setTransition(et),ot.setTranslate(bt),ot.updateActiveIndex(at),ot.updateSlidesClasses(),ot.emit("beforeTransitionStart",et,nt),ot.transitionStart(rt,St),et===0?ot.transitionEnd(rt,St):ot.animating||(ot.animating=!0,ot.onSlideToWrapperTransitionEnd||(ot.onSlideToWrapperTransitionEnd=function(Rt){!ot||ot.destroyed||Rt.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onSlideToWrapperTransitionEnd),ot.onSlideToWrapperTransitionEnd=null,delete ot.onSlideToWrapperTransitionEnd,ot.transitionEnd(rt,St))}),ot.wrapperEl.addEventListener("transitionend",ot.onSlideToWrapperTransitionEnd)),!0}function slideToLoop(tt,et,rt,nt){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const st=this;let ot=tt;return st.params.loop&&(st.virtual&&st.params.virtual.enabled?ot=ot+st.virtual.slidesBefore:ot=st.getSlideIndexByData(ot)),st.slideTo(ot,et,rt,nt)}function slideNext(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const nt=this,{enabled:st,params:ot,animating:at}=nt;if(!st)return nt;let lt=ot.slidesPerGroup;ot.slidesPerView==="auto"&&ot.slidesPerGroup===1&&ot.slidesPerGroupAuto&&(lt=Math.max(nt.slidesPerViewDynamic("current",!0),1));const ut=nt.activeIndex<ot.slidesPerGroupSkip?1:lt,ct=nt.virtual&&ot.virtual.enabled;if(ot.loop){if(at&&!ct&&ot.loopPreventsSliding)return!1;if(nt.loopFix({direction:"next"}),nt._clientLeft=nt.wrapperEl.clientLeft,nt.activeIndex===nt.slides.length-1&&ot.cssMode)return requestAnimationFrame(()=>{nt.slideTo(nt.activeIndex+ut,tt,et,rt)}),!0}return ot.rewind&&nt.isEnd?nt.slideTo(0,tt,et,rt):nt.slideTo(nt.activeIndex+ut,tt,et,rt)}function slidePrev(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const nt=this,{params:st,snapGrid:ot,slidesGrid:at,rtlTranslate:lt,enabled:ut,animating:ct}=nt;if(!ut)return nt;const dt=nt.virtual&&st.virtual.enabled;if(st.loop){if(ct&&!dt&&st.loopPreventsSliding)return!1;nt.loopFix({direction:"prev"}),nt._clientLeft=nt.wrapperEl.clientLeft}const ht=lt?nt.translate:-nt.translate;function mt(bt){return bt<0?-Math.floor(Math.abs(bt)):Math.floor(bt)}const xt=mt(ht),yt=ot.map(bt=>mt(bt));let vt=ot[yt.indexOf(xt)-1];if(typeof vt>"u"&&st.cssMode){let bt;ot.forEach((St,wt)=>{xt>=St&&(bt=wt)}),typeof bt<"u"&&(vt=ot[bt>0?bt-1:bt])}let Et=0;if(typeof vt<"u"&&(Et=at.indexOf(vt),Et<0&&(Et=nt.activeIndex-1),st.slidesPerView==="auto"&&st.slidesPerGroup===1&&st.slidesPerGroupAuto&&(Et=Et-nt.slidesPerViewDynamic("previous",!0)+1,Et=Math.max(Et,0))),st.rewind&&nt.isBeginning){const bt=nt.params.virtual&&nt.params.virtual.enabled&&nt.virtual?nt.virtual.slides.length-1:nt.slides.length-1;return nt.slideTo(bt,tt,et,rt)}else if(st.loop&&nt.activeIndex===0&&st.cssMode)return requestAnimationFrame(()=>{nt.slideTo(Et,tt,et,rt)}),!0;return nt.slideTo(Et,tt,et,rt)}function slideReset(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const nt=this;return nt.slideTo(nt.activeIndex,tt,et,rt)}function slideToClosest(tt,et,rt,nt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0),nt===void 0&&(nt=.5);const st=this;let ot=st.activeIndex;const at=Math.min(st.params.slidesPerGroupSkip,ot),lt=at+Math.floor((ot-at)/st.params.slidesPerGroup),ut=st.rtlTranslate?st.translate:-st.translate;if(ut>=st.snapGrid[lt]){const ct=st.snapGrid[lt],dt=st.snapGrid[lt+1];ut-ct>(dt-ct)*nt&&(ot+=st.params.slidesPerGroup)}else{const ct=st.snapGrid[lt-1],dt=st.snapGrid[lt];ut-ct<=(dt-ct)*nt&&(ot-=st.params.slidesPerGroup)}return ot=Math.max(ot,0),ot=Math.min(ot,st.slidesGrid.length-1),st.slideTo(ot,tt,et,rt)}function slideToClickedSlide(){const tt=this,{params:et,slidesEl:rt}=tt,nt=et.slidesPerView==="auto"?tt.slidesPerViewDynamic():et.slidesPerView;let st=tt.clickedIndex,ot;const at=tt.isElement?"swiper-slide":`.${et.slideClass}`;if(et.loop){if(tt.animating)return;ot=parseInt(tt.clickedSlide.getAttribute("data-swiper-slide-index"),10),et.centeredSlides?st<tt.loopedSlides-nt/2||st>tt.slides.length-tt.loopedSlides+nt/2?(tt.loopFix(),st=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(st)})):tt.slideTo(st):st>tt.slides.length-nt?(tt.loopFix(),st=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(st)})):tt.slideTo(st)}else tt.slideTo(st)}var slide={slideTo,slideToLoop,slideNext,slidePrev,slideReset,slideToClosest,slideToClickedSlide};function loopCreate(tt){const et=this,{params:rt,slidesEl:nt}=et;if(!rt.loop||et.virtual&&et.params.virtual.enabled)return;elementChildren(nt,`.${rt.slideClass}, swiper-slide`).forEach((ot,at)=>{ot.setAttribute("data-swiper-slide-index",at)}),et.loopFix({slideRealIndex:tt,direction:rt.centeredSlides?void 0:"next"})}function loopFix(tt){let{slideRealIndex:et,slideTo:rt=!0,direction:nt,setTranslate:st,activeSlideIndex:ot,byController:at,byMousewheel:lt}=tt===void 0?{}:tt;const ut=this;if(!ut.params.loop)return;ut.emit("beforeLoopFix");const{slides:ct,allowSlidePrev:dt,allowSlideNext:ht,slidesEl:mt,params:xt}=ut;if(ut.allowSlidePrev=!0,ut.allowSlideNext=!0,ut.virtual&&xt.virtual.enabled){rt&&(!xt.centeredSlides&&ut.snapIndex===0?ut.slideTo(ut.virtual.slides.length,0,!1,!0):xt.centeredSlides&&ut.snapIndex<xt.slidesPerView?ut.slideTo(ut.virtual.slides.length+ut.snapIndex,0,!1,!0):ut.snapIndex===ut.snapGrid.length-1&&ut.slideTo(ut.virtual.slidesBefore,0,!1,!0)),ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.emit("loopFix");return}const yt=xt.slidesPerView==="auto"?ut.slidesPerViewDynamic():Math.ceil(parseFloat(xt.slidesPerView,10));let vt=xt.loopedSlides||yt;vt%xt.slidesPerGroup!==0&&(vt+=xt.slidesPerGroup-vt%xt.slidesPerGroup),ut.loopedSlides=vt;const Et=[],bt=[];let St=ut.activeIndex;typeof ot>"u"?ot=ut.getSlideIndex(ut.slides.filter(It=>It.classList.contains(xt.slideActiveClass))[0]):St=ot;const wt=nt==="next"||!nt,Rt=nt==="prev"||!nt;let Ct=0,Pt=0;if(ot<vt){Ct=Math.max(vt-ot,xt.slidesPerGroup);for(let It=0;It<vt-ot;It+=1){const jt=It-Math.floor(It/ct.length)*ct.length;Et.push(ct.length-jt-1)}}else if(ot>ut.slides.length-vt*2){Pt=Math.max(ot-(ut.slides.length-vt*2),xt.slidesPerGroup);for(let It=0;It<Pt;It+=1){const jt=It-Math.floor(It/ct.length)*ct.length;bt.push(jt)}}if(Rt&&Et.forEach(It=>{ut.slides[It].swiperLoopMoveDOM=!0,mt.prepend(ut.slides[It]),ut.slides[It].swiperLoopMoveDOM=!1}),wt&&bt.forEach(It=>{ut.slides[It].swiperLoopMoveDOM=!0,mt.append(ut.slides[It]),ut.slides[It].swiperLoopMoveDOM=!1}),ut.recalcSlides(),xt.slidesPerView==="auto"&&ut.updateSlides(),xt.watchSlidesProgress&&ut.updateSlidesOffset(),rt){if(Et.length>0&&Rt)if(typeof et>"u"){const It=ut.slidesGrid[St],Dt=ut.slidesGrid[St+Ct]-It;lt?ut.setTranslate(ut.translate-Dt):(ut.slideTo(St+Ct,0,!1,!0),st&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Dt,ut.touchEventsData.currentTranslate=ut.translate))}else st&&(ut.slideToLoop(et,0,!1,!0),ut.touchEventsData.currentTranslate=ut.translate);else if(bt.length>0&&wt)if(typeof et>"u"){const It=ut.slidesGrid[St],Dt=ut.slidesGrid[St-Pt]-It;lt?ut.setTranslate(ut.translate-Dt):(ut.slideTo(St-Pt,0,!1,!0),st&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Dt,ut.touchEventsData.currentTranslate=ut.translate))}else ut.slideToLoop(et,0,!1,!0)}if(ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.controller&&ut.controller.control&&!at){const It={slideRealIndex:et,direction:nt,setTranslate:st,activeSlideIndex:ot,byController:!0};Array.isArray(ut.controller.control)?ut.controller.control.forEach(jt=>{!jt.destroyed&&jt.params.loop&&jt.loopFix({...It,slideTo:jt.params.slidesPerView===xt.slidesPerView?rt:!1})}):ut.controller.control instanceof ut.constructor&&ut.controller.control.params.loop&&ut.controller.control.loopFix({...It,slideTo:ut.controller.control.params.slidesPerView===xt.slidesPerView?rt:!1})}ut.emit("loopFix")}function loopDestroy(){const tt=this,{params:et,slidesEl:rt}=tt;if(!et.loop||tt.virtual&&tt.params.virtual.enabled)return;tt.recalcSlides();const nt=[];tt.slides.forEach(st=>{const ot=typeof st.swiperSlideIndex>"u"?st.getAttribute("data-swiper-slide-index")*1:st.swiperSlideIndex;nt[ot]=st}),tt.slides.forEach(st=>{st.removeAttribute("data-swiper-slide-index")}),nt.forEach(st=>{rt.append(st)}),tt.recalcSlides(),tt.slideTo(tt.realIndex,0)}var loop={loopCreate,loopFix,loopDestroy};function setGrabCursor(tt){const et=this;if(!et.params.simulateTouch||et.params.watchOverflow&&et.isLocked||et.params.cssMode)return;const rt=et.params.touchEventsTarget==="container"?et.el:et.wrapperEl;et.isElement&&(et.__preventObserver__=!0),rt.style.cursor="move",rt.style.cursor=tt?"grabbing":"grab",et.isElement&&requestAnimationFrame(()=>{et.__preventObserver__=!1})}function unsetGrabCursor(){const tt=this;tt.params.watchOverflow&&tt.isLocked||tt.params.cssMode||(tt.isElement&&(tt.__preventObserver__=!0),tt[tt.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",tt.isElement&&requestAnimationFrame(()=>{tt.__preventObserver__=!1}))}var grabCursor={setGrabCursor,unsetGrabCursor};function closestElement(tt,et){et===void 0&&(et=this);function rt(nt){if(!nt||nt===getDocument()||nt===getWindow())return null;nt.assignedSlot&&(nt=nt.assignedSlot);const st=nt.closest(tt);return!st&&!nt.getRootNode?null:st||rt(nt.getRootNode().host)}return rt(et)}function onTouchStart(tt){const et=this,rt=getDocument(),nt=getWindow(),st=et.touchEventsData;st.evCache.push(tt);const{params:ot,touches:at,enabled:lt}=et;if(!lt||!ot.simulateTouch&&tt.pointerType==="mouse"||et.animating&&ot.preventInteractionOnTransition)return;!et.animating&&ot.cssMode&&ot.loop&&et.loopFix();let ut=tt;ut.originalEvent&&(ut=ut.originalEvent);let ct=ut.target;if(ot.touchEventsTarget==="wrapper"&&!et.wrapperEl.contains(ct)||"which"in ut&&ut.which===3||"button"in ut&&ut.button>0||st.isTouched&&st.isMoved)return;const dt=!!ot.noSwipingClass&&ot.noSwipingClass!=="",ht=tt.composedPath?tt.composedPath():tt.path;dt&&ut.target&&ut.target.shadowRoot&&ht&&(ct=ht[0]);const mt=ot.noSwipingSelector?ot.noSwipingSelector:`.${ot.noSwipingClass}`,xt=!!(ut.target&&ut.target.shadowRoot);if(ot.noSwiping&&(xt?closestElement(mt,ct):ct.closest(mt))){et.allowClick=!0;return}if(ot.swipeHandler&&!ct.closest(ot.swipeHandler))return;at.currentX=ut.pageX,at.currentY=ut.pageY;const yt=at.currentX,vt=at.currentY,Et=ot.edgeSwipeDetection||ot.iOSEdgeSwipeDetection,bt=ot.edgeSwipeThreshold||ot.iOSEdgeSwipeThreshold;if(Et&&(yt<=bt||yt>=nt.innerWidth-bt))if(Et==="prevent")tt.preventDefault();else return;Object.assign(st,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),at.startX=yt,at.startY=vt,st.touchStartTime=now(),et.allowClick=!0,et.updateSize(),et.swipeDirection=void 0,ot.threshold>0&&(st.allowThresholdMove=!1);let St=!0;ct.matches(st.focusableElements)&&(St=!1,ct.nodeName==="SELECT"&&(st.isTouched=!1)),rt.activeElement&&rt.activeElement.matches(st.focusableElements)&&rt.activeElement!==ct&&rt.activeElement.blur();const wt=St&&et.allowTouchMove&&ot.touchStartPreventDefault;(ot.touchStartForcePreventDefault||wt)&&!ct.isContentEditable&&ut.preventDefault(),ot.freeMode&&ot.freeMode.enabled&&et.freeMode&&et.animating&&!ot.cssMode&&et.freeMode.onTouchStart(),et.emit("touchStart",ut)}function onTouchMove(tt){const et=getDocument(),rt=this,nt=rt.touchEventsData,{params:st,touches:ot,rtlTranslate:at,enabled:lt}=rt;if(!lt||!st.simulateTouch&&tt.pointerType==="mouse")return;let ut=tt;if(ut.originalEvent&&(ut=ut.originalEvent),!nt.isTouched){nt.startMoving&&nt.isScrolling&&rt.emit("touchMoveOpposite",ut);return}const ct=nt.evCache.findIndex(It=>It.pointerId===ut.pointerId);ct>=0&&(nt.evCache[ct]=ut);const dt=nt.evCache.length>1?nt.evCache[0]:ut,ht=dt.pageX,mt=dt.pageY;if(ut.preventedByNestedSwiper){ot.startX=ht,ot.startY=mt;return}if(!rt.allowTouchMove){ut.target.matches(nt.focusableElements)||(rt.allowClick=!1),nt.isTouched&&(Object.assign(ot,{startX:ht,startY:mt,prevX:rt.touches.currentX,prevY:rt.touches.currentY,currentX:ht,currentY:mt}),nt.touchStartTime=now());return}if(st.touchReleaseOnEdges&&!st.loop){if(rt.isVertical()){if(mt<ot.startY&&rt.translate<=rt.maxTranslate()||mt>ot.startY&&rt.translate>=rt.minTranslate()){nt.isTouched=!1,nt.isMoved=!1;return}}else if(ht<ot.startX&&rt.translate<=rt.maxTranslate()||ht>ot.startX&&rt.translate>=rt.minTranslate())return}if(et.activeElement&&ut.target===et.activeElement&&ut.target.matches(nt.focusableElements)){nt.isMoved=!0,rt.allowClick=!1;return}if(nt.allowTouchCallbacks&&rt.emit("touchMove",ut),ut.targetTouches&&ut.targetTouches.length>1)return;ot.currentX=ht,ot.currentY=mt;const xt=ot.currentX-ot.startX,yt=ot.currentY-ot.startY;if(rt.params.threshold&&Math.sqrt(xt**2+yt**2)<rt.params.threshold)return;if(typeof nt.isScrolling>"u"){let It;rt.isHorizontal()&&ot.currentY===ot.startY||rt.isVertical()&&ot.currentX===ot.startX?nt.isScrolling=!1:xt*xt+yt*yt>=25&&(It=Math.atan2(Math.abs(yt),Math.abs(xt))*180/Math.PI,nt.isScrolling=rt.isHorizontal()?It>st.touchAngle:90-It>st.touchAngle)}if(nt.isScrolling&&rt.emit("touchMoveOpposite",ut),typeof nt.startMoving>"u"&&(ot.currentX!==ot.startX||ot.currentY!==ot.startY)&&(nt.startMoving=!0),nt.isScrolling||rt.zoom&&rt.params.zoom&&rt.params.zoom.enabled&&nt.evCache.length>1){nt.isTouched=!1;return}if(!nt.startMoving)return;rt.allowClick=!1,!st.cssMode&&ut.cancelable&&ut.preventDefault(),st.touchMoveStopPropagation&&!st.nested&&ut.stopPropagation();let vt=rt.isHorizontal()?xt:yt,Et=rt.isHorizontal()?ot.currentX-ot.previousX:ot.currentY-ot.previousY;st.oneWayMovement&&(vt=Math.abs(vt)*(at?1:-1),Et=Math.abs(Et)*(at?1:-1)),ot.diff=vt,vt*=st.touchRatio,at&&(vt=-vt,Et=-Et);const bt=rt.touchesDirection;rt.swipeDirection=vt>0?"prev":"next",rt.touchesDirection=Et>0?"prev":"next";const St=rt.params.loop&&!st.cssMode,wt=rt.swipeDirection==="next"&&rt.allowSlideNext||rt.swipeDirection==="prev"&&rt.allowSlidePrev;if(!nt.isMoved){if(St&&wt&&rt.loopFix({direction:rt.swipeDirection}),nt.startTranslate=rt.getTranslate(),rt.setTransition(0),rt.animating){const It=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});rt.wrapperEl.dispatchEvent(It)}nt.allowMomentumBounce=!1,st.grabCursor&&(rt.allowSlideNext===!0||rt.allowSlidePrev===!0)&&rt.setGrabCursor(!0),rt.emit("sliderFirstMove",ut)}let Rt;nt.isMoved&&bt!==rt.touchesDirection&&St&&wt&&Math.abs(vt)>=1&&(rt.loopFix({direction:rt.swipeDirection,setTranslate:!0}),Rt=!0),rt.emit("sliderMove",ut),nt.isMoved=!0,nt.currentTranslate=vt+nt.startTranslate;let Ct=!0,Pt=st.resistanceRatio;if(st.touchReleaseOnEdges&&(Pt=0),vt>0?(St&&wt&&!Rt&&nt.currentTranslate>(st.centeredSlides?rt.minTranslate()-rt.size/2:rt.minTranslate())&&rt.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),nt.currentTranslate>rt.minTranslate()&&(Ct=!1,st.resistance&&(nt.currentTranslate=rt.minTranslate()-1+(-rt.minTranslate()+nt.startTranslate+vt)**Pt))):vt<0&&(St&&wt&&!Rt&&nt.currentTranslate<(st.centeredSlides?rt.maxTranslate()+rt.size/2:rt.maxTranslate())&&rt.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:rt.slides.length-(st.slidesPerView==="auto"?rt.slidesPerViewDynamic():Math.ceil(parseFloat(st.slidesPerView,10)))}),nt.currentTranslate<rt.maxTranslate()&&(Ct=!1,st.resistance&&(nt.currentTranslate=rt.maxTranslate()+1-(rt.maxTranslate()-nt.startTranslate-vt)**Pt))),Ct&&(ut.preventedByNestedSwiper=!0),!rt.allowSlideNext&&rt.swipeDirection==="next"&&nt.currentTranslate<nt.startTranslate&&(nt.currentTranslate=nt.startTranslate),!rt.allowSlidePrev&&rt.swipeDirection==="prev"&&nt.currentTranslate>nt.startTranslate&&(nt.currentTranslate=nt.startTranslate),!rt.allowSlidePrev&&!rt.allowSlideNext&&(nt.currentTranslate=nt.startTranslate),st.threshold>0)if(Math.abs(vt)>st.threshold||nt.allowThresholdMove){if(!nt.allowThresholdMove){nt.allowThresholdMove=!0,ot.startX=ot.currentX,ot.startY=ot.currentY,nt.currentTranslate=nt.startTranslate,ot.diff=rt.isHorizontal()?ot.currentX-ot.startX:ot.currentY-ot.startY;return}}else{nt.currentTranslate=nt.startTranslate;return}!st.followFinger||st.cssMode||((st.freeMode&&st.freeMode.enabled&&rt.freeMode||st.watchSlidesProgress)&&(rt.updateActiveIndex(),rt.updateSlidesClasses()),st.freeMode&&st.freeMode.enabled&&rt.freeMode&&rt.freeMode.onTouchMove(),rt.updateProgress(nt.currentTranslate),rt.setTranslate(nt.currentTranslate))}function onTouchEnd(tt){const et=this,rt=et.touchEventsData,nt=rt.evCache.findIndex(wt=>wt.pointerId===tt.pointerId);if(nt>=0&&rt.evCache.splice(nt,1),["pointercancel","pointerout","pointerleave","contextmenu"].includes(tt.type)&&!(["pointercancel","contextmenu"].includes(tt.type)&&(et.browser.isSafari||et.browser.isWebView)))return;const{params:st,touches:ot,rtlTranslate:at,slidesGrid:lt,enabled:ut}=et;if(!ut||!st.simulateTouch&&tt.pointerType==="mouse")return;let ct=tt;if(ct.originalEvent&&(ct=ct.originalEvent),rt.allowTouchCallbacks&&et.emit("touchEnd",ct),rt.allowTouchCallbacks=!1,!rt.isTouched){rt.isMoved&&st.grabCursor&&et.setGrabCursor(!1),rt.isMoved=!1,rt.startMoving=!1;return}st.grabCursor&&rt.isMoved&&rt.isTouched&&(et.allowSlideNext===!0||et.allowSlidePrev===!0)&&et.setGrabCursor(!1);const dt=now(),ht=dt-rt.touchStartTime;if(et.allowClick){const wt=ct.path||ct.composedPath&&ct.composedPath();et.updateClickedSlide(wt&&wt[0]||ct.target,wt),et.emit("tap click",ct),ht<300&&dt-rt.lastClickTime<300&&et.emit("doubleTap doubleClick",ct)}if(rt.lastClickTime=now(),nextTick(()=>{et.destroyed||(et.allowClick=!0)}),!rt.isTouched||!rt.isMoved||!et.swipeDirection||ot.diff===0||rt.currentTranslate===rt.startTranslate){rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;return}rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;let mt;if(st.followFinger?mt=at?et.translate:-et.translate:mt=-rt.currentTranslate,st.cssMode)return;if(st.freeMode&&st.freeMode.enabled){et.freeMode.onTouchEnd({currentPos:mt});return}let xt=0,yt=et.slidesSizesGrid[0];for(let wt=0;wt<lt.length;wt+=wt<st.slidesPerGroupSkip?1:st.slidesPerGroup){const Rt=wt<st.slidesPerGroupSkip-1?1:st.slidesPerGroup;typeof lt[wt+Rt]<"u"?mt>=lt[wt]&&mt<lt[wt+Rt]&&(xt=wt,yt=lt[wt+Rt]-lt[wt]):mt>=lt[wt]&&(xt=wt,yt=lt[lt.length-1]-lt[lt.length-2])}let vt=null,Et=null;st.rewind&&(et.isBeginning?Et=st.virtual&&st.virtual.enabled&&et.virtual?et.virtual.slides.length-1:et.slides.length-1:et.isEnd&&(vt=0));const bt=(mt-lt[xt])/yt,St=xt<st.slidesPerGroupSkip-1?1:st.slidesPerGroup;if(ht>st.longSwipesMs){if(!st.longSwipes){et.slideTo(et.activeIndex);return}et.swipeDirection==="next"&&(bt>=st.longSwipesRatio?et.slideTo(st.rewind&&et.isEnd?vt:xt+St):et.slideTo(xt)),et.swipeDirection==="prev"&&(bt>1-st.longSwipesRatio?et.slideTo(xt+St):Et!==null&&bt<0&&Math.abs(bt)>st.longSwipesRatio?et.slideTo(Et):et.slideTo(xt))}else{if(!st.shortSwipes){et.slideTo(et.activeIndex);return}et.navigation&&(ct.target===et.navigation.nextEl||ct.target===et.navigation.prevEl)?ct.target===et.navigation.nextEl?et.slideTo(xt+St):et.slideTo(xt):(et.swipeDirection==="next"&&et.slideTo(vt!==null?vt:xt+St),et.swipeDirection==="prev"&&et.slideTo(Et!==null?Et:xt))}}function onResize(){const tt=this,{params:et,el:rt}=tt;if(rt&&rt.offsetWidth===0)return;et.breakpoints&&tt.setBreakpoint();const{allowSlideNext:nt,allowSlidePrev:st,snapGrid:ot}=tt,at=tt.virtual&&tt.params.virtual.enabled;tt.allowSlideNext=!0,tt.allowSlidePrev=!0,tt.updateSize(),tt.updateSlides(),tt.updateSlidesClasses();const lt=at&&et.loop;(et.slidesPerView==="auto"||et.slidesPerView>1)&&tt.isEnd&&!tt.isBeginning&&!tt.params.centeredSlides&&!lt?tt.slideTo(tt.slides.length-1,0,!1,!0):tt.params.loop&&!at?tt.slideToLoop(tt.realIndex,0,!1,!0):tt.slideTo(tt.activeIndex,0,!1,!0),tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&(clearTimeout(tt.autoplay.resizeTimeout),tt.autoplay.resizeTimeout=setTimeout(()=>{tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&tt.autoplay.resume()},500)),tt.allowSlidePrev=st,tt.allowSlideNext=nt,tt.params.watchOverflow&&ot!==tt.snapGrid&&tt.checkOverflow()}function onClick(tt){const et=this;et.enabled&&(et.allowClick||(et.params.preventClicks&&tt.preventDefault(),et.params.preventClicksPropagation&&et.animating&&(tt.stopPropagation(),tt.stopImmediatePropagation())))}function onScroll(){const tt=this,{wrapperEl:et,rtlTranslate:rt,enabled:nt}=tt;if(!nt)return;tt.previousTranslate=tt.translate,tt.isHorizontal()?tt.translate=-et.scrollLeft:tt.translate=-et.scrollTop,tt.translate===0&&(tt.translate=0),tt.updateActiveIndex(),tt.updateSlidesClasses();let st;const ot=tt.maxTranslate()-tt.minTranslate();ot===0?st=0:st=(tt.translate-tt.minTranslate())/ot,st!==tt.progress&&tt.updateProgress(rt?-tt.translate:tt.translate),tt.emit("setTranslate",tt.translate,!1)}function onLoad(tt){const et=this;processLazyPreloader(et,tt.target),!(et.params.cssMode||et.params.slidesPerView!=="auto"&&!et.params.autoHeight)&&et.update()}let dummyEventAttached=!1;function dummyEventListener(){}const events=(tt,et)=>{const rt=getDocument(),{params:nt,el:st,wrapperEl:ot,device:at}=tt,lt=!!nt.nested,ut=et==="on"?"addEventListener":"removeEventListener",ct=et;st[ut]("pointerdown",tt.onTouchStart,{passive:!1}),rt[ut]("pointermove",tt.onTouchMove,{passive:!1,capture:lt}),rt[ut]("pointerup",tt.onTouchEnd,{passive:!0}),rt[ut]("pointercancel",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerout",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerleave",tt.onTouchEnd,{passive:!0}),rt[ut]("contextmenu",tt.onTouchEnd,{passive:!0}),(nt.preventClicks||nt.preventClicksPropagation)&&st[ut]("click",tt.onClick,!0),nt.cssMode&&ot[ut]("scroll",tt.onScroll),nt.updateOnWindowResize?tt[ct](at.ios||at.android?"resize orientationchange observerUpdate":"resize observerUpdate",onResize,!0):tt[ct]("observerUpdate",onResize,!0),st[ut]("load",tt.onLoad,{capture:!0})};function attachEvents(){const tt=this,et=getDocument(),{params:rt}=tt;tt.onTouchStart=onTouchStart.bind(tt),tt.onTouchMove=onTouchMove.bind(tt),tt.onTouchEnd=onTouchEnd.bind(tt),rt.cssMode&&(tt.onScroll=onScroll.bind(tt)),tt.onClick=onClick.bind(tt),tt.onLoad=onLoad.bind(tt),dummyEventAttached||(et.addEventListener("touchstart",dummyEventListener),dummyEventAttached=!0),events(tt,"on")}function detachEvents(){events(this,"off")}var events$1={attachEvents,detachEvents};const isGridEnabled=(tt,et)=>tt.grid&&et.grid&&et.grid.rows>1;function setBreakpoint(){const tt=this,{realIndex:et,initialized:rt,params:nt,el:st}=tt,ot=nt.breakpoints;if(!ot||ot&&Object.keys(ot).length===0)return;const at=tt.getBreakpoint(ot,tt.params.breakpointsBase,tt.el);if(!at||tt.currentBreakpoint===at)return;const ut=(at in ot?ot[at]:void 0)||tt.originalParams,ct=isGridEnabled(tt,nt),dt=isGridEnabled(tt,ut),ht=nt.enabled;ct&&!dt?(st.classList.remove(`${nt.containerModifierClass}grid`,`${nt.containerModifierClass}grid-column`),tt.emitContainerClasses()):!ct&&dt&&(st.classList.add(`${nt.containerModifierClass}grid`),(ut.grid.fill&&ut.grid.fill==="column"||!ut.grid.fill&&nt.grid.fill==="column")&&st.classList.add(`${nt.containerModifierClass}grid-column`),tt.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(bt=>{if(typeof ut[bt]>"u")return;const St=nt[bt]&&nt[bt].enabled,wt=ut[bt]&&ut[bt].enabled;St&&!wt&&tt[bt].disable(),!St&&wt&&tt[bt].enable()});const mt=ut.direction&&ut.direction!==nt.direction,xt=nt.loop&&(ut.slidesPerView!==nt.slidesPerView||mt),yt=nt.loop;mt&&rt&&tt.changeDirection(),extend$1(tt.params,ut);const vt=tt.params.enabled,Et=tt.params.loop;Object.assign(tt,{allowTouchMove:tt.params.allowTouchMove,allowSlideNext:tt.params.allowSlideNext,allowSlidePrev:tt.params.allowSlidePrev}),ht&&!vt?tt.disable():!ht&&vt&&tt.enable(),tt.currentBreakpoint=at,tt.emit("_beforeBreakpoint",ut),rt&&(xt?(tt.loopDestroy(),tt.loopCreate(et),tt.updateSlides()):!yt&&Et?(tt.loopCreate(et),tt.updateSlides()):yt&&!Et&&tt.loopDestroy()),tt.emit("breakpoint",ut)}function getBreakpoint(tt,et,rt){if(et===void 0&&(et="window"),!tt||et==="container"&&!rt)return;let nt=!1;const st=getWindow(),ot=et==="window"?st.innerHeight:rt.clientHeight,at=Object.keys(tt).map(lt=>{if(typeof lt=="string"&&lt.indexOf("@")===0){const ut=parseFloat(lt.substr(1));return{value:ot*ut,point:lt}}return{value:lt,point:lt}});at.sort((lt,ut)=>parseInt(lt.value,10)-parseInt(ut.value,10));for(let lt=0;lt<at.length;lt+=1){const{point:ut,value:ct}=at[lt];et==="window"?st.matchMedia(`(min-width: ${ct}px)`).matches&&(nt=ut):ct<=rt.clientWidth&&(nt=ut)}return nt||"max"}var breakpoints={setBreakpoint,getBreakpoint};function prepareClasses(tt,et){const rt=[];return tt.forEach(nt=>{typeof nt=="object"?Object.keys(nt).forEach(st=>{nt[st]&&rt.push(et+st)}):typeof nt=="string"&&rt.push(et+nt)}),rt}function addClasses(){const tt=this,{classNames:et,params:rt,rtl:nt,el:st,device:ot}=tt,at=prepareClasses(["initialized",rt.direction,{"free-mode":tt.params.freeMode&&rt.freeMode.enabled},{autoheight:rt.autoHeight},{rtl:nt},{grid:rt.grid&&rt.grid.rows>1},{"grid-column":rt.grid&&rt.grid.rows>1&&rt.grid.fill==="column"},{android:ot.android},{ios:ot.ios},{"css-mode":rt.cssMode},{centered:rt.cssMode&&rt.centeredSlides},{"watch-progress":rt.watchSlidesProgress}],rt.containerModifierClass);et.push(...at),st.classList.add(...et),tt.emitContainerClasses()}function removeClasses(){const tt=this,{el:et,classNames:rt}=tt;et.classList.remove(...rt),tt.emitContainerClasses()}var classes={addClasses,removeClasses};function checkOverflow(){const tt=this,{isLocked:et,params:rt}=tt,{slidesOffsetBefore:nt}=rt;if(nt){const st=tt.slides.length-1,ot=tt.slidesGrid[st]+tt.slidesSizesGrid[st]+nt*2;tt.isLocked=tt.size>ot}else tt.isLocked=tt.snapGrid.length===1;rt.allowSlideNext===!0&&(tt.allowSlideNext=!tt.isLocked),rt.allowSlidePrev===!0&&(tt.allowSlidePrev=!tt.isLocked),et&&et!==tt.isLocked&&(tt.isEnd=!1),et!==tt.isLocked&&tt.emit(tt.isLocked?"lock":"unlock")}var checkOverflow$1={checkOverflow},defaults$3={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function moduleExtendParams(tt,et){return function(nt){nt===void 0&&(nt={});const st=Object.keys(nt)[0],ot=nt[st];if(typeof ot!="object"||ot===null){extend$1(et,nt);return}if(tt[st]===!0&&(tt[st]={enabled:!0}),st==="navigation"&&tt[st]&&tt[st].enabled&&!tt[st].prevEl&&!tt[st].nextEl&&(tt[st].auto=!0),["pagination","scrollbar"].indexOf(st)>=0&&tt[st]&&tt[st].enabled&&!tt[st].el&&(tt[st].auto=!0),!(st in tt&&"enabled"in ot)){extend$1(et,nt);return}typeof tt[st]=="object"&&!("enabled"in tt[st])&&(tt[st].enabled=!0),tt[st]||(tt[st]={enabled:!1}),extend$1(et,nt)}}const prototypes={eventsEmitter,update,translate,transition,slide,loop,grabCursor,events:events$1,breakpoints,checkOverflow:checkOverflow$1,classes},extendedDefaults={};let Swiper$1=class _o{constructor(){let et,rt;for(var nt=arguments.length,st=new Array(nt),ot=0;ot<nt;ot++)st[ot]=arguments[ot];st.length===1&&st[0].constructor&&Object.prototype.toString.call(st[0]).slice(8,-1)==="Object"?rt=st[0]:[et,rt]=st,rt||(rt={}),rt=extend$1({},rt),et&&!rt.el&&(rt.el=et);const at=getDocument();if(rt.el&&typeof rt.el=="string"&&at.querySelectorAll(rt.el).length>1){const dt=[];return at.querySelectorAll(rt.el).forEach(ht=>{const mt=extend$1({},rt,{el:ht});dt.push(new _o(mt))}),dt}const lt=this;lt.__swiper__=!0,lt.support=getSupport(),lt.device=getDevice({userAgent:rt.userAgent}),lt.browser=getBrowser(),lt.eventsListeners={},lt.eventsAnyListeners=[],lt.modules=[...lt.__modules__],rt.modules&&Array.isArray(rt.modules)&&lt.modules.push(...rt.modules);const ut={};lt.modules.forEach(dt=>{dt({params:rt,swiper:lt,extendParams:moduleExtendParams(rt,ut),on:lt.on.bind(lt),once:lt.once.bind(lt),off:lt.off.bind(lt),emit:lt.emit.bind(lt)})});const ct=extend$1({},defaults$3,ut);return lt.params=extend$1({},ct,extendedDefaults,rt),lt.originalParams=extend$1({},lt.params),lt.passedParams=extend$1({},rt),lt.params&&lt.params.on&&Object.keys(lt.params.on).forEach(dt=>{lt.on(dt,lt.params.on[dt])}),lt.params&&lt.params.onAny&&lt.onAny(lt.params.onAny),Object.assign(lt,{enabled:lt.params.enabled,el:et,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return lt.params.direction==="horizontal"},isVertical(){return lt.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:lt.params.allowSlideNext,allowSlidePrev:lt.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:lt.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:lt.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),lt.emit("_swiper"),lt.params.init&&lt.init(),lt}getSlideIndex(et){const{slidesEl:rt,params:nt}=this,st=elementChildren(rt,`.${nt.slideClass}, swiper-slide`),ot=elementIndex(st[0]);return elementIndex(et)-ot}getSlideIndexByData(et){return this.getSlideIndex(this.slides.filter(rt=>rt.getAttribute("data-swiper-slide-index")*1===et)[0])}recalcSlides(){const et=this,{slidesEl:rt,params:nt}=et;et.slides=elementChildren(rt,`.${nt.slideClass}, swiper-slide`)}enable(){const et=this;et.enabled||(et.enabled=!0,et.params.grabCursor&&et.setGrabCursor(),et.emit("enable"))}disable(){const et=this;et.enabled&&(et.enabled=!1,et.params.grabCursor&&et.unsetGrabCursor(),et.emit("disable"))}setProgress(et,rt){const nt=this;et=Math.min(Math.max(et,0),1);const st=nt.minTranslate(),at=(nt.maxTranslate()-st)*et+st;nt.translateTo(at,typeof rt>"u"?0:rt),nt.updateActiveIndex(),nt.updateSlidesClasses()}emitContainerClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=et.el.className.split(" ").filter(nt=>nt.indexOf("swiper")===0||nt.indexOf(et.params.containerModifierClass)===0);et.emit("_containerClasses",rt.join(" "))}getSlideClasses(et){const rt=this;return rt.destroyed?"":et.className.split(" ").filter(nt=>nt.indexOf("swiper-slide")===0||nt.indexOf(rt.params.slideClass)===0).join(" ")}emitSlidesClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=[];et.slides.forEach(nt=>{const st=et.getSlideClasses(nt);rt.push({slideEl:nt,classNames:st}),et.emit("_slideClass",nt,st)}),et.emit("_slideClasses",rt)}slidesPerViewDynamic(et,rt){et===void 0&&(et="current"),rt===void 0&&(rt=!1);const nt=this,{params:st,slides:ot,slidesGrid:at,slidesSizesGrid:lt,size:ut,activeIndex:ct}=nt;let dt=1;if(typeof st.slidesPerView=="number")return st.slidesPerView;if(st.centeredSlides){let ht=ot[ct]?ot[ct].swiperSlideSize:0,mt;for(let xt=ct+1;xt<ot.length;xt+=1)ot[xt]&&!mt&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(mt=!0));for(let xt=ct-1;xt>=0;xt-=1)ot[xt]&&!mt&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(mt=!0))}else if(et==="current")for(let ht=ct+1;ht<ot.length;ht+=1)(rt?at[ht]+lt[ht]-at[ct]<ut:at[ht]-at[ct]<ut)&&(dt+=1);else for(let ht=ct-1;ht>=0;ht-=1)at[ct]-at[ht]<ut&&(dt+=1);return dt}update(){const et=this;if(!et||et.destroyed)return;const{snapGrid:rt,params:nt}=et;nt.breakpoints&&et.setBreakpoint(),[...et.el.querySelectorAll('[loading="lazy"]')].forEach(at=>{at.complete&&processLazyPreloader(et,at)}),et.updateSize(),et.updateSlides(),et.updateProgress(),et.updateSlidesClasses();function st(){const at=et.rtlTranslate?et.translate*-1:et.translate,lt=Math.min(Math.max(at,et.maxTranslate()),et.minTranslate());et.setTranslate(lt),et.updateActiveIndex(),et.updateSlidesClasses()}let ot;if(nt.freeMode&&nt.freeMode.enabled&&!nt.cssMode)st(),nt.autoHeight&&et.updateAutoHeight();else{if((nt.slidesPerView==="auto"||nt.slidesPerView>1)&&et.isEnd&&!nt.centeredSlides){const at=et.virtual&&nt.virtual.enabled?et.virtual.slides:et.slides;ot=et.slideTo(at.length-1,0,!1,!0)}else ot=et.slideTo(et.activeIndex,0,!1,!0);ot||st()}nt.watchOverflow&&rt!==et.snapGrid&&et.checkOverflow(),et.emit("update")}changeDirection(et,rt){rt===void 0&&(rt=!0);const nt=this,st=nt.params.direction;return et||(et=st==="horizontal"?"vertical":"horizontal"),et===st||et!=="horizontal"&&et!=="vertical"||(nt.el.classList.remove(`${nt.params.containerModifierClass}${st}`),nt.el.classList.add(`${nt.params.containerModifierClass}${et}`),nt.emitContainerClasses(),nt.params.direction=et,nt.slides.forEach(ot=>{et==="vertical"?ot.style.width="":ot.style.height=""}),nt.emit("changeDirection"),rt&&nt.update()),nt}changeLanguageDirection(et){const rt=this;rt.rtl&&et==="rtl"||!rt.rtl&&et==="ltr"||(rt.rtl=et==="rtl",rt.rtlTranslate=rt.params.direction==="horizontal"&&rt.rtl,rt.rtl?(rt.el.classList.add(`${rt.params.containerModifierClass}rtl`),rt.el.dir="rtl"):(rt.el.classList.remove(`${rt.params.containerModifierClass}rtl`),rt.el.dir="ltr"),rt.update())}mount(et){const rt=this;if(rt.mounted)return!0;let nt=et||rt.params.el;if(typeof nt=="string"&&(nt=document.querySelector(nt)),!nt)return!1;nt.swiper=rt,nt.parentNode&&nt.parentNode.host&&nt.parentNode.host.nodeName==="SWIPER-CONTAINER"&&(rt.isElement=!0);const st=()=>`.${(rt.params.wrapperClass||"").trim().split(" ").join(".")}`;let at=nt&&nt.shadowRoot&&nt.shadowRoot.querySelector?nt.shadowRoot.querySelector(st()):elementChildren(nt,st())[0];return!at&&rt.params.createElements&&(at=createElement("div",rt.params.wrapperClass),nt.append(at),elementChildren(nt,`.${rt.params.slideClass}`).forEach(lt=>{at.append(lt)})),Object.assign(rt,{el:nt,wrapperEl:at,slidesEl:rt.isElement&&!nt.parentNode.host.slideSlots?nt.parentNode.host:at,hostEl:rt.isElement?nt.parentNode.host:nt,mounted:!0,rtl:nt.dir.toLowerCase()==="rtl"||elementStyle(nt,"direction")==="rtl",rtlTranslate:rt.params.direction==="horizontal"&&(nt.dir.toLowerCase()==="rtl"||elementStyle(nt,"direction")==="rtl"),wrongRTL:elementStyle(at,"display")==="-webkit-box"}),!0}init(et){const rt=this;if(rt.initialized||rt.mount(et)===!1)return rt;rt.emit("beforeInit"),rt.params.breakpoints&&rt.setBreakpoint(),rt.addClasses(),rt.updateSize(),rt.updateSlides(),rt.params.watchOverflow&&rt.checkOverflow(),rt.params.grabCursor&&rt.enabled&&rt.setGrabCursor(),rt.params.loop&&rt.virtual&&rt.params.virtual.enabled?rt.slideTo(rt.params.initialSlide+rt.virtual.slidesBefore,0,rt.params.runCallbacksOnInit,!1,!0):rt.slideTo(rt.params.initialSlide,0,rt.params.runCallbacksOnInit,!1,!0),rt.params.loop&&rt.loopCreate(),rt.attachEvents();const st=[...rt.el.querySelectorAll('[loading="lazy"]')];return rt.isElement&&st.push(...rt.hostEl.querySelectorAll('[loading="lazy"]')),st.forEach(ot=>{ot.complete?processLazyPreloader(rt,ot):ot.addEventListener("load",at=>{processLazyPreloader(rt,at.target)})}),preload(rt),rt.initialized=!0,preload(rt),rt.emit("init"),rt.emit("afterInit"),rt}destroy(et,rt){et===void 0&&(et=!0),rt===void 0&&(rt=!0);const nt=this,{params:st,el:ot,wrapperEl:at,slides:lt}=nt;return typeof nt.params>"u"||nt.destroyed||(nt.emit("beforeDestroy"),nt.initialized=!1,nt.detachEvents(),st.loop&&nt.loopDestroy(),rt&&(nt.removeClasses(),ot.removeAttribute("style"),at.removeAttribute("style"),lt&&lt.length&&lt.forEach(ut=>{ut.classList.remove(st.slideVisibleClass,st.slideActiveClass,st.slideNextClass,st.slidePrevClass),ut.removeAttribute("style"),ut.removeAttribute("data-swiper-slide-index")})),nt.emit("destroy"),Object.keys(nt.eventsListeners).forEach(ut=>{nt.off(ut)}),et!==!1&&(nt.el.swiper=null,deleteProps(nt)),nt.destroyed=!0),null}static extendDefaults(et){extend$1(extendedDefaults,et)}static get extendedDefaults(){return extendedDefaults}static get defaults(){return defaults$3}static installModule(et){_o.prototype.__modules__||(_o.prototype.__modules__=[]);const rt=_o.prototype.__modules__;typeof et=="function"&&rt.indexOf(et)<0&&rt.push(et)}static use(et){return Array.isArray(et)?(et.forEach(rt=>_o.installModule(rt)),_o):(_o.installModule(et),_o)}};Object.keys(prototypes).forEach(tt=>{Object.keys(prototypes[tt]).forEach(et=>{Swiper$1.prototype[et]=prototypes[tt][et]})});Swiper$1.use([Resize,Observer]);const paramsList=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function isObject$1(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"&&!tt.__swiper__}function extend(tt,et){const rt=["__proto__","constructor","prototype"];Object.keys(et).filter(nt=>rt.indexOf(nt)<0).forEach(nt=>{typeof tt[nt]>"u"?tt[nt]=et[nt]:isObject$1(et[nt])&&isObject$1(tt[nt])&&Object.keys(et[nt]).length>0?et[nt].__swiper__?tt[nt]=et[nt]:extend(tt[nt],et[nt]):tt[nt]=et[nt]})}function needsNavigation(tt){return tt===void 0&&(tt={}),tt.navigation&&typeof tt.navigation.nextEl>"u"&&typeof tt.navigation.prevEl>"u"}function needsPagination(tt){return tt===void 0&&(tt={}),tt.pagination&&typeof tt.pagination.el>"u"}function needsScrollbar(tt){return tt===void 0&&(tt={}),tt.scrollbar&&typeof tt.scrollbar.el>"u"}function uniqueClasses(tt){tt===void 0&&(tt="");const et=tt.split(" ").map(nt=>nt.trim()).filter(nt=>!!nt),rt=[];return et.forEach(nt=>{rt.indexOf(nt)<0&&rt.push(nt)}),rt.join(" ")}function wrapperClass(tt){return tt===void 0&&(tt=""),tt?tt.includes("swiper-wrapper")?tt:`swiper-wrapper ${tt}`:"swiper-wrapper"}function updateSwiper(tt){let{swiper:et,slides:rt,passedParams:nt,changedParams:st,nextEl:ot,prevEl:at,scrollbarEl:lt,paginationEl:ut}=tt;const ct=st.filter(Dt=>Dt!=="children"&&Dt!=="direction"&&Dt!=="wrapperClass"),{params:dt,pagination:ht,navigation:mt,scrollbar:xt,virtual:yt,thumbs:vt}=et;let Et,bt,St,wt,Rt,Ct,Pt,It;st.includes("thumbs")&&nt.thumbs&&nt.thumbs.swiper&&dt.thumbs&&!dt.thumbs.swiper&&(Et=!0),st.includes("controller")&&nt.controller&&nt.controller.control&&dt.controller&&!dt.controller.control&&(bt=!0),st.includes("pagination")&&nt.pagination&&(nt.pagination.el||ut)&&(dt.pagination||dt.pagination===!1)&&ht&&!ht.el&&(St=!0),st.includes("scrollbar")&&nt.scrollbar&&(nt.scrollbar.el||lt)&&(dt.scrollbar||dt.scrollbar===!1)&&xt&&!xt.el&&(wt=!0),st.includes("navigation")&&nt.navigation&&(nt.navigation.prevEl||at)&&(nt.navigation.nextEl||ot)&&(dt.navigation||dt.navigation===!1)&&mt&&!mt.prevEl&&!mt.nextEl&&(Rt=!0);const jt=Dt=>{et[Dt]&&(et[Dt].destroy(),Dt==="navigation"?(et.isElement&&(et[Dt].prevEl.remove(),et[Dt].nextEl.remove()),dt[Dt].prevEl=void 0,dt[Dt].nextEl=void 0,et[Dt].prevEl=void 0,et[Dt].nextEl=void 0):(et.isElement&&et[Dt].el.remove(),dt[Dt].el=void 0,et[Dt].el=void 0))};st.includes("loop")&&et.isElement&&(dt.loop&&!nt.loop?Ct=!0:!dt.loop&&nt.loop?Pt=!0:It=!0),ct.forEach(Dt=>{if(isObject$1(dt[Dt])&&isObject$1(nt[Dt]))extend(dt[Dt],nt[Dt]),(Dt==="navigation"||Dt==="pagination"||Dt==="scrollbar")&&"enabled"in nt[Dt]&&!nt[Dt].enabled&&jt(Dt);else{const Vt=nt[Dt];(Vt===!0||Vt===!1)&&(Dt==="navigation"||Dt==="pagination"||Dt==="scrollbar")?Vt===!1&&jt(Dt):dt[Dt]=nt[Dt]}}),ct.includes("controller")&&!bt&&et.controller&&et.controller.control&&dt.controller&&dt.controller.control&&(et.controller.control=dt.controller.control),st.includes("children")&&rt&&yt&&dt.virtual.enabled&&(yt.slides=rt,yt.update(!0)),st.includes("children")&&rt&&dt.loop&&(It=!0),Et&&vt.init()&&vt.update(!0),bt&&(et.controller.control=dt.controller.control),St&&(et.isElement&&(!ut||typeof ut=="string")&&(ut=document.createElement("div"),ut.classList.add("swiper-pagination"),ut.part.add("pagination"),et.el.appendChild(ut)),ut&&(dt.pagination.el=ut),ht.init(),ht.render(),ht.update()),wt&&(et.isElement&&(!lt||typeof lt=="string")&&(lt=document.createElement("div"),lt.classList.add("swiper-scrollbar"),lt.part.add("scrollbar"),et.el.appendChild(lt)),lt&&(dt.scrollbar.el=lt),xt.init(),xt.updateSize(),xt.setTranslate()),Rt&&(et.isElement&&((!ot||typeof ot=="string")&&(ot=document.createElement("div"),ot.classList.add("swiper-button-next"),ot.innerHTML=et.hostEl.constructor.nextButtonSvg,ot.part.add("button-next"),et.el.appendChild(ot)),(!at||typeof at=="string")&&(at=document.createElement("div"),at.classList.add("swiper-button-prev"),at.innerHTML=et.hostEl.constructor.prevButtonSvg,at.part.add("button-prev"),et.el.appendChild(at))),ot&&(dt.navigation.nextEl=ot),at&&(dt.navigation.prevEl=at),mt.init(),mt.update()),st.includes("allowSlideNext")&&(et.allowSlideNext=nt.allowSlideNext),st.includes("allowSlidePrev")&&(et.allowSlidePrev=nt.allowSlidePrev),st.includes("direction")&&et.changeDirection(nt.direction,!1),(Ct||It)&&et.loopDestroy(),(Pt||It)&&et.loopCreate(),et.update()}function getParams(tt,et){tt===void 0&&(tt={}),et===void 0&&(et=!0);const rt={on:{}},nt={},st={};extend(rt,defaults$3),rt._emitClasses=!0,rt.init=!1;const ot={},at=paramsList.map(ut=>ut.replace(/_/,"")),lt=Object.assign({},tt);return Object.keys(lt).forEach(ut=>{typeof tt[ut]>"u"||(at.indexOf(ut)>=0?isObject$1(tt[ut])?(rt[ut]={},st[ut]={},extend(rt[ut],tt[ut]),extend(st[ut],tt[ut])):(rt[ut]=tt[ut],st[ut]=tt[ut]):ut.search(/on[A-Z]/)===0&&typeof tt[ut]=="function"?et?nt[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:rt.on[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:ot[ut]=tt[ut])}),["navigation","pagination","scrollbar"].forEach(ut=>{rt[ut]===!0&&(rt[ut]={}),rt[ut]===!1&&delete rt[ut]}),{params:rt,passedParams:st,rest:ot,events:nt}}function mountSwiper(tt,et){let{el:rt,nextEl:nt,prevEl:st,paginationEl:ot,scrollbarEl:at,swiper:lt}=tt;needsNavigation(et)&&nt&&st&&(lt.params.navigation.nextEl=nt,lt.originalParams.navigation.nextEl=nt,lt.params.navigation.prevEl=st,lt.originalParams.navigation.prevEl=st),needsPagination(et)&&ot&&(lt.params.pagination.el=ot,lt.originalParams.pagination.el=ot),needsScrollbar(et)&&at&&(lt.params.scrollbar.el=at,lt.originalParams.scrollbar.el=at),lt.init(rt)}function getChangedParams(tt,et,rt,nt,st){const ot=[];if(!et)return ot;const at=ut=>{ot.indexOf(ut)<0&&ot.push(ut)};if(rt&&nt){const ut=nt.map(st),ct=rt.map(st);ut.join("")!==ct.join("")&&at("children"),nt.length!==rt.length&&at("children")}return paramsList.filter(ut=>ut[0]==="_").map(ut=>ut.replace(/_/,"")).forEach(ut=>{if(ut in tt&&ut in et)if(isObject$1(tt[ut])&&isObject$1(et[ut])){const ct=Object.keys(tt[ut]),dt=Object.keys(et[ut]);ct.length!==dt.length?at(ut):(ct.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}),dt.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}))}else tt[ut]!==et[ut]&&at(ut)}),ot}const updateOnVirtualData=tt=>{!tt||tt.destroyed||!tt.params.virtual||tt.params.virtual&&!tt.params.virtual.enabled||(tt.updateSlides(),tt.updateProgress(),tt.updateSlidesClasses(),tt.parallax&&tt.params.parallax&&tt.params.parallax.enabled&&tt.parallax.setTranslate())};function _extends(){return _extends=Object.assign?Object.assign.bind():function(tt){for(var et=1;et<arguments.length;et++){var rt=arguments[et];for(var nt in rt)Object.prototype.hasOwnProperty.call(rt,nt)&&(tt[nt]=rt[nt])}return tt},_extends.apply(this,arguments)}function isChildSwiperSlide(tt){return tt.type&&tt.type.displayName&&tt.type.displayName.includes("SwiperSlide")}function processChildren(tt){const et=[];return React$4.Children.toArray(tt).forEach(rt=>{isChildSwiperSlide(rt)?et.push(rt):rt.props&&rt.props.children&&processChildren(rt.props.children).forEach(nt=>et.push(nt))}),et}function getChildren(tt){const et=[],rt={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return React$4.Children.toArray(tt).forEach(nt=>{if(isChildSwiperSlide(nt))et.push(nt);else if(nt.props&&nt.props.slot&&rt[nt.props.slot])rt[nt.props.slot].push(nt);else if(nt.props&&nt.props.children){const st=processChildren(nt.props.children);st.length>0?st.forEach(ot=>et.push(ot)):rt["container-end"].push(nt)}else rt["container-end"].push(nt)}),{slides:et,slots:rt}}function renderVirtual(tt,et,rt){if(!rt)return null;const nt=dt=>{let ht=dt;return dt<0?ht=et.length+dt:ht>=et.length&&(ht=ht-et.length),ht},st=tt.isHorizontal()?{[tt.rtlTranslate?"right":"left"]:`${rt.offset}px`}:{top:`${rt.offset}px`},{from:ot,to:at}=rt,lt=tt.params.loop?-et.length:0,ut=tt.params.loop?et.length*2:et.length,ct=[];for(let dt=lt;dt<ut;dt+=1)dt>=ot&&dt<=at&&ct.push(et[nt(dt)]);return ct.map((dt,ht)=>React$4.cloneElement(dt,{swiper:tt,style:st,key:`slide-${ht}`}))}function useIsomorphicLayoutEffect(tt,et){return typeof window>"u"?reactExports.useEffect(tt,et):reactExports.useLayoutEffect(tt,et)}const SwiperSlideContext=reactExports.createContext(null),SwiperContext=reactExports.createContext(null),Swiper=reactExports.forwardRef(function(tt,et){let{className:rt,tag:nt="div",wrapperTag:st="div",children:ot,onSwiper:at,...lt}=tt===void 0?{}:tt,ut=!1;const[ct,dt]=reactExports.useState("swiper"),[ht,mt]=reactExports.useState(null),[xt,yt]=reactExports.useState(!1),vt=reactExports.useRef(!1),Et=reactExports.useRef(null),bt=reactExports.useRef(null),St=reactExports.useRef(null),wt=reactExports.useRef(null),Rt=reactExports.useRef(null),Ct=reactExports.useRef(null),Pt=reactExports.useRef(null),It=reactExports.useRef(null),{params:jt,passedParams:Dt,rest:Vt,events:Ft}=getParams(lt),{slides:Ht,slots:Nt}=getChildren(ot),Lt=()=>{yt(!xt)};Object.assign(jt.on,{_containerClasses(Ut,Bt){dt(Bt)}});const Mt=()=>{Object.assign(jt.on,Ft),ut=!0;const Ut={...jt};if(delete Ut.wrapperClass,bt.current=new Swiper$1(Ut),bt.current.virtual&&bt.current.params.virtual.enabled){bt.current.virtual.slides=Ht;const Bt={cache:!1,slides:Ht,renderExternal:mt,renderExternalUpdate:!1};extend(bt.current.params.virtual,Bt),extend(bt.current.originalParams.virtual,Bt)}};Et.current||Mt(),bt.current&&bt.current.on("_beforeBreakpoint",Lt);const zt=()=>{ut||!Ft||!bt.current||Object.keys(Ft).forEach(Ut=>{bt.current.on(Ut,Ft[Ut])})},Gt=()=>{!Ft||!bt.current||Object.keys(Ft).forEach(Ut=>{bt.current.off(Ut,Ft[Ut])})};reactExports.useEffect(()=>()=>{bt.current&&bt.current.off("_beforeBreakpoint",Lt)}),reactExports.useEffect(()=>{!vt.current&&bt.current&&(bt.current.emitSlidesClasses(),vt.current=!0)}),useIsomorphicLayoutEffect(()=>{if(et&&(et.current=Et.current),!!Et.current)return bt.current.destroyed&&Mt(),mountSwiper({el:Et.current,nextEl:Rt.current,prevEl:Ct.current,paginationEl:Pt.current,scrollbarEl:It.current,swiper:bt.current},jt),at&&at(bt.current),()=>{bt.current&&!bt.current.destroyed&&bt.current.destroy(!0,!1)}},[]),useIsomorphicLayoutEffect(()=>{zt();const Ut=getChangedParams(Dt,St.current,Ht,wt.current,Bt=>Bt.key);return St.current=Dt,wt.current=Ht,Ut.length&&bt.current&&!bt.current.destroyed&&updateSwiper({swiper:bt.current,slides:Ht,passedParams:Dt,changedParams:Ut,nextEl:Rt.current,prevEl:Ct.current,scrollbarEl:It.current,paginationEl:Pt.current}),()=>{Gt()}}),useIsomorphicLayoutEffect(()=>{updateOnVirtualData(bt.current)},[ht]);function $t(){return jt.virtual?renderVirtual(bt.current,Ht,ht):Ht.map((Ut,Bt)=>React$4.cloneElement(Ut,{swiper:bt.current,swiperSlideIndex:Bt}))}return React$4.createElement(nt,_extends({ref:Et,className:uniqueClasses(`${ct}${rt?` ${rt}`:""}`)},Vt),React$4.createElement(SwiperContext.Provider,{value:bt.current},Nt["container-start"],React$4.createElement(st,{className:wrapperClass(jt.wrapperClass)},Nt["wrapper-start"],$t(),Nt["wrapper-end"]),needsNavigation(jt)&&React$4.createElement(React$4.Fragment,null,React$4.createElement("div",{ref:Ct,className:"swiper-button-prev"}),React$4.createElement("div",{ref:Rt,className:"swiper-button-next"})),needsScrollbar(jt)&&React$4.createElement("div",{ref:It,className:"swiper-scrollbar"}),needsPagination(jt)&&React$4.createElement("div",{ref:Pt,className:"swiper-pagination"}),Nt["container-end"]))});Swiper.displayName="Swiper";const SwiperSlide=reactExports.forwardRef(function(tt,et){let{tag:rt="div",children:nt,className:st="",swiper:ot,zoom:at,lazy:lt,virtualIndex:ut,swiperSlideIndex:ct,...dt}=tt===void 0?{}:tt;const ht=reactExports.useRef(null),[mt,xt]=reactExports.useState("swiper-slide"),[yt,vt]=reactExports.useState(!1);function Et(Rt,Ct,Pt){Ct===ht.current&&xt(Pt)}useIsomorphicLayoutEffect(()=>{if(typeof ct<"u"&&(ht.current.swiperSlideIndex=ct),et&&(et.current=ht.current),!(!ht.current||!ot)){if(ot.destroyed){mt!=="swiper-slide"&&xt("swiper-slide");return}return ot.on("_slideClass",Et),()=>{ot&&ot.off("_slideClass",Et)}}}),useIsomorphicLayoutEffect(()=>{ot&&ht.current&&!ot.destroyed&&xt(ot.getSlideClasses(ht.current))},[ot]);const bt={isActive:mt.indexOf("swiper-slide-active")>=0,isVisible:mt.indexOf("swiper-slide-visible")>=0,isPrev:mt.indexOf("swiper-slide-prev")>=0,isNext:mt.indexOf("swiper-slide-next")>=0},St=()=>typeof nt=="function"?nt(bt):nt,wt=()=>{vt(!0)};return React$4.createElement(rt,_extends({ref:ht,className:uniqueClasses(`${mt}${st?` ${st}`:""}`),"data-swiper-slide-index":ut,onLoad:wt},dt),at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},React$4.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof at=="number"?at:void 0},St(),lt&&!yt&&React$4.createElement("div",{className:"swiper-lazy-preloader"}))),!at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},St(),lt&&!yt&&React$4.createElement("div",{className:"swiper-lazy-preloader"})))});SwiperSlide.displayName="SwiperSlide";const getOnboardingTrash=async tt=>await odeServices.conf().getPreference(tt),saveOnboardingTrash=async tt=>await odeServices.conf().savePreference(tt,JSON.stringify({key:!1})),useOnboardingModal=tt=>{const[et,rt]=reactExports.useState(!0),[nt,st]=reactExports.useState(!1);return reactExports.useEffect(()=>{(async()=>{const ot=await getOnboardingTrash(tt);if(ot){const{key:at}=ot;st(at);return}st(!0)})()},[tt]),{isOpen:et,setIsOpen:rt,isOnboarding:nt,handleSavePreference:async()=>{await saveOnboardingTrash(tt),rt(!1)}}},OnboardingModal$2=({id:tt,items:et,modalOptions:rt})=>{const[nt,st]=reactExports.useState(),[ot,at]=reactExports.useState(0),{isOpen:lt,isOnboarding:ut,setIsOpen:ct,handleSavePreference:dt}=useOnboardingModal(tt);reactExports.useEffect(()=>{const Et=document.createElement("link");return Et.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",Et.rel="stylesheet",Et.type="text/css",document.head.appendChild(Et),()=>{document.head.removeChild(Et)}},[]);const{t:ht}=useTranslation(),{title:mt,prevText:xt,closeText:yt,nextText:vt}=rt;return ut?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"onboarding-modal",size:"md",isOpen:lt,focusId:"nextButtonId",onModalClose:()=>ct(!1),children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:()=>ct(!1),children:ht(mt||"explorer.modal.onboarding.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx(Swiper,{modules:[Pagination],onSwiper:Et=>{st(Et)},onSlideChange:Et=>{at(Et.progress)},pagination:{clickable:!0},children:et.map((Et,bt)=>jsxRuntimeExports.jsxs(SwiperSlide,{children:[jsxRuntimeExports.jsx(Image$1,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:Et.src,alt:ht(Et.alt)}),jsxRuntimeExports.jsx("p",{children:ht(Et.text)})]},bt))})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>ct(!1),children:ht("explorer.modal.onboarding.trash.later")}),ot>0&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"outline",onClick:()=>nt.slidePrev(),children:ht(xt||"explorer.modal.onboarding.trash.prev")}),ot<1&&jsxRuntimeExports.jsx(Button,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>nt.slideNext(),children:ht(vt||"explorer.modal.onboarding.trash.next")}),ot===1&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",onClick:dt,children:ht(yt||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null};var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const rt=Array.isArray(tt),nt=typeof FileList<"u"?tt instanceof FileList:!1;if(tt instanceof Date)et=new Date(tt);else if(tt instanceof Set)et=new Set(tt);else if(!(isWeb&&(tt instanceof Blob||nt))&&(rt||isObject(tt)))if(et=rt?[]:{},!rt&&!isPlainObject(tt))et=tt;else for(const st in tt)tt.hasOwnProperty(st)&&(et[st]=cloneObject(tt[st]));else return tt;return et}var compact$1=tt=>Array.isArray(tt)?tt.filter(Boolean):[],isUndefined=tt=>tt===void 0,get$1=(tt,et,rt)=>{if(!et||!isObject(tt))return rt;const nt=compact$1(et.split(/[,[\].]+?/)).reduce((st,ot)=>isNullOrUndefined(st)?st:st[ot],tt);return isUndefined(nt)||nt===tt?isUndefined(tt[et])?rt:tt[et]:nt},isBoolean$1=tt=>typeof tt=="boolean",isKey=tt=>/^\w*$/.test(tt),stringToPath$1=tt=>compact$1(tt.replace(/["|']|\]/g,"").split(/\.|\[/)),set=(tt,et,rt)=>{let nt=-1;const st=isKey(et)?[et]:stringToPath$1(et),ot=st.length,at=ot-1;for(;++nt<ot;){const lt=st[nt];let ut=rt;if(nt!==at){const ct=tt[lt];ut=isObject(ct)||Array.isArray(ct)?ct:isNaN(+st[nt+1])?{}:[]}if(lt==="__proto__"||lt==="constructor"||lt==="prototype")return;tt[lt]=ut,tt=tt[lt]}return tt};const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$4.createContext(null),useFormContext=()=>React$4.useContext(HookFormContext);var getProxyFormState=(tt,et,rt,nt=!0)=>{const st={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(st,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!nt||VALIDATION_MODE.all),rt&&(rt[at]=!0),tt[at]}});return st},isEmptyObject=tt=>isObject(tt)&&!Object.keys(tt).length,shouldRenderFormState=(tt,et,rt,nt)=>{rt(tt);const{name:st,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!nt||VALIDATION_MODE.all))},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],shouldSubscribeByName=(tt,et,rt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(nt=>nt&&(rt?nt===et:nt.startsWith(et)||et.startsWith(nt)));function useSubscribe(tt){const et=React$4.useRef(tt);et.current=tt,React$4.useEffect(()=>{const rt=!tt.disabled&&et.current.subject&&et.current.subject.subscribe({next:et.current.next});return()=>{rt&&rt.unsubscribe()}},[tt.disabled])}function useFormState(tt){const et=useFormContext(),{control:rt=et.control,disabled:nt,name:st,exact:ot}=tt,[at,lt]=React$4.useState(rt._formState),ut=React$4.useRef(!0),ct=React$4.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),dt=React$4.useRef(st);return dt.current=st,useSubscribe({disabled:nt,next:ht=>ut.current&&shouldSubscribeByName(dt.current,ht.name,ot)&&shouldRenderFormState(ht,ct.current,rt._updateFormState)&&lt({...rt._formState,...ht}),subject:rt._subjects.state}),React$4.useEffect(()=>(ut.current=!0,ct.current.isValid&&rt._updateValid(!0),()=>{ut.current=!1}),[rt]),React$4.useMemo(()=>getProxyFormState(at,rt,ct.current,!1),[at,rt])}var isString$1=tt=>typeof tt=="string",generateWatchOutput=(tt,et,rt,nt,st)=>isString$1(tt)?(nt&&et.watch.add(tt),get$1(rt,tt,st)):Array.isArray(tt)?tt.map(ot=>(nt&&et.watch.add(ot),get$1(rt,ot))):(nt&&(et.watchAll=!0),rt);function useWatch(tt){const et=useFormContext(),{control:rt=et.control,name:nt,defaultValue:st,disabled:ot,exact:at}=tt,lt=React$4.useRef(nt);lt.current=nt,useSubscribe({disabled:ot,subject:rt._subjects.values,next:dt=>{shouldSubscribeByName(lt.current,dt.name,at)&&ct(cloneObject(generateWatchOutput(lt.current,rt._names,dt.values||rt._formValues,!1,st)))}});const[ut,ct]=React$4.useState(rt._getWatch(nt,st));return React$4.useEffect(()=>rt._removeUnmounted()),ut}function useController(tt){const et=useFormContext(),{name:rt,disabled:nt,control:st=et.control,shouldUnregister:ot}=tt,at=isNameInFieldArray(st._names.array,rt),lt=useWatch({control:st,name:rt,defaultValue:get$1(st._formValues,rt,get$1(st._defaultValues,rt,tt.defaultValue)),exact:!0}),ut=useFormState({control:st,name:rt,exact:!0}),ct=React$4.useRef(st.register(rt,{...tt.rules,value:lt,...isBoolean$1(tt.disabled)?{disabled:tt.disabled}:{}})),dt=React$4.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$1(ut.errors,rt)},isDirty:{enumerable:!0,get:()=>!!get$1(ut.dirtyFields,rt)},isTouched:{enumerable:!0,get:()=>!!get$1(ut.touchedFields,rt)},isValidating:{enumerable:!0,get:()=>!!get$1(ut.validatingFields,rt)},error:{enumerable:!0,get:()=>get$1(ut.errors,rt)}}),[ut,rt]),ht=React$4.useMemo(()=>({name:rt,value:lt,...isBoolean$1(nt)||ut.disabled?{disabled:ut.disabled||nt}:{},onChange:mt=>ct.current.onChange({target:{value:getEventValue(mt),name:rt},type:EVENTS.CHANGE}),onBlur:()=>ct.current.onBlur({target:{value:get$1(st._formValues,rt),name:rt},type:EVENTS.BLUR}),ref:mt=>{const xt=get$1(st._fields,rt);xt&&mt&&(xt._f.ref={focus:()=>mt.focus(),select:()=>mt.select(),setCustomValidity:yt=>mt.setCustomValidity(yt),reportValidity:()=>mt.reportValidity()})}}),[rt,st._formValues,nt,ut.disabled,lt,st._fields]);return React$4.useEffect(()=>{const mt=st._options.shouldUnregister||ot,xt=(yt,vt)=>{const Et=get$1(st._fields,yt);Et&&Et._f&&(Et._f.mount=vt)};if(xt(rt,!0),mt){const yt=cloneObject(get$1(st._options.defaultValues,rt));set(st._defaultValues,rt,yt),isUndefined(get$1(st._formValues,rt))&&set(st._formValues,rt,yt)}return!at&&st.register(rt),()=>{(at?mt&&!st._state.action:mt)?st.unregister(rt):xt(rt,!1)}},[rt,st,at,ot]),React$4.useEffect(()=>{st._updateDisabledField({disabled:nt,fields:st._fields,name:rt})},[nt,rt,st]),React$4.useMemo(()=>({field:ht,formState:ut,fieldState:dt}),[ht,ut,dt])}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,rt,nt,st)=>et?{...rt[tt],types:{...rt[tt]&&rt[tt].types?rt[tt].types:{},[nt]:st||!0}}:{},getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched}),isWatched=(tt,et,rt)=>!rt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(nt=>tt.startsWith(nt)&&/^\.\w+/.test(tt.slice(nt.length))));const iterateFieldsByAction=(tt,et,rt,nt)=>{for(const st of rt||Object.keys(tt)){const ot=get$1(tt,st);if(ot){const{_f:at,...lt}=ot;if(at){if(at.refs&&at.refs[0]&&et(at.refs[0],st)&&!nt)return!0;if(at.ref&&et(at.ref,at.name)&&!nt)return!0;if(iterateFieldsByAction(lt,et))break}else if(isObject(lt)&&iterateFieldsByAction(lt,et))break}}};var updateFieldArrayRootError=(tt,et,rt)=>{const nt=convertToArrayPayload(get$1(tt,rt));return set(nt,"root",et[rt]),set(tt,rt,nt),tt},isFileInput=tt=>tt.type==="file",isFunction=tt=>typeof tt=="function",isHTMLElement=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMessage=tt=>isString$1(tt),isRadioInput=tt=>tt.type==="radio",isRegex=tt=>tt instanceof RegExp;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(rt=>rt&&rt.checked&&!rt.disabled).map(rt=>rt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined(tt[0].attributes.value)?isUndefined(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult}return defaultResult};const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,rt)=>rt&&rt.checked&&!rt.disabled?{isValid:!0,value:rt.value}:et,defaultReturn):defaultReturn;function getValidateError(tt,et,rt="validate"){if(isMessage(tt)||Array.isArray(tt)&&tt.every(isMessage)||isBoolean$1(tt)&&!tt)return{type:rt,message:isMessage(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,rt,nt,st,ot)=>{const{ref:at,refs:lt,required:ut,maxLength:ct,minLength:dt,min:ht,max:mt,pattern:xt,validate:yt,name:vt,valueAsNumber:Et,mount:bt}=tt._f,St=get$1(rt,vt);if(!bt||et.has(vt))return{};const wt=lt?lt[0]:at,Rt=Ht=>{st&&wt.reportValidity&&(wt.setCustomValidity(isBoolean$1(Ht)?"":Ht||""),wt.reportValidity())},Ct={},Pt=isRadioInput(at),It=isCheckBoxInput(at),jt=Pt||It,Dt=(Et||isFileInput(at))&&isUndefined(at.value)&&isUndefined(St)||isHTMLElement(at)&&at.value===""||St===""||Array.isArray(St)&&!St.length,Vt=appendErrors.bind(null,vt,nt,Ct),Ft=(Ht,Nt,Lt,Mt=INPUT_VALIDATION_RULES.maxLength,zt=INPUT_VALIDATION_RULES.minLength)=>{const Gt=Ht?Nt:Lt;Ct[vt]={type:Ht?Mt:zt,message:Gt,ref:at,...Vt(Ht?Mt:zt,Gt)}};if(ot?!Array.isArray(St)||!St.length:ut&&(!jt&&(Dt||isNullOrUndefined(St))||isBoolean$1(St)&&!St||It&&!getCheckboxValue(lt).isValid||Pt&&!getRadioValue(lt).isValid)){const{value:Ht,message:Nt}=isMessage(ut)?{value:!!ut,message:ut}:getValueAndMessage(ut);if(Ht&&(Ct[vt]={type:INPUT_VALIDATION_RULES.required,message:Nt,ref:wt,...Vt(INPUT_VALIDATION_RULES.required,Nt)},!nt))return Rt(Nt),Ct}if(!Dt&&(!isNullOrUndefined(ht)||!isNullOrUndefined(mt))){let Ht,Nt;const Lt=getValueAndMessage(mt),Mt=getValueAndMessage(ht);if(!isNullOrUndefined(St)&&!isNaN(St)){const zt=at.valueAsNumber||St&&+St;isNullOrUndefined(Lt.value)||(Ht=zt>Lt.value),isNullOrUndefined(Mt.value)||(Nt=zt<Mt.value)}else{const zt=at.valueAsDate||new Date(St),Gt=Bt=>new Date(new Date().toDateString()+" "+Bt),$t=at.type=="time",Ut=at.type=="week";isString$1(Lt.value)&&St&&(Ht=$t?Gt(St)>Gt(Lt.value):Ut?St>Lt.value:zt>new Date(Lt.value)),isString$1(Mt.value)&&St&&(Nt=$t?Gt(St)<Gt(Mt.value):Ut?St<Mt.value:zt<new Date(Mt.value))}if((Ht||Nt)&&(Ft(!!Ht,Lt.message,Mt.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!nt))return Rt(Ct[vt].message),Ct}if((ct||dt)&&!Dt&&(isString$1(St)||ot&&Array.isArray(St))){const Ht=getValueAndMessage(ct),Nt=getValueAndMessage(dt),Lt=!isNullOrUndefined(Ht.value)&&St.length>+Ht.value,Mt=!isNullOrUndefined(Nt.value)&&St.length<+Nt.value;if((Lt||Mt)&&(Ft(Lt,Ht.message,Nt.message),!nt))return Rt(Ct[vt].message),Ct}if(xt&&!Dt&&isString$1(St)){const{value:Ht,message:Nt}=getValueAndMessage(xt);if(isRegex(Ht)&&!St.match(Ht)&&(Ct[vt]={type:INPUT_VALIDATION_RULES.pattern,message:Nt,ref:at,...Vt(INPUT_VALIDATION_RULES.pattern,Nt)},!nt))return Rt(Nt),Ct}if(yt){if(isFunction(yt)){const Ht=await yt(St,rt),Nt=getValidateError(Ht,wt);if(Nt&&(Ct[vt]={...Nt,...Vt(INPUT_VALIDATION_RULES.validate,Nt.message)},!nt))return Rt(Nt.message),Ct}else if(isObject(yt)){let Ht={};for(const Nt in yt){if(!isEmptyObject(Ht)&&!nt)break;const Lt=getValidateError(await yt[Nt](St,rt),wt,Nt);Lt&&(Ht={...Lt,...Vt(Nt,Lt.message)},Rt(Lt.message),nt&&(Ct[vt]=Ht))}if(!isEmptyObject(Ht)&&(Ct[vt]={ref:wt,...Ht},!nt))return Ct}}return Rt(!0),Ct};function baseGet(tt,et){const rt=et.slice(0,-1).length;let nt=0;for(;nt<rt;)tt=isUndefined(tt)?nt++:tt[et[nt++]];return tt}function isEmptyArray(tt){for(const et in tt)if(tt.hasOwnProperty(et)&&!isUndefined(tt[et]))return!1;return!0}function unset(tt,et){const rt=Array.isArray(et)?et:isKey(et)?[et]:stringToPath$1(et),nt=rt.length===1?tt:baseGet(tt,rt),st=rt.length-1,ot=rt[st];return nt&&delete nt[ot],st!==0&&(isObject(nt)&&isEmptyObject(nt)||Array.isArray(nt)&&isEmptyArray(nt))&&unset(tt,rt.slice(0,-1)),tt}var createSubject=()=>{let tt=[];return{get observers(){return tt},next:st=>{for(const ot of tt)ot.next&&ot.next(st)},subscribe:st=>(tt.push(st),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==st)}}),unsubscribe:()=>{tt=[]}}},isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual(tt,et){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const rt=Object.keys(tt),nt=Object.keys(et);if(rt.length!==nt.length)return!1;for(const st of rt){const ot=tt[st];if(!nt.includes(st))return!1;if(st!=="ref"){const at=et[st];if(isDateObject(ot)&&isDateObject(at)||isObject(ot)&&isObject(at)||Array.isArray(ot)&&Array.isArray(at)?!deepEqual(ot,at):ot!==at)return!1}}return!0}var isMultipleSelect=tt=>tt.type==="select-multiple",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement(tt)&&tt.isConnected,objectHasFunction=tt=>{for(const et in tt)if(isFunction(tt[et]))return!0;return!1};function markFieldsDirty(tt,et={}){const rt=Array.isArray(tt);if(isObject(tt)||rt)for(const nt in tt)Array.isArray(tt[nt])||isObject(tt[nt])&&!objectHasFunction(tt[nt])?(et[nt]=Array.isArray(tt[nt])?[]:{},markFieldsDirty(tt[nt],et[nt])):isNullOrUndefined(tt[nt])||(et[nt]=!0);return et}function getDirtyFieldsFromDefaultValues(tt,et,rt){const nt=Array.isArray(tt);if(isObject(tt)||nt)for(const st in tt)Array.isArray(tt[st])||isObject(tt[st])&&!objectHasFunction(tt[st])?isUndefined(et)||isPrimitive(rt[st])?rt[st]=Array.isArray(tt[st])?markFieldsDirty(tt[st],[]):{...markFieldsDirty(tt[st])}:getDirtyFieldsFromDefaultValues(tt[st],isNullOrUndefined(et)?{}:et[st],rt[st]):rt[st]=!deepEqual(tt[st],et[st]);return rt}var getDirtyFields=(tt,et)=>getDirtyFieldsFromDefaultValues(tt,et,markFieldsDirty(et)),getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:rt,setValueAs:nt})=>isUndefined(tt)?tt:et?tt===""?NaN:tt&&+tt:rt&&isString$1(tt)?new Date(tt):nt?nt(tt):tt;function getFieldValue(tt){const et=tt.ref;return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:rt})=>rt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,rt,nt)=>{const st={};for(const ot of tt){const at=get$1(et,ot);at&&set(st,ot,at._f)}return{criteriaMode:rt,names:[...tt],fields:st,shouldUseNativeValidation:nt}},getRuleValue=tt=>isUndefined(tt)?tt:isRegex(tt)?tt.source:isObject(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt;const ASYNC_FUNCTION="AsyncFunction";var hasPromiseValidation=tt=>!!tt&&!!tt.validate&&!!(isFunction(tt.validate)&&tt.validate.constructor.name===ASYNC_FUNCTION||isObject(tt.validate)&&Object.values(tt.validate).find(et=>et.constructor.name===ASYNC_FUNCTION)),hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate);function schemaErrorLookup(tt,et,rt){const nt=get$1(tt,rt);if(nt||isKey(rt))return{error:nt,name:rt};const st=rt.split(".");for(;st.length;){const ot=st.join("."),at=get$1(et,ot),lt=get$1(tt,ot);if(at&&!Array.isArray(at)&&rt!==ot)return{name:rt};if(lt&&lt.type)return{name:ot,error:lt};st.pop()}return{name:rt}}var skipValidation=(tt,et,rt,nt,st)=>st.isOnAll?!1:!rt&&st.isOnTouch?!(et||tt):(rt?nt.isOnBlur:st.isOnBlur)?!tt:(rt?nt.isOnChange:st.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact$1(get$1(tt,et)).length&&unset(tt,et);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={}){let et={...defaultOptions,...tt},rt={submitCount:0,isDirty:!1,isLoading:isFunction(et.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:et.errors||{},disabled:et.disabled||!1},nt={},st=isObject(et.defaultValues)||isObject(et.values)?cloneObject(et.defaultValues||et.values)||{}:{},ot=et.shouldUnregister?{}:cloneObject(st),at={action:!1,mount:!1,watch:!1},lt={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},ut,ct=0;const dt={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},ht={values:createSubject(),array:createSubject(),state:createSubject()},mt=getValidationModes(et.mode),xt=getValidationModes(et.reValidateMode),yt=et.criteriaMode===VALIDATION_MODE.all,vt=qt=>er=>{clearTimeout(ct),ct=setTimeout(qt,er)},Et=async qt=>{if(!et.disabled&&(dt.isValid||qt)){const er=et.resolver?isEmptyObject((await jt()).errors):await Vt(nt,!0);er!==rt.isValid&&ht.state.next({isValid:er})}},bt=(qt,er)=>{!et.disabled&&(dt.isValidating||dt.validatingFields)&&((qt||Array.from(lt.mount)).forEach(nr=>{nr&&(er?set(rt.validatingFields,nr,er):unset(rt.validatingFields,nr))}),ht.state.next({validatingFields:rt.validatingFields,isValidating:!isEmptyObject(rt.validatingFields)}))},St=(qt,er=[],nr,yr,xr=!0,dr=!0)=>{if(yr&&nr&&!et.disabled){if(at.action=!0,dr&&Array.isArray(get$1(nt,qt))){const _r=nr(get$1(nt,qt),yr.argA,yr.argB);xr&&set(nt,qt,_r)}if(dr&&Array.isArray(get$1(rt.errors,qt))){const _r=nr(get$1(rt.errors,qt),yr.argA,yr.argB);xr&&set(rt.errors,qt,_r),unsetEmptyArray(rt.errors,qt)}if(dt.touchedFields&&dr&&Array.isArray(get$1(rt.touchedFields,qt))){const _r=nr(get$1(rt.touchedFields,qt),yr.argA,yr.argB);xr&&set(rt.touchedFields,qt,_r)}dt.dirtyFields&&(rt.dirtyFields=getDirtyFields(st,ot)),ht.state.next({name:qt,isDirty:Ht(qt,er),dirtyFields:rt.dirtyFields,errors:rt.errors,isValid:rt.isValid})}else set(ot,qt,er)},wt=(qt,er)=>{set(rt.errors,qt,er),ht.state.next({errors:rt.errors})},Rt=qt=>{rt.errors=qt,ht.state.next({errors:rt.errors,isValid:!1})},Ct=(qt,er,nr,yr)=>{const xr=get$1(nt,qt);if(xr){const dr=get$1(ot,qt,isUndefined(nr)?get$1(st,qt):nr);isUndefined(dr)||yr&&yr.defaultChecked||er?set(ot,qt,er?dr:getFieldValue(xr._f)):Mt(qt,dr),at.mount&&Et()}},Pt=(qt,er,nr,yr,xr)=>{let dr=!1,_r=!1;const Fr={name:qt};if(!et.disabled){const jr=!!(get$1(nt,qt)&&get$1(nt,qt)._f&&get$1(nt,qt)._f.disabled);if(!nr||yr){dt.isDirty&&(_r=rt.isDirty,rt.isDirty=Fr.isDirty=Ht(),dr=_r!==Fr.isDirty);const Ir=jr||deepEqual(get$1(st,qt),er);_r=!!(!jr&&get$1(rt.dirtyFields,qt)),Ir||jr?unset(rt.dirtyFields,qt):set(rt.dirtyFields,qt,!0),Fr.dirtyFields=rt.dirtyFields,dr=dr||dt.dirtyFields&&_r!==!Ir}if(nr){const Ir=get$1(rt.touchedFields,qt);Ir||(set(rt.touchedFields,qt,nr),Fr.touchedFields=rt.touchedFields,dr=dr||dt.touchedFields&&Ir!==nr)}dr&&xr&&ht.state.next(Fr)}return dr?Fr:{}},It=(qt,er,nr,yr)=>{const xr=get$1(rt.errors,qt),dr=dt.isValid&&isBoolean$1(er)&&rt.isValid!==er;if(et.delayError&&nr?(ut=vt(()=>wt(qt,nr)),ut(et.delayError)):(clearTimeout(ct),ut=null,nr?set(rt.errors,qt,nr):unset(rt.errors,qt)),(nr?!deepEqual(xr,nr):xr)||!isEmptyObject(yr)||dr){const _r={...yr,...dr&&isBoolean$1(er)?{isValid:er}:{},errors:rt.errors,name:qt};rt={...rt,..._r},ht.state.next(_r)}},jt=async qt=>{bt(qt,!0);const er=await et.resolver(ot,et.context,getResolverOptions(qt||lt.mount,nt,et.criteriaMode,et.shouldUseNativeValidation));return bt(qt),er},Dt=async qt=>{const{errors:er}=await jt(qt);if(qt)for(const nr of qt){const yr=get$1(er,nr);yr?set(rt.errors,nr,yr):unset(rt.errors,nr)}else rt.errors=er;return er},Vt=async(qt,er,nr={valid:!0})=>{for(const yr in qt){const xr=qt[yr];if(xr){const{_f:dr,..._r}=xr;if(dr){const Fr=lt.array.has(dr.name),jr=xr._f&&hasPromiseValidation(xr._f);jr&&dt.validatingFields&&bt([yr],!0);const Ir=await validateField(xr,lt.disabled,ot,yt,et.shouldUseNativeValidation&&!er,Fr);if(jr&&dt.validatingFields&&bt([yr]),Ir[dr.name]&&(nr.valid=!1,er))break;!er&&(get$1(Ir,dr.name)?Fr?updateFieldArrayRootError(rt.errors,Ir,dr.name):set(rt.errors,dr.name,Ir[dr.name]):unset(rt.errors,dr.name))}!isEmptyObject(_r)&&await Vt(_r,er,nr)}}return nr.valid},Ft=()=>{for(const qt of lt.unMount){const er=get$1(nt,qt);er&&(er._f.refs?er._f.refs.every(nr=>!live(nr)):!live(er._f.ref))&&ur(qt)}lt.unMount=new Set},Ht=(qt,er)=>!et.disabled&&(qt&&er&&set(ot,qt,er),!deepEqual(Yt(),st)),Nt=(qt,er,nr)=>generateWatchOutput(qt,lt,{...at.mount?ot:isUndefined(er)?st:isString$1(qt)?{[qt]:er}:er},nr,er),Lt=qt=>compact$1(get$1(at.mount?ot:st,qt,et.shouldUnregister?get$1(st,qt,[]):[])),Mt=(qt,er,nr={})=>{const yr=get$1(nt,qt);let xr=er;if(yr){const dr=yr._f;dr&&(!dr.disabled&&set(ot,qt,getFieldValueAs(er,dr)),xr=isHTMLElement(dr.ref)&&isNullOrUndefined(er)?"":er,isMultipleSelect(dr.ref)?[...dr.ref.options].forEach(_r=>_r.selected=xr.includes(_r.value)):dr.refs?isCheckBoxInput(dr.ref)?dr.refs.length>1?dr.refs.forEach(_r=>(!_r.defaultChecked||!_r.disabled)&&(_r.checked=Array.isArray(xr)?!!xr.find(Fr=>Fr===_r.value):xr===_r.value)):dr.refs[0]&&(dr.refs[0].checked=!!xr):dr.refs.forEach(_r=>_r.checked=_r.value===xr):isFileInput(dr.ref)?dr.ref.value="":(dr.ref.value=xr,dr.ref.type||ht.values.next({name:qt,values:{...ot}})))}(nr.shouldDirty||nr.shouldTouch)&&Pt(qt,xr,nr.shouldTouch,nr.shouldDirty,!0),nr.shouldValidate&&Bt(qt)},zt=(qt,er,nr)=>{for(const yr in er){const xr=er[yr],dr=`${qt}.${yr}`,_r=get$1(nt,dr);(lt.array.has(qt)||isObject(xr)||_r&&!_r._f)&&!isDateObject(xr)?zt(dr,xr,nr):Mt(dr,xr,nr)}},Gt=(qt,er,nr={})=>{const yr=get$1(nt,qt),xr=lt.array.has(qt),dr=cloneObject(er);set(ot,qt,dr),xr?(ht.array.next({name:qt,values:{...ot}}),(dt.isDirty||dt.dirtyFields)&&nr.shouldDirty&&ht.state.next({name:qt,dirtyFields:getDirtyFields(st,ot),isDirty:Ht(qt,dr)})):yr&&!yr._f&&!isNullOrUndefined(dr)?zt(qt,dr,nr):Mt(qt,dr,nr),isWatched(qt,lt)&&ht.state.next({...rt}),ht.values.next({name:at.mount?qt:void 0,values:{...ot}})},$t=async qt=>{at.mount=!0;const er=qt.target;let nr=er.name,yr=!0;const xr=get$1(nt,nr),dr=()=>er.type?getFieldValue(xr._f):getEventValue(qt),_r=Fr=>{yr=Number.isNaN(Fr)||isDateObject(Fr)&&isNaN(Fr.getTime())||deepEqual(Fr,get$1(ot,nr,Fr))};if(xr){let Fr,jr;const Ir=dr(),Pr=qt.type===EVENTS.BLUR||qt.type===EVENTS.FOCUS_OUT,Vr=!hasValidation(xr._f)&&!et.resolver&&!get$1(rt.errors,nr)&&!xr._f.deps||skipValidation(Pr,get$1(rt.touchedFields,nr),rt.isSubmitted,xt,mt),Xn=isWatched(nr,lt,Pr);set(ot,nr,Ir),Pr?(xr._f.onBlur&&xr._f.onBlur(qt),ut&&ut(0)):xr._f.onChange&&xr._f.onChange(qt);const An=Pt(nr,Ir,Pr,!1),Hr=!isEmptyObject(An)||Xn;if(!Pr&&ht.values.next({name:nr,type:qt.type,values:{...ot}}),Vr)return dt.isValid&&(et.mode==="onBlur"&&Pr?Et():Pr||Et()),Hr&&ht.state.next({name:nr,...Xn?{}:An});if(!Pr&&Xn&&ht.state.next({...rt}),et.resolver){const{errors:Lr}=await jt([nr]);if(_r(Ir),yr){const os=schemaErrorLookup(rt.errors,nt,nr),Ms=schemaErrorLookup(Lr,nt,os.name||nr);Fr=Ms.error,nr=Ms.name,jr=isEmptyObject(Lr)}}else bt([nr],!0),Fr=(await validateField(xr,lt.disabled,ot,yt,et.shouldUseNativeValidation))[nr],bt([nr]),_r(Ir),yr&&(Fr?jr=!1:dt.isValid&&(jr=await Vt(nt,!0)));yr&&(xr._f.deps&&Bt(xr._f.deps),It(nr,jr,Fr,An))}},Ut=(qt,er)=>{if(get$1(rt.errors,er)&&qt.focus)return qt.focus(),1},Bt=async(qt,er={})=>{let nr,yr;const xr=convertToArrayPayload(qt);if(et.resolver){const dr=await Dt(isUndefined(qt)?qt:xr);nr=isEmptyObject(dr),yr=qt?!xr.some(_r=>get$1(dr,_r)):nr}else qt?(yr=(await Promise.all(xr.map(async dr=>{const _r=get$1(nt,dr);return await Vt(_r&&_r._f?{[dr]:_r}:_r)}))).every(Boolean),!(!yr&&!rt.isValid)&&Et()):yr=nr=await Vt(nt);return ht.state.next({...!isString$1(qt)||dt.isValid&&nr!==rt.isValid?{}:{name:qt},...et.resolver||!qt?{isValid:nr}:{},errors:rt.errors}),er.shouldFocus&&!yr&&iterateFieldsByAction(nt,Ut,qt?xr:lt.mount),yr},Yt=qt=>{const er={...at.mount?ot:st};return isUndefined(qt)?er:isString$1(qt)?get$1(er,qt):qt.map(nr=>get$1(er,nr))},Zt=(qt,er)=>({invalid:!!get$1((er||rt).errors,qt),isDirty:!!get$1((er||rt).dirtyFields,qt),error:get$1((er||rt).errors,qt),isValidating:!!get$1(rt.validatingFields,qt),isTouched:!!get$1((er||rt).touchedFields,qt)}),Xt=qt=>{qt&&convertToArrayPayload(qt).forEach(er=>unset(rt.errors,er)),ht.state.next({errors:qt?rt.errors:{}})},rr=(qt,er,nr)=>{const yr=(get$1(nt,qt,{_f:{}})._f||{}).ref,xr=get$1(rt.errors,qt)||{},{ref:dr,message:_r,type:Fr,...jr}=xr;set(rt.errors,qt,{...jr,...er,ref:yr}),ht.state.next({name:qt,errors:rt.errors,isValid:!1}),nr&&nr.shouldFocus&&yr&&yr.focus&&yr.focus()},cr=(qt,er)=>isFunction(qt)?ht.values.subscribe({next:nr=>qt(Nt(void 0,er),nr)}):Nt(qt,er,!0),ur=(qt,er={})=>{for(const nr of qt?convertToArrayPayload(qt):lt.mount)lt.mount.delete(nr),lt.array.delete(nr),er.keepValue||(unset(nt,nr),unset(ot,nr)),!er.keepError&&unset(rt.errors,nr),!er.keepDirty&&unset(rt.dirtyFields,nr),!er.keepTouched&&unset(rt.touchedFields,nr),!er.keepIsValidating&&unset(rt.validatingFields,nr),!et.shouldUnregister&&!er.keepDefaultValue&&unset(st,nr);ht.values.next({values:{...ot}}),ht.state.next({...rt,...er.keepDirty?{isDirty:Ht()}:{}}),!er.keepIsValid&&Et()},mr=({disabled:qt,name:er,field:nr,fields:yr})=>{(isBoolean$1(qt)&&at.mount||qt||lt.disabled.has(er))&&(qt?lt.disabled.add(er):lt.disabled.delete(er),Pt(er,getFieldValue(nr?nr._f:get$1(yr,er)._f),!1,!1,!0))},vr=(qt,er={})=>{let nr=get$1(nt,qt);const yr=isBoolean$1(er.disabled)||isBoolean$1(et.disabled);return set(nt,qt,{...nr||{},_f:{...nr&&nr._f?nr._f:{ref:{name:qt}},name:qt,mount:!0,...er}}),lt.mount.add(qt),nr?mr({field:nr,disabled:isBoolean$1(er.disabled)?er.disabled:et.disabled,name:qt}):Ct(qt,!0,er.value),{...yr?{disabled:er.disabled||et.disabled}:{},...et.progressive?{required:!!er.required,min:getRuleValue(er.min),max:getRuleValue(er.max),minLength:getRuleValue(er.minLength),maxLength:getRuleValue(er.maxLength),pattern:getRuleValue(er.pattern)}:{},name:qt,onChange:$t,onBlur:$t,ref:xr=>{if(xr){vr(qt,er),nr=get$1(nt,qt);const dr=isUndefined(xr.value)&&xr.querySelectorAll&&xr.querySelectorAll("input,select,textarea")[0]||xr,_r=isRadioOrCheckbox(dr),Fr=nr._f.refs||[];if(_r?Fr.find(jr=>jr===dr):dr===nr._f.ref)return;set(nt,qt,{_f:{...nr._f,..._r?{refs:[...Fr.filter(live),dr,...Array.isArray(get$1(st,qt))?[{}]:[]],ref:{type:dr.type,name:qt}}:{ref:dr}}}),Ct(qt,!1,void 0,dr)}else nr=get$1(nt,qt,{}),nr._f&&(nr._f.mount=!1),(et.shouldUnregister||er.shouldUnregister)&&!(isNameInFieldArray(lt.array,qt)&&at.action)&&lt.unMount.add(qt)}}},Er=()=>et.shouldFocusError&&iterateFieldsByAction(nt,Ut,lt.mount),br=qt=>{isBoolean$1(qt)&&(ht.state.next({disabled:qt}),iterateFieldsByAction(nt,(er,nr)=>{const yr=get$1(nt,nr);yr&&(er.disabled=yr._f.disabled||qt,Array.isArray(yr._f.refs)&&yr._f.refs.forEach(xr=>{xr.disabled=yr._f.disabled||qt}))},0,!1))},hr=(qt,er)=>async nr=>{let yr;nr&&(nr.preventDefault&&nr.preventDefault(),nr.persist&&nr.persist());let xr=cloneObject(ot);if(lt.disabled.size)for(const dr of lt.disabled)set(xr,dr,void 0);if(ht.state.next({isSubmitting:!0}),et.resolver){const{errors:dr,values:_r}=await jt();rt.errors=dr,xr=_r}else await Vt(nt);if(unset(rt.errors,"root"),isEmptyObject(rt.errors)){ht.state.next({errors:{}});try{await qt(xr,nr)}catch(dr){yr=dr}}else er&&await er({...rt.errors},nr),Er(),setTimeout(Er);if(ht.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(rt.errors)&&!yr,submitCount:rt.submitCount+1,errors:rt.errors}),yr)throw yr},Ar=(qt,er={})=>{get$1(nt,qt)&&(isUndefined(er.defaultValue)?Gt(qt,cloneObject(get$1(st,qt))):(Gt(qt,er.defaultValue),set(st,qt,cloneObject(er.defaultValue))),er.keepTouched||unset(rt.touchedFields,qt),er.keepDirty||(unset(rt.dirtyFields,qt),rt.isDirty=er.defaultValue?Ht(qt,cloneObject(get$1(st,qt))):Ht()),er.keepError||(unset(rt.errors,qt),dt.isValid&&Et()),ht.state.next({...rt}))},Cr=(qt,er={})=>{const nr=qt?cloneObject(qt):st,yr=cloneObject(nr),xr=isEmptyObject(qt),dr=xr?st:yr;if(er.keepDefaultValues||(st=nr),!er.keepValues){if(er.keepDirtyValues){const _r=new Set([...lt.mount,...Object.keys(getDirtyFields(st,ot))]);for(const Fr of Array.from(_r))get$1(rt.dirtyFields,Fr)?set(dr,Fr,get$1(ot,Fr)):Gt(Fr,get$1(dr,Fr))}else{if(isWeb&&isUndefined(qt))for(const _r of lt.mount){const Fr=get$1(nt,_r);if(Fr&&Fr._f){const jr=Array.isArray(Fr._f.refs)?Fr._f.refs[0]:Fr._f.ref;if(isHTMLElement(jr)){const Ir=jr.closest("form");if(Ir){Ir.reset();break}}}}nt={}}ot=et.shouldUnregister?er.keepDefaultValues?cloneObject(st):{}:cloneObject(dr),ht.array.next({values:{...dr}}),ht.values.next({values:{...dr}})}lt={mount:er.keepDirtyValues?lt.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},at.mount=!dt.isValid||!!er.keepIsValid||!!er.keepDirtyValues,at.watch=!!et.shouldUnregister,ht.state.next({submitCount:er.keepSubmitCount?rt.submitCount:0,isDirty:xr?!1:er.keepDirty?rt.isDirty:!!(er.keepDefaultValues&&!deepEqual(qt,st)),isSubmitted:er.keepIsSubmitted?rt.isSubmitted:!1,dirtyFields:xr?{}:er.keepDirtyValues?er.keepDefaultValues&&ot?getDirtyFields(st,ot):rt.dirtyFields:er.keepDefaultValues&&qt?getDirtyFields(st,qt):er.keepDirty?rt.dirtyFields:{},touchedFields:er.keepTouched?rt.touchedFields:{},errors:er.keepErrors?rt.errors:{},isSubmitSuccessful:er.keepIsSubmitSuccessful?rt.isSubmitSuccessful:!1,isSubmitting:!1})},Ur=(qt,er)=>Cr(isFunction(qt)?qt(ot):qt,er);return{control:{register:vr,unregister:ur,getFieldState:Zt,handleSubmit:hr,setError:rr,_executeSchema:jt,_getWatch:Nt,_getDirty:Ht,_updateValid:Et,_removeUnmounted:Ft,_updateFieldArray:St,_updateDisabledField:mr,_getFieldArray:Lt,_reset:Cr,_resetDefaultValues:()=>isFunction(et.defaultValues)&&et.defaultValues().then(qt=>{Ur(qt,et.resetOptions),ht.state.next({isLoading:!1})}),_updateFormState:qt=>{rt={...rt,...qt}},_disableForm:br,_subjects:ht,_proxyFormState:dt,_setErrors:Rt,get _fields(){return nt},get _formValues(){return ot},get _state(){return at},set _state(qt){at=qt},get _defaultValues(){return st},get _names(){return lt},set _names(qt){lt=qt},get _formState(){return rt},set _formState(qt){rt=qt},get _options(){return et},set _options(qt){et={...et,...qt}}},trigger:Bt,register:vr,handleSubmit:hr,watch:cr,setValue:Gt,getValues:Yt,reset:Ur,resetField:Ar,clearErrors:Xt,unregister:ur,setError:rr,setFocus:(qt,er={})=>{const nr=get$1(nt,qt),yr=nr&&nr._f;if(yr){const xr=yr.refs?yr.refs[0]:yr.ref;xr.focus&&(xr.focus(),er.shouldSelect&&isFunction(xr.select)&&xr.select())}},getFieldState:Zt}}function useForm(tt={}){const et=React$4.useRef(void 0),rt=React$4.useRef(void 0),[nt,st]=React$4.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:tt.errors||{},disabled:tt.disabled||!1,defaultValues:isFunction(tt.defaultValues)?void 0:tt.defaultValues});et.current||(et.current={...createFormControl(tt),formState:nt});const ot=et.current.control;return ot._options=tt,useSubscribe({subject:ot._subjects.state,next:at=>{shouldRenderFormState(at,ot._proxyFormState,ot._updateFormState,!0)&&st({...ot._formState})}}),React$4.useEffect(()=>ot._disableForm(tt.disabled),[ot,tt.disabled]),React$4.useEffect(()=>{if(ot._proxyFormState.isDirty){const at=ot._getDirty();at!==nt.isDirty&&ot._subjects.state.next({isDirty:at})}},[ot,nt.isDirty]),React$4.useEffect(()=>{tt.values&&!deepEqual(tt.values,rt.current)?(ot._reset(tt.values,ot._options.resetOptions),rt.current=tt.values,st(at=>({...at}))):ot._resetDefaultValues()},[tt.values,ot]),React$4.useEffect(()=>{tt.errors&&ot._setErrors(tt.errors)},[tt.errors,ot]),React$4.useEffect(()=>{ot._state.mount||(ot._updateValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),React$4.useEffect(()=>{tt.shouldUnregister&&ot._subjects.values.next({values:ot._getWatch()})},[tt.shouldUnregister,ot]),et.current.formState=getProxyFormState(nt,ot),et.current}const useActivitiesOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.activityType.classroomActivity",label:tt("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:tt("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:tt("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:tt("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:tt("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:tt("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:tt("bpr.activityType.courseElement")},{value:"bpr.other",label:tt("bpr.other")}]},ActivitiesDropdown=({control:tt,selectedActivities:et,selectActivities:rt})=>{const nt=useActivitiesOptions(),{t:st}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"activityType",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:st("bpr.form.publication.type"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:nt.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})},ageOptions=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],AgeSelect=({name:tt,control:et,placeholderOption:rt,validate:nt})=>jsxRuntimeExports.jsx(Controller,{name:tt,control:et,rules:{required:!0,validate:nt},render:({field:{onChange:st}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:st,options:ageOptions,"aria-required":!0,placeholderOption:rt})}),useLanguageOptions=()=>{const{t:tt}=useTranslation();return[{value:"de_DE",label:tt("de_DE")},{value:"en_EN",label:tt("en_EN")},{value:"ar_DZ",label:tt("ar_DZ")},{value:"es_ES",label:tt("es_ES")},{value:"fr_FR",label:tt("fr_FR")},{value:"it_IT",label:tt("it_IT")},{value:"ja_JP",label:tt("ja_JP")},{value:"zh_CN",label:tt("zh_CN")},{value:"pt_PT",label:tt("pt_PT")},{value:"ru_RU",label:tt("ru_RU")},{value:"bpr.other",label:tt("bpr.other")}]},defaultSelectLanguageOption="bpr.form.publication.language",LangSelect=({control:tt})=>{const et=useLanguageOptions();return jsxRuntimeExports.jsx("div",{className:"col",children:jsxRuntimeExports.jsx(Controller,{name:"language",control:tt,rules:{required:!0},render:({field:{onChange:rt}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:rt,options:et,"aria-required":!0,placeholderOption:defaultSelectLanguageOption})})})},creativeCommons="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAYCAYAAACsnTAAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAubSURBVHgB7Vh3UNVnFj2P/kAQURGNsa2GKKIOCjGzIEUhqElsY40m9lgiGksmWUfjTNZel8ggblSIxjUxujbEiiiwoiiixoqVJtKkCQg82O9c9r0AeaiTP3ZmZ3NnmAHed9/v+84999zz/TRvvvnmlo6dO04xMTExw/95VLyoyEm6lDRW4+XjpZszP8gE/4XQ6XQoeFYAXbVO/m7atCksLS1fK7eqqgqFhYXyHaYmprCzs4O5hflr5VZUVKCosAjVNdUw0ZjArqkdLCwsjO7voxHjtpsphpigpgbQaIwuys3JxS/J13H9+i/qQM/k/81bNEdXl27o5dZLftcYya0bZWVluJ58DSeOnUBxYTHMzMxlg9bWWri/4wHfAb6wtLJsNPda8lVEHY5C6fMymJubyyFtmlgjcHAg3Pr0hoWlhdHc8vJynI8/j7iYWJSXlssZK6sqpBg+/X3k2XVzeY7q6moTMw00RgEpLi7GrohduBCfoDZTClNTU3To0EEqdvvmbcSqB9k3s4enjxfGfDTGKPKyMXWoiL+Hq4Ndw7Rp0zBgwAA0a9YMz58/R0JCAtavX4/LiZcQtGAubO1s6+WWqD2EBociMz0T8+bNg4eHhzCkqKgIZ8+exYYNGxB7NhYzg2ahSZMm9XLJqg2r1uNZ3jMsWrQI7u7usLW1RUFBAY4fP46wsDBcTbqK6Z99qopkZgCFYVJj5CCpjx5j9TerEBt9Dp5/9sShQ4cEpHv37uHRo0dyoH379sG1uyuO/PMwVny9XOhpLMK/i0Budi4OHjyIFStWoHPnzti6dStatmyJhQsXIjExEVYWVli/cp0CsNyQR4YQEF2lDjExMbK2X79+yMrKgpubG5YsWSK5leWVCAvZgsrKSkMuW/Tb9cFwsHfAjRs3MH/+fHh6eqJHjx7w8fHBypUrER0djccPH2NrSJgwr26YoAFJnpeUIGRTCDLSMrBlyxYcOHAAH3zwAbRarWGNlZUVhg8fjmPHjmHVqlXIzMjExjUbUKiqUDcSExJx6UIiQkJC8O6778r/0tPTcebMGQGY0bZtW+zatQu6Kp2wTx8xp84oBl3G4sWL0aZNG2nlU6dOYe7cuYiKikJOTo4AvGPHDuRk5SL+XLwhN/5cHFAN7N69W1jJ9X379kWnTp0EWD7f1dUVP/74I5IvJyPlTkoDUOpQpUZpS/h34cjLzcOaNWswefLkemA0DGtra3z++eey8ZS7KTh+9IThM7bZ8aPHMHToUKkSqUnqEgACQebcvn1b1vJwZALXcw9lpWWiBS1atMCcOXMwduxYqfaHH34oB1u+fDlu3rwpub169cJH48bhRNQJ6oGwLfpktKxv166dMGXKlCmyV7bvixcvMGbMGFy+fFlaaurUqTgeeaw+KHWJ8uDefanW4MGDBZBXCSiDWsKNe/fzxsF9B5CV+UT+Tx3KSM/AyJEjDWtJ/dDQUJw+fRo7d+6UVtQHaZ39NBs52Tl4pgSdwOzdu1d6v0Sxd/PmzTKpRo8eLXri5eVlyCVYZHhxUTGys7NhrbWWAzOCg4ORl5cne2Txtm3bJsCQYQxvb29kPckSDTKAoicKUT594rSIDpPZIlTvPXv2yN/ff/+9bI4MOHr0KJYuXSobZTtws+xxUjzubJzh+9gSZMHrBIXS3t5etKFCbZoMZtu8//77AiL1IzAwUJhJdvCwmZmZkss9c0xT96h3LCaZwfj4448xadIkAZ1B9pH9+oI4OjrKEFEe5VdQZByrHwLwWAkse00/ZUi76dOnq3F83QDCunXrMGHCBCQnJ4vmfPXVVyKKzs7OUEYQ9xXbKitqRc/UzBSpqamGh3EU8mCMrl27omPHjobPSktLZaqQeZaqIHQKBXU0qmfPnti4caOA4+DgIBOFgsu2416ojQRWq7WSFtQLL5/JXD3rWVjut1WrVvJ3fn6+nJXAMk9A1j9Ub6ycuzgLchQyiiwrRUF68OCBbMbFxUUqRWqnpaX9ZyNaUXAnJycUFBUoL1Ap8/+Ntm+IdgQEBMgzWrduLfSnQJO2BFIfnAZkJ30P6W1hZSEA9OnTR1jH0c2Jx5wnT57gk08+EfHmWOY0c3RyrDVl6rlFJUUy7rt06SJF+eKLL3D37l0MGzYMmzZtkvONUzrEOHfuHJo5NENT+6a/MkUQpGlRoFTrqgUx/vCQ/CGFGRQ40pvVJAXZMmwNAsGgqeKhXpTXUp/09fb1xk8//YRbt27hZZGRkSHa4R/oLwwhyN5+PiL2rCT/R7FlG3A8L1u2TD4jkwk6/Yd/YICs43M9+npg7dq1yM3Nhb+/P4KCgoTVLAQnD/PZTpyA1Dg/fz/J/Y1PMVOHamLXRASHleIoI8VPnjwpFZoxY4agTLQpdJwirMDMmTOFjmw/boKGjgAxvHz7oVOXP8nmySoGgSXT9GDy0F9++SUKiwoRMOg9A1Ce/TyhtdFiyJAhAhpbk3uYNWuWVJmspZ4RKIcWDnBzdzPkDhk+FCXPSzB79mwpIqcV2cXicB8U3ZSUFAGa+3Nz712vSKYdOrRf5tHXXZC6oaw8NYGL2XO9e/fG+fPnBRj9SKMjvXPnjrTW06dPpQqk6cOHD7F69Wq49OiOPu/0MTzgbZe3kaTGX/DfggUssovA8pAUUOpTxpMMzJgzE46tHA15ZuZm6K02Gxsbh3/8sBu1t5EamSo8IKcXXW6VrgrTZk8XM6gPtpBzN2ccPRKFiPAIKQTZb2NjI0By8rCgNrY2mDl3lkGU+f0/7/k5WaMoXjN73mxpIRqm0G9D5XAUMgYZwBHZvHlzg5WnMLHC+gsdRY3rORG+/uvX6ObqUg95jueLCRcReShSOdQqsfNyQVNa4ePvi/4B/cW+GwtWOl5NtDNqb3yOnW2tzTc1N4Vvfz+hvtbauJfKz8tHgvI79DCcTgSF4k0GvjcoEJ7envWuJ9zPmKGjwzU+fj41swgKasV28aK/ID83H3FxcSKqrxN0mqx4y1YtseSbpY2u4/dnqSpXVlDtTeHUprXh3vGqoL7Rx1QpUCmUTm2cDG36ylw1bulfmMubtVNrJ/mOhkGmjB4yKtyMc/3h/YcyPrl44tRJWLtyjThRili3bt1e+sCkpCQxejzw+InjhVlPs54K6i+LSsW2tNQ0/J5gy6SnpeP3BMFNfZxq9DP9SNYotGuInij8+LEYoCbA2egY7I7YLa1BpR40aJBYc65hEAAKFo0dL1ca5Ys//WyGaECEuibEqPz/1VCtHs4ZZLj90HMELZyLHr16qNcDt7AtbBuys7JlHFNM9eOZs//atWti29u1b4dJn07GW85vCRhbN4cJaHWDk4KiTcrSL1A/KMwcge3btxdz2BizWAyOeq7nd9CocXoxj1OQbdFYMM/X11d+56WQRfXz8xNv0vBmXCfC2VjL9H9xYXJSsjhN156uIkQEghtKOJ+Aixcv4tKlS8IS567OGDZyGMZPmiDKH6WUfteOnfWu8Pqg4aKv4NQis2gM2XLcICl75cqVxjYot3Hesukv6GiZS/2ipeeo379/f6O5vOzxMspJR0Dorw4fPixg1nXaDSL5NyrHS9W6lWsxcuwoBAwMEK/BHwZf+vCtmZWy0vooLChE5MEjOKJ+OJUaC7Zi9+7dBVD6HmoW/dD27dvxquA9hXceBl0sc+Lj42Usvyyod3ztwQshR/GCBQvEAY8aNUry9RrSMIxKPzf7g3rrFn3ytALEC93VfYg2mKNPpz7ja8kc9ZoyUY3ZhH9dMLymfFmw1SIjI2s1SLUNPcqz18hjcLrxBRFtAa8brD4vcjzwxIkTG83j3YgFYAuSNWw7ehbm8sqhv1A2jHqa0liwyvQWWnUl11VXoUy9K6VXaKgdjQU1ZeDAgQZ/QzPIDdIz1H19YCzILgafxxdFvKGPGDFCWoKu+mX5fJ/C1wrUFl4POP55J2Lb0t3SBBoJJbQaTanikRZ/hITSntB/Awop/YGn+Be4AAAAAElFTkSuQmCC",PublishModalFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("ul",{className:"mb-12",children:[jsxRuntimeExports.jsxs("li",{children:[tt("bpr.form.publication.licence.text.1"),jsxRuntimeExports.jsx("img",{className:"ms-8 d-inline-block",src:creativeCommons,alt:"licence creative commons"})]}),jsxRuntimeExports.jsx("li",{children:tt("bpr.form.publication.licence.text.2")})]}),jsxRuntimeExports.jsx(Alert,{type:"info",className:"mb-12",children:tt("bpr.form.publication.licence.text.3")}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:tt("bpr.form.publication.licence.text.4")})]})},useSubjectsOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.subjectArea.artActivity",label:tt("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:tt("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:tt("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:tt("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:tt("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:tt("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:tt("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:tt("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:tt("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:tt("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:tt("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:tt("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:tt("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:tt("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:tt("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:tt("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:tt("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:tt("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:tt("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:tt("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:tt("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:tt("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:tt("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:tt("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:tt("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:tt("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:tt("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:tt("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:tt("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:tt("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:tt("bpr.subjectArea.technology")},{value:"bpr.subjectArea.Arabic",label:tt("bpr.subjectArea.Arabic")},{value:"bpr.subjectArea.Chinese",label:tt("bpr.subjectArea.Chinese")},{value:"bpr.subjectArea.NaturalSciences",label:tt("bpr.subjectArea.NaturalSciences")},{value:"bpr.subjectArea.SocioEmotionalEducation",label:tt("bpr.subjectArea.SocioEmotionalEducation")},{value:"bpr.other",label:tt("bpr.other")}]},SubjectsDropdown=({control:tt,selectedSubjectAreas:et,selectSubjects:rt})=>{const nt=useSubjectsOptions(),{t:st}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"subjectArea",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:st("bpr.form.publication.discipline"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:nt.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})};function ToastError({formData:tt,errorMessage:et}){const{t:rt}=useTranslation(),nt=st=>st==null?void 0:st.match(/^\s/);return et==="CONTENT_TOO_LARGE"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content_too_large")})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content")})}),jsxRuntimeExports.jsxs("ul",{children:[nt(tt==null?void 0:tt.title)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.title")})}),nt(tt==null?void 0:tt.description)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.description")})})]})]})}function ToastSuccess({result:tt}){const{t:et}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:et("bpr.form.publication.response.success.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.1")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.2")}),tt.details.front_url&&jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("a",{className:"button right-magnet",href:tt.details.front_url,target:"_blank",rel:"noreferrer",children:et("bpr.form.publication.response.success.button")})})]})}function usePublishModal({onSuccess:tt,resource:et}){const{user:rt,appCode:nt}=useEdificeClient(),st=useToast(),[ot,at]=reactExports.useState((et==null?void 0:et.thumbnail)||"");reactExports.useEffect(()=>{at(et==null?void 0:et.thumbnail)},[et]);const{control:lt,register:ut,watch:ct,setValue:dt,handleSubmit:ht,formState:{errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt}}=useForm({mode:"onChange"}),[Et,bt]=reactExports.useState([]),[St,wt]=reactExports.useState([]),Rt=(Ct,Pt,It)=>{let jt=[...Pt];const Dt=jt.findIndex(Vt=>Vt===Ct);Pt.includes(Ct)?jt=Pt.filter((Vt,Ft)=>Ft!==Dt):jt=[...Pt,Ct],It(jt)};return{control:lt,cover:ot,formState:{errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt},handleDeleteImage:()=>at(""),handlePublish:async Ct=>{const Pt=rt?rt==null?void 0:rt.userId:"";try{let It=new Blob;typeof ot=="string"?It=await odeServices.http().get(ot,{responseType:"blob"}):ot?It=await odeServices.http().get(URL.createObjectURL(ot),{responseType:"blob"}):et!=null&&et.thumbnail&&(It=await odeServices.http().get(et==null?void 0:et.thumbnail,{responseType:"blob"}));const jt=await odeServices.http().get(`/userbook/avatar/${Pt}?thumbnail=48x48`,{responseType:"blob"}),Dt=await odeServices.http().get(`/directory/user/${Pt}/attachment-school`,{responseType:"json"}),Vt=e$3[nt],Ft={activityType:Et,age:[Ct.ageMin,Ct.ageMax],application:Vt,cover:It,description:Ct.description,keyWords:Ct.keyWords,language:Ct.language,licence:"CC-BY",resourceId:et==null?void 0:et.assetId,resourceEntId:et==null?void 0:et.assetId,subjectArea:St,teacherAvatar:jt,title:Ct.title,userId:Pt,userStructureName:Dt.name||(rt==null?void 0:rt.structureNames[0])},Ht=await odeServices.resource(nt).publish(Ft);Ht.success?st.success(jsxRuntimeExports.jsx(ToastSuccess,{result:Ht}),{duration:1e4}):Ht.message==="CONTENT_TOO_LARGE"?st.error(jsxRuntimeExports.jsx(ToastError,{errorMessage:Ht.message})):st.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct})),tt==null||tt()}catch(It){console.error(It),st.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct}))}},handleSubmit:ht,handleUploadImage:Ct=>at(Ct),register:ut,selectActivities:Ct=>{Rt(Ct,Et,bt)},selectedActivities:Et,selectedSubjectAreas:St,selectSubjects:Ct=>{Rt(Ct,St,wt)},setValue:dt,watch:ct}}const SvgIconDelete=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.461 3.689a.96.96 0 0 1 .675-.28h3.819a.955.955 0 0 1 .954.955v.954H9.182v-.954c0-.254.1-.496.28-.675m7.357.675v.954h3.818a.955.955 0 0 1 0 1.91h-.954v12.408a2.864 2.864 0 0 1-2.864 2.864H7.273a2.864 2.864 0 0 1-2.864-2.864V7.227h-.954a.955.955 0 1 1 0-1.909h3.818v-.954A2.864 2.864 0 0 1 10.136 1.5h3.819a2.864 2.864 0 0 1 2.863 2.864m-10.5 2.863v12.41a.954.954 0 0 0 .955.954h9.545a.955.955 0 0 0 .955-.955V7.227zm3.818 2.864c.528 0 .955.427.955.955v5.727a.955.955 0 1 1-1.91 0v-5.727c0-.528.428-.955.955-.955m4.773 6.682v-5.727a.955.955 0 0 0-1.909 0v5.727a.955.955 0 1 0 1.91 0",clipRule:"evenodd"})]}),SvgIconEdit=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.879 3.879A3 3 0 0 1 4 3h7a1 1 0 1 1 0 2H4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7a1 1 0 1 1 2 0v7a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V6a3 3 0 0 1 .879-2.121",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 2.879c-.297 0-.583.118-.793.328l-9.304 9.304-.529 2.115 2.115-.529 9.304-9.304A1.121 1.121 0 0 0 20 2.879m-2.207-1.086a3.121 3.121 0 0 1 4.414 4.414l-9.5 9.5a1 1 0 0 1-.464.263l-4 1a1 1 0 0 1-1.213-1.212l1-4a1 1 0 0 1 .263-.465z",clipRule:"evenodd"})]}),ImagePicker=({addButtonLabel:tt="Add image",deleteButtonLabel:et="Delete image",src:rt,className:nt,mediaLibraryRef:st,libraryMedia:ot,app:at,onUploadImage:lt,onDeleteImage:ut})=>{const[ct,dt]=reactExports.useState(rt||"");reactExports.useEffect(()=>{ot&&(dt(ot),lt(ot))},[ot]);const ht=()=>{var yt;(yt=st.current)==null||yt.show("image")},mt=()=>{dt(""),ut()},xt=clsx("image-input",nt);return jsxRuntimeExports.jsxs("div",{id:"image-input",className:xt,children:[jsxRuntimeExports.jsxs("div",{className:"image-input-actions gap-8",children:[jsxRuntimeExports.jsx(IconButton,{"aria-label":tt,color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconEdit,{}),onClick:ht,type:"button",variant:"ghost"}),jsxRuntimeExports.jsx(IconButton,{"aria-label":et,color:"danger",disabled:!ct,icon:jsxRuntimeExports.jsx(SvgIconDelete,{}),onClick:mt,type:"button",variant:"ghost"})]}),ct?jsxRuntimeExports.jsx(Avatar,{alt:"",src:ct,size:"xl"}):jsxRuntimeExports.jsx(AppIcon,{app:at,iconFit:"ratio",size:"160",variant:"rounded"})]})},useResource=(tt,et)=>{const[rt,nt]=reactExports.useState(null);return reactExports.useEffect(()=>{if(et===""){console.warn("resourceId must be an assetId and not an empty string");return}(async()=>{try{const st=await odeServices.resource(tt).searchResource({application:tt,id:et});nt(st)}catch(st){console.error(st)}})()},[]),rt},SvgIconApplications=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 3c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6zm4 0c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zm-8 12c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zM1 15c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6z",clipRule:"evenodd"})]}),SvgIconCode=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M17.327 5.76a1 1 0 0 1 1.413.067l5 5.5a1 1 0 0 1 0 1.346l-5 5.5a1 1 0 1 1-1.48-1.346L21.648 12 17.26 7.173a1 1 0 0 1 .067-1.413M6.673 5.76a1 1 0 0 1 .067 1.413L2.35 12l4.389 4.827a1 1 0 0 1-1.48 1.346l-5-5.5a1 1 0 0 1 0-1.346l5-5.5a1 1 0 0 1 1.413-.067M8.979 21.609a1 1 0 0 1-.658-1.252l5.375-17.29a1 1 0 1 1 1.91.594L10.23 20.95a1 1 0 0 1-1.251.658",clipRule:"evenodd"})]}),SvgIconGlobe=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.726 3.29A9.01 9.01 0 0 0 3.055 11H7.05a16.3 16.3 0 0 1 2.676-7.71m4.548 0A16.3 16.3 0 0 1 16.95 11h3.995a9.01 9.01 0 0 0-6.67-7.71m.668 7.71A14.3 14.3 0 0 0 12 3.55 14.3 14.3 0 0 0 9.058 11zm-5.884 2h5.884A14.3 14.3 0 0 1 12 20.45 14.3 14.3 0 0 1 9.058 13M7.05 13H3.055a9.01 9.01 0 0 0 6.67 7.71A16.3 16.3 0 0 1 7.05 13m7.224 7.71A16.3 16.3 0 0 0 16.95 13h3.995a9.01 9.01 0 0 1-6.67 7.71M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11",clipRule:"evenodd"})]}),SvgIconMic=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 .5a4.07 4.07 0 0 0-2.812 1.115A3.8 3.8 0 0 0 8 4.364V12a3.8 3.8 0 0 0 1.188 2.748A4.07 4.07 0 0 0 12 15.864a4.07 4.07 0 0 0 2.812-1.116A3.8 3.8 0 0 0 16 12V4.364a3.8 3.8 0 0 0-1.188-2.749A4.07 4.07 0 0 0 12 .5m-1.43 2.562A2.07 2.07 0 0 1 12 2.5c.545 0 1.059.207 1.43.562.371.354.57.823.57 1.302V12a1.8 1.8 0 0 1-.57 1.302 2.07 2.07 0 0 1-1.43.562 2.07 2.07 0 0 1-1.43-.562A1.8 1.8 0 0 1 10 12V4.364a1.8 1.8 0 0 1 .57-1.302M6 10.091a1 1 0 0 0-2 0V12c0 2.053.855 4.011 2.36 5.448A8.13 8.13 0 0 0 11 19.622V21.5H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-1.878a8.13 8.13 0 0 0 4.64-2.174C19.145 16.011 20 14.053 20 12v-1.91a1 1 0 0 0-2 0V12c0 1.491-.62 2.932-1.74 4.001s-2.646 1.678-4.248 1.68h-.024c-1.602-.002-3.128-.611-4.247-1.68C6.62 14.931 6 13.491 6 12z",clipRule:"evenodd"})]}),SvgIconRecordVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-1.936l4.409 1.365A2 2 0 0 0 24 15.519V8.48a2 2 0 0 0-2.591-1.91l-4.41 1.364V6a2 2 0 0 0-2-2zm0 2h13v12H2zm15 7.97V10.03l5-1.548v7.037z",clipRule:"evenodd"})]}),SvgIconSmartphone=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM4 4a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 18a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1",clipRule:"evenodd"})]}),MediaLibraryContext=reactExports.createContext(null);function useMediaLibraryContext(){const tt=reactExports.useContext(MediaLibraryContext);if(!tt)throw new Error("Innertabs compound components cannot be rendered outside the MediaLibrary component");return tt}const SvgIconPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3zm10-2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3z",clipRule:"evenodd"})]}),SvgIconRecord=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("circle",{cx:12,cy:12,r:11,fill:"currentColor"})]}),AudioRecorderTimer=({recordState:tt,playState:et,recordTime:rt,audioTime:nt,maxDuration:st})=>jsxRuntimeExports.jsxs("div",{className:"audio-recorder-time my-16 mx-auto",children:[et==="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center",children:[tt==="PAUSED"?jsxRuntimeExports.jsx(SvgIconPause,{width:12,height:12,className:"me-8 text-danger"}):jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,className:"me-8 text-danger"}),n$3(tt!=="IDLE"?rt:0)+" / "+n$3(st)]}),et!=="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mx-auto",children:[jsxRuntimeExports.jsx(SvgIconMic,{width:12,height:12,className:"me-8"}),n$3(nt*1e3)," /",n$3(rt)]})]}),SvgIconPlayFilled=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M5 3.804c0-1.57 1.728-2.528 3.06-1.696l13.113 8.196a2 2 0 0 1 0 3.392L8.06 21.892C6.728 22.724 5 21.767 5 20.196z"})]}),SvgIconRecordPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M23 12c0 6.075-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1s11 4.925 11 11M10 6H8a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1m4 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconRefresh=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-refresh_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.304 21c3.015 0 5.65-1.924 6.838-4.752a.986.986 0 0 1 1.297-.53c.503.216.738.803.524 1.311C19.498 20.522 16.19 23 12.304 23c-4.644 0-8.444-3.522-9.299-8.113L1.86 17.142a.99.99 0 0 1-1.33.449 1 1 0 0 1-.417-1.348L2.51 11.52c.135-.265.376-.457.66-.527a.96.96 0 0 1 .812.169L8.1 14.297c.433.33.515.958.185 1.404a.98.98 0 0 1-1.382.212L4.93 14.41c.65 3.785 3.744 6.59 7.374 6.59m4.794-12.913a.98.98 0 0 0-1.381.211 1.01 1.01 0 0 0 .184 1.405l4.117 3.135a.96.96 0 0 0 .812.169c.284-.07.525-.262.66-.527l2.398-4.723c.252-.496.065-1.1-.418-1.348a.99.99 0 0 0-1.329.449l-1.145 2.255C20.14 4.522 16.34 1 11.696 1 7.81 1 4.505 3.478 3.037 6.97a1.004 1.004 0 0 0 .525 1.312.986.986 0 0 0 1.297-.53C6.046 4.924 8.681 3 11.697 3c3.63 0 6.724 2.805 7.374 6.59z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-refresh_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconRestart=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M17.919 3.15c1.33-.856 3.081.1 3.081 1.682v14.336c0 1.583-1.75 2.538-3.081 1.683L7 13.83V19a2 2 0 1 1-4 0V5a2 2 0 1 1 4 0v5.168z"})]}),SvgIconSave=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h1v-7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7h1a1 1 0 0 0 1-1V8.414L15.586 4H8v3h7a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1V4zm2-2H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V8a1 1 0 0 0-.293-.707l-5-5A1 1 0 0 0 16 2zm1 12v6h8v-6z",clipRule:"evenodd"})]});function useAudioRecorder(tt,et,rt=!1,nt="protected",st="media-library"){var ot;function at(Xt,rr){return{...Xt,...rr.updatedState}}const[{recordState:lt,playState:ut,micStream:ct,micStreamAudioSourceNode:dt,audioWorkletNode:ht,audioContext:mt,encoderWorker:xt,maxDuration:yt,recordTime:vt,isEncoding:Et},bt]=reactExports.useReducer(at,{recordState:"IDLE",isEncoding:!1,playState:"IDLE",recordTime:0,maxDuration:180}),St=reactExports.useRef(null),wt=reactExports.useRef(null),Rt=reactExports.useRef(),Ct=reactExports.useRef(),{t:Pt}=useTranslation(),{create:It}=useWorkspaceFile(),jt=128,Dt=48e3;reactExports.useEffect(()=>{const Xt=new Worker("/infra/public/js/audioEncoder.js");return bt({type:"update",updatedState:{encoderWorker:Xt}}),Xt.postMessage(["init",(mt==null?void 0:mt.sampleRate)||Dt]),()=>{Ft(),Xt.terminate()}},[]);const Vt=Xt=>{var rr,cr;const ur=Xt.data.inputs[0][0];let mr=Xt.data.inputs[0][1];(!mr||mr.filter(vr=>vr!==void 0).length===0)&&(mr=ur),(rr=Rt.current)==null||rr.push(ur),(cr=Ct.current)==null||cr.push(mr)},Ft=reactExports.useCallback(()=>{ct==null||ct.getTracks().forEach(Xt=>Xt.stop()),dt==null||dt.disconnect(),ht==null||ht.port.removeEventListener("message",Vt),ht==null||ht.port.close(),ht==null||ht.disconnect(),mt==null||mt.close()},[mt,ht,ct,dt]),Ht=async()=>{const Xt=await navigator.mediaDevices.getUserMedia({audio:!0}),rr=new AudioContext({sampleRate:Dt}),cr=rr.createMediaStreamSource(Xt);try{await rr.audioWorklet.addModule("/infra/public/js/audio-recorder-processor.js")}catch(mr){console.error(mr)}const ur=new AudioWorkletNode(rr,"audio-recorder-processor");ur.port.addEventListener("message",Vt),bt({type:"update",updatedState:{micStream:Xt,micStreamAudioSourceNode:cr,audioContext:rr,recordTime:0,audioWorkletNode:ur,recordState:"RECORDING",playState:"IDLE"}}),Ct.current=[],Rt.current=[],ur.port.start(),cr.connect(ur),ur.connect(rr.destination)},Nt=reactExports.useCallback(async()=>{wt.current&&(wt.current.currentTime=0,wt.current.pause()),lt==="PAUSED"?(bt({type:"update",updatedState:{recordState:"RECORDING",playState:"IDLE"}}),mt==null||mt.resume(),et==null||et(void 0)):Ht()},[lt,mt,wt]),Lt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{recordState:"PAUSED",playState:"IDLE",isEncoding:!0}}),mt==null||mt.suspend(),xt&&Rt.current&&Ct.current&&(xt.postMessage(["wav",Ct.current,Rt.current,Ct.current.length*jt]),xt.onmessage=Xt=>{const rr=window.URL.createObjectURL(Xt.data);bt({type:"update",updatedState:{isEncoding:!1}}),wt.current&&(wt.current.src=rr),et&&et(rr)})},[mt,xt,et]),Mt=reactExports.useCallback(()=>{var Xt;bt({type:"update",updatedState:{playState:"PLAYING"}}),((Xt=wt==null?void 0:wt.current)!=null&&Xt.currentTime||wt.current)&&wt.current.play()},[wt]),zt=reactExports.useCallback(()=>{var Xt;(Xt=wt==null?void 0:wt.current)==null||Xt.pause(),bt({type:"update",updatedState:{playState:"PAUSED"}})},[wt]),Gt=reactExports.useCallback(()=>{Ft(),bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),Ct.current=[],Rt.current=[],et&&et(void 0)},[Ft,et]),$t=reactExports.useCallback(async()=>{var Xt;const rr=(Xt=St.current)==null?void 0:Xt.value;if(!rr){console.error("Audio name is required");return}return wt.current&&(wt.current.pause(),wt.current.currentTime=0),bt({type:"update",updatedState:{recordState:"SAVING",playState:"IDLE"}}),new Promise((cr,ur)=>{try{xt&&Rt.current&&Ct.current&&(xt.postMessage(["mp3",Ct.current,Rt.current,Ct.current.length*jt]),xt.onmessage=async mr=>{if(mr.data instanceof Blob){const vr=new File([mr.data],rr,{type:"audio/mp3"}),Er=await It(vr,{application:st,visibility:nt});Er&&tt&&tt(Er),bt({type:"update",updatedState:{recordState:"SAVED"}}),cr(Er)}})}catch(mr){bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),console.error("Error while saving",mr),ur()}})},[lt,tt,Ft]),Ut=reactExports.useCallback(()=>{wt!=null&&wt.current&&(wt.current.pause(),wt.current.currentTime=0),bt({type:"update",updatedState:{playState:"IDLE"}})},[wt]),Bt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{playState:"PAUSED"}}),wt.current&&(wt.current.currentTime=0)},[wt]);reactExports.useEffect(()=>{if(lt==="RECORDING"&&mt){const Xt=window.setInterval(()=>{bt({type:"update",updatedState:{recordTime:mt.currentTime}}),mt.currentTime>=yt&&(Lt(),window.clearInterval(Xt))},100);return()=>window.clearInterval(Xt)}},[mt,Lt,yt,lt]);const Yt=Pt(lt==="IDLE"?"bbm.audio.record.start":"bbm.audio.record.resume"),Zt=[{type:"icon",name:"record",visibility:lt==="RECORDING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{}),color:"danger",disabled:lt!=="IDLE"&&lt!=="PAUSED"||vt>=yt,onClick:Nt,"aria-label":Yt},tooltip:Yt},{type:"icon",name:"recordPause",visibility:lt==="RECORDING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordPause,{}),color:"danger",disabled:lt!=="RECORDING",onClick:Lt,"aria-label":Pt("bbm.audio.record.pause")},tooltip:Pt("bbm.audio.record.pause")},{type:"divider"},{type:"icon",name:"encoding",visibility:Et?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconLoader,{style:{animation:"loading 1s infinite"}}),disabled:!0}},{type:"icon",name:"play",visibility:Et||ut==="PLAYING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:lt!=="RECORDED"&&lt!=="PAUSED"&&lt!=="SAVED",onClick:Mt,"aria-label":Pt("bbm.audio.play.start")},tooltip:Pt("bbm.audio.play.start")},{type:"icon",name:"playPause",visibility:!Et&&ut==="PLAYING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),onClick:zt,"aria-label":Pt("bbm.audio.play.pause")},tooltip:Pt("bbm.audio.play.pause")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRestart,{}),disabled:ut!=="PLAYING"&&ut!=="PAUSED",onClick:Ut,"aria-label":Pt("bbm.audio.play.stop")},tooltip:Pt("bbm.audio.play.stop")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:lt!=="RECORDED"&&lt!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED",onClick:Gt,"aria-label":Pt("bbm.audio.record.reset")},tooltip:Pt("bbm.audio.record.reset")},{type:"icon",name:"save",visibility:rt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:lt!=="RECORDED"&&lt!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED"||lt==="SAVED"||!((ot=St.current)!=null&&ot.value),onClick:$t,"aria-label":Pt("bbm.audio.record.save")},tooltip:Pt("bbm.audio.record.save")}];return{recordState:lt,playState:ut,audioContext:mt,recordTime:vt*1e3,maxDuration:yt*1e3,audioRef:wt,audioNameRef:St,toolbarItems:Zt,handlePlayEnded:Bt,handleSave:$t}}const AudioRecorder=reactExports.forwardRef(({onSaveSuccess:tt,onRecordUpdated:et,hideSaveAction:rt=!1,visibility:nt="protected"},st)=>{const{recordState:ot,playState:at,recordTime:lt,audioRef:ut,audioNameRef:ct,toolbarItems:dt,maxDuration:ht,handlePlayEnded:mt,handleSave:xt}=useAudioRecorder(tt,et,rt,nt,"media-library"),{t:yt}=useTranslation();reactExports.useImperativeHandle(st,()=>({save:xt}));const[vt,Et]=reactExports.useState(0),bt=clsx({"text-danger":ot==="RECORDING","text-success":at==="PLAYING"}),St=wt=>{Et(wt.target.currentTime)};return jsxRuntimeExports.jsxs("div",{className:"audio-recorder m-auto d-flex flex-column",children:[jsxRuntimeExports.jsx(FormControl,{id:"recordName",className:"mb-32",isRequired:!0,isReadOnly:ot==="SAVED"||ot==="SAVING",children:jsxRuntimeExports.jsx(Input,{type:"text",size:"sm",placeholder:yt("bbm.audio.recorder.name"),ref:ct,defaultValue:yt("bbm.audio.recorder.defaultName")+new Date().toLocaleDateString()})}),jsxRuntimeExports.jsx("div",{className:"audio-recorder-icon mx-auto",children:jsxRuntimeExports.jsx(SvgIconMic,{width:64,height:64,className:bt})}),jsxRuntimeExports.jsx(AudioRecorderTimer,{recordState:ot,playState:at,recordTime:lt,audioTime:vt,maxDuration:ht}),jsxRuntimeExports.jsx("audio",{ref:ut,onEnded:mt,onTimeUpdate:St,children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),jsxRuntimeExports.jsx(Toolbar,{items:dt})]})}),Audio=()=>{const{setResult:tt,setPreSuccess:et,visibility:rt}=useMediaLibraryContext(),nt=reactExports.useRef(null);return jsxRuntimeExports.jsx(AudioRecorder,{ref:nt,onRecordUpdated:st=>{st?(tt(st),et(()=>nt.current.save)):tt()},onSaveSuccess:st=>{st&&tt(st)},hideSaveAction:!0,visibility:rt})},ExternalLinker=({link:tt,onChange:et,multiNodeSelected:rt=!1})=>{const{t:nt}=useTranslation(),[st,ot]=reactExports.useState((tt==null?void 0:tt.text)||""),[at,lt]=reactExports.useState((tt==null?void 0:tt.url)||""),[ut,ct]=useToggle(tt?tt.target==="_blank":!0);return reactExports.useEffect(()=>{rt&&tt!=null&&tt.text&&ot(tt.text.slice(0,20)+"...")},[rt,tt]),reactExports.useEffect(()=>{if(!at.length){et==null||et();return}const dt={url:at,text:rt?tt==null?void 0:tt.text:st||at,target:ut?"_blank":void 0};!s$3.isLocalURL(at)&&!s$3.startWithHttp(at)&&(dt.url="http://"+at),et==null||et(dt)},[st,at,ut]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-24",children:[jsxRuntimeExports.jsxs(FormControl,{id:"linkText",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:nt("bbm.linker.ext.text")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:nt("bbm.linker.ext.text.placeholder"),size:"md",disabled:rt,value:st,onChange:dt=>ot(dt.target.value)})]}),jsxRuntimeExports.jsxs(FormControl,{id:"linkUrl",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:nt("bbm.linker.ext.url")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:nt("bbm.linker.ext.url.placeholder"),size:"md",value:at,onChange:dt=>lt(dt.target.value)})]}),jsxRuntimeExports.jsx(Checkbox,{label:nt("bbm.linker.open.tab"),onChange:()=>ct(),checked:ut})]})})},ExternalLink=({link:tt,multiNodeSelected:et=!1})=>{const{setResult:rt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(ExternalLinker,{link:tt,onChange:nt=>{rt(nt)},multiNodeSelected:et})},Embed=({onSuccess:tt})=>{const{t:et}=useTranslation(),[rt,nt]=reactExports.useState();function st(ot){const at=ot.target.value;nt(at),at!=null&&at.length?tt(at):tt()}return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill",children:[jsxRuntimeExports.jsx("div",{className:"mb-32",children:et("bbm.embed.description")}),jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconCode,{className:"me-8"}),et("bbm.embed.title")]}),jsxRuntimeExports.jsx(FormControl,{id:"iframeContent",children:jsxRuntimeExports.jsx(TextArea,{size:"md",height:"sm",placeholder:et("bbm.embed.placeholder"),onChange:st})}),!!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12",dangerouslySetInnerHTML:{__html:rt}}),!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12 d-flex align-items-center justify-content-center bg-gray-300 text-black-50 rounded-3",children:jsxRuntimeExports.jsx("strong",{children:et("bbm.embed.preview")})})]})},Iframe=()=>{const{setResult:tt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(Embed,{onSuccess:et=>{et=et==null?void 0:et.replace(/<p /g,"<div ").replace(/\/p>/g,"/div>"),tt(et)}})},SvgIconUsers=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-users_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M19.055 12.803a1 1 0 0 1 1.272-.618c1.128.39 2.061 1.247 2.7 2.351.64 1.106.972 2.435.973 3.782V21a1 1 0 1 1-2 0v-2.681c0-1.03-.258-2.009-.704-2.782-.448-.773-1.034-1.258-1.623-1.462a1 1 0 0 1-.618-1.272M15.187 1.384a1 1 0 0 1 1.036-.962 5.129 5.129 0 0 1 2.11 9.71 1 1 0 1 1-.896-1.788 3.129 3.129 0 0 0-1.288-5.924 1 1 0 0 1-.962-1.036M1.505 15.694C2.481 14.622 3.825 14 5.25 14h8.5c1.424 0 2.769.622 3.744 1.694.974 1.068 1.506 2.498 1.506 3.973V22a1 1 0 1 1-2 0v-2.333c0-1.001-.363-1.945-.984-2.627-.618-.679-1.436-1.04-2.266-1.04h-8.5c-.83 0-1.648.361-2.266 1.04-.621.682-.984 1.626-.984 2.627V22a1 1 0 1 1-2 0v-2.333c0-1.475.533-2.905 1.505-3.974M9.5 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M4 6.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-users_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),LinkerCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:nt=!1,onClick:st,className:ot})=>{const{fromNow:at}=useDate(),{fromDate:lt}=reactExports.useMemo(()=>({fromDate:at(tt.modifiedAt)}),[at,tt]);return jsxRuntimeExports.jsx(Card,{className:clsx("card-linker shadow-none",ot),isClickable:et,isSelectable:rt,isSelected:nt,onClick:st,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{className:"card-image ps-8 pe-4",children:tt.thumbnail&&tt.thumbnail.length>0?jsxRuntimeExports.jsx(Image$1,{alt:"",height:48,width:48,src:tt.thumbnail,objectFit:"cover",className:"rounded h-full",style:{aspectRatio:1/1}}):jsxRuntimeExports.jsx(AppIcon,{app:tt.application,iconFit:"ratio",size:"48",variant:"rounded"})}),jsxRuntimeExports.jsxs("div",{className:"w-75",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.creatorName})]}),jsxRuntimeExports.jsx("div",{className:"d-none d-md-block text-black-50 ps-4 pe-8",children:jsxRuntimeExports.jsx(Card.Text,{children:lt})}),tt.shared&&jsxRuntimeExports.jsx("div",{className:"ps-4 pe-8",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:"20",height:"20"})})]})})},illuOneBlog="/assets/js/ode-explorer/illu-empty-search-blog.svg",illuOneCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall.svg",illuOneCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149764)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_149764)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149764'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149764'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149764'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149764'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148725)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_148725)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148725'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148725'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148725'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148725'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire.svg",illuOneForum="/assets/js/ode-explorer/illu-empty-search-forum.svg",illuOneHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks.svg",illuOneMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149757)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23F1CA00'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23F1CA00'/%3e%3cg%20filter='url(%23filter0_d_3597_149757)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149757'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149757'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149757'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149757'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneWiki="/assets/js/ode-explorer/illu-empty-search-wiki.svg",illuOneEmpty="/assets/js/ode-explorer/illu-empty-search.svg",illuNeoBlog="/assets/js/ode-explorer/illu-empty-search-blog2.svg",illuNeoCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall2.svg",illuNeoCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141038)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_141038)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141038'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141038'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141038'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141038'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148718)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_148718)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148718'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148718'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148718'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148718'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire2.svg",illuNeoForum="/assets/js/ode-explorer/illu-empty-search-forum2.svg",illuNeoHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks2.svg",illuNeoMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141030)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23ECBE30'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23ECBE30'/%3e%3cg%20filter='url(%23filter0_d_3597_141030)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141030'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141030'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141030'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141030'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoWiki="/assets/js/ode-explorer/illu-empty-search-wiki2.svg",illuNeoEmpty="/assets/js/ode-explorer/illu-empty-search2.svg",emptyScreenMapping={one:{blog:illuOneBlog,wiki:illuOneWiki,empty:illuOneEmpty,"collaborative-wall":illuOneCollaborativeWall,community:illuOneCommunity,exercizer:illuOneExercizer,formulaire:illuOneFormulaire,forum:illuOneForum,homeworks:illuOneHomeworks,magneto:illuOneMagneto},neo:{blog:illuNeoBlog,wiki:illuNeoWiki,empty:illuNeoEmpty,"collaborative-wall":illuNeoCollaborativeWall,community:illuNeoCommunity,exercizer:illuNeoExercizer,formulaire:illuNeoFormulaire,forum:illuNeoForum,homeworks:illuNeoHomeworks,magneto:illuNeoMagneto}},InternalLinker=({appCode:tt,defaultAppCode:et,defaultResourceId:rt,onChange:nt,onSelect:st,multiple:ot=!0,resourceList:at,applicationList:lt,showApplicationSelector:ut=!0})=>{const{t:ct}=useTranslation(),{theme:dt}=useEdificeTheme(),{resourceApplications:ht,loadResources:mt}=useResourceSearch(tt),[xt,yt]=reactExports.useState(),[vt,Et]=reactExports.useState(),[bt,St]=reactExports.useState(),wt=useDebounce(bt||"",500),[Rt,Ct]=reactExports.useState([]),Pt=reactExports.useCallback((Gt,$t)=>{var Ut,Bt,Yt;if(!$t)return!0;const Zt=($t==null?void 0:$t.toLowerCase())||"";return((Ut=Gt.name)==null?void 0:Ut.toLowerCase().includes(Zt))||((Bt=Gt.creatorName)==null?void 0:Bt.toLowerCase().includes(Zt))||((Yt=Gt.description)==null?void 0:Yt.toLowerCase().includes(Zt))},[]),It=reactExports.useCallback(Gt=>Gt.sort(($t,Ut)=>$t.modifiedAt<Ut.modifiedAt?1:-1),[]),jt=reactExports.useCallback(Gt=>{async function $t(){if(at){const Ut=at.filter(Bt=>Pt(Bt,Gt));Ct(It(Ut));return}else if(vt)try{const Ut=(await mt({application:vt.application,search:Gt,types:[vt.application],filters:{},pagination:{startIdx:0,pageSize:300}})).filter(Bt=>Pt(Bt,Gt));Ct(It(Ut));return}catch{}Ct([])}$t()},[mt,vt,Pt,It,at]),[Dt,Vt]=reactExports.useState([]),Ft=Gt=>{nt==null||nt(Gt),Et(Gt)},Ht=Gt=>{const $t=Gt.target.value;St($t.toString())},Nt=reactExports.useCallback(Gt=>{jt(bt),Gt.stopPropagation(),Gt.preventDefault()},[jt,bt]),Lt=reactExports.useCallback(Gt=>Dt.findIndex($t=>$t.assetId===Gt),[Dt]),Mt=reactExports.useCallback(Gt=>{Vt(ot?$t=>[...$t,Gt]:[Gt])},[Vt,ot]),zt=reactExports.useCallback(Gt=>{const $t=Lt(Gt.assetId);$t<0?Mt(Gt):Vt(Dt.filter((Ut,Bt)=>Bt!==$t))},[Lt,Mt,Dt]);return reactExports.useEffect(()=>{(async()=>{if(lt){yt(lt.sort((Ut,Bt)=>Ut.displayName.localeCompare(Bt.displayName)));return}const Gt=ht.map(Ut=>odeServices.session().getWebApp(Ut)),$t=await Promise.all(Gt);yt(ht.map((Ut,Bt)=>{var Yt;return{application:Ut,displayName:ct(((Yt=$t[Bt])==null?void 0:Yt.displayName)??Ut),icon:jsxRuntimeExports.jsx(AppIcon,{app:$t[Bt],size:"24"})}}).sort((Ut,Bt)=>Ut.displayName.localeCompare(Bt.displayName)))})()},[ht,ct,lt]),reactExports.useEffect(()=>{jt(wt)},[jt,wt]),reactExports.useEffect(()=>{st==null||st(Dt)},[Dt]),reactExports.useEffect(()=>{var Gt;const $t=et??((lt==null?void 0:lt.length)===1&&((Gt=lt==null?void 0:lt[0])==null?void 0:Gt.application));if($t){const Ut=xt==null?void 0:xt.find(Bt=>$t===Bt.application);Et(Ut),jt("")}},[xt,et]),reactExports.useEffect(()=>{if(rt&&Lt(rt)<0){const Gt=Rt==null?void 0:Rt.find($t=>rt===$t.assetId);Gt&&Mt(Gt)}},[Rt]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"search d-flex bg-light rounded-top border border-bottom-0",children:[ut&&jsxRuntimeExports.jsx("div",{className:"flex-shrink-1 px-8 py-12 border-end",children:jsxRuntimeExports.jsxs(Dropdown,{overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{icon:jsxRuntimeExports.jsx("div",{className:"pe-8",children:(vt==null?void 0:vt.icon)||jsxRuntimeExports.jsx(SvgIconApplications,{})}),label:ct((vt==null?void 0:vt.displayName)||"bbm.linker.int.choose"),variant:"ghost",size:"md"}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:xt==null?void 0:xt.map(Gt=>jsxRuntimeExports.jsx(Dropdown.Item,{icon:Gt.icon,onClick:()=>Ft(Gt),children:Gt.displayName},Gt.application))})]})}),jsxRuntimeExports.jsx("div",{className:"flex-grow-1 align-self-center",children:jsxRuntimeExports.jsx("form",{className:"gap-16 d-flex w-100 align-items-center px-16 py-8",onSubmit:Nt,children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,placeholder:ct("search"),size:"lg",className:"w-100",disabled:!vt,onChange:Ht})})})]}),jsxRuntimeExports.jsxs("div",{className:"internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto",children:[vt&&Rt&&Rt.length>0&&jsxRuntimeExports.jsx("div",{children:Rt.map(Gt=>{const $t=Dt.findIndex(Ut=>Ut.assetId===Gt.assetId)>=0;return jsxRuntimeExports.jsx(LinkerCard,{doc:Gt,isSelected:$t,onClick:()=>zt(Gt)},Gt.path)})}),vt&&Rt&&Rt.length<=0&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-16",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(dt==null?void 0:dt.bootstrapVersion)??"one"][vt==null?void 0:vt.application],text:ct("bbm.linker.int.notfound"),className:"mt-16"})}),!vt&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-32",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(dt==null?void 0:dt.bootstrapVersion)??"one"].empty,text:ct("bbm.linker.int.empty"),className:"mt-32"})})]})]})},InternalLink=({target:tt,resourceId:et,appPrefix:rt})=>{const{t:nt}=useTranslation(),{setResult:st,setResultCounter:ot,appCode:at,multiple:lt}=useMediaLibraryContext(),[ut,ct]=useToggle(tt==="_blank"),[dt,ht]=reactExports.useState([]),mt=xt=>{ht(xt)};return reactExports.useEffect(()=>{st({target:ut?"_blank":void 0,resources:dt}),dt&&dt.length?ot(dt.length):ot(void 0)},[ut,dt]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-16 overflow-hidden",children:[jsxRuntimeExports.jsx(InternalLinker,{appCode:at,defaultAppCode:rt,defaultResourceId:et,onSelect:mt,multiple:lt}),jsxRuntimeExports.jsx(Checkbox,{className:"align-items-center",checked:ut,label:nt("bbm.linker.open.tab"),onChange:ct})]})},SvgIconReset=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.583 7.313 3.976 3.87a.996.996 0 1 0-1.96.346l1.012 5.747a.996.996 0 0 0 1.153.809l5.743-1.014a.997.997 0 0 0-.346-1.962l-3.3.582a7.754 7.754 0 0 1 8.399-4.254 7.76 7.76 0 0 1 .78 15.064 7.745 7.745 0 0 1-8.912-3.56.995.995 0 1 0-1.724.997 9.744 9.744 0 0 0 11.201 4.474 9.74 9.74 0 0 0 5.19-3.718 9.756 9.756 0 0 0-.625-12.055A9.74 9.74 0 0 0 8.73 3.117a9.75 9.75 0 0 0-4.147 4.196",clipRule:"evenodd"})]}),SvgIconWand=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 0a1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 0 2 1 1 0 0 0-1 1 1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 1 1 0 0 0 1-1 1 1 0 0 1 1-1m9.914 2a2 2 0 0 0-2.828 0L1 18.086a2 2 0 0 0 0 2.828L3.086 23a2 2 0 0 0 2.828 0L22 6.914a2 2 0 0 0 0-2.828zm-3.75 3.75L18.5 3.414 20.586 5.5 18.25 7.836zM14.75 7.164 2.414 19.5 4.5 21.586 16.836 9.25zM21 13a1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 1 1 0 0 1 1-1 1 1 0 1 0 0-2 1 1 0 0 1-1-1",clipRule:"evenodd"})]}),UploadCard=({item:tt,status:et="idle",isClickable:rt=!1,isSelectable:nt=!1,onDelete:st,onEdit:ot,onRetry:at})=>{const{t:lt}=useTranslation(),{src:ut,name:ct,info:dt}=tt,ht=et==="idle",mt=et==="loading",xt=et==="success",yt=dt==null?void 0:dt.type.startsWith("image"),vt={text:"",context:null,image:jsxRuntimeExports.jsx("img",{src:commonPlaceholder,alt:"",width:"48",height:"48"})},Et={error:{text:jsxRuntimeExports.jsx("strong",{children:jsxRuntimeExports.jsx("small",{className:"text-danger caption",children:lt("tiptap.upload.error")})}),context:jsxRuntimeExports.jsx(Button,{leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),variant:"ghost",color:"tertiary",onClick:at,children:lt("tiptap.upload.retry")}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:`${commonPlaceholder}/common/image-status-error.svg`,objectFit:"cover"})},idle:vt,loading:{text:"",context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loading"),placement:"top",children:jsxRuntimeExports.jsx(Loading,{isLoading:!0,loadingPosition:"left",className:"text-secondary"})}),image:vt.image},warning:vt,success:{text:jsxRuntimeExports.jsxs("em",{children:[dt==null?void 0:dt.type," ",(dt==null?void 0:dt.weight)&&`- ${dt.weight}`]}),context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loaded"),placement:"top",children:jsxRuntimeExports.jsx(SvgIconSuccessOutline,{className:"text-success"})}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:ut??"",width:"48",objectFit:"cover",className:"rounded",style:{aspectRatio:1/1}})},unknown:vt},bt=()=>yt&&jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.edit"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconWand,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.loading"),disabled:mt||!xt,onClick:ot,color:"secondary"})});return jsxRuntimeExports.jsx(Card,{isClickable:rt,isSelectable:nt,className:"card-upload",children:jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx("div",{className:"card-image",children:Et[et].image}),jsxRuntimeExports.jsxs("div",{className:"text-truncate",children:[jsxRuntimeExports.jsx(Card.Text,{children:ct}),jsxRuntimeExports.jsx(Card.Text,{className:"caption",children:Et[et].text})]}),!ht&&jsxRuntimeExports.jsx("div",{className:"ms-auto",children:jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-12",children:[Et[et].context,!ht&&jsxRuntimeExports.jsx("div",{className:"vr"}),bt(),jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.delete"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconClose,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.delete"),color:"tertiary",onClick:st})})]})})]})})};var module={exports:{}},ENV=(tt=>(tt[tt.WEBGL_LEGACY=0]="WEBGL_LEGACY",tt[tt.WEBGL=1]="WEBGL",tt[tt.WEBGL2=2]="WEBGL2",tt))(ENV||{}),RENDERER_TYPE=(tt=>(tt[tt.UNKNOWN=0]="UNKNOWN",tt[tt.WEBGL=1]="WEBGL",tt[tt.CANVAS=2]="CANVAS",tt))(RENDERER_TYPE||{}),BUFFER_BITS=(tt=>(tt[tt.COLOR=16384]="COLOR",tt[tt.DEPTH=256]="DEPTH",tt[tt.STENCIL=1024]="STENCIL",tt))(BUFFER_BITS||{}),BLEND_MODES=(tt=>(tt[tt.NORMAL=0]="NORMAL",tt[tt.ADD=1]="ADD",tt[tt.MULTIPLY=2]="MULTIPLY",tt[tt.SCREEN=3]="SCREEN",tt[tt.OVERLAY=4]="OVERLAY",tt[tt.DARKEN=5]="DARKEN",tt[tt.LIGHTEN=6]="LIGHTEN",tt[tt.COLOR_DODGE=7]="COLOR_DODGE",tt[tt.COLOR_BURN=8]="COLOR_BURN",tt[tt.HARD_LIGHT=9]="HARD_LIGHT",tt[tt.SOFT_LIGHT=10]="SOFT_LIGHT",tt[tt.DIFFERENCE=11]="DIFFERENCE",tt[tt.EXCLUSION=12]="EXCLUSION",tt[tt.HUE=13]="HUE",tt[tt.SATURATION=14]="SATURATION",tt[tt.COLOR=15]="COLOR",tt[tt.LUMINOSITY=16]="LUMINOSITY",tt[tt.NORMAL_NPM=17]="NORMAL_NPM",tt[tt.ADD_NPM=18]="ADD_NPM",tt[tt.SCREEN_NPM=19]="SCREEN_NPM",tt[tt.NONE=20]="NONE",tt[tt.SRC_OVER=0]="SRC_OVER",tt[tt.SRC_IN=21]="SRC_IN",tt[tt.SRC_OUT=22]="SRC_OUT",tt[tt.SRC_ATOP=23]="SRC_ATOP",tt[tt.DST_OVER=24]="DST_OVER",tt[tt.DST_IN=25]="DST_IN",tt[tt.DST_OUT=26]="DST_OUT",tt[tt.DST_ATOP=27]="DST_ATOP",tt[tt.ERASE=26]="ERASE",tt[tt.SUBTRACT=28]="SUBTRACT",tt[tt.XOR=29]="XOR",tt))(BLEND_MODES||{}),DRAW_MODES=(tt=>(tt[tt.POINTS=0]="POINTS",tt[tt.LINES=1]="LINES",tt[tt.LINE_LOOP=2]="LINE_LOOP",tt[tt.LINE_STRIP=3]="LINE_STRIP",tt[tt.TRIANGLES=4]="TRIANGLES",tt[tt.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",tt[tt.TRIANGLE_FAN=6]="TRIANGLE_FAN",tt))(DRAW_MODES||{}),FORMATS=(tt=>(tt[tt.RGBA=6408]="RGBA",tt[tt.RGB=6407]="RGB",tt[tt.RG=33319]="RG",tt[tt.RED=6403]="RED",tt[tt.RGBA_INTEGER=36249]="RGBA_INTEGER",tt[tt.RGB_INTEGER=36248]="RGB_INTEGER",tt[tt.RG_INTEGER=33320]="RG_INTEGER",tt[tt.RED_INTEGER=36244]="RED_INTEGER",tt[tt.ALPHA=6406]="ALPHA",tt[tt.LUMINANCE=6409]="LUMINANCE",tt[tt.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",tt[tt.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",tt[tt.DEPTH_STENCIL=34041]="DEPTH_STENCIL",tt))(FORMATS||{}),TARGETS=(tt=>(tt[tt.TEXTURE_2D=3553]="TEXTURE_2D",tt[tt.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",tt[tt.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",tt))(TARGETS||{}),TYPES=(tt=>(tt[tt.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",tt[tt.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",tt[tt.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",tt[tt.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",tt[tt.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",tt[tt.UNSIGNED_INT=5125]="UNSIGNED_INT",tt[tt.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",tt[tt.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",tt[tt.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",tt[tt.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",tt[tt.BYTE=5120]="BYTE",tt[tt.SHORT=5122]="SHORT",tt[tt.INT=5124]="INT",tt[tt.FLOAT=5126]="FLOAT",tt[tt.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",tt[tt.HALF_FLOAT=36193]="HALF_FLOAT",tt))(TYPES||{}),SAMPLER_TYPES=(tt=>(tt[tt.FLOAT=0]="FLOAT",tt[tt.INT=1]="INT",tt[tt.UINT=2]="UINT",tt))(SAMPLER_TYPES||{}),SCALE_MODES=(tt=>(tt[tt.NEAREST=0]="NEAREST",tt[tt.LINEAR=1]="LINEAR",tt))(SCALE_MODES||{}),WRAP_MODES=(tt=>(tt[tt.CLAMP=33071]="CLAMP",tt[tt.REPEAT=10497]="REPEAT",tt[tt.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",tt))(WRAP_MODES||{}),MIPMAP_MODES=(tt=>(tt[tt.OFF=0]="OFF",tt[tt.POW2=1]="POW2",tt[tt.ON=2]="ON",tt[tt.ON_MANUAL=3]="ON_MANUAL",tt))(MIPMAP_MODES||{}),ALPHA_MODES=(tt=>(tt[tt.NPM=0]="NPM",tt[tt.UNPACK=1]="UNPACK",tt[tt.PMA=2]="PMA",tt[tt.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",tt[tt.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",tt[tt.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",tt))(ALPHA_MODES||{}),CLEAR_MODES=(tt=>(tt[tt.NO=0]="NO",tt[tt.YES=1]="YES",tt[tt.AUTO=2]="AUTO",tt[tt.BLEND=0]="BLEND",tt[tt.CLEAR=1]="CLEAR",tt[tt.BLIT=2]="BLIT",tt))(CLEAR_MODES||{}),GC_MODES=(tt=>(tt[tt.AUTO=0]="AUTO",tt[tt.MANUAL=1]="MANUAL",tt))(GC_MODES||{}),PRECISION=(tt=>(tt.LOW="lowp",tt.MEDIUM="mediump",tt.HIGH="highp",tt))(PRECISION||{}),MASK_TYPES=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.SCISSOR=1]="SCISSOR",tt[tt.STENCIL=2]="STENCIL",tt[tt.SPRITE=3]="SPRITE",tt[tt.COLOR=4]="COLOR",tt))(MASK_TYPES||{}),MSAA_QUALITY=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.LOW=2]="LOW",tt[tt.MEDIUM=4]="MEDIUM",tt[tt.HIGH=8]="HIGH",tt))(MSAA_QUALITY||{}),BUFFER_TYPE=(tt=>(tt[tt.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",tt[tt.ARRAY_BUFFER=34962]="ARRAY_BUFFER",tt[tt.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",tt))(BUFFER_TYPE||{});const BrowserAdapter={createCanvas:(tt,et)=>{const rt=document.createElement("canvas");return rt.width=tt,rt.height=et,rt},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(tt,et)=>fetch(tt,et),parseXML:tt=>new DOMParser().parseFromString(tt,"text/xml")},settings={ADAPTER:BrowserAdapter,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var appleIphone=/iPhone/i,appleIpod=/iPod/i,appleTablet=/iPad/i,appleUniversal=/\biOS-universal(?:.+)Mac\b/i,androidPhone=/\bAndroid(?:.+)Mobile\b/i,androidTablet=/Android/i,amazonPhone=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,amazonTablet=/Silk/i,windowsPhone=/Windows Phone/i,windowsTablet=/\bWindows(?:.+)ARM\b/i,otherBlackBerry=/BlackBerry/i,otherBlackBerry10=/BB10/i,otherOpera=/Opera Mini/i,otherChrome=/\b(CriOS|Chrome)(?:.+)Mobile/i,otherFirefox=/Mobile(?:.+)Firefox\b/i,isAppleTabletOnIos13=function(tt){return typeof tt<"u"&&tt.platform==="MacIntel"&&typeof tt.maxTouchPoints=="number"&&tt.maxTouchPoints>1&&typeof MSStream>"u"};function createMatch(tt){return function(et){return et.test(tt)}}function isMobile$1(tt){var et={userAgent:"",platform:"",maxTouchPoints:0};!tt&&typeof navigator<"u"?et={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof tt=="string"?et.userAgent=tt:tt&&tt.userAgent&&(et={userAgent:tt.userAgent,platform:tt.platform,maxTouchPoints:tt.maxTouchPoints||0});var rt=et.userAgent,nt=rt.split("[FBAN");typeof nt[1]<"u"&&(rt=nt[0]),nt=rt.split("Twitter"),typeof nt[1]<"u"&&(rt=nt[0]);var st=createMatch(rt),ot={apple:{phone:st(appleIphone)&&!st(windowsPhone),ipod:st(appleIpod),tablet:!st(appleIphone)&&(st(appleTablet)||isAppleTabletOnIos13(et))&&!st(windowsPhone),universal:st(appleUniversal),device:(st(appleIphone)||st(appleIpod)||st(appleTablet)||st(appleUniversal)||isAppleTabletOnIos13(et))&&!st(windowsPhone)},amazon:{phone:st(amazonPhone),tablet:!st(amazonPhone)&&st(amazonTablet),device:st(amazonPhone)||st(amazonTablet)},android:{phone:!st(windowsPhone)&&st(amazonPhone)||!st(windowsPhone)&&st(androidPhone),tablet:!st(windowsPhone)&&!st(amazonPhone)&&!st(androidPhone)&&(st(amazonTablet)||st(androidTablet)),device:!st(windowsPhone)&&(st(amazonPhone)||st(amazonTablet)||st(androidPhone)||st(androidTablet))||st(/\bokhttp\b/i)},windows:{phone:st(windowsPhone),tablet:st(windowsTablet),device:st(windowsPhone)||st(windowsTablet)},other:{blackberry:st(otherBlackBerry),blackberry10:st(otherBlackBerry10),opera:st(otherOpera),firefox:st(otherFirefox),chrome:st(otherChrome),device:st(otherBlackBerry)||st(otherBlackBerry10)||st(otherOpera)||st(otherFirefox)||st(otherChrome)},any:!1,phone:!1,tablet:!1};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}const isMobileCall=isMobile$1.default??isMobile$1,isMobile=isMobileCall(globalThis.navigator);settings.RETINA_PREFIX=/@([0-9\.]+)x/;settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var eventemitter3={exports:{}};(function(tt){var et=Object.prototype.hasOwnProperty,rt="~";function nt(){}Object.create&&(nt.prototype=Object.create(null),new nt().__proto__||(rt=!1));function st(ut,ct,dt){this.fn=ut,this.context=ct,this.once=dt||!1}function ot(ut,ct,dt,ht,mt){if(typeof dt!="function")throw new TypeError("The listener must be a function");var xt=new st(dt,ht||ut,mt),yt=rt?rt+ct:ct;return ut._events[yt]?ut._events[yt].fn?ut._events[yt]=[ut._events[yt],xt]:ut._events[yt].push(xt):(ut._events[yt]=xt,ut._eventsCount++),ut}function at(ut,ct){--ut._eventsCount===0?ut._events=new nt:delete ut._events[ct]}function lt(){this._events=new nt,this._eventsCount=0}lt.prototype.eventNames=function(){var ct=[],dt,ht;if(this._eventsCount===0)return ct;for(ht in dt=this._events)et.call(dt,ht)&&ct.push(rt?ht.slice(1):ht);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(dt)):ct},lt.prototype.listeners=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];if(!ht)return[];if(ht.fn)return[ht.fn];for(var mt=0,xt=ht.length,yt=new Array(xt);mt<xt;mt++)yt[mt]=ht[mt].fn;return yt},lt.prototype.listenerCount=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];return ht?ht.fn?1:ht.length:0},lt.prototype.emit=function(ct,dt,ht,mt,xt,yt){var vt=rt?rt+ct:ct;if(!this._events[vt])return!1;var Et=this._events[vt],bt=arguments.length,St,wt;if(Et.fn){switch(Et.once&&this.removeListener(ct,Et.fn,void 0,!0),bt){case 1:return Et.fn.call(Et.context),!0;case 2:return Et.fn.call(Et.context,dt),!0;case 3:return Et.fn.call(Et.context,dt,ht),!0;case 4:return Et.fn.call(Et.context,dt,ht,mt),!0;case 5:return Et.fn.call(Et.context,dt,ht,mt,xt),!0;case 6:return Et.fn.call(Et.context,dt,ht,mt,xt,yt),!0}for(wt=1,St=new Array(bt-1);wt<bt;wt++)St[wt-1]=arguments[wt];Et.fn.apply(Et.context,St)}else{var Rt=Et.length,Ct;for(wt=0;wt<Rt;wt++)switch(Et[wt].once&&this.removeListener(ct,Et[wt].fn,void 0,!0),bt){case 1:Et[wt].fn.call(Et[wt].context);break;case 2:Et[wt].fn.call(Et[wt].context,dt);break;case 3:Et[wt].fn.call(Et[wt].context,dt,ht);break;case 4:Et[wt].fn.call(Et[wt].context,dt,ht,mt);break;default:if(!St)for(Ct=1,St=new Array(bt-1);Ct<bt;Ct++)St[Ct-1]=arguments[Ct];Et[wt].fn.apply(Et[wt].context,St)}}return!0},lt.prototype.on=function(ct,dt,ht){return ot(this,ct,dt,ht,!1)},lt.prototype.once=function(ct,dt,ht){return ot(this,ct,dt,ht,!0)},lt.prototype.removeListener=function(ct,dt,ht,mt){var xt=rt?rt+ct:ct;if(!this._events[xt])return this;if(!dt)return at(this,xt),this;var yt=this._events[xt];if(yt.fn)yt.fn===dt&&(!mt||yt.once)&&(!ht||yt.context===ht)&&at(this,xt);else{for(var vt=0,Et=[],bt=yt.length;vt<bt;vt++)(yt[vt].fn!==dt||mt&&!yt[vt].once||ht&&yt[vt].context!==ht)&&Et.push(yt[vt]);Et.length?this._events[xt]=Et.length===1?Et[0]:Et:at(this,xt)}return this},lt.prototype.removeAllListeners=function(ct){var dt;return ct?(dt=rt?rt+ct:ct,this._events[dt]&&at(this,dt)):(this._events=new nt,this._eventsCount=0),this},lt.prototype.off=lt.prototype.removeListener,lt.prototype.addListener=lt.prototype.on,lt.prefixed=rt,lt.EventEmitter=lt,tt.exports=lt})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);var earcut$2={exports:{}};earcut$2.exports=earcut;earcut$2.exports.default=earcut;function earcut(tt,et,rt){rt=rt||2;var nt=et&&et.length,st=nt?et[0]*rt:tt.length,ot=linkedList(tt,0,st,rt,!0),at=[];if(!ot||ot.next===ot.prev)return at;var lt,ut,ct,dt,ht,mt,xt;if(nt&&(ot=eliminateHoles(tt,et,ot,rt)),tt.length>80*rt){lt=ct=tt[0],ut=dt=tt[1];for(var yt=rt;yt<st;yt+=rt)ht=tt[yt],mt=tt[yt+1],ht<lt&&(lt=ht),mt<ut&&(ut=mt),ht>ct&&(ct=ht),mt>dt&&(dt=mt);xt=Math.max(ct-lt,dt-ut),xt=xt!==0?32767/xt:0}return earcutLinked(ot,at,rt,lt,ut,xt,0),at}function linkedList(tt,et,rt,nt,st){var ot,at;if(st===signedArea(tt,et,rt,nt)>0)for(ot=et;ot<rt;ot+=nt)at=insertNode(ot,tt[ot],tt[ot+1],at);else for(ot=rt-nt;ot>=et;ot-=nt)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);var rt=tt,nt;do if(nt=!1,!rt.steiner&&(equals(rt,rt.next)||area(rt.prev,rt,rt.next)===0)){if(removeNode(rt),rt=et=rt.prev,rt===rt.next)break;nt=!0}else rt=rt.next;while(nt||rt!==et);return et}function earcutLinked(tt,et,rt,nt,st,ot,at){if(tt){!at&&ot&&indexCurve(tt,nt,st,ot);for(var lt=tt,ut,ct;tt.prev!==tt.next;){if(ut=tt.prev,ct=tt.next,ot?isEarHashed(tt,nt,st,ot):isEar(tt)){et.push(ut.i/rt|0),et.push(tt.i/rt|0),et.push(ct.i/rt|0),removeNode(tt),tt=ct.next,lt=ct.next;continue}if(tt=ct,tt===lt){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,rt),earcutLinked(tt,et,rt,nt,st,ot,2)):at===2&&splitEarcut(tt,et,rt,nt,st,ot):earcutLinked(filterPoints(tt),et,rt,nt,st,ot,1);break}}}}function isEar(tt){var et=tt.prev,rt=tt,nt=tt.next;if(area(et,rt,nt)>=0)return!1;for(var st=et.x,ot=rt.x,at=nt.x,lt=et.y,ut=rt.y,ct=nt.y,dt=st<ot?st<at?st:at:ot<at?ot:at,ht=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,mt=st>ot?st>at?st:at:ot>at?ot:at,xt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,yt=nt.next;yt!==et;){if(yt.x>=dt&&yt.x<=mt&&yt.y>=ht&&yt.y<=xt&&pointInTriangle(st,lt,ot,ut,at,ct,yt.x,yt.y)&&area(yt.prev,yt,yt.next)>=0)return!1;yt=yt.next}return!0}function isEarHashed(tt,et,rt,nt){var st=tt.prev,ot=tt,at=tt.next;if(area(st,ot,at)>=0)return!1;for(var lt=st.x,ut=ot.x,ct=at.x,dt=st.y,ht=ot.y,mt=at.y,xt=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,yt=dt<ht?dt<mt?dt:mt:ht<mt?ht:mt,vt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,Et=dt>ht?dt>mt?dt:mt:ht>mt?ht:mt,bt=zOrder(xt,yt,et,rt,nt),St=zOrder(vt,Et,et,rt,nt),wt=tt.prevZ,Rt=tt.nextZ;wt&&wt.z>=bt&&Rt&&Rt.z<=St;){if(wt.x>=xt&&wt.x<=vt&&wt.y>=yt&&wt.y<=Et&&wt!==st&&wt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,wt.x,wt.y)&&area(wt.prev,wt,wt.next)>=0||(wt=wt.prevZ,Rt.x>=xt&&Rt.x<=vt&&Rt.y>=yt&&Rt.y<=Et&&Rt!==st&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0))return!1;Rt=Rt.nextZ}for(;wt&&wt.z>=bt;){if(wt.x>=xt&&wt.x<=vt&&wt.y>=yt&&wt.y<=Et&&wt!==st&&wt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,wt.x,wt.y)&&area(wt.prev,wt,wt.next)>=0)return!1;wt=wt.prevZ}for(;Rt&&Rt.z<=St;){if(Rt.x>=xt&&Rt.x<=vt&&Rt.y>=yt&&Rt.y<=Et&&Rt!==st&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.nextZ}return!0}function cureLocalIntersections(tt,et,rt){var nt=tt;do{var st=nt.prev,ot=nt.next.next;!equals(st,ot)&&intersects(st,nt,nt.next,ot)&&locallyInside(st,ot)&&locallyInside(ot,st)&&(et.push(st.i/rt|0),et.push(nt.i/rt|0),et.push(ot.i/rt|0),removeNode(nt),removeNode(nt.next),nt=tt=ot),nt=nt.next}while(nt!==tt);return filterPoints(nt)}function splitEarcut(tt,et,rt,nt,st,ot){var at=tt;do{for(var lt=at.next.next;lt!==at.prev;){if(at.i!==lt.i&&isValidDiagonal(at,lt)){var ut=splitPolygon(at,lt);at=filterPoints(at,at.next),ut=filterPoints(ut,ut.next),earcutLinked(at,et,rt,nt,st,ot,0),earcutLinked(ut,et,rt,nt,st,ot,0);return}lt=lt.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,rt,nt){var st=[],ot,at,lt,ut,ct;for(ot=0,at=et.length;ot<at;ot++)lt=et[ot]*nt,ut=ot<at-1?et[ot+1]*nt:tt.length,ct=linkedList(tt,lt,ut,nt,!1),ct===ct.next&&(ct.steiner=!0),st.push(getLeftmost(ct));for(st.sort(compareX),ot=0;ot<st.length;ot++)rt=eliminateHole(st[ot],rt);return rt}function compareX(tt,et){return tt.x-et.x}function eliminateHole(tt,et){var rt=findHoleBridge(tt,et);if(!rt)return et;var nt=splitPolygon(rt,tt);return filterPoints(nt,nt.next),filterPoints(rt,rt.next)}function findHoleBridge(tt,et){var rt=et,nt=tt.x,st=tt.y,ot=-1/0,at;do{if(st<=rt.y&&st>=rt.next.y&&rt.next.y!==rt.y){var lt=rt.x+(st-rt.y)*(rt.next.x-rt.x)/(rt.next.y-rt.y);if(lt<=nt&&lt>ot&&(ot=lt,at=rt.x<rt.next.x?rt:rt.next,lt===nt))return at}rt=rt.next}while(rt!==et);if(!at)return null;var ut=at,ct=at.x,dt=at.y,ht=1/0,mt;rt=at;do nt>=rt.x&&rt.x>=ct&&nt!==rt.x&&pointInTriangle(st<dt?nt:ot,st,ct,dt,st<dt?ot:nt,st,rt.x,rt.y)&&(mt=Math.abs(st-rt.y)/(nt-rt.x),locallyInside(rt,tt)&&(mt<ht||mt===ht&&(rt.x>at.x||rt.x===at.x&&sectorContainsSector(at,rt)))&&(at=rt,ht=mt)),rt=rt.next;while(rt!==ut);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,rt,nt){var st=tt;do st.z===0&&(st.z=zOrder(st.x,st.y,et,rt,nt)),st.prevZ=st.prev,st.nextZ=st.next,st=st.next;while(st!==tt);st.prevZ.nextZ=null,st.prevZ=null,sortLinked(st)}function sortLinked(tt){var et,rt,nt,st,ot,at,lt,ut,ct=1;do{for(rt=tt,tt=null,ot=null,at=0;rt;){for(at++,nt=rt,lt=0,et=0;et<ct&&(lt++,nt=nt.nextZ,!!nt);et++);for(ut=ct;lt>0||ut>0&&nt;)lt!==0&&(ut===0||!nt||rt.z<=nt.z)?(st=rt,rt=rt.nextZ,lt--):(st=nt,nt=nt.nextZ,ut--),ot?ot.nextZ=st:tt=st,st.prevZ=ot,ot=st;rt=nt}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,rt,nt,st){return tt=(tt-rt)*st|0,et=(et-nt)*st|0,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){var et=tt,rt=tt;do(et.x<rt.x||et.x===rt.x&&et.y<rt.y)&&(rt=et),et=et.next;while(et!==tt);return rt}function pointInTriangle(tt,et,rt,nt,st,ot,at,lt){return(st-at)*(et-lt)>=(tt-at)*(ot-lt)&&(tt-at)*(nt-lt)>=(rt-at)*(et-lt)&&(rt-at)*(ot-lt)>=(st-at)*(nt-lt)}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,rt){return(et.y-tt.y)*(rt.x-et.x)-(et.x-tt.x)*(rt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,rt,nt){var st=sign$3(area(tt,et,rt)),ot=sign$3(area(tt,et,nt)),at=sign$3(area(rt,nt,tt)),lt=sign$3(area(rt,nt,et));return!!(st!==ot&&at!==lt||st===0&&onSegment(tt,rt,et)||ot===0&&onSegment(tt,nt,et)||at===0&&onSegment(rt,tt,nt)||lt===0&&onSegment(rt,et,nt))}function onSegment(tt,et,rt){return et.x<=Math.max(tt.x,rt.x)&&et.x>=Math.min(tt.x,rt.x)&&et.y<=Math.max(tt.y,rt.y)&&et.y>=Math.min(tt.y,rt.y)}function sign$3(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){var rt=tt;do{if(rt.i!==tt.i&&rt.next.i!==tt.i&&rt.i!==et.i&&rt.next.i!==et.i&&intersects(rt,rt.next,tt,et))return!0;rt=rt.next}while(rt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){var rt=tt,nt=!1,st=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do rt.y>ot!=rt.next.y>ot&&rt.next.y!==rt.y&&st<(rt.next.x-rt.x)*(ot-rt.y)/(rt.next.y-rt.y)+rt.x&&(nt=!nt),rt=rt.next;while(rt!==tt);return nt}function splitPolygon(tt,et){var rt=new Node$1(tt.i,tt.x,tt.y),nt=new Node$1(et.i,et.x,et.y),st=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,rt.next=st,st.prev=rt,nt.next=rt,rt.prev=nt,ot.next=nt,nt.prev=ot,nt}function insertNode(tt,et,rt,nt){var st=new Node$1(tt,et,rt);return nt?(st.next=nt.next,st.prev=nt,nt.next.prev=st,nt.next=st):(st.prev=st,st.next=st),st}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$1(tt,et,rt){this.i=tt,this.x=et,this.y=rt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}earcut.deviation=function(tt,et,rt,nt){var st=et&&et.length,ot=st?et[0]*rt:tt.length,at=Math.abs(signedArea(tt,0,ot,rt));if(st)for(var lt=0,ut=et.length;lt<ut;lt++){var ct=et[lt]*rt,dt=lt<ut-1?et[lt+1]*rt:tt.length;at-=Math.abs(signedArea(tt,ct,dt,rt))}var ht=0;for(lt=0;lt<nt.length;lt+=3){var mt=nt[lt]*rt,xt=nt[lt+1]*rt,yt=nt[lt+2]*rt;ht+=Math.abs((tt[mt]-tt[yt])*(tt[xt+1]-tt[mt+1])-(tt[mt]-tt[xt])*(tt[yt+1]-tt[mt+1]))}return at===0&&ht===0?0:Math.abs((ht-at)/at)};function signedArea(tt,et,rt,nt){for(var st=0,ot=et,at=rt-nt;ot<rt;ot+=nt)st+=(tt[at]-tt[ot])*(tt[ot+1]+tt[at+1]),at=ot;return st}earcut.flatten=function(tt){for(var et=tt[0][0].length,rt={vertices:[],holes:[],dimensions:et},nt=0,st=0;st<tt.length;st++){for(var ot=0;ot<tt[st].length;ot++)for(var at=0;at<et;at++)rt.vertices.push(tt[st][ot][at]);st>0&&(nt+=tt[st-1].length,rt.holes.push(nt))}return rt};var earcutExports=earcut$2.exports;const earcut$1=getDefaultExportFromCjs(earcutExports);var punycode$1={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */punycode$1.exports;(function(tt,et){(function(rt){var nt=et&&!et.nodeType&&et,st=!tt.nodeType&&tt,ot=typeof commonjsGlobal=="object"&&commonjsGlobal;(ot.global===ot||ot.window===ot||ot.self===ot)&&(rt=ot);var at,lt=2147483647,ut=36,ct=1,dt=26,ht=38,mt=700,xt=72,yt=128,vt="-",Et=/^xn--/,bt=/[^\x20-\x7E]/,St=/[\x2E\u3002\uFF0E\uFF61]/g,wt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Rt=ut-ct,Ct=Math.floor,Pt=String.fromCharCode,It;function jt(Bt){throw new RangeError(wt[Bt])}function Dt(Bt,Yt){for(var Zt=Bt.length,Xt=[];Zt--;)Xt[Zt]=Yt(Bt[Zt]);return Xt}function Vt(Bt,Yt){var Zt=Bt.split("@"),Xt="";Zt.length>1&&(Xt=Zt[0]+"@",Bt=Zt[1]),Bt=Bt.replace(St,".");var rr=Bt.split("."),cr=Dt(rr,Yt).join(".");return Xt+cr}function Ft(Bt){for(var Yt=[],Zt=0,Xt=Bt.length,rr,cr;Zt<Xt;)rr=Bt.charCodeAt(Zt++),rr>=55296&&rr<=56319&&Zt<Xt?(cr=Bt.charCodeAt(Zt++),(cr&64512)==56320?Yt.push(((rr&1023)<<10)+(cr&1023)+65536):(Yt.push(rr),Zt--)):Yt.push(rr);return Yt}function Ht(Bt){return Dt(Bt,function(Yt){var Zt="";return Yt>65535&&(Yt-=65536,Zt+=Pt(Yt>>>10&1023|55296),Yt=56320|Yt&1023),Zt+=Pt(Yt),Zt}).join("")}function Nt(Bt){return Bt-48<10?Bt-22:Bt-65<26?Bt-65:Bt-97<26?Bt-97:ut}function Lt(Bt,Yt){return Bt+22+75*(Bt<26)-((Yt!=0)<<5)}function Mt(Bt,Yt,Zt){var Xt=0;for(Bt=Zt?Ct(Bt/mt):Bt>>1,Bt+=Ct(Bt/Yt);Bt>Rt*dt>>1;Xt+=ut)Bt=Ct(Bt/Rt);return Ct(Xt+(Rt+1)*Bt/(Bt+ht))}function zt(Bt){var Yt=[],Zt=Bt.length,Xt,rr=0,cr=yt,ur=xt,mr,vr,Er,br,hr,Ar,Cr,Ur,Sr;for(mr=Bt.lastIndexOf(vt),mr<0&&(mr=0),vr=0;vr<mr;++vr)Bt.charCodeAt(vr)>=128&&jt("not-basic"),Yt.push(Bt.charCodeAt(vr));for(Er=mr>0?mr+1:0;Er<Zt;){for(br=rr,hr=1,Ar=ut;Er>=Zt&&jt("invalid-input"),Cr=Nt(Bt.charCodeAt(Er++)),(Cr>=ut||Cr>Ct((lt-rr)/hr))&&jt("overflow"),rr+=Cr*hr,Ur=Ar<=ur?ct:Ar>=ur+dt?dt:Ar-ur,!(Cr<Ur);Ar+=ut)Sr=ut-Ur,hr>Ct(lt/Sr)&&jt("overflow"),hr*=Sr;Xt=Yt.length+1,ur=Mt(rr-br,Xt,br==0),Ct(rr/Xt)>lt-cr&&jt("overflow"),cr+=Ct(rr/Xt),rr%=Xt,Yt.splice(rr++,0,cr)}return Ht(Yt)}function Gt(Bt){var Yt,Zt,Xt,rr,cr,ur,mr,vr,Er,br,hr,Ar=[],Cr,Ur,Sr,kr;for(Bt=Ft(Bt),Cr=Bt.length,Yt=yt,Zt=0,cr=xt,ur=0;ur<Cr;++ur)hr=Bt[ur],hr<128&&Ar.push(Pt(hr));for(Xt=rr=Ar.length,rr&&Ar.push(vt);Xt<Cr;){for(mr=lt,ur=0;ur<Cr;++ur)hr=Bt[ur],hr>=Yt&&hr<mr&&(mr=hr);for(Ur=Xt+1,mr-Yt>Ct((lt-Zt)/Ur)&&jt("overflow"),Zt+=(mr-Yt)*Ur,Yt=mr,ur=0;ur<Cr;++ur)if(hr=Bt[ur],hr<Yt&&++Zt>lt&&jt("overflow"),hr==Yt){for(vr=Zt,Er=ut;br=Er<=cr?ct:Er>=cr+dt?dt:Er-cr,!(vr<br);Er+=ut)kr=vr-br,Sr=ut-br,Ar.push(Pt(Lt(br+kr%Sr,0))),vr=Ct(kr/Sr);Ar.push(Pt(Lt(vr,0))),cr=Mt(Zt,Ur,Xt==rr),Zt=0,++Xt}++Zt,++Yt}return Ar.join("")}function $t(Bt){return Vt(Bt,function(Yt){return Et.test(Yt)?zt(Yt.slice(4).toLowerCase()):Yt})}function Ut(Bt){return Vt(Bt,function(Yt){return bt.test(Yt)?"xn--"+Gt(Yt):Yt})}if(at={version:"1.4.1",ucs2:{decode:Ft,encode:Ht},decode:zt,encode:Gt,toASCII:Ut,toUnicode:$t},nt&&st)if(tt.exports==nt)st.exports=at;else for(It in at)at.hasOwnProperty(It)&&(nt[It]=at[It]);else rt.punycode=at})(commonjsGlobal)})(punycode$1,punycode$1.exports);var punycodeExports=punycode$1.exports,type=TypeError;const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasMap=typeof Map=="function"&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize$1=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get=="function"?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet=typeof Set=="function"&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get=="function"?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,hasWeakMap=typeof WeakMap=="function"&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet=typeof WeakSet=="function"&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef=typeof WeakRef=="function"&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace$1=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat$1=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hasShammedSymbols=typeof Symbol=="function"&&typeof Symbol.iterator=="object",toStringTag=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||!0)?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(tt){return tt.__proto__}:null);function addNumericSeparator(tt,et){if(tt===1/0||tt===-1/0||tt!==tt||tt&&tt>-1e3&&tt<1e3||$test.call(/e/,et))return et;var rt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof tt=="number"){var nt=tt<0?-$floor(-tt):$floor(tt);if(nt!==tt){var st=String(nt),ot=$slice.call(et,st.length+1);return $replace$1.call(st,rt,"$&_")+"."+$replace$1.call($replace$1.call(ot,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace$1.call(et,rt,"$&_")}var utilInspect=require$$0$1,inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},objectInspect=function tt(et,rt,nt,st){var ot=rt||{};if(has$3(ot,"quoteStyle")&&!has$3(quotes,ot.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(ot,"maxStringLength")&&(typeof ot.maxStringLength=="number"?ot.maxStringLength<0&&ot.maxStringLength!==1/0:ot.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var at=has$3(ot,"customInspect")?ot.customInspect:!0;if(typeof at!="boolean"&&at!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(ot,"indent")&&ot.indent!==null&&ot.indent!==" "&&!(parseInt(ot.indent,10)===ot.indent&&ot.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(ot,"numericSeparator")&&typeof ot.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var lt=ot.numericSeparator;if(typeof et>"u")return"undefined";if(et===null)return"null";if(typeof et=="boolean")return et?"true":"false";if(typeof et=="string")return inspectString(et,ot);if(typeof et=="number"){if(et===0)return 1/0/et>0?"0":"-0";var ut=String(et);return lt?addNumericSeparator(et,ut):ut}if(typeof et=="bigint"){var ct=String(et)+"n";return lt?addNumericSeparator(et,ct):ct}var dt=typeof ot.depth>"u"?5:ot.depth;if(typeof nt>"u"&&(nt=0),nt>=dt&&dt>0&&typeof et=="object")return isArray$3(et)?"[Array]":"[Object]";var ht=getIndent(ot,nt);if(typeof st>"u")st=[];else if(indexOf(st,et)>=0)return"[Circular]";function mt(Nt,Lt,Mt){if(Lt&&(st=$arrSlice.call(st),st.push(Lt)),Mt){var zt={depth:ot.depth};return has$3(ot,"quoteStyle")&&(zt.quoteStyle=ot.quoteStyle),tt(Nt,zt,nt+1,st)}return tt(Nt,ot,nt+1,st)}if(typeof et=="function"&&!isRegExp$1(et)){var xt=nameOf(et),yt=arrObjKeys(et,mt);return"[Function"+(xt?": "+xt:" (anonymous)")+"]"+(yt.length>0?" { "+$join.call(yt,", ")+" }":"")}if(isSymbol(et)){var vt=hasShammedSymbols?$replace$1.call(String(et),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(et);return typeof et=="object"&&!hasShammedSymbols?markBoxed(vt):vt}if(isElement(et)){for(var Et="<"+$toLowerCase.call(String(et.nodeName)),bt=et.attributes||[],St=0;St<bt.length;St++)Et+=" "+bt[St].name+"="+wrapQuotes(quote(bt[St].value),"double",ot);return Et+=">",et.childNodes&&et.childNodes.length&&(Et+="..."),Et+="</"+$toLowerCase.call(String(et.nodeName))+">",Et}if(isArray$3(et)){if(et.length===0)return"[]";var wt=arrObjKeys(et,mt);return ht&&!singleLineValues(wt)?"["+indentedJoin(wt,ht)+"]":"[ "+$join.call(wt,", ")+" ]"}if(isError(et)){var Rt=arrObjKeys(et,mt);return!("cause"in Error.prototype)&&"cause"in et&&!isEnumerable.call(et,"cause")?"{ ["+String(et)+"] "+$join.call($concat$1.call("[cause]: "+mt(et.cause),Rt),", ")+" }":Rt.length===0?"["+String(et)+"]":"{ ["+String(et)+"] "+$join.call(Rt,", ")+" }"}if(typeof et=="object"&&at){if(inspectSymbol&&typeof et[inspectSymbol]=="function"&&utilInspect)return utilInspect(et,{depth:dt-nt});if(at!=="symbol"&&typeof et.inspect=="function")return et.inspect()}if(isMap(et)){var Ct=[];return mapForEach&&mapForEach.call(et,function(Nt,Lt){Ct.push(mt(Lt,et,!0)+" => "+mt(Nt,et))}),collectionOf("Map",mapSize$1.call(et),Ct,ht)}if(isSet(et)){var Pt=[];return setForEach&&setForEach.call(et,function(Nt){Pt.push(mt(Nt,et))}),collectionOf("Set",setSize.call(et),Pt,ht)}if(isWeakMap(et))return weakCollectionOf("WeakMap");if(isWeakSet(et))return weakCollectionOf("WeakSet");if(isWeakRef(et))return weakCollectionOf("WeakRef");if(isNumber(et))return markBoxed(mt(Number(et)));if(isBigInt(et))return markBoxed(mt(bigIntValueOf.call(et)));if(isBoolean(et))return markBoxed(booleanValueOf.call(et));if(isString(et))return markBoxed(mt(String(et)));if(typeof window<"u"&&et===window)return"{ [object Window] }";if(typeof globalThis<"u"&&et===globalThis||typeof commonjsGlobal<"u"&&et===commonjsGlobal)return"{ [object globalThis] }";if(!isDate(et)&&!isRegExp$1(et)){var It=arrObjKeys(et,mt),jt=gPO?gPO(et)===Object.prototype:et instanceof Object||et.constructor===Object,Dt=et instanceof Object?"":"null prototype",Vt=!jt&&toStringTag&&Object(et)===et&&toStringTag in et?$slice.call(toStr(et),8,-1):Dt?"Object":"",Ft=jt||typeof et.constructor!="function"?"":et.constructor.name?et.constructor.name+" ":"",Ht=Ft+(Vt||Dt?"["+$join.call($concat$1.call([],Vt||[],Dt||[]),": ")+"] ":"");return It.length===0?Ht+"{}":ht?Ht+"{"+indentedJoin(It,ht)+"}":Ht+"{ "+$join.call(It,", ")+" }"}return String(et)};function wrapQuotes(tt,et,rt){var nt=rt.quoteStyle||et,st=quotes[nt];return st+tt+st}function quote(tt){return $replace$1.call(String(tt),/"/g,"&quot;")}function isArray$3(tt){return toStr(tt)==="[object Array]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isDate(tt){return toStr(tt)==="[object Date]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isRegExp$1(tt){return toStr(tt)==="[object RegExp]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isError(tt){return toStr(tt)==="[object Error]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isString(tt){return toStr(tt)==="[object String]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isNumber(tt){return toStr(tt)==="[object Number]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isBoolean(tt){return toStr(tt)==="[object Boolean]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isSymbol(tt){if(hasShammedSymbols)return tt&&typeof tt=="object"&&tt instanceof Symbol;if(typeof tt=="symbol")return!0;if(!tt||typeof tt!="object"||!symToString)return!1;try{return symToString.call(tt),!0}catch{}return!1}function isBigInt(tt){if(!tt||typeof tt!="object"||!bigIntValueOf)return!1;try{return bigIntValueOf.call(tt),!0}catch{}return!1}var hasOwn$1=Object.prototype.hasOwnProperty||function(tt){return tt in this};function has$3(tt,et){return hasOwn$1.call(tt,et)}function toStr(tt){return objectToString.call(tt)}function nameOf(tt){if(tt.name)return tt.name;var et=$match.call(functionToString.call(tt),/^function\s*([\w$]+)/);return et?et[1]:null}function indexOf(tt,et){if(tt.indexOf)return tt.indexOf(et);for(var rt=0,nt=tt.length;rt<nt;rt++)if(tt[rt]===et)return rt;return-1}function isMap(tt){if(!mapSize$1||!tt||typeof tt!="object")return!1;try{mapSize$1.call(tt);try{setSize.call(tt)}catch{return!0}return tt instanceof Map}catch{}return!1}function isWeakMap(tt){if(!weakMapHas||!tt||typeof tt!="object")return!1;try{weakMapHas.call(tt,weakMapHas);try{weakSetHas.call(tt,weakSetHas)}catch{return!0}return tt instanceof WeakMap}catch{}return!1}function isWeakRef(tt){if(!weakRefDeref||!tt||typeof tt!="object")return!1;try{return weakRefDeref.call(tt),!0}catch{}return!1}function isSet(tt){if(!setSize||!tt||typeof tt!="object")return!1;try{setSize.call(tt);try{mapSize$1.call(tt)}catch{return!0}return tt instanceof Set}catch{}return!1}function isWeakSet(tt){if(!weakSetHas||!tt||typeof tt!="object")return!1;try{weakSetHas.call(tt,weakSetHas);try{weakMapHas.call(tt,weakMapHas)}catch{return!0}return tt instanceof WeakSet}catch{}return!1}function isElement(tt){return!tt||typeof tt!="object"?!1:typeof HTMLElement<"u"&&tt instanceof HTMLElement?!0:typeof tt.nodeName=="string"&&typeof tt.getAttribute=="function"}function inspectString(tt,et){if(tt.length>et.maxStringLength){var rt=tt.length-et.maxStringLength,nt="... "+rt+" more character"+(rt>1?"s":"");return inspectString($slice.call(tt,0,et.maxStringLength),et)+nt}var st=quoteREs[et.quoteStyle||"single"];st.lastIndex=0;var ot=$replace$1.call($replace$1.call(tt,st,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(ot,"single",et)}function lowbyte(tt){var et=tt.charCodeAt(0),rt={8:"b",9:"t",10:"n",12:"f",13:"r"}[et];return rt?"\\"+rt:"\\x"+(et<16?"0":"")+$toUpperCase.call(et.toString(16))}function markBoxed(tt){return"Object("+tt+")"}function weakCollectionOf(tt){return tt+" { ? }"}function collectionOf(tt,et,rt,nt){var st=nt?indentedJoin(rt,nt):$join.call(rt,", ");return tt+" ("+et+") {"+st+"}"}function singleLineValues(tt){for(var et=0;et<tt.length;et++)if(indexOf(tt[et],`
228
+ `,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(!tt)return[];et=et||{};var rt=1,nt=1;function st(yt){var vt=yt.match(NEWLINE_REGEX);vt&&(rt+=vt.length);var Et=yt.lastIndexOf(NEWLINE);nt=~Et?yt.length-Et:nt+yt.length}function ot(){var yt={line:rt,column:nt};return function(vt){return vt.position=new at(yt),ct(),vt}}function at(yt){this.start=yt,this.end={line:rt,column:nt},this.source=et.source}at.prototype.content=tt;function lt(yt){var vt=new Error(et.source+":"+rt+":"+nt+": "+yt);if(vt.reason=yt,vt.filename=et.source,vt.line=rt,vt.column=nt,vt.source=tt,!et.silent)throw vt}function ut(yt){var vt=yt.exec(tt);if(vt){var Et=vt[0];return st(Et),tt=tt.slice(Et.length),vt}}function ct(){ut(WHITESPACE_REGEX)}function dt(yt){var vt;for(yt=yt||[];vt=ht();)vt!==!1&&yt.push(vt);return yt}function ht(){var yt=ot();if(!(FORWARD_SLASH!=tt.charAt(0)||ASTERISK!=tt.charAt(1))){for(var vt=2;EMPTY_STRING!=tt.charAt(vt)&&(ASTERISK!=tt.charAt(vt)||FORWARD_SLASH!=tt.charAt(vt+1));)++vt;if(vt+=2,EMPTY_STRING===tt.charAt(vt-1))return lt("End of comment missing");var Et=tt.slice(2,vt-2);return nt+=2,st(Et),tt=tt.slice(vt),nt+=2,yt({type:TYPE_COMMENT,comment:Et})}}function mt(){var yt=ot(),vt=ut(PROPERTY_REGEX);if(vt){if(ht(),!ut(COLON_REGEX))return lt("property missing ':'");var Et=ut(VALUE_REGEX),bt=yt({type:TYPE_DECLARATION,property:trim(vt[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:Et?trim(Et[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return ut(SEMICOLON_REGEX),bt}}function xt(){var yt=[];dt(yt);for(var vt;vt=mt();)vt!==!1&&(yt.push(vt),dt(yt));return yt}return ct(),xt()};function trim(tt){return tt?tt.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var parse$2=inlineStyleParser;function StyleToObject(tt,et){var rt=null;if(!tt||typeof tt!="string")return rt;for(var nt,st=parse$2(tt),ot=typeof et=="function",at,lt,ut=0,ct=st.length;ut<ct;ut++)nt=st[ut],at=nt.property,lt=nt.value,ot?et(at,lt,nt):lt&&(rt||(rt={}),rt[at]=lt);return rt}styleToObject.exports=StyleToObject;styleToObject.exports.default=StyleToObject;var styleToObjectExports=styleToObject.exports,utilities$3={};utilities$3.__esModule=!0;utilities$3.camelCase=void 0;var CUSTOM_PROPERTY_REGEX=/^--[a-zA-Z0-9-]+$/,HYPHEN_REGEX=/-([a-z])/g,NO_HYPHEN_REGEX=/^[^-]+$/,VENDOR_PREFIX_REGEX=/^-(webkit|moz|ms|o|khtml)-/,MS_VENDOR_PREFIX_REGEX=/^-(ms)-/,skipCamelCase=function(tt){return!tt||NO_HYPHEN_REGEX.test(tt)||CUSTOM_PROPERTY_REGEX.test(tt)},capitalize=function(tt,et){return et.toUpperCase()},trimHyphen=function(tt,et){return"".concat(et,"-")},camelCase=function(tt,et){return et===void 0&&(et={}),skipCamelCase(tt)?tt:(tt=tt.toLowerCase(),et.reactCompat?tt=tt.replace(MS_VENDOR_PREFIX_REGEX,trimHyphen):tt=tt.replace(VENDOR_PREFIX_REGEX,trimHyphen),tt.replace(HYPHEN_REGEX,capitalize))};utilities$3.camelCase=camelCase;(function(tt){var et=commonjsGlobal&&commonjsGlobal.__importDefault||function(ot){return ot&&ot.__esModule?ot:{default:ot}};tt.__esModule=!0;var rt=et(styleToObjectExports),nt=utilities$3;function st(ot,at){var lt={};return!ot||typeof ot!="string"||(0,rt.default)(ot,function(ut,ct){ut&&ct&&(lt[(0,nt.camelCase)(ut,at)]=ct)}),lt}tt.default=st})(cjs);var React$3=reactExports,styleToJS=cjs.default;function invertObject(tt,et){if(!tt||typeof tt!="object")throw new TypeError("First argument must be an object");var rt=typeof et=="function",nt={},st={};for(var ot in tt){var at=tt[ot];if(rt&&(nt=et(ot,at),nt&&nt.length===2)){st[nt[0]]=nt[1];continue}typeof at=="string"&&(st[at]=ot)}return st}var RESERVED_SVG_MATHML_ELEMENTS=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function isCustomComponent(tt,et){return tt.indexOf("-")===-1?et&&typeof et.is=="string":!RESERVED_SVG_MATHML_ELEMENTS.has(tt)}var STYLE_TO_JS_OPTIONS={reactCompat:!0};function setStyleProp$1(tt,et){if(tt!=null)try{et.style=styleToJS(tt,STYLE_TO_JS_OPTIONS)}catch{et.style={}}}var PRESERVE_CUSTOM_ATTRIBUTES=React$3.version.split(".")[0]>=16,ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function canTextBeChildOfNode$1(tt){return!ELEMENTS_WITH_NO_TEXT_CHILDREN.has(tt.name)}function returnFirstArg(tt){return tt}var utilities$2={PRESERVE_CUSTOM_ATTRIBUTES,ELEMENTS_WITH_NO_TEXT_CHILDREN,invertObject,isCustomComponent,setStyleProp:setStyleProp$1,canTextBeChildOfNode:canTextBeChildOfNode$1,returnFirstArg},reactProperty=lib$1,utilities$1=utilities$2,UNCONTROLLED_COMPONENT_ATTRIBUTES=["checked","value"],UNCONTROLLED_COMPONENT_NAMES=["input","select","textarea"],VALUE_ONLY_INPUTS={reset:!0,submit:!0},attributesToProps$3=function tt(et,rt){et=et||{};var nt,st,ot,at,lt,ut={},ct=et.type&&VALUE_ONLY_INPUTS[et.type];for(nt in et){if(ot=et[nt],reactProperty.isCustomAttribute(nt)){ut[nt]=ot;continue}if(st=nt.toLowerCase(),at=getPropName(st),at){switch(lt=reactProperty.getPropertyInfo(at),UNCONTROLLED_COMPONENT_ATTRIBUTES.indexOf(at)!==-1&&UNCONTROLLED_COMPONENT_NAMES.indexOf(rt)!==-1&&!ct&&(at=getPropName("default"+st)),ut[at]=ot,lt&&lt.type){case reactProperty.BOOLEAN:ut[at]=!0;break;case reactProperty.OVERLOADED_BOOLEAN:ot===""&&(ut[at]=!0);break}continue}utilities$1.PRESERVE_CUSTOM_ATTRIBUTES&&(ut[nt]=ot)}return utilities$1.setStyleProp(et.style,ut),ut};function getPropName(tt){return reactProperty.possibleStandardNames[tt]}var React$2=reactExports,attributesToProps$2=attributesToProps$3,utilities=utilities$2,setStyleProp=utilities.setStyleProp,canTextBeChildOfNode=utilities.canTextBeChildOfNode;function domToReact$2(tt,et){et=et||{};for(var rt=et.library||React$2,nt=rt.cloneElement,st=rt.createElement,ot=rt.isValidElement,at=[],lt,ut,ct=typeof et.replace=="function",dt=et.transform||utilities.returnFirstArg,ht,mt,xt,yt=et.trim,vt=0,Et=tt.length;vt<Et;vt++){if(lt=tt[vt],ct&&(ht=et.replace(lt),ot(ht))){Et>1&&(ht=nt(ht,{key:ht.key||vt})),at.push(dt(ht,lt,vt));continue}if(lt.type==="text"){if(ut=!lt.data.trim().length,ut&&lt.parent&&!canTextBeChildOfNode(lt.parent)||yt&&ut)continue;at.push(dt(lt.data,lt,vt));continue}switch(mt=lt.attribs,skipAttributesToProps(lt)?setStyleProp(mt.style,mt):mt&&(mt=attributesToProps$2(mt,lt.name)),xt=null,lt.type){case"script":case"style":lt.children[0]&&(mt.dangerouslySetInnerHTML={__html:lt.children[0].data});break;case"tag":lt.name==="textarea"&&lt.children[0]?mt.defaultValue=lt.children[0].data:lt.children&&lt.children.length&&(xt=domToReact$2(lt.children,et));break;default:continue}Et>1&&(mt.key=vt),at.push(dt(st(lt.name,mt,xt),lt,vt))}return at.length===1?at[0]:at}function skipAttributesToProps(tt){return utilities.PRESERVE_CUSTOM_ATTRIBUTES&&tt.type==="tag"&&utilities.isCustomComponent(tt.name,tt.attribs)}var domToReact_1=domToReact$2,domhandler=lib$3,htmlToDOM=htmlToDom,attributesToProps$1=attributesToProps$3,domToReact$1=domToReact_1;htmlToDOM=typeof htmlToDOM.default=="function"?htmlToDOM.default:htmlToDOM;var domParserOptions={lowerCaseAttributeNames:!1};function HTMLReactParser(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");return tt===""?[]:(et=et||{},domToReact$1(htmlToDOM(tt,et.htmlparser2||domParserOptions),et))}HTMLReactParser.domToReact=domToReact$1;HTMLReactParser.htmlToDOM=htmlToDOM;HTMLReactParser.attributesToProps=attributesToProps$1;HTMLReactParser.Comment=domhandler.Comment;HTMLReactParser.Element=domhandler.Element;HTMLReactParser.ProcessingInstruction=domhandler.ProcessingInstruction;HTMLReactParser.Text=domhandler.Text;var htmlReactParser=HTMLReactParser;HTMLReactParser.default=HTMLReactParser;const HTMLReactParser$1=getDefaultExportFromCjs(htmlReactParser);var domToReact=HTMLReactParser$1.domToReact;HTMLReactParser$1.htmlToDOM;var attributesToProps=HTMLReactParser$1.attributesToProps;HTMLReactParser$1.Comment;HTMLReactParser$1.Element;HTMLReactParser$1.ProcessingInstruction;HTMLReactParser$1.Text;const SvgIconBurgerMenu=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M21 5c0 .828-.711 1.5-1.588 1.5H4.588C3.711 6.5 3 5.828 3 5s.711-1.5 1.588-1.5h14.824C20.289 3.5 21 4.172 21 5M21 12c0 .828-.711 1.5-1.588 1.5H4.588C3.711 13.5 3 12.828 3 12s.711-1.5 1.588-1.5h14.824c.877 0 1.588.672 1.588 1.5M21 19c0 .828-.711 1.5-1.588 1.5H4.588C3.711 20.5 3 19.828 3 19s.711-1.5 1.588-1.5h14.824c.877 0 1.588.672 1.588 1.5",clipRule:"evenodd"})]});function useHelp(){var tt,et,rt,nt,st;const{appCode:ot}=useEdificeClient(),{theme:at}=useEdificeTheme(),[lt,ut]=reactExports.useState(""),[ct,dt]=reactExports.useState(!0),[ht,mt]=reactExports.useState(!1),[xt,yt]=reactExports.useState(!1),vt=at!=null&&at.is1d?"/help-1d":"/help-2d";reactExports.useEffect(()=>{(async()=>{let wt="";wt=vt+"/application/"+ot+"/",!ot&&window.location.pathname!=="/adapter"?wt=vt+"/application/portal/":window.location.pathname==="/adapter"?wt=vt+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?wt=vt+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(wt=vt+"/application/userbook/");try{const Rt=await fetch(wt),Ct=await Rt.text();if(Rt.status===404){yt(!0);return}ut(Ct),yt(!1)}catch(Rt){yt(!0),console.error(Rt)}})()},[ot,vt]);const Et=HTMLReactParser$1(lt,{replace:wt=>{const Rt=wt;if(Rt.attribs&&Rt.attribs.id==="TOC")return jsxRuntimeExports.jsxs("nav",{id:"TOC",children:[jsxRuntimeExports.jsx(Button,{onClick:()=>{dt(!ct)},children:jsxRuntimeExports.jsx(SvgIconBurgerMenu,{})}),domToReact(Rt.children,{replace:Ct=>{const Pt=Ct;if(Pt.attribs&&Pt.name==="ul")return jsxRuntimeExports.jsx("ul",{id:"TOC-list",style:{display:ct?"block":"none"},children:domToReact(Pt.children,{replace:It=>{const jt=It;if(jt.attribs&&jt.name==="a")return jsxRuntimeExports.jsx("a",{...attributesToProps(jt.attribs),children:jsxRuntimeExports.jsx("span",{onClick:()=>{dt(!1)},children:domToReact(jt.children)})})}})})}})]});if(Rt.attribs&&Rt.attribs.class==="section level2"){const Ct=attributesToProps(wt.attribs);return jsxRuntimeExports.jsx("div",{...Ct,className:"section level2",style:{display:Rt.attribs.id!=="présentation"?"none":"block"},children:domToReact(Rt.children,{replace:Pt=>{const It=Pt;if(It.attribs&&It.name==="img"){const jt=Pt.attribs.src;return jsxRuntimeExports.jsx("img",{...attributesToProps(It.attribs),src:`${vt}/${jt}`,alt:""})}}})})}}}),bt=(rt=(et=(tt=Et==null?void 0:Et.props)==null?void 0:tt.children.find(wt=>wt.type==="body"))==null?void 0:et.props)==null?void 0:rt.children,St=(st=(nt=bt==null?void 0:bt.find(wt=>wt.type==="p"))==null?void 0:nt.props)==null?void 0:st.children;return{html:lt,visibility:ct,isModalOpen:ht,setIsModalOpen:mt,parsedContent:bt,parsedHeadline:St,error:xt}}const Header=({is1d:tt=!1,src:et=""})=>{const{t:rt}=useTranslation(),{messages:nt,msgLink:st,zimbraWorkflow:ot}=useConversation(),{user:at,avatar:lt}=useUser(),{currentLanguage:ut,currentApp:ct}=useEdificeClient(),dt=useHasWorkflow("org.entcore.portal.controllers.PortalController|oldHelpEnable")||!1,{isModalOpen:ht,setIsModalOpen:mt,parsedContent:xt,parsedHeadline:yt,error:vt}=useHelp(),Et=clsx("header",{"no-2d":tt,"no-1d":!tt}),{title:bt,bookmarkedApps:St,appsRef:wt,isAppsHovered:Rt,popoverAppsId:Ct,userAvatar:Pt,userName:It,welcomeUser:jt,communityWorkflow:Dt,conversationWorflow:Vt,searchWorkflow:Ft,isCollapsed:Ht,toggleCollapsedNav:Nt,handleLogout:Lt}=useHeader({user:at,avatar:lt}),Mt=nt>0,{theme:zt}=useEdificeTheme();return jsxRuntimeExports.jsx("header",{className:Et,children:tt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"container-fluid",children:jsxRuntimeExports.jsxs(Navbar,{children:[jsxRuntimeExports.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:ct?ct.address:"/timeline/timeline",children:bt}),jsxRuntimeExports.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[jsxRuntimeExports.jsx(Avatar,{alt:It,size:"sm",src:Pt,variant:"circle",width:"32",height:"32"}),jsxRuntimeExports.jsx("span",{className:"navbar-text",children:jt})]}),jsxRuntimeExports.jsxs(NavBarNav,{className:"gap-8","aria-hidden":"false","aria-label":rt("navbar.main.navigation"),children:[Vt&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[jsxRuntimeExports.jsx(SvgIconOneMessaging,{className:"icon notification"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"danger"},className:"position-absolute",children:nt}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.messages")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx(NavLink,{link:"/userbook/mon-compte",className:"dropdown-item",translate:rt("navbar.myaccount"),children:jsxRuntimeExports.jsx(SvgIconOneProfile,{className:"icon user"})})}),ut==="fr"&&dt?jsxRuntimeExports.jsxs(NavItem,{children:[jsxRuntimeExports.jsxs("button",{className:"nav-link",onClick:()=>{mt(!0)},children:[jsxRuntimeExports.jsx(SvgIconAssistance,{className:"icon help"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.help")})]}),jsxRuntimeExports.jsx(Help,{isHelpOpen:ht,setIsHelpOpen:mt,parsedContent:xt,parsedHeadline:yt,error:vt})]}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("button",{className:"nav-link",onClick:Lt,children:[jsxRuntimeExports.jsx(SvgIconDisconnect,{className:"icon logout"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.disconnect")})]})}),jsxRuntimeExports.jsx(NavItem,{className:"d-md-none",children:jsxRuntimeExports.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!Ht,"aria-label":rt("navbar.secondary.navigation"),onClick:Nt,children:jsxRuntimeExports.jsx(SvgIconRafterDown,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),jsxRuntimeExports.jsx(Navbar,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":rt("navbar.secondary.navigation"),children:jsxRuntimeExports.jsx("div",{className:"container-fluid",children:jsxRuntimeExports.jsxs("div",{className:`collapse navbar-collapse ${Ht?"":"show"}`,id:"navbarCollapsed",children:[jsxRuntimeExports.jsx(Logo,{is1d:!0,src:`${et}/img/illustrations/logo.png`,translate:rt("navbar.home")}),jsxRuntimeExports.jsxs(NavBarNav,{className:"gap-8",children:[jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/timeline/timeline",className:"button",children:[jsxRuntimeExports.jsx(SvgIconNewRelease,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.whatsnew")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[jsxRuntimeExports.jsx(SvgIconUserbook,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.classMembers")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/welcome",className:"button",children:[jsxRuntimeExports.jsx(SvgIconMyApps,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.myapps")})]})})]})]})})})]}):jsxRuntimeExports.jsx(Navbar,{className:"navbar-expand-md",children:jsxRuntimeExports.jsxs("div",{className:"container-fluid",children:[jsxRuntimeExports.jsx(Logo,{src:`${et}/img/illustrations/logo.png`}),jsxRuntimeExports.jsx("a",{href:ct?ct.address:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:bt}),jsxRuntimeExports.jsxs("ul",{className:"navbar-nav",children:[jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx(NavLink,{link:"/timeline/timeline",translate:rt("navbar.home"),children:jsxRuntimeExports.jsx(SvgIconHome,{color:"#fff"})})}),jsxRuntimeExports.jsxs(NavItem,{className:"position-relative",ref:wt,id:Ct,"aria-haspopup":"true","aria-expanded":Rt,children:[jsxRuntimeExports.jsx(NavLink,{link:"/welcome",translate:rt("navbar.applications"),children:jsxRuntimeExports.jsx(SvgIconMyApps,{color:"#fff"})}),jsxRuntimeExports.jsxs(Popover,{className:"top-100 widget",id:Ct,isVisible:Rt,children:[jsxRuntimeExports.jsx(PopoverBody,{children:jsxRuntimeExports.jsx(WidgetAppsBody,{bookmarkedApps:St})}),jsxRuntimeExports.jsx(PopoverFooter,{className:"widget-footer border-top border-ghost",children:jsxRuntimeExports.jsx(WidgetAppsFooter,{})})]})]}),Vt&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs(NavLink,{className:"position-relative",link:"/conversation/conversation",translate:rt("conversation"),children:[jsxRuntimeExports.jsx(SvgIconNeoMessaging,{color:"#fff"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"warning"},className:"position-absolute",children:nt})]})}),ot&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs(NavLink,{className:"position-relative",link:st,translate:rt("conversation"),children:[jsxRuntimeExports.jsx(SvgIconNeoMessaging,{color:"#fff"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"warning"},className:"position-absolute",children:nt})]})}),ut==="fr"&&dt?jsxRuntimeExports.jsxs(NavItem,{children:[jsxRuntimeExports.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{mt(!0)},children:[jsxRuntimeExports.jsx(SvgIconAssistance,{color:"#fff"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("support")})]}),jsxRuntimeExports.jsx(Help,{isHelpOpen:ht,setIsHelpOpen:mt,parsedContent:xt,parsedHeadline:yt,error:vt})]}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("div",{className:"dropdown",children:[jsxRuntimeExports.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!Ht,"aria-label":rt("navbar.open.menu"),onClick:Nt,children:jsxRuntimeExports.jsx(SvgIconRafterDown,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),jsxRuntimeExports.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${Ht?"":"show"}`,id:"dropdown-navbar",children:[Dt&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconCommunity,{className:"icon community"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:rt("navbar.community")})]})}),Ft?jsxRuntimeExports.jsx(SearchEngine,{}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(Avatar,{alt:It,size:"sm",src:Pt,variant:"circle",className:"bg-white",width:"32",height:"32"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:rt("navbar.myaccount")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx("hr",{className:"dropdown-divider"})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/auth/logout?callback="+((zt==null?void 0:zt.logoutCallback)??"/"),className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconDisconnect,{className:"icon logout"}),jsxRuntimeExports.jsx("span",{id:"logout-label",className:"nav-text",children:rt("navbar.disconnect")})]})})]})]})})]})]})})})};function usePreferences(tt){return{getPreference:async()=>await odeServices.conf().getPreference(tt),savePreference:async et=>await odeServices.conf().savePreference(tt,JSON.stringify(et))}}function useCookiesConsent(){const[tt,et]=reactExports.useState(!1),{getPreference:rt,savePreference:nt}=usePreferences("rgpdCookies");return reactExports.useEffect(()=>{(async()=>{const st=await rt();et(st===null?!0:st.showInfoTip)})()},[]),{showCookiesConsent:tt,handleConsultCookies:()=>{document.location.href="/userbook/mon-compte",nt({showInfoTip:!1}),et(!1)},handleCloseCookiesConsent:()=>{nt({showInfoTip:!1}),et(!1)}}}const Layout=({children:tt,headless:et=!1,...rt})=>{const{theme:nt}=useEdificeTheme(),{t:st}=useTranslation(),{showCookiesConsent:ot,handleConsultCookies:at,handleCloseCookiesConsent:lt}=useCookiesConsent();useZendeskGuide(),useCantoo();const ut=clsx("d-flex flex-column bg-white",{"container-fluid":!et,"rounded-4 border":(nt==null?void 0:nt.is1d)&&!et,"mt-24":(nt==null?void 0:nt.is1d)&&!et}),ct=et?null:jsxRuntimeExports.jsx(Header,{is1d:nt==null?void 0:nt.is1d,src:nt==null?void 0:nt.basePath}),dt=ot&&jsxRuntimeExports.jsx(Alert,{type:"info",className:"m-12 rgpd",isConfirm:!0,position:"bottom-right",button:jsxRuntimeExports.jsx(Button,{color:"tertiary",variant:"ghost",onClick:at,children:st("rgpd.cookies.banner.button.consult")}),onClose:lt,children:st("rgpd.cookies.banner.text1")}),ht=jsxRuntimeExports.jsx(De$1,{containerClassName:"toaster-container",toastOptions:{position:"top-right"}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ct,jsxRuntimeExports.jsx("main",{className:ut,...rt,children:tt}),ht,dt]})},Toolbar=reactExports.forwardRef(({items:tt,variant:et="default",align:rt="space",isBlock:nt=!1,ariaControls:st,className:ot},at)=>{const[lt,ut]=reactExports.useState(0),[ct,dt]=reactExports.useState([]),[ht,mt]=reactExports.useState(),[xt,yt]=reactExports.useState(),vt=reactExports.useRef(),Et=clsx("toolbar z-1000 bg-white",ot,{default:et==="default","no-shadow":et==="no-shadow","d-flex":nt,"d-inline-flex":!nt,"overflow-x-auto":nt,"justify-content-start":rt==="left","justify-content-between":rt==="space","justify-content-center":rt==="center","justify-content-end":rt==="right"});reactExports.useEffect(()=>{var Pt;const It=(Pt=vt.current)==null?void 0:Pt.querySelectorAll("button"),jt=[];let Dt=!1;It==null||It.forEach(Vt=>{Vt.disabled||(Dt||(mt(Vt),Dt=!0),yt(Vt),jt.push(Vt))}),dt(jt),ut(tt.findIndex(Vt=>(Vt.type==="button"||Vt.type==="icon")&&!Vt.props.disabled))},[tt]);const bt=Pt=>{Pt.target.classList.add("focus")},St=Pt=>{Pt.target.classList.remove("focus")},wt=Pt=>{var It,jt;const Dt=ct.indexOf(Pt.currentTarget);switch(Pt.code){case"ArrowLeft":Pt.currentTarget===ht?xt==null||xt.focus():(It=ct[Dt-1])==null||It.focus();break;case"ArrowRight":Pt.currentTarget===xt?ht==null||ht.focus():(jt=ct[Dt+1])==null||jt.focus();break}},Rt=Pt=>{var It;return typeof Pt.tooltip=="string"?Pt.tooltip:(It=Pt.tooltip)==null?void 0:It.message},Ct=Pt=>{var It;return typeof Pt.tooltip!="string"?(It=Pt.tooltip)==null?void 0:It.position:"top"};return jsxRuntimeExports.jsx("div",{ref:mergeRefs(at,vt),className:Et,role:"toolbar","aria-label":"Text Formatting","aria-controls":st,onFocus:bt,onBlur:St,children:tt.map((Pt,It)=>{if(Pt.visibility==="hide")return null;switch(Pt.type){case"divider":return jsxRuntimeExports.jsx("div",{className:"toolbar-divider"},Pt.name??It);case"button":return jsxRuntimeExports.jsx(Tooltip,{message:Rt(Pt),placement:Ct(Pt),children:reactExports.createElement(Button,{...Pt.props,key:Pt.name??It,color:Pt.props.color?Pt.props.color:"tertiary",variant:"ghost",tabIndex:It===lt?0:-1,onKeyDown:wt})},Pt.name??It);case"icon":return jsxRuntimeExports.jsx(Tooltip,{message:Rt(Pt),placement:Ct(Pt),children:reactExports.createElement(IconButton,{...Pt.props,key:Pt.name??It,color:Pt.props.color?Pt.props.color:"tertiary",variant:Pt.props.variant?Pt.props.variant:"ghost",tabIndex:It===lt?0:-1,onKeyDown:wt})},Pt.name??It);case"dropdown":return reactExports.createElement(Dropdown,{...Pt.props,key:Pt.name??It,extraTriggerKeyDownHandler:wt,overflow:Pt.overflow});case"primary":return jsxRuntimeExports.jsx(Tooltip,{message:Rt(Pt),placement:Ct(Pt),children:jsxRuntimeExports.jsx(Button,{...Pt.props,variant:"filled",color:"primary",tabIndex:It===lt?0:-1,onKeyDown:wt})},Pt.name??It)}return null})})}),loadingScreen="/assets/js/ode-explorer/screen-loading.gif",LoadingScreen=reactExports.forwardRef(({position:tt=!0,caption:et},rt)=>{const nt=clsx("top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-content-center align-items-center z-2000",{"position-fixed":!tt,"position-static":tt}),st=clsx("text-center pt-12",{"text-white":!tt});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{ref:rt,className:nt,children:[jsxRuntimeExports.jsx("div",{className:"bg-white rounded-circle mx-auto w-25",children:jsxRuntimeExports.jsx("img",{src:loadingScreen,alt:"loading"})}),et&&jsxRuntimeExports.jsx("div",{className:st,children:et})]}),!tt&&jsxRuntimeExports.jsx("div",{className:"modal-backdrop fade show"})]})}),TabsContext=reactExports.createContext(null);function useTabsContext(){const tt=reactExports.useContext(TabsContext);if(!tt)throw new Error("Tabs compound components cannot be rendered outside the Tabs component");return tt}const useTabs=({defaultId:tt,items:et,onChange:rt})=>{const[nt,st]=reactExports.useState(tt||""),[ot,at]=reactExports.useState(0),[lt,ut]=reactExports.useState(0),ct=reactExports.useRef([]),dt=reactExports.useCallback(yt=>{st(yt)},[]);reactExports.useEffect(()=>{const yt=et.find(vt=>vt.id===nt);yt&&(rt==null||rt(yt))},[nt]),reactExports.useEffect(()=>{function yt(){var vt;if(((vt=document==null?void 0:document.activeElement)==null?void 0:vt.tagName)!=="INPUT"){const Et=et.findIndex(St=>St.id===nt);Et===-1&&tt&&st(tt);const bt=ct.current[Et];bt&&(bt.focus(),ut((bt==null?void 0:bt.offsetLeft)??0),at((bt==null?void 0:bt.clientWidth)??0))}}return yt(),window.addEventListener("resize",yt),()=>window.removeEventListener("resize",yt)},[nt,et,tt]);const ht=reactExports.useCallback(yt=>{var vt,Et,bt;const St=et.findIndex(wt=>wt.id===yt);yt===((vt=et[0])==null?void 0:vt.id)?st((Et=et[et.length-1])==null?void 0:Et.id):st((bt=et[St-1])==null?void 0:bt.id)},[et]),mt=reactExports.useCallback(yt=>{var vt,Et,bt;const St=et.findIndex(wt=>wt.id===yt);yt===((vt=et[et.length-1])==null?void 0:vt.id)?st((Et=et[0])==null?void 0:Et.id):st((bt=et[St+1])==null?void 0:bt.id)},[et]),xt=reactExports.useCallback(yt=>{var vt,Et;switch(yt.code){case"ArrowLeft":ht(nt);break;case"ArrowRight":mt(nt);break;case"Home":st((vt=et[0])==null?void 0:vt.id);break;case"End":st((Et=et[et.length-1])==null?void 0:Et.id);break}},[nt,et,mt,ht]);return{activeTab:nt,setSelectedTab:dt,tabsRef:ct,tabUnderlineLeft:lt,tabUnderlineWidth:ot,onKeyDown:xt}},TabsItem=({icon:tt,label:et,id:rt,order:nt})=>{const{activeTab:st,setSelectedTab:ot,onKeyDown:at,tabsRef:lt}=useTabsContext(),{t:ut}=useTranslation(),ct=clsx("nav-link d-inline-flex gap-8 border-0",st===rt?"selected":"");return jsxRuntimeExports.jsx("li",{className:"nav-item flex-shrink-0",role:"presentation",children:jsxRuntimeExports.jsxs("button",{ref:dt=>lt.current[nt]=dt,type:"button",id:`tab-${rt}`,className:ct,onClick:()=>ot(rt),onKeyDown:dt=>at(dt),role:"tab","aria-controls":`tabpanel-${rt}`,"aria-selected":st===rt,tabIndex:st===rt?0:-1,children:[tt,jsxRuntimeExports.jsx("small",{children:ut(et)})]})})},TabsList=tt=>{const{items:et,tabUnderlineLeft:rt,tabUnderlineWidth:nt}=useTabsContext(),{className:st,...ot}=tt,at=clsx("position-relative flex-shrink-0 overflow-x-auto",st);return jsxRuntimeExports.jsxs("div",{className:at,...ot,children:[jsxRuntimeExports.jsx("ul",{className:"nav nav-tabs flex-nowrap",role:"tablist",children:et.map((lt,ut)=>jsxRuntimeExports.jsx(Tabs.Item,{order:ut,...lt},lt.id))}),jsxRuntimeExports.jsx("span",{className:"nav-slide",style:{left:rt,width:nt}})]})},TabsPanel=({children:tt,currentItem:et})=>{const{activeTab:rt}=useTabsContext();return jsxRuntimeExports.jsx("div",{className:"tab-content d-flex flex-fill w-100",children:jsxRuntimeExports.jsx("div",{className:`tab-pane flex-fill w-100 fade ${rt===(et==null?void 0:et.id)?"show active":""}`,id:`tabpanel-${et==null?void 0:et.id}`,role:"tabpanel","aria-labelledby":`tab-${et==null?void 0:et.id}`,tabIndex:0,children:tt})})},Tabs=({defaultId:tt,items:et,onChange:rt,children:nt})=>{const{activeTab:st,setSelectedTab:ot,tabsRef:at,tabUnderlineLeft:lt,tabUnderlineWidth:ut,onKeyDown:ct}=useTabs({defaultId:tt,items:et,onChange:rt}),dt=reactExports.useMemo(()=>({activeTab:st,items:et,setSelectedTab:ot,tabsRef:at,tabUnderlineLeft:lt,tabUnderlineWidth:ut,onKeyDown:ct}),[st,et,ct,ot,lt,ut,at]),ht=et.find(mt=>mt.id===st);return jsxRuntimeExports.jsx(TabsContext.Provider,{value:dt,children:typeof nt=="function"?nt(ht):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tabs.List,{}),jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:ht,children:ht==null?void 0:ht.content})]})})};Tabs.Item=TabsItem;Tabs.Panel=TabsPanel;Tabs.List=TabsList;const TextArea=reactExports.forwardRef(({noValidationIcon:tt,placeholder:et,size:rt="md",height:nt="md",className:st,...ot},at)=>{const{id:lt,isRequired:ut,isReadOnly:ct,status:dt}=useFormControl(),ht=clsx({"form-control":!ct,"form-control-lg":rt==="lg","form-control-sm":rt==="sm","textarea-height-lg":nt==="lg","textarea-height-md":nt==="md","textarea-height-sm":nt==="sm","is-invalid":dt==="invalid","is-valid":dt==="valid","form-control-plaintext":ct,"no-validation-icon":tt},st);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("textarea",{ref:at,id:lt,className:ht,placeholder:et,required:ut,readOnly:ct,...ot})})}),useMediaLibrary=()=>{const tt=reactExports.useRef(null),[et,rt]=reactExports.useState(),{remove:nt}=useWorkspaceFile();return{ref:tt,libraryMedia:et,setLibraryMedia:rt,onCancel:async st=>{var ot,at;(ot=tt.current)!=null&&ot.type&&st&&st.length>0&&await nt(st),(at=tt.current)==null||at.hide()},onSuccess:st=>{var ot,at,lt,ut;let ct;switch((ot=tt.current)==null?void 0:ot.type){case"video":{if(typeof st=="object")ct=st[0];else{const dt=new DOMParser().parseFromString(st,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(at=tt.current)==null||at.hide(),ct=ht}break}case"embedder":{const dt=new DOMParser().parseFromString(st,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(lt=tt.current)==null||lt.hide(),ct=ht;break}case"audio":{st.length===void 0?ct=st:ct=st[0];break}case"hyperlink":{ct=st;break}case"image":{ct=`/workspace/document/${st[0]._id}`;break}default:ct=st[0]}(ut=tt.current)==null||ut.hide(),rt(ct)},onTabChange:async(st,ot)=>{var at;(at=tt.current)!=null&&at.type&&ot&&ot.length>0&&await nt(ot)}}},useResourceSearch=tt=>{const[et,rt]=reactExports.useState([]);reactExports.useEffect(()=>{(async()=>(await SnipletsService.initialize(odeServices,tt),await SnipletsService.registerBehaviours(tt),rt(SnipletsService.resourceProducingApps)))()},[]);const nt=reactExports.useCallback(async st=>{const[ot]=st.types;return await odeServices.behaviour(tt,ot).loadResources(st)},[tt]);return{resourceApplications:et,loadResources:nt}};function isObject$3(tt){return tt!==null&&typeof tt=="object"&&"constructor"in tt&&tt.constructor===Object}function extend$2(tt,et){tt===void 0&&(tt={}),et===void 0&&(et={}),Object.keys(et).forEach(rt=>{typeof tt[rt]>"u"?tt[rt]=et[rt]:isObject$3(et[rt])&&isObject$3(tt[rt])&&Object.keys(et[rt]).length>0&&extend$2(tt[rt],et[rt])})}const ssrDocument={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function getDocument(){const tt=typeof document<"u"?document:{};return extend$2(tt,ssrDocument),tt}const ssrWindow={document:ssrDocument,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function tt(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(tt){return typeof setTimeout>"u"?(tt(),null):setTimeout(tt,0)},cancelAnimationFrame(tt){typeof setTimeout>"u"||clearTimeout(tt)}};function getWindow(){const tt=typeof window<"u"?window:{};return extend$2(tt,ssrWindow),tt}function deleteProps(tt){const et=tt;Object.keys(et).forEach(rt=>{try{et[rt]=null}catch{}try{delete et[rt]}catch{}})}function nextTick(tt,et){return et===void 0&&(et=0),setTimeout(tt,et)}function now(){return Date.now()}function getComputedStyle$1(tt){const et=getWindow();let rt;return et.getComputedStyle&&(rt=et.getComputedStyle(tt,null)),!rt&&tt.currentStyle&&(rt=tt.currentStyle),rt||(rt=tt.style),rt}function getTranslate(tt,et){et===void 0&&(et="x");const rt=getWindow();let nt,st,ot;const at=getComputedStyle$1(tt);return rt.WebKitCSSMatrix?(st=at.transform||at.webkitTransform,st.split(",").length>6&&(st=st.split(", ").map(lt=>lt.replace(",",".")).join(", ")),ot=new rt.WebKitCSSMatrix(st==="none"?"":st)):(ot=at.MozTransform||at.OTransform||at.MsTransform||at.msTransform||at.transform||at.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),nt=ot.toString().split(",")),et==="x"&&(rt.WebKitCSSMatrix?st=ot.m41:nt.length===16?st=parseFloat(nt[12]):st=parseFloat(nt[4])),et==="y"&&(rt.WebKitCSSMatrix?st=ot.m42:nt.length===16?st=parseFloat(nt[13]):st=parseFloat(nt[5])),st||0}function isObject$2(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"}function isNode(tt){return typeof window<"u"&&typeof window.HTMLElement<"u"?tt instanceof HTMLElement:tt&&(tt.nodeType===1||tt.nodeType===11)}function extend$1(){const tt=Object(arguments.length<=0?void 0:arguments[0]),et=["__proto__","constructor","prototype"];for(let rt=1;rt<arguments.length;rt+=1){const nt=rt<0||arguments.length<=rt?void 0:arguments[rt];if(nt!=null&&!isNode(nt)){const st=Object.keys(Object(nt)).filter(ot=>et.indexOf(ot)<0);for(let ot=0,at=st.length;ot<at;ot+=1){const lt=st[ot],ut=Object.getOwnPropertyDescriptor(nt,lt);ut!==void 0&&ut.enumerable&&(isObject$2(tt[lt])&&isObject$2(nt[lt])?nt[lt].__swiper__?tt[lt]=nt[lt]:extend$1(tt[lt],nt[lt]):!isObject$2(tt[lt])&&isObject$2(nt[lt])?(tt[lt]={},nt[lt].__swiper__?tt[lt]=nt[lt]:extend$1(tt[lt],nt[lt])):tt[lt]=nt[lt])}}}return tt}function setCSSProperty(tt,et,rt){tt.style.setProperty(et,rt)}function animateCSSModeScroll(tt){let{swiper:et,targetPosition:rt,side:nt}=tt;const st=getWindow(),ot=-et.translate;let at=null,lt;const ut=et.params.speed;et.wrapperEl.style.scrollSnapType="none",st.cancelAnimationFrame(et.cssModeFrameID);const ct=rt>ot?"next":"prev",dt=(mt,xt)=>ct==="next"&&mt>=xt||ct==="prev"&&mt<=xt,ht=()=>{lt=new Date().getTime(),at===null&&(at=lt);const mt=Math.max(Math.min((lt-at)/ut,1),0),xt=.5-Math.cos(mt*Math.PI)/2;let yt=ot+xt*(rt-ot);if(dt(yt,rt)&&(yt=rt),et.wrapperEl.scrollTo({[nt]:yt}),dt(yt,rt)){et.wrapperEl.style.overflow="hidden",et.wrapperEl.style.scrollSnapType="",setTimeout(()=>{et.wrapperEl.style.overflow="",et.wrapperEl.scrollTo({[nt]:yt})}),st.cancelAnimationFrame(et.cssModeFrameID);return}et.cssModeFrameID=st.requestAnimationFrame(ht)};ht()}function elementChildren(tt,et){return et===void 0&&(et=""),[...tt.children].filter(rt=>rt.matches(et))}function createElement(tt,et){et===void 0&&(et=[]);const rt=document.createElement(tt);return rt.classList.add(...Array.isArray(et)?et:[et]),rt}function elementPrevAll(tt,et){const rt=[];for(;tt.previousElementSibling;){const nt=tt.previousElementSibling;et?nt.matches(et)&&rt.push(nt):rt.push(nt),tt=nt}return rt}function elementNextAll(tt,et){const rt=[];for(;tt.nextElementSibling;){const nt=tt.nextElementSibling;et?nt.matches(et)&&rt.push(nt):rt.push(nt),tt=nt}return rt}function elementStyle(tt,et){return getWindow().getComputedStyle(tt,null).getPropertyValue(et)}function elementIndex(tt){let et=tt,rt;if(et){for(rt=0;(et=et.previousSibling)!==null;)et.nodeType===1&&(rt+=1);return rt}}function elementParents(tt,et){const rt=[];let nt=tt.parentElement;for(;nt;)et?nt.matches(et)&&rt.push(nt):rt.push(nt),nt=nt.parentElement;return rt}function elementOuterSize(tt,et,rt){const nt=getWindow();return tt[et==="width"?"offsetWidth":"offsetHeight"]+parseFloat(nt.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-right":"margin-top"))+parseFloat(nt.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-left":"margin-bottom"))}function createElementIfNotDefined(tt,et,rt,nt){return tt.params.createElements&&Object.keys(nt).forEach(st=>{if(!rt[st]&&rt.auto===!0){let ot=elementChildren(tt.el,`.${nt[st]}`)[0];ot||(ot=createElement("div",nt[st]),ot.className=nt[st],tt.el.append(ot)),rt[st]=ot,et[st]=ot}}),rt}function classesToSelector(tt){return tt===void 0&&(tt=""),`.${tt.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function Pagination(tt){let{swiper:et,extendParams:rt,on:nt,emit:st}=tt;const ot="swiper-pagination";rt({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:St=>St,formatFractionTotal:St=>St,bulletClass:`${ot}-bullet`,bulletActiveClass:`${ot}-bullet-active`,modifierClass:`${ot}-`,currentClass:`${ot}-current`,totalClass:`${ot}-total`,hiddenClass:`${ot}-hidden`,progressbarFillClass:`${ot}-progressbar-fill`,progressbarOppositeClass:`${ot}-progressbar-opposite`,clickableClass:`${ot}-clickable`,lockClass:`${ot}-lock`,horizontalClass:`${ot}-horizontal`,verticalClass:`${ot}-vertical`,paginationDisabledClass:`${ot}-disabled`}}),et.pagination={el:null,bullets:[]};let at,lt=0;const ut=St=>(Array.isArray(St)?St:[St]).filter(wt=>!!wt);function ct(){return!et.params.pagination.el||!et.pagination.el||Array.isArray(et.pagination.el)&&et.pagination.el.length===0}function dt(St,wt){const{bulletActiveClass:Rt}=et.params.pagination;St&&(St=St[`${wt==="prev"?"previous":"next"}ElementSibling`],St&&(St.classList.add(`${Rt}-${wt}`),St=St[`${wt==="prev"?"previous":"next"}ElementSibling`],St&&St.classList.add(`${Rt}-${wt}-${wt}`)))}function ht(St){const wt=St.target.closest(classesToSelector(et.params.pagination.bulletClass));if(!wt)return;St.preventDefault();const Rt=elementIndex(wt)*et.params.slidesPerGroup;if(et.params.loop){if(et.realIndex===Rt)return;const Ct=et.realIndex,Pt=et.getSlideIndexByData(Rt),It=et.getSlideIndexByData(et.realIndex),jt=Dt=>{const Vt=et.activeIndex;et.loopFix({direction:Dt,activeSlideIndex:Pt,slideTo:!1});const Ft=et.activeIndex;Vt===Ft&&et.slideToLoop(Ct,0,!1,!0)};if(Pt>et.slides.length-et.loopedSlides)jt(Pt>It?"next":"prev");else if(et.params.centeredSlides){const Dt=et.params.slidesPerView==="auto"?et.slidesPerViewDynamic():Math.ceil(parseFloat(et.params.slidesPerView,10));Pt<Math.floor(Dt/2)&&jt("prev")}et.slideToLoop(Rt)}else et.slideTo(Rt)}function mt(){const St=et.rtl,wt=et.params.pagination;if(ct())return;let Rt=et.pagination.el;Rt=ut(Rt);let Ct,Pt;const It=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length,jt=et.params.loop?Math.ceil(It/et.params.slidesPerGroup):et.snapGrid.length;if(et.params.loop?(Pt=et.previousRealIndex||0,Ct=et.params.slidesPerGroup>1?Math.floor(et.realIndex/et.params.slidesPerGroup):et.realIndex):typeof et.snapIndex<"u"?(Ct=et.snapIndex,Pt=et.previousSnapIndex):(Pt=et.previousIndex||0,Ct=et.activeIndex||0),wt.type==="bullets"&&et.pagination.bullets&&et.pagination.bullets.length>0){const Dt=et.pagination.bullets;let Vt,Ft,Ht;if(wt.dynamicBullets&&(at=elementOuterSize(Dt[0],et.isHorizontal()?"width":"height"),Rt.forEach(Nt=>{Nt.style[et.isHorizontal()?"width":"height"]=`${at*(wt.dynamicMainBullets+4)}px`}),wt.dynamicMainBullets>1&&Pt!==void 0&&(lt+=Ct-(Pt||0),lt>wt.dynamicMainBullets-1?lt=wt.dynamicMainBullets-1:lt<0&&(lt=0)),Vt=Math.max(Ct-lt,0),Ft=Vt+(Math.min(Dt.length,wt.dynamicMainBullets)-1),Ht=(Ft+Vt)/2),Dt.forEach(Nt=>{const Lt=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(Mt=>`${wt.bulletActiveClass}${Mt}`)].map(Mt=>typeof Mt=="string"&&Mt.includes(" ")?Mt.split(" "):Mt).flat();Nt.classList.remove(...Lt)}),Rt.length>1)Dt.forEach(Nt=>{const Lt=elementIndex(Nt);Lt===Ct?Nt.classList.add(...wt.bulletActiveClass.split(" ")):et.isElement&&Nt.setAttribute("part","bullet"),wt.dynamicBullets&&(Lt>=Vt&&Lt<=Ft&&Nt.classList.add(...`${wt.bulletActiveClass}-main`.split(" ")),Lt===Vt&&dt(Nt,"prev"),Lt===Ft&&dt(Nt,"next"))});else{const Nt=Dt[Ct];if(Nt&&Nt.classList.add(...wt.bulletActiveClass.split(" ")),et.isElement&&Dt.forEach((Lt,Mt)=>{Lt.setAttribute("part",Mt===Ct?"bullet-active":"bullet")}),wt.dynamicBullets){const Lt=Dt[Vt],Mt=Dt[Ft];for(let zt=Vt;zt<=Ft;zt+=1)Dt[zt]&&Dt[zt].classList.add(...`${wt.bulletActiveClass}-main`.split(" "));dt(Lt,"prev"),dt(Mt,"next")}}if(wt.dynamicBullets){const Nt=Math.min(Dt.length,wt.dynamicMainBullets+4),Lt=(at*Nt-at)/2-Ht*at,Mt=St?"right":"left";Dt.forEach(zt=>{zt.style[et.isHorizontal()?Mt:"top"]=`${Lt}px`})}}Rt.forEach((Dt,Vt)=>{if(wt.type==="fraction"&&(Dt.querySelectorAll(classesToSelector(wt.currentClass)).forEach(Ft=>{Ft.textContent=wt.formatFractionCurrent(Ct+1)}),Dt.querySelectorAll(classesToSelector(wt.totalClass)).forEach(Ft=>{Ft.textContent=wt.formatFractionTotal(jt)})),wt.type==="progressbar"){let Ft;wt.progressbarOpposite?Ft=et.isHorizontal()?"vertical":"horizontal":Ft=et.isHorizontal()?"horizontal":"vertical";const Ht=(Ct+1)/jt;let Nt=1,Lt=1;Ft==="horizontal"?Nt=Ht:Lt=Ht,Dt.querySelectorAll(classesToSelector(wt.progressbarFillClass)).forEach(Mt=>{Mt.style.transform=`translate3d(0,0,0) scaleX(${Nt}) scaleY(${Lt})`,Mt.style.transitionDuration=`${et.params.speed}ms`})}wt.type==="custom"&&wt.renderCustom?(Dt.innerHTML=wt.renderCustom(et,Ct+1,jt),Vt===0&&st("paginationRender",Dt)):(Vt===0&&st("paginationRender",Dt),st("paginationUpdate",Dt)),et.params.watchOverflow&&et.enabled&&Dt.classList[et.isLocked?"add":"remove"](wt.lockClass)})}function xt(){const St=et.params.pagination;if(ct())return;const wt=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length;let Rt=et.pagination.el;Rt=ut(Rt);let Ct="";if(St.type==="bullets"){let Pt=et.params.loop?Math.ceil(wt/et.params.slidesPerGroup):et.snapGrid.length;et.params.freeMode&&et.params.freeMode.enabled&&Pt>wt&&(Pt=wt);for(let It=0;It<Pt;It+=1)St.renderBullet?Ct+=St.renderBullet.call(et,It,St.bulletClass):Ct+=`<${St.bulletElement} ${et.isElement?'part="bullet"':""} class="${St.bulletClass}"></${St.bulletElement}>`}St.type==="fraction"&&(St.renderFraction?Ct=St.renderFraction.call(et,St.currentClass,St.totalClass):Ct=`<span class="${St.currentClass}"></span> / <span class="${St.totalClass}"></span>`),St.type==="progressbar"&&(St.renderProgressbar?Ct=St.renderProgressbar.call(et,St.progressbarFillClass):Ct=`<span class="${St.progressbarFillClass}"></span>`),et.pagination.bullets=[],Rt.forEach(Pt=>{St.type!=="custom"&&(Pt.innerHTML=Ct||""),St.type==="bullets"&&et.pagination.bullets.push(...Pt.querySelectorAll(classesToSelector(St.bulletClass)))}),St.type!=="custom"&&st("paginationRender",Rt[0])}function yt(){et.params.pagination=createElementIfNotDefined(et,et.originalParams.pagination,et.params.pagination,{el:"swiper-pagination"});const St=et.params.pagination;if(!St.el)return;let wt;typeof St.el=="string"&&et.isElement&&(wt=et.el.querySelector(St.el)),!wt&&typeof St.el=="string"&&(wt=[...document.querySelectorAll(St.el)]),wt||(wt=St.el),!(!wt||wt.length===0)&&(et.params.uniqueNavElements&&typeof St.el=="string"&&Array.isArray(wt)&&wt.length>1&&(wt=[...et.el.querySelectorAll(St.el)],wt.length>1&&(wt=wt.filter(Rt=>elementParents(Rt,".swiper")[0]===et.el)[0])),Array.isArray(wt)&&wt.length===1&&(wt=wt[0]),Object.assign(et.pagination,{el:wt}),wt=ut(wt),wt.forEach(Rt=>{St.type==="bullets"&&St.clickable&&Rt.classList.add(...(St.clickableClass||"").split(" ")),Rt.classList.add(St.modifierClass+St.type),Rt.classList.add(et.isHorizontal()?St.horizontalClass:St.verticalClass),St.type==="bullets"&&St.dynamicBullets&&(Rt.classList.add(`${St.modifierClass}${St.type}-dynamic`),lt=0,St.dynamicMainBullets<1&&(St.dynamicMainBullets=1)),St.type==="progressbar"&&St.progressbarOpposite&&Rt.classList.add(St.progressbarOppositeClass),St.clickable&&Rt.addEventListener("click",ht),et.enabled||Rt.classList.add(St.lockClass)}))}function vt(){const St=et.params.pagination;if(ct())return;let wt=et.pagination.el;wt&&(wt=ut(wt),wt.forEach(Rt=>{Rt.classList.remove(St.hiddenClass),Rt.classList.remove(St.modifierClass+St.type),Rt.classList.remove(et.isHorizontal()?St.horizontalClass:St.verticalClass),St.clickable&&(Rt.classList.remove(...(St.clickableClass||"").split(" ")),Rt.removeEventListener("click",ht))})),et.pagination.bullets&&et.pagination.bullets.forEach(Rt=>Rt.classList.remove(...St.bulletActiveClass.split(" ")))}nt("changeDirection",()=>{if(!et.pagination||!et.pagination.el)return;const St=et.params.pagination;let{el:wt}=et.pagination;wt=ut(wt),wt.forEach(Rt=>{Rt.classList.remove(St.horizontalClass,St.verticalClass),Rt.classList.add(et.isHorizontal()?St.horizontalClass:St.verticalClass)})}),nt("init",()=>{et.params.pagination.enabled===!1?bt():(yt(),xt(),mt())}),nt("activeIndexChange",()=>{typeof et.snapIndex>"u"&&mt()}),nt("snapIndexChange",()=>{mt()}),nt("snapGridLengthChange",()=>{xt(),mt()}),nt("destroy",()=>{vt()}),nt("enable disable",()=>{let{el:St}=et.pagination;St&&(St=ut(St),St.forEach(wt=>wt.classList[et.enabled?"remove":"add"](et.params.pagination.lockClass)))}),nt("lock unlock",()=>{mt()}),nt("click",(St,wt)=>{const Rt=wt.target,Ct=ut(et.pagination.el);if(et.params.pagination.el&&et.params.pagination.hideOnClick&&Ct&&Ct.length>0&&!Rt.classList.contains(et.params.pagination.bulletClass)){if(et.navigation&&(et.navigation.nextEl&&Rt===et.navigation.nextEl||et.navigation.prevEl&&Rt===et.navigation.prevEl))return;const Pt=Ct[0].classList.contains(et.params.pagination.hiddenClass);st(Pt===!0?"paginationShow":"paginationHide"),Ct.forEach(It=>It.classList.toggle(et.params.pagination.hiddenClass))}});const Et=()=>{et.el.classList.remove(et.params.pagination.paginationDisabledClass);let{el:St}=et.pagination;St&&(St=ut(St),St.forEach(wt=>wt.classList.remove(et.params.pagination.paginationDisabledClass))),yt(),xt(),mt()},bt=()=>{et.el.classList.add(et.params.pagination.paginationDisabledClass);let{el:St}=et.pagination;St&&(St=ut(St),St.forEach(wt=>wt.classList.add(et.params.pagination.paginationDisabledClass))),vt()};Object.assign(et.pagination,{enable:Et,disable:bt,render:xt,update:mt,init:yt,destroy:vt})}let support;function calcSupport(){const tt=getWindow(),et=getDocument();return{smoothScroll:et.documentElement&&et.documentElement.style&&"scrollBehavior"in et.documentElement.style,touch:!!("ontouchstart"in tt||tt.DocumentTouch&&et instanceof tt.DocumentTouch)}}function getSupport(){return support||(support=calcSupport()),support}let deviceCached;function calcDevice(tt){let{userAgent:et}=tt===void 0?{}:tt;const rt=getSupport(),nt=getWindow(),st=nt.navigator.platform,ot=et||nt.navigator.userAgent,at={ios:!1,android:!1},lt=nt.screen.width,ut=nt.screen.height,ct=ot.match(/(Android);?[\s\/]+([\d.]+)?/);let dt=ot.match(/(iPad).*OS\s([\d_]+)/);const ht=ot.match(/(iPod)(.*OS\s([\d_]+))?/),mt=!dt&&ot.match(/(iPhone\sOS|iOS)\s([\d_]+)/),xt=st==="Win32";let yt=st==="MacIntel";const vt=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!dt&&yt&&rt.touch&&vt.indexOf(`${lt}x${ut}`)>=0&&(dt=ot.match(/(Version)\/([\d.]+)/),dt||(dt=[0,1,"13_0_0"]),yt=!1),ct&&!xt&&(at.os="android",at.android=!0),(dt||mt||ht)&&(at.os="ios",at.ios=!0),at}function getDevice(tt){return tt===void 0&&(tt={}),deviceCached||(deviceCached=calcDevice(tt)),deviceCached}let browser;function calcBrowser(){const tt=getWindow();let et=!1;function rt(){const nt=tt.navigator.userAgent.toLowerCase();return nt.indexOf("safari")>=0&&nt.indexOf("chrome")<0&&nt.indexOf("android")<0}if(rt()){const nt=String(tt.navigator.userAgent);if(nt.includes("Version/")){const[st,ot]=nt.split("Version/")[1].split(" ")[0].split(".").map(at=>Number(at));et=st<16||st===16&&ot<2}}return{isSafari:et||rt(),needPerspectiveFix:et,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(tt.navigator.userAgent)}}function getBrowser(){return browser||(browser=calcBrowser()),browser}function Resize(tt){let{swiper:et,on:rt,emit:nt}=tt;const st=getWindow();let ot=null,at=null;const lt=()=>{!et||et.destroyed||!et.initialized||(nt("beforeResize"),nt("resize"))},ut=()=>{!et||et.destroyed||!et.initialized||(ot=new ResizeObserver(ht=>{at=st.requestAnimationFrame(()=>{const{width:mt,height:xt}=et;let yt=mt,vt=xt;ht.forEach(Et=>{let{contentBoxSize:bt,contentRect:St,target:wt}=Et;wt&&wt!==et.el||(yt=St?St.width:(bt[0]||bt).inlineSize,vt=St?St.height:(bt[0]||bt).blockSize)}),(yt!==mt||vt!==xt)&&lt()})}),ot.observe(et.el))},ct=()=>{at&&st.cancelAnimationFrame(at),ot&&ot.unobserve&&et.el&&(ot.unobserve(et.el),ot=null)},dt=()=>{!et||et.destroyed||!et.initialized||nt("orientationchange")};rt("init",()=>{if(et.params.resizeObserver&&typeof st.ResizeObserver<"u"){ut();return}st.addEventListener("resize",lt),st.addEventListener("orientationchange",dt)}),rt("destroy",()=>{ct(),st.removeEventListener("resize",lt),st.removeEventListener("orientationchange",dt)})}function Observer(tt){let{swiper:et,extendParams:rt,on:nt,emit:st}=tt;const ot=[],at=getWindow(),lt=function(dt,ht){ht===void 0&&(ht={});const mt=at.MutationObserver||at.WebkitMutationObserver,xt=new mt(yt=>{if(et.__preventObserver__)return;if(yt.length===1){st("observerUpdate",yt[0]);return}const vt=function(){st("observerUpdate",yt[0])};at.requestAnimationFrame?at.requestAnimationFrame(vt):at.setTimeout(vt,0)});xt.observe(dt,{attributes:typeof ht.attributes>"u"?!0:ht.attributes,childList:typeof ht.childList>"u"?!0:ht.childList,characterData:typeof ht.characterData>"u"?!0:ht.characterData}),ot.push(xt)},ut=()=>{if(et.params.observer){if(et.params.observeParents){const dt=elementParents(et.hostEl);for(let ht=0;ht<dt.length;ht+=1)lt(dt[ht])}lt(et.hostEl,{childList:et.params.observeSlideChildren}),lt(et.wrapperEl,{attributes:!1})}},ct=()=>{ot.forEach(dt=>{dt.disconnect()}),ot.splice(0,ot.length)};rt({observer:!1,observeParents:!1,observeSlideChildren:!1}),nt("init",ut),nt("destroy",ct)}var eventsEmitter={on(tt,et,rt){const nt=this;if(!nt.eventsListeners||nt.destroyed||typeof et!="function")return nt;const st=rt?"unshift":"push";return tt.split(" ").forEach(ot=>{nt.eventsListeners[ot]||(nt.eventsListeners[ot]=[]),nt.eventsListeners[ot][st](et)}),nt},once(tt,et,rt){const nt=this;if(!nt.eventsListeners||nt.destroyed||typeof et!="function")return nt;function st(){nt.off(tt,st),st.__emitterProxy&&delete st.__emitterProxy;for(var ot=arguments.length,at=new Array(ot),lt=0;lt<ot;lt++)at[lt]=arguments[lt];et.apply(nt,at)}return st.__emitterProxy=et,nt.on(tt,st,rt)},onAny(tt,et){const rt=this;if(!rt.eventsListeners||rt.destroyed||typeof tt!="function")return rt;const nt=et?"unshift":"push";return rt.eventsAnyListeners.indexOf(tt)<0&&rt.eventsAnyListeners[nt](tt),rt},offAny(tt){const et=this;if(!et.eventsListeners||et.destroyed||!et.eventsAnyListeners)return et;const rt=et.eventsAnyListeners.indexOf(tt);return rt>=0&&et.eventsAnyListeners.splice(rt,1),et},off(tt,et){const rt=this;return!rt.eventsListeners||rt.destroyed||!rt.eventsListeners||tt.split(" ").forEach(nt=>{typeof et>"u"?rt.eventsListeners[nt]=[]:rt.eventsListeners[nt]&&rt.eventsListeners[nt].forEach((st,ot)=>{(st===et||st.__emitterProxy&&st.__emitterProxy===et)&&rt.eventsListeners[nt].splice(ot,1)})}),rt},emit(){const tt=this;if(!tt.eventsListeners||tt.destroyed||!tt.eventsListeners)return tt;let et,rt,nt;for(var st=arguments.length,ot=new Array(st),at=0;at<st;at++)ot[at]=arguments[at];return typeof ot[0]=="string"||Array.isArray(ot[0])?(et=ot[0],rt=ot.slice(1,ot.length),nt=tt):(et=ot[0].events,rt=ot[0].data,nt=ot[0].context||tt),rt.unshift(nt),(Array.isArray(et)?et:et.split(" ")).forEach(ut=>{tt.eventsAnyListeners&&tt.eventsAnyListeners.length&&tt.eventsAnyListeners.forEach(ct=>{ct.apply(nt,[ut,...rt])}),tt.eventsListeners&&tt.eventsListeners[ut]&&tt.eventsListeners[ut].forEach(ct=>{ct.apply(nt,rt)})}),tt}};function updateSize(){const tt=this;let et,rt;const nt=tt.el;typeof tt.params.width<"u"&&tt.params.width!==null?et=tt.params.width:et=nt.clientWidth,typeof tt.params.height<"u"&&tt.params.height!==null?rt=tt.params.height:rt=nt.clientHeight,!(et===0&&tt.isHorizontal()||rt===0&&tt.isVertical())&&(et=et-parseInt(elementStyle(nt,"padding-left")||0,10)-parseInt(elementStyle(nt,"padding-right")||0,10),rt=rt-parseInt(elementStyle(nt,"padding-top")||0,10)-parseInt(elementStyle(nt,"padding-bottom")||0,10),Number.isNaN(et)&&(et=0),Number.isNaN(rt)&&(rt=0),Object.assign(tt,{width:et,height:rt,size:tt.isHorizontal()?et:rt}))}function updateSlides(){const tt=this;function et(Ft){return tt.isHorizontal()?Ft:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[Ft]}function rt(Ft,Ht){return parseFloat(Ft.getPropertyValue(et(Ht))||0)}const nt=tt.params,{wrapperEl:st,slidesEl:ot,size:at,rtlTranslate:lt,wrongRTL:ut}=tt,ct=tt.virtual&&nt.virtual.enabled,dt=ct?tt.virtual.slides.length:tt.slides.length,ht=elementChildren(ot,`.${tt.params.slideClass}, swiper-slide`),mt=ct?tt.virtual.slides.length:ht.length;let xt=[];const yt=[],vt=[];let Et=nt.slidesOffsetBefore;typeof Et=="function"&&(Et=nt.slidesOffsetBefore.call(tt));let bt=nt.slidesOffsetAfter;typeof bt=="function"&&(bt=nt.slidesOffsetAfter.call(tt));const St=tt.snapGrid.length,wt=tt.slidesGrid.length;let Rt=nt.spaceBetween,Ct=-Et,Pt=0,It=0;if(typeof at>"u")return;typeof Rt=="string"&&Rt.indexOf("%")>=0?Rt=parseFloat(Rt.replace("%",""))/100*at:typeof Rt=="string"&&(Rt=parseFloat(Rt)),tt.virtualSize=-Rt,ht.forEach(Ft=>{lt?Ft.style.marginLeft="":Ft.style.marginRight="",Ft.style.marginBottom="",Ft.style.marginTop=""}),nt.centeredSlides&&nt.cssMode&&(setCSSProperty(st,"--swiper-centered-offset-before",""),setCSSProperty(st,"--swiper-centered-offset-after",""));const jt=nt.grid&&nt.grid.rows>1&&tt.grid;jt&&tt.grid.initSlides(mt);let Dt;const Vt=nt.slidesPerView==="auto"&&nt.breakpoints&&Object.keys(nt.breakpoints).filter(Ft=>typeof nt.breakpoints[Ft].slidesPerView<"u").length>0;for(let Ft=0;Ft<mt;Ft+=1){Dt=0;let Ht;if(ht[Ft]&&(Ht=ht[Ft]),jt&&tt.grid.updateSlide(Ft,Ht,mt,et),!(ht[Ft]&&elementStyle(Ht,"display")==="none")){if(nt.slidesPerView==="auto"){Vt&&(ht[Ft].style[et("width")]="");const Nt=getComputedStyle(Ht),Lt=Ht.style.transform,Mt=Ht.style.webkitTransform;if(Lt&&(Ht.style.transform="none"),Mt&&(Ht.style.webkitTransform="none"),nt.roundLengths)Dt=tt.isHorizontal()?elementOuterSize(Ht,"width"):elementOuterSize(Ht,"height");else{const zt=rt(Nt,"width"),Gt=rt(Nt,"padding-left"),$t=rt(Nt,"padding-right"),Ut=rt(Nt,"margin-left"),Bt=rt(Nt,"margin-right"),Yt=Nt.getPropertyValue("box-sizing");if(Yt&&Yt==="border-box")Dt=zt+Ut+Bt;else{const{clientWidth:Zt,offsetWidth:Xt}=Ht;Dt=zt+Gt+$t+Ut+Bt+(Xt-Zt)}}Lt&&(Ht.style.transform=Lt),Mt&&(Ht.style.webkitTransform=Mt),nt.roundLengths&&(Dt=Math.floor(Dt))}else Dt=(at-(nt.slidesPerView-1)*Rt)/nt.slidesPerView,nt.roundLengths&&(Dt=Math.floor(Dt)),ht[Ft]&&(ht[Ft].style[et("width")]=`${Dt}px`);ht[Ft]&&(ht[Ft].swiperSlideSize=Dt),vt.push(Dt),nt.centeredSlides?(Ct=Ct+Dt/2+Pt/2+Rt,Pt===0&&Ft!==0&&(Ct=Ct-at/2-Rt),Ft===0&&(Ct=Ct-at/2-Rt),Math.abs(Ct)<1/1e3&&(Ct=0),nt.roundLengths&&(Ct=Math.floor(Ct)),It%nt.slidesPerGroup===0&&xt.push(Ct),yt.push(Ct)):(nt.roundLengths&&(Ct=Math.floor(Ct)),(It-Math.min(tt.params.slidesPerGroupSkip,It))%tt.params.slidesPerGroup===0&&xt.push(Ct),yt.push(Ct),Ct=Ct+Dt+Rt),tt.virtualSize+=Dt+Rt,Pt=Dt,It+=1}}if(tt.virtualSize=Math.max(tt.virtualSize,at)+bt,lt&&ut&&(nt.effect==="slide"||nt.effect==="coverflow")&&(st.style.width=`${tt.virtualSize+Rt}px`),nt.setWrapperSize&&(st.style[et("width")]=`${tt.virtualSize+Rt}px`),jt&&tt.grid.updateWrapperSize(Dt,xt,et),!nt.centeredSlides){const Ft=[];for(let Ht=0;Ht<xt.length;Ht+=1){let Nt=xt[Ht];nt.roundLengths&&(Nt=Math.floor(Nt)),xt[Ht]<=tt.virtualSize-at&&Ft.push(Nt)}xt=Ft,Math.floor(tt.virtualSize-at)-Math.floor(xt[xt.length-1])>1&&xt.push(tt.virtualSize-at)}if(ct&&nt.loop){const Ft=vt[0]+Rt;if(nt.slidesPerGroup>1){const Ht=Math.ceil((tt.virtual.slidesBefore+tt.virtual.slidesAfter)/nt.slidesPerGroup),Nt=Ft*nt.slidesPerGroup;for(let Lt=0;Lt<Ht;Lt+=1)xt.push(xt[xt.length-1]+Nt)}for(let Ht=0;Ht<tt.virtual.slidesBefore+tt.virtual.slidesAfter;Ht+=1)nt.slidesPerGroup===1&&xt.push(xt[xt.length-1]+Ft),yt.push(yt[yt.length-1]+Ft),tt.virtualSize+=Ft}if(xt.length===0&&(xt=[0]),Rt!==0){const Ft=tt.isHorizontal()&&lt?"marginLeft":et("marginRight");ht.filter((Ht,Nt)=>!nt.cssMode||nt.loop?!0:Nt!==ht.length-1).forEach(Ht=>{Ht.style[Ft]=`${Rt}px`})}if(nt.centeredSlides&&nt.centeredSlidesBounds){let Ft=0;vt.forEach(Nt=>{Ft+=Nt+(Rt||0)}),Ft-=Rt;const Ht=Ft-at;xt=xt.map(Nt=>Nt<=0?-Et:Nt>Ht?Ht+bt:Nt)}if(nt.centerInsufficientSlides){let Ft=0;if(vt.forEach(Ht=>{Ft+=Ht+(Rt||0)}),Ft-=Rt,Ft<at){const Ht=(at-Ft)/2;xt.forEach((Nt,Lt)=>{xt[Lt]=Nt-Ht}),yt.forEach((Nt,Lt)=>{yt[Lt]=Nt+Ht})}}if(Object.assign(tt,{slides:ht,snapGrid:xt,slidesGrid:yt,slidesSizesGrid:vt}),nt.centeredSlides&&nt.cssMode&&!nt.centeredSlidesBounds){setCSSProperty(st,"--swiper-centered-offset-before",`${-xt[0]}px`),setCSSProperty(st,"--swiper-centered-offset-after",`${tt.size/2-vt[vt.length-1]/2}px`);const Ft=-tt.snapGrid[0],Ht=-tt.slidesGrid[0];tt.snapGrid=tt.snapGrid.map(Nt=>Nt+Ft),tt.slidesGrid=tt.slidesGrid.map(Nt=>Nt+Ht)}if(mt!==dt&&tt.emit("slidesLengthChange"),xt.length!==St&&(tt.params.watchOverflow&&tt.checkOverflow(),tt.emit("snapGridLengthChange")),yt.length!==wt&&tt.emit("slidesGridLengthChange"),nt.watchSlidesProgress&&tt.updateSlidesOffset(),!ct&&!nt.cssMode&&(nt.effect==="slide"||nt.effect==="fade")){const Ft=`${nt.containerModifierClass}backface-hidden`,Ht=tt.el.classList.contains(Ft);mt<=nt.maxBackfaceHiddenSlides?Ht||tt.el.classList.add(Ft):Ht&&tt.el.classList.remove(Ft)}}function updateAutoHeight(tt){const et=this,rt=[],nt=et.virtual&&et.params.virtual.enabled;let st=0,ot;typeof tt=="number"?et.setTransition(tt):tt===!0&&et.setTransition(et.params.speed);const at=lt=>nt?et.slides[et.getSlideIndexByData(lt)]:et.slides[lt];if(et.params.slidesPerView!=="auto"&&et.params.slidesPerView>1)if(et.params.centeredSlides)(et.visibleSlides||[]).forEach(lt=>{rt.push(lt)});else for(ot=0;ot<Math.ceil(et.params.slidesPerView);ot+=1){const lt=et.activeIndex+ot;if(lt>et.slides.length&&!nt)break;rt.push(at(lt))}else rt.push(at(et.activeIndex));for(ot=0;ot<rt.length;ot+=1)if(typeof rt[ot]<"u"){const lt=rt[ot].offsetHeight;st=lt>st?lt:st}(st||st===0)&&(et.wrapperEl.style.height=`${st}px`)}function updateSlidesOffset(){const tt=this,et=tt.slides,rt=tt.isElement?tt.isHorizontal()?tt.wrapperEl.offsetLeft:tt.wrapperEl.offsetTop:0;for(let nt=0;nt<et.length;nt+=1)et[nt].swiperSlideOffset=(tt.isHorizontal()?et[nt].offsetLeft:et[nt].offsetTop)-rt-tt.cssOverflowAdjustment()}function updateSlidesProgress(tt){tt===void 0&&(tt=this&&this.translate||0);const et=this,rt=et.params,{slides:nt,rtlTranslate:st,snapGrid:ot}=et;if(nt.length===0)return;typeof nt[0].swiperSlideOffset>"u"&&et.updateSlidesOffset();let at=-tt;st&&(at=tt),nt.forEach(ut=>{ut.classList.remove(rt.slideVisibleClass)}),et.visibleSlidesIndexes=[],et.visibleSlides=[];let lt=rt.spaceBetween;typeof lt=="string"&&lt.indexOf("%")>=0?lt=parseFloat(lt.replace("%",""))/100*et.size:typeof lt=="string"&&(lt=parseFloat(lt));for(let ut=0;ut<nt.length;ut+=1){const ct=nt[ut];let dt=ct.swiperSlideOffset;rt.cssMode&&rt.centeredSlides&&(dt-=nt[0].swiperSlideOffset);const ht=(at+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),mt=(at-ot[0]+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),xt=-(at-dt),yt=xt+et.slidesSizesGrid[ut];(xt>=0&&xt<et.size-1||yt>1&&yt<=et.size||xt<=0&&yt>=et.size)&&(et.visibleSlides.push(ct),et.visibleSlidesIndexes.push(ut),nt[ut].classList.add(rt.slideVisibleClass)),ct.progress=st?-ht:ht,ct.originalProgress=st?-mt:mt}}function updateProgress(tt){const et=this;if(typeof tt>"u"){const dt=et.rtlTranslate?-1:1;tt=et&&et.translate&&et.translate*dt||0}const rt=et.params,nt=et.maxTranslate()-et.minTranslate();let{progress:st,isBeginning:ot,isEnd:at,progressLoop:lt}=et;const ut=ot,ct=at;if(nt===0)st=0,ot=!0,at=!0;else{st=(tt-et.minTranslate())/nt;const dt=Math.abs(tt-et.minTranslate())<1,ht=Math.abs(tt-et.maxTranslate())<1;ot=dt||st<=0,at=ht||st>=1,dt&&(st=0),ht&&(st=1)}if(rt.loop){const dt=et.getSlideIndexByData(0),ht=et.getSlideIndexByData(et.slides.length-1),mt=et.slidesGrid[dt],xt=et.slidesGrid[ht],yt=et.slidesGrid[et.slidesGrid.length-1],vt=Math.abs(tt);vt>=mt?lt=(vt-mt)/yt:lt=(vt+yt-xt)/yt,lt>1&&(lt-=1)}Object.assign(et,{progress:st,progressLoop:lt,isBeginning:ot,isEnd:at}),(rt.watchSlidesProgress||rt.centeredSlides&&rt.autoHeight)&&et.updateSlidesProgress(tt),ot&&!ut&&et.emit("reachBeginning toEdge"),at&&!ct&&et.emit("reachEnd toEdge"),(ut&&!ot||ct&&!at)&&et.emit("fromEdge"),et.emit("progress",st)}function updateSlidesClasses(){const tt=this,{slides:et,params:rt,slidesEl:nt,activeIndex:st}=tt,ot=tt.virtual&&rt.virtual.enabled,at=ut=>elementChildren(nt,`.${rt.slideClass}${ut}, swiper-slide${ut}`)[0];et.forEach(ut=>{ut.classList.remove(rt.slideActiveClass,rt.slideNextClass,rt.slidePrevClass)});let lt;if(ot)if(rt.loop){let ut=st-tt.virtual.slidesBefore;ut<0&&(ut=tt.virtual.slides.length+ut),ut>=tt.virtual.slides.length&&(ut-=tt.virtual.slides.length),lt=at(`[data-swiper-slide-index="${ut}"]`)}else lt=at(`[data-swiper-slide-index="${st}"]`);else lt=et[st];if(lt){lt.classList.add(rt.slideActiveClass);let ut=elementNextAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ut&&(ut=et[0]),ut&&ut.classList.add(rt.slideNextClass);let ct=elementPrevAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ct===0&&(ct=et[et.length-1]),ct&&ct.classList.add(rt.slidePrevClass)}tt.emitSlidesClasses()}const processLazyPreloader=(tt,et)=>{if(!tt||tt.destroyed||!tt.params)return;const rt=()=>tt.isElement?"swiper-slide":`.${tt.params.slideClass}`,nt=et.closest(rt());if(nt){let st=nt.querySelector(`.${tt.params.lazyPreloaderClass}`);!st&&tt.isElement&&(nt.shadowRoot?st=nt.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{nt.shadowRoot&&(st=nt.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`),st&&st.remove())})),st&&st.remove()}},unlazy=(tt,et)=>{if(!tt.slides[et])return;const rt=tt.slides[et].querySelector('[loading="lazy"]');rt&&rt.removeAttribute("loading")},preload=tt=>{if(!tt||tt.destroyed||!tt.params)return;let et=tt.params.lazyPreloadPrevNext;const rt=tt.slides.length;if(!rt||!et||et<0)return;et=Math.min(et,rt);const nt=tt.params.slidesPerView==="auto"?tt.slidesPerViewDynamic():Math.ceil(tt.params.slidesPerView),st=tt.activeIndex;if(tt.params.grid&&tt.params.grid.rows>1){const at=st,lt=[at-et];lt.push(...Array.from({length:et}).map((ut,ct)=>at+nt+ct)),tt.slides.forEach((ut,ct)=>{lt.includes(ut.column)&&unlazy(tt,ct)});return}const ot=st+nt-1;if(tt.params.rewind||tt.params.loop)for(let at=st-et;at<=ot+et;at+=1){const lt=(at%rt+rt)%rt;(lt<st||lt>ot)&&unlazy(tt,lt)}else for(let at=Math.max(st-et,0);at<=Math.min(ot+et,rt-1);at+=1)at!==st&&(at>ot||at<st)&&unlazy(tt,at)};function getActiveIndexByTranslate(tt){const{slidesGrid:et,params:rt}=tt,nt=tt.rtlTranslate?tt.translate:-tt.translate;let st;for(let ot=0;ot<et.length;ot+=1)typeof et[ot+1]<"u"?nt>=et[ot]&&nt<et[ot+1]-(et[ot+1]-et[ot])/2?st=ot:nt>=et[ot]&&nt<et[ot+1]&&(st=ot+1):nt>=et[ot]&&(st=ot);return rt.normalizeSlideIndex&&(st<0||typeof st>"u")&&(st=0),st}function updateActiveIndex(tt){const et=this,rt=et.rtlTranslate?et.translate:-et.translate,{snapGrid:nt,params:st,activeIndex:ot,realIndex:at,snapIndex:lt}=et;let ut=tt,ct;const dt=mt=>{let xt=mt-et.virtual.slidesBefore;return xt<0&&(xt=et.virtual.slides.length+xt),xt>=et.virtual.slides.length&&(xt-=et.virtual.slides.length),xt};if(typeof ut>"u"&&(ut=getActiveIndexByTranslate(et)),nt.indexOf(rt)>=0)ct=nt.indexOf(rt);else{const mt=Math.min(st.slidesPerGroupSkip,ut);ct=mt+Math.floor((ut-mt)/st.slidesPerGroup)}if(ct>=nt.length&&(ct=nt.length-1),ut===ot){ct!==lt&&(et.snapIndex=ct,et.emit("snapIndexChange")),et.params.loop&&et.virtual&&et.params.virtual.enabled&&(et.realIndex=dt(ut));return}let ht;et.virtual&&st.virtual.enabled&&st.loop?ht=dt(ut):et.slides[ut]?ht=parseInt(et.slides[ut].getAttribute("data-swiper-slide-index")||ut,10):ht=ut,Object.assign(et,{previousSnapIndex:lt,snapIndex:ct,previousRealIndex:at,realIndex:ht,previousIndex:ot,activeIndex:ut}),et.initialized&&preload(et),et.emit("activeIndexChange"),et.emit("snapIndexChange"),(et.initialized||et.params.runCallbacksOnInit)&&(at!==ht&&et.emit("realIndexChange"),et.emit("slideChange"))}function updateClickedSlide(tt,et){const rt=this,nt=rt.params;let st=tt.closest(`.${nt.slideClass}, swiper-slide`);!st&&rt.isElement&&et&&et.length>1&&et.includes(tt)&&[...et.slice(et.indexOf(tt)+1,et.length)].forEach(lt=>{!st&&lt.matches&&lt.matches(`.${nt.slideClass}, swiper-slide`)&&(st=lt)});let ot=!1,at;if(st){for(let lt=0;lt<rt.slides.length;lt+=1)if(rt.slides[lt]===st){ot=!0,at=lt;break}}if(st&&ot)rt.clickedSlide=st,rt.virtual&&rt.params.virtual.enabled?rt.clickedIndex=parseInt(st.getAttribute("data-swiper-slide-index"),10):rt.clickedIndex=at;else{rt.clickedSlide=void 0,rt.clickedIndex=void 0;return}nt.slideToClickedSlide&&rt.clickedIndex!==void 0&&rt.clickedIndex!==rt.activeIndex&&rt.slideToClickedSlide()}var update={updateSize,updateSlides,updateAutoHeight,updateSlidesOffset,updateSlidesProgress,updateProgress,updateSlidesClasses,updateActiveIndex,updateClickedSlide};function getSwiperTranslate(tt){tt===void 0&&(tt=this.isHorizontal()?"x":"y");const et=this,{params:rt,rtlTranslate:nt,translate:st,wrapperEl:ot}=et;if(rt.virtualTranslate)return nt?-st:st;if(rt.cssMode)return st;let at=getTranslate(ot,tt);return at+=et.cssOverflowAdjustment(),nt&&(at=-at),at||0}function setTranslate(tt,et){const rt=this,{rtlTranslate:nt,params:st,wrapperEl:ot,progress:at}=rt;let lt=0,ut=0;const ct=0;rt.isHorizontal()?lt=nt?-tt:tt:ut=tt,st.roundLengths&&(lt=Math.floor(lt),ut=Math.floor(ut)),rt.previousTranslate=rt.translate,rt.translate=rt.isHorizontal()?lt:ut,st.cssMode?ot[rt.isHorizontal()?"scrollLeft":"scrollTop"]=rt.isHorizontal()?-lt:-ut:st.virtualTranslate||(rt.isHorizontal()?lt-=rt.cssOverflowAdjustment():ut-=rt.cssOverflowAdjustment(),ot.style.transform=`translate3d(${lt}px, ${ut}px, ${ct}px)`);let dt;const ht=rt.maxTranslate()-rt.minTranslate();ht===0?dt=0:dt=(tt-rt.minTranslate())/ht,dt!==at&&rt.updateProgress(tt),rt.emit("setTranslate",rt.translate,et)}function minTranslate(){return-this.snapGrid[0]}function maxTranslate(){return-this.snapGrid[this.snapGrid.length-1]}function translateTo(tt,et,rt,nt,st){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),nt===void 0&&(nt=!0);const ot=this,{params:at,wrapperEl:lt}=ot;if(ot.animating&&at.preventInteractionOnTransition)return!1;const ut=ot.minTranslate(),ct=ot.maxTranslate();let dt;if(nt&&tt>ut?dt=ut:nt&&tt<ct?dt=ct:dt=tt,ot.updateProgress(dt),at.cssMode){const ht=ot.isHorizontal();if(et===0)lt[ht?"scrollLeft":"scrollTop"]=-dt;else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:-dt,side:ht?"left":"top"}),!0;lt.scrollTo({[ht?"left":"top"]:-dt,behavior:"smooth"})}return!0}return et===0?(ot.setTransition(0),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,st),ot.emit("transitionEnd"))):(ot.setTransition(et),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,st),ot.emit("transitionStart")),ot.animating||(ot.animating=!0,ot.onTranslateToWrapperTransitionEnd||(ot.onTranslateToWrapperTransitionEnd=function(mt){!ot||ot.destroyed||mt.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd),ot.onTranslateToWrapperTransitionEnd=null,delete ot.onTranslateToWrapperTransitionEnd,rt&&ot.emit("transitionEnd"))}),ot.wrapperEl.addEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd))),!0}var translate={getTranslate:getSwiperTranslate,setTranslate,minTranslate,maxTranslate,translateTo};function setTransition(tt,et){const rt=this;rt.params.cssMode||(rt.wrapperEl.style.transitionDuration=`${tt}ms`,rt.wrapperEl.style.transitionDelay=tt===0?"0ms":""),rt.emit("setTransition",tt,et)}function transitionEmit(tt){let{swiper:et,runCallbacks:rt,direction:nt,step:st}=tt;const{activeIndex:ot,previousIndex:at}=et;let lt=nt;if(lt||(ot>at?lt="next":ot<at?lt="prev":lt="reset"),et.emit(`transition${st}`),rt&&ot!==at){if(lt==="reset"){et.emit(`slideResetTransition${st}`);return}et.emit(`slideChangeTransition${st}`),lt==="next"?et.emit(`slideNextTransition${st}`):et.emit(`slidePrevTransition${st}`)}}function transitionStart(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:nt}=rt;nt.cssMode||(nt.autoHeight&&rt.updateAutoHeight(),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"Start"}))}function transitionEnd(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:nt}=rt;rt.animating=!1,!nt.cssMode&&(rt.setTransition(0),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"End"}))}var transition={setTransition,transitionStart,transitionEnd};function slideTo(tt,et,rt,nt,st){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const ot=this;let at=tt;at<0&&(at=0);const{params:lt,snapGrid:ut,slidesGrid:ct,previousIndex:dt,activeIndex:ht,rtlTranslate:mt,wrapperEl:xt,enabled:yt}=ot;if(ot.animating&&lt.preventInteractionOnTransition||!yt&&!nt&&!st)return!1;const vt=Math.min(ot.params.slidesPerGroupSkip,at);let Et=vt+Math.floor((at-vt)/ot.params.slidesPerGroup);Et>=ut.length&&(Et=ut.length-1);const bt=-ut[Et];if(lt.normalizeSlideIndex)for(let wt=0;wt<ct.length;wt+=1){const Rt=-Math.floor(bt*100),Ct=Math.floor(ct[wt]*100),Pt=Math.floor(ct[wt+1]*100);typeof ct[wt+1]<"u"?Rt>=Ct&&Rt<Pt-(Pt-Ct)/2?at=wt:Rt>=Ct&&Rt<Pt&&(at=wt+1):Rt>=Ct&&(at=wt)}if(ot.initialized&&at!==ht&&(!ot.allowSlideNext&&(mt?bt>ot.translate&&bt>ot.minTranslate():bt<ot.translate&&bt<ot.minTranslate())||!ot.allowSlidePrev&&bt>ot.translate&&bt>ot.maxTranslate()&&(ht||0)!==at))return!1;at!==(dt||0)&&rt&&ot.emit("beforeSlideChangeStart"),ot.updateProgress(bt);let St;if(at>ht?St="next":at<ht?St="prev":St="reset",mt&&-bt===ot.translate||!mt&&bt===ot.translate)return ot.updateActiveIndex(at),lt.autoHeight&&ot.updateAutoHeight(),ot.updateSlidesClasses(),lt.effect!=="slide"&&ot.setTranslate(bt),St!=="reset"&&(ot.transitionStart(rt,St),ot.transitionEnd(rt,St)),!1;if(lt.cssMode){const wt=ot.isHorizontal(),Rt=mt?bt:-bt;if(et===0){const Ct=ot.virtual&&ot.params.virtual.enabled;Ct&&(ot.wrapperEl.style.scrollSnapType="none",ot._immediateVirtual=!0),Ct&&!ot._cssModeVirtualInitialSet&&ot.params.initialSlide>0?(ot._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{xt[wt?"scrollLeft":"scrollTop"]=Rt})):xt[wt?"scrollLeft":"scrollTop"]=Rt,Ct&&requestAnimationFrame(()=>{ot.wrapperEl.style.scrollSnapType="",ot._immediateVirtual=!1})}else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:Rt,side:wt?"left":"top"}),!0;xt.scrollTo({[wt?"left":"top"]:Rt,behavior:"smooth"})}return!0}return ot.setTransition(et),ot.setTranslate(bt),ot.updateActiveIndex(at),ot.updateSlidesClasses(),ot.emit("beforeTransitionStart",et,nt),ot.transitionStart(rt,St),et===0?ot.transitionEnd(rt,St):ot.animating||(ot.animating=!0,ot.onSlideToWrapperTransitionEnd||(ot.onSlideToWrapperTransitionEnd=function(Rt){!ot||ot.destroyed||Rt.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onSlideToWrapperTransitionEnd),ot.onSlideToWrapperTransitionEnd=null,delete ot.onSlideToWrapperTransitionEnd,ot.transitionEnd(rt,St))}),ot.wrapperEl.addEventListener("transitionend",ot.onSlideToWrapperTransitionEnd)),!0}function slideToLoop(tt,et,rt,nt){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const st=this;let ot=tt;return st.params.loop&&(st.virtual&&st.params.virtual.enabled?ot=ot+st.virtual.slidesBefore:ot=st.getSlideIndexByData(ot)),st.slideTo(ot,et,rt,nt)}function slideNext(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const nt=this,{enabled:st,params:ot,animating:at}=nt;if(!st)return nt;let lt=ot.slidesPerGroup;ot.slidesPerView==="auto"&&ot.slidesPerGroup===1&&ot.slidesPerGroupAuto&&(lt=Math.max(nt.slidesPerViewDynamic("current",!0),1));const ut=nt.activeIndex<ot.slidesPerGroupSkip?1:lt,ct=nt.virtual&&ot.virtual.enabled;if(ot.loop){if(at&&!ct&&ot.loopPreventsSliding)return!1;if(nt.loopFix({direction:"next"}),nt._clientLeft=nt.wrapperEl.clientLeft,nt.activeIndex===nt.slides.length-1&&ot.cssMode)return requestAnimationFrame(()=>{nt.slideTo(nt.activeIndex+ut,tt,et,rt)}),!0}return ot.rewind&&nt.isEnd?nt.slideTo(0,tt,et,rt):nt.slideTo(nt.activeIndex+ut,tt,et,rt)}function slidePrev(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const nt=this,{params:st,snapGrid:ot,slidesGrid:at,rtlTranslate:lt,enabled:ut,animating:ct}=nt;if(!ut)return nt;const dt=nt.virtual&&st.virtual.enabled;if(st.loop){if(ct&&!dt&&st.loopPreventsSliding)return!1;nt.loopFix({direction:"prev"}),nt._clientLeft=nt.wrapperEl.clientLeft}const ht=lt?nt.translate:-nt.translate;function mt(bt){return bt<0?-Math.floor(Math.abs(bt)):Math.floor(bt)}const xt=mt(ht),yt=ot.map(bt=>mt(bt));let vt=ot[yt.indexOf(xt)-1];if(typeof vt>"u"&&st.cssMode){let bt;ot.forEach((St,wt)=>{xt>=St&&(bt=wt)}),typeof bt<"u"&&(vt=ot[bt>0?bt-1:bt])}let Et=0;if(typeof vt<"u"&&(Et=at.indexOf(vt),Et<0&&(Et=nt.activeIndex-1),st.slidesPerView==="auto"&&st.slidesPerGroup===1&&st.slidesPerGroupAuto&&(Et=Et-nt.slidesPerViewDynamic("previous",!0)+1,Et=Math.max(Et,0))),st.rewind&&nt.isBeginning){const bt=nt.params.virtual&&nt.params.virtual.enabled&&nt.virtual?nt.virtual.slides.length-1:nt.slides.length-1;return nt.slideTo(bt,tt,et,rt)}else if(st.loop&&nt.activeIndex===0&&st.cssMode)return requestAnimationFrame(()=>{nt.slideTo(Et,tt,et,rt)}),!0;return nt.slideTo(Et,tt,et,rt)}function slideReset(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const nt=this;return nt.slideTo(nt.activeIndex,tt,et,rt)}function slideToClosest(tt,et,rt,nt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0),nt===void 0&&(nt=.5);const st=this;let ot=st.activeIndex;const at=Math.min(st.params.slidesPerGroupSkip,ot),lt=at+Math.floor((ot-at)/st.params.slidesPerGroup),ut=st.rtlTranslate?st.translate:-st.translate;if(ut>=st.snapGrid[lt]){const ct=st.snapGrid[lt],dt=st.snapGrid[lt+1];ut-ct>(dt-ct)*nt&&(ot+=st.params.slidesPerGroup)}else{const ct=st.snapGrid[lt-1],dt=st.snapGrid[lt];ut-ct<=(dt-ct)*nt&&(ot-=st.params.slidesPerGroup)}return ot=Math.max(ot,0),ot=Math.min(ot,st.slidesGrid.length-1),st.slideTo(ot,tt,et,rt)}function slideToClickedSlide(){const tt=this,{params:et,slidesEl:rt}=tt,nt=et.slidesPerView==="auto"?tt.slidesPerViewDynamic():et.slidesPerView;let st=tt.clickedIndex,ot;const at=tt.isElement?"swiper-slide":`.${et.slideClass}`;if(et.loop){if(tt.animating)return;ot=parseInt(tt.clickedSlide.getAttribute("data-swiper-slide-index"),10),et.centeredSlides?st<tt.loopedSlides-nt/2||st>tt.slides.length-tt.loopedSlides+nt/2?(tt.loopFix(),st=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(st)})):tt.slideTo(st):st>tt.slides.length-nt?(tt.loopFix(),st=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(st)})):tt.slideTo(st)}else tt.slideTo(st)}var slide={slideTo,slideToLoop,slideNext,slidePrev,slideReset,slideToClosest,slideToClickedSlide};function loopCreate(tt){const et=this,{params:rt,slidesEl:nt}=et;if(!rt.loop||et.virtual&&et.params.virtual.enabled)return;elementChildren(nt,`.${rt.slideClass}, swiper-slide`).forEach((ot,at)=>{ot.setAttribute("data-swiper-slide-index",at)}),et.loopFix({slideRealIndex:tt,direction:rt.centeredSlides?void 0:"next"})}function loopFix(tt){let{slideRealIndex:et,slideTo:rt=!0,direction:nt,setTranslate:st,activeSlideIndex:ot,byController:at,byMousewheel:lt}=tt===void 0?{}:tt;const ut=this;if(!ut.params.loop)return;ut.emit("beforeLoopFix");const{slides:ct,allowSlidePrev:dt,allowSlideNext:ht,slidesEl:mt,params:xt}=ut;if(ut.allowSlidePrev=!0,ut.allowSlideNext=!0,ut.virtual&&xt.virtual.enabled){rt&&(!xt.centeredSlides&&ut.snapIndex===0?ut.slideTo(ut.virtual.slides.length,0,!1,!0):xt.centeredSlides&&ut.snapIndex<xt.slidesPerView?ut.slideTo(ut.virtual.slides.length+ut.snapIndex,0,!1,!0):ut.snapIndex===ut.snapGrid.length-1&&ut.slideTo(ut.virtual.slidesBefore,0,!1,!0)),ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.emit("loopFix");return}const yt=xt.slidesPerView==="auto"?ut.slidesPerViewDynamic():Math.ceil(parseFloat(xt.slidesPerView,10));let vt=xt.loopedSlides||yt;vt%xt.slidesPerGroup!==0&&(vt+=xt.slidesPerGroup-vt%xt.slidesPerGroup),ut.loopedSlides=vt;const Et=[],bt=[];let St=ut.activeIndex;typeof ot>"u"?ot=ut.getSlideIndex(ut.slides.filter(It=>It.classList.contains(xt.slideActiveClass))[0]):St=ot;const wt=nt==="next"||!nt,Rt=nt==="prev"||!nt;let Ct=0,Pt=0;if(ot<vt){Ct=Math.max(vt-ot,xt.slidesPerGroup);for(let It=0;It<vt-ot;It+=1){const jt=It-Math.floor(It/ct.length)*ct.length;Et.push(ct.length-jt-1)}}else if(ot>ut.slides.length-vt*2){Pt=Math.max(ot-(ut.slides.length-vt*2),xt.slidesPerGroup);for(let It=0;It<Pt;It+=1){const jt=It-Math.floor(It/ct.length)*ct.length;bt.push(jt)}}if(Rt&&Et.forEach(It=>{ut.slides[It].swiperLoopMoveDOM=!0,mt.prepend(ut.slides[It]),ut.slides[It].swiperLoopMoveDOM=!1}),wt&&bt.forEach(It=>{ut.slides[It].swiperLoopMoveDOM=!0,mt.append(ut.slides[It]),ut.slides[It].swiperLoopMoveDOM=!1}),ut.recalcSlides(),xt.slidesPerView==="auto"&&ut.updateSlides(),xt.watchSlidesProgress&&ut.updateSlidesOffset(),rt){if(Et.length>0&&Rt)if(typeof et>"u"){const It=ut.slidesGrid[St],Dt=ut.slidesGrid[St+Ct]-It;lt?ut.setTranslate(ut.translate-Dt):(ut.slideTo(St+Ct,0,!1,!0),st&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Dt,ut.touchEventsData.currentTranslate=ut.translate))}else st&&(ut.slideToLoop(et,0,!1,!0),ut.touchEventsData.currentTranslate=ut.translate);else if(bt.length>0&&wt)if(typeof et>"u"){const It=ut.slidesGrid[St],Dt=ut.slidesGrid[St-Pt]-It;lt?ut.setTranslate(ut.translate-Dt):(ut.slideTo(St-Pt,0,!1,!0),st&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Dt,ut.touchEventsData.currentTranslate=ut.translate))}else ut.slideToLoop(et,0,!1,!0)}if(ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.controller&&ut.controller.control&&!at){const It={slideRealIndex:et,direction:nt,setTranslate:st,activeSlideIndex:ot,byController:!0};Array.isArray(ut.controller.control)?ut.controller.control.forEach(jt=>{!jt.destroyed&&jt.params.loop&&jt.loopFix({...It,slideTo:jt.params.slidesPerView===xt.slidesPerView?rt:!1})}):ut.controller.control instanceof ut.constructor&&ut.controller.control.params.loop&&ut.controller.control.loopFix({...It,slideTo:ut.controller.control.params.slidesPerView===xt.slidesPerView?rt:!1})}ut.emit("loopFix")}function loopDestroy(){const tt=this,{params:et,slidesEl:rt}=tt;if(!et.loop||tt.virtual&&tt.params.virtual.enabled)return;tt.recalcSlides();const nt=[];tt.slides.forEach(st=>{const ot=typeof st.swiperSlideIndex>"u"?st.getAttribute("data-swiper-slide-index")*1:st.swiperSlideIndex;nt[ot]=st}),tt.slides.forEach(st=>{st.removeAttribute("data-swiper-slide-index")}),nt.forEach(st=>{rt.append(st)}),tt.recalcSlides(),tt.slideTo(tt.realIndex,0)}var loop={loopCreate,loopFix,loopDestroy};function setGrabCursor(tt){const et=this;if(!et.params.simulateTouch||et.params.watchOverflow&&et.isLocked||et.params.cssMode)return;const rt=et.params.touchEventsTarget==="container"?et.el:et.wrapperEl;et.isElement&&(et.__preventObserver__=!0),rt.style.cursor="move",rt.style.cursor=tt?"grabbing":"grab",et.isElement&&requestAnimationFrame(()=>{et.__preventObserver__=!1})}function unsetGrabCursor(){const tt=this;tt.params.watchOverflow&&tt.isLocked||tt.params.cssMode||(tt.isElement&&(tt.__preventObserver__=!0),tt[tt.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",tt.isElement&&requestAnimationFrame(()=>{tt.__preventObserver__=!1}))}var grabCursor={setGrabCursor,unsetGrabCursor};function closestElement(tt,et){et===void 0&&(et=this);function rt(nt){if(!nt||nt===getDocument()||nt===getWindow())return null;nt.assignedSlot&&(nt=nt.assignedSlot);const st=nt.closest(tt);return!st&&!nt.getRootNode?null:st||rt(nt.getRootNode().host)}return rt(et)}function onTouchStart(tt){const et=this,rt=getDocument(),nt=getWindow(),st=et.touchEventsData;st.evCache.push(tt);const{params:ot,touches:at,enabled:lt}=et;if(!lt||!ot.simulateTouch&&tt.pointerType==="mouse"||et.animating&&ot.preventInteractionOnTransition)return;!et.animating&&ot.cssMode&&ot.loop&&et.loopFix();let ut=tt;ut.originalEvent&&(ut=ut.originalEvent);let ct=ut.target;if(ot.touchEventsTarget==="wrapper"&&!et.wrapperEl.contains(ct)||"which"in ut&&ut.which===3||"button"in ut&&ut.button>0||st.isTouched&&st.isMoved)return;const dt=!!ot.noSwipingClass&&ot.noSwipingClass!=="",ht=tt.composedPath?tt.composedPath():tt.path;dt&&ut.target&&ut.target.shadowRoot&&ht&&(ct=ht[0]);const mt=ot.noSwipingSelector?ot.noSwipingSelector:`.${ot.noSwipingClass}`,xt=!!(ut.target&&ut.target.shadowRoot);if(ot.noSwiping&&(xt?closestElement(mt,ct):ct.closest(mt))){et.allowClick=!0;return}if(ot.swipeHandler&&!ct.closest(ot.swipeHandler))return;at.currentX=ut.pageX,at.currentY=ut.pageY;const yt=at.currentX,vt=at.currentY,Et=ot.edgeSwipeDetection||ot.iOSEdgeSwipeDetection,bt=ot.edgeSwipeThreshold||ot.iOSEdgeSwipeThreshold;if(Et&&(yt<=bt||yt>=nt.innerWidth-bt))if(Et==="prevent")tt.preventDefault();else return;Object.assign(st,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),at.startX=yt,at.startY=vt,st.touchStartTime=now(),et.allowClick=!0,et.updateSize(),et.swipeDirection=void 0,ot.threshold>0&&(st.allowThresholdMove=!1);let St=!0;ct.matches(st.focusableElements)&&(St=!1,ct.nodeName==="SELECT"&&(st.isTouched=!1)),rt.activeElement&&rt.activeElement.matches(st.focusableElements)&&rt.activeElement!==ct&&rt.activeElement.blur();const wt=St&&et.allowTouchMove&&ot.touchStartPreventDefault;(ot.touchStartForcePreventDefault||wt)&&!ct.isContentEditable&&ut.preventDefault(),ot.freeMode&&ot.freeMode.enabled&&et.freeMode&&et.animating&&!ot.cssMode&&et.freeMode.onTouchStart(),et.emit("touchStart",ut)}function onTouchMove(tt){const et=getDocument(),rt=this,nt=rt.touchEventsData,{params:st,touches:ot,rtlTranslate:at,enabled:lt}=rt;if(!lt||!st.simulateTouch&&tt.pointerType==="mouse")return;let ut=tt;if(ut.originalEvent&&(ut=ut.originalEvent),!nt.isTouched){nt.startMoving&&nt.isScrolling&&rt.emit("touchMoveOpposite",ut);return}const ct=nt.evCache.findIndex(It=>It.pointerId===ut.pointerId);ct>=0&&(nt.evCache[ct]=ut);const dt=nt.evCache.length>1?nt.evCache[0]:ut,ht=dt.pageX,mt=dt.pageY;if(ut.preventedByNestedSwiper){ot.startX=ht,ot.startY=mt;return}if(!rt.allowTouchMove){ut.target.matches(nt.focusableElements)||(rt.allowClick=!1),nt.isTouched&&(Object.assign(ot,{startX:ht,startY:mt,prevX:rt.touches.currentX,prevY:rt.touches.currentY,currentX:ht,currentY:mt}),nt.touchStartTime=now());return}if(st.touchReleaseOnEdges&&!st.loop){if(rt.isVertical()){if(mt<ot.startY&&rt.translate<=rt.maxTranslate()||mt>ot.startY&&rt.translate>=rt.minTranslate()){nt.isTouched=!1,nt.isMoved=!1;return}}else if(ht<ot.startX&&rt.translate<=rt.maxTranslate()||ht>ot.startX&&rt.translate>=rt.minTranslate())return}if(et.activeElement&&ut.target===et.activeElement&&ut.target.matches(nt.focusableElements)){nt.isMoved=!0,rt.allowClick=!1;return}if(nt.allowTouchCallbacks&&rt.emit("touchMove",ut),ut.targetTouches&&ut.targetTouches.length>1)return;ot.currentX=ht,ot.currentY=mt;const xt=ot.currentX-ot.startX,yt=ot.currentY-ot.startY;if(rt.params.threshold&&Math.sqrt(xt**2+yt**2)<rt.params.threshold)return;if(typeof nt.isScrolling>"u"){let It;rt.isHorizontal()&&ot.currentY===ot.startY||rt.isVertical()&&ot.currentX===ot.startX?nt.isScrolling=!1:xt*xt+yt*yt>=25&&(It=Math.atan2(Math.abs(yt),Math.abs(xt))*180/Math.PI,nt.isScrolling=rt.isHorizontal()?It>st.touchAngle:90-It>st.touchAngle)}if(nt.isScrolling&&rt.emit("touchMoveOpposite",ut),typeof nt.startMoving>"u"&&(ot.currentX!==ot.startX||ot.currentY!==ot.startY)&&(nt.startMoving=!0),nt.isScrolling||rt.zoom&&rt.params.zoom&&rt.params.zoom.enabled&&nt.evCache.length>1){nt.isTouched=!1;return}if(!nt.startMoving)return;rt.allowClick=!1,!st.cssMode&&ut.cancelable&&ut.preventDefault(),st.touchMoveStopPropagation&&!st.nested&&ut.stopPropagation();let vt=rt.isHorizontal()?xt:yt,Et=rt.isHorizontal()?ot.currentX-ot.previousX:ot.currentY-ot.previousY;st.oneWayMovement&&(vt=Math.abs(vt)*(at?1:-1),Et=Math.abs(Et)*(at?1:-1)),ot.diff=vt,vt*=st.touchRatio,at&&(vt=-vt,Et=-Et);const bt=rt.touchesDirection;rt.swipeDirection=vt>0?"prev":"next",rt.touchesDirection=Et>0?"prev":"next";const St=rt.params.loop&&!st.cssMode,wt=rt.swipeDirection==="next"&&rt.allowSlideNext||rt.swipeDirection==="prev"&&rt.allowSlidePrev;if(!nt.isMoved){if(St&&wt&&rt.loopFix({direction:rt.swipeDirection}),nt.startTranslate=rt.getTranslate(),rt.setTransition(0),rt.animating){const It=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});rt.wrapperEl.dispatchEvent(It)}nt.allowMomentumBounce=!1,st.grabCursor&&(rt.allowSlideNext===!0||rt.allowSlidePrev===!0)&&rt.setGrabCursor(!0),rt.emit("sliderFirstMove",ut)}let Rt;nt.isMoved&&bt!==rt.touchesDirection&&St&&wt&&Math.abs(vt)>=1&&(rt.loopFix({direction:rt.swipeDirection,setTranslate:!0}),Rt=!0),rt.emit("sliderMove",ut),nt.isMoved=!0,nt.currentTranslate=vt+nt.startTranslate;let Ct=!0,Pt=st.resistanceRatio;if(st.touchReleaseOnEdges&&(Pt=0),vt>0?(St&&wt&&!Rt&&nt.currentTranslate>(st.centeredSlides?rt.minTranslate()-rt.size/2:rt.minTranslate())&&rt.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),nt.currentTranslate>rt.minTranslate()&&(Ct=!1,st.resistance&&(nt.currentTranslate=rt.minTranslate()-1+(-rt.minTranslate()+nt.startTranslate+vt)**Pt))):vt<0&&(St&&wt&&!Rt&&nt.currentTranslate<(st.centeredSlides?rt.maxTranslate()+rt.size/2:rt.maxTranslate())&&rt.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:rt.slides.length-(st.slidesPerView==="auto"?rt.slidesPerViewDynamic():Math.ceil(parseFloat(st.slidesPerView,10)))}),nt.currentTranslate<rt.maxTranslate()&&(Ct=!1,st.resistance&&(nt.currentTranslate=rt.maxTranslate()+1-(rt.maxTranslate()-nt.startTranslate-vt)**Pt))),Ct&&(ut.preventedByNestedSwiper=!0),!rt.allowSlideNext&&rt.swipeDirection==="next"&&nt.currentTranslate<nt.startTranslate&&(nt.currentTranslate=nt.startTranslate),!rt.allowSlidePrev&&rt.swipeDirection==="prev"&&nt.currentTranslate>nt.startTranslate&&(nt.currentTranslate=nt.startTranslate),!rt.allowSlidePrev&&!rt.allowSlideNext&&(nt.currentTranslate=nt.startTranslate),st.threshold>0)if(Math.abs(vt)>st.threshold||nt.allowThresholdMove){if(!nt.allowThresholdMove){nt.allowThresholdMove=!0,ot.startX=ot.currentX,ot.startY=ot.currentY,nt.currentTranslate=nt.startTranslate,ot.diff=rt.isHorizontal()?ot.currentX-ot.startX:ot.currentY-ot.startY;return}}else{nt.currentTranslate=nt.startTranslate;return}!st.followFinger||st.cssMode||((st.freeMode&&st.freeMode.enabled&&rt.freeMode||st.watchSlidesProgress)&&(rt.updateActiveIndex(),rt.updateSlidesClasses()),st.freeMode&&st.freeMode.enabled&&rt.freeMode&&rt.freeMode.onTouchMove(),rt.updateProgress(nt.currentTranslate),rt.setTranslate(nt.currentTranslate))}function onTouchEnd(tt){const et=this,rt=et.touchEventsData,nt=rt.evCache.findIndex(wt=>wt.pointerId===tt.pointerId);if(nt>=0&&rt.evCache.splice(nt,1),["pointercancel","pointerout","pointerleave","contextmenu"].includes(tt.type)&&!(["pointercancel","contextmenu"].includes(tt.type)&&(et.browser.isSafari||et.browser.isWebView)))return;const{params:st,touches:ot,rtlTranslate:at,slidesGrid:lt,enabled:ut}=et;if(!ut||!st.simulateTouch&&tt.pointerType==="mouse")return;let ct=tt;if(ct.originalEvent&&(ct=ct.originalEvent),rt.allowTouchCallbacks&&et.emit("touchEnd",ct),rt.allowTouchCallbacks=!1,!rt.isTouched){rt.isMoved&&st.grabCursor&&et.setGrabCursor(!1),rt.isMoved=!1,rt.startMoving=!1;return}st.grabCursor&&rt.isMoved&&rt.isTouched&&(et.allowSlideNext===!0||et.allowSlidePrev===!0)&&et.setGrabCursor(!1);const dt=now(),ht=dt-rt.touchStartTime;if(et.allowClick){const wt=ct.path||ct.composedPath&&ct.composedPath();et.updateClickedSlide(wt&&wt[0]||ct.target,wt),et.emit("tap click",ct),ht<300&&dt-rt.lastClickTime<300&&et.emit("doubleTap doubleClick",ct)}if(rt.lastClickTime=now(),nextTick(()=>{et.destroyed||(et.allowClick=!0)}),!rt.isTouched||!rt.isMoved||!et.swipeDirection||ot.diff===0||rt.currentTranslate===rt.startTranslate){rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;return}rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;let mt;if(st.followFinger?mt=at?et.translate:-et.translate:mt=-rt.currentTranslate,st.cssMode)return;if(st.freeMode&&st.freeMode.enabled){et.freeMode.onTouchEnd({currentPos:mt});return}let xt=0,yt=et.slidesSizesGrid[0];for(let wt=0;wt<lt.length;wt+=wt<st.slidesPerGroupSkip?1:st.slidesPerGroup){const Rt=wt<st.slidesPerGroupSkip-1?1:st.slidesPerGroup;typeof lt[wt+Rt]<"u"?mt>=lt[wt]&&mt<lt[wt+Rt]&&(xt=wt,yt=lt[wt+Rt]-lt[wt]):mt>=lt[wt]&&(xt=wt,yt=lt[lt.length-1]-lt[lt.length-2])}let vt=null,Et=null;st.rewind&&(et.isBeginning?Et=st.virtual&&st.virtual.enabled&&et.virtual?et.virtual.slides.length-1:et.slides.length-1:et.isEnd&&(vt=0));const bt=(mt-lt[xt])/yt,St=xt<st.slidesPerGroupSkip-1?1:st.slidesPerGroup;if(ht>st.longSwipesMs){if(!st.longSwipes){et.slideTo(et.activeIndex);return}et.swipeDirection==="next"&&(bt>=st.longSwipesRatio?et.slideTo(st.rewind&&et.isEnd?vt:xt+St):et.slideTo(xt)),et.swipeDirection==="prev"&&(bt>1-st.longSwipesRatio?et.slideTo(xt+St):Et!==null&&bt<0&&Math.abs(bt)>st.longSwipesRatio?et.slideTo(Et):et.slideTo(xt))}else{if(!st.shortSwipes){et.slideTo(et.activeIndex);return}et.navigation&&(ct.target===et.navigation.nextEl||ct.target===et.navigation.prevEl)?ct.target===et.navigation.nextEl?et.slideTo(xt+St):et.slideTo(xt):(et.swipeDirection==="next"&&et.slideTo(vt!==null?vt:xt+St),et.swipeDirection==="prev"&&et.slideTo(Et!==null?Et:xt))}}function onResize(){const tt=this,{params:et,el:rt}=tt;if(rt&&rt.offsetWidth===0)return;et.breakpoints&&tt.setBreakpoint();const{allowSlideNext:nt,allowSlidePrev:st,snapGrid:ot}=tt,at=tt.virtual&&tt.params.virtual.enabled;tt.allowSlideNext=!0,tt.allowSlidePrev=!0,tt.updateSize(),tt.updateSlides(),tt.updateSlidesClasses();const lt=at&&et.loop;(et.slidesPerView==="auto"||et.slidesPerView>1)&&tt.isEnd&&!tt.isBeginning&&!tt.params.centeredSlides&&!lt?tt.slideTo(tt.slides.length-1,0,!1,!0):tt.params.loop&&!at?tt.slideToLoop(tt.realIndex,0,!1,!0):tt.slideTo(tt.activeIndex,0,!1,!0),tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&(clearTimeout(tt.autoplay.resizeTimeout),tt.autoplay.resizeTimeout=setTimeout(()=>{tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&tt.autoplay.resume()},500)),tt.allowSlidePrev=st,tt.allowSlideNext=nt,tt.params.watchOverflow&&ot!==tt.snapGrid&&tt.checkOverflow()}function onClick(tt){const et=this;et.enabled&&(et.allowClick||(et.params.preventClicks&&tt.preventDefault(),et.params.preventClicksPropagation&&et.animating&&(tt.stopPropagation(),tt.stopImmediatePropagation())))}function onScroll(){const tt=this,{wrapperEl:et,rtlTranslate:rt,enabled:nt}=tt;if(!nt)return;tt.previousTranslate=tt.translate,tt.isHorizontal()?tt.translate=-et.scrollLeft:tt.translate=-et.scrollTop,tt.translate===0&&(tt.translate=0),tt.updateActiveIndex(),tt.updateSlidesClasses();let st;const ot=tt.maxTranslate()-tt.minTranslate();ot===0?st=0:st=(tt.translate-tt.minTranslate())/ot,st!==tt.progress&&tt.updateProgress(rt?-tt.translate:tt.translate),tt.emit("setTranslate",tt.translate,!1)}function onLoad(tt){const et=this;processLazyPreloader(et,tt.target),!(et.params.cssMode||et.params.slidesPerView!=="auto"&&!et.params.autoHeight)&&et.update()}let dummyEventAttached=!1;function dummyEventListener(){}const events=(tt,et)=>{const rt=getDocument(),{params:nt,el:st,wrapperEl:ot,device:at}=tt,lt=!!nt.nested,ut=et==="on"?"addEventListener":"removeEventListener",ct=et;st[ut]("pointerdown",tt.onTouchStart,{passive:!1}),rt[ut]("pointermove",tt.onTouchMove,{passive:!1,capture:lt}),rt[ut]("pointerup",tt.onTouchEnd,{passive:!0}),rt[ut]("pointercancel",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerout",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerleave",tt.onTouchEnd,{passive:!0}),rt[ut]("contextmenu",tt.onTouchEnd,{passive:!0}),(nt.preventClicks||nt.preventClicksPropagation)&&st[ut]("click",tt.onClick,!0),nt.cssMode&&ot[ut]("scroll",tt.onScroll),nt.updateOnWindowResize?tt[ct](at.ios||at.android?"resize orientationchange observerUpdate":"resize observerUpdate",onResize,!0):tt[ct]("observerUpdate",onResize,!0),st[ut]("load",tt.onLoad,{capture:!0})};function attachEvents(){const tt=this,et=getDocument(),{params:rt}=tt;tt.onTouchStart=onTouchStart.bind(tt),tt.onTouchMove=onTouchMove.bind(tt),tt.onTouchEnd=onTouchEnd.bind(tt),rt.cssMode&&(tt.onScroll=onScroll.bind(tt)),tt.onClick=onClick.bind(tt),tt.onLoad=onLoad.bind(tt),dummyEventAttached||(et.addEventListener("touchstart",dummyEventListener),dummyEventAttached=!0),events(tt,"on")}function detachEvents(){events(this,"off")}var events$1={attachEvents,detachEvents};const isGridEnabled=(tt,et)=>tt.grid&&et.grid&&et.grid.rows>1;function setBreakpoint(){const tt=this,{realIndex:et,initialized:rt,params:nt,el:st}=tt,ot=nt.breakpoints;if(!ot||ot&&Object.keys(ot).length===0)return;const at=tt.getBreakpoint(ot,tt.params.breakpointsBase,tt.el);if(!at||tt.currentBreakpoint===at)return;const ut=(at in ot?ot[at]:void 0)||tt.originalParams,ct=isGridEnabled(tt,nt),dt=isGridEnabled(tt,ut),ht=nt.enabled;ct&&!dt?(st.classList.remove(`${nt.containerModifierClass}grid`,`${nt.containerModifierClass}grid-column`),tt.emitContainerClasses()):!ct&&dt&&(st.classList.add(`${nt.containerModifierClass}grid`),(ut.grid.fill&&ut.grid.fill==="column"||!ut.grid.fill&&nt.grid.fill==="column")&&st.classList.add(`${nt.containerModifierClass}grid-column`),tt.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(bt=>{if(typeof ut[bt]>"u")return;const St=nt[bt]&&nt[bt].enabled,wt=ut[bt]&&ut[bt].enabled;St&&!wt&&tt[bt].disable(),!St&&wt&&tt[bt].enable()});const mt=ut.direction&&ut.direction!==nt.direction,xt=nt.loop&&(ut.slidesPerView!==nt.slidesPerView||mt),yt=nt.loop;mt&&rt&&tt.changeDirection(),extend$1(tt.params,ut);const vt=tt.params.enabled,Et=tt.params.loop;Object.assign(tt,{allowTouchMove:tt.params.allowTouchMove,allowSlideNext:tt.params.allowSlideNext,allowSlidePrev:tt.params.allowSlidePrev}),ht&&!vt?tt.disable():!ht&&vt&&tt.enable(),tt.currentBreakpoint=at,tt.emit("_beforeBreakpoint",ut),rt&&(xt?(tt.loopDestroy(),tt.loopCreate(et),tt.updateSlides()):!yt&&Et?(tt.loopCreate(et),tt.updateSlides()):yt&&!Et&&tt.loopDestroy()),tt.emit("breakpoint",ut)}function getBreakpoint(tt,et,rt){if(et===void 0&&(et="window"),!tt||et==="container"&&!rt)return;let nt=!1;const st=getWindow(),ot=et==="window"?st.innerHeight:rt.clientHeight,at=Object.keys(tt).map(lt=>{if(typeof lt=="string"&&lt.indexOf("@")===0){const ut=parseFloat(lt.substr(1));return{value:ot*ut,point:lt}}return{value:lt,point:lt}});at.sort((lt,ut)=>parseInt(lt.value,10)-parseInt(ut.value,10));for(let lt=0;lt<at.length;lt+=1){const{point:ut,value:ct}=at[lt];et==="window"?st.matchMedia(`(min-width: ${ct}px)`).matches&&(nt=ut):ct<=rt.clientWidth&&(nt=ut)}return nt||"max"}var breakpoints={setBreakpoint,getBreakpoint};function prepareClasses(tt,et){const rt=[];return tt.forEach(nt=>{typeof nt=="object"?Object.keys(nt).forEach(st=>{nt[st]&&rt.push(et+st)}):typeof nt=="string"&&rt.push(et+nt)}),rt}function addClasses(){const tt=this,{classNames:et,params:rt,rtl:nt,el:st,device:ot}=tt,at=prepareClasses(["initialized",rt.direction,{"free-mode":tt.params.freeMode&&rt.freeMode.enabled},{autoheight:rt.autoHeight},{rtl:nt},{grid:rt.grid&&rt.grid.rows>1},{"grid-column":rt.grid&&rt.grid.rows>1&&rt.grid.fill==="column"},{android:ot.android},{ios:ot.ios},{"css-mode":rt.cssMode},{centered:rt.cssMode&&rt.centeredSlides},{"watch-progress":rt.watchSlidesProgress}],rt.containerModifierClass);et.push(...at),st.classList.add(...et),tt.emitContainerClasses()}function removeClasses(){const tt=this,{el:et,classNames:rt}=tt;et.classList.remove(...rt),tt.emitContainerClasses()}var classes={addClasses,removeClasses};function checkOverflow(){const tt=this,{isLocked:et,params:rt}=tt,{slidesOffsetBefore:nt}=rt;if(nt){const st=tt.slides.length-1,ot=tt.slidesGrid[st]+tt.slidesSizesGrid[st]+nt*2;tt.isLocked=tt.size>ot}else tt.isLocked=tt.snapGrid.length===1;rt.allowSlideNext===!0&&(tt.allowSlideNext=!tt.isLocked),rt.allowSlidePrev===!0&&(tt.allowSlidePrev=!tt.isLocked),et&&et!==tt.isLocked&&(tt.isEnd=!1),et!==tt.isLocked&&tt.emit(tt.isLocked?"lock":"unlock")}var checkOverflow$1={checkOverflow},defaults$3={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function moduleExtendParams(tt,et){return function(nt){nt===void 0&&(nt={});const st=Object.keys(nt)[0],ot=nt[st];if(typeof ot!="object"||ot===null){extend$1(et,nt);return}if(tt[st]===!0&&(tt[st]={enabled:!0}),st==="navigation"&&tt[st]&&tt[st].enabled&&!tt[st].prevEl&&!tt[st].nextEl&&(tt[st].auto=!0),["pagination","scrollbar"].indexOf(st)>=0&&tt[st]&&tt[st].enabled&&!tt[st].el&&(tt[st].auto=!0),!(st in tt&&"enabled"in ot)){extend$1(et,nt);return}typeof tt[st]=="object"&&!("enabled"in tt[st])&&(tt[st].enabled=!0),tt[st]||(tt[st]={enabled:!1}),extend$1(et,nt)}}const prototypes={eventsEmitter,update,translate,transition,slide,loop,grabCursor,events:events$1,breakpoints,checkOverflow:checkOverflow$1,classes},extendedDefaults={};let Swiper$1=class _o{constructor(){let et,rt;for(var nt=arguments.length,st=new Array(nt),ot=0;ot<nt;ot++)st[ot]=arguments[ot];st.length===1&&st[0].constructor&&Object.prototype.toString.call(st[0]).slice(8,-1)==="Object"?rt=st[0]:[et,rt]=st,rt||(rt={}),rt=extend$1({},rt),et&&!rt.el&&(rt.el=et);const at=getDocument();if(rt.el&&typeof rt.el=="string"&&at.querySelectorAll(rt.el).length>1){const dt=[];return at.querySelectorAll(rt.el).forEach(ht=>{const mt=extend$1({},rt,{el:ht});dt.push(new _o(mt))}),dt}const lt=this;lt.__swiper__=!0,lt.support=getSupport(),lt.device=getDevice({userAgent:rt.userAgent}),lt.browser=getBrowser(),lt.eventsListeners={},lt.eventsAnyListeners=[],lt.modules=[...lt.__modules__],rt.modules&&Array.isArray(rt.modules)&&lt.modules.push(...rt.modules);const ut={};lt.modules.forEach(dt=>{dt({params:rt,swiper:lt,extendParams:moduleExtendParams(rt,ut),on:lt.on.bind(lt),once:lt.once.bind(lt),off:lt.off.bind(lt),emit:lt.emit.bind(lt)})});const ct=extend$1({},defaults$3,ut);return lt.params=extend$1({},ct,extendedDefaults,rt),lt.originalParams=extend$1({},lt.params),lt.passedParams=extend$1({},rt),lt.params&&lt.params.on&&Object.keys(lt.params.on).forEach(dt=>{lt.on(dt,lt.params.on[dt])}),lt.params&&lt.params.onAny&&lt.onAny(lt.params.onAny),Object.assign(lt,{enabled:lt.params.enabled,el:et,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return lt.params.direction==="horizontal"},isVertical(){return lt.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:lt.params.allowSlideNext,allowSlidePrev:lt.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:lt.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:lt.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),lt.emit("_swiper"),lt.params.init&&lt.init(),lt}getSlideIndex(et){const{slidesEl:rt,params:nt}=this,st=elementChildren(rt,`.${nt.slideClass}, swiper-slide`),ot=elementIndex(st[0]);return elementIndex(et)-ot}getSlideIndexByData(et){return this.getSlideIndex(this.slides.filter(rt=>rt.getAttribute("data-swiper-slide-index")*1===et)[0])}recalcSlides(){const et=this,{slidesEl:rt,params:nt}=et;et.slides=elementChildren(rt,`.${nt.slideClass}, swiper-slide`)}enable(){const et=this;et.enabled||(et.enabled=!0,et.params.grabCursor&&et.setGrabCursor(),et.emit("enable"))}disable(){const et=this;et.enabled&&(et.enabled=!1,et.params.grabCursor&&et.unsetGrabCursor(),et.emit("disable"))}setProgress(et,rt){const nt=this;et=Math.min(Math.max(et,0),1);const st=nt.minTranslate(),at=(nt.maxTranslate()-st)*et+st;nt.translateTo(at,typeof rt>"u"?0:rt),nt.updateActiveIndex(),nt.updateSlidesClasses()}emitContainerClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=et.el.className.split(" ").filter(nt=>nt.indexOf("swiper")===0||nt.indexOf(et.params.containerModifierClass)===0);et.emit("_containerClasses",rt.join(" "))}getSlideClasses(et){const rt=this;return rt.destroyed?"":et.className.split(" ").filter(nt=>nt.indexOf("swiper-slide")===0||nt.indexOf(rt.params.slideClass)===0).join(" ")}emitSlidesClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=[];et.slides.forEach(nt=>{const st=et.getSlideClasses(nt);rt.push({slideEl:nt,classNames:st}),et.emit("_slideClass",nt,st)}),et.emit("_slideClasses",rt)}slidesPerViewDynamic(et,rt){et===void 0&&(et="current"),rt===void 0&&(rt=!1);const nt=this,{params:st,slides:ot,slidesGrid:at,slidesSizesGrid:lt,size:ut,activeIndex:ct}=nt;let dt=1;if(typeof st.slidesPerView=="number")return st.slidesPerView;if(st.centeredSlides){let ht=ot[ct]?ot[ct].swiperSlideSize:0,mt;for(let xt=ct+1;xt<ot.length;xt+=1)ot[xt]&&!mt&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(mt=!0));for(let xt=ct-1;xt>=0;xt-=1)ot[xt]&&!mt&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(mt=!0))}else if(et==="current")for(let ht=ct+1;ht<ot.length;ht+=1)(rt?at[ht]+lt[ht]-at[ct]<ut:at[ht]-at[ct]<ut)&&(dt+=1);else for(let ht=ct-1;ht>=0;ht-=1)at[ct]-at[ht]<ut&&(dt+=1);return dt}update(){const et=this;if(!et||et.destroyed)return;const{snapGrid:rt,params:nt}=et;nt.breakpoints&&et.setBreakpoint(),[...et.el.querySelectorAll('[loading="lazy"]')].forEach(at=>{at.complete&&processLazyPreloader(et,at)}),et.updateSize(),et.updateSlides(),et.updateProgress(),et.updateSlidesClasses();function st(){const at=et.rtlTranslate?et.translate*-1:et.translate,lt=Math.min(Math.max(at,et.maxTranslate()),et.minTranslate());et.setTranslate(lt),et.updateActiveIndex(),et.updateSlidesClasses()}let ot;if(nt.freeMode&&nt.freeMode.enabled&&!nt.cssMode)st(),nt.autoHeight&&et.updateAutoHeight();else{if((nt.slidesPerView==="auto"||nt.slidesPerView>1)&&et.isEnd&&!nt.centeredSlides){const at=et.virtual&&nt.virtual.enabled?et.virtual.slides:et.slides;ot=et.slideTo(at.length-1,0,!1,!0)}else ot=et.slideTo(et.activeIndex,0,!1,!0);ot||st()}nt.watchOverflow&&rt!==et.snapGrid&&et.checkOverflow(),et.emit("update")}changeDirection(et,rt){rt===void 0&&(rt=!0);const nt=this,st=nt.params.direction;return et||(et=st==="horizontal"?"vertical":"horizontal"),et===st||et!=="horizontal"&&et!=="vertical"||(nt.el.classList.remove(`${nt.params.containerModifierClass}${st}`),nt.el.classList.add(`${nt.params.containerModifierClass}${et}`),nt.emitContainerClasses(),nt.params.direction=et,nt.slides.forEach(ot=>{et==="vertical"?ot.style.width="":ot.style.height=""}),nt.emit("changeDirection"),rt&&nt.update()),nt}changeLanguageDirection(et){const rt=this;rt.rtl&&et==="rtl"||!rt.rtl&&et==="ltr"||(rt.rtl=et==="rtl",rt.rtlTranslate=rt.params.direction==="horizontal"&&rt.rtl,rt.rtl?(rt.el.classList.add(`${rt.params.containerModifierClass}rtl`),rt.el.dir="rtl"):(rt.el.classList.remove(`${rt.params.containerModifierClass}rtl`),rt.el.dir="ltr"),rt.update())}mount(et){const rt=this;if(rt.mounted)return!0;let nt=et||rt.params.el;if(typeof nt=="string"&&(nt=document.querySelector(nt)),!nt)return!1;nt.swiper=rt,nt.parentNode&&nt.parentNode.host&&nt.parentNode.host.nodeName==="SWIPER-CONTAINER"&&(rt.isElement=!0);const st=()=>`.${(rt.params.wrapperClass||"").trim().split(" ").join(".")}`;let at=nt&&nt.shadowRoot&&nt.shadowRoot.querySelector?nt.shadowRoot.querySelector(st()):elementChildren(nt,st())[0];return!at&&rt.params.createElements&&(at=createElement("div",rt.params.wrapperClass),nt.append(at),elementChildren(nt,`.${rt.params.slideClass}`).forEach(lt=>{at.append(lt)})),Object.assign(rt,{el:nt,wrapperEl:at,slidesEl:rt.isElement&&!nt.parentNode.host.slideSlots?nt.parentNode.host:at,hostEl:rt.isElement?nt.parentNode.host:nt,mounted:!0,rtl:nt.dir.toLowerCase()==="rtl"||elementStyle(nt,"direction")==="rtl",rtlTranslate:rt.params.direction==="horizontal"&&(nt.dir.toLowerCase()==="rtl"||elementStyle(nt,"direction")==="rtl"),wrongRTL:elementStyle(at,"display")==="-webkit-box"}),!0}init(et){const rt=this;if(rt.initialized||rt.mount(et)===!1)return rt;rt.emit("beforeInit"),rt.params.breakpoints&&rt.setBreakpoint(),rt.addClasses(),rt.updateSize(),rt.updateSlides(),rt.params.watchOverflow&&rt.checkOverflow(),rt.params.grabCursor&&rt.enabled&&rt.setGrabCursor(),rt.params.loop&&rt.virtual&&rt.params.virtual.enabled?rt.slideTo(rt.params.initialSlide+rt.virtual.slidesBefore,0,rt.params.runCallbacksOnInit,!1,!0):rt.slideTo(rt.params.initialSlide,0,rt.params.runCallbacksOnInit,!1,!0),rt.params.loop&&rt.loopCreate(),rt.attachEvents();const st=[...rt.el.querySelectorAll('[loading="lazy"]')];return rt.isElement&&st.push(...rt.hostEl.querySelectorAll('[loading="lazy"]')),st.forEach(ot=>{ot.complete?processLazyPreloader(rt,ot):ot.addEventListener("load",at=>{processLazyPreloader(rt,at.target)})}),preload(rt),rt.initialized=!0,preload(rt),rt.emit("init"),rt.emit("afterInit"),rt}destroy(et,rt){et===void 0&&(et=!0),rt===void 0&&(rt=!0);const nt=this,{params:st,el:ot,wrapperEl:at,slides:lt}=nt;return typeof nt.params>"u"||nt.destroyed||(nt.emit("beforeDestroy"),nt.initialized=!1,nt.detachEvents(),st.loop&&nt.loopDestroy(),rt&&(nt.removeClasses(),ot.removeAttribute("style"),at.removeAttribute("style"),lt&&lt.length&&lt.forEach(ut=>{ut.classList.remove(st.slideVisibleClass,st.slideActiveClass,st.slideNextClass,st.slidePrevClass),ut.removeAttribute("style"),ut.removeAttribute("data-swiper-slide-index")})),nt.emit("destroy"),Object.keys(nt.eventsListeners).forEach(ut=>{nt.off(ut)}),et!==!1&&(nt.el.swiper=null,deleteProps(nt)),nt.destroyed=!0),null}static extendDefaults(et){extend$1(extendedDefaults,et)}static get extendedDefaults(){return extendedDefaults}static get defaults(){return defaults$3}static installModule(et){_o.prototype.__modules__||(_o.prototype.__modules__=[]);const rt=_o.prototype.__modules__;typeof et=="function"&&rt.indexOf(et)<0&&rt.push(et)}static use(et){return Array.isArray(et)?(et.forEach(rt=>_o.installModule(rt)),_o):(_o.installModule(et),_o)}};Object.keys(prototypes).forEach(tt=>{Object.keys(prototypes[tt]).forEach(et=>{Swiper$1.prototype[et]=prototypes[tt][et]})});Swiper$1.use([Resize,Observer]);const paramsList=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function isObject$1(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"&&!tt.__swiper__}function extend(tt,et){const rt=["__proto__","constructor","prototype"];Object.keys(et).filter(nt=>rt.indexOf(nt)<0).forEach(nt=>{typeof tt[nt]>"u"?tt[nt]=et[nt]:isObject$1(et[nt])&&isObject$1(tt[nt])&&Object.keys(et[nt]).length>0?et[nt].__swiper__?tt[nt]=et[nt]:extend(tt[nt],et[nt]):tt[nt]=et[nt]})}function needsNavigation(tt){return tt===void 0&&(tt={}),tt.navigation&&typeof tt.navigation.nextEl>"u"&&typeof tt.navigation.prevEl>"u"}function needsPagination(tt){return tt===void 0&&(tt={}),tt.pagination&&typeof tt.pagination.el>"u"}function needsScrollbar(tt){return tt===void 0&&(tt={}),tt.scrollbar&&typeof tt.scrollbar.el>"u"}function uniqueClasses(tt){tt===void 0&&(tt="");const et=tt.split(" ").map(nt=>nt.trim()).filter(nt=>!!nt),rt=[];return et.forEach(nt=>{rt.indexOf(nt)<0&&rt.push(nt)}),rt.join(" ")}function wrapperClass(tt){return tt===void 0&&(tt=""),tt?tt.includes("swiper-wrapper")?tt:`swiper-wrapper ${tt}`:"swiper-wrapper"}function updateSwiper(tt){let{swiper:et,slides:rt,passedParams:nt,changedParams:st,nextEl:ot,prevEl:at,scrollbarEl:lt,paginationEl:ut}=tt;const ct=st.filter(Dt=>Dt!=="children"&&Dt!=="direction"&&Dt!=="wrapperClass"),{params:dt,pagination:ht,navigation:mt,scrollbar:xt,virtual:yt,thumbs:vt}=et;let Et,bt,St,wt,Rt,Ct,Pt,It;st.includes("thumbs")&&nt.thumbs&&nt.thumbs.swiper&&dt.thumbs&&!dt.thumbs.swiper&&(Et=!0),st.includes("controller")&&nt.controller&&nt.controller.control&&dt.controller&&!dt.controller.control&&(bt=!0),st.includes("pagination")&&nt.pagination&&(nt.pagination.el||ut)&&(dt.pagination||dt.pagination===!1)&&ht&&!ht.el&&(St=!0),st.includes("scrollbar")&&nt.scrollbar&&(nt.scrollbar.el||lt)&&(dt.scrollbar||dt.scrollbar===!1)&&xt&&!xt.el&&(wt=!0),st.includes("navigation")&&nt.navigation&&(nt.navigation.prevEl||at)&&(nt.navigation.nextEl||ot)&&(dt.navigation||dt.navigation===!1)&&mt&&!mt.prevEl&&!mt.nextEl&&(Rt=!0);const jt=Dt=>{et[Dt]&&(et[Dt].destroy(),Dt==="navigation"?(et.isElement&&(et[Dt].prevEl.remove(),et[Dt].nextEl.remove()),dt[Dt].prevEl=void 0,dt[Dt].nextEl=void 0,et[Dt].prevEl=void 0,et[Dt].nextEl=void 0):(et.isElement&&et[Dt].el.remove(),dt[Dt].el=void 0,et[Dt].el=void 0))};st.includes("loop")&&et.isElement&&(dt.loop&&!nt.loop?Ct=!0:!dt.loop&&nt.loop?Pt=!0:It=!0),ct.forEach(Dt=>{if(isObject$1(dt[Dt])&&isObject$1(nt[Dt]))extend(dt[Dt],nt[Dt]),(Dt==="navigation"||Dt==="pagination"||Dt==="scrollbar")&&"enabled"in nt[Dt]&&!nt[Dt].enabled&&jt(Dt);else{const Vt=nt[Dt];(Vt===!0||Vt===!1)&&(Dt==="navigation"||Dt==="pagination"||Dt==="scrollbar")?Vt===!1&&jt(Dt):dt[Dt]=nt[Dt]}}),ct.includes("controller")&&!bt&&et.controller&&et.controller.control&&dt.controller&&dt.controller.control&&(et.controller.control=dt.controller.control),st.includes("children")&&rt&&yt&&dt.virtual.enabled&&(yt.slides=rt,yt.update(!0)),st.includes("children")&&rt&&dt.loop&&(It=!0),Et&&vt.init()&&vt.update(!0),bt&&(et.controller.control=dt.controller.control),St&&(et.isElement&&(!ut||typeof ut=="string")&&(ut=document.createElement("div"),ut.classList.add("swiper-pagination"),ut.part.add("pagination"),et.el.appendChild(ut)),ut&&(dt.pagination.el=ut),ht.init(),ht.render(),ht.update()),wt&&(et.isElement&&(!lt||typeof lt=="string")&&(lt=document.createElement("div"),lt.classList.add("swiper-scrollbar"),lt.part.add("scrollbar"),et.el.appendChild(lt)),lt&&(dt.scrollbar.el=lt),xt.init(),xt.updateSize(),xt.setTranslate()),Rt&&(et.isElement&&((!ot||typeof ot=="string")&&(ot=document.createElement("div"),ot.classList.add("swiper-button-next"),ot.innerHTML=et.hostEl.constructor.nextButtonSvg,ot.part.add("button-next"),et.el.appendChild(ot)),(!at||typeof at=="string")&&(at=document.createElement("div"),at.classList.add("swiper-button-prev"),at.innerHTML=et.hostEl.constructor.prevButtonSvg,at.part.add("button-prev"),et.el.appendChild(at))),ot&&(dt.navigation.nextEl=ot),at&&(dt.navigation.prevEl=at),mt.init(),mt.update()),st.includes("allowSlideNext")&&(et.allowSlideNext=nt.allowSlideNext),st.includes("allowSlidePrev")&&(et.allowSlidePrev=nt.allowSlidePrev),st.includes("direction")&&et.changeDirection(nt.direction,!1),(Ct||It)&&et.loopDestroy(),(Pt||It)&&et.loopCreate(),et.update()}function getParams(tt,et){tt===void 0&&(tt={}),et===void 0&&(et=!0);const rt={on:{}},nt={},st={};extend(rt,defaults$3),rt._emitClasses=!0,rt.init=!1;const ot={},at=paramsList.map(ut=>ut.replace(/_/,"")),lt=Object.assign({},tt);return Object.keys(lt).forEach(ut=>{typeof tt[ut]>"u"||(at.indexOf(ut)>=0?isObject$1(tt[ut])?(rt[ut]={},st[ut]={},extend(rt[ut],tt[ut]),extend(st[ut],tt[ut])):(rt[ut]=tt[ut],st[ut]=tt[ut]):ut.search(/on[A-Z]/)===0&&typeof tt[ut]=="function"?et?nt[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:rt.on[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:ot[ut]=tt[ut])}),["navigation","pagination","scrollbar"].forEach(ut=>{rt[ut]===!0&&(rt[ut]={}),rt[ut]===!1&&delete rt[ut]}),{params:rt,passedParams:st,rest:ot,events:nt}}function mountSwiper(tt,et){let{el:rt,nextEl:nt,prevEl:st,paginationEl:ot,scrollbarEl:at,swiper:lt}=tt;needsNavigation(et)&&nt&&st&&(lt.params.navigation.nextEl=nt,lt.originalParams.navigation.nextEl=nt,lt.params.navigation.prevEl=st,lt.originalParams.navigation.prevEl=st),needsPagination(et)&&ot&&(lt.params.pagination.el=ot,lt.originalParams.pagination.el=ot),needsScrollbar(et)&&at&&(lt.params.scrollbar.el=at,lt.originalParams.scrollbar.el=at),lt.init(rt)}function getChangedParams(tt,et,rt,nt,st){const ot=[];if(!et)return ot;const at=ut=>{ot.indexOf(ut)<0&&ot.push(ut)};if(rt&&nt){const ut=nt.map(st),ct=rt.map(st);ut.join("")!==ct.join("")&&at("children"),nt.length!==rt.length&&at("children")}return paramsList.filter(ut=>ut[0]==="_").map(ut=>ut.replace(/_/,"")).forEach(ut=>{if(ut in tt&&ut in et)if(isObject$1(tt[ut])&&isObject$1(et[ut])){const ct=Object.keys(tt[ut]),dt=Object.keys(et[ut]);ct.length!==dt.length?at(ut):(ct.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}),dt.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}))}else tt[ut]!==et[ut]&&at(ut)}),ot}const updateOnVirtualData=tt=>{!tt||tt.destroyed||!tt.params.virtual||tt.params.virtual&&!tt.params.virtual.enabled||(tt.updateSlides(),tt.updateProgress(),tt.updateSlidesClasses(),tt.parallax&&tt.params.parallax&&tt.params.parallax.enabled&&tt.parallax.setTranslate())};function _extends(){return _extends=Object.assign?Object.assign.bind():function(tt){for(var et=1;et<arguments.length;et++){var rt=arguments[et];for(var nt in rt)Object.prototype.hasOwnProperty.call(rt,nt)&&(tt[nt]=rt[nt])}return tt},_extends.apply(this,arguments)}function isChildSwiperSlide(tt){return tt.type&&tt.type.displayName&&tt.type.displayName.includes("SwiperSlide")}function processChildren(tt){const et=[];return React$4.Children.toArray(tt).forEach(rt=>{isChildSwiperSlide(rt)?et.push(rt):rt.props&&rt.props.children&&processChildren(rt.props.children).forEach(nt=>et.push(nt))}),et}function getChildren(tt){const et=[],rt={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return React$4.Children.toArray(tt).forEach(nt=>{if(isChildSwiperSlide(nt))et.push(nt);else if(nt.props&&nt.props.slot&&rt[nt.props.slot])rt[nt.props.slot].push(nt);else if(nt.props&&nt.props.children){const st=processChildren(nt.props.children);st.length>0?st.forEach(ot=>et.push(ot)):rt["container-end"].push(nt)}else rt["container-end"].push(nt)}),{slides:et,slots:rt}}function renderVirtual(tt,et,rt){if(!rt)return null;const nt=dt=>{let ht=dt;return dt<0?ht=et.length+dt:ht>=et.length&&(ht=ht-et.length),ht},st=tt.isHorizontal()?{[tt.rtlTranslate?"right":"left"]:`${rt.offset}px`}:{top:`${rt.offset}px`},{from:ot,to:at}=rt,lt=tt.params.loop?-et.length:0,ut=tt.params.loop?et.length*2:et.length,ct=[];for(let dt=lt;dt<ut;dt+=1)dt>=ot&&dt<=at&&ct.push(et[nt(dt)]);return ct.map((dt,ht)=>React$4.cloneElement(dt,{swiper:tt,style:st,key:`slide-${ht}`}))}function useIsomorphicLayoutEffect(tt,et){return typeof window>"u"?reactExports.useEffect(tt,et):reactExports.useLayoutEffect(tt,et)}const SwiperSlideContext=reactExports.createContext(null),SwiperContext=reactExports.createContext(null),Swiper=reactExports.forwardRef(function(tt,et){let{className:rt,tag:nt="div",wrapperTag:st="div",children:ot,onSwiper:at,...lt}=tt===void 0?{}:tt,ut=!1;const[ct,dt]=reactExports.useState("swiper"),[ht,mt]=reactExports.useState(null),[xt,yt]=reactExports.useState(!1),vt=reactExports.useRef(!1),Et=reactExports.useRef(null),bt=reactExports.useRef(null),St=reactExports.useRef(null),wt=reactExports.useRef(null),Rt=reactExports.useRef(null),Ct=reactExports.useRef(null),Pt=reactExports.useRef(null),It=reactExports.useRef(null),{params:jt,passedParams:Dt,rest:Vt,events:Ft}=getParams(lt),{slides:Ht,slots:Nt}=getChildren(ot),Lt=()=>{yt(!xt)};Object.assign(jt.on,{_containerClasses(Ut,Bt){dt(Bt)}});const Mt=()=>{Object.assign(jt.on,Ft),ut=!0;const Ut={...jt};if(delete Ut.wrapperClass,bt.current=new Swiper$1(Ut),bt.current.virtual&&bt.current.params.virtual.enabled){bt.current.virtual.slides=Ht;const Bt={cache:!1,slides:Ht,renderExternal:mt,renderExternalUpdate:!1};extend(bt.current.params.virtual,Bt),extend(bt.current.originalParams.virtual,Bt)}};Et.current||Mt(),bt.current&&bt.current.on("_beforeBreakpoint",Lt);const zt=()=>{ut||!Ft||!bt.current||Object.keys(Ft).forEach(Ut=>{bt.current.on(Ut,Ft[Ut])})},Gt=()=>{!Ft||!bt.current||Object.keys(Ft).forEach(Ut=>{bt.current.off(Ut,Ft[Ut])})};reactExports.useEffect(()=>()=>{bt.current&&bt.current.off("_beforeBreakpoint",Lt)}),reactExports.useEffect(()=>{!vt.current&&bt.current&&(bt.current.emitSlidesClasses(),vt.current=!0)}),useIsomorphicLayoutEffect(()=>{if(et&&(et.current=Et.current),!!Et.current)return bt.current.destroyed&&Mt(),mountSwiper({el:Et.current,nextEl:Rt.current,prevEl:Ct.current,paginationEl:Pt.current,scrollbarEl:It.current,swiper:bt.current},jt),at&&at(bt.current),()=>{bt.current&&!bt.current.destroyed&&bt.current.destroy(!0,!1)}},[]),useIsomorphicLayoutEffect(()=>{zt();const Ut=getChangedParams(Dt,St.current,Ht,wt.current,Bt=>Bt.key);return St.current=Dt,wt.current=Ht,Ut.length&&bt.current&&!bt.current.destroyed&&updateSwiper({swiper:bt.current,slides:Ht,passedParams:Dt,changedParams:Ut,nextEl:Rt.current,prevEl:Ct.current,scrollbarEl:It.current,paginationEl:Pt.current}),()=>{Gt()}}),useIsomorphicLayoutEffect(()=>{updateOnVirtualData(bt.current)},[ht]);function $t(){return jt.virtual?renderVirtual(bt.current,Ht,ht):Ht.map((Ut,Bt)=>React$4.cloneElement(Ut,{swiper:bt.current,swiperSlideIndex:Bt}))}return React$4.createElement(nt,_extends({ref:Et,className:uniqueClasses(`${ct}${rt?` ${rt}`:""}`)},Vt),React$4.createElement(SwiperContext.Provider,{value:bt.current},Nt["container-start"],React$4.createElement(st,{className:wrapperClass(jt.wrapperClass)},Nt["wrapper-start"],$t(),Nt["wrapper-end"]),needsNavigation(jt)&&React$4.createElement(React$4.Fragment,null,React$4.createElement("div",{ref:Ct,className:"swiper-button-prev"}),React$4.createElement("div",{ref:Rt,className:"swiper-button-next"})),needsScrollbar(jt)&&React$4.createElement("div",{ref:It,className:"swiper-scrollbar"}),needsPagination(jt)&&React$4.createElement("div",{ref:Pt,className:"swiper-pagination"}),Nt["container-end"]))});Swiper.displayName="Swiper";const SwiperSlide=reactExports.forwardRef(function(tt,et){let{tag:rt="div",children:nt,className:st="",swiper:ot,zoom:at,lazy:lt,virtualIndex:ut,swiperSlideIndex:ct,...dt}=tt===void 0?{}:tt;const ht=reactExports.useRef(null),[mt,xt]=reactExports.useState("swiper-slide"),[yt,vt]=reactExports.useState(!1);function Et(Rt,Ct,Pt){Ct===ht.current&&xt(Pt)}useIsomorphicLayoutEffect(()=>{if(typeof ct<"u"&&(ht.current.swiperSlideIndex=ct),et&&(et.current=ht.current),!(!ht.current||!ot)){if(ot.destroyed){mt!=="swiper-slide"&&xt("swiper-slide");return}return ot.on("_slideClass",Et),()=>{ot&&ot.off("_slideClass",Et)}}}),useIsomorphicLayoutEffect(()=>{ot&&ht.current&&!ot.destroyed&&xt(ot.getSlideClasses(ht.current))},[ot]);const bt={isActive:mt.indexOf("swiper-slide-active")>=0,isVisible:mt.indexOf("swiper-slide-visible")>=0,isPrev:mt.indexOf("swiper-slide-prev")>=0,isNext:mt.indexOf("swiper-slide-next")>=0},St=()=>typeof nt=="function"?nt(bt):nt,wt=()=>{vt(!0)};return React$4.createElement(rt,_extends({ref:ht,className:uniqueClasses(`${mt}${st?` ${st}`:""}`),"data-swiper-slide-index":ut,onLoad:wt},dt),at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},React$4.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof at=="number"?at:void 0},St(),lt&&!yt&&React$4.createElement("div",{className:"swiper-lazy-preloader"}))),!at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},St(),lt&&!yt&&React$4.createElement("div",{className:"swiper-lazy-preloader"})))});SwiperSlide.displayName="SwiperSlide";const getOnboardingTrash=async tt=>await odeServices.conf().getPreference(tt),saveOnboardingTrash=async tt=>await odeServices.conf().savePreference(tt,JSON.stringify({key:!1})),useOnboardingModal=tt=>{const[et,rt]=reactExports.useState(!0),[nt,st]=reactExports.useState(!1);return reactExports.useEffect(()=>{(async()=>{const ot=await getOnboardingTrash(tt);if(ot){const{key:at}=ot;st(at);return}st(!0)})()},[tt]),{isOpen:et,setIsOpen:rt,isOnboarding:nt,handleSavePreference:async()=>{await saveOnboardingTrash(tt),rt(!1)}}},OnboardingModal$2=({id:tt,items:et,modalOptions:rt})=>{const[nt,st]=reactExports.useState(),[ot,at]=reactExports.useState(0),{isOpen:lt,isOnboarding:ut,setIsOpen:ct,handleSavePreference:dt}=useOnboardingModal(tt);reactExports.useEffect(()=>{const Et=document.createElement("link");return Et.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",Et.rel="stylesheet",Et.type="text/css",document.head.appendChild(Et),()=>{document.head.removeChild(Et)}},[]);const{t:ht}=useTranslation(),{title:mt,prevText:xt,closeText:yt,nextText:vt}=rt;return ut?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"onboarding-modal",size:"md",isOpen:lt,focusId:"nextButtonId",onModalClose:()=>ct(!1),children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:()=>ct(!1),children:ht(mt||"explorer.modal.onboarding.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx(Swiper,{modules:[Pagination],onSwiper:Et=>{st(Et)},onSlideChange:Et=>{at(Et.progress)},pagination:{clickable:!0},children:et.map((Et,bt)=>jsxRuntimeExports.jsxs(SwiperSlide,{children:[jsxRuntimeExports.jsx(Image$1,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:Et.src,alt:ht(Et.alt)}),jsxRuntimeExports.jsx("p",{children:ht(Et.text)})]},bt))})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>ct(!1),children:ht("explorer.modal.onboarding.trash.later")}),ot>0&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"outline",onClick:()=>nt.slidePrev(),children:ht(xt||"explorer.modal.onboarding.trash.prev")}),ot<1&&jsxRuntimeExports.jsx(Button,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>nt.slideNext(),children:ht(vt||"explorer.modal.onboarding.trash.next")}),ot===1&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",onClick:dt,children:ht(yt||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null};var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const rt=Array.isArray(tt),nt=typeof FileList<"u"?tt instanceof FileList:!1;if(tt instanceof Date)et=new Date(tt);else if(tt instanceof Set)et=new Set(tt);else if(!(isWeb&&(tt instanceof Blob||nt))&&(rt||isObject(tt)))if(et=rt?[]:{},!rt&&!isPlainObject(tt))et=tt;else for(const st in tt)tt.hasOwnProperty(st)&&(et[st]=cloneObject(tt[st]));else return tt;return et}var compact$1=tt=>Array.isArray(tt)?tt.filter(Boolean):[],isUndefined=tt=>tt===void 0,get$1=(tt,et,rt)=>{if(!et||!isObject(tt))return rt;const nt=compact$1(et.split(/[,[\].]+?/)).reduce((st,ot)=>isNullOrUndefined(st)?st:st[ot],tt);return isUndefined(nt)||nt===tt?isUndefined(tt[et])?rt:tt[et]:nt},isBoolean$1=tt=>typeof tt=="boolean",isKey=tt=>/^\w*$/.test(tt),stringToPath$1=tt=>compact$1(tt.replace(/["|']|\]/g,"").split(/\.|\[/)),set=(tt,et,rt)=>{let nt=-1;const st=isKey(et)?[et]:stringToPath$1(et),ot=st.length,at=ot-1;for(;++nt<ot;){const lt=st[nt];let ut=rt;if(nt!==at){const ct=tt[lt];ut=isObject(ct)||Array.isArray(ct)?ct:isNaN(+st[nt+1])?{}:[]}if(lt==="__proto__"||lt==="constructor"||lt==="prototype")return;tt[lt]=ut,tt=tt[lt]}return tt};const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$4.createContext(null),useFormContext=()=>React$4.useContext(HookFormContext);var getProxyFormState=(tt,et,rt,nt=!0)=>{const st={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(st,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!nt||VALIDATION_MODE.all),rt&&(rt[at]=!0),tt[at]}});return st},isEmptyObject=tt=>isObject(tt)&&!Object.keys(tt).length,shouldRenderFormState=(tt,et,rt,nt)=>{rt(tt);const{name:st,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!nt||VALIDATION_MODE.all))},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],shouldSubscribeByName=(tt,et,rt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(nt=>nt&&(rt?nt===et:nt.startsWith(et)||et.startsWith(nt)));function useSubscribe(tt){const et=React$4.useRef(tt);et.current=tt,React$4.useEffect(()=>{const rt=!tt.disabled&&et.current.subject&&et.current.subject.subscribe({next:et.current.next});return()=>{rt&&rt.unsubscribe()}},[tt.disabled])}function useFormState(tt){const et=useFormContext(),{control:rt=et.control,disabled:nt,name:st,exact:ot}=tt,[at,lt]=React$4.useState(rt._formState),ut=React$4.useRef(!0),ct=React$4.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),dt=React$4.useRef(st);return dt.current=st,useSubscribe({disabled:nt,next:ht=>ut.current&&shouldSubscribeByName(dt.current,ht.name,ot)&&shouldRenderFormState(ht,ct.current,rt._updateFormState)&&lt({...rt._formState,...ht}),subject:rt._subjects.state}),React$4.useEffect(()=>(ut.current=!0,ct.current.isValid&&rt._updateValid(!0),()=>{ut.current=!1}),[rt]),React$4.useMemo(()=>getProxyFormState(at,rt,ct.current,!1),[at,rt])}var isString$1=tt=>typeof tt=="string",generateWatchOutput=(tt,et,rt,nt,st)=>isString$1(tt)?(nt&&et.watch.add(tt),get$1(rt,tt,st)):Array.isArray(tt)?tt.map(ot=>(nt&&et.watch.add(ot),get$1(rt,ot))):(nt&&(et.watchAll=!0),rt);function useWatch(tt){const et=useFormContext(),{control:rt=et.control,name:nt,defaultValue:st,disabled:ot,exact:at}=tt,lt=React$4.useRef(nt);lt.current=nt,useSubscribe({disabled:ot,subject:rt._subjects.values,next:dt=>{shouldSubscribeByName(lt.current,dt.name,at)&&ct(cloneObject(generateWatchOutput(lt.current,rt._names,dt.values||rt._formValues,!1,st)))}});const[ut,ct]=React$4.useState(rt._getWatch(nt,st));return React$4.useEffect(()=>rt._removeUnmounted()),ut}function useController(tt){const et=useFormContext(),{name:rt,disabled:nt,control:st=et.control,shouldUnregister:ot}=tt,at=isNameInFieldArray(st._names.array,rt),lt=useWatch({control:st,name:rt,defaultValue:get$1(st._formValues,rt,get$1(st._defaultValues,rt,tt.defaultValue)),exact:!0}),ut=useFormState({control:st,name:rt,exact:!0}),ct=React$4.useRef(st.register(rt,{...tt.rules,value:lt,...isBoolean$1(tt.disabled)?{disabled:tt.disabled}:{}})),dt=React$4.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$1(ut.errors,rt)},isDirty:{enumerable:!0,get:()=>!!get$1(ut.dirtyFields,rt)},isTouched:{enumerable:!0,get:()=>!!get$1(ut.touchedFields,rt)},isValidating:{enumerable:!0,get:()=>!!get$1(ut.validatingFields,rt)},error:{enumerable:!0,get:()=>get$1(ut.errors,rt)}}),[ut,rt]),ht=React$4.useMemo(()=>({name:rt,value:lt,...isBoolean$1(nt)||ut.disabled?{disabled:ut.disabled||nt}:{},onChange:mt=>ct.current.onChange({target:{value:getEventValue(mt),name:rt},type:EVENTS.CHANGE}),onBlur:()=>ct.current.onBlur({target:{value:get$1(st._formValues,rt),name:rt},type:EVENTS.BLUR}),ref:mt=>{const xt=get$1(st._fields,rt);xt&&mt&&(xt._f.ref={focus:()=>mt.focus(),select:()=>mt.select(),setCustomValidity:yt=>mt.setCustomValidity(yt),reportValidity:()=>mt.reportValidity()})}}),[rt,st._formValues,nt,ut.disabled,lt,st._fields]);return React$4.useEffect(()=>{const mt=st._options.shouldUnregister||ot,xt=(yt,vt)=>{const Et=get$1(st._fields,yt);Et&&Et._f&&(Et._f.mount=vt)};if(xt(rt,!0),mt){const yt=cloneObject(get$1(st._options.defaultValues,rt));set(st._defaultValues,rt,yt),isUndefined(get$1(st._formValues,rt))&&set(st._formValues,rt,yt)}return!at&&st.register(rt),()=>{(at?mt&&!st._state.action:mt)?st.unregister(rt):xt(rt,!1)}},[rt,st,at,ot]),React$4.useEffect(()=>{st._updateDisabledField({disabled:nt,fields:st._fields,name:rt})},[nt,rt,st]),React$4.useMemo(()=>({field:ht,formState:ut,fieldState:dt}),[ht,ut,dt])}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,rt,nt,st)=>et?{...rt[tt],types:{...rt[tt]&&rt[tt].types?rt[tt].types:{},[nt]:st||!0}}:{},getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched}),isWatched=(tt,et,rt)=>!rt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(nt=>tt.startsWith(nt)&&/^\.\w+/.test(tt.slice(nt.length))));const iterateFieldsByAction=(tt,et,rt,nt)=>{for(const st of rt||Object.keys(tt)){const ot=get$1(tt,st);if(ot){const{_f:at,...lt}=ot;if(at){if(at.refs&&at.refs[0]&&et(at.refs[0],st)&&!nt)return!0;if(at.ref&&et(at.ref,at.name)&&!nt)return!0;if(iterateFieldsByAction(lt,et))break}else if(isObject(lt)&&iterateFieldsByAction(lt,et))break}}};var updateFieldArrayRootError=(tt,et,rt)=>{const nt=convertToArrayPayload(get$1(tt,rt));return set(nt,"root",et[rt]),set(tt,rt,nt),tt},isFileInput=tt=>tt.type==="file",isFunction=tt=>typeof tt=="function",isHTMLElement=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMessage=tt=>isString$1(tt),isRadioInput=tt=>tt.type==="radio",isRegex=tt=>tt instanceof RegExp;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(rt=>rt&&rt.checked&&!rt.disabled).map(rt=>rt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined(tt[0].attributes.value)?isUndefined(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult}return defaultResult};const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,rt)=>rt&&rt.checked&&!rt.disabled?{isValid:!0,value:rt.value}:et,defaultReturn):defaultReturn;function getValidateError(tt,et,rt="validate"){if(isMessage(tt)||Array.isArray(tt)&&tt.every(isMessage)||isBoolean$1(tt)&&!tt)return{type:rt,message:isMessage(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,rt,nt,st,ot)=>{const{ref:at,refs:lt,required:ut,maxLength:ct,minLength:dt,min:ht,max:mt,pattern:xt,validate:yt,name:vt,valueAsNumber:Et,mount:bt}=tt._f,St=get$1(rt,vt);if(!bt||et.has(vt))return{};const wt=lt?lt[0]:at,Rt=Ht=>{st&&wt.reportValidity&&(wt.setCustomValidity(isBoolean$1(Ht)?"":Ht||""),wt.reportValidity())},Ct={},Pt=isRadioInput(at),It=isCheckBoxInput(at),jt=Pt||It,Dt=(Et||isFileInput(at))&&isUndefined(at.value)&&isUndefined(St)||isHTMLElement(at)&&at.value===""||St===""||Array.isArray(St)&&!St.length,Vt=appendErrors.bind(null,vt,nt,Ct),Ft=(Ht,Nt,Lt,Mt=INPUT_VALIDATION_RULES.maxLength,zt=INPUT_VALIDATION_RULES.minLength)=>{const Gt=Ht?Nt:Lt;Ct[vt]={type:Ht?Mt:zt,message:Gt,ref:at,...Vt(Ht?Mt:zt,Gt)}};if(ot?!Array.isArray(St)||!St.length:ut&&(!jt&&(Dt||isNullOrUndefined(St))||isBoolean$1(St)&&!St||It&&!getCheckboxValue(lt).isValid||Pt&&!getRadioValue(lt).isValid)){const{value:Ht,message:Nt}=isMessage(ut)?{value:!!ut,message:ut}:getValueAndMessage(ut);if(Ht&&(Ct[vt]={type:INPUT_VALIDATION_RULES.required,message:Nt,ref:wt,...Vt(INPUT_VALIDATION_RULES.required,Nt)},!nt))return Rt(Nt),Ct}if(!Dt&&(!isNullOrUndefined(ht)||!isNullOrUndefined(mt))){let Ht,Nt;const Lt=getValueAndMessage(mt),Mt=getValueAndMessage(ht);if(!isNullOrUndefined(St)&&!isNaN(St)){const zt=at.valueAsNumber||St&&+St;isNullOrUndefined(Lt.value)||(Ht=zt>Lt.value),isNullOrUndefined(Mt.value)||(Nt=zt<Mt.value)}else{const zt=at.valueAsDate||new Date(St),Gt=Bt=>new Date(new Date().toDateString()+" "+Bt),$t=at.type=="time",Ut=at.type=="week";isString$1(Lt.value)&&St&&(Ht=$t?Gt(St)>Gt(Lt.value):Ut?St>Lt.value:zt>new Date(Lt.value)),isString$1(Mt.value)&&St&&(Nt=$t?Gt(St)<Gt(Mt.value):Ut?St<Mt.value:zt<new Date(Mt.value))}if((Ht||Nt)&&(Ft(!!Ht,Lt.message,Mt.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!nt))return Rt(Ct[vt].message),Ct}if((ct||dt)&&!Dt&&(isString$1(St)||ot&&Array.isArray(St))){const Ht=getValueAndMessage(ct),Nt=getValueAndMessage(dt),Lt=!isNullOrUndefined(Ht.value)&&St.length>+Ht.value,Mt=!isNullOrUndefined(Nt.value)&&St.length<+Nt.value;if((Lt||Mt)&&(Ft(Lt,Ht.message,Nt.message),!nt))return Rt(Ct[vt].message),Ct}if(xt&&!Dt&&isString$1(St)){const{value:Ht,message:Nt}=getValueAndMessage(xt);if(isRegex(Ht)&&!St.match(Ht)&&(Ct[vt]={type:INPUT_VALIDATION_RULES.pattern,message:Nt,ref:at,...Vt(INPUT_VALIDATION_RULES.pattern,Nt)},!nt))return Rt(Nt),Ct}if(yt){if(isFunction(yt)){const Ht=await yt(St,rt),Nt=getValidateError(Ht,wt);if(Nt&&(Ct[vt]={...Nt,...Vt(INPUT_VALIDATION_RULES.validate,Nt.message)},!nt))return Rt(Nt.message),Ct}else if(isObject(yt)){let Ht={};for(const Nt in yt){if(!isEmptyObject(Ht)&&!nt)break;const Lt=getValidateError(await yt[Nt](St,rt),wt,Nt);Lt&&(Ht={...Lt,...Vt(Nt,Lt.message)},Rt(Lt.message),nt&&(Ct[vt]=Ht))}if(!isEmptyObject(Ht)&&(Ct[vt]={ref:wt,...Ht},!nt))return Ct}}return Rt(!0),Ct};function baseGet(tt,et){const rt=et.slice(0,-1).length;let nt=0;for(;nt<rt;)tt=isUndefined(tt)?nt++:tt[et[nt++]];return tt}function isEmptyArray(tt){for(const et in tt)if(tt.hasOwnProperty(et)&&!isUndefined(tt[et]))return!1;return!0}function unset(tt,et){const rt=Array.isArray(et)?et:isKey(et)?[et]:stringToPath$1(et),nt=rt.length===1?tt:baseGet(tt,rt),st=rt.length-1,ot=rt[st];return nt&&delete nt[ot],st!==0&&(isObject(nt)&&isEmptyObject(nt)||Array.isArray(nt)&&isEmptyArray(nt))&&unset(tt,rt.slice(0,-1)),tt}var createSubject=()=>{let tt=[];return{get observers(){return tt},next:st=>{for(const ot of tt)ot.next&&ot.next(st)},subscribe:st=>(tt.push(st),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==st)}}),unsubscribe:()=>{tt=[]}}},isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual(tt,et){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const rt=Object.keys(tt),nt=Object.keys(et);if(rt.length!==nt.length)return!1;for(const st of rt){const ot=tt[st];if(!nt.includes(st))return!1;if(st!=="ref"){const at=et[st];if(isDateObject(ot)&&isDateObject(at)||isObject(ot)&&isObject(at)||Array.isArray(ot)&&Array.isArray(at)?!deepEqual(ot,at):ot!==at)return!1}}return!0}var isMultipleSelect=tt=>tt.type==="select-multiple",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement(tt)&&tt.isConnected,objectHasFunction=tt=>{for(const et in tt)if(isFunction(tt[et]))return!0;return!1};function markFieldsDirty(tt,et={}){const rt=Array.isArray(tt);if(isObject(tt)||rt)for(const nt in tt)Array.isArray(tt[nt])||isObject(tt[nt])&&!objectHasFunction(tt[nt])?(et[nt]=Array.isArray(tt[nt])?[]:{},markFieldsDirty(tt[nt],et[nt])):isNullOrUndefined(tt[nt])||(et[nt]=!0);return et}function getDirtyFieldsFromDefaultValues(tt,et,rt){const nt=Array.isArray(tt);if(isObject(tt)||nt)for(const st in tt)Array.isArray(tt[st])||isObject(tt[st])&&!objectHasFunction(tt[st])?isUndefined(et)||isPrimitive(rt[st])?rt[st]=Array.isArray(tt[st])?markFieldsDirty(tt[st],[]):{...markFieldsDirty(tt[st])}:getDirtyFieldsFromDefaultValues(tt[st],isNullOrUndefined(et)?{}:et[st],rt[st]):rt[st]=!deepEqual(tt[st],et[st]);return rt}var getDirtyFields=(tt,et)=>getDirtyFieldsFromDefaultValues(tt,et,markFieldsDirty(et)),getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:rt,setValueAs:nt})=>isUndefined(tt)?tt:et?tt===""?NaN:tt&&+tt:rt&&isString$1(tt)?new Date(tt):nt?nt(tt):tt;function getFieldValue(tt){const et=tt.ref;return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:rt})=>rt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,rt,nt)=>{const st={};for(const ot of tt){const at=get$1(et,ot);at&&set(st,ot,at._f)}return{criteriaMode:rt,names:[...tt],fields:st,shouldUseNativeValidation:nt}},getRuleValue=tt=>isUndefined(tt)?tt:isRegex(tt)?tt.source:isObject(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt;const ASYNC_FUNCTION="AsyncFunction";var hasPromiseValidation=tt=>!!tt&&!!tt.validate&&!!(isFunction(tt.validate)&&tt.validate.constructor.name===ASYNC_FUNCTION||isObject(tt.validate)&&Object.values(tt.validate).find(et=>et.constructor.name===ASYNC_FUNCTION)),hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate);function schemaErrorLookup(tt,et,rt){const nt=get$1(tt,rt);if(nt||isKey(rt))return{error:nt,name:rt};const st=rt.split(".");for(;st.length;){const ot=st.join("."),at=get$1(et,ot),lt=get$1(tt,ot);if(at&&!Array.isArray(at)&&rt!==ot)return{name:rt};if(lt&&lt.type)return{name:ot,error:lt};st.pop()}return{name:rt}}var skipValidation=(tt,et,rt,nt,st)=>st.isOnAll?!1:!rt&&st.isOnTouch?!(et||tt):(rt?nt.isOnBlur:st.isOnBlur)?!tt:(rt?nt.isOnChange:st.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact$1(get$1(tt,et)).length&&unset(tt,et);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={}){let et={...defaultOptions,...tt},rt={submitCount:0,isDirty:!1,isLoading:isFunction(et.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:et.errors||{},disabled:et.disabled||!1},nt={},st=isObject(et.defaultValues)||isObject(et.values)?cloneObject(et.defaultValues||et.values)||{}:{},ot=et.shouldUnregister?{}:cloneObject(st),at={action:!1,mount:!1,watch:!1},lt={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},ut,ct=0;const dt={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},ht={values:createSubject(),array:createSubject(),state:createSubject()},mt=getValidationModes(et.mode),xt=getValidationModes(et.reValidateMode),yt=et.criteriaMode===VALIDATION_MODE.all,vt=qt=>er=>{clearTimeout(ct),ct=setTimeout(qt,er)},Et=async qt=>{if(!et.disabled&&(dt.isValid||qt)){const er=et.resolver?isEmptyObject((await jt()).errors):await Vt(nt,!0);er!==rt.isValid&&ht.state.next({isValid:er})}},bt=(qt,er)=>{!et.disabled&&(dt.isValidating||dt.validatingFields)&&((qt||Array.from(lt.mount)).forEach(nr=>{nr&&(er?set(rt.validatingFields,nr,er):unset(rt.validatingFields,nr))}),ht.state.next({validatingFields:rt.validatingFields,isValidating:!isEmptyObject(rt.validatingFields)}))},St=(qt,er=[],nr,yr,xr=!0,dr=!0)=>{if(yr&&nr&&!et.disabled){if(at.action=!0,dr&&Array.isArray(get$1(nt,qt))){const _r=nr(get$1(nt,qt),yr.argA,yr.argB);xr&&set(nt,qt,_r)}if(dr&&Array.isArray(get$1(rt.errors,qt))){const _r=nr(get$1(rt.errors,qt),yr.argA,yr.argB);xr&&set(rt.errors,qt,_r),unsetEmptyArray(rt.errors,qt)}if(dt.touchedFields&&dr&&Array.isArray(get$1(rt.touchedFields,qt))){const _r=nr(get$1(rt.touchedFields,qt),yr.argA,yr.argB);xr&&set(rt.touchedFields,qt,_r)}dt.dirtyFields&&(rt.dirtyFields=getDirtyFields(st,ot)),ht.state.next({name:qt,isDirty:Ht(qt,er),dirtyFields:rt.dirtyFields,errors:rt.errors,isValid:rt.isValid})}else set(ot,qt,er)},wt=(qt,er)=>{set(rt.errors,qt,er),ht.state.next({errors:rt.errors})},Rt=qt=>{rt.errors=qt,ht.state.next({errors:rt.errors,isValid:!1})},Ct=(qt,er,nr,yr)=>{const xr=get$1(nt,qt);if(xr){const dr=get$1(ot,qt,isUndefined(nr)?get$1(st,qt):nr);isUndefined(dr)||yr&&yr.defaultChecked||er?set(ot,qt,er?dr:getFieldValue(xr._f)):Mt(qt,dr),at.mount&&Et()}},Pt=(qt,er,nr,yr,xr)=>{let dr=!1,_r=!1;const Fr={name:qt};if(!et.disabled){const jr=!!(get$1(nt,qt)&&get$1(nt,qt)._f&&get$1(nt,qt)._f.disabled);if(!nr||yr){dt.isDirty&&(_r=rt.isDirty,rt.isDirty=Fr.isDirty=Ht(),dr=_r!==Fr.isDirty);const Ir=jr||deepEqual(get$1(st,qt),er);_r=!!(!jr&&get$1(rt.dirtyFields,qt)),Ir||jr?unset(rt.dirtyFields,qt):set(rt.dirtyFields,qt,!0),Fr.dirtyFields=rt.dirtyFields,dr=dr||dt.dirtyFields&&_r!==!Ir}if(nr){const Ir=get$1(rt.touchedFields,qt);Ir||(set(rt.touchedFields,qt,nr),Fr.touchedFields=rt.touchedFields,dr=dr||dt.touchedFields&&Ir!==nr)}dr&&xr&&ht.state.next(Fr)}return dr?Fr:{}},It=(qt,er,nr,yr)=>{const xr=get$1(rt.errors,qt),dr=dt.isValid&&isBoolean$1(er)&&rt.isValid!==er;if(et.delayError&&nr?(ut=vt(()=>wt(qt,nr)),ut(et.delayError)):(clearTimeout(ct),ut=null,nr?set(rt.errors,qt,nr):unset(rt.errors,qt)),(nr?!deepEqual(xr,nr):xr)||!isEmptyObject(yr)||dr){const _r={...yr,...dr&&isBoolean$1(er)?{isValid:er}:{},errors:rt.errors,name:qt};rt={...rt,..._r},ht.state.next(_r)}},jt=async qt=>{bt(qt,!0);const er=await et.resolver(ot,et.context,getResolverOptions(qt||lt.mount,nt,et.criteriaMode,et.shouldUseNativeValidation));return bt(qt),er},Dt=async qt=>{const{errors:er}=await jt(qt);if(qt)for(const nr of qt){const yr=get$1(er,nr);yr?set(rt.errors,nr,yr):unset(rt.errors,nr)}else rt.errors=er;return er},Vt=async(qt,er,nr={valid:!0})=>{for(const yr in qt){const xr=qt[yr];if(xr){const{_f:dr,..._r}=xr;if(dr){const Fr=lt.array.has(dr.name),jr=xr._f&&hasPromiseValidation(xr._f);jr&&dt.validatingFields&&bt([yr],!0);const Ir=await validateField(xr,lt.disabled,ot,yt,et.shouldUseNativeValidation&&!er,Fr);if(jr&&dt.validatingFields&&bt([yr]),Ir[dr.name]&&(nr.valid=!1,er))break;!er&&(get$1(Ir,dr.name)?Fr?updateFieldArrayRootError(rt.errors,Ir,dr.name):set(rt.errors,dr.name,Ir[dr.name]):unset(rt.errors,dr.name))}!isEmptyObject(_r)&&await Vt(_r,er,nr)}}return nr.valid},Ft=()=>{for(const qt of lt.unMount){const er=get$1(nt,qt);er&&(er._f.refs?er._f.refs.every(nr=>!live(nr)):!live(er._f.ref))&&ur(qt)}lt.unMount=new Set},Ht=(qt,er)=>!et.disabled&&(qt&&er&&set(ot,qt,er),!deepEqual(Yt(),st)),Nt=(qt,er,nr)=>generateWatchOutput(qt,lt,{...at.mount?ot:isUndefined(er)?st:isString$1(qt)?{[qt]:er}:er},nr,er),Lt=qt=>compact$1(get$1(at.mount?ot:st,qt,et.shouldUnregister?get$1(st,qt,[]):[])),Mt=(qt,er,nr={})=>{const yr=get$1(nt,qt);let xr=er;if(yr){const dr=yr._f;dr&&(!dr.disabled&&set(ot,qt,getFieldValueAs(er,dr)),xr=isHTMLElement(dr.ref)&&isNullOrUndefined(er)?"":er,isMultipleSelect(dr.ref)?[...dr.ref.options].forEach(_r=>_r.selected=xr.includes(_r.value)):dr.refs?isCheckBoxInput(dr.ref)?dr.refs.length>1?dr.refs.forEach(_r=>(!_r.defaultChecked||!_r.disabled)&&(_r.checked=Array.isArray(xr)?!!xr.find(Fr=>Fr===_r.value):xr===_r.value)):dr.refs[0]&&(dr.refs[0].checked=!!xr):dr.refs.forEach(_r=>_r.checked=_r.value===xr):isFileInput(dr.ref)?dr.ref.value="":(dr.ref.value=xr,dr.ref.type||ht.values.next({name:qt,values:{...ot}})))}(nr.shouldDirty||nr.shouldTouch)&&Pt(qt,xr,nr.shouldTouch,nr.shouldDirty,!0),nr.shouldValidate&&Bt(qt)},zt=(qt,er,nr)=>{for(const yr in er){const xr=er[yr],dr=`${qt}.${yr}`,_r=get$1(nt,dr);(lt.array.has(qt)||isObject(xr)||_r&&!_r._f)&&!isDateObject(xr)?zt(dr,xr,nr):Mt(dr,xr,nr)}},Gt=(qt,er,nr={})=>{const yr=get$1(nt,qt),xr=lt.array.has(qt),dr=cloneObject(er);set(ot,qt,dr),xr?(ht.array.next({name:qt,values:{...ot}}),(dt.isDirty||dt.dirtyFields)&&nr.shouldDirty&&ht.state.next({name:qt,dirtyFields:getDirtyFields(st,ot),isDirty:Ht(qt,dr)})):yr&&!yr._f&&!isNullOrUndefined(dr)?zt(qt,dr,nr):Mt(qt,dr,nr),isWatched(qt,lt)&&ht.state.next({...rt}),ht.values.next({name:at.mount?qt:void 0,values:{...ot}})},$t=async qt=>{at.mount=!0;const er=qt.target;let nr=er.name,yr=!0;const xr=get$1(nt,nr),dr=()=>er.type?getFieldValue(xr._f):getEventValue(qt),_r=Fr=>{yr=Number.isNaN(Fr)||isDateObject(Fr)&&isNaN(Fr.getTime())||deepEqual(Fr,get$1(ot,nr,Fr))};if(xr){let Fr,jr;const Ir=dr(),Pr=qt.type===EVENTS.BLUR||qt.type===EVENTS.FOCUS_OUT,Vr=!hasValidation(xr._f)&&!et.resolver&&!get$1(rt.errors,nr)&&!xr._f.deps||skipValidation(Pr,get$1(rt.touchedFields,nr),rt.isSubmitted,xt,mt),Xn=isWatched(nr,lt,Pr);set(ot,nr,Ir),Pr?(xr._f.onBlur&&xr._f.onBlur(qt),ut&&ut(0)):xr._f.onChange&&xr._f.onChange(qt);const An=Pt(nr,Ir,Pr,!1),Hr=!isEmptyObject(An)||Xn;if(!Pr&&ht.values.next({name:nr,type:qt.type,values:{...ot}}),Vr)return dt.isValid&&(et.mode==="onBlur"&&Pr?Et():Pr||Et()),Hr&&ht.state.next({name:nr,...Xn?{}:An});if(!Pr&&Xn&&ht.state.next({...rt}),et.resolver){const{errors:Lr}=await jt([nr]);if(_r(Ir),yr){const os=schemaErrorLookup(rt.errors,nt,nr),Ms=schemaErrorLookup(Lr,nt,os.name||nr);Fr=Ms.error,nr=Ms.name,jr=isEmptyObject(Lr)}}else bt([nr],!0),Fr=(await validateField(xr,lt.disabled,ot,yt,et.shouldUseNativeValidation))[nr],bt([nr]),_r(Ir),yr&&(Fr?jr=!1:dt.isValid&&(jr=await Vt(nt,!0)));yr&&(xr._f.deps&&Bt(xr._f.deps),It(nr,jr,Fr,An))}},Ut=(qt,er)=>{if(get$1(rt.errors,er)&&qt.focus)return qt.focus(),1},Bt=async(qt,er={})=>{let nr,yr;const xr=convertToArrayPayload(qt);if(et.resolver){const dr=await Dt(isUndefined(qt)?qt:xr);nr=isEmptyObject(dr),yr=qt?!xr.some(_r=>get$1(dr,_r)):nr}else qt?(yr=(await Promise.all(xr.map(async dr=>{const _r=get$1(nt,dr);return await Vt(_r&&_r._f?{[dr]:_r}:_r)}))).every(Boolean),!(!yr&&!rt.isValid)&&Et()):yr=nr=await Vt(nt);return ht.state.next({...!isString$1(qt)||dt.isValid&&nr!==rt.isValid?{}:{name:qt},...et.resolver||!qt?{isValid:nr}:{},errors:rt.errors}),er.shouldFocus&&!yr&&iterateFieldsByAction(nt,Ut,qt?xr:lt.mount),yr},Yt=qt=>{const er={...at.mount?ot:st};return isUndefined(qt)?er:isString$1(qt)?get$1(er,qt):qt.map(nr=>get$1(er,nr))},Zt=(qt,er)=>({invalid:!!get$1((er||rt).errors,qt),isDirty:!!get$1((er||rt).dirtyFields,qt),error:get$1((er||rt).errors,qt),isValidating:!!get$1(rt.validatingFields,qt),isTouched:!!get$1((er||rt).touchedFields,qt)}),Xt=qt=>{qt&&convertToArrayPayload(qt).forEach(er=>unset(rt.errors,er)),ht.state.next({errors:qt?rt.errors:{}})},rr=(qt,er,nr)=>{const yr=(get$1(nt,qt,{_f:{}})._f||{}).ref,xr=get$1(rt.errors,qt)||{},{ref:dr,message:_r,type:Fr,...jr}=xr;set(rt.errors,qt,{...jr,...er,ref:yr}),ht.state.next({name:qt,errors:rt.errors,isValid:!1}),nr&&nr.shouldFocus&&yr&&yr.focus&&yr.focus()},cr=(qt,er)=>isFunction(qt)?ht.values.subscribe({next:nr=>qt(Nt(void 0,er),nr)}):Nt(qt,er,!0),ur=(qt,er={})=>{for(const nr of qt?convertToArrayPayload(qt):lt.mount)lt.mount.delete(nr),lt.array.delete(nr),er.keepValue||(unset(nt,nr),unset(ot,nr)),!er.keepError&&unset(rt.errors,nr),!er.keepDirty&&unset(rt.dirtyFields,nr),!er.keepTouched&&unset(rt.touchedFields,nr),!er.keepIsValidating&&unset(rt.validatingFields,nr),!et.shouldUnregister&&!er.keepDefaultValue&&unset(st,nr);ht.values.next({values:{...ot}}),ht.state.next({...rt,...er.keepDirty?{isDirty:Ht()}:{}}),!er.keepIsValid&&Et()},mr=({disabled:qt,name:er,field:nr,fields:yr})=>{(isBoolean$1(qt)&&at.mount||qt||lt.disabled.has(er))&&(qt?lt.disabled.add(er):lt.disabled.delete(er),Pt(er,getFieldValue(nr?nr._f:get$1(yr,er)._f),!1,!1,!0))},vr=(qt,er={})=>{let nr=get$1(nt,qt);const yr=isBoolean$1(er.disabled)||isBoolean$1(et.disabled);return set(nt,qt,{...nr||{},_f:{...nr&&nr._f?nr._f:{ref:{name:qt}},name:qt,mount:!0,...er}}),lt.mount.add(qt),nr?mr({field:nr,disabled:isBoolean$1(er.disabled)?er.disabled:et.disabled,name:qt}):Ct(qt,!0,er.value),{...yr?{disabled:er.disabled||et.disabled}:{},...et.progressive?{required:!!er.required,min:getRuleValue(er.min),max:getRuleValue(er.max),minLength:getRuleValue(er.minLength),maxLength:getRuleValue(er.maxLength),pattern:getRuleValue(er.pattern)}:{},name:qt,onChange:$t,onBlur:$t,ref:xr=>{if(xr){vr(qt,er),nr=get$1(nt,qt);const dr=isUndefined(xr.value)&&xr.querySelectorAll&&xr.querySelectorAll("input,select,textarea")[0]||xr,_r=isRadioOrCheckbox(dr),Fr=nr._f.refs||[];if(_r?Fr.find(jr=>jr===dr):dr===nr._f.ref)return;set(nt,qt,{_f:{...nr._f,..._r?{refs:[...Fr.filter(live),dr,...Array.isArray(get$1(st,qt))?[{}]:[]],ref:{type:dr.type,name:qt}}:{ref:dr}}}),Ct(qt,!1,void 0,dr)}else nr=get$1(nt,qt,{}),nr._f&&(nr._f.mount=!1),(et.shouldUnregister||er.shouldUnregister)&&!(isNameInFieldArray(lt.array,qt)&&at.action)&&lt.unMount.add(qt)}}},Er=()=>et.shouldFocusError&&iterateFieldsByAction(nt,Ut,lt.mount),br=qt=>{isBoolean$1(qt)&&(ht.state.next({disabled:qt}),iterateFieldsByAction(nt,(er,nr)=>{const yr=get$1(nt,nr);yr&&(er.disabled=yr._f.disabled||qt,Array.isArray(yr._f.refs)&&yr._f.refs.forEach(xr=>{xr.disabled=yr._f.disabled||qt}))},0,!1))},hr=(qt,er)=>async nr=>{let yr;nr&&(nr.preventDefault&&nr.preventDefault(),nr.persist&&nr.persist());let xr=cloneObject(ot);if(lt.disabled.size)for(const dr of lt.disabled)set(xr,dr,void 0);if(ht.state.next({isSubmitting:!0}),et.resolver){const{errors:dr,values:_r}=await jt();rt.errors=dr,xr=_r}else await Vt(nt);if(unset(rt.errors,"root"),isEmptyObject(rt.errors)){ht.state.next({errors:{}});try{await qt(xr,nr)}catch(dr){yr=dr}}else er&&await er({...rt.errors},nr),Er(),setTimeout(Er);if(ht.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(rt.errors)&&!yr,submitCount:rt.submitCount+1,errors:rt.errors}),yr)throw yr},Ar=(qt,er={})=>{get$1(nt,qt)&&(isUndefined(er.defaultValue)?Gt(qt,cloneObject(get$1(st,qt))):(Gt(qt,er.defaultValue),set(st,qt,cloneObject(er.defaultValue))),er.keepTouched||unset(rt.touchedFields,qt),er.keepDirty||(unset(rt.dirtyFields,qt),rt.isDirty=er.defaultValue?Ht(qt,cloneObject(get$1(st,qt))):Ht()),er.keepError||(unset(rt.errors,qt),dt.isValid&&Et()),ht.state.next({...rt}))},Cr=(qt,er={})=>{const nr=qt?cloneObject(qt):st,yr=cloneObject(nr),xr=isEmptyObject(qt),dr=xr?st:yr;if(er.keepDefaultValues||(st=nr),!er.keepValues){if(er.keepDirtyValues){const _r=new Set([...lt.mount,...Object.keys(getDirtyFields(st,ot))]);for(const Fr of Array.from(_r))get$1(rt.dirtyFields,Fr)?set(dr,Fr,get$1(ot,Fr)):Gt(Fr,get$1(dr,Fr))}else{if(isWeb&&isUndefined(qt))for(const _r of lt.mount){const Fr=get$1(nt,_r);if(Fr&&Fr._f){const jr=Array.isArray(Fr._f.refs)?Fr._f.refs[0]:Fr._f.ref;if(isHTMLElement(jr)){const Ir=jr.closest("form");if(Ir){Ir.reset();break}}}}nt={}}ot=et.shouldUnregister?er.keepDefaultValues?cloneObject(st):{}:cloneObject(dr),ht.array.next({values:{...dr}}),ht.values.next({values:{...dr}})}lt={mount:er.keepDirtyValues?lt.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},at.mount=!dt.isValid||!!er.keepIsValid||!!er.keepDirtyValues,at.watch=!!et.shouldUnregister,ht.state.next({submitCount:er.keepSubmitCount?rt.submitCount:0,isDirty:xr?!1:er.keepDirty?rt.isDirty:!!(er.keepDefaultValues&&!deepEqual(qt,st)),isSubmitted:er.keepIsSubmitted?rt.isSubmitted:!1,dirtyFields:xr?{}:er.keepDirtyValues?er.keepDefaultValues&&ot?getDirtyFields(st,ot):rt.dirtyFields:er.keepDefaultValues&&qt?getDirtyFields(st,qt):er.keepDirty?rt.dirtyFields:{},touchedFields:er.keepTouched?rt.touchedFields:{},errors:er.keepErrors?rt.errors:{},isSubmitSuccessful:er.keepIsSubmitSuccessful?rt.isSubmitSuccessful:!1,isSubmitting:!1})},Ur=(qt,er)=>Cr(isFunction(qt)?qt(ot):qt,er);return{control:{register:vr,unregister:ur,getFieldState:Zt,handleSubmit:hr,setError:rr,_executeSchema:jt,_getWatch:Nt,_getDirty:Ht,_updateValid:Et,_removeUnmounted:Ft,_updateFieldArray:St,_updateDisabledField:mr,_getFieldArray:Lt,_reset:Cr,_resetDefaultValues:()=>isFunction(et.defaultValues)&&et.defaultValues().then(qt=>{Ur(qt,et.resetOptions),ht.state.next({isLoading:!1})}),_updateFormState:qt=>{rt={...rt,...qt}},_disableForm:br,_subjects:ht,_proxyFormState:dt,_setErrors:Rt,get _fields(){return nt},get _formValues(){return ot},get _state(){return at},set _state(qt){at=qt},get _defaultValues(){return st},get _names(){return lt},set _names(qt){lt=qt},get _formState(){return rt},set _formState(qt){rt=qt},get _options(){return et},set _options(qt){et={...et,...qt}}},trigger:Bt,register:vr,handleSubmit:hr,watch:cr,setValue:Gt,getValues:Yt,reset:Ur,resetField:Ar,clearErrors:Xt,unregister:ur,setError:rr,setFocus:(qt,er={})=>{const nr=get$1(nt,qt),yr=nr&&nr._f;if(yr){const xr=yr.refs?yr.refs[0]:yr.ref;xr.focus&&(xr.focus(),er.shouldSelect&&isFunction(xr.select)&&xr.select())}},getFieldState:Zt}}function useForm(tt={}){const et=React$4.useRef(void 0),rt=React$4.useRef(void 0),[nt,st]=React$4.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:tt.errors||{},disabled:tt.disabled||!1,defaultValues:isFunction(tt.defaultValues)?void 0:tt.defaultValues});et.current||(et.current={...createFormControl(tt),formState:nt});const ot=et.current.control;return ot._options=tt,useSubscribe({subject:ot._subjects.state,next:at=>{shouldRenderFormState(at,ot._proxyFormState,ot._updateFormState,!0)&&st({...ot._formState})}}),React$4.useEffect(()=>ot._disableForm(tt.disabled),[ot,tt.disabled]),React$4.useEffect(()=>{if(ot._proxyFormState.isDirty){const at=ot._getDirty();at!==nt.isDirty&&ot._subjects.state.next({isDirty:at})}},[ot,nt.isDirty]),React$4.useEffect(()=>{tt.values&&!deepEqual(tt.values,rt.current)?(ot._reset(tt.values,ot._options.resetOptions),rt.current=tt.values,st(at=>({...at}))):ot._resetDefaultValues()},[tt.values,ot]),React$4.useEffect(()=>{tt.errors&&ot._setErrors(tt.errors)},[tt.errors,ot]),React$4.useEffect(()=>{ot._state.mount||(ot._updateValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),React$4.useEffect(()=>{tt.shouldUnregister&&ot._subjects.values.next({values:ot._getWatch()})},[tt.shouldUnregister,ot]),et.current.formState=getProxyFormState(nt,ot),et.current}const useActivitiesOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.activityType.classroomActivity",label:tt("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:tt("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:tt("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:tt("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:tt("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:tt("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:tt("bpr.activityType.courseElement")},{value:"bpr.other",label:tt("bpr.other")}]},ActivitiesDropdown=({control:tt,selectedActivities:et,selectActivities:rt})=>{const nt=useActivitiesOptions(),{t:st}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"activityType",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:st("bpr.form.publication.type"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:nt.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})},ageOptions=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],AgeSelect=({name:tt,control:et,placeholderOption:rt,validate:nt})=>jsxRuntimeExports.jsx(Controller,{name:tt,control:et,rules:{required:!0,validate:nt},render:({field:{onChange:st}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:st,options:ageOptions,"aria-required":!0,placeholderOption:rt})}),useLanguageOptions=()=>{const{t:tt}=useTranslation();return[{value:"de_DE",label:tt("de_DE")},{value:"en_EN",label:tt("en_EN")},{value:"ar_DZ",label:tt("ar_DZ")},{value:"es_ES",label:tt("es_ES")},{value:"fr_FR",label:tt("fr_FR")},{value:"it_IT",label:tt("it_IT")},{value:"ja_JP",label:tt("ja_JP")},{value:"zh_CN",label:tt("zh_CN")},{value:"pt_PT",label:tt("pt_PT")},{value:"ru_RU",label:tt("ru_RU")},{value:"bpr.other",label:tt("bpr.other")}]},defaultSelectLanguageOption="bpr.form.publication.language",LangSelect=({control:tt})=>{const et=useLanguageOptions();return jsxRuntimeExports.jsx("div",{className:"col",children:jsxRuntimeExports.jsx(Controller,{name:"language",control:tt,rules:{required:!0},render:({field:{onChange:rt}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:rt,options:et,"aria-required":!0,placeholderOption:defaultSelectLanguageOption})})})},creativeCommons="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAYCAYAAACsnTAAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAubSURBVHgB7Vh3UNVnFj2P/kAQURGNsa2GKKIOCjGzIEUhqElsY40m9lgiGksmWUfjTNZel8ggblSIxjUxujbEiiiwoiiixoqVJtKkCQg82O9c9r0AeaiTP3ZmZ3NnmAHed9/v+84999zz/TRvvvnmlo6dO04xMTExw/95VLyoyEm6lDRW4+XjpZszP8gE/4XQ6XQoeFYAXbVO/m7atCksLS1fK7eqqgqFhYXyHaYmprCzs4O5hflr5VZUVKCosAjVNdUw0ZjArqkdLCwsjO7voxHjtpsphpigpgbQaIwuys3JxS/J13H9+i/qQM/k/81bNEdXl27o5dZLftcYya0bZWVluJ58DSeOnUBxYTHMzMxlg9bWWri/4wHfAb6wtLJsNPda8lVEHY5C6fMymJubyyFtmlgjcHAg3Pr0hoWlhdHc8vJynI8/j7iYWJSXlssZK6sqpBg+/X3k2XVzeY7q6moTMw00RgEpLi7GrohduBCfoDZTClNTU3To0EEqdvvmbcSqB9k3s4enjxfGfDTGKPKyMXWoiL+Hq4Ndw7Rp0zBgwAA0a9YMz58/R0JCAtavX4/LiZcQtGAubO1s6+WWqD2EBociMz0T8+bNg4eHhzCkqKgIZ8+exYYNGxB7NhYzg2ahSZMm9XLJqg2r1uNZ3jMsWrQI7u7usLW1RUFBAY4fP46wsDBcTbqK6Z99qopkZgCFYVJj5CCpjx5j9TerEBt9Dp5/9sShQ4cEpHv37uHRo0dyoH379sG1uyuO/PMwVny9XOhpLMK/i0Budi4OHjyIFStWoHPnzti6dStatmyJhQsXIjExEVYWVli/cp0CsNyQR4YQEF2lDjExMbK2X79+yMrKgpubG5YsWSK5leWVCAvZgsrKSkMuW/Tb9cFwsHfAjRs3MH/+fHh6eqJHjx7w8fHBypUrER0djccPH2NrSJgwr26YoAFJnpeUIGRTCDLSMrBlyxYcOHAAH3zwAbRarWGNlZUVhg8fjmPHjmHVqlXIzMjExjUbUKiqUDcSExJx6UIiQkJC8O6778r/0tPTcebMGQGY0bZtW+zatQu6Kp2wTx8xp84oBl3G4sWL0aZNG2nlU6dOYe7cuYiKikJOTo4AvGPHDuRk5SL+XLwhN/5cHFAN7N69W1jJ9X379kWnTp0EWD7f1dUVP/74I5IvJyPlTkoDUOpQpUZpS/h34cjLzcOaNWswefLkemA0DGtra3z++eey8ZS7KTh+9IThM7bZ8aPHMHToUKkSqUnqEgACQebcvn1b1vJwZALXcw9lpWWiBS1atMCcOXMwduxYqfaHH34oB1u+fDlu3rwpub169cJH48bhRNQJ6oGwLfpktKxv166dMGXKlCmyV7bvixcvMGbMGFy+fFlaaurUqTgeeaw+KHWJ8uDefanW4MGDBZBXCSiDWsKNe/fzxsF9B5CV+UT+Tx3KSM/AyJEjDWtJ/dDQUJw+fRo7d+6UVtQHaZ39NBs52Tl4pgSdwOzdu1d6v0Sxd/PmzTKpRo8eLXri5eVlyCVYZHhxUTGys7NhrbWWAzOCg4ORl5cne2Txtm3bJsCQYQxvb29kPckSDTKAoicKUT594rSIDpPZIlTvPXv2yN/ff/+9bI4MOHr0KJYuXSobZTtws+xxUjzubJzh+9gSZMHrBIXS3t5etKFCbZoMZtu8//77AiL1IzAwUJhJdvCwmZmZkss9c0xT96h3LCaZwfj4448xadIkAZ1B9pH9+oI4OjrKEFEe5VdQZByrHwLwWAkse00/ZUi76dOnq3F83QDCunXrMGHCBCQnJ4vmfPXVVyKKzs7OUEYQ9xXbKitqRc/UzBSpqamGh3EU8mCMrl27omPHjobPSktLZaqQeZaqIHQKBXU0qmfPnti4caOA4+DgIBOFgsu2416ojQRWq7WSFtQLL5/JXD3rWVjut1WrVvJ3fn6+nJXAMk9A1j9Ub6ycuzgLchQyiiwrRUF68OCBbMbFxUUqRWqnpaX9ZyNaUXAnJycUFBUoL1Ap8/+Ntm+IdgQEBMgzWrduLfSnQJO2BFIfnAZkJ30P6W1hZSEA9OnTR1jH0c2Jx5wnT57gk08+EfHmWOY0c3RyrDVl6rlFJUUy7rt06SJF+eKLL3D37l0MGzYMmzZtkvONUzrEOHfuHJo5NENT+6a/MkUQpGlRoFTrqgUx/vCQ/CGFGRQ40pvVJAXZMmwNAsGgqeKhXpTXUp/09fb1xk8//YRbt27hZZGRkSHa4R/oLwwhyN5+PiL2rCT/R7FlG3A8L1u2TD4jkwk6/Yd/YICs43M9+npg7dq1yM3Nhb+/P4KCgoTVLAQnD/PZTpyA1Dg/fz/J/Y1PMVOHamLXRASHleIoI8VPnjwpFZoxY4agTLQpdJwirMDMmTOFjmw/boKGjgAxvHz7oVOXP8nmySoGgSXT9GDy0F9++SUKiwoRMOg9A1Ce/TyhtdFiyJAhAhpbk3uYNWuWVJmspZ4RKIcWDnBzdzPkDhk+FCXPSzB79mwpIqcV2cXicB8U3ZSUFAGa+3Nz712vSKYdOrRf5tHXXZC6oaw8NYGL2XO9e/fG+fPnBRj9SKMjvXPnjrTW06dPpQqk6cOHD7F69Wq49OiOPu/0MTzgbZe3kaTGX/DfggUssovA8pAUUOpTxpMMzJgzE46tHA15ZuZm6K02Gxsbh3/8sBu1t5EamSo8IKcXXW6VrgrTZk8XM6gPtpBzN2ccPRKFiPAIKQTZb2NjI0By8rCgNrY2mDl3lkGU+f0/7/k5WaMoXjN73mxpIRqm0G9D5XAUMgYZwBHZvHlzg5WnMLHC+gsdRY3rORG+/uvX6ObqUg95jueLCRcReShSOdQqsfNyQVNa4ePvi/4B/cW+GwtWOl5NtDNqb3yOnW2tzTc1N4Vvfz+hvtbauJfKz8tHgvI79DCcTgSF4k0GvjcoEJ7envWuJ9zPmKGjwzU+fj41swgKasV28aK/ID83H3FxcSKqrxN0mqx4y1YtseSbpY2u4/dnqSpXVlDtTeHUprXh3vGqoL7Rx1QpUCmUTm2cDG36ylw1bulfmMubtVNrJ/mOhkGmjB4yKtyMc/3h/YcyPrl44tRJWLtyjThRili3bt1e+sCkpCQxejzw+InjhVlPs54K6i+LSsW2tNQ0/J5gy6SnpeP3BMFNfZxq9DP9SNYotGuInij8+LEYoCbA2egY7I7YLa1BpR40aJBYc65hEAAKFo0dL1ca5Ys//WyGaECEuibEqPz/1VCtHs4ZZLj90HMELZyLHr16qNcDt7AtbBuys7JlHFNM9eOZs//atWti29u1b4dJn07GW85vCRhbN4cJaHWDk4KiTcrSL1A/KMwcge3btxdz2BizWAyOeq7nd9CocXoxj1OQbdFYMM/X11d+56WQRfXz8xNv0vBmXCfC2VjL9H9xYXJSsjhN156uIkQEghtKOJ+Aixcv4tKlS8IS567OGDZyGMZPmiDKH6WUfteOnfWu8Pqg4aKv4NQis2gM2XLcICl75cqVxjYot3Hesukv6GiZS/2ipeeo379/f6O5vOzxMspJR0Dorw4fPixg1nXaDSL5NyrHS9W6lWsxcuwoBAwMEK/BHwZf+vCtmZWy0vooLChE5MEjOKJ+OJUaC7Zi9+7dBVD6HmoW/dD27dvxquA9hXceBl0sc+Lj42Usvyyod3ztwQshR/GCBQvEAY8aNUry9RrSMIxKPzf7g3rrFn3ytALEC93VfYg2mKNPpz7ja8kc9ZoyUY3ZhH9dMLymfFmw1SIjI2s1SLUNPcqz18hjcLrxBRFtAa8brD4vcjzwxIkTG83j3YgFYAuSNWw7ehbm8sqhv1A2jHqa0liwyvQWWnUl11VXoUy9K6VXaKgdjQU1ZeDAgQZ/QzPIDdIz1H19YCzILgafxxdFvKGPGDFCWoKu+mX5fJ/C1wrUFl4POP55J2Lb0t3SBBoJJbQaTanikRZ/hITSntB/Awop/YGn+Be4AAAAAElFTkSuQmCC",PublishModalFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("ul",{className:"mb-12",children:[jsxRuntimeExports.jsxs("li",{children:[tt("bpr.form.publication.licence.text.1"),jsxRuntimeExports.jsx("img",{className:"ms-8 d-inline-block",src:creativeCommons,alt:"licence creative commons"})]}),jsxRuntimeExports.jsx("li",{children:tt("bpr.form.publication.licence.text.2")})]}),jsxRuntimeExports.jsx(Alert,{type:"info",className:"mb-12",children:tt("bpr.form.publication.licence.text.3")}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:tt("bpr.form.publication.licence.text.4")})]})},useSubjectsOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.subjectArea.artActivity",label:tt("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:tt("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:tt("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:tt("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:tt("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:tt("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:tt("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:tt("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:tt("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:tt("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:tt("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:tt("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:tt("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:tt("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:tt("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:tt("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:tt("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:tt("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:tt("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:tt("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:tt("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:tt("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:tt("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:tt("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:tt("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:tt("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:tt("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:tt("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:tt("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:tt("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:tt("bpr.subjectArea.technology")},{value:"bpr.subjectArea.Arabic",label:tt("bpr.subjectArea.Arabic")},{value:"bpr.subjectArea.Chinese",label:tt("bpr.subjectArea.Chinese")},{value:"bpr.subjectArea.NaturalSciences",label:tt("bpr.subjectArea.NaturalSciences")},{value:"bpr.subjectArea.SocioEmotionalEducation",label:tt("bpr.subjectArea.SocioEmotionalEducation")},{value:"bpr.other",label:tt("bpr.other")}]},SubjectsDropdown=({control:tt,selectedSubjectAreas:et,selectSubjects:rt})=>{const nt=useSubjectsOptions(),{t:st}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"subjectArea",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:st("bpr.form.publication.discipline"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:nt.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})};function ToastError({formData:tt,errorMessage:et}){const{t:rt}=useTranslation(),nt=st=>st==null?void 0:st.match(/^\s/);return et==="CONTENT_TOO_LARGE"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content_too_large")})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content")})}),jsxRuntimeExports.jsxs("ul",{children:[nt(tt==null?void 0:tt.title)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.title")})}),nt(tt==null?void 0:tt.description)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.description")})})]})]})}function ToastSuccess({result:tt}){const{t:et}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:et("bpr.form.publication.response.success.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.1")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.2")}),tt.details.front_url&&jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("a",{className:"button right-magnet",href:tt.details.front_url,target:"_blank",rel:"noreferrer",children:et("bpr.form.publication.response.success.button")})})]})}function usePublishModal({onSuccess:tt,resource:et}){const{user:rt,appCode:nt}=useEdificeClient(),st=useToast(),[ot,at]=reactExports.useState((et==null?void 0:et.thumbnail)||"");reactExports.useEffect(()=>{at(et==null?void 0:et.thumbnail)},[et]);const{control:lt,register:ut,watch:ct,setValue:dt,handleSubmit:ht,formState:{errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt}}=useForm({mode:"onChange"}),[Et,bt]=reactExports.useState([]),[St,wt]=reactExports.useState([]),Rt=(Ct,Pt,It)=>{let jt=[...Pt];const Dt=jt.findIndex(Vt=>Vt===Ct);Pt.includes(Ct)?jt=Pt.filter((Vt,Ft)=>Ft!==Dt):jt=[...Pt,Ct],It(jt)};return{control:lt,cover:ot,formState:{errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt},handleDeleteImage:()=>at(""),handlePublish:async Ct=>{const Pt=rt?rt==null?void 0:rt.userId:"";try{let It=new Blob;typeof ot=="string"?It=await odeServices.http().get(ot,{responseType:"blob"}):ot?It=await odeServices.http().get(URL.createObjectURL(ot),{responseType:"blob"}):et!=null&&et.thumbnail&&(It=await odeServices.http().get(et==null?void 0:et.thumbnail,{responseType:"blob"}));const jt=await odeServices.http().get(`/userbook/avatar/${Pt}?thumbnail=48x48`,{responseType:"blob"}),Dt=await odeServices.http().get(`/directory/user/${Pt}/attachment-school`,{responseType:"json"}),Vt=e$3[nt],Ft={activityType:Et,age:[Ct.ageMin,Ct.ageMax],application:Vt,cover:It,description:Ct.description,keyWords:Ct.keyWords,language:Ct.language,licence:"CC-BY",resourceId:et==null?void 0:et.assetId,resourceEntId:et==null?void 0:et.assetId,subjectArea:St,teacherAvatar:jt,title:Ct.title,userId:Pt,userStructureName:Dt.name||(rt==null?void 0:rt.structureNames[0])},Ht=await odeServices.resource(nt).publish(Ft);Ht.success?st.success(jsxRuntimeExports.jsx(ToastSuccess,{result:Ht}),{duration:1e4}):Ht.message==="CONTENT_TOO_LARGE"?st.error(jsxRuntimeExports.jsx(ToastError,{errorMessage:Ht.message})):st.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct})),tt==null||tt()}catch(It){console.error(It),st.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct}))}},handleSubmit:ht,handleUploadImage:Ct=>at(Ct),register:ut,selectActivities:Ct=>{Rt(Ct,Et,bt)},selectedActivities:Et,selectedSubjectAreas:St,selectSubjects:Ct=>{Rt(Ct,St,wt)},setValue:dt,watch:ct}}const SvgIconDelete=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.461 3.689a.96.96 0 0 1 .675-.28h3.819a.955.955 0 0 1 .954.955v.954H9.182v-.954c0-.254.1-.496.28-.675m7.357.675v.954h3.818a.955.955 0 0 1 0 1.91h-.954v12.408a2.864 2.864 0 0 1-2.864 2.864H7.273a2.864 2.864 0 0 1-2.864-2.864V7.227h-.954a.955.955 0 1 1 0-1.909h3.818v-.954A2.864 2.864 0 0 1 10.136 1.5h3.819a2.864 2.864 0 0 1 2.863 2.864m-10.5 2.863v12.41a.954.954 0 0 0 .955.954h9.545a.955.955 0 0 0 .955-.955V7.227zm3.818 2.864c.528 0 .955.427.955.955v5.727a.955.955 0 1 1-1.91 0v-5.727c0-.528.428-.955.955-.955m4.773 6.682v-5.727a.955.955 0 0 0-1.909 0v5.727a.955.955 0 1 0 1.91 0",clipRule:"evenodd"})]}),SvgIconEdit=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.879 3.879A3 3 0 0 1 4 3h7a1 1 0 1 1 0 2H4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7a1 1 0 1 1 2 0v7a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V6a3 3 0 0 1 .879-2.121",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 2.879c-.297 0-.583.118-.793.328l-9.304 9.304-.529 2.115 2.115-.529 9.304-9.304A1.121 1.121 0 0 0 20 2.879m-2.207-1.086a3.121 3.121 0 0 1 4.414 4.414l-9.5 9.5a1 1 0 0 1-.464.263l-4 1a1 1 0 0 1-1.213-1.212l1-4a1 1 0 0 1 .263-.465z",clipRule:"evenodd"})]}),ImagePicker=({addButtonLabel:tt="Add image",deleteButtonLabel:et="Delete image",src:rt,className:nt,mediaLibraryRef:st,libraryMedia:ot,app:at,onUploadImage:lt,onDeleteImage:ut})=>{const[ct,dt]=reactExports.useState(rt||"");reactExports.useEffect(()=>{ot&&(dt(ot),lt(ot))},[ot]);const ht=()=>{var yt;(yt=st.current)==null||yt.show("image")},mt=()=>{dt(""),ut()},xt=clsx("image-input",nt);return jsxRuntimeExports.jsxs("div",{id:"image-input",className:xt,children:[jsxRuntimeExports.jsxs("div",{className:"image-input-actions gap-8",children:[jsxRuntimeExports.jsx(IconButton,{"aria-label":tt,color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconEdit,{}),onClick:ht,type:"button",variant:"ghost"}),jsxRuntimeExports.jsx(IconButton,{"aria-label":et,color:"danger",disabled:!ct,icon:jsxRuntimeExports.jsx(SvgIconDelete,{}),onClick:mt,type:"button",variant:"ghost"})]}),ct?jsxRuntimeExports.jsx(Avatar,{alt:"",src:ct,size:"xl"}):jsxRuntimeExports.jsx(AppIcon,{app:at,iconFit:"ratio",size:"160",variant:"rounded"})]})},useResource=(tt,et)=>{const[rt,nt]=reactExports.useState(null);return reactExports.useEffect(()=>{if(et===""){console.warn("resourceId must be an assetId and not an empty string");return}(async()=>{try{const st=await odeServices.resource(tt).searchResource({application:tt,id:et});nt(st)}catch(st){console.error(st)}})()},[]),rt},SvgIconApplications=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 3c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6zm4 0c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zm-8 12c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zM1 15c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6z",clipRule:"evenodd"})]}),SvgIconCode=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M17.327 5.76a1 1 0 0 1 1.413.067l5 5.5a1 1 0 0 1 0 1.346l-5 5.5a1 1 0 1 1-1.48-1.346L21.648 12 17.26 7.173a1 1 0 0 1 .067-1.413M6.673 5.76a1 1 0 0 1 .067 1.413L2.35 12l4.389 4.827a1 1 0 0 1-1.48 1.346l-5-5.5a1 1 0 0 1 0-1.346l5-5.5a1 1 0 0 1 1.413-.067M8.979 21.609a1 1 0 0 1-.658-1.252l5.375-17.29a1 1 0 1 1 1.91.594L10.23 20.95a1 1 0 0 1-1.251.658",clipRule:"evenodd"})]}),SvgIconGlobe=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.726 3.29A9.01 9.01 0 0 0 3.055 11H7.05a16.3 16.3 0 0 1 2.676-7.71m4.548 0A16.3 16.3 0 0 1 16.95 11h3.995a9.01 9.01 0 0 0-6.67-7.71m.668 7.71A14.3 14.3 0 0 0 12 3.55 14.3 14.3 0 0 0 9.058 11zm-5.884 2h5.884A14.3 14.3 0 0 1 12 20.45 14.3 14.3 0 0 1 9.058 13M7.05 13H3.055a9.01 9.01 0 0 0 6.67 7.71A16.3 16.3 0 0 1 7.05 13m7.224 7.71A16.3 16.3 0 0 0 16.95 13h3.995a9.01 9.01 0 0 1-6.67 7.71M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11",clipRule:"evenodd"})]}),SvgIconMic=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 .5a4.07 4.07 0 0 0-2.812 1.115A3.8 3.8 0 0 0 8 4.364V12a3.8 3.8 0 0 0 1.188 2.748A4.07 4.07 0 0 0 12 15.864a4.07 4.07 0 0 0 2.812-1.116A3.8 3.8 0 0 0 16 12V4.364a3.8 3.8 0 0 0-1.188-2.749A4.07 4.07 0 0 0 12 .5m-1.43 2.562A2.07 2.07 0 0 1 12 2.5c.545 0 1.059.207 1.43.562.371.354.57.823.57 1.302V12a1.8 1.8 0 0 1-.57 1.302 2.07 2.07 0 0 1-1.43.562 2.07 2.07 0 0 1-1.43-.562A1.8 1.8 0 0 1 10 12V4.364a1.8 1.8 0 0 1 .57-1.302M6 10.091a1 1 0 0 0-2 0V12c0 2.053.855 4.011 2.36 5.448A8.13 8.13 0 0 0 11 19.622V21.5H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-1.878a8.13 8.13 0 0 0 4.64-2.174C19.145 16.011 20 14.053 20 12v-1.91a1 1 0 0 0-2 0V12c0 1.491-.62 2.932-1.74 4.001s-2.646 1.678-4.248 1.68h-.024c-1.602-.002-3.128-.611-4.247-1.68C6.62 14.931 6 13.491 6 12z",clipRule:"evenodd"})]}),SvgIconRecordVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-1.936l4.409 1.365A2 2 0 0 0 24 15.519V8.48a2 2 0 0 0-2.591-1.91l-4.41 1.364V6a2 2 0 0 0-2-2zm0 2h13v12H2zm15 7.97V10.03l5-1.548v7.037z",clipRule:"evenodd"})]}),SvgIconSmartphone=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM4 4a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 18a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1",clipRule:"evenodd"})]}),MediaLibraryContext=reactExports.createContext(null);function useMediaLibraryContext(){const tt=reactExports.useContext(MediaLibraryContext);if(!tt)throw new Error("Innertabs compound components cannot be rendered outside the MediaLibrary component");return tt}const SvgIconPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3zm10-2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3z",clipRule:"evenodd"})]}),SvgIconRecord=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("circle",{cx:12,cy:12,r:11,fill:"currentColor"})]}),AudioRecorderTimer=({recordState:tt,playState:et,recordTime:rt,audioTime:nt,maxDuration:st})=>jsxRuntimeExports.jsxs("div",{className:"audio-recorder-time my-16 mx-auto",children:[et==="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center",children:[tt==="PAUSED"?jsxRuntimeExports.jsx(SvgIconPause,{width:12,height:12,className:"me-8 text-danger"}):jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,className:"me-8 text-danger"}),n$2(tt!=="IDLE"?rt:0)+" / "+n$2(st)]}),et!=="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mx-auto",children:[jsxRuntimeExports.jsx(SvgIconMic,{width:12,height:12,className:"me-8"}),n$2(nt*1e3)," /",n$2(rt)]})]}),SvgIconPlayFilled=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M5 3.804c0-1.57 1.728-2.528 3.06-1.696l13.113 8.196a2 2 0 0 1 0 3.392L8.06 21.892C6.728 22.724 5 21.767 5 20.196z"})]}),SvgIconRecordPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M23 12c0 6.075-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1s11 4.925 11 11M10 6H8a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1m4 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconRefresh=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-refresh_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.304 21c3.015 0 5.65-1.924 6.838-4.752a.986.986 0 0 1 1.297-.53c.503.216.738.803.524 1.311C19.498 20.522 16.19 23 12.304 23c-4.644 0-8.444-3.522-9.299-8.113L1.86 17.142a.99.99 0 0 1-1.33.449 1 1 0 0 1-.417-1.348L2.51 11.52c.135-.265.376-.457.66-.527a.96.96 0 0 1 .812.169L8.1 14.297c.433.33.515.958.185 1.404a.98.98 0 0 1-1.382.212L4.93 14.41c.65 3.785 3.744 6.59 7.374 6.59m4.794-12.913a.98.98 0 0 0-1.381.211 1.01 1.01 0 0 0 .184 1.405l4.117 3.135a.96.96 0 0 0 .812.169c.284-.07.525-.262.66-.527l2.398-4.723c.252-.496.065-1.1-.418-1.348a.99.99 0 0 0-1.329.449l-1.145 2.255C20.14 4.522 16.34 1 11.696 1 7.81 1 4.505 3.478 3.037 6.97a1.004 1.004 0 0 0 .525 1.312.986.986 0 0 0 1.297-.53C6.046 4.924 8.681 3 11.697 3c3.63 0 6.724 2.805 7.374 6.59z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-refresh_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconRestart=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M17.919 3.15c1.33-.856 3.081.1 3.081 1.682v14.336c0 1.583-1.75 2.538-3.081 1.683L7 13.83V19a2 2 0 1 1-4 0V5a2 2 0 1 1 4 0v5.168z"})]}),SvgIconSave=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h1v-7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7h1a1 1 0 0 0 1-1V8.414L15.586 4H8v3h7a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1V4zm2-2H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V8a1 1 0 0 0-.293-.707l-5-5A1 1 0 0 0 16 2zm1 12v6h8v-6z",clipRule:"evenodd"})]});function useAudioRecorder(tt,et,rt=!1,nt="protected",st="media-library"){var ot;function at(Xt,rr){return{...Xt,...rr.updatedState}}const[{recordState:lt,playState:ut,micStream:ct,micStreamAudioSourceNode:dt,audioWorkletNode:ht,audioContext:mt,encoderWorker:xt,maxDuration:yt,recordTime:vt,isEncoding:Et},bt]=reactExports.useReducer(at,{recordState:"IDLE",isEncoding:!1,playState:"IDLE",recordTime:0,maxDuration:180}),St=reactExports.useRef(null),wt=reactExports.useRef(null),Rt=reactExports.useRef(),Ct=reactExports.useRef(),{t:Pt}=useTranslation(),{create:It}=useWorkspaceFile(),jt=128,Dt=48e3;reactExports.useEffect(()=>{const Xt=new Worker("/infra/public/js/audioEncoder.js");return bt({type:"update",updatedState:{encoderWorker:Xt}}),Xt.postMessage(["init",(mt==null?void 0:mt.sampleRate)||Dt]),()=>{Ft(),Xt.terminate()}},[]);const Vt=Xt=>{var rr,cr;const ur=Xt.data.inputs[0][0];let mr=Xt.data.inputs[0][1];(!mr||mr.filter(vr=>vr!==void 0).length===0)&&(mr=ur),(rr=Rt.current)==null||rr.push(ur),(cr=Ct.current)==null||cr.push(mr)},Ft=reactExports.useCallback(()=>{ct==null||ct.getTracks().forEach(Xt=>Xt.stop()),dt==null||dt.disconnect(),ht==null||ht.port.removeEventListener("message",Vt),ht==null||ht.port.close(),ht==null||ht.disconnect(),mt==null||mt.close()},[mt,ht,ct,dt]),Ht=async()=>{const Xt=await navigator.mediaDevices.getUserMedia({audio:!0}),rr=new AudioContext({sampleRate:Dt}),cr=rr.createMediaStreamSource(Xt);try{await rr.audioWorklet.addModule("/infra/public/js/audio-recorder-processor.js")}catch(mr){console.error(mr)}const ur=new AudioWorkletNode(rr,"audio-recorder-processor");ur.port.addEventListener("message",Vt),bt({type:"update",updatedState:{micStream:Xt,micStreamAudioSourceNode:cr,audioContext:rr,recordTime:0,audioWorkletNode:ur,recordState:"RECORDING",playState:"IDLE"}}),Ct.current=[],Rt.current=[],ur.port.start(),cr.connect(ur),ur.connect(rr.destination)},Nt=reactExports.useCallback(async()=>{wt.current&&(wt.current.currentTime=0,wt.current.pause()),lt==="PAUSED"?(bt({type:"update",updatedState:{recordState:"RECORDING",playState:"IDLE"}}),mt==null||mt.resume(),et==null||et(void 0)):Ht()},[lt,mt,wt]),Lt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{recordState:"PAUSED",playState:"IDLE",isEncoding:!0}}),mt==null||mt.suspend(),xt&&Rt.current&&Ct.current&&(xt.postMessage(["wav",Ct.current,Rt.current,Ct.current.length*jt]),xt.onmessage=Xt=>{const rr=window.URL.createObjectURL(Xt.data);bt({type:"update",updatedState:{isEncoding:!1}}),wt.current&&(wt.current.src=rr),et&&et(rr)})},[mt,xt,et]),Mt=reactExports.useCallback(()=>{var Xt;bt({type:"update",updatedState:{playState:"PLAYING"}}),((Xt=wt==null?void 0:wt.current)!=null&&Xt.currentTime||wt.current)&&wt.current.play()},[wt]),zt=reactExports.useCallback(()=>{var Xt;(Xt=wt==null?void 0:wt.current)==null||Xt.pause(),bt({type:"update",updatedState:{playState:"PAUSED"}})},[wt]),Gt=reactExports.useCallback(()=>{Ft(),bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),Ct.current=[],Rt.current=[],et&&et(void 0)},[Ft,et]),$t=reactExports.useCallback(async()=>{var Xt;const rr=(Xt=St.current)==null?void 0:Xt.value;if(!rr){console.error("Audio name is required");return}return wt.current&&(wt.current.pause(),wt.current.currentTime=0),bt({type:"update",updatedState:{recordState:"SAVING",playState:"IDLE"}}),new Promise((cr,ur)=>{try{xt&&Rt.current&&Ct.current&&(xt.postMessage(["mp3",Ct.current,Rt.current,Ct.current.length*jt]),xt.onmessage=async mr=>{if(mr.data instanceof Blob){const vr=new File([mr.data],rr,{type:"audio/mp3"}),Er=await It(vr,{application:st,visibility:nt});Er&&tt&&tt(Er),bt({type:"update",updatedState:{recordState:"SAVED"}}),cr(Er)}})}catch(mr){bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),console.error("Error while saving",mr),ur()}})},[lt,tt,Ft]),Ut=reactExports.useCallback(()=>{wt!=null&&wt.current&&(wt.current.pause(),wt.current.currentTime=0),bt({type:"update",updatedState:{playState:"IDLE"}})},[wt]),Bt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{playState:"PAUSED"}}),wt.current&&(wt.current.currentTime=0)},[wt]);reactExports.useEffect(()=>{if(lt==="RECORDING"&&mt){const Xt=window.setInterval(()=>{bt({type:"update",updatedState:{recordTime:mt.currentTime}}),mt.currentTime>=yt&&(Lt(),window.clearInterval(Xt))},100);return()=>window.clearInterval(Xt)}},[mt,Lt,yt,lt]);const Yt=Pt(lt==="IDLE"?"bbm.audio.record.start":"bbm.audio.record.resume"),Zt=[{type:"icon",name:"record",visibility:lt==="RECORDING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{}),color:"danger",disabled:lt!=="IDLE"&&lt!=="PAUSED"||vt>=yt,onClick:Nt,"aria-label":Yt},tooltip:Yt},{type:"icon",name:"recordPause",visibility:lt==="RECORDING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordPause,{}),color:"danger",disabled:lt!=="RECORDING",onClick:Lt,"aria-label":Pt("bbm.audio.record.pause")},tooltip:Pt("bbm.audio.record.pause")},{type:"divider"},{type:"icon",name:"encoding",visibility:Et?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconLoader,{style:{animation:"loading 1s infinite"}}),disabled:!0}},{type:"icon",name:"play",visibility:Et||ut==="PLAYING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:lt!=="RECORDED"&&lt!=="PAUSED"&&lt!=="SAVED",onClick:Mt,"aria-label":Pt("bbm.audio.play.start")},tooltip:Pt("bbm.audio.play.start")},{type:"icon",name:"playPause",visibility:!Et&&ut==="PLAYING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),onClick:zt,"aria-label":Pt("bbm.audio.play.pause")},tooltip:Pt("bbm.audio.play.pause")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRestart,{}),disabled:ut!=="PLAYING"&&ut!=="PAUSED",onClick:Ut,"aria-label":Pt("bbm.audio.play.stop")},tooltip:Pt("bbm.audio.play.stop")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:lt!=="RECORDED"&&lt!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED",onClick:Gt,"aria-label":Pt("bbm.audio.record.reset")},tooltip:Pt("bbm.audio.record.reset")},{type:"icon",name:"save",visibility:rt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:lt!=="RECORDED"&&lt!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED"||lt==="SAVED"||!((ot=St.current)!=null&&ot.value),onClick:$t,"aria-label":Pt("bbm.audio.record.save")},tooltip:Pt("bbm.audio.record.save")}];return{recordState:lt,playState:ut,audioContext:mt,recordTime:vt*1e3,maxDuration:yt*1e3,audioRef:wt,audioNameRef:St,toolbarItems:Zt,handlePlayEnded:Bt,handleSave:$t}}const AudioRecorder=reactExports.forwardRef(({onSaveSuccess:tt,onRecordUpdated:et,hideSaveAction:rt=!1,visibility:nt="protected"},st)=>{const{recordState:ot,playState:at,recordTime:lt,audioRef:ut,audioNameRef:ct,toolbarItems:dt,maxDuration:ht,handlePlayEnded:mt,handleSave:xt}=useAudioRecorder(tt,et,rt,nt,"media-library"),{t:yt}=useTranslation();reactExports.useImperativeHandle(st,()=>({save:xt}));const[vt,Et]=reactExports.useState(0),bt=clsx({"text-danger":ot==="RECORDING","text-success":at==="PLAYING"}),St=wt=>{Et(wt.target.currentTime)};return jsxRuntimeExports.jsxs("div",{className:"audio-recorder m-auto d-flex flex-column",children:[jsxRuntimeExports.jsx(FormControl,{id:"recordName",className:"mb-32",isRequired:!0,isReadOnly:ot==="SAVED"||ot==="SAVING",children:jsxRuntimeExports.jsx(Input,{type:"text",size:"sm",placeholder:yt("bbm.audio.recorder.name"),ref:ct,defaultValue:yt("bbm.audio.recorder.defaultName")+new Date().toLocaleDateString()})}),jsxRuntimeExports.jsx("div",{className:"audio-recorder-icon mx-auto",children:jsxRuntimeExports.jsx(SvgIconMic,{width:64,height:64,className:bt})}),jsxRuntimeExports.jsx(AudioRecorderTimer,{recordState:ot,playState:at,recordTime:lt,audioTime:vt,maxDuration:ht}),jsxRuntimeExports.jsx("audio",{ref:ut,onEnded:mt,onTimeUpdate:St,children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),jsxRuntimeExports.jsx(Toolbar,{items:dt})]})}),Audio=()=>{const{setResult:tt,setPreSuccess:et,visibility:rt}=useMediaLibraryContext(),nt=reactExports.useRef(null);return jsxRuntimeExports.jsx(AudioRecorder,{ref:nt,onRecordUpdated:st=>{st?(tt(st),et(()=>nt.current.save)):tt()},onSaveSuccess:st=>{st&&tt(st)},hideSaveAction:!0,visibility:rt})},ExternalLinker=({link:tt,onChange:et,multiNodeSelected:rt=!1})=>{const{t:nt}=useTranslation(),[st,ot]=reactExports.useState((tt==null?void 0:tt.text)||""),[at,lt]=reactExports.useState((tt==null?void 0:tt.url)||""),[ut,ct]=useToggle(tt?tt.target==="_blank":!0);return reactExports.useEffect(()=>{rt&&tt!=null&&tt.text&&ot(tt.text.slice(0,20)+"...")},[rt,tt]),reactExports.useEffect(()=>{if(!at.length){et==null||et();return}const dt={url:at,text:rt?tt==null?void 0:tt.text:st||at,target:ut?"_blank":void 0};!s$3.isLocalURL(at)&&!s$3.startWithHttp(at)&&(dt.url="http://"+at),et==null||et(dt)},[st,at,ut]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-24",children:[jsxRuntimeExports.jsxs(FormControl,{id:"linkText",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:nt("bbm.linker.ext.text")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:nt("bbm.linker.ext.text.placeholder"),size:"md",disabled:rt,value:st,onChange:dt=>ot(dt.target.value)})]}),jsxRuntimeExports.jsxs(FormControl,{id:"linkUrl",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:nt("bbm.linker.ext.url")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:nt("bbm.linker.ext.url.placeholder"),size:"md",value:at,onChange:dt=>lt(dt.target.value)})]}),jsxRuntimeExports.jsx(Checkbox,{label:nt("bbm.linker.open.tab"),onChange:()=>ct(),checked:ut})]})})},ExternalLink=({link:tt,multiNodeSelected:et=!1})=>{const{setResult:rt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(ExternalLinker,{link:tt,onChange:nt=>{rt(nt)},multiNodeSelected:et})},Embed=({onSuccess:tt})=>{const{t:et}=useTranslation(),[rt,nt]=reactExports.useState();function st(ot){const at=ot.target.value;nt(at),at!=null&&at.length?tt(at):tt()}return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill",children:[jsxRuntimeExports.jsx("div",{className:"mb-32",children:et("bbm.embed.description")}),jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconCode,{className:"me-8"}),et("bbm.embed.title")]}),jsxRuntimeExports.jsx(FormControl,{id:"iframeContent",children:jsxRuntimeExports.jsx(TextArea,{size:"md",height:"sm",placeholder:et("bbm.embed.placeholder"),onChange:st})}),!!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12",dangerouslySetInnerHTML:{__html:rt}}),!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12 d-flex align-items-center justify-content-center bg-gray-300 text-black-50 rounded-3",children:jsxRuntimeExports.jsx("strong",{children:et("bbm.embed.preview")})})]})},Iframe=()=>{const{setResult:tt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(Embed,{onSuccess:et=>{et=et==null?void 0:et.replace(/<p /g,"<div ").replace(/\/p>/g,"/div>"),tt(et)}})},SvgIconUsers=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-users_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M19.055 12.803a1 1 0 0 1 1.272-.618c1.128.39 2.061 1.247 2.7 2.351.64 1.106.972 2.435.973 3.782V21a1 1 0 1 1-2 0v-2.681c0-1.03-.258-2.009-.704-2.782-.448-.773-1.034-1.258-1.623-1.462a1 1 0 0 1-.618-1.272M15.187 1.384a1 1 0 0 1 1.036-.962 5.129 5.129 0 0 1 2.11 9.71 1 1 0 1 1-.896-1.788 3.129 3.129 0 0 0-1.288-5.924 1 1 0 0 1-.962-1.036M1.505 15.694C2.481 14.622 3.825 14 5.25 14h8.5c1.424 0 2.769.622 3.744 1.694.974 1.068 1.506 2.498 1.506 3.973V22a1 1 0 1 1-2 0v-2.333c0-1.001-.363-1.945-.984-2.627-.618-.679-1.436-1.04-2.266-1.04h-8.5c-.83 0-1.648.361-2.266 1.04-.621.682-.984 1.626-.984 2.627V22a1 1 0 1 1-2 0v-2.333c0-1.475.533-2.905 1.505-3.974M9.5 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M4 6.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-users_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),LinkerCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:nt=!1,onClick:st,className:ot})=>{const{fromNow:at}=useDate(),{fromDate:lt}=reactExports.useMemo(()=>({fromDate:at(tt.modifiedAt)}),[at,tt]);return jsxRuntimeExports.jsx(Card,{className:clsx("card-linker shadow-none",ot),isClickable:et,isSelectable:rt,isSelected:nt,onClick:st,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{className:"card-image ps-8 pe-4",children:tt.thumbnail&&tt.thumbnail.length>0?jsxRuntimeExports.jsx(Image$1,{alt:"",height:48,width:48,src:tt.thumbnail,objectFit:"cover",className:"rounded h-full",style:{aspectRatio:1/1}}):jsxRuntimeExports.jsx(AppIcon,{app:tt.application,iconFit:"ratio",size:"48",variant:"rounded"})}),jsxRuntimeExports.jsxs("div",{className:"w-75",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.creatorName})]}),jsxRuntimeExports.jsx("div",{className:"d-none d-md-block text-black-50 ps-4 pe-8",children:jsxRuntimeExports.jsx(Card.Text,{children:lt})}),tt.shared&&jsxRuntimeExports.jsx("div",{className:"ps-4 pe-8",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:"20",height:"20"})})]})})},illuOneBlog="/assets/js/ode-explorer/illu-empty-search-blog.svg",illuOneCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall.svg",illuOneCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149764)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_149764)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149764'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149764'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149764'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149764'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148725)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_148725)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148725'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148725'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148725'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148725'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire.svg",illuOneForum="/assets/js/ode-explorer/illu-empty-search-forum.svg",illuOneHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks.svg",illuOneMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149757)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23F1CA00'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23F1CA00'/%3e%3cg%20filter='url(%23filter0_d_3597_149757)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149757'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149757'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149757'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149757'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneWiki="/assets/js/ode-explorer/illu-empty-search-wiki.svg",illuOneEmpty="/assets/js/ode-explorer/illu-empty-search.svg",illuNeoBlog="/assets/js/ode-explorer/illu-empty-search-blog2.svg",illuNeoCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall2.svg",illuNeoCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141038)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_141038)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141038'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141038'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141038'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141038'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148718)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_148718)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148718'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148718'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148718'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148718'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire2.svg",illuNeoForum="/assets/js/ode-explorer/illu-empty-search-forum2.svg",illuNeoHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks2.svg",illuNeoMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141030)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23ECBE30'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23ECBE30'/%3e%3cg%20filter='url(%23filter0_d_3597_141030)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141030'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141030'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141030'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141030'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoWiki="/assets/js/ode-explorer/illu-empty-search-wiki2.svg",illuNeoEmpty="/assets/js/ode-explorer/illu-empty-search2.svg",emptyScreenMapping={one:{blog:illuOneBlog,wiki:illuOneWiki,empty:illuOneEmpty,"collaborative-wall":illuOneCollaborativeWall,community:illuOneCommunity,exercizer:illuOneExercizer,formulaire:illuOneFormulaire,forum:illuOneForum,homeworks:illuOneHomeworks,magneto:illuOneMagneto},neo:{blog:illuNeoBlog,wiki:illuNeoWiki,empty:illuNeoEmpty,"collaborative-wall":illuNeoCollaborativeWall,community:illuNeoCommunity,exercizer:illuNeoExercizer,formulaire:illuNeoFormulaire,forum:illuNeoForum,homeworks:illuNeoHomeworks,magneto:illuNeoMagneto}},InternalLinker=({appCode:tt,defaultAppCode:et,defaultResourceId:rt,onChange:nt,onSelect:st,multiple:ot=!0,resourceList:at,applicationList:lt,showApplicationSelector:ut=!0})=>{const{t:ct}=useTranslation(),{theme:dt}=useEdificeTheme(),{resourceApplications:ht,loadResources:mt}=useResourceSearch(tt),[xt,yt]=reactExports.useState(),[vt,Et]=reactExports.useState(),[bt,St]=reactExports.useState(),wt=useDebounce(bt||"",500),[Rt,Ct]=reactExports.useState([]),Pt=reactExports.useCallback((Gt,$t)=>{var Ut,Bt,Yt;if(!$t)return!0;const Zt=($t==null?void 0:$t.toLowerCase())||"";return((Ut=Gt.name)==null?void 0:Ut.toLowerCase().includes(Zt))||((Bt=Gt.creatorName)==null?void 0:Bt.toLowerCase().includes(Zt))||((Yt=Gt.description)==null?void 0:Yt.toLowerCase().includes(Zt))},[]),It=reactExports.useCallback(Gt=>Gt.sort(($t,Ut)=>$t.modifiedAt<Ut.modifiedAt?1:-1),[]),jt=reactExports.useCallback(Gt=>{async function $t(){if(at){const Ut=at.filter(Bt=>Pt(Bt,Gt));Ct(It(Ut));return}else if(vt)try{const Ut=(await mt({application:vt.application,search:Gt,types:[vt.application],filters:{},pagination:{startIdx:0,pageSize:300}})).filter(Bt=>Pt(Bt,Gt));Ct(It(Ut));return}catch{}Ct([])}$t()},[mt,vt,Pt,It,at]),[Dt,Vt]=reactExports.useState([]),Ft=Gt=>{nt==null||nt(Gt),Et(Gt)},Ht=Gt=>{const $t=Gt.target.value;St($t.toString())},Nt=reactExports.useCallback(Gt=>{jt(bt),Gt.stopPropagation(),Gt.preventDefault()},[jt,bt]),Lt=reactExports.useCallback(Gt=>Dt.findIndex($t=>$t.assetId===Gt),[Dt]),Mt=reactExports.useCallback(Gt=>{Vt(ot?$t=>[...$t,Gt]:[Gt])},[Vt,ot]),zt=reactExports.useCallback(Gt=>{const $t=Lt(Gt.assetId);$t<0?Mt(Gt):Vt(Dt.filter((Ut,Bt)=>Bt!==$t))},[Lt,Mt,Dt]);return reactExports.useEffect(()=>{(async()=>{if(lt){yt(lt.sort((Ut,Bt)=>Ut.displayName.localeCompare(Bt.displayName)));return}const Gt=ht.map(Ut=>odeServices.session().getWebApp(Ut)),$t=await Promise.all(Gt);yt(ht.map((Ut,Bt)=>{var Yt;return{application:Ut,displayName:ct(((Yt=$t[Bt])==null?void 0:Yt.displayName)??Ut),icon:jsxRuntimeExports.jsx(AppIcon,{app:$t[Bt],size:"24"})}}).sort((Ut,Bt)=>Ut.displayName.localeCompare(Bt.displayName)))})()},[ht,ct,lt]),reactExports.useEffect(()=>{jt(wt)},[jt,wt]),reactExports.useEffect(()=>{st==null||st(Dt)},[Dt]),reactExports.useEffect(()=>{var Gt;const $t=et??((lt==null?void 0:lt.length)===1&&((Gt=lt==null?void 0:lt[0])==null?void 0:Gt.application));if($t){const Ut=xt==null?void 0:xt.find(Bt=>$t===Bt.application);Et(Ut),jt("")}},[xt,et]),reactExports.useEffect(()=>{if(rt&&Lt(rt)<0){const Gt=Rt==null?void 0:Rt.find($t=>rt===$t.assetId);Gt&&Mt(Gt)}},[Rt]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"search d-flex bg-light rounded-top border border-bottom-0",children:[ut&&jsxRuntimeExports.jsx("div",{className:"flex-shrink-1 px-8 py-12 border-end",children:jsxRuntimeExports.jsxs(Dropdown,{overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{icon:jsxRuntimeExports.jsx("div",{className:"pe-8",children:(vt==null?void 0:vt.icon)||jsxRuntimeExports.jsx(SvgIconApplications,{})}),label:ct((vt==null?void 0:vt.displayName)||"bbm.linker.int.choose"),variant:"ghost",size:"md"}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:xt==null?void 0:xt.map(Gt=>jsxRuntimeExports.jsx(Dropdown.Item,{icon:Gt.icon,onClick:()=>Ft(Gt),children:Gt.displayName},Gt.application))})]})}),jsxRuntimeExports.jsx("div",{className:"flex-grow-1 align-self-center",children:jsxRuntimeExports.jsx("form",{className:"gap-16 d-flex w-100 align-items-center px-16 py-8",onSubmit:Nt,children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,placeholder:ct("search"),size:"lg",className:"w-100",disabled:!vt,onChange:Ht})})})]}),jsxRuntimeExports.jsxs("div",{className:"internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto",children:[vt&&Rt&&Rt.length>0&&jsxRuntimeExports.jsx("div",{children:Rt.map(Gt=>{const $t=Dt.findIndex(Ut=>Ut.assetId===Gt.assetId)>=0;return jsxRuntimeExports.jsx(LinkerCard,{doc:Gt,isSelected:$t,onClick:()=>zt(Gt)},Gt.path)})}),vt&&Rt&&Rt.length<=0&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-16",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(dt==null?void 0:dt.bootstrapVersion)??"one"][vt==null?void 0:vt.application],text:ct("bbm.linker.int.notfound"),className:"mt-16"})}),!vt&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-32",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(dt==null?void 0:dt.bootstrapVersion)??"one"].empty,text:ct("bbm.linker.int.empty"),className:"mt-32"})})]})]})},InternalLink=({target:tt,resourceId:et,appPrefix:rt})=>{const{t:nt}=useTranslation(),{setResult:st,setResultCounter:ot,appCode:at,multiple:lt}=useMediaLibraryContext(),[ut,ct]=useToggle(tt==="_blank"),[dt,ht]=reactExports.useState([]),mt=xt=>{ht(xt)};return reactExports.useEffect(()=>{st({target:ut?"_blank":void 0,resources:dt}),dt&&dt.length?ot(dt.length):ot(void 0)},[ut,dt]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-16 overflow-hidden",children:[jsxRuntimeExports.jsx(InternalLinker,{appCode:at,defaultAppCode:rt,defaultResourceId:et,onSelect:mt,multiple:lt}),jsxRuntimeExports.jsx(Checkbox,{className:"align-items-center",checked:ut,label:nt("bbm.linker.open.tab"),onChange:ct})]})},SvgIconReset=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.583 7.313 3.976 3.87a.996.996 0 1 0-1.96.346l1.012 5.747a.996.996 0 0 0 1.153.809l5.743-1.014a.997.997 0 0 0-.346-1.962l-3.3.582a7.754 7.754 0 0 1 8.399-4.254 7.76 7.76 0 0 1 .78 15.064 7.745 7.745 0 0 1-8.912-3.56.995.995 0 1 0-1.724.997 9.744 9.744 0 0 0 11.201 4.474 9.74 9.74 0 0 0 5.19-3.718 9.756 9.756 0 0 0-.625-12.055A9.74 9.74 0 0 0 8.73 3.117a9.75 9.75 0 0 0-4.147 4.196",clipRule:"evenodd"})]}),SvgIconWand=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 0a1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 0 2 1 1 0 0 0-1 1 1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 1 1 0 0 0 1-1 1 1 0 0 1 1-1m9.914 2a2 2 0 0 0-2.828 0L1 18.086a2 2 0 0 0 0 2.828L3.086 23a2 2 0 0 0 2.828 0L22 6.914a2 2 0 0 0 0-2.828zm-3.75 3.75L18.5 3.414 20.586 5.5 18.25 7.836zM14.75 7.164 2.414 19.5 4.5 21.586 16.836 9.25zM21 13a1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 1 1 0 0 1 1-1 1 1 0 1 0 0-2 1 1 0 0 1-1-1",clipRule:"evenodd"})]}),UploadCard=({item:tt,status:et="idle",isClickable:rt=!1,isSelectable:nt=!1,onDelete:st,onEdit:ot,onRetry:at})=>{const{t:lt}=useTranslation(),{src:ut,name:ct,info:dt}=tt,ht=et==="idle",mt=et==="loading",xt=et==="success",yt=dt==null?void 0:dt.type.startsWith("image"),vt={text:"",context:null,image:jsxRuntimeExports.jsx("img",{src:commonPlaceholder,alt:"",width:"48",height:"48"})},Et={error:{text:jsxRuntimeExports.jsx("strong",{children:jsxRuntimeExports.jsx("small",{className:"text-danger caption",children:lt("tiptap.upload.error")})}),context:jsxRuntimeExports.jsx(Button,{leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),variant:"ghost",color:"tertiary",onClick:at,children:lt("tiptap.upload.retry")}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:`${commonPlaceholder}/common/image-status-error.svg`,objectFit:"cover"})},idle:vt,loading:{text:"",context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loading"),placement:"top",children:jsxRuntimeExports.jsx(Loading,{isLoading:!0,loadingPosition:"left",className:"text-secondary"})}),image:vt.image},warning:vt,success:{text:jsxRuntimeExports.jsxs("em",{children:[dt==null?void 0:dt.type," ",(dt==null?void 0:dt.weight)&&`- ${dt.weight}`]}),context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loaded"),placement:"top",children:jsxRuntimeExports.jsx(SvgIconSuccessOutline,{className:"text-success"})}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:ut??"",width:"48",objectFit:"cover",className:"rounded",style:{aspectRatio:1/1}})},unknown:vt},bt=()=>yt&&jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.edit"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconWand,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.loading"),disabled:mt||!xt,onClick:ot,color:"secondary"})});return jsxRuntimeExports.jsx(Card,{isClickable:rt,isSelectable:nt,className:"card-upload",children:jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx("div",{className:"card-image",children:Et[et].image}),jsxRuntimeExports.jsxs("div",{className:"text-truncate",children:[jsxRuntimeExports.jsx(Card.Text,{children:ct}),jsxRuntimeExports.jsx(Card.Text,{className:"caption",children:Et[et].text})]}),!ht&&jsxRuntimeExports.jsx("div",{className:"ms-auto",children:jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-12",children:[Et[et].context,!ht&&jsxRuntimeExports.jsx("div",{className:"vr"}),bt(),jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.delete"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconClose,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.delete"),color:"tertiary",onClick:st})})]})})]})})};var module={exports:{}},ENV=(tt=>(tt[tt.WEBGL_LEGACY=0]="WEBGL_LEGACY",tt[tt.WEBGL=1]="WEBGL",tt[tt.WEBGL2=2]="WEBGL2",tt))(ENV||{}),RENDERER_TYPE=(tt=>(tt[tt.UNKNOWN=0]="UNKNOWN",tt[tt.WEBGL=1]="WEBGL",tt[tt.CANVAS=2]="CANVAS",tt))(RENDERER_TYPE||{}),BUFFER_BITS=(tt=>(tt[tt.COLOR=16384]="COLOR",tt[tt.DEPTH=256]="DEPTH",tt[tt.STENCIL=1024]="STENCIL",tt))(BUFFER_BITS||{}),BLEND_MODES=(tt=>(tt[tt.NORMAL=0]="NORMAL",tt[tt.ADD=1]="ADD",tt[tt.MULTIPLY=2]="MULTIPLY",tt[tt.SCREEN=3]="SCREEN",tt[tt.OVERLAY=4]="OVERLAY",tt[tt.DARKEN=5]="DARKEN",tt[tt.LIGHTEN=6]="LIGHTEN",tt[tt.COLOR_DODGE=7]="COLOR_DODGE",tt[tt.COLOR_BURN=8]="COLOR_BURN",tt[tt.HARD_LIGHT=9]="HARD_LIGHT",tt[tt.SOFT_LIGHT=10]="SOFT_LIGHT",tt[tt.DIFFERENCE=11]="DIFFERENCE",tt[tt.EXCLUSION=12]="EXCLUSION",tt[tt.HUE=13]="HUE",tt[tt.SATURATION=14]="SATURATION",tt[tt.COLOR=15]="COLOR",tt[tt.LUMINOSITY=16]="LUMINOSITY",tt[tt.NORMAL_NPM=17]="NORMAL_NPM",tt[tt.ADD_NPM=18]="ADD_NPM",tt[tt.SCREEN_NPM=19]="SCREEN_NPM",tt[tt.NONE=20]="NONE",tt[tt.SRC_OVER=0]="SRC_OVER",tt[tt.SRC_IN=21]="SRC_IN",tt[tt.SRC_OUT=22]="SRC_OUT",tt[tt.SRC_ATOP=23]="SRC_ATOP",tt[tt.DST_OVER=24]="DST_OVER",tt[tt.DST_IN=25]="DST_IN",tt[tt.DST_OUT=26]="DST_OUT",tt[tt.DST_ATOP=27]="DST_ATOP",tt[tt.ERASE=26]="ERASE",tt[tt.SUBTRACT=28]="SUBTRACT",tt[tt.XOR=29]="XOR",tt))(BLEND_MODES||{}),DRAW_MODES=(tt=>(tt[tt.POINTS=0]="POINTS",tt[tt.LINES=1]="LINES",tt[tt.LINE_LOOP=2]="LINE_LOOP",tt[tt.LINE_STRIP=3]="LINE_STRIP",tt[tt.TRIANGLES=4]="TRIANGLES",tt[tt.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",tt[tt.TRIANGLE_FAN=6]="TRIANGLE_FAN",tt))(DRAW_MODES||{}),FORMATS=(tt=>(tt[tt.RGBA=6408]="RGBA",tt[tt.RGB=6407]="RGB",tt[tt.RG=33319]="RG",tt[tt.RED=6403]="RED",tt[tt.RGBA_INTEGER=36249]="RGBA_INTEGER",tt[tt.RGB_INTEGER=36248]="RGB_INTEGER",tt[tt.RG_INTEGER=33320]="RG_INTEGER",tt[tt.RED_INTEGER=36244]="RED_INTEGER",tt[tt.ALPHA=6406]="ALPHA",tt[tt.LUMINANCE=6409]="LUMINANCE",tt[tt.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",tt[tt.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",tt[tt.DEPTH_STENCIL=34041]="DEPTH_STENCIL",tt))(FORMATS||{}),TARGETS=(tt=>(tt[tt.TEXTURE_2D=3553]="TEXTURE_2D",tt[tt.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",tt[tt.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",tt))(TARGETS||{}),TYPES=(tt=>(tt[tt.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",tt[tt.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",tt[tt.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",tt[tt.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",tt[tt.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",tt[tt.UNSIGNED_INT=5125]="UNSIGNED_INT",tt[tt.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",tt[tt.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",tt[tt.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",tt[tt.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",tt[tt.BYTE=5120]="BYTE",tt[tt.SHORT=5122]="SHORT",tt[tt.INT=5124]="INT",tt[tt.FLOAT=5126]="FLOAT",tt[tt.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",tt[tt.HALF_FLOAT=36193]="HALF_FLOAT",tt))(TYPES||{}),SAMPLER_TYPES=(tt=>(tt[tt.FLOAT=0]="FLOAT",tt[tt.INT=1]="INT",tt[tt.UINT=2]="UINT",tt))(SAMPLER_TYPES||{}),SCALE_MODES=(tt=>(tt[tt.NEAREST=0]="NEAREST",tt[tt.LINEAR=1]="LINEAR",tt))(SCALE_MODES||{}),WRAP_MODES=(tt=>(tt[tt.CLAMP=33071]="CLAMP",tt[tt.REPEAT=10497]="REPEAT",tt[tt.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",tt))(WRAP_MODES||{}),MIPMAP_MODES=(tt=>(tt[tt.OFF=0]="OFF",tt[tt.POW2=1]="POW2",tt[tt.ON=2]="ON",tt[tt.ON_MANUAL=3]="ON_MANUAL",tt))(MIPMAP_MODES||{}),ALPHA_MODES=(tt=>(tt[tt.NPM=0]="NPM",tt[tt.UNPACK=1]="UNPACK",tt[tt.PMA=2]="PMA",tt[tt.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",tt[tt.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",tt[tt.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",tt))(ALPHA_MODES||{}),CLEAR_MODES=(tt=>(tt[tt.NO=0]="NO",tt[tt.YES=1]="YES",tt[tt.AUTO=2]="AUTO",tt[tt.BLEND=0]="BLEND",tt[tt.CLEAR=1]="CLEAR",tt[tt.BLIT=2]="BLIT",tt))(CLEAR_MODES||{}),GC_MODES=(tt=>(tt[tt.AUTO=0]="AUTO",tt[tt.MANUAL=1]="MANUAL",tt))(GC_MODES||{}),PRECISION=(tt=>(tt.LOW="lowp",tt.MEDIUM="mediump",tt.HIGH="highp",tt))(PRECISION||{}),MASK_TYPES=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.SCISSOR=1]="SCISSOR",tt[tt.STENCIL=2]="STENCIL",tt[tt.SPRITE=3]="SPRITE",tt[tt.COLOR=4]="COLOR",tt))(MASK_TYPES||{}),MSAA_QUALITY=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.LOW=2]="LOW",tt[tt.MEDIUM=4]="MEDIUM",tt[tt.HIGH=8]="HIGH",tt))(MSAA_QUALITY||{}),BUFFER_TYPE=(tt=>(tt[tt.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",tt[tt.ARRAY_BUFFER=34962]="ARRAY_BUFFER",tt[tt.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",tt))(BUFFER_TYPE||{});const BrowserAdapter={createCanvas:(tt,et)=>{const rt=document.createElement("canvas");return rt.width=tt,rt.height=et,rt},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(tt,et)=>fetch(tt,et),parseXML:tt=>new DOMParser().parseFromString(tt,"text/xml")},settings={ADAPTER:BrowserAdapter,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var appleIphone=/iPhone/i,appleIpod=/iPod/i,appleTablet=/iPad/i,appleUniversal=/\biOS-universal(?:.+)Mac\b/i,androidPhone=/\bAndroid(?:.+)Mobile\b/i,androidTablet=/Android/i,amazonPhone=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,amazonTablet=/Silk/i,windowsPhone=/Windows Phone/i,windowsTablet=/\bWindows(?:.+)ARM\b/i,otherBlackBerry=/BlackBerry/i,otherBlackBerry10=/BB10/i,otherOpera=/Opera Mini/i,otherChrome=/\b(CriOS|Chrome)(?:.+)Mobile/i,otherFirefox=/Mobile(?:.+)Firefox\b/i,isAppleTabletOnIos13=function(tt){return typeof tt<"u"&&tt.platform==="MacIntel"&&typeof tt.maxTouchPoints=="number"&&tt.maxTouchPoints>1&&typeof MSStream>"u"};function createMatch(tt){return function(et){return et.test(tt)}}function isMobile$1(tt){var et={userAgent:"",platform:"",maxTouchPoints:0};!tt&&typeof navigator<"u"?et={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof tt=="string"?et.userAgent=tt:tt&&tt.userAgent&&(et={userAgent:tt.userAgent,platform:tt.platform,maxTouchPoints:tt.maxTouchPoints||0});var rt=et.userAgent,nt=rt.split("[FBAN");typeof nt[1]<"u"&&(rt=nt[0]),nt=rt.split("Twitter"),typeof nt[1]<"u"&&(rt=nt[0]);var st=createMatch(rt),ot={apple:{phone:st(appleIphone)&&!st(windowsPhone),ipod:st(appleIpod),tablet:!st(appleIphone)&&(st(appleTablet)||isAppleTabletOnIos13(et))&&!st(windowsPhone),universal:st(appleUniversal),device:(st(appleIphone)||st(appleIpod)||st(appleTablet)||st(appleUniversal)||isAppleTabletOnIos13(et))&&!st(windowsPhone)},amazon:{phone:st(amazonPhone),tablet:!st(amazonPhone)&&st(amazonTablet),device:st(amazonPhone)||st(amazonTablet)},android:{phone:!st(windowsPhone)&&st(amazonPhone)||!st(windowsPhone)&&st(androidPhone),tablet:!st(windowsPhone)&&!st(amazonPhone)&&!st(androidPhone)&&(st(amazonTablet)||st(androidTablet)),device:!st(windowsPhone)&&(st(amazonPhone)||st(amazonTablet)||st(androidPhone)||st(androidTablet))||st(/\bokhttp\b/i)},windows:{phone:st(windowsPhone),tablet:st(windowsTablet),device:st(windowsPhone)||st(windowsTablet)},other:{blackberry:st(otherBlackBerry),blackberry10:st(otherBlackBerry10),opera:st(otherOpera),firefox:st(otherFirefox),chrome:st(otherChrome),device:st(otherBlackBerry)||st(otherBlackBerry10)||st(otherOpera)||st(otherFirefox)||st(otherChrome)},any:!1,phone:!1,tablet:!1};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}const isMobileCall=isMobile$1.default??isMobile$1,isMobile=isMobileCall(globalThis.navigator);settings.RETINA_PREFIX=/@([0-9\.]+)x/;settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var eventemitter3={exports:{}};(function(tt){var et=Object.prototype.hasOwnProperty,rt="~";function nt(){}Object.create&&(nt.prototype=Object.create(null),new nt().__proto__||(rt=!1));function st(ut,ct,dt){this.fn=ut,this.context=ct,this.once=dt||!1}function ot(ut,ct,dt,ht,mt){if(typeof dt!="function")throw new TypeError("The listener must be a function");var xt=new st(dt,ht||ut,mt),yt=rt?rt+ct:ct;return ut._events[yt]?ut._events[yt].fn?ut._events[yt]=[ut._events[yt],xt]:ut._events[yt].push(xt):(ut._events[yt]=xt,ut._eventsCount++),ut}function at(ut,ct){--ut._eventsCount===0?ut._events=new nt:delete ut._events[ct]}function lt(){this._events=new nt,this._eventsCount=0}lt.prototype.eventNames=function(){var ct=[],dt,ht;if(this._eventsCount===0)return ct;for(ht in dt=this._events)et.call(dt,ht)&&ct.push(rt?ht.slice(1):ht);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(dt)):ct},lt.prototype.listeners=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];if(!ht)return[];if(ht.fn)return[ht.fn];for(var mt=0,xt=ht.length,yt=new Array(xt);mt<xt;mt++)yt[mt]=ht[mt].fn;return yt},lt.prototype.listenerCount=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];return ht?ht.fn?1:ht.length:0},lt.prototype.emit=function(ct,dt,ht,mt,xt,yt){var vt=rt?rt+ct:ct;if(!this._events[vt])return!1;var Et=this._events[vt],bt=arguments.length,St,wt;if(Et.fn){switch(Et.once&&this.removeListener(ct,Et.fn,void 0,!0),bt){case 1:return Et.fn.call(Et.context),!0;case 2:return Et.fn.call(Et.context,dt),!0;case 3:return Et.fn.call(Et.context,dt,ht),!0;case 4:return Et.fn.call(Et.context,dt,ht,mt),!0;case 5:return Et.fn.call(Et.context,dt,ht,mt,xt),!0;case 6:return Et.fn.call(Et.context,dt,ht,mt,xt,yt),!0}for(wt=1,St=new Array(bt-1);wt<bt;wt++)St[wt-1]=arguments[wt];Et.fn.apply(Et.context,St)}else{var Rt=Et.length,Ct;for(wt=0;wt<Rt;wt++)switch(Et[wt].once&&this.removeListener(ct,Et[wt].fn,void 0,!0),bt){case 1:Et[wt].fn.call(Et[wt].context);break;case 2:Et[wt].fn.call(Et[wt].context,dt);break;case 3:Et[wt].fn.call(Et[wt].context,dt,ht);break;case 4:Et[wt].fn.call(Et[wt].context,dt,ht,mt);break;default:if(!St)for(Ct=1,St=new Array(bt-1);Ct<bt;Ct++)St[Ct-1]=arguments[Ct];Et[wt].fn.apply(Et[wt].context,St)}}return!0},lt.prototype.on=function(ct,dt,ht){return ot(this,ct,dt,ht,!1)},lt.prototype.once=function(ct,dt,ht){return ot(this,ct,dt,ht,!0)},lt.prototype.removeListener=function(ct,dt,ht,mt){var xt=rt?rt+ct:ct;if(!this._events[xt])return this;if(!dt)return at(this,xt),this;var yt=this._events[xt];if(yt.fn)yt.fn===dt&&(!mt||yt.once)&&(!ht||yt.context===ht)&&at(this,xt);else{for(var vt=0,Et=[],bt=yt.length;vt<bt;vt++)(yt[vt].fn!==dt||mt&&!yt[vt].once||ht&&yt[vt].context!==ht)&&Et.push(yt[vt]);Et.length?this._events[xt]=Et.length===1?Et[0]:Et:at(this,xt)}return this},lt.prototype.removeAllListeners=function(ct){var dt;return ct?(dt=rt?rt+ct:ct,this._events[dt]&&at(this,dt)):(this._events=new nt,this._eventsCount=0),this},lt.prototype.off=lt.prototype.removeListener,lt.prototype.addListener=lt.prototype.on,lt.prefixed=rt,lt.EventEmitter=lt,tt.exports=lt})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);var earcut$2={exports:{}};earcut$2.exports=earcut;earcut$2.exports.default=earcut;function earcut(tt,et,rt){rt=rt||2;var nt=et&&et.length,st=nt?et[0]*rt:tt.length,ot=linkedList(tt,0,st,rt,!0),at=[];if(!ot||ot.next===ot.prev)return at;var lt,ut,ct,dt,ht,mt,xt;if(nt&&(ot=eliminateHoles(tt,et,ot,rt)),tt.length>80*rt){lt=ct=tt[0],ut=dt=tt[1];for(var yt=rt;yt<st;yt+=rt)ht=tt[yt],mt=tt[yt+1],ht<lt&&(lt=ht),mt<ut&&(ut=mt),ht>ct&&(ct=ht),mt>dt&&(dt=mt);xt=Math.max(ct-lt,dt-ut),xt=xt!==0?32767/xt:0}return earcutLinked(ot,at,rt,lt,ut,xt,0),at}function linkedList(tt,et,rt,nt,st){var ot,at;if(st===signedArea(tt,et,rt,nt)>0)for(ot=et;ot<rt;ot+=nt)at=insertNode(ot,tt[ot],tt[ot+1],at);else for(ot=rt-nt;ot>=et;ot-=nt)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);var rt=tt,nt;do if(nt=!1,!rt.steiner&&(equals(rt,rt.next)||area(rt.prev,rt,rt.next)===0)){if(removeNode(rt),rt=et=rt.prev,rt===rt.next)break;nt=!0}else rt=rt.next;while(nt||rt!==et);return et}function earcutLinked(tt,et,rt,nt,st,ot,at){if(tt){!at&&ot&&indexCurve(tt,nt,st,ot);for(var lt=tt,ut,ct;tt.prev!==tt.next;){if(ut=tt.prev,ct=tt.next,ot?isEarHashed(tt,nt,st,ot):isEar(tt)){et.push(ut.i/rt|0),et.push(tt.i/rt|0),et.push(ct.i/rt|0),removeNode(tt),tt=ct.next,lt=ct.next;continue}if(tt=ct,tt===lt){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,rt),earcutLinked(tt,et,rt,nt,st,ot,2)):at===2&&splitEarcut(tt,et,rt,nt,st,ot):earcutLinked(filterPoints(tt),et,rt,nt,st,ot,1);break}}}}function isEar(tt){var et=tt.prev,rt=tt,nt=tt.next;if(area(et,rt,nt)>=0)return!1;for(var st=et.x,ot=rt.x,at=nt.x,lt=et.y,ut=rt.y,ct=nt.y,dt=st<ot?st<at?st:at:ot<at?ot:at,ht=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,mt=st>ot?st>at?st:at:ot>at?ot:at,xt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,yt=nt.next;yt!==et;){if(yt.x>=dt&&yt.x<=mt&&yt.y>=ht&&yt.y<=xt&&pointInTriangle(st,lt,ot,ut,at,ct,yt.x,yt.y)&&area(yt.prev,yt,yt.next)>=0)return!1;yt=yt.next}return!0}function isEarHashed(tt,et,rt,nt){var st=tt.prev,ot=tt,at=tt.next;if(area(st,ot,at)>=0)return!1;for(var lt=st.x,ut=ot.x,ct=at.x,dt=st.y,ht=ot.y,mt=at.y,xt=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,yt=dt<ht?dt<mt?dt:mt:ht<mt?ht:mt,vt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,Et=dt>ht?dt>mt?dt:mt:ht>mt?ht:mt,bt=zOrder(xt,yt,et,rt,nt),St=zOrder(vt,Et,et,rt,nt),wt=tt.prevZ,Rt=tt.nextZ;wt&&wt.z>=bt&&Rt&&Rt.z<=St;){if(wt.x>=xt&&wt.x<=vt&&wt.y>=yt&&wt.y<=Et&&wt!==st&&wt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,wt.x,wt.y)&&area(wt.prev,wt,wt.next)>=0||(wt=wt.prevZ,Rt.x>=xt&&Rt.x<=vt&&Rt.y>=yt&&Rt.y<=Et&&Rt!==st&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0))return!1;Rt=Rt.nextZ}for(;wt&&wt.z>=bt;){if(wt.x>=xt&&wt.x<=vt&&wt.y>=yt&&wt.y<=Et&&wt!==st&&wt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,wt.x,wt.y)&&area(wt.prev,wt,wt.next)>=0)return!1;wt=wt.prevZ}for(;Rt&&Rt.z<=St;){if(Rt.x>=xt&&Rt.x<=vt&&Rt.y>=yt&&Rt.y<=Et&&Rt!==st&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,mt,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.nextZ}return!0}function cureLocalIntersections(tt,et,rt){var nt=tt;do{var st=nt.prev,ot=nt.next.next;!equals(st,ot)&&intersects(st,nt,nt.next,ot)&&locallyInside(st,ot)&&locallyInside(ot,st)&&(et.push(st.i/rt|0),et.push(nt.i/rt|0),et.push(ot.i/rt|0),removeNode(nt),removeNode(nt.next),nt=tt=ot),nt=nt.next}while(nt!==tt);return filterPoints(nt)}function splitEarcut(tt,et,rt,nt,st,ot){var at=tt;do{for(var lt=at.next.next;lt!==at.prev;){if(at.i!==lt.i&&isValidDiagonal(at,lt)){var ut=splitPolygon(at,lt);at=filterPoints(at,at.next),ut=filterPoints(ut,ut.next),earcutLinked(at,et,rt,nt,st,ot,0),earcutLinked(ut,et,rt,nt,st,ot,0);return}lt=lt.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,rt,nt){var st=[],ot,at,lt,ut,ct;for(ot=0,at=et.length;ot<at;ot++)lt=et[ot]*nt,ut=ot<at-1?et[ot+1]*nt:tt.length,ct=linkedList(tt,lt,ut,nt,!1),ct===ct.next&&(ct.steiner=!0),st.push(getLeftmost(ct));for(st.sort(compareX),ot=0;ot<st.length;ot++)rt=eliminateHole(st[ot],rt);return rt}function compareX(tt,et){return tt.x-et.x}function eliminateHole(tt,et){var rt=findHoleBridge(tt,et);if(!rt)return et;var nt=splitPolygon(rt,tt);return filterPoints(nt,nt.next),filterPoints(rt,rt.next)}function findHoleBridge(tt,et){var rt=et,nt=tt.x,st=tt.y,ot=-1/0,at;do{if(st<=rt.y&&st>=rt.next.y&&rt.next.y!==rt.y){var lt=rt.x+(st-rt.y)*(rt.next.x-rt.x)/(rt.next.y-rt.y);if(lt<=nt&&lt>ot&&(ot=lt,at=rt.x<rt.next.x?rt:rt.next,lt===nt))return at}rt=rt.next}while(rt!==et);if(!at)return null;var ut=at,ct=at.x,dt=at.y,ht=1/0,mt;rt=at;do nt>=rt.x&&rt.x>=ct&&nt!==rt.x&&pointInTriangle(st<dt?nt:ot,st,ct,dt,st<dt?ot:nt,st,rt.x,rt.y)&&(mt=Math.abs(st-rt.y)/(nt-rt.x),locallyInside(rt,tt)&&(mt<ht||mt===ht&&(rt.x>at.x||rt.x===at.x&&sectorContainsSector(at,rt)))&&(at=rt,ht=mt)),rt=rt.next;while(rt!==ut);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,rt,nt){var st=tt;do st.z===0&&(st.z=zOrder(st.x,st.y,et,rt,nt)),st.prevZ=st.prev,st.nextZ=st.next,st=st.next;while(st!==tt);st.prevZ.nextZ=null,st.prevZ=null,sortLinked(st)}function sortLinked(tt){var et,rt,nt,st,ot,at,lt,ut,ct=1;do{for(rt=tt,tt=null,ot=null,at=0;rt;){for(at++,nt=rt,lt=0,et=0;et<ct&&(lt++,nt=nt.nextZ,!!nt);et++);for(ut=ct;lt>0||ut>0&&nt;)lt!==0&&(ut===0||!nt||rt.z<=nt.z)?(st=rt,rt=rt.nextZ,lt--):(st=nt,nt=nt.nextZ,ut--),ot?ot.nextZ=st:tt=st,st.prevZ=ot,ot=st;rt=nt}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,rt,nt,st){return tt=(tt-rt)*st|0,et=(et-nt)*st|0,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){var et=tt,rt=tt;do(et.x<rt.x||et.x===rt.x&&et.y<rt.y)&&(rt=et),et=et.next;while(et!==tt);return rt}function pointInTriangle(tt,et,rt,nt,st,ot,at,lt){return(st-at)*(et-lt)>=(tt-at)*(ot-lt)&&(tt-at)*(nt-lt)>=(rt-at)*(et-lt)&&(rt-at)*(ot-lt)>=(st-at)*(nt-lt)}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,rt){return(et.y-tt.y)*(rt.x-et.x)-(et.x-tt.x)*(rt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,rt,nt){var st=sign$3(area(tt,et,rt)),ot=sign$3(area(tt,et,nt)),at=sign$3(area(rt,nt,tt)),lt=sign$3(area(rt,nt,et));return!!(st!==ot&&at!==lt||st===0&&onSegment(tt,rt,et)||ot===0&&onSegment(tt,nt,et)||at===0&&onSegment(rt,tt,nt)||lt===0&&onSegment(rt,et,nt))}function onSegment(tt,et,rt){return et.x<=Math.max(tt.x,rt.x)&&et.x>=Math.min(tt.x,rt.x)&&et.y<=Math.max(tt.y,rt.y)&&et.y>=Math.min(tt.y,rt.y)}function sign$3(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){var rt=tt;do{if(rt.i!==tt.i&&rt.next.i!==tt.i&&rt.i!==et.i&&rt.next.i!==et.i&&intersects(rt,rt.next,tt,et))return!0;rt=rt.next}while(rt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){var rt=tt,nt=!1,st=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do rt.y>ot!=rt.next.y>ot&&rt.next.y!==rt.y&&st<(rt.next.x-rt.x)*(ot-rt.y)/(rt.next.y-rt.y)+rt.x&&(nt=!nt),rt=rt.next;while(rt!==tt);return nt}function splitPolygon(tt,et){var rt=new Node$1(tt.i,tt.x,tt.y),nt=new Node$1(et.i,et.x,et.y),st=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,rt.next=st,st.prev=rt,nt.next=rt,rt.prev=nt,ot.next=nt,nt.prev=ot,nt}function insertNode(tt,et,rt,nt){var st=new Node$1(tt,et,rt);return nt?(st.next=nt.next,st.prev=nt,nt.next.prev=st,nt.next=st):(st.prev=st,st.next=st),st}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$1(tt,et,rt){this.i=tt,this.x=et,this.y=rt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}earcut.deviation=function(tt,et,rt,nt){var st=et&&et.length,ot=st?et[0]*rt:tt.length,at=Math.abs(signedArea(tt,0,ot,rt));if(st)for(var lt=0,ut=et.length;lt<ut;lt++){var ct=et[lt]*rt,dt=lt<ut-1?et[lt+1]*rt:tt.length;at-=Math.abs(signedArea(tt,ct,dt,rt))}var ht=0;for(lt=0;lt<nt.length;lt+=3){var mt=nt[lt]*rt,xt=nt[lt+1]*rt,yt=nt[lt+2]*rt;ht+=Math.abs((tt[mt]-tt[yt])*(tt[xt+1]-tt[mt+1])-(tt[mt]-tt[xt])*(tt[yt+1]-tt[mt+1]))}return at===0&&ht===0?0:Math.abs((ht-at)/at)};function signedArea(tt,et,rt,nt){for(var st=0,ot=et,at=rt-nt;ot<rt;ot+=nt)st+=(tt[at]-tt[ot])*(tt[ot+1]+tt[at+1]),at=ot;return st}earcut.flatten=function(tt){for(var et=tt[0][0].length,rt={vertices:[],holes:[],dimensions:et},nt=0,st=0;st<tt.length;st++){for(var ot=0;ot<tt[st].length;ot++)for(var at=0;at<et;at++)rt.vertices.push(tt[st][ot][at]);st>0&&(nt+=tt[st-1].length,rt.holes.push(nt))}return rt};var earcutExports=earcut$2.exports;const earcut$1=getDefaultExportFromCjs(earcutExports);var punycode$1={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */punycode$1.exports;(function(tt,et){(function(rt){var nt=et&&!et.nodeType&&et,st=!tt.nodeType&&tt,ot=typeof commonjsGlobal=="object"&&commonjsGlobal;(ot.global===ot||ot.window===ot||ot.self===ot)&&(rt=ot);var at,lt=2147483647,ut=36,ct=1,dt=26,ht=38,mt=700,xt=72,yt=128,vt="-",Et=/^xn--/,bt=/[^\x20-\x7E]/,St=/[\x2E\u3002\uFF0E\uFF61]/g,wt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Rt=ut-ct,Ct=Math.floor,Pt=String.fromCharCode,It;function jt(Bt){throw new RangeError(wt[Bt])}function Dt(Bt,Yt){for(var Zt=Bt.length,Xt=[];Zt--;)Xt[Zt]=Yt(Bt[Zt]);return Xt}function Vt(Bt,Yt){var Zt=Bt.split("@"),Xt="";Zt.length>1&&(Xt=Zt[0]+"@",Bt=Zt[1]),Bt=Bt.replace(St,".");var rr=Bt.split("."),cr=Dt(rr,Yt).join(".");return Xt+cr}function Ft(Bt){for(var Yt=[],Zt=0,Xt=Bt.length,rr,cr;Zt<Xt;)rr=Bt.charCodeAt(Zt++),rr>=55296&&rr<=56319&&Zt<Xt?(cr=Bt.charCodeAt(Zt++),(cr&64512)==56320?Yt.push(((rr&1023)<<10)+(cr&1023)+65536):(Yt.push(rr),Zt--)):Yt.push(rr);return Yt}function Ht(Bt){return Dt(Bt,function(Yt){var Zt="";return Yt>65535&&(Yt-=65536,Zt+=Pt(Yt>>>10&1023|55296),Yt=56320|Yt&1023),Zt+=Pt(Yt),Zt}).join("")}function Nt(Bt){return Bt-48<10?Bt-22:Bt-65<26?Bt-65:Bt-97<26?Bt-97:ut}function Lt(Bt,Yt){return Bt+22+75*(Bt<26)-((Yt!=0)<<5)}function Mt(Bt,Yt,Zt){var Xt=0;for(Bt=Zt?Ct(Bt/mt):Bt>>1,Bt+=Ct(Bt/Yt);Bt>Rt*dt>>1;Xt+=ut)Bt=Ct(Bt/Rt);return Ct(Xt+(Rt+1)*Bt/(Bt+ht))}function zt(Bt){var Yt=[],Zt=Bt.length,Xt,rr=0,cr=yt,ur=xt,mr,vr,Er,br,hr,Ar,Cr,Ur,Sr;for(mr=Bt.lastIndexOf(vt),mr<0&&(mr=0),vr=0;vr<mr;++vr)Bt.charCodeAt(vr)>=128&&jt("not-basic"),Yt.push(Bt.charCodeAt(vr));for(Er=mr>0?mr+1:0;Er<Zt;){for(br=rr,hr=1,Ar=ut;Er>=Zt&&jt("invalid-input"),Cr=Nt(Bt.charCodeAt(Er++)),(Cr>=ut||Cr>Ct((lt-rr)/hr))&&jt("overflow"),rr+=Cr*hr,Ur=Ar<=ur?ct:Ar>=ur+dt?dt:Ar-ur,!(Cr<Ur);Ar+=ut)Sr=ut-Ur,hr>Ct(lt/Sr)&&jt("overflow"),hr*=Sr;Xt=Yt.length+1,ur=Mt(rr-br,Xt,br==0),Ct(rr/Xt)>lt-cr&&jt("overflow"),cr+=Ct(rr/Xt),rr%=Xt,Yt.splice(rr++,0,cr)}return Ht(Yt)}function Gt(Bt){var Yt,Zt,Xt,rr,cr,ur,mr,vr,Er,br,hr,Ar=[],Cr,Ur,Sr,kr;for(Bt=Ft(Bt),Cr=Bt.length,Yt=yt,Zt=0,cr=xt,ur=0;ur<Cr;++ur)hr=Bt[ur],hr<128&&Ar.push(Pt(hr));for(Xt=rr=Ar.length,rr&&Ar.push(vt);Xt<Cr;){for(mr=lt,ur=0;ur<Cr;++ur)hr=Bt[ur],hr>=Yt&&hr<mr&&(mr=hr);for(Ur=Xt+1,mr-Yt>Ct((lt-Zt)/Ur)&&jt("overflow"),Zt+=(mr-Yt)*Ur,Yt=mr,ur=0;ur<Cr;++ur)if(hr=Bt[ur],hr<Yt&&++Zt>lt&&jt("overflow"),hr==Yt){for(vr=Zt,Er=ut;br=Er<=cr?ct:Er>=cr+dt?dt:Er-cr,!(vr<br);Er+=ut)kr=vr-br,Sr=ut-br,Ar.push(Pt(Lt(br+kr%Sr,0))),vr=Ct(kr/Sr);Ar.push(Pt(Lt(vr,0))),cr=Mt(Zt,Ur,Xt==rr),Zt=0,++Xt}++Zt,++Yt}return Ar.join("")}function $t(Bt){return Vt(Bt,function(Yt){return Et.test(Yt)?zt(Yt.slice(4).toLowerCase()):Yt})}function Ut(Bt){return Vt(Bt,function(Yt){return bt.test(Yt)?"xn--"+Gt(Yt):Yt})}if(at={version:"1.4.1",ucs2:{decode:Ft,encode:Ht},decode:zt,encode:Gt,toASCII:Ut,toUnicode:$t},nt&&st)if(tt.exports==nt)st.exports=at;else for(It in at)at.hasOwnProperty(It)&&(nt[It]=at[It]);else rt.punycode=at})(commonjsGlobal)})(punycode$1,punycode$1.exports);var punycodeExports=punycode$1.exports,type=TypeError;const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasMap=typeof Map=="function"&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize$1=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get=="function"?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet=typeof Set=="function"&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get=="function"?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,hasWeakMap=typeof WeakMap=="function"&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet=typeof WeakSet=="function"&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef=typeof WeakRef=="function"&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace$1=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat$1=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hasShammedSymbols=typeof Symbol=="function"&&typeof Symbol.iterator=="object",toStringTag=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||!0)?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(tt){return tt.__proto__}:null);function addNumericSeparator(tt,et){if(tt===1/0||tt===-1/0||tt!==tt||tt&&tt>-1e3&&tt<1e3||$test.call(/e/,et))return et;var rt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof tt=="number"){var nt=tt<0?-$floor(-tt):$floor(tt);if(nt!==tt){var st=String(nt),ot=$slice.call(et,st.length+1);return $replace$1.call(st,rt,"$&_")+"."+$replace$1.call($replace$1.call(ot,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace$1.call(et,rt,"$&_")}var utilInspect=require$$0$1,inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},objectInspect=function tt(et,rt,nt,st){var ot=rt||{};if(has$3(ot,"quoteStyle")&&!has$3(quotes,ot.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(ot,"maxStringLength")&&(typeof ot.maxStringLength=="number"?ot.maxStringLength<0&&ot.maxStringLength!==1/0:ot.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var at=has$3(ot,"customInspect")?ot.customInspect:!0;if(typeof at!="boolean"&&at!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(ot,"indent")&&ot.indent!==null&&ot.indent!==" "&&!(parseInt(ot.indent,10)===ot.indent&&ot.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(ot,"numericSeparator")&&typeof ot.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var lt=ot.numericSeparator;if(typeof et>"u")return"undefined";if(et===null)return"null";if(typeof et=="boolean")return et?"true":"false";if(typeof et=="string")return inspectString(et,ot);if(typeof et=="number"){if(et===0)return 1/0/et>0?"0":"-0";var ut=String(et);return lt?addNumericSeparator(et,ut):ut}if(typeof et=="bigint"){var ct=String(et)+"n";return lt?addNumericSeparator(et,ct):ct}var dt=typeof ot.depth>"u"?5:ot.depth;if(typeof nt>"u"&&(nt=0),nt>=dt&&dt>0&&typeof et=="object")return isArray$3(et)?"[Array]":"[Object]";var ht=getIndent(ot,nt);if(typeof st>"u")st=[];else if(indexOf(st,et)>=0)return"[Circular]";function mt(Nt,Lt,Mt){if(Lt&&(st=$arrSlice.call(st),st.push(Lt)),Mt){var zt={depth:ot.depth};return has$3(ot,"quoteStyle")&&(zt.quoteStyle=ot.quoteStyle),tt(Nt,zt,nt+1,st)}return tt(Nt,ot,nt+1,st)}if(typeof et=="function"&&!isRegExp$1(et)){var xt=nameOf(et),yt=arrObjKeys(et,mt);return"[Function"+(xt?": "+xt:" (anonymous)")+"]"+(yt.length>0?" { "+$join.call(yt,", ")+" }":"")}if(isSymbol(et)){var vt=hasShammedSymbols?$replace$1.call(String(et),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(et);return typeof et=="object"&&!hasShammedSymbols?markBoxed(vt):vt}if(isElement(et)){for(var Et="<"+$toLowerCase.call(String(et.nodeName)),bt=et.attributes||[],St=0;St<bt.length;St++)Et+=" "+bt[St].name+"="+wrapQuotes(quote(bt[St].value),"double",ot);return Et+=">",et.childNodes&&et.childNodes.length&&(Et+="..."),Et+="</"+$toLowerCase.call(String(et.nodeName))+">",Et}if(isArray$3(et)){if(et.length===0)return"[]";var wt=arrObjKeys(et,mt);return ht&&!singleLineValues(wt)?"["+indentedJoin(wt,ht)+"]":"[ "+$join.call(wt,", ")+" ]"}if(isError(et)){var Rt=arrObjKeys(et,mt);return!("cause"in Error.prototype)&&"cause"in et&&!isEnumerable.call(et,"cause")?"{ ["+String(et)+"] "+$join.call($concat$1.call("[cause]: "+mt(et.cause),Rt),", ")+" }":Rt.length===0?"["+String(et)+"]":"{ ["+String(et)+"] "+$join.call(Rt,", ")+" }"}if(typeof et=="object"&&at){if(inspectSymbol&&typeof et[inspectSymbol]=="function"&&utilInspect)return utilInspect(et,{depth:dt-nt});if(at!=="symbol"&&typeof et.inspect=="function")return et.inspect()}if(isMap(et)){var Ct=[];return mapForEach&&mapForEach.call(et,function(Nt,Lt){Ct.push(mt(Lt,et,!0)+" => "+mt(Nt,et))}),collectionOf("Map",mapSize$1.call(et),Ct,ht)}if(isSet(et)){var Pt=[];return setForEach&&setForEach.call(et,function(Nt){Pt.push(mt(Nt,et))}),collectionOf("Set",setSize.call(et),Pt,ht)}if(isWeakMap(et))return weakCollectionOf("WeakMap");if(isWeakSet(et))return weakCollectionOf("WeakSet");if(isWeakRef(et))return weakCollectionOf("WeakRef");if(isNumber(et))return markBoxed(mt(Number(et)));if(isBigInt(et))return markBoxed(mt(bigIntValueOf.call(et)));if(isBoolean(et))return markBoxed(booleanValueOf.call(et));if(isString(et))return markBoxed(mt(String(et)));if(typeof window<"u"&&et===window)return"{ [object Window] }";if(typeof globalThis<"u"&&et===globalThis||typeof commonjsGlobal<"u"&&et===commonjsGlobal)return"{ [object globalThis] }";if(!isDate(et)&&!isRegExp$1(et)){var It=arrObjKeys(et,mt),jt=gPO?gPO(et)===Object.prototype:et instanceof Object||et.constructor===Object,Dt=et instanceof Object?"":"null prototype",Vt=!jt&&toStringTag&&Object(et)===et&&toStringTag in et?$slice.call(toStr(et),8,-1):Dt?"Object":"",Ft=jt||typeof et.constructor!="function"?"":et.constructor.name?et.constructor.name+" ":"",Ht=Ft+(Vt||Dt?"["+$join.call($concat$1.call([],Vt||[],Dt||[]),": ")+"] ":"");return It.length===0?Ht+"{}":ht?Ht+"{"+indentedJoin(It,ht)+"}":Ht+"{ "+$join.call(It,", ")+" }"}return String(et)};function wrapQuotes(tt,et,rt){var nt=rt.quoteStyle||et,st=quotes[nt];return st+tt+st}function quote(tt){return $replace$1.call(String(tt),/"/g,"&quot;")}function isArray$3(tt){return toStr(tt)==="[object Array]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isDate(tt){return toStr(tt)==="[object Date]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isRegExp$1(tt){return toStr(tt)==="[object RegExp]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isError(tt){return toStr(tt)==="[object Error]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isString(tt){return toStr(tt)==="[object String]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isNumber(tt){return toStr(tt)==="[object Number]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isBoolean(tt){return toStr(tt)==="[object Boolean]"&&(!toStringTag||!(typeof tt=="object"&&toStringTag in tt))}function isSymbol(tt){if(hasShammedSymbols)return tt&&typeof tt=="object"&&tt instanceof Symbol;if(typeof tt=="symbol")return!0;if(!tt||typeof tt!="object"||!symToString)return!1;try{return symToString.call(tt),!0}catch{}return!1}function isBigInt(tt){if(!tt||typeof tt!="object"||!bigIntValueOf)return!1;try{return bigIntValueOf.call(tt),!0}catch{}return!1}var hasOwn$1=Object.prototype.hasOwnProperty||function(tt){return tt in this};function has$3(tt,et){return hasOwn$1.call(tt,et)}function toStr(tt){return objectToString.call(tt)}function nameOf(tt){if(tt.name)return tt.name;var et=$match.call(functionToString.call(tt),/^function\s*([\w$]+)/);return et?et[1]:null}function indexOf(tt,et){if(tt.indexOf)return tt.indexOf(et);for(var rt=0,nt=tt.length;rt<nt;rt++)if(tt[rt]===et)return rt;return-1}function isMap(tt){if(!mapSize$1||!tt||typeof tt!="object")return!1;try{mapSize$1.call(tt);try{setSize.call(tt)}catch{return!0}return tt instanceof Map}catch{}return!1}function isWeakMap(tt){if(!weakMapHas||!tt||typeof tt!="object")return!1;try{weakMapHas.call(tt,weakMapHas);try{weakSetHas.call(tt,weakSetHas)}catch{return!0}return tt instanceof WeakMap}catch{}return!1}function isWeakRef(tt){if(!weakRefDeref||!tt||typeof tt!="object")return!1;try{return weakRefDeref.call(tt),!0}catch{}return!1}function isSet(tt){if(!setSize||!tt||typeof tt!="object")return!1;try{setSize.call(tt);try{mapSize$1.call(tt)}catch{return!0}return tt instanceof Set}catch{}return!1}function isWeakSet(tt){if(!weakSetHas||!tt||typeof tt!="object")return!1;try{weakSetHas.call(tt,weakSetHas);try{weakMapHas.call(tt,weakMapHas)}catch{return!0}return tt instanceof WeakSet}catch{}return!1}function isElement(tt){return!tt||typeof tt!="object"?!1:typeof HTMLElement<"u"&&tt instanceof HTMLElement?!0:typeof tt.nodeName=="string"&&typeof tt.getAttribute=="function"}function inspectString(tt,et){if(tt.length>et.maxStringLength){var rt=tt.length-et.maxStringLength,nt="... "+rt+" more character"+(rt>1?"s":"");return inspectString($slice.call(tt,0,et.maxStringLength),et)+nt}var st=quoteREs[et.quoteStyle||"single"];st.lastIndex=0;var ot=$replace$1.call($replace$1.call(tt,st,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(ot,"single",et)}function lowbyte(tt){var et=tt.charCodeAt(0),rt={8:"b",9:"t",10:"n",12:"f",13:"r"}[et];return rt?"\\"+rt:"\\x"+(et<16?"0":"")+$toUpperCase.call(et.toString(16))}function markBoxed(tt){return"Object("+tt+")"}function weakCollectionOf(tt){return tt+" { ? }"}function collectionOf(tt,et,rt,nt){var st=nt?indentedJoin(rt,nt):$join.call(rt,", ");return tt+" ("+et+") {"+st+"}"}function singleLineValues(tt){for(var et=0;et<tt.length;et++)if(indexOf(tt[et],`
229
229
  `)>=0)return!1;return!0}function getIndent(tt,et){var rt;if(tt.indent===" ")rt=" ";else if(typeof tt.indent=="number"&&tt.indent>0)rt=$join.call(Array(tt.indent+1)," ");else return null;return{base:rt,prev:$join.call(Array(et+1),rt)}}function indentedJoin(tt,et){if(tt.length===0)return"";var rt=`
230
230
  `+et.prev+et.base;return rt+$join.call(tt,","+rt)+`
231
231
  `+et.prev}function arrObjKeys(tt,et){var rt=isArray$3(tt),nt=[];if(rt){nt.length=tt.length;for(var st=0;st<tt.length;st++)nt[st]=has$3(tt,st)?et(tt[st],tt):""}var ot=typeof gOPS=="function"?gOPS(tt):[],at;if(hasShammedSymbols){at={};for(var lt=0;lt<ot.length;lt++)at["$"+ot[lt]]=ot[lt]}for(var ut in tt)has$3(tt,ut)&&(rt&&String(Number(ut))===ut&&ut<tt.length||hasShammedSymbols&&at["$"+ut]instanceof Symbol||($test.call(/[^\w$]/,ut)?nt.push(et(ut,tt)+": "+et(tt[ut],tt)):nt.push(ut+": "+et(tt[ut],tt))));if(typeof gOPS=="function")for(var ct=0;ct<ot.length;ct++)isEnumerable.call(tt,ot[ct])&&nt.push("["+et(ot[ct])+"]: "+et(tt[ot[ct]],tt));return nt}var inspect$3=objectInspect,$TypeError$5=type,listGetNode=function(tt,et,rt){for(var nt=tt,st;(st=nt.next)!=null;nt=st)if(st.key===et)return nt.next=st.next,rt||(st.next=tt.next,tt.next=st),st},listGet=function(tt,et){if(tt){var rt=listGetNode(tt,et);return rt&&rt.value}},listSet=function(tt,et,rt){var nt=listGetNode(tt,et);nt?nt.value=rt:tt.next={key:et,next:tt.next,value:rt}},listHas=function(tt,et){return tt?!!listGetNode(tt,et):!1},listDelete=function(tt,et){if(tt)return listGetNode(tt,et,!0)},sideChannelList=function tt(){var et,rt={assert:function(nt){if(!rt.has(nt))throw new $TypeError$5("Side channel does not contain "+inspect$3(nt))},delete:function(nt){var st=et&&et.next,ot=listDelete(et,nt);return ot&&st&&st===ot&&(et=void 0),!!ot},get:function(nt){return listGet(et,nt)},has:function(nt){return listHas(et,nt)},set:function(nt,st){et||(et={next:void 0}),listSet(et,nt,st)}};return rt},esObjectAtoms=Object,esErrors=Error,_eval=EvalError,range=RangeError,ref=ReferenceError,syntax=SyntaxError,uri=URIError,abs$1=Math.abs,floor$1=Math.floor,max$1=Math.max,min$1=Math.min,pow$1=Math.pow,round$2=Math.round,_isNaN=Number.isNaN||function tt(et){return et!==et},$isNaN=_isNaN,sign$2=function tt(et){return $isNaN(et)||et===0?et:et<0?-1:1},gOPD=Object.getOwnPropertyDescriptor,$gOPD$1=gOPD;if($gOPD$1)try{$gOPD$1([],"length")}catch{$gOPD$1=null}var gopd=$gOPD$1,$defineProperty$1=Object.defineProperty||!1;if($defineProperty$1)try{$defineProperty$1({},"a",{value:1})}catch{$defineProperty$1=!1}var esDefineProperty=$defineProperty$1,shams,hasRequiredShams;function requireShams(){return hasRequiredShams||(hasRequiredShams=1,shams=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var et={},rt=Symbol("test"),nt=Object(rt);if(typeof rt=="string"||Object.prototype.toString.call(rt)!=="[object Symbol]"||Object.prototype.toString.call(nt)!=="[object Symbol]")return!1;var st=42;et[rt]=st;for(var ot in et)return!1;if(typeof Object.keys=="function"&&Object.keys(et).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(et).length!==0)return!1;var at=Object.getOwnPropertySymbols(et);if(at.length!==1||at[0]!==rt||!Object.prototype.propertyIsEnumerable.call(et,rt))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var lt=Object.getOwnPropertyDescriptor(et,rt);if(lt.value!==st||lt.enumerable!==!0)return!1}return!0}),shams}var hasSymbols$1,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols$1;hasRequiredHasSymbols=1;var tt=typeof Symbol<"u"&&Symbol,et=requireShams();return hasSymbols$1=function(){return typeof tt!="function"||typeof Symbol!="function"||typeof tt("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:et()},hasSymbols$1}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var tt=esObjectAtoms;return Object_getPrototypeOf=tt.getPrototypeOf||null,Object_getPrototypeOf}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var tt="Function.prototype.bind called on incompatible ",et=Object.prototype.toString,rt=Math.max,nt="[object Function]",st=function(ut,ct){for(var dt=[],ht=0;ht<ut.length;ht+=1)dt[ht]=ut[ht];for(var mt=0;mt<ct.length;mt+=1)dt[mt+ut.length]=ct[mt];return dt},ot=function(ut,ct){for(var dt=[],ht=ct,mt=0;ht<ut.length;ht+=1,mt+=1)dt[mt]=ut[ht];return dt},at=function(lt,ut){for(var ct="",dt=0;dt<lt.length;dt+=1)ct+=lt[dt],dt+1<lt.length&&(ct+=ut);return ct};return implementation=function(ut){var ct=this;if(typeof ct!="function"||et.apply(ct)!==nt)throw new TypeError(tt+ct);for(var dt=ot(arguments,1),ht,mt=function(){if(this instanceof ht){var bt=ct.apply(this,st(dt,arguments));return Object(bt)===bt?bt:this}return ct.apply(ut,st(dt,arguments))},xt=rt(0,ct.length-dt.length),yt=[],vt=0;vt<xt;vt++)yt[vt]="$"+vt;if(ht=Function("binder","return function ("+at(yt,",")+"){ return binder.apply(this,arguments); }")(mt),ct.prototype){var Et=function(){};Et.prototype=ct.prototype,ht.prototype=new Et,Et.prototype=null}return ht},implementation}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var tt=requireImplementation();return functionBind=Function.prototype.bind||tt,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply,bind$2=requireFunctionBind(),$apply$1=requireFunctionApply(),$call$2=requireFunctionCall(),$reflectApply=reflectApply,actualApply=$reflectApply||bind$2.call($call$2,$apply$1),bind$1=requireFunctionBind(),$TypeError$4=type,$call$1=requireFunctionCall(),$actualApply=actualApply,callBindApplyHelpers=function tt(et){if(et.length<1||typeof et[0]!="function")throw new $TypeError$4("a function is required");return $actualApply(bind$1,$call$1,et)},get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var tt=callBindApplyHelpers,et=gopd,rt;try{rt=[].__proto__===Array.prototype}catch(at){if(!at||typeof at!="object"||!("code"in at)||at.code!=="ERR_PROTO_ACCESS")throw at}var nt=!!rt&&et&&et(Object.prototype,"__proto__"),st=Object,ot=st.getPrototypeOf;return get=nt&&typeof nt.get=="function"?tt([nt.get]):typeof ot=="function"?function(lt){return ot(lt==null?lt:st(lt))}:!1,get}var getProto$1,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto$1;hasRequiredGetProto=1;var tt=requireReflect_getPrototypeOf(),et=requireObject_getPrototypeOf(),rt=requireGet();return getProto$1=tt?function(st){return tt(st)}:et?function(st){if(!st||typeof st!="object"&&typeof st!="function")throw new TypeError("getProto: not an object");return et(st)}:rt?function(st){return rt(st)}:null,getProto$1}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var tt=Function.prototype.call,et=Object.prototype.hasOwnProperty,rt=requireFunctionBind();return hasown=rt.call(tt,et),hasown}var undefined$1,$Object=esObjectAtoms,$Error=esErrors,$EvalError=_eval,$RangeError=range,$ReferenceError=ref,$SyntaxError=syntax,$TypeError$3=type,$URIError=uri,abs=abs$1,floor=floor$1,max=max$1,min=min$1,pow=pow$1,round$1=round$2,sign$1=sign$2,$Function=Function,getEvalledConstructor=function(tt){try{return $Function('"use strict"; return ('+tt+").constructor;")()}catch{}},$gOPD=gopd,$defineProperty=esDefineProperty,throwTypeError=function(){throw new $TypeError$3},ThrowTypeError=$gOPD?function(){try{return arguments.callee,throwTypeError}catch{try{return $gOPD(arguments,"callee").get}catch{return throwTypeError}}}():throwTypeError,hasSymbols=requireHasSymbols()(),getProto=requireGetProto(),$ObjectGPO=requireObject_getPrototypeOf(),$ReflectGPO=requireReflect_getPrototypeOf(),$apply=requireFunctionApply(),$call=requireFunctionCall(),needsEval={},TypedArray=typeof Uint8Array>"u"||!getProto?undefined$1:getProto(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$3,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round$1,"%Math.sign%":sign$1,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(tt){var errorProto=getProto(getProto(tt));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function tt(et){var rt;if(et==="%AsyncFunction%")rt=getEvalledConstructor("async function () {}");else if(et==="%GeneratorFunction%")rt=getEvalledConstructor("function* () {}");else if(et==="%AsyncGeneratorFunction%")rt=getEvalledConstructor("async function* () {}");else if(et==="%AsyncGenerator%"){var nt=tt("%AsyncGeneratorFunction%");nt&&(rt=nt.prototype)}else if(et==="%AsyncIteratorPrototype%"){var st=tt("%AsyncGenerator%");st&&getProto&&(rt=getProto(st.prototype))}return INTRINSICS[et]=rt,rt},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=requireFunctionBind(),hasOwn=requireHasown(),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function tt(et){var rt=$strSlice(et,0,1),nt=$strSlice(et,-1);if(rt==="%"&&nt!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if(nt==="%"&&rt!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var st=[];return $replace(et,rePropName,function(ot,at,lt,ut){st[st.length]=lt?$replace(ut,reEscapeChar,"$1"):at||ot}),st},getBaseIntrinsic=function tt(et,rt){var nt=et,st;if(hasOwn(LEGACY_ALIASES,nt)&&(st=LEGACY_ALIASES[nt],nt="%"+st[0]+"%"),hasOwn(INTRINSICS,nt)){var ot=INTRINSICS[nt];if(ot===needsEval&&(ot=doEval(nt)),typeof ot>"u"&&!rt)throw new $TypeError$3("intrinsic "+et+" exists, but is not available. Please file an issue!");return{alias:st,name:nt,value:ot}}throw new $SyntaxError("intrinsic "+et+" does not exist!")},getIntrinsic=function tt(et,rt){if(typeof et!="string"||et.length===0)throw new $TypeError$3("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof rt!="boolean")throw new $TypeError$3('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,et)===null)throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var nt=stringToPath(et),st=nt.length>0?nt[0]:"",ot=getBaseIntrinsic("%"+st+"%",rt),at=ot.name,lt=ot.value,ut=!1,ct=ot.alias;ct&&(st=ct[0],$spliceApply(nt,$concat([0,1],ct)));for(var dt=1,ht=!0;dt<nt.length;dt+=1){var mt=nt[dt],xt=$strSlice(mt,0,1),yt=$strSlice(mt,-1);if((xt==='"'||xt==="'"||xt==="`"||yt==='"'||yt==="'"||yt==="`")&&xt!==yt)throw new $SyntaxError("property names with quotes must have matching quotes");if((mt==="constructor"||!ht)&&(ut=!0),st+="."+mt,at="%"+st+"%",hasOwn(INTRINSICS,at))lt=INTRINSICS[at];else if(lt!=null){if(!(mt in lt)){if(!rt)throw new $TypeError$3("base intrinsic for "+et+" exists, but the property is not available.");return}if($gOPD&&dt+1>=nt.length){var vt=$gOPD(lt,mt);ht=!!vt,ht&&"get"in vt&&!("originalValue"in vt.get)?lt=vt.get:lt=lt[mt]}else ht=hasOwn(lt,mt),lt=lt[mt];ht&&!ut&&(INTRINSICS[at]=lt)}}return lt},GetIntrinsic$2=getIntrinsic,callBindBasic=callBindApplyHelpers,$indexOf=callBindBasic([GetIntrinsic$2("%String.prototype.indexOf%")]),callBound$2=function tt(et,rt){var nt=GetIntrinsic$2(et,!!rt);return typeof nt=="function"&&$indexOf(et,".prototype.")>-1?callBindBasic([nt]):nt},GetIntrinsic$1=getIntrinsic,callBound$1=callBound$2,inspect$2=objectInspect,$TypeError$2=type,$Map=GetIntrinsic$1("%Map%",!0),$mapGet=callBound$1("Map.prototype.get",!0),$mapSet=callBound$1("Map.prototype.set",!0),$mapHas=callBound$1("Map.prototype.has",!0),$mapDelete=callBound$1("Map.prototype.delete",!0),$mapSize=callBound$1("Map.prototype.size",!0),sideChannelMap=!!$Map&&function tt(){var et,rt={assert:function(nt){if(!rt.has(nt))throw new $TypeError$2("Side channel does not contain "+inspect$2(nt))},delete:function(nt){if(et){var st=$mapDelete(et,nt);return $mapSize(et)===0&&(et=void 0),st}return!1},get:function(nt){if(et)return $mapGet(et,nt)},has:function(nt){return et?$mapHas(et,nt):!1},set:function(nt,st){et||(et=new $Map),$mapSet(et,nt,st)}};return rt},GetIntrinsic=getIntrinsic,callBound=callBound$2,inspect$1=objectInspect,getSideChannelMap$1=sideChannelMap,$TypeError$1=type,$WeakMap=GetIntrinsic("%WeakMap%",!0),$weakMapGet=callBound("WeakMap.prototype.get",!0),$weakMapSet=callBound("WeakMap.prototype.set",!0),$weakMapHas=callBound("WeakMap.prototype.has",!0),$weakMapDelete=callBound("WeakMap.prototype.delete",!0),sideChannelWeakmap=$WeakMap?function tt(){var et,rt,nt={assert:function(st){if(!nt.has(st))throw new $TypeError$1("Side channel does not contain "+inspect$1(st))},delete:function(st){if($WeakMap&&st&&(typeof st=="object"||typeof st=="function")){if(et)return $weakMapDelete(et,st)}else if(getSideChannelMap$1&&rt)return rt.delete(st);return!1},get:function(st){return $WeakMap&&st&&(typeof st=="object"||typeof st=="function")&&et?$weakMapGet(et,st):rt&&rt.get(st)},has:function(st){return $WeakMap&&st&&(typeof st=="object"||typeof st=="function")&&et?$weakMapHas(et,st):!!rt&&rt.has(st)},set:function(st,ot){$WeakMap&&st&&(typeof st=="object"||typeof st=="function")?(et||(et=new $WeakMap),$weakMapSet(et,st,ot)):getSideChannelMap$1&&(rt||(rt=getSideChannelMap$1()),rt.set(st,ot))}};return nt}:getSideChannelMap$1,$TypeError=type,inspect=objectInspect,getSideChannelList=sideChannelList,getSideChannelMap=sideChannelMap,getSideChannelWeakMap=sideChannelWeakmap,makeChannel=getSideChannelWeakMap||getSideChannelMap||getSideChannelList,sideChannel=function tt(){var et,rt={assert:function(nt){if(!rt.has(nt))throw new $TypeError("Side channel does not contain "+inspect(nt))},delete:function(nt){return!!et&&et.delete(nt)},get:function(nt){return et&&et.get(nt)},has:function(nt){return!!et&&et.has(nt)},set:function(nt,st){et||(et=makeChannel()),et.set(nt,st)}};return rt},replace=String.prototype.replace,percentTwenties=/%20/g,Format={RFC1738:"RFC1738",RFC3986:"RFC3986"},formats$4={default:Format.RFC3986,formatters:{RFC1738:function(tt){return replace.call(tt,percentTwenties,"+")},RFC3986:function(tt){return String(tt)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986},formats$3=formats$4,has$2=Object.prototype.hasOwnProperty,isArray$2=Array.isArray,hexTable=function(){for(var tt=[],et=0;et<256;++et)tt.push("%"+((et<16?"0":"")+et.toString(16)).toUpperCase());return tt}(),compactQueue=function tt(et){for(;et.length>1;){var rt=et.pop(),nt=rt.obj[rt.prop];if(isArray$2(nt)){for(var st=[],ot=0;ot<nt.length;++ot)typeof nt[ot]<"u"&&st.push(nt[ot]);rt.obj[rt.prop]=st}}},arrayToObject=function tt(et,rt){for(var nt=rt&&rt.plainObjects?{__proto__:null}:{},st=0;st<et.length;++st)typeof et[st]<"u"&&(nt[st]=et[st]);return nt},merge=function tt(et,rt,nt){if(!rt)return et;if(typeof rt!="object"&&typeof rt!="function"){if(isArray$2(et))et.push(rt);else if(et&&typeof et=="object")(nt&&(nt.plainObjects||nt.allowPrototypes)||!has$2.call(Object.prototype,rt))&&(et[rt]=!0);else return[et,rt];return et}if(!et||typeof et!="object")return[et].concat(rt);var st=et;return isArray$2(et)&&!isArray$2(rt)&&(st=arrayToObject(et,nt)),isArray$2(et)&&isArray$2(rt)?(rt.forEach(function(ot,at){if(has$2.call(et,at)){var lt=et[at];lt&&typeof lt=="object"&&ot&&typeof ot=="object"?et[at]=tt(lt,ot,nt):et.push(ot)}else et[at]=ot}),et):Object.keys(rt).reduce(function(ot,at){var lt=rt[at];return has$2.call(ot,at)?ot[at]=tt(ot[at],lt,nt):ot[at]=lt,ot},st)},assign=function tt(et,rt){return Object.keys(rt).reduce(function(nt,st){return nt[st]=rt[st],nt},et)},decode=function(tt,et,rt){var nt=tt.replace(/\+/g," ");if(rt==="iso-8859-1")return nt.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(nt)}catch{return nt}},limit=1024,encode=function tt(et,rt,nt,st,ot){if(et.length===0)return et;var at=et;if(typeof et=="symbol"?at=Symbol.prototype.toString.call(et):typeof et!="string"&&(at=String(et)),nt==="iso-8859-1")return escape(at).replace(/%u[0-9a-f]{4}/gi,function(xt){return"%26%23"+parseInt(xt.slice(2),16)+"%3B"});for(var lt="",ut=0;ut<at.length;ut+=limit){for(var ct=at.length>=limit?at.slice(ut,ut+limit):at,dt=[],ht=0;ht<ct.length;++ht){var mt=ct.charCodeAt(ht);if(mt===45||mt===46||mt===95||mt===126||mt>=48&&mt<=57||mt>=65&&mt<=90||mt>=97&&mt<=122||ot===formats$3.RFC1738&&(mt===40||mt===41)){dt[dt.length]=ct.charAt(ht);continue}if(mt<128){dt[dt.length]=hexTable[mt];continue}if(mt<2048){dt[dt.length]=hexTable[192|mt>>6]+hexTable[128|mt&63];continue}if(mt<55296||mt>=57344){dt[dt.length]=hexTable[224|mt>>12]+hexTable[128|mt>>6&63]+hexTable[128|mt&63];continue}ht+=1,mt=65536+((mt&1023)<<10|ct.charCodeAt(ht)&1023),dt[dt.length]=hexTable[240|mt>>18]+hexTable[128|mt>>12&63]+hexTable[128|mt>>6&63]+hexTable[128|mt&63]}lt+=dt.join("")}return lt},compact=function tt(et){for(var rt=[{obj:{o:et},prop:"o"}],nt=[],st=0;st<rt.length;++st)for(var ot=rt[st],at=ot.obj[ot.prop],lt=Object.keys(at),ut=0;ut<lt.length;++ut){var ct=lt[ut],dt=at[ct];typeof dt=="object"&&dt!==null&&nt.indexOf(dt)===-1&&(rt.push({obj:at,prop:ct}),nt.push(dt))}return compactQueue(rt),et},isRegExp=function tt(et){return Object.prototype.toString.call(et)==="[object RegExp]"},isBuffer=function tt(et){return!et||typeof et!="object"?!1:!!(et.constructor&&et.constructor.isBuffer&&et.constructor.isBuffer(et))},combine=function tt(et,rt){return[].concat(et,rt)},maybeMap=function tt(et,rt){if(isArray$2(et)){for(var nt=[],st=0;st<et.length;st+=1)nt.push(rt(et[st]));return nt}return rt(et)},utils$2={arrayToObject,assign,combine,compact,decode,encode,isBuffer,isRegExp,maybeMap,merge},getSideChannel=sideChannel,utils$1=utils$2,formats$2=formats$4,has$1=Object.prototype.hasOwnProperty,arrayPrefixGenerators={brackets:function tt(et){return et+"[]"},comma:"comma",indices:function tt(et,rt){return et+"["+rt+"]"},repeat:function tt(et){return et}},isArray$1=Array.isArray,push=Array.prototype.push,pushToArray=function(tt,et){push.apply(tt,isArray$1(et)?et:[et])},toISO=Date.prototype.toISOString,defaultFormat=formats$2.default,defaults$2={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:utils$1.encode,encodeValuesOnly:!1,filter:void 0,format:defaultFormat,formatter:formats$2.formatters[defaultFormat],indices:!1,serializeDate:function tt(et){return toISO.call(et)},skipNulls:!1,strictNullHandling:!1},isNonNullishPrimitive=function tt(et){return typeof et=="string"||typeof et=="number"||typeof et=="boolean"||typeof et=="symbol"||typeof et=="bigint"},sentinel={},stringify$1=function tt(et,rt,nt,st,ot,at,lt,ut,ct,dt,ht,mt,xt,yt,vt,Et,bt,St){for(var wt=et,Rt=St,Ct=0,Pt=!1;(Rt=Rt.get(sentinel))!==void 0&&!Pt;){var It=Rt.get(et);if(Ct+=1,typeof It<"u"){if(It===Ct)throw new RangeError("Cyclic object value");Pt=!0}typeof Rt.get(sentinel)>"u"&&(Ct=0)}if(typeof dt=="function"?wt=dt(rt,wt):wt instanceof Date?wt=xt(wt):nt==="comma"&&isArray$1(wt)&&(wt=utils$1.maybeMap(wt,function(Bt){return Bt instanceof Date?xt(Bt):Bt})),wt===null){if(at)return ct&&!Et?ct(rt,defaults$2.encoder,bt,"key",yt):rt;wt=""}if(isNonNullishPrimitive(wt)||utils$1.isBuffer(wt)){if(ct){var jt=Et?rt:ct(rt,defaults$2.encoder,bt,"key",yt);return[vt(jt)+"="+vt(ct(wt,defaults$2.encoder,bt,"value",yt))]}return[vt(rt)+"="+vt(String(wt))]}var Dt=[];if(typeof wt>"u")return Dt;var Vt;if(nt==="comma"&&isArray$1(wt))Et&&ct&&(wt=utils$1.maybeMap(wt,ct)),Vt=[{value:wt.length>0?wt.join(",")||null:void 0}];else if(isArray$1(dt))Vt=dt;else{var Ft=Object.keys(wt);Vt=ht?Ft.sort(ht):Ft}var Ht=ut?String(rt).replace(/\./g,"%2E"):String(rt),Nt=st&&isArray$1(wt)&&wt.length===1?Ht+"[]":Ht;if(ot&&isArray$1(wt)&&wt.length===0)return Nt+"[]";for(var Lt=0;Lt<Vt.length;++Lt){var Mt=Vt[Lt],zt=typeof Mt=="object"&&Mt&&typeof Mt.value<"u"?Mt.value:wt[Mt];if(!(lt&&zt===null)){var Gt=mt&&ut?String(Mt).replace(/\./g,"%2E"):String(Mt),$t=isArray$1(wt)?typeof nt=="function"?nt(Nt,Gt):Nt:Nt+(mt?"."+Gt:"["+Gt+"]");St.set(et,Ct);var Ut=getSideChannel();Ut.set(sentinel,St),pushToArray(Dt,tt(zt,$t,nt,st,ot,at,lt,ut,nt==="comma"&&Et&&isArray$1(wt)?null:ct,dt,ht,mt,xt,yt,vt,Et,bt,Ut))}}return Dt},normalizeStringifyOptions=function tt(et){if(!et)return defaults$2;if(typeof et.allowEmptyArrays<"u"&&typeof et.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof et.encodeDotInKeys<"u"&&typeof et.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(et.encoder!==null&&typeof et.encoder<"u"&&typeof et.encoder!="function")throw new TypeError("Encoder has to be a function.");var rt=et.charset||defaults$2.charset;if(typeof et.charset<"u"&&et.charset!=="utf-8"&&et.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var nt=formats$2.default;if(typeof et.format<"u"){if(!has$1.call(formats$2.formatters,et.format))throw new TypeError("Unknown format option provided.");nt=et.format}var st=formats$2.formatters[nt],ot=defaults$2.filter;(typeof et.filter=="function"||isArray$1(et.filter))&&(ot=et.filter);var at;if(et.arrayFormat in arrayPrefixGenerators?at=et.arrayFormat:"indices"in et?at=et.indices?"indices":"repeat":at=defaults$2.arrayFormat,"commaRoundTrip"in et&&typeof et.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var lt=typeof et.allowDots>"u"?et.encodeDotInKeys===!0?!0:defaults$2.allowDots:!!et.allowDots;return{addQueryPrefix:typeof et.addQueryPrefix=="boolean"?et.addQueryPrefix:defaults$2.addQueryPrefix,allowDots:lt,allowEmptyArrays:typeof et.allowEmptyArrays=="boolean"?!!et.allowEmptyArrays:defaults$2.allowEmptyArrays,arrayFormat:at,charset:rt,charsetSentinel:typeof et.charsetSentinel=="boolean"?et.charsetSentinel:defaults$2.charsetSentinel,commaRoundTrip:!!et.commaRoundTrip,delimiter:typeof et.delimiter>"u"?defaults$2.delimiter:et.delimiter,encode:typeof et.encode=="boolean"?et.encode:defaults$2.encode,encodeDotInKeys:typeof et.encodeDotInKeys=="boolean"?et.encodeDotInKeys:defaults$2.encodeDotInKeys,encoder:typeof et.encoder=="function"?et.encoder:defaults$2.encoder,encodeValuesOnly:typeof et.encodeValuesOnly=="boolean"?et.encodeValuesOnly:defaults$2.encodeValuesOnly,filter:ot,format:nt,formatter:st,serializeDate:typeof et.serializeDate=="function"?et.serializeDate:defaults$2.serializeDate,skipNulls:typeof et.skipNulls=="boolean"?et.skipNulls:defaults$2.skipNulls,sort:typeof et.sort=="function"?et.sort:null,strictNullHandling:typeof et.strictNullHandling=="boolean"?et.strictNullHandling:defaults$2.strictNullHandling}},stringify_1=function(tt,et){var rt=tt,nt=normalizeStringifyOptions(et),st,ot;typeof nt.filter=="function"?(ot=nt.filter,rt=ot("",rt)):isArray$1(nt.filter)&&(ot=nt.filter,st=ot);var at=[];if(typeof rt!="object"||rt===null)return"";var lt=arrayPrefixGenerators[nt.arrayFormat],ut=lt==="comma"&&nt.commaRoundTrip;st||(st=Object.keys(rt)),nt.sort&&st.sort(nt.sort);for(var ct=getSideChannel(),dt=0;dt<st.length;++dt){var ht=st[dt],mt=rt[ht];nt.skipNulls&&mt===null||pushToArray(at,stringify$1(mt,ht,lt,ut,nt.allowEmptyArrays,nt.strictNullHandling,nt.skipNulls,nt.encodeDotInKeys,nt.encode?nt.encoder:null,nt.filter,nt.sort,nt.allowDots,nt.serializeDate,nt.format,nt.formatter,nt.encodeValuesOnly,nt.charset,ct))}var xt=at.join(nt.delimiter),yt=nt.addQueryPrefix===!0?"?":"";return nt.charsetSentinel&&(nt.charset==="iso-8859-1"?yt+="utf8=%26%2310003%3B&":yt+="utf8=%E2%9C%93&"),xt.length>0?yt+xt:""},utils=utils$2,has=Object.prototype.hasOwnProperty,isArray=Array.isArray,defaults$1={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:utils.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},interpretNumericEntities=function(tt){return tt.replace(/&#(\d+);/g,function(et,rt){return String.fromCharCode(parseInt(rt,10))})},parseArrayValue=function(tt,et){return tt&&typeof tt=="string"&&et.comma&&tt.indexOf(",")>-1?tt.split(","):tt},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function tt(et,rt){var nt={__proto__:null},st=rt.ignoreQueryPrefix?et.replace(/^\?/,""):et;st=st.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var ot=rt.parameterLimit===1/0?void 0:rt.parameterLimit,at=st.split(rt.delimiter,ot),lt=-1,ut,ct=rt.charset;if(rt.charsetSentinel)for(ut=0;ut<at.length;++ut)at[ut].indexOf("utf8=")===0&&(at[ut]===charsetSentinel?ct="utf-8":at[ut]===isoSentinel&&(ct="iso-8859-1"),lt=ut,ut=at.length);for(ut=0;ut<at.length;++ut)if(ut!==lt){var dt=at[ut],ht=dt.indexOf("]="),mt=ht===-1?dt.indexOf("="):ht+1,xt,yt;mt===-1?(xt=rt.decoder(dt,defaults$1.decoder,ct,"key"),yt=rt.strictNullHandling?null:""):(xt=rt.decoder(dt.slice(0,mt),defaults$1.decoder,ct,"key"),yt=utils.maybeMap(parseArrayValue(dt.slice(mt+1),rt),function(Et){return rt.decoder(Et,defaults$1.decoder,ct,"value")})),yt&&rt.interpretNumericEntities&&ct==="iso-8859-1"&&(yt=interpretNumericEntities(String(yt))),dt.indexOf("[]=")>-1&&(yt=isArray(yt)?[yt]:yt);var vt=has.call(nt,xt);vt&&rt.duplicates==="combine"?nt[xt]=utils.combine(nt[xt],yt):(!vt||rt.duplicates==="last")&&(nt[xt]=yt)}return nt},parseObject=function(tt,et,rt,nt){for(var st=nt?et:parseArrayValue(et,rt),ot=tt.length-1;ot>=0;--ot){var at,lt=tt[ot];if(lt==="[]"&&rt.parseArrays)at=rt.allowEmptyArrays&&(st===""||rt.strictNullHandling&&st===null)?[]:[].concat(st);else{at=rt.plainObjects?{__proto__:null}:{};var ut=lt.charAt(0)==="["&&lt.charAt(lt.length-1)==="]"?lt.slice(1,-1):lt,ct=rt.decodeDotInKeys?ut.replace(/%2E/g,"."):ut,dt=parseInt(ct,10);!rt.parseArrays&&ct===""?at={0:st}:!isNaN(dt)&&lt!==ct&&String(dt)===ct&&dt>=0&&rt.parseArrays&&dt<=rt.arrayLimit?(at=[],at[dt]=st):ct!=="__proto__"&&(at[ct]=st)}st=at}return st},parseKeys=function tt(et,rt,nt,st){if(et){var ot=nt.allowDots?et.replace(/\.([^.[]+)/g,"[$1]"):et,at=/(\[[^[\]]*])/,lt=/(\[[^[\]]*])/g,ut=nt.depth>0&&at.exec(ot),ct=ut?ot.slice(0,ut.index):ot,dt=[];if(ct){if(!nt.plainObjects&&has.call(Object.prototype,ct)&&!nt.allowPrototypes)return;dt.push(ct)}for(var ht=0;nt.depth>0&&(ut=lt.exec(ot))!==null&&ht<nt.depth;){if(ht+=1,!nt.plainObjects&&has.call(Object.prototype,ut[1].slice(1,-1))&&!nt.allowPrototypes)return;dt.push(ut[1])}if(ut){if(nt.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+nt.depth+" and strictDepth is true");dt.push("["+ot.slice(ut.index)+"]")}return parseObject(dt,rt,nt,st)}},normalizeParseOptions=function tt(et){if(!et)return defaults$1;if(typeof et.allowEmptyArrays<"u"&&typeof et.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof et.decodeDotInKeys<"u"&&typeof et.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(et.decoder!==null&&typeof et.decoder<"u"&&typeof et.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof et.charset<"u"&&et.charset!=="utf-8"&&et.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var rt=typeof et.charset>"u"?defaults$1.charset:et.charset,nt=typeof et.duplicates>"u"?defaults$1.duplicates:et.duplicates;if(nt!=="combine"&&nt!=="first"&&nt!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var st=typeof et.allowDots>"u"?et.decodeDotInKeys===!0?!0:defaults$1.allowDots:!!et.allowDots;return{allowDots:st,allowEmptyArrays:typeof et.allowEmptyArrays=="boolean"?!!et.allowEmptyArrays:defaults$1.allowEmptyArrays,allowPrototypes:typeof et.allowPrototypes=="boolean"?et.allowPrototypes:defaults$1.allowPrototypes,allowSparse:typeof et.allowSparse=="boolean"?et.allowSparse:defaults$1.allowSparse,arrayLimit:typeof et.arrayLimit=="number"?et.arrayLimit:defaults$1.arrayLimit,charset:rt,charsetSentinel:typeof et.charsetSentinel=="boolean"?et.charsetSentinel:defaults$1.charsetSentinel,comma:typeof et.comma=="boolean"?et.comma:defaults$1.comma,decodeDotInKeys:typeof et.decodeDotInKeys=="boolean"?et.decodeDotInKeys:defaults$1.decodeDotInKeys,decoder:typeof et.decoder=="function"?et.decoder:defaults$1.decoder,delimiter:typeof et.delimiter=="string"||utils.isRegExp(et.delimiter)?et.delimiter:defaults$1.delimiter,depth:typeof et.depth=="number"||et.depth===!1?+et.depth:defaults$1.depth,duplicates:nt,ignoreQueryPrefix:et.ignoreQueryPrefix===!0,interpretNumericEntities:typeof et.interpretNumericEntities=="boolean"?et.interpretNumericEntities:defaults$1.interpretNumericEntities,parameterLimit:typeof et.parameterLimit=="number"?et.parameterLimit:defaults$1.parameterLimit,parseArrays:et.parseArrays!==!1,plainObjects:typeof et.plainObjects=="boolean"?et.plainObjects:defaults$1.plainObjects,strictDepth:typeof et.strictDepth=="boolean"?!!et.strictDepth:defaults$1.strictDepth,strictNullHandling:typeof et.strictNullHandling=="boolean"?et.strictNullHandling:defaults$1.strictNullHandling}},parse$1=function(tt,et){var rt=normalizeParseOptions(et);if(tt===""||tt===null||typeof tt>"u")return rt.plainObjects?{__proto__:null}:{};for(var nt=typeof tt=="string"?parseValues(tt,rt):tt,st=rt.plainObjects?{__proto__:null}:{},ot=Object.keys(nt),at=0;at<ot.length;++at){var lt=ot[at],ut=parseKeys(lt,nt[lt],rt,typeof tt=="string");st=utils.merge(st,ut,rt)}return rt.allowSparse===!0?st:utils.compact(st)},stringify=stringify_1,parse=parse$1,formats$1=formats$4,lib={formats:formats$1,parse,stringify},punycode=punycodeExports;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r",`
@@ -1390,7 +1390,7 @@ void main()
1390
1390
  font-weight: ${rt.weight};
1391
1391
  font-style: ${rt.style};
1392
1392
  font-display: ${rt.display};
1393
- }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(et){this._stylesheet!==et&&(this._stylesheet=et,this.styleID++)}normalizeColor(et){return Array.isArray(et)&&(et=rgb2hex(et)),typeof et=="number"?hex2string(et):et}dropShadowToCSS(){let et=this.normalizeColor(this.dropShadowColor);const rt=this.dropShadowAlpha,nt=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),st=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);et.startsWith("#")&&rt<1&&(et+=(rt*255|0).toString(16).padStart(2,"0"));const ot=`${nt}px ${st}px`;return this.dropShadowBlur>0?`text-shadow: ${ot} ${this.dropShadowBlur}px ${et}`:`text-shadow: ${ot} ${et}`}reset(){Object.assign(this,Hl.defaultOptions)}onBeforeDraw(){const{fontsDirty:et}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&et?new Promise(rt=>setTimeout(rt,100)):Promise.resolve()}get isSafari(){const{userAgent:et}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(et)}set fillGradientStops(et){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(et){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(et){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(et){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(et){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(et){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(et){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_HTMLTextStyle.availableFonts={},_HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let HTMLTextStyle=_HTMLTextStyle;const _HTMLText=class Vl extends Sprite{constructor(et="",rt={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const nt=new Image,st=Texture.from(nt,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});st.orig=new Rectangle,st.trim=new Rectangle,this.texture=st;const ot="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",lt=document.createElementNS(ot,"svg"),ut=document.createElementNS(ot,"foreignObject"),ct=document.createElementNS(at,"div"),dt=document.createElementNS(at,"style");ut.setAttribute("width","10000"),ut.setAttribute("height","10000"),ut.style.overflow="hidden",lt.appendChild(ut),this.maxWidth=Vl.defaultMaxWidth,this.maxHeight=Vl.defaultMaxHeight,this._domElement=ct,this._styleElement=dt,this._svgRoot=lt,this._foreignObject=ut,this._foreignObject.appendChild(dt),this._foreignObject.appendChild(ct),this._image=nt,this._loadImage=new Image,this._autoResolution=Vl.defaultAutoResolution,this._resolution=Vl.defaultResolution??settings.RESOLUTION,this.text=et,this.style=rt}measureText(et){var dt,ht;const{text:rt,style:nt,resolution:st}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},et);Object.assign(this._domElement,{innerHTML:rt,style:nt.toCSS(st)}),this._styleElement.textContent=nt.toGlobalCSS(),document.body.appendChild(this._svgRoot);const ot=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:at,height:lt}=ot;(at>this.maxWidth||lt>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const ut=Math.min(this.maxWidth,Math.ceil(at)),ct=Math.min(this.maxHeight,Math.ceil(lt));return this._svgRoot.setAttribute("width",ut.toString()),this._svgRoot.setAttribute("height",ct.toString()),rt!==this._text&&(this._domElement.innerHTML=this._text),nt!==this._style&&(Object.assign(this._domElement,{style:(dt=this._style)==null?void 0:dt.toCSS(st)}),this._styleElement.textContent=(ht=this._style)==null?void 0:ht.toGlobalCSS()),{width:ut+nt.padding*2,height:ct+nt.padding*2}}async updateText(et=!0){const{style:rt,_image:nt,_loadImage:st}=this;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;const{width:ot,height:at}=this.measureText();nt.width=st.width=Math.ceil(Math.max(1,ot)),nt.height=st.height=Math.ceil(Math.max(1,at)),this._updateID++;const lt=this._updateID;await new Promise(ut=>{st.onload=async()=>{if(lt<this._updateID){ut();return}await rt.onBeforeDraw(),nt.src=st.src,st.onload=null,st.src="",this.updateTexture(),ut()};const ct=new XMLSerializer().serializeToString(this._svgRoot);st.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ct)}`})}get source(){return this._image}updateTexture(){const{style:et,texture:rt,_image:nt,resolution:st}=this,{padding:ot}=et,{baseTexture:at}=rt;rt.trim.width=rt._frame.width=nt.width/st,rt.trim.height=rt._frame.height=nt.height/st,rt.trim.x=-ot,rt.trim.y=-ot,rt.orig.width=rt._frame.width-ot*2,rt.orig.height=rt._frame.height-ot*2,this._onTextureUpdate(),at.setRealSize(nt.width,nt.height,st),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}_renderCanvas(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(et)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds(et)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(et){var nt,st,ot,at,lt;typeof et=="boolean"&&(et={children:et}),et=Object.assign({},Vl.defaultDestroyOptions,et),super.destroy(et);const rt=null;this.ownsStyle&&((nt=this._style)==null||nt.cleanFonts()),this._style=rt,(st=this._svgRoot)==null||st.remove(),this._svgRoot=rt,(ot=this._domElement)==null||ot.remove(),this._domElement=rt,(at=this._foreignObject)==null||at.remove(),this._foreignObject=rt,(lt=this._styleElement)==null||lt.remove(),this._styleElement=rt,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=rt,this._image.src="",this._image=rt}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._image.width/this.resolution,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._image.height/this.resolution,this._height=et}get style(){return this._style}set style(et){this._style!==et&&(et=et||{},et instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=et):et instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(et)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(et)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(et){et=String(et===""||et===null||et===void 0?" ":et),et=this.sanitiseText(et),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}sanitiseText(et){return et.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};_HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_HTMLText.defaultMaxWidth=2024,_HTMLText.defaultMaxHeight=2024,_HTMLText.defaultAutoResolution=!0;const MIN_HEIGHT=100,MIN_WIDTH=100,MODAL_VERTICAL_PADDING=450,MODAL_HORIZONTAL_PADDING=64,DEFAULT_QUALITY=.5,DEFAULT_SPRITE_NAME="image";function updateImageFromBlob(tt,{spriteName:et,imgDatasource:rt,settings:nt}){const st=URL.createObjectURL(rt),ot=new Image;return ot.src=st,new Promise(at=>{ot.onload=async()=>{await updateImage(tt,{spriteName:et,imgDatasource:ot,settings:nt});const lt=tt==null?void 0:tt.stage.getChildByName(et,!0);at(lt)}})}async function updateImage(tt,{spriteName:et,imgDatasource:rt,settings:nt}){if(tt===void 0||tt.stage===null)return;const st=tt.stage.getChildByName(et,!0);st==null||st.removeFromParent();const ot=rt instanceof HTMLImageElement?Texture.from(rt):rt instanceof Sprite?rt:await Texture.fromURL(rt),at=ot instanceof Sprite?ot:Sprite.from(ot,{});if(at.interactive=!0,at.name=et,nt){const{sprite:{anchor:lt,position:ut,scale:ct,size:dt,rotation:ht},stage:{size:mt}}=nt,xt=ht%Math.PI!==0;at.anchor.x=lt.x,at.anchor.y=lt.y,at.position.x=ut.x,at.position.y=ut.y,at.scale.x=ct.x,at.scale.y=ct.y,at.width=xt?dt.height:dt.width,at.height=xt?dt.width:dt.height,tt.stage.height=mt.height,tt.stage.width=mt.width,tt.renderer.resize(mt.width,mt.height),tt.stage.addChild(at)}else tt.stage.addChild(at),tt.renderer.resize(at.width,at.height);autoResize(tt,at)}function autoResize(tt,et){var rt;const nt=tt.view.parentNode,st=window.innerWidth-MODAL_HORIZONTAL_PADDING,ot=Math.max((nt==null?void 0:nt.offsetWidth)??0,MIN_WIDTH),at=constraintSize({width:et.width,height:et.height},{width:{max:Math.min(ot,st),min:MIN_WIDTH},height:{min:MIN_HEIGHT,max:window.innerHeight-MODAL_VERTICAL_PADDING}}),{height:lt,width:ut}=at;(rt=tt.view)!=null&&rt.style&&(tt.view.style.width=`${ut}px`,tt.view.style.height=`${lt}px`)}function constraintSize(tt,et){const{height:rt,width:nt}=tt,st=nt/rt,{height:ot,width:at}=et;let lt=at.max,ut=at.max/st;return nt>at.max&&(lt=at.max,ut=lt/st),ut>ot.max&&(ut=ot.max,lt=ut*st),lt<at.min&&(lt=at.min,ut=lt/st),ut<ot.min&&(ut=ot.min,lt=ut*st),{width:lt,height:ut}}function saveAsBlob(tt){return new Promise((et,rt)=>{var nt;(nt=tt==null?void 0:tt.view)!=null&&nt.toBlob?tt.view.toBlob(st=>{st?et(st):rt("EXTRACT_FAILED")},"image/jpeg",DEFAULT_QUALITY):rt("EXTRACT_FAILED")})}function saveAsDataURL(tt){var et,rt;return(rt=(et=tt.view).toDataURL)==null?void 0:rt.call(et)}function getApplicationScale(tt){return tt.view.getBoundingClientRect?tt.view.getBoundingClientRect().width/tt.view.width:1}function toBlob(tt){return new Promise((et,rt)=>{var nt,st;(st=(nt=tt.view).toBlob)==null||st.call(nt,ot=>{ot?et(ot):rt("EXTRACT_FAIL")},"image/png",1)})}function createImageSettings({application:tt,sprite:et}){return{sprite:{rotation:et.rotation,size:{width:et.width,height:et.height},position:{x:et.position.x,y:et.position.y},scale:{x:et.scale.x,y:et.scale.y},anchor:{x:et.anchor.x,y:et.anchor.y}},stage:{size:{width:tt.stage.width,height:tt.stage.height},scale:{x:tt.stage.scale.x,y:tt.stage.scale.y}}}}function resizeStage({application:tt,sprite:et,newHeight:rt,newWidth:nt}){et.anchor.x=.5,et.anchor.y=.5,et.position=new Point(nt/2,rt/2),tt.stage.height=rt,tt.stage.width=nt,tt.renderer.resize(nt,rt)}const DEFAULT_MAX_HISTORY=20,useHistoryTool=({maxSize:tt=DEFAULT_MAX_HISTORY,application:et,spriteName:rt,onRestore:nt})=>{const[st,ot]=reactExports.useState([]);reactExports.useEffect(()=>{ot([])},[et]);const at=async()=>{const ct=st.pop();ct&&(nt(await ct.backup,ct),ot(st.filter(dt=>dt!==ct)))},lt=ct=>(ct.length>tt&&ct.splice(0,ct.length-tt),ct),ut=async ct=>{{if(!et)return;const dt=et.stage.getChildByName(rt,!0);if(dt==null)return;const ht=toBlob(et),mt={backup:ht,sprite:{rotation:dt.rotation,size:{width:dt.width,height:dt.height},position:{x:dt.position.x,y:dt.position.y},scale:{x:dt.scale.x,y:dt.scale.y},anchor:{x:dt.anchor.x,y:dt.anchor.y}},stage:{size:{width:et.stage.width,height:et.stage.height},scale:{x:et.stage.scale.x,y:et.stage.scale.y}}};return ot([...lt(st),mt]),await ht,ct.call(ct)}};return{historyCount:st.length,restore:at,historize:ut}};function aggregate(tt,et,rt){let nt;const st=[];return function(ot){st.push(et(ot)),!nt&&(nt=setTimeout(()=>{const at=[...st];st.splice(0,st.length),rt(at),nt=void 0},tt))}}const BRUSH_SIZE=20,DEBOUNCE=50,CURSOR_NAME="BRUSH_CURSOR";function drawBrush(tt,et){const rt=new Graphics;for(const nt of tt)nt&&(rt.beginFill(16777215,1),rt.drawCircle(nt.x,nt.y,BRUSH_SIZE/et),rt.lineStyle(0),rt.endFill());return rt}function drawBlurListener(tt,{spriteName:et}){return aggregate(DEBOUNCE,rt=>tt.stage.toLocal(rt.global),rt=>{const nt=tt.stage.getChildByName(et),st=getApplicationScale(tt);if(nt==null)return;const ot=new Sprite(nt.texture);ot.filters=[new BlurFilter(8,4,Math.min(st,1))],ot.width=nt.width,ot.height=nt.height,ot.scale=new Point(1,1),ot.anchor=nt.anchor,ot.mask=drawBrush(rt,st),nt.addChild(ot)})}function drawCursor(tt){removeCursor(tt);const et=getApplicationScale(tt),rt=new Graphics;return rt.lineStyle(Math.max(1,1/et),16711680),rt.drawCircle(0,0,BRUSH_SIZE/et),rt.endFill(),rt.name=CURSOR_NAME,tt.stage.addChild(rt),rt}function removeCursor(tt){const et=tt.stage.getChildByName(CURSOR_NAME);et&&et.removeFromParent()}function moveCursorListener(tt){return et=>{if(!tt)return;const rt=tt.stage.toLocal(et.global),nt=tt.stage.getChildByName(CURSOR_NAME,!0);nt&&(nt.position.x=rt.x,nt.position.y=rt.y)}}function start$2(tt,{spriteName:et}){tt.stage.interactive=!0;const rt=drawCursor(tt),nt=moveCursorListener(tt);tt.stage.on("pointermove",nt);const st=drawBlurListener(tt,{spriteName:et});tt.stage.on("pointerdown",()=>{tt.stage.on("pointermove",st)});const ot=()=>{var at;(at=tt==null?void 0:tt.stage)==null||at.off("pointermove",st)};globalThis.addEventListener("pointerup",ot),rt.once("destroyed",()=>{globalThis.removeEventListener("pointerup",ot)})}function stop$2(tt){removeCursor(tt),tt.stage.off("pointerdown"),tt.stage.off("pointermove")}const CORNERS=["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"],PADDING=0,POINT_RADIUS$1=20,CROP_BACKGROUND_NAME="CROP_BACKGROUND_NAME",CROP_MASK_NAME="CROP_MASK_NAME";function getCornerName$1(tt){return"CROP_CORNER_"+tt}function drawBackground(tt,{spriteName:et}){removeBackground(tt);const rt=tt.stage.getChildByName(et);if(rt==null)return;const nt=rt.getBounds(),st=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(st);ot.height=nt.height,ot.width=nt.width,ot.position=new Point(0,0);const at=new Graphics;at.beginFill(16777215,.5),at.drawRect(0,0,nt.width,nt.height),at.endFill(),at.name=CROP_BACKGROUND_NAME,at.position=new Point(nt.x,nt.y);const lt=new Graphics;lt.beginFill(0,1),lt.drawRect(0,0,nt.width-2*PADDING,nt.height-2*PADDING),lt.endFill(),lt.position=new Point(PADDING,PADDING),lt.name=CROP_MASK_NAME,ot.mask=lt,tt.stage.addChild(at),at.addChild(lt),at.addChild(ot)}function removeBackground(tt){const et=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0);et==null||et.removeFromParent()}function computeCornerPosition$1(tt,et){switch(tt){case"TOP_LEFT":return{x:et.x,y:et.y,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:et.x+et.width,y:et.y,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:et.x,y:et.y+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:et.x+et.width,y:et.y+et.height,start:Math.PI,end:3*Math.PI/2}}}function refreshCorners(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);et!=null&&CORNERS.forEach(rt=>{const nt=tt.stage.getChildByName(getCornerName$1(rt),!0);if(nt==null)return;const st=computeCornerPosition$1(rt,{height:et.height,width:et.width,x:et.x,y:et.y});nt.position=new Point(st.x,st.y)})}function drawCorner$1(tt,et,{spriteName:rt}){const nt=tt.stage.getChildByName(getCornerName$1(et),!0),st=getApplicationScale(tt);nt==null||nt.removeFromParent();const ot=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0),at=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(tt.stage.getChildByName(rt)==null||ot===null||ot===void 0||at===void 0||at===null)return;const ut=computeCornerPosition$1(et,{height:at.height,width:at.width,x:at.x,y:at.y}),ct=new Graphics;ct.beginFill(4960213,1),ct.arc(0,0,POINT_RADIUS$1/st,ut.start,ut.end),ct.lineTo(0,0),ct.endFill(),ct.position=new Point(ut.x,ut.y),ct.name=getCornerName$1(et),ct.interactive=!0;let dt=!1;tt.stage.on("pointermove",xt=>{if(dt===!1)return;const yt=ot.toLocal(xt.global);ct.position.x=yt.x,ct.position.y=yt.y,moveMask(tt,et,yt)});const ht=()=>{dt=!0};ct.on("pointerdown",ht);const mt=()=>{dt=!1};globalThis.addEventListener("pointerup",mt),ct.once("destroyed",()=>{ct.off("pointerdown"),globalThis.removeEventListener("pointerup",mt)}),ot.addChild(ct)}function moveMask(tt,et,rt){const nt=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(nt==null)return;const st=nt.position.x+nt.width,ot=nt.position.y+nt.height;switch(et){case"TOP_LEFT":{nt.position.x=rt.x,nt.position.y=rt.y,nt.width=st-rt.x,nt.height=ot-rt.y;break}case"TOP_RIGHT":{nt.position.y=rt.y,nt.width=rt.x-nt.position.x,nt.height=ot-rt.y;break}case"BOTTOM_LEFT":{nt.position.x=rt.x,nt.width=st-rt.x,nt.height=rt.y-nt.position.y;break}case"BOTTOM_RIGHT":{nt.width=rt.x-nt.position.x,nt.height=rt.y-nt.position.y;break}}refreshCorners(tt)}function start$1(tt,{spriteName:et}){stop$1(tt),tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,drawBackground(tt,{spriteName:et}),drawCorner$1(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner$1(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner$1(tt,"TOP_LEFT",{spriteName:et}),drawCorner$1(tt,"TOP_RIGHT",{spriteName:et})}function stop$1(tt){removeBackground(tt),tt.stage.off("pointermove"),tt.render()}function save$1(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(et==null)return;stop$1(tt);const rt=tt.renderer.generateTexture(tt.stage).clone(),nt=new Sprite(rt),st=et.getBounds(),ot=new Rectangle(Math.floor(st.x),Math.floor(st.y),Math.floor(st.width),Math.floor(st.height)),at=new Texture(nt.texture.baseTexture,ot);return new Sprite(at)}const POINT_RADIUS=20,CONTROL_NAME="CONTROL_NAME";function getCornerName(tt){return"RESIZE_CORNER_"+tt}function computeCornerPosition(tt,et){const rt=et.x,nt=et.y;switch(tt){case"TOP_LEFT":return{x:rt,y:nt,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:rt+et.width,y:nt,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:rt,y:nt+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:rt+et.width,y:nt+et.height,start:Math.PI,end:3*Math.PI/2}}}function resizeContainer(tt,{container:et,cornerType:rt,position:nt,spriteName:st}){const ot=tt.stage.getChildByName(st,!0);if(ot==null)return;const at=ot.rotation%Math.PI!==0,lt=at?ot.height:ot.width,ut=at?ot.width:ot.height;switch(rt){case"TOP_LEFT":{et.position=new Point(nt.x,nt.y),et.width=lt-2*nt.x,et.height=ut-2*nt.y;break}case"TOP_RIGHT":{const ct=lt-nt.x;et.position=new Point(ct,nt.y),et.width=lt-2*ct,et.height=ut-2*nt.y;break}case"BOTTOM_LEFT":{const ct=ut-nt.y;et.position=new Point(nt.x,ct),et.width=lt-2*nt.x,et.height=ut-2*ct;break}case"BOTTOM_RIGHT":{const ct=ut-nt.y,dt=lt-nt.x;et.position=new Point(dt,ct),et.width=lt-2*dt,et.height=ut-2*ct;break}}}function removeCorner(tt,et){const rt=tt.stage.getChildByName(getCornerName(et),!0);rt==null||rt.removeFromParent()}function drawCorner(tt,et,{spriteName:rt}){removeCorner(tt,et);const nt=tt.stage.getChildByName(rt,!0),st=tt.stage.getChildByName(CONTROL_NAME,!0);if(nt==null||st===null||st===void 0)return;const ot=computeCornerPosition(et,st),at=new Graphics;at.beginFill(4960213,1),at.arc(0,0,POINT_RADIUS,ot.start,ot.end),at.lineTo(0,0),at.endFill(),at.position=new Point(ot.x,ot.y),at.name=getCornerName(et),at.interactive=!0;let lt=!1;tt.stage.on("pointermove",dt=>{if(lt===!1)return;const ht=tt.stage.toLocal(dt.global);resizeContainer(tt,{cornerType:et,position:ht,container:st,spriteName:rt})});const ut=()=>{lt=!1};globalThis.addEventListener("pointerup",ut),at.once("destroyed",()=>{at.off("pointerdown"),globalThis.removeEventListener("pointerup",ut)});const ct=()=>{lt=!0};at.on("pointerdown",ct),st.addChild(at)}function drawContainer(tt,et){removeContainer(tt);const rt=tt.stage.getChildByName(et,!0);if(rt==null)return;const nt=tt.renderer.generateTexture(tt.stage),st=new Sprite(nt);tt.stage.children.forEach(at=>{at.alpha=0});const ot=new Graphics;ot.drawRect(0,0,rt.width,rt.height),ot.name=CONTROL_NAME,ot.interactive=!0,ot.interactiveChildren=!0,tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,tt.stage.addChild(ot),ot.addChild(st)}function removeContainer(tt){const et=tt.stage.getChildByName(CONTROL_NAME,!0);et==null||et.removeFromParent(),tt.stage.children.forEach(rt=>{rt.alpha=1})}function drawControl(tt,et){drawContainer(tt,et),drawCorner(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner(tt,"TOP_LEFT",{spriteName:et}),drawCorner(tt,"TOP_RIGHT",{spriteName:et})}function removeControl(tt){removeContainer(tt),removeCorner(tt,"BOTTOM_LEFT"),removeCorner(tt,"BOTTOM_RIGHT"),removeCorner(tt,"TOP_LEFT"),removeCorner(tt,"TOP_RIGHT"),tt.stage.off("pointermove")}function start(tt,et){drawControl(tt,et)}function stop(tt){removeControl(tt),tt.stage.off("pointermove"),tt.render()}function save(tt){var et;const rt=(et=tt==null?void 0:tt.stage)==null?void 0:et.getChildByName(CONTROL_NAME,!0),nt=rt?{height:rt.height,width:rt.width}:void 0;if(removeControl(tt),nt){const st=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(st);return ot.width=nt.width,ot.height=nt.height,ot}else return}async function rotate(tt,et){const rt=tt==null?void 0:tt.stage.getChildByName(et,!0);if(tt&&rt){if(!tt)return;const nt=await toBlob(tt),st=await updateImageFromBlob(tt,{imgDatasource:nt,spriteName:et,settings:createImageSettings({application:tt,sprite:rt})});if(!st)return;let ot,at;const lt=tt.view;lt.style&&(ot=lt.style.maxHeight??"",at=lt.style.visibility??"",lt.style.maxHeight=`${lt.clientHeight}px`,lt.style.visibility="hidden"),st.rotation+=Math.PI/2,resizeStage({application:tt,sprite:st,newHeight:st.width,newWidth:st.height}),tt.render();const ut=await toBlob(tt);ot!==void 0&&(lt.style.maxHeight=ot),at!==void 0&&(lt.style.visibility=at),await updateImageFromBlob(tt,{imgDatasource:ut,spriteName:et})}}function useImageEffects({application:tt,spriteName:et,onSave:rt}){return{rotate:async()=>{tt&&await rotate(tt,et)},startCrop:()=>{tt&&start$1(tt,{spriteName:et})},stopCrop:nt=>{if(tt){if(nt){const st=save$1(tt);st&&rt(st)}stop$1(tt)}},startBlur:()=>{tt&&start$2(tt,{spriteName:et})},stopBlur:()=>{tt&&stop$2(tt)},startResize:()=>{tt&&start(tt,et)},stopResize:nt=>{if(tt){if(nt){const st=save(tt);st&&rt(st)}stop(tt)}}}}function useImageEditor({imageSrc:tt,spriteName:et=DEFAULT_SPRITE_NAME}){const[rt,nt]=reactExports.useState(void 0),[st,ot]=reactExports.useState(!0),{rotate:at,startBlur:lt,startCrop:ut,startResize:ct,stopBlur:dt,stopCrop:ht,stopResize:mt}=useImageEffects({spriteName:et,application:rt,onSave(St){rt&&updateImage(rt,{imgDatasource:St,spriteName:et})}}),xt=()=>rt?saveAsBlob(rt):Promise.resolve(void 0),yt=()=>{if(rt)return saveAsDataURL(rt)},{restore:vt,historize:Et,historyCount:bt}=useHistoryTool({application:rt,spriteName:et,onRestore(St,wt){rt&&updateImageFromBlob(rt,{imgDatasource:St,spriteName:et,settings:wt})}});return reactExports.useEffect(()=>{rt&&(ot(!0),updateImage(rt,{spriteName:et,imgDatasource:tt}).finally(()=>ot(!1)))},[rt,tt,et]),{historyCount:bt,setApplication:nt,restore:vt,stopCrop:ht,stopBlur:dt,stopResize:mt,startResize:async()=>{ot(!0),await Et(ct),ot(!1)},startCrop:async()=>{ot(!0),await Et(ut),ot(!1)},startBlur:async()=>{ot(!0),await Et(lt),ot(!1)},rotate:async()=>{ot(!0),await Et(at),ot(!1)},toBlob:xt,toDataURL:yt,loading:st}}const SvgIconBlur=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-blur_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M17.504 1.673a1 1 0 0 1 .932.491c.37.63.9 1.935 1.404 3.18l.08.197c.502 1.24.994 2.457 1.369 3.205l-.895.447.895-.447c.561 1.122 1.962 4.049 2.136 6.753.087 1.364-.125 2.839-1.094 3.978-.987 1.16-2.573 1.76-4.757 1.76-2.186 0-3.777-.6-4.777-1.752-.983-1.134-1.221-2.604-1.152-3.973.138-2.711 1.514-5.636 2.13-6.79.86-1.611 2.414-5.32 2.874-6.433a1 1 0 0 1 .855-.616m.104 3.492c-.657 1.533-1.496 3.425-2.07 4.5-.59 1.106-1.781 3.703-1.895 5.949-.057 1.11.158 1.976.665 2.56.49.565 1.427 1.063 3.266 1.063 1.84 0 2.76-.498 3.233-1.055.492-.579.694-1.44.622-2.555-.145-2.253-1.36-4.848-1.929-5.986-.412-.823-.932-2.108-1.417-3.308l-.097-.238q-.196-.487-.378-.93M12.843 22.535a1 1 0 0 1-1.034.964l-.259-.009a1 1 0 0 1-.257-.042q-.125.029-.26.024l-.257-.009a11 11 0 0 1-2.102-.279 1 1 0 0 1 .457-1.947 9 9 0 0 0 1.715.228l.258.009q.134.004.257.042.125-.028.26-.024l.257.009a1 1 0 0 1 .965 1.034m-6.615-1.329a1 1 0 0 1-1.396.226 10.9 10.9 0 0 1-2.877-3.086 1 1 0 1 1 1.7-1.054 8.9 8.9 0 0 0 2.347 2.518 1 1 0 0 1 .226 1.396M1.622 15.22a1 1 0 0 1-1.147-.827 10.9 10.9 0 0 1 .148-4.218 1 1 0 0 1 1.947.457 8.9 8.9 0 0 0-.12 3.441 1 1 0 0 1-.828 1.147m.978-7.49a1 1 0 0 1-.226-1.397A10.9 10.9 0 0 1 5.46 3.455a1 1 0 0 1 1.054 1.7 8.9 8.9 0 0 0-2.518 2.347 1 1 0 0 1-1.396.226m5.988-4.607a1 1 0 0 1 .827-1.147 11 11 0 0 1 2.116-.132l.258.01q.135.004.257.042.125-.03.26-.025l.258.01a1 1 0 0 1-.07 1.998l-.258-.009a1 1 0 0 1-.258-.043q-.125.03-.259.025l-.258-.009a9 9 0 0 0-1.727.108 1 1 0 0 1-1.146-.828"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-blur_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconCrop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-crop_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.13 1.009a1 1 0 1 0-2-.018l-.036 4.103-4.103.036a1 1 0 1 0 .018 2l4.068-.035L5 15.99V16a3 3 0 0 0 3 3h9v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V8a3 3 0 0 0-3-3l-8.905.077zm-.053 6.068L7 16.004A1 1 0 0 0 8 17h9V8a1 1 0 0 0-.996-1z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-crop_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconUndo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.707 13.707a1 1 0 0 0 0-1.414L5.414 8l4.293-4.293a1 1 0 0 0-1.414-1.414l-5 5a1 1 0 0 0 0 1.414l5 5a1 1 0 0 0 1.414 0",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 20a1 1 0 0 0 1-1v-7a5 5 0 0 0-5-5H4a1 1 0 1 0 0 2h12a3 3 0 0 1 3 3v7a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),ImageEditorToolbar=({historyCount:tt,handle:et})=>{const{t:rt}=useTranslation(),[nt,st]=reactExports.useState(void 0),ot=lt=>{st(lt),et(lt)},at=[{type:"button",name:"undo",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconUndo,{}),"aria-label":rt("cancel"),children:rt("cancel"),onClick:()=>ot("UNDO"),disabled:tt===0},tooltip:rt("cancel")},{type:"divider",name:"div-1"},{type:"button",name:"reset",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),"aria-label":rt("rotate"),children:rt("rotate"),onClick:()=>ot("ROTATE")},tooltip:rt("rotate")},{type:"button",name:"crop",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconCrop,{}),"aria-label":rt("crop"),children:rt("crop"),className:nt==="CROP"?"is-selected":"",onClick:()=>ot("CROP")},tooltip:rt("crop")},{type:"button",name:"blur",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBlur,{}),"aria-label":rt("blur"),children:rt("blur"),className:nt==="BLUR"?"is-selected":"",onClick:()=>ot("BLUR")},tooltip:rt("blur")}];return jsxRuntimeExports.jsx(Toolbar,{variant:"no-shadow",align:"left",isBlock:!0,items:at})},ImageEditor=({altText:tt,legend:et,image:rt,isOpen:nt,onCancel:st,onError:ot,onSave:at})=>{const{t:lt}=useTranslation(),[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(!1),[mt,xt]=reactExports.useState(tt??""),[yt,vt]=reactExports.useState(et??""),[Et,bt]=reactExports.useState(!1),{toBlob:St,setApplication:wt,startBlur:Rt,stopBlur:Ct,restore:Pt,rotate:It,startCrop:jt,stopCrop:Dt,startResize:Vt,stopResize:Ft,historyCount:Ht,loading:Nt}=useImageEditor({imageSrc:rt}),Lt=()=>{Ct(),Dt(ut==="CROP"),Ft(ut==="RESIZE")},Mt=async()=>{try{ht(!0),Lt();const $t=await St();$t&&await at({blob:$t,legend:yt,altText:mt})}catch($t){ot==null||ot(`${$t}`)}finally{ht(!1)}},zt=()=>{st()},Gt=async $t=>{switch(Lt(),ct($t),bt(!0),$t){case"ROTATE":{await It();break}case"UNDO":{await Pt();break}case"CROP":{jt();break}case"RESIZE":{await Vt();break}case"BLUR":{await Rt();break}}};return jsxRuntimeExports.jsxs(Modal,{id:"image-editor",isOpen:nt,onModalClose:zt,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:zt,children:jsxRuntimeExports.jsx("span",{className:"h2",children:lt("imageeditor.title")})}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex flex-column align-items-center",children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-12 w-100 flex-grow-1",children:[jsxRuntimeExports.jsx(ImageEditorToolbar,{handle:Gt,historyCount:Ht}),jsxRuntimeExports.jsxs("div",{className:"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor",children:[jsxRuntimeExports.jsx(moduleExports.Stage,{onMount:$t=>wt($t),options:{preserveDrawingBuffer:!0,backgroundAlpha:0,resolution:1}}),!!Nt&&jsxRuntimeExports.jsx("div",{className:"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25",children:jsxRuntimeExports.jsx(LoadingScreen,{})})]}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row m-10 gap-12 w-100",children:[jsxRuntimeExports.jsxs(FormControl,{id:"alt",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("alttext")}),jsxRuntimeExports.jsx(Input,{value:mt,onChange:$t=>{bt(!0),xt($t.target.value)},placeholder:lt("alttext.help"),size:"md",type:"text"})]}),jsxRuntimeExports.jsxs(FormControl,{id:"legend",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("legend")}),jsxRuntimeExports.jsx(Input,{value:yt,onChange:$t=>{bt(!0),vt($t.target.value)},placeholder:lt("legend.help"),size:"md",type:"text"})]})]})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:zt,type:"button",variant:"ghost",children:lt("imageeditor.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:Mt,type:"button",variant:"filled",isLoading:dt,disabled:dt||!Et,children:lt("imageeditor.save")})]})]})},UploadFiles=({onFilesChange:tt,visibility:et="protected"})=>{const{files:rt,uploadedFiles:nt,getUploadStatus:st,uploadFile:ot,removeFile:at,updateImage:lt,editingImage:ut,setEditingImage:ct,getUrl:dt}=useUploadFiles({handleOnChange:tt,application:"media-library",visibility:et}),ht=reactExports.useRef(new Map);reactExports.useEffect(()=>{const yt=ht.current;return()=>{yt.forEach(vt=>URL.revokeObjectURL(vt)),yt.clear()}},[]);const mt=yt=>{const vt=yt.type.startsWith("image")?ht.current.get(yt.name):"";return ht.current.has(yt.name)||ht.current.set(yt.name,URL.createObjectURL(yt)),{name:yt.name,info:{type:yt.type,weight:c$3(yt.size||0,1)},src:vt}},xt=yt=>{const vt=ht.current.get(yt.name);vt&&(URL.revokeObjectURL(vt),ht.current.delete(yt.name)),at(yt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rt.map(yt=>{const vt=nt.find(Et=>Et.name===yt.name);return jsxRuntimeExports.jsx(UploadCard,{status:st(yt),item:mt(yt),onEdit:()=>ct(vt),onRetry:()=>ot(yt),onDelete:()=>xt(yt)},yt.name)}),ut&&jsxRuntimeExports.jsx(ImageEditor,{altText:ut.alt,legend:ut.title,image:dt(ut,!0),isOpen:!!ut,onCancel:()=>ct(void 0),onSave:lt,onError:console.error})]})},acceptedTypes=tt=>{const et=[];switch(tt){case"audio":et.push("audio/*");break;case"video":et.push("video/*");break;case"image":et.push("image/png"),et.push("image/jpeg"),et.push("image/webp"),et.push("image/gif"),et.push("image/avif");break}return et},Upload=()=>{const{type:tt,visibility:et,multiple:rt,setResult:nt,setResultCounter:st,setCancellable:ot}=useMediaLibraryContext(),at=lt=>{lt.length?(ot(lt),st(lt.length),nt(lt)):(ot([]),st(void 0),nt(void 0))};return jsxRuntimeExports.jsx("div",{className:"py-8 flex-grow-1",children:jsxRuntimeExports.jsx(Dropzone,{multiple:rt,accept:acceptedTypes(tt??"embedder"),children:jsxRuntimeExports.jsx(UploadFiles,{onFilesChange:at,visibility:et})})})},SvgIconRecordStop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z"})]}),VIDEO_HEIGHT=9,VIDEO_WIDTH=16,VideoRecorder=reactExports.forwardRef(({appCode:tt,caption:et,onSuccess:rt,onError:nt,onRecordUpdated:st,hideSaveAction:ot=!1},at)=>{const[lt,ut]=reactExports.useState(18e4),[ct,dt]=reactExports.useState([]),[ht,mt]=reactExports.useState(!1),[xt,yt]=reactExports.useState(!1),[vt,Et]=reactExports.useState(!1),[bt,St]=reactExports.useState(!1),[wt,Rt]=reactExports.useState(!1),[Ct,Pt]=reactExports.useState({audio:!0,video:{facingMode:"environment",aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT}}),[It,jt]=reactExports.useState(),[Dt,Vt]=reactExports.useState(""),[Ft,Ht]=reactExports.useState([]),[Nt,Lt]=reactExports.useState(),[Mt,zt]=reactExports.useState(0),[Gt,$t]=reactExports.useState(0),Ut=reactExports.useRef(null),Bt=reactExports.useRef(null),{uploadBlob:Yt}=useUpload(void 0,tt),{device:Zt}=useBrowserInfo(navigator.userAgent);reactExports.useImperativeHandle(at,()=>({save:hr}));const{t:Xt}=useTranslation();reactExports.useEffect(()=>{rr(),cr()},[]),reactExports.useEffect(()=>(It||ur(Ct),()=>{It&&It.getTracks().forEach(Sr=>Sr.stop())}),[It]),reactExports.useEffect(()=>{if(Ft.length&&!ht&&Ut.current){const Sr=new Blob(Ft,{type:Dt});if(Lt(Sr),st){const kr=window.URL.createObjectURL(Sr);st(kr)}Ut.current.autoplay=!1,Ut.current.srcObject=null,Ut.current.src=window.URL.createObjectURL(Sr)}},[ht,Ft]),reactExports.useEffect(()=>{if(ht){const Sr=Date.now(),kr=window.setInterval(()=>zt(Date.now()-Sr),500);return()=>{window.clearInterval(kr)}}},[ht]),reactExports.useEffect(()=>{if(vt){const Sr=window.setInterval(()=>$t(kr=>kr+500),500);return()=>{window.clearInterval(Sr)}}},[vt]);const rr=async()=>{const Sr=await odeServices.video().getVideoConf();ut((Sr.maxDuration??3)*60*1e3)},cr=async()=>{const Sr=(await navigator.mediaDevices.enumerateDevices()).filter(kr=>kr.kind==="videoinput");switch(Zt.type){case"mobile":case"tablet":{const kr={deviceId:"environment",label:Xt("video.back.camera"),groupId:"",kind:"videoinput"},Zr={deviceId:"user",label:Xt("video.front.camera"),groupId:"",kind:"videoinput"};(Sr==null?void 0:Sr.length)>1?dt([kr,Zr]):dt([kr]);break}default:dt(Sr);break}},ur=async Sr=>{try{const kr=await navigator.mediaDevices.getUserMedia(Sr);jt(kr),Ut.current&&(Ut.current.src&&(window.URL.revokeObjectURL(Ut.current.src),Ut.current.src=""),Ut.current.srcObject=kr,Ut.current.autoplay=!0,Ut.current.volume=1,Ut.current.muted=!0)}catch(kr){console.error(kr)}},mr=reactExports.useCallback(()=>{mt(!0),Ut&&Ut.current&&(Ut.current.muted=!0);const Sr=o$2();Vt(Sr),It&&(Bt.current=new MediaRecorder(It,{mimeType:Sr}),Bt.current.ondataavailable=({data:kr})=>{kr.size>0&&Ht(Zr=>[...Zr,kr])},Bt.current.onerror=kr=>console.error(kr),Bt.current.start(1e3))},[It]),vr=reactExports.useCallback(()=>{var Sr;mt(!1),yt(!0),((Sr=Bt.current)==null?void 0:Sr.state)==="recording"&&(Bt.current.requestData(),Bt.current.stop())},[Bt]),Er=reactExports.useCallback(()=>{var Sr,kr;Ut&&Ut.current&&(Ut.current.muted=!1),vt?((kr=Ut==null?void 0:Ut.current)==null||kr.pause(),Et(!1)):((Sr=Ut==null?void 0:Ut.current)==null||Sr.play(),Et(!0))},[vt]),br=()=>{yt(!1),mt(!1),Et(!1),Rt(!1),zt(0),Ht([]),Lt(void 0),ur(Ct),st&&st()},hr=async()=>{var Sr;if((Sr=Ut==null?void 0:Ut.current)==null||Sr.pause(),St(!0),!Nt){console.error("Error while saving video: recorded video is undefined.");return}const kr=await Yt(Nt,{duration:Mt});if(kr!=null)return rt==null||rt([kr]),St(!1),Rt(!0),[kr];nt("Error while uploading video"),St(!1),Rt(!0)},Ar=()=>{Et(!1),$t(0),Ut.current&&(Ut.current.currentTime=0)},Cr=Sr=>{var kr;const Zr=ct.find(er=>er.label===Sr);let qt={};Zr!=null&&Zr.deviceId?((Zr==null?void 0:Zr.deviceId)==="environment"||(Zr==null?void 0:Zr.deviceId)==="user"?qt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,facingMode:Zr==null?void 0:Zr.deviceId}}:qt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,deviceId:Zr.deviceId}},Pt(qt),It&&(((kr=Bt.current)==null?void 0:kr.state)==="recording"&&(Bt.current.requestData(),Bt.current.stop()),It.getTracks().forEach(er=>er.stop()),jt(void 0)),ur(qt)):console.error("Selected input device id is null")};reactExports.useEffect(()=>{Mt>=lt&&vr()},[Mt,vr]);const Ur=[{type:"icon",name:"record",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{color:ht||xt?"":"red"}),color:"danger",disabled:ht||xt||bt,onClick:mr,"aria-label":Xt("bbm.video.record.start")},tooltip:Xt("bbm.video.record.start")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordStop,{}),disabled:!ht||xt||bt,onClick:vr,"aria-label":Xt("bbm.video.record.stop")},tooltip:Xt("bbm.video.record.stop")},{type:"icon",name:"play",visibility:vt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:!xt||bt,onClick:Er,"aria-label":Xt("bbm.video.play.start")},tooltip:Xt("bbm.video.play.start")},{type:"icon",name:"pause",visibility:vt?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),disabled:!xt||bt,onClick:Er,"aria-label":Xt("bbm.video.play.pause")},tooltip:Xt("bbm.video.play.pause")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:!xt||bt,onClick:br,"aria-label":Xt("bbm.video.record.reset")},tooltip:Xt("bbm.video.record.reset")},{type:"icon",name:"save",visibility:ot?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:!xt||bt||wt,onClick:hr,"aria-label":Xt("bbm.video.record.save")},tooltip:Xt("bbm.video.record.save")}];return jsxRuntimeExports.jsxs("div",{className:"video-recorder d-flex flex-fill flex-column align-items-center pb-8",children:[jsxRuntimeExports.jsx("div",{className:"video-recorder-caption d-none d-md-block",children:et}),ct.length>1&&jsxRuntimeExports.jsx("div",{className:"video-recorder-devices mb-12",children:jsxRuntimeExports.jsxs(FormControl,{id:"selectInputDevice",children:[jsxRuntimeExports.jsx(Label,{className:"d-none d-md-block",children:Xt("bbm.video.record.select.devices.label")}),jsxRuntimeExports.jsx(Select,{placeholderOption:Xt("bbm.video.record.select.devices.placeholder"),options:ct.map(Sr=>Sr.label),onValueChange:Cr})]})}),jsxRuntimeExports.jsxs("div",{className:"video-recorder-video-container position-relative align-self-stretch",children:[jsxRuntimeExports.jsx("video",{ref:Ut,playsInline:!0,autoPlay:!0,controls:!1,muted:!0,onEnded:Ar,className:"rounded",children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),(ht||xt)&&jsxRuntimeExports.jsxs("div",{className:"video-recorder-time d-flex align-items-center font-monospace fs-6 text-bg-dark rounded",children:[ht&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,color:"red",className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$3(Mt),"/",n$3(lt)]})]}),xt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecordVideo,{width:14,height:14,className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$3(Gt),"/",n$3(Mt)]})]})]}),It&&jsxRuntimeExports.jsx(Toolbar,{items:Ur,className:"position-absolute bottom-0 start-50 bg-white"})]}),bt&&jsxRuntimeExports.jsx(LoadingScreen,{position:!1,caption:Xt("bbm.video.save.loader.caption")})]})}),Video=()=>{const{appCode:tt,setResult:et,setPreSuccess:rt}=useMediaLibraryContext(),{t:nt}=useTranslation(),st=reactExports.useRef(null),ot=lt=>{lt?(et(lt),rt(()=>st.current.save)):et()},at=lt=>{console.error(lt)};return jsxRuntimeExports.jsx(VideoRecorder,{ref:st,appCode:tt,caption:nt("bbm.video.caption"),onRecordUpdated:ot,onError:at,hideSaveAction:!0})},SvgIconArrowRight=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"})]}),illuError="/assets/js/ode-explorer/illu-error.svg",illuError$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuError},Symbol.toStringTag,{value:"Module"})),VideoEmbed=({switchType:tt,onSuccess:et})=>{const{t:rt}=useTranslation(),[nt,st]=reactExports.useState(),[ot,at]=reactExports.useState(),[lt,ut]=reactExports.useState(void 0),[ct,dt]=reactExports.useState(),ht=useDebounce(nt||"",300),mt=reactExports.useId();reactExports.useEffect(()=>{xt()},[]),reactExports.useEffect(()=>{if(ct&&ht){const bt=odeServices.embedder().getProviderFromUrl(ct,ht);if(bt){ut(bt);const St=odeServices.embedder().getEmbedCodeForProvider(bt,ht);at(St),et(St)}else ut(void 0),et()}},[ht,ct]);const xt=async()=>{const bt=await Promise.all([odeServices.embedder().getDefault(),odeServices.embedder().getCustom()]).then(St=>St.flat());dt(bt)};function yt(bt){const St=bt.currentTarget.value;st(St),et(St!=null&&St.length?St:void 0)}function vt(){tt==null||tt("embedder")}const Et=()=>ht?lt?jsxRuntimeExports.jsxs("div",{className:"mx-auto mt-16",children:[jsxRuntimeExports.jsxs("div",{className:"video-embed-provider d-flex align-items-center",children:[jsxRuntimeExports.jsx(Image$1,{src:lt.logo,alt:"Logo "+lt.displayName,className:"video-embed-provider-logo"}),lt.displayName]}),ot&&jsxRuntimeExports.jsx("div",{className:"video-embed-preview mt-12",dangerouslySetInnerHTML:{__html:ot}})]}):jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column align-items-center m-16",children:[jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,title:rt("bbm.video.previewError.title"),text:rt("bbm.video.previewError.text")}),tt&&jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:vt,className:"align-items-start mt-16",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]}):tt&&jsxRuntimeExports.jsx("div",{className:"d-flex my-16 align-items-start",children:jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:vt,className:"align-items-start",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})});return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill video-embed",children:[jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconGlobe,{className:"me-8"}),rt("bbm.video.url.title")]}),jsxRuntimeExports.jsx(FormControl,{id:mt,children:jsxRuntimeExports.jsx(Input,{size:"md",type:"text",placeholder:rt("bbm.video.url.placeholder"),onChange:yt})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et()})]})},VideoEmbedder=()=>{const{switchType:tt,setResult:et}=useMediaLibraryContext();return jsxRuntimeExports.jsx(VideoEmbed,{switchType:tt,onSuccess:rt=>{et(rt)}})},SvgIconSortAscendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 16.293a1 1 0 0 1 1.414 0L7 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 4a1 1 0 0 1 1 1v15a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconSortDescendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 8.707a1 1 0 0 0 1.414 0L7 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-3-3a1 1 0 0 0-1.414 0l-3 3a1 1 0 0 0 0 1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 21a1 1 0 0 0 1-1V5a1 1 0 0 0-2 0v15a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),SvgIconSortTime=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.509 6.027a6.138 6.138 0 1 1-.28 12.099 1 1 0 1 0-.383 1.963A8.138 8.138 0 1 0 9.653 5.488a1 1 0 1 0 1.168 1.624 6.1 6.1 0 0 1 2.688-1.085",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.38 8.252a1 1 0 0 0-1 1v3.8a1 1 0 0 0 .456.838l2.052 1.332a1 1 0 0 0 1.089-1.678l-1.597-1.036V9.252a1 1 0 0 0-1-1M1.793 16.293a1 1 0 0 1 1.414 0L5.5 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 4a1 1 0 0 0-1 1v15a1 1 0 1 0 2 0V5a1 1 0 0 0-1-1",clipRule:"evenodd"})]}),illuTrash="/assets/js/ode-explorer/illu-trash.svg",illuTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTrash},Symbol.toStringTag,{value:"Module"})),SvgIconLandscape=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.222 5.037c-.895 0-1.222.555-1.222.792v12.675c0 .237.327.792 1.222.792h1.364l9.707-9.886a.987.987 0 0 1 1.414 0L21 13.782V5.829c0-.237-.328-.792-1.222-.792zM23 16.224V5.829C23 4.066 21.337 3 19.778 3H4.222C2.662 3 1 4.066 1 5.83v12.674c0 1.763 1.662 2.829 3.222 2.829h15.556c1.56 0 3.222-1.066 3.222-2.83v-2.279m-2 .439-5-5.093-7.585 7.726h11.363c.894 0 1.222-.555 1.222-.792zM8 8.093c-.552 0-1 .455-1 1.018a1.01 1.01 0 0 0 1 1.018c.552 0 1-.456 1-1.018a1.01 1.01 0 0 0-1-1.019M5 9.11c0-1.688 1.343-3.056 3-3.056s3 1.368 3 3.056-1.343 3.055-3 3.055-3-1.368-3-3.055",clipRule:"evenodd"})]}),SvgIconTextPage=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.286 3c-.35 0-.68.135-.92.368-.238.231-.366.54-.366.854v15.556c0 .315.128.623.367.854.239.233.569.368.919.368h11.428c.35 0 .68-.135.92-.368.238-.231.366-.54.366-.854V8h-3a2 2 0 0 1-2-2V3zM16 6h1.986L16 4.08zm5 13.778V6.556a1 1 0 0 0-.305-.72L15.98 1.281A1 1 0 0 0 15.286 1h-9a3.32 3.32 0 0 0-2.314.934A3.2 3.2 0 0 0 3 4.222v15.556c0 .864.353 1.686.972 2.288S5.423 23 6.286 23h11.428c.863 0 1.695-.333 2.314-.934.619-.602.972-1.424.972-2.288M8 6a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1m5 4a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2z",clipRule:"evenodd"})]}),SvgIconVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 4.962C4 4.376 4.435 4 4.853 4H6.5v2H4zM4 8h2.5v3H4zm-2 4V4.962C2 3.381 3.224 2 4.853 2h13.294C19.776 2 21 3.38 21 4.962v14.076C21 20.619 19.776 22 18.147 22H4.853C3.224 22 2 20.62 2 19.038zm17-6V4.962c0-.586-.435-.962-.853-.962H16.5v2zm0 2h-2.5v3H19zm-2.5 5H19v3h-2.5zm0 5H19v1.038c0 .586-.435.962-.853.962H16.5zm-2-7V4h-6v7zm-6 2h6v7h-6zm-2 5v2H4.853C4.435 20 4 19.624 4 19.038V18zm0-2v-3H4v3z",clipRule:"evenodd"})]}),FileIcon=({type:tt,roleMap:et})=>{const rt=typeof(et==null?void 0:et.icon)!="string"&&tt!=="unknown",nt=clsx("position-absolute top-50 start-50 translate-middle",{"p-12 rounded-circle shadow":rt},et==null?void 0:et.color);return jsxRuntimeExports.jsx("div",{className:nt,children:(et==null?void 0:et.icon)??jsxRuntimeExports.jsx(SvgIconPaperclip,{})})};var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(tt){return tt?(RootIds.has(tt)||(rootId+=1,RootIds.set(tt,rootId.toString())),RootIds.get(tt)):"0"}function optionsToId(tt){return Object.keys(tt).sort().filter(et=>tt[et]!==void 0).map(et=>`${et}_${et==="root"?getRootId(tt.root):tt[et]}`).toString()}function createObserver(tt){let et=optionsToId(tt),rt=observerMap.get(et);if(!rt){const nt=new Map;let st;const ot=new IntersectionObserver(at=>{at.forEach(lt=>{var ut;const ct=lt.isIntersecting&&st.some(dt=>lt.intersectionRatio>=dt);tt.trackVisibility&&typeof lt.isVisible>"u"&&(lt.isVisible=ct),(ut=nt.get(lt.target))==null||ut.forEach(dt=>{dt(ct,lt)})})},tt);st=ot.thresholds||(Array.isArray(tt.threshold)?tt.threshold:[tt.threshold||0]),rt={id:et,observer:ot,elements:nt},observerMap.set(et,rt)}return rt}function observe(tt,et,rt={},nt=unsupportedValue){if(typeof window.IntersectionObserver>"u"&&nt!==void 0){const ut=tt.getBoundingClientRect();return et(nt,{isIntersecting:nt,target:tt,intersectionRatio:typeof rt.threshold=="number"?rt.threshold:0,time:0,boundingClientRect:ut,intersectionRect:ut,rootBounds:ut}),()=>{}}const{id:st,observer:ot,elements:at}=createObserver(rt);let lt=at.get(tt)||[];return at.has(tt)||at.set(tt,lt),lt.push(et),ot.observe(tt),function(){lt.splice(lt.indexOf(et),1),lt.length===0&&(at.delete(tt),ot.unobserve(tt)),at.size===0&&(ot.disconnect(),observerMap.delete(st))}}function useInView({threshold:tt,delay:et,trackVisibility:rt,rootMargin:nt,root:st,triggerOnce:ot,skip:at,initialInView:lt,fallbackInView:ut,onChange:ct}={}){var dt;const[ht,mt]=reactExports.useState(null),xt=reactExports.useRef(),[yt,vt]=reactExports.useState({inView:!!lt,entry:void 0});xt.current=ct,reactExports.useEffect(()=>{if(at||!ht)return;let wt;return wt=observe(ht,(Rt,Ct)=>{vt({inView:Rt,entry:Ct}),xt.current&&xt.current(Rt,Ct),Ct.isIntersecting&&ot&&wt&&(wt(),wt=void 0)},{root:st,rootMargin:nt,threshold:tt,trackVisibility:rt,delay:et},ut),()=>{wt&&wt()}},[Array.isArray(tt)?tt.toString():tt,ht,st,nt,ot,at,rt,ut,et]);const Et=(dt=yt.entry)==null?void 0:dt.target,bt=reactExports.useRef();!ht&&Et&&!ot&&!at&&bt.current!==Et&&(bt.current=Et,vt({inView:!!lt,entry:void 0}));const St=[mt,yt.inView,yt.entry];return St.ref=St[0],St.inView=St[1],St.entry=St[2],St}function useThumbnail(tt,et){const[rt,nt]=reactExports.useState(null),{ref:st,inView:ot}=useInView({triggerOnce:!0,...et==null?void 0:et.intersectionOptions});return reactExports.useEffect(()=>{var at;(at=et==null?void 0:et.ref)!=null&&at.current&&(st==null||st(et.ref.current))},[et==null?void 0:et.ref,st]),reactExports.useEffect(()=>{if((et==null?void 0:et.ref)===void 0||ot){const at=new Image;return at.src=tt,at.onload=()=>{nt(!0)},at.onerror=()=>{nt(!1)},()=>{at.onload=null,at.onerror=null,nt(null)}}},[ot]),rt}const FileCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:nt=!1,onClick:st,className:ot})=>{var at;const lt=reactExports.useRef(null),ut=DocumentHelper.getRole(tt);function ct(yt){const vt={csv:{icon:".CSV",color:"bg-orange-200"},xls:{icon:".XLS",color:"bg-green-200"},doc:{icon:".DOC",color:"bg-blue-200"},txt:{icon:".TXT",color:"bg-blue-200"},pdf:{icon:".PDF",color:"bg-red-200"},audio:{icon:jsxRuntimeExports.jsx(SvgIconMic,{width:22,height:22}),color:"bg-red-200"},ppt:{icon:".PPT",color:"bg-yellow-200"},img:{icon:jsxRuntimeExports.jsx(SvgIconLandscape,{width:22,height:22}),color:"bg-green-200"},video:{icon:jsxRuntimeExports.jsx(SvgIconVideo,{width:22,height:22}),color:"bg-purple-200"},zip:{icon:".ZIP",color:"bg-gray-300"},md:{icon:".MD",color:"bg-blue-200"},unknown:{icon:jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:"bg-gray-300"}};return vt[yt]||vt.unknown}const dt=clsx("file position-relative rounded",((at=ct(ut??"default"))==null?void 0:at.color)??"bg-yellow-200"),ht=ut==="img"||ut==="video"?odeServices.workspace().getThumbnailUrl(tt):null,mt=useThumbnail(ht,{ref:lt}),xt=mt&&{backgroundImage:`url(${ht})`,backgroundSize:"cover"};return jsxRuntimeExports.jsx(Card,{className:clsx("card-file",ot),isClickable:et,isSelectable:rt,isSelected:nt,onClick:st,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{ref:lt,className:dt,style:{aspectRatio:"16/10",...xt},children:ut!=="img"||ut==="img"&&!mt?jsxRuntimeExports.jsx(FileIcon,{type:ut,roleMap:ct(ut)}):null}),jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.ownerName})]})]})})},Workspace$1=({roles:tt,onSelect:et,multiple:rt=!0,className:nt,defaultFolder:st,showPublicFolder:ot})=>{const{t:at}=useTranslation(),{root:lt,loadContent:ut}=useWorkspaceSearch("root",at("workspace.tree.owner"),"owner",tt),{root:ct,loadContent:dt}=useWorkspaceSearch("root",at("workspace.tree.shared"),"shared",tt),{root:ht,loadContent:mt}=useWorkspaceSearch("root",at("workspace.tree.protected"),"protected",tt),{root:xt,loadContent:yt}=useWorkspaceSearch("root",at("workspace.tree.public"),"public",tt),vt=reactExports.useRef(null),Et=reactExports.useRef(null),bt=reactExports.useRef(null),St=reactExports.useRef(null),[wt,Rt]=reactExports.useState(()=>st==="public"?ot?st:"protected":st==="protected"||st==="shared"?st:"owner"),[Ct,Pt]=reactExports.useState(()=>st==="public"?ot?xt:ht:st==="protected"?ht:st==="shared"?ct:lt),[It,jt]=reactExports.useState(),[Dt,Vt]=reactExports.useState(null),[Ft,Ht]=reactExports.useState(["modified","desc"]),[Nt,Lt]=reactExports.useState([]),Mt=reactExports.useCallback(Xt=>{switch(Xt){case"owner":return{root:lt,othersRef:[Et,bt,St]};case"shared":return{root:ct,othersRef:[vt,bt,St]};case"protected":return{root:ht,othersRef:[vt,Et,St]};case"public":return{root:xt,othersRef:[vt,Et,bt]};default:throw"no.root.node"}},[lt,ct,ht,xt]),zt=reactExports.useCallback(()=>{switch(wt){case"owner":ut(Ct.id);break;case"shared":dt(Ct.id);break;case"protected":mt(Ct.id);break;case"public":yt(Ct.id);break;default:throw"no.way"}},[wt,Ct.id,ut,mt,yt,dt]);function Gt(Xt,rr){Rt(Xt);const{root:cr,othersRef:ur}=Mt(Xt),mr=findTreeNode(cr,vr=>vr.id===rr);mr&&(Pt(mr),ur.forEach(vr=>{var Er;return(Er=vr.current)==null?void 0:Er.unselectAll()}))}reactExports.useEffect(()=>{var Xt;let rr;switch(wt){case"owner":rr=vt;break;case"shared":rr=Et;break;case"protected":rr=bt;break;case"public":rr=St;break;default:return}(Xt=rr==null?void 0:rr.current)==null||Xt.select("root")},[wt]),reactExports.useEffect(zt,[zt]),reactExports.useEffect(()=>{if(Ct.files){let Xt=[].concat(Ct.files);Dt&&(Xt=Xt.filter(cr=>cr.name.indexOf(Dt)>=0));const rr=Ft[0]==="name"?Ft[1]==="asc"?(cr,ur)=>Ut(cr.name,ur.name):(cr,ur)=>Ut(ur.name,cr.name):(cr,ur)=>Ut(ur.modified,cr.modified);jt(()=>Xt.sort(rr))}else jt(void 0)},[Ct,lt,ht,ct,xt,Dt,Ft]);const $t=reactExports.useCallback(Xt=>{Vt(Xt.target.value)},[Vt]);function Ut(Xt,rr){return Xt?rr?Xt.localeCompare(rr):1:-1}function Bt(){return Ft[0]==="name"?Ft[1]==="asc"?at("sort.order.alpha.asc"):at("sort.order.alpha.desc"):at("sort.order.modify.desc")}function Yt(Xt){let rr=[...Nt];rt?rr.includes(Xt)?rr=rr.filter(cr=>cr._id!==Xt._id):rr=[...rr,Xt]:rr=[Xt],Lt(rr),et(rr)}const Zt=clsx("workspace flex-grow-1 gap-0",nt);return jsxRuntimeExports.jsxs(Grid,{className:Zt,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"3",xl:"4",className:"workspace-folders p-12 pt-0 gap-12",children:jsxRuntimeExports.jsxs("div",{style:{position:"sticky",top:0,paddingTop:"1.2rem"},children:[jsxRuntimeExports.jsx(TreeView,{ref:vt,data:lt,onTreeItemClick:Xt=>Gt("owner",Xt),onTreeItemUnfold:Xt=>Gt("owner",Xt)}),jsxRuntimeExports.jsx(TreeView,{ref:Et,data:ct,onTreeItemClick:Xt=>Gt("shared",Xt),onTreeItemUnfold:Xt=>Gt("shared",Xt)}),jsxRuntimeExports.jsx(TreeView,{ref:bt,data:ht,onTreeItemClick:Xt=>Gt("protected",Xt),onTreeItemUnfold:Xt=>Gt("protected",Xt)}),ot&&jsxRuntimeExports.jsx(TreeView,{ref:St,data:xt,onTreeItemClick:Xt=>Gt("public",Xt),onTreeItemUnfold:Xt=>Gt("public",Xt)})]})}),jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"5",xl:"8",children:jsxRuntimeExports.jsxs(Grid,{className:"flex-grow-1 gap-0",children:[jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",xl:"12",children:[jsxRuntimeExports.jsx("div",{className:"workspace-search px-16 py-8 ",children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,className:"gap-16",onChange:$t})}),jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-end px-8 py-4",children:[jsxRuntimeExports.jsx("small",{className:"text-muted",children:at("workspace.search.order")}),jsxRuntimeExports.jsxs(Dropdown,{children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"sm",label:Bt(),variant:"ghost"}),jsxRuntimeExports.jsxs(Dropdown.Menu,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortTime,{}),onClick:()=>Ht(["modified","desc"]),children:at("sort.order.modify.desc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortAscendingLetters,{}),onClick:()=>Ht(["name","asc"]),children:at("sort.order.alpha.asc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortDescendingLetters,{}),onClick:()=>Ht(["name","desc"]),children:at("sort.order.alpha.desc")})]})]})]})]}),jsxRuntimeExports.jsx(Grid.Col,{sm:"4",md:"8",xl:"12",className:"p-8 gap-8",children:It?It.length!==0?jsxRuntimeExports.jsx("div",{className:"grid grid-workspace",children:It.map(Xt=>{const rr=Nt.includes(Xt);return jsxRuntimeExports.jsx(FileCard,{doc:Xt,isSelected:rr,onClick:()=>Yt(Xt)},Xt._id)})}):jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,text:at("workspace.empty.docSpace"),title:at("explorer.emptyScreen.trash.title")}):jsxRuntimeExports.jsx(LoadingScreen,{})})]})})]})},Workspace=()=>{const{type:tt,setResultCounter:et,setResult:rt,multiple:nt,visibility:st}=useMediaLibraryContext();function ot(){switch(tt){case"image":return"img";case"audio":return"audio";case"video":return"video";default:return null}}function at(lt){et(lt.length),lt.length?rt(lt):rt()}return jsxRuntimeExports.jsx(Workspace$1,{roles:ot(),onSelect:at,multiple:nt,className:"border rounded overflow-y-auto",defaultFolder:st,showPublicFolder:st==="public"})},InnerTabs={Audio,Video,Upload,ExternalLink,Workspace,InternalLink,Iframe,VideoEmbedder},orderedTabs=["audio-capture","video-capture","internal-link","external-link","iframe","upload","workspace","video-embedder"],mediaLibraryTypes={none:null,audio:{title:"bbm.audio.modal.title",defaultTab:"audio-capture"},video:{title:"bbm.video.modal.title",defaultTab:"video-capture"},image:{title:"bbm.image.modal.title",defaultTab:"workspace"},attachment:{title:"bbm.attachment.modal.title",defaultTab:"workspace"},hyperlink:{title:"bbm.link.modal.title",defaultTab:"linker"},embedder:{title:"bbm.embed.modal.title",defaultTab:"iframe"}},MediaLibrary=reactExports.forwardRef(({appCode:tt,visibility:et,multiple:rt,onSuccess:nt,onCancel:st,onTabChange:ot},at)=>{var lt;const ut=reactExports.useRef(),ct=reactExports.useRef(null);reactExports.useImperativeHandle(at,()=>({show:Lt,hide:Mt,showLink:zt,type:xt,...ct.current})),useHttpErrorToast({isDismissible:!0,duration:1/0});const{t:dt}=useTranslation(),ht=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"),mt=useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),[xt,yt]=reactExports.useState(null),vt={workspace:{id:"workspace",icon:jsxRuntimeExports.jsx(SvgIconFolder,{}),label:dt("bbm.workspace"),content:jsxRuntimeExports.jsx(InnerTabs.Workspace,{}),availableFor:["audio","video","image","attachment"],isEnable:null},upload:{id:"upload",icon:jsxRuntimeExports.jsx(SvgIconSmartphone,{}),label:dt("bbm.device"),content:jsxRuntimeExports.jsx(InnerTabs.Upload,{}),availableFor:["audio","video","image","attachment"],isEnable:()=>!!ht},"video-capture":{id:"video-capture",icon:jsxRuntimeExports.jsx(SvgIconRecordVideo,{}),label:dt("bbm.video"),content:jsxRuntimeExports.jsx(InnerTabs.Video,{}),availableFor:["video"],isEnable:()=>!!mt},"audio-capture":{id:"audio-capture",icon:jsxRuntimeExports.jsx(SvgIconMic,{}),label:dt("bbm.audio"),content:jsxRuntimeExports.jsx(InnerTabs.Audio,{}),availableFor:["audio"],isEnable:()=>!!ht},"external-link":{id:"external-link",icon:jsxRuntimeExports.jsx(SvgIconGlobe,{}),label:dt("bbm.linker.ext"),content:jsxRuntimeExports.jsx(InnerTabs.ExternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},"internal-link":{id:"internal-link",icon:jsxRuntimeExports.jsx(SvgIconApplications,{}),label:dt("bbm.linker.int"),content:jsxRuntimeExports.jsx(InnerTabs.InternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},iframe:{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.Iframe,{}),availableFor:["embedder"],isEnable:null},"video-embedder":{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.VideoEmbedder,{}),availableFor:["video"],isEnable:null}},Et=reactExports.useMemo(()=>orderedTabs.map(Zt=>vt[Zt]).filter(Zt=>{var Xt;return((Xt=Zt.isEnable)==null?void 0:Xt.call(Zt))!==!1&&(Zt.availableFor.length===0||Zt.availableFor.includes(xt))}),[xt]),[bt,St]=reactExports.useState(),wt=reactExports.useMemo(()=>{const Zt=Et.findIndex(Xt=>Xt.id===bt);return 0>Zt||Zt>=Et.length?0:Zt},[Et,bt]),[Rt,Ct]=reactExports.useState(),[Pt,It]=reactExports.useState(),[jt,Dt]=reactExports.useState([]),[Vt,Ft]=reactExports.useState();function Ht(Zt){throw Et.findIndex(Xt=>Xt.id===Zt)<0?"tab.not.visible":"not.implemented.yet"}function Nt(Zt){ut.current=void 0,St(void 0),yt(Zt)}const Lt=Zt=>{yt(Zt)},Mt=()=>{yt(null)},zt=Zt=>{ut.current=Zt,"resourceId"in Zt||"appPrefix"in Zt||St("external-link"),yt("hyperlink")};reactExports.useEffect(()=>{var Zt,Xt;const rr=xt||"none";!bt&&typeof((Zt=mediaLibraryTypes[rr])==null?void 0:Zt.defaultTab)=="string"&&St((Xt=mediaLibraryTypes[rr])==null?void 0:Xt.defaultTab)},[bt,xt]);const Gt=dt(((lt=mediaLibraryTypes[xt??"none"])==null?void 0:lt.title)??"bbm"),$t=()=>{ut.current=void 0,It(void 0),Ct(void 0),St(void 0),Ft(void 0),Dt([])},Ut=Zt=>{ot==null||ot(Zt,jt),$t()},Bt=reactExports.useCallback(()=>{const Zt=async Xt=>{Xt instanceof Array&&["protected","public"].findIndex(rr=>rr===et)>=0&&(Xt=await odeServices.workspace().transferDocuments(Xt,tt??"media-library",et)),nt(Xt)};Vt?Vt().then(Xt=>{Zt(Xt)}):Pt&&Zt(Pt),$t()},[Vt,Pt,nt,et,tt]),Yt=()=>{st(jt),$t()};return xt&&jsxRuntimeExports.jsx(MediaLibraryContext.Provider,{value:{appCode:tt,visibility:et,multiple:rt,type:xt,setResultCounter:Ct,setResult:It,setCancellable:Zt=>Dt([...Zt]),setVisibleTab:Ht,switchType:Nt,setPreSuccess:Ft},children:jsxRuntimeExports.jsxs(Modal,{id:"media-library",isOpen:xt!==null,onModalClose:Yt,size:"lg",viewport:!0,scrollable:!0,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Yt,children:Gt}),jsxRuntimeExports.jsx(Tabs,{items:Et,defaultId:Et[wt].id,onChange:Ut,children:Zt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Et.length>1&&jsxRuntimeExports.jsx(Tabs.List,{className:"mt-16"}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex",children:jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:Zt,children:Zt==null?void 0:Zt.content})})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:Yt,children:dt("cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",disabled:typeof Pt>"u",onClick:Bt,children:Rt&&Rt>1?dt("addMultiple",{number:Rt}):dt("add")})]})]})})});function PublishModal$2({isOpen:tt,resourceId:et,onSuccess:rt,onCancel:nt}){const{appCode:st,currentApp:ot}=useEdificeClient(),{ref:at,libraryMedia:lt,...ut}=useMediaLibrary(),{t:ct}=useTranslation(),dt=useResource(st,et),{control:ht,cover:mt,formState:{isDirty:xt,isValid:yt,isSubmitting:vt},handleDeleteImage:Et,handleSubmit:bt,handleUploadImage:St,handlePublish:wt,register:Rt,selectActivities:Ct,selectedActivities:Pt,selectedSubjectAreas:It,selectSubjects:jt}=usePublishModal({resource:dt,onSuccess:rt});return dt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:nt,id:"libraryModal",size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:nt,children:ct("bpr.publish")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:ct("bpr.form.tip")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.general")}),jsxRuntimeExports.jsxs("form",{id:"libraryModalForm",onSubmit:bt(wt),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[jsxRuntimeExports.jsxs("div",{style:{maxWidth:"160px"},children:[jsxRuntimeExports.jsx("div",{className:"form-label",children:ct("bpr.form.publication.cover.title")}),jsxRuntimeExports.jsx(ImagePicker,{app:ot,src:dt==null?void 0:dt.thumbnail,addButtonLabel:ct("bpr.form.publication.cover.upload.add"),deleteButtonLabel:ct("bpr.form.publication.cover.upload.remove"),onUploadImage:St,onDeleteImage:Et,className:"align-self-center",libraryMedia:lt,mediaLibraryRef:at}),!mt&&jsxRuntimeExports.jsx("p",{className:"form-text is-invalid",children:jsxRuntimeExports.jsx("em",{children:ct("bpr.form.publication.cover.upload.required.image")})})]}),jsxRuntimeExports.jsxs("div",{className:"flex-fill",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:dt==null?void 0:dt.name,...Rt("title",{required:!0}),placeholder:ct("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.description")}),jsxRuntimeExports.jsx(TextArea,{...Rt("description",{required:!0}),placeholder:ct("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.infos")}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[jsxRuntimeExports.jsx(ActivitiesDropdown,{control:ht,selectedActivities:Pt,selectActivities:Ct}),jsxRuntimeExports.jsx(SubjectsDropdown,{control:ht,selectedSubjectAreas:It,selectSubjects:jt}),jsxRuntimeExports.jsx(LangSelect,{control:ht})]}),jsxRuntimeExports.jsxs("div",{className:"mb-24",children:[jsxRuntimeExports.jsx("label",{htmlFor:"",className:"form-label",children:ct("bpr.form.publication.age")}),jsxRuntimeExports.jsxs("div",{className:"d-flex gap-8",children:[jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(Ft,Ht)=>parseInt(Ft)<=parseInt(Ht.ageMax)})}),jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(Ft,Ht)=>parseInt(Ft)>=parseInt(Ht.ageMin)})})]})]}),jsxRuntimeExports.jsx("div",{className:"mb-24",children:jsxRuntimeExports.jsxs(FormControl,{id:"keywords",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.keywords")}),jsxRuntimeExports.jsx(Input,{type:"text",...Rt("keyWords"),size:"md",placeholder:ct("bpr.form.publication.keywords.placeholder")})]})}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.licence.text")}),jsxRuntimeExports.jsx(PublishModalFooter,{})]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:nt,type:"button",variant:"ghost",children:ct("cancel")}),jsxRuntimeExports.jsx(Button,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:vt,disabled:!mt||vt||!xt||!yt,children:ct("bpr.form.submit")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:st,ref:at,multiple:!1,visibility:"protected",...ut})]}),document.getElementById("portal")):jsxRuntimeExports.jsx(LoadingScreen,{})}const SvgIconCopy=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.676 3c.284-.672.853-1 1.263-1h11.423c.566 0 1.438.628 1.438 1.923v13.154c0 1.056-.58 1.668-1.1 1.858V6.923C19.7 4.99 18.3 3 16.061 3zm-2.272.007C4.765 1.41 6.056 0 7.939 0h11.423C21.599 0 23 1.99 23 3.923v13.154c0 1.865-1.303 3.782-3.403 3.916C19.235 22.59 17.944 24 16.06 24H4.638C2.401 24 1 22.01 1 20.077V6.923c0-1.865 1.303-3.782 3.404-3.916M3.2 6.923C3.2 5.628 4.072 5 4.638 5h11.423c.567 0 1.439.628 1.439 1.923v13.154c0 1.295-.872 1.923-1.439 1.923H4.638c-.566 0-1.438-.628-1.438-1.923z",clipRule:"evenodd"})]}),defaults=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function objectHash(tt,et){et?et={...defaults,...et}:et=defaults;const rt=createHasher(et);return rt.dispatch(tt),rt.toString()}const defaultPrototypesKeys=Object.freeze(["prototype","__proto__","constructor"]);function createHasher(tt){let et="",rt=new Map;const nt=st=>{et+=st};return{toString(){return et},getContext(){return rt},dispatch(st){return tt.replacer&&(st=tt.replacer(st)),this[st===null?"null":typeof st](st)},object(st){if(st&&typeof st.toJSON=="function")return this.object(st.toJSON());const ot=Object.prototype.toString.call(st);let at="";const lt=ot.length;lt<10?at="unknown:["+ot+"]":at=ot.slice(8,lt-1),at=at.toLowerCase();let ut=null;if((ut=rt.get(st))===void 0)rt.set(st,rt.size);else return this.dispatch("[CIRCULAR:"+ut+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(st))return nt("buffer:"),nt(st.toString("utf8"));if(at!=="object"&&at!=="function"&&at!=="asyncfunction")this[at]?this[at](st):tt.ignoreUnknown||this.unkown(st,at);else{let ct=Object.keys(st);tt.unorderedObjects&&(ct=ct.sort());let dt=[];tt.respectType!==!1&&!isNativeFunction(st)&&(dt=defaultPrototypesKeys),tt.excludeKeys&&(ct=ct.filter(mt=>!tt.excludeKeys(mt)),dt=dt.filter(mt=>!tt.excludeKeys(mt))),nt("object:"+(ct.length+dt.length)+":");const ht=mt=>{this.dispatch(mt),nt(":"),tt.excludeValues||this.dispatch(st[mt]),nt(",")};for(const mt of ct)ht(mt);for(const mt of dt)ht(mt)}},array(st,ot){if(ot=ot===void 0?tt.unorderedArrays!==!1:ot,nt("array:"+st.length+":"),!ot||st.length<=1){for(const ut of st)this.dispatch(ut);return}const at=new Map,lt=st.map(ut=>{const ct=createHasher(tt);ct.dispatch(ut);for(const[dt,ht]of ct.getContext())at.set(dt,ht);return ct.toString()});return rt=at,lt.sort(),this.array(lt,!1)},date(st){return nt("date:"+st.toJSON())},symbol(st){return nt("symbol:"+st.toString())},unkown(st,ot){if(nt(ot),!!st&&(nt(":"),st&&typeof st.entries=="function"))return this.array(Array.from(st.entries()),!0)},error(st){return nt("error:"+st.toString())},boolean(st){return nt("bool:"+st)},string(st){nt("string:"+st.length+":"),nt(st)},function(st){nt("fn:"),isNativeFunction(st)?this.dispatch("[native]"):this.dispatch(st.toString()),tt.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(st.name)),tt.respectFunctionProperties&&this.object(st)},number(st){return nt("number:"+st)},xml(st){return nt("xml:"+st.toString())},null(){return nt("Null")},undefined(){return nt("Undefined")},regexp(st){return nt("regex:"+st.toString())},uint8array(st){return nt("uint8array:"),this.dispatch(Array.prototype.slice.call(st))},uint8clampedarray(st){return nt("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(st))},int8array(st){return nt("int8array:"),this.dispatch(Array.prototype.slice.call(st))},uint16array(st){return nt("uint16array:"),this.dispatch(Array.prototype.slice.call(st))},int16array(st){return nt("int16array:"),this.dispatch(Array.prototype.slice.call(st))},uint32array(st){return nt("uint32array:"),this.dispatch(Array.prototype.slice.call(st))},int32array(st){return nt("int32array:"),this.dispatch(Array.prototype.slice.call(st))},float32array(st){return nt("float32array:"),this.dispatch(Array.prototype.slice.call(st))},float64array(st){return nt("float64array:"),this.dispatch(Array.prototype.slice.call(st))},arraybuffer(st){return nt("arraybuffer:"),this.dispatch(new Uint8Array(st))},url(st){return nt("url:"+st.toString())},map(st){nt("map:");const ot=[...st];return this.array(ot,tt.unorderedSets!==!1)},set(st){nt("set:");const ot=[...st];return this.array(ot,tt.unorderedSets!==!1)},file(st){return nt("file:"),this.dispatch([st.name,st.size,st.type,st.lastModfied])},blob(){if(tt.ignoreUnknown)return nt("[blob]");throw new Error(`Hashing Blob objects is currently not supported
1393
+ }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(et){this._stylesheet!==et&&(this._stylesheet=et,this.styleID++)}normalizeColor(et){return Array.isArray(et)&&(et=rgb2hex(et)),typeof et=="number"?hex2string(et):et}dropShadowToCSS(){let et=this.normalizeColor(this.dropShadowColor);const rt=this.dropShadowAlpha,nt=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),st=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);et.startsWith("#")&&rt<1&&(et+=(rt*255|0).toString(16).padStart(2,"0"));const ot=`${nt}px ${st}px`;return this.dropShadowBlur>0?`text-shadow: ${ot} ${this.dropShadowBlur}px ${et}`:`text-shadow: ${ot} ${et}`}reset(){Object.assign(this,Hl.defaultOptions)}onBeforeDraw(){const{fontsDirty:et}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&et?new Promise(rt=>setTimeout(rt,100)):Promise.resolve()}get isSafari(){const{userAgent:et}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(et)}set fillGradientStops(et){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(et){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(et){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(et){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(et){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(et){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(et){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_HTMLTextStyle.availableFonts={},_HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let HTMLTextStyle=_HTMLTextStyle;const _HTMLText=class Vl extends Sprite{constructor(et="",rt={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const nt=new Image,st=Texture.from(nt,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});st.orig=new Rectangle,st.trim=new Rectangle,this.texture=st;const ot="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",lt=document.createElementNS(ot,"svg"),ut=document.createElementNS(ot,"foreignObject"),ct=document.createElementNS(at,"div"),dt=document.createElementNS(at,"style");ut.setAttribute("width","10000"),ut.setAttribute("height","10000"),ut.style.overflow="hidden",lt.appendChild(ut),this.maxWidth=Vl.defaultMaxWidth,this.maxHeight=Vl.defaultMaxHeight,this._domElement=ct,this._styleElement=dt,this._svgRoot=lt,this._foreignObject=ut,this._foreignObject.appendChild(dt),this._foreignObject.appendChild(ct),this._image=nt,this._loadImage=new Image,this._autoResolution=Vl.defaultAutoResolution,this._resolution=Vl.defaultResolution??settings.RESOLUTION,this.text=et,this.style=rt}measureText(et){var dt,ht;const{text:rt,style:nt,resolution:st}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},et);Object.assign(this._domElement,{innerHTML:rt,style:nt.toCSS(st)}),this._styleElement.textContent=nt.toGlobalCSS(),document.body.appendChild(this._svgRoot);const ot=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:at,height:lt}=ot;(at>this.maxWidth||lt>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const ut=Math.min(this.maxWidth,Math.ceil(at)),ct=Math.min(this.maxHeight,Math.ceil(lt));return this._svgRoot.setAttribute("width",ut.toString()),this._svgRoot.setAttribute("height",ct.toString()),rt!==this._text&&(this._domElement.innerHTML=this._text),nt!==this._style&&(Object.assign(this._domElement,{style:(dt=this._style)==null?void 0:dt.toCSS(st)}),this._styleElement.textContent=(ht=this._style)==null?void 0:ht.toGlobalCSS()),{width:ut+nt.padding*2,height:ct+nt.padding*2}}async updateText(et=!0){const{style:rt,_image:nt,_loadImage:st}=this;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;const{width:ot,height:at}=this.measureText();nt.width=st.width=Math.ceil(Math.max(1,ot)),nt.height=st.height=Math.ceil(Math.max(1,at)),this._updateID++;const lt=this._updateID;await new Promise(ut=>{st.onload=async()=>{if(lt<this._updateID){ut();return}await rt.onBeforeDraw(),nt.src=st.src,st.onload=null,st.src="",this.updateTexture(),ut()};const ct=new XMLSerializer().serializeToString(this._svgRoot);st.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ct)}`})}get source(){return this._image}updateTexture(){const{style:et,texture:rt,_image:nt,resolution:st}=this,{padding:ot}=et,{baseTexture:at}=rt;rt.trim.width=rt._frame.width=nt.width/st,rt.trim.height=rt._frame.height=nt.height/st,rt.trim.x=-ot,rt.trim.y=-ot,rt.orig.width=rt._frame.width-ot*2,rt.orig.height=rt._frame.height-ot*2,this._onTextureUpdate(),at.setRealSize(nt.width,nt.height,st),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}_renderCanvas(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(et)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds(et)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(et){var nt,st,ot,at,lt;typeof et=="boolean"&&(et={children:et}),et=Object.assign({},Vl.defaultDestroyOptions,et),super.destroy(et);const rt=null;this.ownsStyle&&((nt=this._style)==null||nt.cleanFonts()),this._style=rt,(st=this._svgRoot)==null||st.remove(),this._svgRoot=rt,(ot=this._domElement)==null||ot.remove(),this._domElement=rt,(at=this._foreignObject)==null||at.remove(),this._foreignObject=rt,(lt=this._styleElement)==null||lt.remove(),this._styleElement=rt,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=rt,this._image.src="",this._image=rt}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._image.width/this.resolution,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._image.height/this.resolution,this._height=et}get style(){return this._style}set style(et){this._style!==et&&(et=et||{},et instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=et):et instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(et)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(et)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(et){et=String(et===""||et===null||et===void 0?" ":et),et=this.sanitiseText(et),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}sanitiseText(et){return et.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};_HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_HTMLText.defaultMaxWidth=2024,_HTMLText.defaultMaxHeight=2024,_HTMLText.defaultAutoResolution=!0;const MIN_HEIGHT=100,MIN_WIDTH=100,MODAL_VERTICAL_PADDING=450,MODAL_HORIZONTAL_PADDING=64,DEFAULT_QUALITY=.5,DEFAULT_SPRITE_NAME="image";function updateImageFromBlob(tt,{spriteName:et,imgDatasource:rt,settings:nt}){const st=URL.createObjectURL(rt),ot=new Image;return ot.src=st,new Promise(at=>{ot.onload=async()=>{await updateImage(tt,{spriteName:et,imgDatasource:ot,settings:nt});const lt=tt==null?void 0:tt.stage.getChildByName(et,!0);at(lt)}})}async function updateImage(tt,{spriteName:et,imgDatasource:rt,settings:nt}){if(tt===void 0||tt.stage===null)return;const st=tt.stage.getChildByName(et,!0);st==null||st.removeFromParent();const ot=rt instanceof HTMLImageElement?Texture.from(rt):rt instanceof Sprite?rt:await Texture.fromURL(rt),at=ot instanceof Sprite?ot:Sprite.from(ot,{});if(at.interactive=!0,at.name=et,nt){const{sprite:{anchor:lt,position:ut,scale:ct,size:dt,rotation:ht},stage:{size:mt}}=nt,xt=ht%Math.PI!==0;at.anchor.x=lt.x,at.anchor.y=lt.y,at.position.x=ut.x,at.position.y=ut.y,at.scale.x=ct.x,at.scale.y=ct.y,at.width=xt?dt.height:dt.width,at.height=xt?dt.width:dt.height,tt.stage.height=mt.height,tt.stage.width=mt.width,tt.renderer.resize(mt.width,mt.height),tt.stage.addChild(at)}else tt.stage.addChild(at),tt.renderer.resize(at.width,at.height);autoResize(tt,at)}function autoResize(tt,et){var rt;const nt=tt.view.parentNode,st=window.innerWidth-MODAL_HORIZONTAL_PADDING,ot=Math.max((nt==null?void 0:nt.offsetWidth)??0,MIN_WIDTH),at=constraintSize({width:et.width,height:et.height},{width:{max:Math.min(ot,st),min:MIN_WIDTH},height:{min:MIN_HEIGHT,max:window.innerHeight-MODAL_VERTICAL_PADDING}}),{height:lt,width:ut}=at;(rt=tt.view)!=null&&rt.style&&(tt.view.style.width=`${ut}px`,tt.view.style.height=`${lt}px`)}function constraintSize(tt,et){const{height:rt,width:nt}=tt,st=nt/rt,{height:ot,width:at}=et;let lt=at.max,ut=at.max/st;return nt>at.max&&(lt=at.max,ut=lt/st),ut>ot.max&&(ut=ot.max,lt=ut*st),lt<at.min&&(lt=at.min,ut=lt/st),ut<ot.min&&(ut=ot.min,lt=ut*st),{width:lt,height:ut}}function saveAsBlob(tt){return new Promise((et,rt)=>{var nt;(nt=tt==null?void 0:tt.view)!=null&&nt.toBlob?tt.view.toBlob(st=>{st?et(st):rt("EXTRACT_FAILED")},"image/jpeg",DEFAULT_QUALITY):rt("EXTRACT_FAILED")})}function saveAsDataURL(tt){var et,rt;return(rt=(et=tt.view).toDataURL)==null?void 0:rt.call(et)}function getApplicationScale(tt){return tt.view.getBoundingClientRect?tt.view.getBoundingClientRect().width/tt.view.width:1}function toBlob(tt){return new Promise((et,rt)=>{var nt,st;(st=(nt=tt.view).toBlob)==null||st.call(nt,ot=>{ot?et(ot):rt("EXTRACT_FAIL")},"image/png",1)})}function createImageSettings({application:tt,sprite:et}){return{sprite:{rotation:et.rotation,size:{width:et.width,height:et.height},position:{x:et.position.x,y:et.position.y},scale:{x:et.scale.x,y:et.scale.y},anchor:{x:et.anchor.x,y:et.anchor.y}},stage:{size:{width:tt.stage.width,height:tt.stage.height},scale:{x:tt.stage.scale.x,y:tt.stage.scale.y}}}}function resizeStage({application:tt,sprite:et,newHeight:rt,newWidth:nt}){et.anchor.x=.5,et.anchor.y=.5,et.position=new Point(nt/2,rt/2),tt.stage.height=rt,tt.stage.width=nt,tt.renderer.resize(nt,rt)}const DEFAULT_MAX_HISTORY=20,useHistoryTool=({maxSize:tt=DEFAULT_MAX_HISTORY,application:et,spriteName:rt,onRestore:nt})=>{const[st,ot]=reactExports.useState([]);reactExports.useEffect(()=>{ot([])},[et]);const at=async()=>{const ct=st.pop();ct&&(nt(await ct.backup,ct),ot(st.filter(dt=>dt!==ct)))},lt=ct=>(ct.length>tt&&ct.splice(0,ct.length-tt),ct),ut=async ct=>{{if(!et)return;const dt=et.stage.getChildByName(rt,!0);if(dt==null)return;const ht=toBlob(et),mt={backup:ht,sprite:{rotation:dt.rotation,size:{width:dt.width,height:dt.height},position:{x:dt.position.x,y:dt.position.y},scale:{x:dt.scale.x,y:dt.scale.y},anchor:{x:dt.anchor.x,y:dt.anchor.y}},stage:{size:{width:et.stage.width,height:et.stage.height},scale:{x:et.stage.scale.x,y:et.stage.scale.y}}};return ot([...lt(st),mt]),await ht,ct.call(ct)}};return{historyCount:st.length,restore:at,historize:ut}};function aggregate(tt,et,rt){let nt;const st=[];return function(ot){st.push(et(ot)),!nt&&(nt=setTimeout(()=>{const at=[...st];st.splice(0,st.length),rt(at),nt=void 0},tt))}}const BRUSH_SIZE=20,DEBOUNCE=50,CURSOR_NAME="BRUSH_CURSOR";function drawBrush(tt,et){const rt=new Graphics;for(const nt of tt)nt&&(rt.beginFill(16777215,1),rt.drawCircle(nt.x,nt.y,BRUSH_SIZE/et),rt.lineStyle(0),rt.endFill());return rt}function drawBlurListener(tt,{spriteName:et}){return aggregate(DEBOUNCE,rt=>tt.stage.toLocal(rt.global),rt=>{const nt=tt.stage.getChildByName(et),st=getApplicationScale(tt);if(nt==null)return;const ot=new Sprite(nt.texture);ot.filters=[new BlurFilter(8,4,Math.min(st,1))],ot.width=nt.width,ot.height=nt.height,ot.scale=new Point(1,1),ot.anchor=nt.anchor,ot.mask=drawBrush(rt,st),nt.addChild(ot)})}function drawCursor(tt){removeCursor(tt);const et=getApplicationScale(tt),rt=new Graphics;return rt.lineStyle(Math.max(1,1/et),16711680),rt.drawCircle(0,0,BRUSH_SIZE/et),rt.endFill(),rt.name=CURSOR_NAME,tt.stage.addChild(rt),rt}function removeCursor(tt){const et=tt.stage.getChildByName(CURSOR_NAME);et&&et.removeFromParent()}function moveCursorListener(tt){return et=>{if(!tt)return;const rt=tt.stage.toLocal(et.global),nt=tt.stage.getChildByName(CURSOR_NAME,!0);nt&&(nt.position.x=rt.x,nt.position.y=rt.y)}}function start$2(tt,{spriteName:et}){tt.stage.interactive=!0;const rt=drawCursor(tt),nt=moveCursorListener(tt);tt.stage.on("pointermove",nt);const st=drawBlurListener(tt,{spriteName:et});tt.stage.on("pointerdown",()=>{tt.stage.on("pointermove",st)});const ot=()=>{var at;(at=tt==null?void 0:tt.stage)==null||at.off("pointermove",st)};globalThis.addEventListener("pointerup",ot),rt.once("destroyed",()=>{globalThis.removeEventListener("pointerup",ot)})}function stop$2(tt){removeCursor(tt),tt.stage.off("pointerdown"),tt.stage.off("pointermove")}const CORNERS=["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"],PADDING=0,POINT_RADIUS$1=20,CROP_BACKGROUND_NAME="CROP_BACKGROUND_NAME",CROP_MASK_NAME="CROP_MASK_NAME";function getCornerName$1(tt){return"CROP_CORNER_"+tt}function drawBackground(tt,{spriteName:et}){removeBackground(tt);const rt=tt.stage.getChildByName(et);if(rt==null)return;const nt=rt.getBounds(),st=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(st);ot.height=nt.height,ot.width=nt.width,ot.position=new Point(0,0);const at=new Graphics;at.beginFill(16777215,.5),at.drawRect(0,0,nt.width,nt.height),at.endFill(),at.name=CROP_BACKGROUND_NAME,at.position=new Point(nt.x,nt.y);const lt=new Graphics;lt.beginFill(0,1),lt.drawRect(0,0,nt.width-2*PADDING,nt.height-2*PADDING),lt.endFill(),lt.position=new Point(PADDING,PADDING),lt.name=CROP_MASK_NAME,ot.mask=lt,tt.stage.addChild(at),at.addChild(lt),at.addChild(ot)}function removeBackground(tt){const et=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0);et==null||et.removeFromParent()}function computeCornerPosition$1(tt,et){switch(tt){case"TOP_LEFT":return{x:et.x,y:et.y,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:et.x+et.width,y:et.y,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:et.x,y:et.y+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:et.x+et.width,y:et.y+et.height,start:Math.PI,end:3*Math.PI/2}}}function refreshCorners(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);et!=null&&CORNERS.forEach(rt=>{const nt=tt.stage.getChildByName(getCornerName$1(rt),!0);if(nt==null)return;const st=computeCornerPosition$1(rt,{height:et.height,width:et.width,x:et.x,y:et.y});nt.position=new Point(st.x,st.y)})}function drawCorner$1(tt,et,{spriteName:rt}){const nt=tt.stage.getChildByName(getCornerName$1(et),!0),st=getApplicationScale(tt);nt==null||nt.removeFromParent();const ot=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0),at=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(tt.stage.getChildByName(rt)==null||ot===null||ot===void 0||at===void 0||at===null)return;const ut=computeCornerPosition$1(et,{height:at.height,width:at.width,x:at.x,y:at.y}),ct=new Graphics;ct.beginFill(4960213,1),ct.arc(0,0,POINT_RADIUS$1/st,ut.start,ut.end),ct.lineTo(0,0),ct.endFill(),ct.position=new Point(ut.x,ut.y),ct.name=getCornerName$1(et),ct.interactive=!0;let dt=!1;tt.stage.on("pointermove",xt=>{if(dt===!1)return;const yt=ot.toLocal(xt.global);ct.position.x=yt.x,ct.position.y=yt.y,moveMask(tt,et,yt)});const ht=()=>{dt=!0};ct.on("pointerdown",ht);const mt=()=>{dt=!1};globalThis.addEventListener("pointerup",mt),ct.once("destroyed",()=>{ct.off("pointerdown"),globalThis.removeEventListener("pointerup",mt)}),ot.addChild(ct)}function moveMask(tt,et,rt){const nt=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(nt==null)return;const st=nt.position.x+nt.width,ot=nt.position.y+nt.height;switch(et){case"TOP_LEFT":{nt.position.x=rt.x,nt.position.y=rt.y,nt.width=st-rt.x,nt.height=ot-rt.y;break}case"TOP_RIGHT":{nt.position.y=rt.y,nt.width=rt.x-nt.position.x,nt.height=ot-rt.y;break}case"BOTTOM_LEFT":{nt.position.x=rt.x,nt.width=st-rt.x,nt.height=rt.y-nt.position.y;break}case"BOTTOM_RIGHT":{nt.width=rt.x-nt.position.x,nt.height=rt.y-nt.position.y;break}}refreshCorners(tt)}function start$1(tt,{spriteName:et}){stop$1(tt),tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,drawBackground(tt,{spriteName:et}),drawCorner$1(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner$1(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner$1(tt,"TOP_LEFT",{spriteName:et}),drawCorner$1(tt,"TOP_RIGHT",{spriteName:et})}function stop$1(tt){removeBackground(tt),tt.stage.off("pointermove"),tt.render()}function save$1(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(et==null)return;stop$1(tt);const rt=tt.renderer.generateTexture(tt.stage).clone(),nt=new Sprite(rt),st=et.getBounds(),ot=new Rectangle(Math.floor(st.x),Math.floor(st.y),Math.floor(st.width),Math.floor(st.height)),at=new Texture(nt.texture.baseTexture,ot);return new Sprite(at)}const POINT_RADIUS=20,CONTROL_NAME="CONTROL_NAME";function getCornerName(tt){return"RESIZE_CORNER_"+tt}function computeCornerPosition(tt,et){const rt=et.x,nt=et.y;switch(tt){case"TOP_LEFT":return{x:rt,y:nt,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:rt+et.width,y:nt,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:rt,y:nt+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:rt+et.width,y:nt+et.height,start:Math.PI,end:3*Math.PI/2}}}function resizeContainer(tt,{container:et,cornerType:rt,position:nt,spriteName:st}){const ot=tt.stage.getChildByName(st,!0);if(ot==null)return;const at=ot.rotation%Math.PI!==0,lt=at?ot.height:ot.width,ut=at?ot.width:ot.height;switch(rt){case"TOP_LEFT":{et.position=new Point(nt.x,nt.y),et.width=lt-2*nt.x,et.height=ut-2*nt.y;break}case"TOP_RIGHT":{const ct=lt-nt.x;et.position=new Point(ct,nt.y),et.width=lt-2*ct,et.height=ut-2*nt.y;break}case"BOTTOM_LEFT":{const ct=ut-nt.y;et.position=new Point(nt.x,ct),et.width=lt-2*nt.x,et.height=ut-2*ct;break}case"BOTTOM_RIGHT":{const ct=ut-nt.y,dt=lt-nt.x;et.position=new Point(dt,ct),et.width=lt-2*dt,et.height=ut-2*ct;break}}}function removeCorner(tt,et){const rt=tt.stage.getChildByName(getCornerName(et),!0);rt==null||rt.removeFromParent()}function drawCorner(tt,et,{spriteName:rt}){removeCorner(tt,et);const nt=tt.stage.getChildByName(rt,!0),st=tt.stage.getChildByName(CONTROL_NAME,!0);if(nt==null||st===null||st===void 0)return;const ot=computeCornerPosition(et,st),at=new Graphics;at.beginFill(4960213,1),at.arc(0,0,POINT_RADIUS,ot.start,ot.end),at.lineTo(0,0),at.endFill(),at.position=new Point(ot.x,ot.y),at.name=getCornerName(et),at.interactive=!0;let lt=!1;tt.stage.on("pointermove",dt=>{if(lt===!1)return;const ht=tt.stage.toLocal(dt.global);resizeContainer(tt,{cornerType:et,position:ht,container:st,spriteName:rt})});const ut=()=>{lt=!1};globalThis.addEventListener("pointerup",ut),at.once("destroyed",()=>{at.off("pointerdown"),globalThis.removeEventListener("pointerup",ut)});const ct=()=>{lt=!0};at.on("pointerdown",ct),st.addChild(at)}function drawContainer(tt,et){removeContainer(tt);const rt=tt.stage.getChildByName(et,!0);if(rt==null)return;const nt=tt.renderer.generateTexture(tt.stage),st=new Sprite(nt);tt.stage.children.forEach(at=>{at.alpha=0});const ot=new Graphics;ot.drawRect(0,0,rt.width,rt.height),ot.name=CONTROL_NAME,ot.interactive=!0,ot.interactiveChildren=!0,tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,tt.stage.addChild(ot),ot.addChild(st)}function removeContainer(tt){const et=tt.stage.getChildByName(CONTROL_NAME,!0);et==null||et.removeFromParent(),tt.stage.children.forEach(rt=>{rt.alpha=1})}function drawControl(tt,et){drawContainer(tt,et),drawCorner(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner(tt,"TOP_LEFT",{spriteName:et}),drawCorner(tt,"TOP_RIGHT",{spriteName:et})}function removeControl(tt){removeContainer(tt),removeCorner(tt,"BOTTOM_LEFT"),removeCorner(tt,"BOTTOM_RIGHT"),removeCorner(tt,"TOP_LEFT"),removeCorner(tt,"TOP_RIGHT"),tt.stage.off("pointermove")}function start(tt,et){drawControl(tt,et)}function stop(tt){removeControl(tt),tt.stage.off("pointermove"),tt.render()}function save(tt){var et;const rt=(et=tt==null?void 0:tt.stage)==null?void 0:et.getChildByName(CONTROL_NAME,!0),nt=rt?{height:rt.height,width:rt.width}:void 0;if(removeControl(tt),nt){const st=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(st);return ot.width=nt.width,ot.height=nt.height,ot}else return}async function rotate(tt,et){const rt=tt==null?void 0:tt.stage.getChildByName(et,!0);if(tt&&rt){if(!tt)return;const nt=await toBlob(tt),st=await updateImageFromBlob(tt,{imgDatasource:nt,spriteName:et,settings:createImageSettings({application:tt,sprite:rt})});if(!st)return;let ot,at;const lt=tt.view;lt.style&&(ot=lt.style.maxHeight??"",at=lt.style.visibility??"",lt.style.maxHeight=`${lt.clientHeight}px`,lt.style.visibility="hidden"),st.rotation+=Math.PI/2,resizeStage({application:tt,sprite:st,newHeight:st.width,newWidth:st.height}),tt.render();const ut=await toBlob(tt);ot!==void 0&&(lt.style.maxHeight=ot),at!==void 0&&(lt.style.visibility=at),await updateImageFromBlob(tt,{imgDatasource:ut,spriteName:et})}}function useImageEffects({application:tt,spriteName:et,onSave:rt}){return{rotate:async()=>{tt&&await rotate(tt,et)},startCrop:()=>{tt&&start$1(tt,{spriteName:et})},stopCrop:nt=>{if(tt){if(nt){const st=save$1(tt);st&&rt(st)}stop$1(tt)}},startBlur:()=>{tt&&start$2(tt,{spriteName:et})},stopBlur:()=>{tt&&stop$2(tt)},startResize:()=>{tt&&start(tt,et)},stopResize:nt=>{if(tt){if(nt){const st=save(tt);st&&rt(st)}stop(tt)}}}}function useImageEditor({imageSrc:tt,spriteName:et=DEFAULT_SPRITE_NAME}){const[rt,nt]=reactExports.useState(void 0),[st,ot]=reactExports.useState(!0),{rotate:at,startBlur:lt,startCrop:ut,startResize:ct,stopBlur:dt,stopCrop:ht,stopResize:mt}=useImageEffects({spriteName:et,application:rt,onSave(St){rt&&updateImage(rt,{imgDatasource:St,spriteName:et})}}),xt=()=>rt?saveAsBlob(rt):Promise.resolve(void 0),yt=()=>{if(rt)return saveAsDataURL(rt)},{restore:vt,historize:Et,historyCount:bt}=useHistoryTool({application:rt,spriteName:et,onRestore(St,wt){rt&&updateImageFromBlob(rt,{imgDatasource:St,spriteName:et,settings:wt})}});return reactExports.useEffect(()=>{rt&&(ot(!0),updateImage(rt,{spriteName:et,imgDatasource:tt}).finally(()=>ot(!1)))},[rt,tt,et]),{historyCount:bt,setApplication:nt,restore:vt,stopCrop:ht,stopBlur:dt,stopResize:mt,startResize:async()=>{ot(!0),await Et(ct),ot(!1)},startCrop:async()=>{ot(!0),await Et(ut),ot(!1)},startBlur:async()=>{ot(!0),await Et(lt),ot(!1)},rotate:async()=>{ot(!0),await Et(at),ot(!1)},toBlob:xt,toDataURL:yt,loading:st}}const SvgIconBlur=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-blur_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M17.504 1.673a1 1 0 0 1 .932.491c.37.63.9 1.935 1.404 3.18l.08.197c.502 1.24.994 2.457 1.369 3.205l-.895.447.895-.447c.561 1.122 1.962 4.049 2.136 6.753.087 1.364-.125 2.839-1.094 3.978-.987 1.16-2.573 1.76-4.757 1.76-2.186 0-3.777-.6-4.777-1.752-.983-1.134-1.221-2.604-1.152-3.973.138-2.711 1.514-5.636 2.13-6.79.86-1.611 2.414-5.32 2.874-6.433a1 1 0 0 1 .855-.616m.104 3.492c-.657 1.533-1.496 3.425-2.07 4.5-.59 1.106-1.781 3.703-1.895 5.949-.057 1.11.158 1.976.665 2.56.49.565 1.427 1.063 3.266 1.063 1.84 0 2.76-.498 3.233-1.055.492-.579.694-1.44.622-2.555-.145-2.253-1.36-4.848-1.929-5.986-.412-.823-.932-2.108-1.417-3.308l-.097-.238q-.196-.487-.378-.93M12.843 22.535a1 1 0 0 1-1.034.964l-.259-.009a1 1 0 0 1-.257-.042q-.125.029-.26.024l-.257-.009a11 11 0 0 1-2.102-.279 1 1 0 0 1 .457-1.947 9 9 0 0 0 1.715.228l.258.009q.134.004.257.042.125-.028.26-.024l.257.009a1 1 0 0 1 .965 1.034m-6.615-1.329a1 1 0 0 1-1.396.226 10.9 10.9 0 0 1-2.877-3.086 1 1 0 1 1 1.7-1.054 8.9 8.9 0 0 0 2.347 2.518 1 1 0 0 1 .226 1.396M1.622 15.22a1 1 0 0 1-1.147-.827 10.9 10.9 0 0 1 .148-4.218 1 1 0 0 1 1.947.457 8.9 8.9 0 0 0-.12 3.441 1 1 0 0 1-.828 1.147m.978-7.49a1 1 0 0 1-.226-1.397A10.9 10.9 0 0 1 5.46 3.455a1 1 0 0 1 1.054 1.7 8.9 8.9 0 0 0-2.518 2.347 1 1 0 0 1-1.396.226m5.988-4.607a1 1 0 0 1 .827-1.147 11 11 0 0 1 2.116-.132l.258.01q.135.004.257.042.125-.03.26-.025l.258.01a1 1 0 0 1-.07 1.998l-.258-.009a1 1 0 0 1-.258-.043q-.125.03-.259.025l-.258-.009a9 9 0 0 0-1.727.108 1 1 0 0 1-1.146-.828"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-blur_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconCrop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-crop_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.13 1.009a1 1 0 1 0-2-.018l-.036 4.103-4.103.036a1 1 0 1 0 .018 2l4.068-.035L5 15.99V16a3 3 0 0 0 3 3h9v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V8a3 3 0 0 0-3-3l-8.905.077zm-.053 6.068L7 16.004A1 1 0 0 0 8 17h9V8a1 1 0 0 0-.996-1z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-crop_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconUndo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.707 13.707a1 1 0 0 0 0-1.414L5.414 8l4.293-4.293a1 1 0 0 0-1.414-1.414l-5 5a1 1 0 0 0 0 1.414l5 5a1 1 0 0 0 1.414 0",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 20a1 1 0 0 0 1-1v-7a5 5 0 0 0-5-5H4a1 1 0 1 0 0 2h12a3 3 0 0 1 3 3v7a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),ImageEditorToolbar=({historyCount:tt,handle:et})=>{const{t:rt}=useTranslation(),[nt,st]=reactExports.useState(void 0),ot=lt=>{st(lt),et(lt)},at=[{type:"button",name:"undo",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconUndo,{}),"aria-label":rt("cancel"),children:rt("cancel"),onClick:()=>ot("UNDO"),disabled:tt===0},tooltip:rt("cancel")},{type:"divider",name:"div-1"},{type:"button",name:"reset",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),"aria-label":rt("rotate"),children:rt("rotate"),onClick:()=>ot("ROTATE")},tooltip:rt("rotate")},{type:"button",name:"crop",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconCrop,{}),"aria-label":rt("crop"),children:rt("crop"),className:nt==="CROP"?"is-selected":"",onClick:()=>ot("CROP")},tooltip:rt("crop")},{type:"button",name:"blur",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBlur,{}),"aria-label":rt("blur"),children:rt("blur"),className:nt==="BLUR"?"is-selected":"",onClick:()=>ot("BLUR")},tooltip:rt("blur")}];return jsxRuntimeExports.jsx(Toolbar,{variant:"no-shadow",align:"left",isBlock:!0,items:at})},ImageEditor=({altText:tt,legend:et,image:rt,isOpen:nt,onCancel:st,onError:ot,onSave:at})=>{const{t:lt}=useTranslation(),[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(!1),[mt,xt]=reactExports.useState(tt??""),[yt,vt]=reactExports.useState(et??""),[Et,bt]=reactExports.useState(!1),{toBlob:St,setApplication:wt,startBlur:Rt,stopBlur:Ct,restore:Pt,rotate:It,startCrop:jt,stopCrop:Dt,startResize:Vt,stopResize:Ft,historyCount:Ht,loading:Nt}=useImageEditor({imageSrc:rt}),Lt=()=>{Ct(),Dt(ut==="CROP"),Ft(ut==="RESIZE")},Mt=async()=>{try{ht(!0),Lt();const $t=await St();$t&&await at({blob:$t,legend:yt,altText:mt})}catch($t){ot==null||ot(`${$t}`)}finally{ht(!1)}},zt=()=>{st()},Gt=async $t=>{switch(Lt(),ct($t),bt(!0),$t){case"ROTATE":{await It();break}case"UNDO":{await Pt();break}case"CROP":{jt();break}case"RESIZE":{await Vt();break}case"BLUR":{await Rt();break}}};return jsxRuntimeExports.jsxs(Modal,{id:"image-editor",isOpen:nt,onModalClose:zt,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:zt,children:jsxRuntimeExports.jsx("span",{className:"h2",children:lt("imageeditor.title")})}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex flex-column align-items-center",children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-12 w-100 flex-grow-1",children:[jsxRuntimeExports.jsx(ImageEditorToolbar,{handle:Gt,historyCount:Ht}),jsxRuntimeExports.jsxs("div",{className:"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor",children:[jsxRuntimeExports.jsx(moduleExports.Stage,{onMount:$t=>wt($t),options:{preserveDrawingBuffer:!0,backgroundAlpha:0,resolution:1}}),!!Nt&&jsxRuntimeExports.jsx("div",{className:"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25",children:jsxRuntimeExports.jsx(LoadingScreen,{})})]}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row m-10 gap-12 w-100",children:[jsxRuntimeExports.jsxs(FormControl,{id:"alt",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("alttext")}),jsxRuntimeExports.jsx(Input,{value:mt,onChange:$t=>{bt(!0),xt($t.target.value)},placeholder:lt("alttext.help"),size:"md",type:"text"})]}),jsxRuntimeExports.jsxs(FormControl,{id:"legend",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("legend")}),jsxRuntimeExports.jsx(Input,{value:yt,onChange:$t=>{bt(!0),vt($t.target.value)},placeholder:lt("legend.help"),size:"md",type:"text"})]})]})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:zt,type:"button",variant:"ghost",children:lt("imageeditor.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:Mt,type:"button",variant:"filled",isLoading:dt,disabled:dt||!Et,children:lt("imageeditor.save")})]})]})},UploadFiles=({onFilesChange:tt,visibility:et="protected"})=>{const{files:rt,uploadedFiles:nt,getUploadStatus:st,uploadFile:ot,removeFile:at,updateImage:lt,editingImage:ut,setEditingImage:ct,getUrl:dt}=useUploadFiles({handleOnChange:tt,application:"media-library",visibility:et}),ht=reactExports.useRef(new Map);reactExports.useEffect(()=>{const yt=ht.current;return()=>{yt.forEach(vt=>URL.revokeObjectURL(vt)),yt.clear()}},[]);const mt=yt=>{const vt=yt.type.startsWith("image")?ht.current.get(yt.name):"";return ht.current.has(yt.name)||ht.current.set(yt.name,URL.createObjectURL(yt)),{name:yt.name,info:{type:yt.type,weight:c$3(yt.size||0,1)},src:vt}},xt=yt=>{const vt=ht.current.get(yt.name);vt&&(URL.revokeObjectURL(vt),ht.current.delete(yt.name)),at(yt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rt.map(yt=>{const vt=nt.find(Et=>Et.name===yt.name);return jsxRuntimeExports.jsx(UploadCard,{status:st(yt),item:mt(yt),onEdit:()=>ct(vt),onRetry:()=>ot(yt),onDelete:()=>xt(yt)},yt.name)}),ut&&jsxRuntimeExports.jsx(ImageEditor,{altText:ut.alt,legend:ut.title,image:dt(ut,!0),isOpen:!!ut,onCancel:()=>ct(void 0),onSave:lt,onError:console.error})]})},acceptedTypes=tt=>{const et=[];switch(tt){case"audio":et.push("audio/*");break;case"video":et.push("video/*");break;case"image":et.push("image/png"),et.push("image/jpeg"),et.push("image/webp"),et.push("image/gif"),et.push("image/avif");break}return et},Upload=()=>{const{type:tt,visibility:et,multiple:rt,setResult:nt,setResultCounter:st,setCancellable:ot}=useMediaLibraryContext(),at=lt=>{lt.length?(ot(lt),st(lt.length),nt(lt)):(ot([]),st(void 0),nt(void 0))};return jsxRuntimeExports.jsx("div",{className:"py-8 flex-grow-1",children:jsxRuntimeExports.jsx(Dropzone,{multiple:rt,accept:acceptedTypes(tt??"embedder"),children:jsxRuntimeExports.jsx(UploadFiles,{onFilesChange:at,visibility:et})})})},SvgIconRecordStop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z"})]}),VIDEO_HEIGHT=9,VIDEO_WIDTH=16,VideoRecorder=reactExports.forwardRef(({appCode:tt,caption:et,onSuccess:rt,onError:nt,onRecordUpdated:st,hideSaveAction:ot=!1},at)=>{const[lt,ut]=reactExports.useState(18e4),[ct,dt]=reactExports.useState([]),[ht,mt]=reactExports.useState(!1),[xt,yt]=reactExports.useState(!1),[vt,Et]=reactExports.useState(!1),[bt,St]=reactExports.useState(!1),[wt,Rt]=reactExports.useState(!1),[Ct,Pt]=reactExports.useState({audio:!0,video:{facingMode:"environment",aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT}}),[It,jt]=reactExports.useState(),[Dt,Vt]=reactExports.useState(""),[Ft,Ht]=reactExports.useState([]),[Nt,Lt]=reactExports.useState(),[Mt,zt]=reactExports.useState(0),[Gt,$t]=reactExports.useState(0),Ut=reactExports.useRef(null),Bt=reactExports.useRef(null),{uploadBlob:Yt}=useUpload(void 0,tt),{device:Zt}=useBrowserInfo(navigator.userAgent);reactExports.useImperativeHandle(at,()=>({save:hr}));const{t:Xt}=useTranslation();reactExports.useEffect(()=>{rr(),cr()},[]),reactExports.useEffect(()=>(It||ur(Ct),()=>{It&&It.getTracks().forEach(Sr=>Sr.stop())}),[It]),reactExports.useEffect(()=>{if(Ft.length&&!ht&&Ut.current){const Sr=new Blob(Ft,{type:Dt});if(Lt(Sr),st){const kr=window.URL.createObjectURL(Sr);st(kr)}Ut.current.autoplay=!1,Ut.current.srcObject=null,Ut.current.src=window.URL.createObjectURL(Sr)}},[ht,Ft]),reactExports.useEffect(()=>{if(ht){const Sr=Date.now(),kr=window.setInterval(()=>zt(Date.now()-Sr),500);return()=>{window.clearInterval(kr)}}},[ht]),reactExports.useEffect(()=>{if(vt){const Sr=window.setInterval(()=>$t(kr=>kr+500),500);return()=>{window.clearInterval(Sr)}}},[vt]);const rr=async()=>{const Sr=await odeServices.video().getVideoConf();ut((Sr.maxDuration??3)*60*1e3)},cr=async()=>{const Sr=(await navigator.mediaDevices.enumerateDevices()).filter(kr=>kr.kind==="videoinput");switch(Zt.type){case"mobile":case"tablet":{const kr={deviceId:"environment",label:Xt("video.back.camera"),groupId:"",kind:"videoinput"},Zr={deviceId:"user",label:Xt("video.front.camera"),groupId:"",kind:"videoinput"};(Sr==null?void 0:Sr.length)>1?dt([kr,Zr]):dt([kr]);break}default:dt(Sr);break}},ur=async Sr=>{try{const kr=await navigator.mediaDevices.getUserMedia(Sr);jt(kr),Ut.current&&(Ut.current.src&&(window.URL.revokeObjectURL(Ut.current.src),Ut.current.src=""),Ut.current.srcObject=kr,Ut.current.autoplay=!0,Ut.current.volume=1,Ut.current.muted=!0)}catch(kr){console.error(kr)}},mr=reactExports.useCallback(()=>{mt(!0),Ut&&Ut.current&&(Ut.current.muted=!0);const Sr=o$3();Vt(Sr),It&&(Bt.current=new MediaRecorder(It,{mimeType:Sr}),Bt.current.ondataavailable=({data:kr})=>{kr.size>0&&Ht(Zr=>[...Zr,kr])},Bt.current.onerror=kr=>console.error(kr),Bt.current.start(1e3))},[It]),vr=reactExports.useCallback(()=>{var Sr;mt(!1),yt(!0),((Sr=Bt.current)==null?void 0:Sr.state)==="recording"&&(Bt.current.requestData(),Bt.current.stop())},[Bt]),Er=reactExports.useCallback(()=>{var Sr,kr;Ut&&Ut.current&&(Ut.current.muted=!1),vt?((kr=Ut==null?void 0:Ut.current)==null||kr.pause(),Et(!1)):((Sr=Ut==null?void 0:Ut.current)==null||Sr.play(),Et(!0))},[vt]),br=()=>{yt(!1),mt(!1),Et(!1),Rt(!1),zt(0),Ht([]),Lt(void 0),ur(Ct),st&&st()},hr=async()=>{var Sr;if((Sr=Ut==null?void 0:Ut.current)==null||Sr.pause(),St(!0),!Nt){console.error("Error while saving video: recorded video is undefined.");return}const kr=await Yt(Nt,{duration:Mt});if(kr!=null)return rt==null||rt([kr]),St(!1),Rt(!0),[kr];nt("Error while uploading video"),St(!1),Rt(!0)},Ar=()=>{Et(!1),$t(0),Ut.current&&(Ut.current.currentTime=0)},Cr=Sr=>{var kr;const Zr=ct.find(er=>er.label===Sr);let qt={};Zr!=null&&Zr.deviceId?((Zr==null?void 0:Zr.deviceId)==="environment"||(Zr==null?void 0:Zr.deviceId)==="user"?qt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,facingMode:Zr==null?void 0:Zr.deviceId}}:qt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,deviceId:Zr.deviceId}},Pt(qt),It&&(((kr=Bt.current)==null?void 0:kr.state)==="recording"&&(Bt.current.requestData(),Bt.current.stop()),It.getTracks().forEach(er=>er.stop()),jt(void 0)),ur(qt)):console.error("Selected input device id is null")};reactExports.useEffect(()=>{Mt>=lt&&vr()},[Mt,vr]);const Ur=[{type:"icon",name:"record",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{color:ht||xt?"":"red"}),color:"danger",disabled:ht||xt||bt,onClick:mr,"aria-label":Xt("bbm.video.record.start")},tooltip:Xt("bbm.video.record.start")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordStop,{}),disabled:!ht||xt||bt,onClick:vr,"aria-label":Xt("bbm.video.record.stop")},tooltip:Xt("bbm.video.record.stop")},{type:"icon",name:"play",visibility:vt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:!xt||bt,onClick:Er,"aria-label":Xt("bbm.video.play.start")},tooltip:Xt("bbm.video.play.start")},{type:"icon",name:"pause",visibility:vt?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),disabled:!xt||bt,onClick:Er,"aria-label":Xt("bbm.video.play.pause")},tooltip:Xt("bbm.video.play.pause")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:!xt||bt,onClick:br,"aria-label":Xt("bbm.video.record.reset")},tooltip:Xt("bbm.video.record.reset")},{type:"icon",name:"save",visibility:ot?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:!xt||bt||wt,onClick:hr,"aria-label":Xt("bbm.video.record.save")},tooltip:Xt("bbm.video.record.save")}];return jsxRuntimeExports.jsxs("div",{className:"video-recorder d-flex flex-fill flex-column align-items-center pb-8",children:[jsxRuntimeExports.jsx("div",{className:"video-recorder-caption d-none d-md-block",children:et}),ct.length>1&&jsxRuntimeExports.jsx("div",{className:"video-recorder-devices mb-12",children:jsxRuntimeExports.jsxs(FormControl,{id:"selectInputDevice",children:[jsxRuntimeExports.jsx(Label,{className:"d-none d-md-block",children:Xt("bbm.video.record.select.devices.label")}),jsxRuntimeExports.jsx(Select,{placeholderOption:Xt("bbm.video.record.select.devices.placeholder"),options:ct.map(Sr=>Sr.label),onValueChange:Cr})]})}),jsxRuntimeExports.jsxs("div",{className:"video-recorder-video-container position-relative align-self-stretch",children:[jsxRuntimeExports.jsx("video",{ref:Ut,playsInline:!0,autoPlay:!0,controls:!1,muted:!0,onEnded:Ar,className:"rounded",children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),(ht||xt)&&jsxRuntimeExports.jsxs("div",{className:"video-recorder-time d-flex align-items-center font-monospace fs-6 text-bg-dark rounded",children:[ht&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,color:"red",className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$2(Mt),"/",n$2(lt)]})]}),xt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecordVideo,{width:14,height:14,className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$2(Gt),"/",n$2(Mt)]})]})]}),It&&jsxRuntimeExports.jsx(Toolbar,{items:Ur,className:"position-absolute bottom-0 start-50 bg-white"})]}),bt&&jsxRuntimeExports.jsx(LoadingScreen,{position:!1,caption:Xt("bbm.video.save.loader.caption")})]})}),Video=()=>{const{appCode:tt,setResult:et,setPreSuccess:rt}=useMediaLibraryContext(),{t:nt}=useTranslation(),st=reactExports.useRef(null),ot=lt=>{lt?(et(lt),rt(()=>st.current.save)):et()},at=lt=>{console.error(lt)};return jsxRuntimeExports.jsx(VideoRecorder,{ref:st,appCode:tt,caption:nt("bbm.video.caption"),onRecordUpdated:ot,onError:at,hideSaveAction:!0})},SvgIconArrowRight=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"})]}),illuError="/assets/js/ode-explorer/illu-error.svg",illuError$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuError},Symbol.toStringTag,{value:"Module"})),VideoEmbed=({switchType:tt,onSuccess:et})=>{const{t:rt}=useTranslation(),[nt,st]=reactExports.useState(),[ot,at]=reactExports.useState(),[lt,ut]=reactExports.useState(void 0),[ct,dt]=reactExports.useState(),ht=useDebounce(nt||"",300),mt=reactExports.useId();reactExports.useEffect(()=>{xt()},[]),reactExports.useEffect(()=>{if(ct&&ht){const bt=odeServices.embedder().getProviderFromUrl(ct,ht);if(bt){ut(bt);const St=odeServices.embedder().getEmbedCodeForProvider(bt,ht);at(St),et(St)}else ut(void 0),et()}},[ht,ct]);const xt=async()=>{const bt=await Promise.all([odeServices.embedder().getDefault(),odeServices.embedder().getCustom()]).then(St=>St.flat());dt(bt)};function yt(bt){const St=bt.currentTarget.value;st(St),et(St!=null&&St.length?St:void 0)}function vt(){tt==null||tt("embedder")}const Et=()=>ht?lt?jsxRuntimeExports.jsxs("div",{className:"mx-auto mt-16",children:[jsxRuntimeExports.jsxs("div",{className:"video-embed-provider d-flex align-items-center",children:[jsxRuntimeExports.jsx(Image$1,{src:lt.logo,alt:"Logo "+lt.displayName,className:"video-embed-provider-logo"}),lt.displayName]}),ot&&jsxRuntimeExports.jsx("div",{className:"video-embed-preview mt-12",dangerouslySetInnerHTML:{__html:ot}})]}):jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column align-items-center m-16",children:[jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,title:rt("bbm.video.previewError.title"),text:rt("bbm.video.previewError.text")}),tt&&jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:vt,className:"align-items-start mt-16",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]}):tt&&jsxRuntimeExports.jsx("div",{className:"d-flex my-16 align-items-start",children:jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:vt,className:"align-items-start",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})});return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill video-embed",children:[jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconGlobe,{className:"me-8"}),rt("bbm.video.url.title")]}),jsxRuntimeExports.jsx(FormControl,{id:mt,children:jsxRuntimeExports.jsx(Input,{size:"md",type:"text",placeholder:rt("bbm.video.url.placeholder"),onChange:yt})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et()})]})},VideoEmbedder=()=>{const{switchType:tt,setResult:et}=useMediaLibraryContext();return jsxRuntimeExports.jsx(VideoEmbed,{switchType:tt,onSuccess:rt=>{et(rt)}})},SvgIconSortAscendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 16.293a1 1 0 0 1 1.414 0L7 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 4a1 1 0 0 1 1 1v15a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconSortDescendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 8.707a1 1 0 0 0 1.414 0L7 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-3-3a1 1 0 0 0-1.414 0l-3 3a1 1 0 0 0 0 1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 21a1 1 0 0 0 1-1V5a1 1 0 0 0-2 0v15a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),SvgIconSortTime=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.509 6.027a6.138 6.138 0 1 1-.28 12.099 1 1 0 1 0-.383 1.963A8.138 8.138 0 1 0 9.653 5.488a1 1 0 1 0 1.168 1.624 6.1 6.1 0 0 1 2.688-1.085",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.38 8.252a1 1 0 0 0-1 1v3.8a1 1 0 0 0 .456.838l2.052 1.332a1 1 0 0 0 1.089-1.678l-1.597-1.036V9.252a1 1 0 0 0-1-1M1.793 16.293a1 1 0 0 1 1.414 0L5.5 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 4a1 1 0 0 0-1 1v15a1 1 0 1 0 2 0V5a1 1 0 0 0-1-1",clipRule:"evenodd"})]}),illuTrash="/assets/js/ode-explorer/illu-trash.svg",illuTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTrash},Symbol.toStringTag,{value:"Module"})),SvgIconLandscape=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.222 5.037c-.895 0-1.222.555-1.222.792v12.675c0 .237.327.792 1.222.792h1.364l9.707-9.886a.987.987 0 0 1 1.414 0L21 13.782V5.829c0-.237-.328-.792-1.222-.792zM23 16.224V5.829C23 4.066 21.337 3 19.778 3H4.222C2.662 3 1 4.066 1 5.83v12.674c0 1.763 1.662 2.829 3.222 2.829h15.556c1.56 0 3.222-1.066 3.222-2.83v-2.279m-2 .439-5-5.093-7.585 7.726h11.363c.894 0 1.222-.555 1.222-.792zM8 8.093c-.552 0-1 .455-1 1.018a1.01 1.01 0 0 0 1 1.018c.552 0 1-.456 1-1.018a1.01 1.01 0 0 0-1-1.019M5 9.11c0-1.688 1.343-3.056 3-3.056s3 1.368 3 3.056-1.343 3.055-3 3.055-3-1.368-3-3.055",clipRule:"evenodd"})]}),SvgIconTextPage=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.286 3c-.35 0-.68.135-.92.368-.238.231-.366.54-.366.854v15.556c0 .315.128.623.367.854.239.233.569.368.919.368h11.428c.35 0 .68-.135.92-.368.238-.231.366-.54.366-.854V8h-3a2 2 0 0 1-2-2V3zM16 6h1.986L16 4.08zm5 13.778V6.556a1 1 0 0 0-.305-.72L15.98 1.281A1 1 0 0 0 15.286 1h-9a3.32 3.32 0 0 0-2.314.934A3.2 3.2 0 0 0 3 4.222v15.556c0 .864.353 1.686.972 2.288S5.423 23 6.286 23h11.428c.863 0 1.695-.333 2.314-.934.619-.602.972-1.424.972-2.288M8 6a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1m5 4a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2z",clipRule:"evenodd"})]}),SvgIconVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 4.962C4 4.376 4.435 4 4.853 4H6.5v2H4zM4 8h2.5v3H4zm-2 4V4.962C2 3.381 3.224 2 4.853 2h13.294C19.776 2 21 3.38 21 4.962v14.076C21 20.619 19.776 22 18.147 22H4.853C3.224 22 2 20.62 2 19.038zm17-6V4.962c0-.586-.435-.962-.853-.962H16.5v2zm0 2h-2.5v3H19zm-2.5 5H19v3h-2.5zm0 5H19v1.038c0 .586-.435.962-.853.962H16.5zm-2-7V4h-6v7zm-6 2h6v7h-6zm-2 5v2H4.853C4.435 20 4 19.624 4 19.038V18zm0-2v-3H4v3z",clipRule:"evenodd"})]}),FileIcon=({type:tt,roleMap:et})=>{const rt=typeof(et==null?void 0:et.icon)!="string"&&tt!=="unknown",nt=clsx("position-absolute top-50 start-50 translate-middle",{"p-12 rounded-circle shadow":rt},et==null?void 0:et.color);return jsxRuntimeExports.jsx("div",{className:nt,children:(et==null?void 0:et.icon)??jsxRuntimeExports.jsx(SvgIconPaperclip,{})})};var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(tt){return tt?(RootIds.has(tt)||(rootId+=1,RootIds.set(tt,rootId.toString())),RootIds.get(tt)):"0"}function optionsToId(tt){return Object.keys(tt).sort().filter(et=>tt[et]!==void 0).map(et=>`${et}_${et==="root"?getRootId(tt.root):tt[et]}`).toString()}function createObserver(tt){let et=optionsToId(tt),rt=observerMap.get(et);if(!rt){const nt=new Map;let st;const ot=new IntersectionObserver(at=>{at.forEach(lt=>{var ut;const ct=lt.isIntersecting&&st.some(dt=>lt.intersectionRatio>=dt);tt.trackVisibility&&typeof lt.isVisible>"u"&&(lt.isVisible=ct),(ut=nt.get(lt.target))==null||ut.forEach(dt=>{dt(ct,lt)})})},tt);st=ot.thresholds||(Array.isArray(tt.threshold)?tt.threshold:[tt.threshold||0]),rt={id:et,observer:ot,elements:nt},observerMap.set(et,rt)}return rt}function observe(tt,et,rt={},nt=unsupportedValue){if(typeof window.IntersectionObserver>"u"&&nt!==void 0){const ut=tt.getBoundingClientRect();return et(nt,{isIntersecting:nt,target:tt,intersectionRatio:typeof rt.threshold=="number"?rt.threshold:0,time:0,boundingClientRect:ut,intersectionRect:ut,rootBounds:ut}),()=>{}}const{id:st,observer:ot,elements:at}=createObserver(rt);let lt=at.get(tt)||[];return at.has(tt)||at.set(tt,lt),lt.push(et),ot.observe(tt),function(){lt.splice(lt.indexOf(et),1),lt.length===0&&(at.delete(tt),ot.unobserve(tt)),at.size===0&&(ot.disconnect(),observerMap.delete(st))}}function useInView({threshold:tt,delay:et,trackVisibility:rt,rootMargin:nt,root:st,triggerOnce:ot,skip:at,initialInView:lt,fallbackInView:ut,onChange:ct}={}){var dt;const[ht,mt]=reactExports.useState(null),xt=reactExports.useRef(),[yt,vt]=reactExports.useState({inView:!!lt,entry:void 0});xt.current=ct,reactExports.useEffect(()=>{if(at||!ht)return;let wt;return wt=observe(ht,(Rt,Ct)=>{vt({inView:Rt,entry:Ct}),xt.current&&xt.current(Rt,Ct),Ct.isIntersecting&&ot&&wt&&(wt(),wt=void 0)},{root:st,rootMargin:nt,threshold:tt,trackVisibility:rt,delay:et},ut),()=>{wt&&wt()}},[Array.isArray(tt)?tt.toString():tt,ht,st,nt,ot,at,rt,ut,et]);const Et=(dt=yt.entry)==null?void 0:dt.target,bt=reactExports.useRef();!ht&&Et&&!ot&&!at&&bt.current!==Et&&(bt.current=Et,vt({inView:!!lt,entry:void 0}));const St=[mt,yt.inView,yt.entry];return St.ref=St[0],St.inView=St[1],St.entry=St[2],St}function useThumbnail(tt,et){const[rt,nt]=reactExports.useState(null),{ref:st,inView:ot}=useInView({triggerOnce:!0,...et==null?void 0:et.intersectionOptions});return reactExports.useEffect(()=>{var at;(at=et==null?void 0:et.ref)!=null&&at.current&&(st==null||st(et.ref.current))},[et==null?void 0:et.ref,st]),reactExports.useEffect(()=>{if((et==null?void 0:et.ref)===void 0||ot){const at=new Image;return at.src=tt,at.onload=()=>{nt(!0)},at.onerror=()=>{nt(!1)},()=>{at.onload=null,at.onerror=null,nt(null)}}},[ot]),rt}const FileCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:nt=!1,onClick:st,className:ot})=>{var at;const lt=reactExports.useRef(null),ut=DocumentHelper.getRole(tt);function ct(yt){const vt={csv:{icon:".CSV",color:"bg-orange-200"},xls:{icon:".XLS",color:"bg-green-200"},doc:{icon:".DOC",color:"bg-blue-200"},txt:{icon:".TXT",color:"bg-blue-200"},pdf:{icon:".PDF",color:"bg-red-200"},audio:{icon:jsxRuntimeExports.jsx(SvgIconMic,{width:22,height:22}),color:"bg-red-200"},ppt:{icon:".PPT",color:"bg-yellow-200"},img:{icon:jsxRuntimeExports.jsx(SvgIconLandscape,{width:22,height:22}),color:"bg-green-200"},video:{icon:jsxRuntimeExports.jsx(SvgIconVideo,{width:22,height:22}),color:"bg-purple-200"},zip:{icon:".ZIP",color:"bg-gray-300"},md:{icon:".MD",color:"bg-blue-200"},unknown:{icon:jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:"bg-gray-300"}};return vt[yt]||vt.unknown}const dt=clsx("file position-relative rounded",((at=ct(ut??"default"))==null?void 0:at.color)??"bg-yellow-200"),ht=ut==="img"||ut==="video"?odeServices.workspace().getThumbnailUrl(tt):null,mt=useThumbnail(ht,{ref:lt}),xt=mt&&{backgroundImage:`url(${ht})`,backgroundSize:"cover"};return jsxRuntimeExports.jsx(Card,{className:clsx("card-file",ot),isClickable:et,isSelectable:rt,isSelected:nt,onClick:st,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{ref:lt,className:dt,style:{aspectRatio:"16/10",...xt},children:ut!=="img"||ut==="img"&&!mt?jsxRuntimeExports.jsx(FileIcon,{type:ut,roleMap:ct(ut)}):null}),jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.ownerName})]})]})})},Workspace$1=({roles:tt,onSelect:et,multiple:rt=!0,className:nt,defaultFolder:st,showPublicFolder:ot})=>{const{t:at}=useTranslation(),{root:lt,loadContent:ut}=useWorkspaceSearch("root",at("workspace.tree.owner"),"owner",tt),{root:ct,loadContent:dt}=useWorkspaceSearch("root",at("workspace.tree.shared"),"shared",tt),{root:ht,loadContent:mt}=useWorkspaceSearch("root",at("workspace.tree.protected"),"protected",tt),{root:xt,loadContent:yt}=useWorkspaceSearch("root",at("workspace.tree.public"),"public",tt),vt=reactExports.useRef(null),Et=reactExports.useRef(null),bt=reactExports.useRef(null),St=reactExports.useRef(null),[wt,Rt]=reactExports.useState(()=>st==="public"?ot?st:"protected":st==="protected"||st==="shared"?st:"owner"),[Ct,Pt]=reactExports.useState(()=>st==="public"?ot?xt:ht:st==="protected"?ht:st==="shared"?ct:lt),[It,jt]=reactExports.useState(),[Dt,Vt]=reactExports.useState(null),[Ft,Ht]=reactExports.useState(["modified","desc"]),[Nt,Lt]=reactExports.useState([]),Mt=reactExports.useCallback(Xt=>{switch(Xt){case"owner":return{root:lt,othersRef:[Et,bt,St]};case"shared":return{root:ct,othersRef:[vt,bt,St]};case"protected":return{root:ht,othersRef:[vt,Et,St]};case"public":return{root:xt,othersRef:[vt,Et,bt]};default:throw"no.root.node"}},[lt,ct,ht,xt]),zt=reactExports.useCallback(()=>{switch(wt){case"owner":ut(Ct.id);break;case"shared":dt(Ct.id);break;case"protected":mt(Ct.id);break;case"public":yt(Ct.id);break;default:throw"no.way"}},[wt,Ct.id,ut,mt,yt,dt]);function Gt(Xt,rr){Rt(Xt);const{root:cr,othersRef:ur}=Mt(Xt),mr=findTreeNode(cr,vr=>vr.id===rr);mr&&(Pt(mr),ur.forEach(vr=>{var Er;return(Er=vr.current)==null?void 0:Er.unselectAll()}))}reactExports.useEffect(()=>{var Xt;let rr;switch(wt){case"owner":rr=vt;break;case"shared":rr=Et;break;case"protected":rr=bt;break;case"public":rr=St;break;default:return}(Xt=rr==null?void 0:rr.current)==null||Xt.select("root")},[wt]),reactExports.useEffect(zt,[zt]),reactExports.useEffect(()=>{if(Ct.files){let Xt=[].concat(Ct.files);Dt&&(Xt=Xt.filter(cr=>cr.name.indexOf(Dt)>=0));const rr=Ft[0]==="name"?Ft[1]==="asc"?(cr,ur)=>Ut(cr.name,ur.name):(cr,ur)=>Ut(ur.name,cr.name):(cr,ur)=>Ut(ur.modified,cr.modified);jt(()=>Xt.sort(rr))}else jt(void 0)},[Ct,lt,ht,ct,xt,Dt,Ft]);const $t=reactExports.useCallback(Xt=>{Vt(Xt.target.value)},[Vt]);function Ut(Xt,rr){return Xt?rr?Xt.localeCompare(rr):1:-1}function Bt(){return Ft[0]==="name"?Ft[1]==="asc"?at("sort.order.alpha.asc"):at("sort.order.alpha.desc"):at("sort.order.modify.desc")}function Yt(Xt){let rr=[...Nt];rt?rr.includes(Xt)?rr=rr.filter(cr=>cr._id!==Xt._id):rr=[...rr,Xt]:rr=[Xt],Lt(rr),et(rr)}const Zt=clsx("workspace flex-grow-1 gap-0",nt);return jsxRuntimeExports.jsxs(Grid,{className:Zt,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"3",xl:"4",className:"workspace-folders p-12 pt-0 gap-12",children:jsxRuntimeExports.jsxs("div",{style:{position:"sticky",top:0,paddingTop:"1.2rem"},children:[jsxRuntimeExports.jsx(TreeView,{ref:vt,data:lt,onTreeItemClick:Xt=>Gt("owner",Xt),onTreeItemUnfold:Xt=>Gt("owner",Xt)}),jsxRuntimeExports.jsx(TreeView,{ref:Et,data:ct,onTreeItemClick:Xt=>Gt("shared",Xt),onTreeItemUnfold:Xt=>Gt("shared",Xt)}),jsxRuntimeExports.jsx(TreeView,{ref:bt,data:ht,onTreeItemClick:Xt=>Gt("protected",Xt),onTreeItemUnfold:Xt=>Gt("protected",Xt)}),ot&&jsxRuntimeExports.jsx(TreeView,{ref:St,data:xt,onTreeItemClick:Xt=>Gt("public",Xt),onTreeItemUnfold:Xt=>Gt("public",Xt)})]})}),jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"5",xl:"8",children:jsxRuntimeExports.jsxs(Grid,{className:"flex-grow-1 gap-0",children:[jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",xl:"12",children:[jsxRuntimeExports.jsx("div",{className:"workspace-search px-16 py-8 ",children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,className:"gap-16",onChange:$t})}),jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-end px-8 py-4",children:[jsxRuntimeExports.jsx("small",{className:"text-muted",children:at("workspace.search.order")}),jsxRuntimeExports.jsxs(Dropdown,{children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"sm",label:Bt(),variant:"ghost"}),jsxRuntimeExports.jsxs(Dropdown.Menu,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortTime,{}),onClick:()=>Ht(["modified","desc"]),children:at("sort.order.modify.desc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortAscendingLetters,{}),onClick:()=>Ht(["name","asc"]),children:at("sort.order.alpha.asc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortDescendingLetters,{}),onClick:()=>Ht(["name","desc"]),children:at("sort.order.alpha.desc")})]})]})]})]}),jsxRuntimeExports.jsx(Grid.Col,{sm:"4",md:"8",xl:"12",className:"p-8 gap-8",children:It?It.length!==0?jsxRuntimeExports.jsx("div",{className:"grid grid-workspace",children:It.map(Xt=>{const rr=Nt.includes(Xt);return jsxRuntimeExports.jsx(FileCard,{doc:Xt,isSelected:rr,onClick:()=>Yt(Xt)},Xt._id)})}):jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,text:at("workspace.empty.docSpace"),title:at("explorer.emptyScreen.trash.title")}):jsxRuntimeExports.jsx(LoadingScreen,{})})]})})]})},Workspace=()=>{const{type:tt,setResultCounter:et,setResult:rt,multiple:nt,visibility:st}=useMediaLibraryContext();function ot(){switch(tt){case"image":return"img";case"audio":return"audio";case"video":return"video";default:return null}}function at(lt){et(lt.length),lt.length?rt(lt):rt()}return jsxRuntimeExports.jsx(Workspace$1,{roles:ot(),onSelect:at,multiple:nt,className:"border rounded overflow-y-auto",defaultFolder:st,showPublicFolder:st==="public"})},InnerTabs={Audio,Video,Upload,ExternalLink,Workspace,InternalLink,Iframe,VideoEmbedder},orderedTabs=["audio-capture","video-capture","internal-link","external-link","iframe","upload","workspace","video-embedder"],mediaLibraryTypes={none:null,audio:{title:"bbm.audio.modal.title",defaultTab:"audio-capture"},video:{title:"bbm.video.modal.title",defaultTab:"video-capture"},image:{title:"bbm.image.modal.title",defaultTab:"workspace"},attachment:{title:"bbm.attachment.modal.title",defaultTab:"workspace"},hyperlink:{title:"bbm.link.modal.title",defaultTab:"linker"},embedder:{title:"bbm.embed.modal.title",defaultTab:"iframe"}},MediaLibrary=reactExports.forwardRef(({appCode:tt,visibility:et,multiple:rt,onSuccess:nt,onCancel:st,onTabChange:ot},at)=>{var lt;const ut=reactExports.useRef(),ct=reactExports.useRef(null);reactExports.useImperativeHandle(at,()=>({show:Lt,hide:Mt,showLink:zt,type:xt,...ct.current})),useHttpErrorToast({isDismissible:!0,duration:1/0});const{t:dt}=useTranslation(),ht=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"),mt=useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),[xt,yt]=reactExports.useState(null),vt={workspace:{id:"workspace",icon:jsxRuntimeExports.jsx(SvgIconFolder,{}),label:dt("bbm.workspace"),content:jsxRuntimeExports.jsx(InnerTabs.Workspace,{}),availableFor:["audio","video","image","attachment"],isEnable:null},upload:{id:"upload",icon:jsxRuntimeExports.jsx(SvgIconSmartphone,{}),label:dt("bbm.device"),content:jsxRuntimeExports.jsx(InnerTabs.Upload,{}),availableFor:["audio","video","image","attachment"],isEnable:()=>!!ht},"video-capture":{id:"video-capture",icon:jsxRuntimeExports.jsx(SvgIconRecordVideo,{}),label:dt("bbm.video"),content:jsxRuntimeExports.jsx(InnerTabs.Video,{}),availableFor:["video"],isEnable:()=>!!mt},"audio-capture":{id:"audio-capture",icon:jsxRuntimeExports.jsx(SvgIconMic,{}),label:dt("bbm.audio"),content:jsxRuntimeExports.jsx(InnerTabs.Audio,{}),availableFor:["audio"],isEnable:()=>!!ht},"external-link":{id:"external-link",icon:jsxRuntimeExports.jsx(SvgIconGlobe,{}),label:dt("bbm.linker.ext"),content:jsxRuntimeExports.jsx(InnerTabs.ExternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},"internal-link":{id:"internal-link",icon:jsxRuntimeExports.jsx(SvgIconApplications,{}),label:dt("bbm.linker.int"),content:jsxRuntimeExports.jsx(InnerTabs.InternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},iframe:{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.Iframe,{}),availableFor:["embedder"],isEnable:null},"video-embedder":{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.VideoEmbedder,{}),availableFor:["video"],isEnable:null}},Et=reactExports.useMemo(()=>orderedTabs.map(Zt=>vt[Zt]).filter(Zt=>{var Xt;return((Xt=Zt.isEnable)==null?void 0:Xt.call(Zt))!==!1&&(Zt.availableFor.length===0||Zt.availableFor.includes(xt))}),[xt]),[bt,St]=reactExports.useState(),wt=reactExports.useMemo(()=>{const Zt=Et.findIndex(Xt=>Xt.id===bt);return 0>Zt||Zt>=Et.length?0:Zt},[Et,bt]),[Rt,Ct]=reactExports.useState(),[Pt,It]=reactExports.useState(),[jt,Dt]=reactExports.useState([]),[Vt,Ft]=reactExports.useState();function Ht(Zt){throw Et.findIndex(Xt=>Xt.id===Zt)<0?"tab.not.visible":"not.implemented.yet"}function Nt(Zt){ut.current=void 0,St(void 0),yt(Zt)}const Lt=Zt=>{yt(Zt)},Mt=()=>{yt(null)},zt=Zt=>{ut.current=Zt,"resourceId"in Zt||"appPrefix"in Zt||St("external-link"),yt("hyperlink")};reactExports.useEffect(()=>{var Zt,Xt;const rr=xt||"none";!bt&&typeof((Zt=mediaLibraryTypes[rr])==null?void 0:Zt.defaultTab)=="string"&&St((Xt=mediaLibraryTypes[rr])==null?void 0:Xt.defaultTab)},[bt,xt]);const Gt=dt(((lt=mediaLibraryTypes[xt??"none"])==null?void 0:lt.title)??"bbm"),$t=()=>{ut.current=void 0,It(void 0),Ct(void 0),St(void 0),Ft(void 0),Dt([])},Ut=Zt=>{ot==null||ot(Zt,jt),$t()},Bt=reactExports.useCallback(()=>{const Zt=async Xt=>{Xt instanceof Array&&["protected","public"].findIndex(rr=>rr===et)>=0&&(Xt=await odeServices.workspace().transferDocuments(Xt,tt??"media-library",et)),nt(Xt)};Vt?Vt().then(Xt=>{Zt(Xt)}):Pt&&Zt(Pt),$t()},[Vt,Pt,nt,et,tt]),Yt=()=>{st(jt),$t()};return xt&&jsxRuntimeExports.jsx(MediaLibraryContext.Provider,{value:{appCode:tt,visibility:et,multiple:rt,type:xt,setResultCounter:Ct,setResult:It,setCancellable:Zt=>Dt([...Zt]),setVisibleTab:Ht,switchType:Nt,setPreSuccess:Ft},children:jsxRuntimeExports.jsxs(Modal,{id:"media-library",isOpen:xt!==null,onModalClose:Yt,size:"lg",viewport:!0,scrollable:!0,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Yt,children:Gt}),jsxRuntimeExports.jsx(Tabs,{items:Et,defaultId:Et[wt].id,onChange:Ut,children:Zt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Et.length>1&&jsxRuntimeExports.jsx(Tabs.List,{className:"mt-16"}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex",children:jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:Zt,children:Zt==null?void 0:Zt.content})})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:Yt,children:dt("cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",disabled:typeof Pt>"u",onClick:Bt,children:Rt&&Rt>1?dt("addMultiple",{number:Rt}):dt("add")})]})]})})});function PublishModal$2({isOpen:tt,resourceId:et,onSuccess:rt,onCancel:nt}){const{appCode:st,currentApp:ot}=useEdificeClient(),{ref:at,libraryMedia:lt,...ut}=useMediaLibrary(),{t:ct}=useTranslation(),dt=useResource(st,et),{control:ht,cover:mt,formState:{isDirty:xt,isValid:yt,isSubmitting:vt},handleDeleteImage:Et,handleSubmit:bt,handleUploadImage:St,handlePublish:wt,register:Rt,selectActivities:Ct,selectedActivities:Pt,selectedSubjectAreas:It,selectSubjects:jt}=usePublishModal({resource:dt,onSuccess:rt});return dt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:nt,id:"libraryModal",size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:nt,children:ct("bpr.publish")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:ct("bpr.form.tip")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.general")}),jsxRuntimeExports.jsxs("form",{id:"libraryModalForm",onSubmit:bt(wt),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[jsxRuntimeExports.jsxs("div",{style:{maxWidth:"160px"},children:[jsxRuntimeExports.jsx("div",{className:"form-label",children:ct("bpr.form.publication.cover.title")}),jsxRuntimeExports.jsx(ImagePicker,{app:ot,src:dt==null?void 0:dt.thumbnail,addButtonLabel:ct("bpr.form.publication.cover.upload.add"),deleteButtonLabel:ct("bpr.form.publication.cover.upload.remove"),onUploadImage:St,onDeleteImage:Et,className:"align-self-center",libraryMedia:lt,mediaLibraryRef:at}),!mt&&jsxRuntimeExports.jsx("p",{className:"form-text is-invalid",children:jsxRuntimeExports.jsx("em",{children:ct("bpr.form.publication.cover.upload.required.image")})})]}),jsxRuntimeExports.jsxs("div",{className:"flex-fill",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:dt==null?void 0:dt.name,...Rt("title",{required:!0}),placeholder:ct("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.description")}),jsxRuntimeExports.jsx(TextArea,{...Rt("description",{required:!0}),placeholder:ct("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.infos")}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[jsxRuntimeExports.jsx(ActivitiesDropdown,{control:ht,selectedActivities:Pt,selectActivities:Ct}),jsxRuntimeExports.jsx(SubjectsDropdown,{control:ht,selectedSubjectAreas:It,selectSubjects:jt}),jsxRuntimeExports.jsx(LangSelect,{control:ht})]}),jsxRuntimeExports.jsxs("div",{className:"mb-24",children:[jsxRuntimeExports.jsx("label",{htmlFor:"",className:"form-label",children:ct("bpr.form.publication.age")}),jsxRuntimeExports.jsxs("div",{className:"d-flex gap-8",children:[jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(Ft,Ht)=>parseInt(Ft)<=parseInt(Ht.ageMax)})}),jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(Ft,Ht)=>parseInt(Ft)>=parseInt(Ht.ageMin)})})]})]}),jsxRuntimeExports.jsx("div",{className:"mb-24",children:jsxRuntimeExports.jsxs(FormControl,{id:"keywords",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.keywords")}),jsxRuntimeExports.jsx(Input,{type:"text",...Rt("keyWords"),size:"md",placeholder:ct("bpr.form.publication.keywords.placeholder")})]})}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.licence.text")}),jsxRuntimeExports.jsx(PublishModalFooter,{})]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:nt,type:"button",variant:"ghost",children:ct("cancel")}),jsxRuntimeExports.jsx(Button,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:vt,disabled:!mt||vt||!xt||!yt,children:ct("bpr.form.submit")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:st,ref:at,multiple:!1,visibility:"protected",...ut})]}),document.getElementById("portal")):jsxRuntimeExports.jsx(LoadingScreen,{})}const SvgIconCopy=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.676 3c.284-.672.853-1 1.263-1h11.423c.566 0 1.438.628 1.438 1.923v13.154c0 1.056-.58 1.668-1.1 1.858V6.923C19.7 4.99 18.3 3 16.061 3zm-2.272.007C4.765 1.41 6.056 0 7.939 0h11.423C21.599 0 23 1.99 23 3.923v13.154c0 1.865-1.303 3.782-3.403 3.916C19.235 22.59 17.944 24 16.06 24H4.638C2.401 24 1 22.01 1 20.077V6.923c0-1.865 1.303-3.782 3.404-3.916M3.2 6.923C3.2 5.628 4.072 5 4.638 5h11.423c.567 0 1.439.628 1.439 1.923v13.154c0 1.295-.872 1.923-1.439 1.923H4.638c-.566 0-1.438-.628-1.438-1.923z",clipRule:"evenodd"})]}),defaults=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function objectHash(tt,et){et?et={...defaults,...et}:et=defaults;const rt=createHasher(et);return rt.dispatch(tt),rt.toString()}const defaultPrototypesKeys=Object.freeze(["prototype","__proto__","constructor"]);function createHasher(tt){let et="",rt=new Map;const nt=st=>{et+=st};return{toString(){return et},getContext(){return rt},dispatch(st){return tt.replacer&&(st=tt.replacer(st)),this[st===null?"null":typeof st](st)},object(st){if(st&&typeof st.toJSON=="function")return this.object(st.toJSON());const ot=Object.prototype.toString.call(st);let at="";const lt=ot.length;lt<10?at="unknown:["+ot+"]":at=ot.slice(8,lt-1),at=at.toLowerCase();let ut=null;if((ut=rt.get(st))===void 0)rt.set(st,rt.size);else return this.dispatch("[CIRCULAR:"+ut+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(st))return nt("buffer:"),nt(st.toString("utf8"));if(at!=="object"&&at!=="function"&&at!=="asyncfunction")this[at]?this[at](st):tt.ignoreUnknown||this.unkown(st,at);else{let ct=Object.keys(st);tt.unorderedObjects&&(ct=ct.sort());let dt=[];tt.respectType!==!1&&!isNativeFunction(st)&&(dt=defaultPrototypesKeys),tt.excludeKeys&&(ct=ct.filter(mt=>!tt.excludeKeys(mt)),dt=dt.filter(mt=>!tt.excludeKeys(mt))),nt("object:"+(ct.length+dt.length)+":");const ht=mt=>{this.dispatch(mt),nt(":"),tt.excludeValues||this.dispatch(st[mt]),nt(",")};for(const mt of ct)ht(mt);for(const mt of dt)ht(mt)}},array(st,ot){if(ot=ot===void 0?tt.unorderedArrays!==!1:ot,nt("array:"+st.length+":"),!ot||st.length<=1){for(const ut of st)this.dispatch(ut);return}const at=new Map,lt=st.map(ut=>{const ct=createHasher(tt);ct.dispatch(ut);for(const[dt,ht]of ct.getContext())at.set(dt,ht);return ct.toString()});return rt=at,lt.sort(),this.array(lt,!1)},date(st){return nt("date:"+st.toJSON())},symbol(st){return nt("symbol:"+st.toString())},unkown(st,ot){if(nt(ot),!!st&&(nt(":"),st&&typeof st.entries=="function"))return this.array(Array.from(st.entries()),!0)},error(st){return nt("error:"+st.toString())},boolean(st){return nt("bool:"+st)},string(st){nt("string:"+st.length+":"),nt(st)},function(st){nt("fn:"),isNativeFunction(st)?this.dispatch("[native]"):this.dispatch(st.toString()),tt.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(st.name)),tt.respectFunctionProperties&&this.object(st)},number(st){return nt("number:"+st)},xml(st){return nt("xml:"+st.toString())},null(){return nt("Null")},undefined(){return nt("Undefined")},regexp(st){return nt("regex:"+st.toString())},uint8array(st){return nt("uint8array:"),this.dispatch(Array.prototype.slice.call(st))},uint8clampedarray(st){return nt("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(st))},int8array(st){return nt("int8array:"),this.dispatch(Array.prototype.slice.call(st))},uint16array(st){return nt("uint16array:"),this.dispatch(Array.prototype.slice.call(st))},int16array(st){return nt("int16array:"),this.dispatch(Array.prototype.slice.call(st))},uint32array(st){return nt("uint32array:"),this.dispatch(Array.prototype.slice.call(st))},int32array(st){return nt("int32array:"),this.dispatch(Array.prototype.slice.call(st))},float32array(st){return nt("float32array:"),this.dispatch(Array.prototype.slice.call(st))},float64array(st){return nt("float64array:"),this.dispatch(Array.prototype.slice.call(st))},arraybuffer(st){return nt("arraybuffer:"),this.dispatch(new Uint8Array(st))},url(st){return nt("url:"+st.toString())},map(st){nt("map:");const ot=[...st];return this.array(ot,tt.unorderedSets!==!1)},set(st){nt("set:");const ot=[...st];return this.array(ot,tt.unorderedSets!==!1)},file(st){return nt("file:"),this.dispatch([st.name,st.size,st.type,st.lastModfied])},blob(){if(tt.ignoreUnknown)return nt("[blob]");throw new Error(`Hashing Blob objects is currently not supported
1394
1394
  Use "options.replacer" or "options.ignoreUnknown"
1395
1395
  `)},domwindow(){return nt("domwindow")},bigint(st){return nt("bigint:"+st.toString())},process(){return nt("process")},timer(){return nt("timer")},pipe(){return nt("pipe")},tcp(){return nt("tcp")},udp(){return nt("udp")},tty(){return nt("tty")},statwatcher(){return nt("statwatcher")},securecontext(){return nt("securecontext")},connection(){return nt("connection")},zlib(){return nt("zlib")},context(){return nt("context")},nodescript(){return nt("nodescript")},httpparser(){return nt("httpparser")},dataview(){return nt("dataview")},signal(){return nt("signal")},fsevent(){return nt("fsevent")},tlswrap(){return nt("tlswrap")}}}const nativeFunc="[native code] }",nativeFuncLength=nativeFunc.length;function isNativeFunction(tt){return typeof tt!="function"?!1:Function.prototype.toString.call(tt).slice(-nativeFuncLength)===nativeFunc}class WordArray{constructor(et,rt){et=this.words=et||[],this.sigBytes=rt===void 0?et.length*4:rt}toString(et){return(et||Hex).stringify(this)}concat(et){if(this.clamp(),this.sigBytes%4)for(let rt=0;rt<et.sigBytes;rt++){const nt=et.words[rt>>>2]>>>24-rt%4*8&255;this.words[this.sigBytes+rt>>>2]|=nt<<24-(this.sigBytes+rt)%4*8}else for(let rt=0;rt<et.sigBytes;rt+=4)this.words[this.sigBytes+rt>>>2]=et.words[rt>>>2];return this.sigBytes+=et.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 WordArray([...this.words])}}const Hex={stringify(tt){const et=[];for(let rt=0;rt<tt.sigBytes;rt++){const nt=tt.words[rt>>>2]>>>24-rt%4*8&255;et.push((nt>>>4).toString(16),(nt&15).toString(16))}return et.join("")}},Base64={stringify(tt){const et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rt=[];for(let nt=0;nt<tt.sigBytes;nt+=3){const st=tt.words[nt>>>2]>>>24-nt%4*8&255,ot=tt.words[nt+1>>>2]>>>24-(nt+1)%4*8&255,at=tt.words[nt+2>>>2]>>>24-(nt+2)%4*8&255,lt=st<<16|ot<<8|at;for(let ut=0;ut<4&&nt*8+ut*6<tt.sigBytes*8;ut++)rt.push(et.charAt(lt>>>6*(3-ut)&63))}return rt.join("")}},Latin1={parse(tt){const et=tt.length,rt=[];for(let nt=0;nt<et;nt++)rt[nt>>>2]|=(tt.charCodeAt(nt)&255)<<24-nt%4*8;return new WordArray(rt,et)}},Utf8={parse(tt){return Latin1.parse(unescape(encodeURIComponent(tt)))}};class BufferedBlockAlgorithm{constructor(){this._data=new WordArray,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new WordArray,this._nDataBytes=0}_append(et){typeof et=="string"&&(et=Utf8.parse(et)),this._data.concat(et),this._nDataBytes+=et.sigBytes}_doProcessBlock(et,rt){}_process(et){let rt,nt=this._data.sigBytes/(this.blockSize*4);et?nt=Math.ceil(nt):nt=Math.max((nt|0)-this._minBufferSize,0);const st=nt*this.blockSize,ot=Math.min(st*4,this._data.sigBytes);if(st){for(let at=0;at<st;at+=this.blockSize)this._doProcessBlock(this._data.words,at);rt=this._data.words.splice(0,st),this._data.sigBytes-=ot}return new WordArray(rt,ot)}}class Hasher extends BufferedBlockAlgorithm{update(et){return this._append(et),this._process(),this}finalize(et){et&&this._append(et)}}const H=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],K=[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],W=[];class SHA256 extends Hasher{constructor(){super(...arguments),this._hash=new WordArray([...H])}reset(){super.reset(),this._hash=new WordArray([...H])}_doProcessBlock(et,rt){const nt=this._hash.words;let st=nt[0],ot=nt[1],at=nt[2],lt=nt[3],ut=nt[4],ct=nt[5],dt=nt[6],ht=nt[7];for(let mt=0;mt<64;mt++){if(mt<16)W[mt]=et[rt+mt]|0;else{const wt=W[mt-15],Rt=(wt<<25|wt>>>7)^(wt<<14|wt>>>18)^wt>>>3,Ct=W[mt-2],Pt=(Ct<<15|Ct>>>17)^(Ct<<13|Ct>>>19)^Ct>>>10;W[mt]=Rt+W[mt-7]+Pt+W[mt-16]}const xt=ut&ct^~ut&dt,yt=st&ot^st&at^ot&at,vt=(st<<30|st>>>2)^(st<<19|st>>>13)^(st<<10|st>>>22),Et=(ut<<26|ut>>>6)^(ut<<21|ut>>>11)^(ut<<7|ut>>>25),bt=ht+Et+xt+K[mt]+W[mt],St=vt+yt;ht=dt,dt=ct,ct=ut,ut=lt+bt|0,lt=at,at=ot,ot=st,st=bt+St|0}nt[0]=nt[0]+st|0,nt[1]=nt[1]+ot|0,nt[2]=nt[2]+at|0,nt[3]=nt[3]+lt|0,nt[4]=nt[4]+ut|0,nt[5]=nt[5]+ct|0,nt[6]=nt[6]+dt|0,nt[7]=nt[7]+ht|0}finalize(et){super.finalize(et);const rt=this._nDataBytes*8,nt=this._data.sigBytes*8;return this._data.words[nt>>>5]|=128<<24-nt%32,this._data.words[(nt+64>>>9<<4)+14]=Math.floor(rt/4294967296),this._data.words[(nt+64>>>9<<4)+15]=rt,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function sha256base64(tt){return new SHA256().finalize(tt).toString(Base64)}function hash(tt,et={}){const rt=typeof tt=="string"?tt:objectHash(tt,et);return sha256base64(rt).slice(0,10)}var slugify$1={};Object.defineProperty(slugify$1,"__esModule",{value:!0});const stripAccents=tt=>{const et="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",rt="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",nt=et.split("").join("|"),st=new RegExp(`(${nt})`,"g");function ot(at){return rt[et.indexOf(at)]||""}return tt.replace(st,ot)},getSafeRegexpString=tt=>tt.split("").map(et=>`\\${et}`).join(""),harmonize=(tt,et,rt=!1)=>{const nt=stripAccents(tt).trim().toLowerCase(),st=getSafeRegexpString(et);return rt?nt.replace(/\s+/g,et):nt.replace(new RegExp(`[^a-z0-9${st}]+`,"g"),et).replace(new RegExp(`${st}+`,"g"),et).replace(new RegExp(`^${st}`,"g"),"").replace(new RegExp(`${st}$`,"g"),"")},slugify=(tt,et={delimiter:"-",prefix:""})=>{if(et.delimiter||(et.delimiter="-"),et.prefix||(et.prefix=""),!tt||typeof tt=="boolean")return"";const{delimiter:rt,prefix:nt}=et;if(typeof tt=="boolean")return"";if(typeof tt=="string"||typeof tt=="number"){const st=harmonize(nt,rt,!0),ot=harmonize(String(tt),rt);return st?`${st}${rt}${ot}`:ot}return"children"in tt?slugify(tt.children):"type"in tt?slugify(tt.props.children,et):Symbol.iterator in tt?slugify(Array.from(tt).map(st=>slugify(st,{delimiter:rt})).join(rt),et):""};var _default=slugify$1.default=slugify;const useSlug=({watch:tt,setValue:et,selectedResource:rt})=>{const[nt,st]=reactExports.useState(""),[ot,at]=reactExports.useState((rt==null?void 0:rt.public)||!1),lt=reactExports.useId(),ut=tt("title"),{t:ct}=useTranslation(),dt=useToast();reactExports.useEffect(()=>{if(ot){let xt="";rt?xt=rt.slug?rt.slug:`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`:xt=`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`,et("formSlug",xt),st(xt)}},[ot,ut]);function ht(xt){at(xt)}function mt(xt){navigator.clipboard.writeText(`${window.location.origin}${xt||window.location.pathname}/pub/${nt}`),dt.success(ct("explorer.copy.clipboard"))}return{slug:nt,uniqueId:lt,isPublic:ot,resourceName:ut,onPublicChange:ht,onCopyToClipBoard:mt}},BlogPublic=({appCode:tt,isUpdating:et,resource:rt,watch:nt,register:st,setValue:ot})=>{const{t:at}=useTranslation(),{slug:lt,isPublic:ut,resourceName:ct,onPublicChange:dt,onCopyToClipBoard:ht}=useSlug({watch:nt,setValue:ot,selectedResource:et?rt:void 0});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:[at("explorer.resource.editModal.heading.access"),tt]}),jsxRuntimeExports.jsx(Alert,{type:"info",children:at("explorer.resource.editModal.access.alert")}),jsxRuntimeExports.jsxs(FormControl,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[jsxRuntimeExports.jsx(FormControl.Input,{type:"checkbox",role:"switch",defaultChecked:et?rt.public:!1,...st("enablePublic",{disabled:!ct,onChange:mt=>{const xt=mt.target.checked;dt(xt)}}),className:"form-check-input mt-0",size:"md"}),jsxRuntimeExports.jsx(FormControl.Label,{className:"form-check-label mb-0",children:at("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),ut&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FormControl,{id:"formSlug",children:jsxRuntimeExports.jsx(Input,{type:"text",hidden:!0,defaultValue:et?lt:"",...st("formSlug"),size:"sm"})},lt),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"text-break",children:[window.location.origin,"/blog/pub/",lt]}),jsxRuntimeExports.jsx(Button,{color:"primary",disabled:!ut,onClick:()=>ht("/blog"),type:"button",leftIcon:jsxRuntimeExports.jsx(SvgIconCopy,{}),variant:"ghost",className:"text-nowrap",children:at("explorer.resource.editModal.access.url.button")})]})]})]})},useUpdateMutation=({application:tt,options:et})=>useMutation({mutationFn:async rt=>await odeServices.resource(tt).update(rt),...et}),TextareaCounter=({content:tt,maxLength:et})=>jsxRuntimeExports.jsx("p",{className:"small text-gray-700 p-2 text-end",children:tt?`${tt.length} / ${et}`:""}),useThumb=({isUpdating:tt,selectedResource:et})=>{const[rt,nt]=reactExports.useState(tt&&(et==null?void 0:et.thumbnail)||"");return reactExports.useEffect(()=>{nt((et==null?void 0:et.thumbnail)||"")},[et]),{thumbnail:rt,handleDeleteImage:()=>nt(""),handleUploadImage:st=>nt(st)}},DEFAULT_INPUT_MAX_LENGTH=60,DEFAULT_TEXTAREA_MAX_LENGTH=400,ResourceModal$1=({isOpen:tt,onCancel:et,onSuccess:rt,children:nt,inputMaxLength:st=DEFAULT_INPUT_MAX_LENGTH,textareaMaxLength:ot=DEFAULT_TEXTAREA_MAX_LENGTH,...at})=>{const{appCode:lt,currentApp:ut}=useEdificeClient(),{t:ct}=useTranslation(),{mode:dt}=at,ht=useToast(),mt=reactExports.useId(),xt=dt==="create",yt=dt==="update",vt=useResource(lt,yt?at.resourceId:""),{watch:Et,register:bt,handleSubmit:St,setValue:wt,formState:{isSubmitting:Rt,isValid:Ct}}=useForm({mode:"onChange",defaultValues:{description:yt?vt==null?void 0:vt.description:"",enablePublic:yt?vt==null?void 0:vt.public:!1,title:yt?vt==null?void 0:vt.name:"",formSlug:yt?vt==null?void 0:vt.slug:""}}),{ref:Pt,libraryMedia:It,...jt}=useMediaLibrary(),{thumbnail:Dt,handleDeleteImage:Vt,handleUploadImage:Ft}=useThumb({isUpdating:yt,selectedResource:yt?vt:void 0}),Ht=Et("description"),Nt=async function(Lt){var Mt,zt;try{const Gt={description:Lt.description||"",name:Lt.title,public:Lt.enablePublic,slug:Lt.enablePublic&&Lt.formSlug||"",thumbnail:Dt};if(xt){const $t={...Gt,folder:at.currentFolder===void 0||((Mt=at.currentFolder)==null?void 0:Mt.id)==="default"?void 0:parseInt(((zt=at.currentFolder)==null?void 0:zt.id)||""),application:lt};at.createResource?await at.createResource.mutateAsync($t):await odeServices.resource(lt).create($t)}else{const $t={...Gt,entId:vt.assetId,trashed:vt.trashed};at.updateResource?await at.updateResource.mutateAsync($t):await odeServices.resource(lt).update($t)}ht.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("strong",{children:ct(xt?"explorer.resource.created":"explorer.resource.updated")}),jsxRuntimeExports.jsxs("p",{children:[ct("title")," : ",Lt.title]}),jsxRuntimeExports.jsxs("p",{children:[ct("description")," : ",Lt.description]}),lt==="blog"&&jsxRuntimeExports.jsxs("p",{children:["Public:",Lt.enablePublic?ct("explorer.enable.public.yes"):ct("explorer.enable.public.no")]})]})),rt()}catch(Gt){console.error(Gt)}};return yt&&!vt?jsxRuntimeExports.jsx(LoadingScreen,{}):reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:`${dt}-resource`,size:"lg",isOpen:tt,onModalClose:et,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:et,children:ct(`explorer.resource.editModal.header.${xt?"create":"edit"}`)}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("explorer.resource.editModal.heading.general")}),jsxRuntimeExports.jsxs("form",{id:mt,onSubmit:St(Nt),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(ImagePicker,{app:ut,src:yt&&(vt==null?void 0:vt.thumbnail)||"",addButtonLabel:ct("explorer.imagepicker.button.add"),deleteButtonLabel:ct("explorer.imagepicker.button.delete"),onUploadImage:Ft,onDeleteImage:Vt,className:"align-self-center mt-8",libraryMedia:It,mediaLibraryRef:Pt})}),jsxRuntimeExports.jsxs("div",{className:"col",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:yt?vt==null?void 0:vt.name:"",...bt("title",{required:!0,maxLength:st,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:ct("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0,maxLength:st})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("description")}),jsxRuntimeExports.jsx(TextArea,{defaultValue:(vt==null?void 0:vt.description)||"",...bt("description",{required:!1,maxLength:ot}),placeholder:ct("explorer.resource.editModal.description.placeholder"),size:"md",maxLength:ot}),Ht&&jsxRuntimeExports.jsx(TextareaCounter,{content:Ht,maxLength:ot})]})]})]}),typeof nt=="function"?nt(vt,yt,Et,wt,bt):nt]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:et,type:"button",variant:"ghost",children:ct("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{form:mt,type:"submit",color:"primary",isLoading:Rt,variant:"filled",disabled:!Ct||Rt,children:ct(xt?"explorer.create":"save")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:lt,ref:Pt,multiple:!1,visibility:"protected",...jt})]}),document.getElementById("portal"))},SvgIconBookmark=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M7 4a1 1 0 0 0-1 1v14.06l5.42-3.87a1 1 0 0 1 1.16 0L18 19.06V5a1 1 0 0 0-1-1zM4.88 2.88A3 3 0 0 1 7 2h10a3 3 0 0 1 3 3v16a1 1 0 0 1-1.58.81L12 17.23 5.58 21.8A1 1 0 0 1 4 21V5a3 3 0 0 1 .88-2.12"})]}),ShareBookmark=({bookmark:tt,refBookmark:et,onBookmarkChange:rt,onSave:nt})=>{const{t:st}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"mt-16",children:jsxRuntimeExports.jsxs(FormControl,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[jsxRuntimeExports.jsx("div",{className:"flex-fill",children:jsxRuntimeExports.jsx(FormControl.Input,{ref:et,onChange:rt,placeholder:st("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},tt.id)}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"ghost",disabled:tt.name.length===0,leftIcon:jsxRuntimeExports.jsx(SvgIconSave,{}),onClick:nt,className:"text-nowrap",children:st("explorer.modal.share.sharebookmark.save")})]})})},hasRight=(tt,et)=>tt.actions.filter(rt=>et.id===rt.id).length>0,showShareRightLine=(tt,et)=>tt.isBookmarkMember&&et||!tt.isBookmarkMember,ShareBookmarkLine=({shareRights:tt,showBookmark:et,toggleBookmark:rt,shareRightActions:nt,toggleRight:st,onDeleteRow:ot})=>{const{t:at}=useTranslation();return tt==null?void 0:tt.rights.map(lt=>{const ut={user:jsxRuntimeExports.jsx(Avatar,{alt:at("explorer.modal.share.avatar.shared.alt"),size:"xs",src:lt.avatarUrl,variant:"circle"}),group:jsxRuntimeExports.jsx("div",{className:"avatar-xs bg-primary-200 justify-content-center d-flex rounded-circle",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16})}),sharebookmark:jsxRuntimeExports.jsx(SvgIconBookmark,{})}[lt.type]||null,ct=lt.type==="sharebookmark",dt=lt.type==="user";return showShareRightLine(lt,et)&&jsxRuntimeExports.jsxs("tr",{className:lt.isBookmarkMember?"bg-light":"",children:[jsxRuntimeExports.jsx("td",{children:ut}),jsxRuntimeExports.jsx("td",{children:jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[ct&&jsxRuntimeExports.jsx(Button,{color:"tertiary",rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:at("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:et?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:rt,children:lt.displayName}),!ct&&lt.displayName,dt&&` (${at(lt.profile||"")})`]})}),nt.map(ht=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:hasRight(lt,ht),onChange:()=>st(lt,ht.id)})},ht.displayName)),jsxRuntimeExports.jsx("td",{children:!lt.isBookmarkMember&&jsxRuntimeExports.jsx(IconButton,{"aria-label":at("close"),color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconClose,{}),type:"button",variant:"ghost",title:at("close"),onClick:()=>ot(lt)})})]},lt.id)})},initialState$2={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function reducer$1(tt,et){switch(et.type){case"onChange":return{...tt,searchInputValue:et.payload};case"isSearching":return{...tt,isSearching:et.payload};case"addResult":return{...tt,searchResults:et.payload};case"addApiResult":return{...tt,searchAPIResults:et.payload};case"updateSearchResult":return{...tt,searchResults:et.payload};case"emptyResult":return{...tt,searchResults:et.payload};default:throw new Error("Unhandled action type")}}const defaultActions=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],useSearch=({resourceId:tt,resourceCreatorId:et,shareRights:rt,shareDispatch:nt})=>{const[st,ot]=reactExports.useReducer(reducer$1,initialState$2),at=useDebounce(st.searchInputValue,500),{isAdml:lt}=useIsAdml(),{appCode:ut}=useEdificeClient(),{t:ct}=useTranslation();reactExports.useEffect(()=>{ht(at)},[at]);const dt=mt=>{const xt=mt.target.value;ot({type:"onChange",payload:xt})},ht=async mt=>{if(tt){if(ot({type:"isSearching",payload:!0}),!lt&&mt.length>=1||lt&&mt.length>=3){const xt=await odeServices.share().searchShareSubjects(ut,tt,mt);ot({type:"addApiResult",payload:xt});const yt=xt.filter(vt=>!rt.rights.find(Et=>Et.id===vt.id)).filter(vt=>!(vt.type==="user"&&vt.id===et)).map(vt=>{let Et=vt.displayName;return vt.type==="user"&&vt.profile?Et=`${Et} (${ct(vt.profile)})`:vt.type==="group"&&vt.structureName&&(Et=`${Et} (${vt.structureName})`),{value:vt.id,label:Et,icon:vt.type==="sharebookmark"?jsxRuntimeExports.jsx(SvgIconBookmark,{}):null}});ot({type:"addResult",payload:yt})}else ot({type:"emptyResult",payload:[]}),Promise.resolve();ot({type:"isSearching",payload:!1})}};return{state:st,showSearchAdmlHint:()=>lt&&st.searchInputValue.length<3,showSearchLoading:()=>st.isSearching,showSearchNoResults:()=>!st.isSearching&&!lt&&at.length>0&&st.searchResults.length===0||!st.isSearching&&lt&&at.length>3&&st.searchResults.length===0,getSearchMinLength:()=>lt?3:1,handleSearchInputChange:dt,handleSearchResultsChange:async mt=>{const xt=st.searchAPIResults.find(yt=>yt.id===mt[0]);if(xt){let yt=[];if(xt.type==="sharebookmark"){const vt=await odeServices.directory().getBookMarkById(xt.id);yt.push({...vt,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:defaultActions}),vt==null||vt.users.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{yt.push({...Et,type:"user",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})}),vt.groups.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{yt.push({...Et,type:"group",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})})}else yt=[{...xt,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];nt({type:"updateShareRights",payload:{...rt,rights:[...rt.rights,...yt]}}),ot({type:"updateSearchResult",payload:st.searchResults.filter(vt=>vt.value!==mt[0])})}}}},initialState$1={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function reducer(tt,et){switch(et.type){case"init":return{...tt,...et.payload};case"deleteRow":return{...tt,shareRights:et.payload};case"updateShareRights":return{...tt,shareRights:et.payload};case"toggleRight":return{...tt,shareRights:et.payload};case"isSharing":return{...tt,isSharing:et.payload};default:throw new Error("Unhandled action type")}}function useShare({resourceId:tt,resourceRights:et,resourceCreatorId:rt,shareResource:nt,setIsLoading:st,onSuccess:ot}){const{appCode:at}=useEdificeClient(),{user:lt,avatar:ut}=useUser(),ct=useToast(),{t:dt}=useTranslation(),[ht,mt]=reactExports.useReducer(reducer,initialState$1);reactExports.useEffect(()=>{tt&&(async()=>{try{const[vt,Et]=await Promise.all([odeServices.share().getActionsForApp(at),odeServices.share().getRightsForResource(at,tt)]);mt({type:"init",payload:{shareRightActions:vt,shareRights:Et}})}catch(vt){console.error(vt)}st(!1)})()},[tt]);const xt=(vt,Et)=>{var bt,St;const{rights:wt,...Rt}=ht.shareRights,Ct=[...wt],Pt=Ct.findIndex(jt=>jt.id===vt.id),It=ht.shareRightActions.filter(jt=>jt.id===Et)[0];if(Ct[Pt].actions.findIndex(jt=>jt.id===Et)>-1){let jt=Ct[Pt].actions.filter(Vt=>Vt.id!==Et);const Dt=ht.shareRightActions.filter(Vt=>{var Ft;return(Ft=Vt.requires)==null?void 0:Ft.includes(Et)});jt=jt.filter(Vt=>!Dt.find(Ft=>Ft.id===Vt.id)),Ct[Pt]={...Ct[Pt],actions:jt}}else{const jt=ht.shareRightActions.filter(Dt=>{var Vt;return((Vt=It.requires)==null?void 0:Vt.includes(Dt.id))&&!Ct[Pt].actions.find(Ft=>Ft.id===Dt.id)});Ct[Pt]={...Ct[Pt],actions:[...Ct[Pt].actions,It,...jt]}}vt.type==="sharebookmark"&&((bt=Ct[Pt].users)==null||bt.forEach(jt=>{const Dt=Ct.findIndex(Vt=>Vt.id===jt.id);Ct[Dt]={...Ct[Dt],actions:Ct[Pt].actions}}),(St=Ct[Pt].groups)==null||St.forEach(jt=>{const Dt=Ct.findIndex(Vt=>Vt.id===jt.id);Ct[Dt]={...Ct[Dt],actions:Ct[Pt].actions}})),mt({type:"toggleRight",payload:{rights:Ct,...Rt}})},yt=vt=>{Object.keys(vt)[0]==="error"?(ct.error(dt("explorer.shared.status.error")),console.error("Failed to save share",vt)):ct.success(dt("explorer.shared.status.saved"))};return{state:ht,dispatch:mt,currentIsAuthor:()=>rt===(lt==null?void 0:lt.userId),myAvatar:ut,handleDeleteRow:vt=>{mt({type:"deleteRow",payload:{...ht.shareRights,rights:ht.shareRights.rights.filter(Et=>{var bt,St;return Et.id!==vt.id&&!((bt=vt.users)!=null&&bt.find(wt=>wt.id===Et.id))&&!((St=vt.groups)!=null&&St.find(wt=>wt.id===Et.id))})}})},handleShare:async()=>{mt({type:"isSharing",payload:!0});try{const vt=et.filter(bt=>lt&&bt.includes(`user:${lt.userId}`)).map(bt=>bt.split(":")[2]).filter(bt=>!!bt),Et=[...ht.shareRights.rights];if(vt.length>0){const bt=vt.map(St=>({displayName:St,id:St}));Et.push({actions:bt,avatarUrl:"",directoryUrl:"",displayName:lt.username,id:lt.userId,type:"user"})}if(nt){const bt=await nt.mutateAsync({resourceId:tt,rights:Et});yt(bt)}else{const bt=await odeServices.share().saveRights(at,tt,Et);yt(bt)}ot()}catch(vt){typeof vt=="string"&&ct.error(dt("explorer.shared.status.error")),console.error("Failed to save share",vt)}finally{mt({type:"isSharing",payload:!1})}},toggleRight:xt}}const useShareBookmark=({shareRights:tt,shareDispatch:et})=>{const rt=useToast(),{t:nt}=useTranslation(),st=reactExports.useRef(null),[ot,at]=reactExports.useState({name:"",id:reactExports.useId()}),[lt,ut]=useToggle$1(!1),[ct,dt]=reactExports.useState(!1),ht=()=>{ut()},mt=()=>{at(yt=>{var vt;return{...yt,name:((vt=st.current)==null?void 0:vt.value)||""}})},xt=async yt=>{try{const vt=await odeServices.directory().saveBookmarks(yt,{users:tt.rights.filter(Et=>Et.type==="user").map(Et=>Et.id),groups:tt.rights.filter(Et=>Et.type==="group").map(Et=>Et.id),bookmarks:tt.rights.filter(Et=>Et.type==="sharebookmark").map(Et=>Et.id)});rt.success(nt("explorer.bookmarked.status.saved")),et({type:"updateShareRights",payload:{...tt,visibleBookmarks:[...tt.visibleBookmarks,{displayName:yt,id:vt.id}]}}),at(Et=>({...Et,bookmarkId:Et.id+new Date().getTime().toString()})),dt(!1)}catch(vt){console.error("Failed to save bookmark",vt),rt.error(nt("explorer.bookmarked.status.error"))}};return{refBookmark:st,showBookmark:lt,showBookmarkInput:ct,bookmark:ot,handleBookmarkChange:mt,setBookmark:at,handleOnSave:()=>{var yt;const vt=((yt=st.current)==null?void 0:yt.value)||"";xt(vt)},toggleBookmark:ht,toggleBookmarkInput:dt}};function ShareResourceModal({isOpen:tt,shareOptions:et,shareResource:rt,children:nt,onSuccess:st,onCancel:ot}){const{resourceId:at,resourceCreatorId:lt,resourceRights:ut}=et,[ct,dt]=reactExports.useState(!0),{state:{isSharing:ht,shareRights:mt,shareRightActions:xt},dispatch:yt,myAvatar:vt,currentIsAuthor:Et,handleShare:bt,toggleRight:St,handleDeleteRow:wt}=useShare({resourceId:at,resourceCreatorId:lt,resourceRights:ut,shareResource:rt,setIsLoading:dt,onSuccess:st}),{state:{searchResults:Rt,searchInputValue:Ct},showSearchAdmlHint:Pt,showSearchLoading:It,showSearchNoResults:jt,getSearchMinLength:Dt,handleSearchInputChange:Vt,handleSearchResultsChange:Ft}=useSearch({resourceId:at,resourceCreatorId:lt,shareRights:mt,shareDispatch:yt}),{refBookmark:Ht,showBookmark:Nt,handleBookmarkChange:Lt,toggleBookmark:Mt,bookmark:zt,handleOnSave:Gt,showBookmarkInput:$t,toggleBookmarkInput:Ut}=useShareBookmark({shareRights:mt,shareDispatch:yt}),{t:Bt}=useTranslation(),Yt=Pt()?Bt("explorer.search.adml.hint"):Bt("explorer.modal.share.search.placeholder");return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"share_modal",size:"lg",isOpen:tt,onModalClose:ot,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:ot,children:Bt("share.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:Bt("explorer.modal.share.usersWithAccess")}),jsxRuntimeExports.jsx("div",{className:"table-responsive",children:ct?jsxRuntimeExports.jsx(LoadingScreen,{}):jsxRuntimeExports.jsxs("table",{className:"table border align-middle mb-0",children:[jsxRuntimeExports.jsx("thead",{className:"bg-secondary",children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"col",className:"w-32",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("explorer.modal.share.avatar.shared.alt")})}),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("explorer.modal.share.search.placeholder")})}),xt.map(Zt=>jsxRuntimeExports.jsx("th",{scope:"col",className:"text-center text-white",children:Bt(Zt.displayName)},Zt.displayName)),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("close")})})]})}),jsxRuntimeExports.jsxs("tbody",{children:[Et()&&jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"row",children:jsxRuntimeExports.jsx(Avatar,{alt:Bt("explorer.modal.share.avatar.me.alt"),size:"xs",src:vt,variant:"circle"})}),jsxRuntimeExports.jsx("td",{children:Bt("share.me")}),xt.map(Zt=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:!0,disabled:!0})},Zt.displayName)),jsxRuntimeExports.jsx("td",{})]}),jsxRuntimeExports.jsx(ShareBookmarkLine,{showBookmark:Nt,shareRightActions:xt,shareRights:mt,onDeleteRow:wt,toggleRight:St,toggleBookmark:Mt})]})]})}),jsxRuntimeExports.jsxs("div",{className:"mt-16",children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBookmark,{}),rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:Bt("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",onClick:()=>Ut(!$t),children:Bt("share.save.sharebookmark")}),$t&&jsxRuntimeExports.jsx(ShareBookmark,{refBookmark:Ht,bookmark:zt,onBookmarkChange:Lt,onSave:Gt})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[jsxRuntimeExports.jsx("div",{className:"me-8",children:Bt("explorer.modal.share.search")}),jsxRuntimeExports.jsx(Tooltip,{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:jsxRuntimeExports.jsx(SvgIconInfoCircle,{className:"c-pointer",height:"18"})})]}),jsxRuntimeExports.jsx("div",{className:"row",children:jsxRuntimeExports.jsx("div",{className:"col-10",children:jsxRuntimeExports.jsx(Combobox,{value:Ct,placeholder:Yt,isLoading:It(),noResult:jt(),options:Rt,searchMinLength:Dt(),onSearchInputChange:Vt,onSearchResultsChange:Ft})})}),nt]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:ot,children:Bt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",isLoading:ht,onClick:bt,disabled:ht,children:Bt("share")})]})]}),document.getElementById("portal"))}function ShareBlog({resourceId:tt,updateResource:et}){const{appCode:rt}=useEdificeClient(),{t:nt}=useTranslation(rt),st=useResource("blog",tt),ot=st&&st["publish-type"],[at,lt]=reactExports.useState(ot??"RESTRAINT");reactExports.useEffect(()=>{ot&&lt(ot)},[ot]);const ut=async ct=>{const dt=ct.target.value,ht={description:st.description||"",entId:st.assetId,name:st.name,public:!!st.public,slug:st.slug||"",thumbnail:st.thumbnail,trashed:st.trashed,"publish-type":dt};et?await et.mutateAsync(ht):await odeServices.resource("blog").update(ht),lt(dt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:nt("explorer.publication.steps")}),jsxRuntimeExports.jsx(Radio,{label:nt("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:at,checked:at==="IMMEDIATE",onChange:ut}),jsxRuntimeExports.jsx(Radio,{label:nt("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:at==="RESTRAINT",model:at,onChange:ut})]})}const useShareMutation=({application:tt,options:et})=>useMutation({mutationFn:async({resourceId:rt,rights:nt})=>await odeServices.share().saveRights(tt,rt,nt),...et});function EdificeClientProvider({children:tt,params:et}){var rt;const nt=et.app,{t:st}=useTranslation(),ot=st(nt),at=useSession(),lt=useConf({appCode:nt}),ut=(lt==null?void 0:lt.isSuccess)&&(at==null?void 0:at.isSuccess),ct=((rt=at==null?void 0:at.data)==null?void 0:rt.currentLanguage)??"fr";reactExports.useEffect(()=>{[{data:"html",value:ct},{data:"translate",value:"no"}].forEach(ht=>{var mt;return(mt=document.querySelector("html"))==null?void 0:mt.setAttribute(ht.data,ht.value)})},[ct,at.data]),reactExports.useEffect(()=>{document.title=`${ot}`},[nt,at.data,ot]);const dt=reactExports.useMemo(()=>{var ht,mt,xt,yt,vt;return{appCode:nt,applications:(ht=lt==null?void 0:lt.data)==null?void 0:ht.applications,confQuery:lt,currentApp:(mt=lt==null?void 0:lt.data)==null?void 0:mt.currentApp,currentLanguage:ct,init:ut,sessionQuery:at,user:(xt=at==null?void 0:at.data)==null?void 0:xt.user,userDescription:(yt=at==null?void 0:at.data)==null?void 0:yt.userDescription,userProfile:(vt=at==null?void 0:at.data)==null?void 0:vt.userProfile}},[nt,lt,ct,ut,at]);return jsxRuntimeExports.jsx(EdificeClientContext.Provider,{value:dt,children:tt})}function EdificeThemeProvider({defaultTheme:tt,children:et}){var rt;const{appCode:nt}=useEdificeClient(),st=useConf({appCode:nt});reactExports.useEffect(()=>{var at,lt,ut,ct,dt,ht,mt,xt,yt,vt,Et;const bt=document.getElementById("favicon");bt.href=`${(lt=(at=st==null?void 0:st.data)==null?void 0:at.theme)==null?void 0:lt.basePath}/img/illustrations/favicon.ico`;const St=(dt=(ct=(ut=st==null?void 0:st.data)==null?void 0:ut.theme)==null?void 0:ct.bootstrapVersion)==null?void 0:dt.split("-"),wt=St?St[St.length-1]:void 0;[{data:"data-skin",value:(mt=(ht=st==null?void 0:st.data)==null?void 0:ht.theme)==null?void 0:mt.skinName},{data:"data-theme",value:((yt=(xt=st==null?void 0:st.data)==null?void 0:xt.theme)==null?void 0:yt.npmTheme)??((Et=(vt=st==null?void 0:st.data)==null?void 0:vt.theme)==null?void 0:Et.themeName)},{data:"data-product",value:tt==="none"?"":tt??wt}].forEach(Rt=>{var Ct;return(Ct=document.querySelector("html"))==null?void 0:Ct.setAttribute(Rt.data,Rt.value)})},[st==null?void 0:st.data,tt]);const ot=reactExports.useMemo(()=>{var at;return{theme:(at=st==null?void 0:st.data)==null?void 0:at.theme}},[(rt=st==null?void 0:st.data)==null?void 0:rt.theme]);return jsxRuntimeExports.jsx(EdificeThemeContext.Provider,{value:ot,children:et})}const scriptRel="modulepreload",assetsURL=function(tt){return"/"+tt},seen={},__vitePreload=function tt(et,rt,nt){let st=Promise.resolve();if(rt&&rt.length>0){document.getElementsByTagName("link");const ot=document.querySelector("meta[property=csp-nonce]"),at=(ot==null?void 0:ot.nonce)||(ot==null?void 0:ot.getAttribute("nonce"));st=Promise.all(rt.map(lt=>{if(lt=assetsURL(lt),lt in seen)return;seen[lt]=!0;const ut=lt.endsWith(".css"),ct=ut?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${lt}"]${ct}`))return;const dt=document.createElement("link");if(dt.rel=ut?"stylesheet":scriptRel,ut||(dt.as="script",dt.crossOrigin=""),dt.href=lt,at&&dt.setAttribute("nonce",at),document.head.appendChild(dt),ut)return new Promise((ht,mt)=>{dt.addEventListener("load",ht),dt.addEventListener("error",()=>mt(new Error(`Unable to preload CSS for ${lt}`)))})}))}return st.then(()=>et()).catch(ot=>{const at=new Event("vite:preloadError",{cancelable:!0});if(at.payload=ot,window.dispatchEvent(at),!at.defaultPrevented)throw ot})},snapCenterToCursor=tt=>{let{activatorEvent:et,draggingNodeRect:rt,transform:nt}=tt;if(rt&&et){const st=getEventCoordinates(et);if(!st)return nt;const ot=st.x-rt.left,at=st.y-rt.top;return{...nt,x:nt.x+ot-rt.width/2,y:nt.y+at-rt.height/2}}return nt},createStoreImpl=tt=>{let et;const rt=new Set,nt=(dt,ht)=>{const mt=typeof dt=="function"?dt(et):dt;if(!Object.is(mt,et)){const xt=et;et=ht??(typeof mt!="object"||mt===null)?mt:Object.assign({},et,mt),rt.forEach(yt=>yt(et,xt))}},st=()=>et,ut={setState:nt,getState:st,getInitialState:()=>ct,subscribe:dt=>(rt.add(dt),()=>rt.delete(dt)),destroy:()=>{rt.clear()}},ct=et=tt(nt,st,ut);return ut},createStore=tt=>createStoreImpl;var withSelector={exports:{}},withSelector_production={},shim$2={exports:{}},useSyncExternalStoreShim_production={};/**
1396
1396
  * @license React
@@ -1408,4 +1408,4 @@ Use "options.replacer" or "options.ignoreUnknown"
1408
1408
  *
1409
1409
  * This source code is licensed under the MIT license found in the
1410
1410
  * LICENSE file in the root directory of this source tree.
1411
- */var React=reactExports,shim=shimExports;function is(tt,et){return tt===et&&(tt!==0||1/tt===1/et)||tt!==tt&&et!==et}var objectIs=typeof Object.is=="function"?Object.is:is,useSyncExternalStore=shim.useSyncExternalStore,useRef=React.useRef,useEffect=React.useEffect,useMemo=React.useMemo,useDebugValue$1=React.useDebugValue;withSelector_production.useSyncExternalStoreWithSelector=function(tt,et,rt,nt,st){var ot=useRef(null);if(ot.current===null){var at={hasValue:!1,value:null};ot.current=at}else at=ot.current;ot=useMemo(function(){function ut(xt){if(!ct){if(ct=!0,dt=xt,xt=nt(xt),st!==void 0&&at.hasValue){var yt=at.value;if(st(yt,xt))return ht=yt}return ht=xt}if(yt=ht,objectIs(dt,xt))return yt;var vt=nt(xt);return st!==void 0&&st(yt,vt)?(dt=xt,yt):(dt=xt,ht=vt)}var ct=!1,dt,ht,mt=rt===void 0?null:rt;return[function(){return ut(et())},mt===null?void 0:function(){return ut(mt())}]},[et,rt,nt,st]);var lt=useSyncExternalStore(tt,ot[0],ot[1]);return useEffect(function(){at.hasValue=!0,at.value=lt},[lt]),useDebugValue$1(lt),lt};withSelector.exports=withSelector_production;var withSelectorExports=withSelector.exports;const useSyncExternalStoreExports=getDefaultExportFromCjs(withSelectorExports),{useDebugValue}=React$4,{useSyncExternalStoreWithSelector}=useSyncExternalStoreExports,identity=tt=>tt;function useStore(tt,et=identity,rt){const nt=useSyncExternalStoreWithSelector(tt.subscribe,tt.getState,tt.getServerState||tt.getInitialState,et,rt);return useDebugValue(nt),nt}const searchContext=async tt=>{const et=await odeServices.resource(tt.application).searchContext(tt);return{...et,folders:et.folders.filter(rt=>!rt.trashed)}},createFolder=async({searchParams:tt,name:et,parentId:rt})=>{const nt={name:et,parentId:rt,application:tt.application,type:tt.types[0]};return await odeServices.resource(tt.application).createFolder(nt)},updateFolder=async({folderId:tt,searchParams:et,parentId:rt,name:nt})=>{const st={folderId:tt,name:nt,parentId:rt,application:et.application,type:et.types[0]};return await odeServices.resource(et.application).updateFolder(st)},trashAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:nt})=>{const st={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:nt};return await odeServices.resource(tt.application).trashAll(st,rt)},deleteAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:nt})=>{const st={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:nt};return await odeServices.resource(tt.application).deleteAll(st,rt)},restoreAll=async({searchParams:tt,resourceIds:et,folderIds:rt,useAssetIds:nt})=>{const st={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:rt};return await odeServices.resource(tt.application).restoreAll(st,nt)},copyResource=async(tt,et)=>await odeServices.resource(tt.application).copy({application:tt.application,resourceId:et}),moveToFolder=async({searchParams:tt,resourceIds:et,folderId:rt,folderIds:nt,useAssetIds:st})=>{const ot={application:tt.application,folderId:rt,resourceIds:et,folderIds:nt};return await odeServices.resource(tt.application).moveToFolder(ot,st)},sessionHasWorkflowRights=async tt=>await odeServices.rights().sessionHasWorkflowRights(tt),goToResource=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getViewUrl(et);window.open(rt,"_self")},createResource=({searchParams:tt,params:et})=>odeServices.resource(tt.application).create(et),printResource=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getPrintUrl(et);return window.open(rt,"_blank")},goToCreate=({searchParams:tt,folderId:et})=>{const rt=odeServices.resource(tt.application).getFormUrl(et);return window.open(rt,"_self")},goToEdit=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getEditUrl(et);return window.open(rt,"_self")},goToExport=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getExportUrl(et);return window.open(rt,"_self")},defaultFolder={id:FOLDER.DEFAULT,name:t$2("explorer.filters.mine"),section:!0,children:[]},initialState={config:void 0,searchConfig:{minLength:1},searchParams:{filters:{folder:FOLDER.DEFAULT,owner:void 0,shared:void 0,public:void 0},orders:{updatedAt:SORT_ORDER.DESC},application:"",types:[],pagination:{startIdx:0,pageSize:48,maxIdx:0},trashed:!1},treeData:defaultFolder,selectedNodeId:"default",currentFolder:{id:"default"},selectedFolders:[],selectedResources:[],folderIds:[],resourceIds:[],resourceIsTrash:!1,resourceOrFolderIsDraggable:{isDrag:!1,elementDrag:void 0},elementDragOver:{isOver:!1,isTreeview:!1,canMove:!0,overId:void 0},resourceActionDisable:!1,status:void 0},store=createStore()((tt,et)=>({...initialState,actions:{setConfig:rt=>tt({config:rt}),setSearchConfig:rt=>tt(nt=>({searchConfig:{...nt.searchConfig,...rt}})),setTreeData:rt=>tt(()=>({treeData:rt})),setSearchParams:rt=>{tt(nt=>{const{searchParams:st}=nt;return st.search!==rt.search?rt.search?{...nt,selectedFolders:[],selectedNodeId:void 0,selectedResources:[],currentFolder:void 0,searchParams:{...st,...rt,trashed:!1,filters:{...st.filters,folder:void 0}}}:{...nt,selectedFolders:[],selectedNodeId:"default",selectedResources:[],currentFolder:{id:"default"},searchParams:{...st,...rt,trashed:!1,filters:{...st.filters}}}:{searchParams:{...st,...rt}}})},setSelectedFolders:rt=>tt(()=>({selectedFolders:rt})),setSelectedResources:rt=>tt(()=>({selectedResources:rt})),setFolderIds:rt=>tt(()=>({folderIds:rt})),setResourceIds:rt=>tt(()=>({resourceIds:rt})),setResourceIsTrash:rt=>tt(()=>({resourceIsTrash:rt})),setResourceOrFolderIsDraggable:rt=>tt(()=>({resourceOrFolderIsDraggable:rt})),setElementDragOver:rt=>tt(()=>({elementDragOver:rt})),setResourceActionDisable:rt=>tt(()=>({resourceActionDisable:rt})),clearSelectedItems:()=>tt(()=>({selectedFolders:[],selectedResources:[]})),clearSelectedIds:()=>tt(()=>({resourceIds:[],folderIds:[]})),openResource:rt=>{try{const{searchParams:nt}=et();goToResource({searchParams:nt,assetId:rt.assetId})}catch(nt){console.error("explorer open failed: ",nt)}},printSelectedResource:()=>{try{const{searchParams:rt,selectedResources:nt,resourceIds:st}=et();if(nt.length!==1)throw new Error("Cannot open more than 1 resource");const ot=nt.find(at=>at.id===st[0]);printResource({searchParams:rt,assetId:ot.assetId})}catch(rt){console.error("explorer print failed: ",rt)}},openFolder:({folderId:rt,folder:nt,queryClient:st})=>{const{searchParams:ot}=et(),at=ot.filters.folder,lt=rt;at!==rt&&(et().actions.fetchTreeData(rt,st),tt(ut=>({...ut,folderIds:[],resourceIds:[],selectedNodeId:lt,currentFolder:nt||{id:rt},searchParams:{...ot,search:void 0,filters:{...ot.filters,folder:rt},trashed:rt===FOLDER.BIN}})))},foldTreeItem:()=>tt(rt=>({...rt,status:"fold"})),fetchTreeData:async(rt,nt)=>{const st=findNodeById(et().treeData,rt),ot=st==null?void 0:st.id;if(Array.isArray(st==null?void 0:st.children)&&st.children.length)return;const at=await nt.fetchQuery({queryKey:["prefetchContext",{folderId:ot,trashed:!1}],queryFn:async()=>await searchContext({...et().searchParams,filters:{...et().searchParams.filters,folder:ot}})});et().actions.setTreeData(wrapTreeNode(et().treeData,at==null?void 0:at.folders,ot||FOLDER.DEFAULT))},selectTreeItem:(rt,nt)=>{const{treeData:st}=et(),{openFolder:ot,fetchTreeData:at}=et().actions,lt=findNodeById(st,rt);at(rt,nt),tt(ut=>({...ut,searchParams:{...ut.searchParams,search:void 0},status:"select",selectedResources:[]})),ot({folder:lt,folderId:rt})},gotoPreviousFolder:()=>{const{selectedNodeId:rt,treeData:nt,searchParams:st}=et(),{openFolder:ot}=et().actions;if(st.search&&ot({folder:defaultFolder,folderId:FOLDER.DEFAULT}),!rt)return;const at=findParentNode(nt,rt);ot({folder:at,folderId:(at==null?void 0:at.id)||FOLDER.DEFAULT})},goToTrash:()=>{tt(rt=>({...rt,selectedNodeId:void 0,selectedResources:[],resourceIds:[],folderIds:[],status:"select",searchParams:{...rt.searchParams,search:void 0,filters:{folder:FOLDER.BIN},trashed:!0},currentFolder:{id:FOLDER.BIN}}))}}}));function useStoreContext(tt){return useStore(store,tt)}const treeData=tt=>tt.treeData,actionsSelector=tt=>tt.actions,useTreeData=()=>useStoreContext(treeData),useStoreActions=()=>useStoreContext(actionsSelector),useSearchParams=()=>useStoreContext(tt=>tt.searchParams),useSelectedNodeId=()=>useStoreContext(tt=>tt.selectedNodeId),useSelectedFolders=()=>useStoreContext(tt=>tt.selectedFolders),useSelectedResources=()=>useStoreContext(tt=>tt.selectedResources),useSearchConfig=()=>useStoreContext(tt=>tt.searchConfig),useFolderIds=()=>useStoreContext(tt=>tt.folderIds),useResourceIds=()=>useStoreContext(tt=>tt.resourceIds),useResourceAssetIds=()=>useStoreContext(tt=>tt.selectedResources.map(et=>et.assetId)),useResourceWithoutIds=()=>useStoreContext(tt=>tt.selectedResources.filter(et=>et.assetId===et.id)),useCurrentFolder=()=>useStoreContext(tt=>tt.currentFolder),useIsTrash=()=>{const tt=useCurrentFolder();return(tt==null?void 0:tt.id)===FOLDER.BIN},useResourceIsTrash=()=>useStoreContext(tt=>tt.resourceIsTrash),useResourceOrFolderIsDraggable=()=>useStoreContext(tt=>tt.resourceOrFolderIsDraggable),useElementDragOver=()=>useStoreContext(tt=>tt.elementDragOver),useResourceActionDisable=()=>useStoreContext(tt=>tt.resourceActionDisable),useIsRoot=()=>{const tt=useCurrentFolder();return(tt==null?void 0:tt.id)==="default"},useTreeStatus=()=>useStoreContext(tt=>tt.status),useDisableModal=()=>{const tt=useResourceActionDisable(),{clearSelectedIds:et,setResourceActionDisable:rt,clearSelectedItems:nt}=useStoreActions();return{isActionDisableModalOpen:tt,onActionDisableCancel:()=>{et(),nt(),rt(!1)}}},useTrashModal=()=>{const tt=useResourceIsTrash(),{clearSelectedIds:et,setResourceIsTrash:rt,clearSelectedItems:nt}=useStoreActions();return{isTrashedModalOpen:tt,onTrashedCancel:()=>{et(),nt(),rt(!1)}}},DELAY=175,TOLERANCE=10,APP="blog",RESOURCE="blog";class BlogResourceService extends ResourceService{getEditUrl(){throw new Error("Method not implemented.")}async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",nt=et.public?"/blog/pub":"/blog",st=await this.http.post(nt,{title:et.name,description:et.description,visibility:et.public?"PUBLIC":"OWNER",thumbnail:rt,trashed:!1,folder:et.folder,slug:et.public?et.slug:"","publish-type":et.publishType||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(st),st}async update(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",nt=await this.http.put(`/blog/${et.entId}`,{trashed:et.trashed,_id:et.entId,title:et.name,thumbnail:rt,description:et.description,visibility:et.public?"PUBLIC":"OWNER",slug:et.public?et.slug:"","publish-type":et["publish-type"]||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(nt),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE}getApplication(){return APP}getFormUrl(et){return et?`/blog?folderid=${et}#/edit/new`:"/blog#/edit/new"}getViewUrl(et){return`/blog/id/${et}`}getPrintUrl(et){return`/blog/print/${et}`}}ResourceService.register({application:APP,resourceType:RESOURCE},tt=>new BlogResourceService(tt));const rootElement=document.querySelector("[data-explorer-config]");let config;function getExplorerConfig(){var tt;if((tt=rootElement==null?void 0:rootElement.dataset)!=null&&tt.explorerConfig){const{explorerConfig:et}=rootElement.dataset;try{const rt=JSON.parse(et);config={...rt,service:BlogResourceService,enableOnboarding:rt.enableOnboarding!==void 0?rt.enableOnboarding:!0}}catch(rt){console.error("[Explorer Config] could not parse app params from root data attributes:",rootElement==null?void 0:rootElement.dataset,rt)}}return config}const actionsQueryOptions=(tt,et)=>{const rt=tt.map(st=>st.workflow),nt=new Set(rt);return{queryKey:[...nt],queryFn:()=>sessionHasWorkflowRights([...nt]),select:st=>tt.filter(ot=>st[ot.workflow]).map(ot=>({...ot,available:!0})),staleTime:1/0,enabled:!!et}},useActions=tt=>{const et=useStoreContext(rt=>rt.config);return useQuery(actionsQueryOptions(tt,et))},useSearchContext=()=>{const tt=useStoreContext(at=>at.config),et=useSearchParams(),{filters:rt,trashed:nt,search:st}=et,ot=["context",{folderId:rt.folder,filters:rt,trashed:nt,search:st}];return useInfiniteQuery({queryKey:ot,queryFn:async({pageParam:at})=>await searchContext({...et,application:tt==null?void 0:tt.app,types:tt==null?void 0:tt.types,pagination:{...et.pagination,startIdx:at}}),staleTime:5e3,initialPageParam:0,enabled:!!tt,retry:!1,getNextPageParam:at=>at.pagination.startIdx+at.pagination.pageSize})},useTrash=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),st=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedItems:ct,clearSelectedIds:dt,setTreeData:ht,setSearchParams:mt}=useStoreActions(),{filters:xt,trashed:yt}=rt,vt=["context",{folderId:xt.folder,filters:xt,trashed:yt}];return useMutation({mutationFn:async()=>await trashAll({searchParams:rt,folderIds:st,resourceIds:ut,useAssetIds:lt}),onError(Et){typeof Et=="string"&&tt.error(t$2(Et))},onSuccess:async Et=>{if(await et.cancelQueries({queryKey:vt}),et.getQueryData(vt))return tt.success(t$2("explorer.trash.title")),et.setQueryData(vt,St=>{var wt;if(St){const Rt={...St,pages:St==null?void 0:St.pages.map(Pt=>{var It;return{...Pt,folders:Pt.folders.filter(jt=>!st.includes(jt.id)),pagination:{...Pt.pagination,maxIdx:((It=Pt==null?void 0:Pt.pagination)==null?void 0:It.maxIdx)-Et.resources.length},resources:Pt.resources.filter(jt=>lt?!ot.includes(jt.assetId):!ut.includes(jt.id))}})},Ct=deleteNode(nt,{folders:st});return ht(Ct),mt({...rt,pagination:{...rt.pagination,maxIdx:((wt=rt.pagination)==null?void 0:wt.maxIdx)-Et.resources.length}}),Rt}})},onSettled:()=>{ct(),dt()}})},useRestore=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useFolderIds(),st=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?st:ot,{setFolderIds:ut,setResourceIds:ct,setSelectedResources:dt,setSelectedFolders:ht}=useStoreActions(),{filters:mt,trashed:xt}=rt,yt=["context",{folderId:mt.folder,filters:mt,trashed:xt}];return useMutation({mutationFn:async()=>await restoreAll({searchParams:rt,folderIds:nt,resourceIds:lt,useAssetIds:at}),onError(vt){typeof vt=="string"&&tt.error(t$2(vt))},onSuccess:async()=>{if(await et.cancelQueries({queryKey:yt}),et.getQueryData(yt))return tt.success(t$2("explorer.trash.toast")),et.setQueryData(yt,Et=>{if(Et)return{...Et,pages:Et==null?void 0:Et.pages.map(bt=>({...bt,folders:bt.folders.filter(St=>!nt.includes(St.id)),resources:bt.resources.filter(St=>at?!st.includes(St.assetId):!lt.includes(St.id))}))}})},onSettled:()=>{ct([]),dt([]),ut([]),ht([])}})},useDelete=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useFolderIds(),st=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?st:ot,{clearSelectedItems:ut,clearSelectedIds:ct}=useStoreActions(),{filters:dt,trashed:ht}=rt,mt=["context",{folderId:dt.folder,filters:dt,trashed:ht}];return useMutation({mutationFn:async()=>await deleteAll({searchParams:rt,folderIds:nt,resourceIds:lt,useAssetIds:at}),onError(xt){typeof xt=="string"&&tt.error(t$2(xt))},onSuccess:async()=>{if(await et.cancelQueries({queryKey:mt}),et.getQueryData(mt))return tt.success(t$2("explorer.removed.from.trash")),et.setQueryData(mt,yt=>{if(yt)return{...yt,pages:yt==null?void 0:yt.pages.map(Et=>({...Et,folders:Et.folders.filter(bt=>!nt.includes(bt.id)),resources:Et.resources.filter(bt=>at?!st.includes(bt.assetId):!lt.includes(bt.id))}))}})},onSettled:()=>{ut(),ct()}})},useCopyResource=()=>{const tt=useToast(),et=useSearchParams(),rt=useQueryClient(),{user:nt}=useUser(),st=useCurrentFolder(),{filters:ot,trashed:at}=et,lt="duplicate_start",ut=["context",{folderId:ot.folder,filters:ot,trashed:at}];return useMutation({mutationFn:async ct=>(tt.info(t$2("duplicate.start"),{id:lt}),await copyResource(et,ct.assetId)),onSuccess:async(ct,dt)=>{tt.remove(lt),tt.success(t$2("duplicate.done")),await rt.cancelQueries({queryKey:ut});const ht=rt.getQueryData(ut),mt={...dt,name:`${dt.name}${t$2("duplicate.suffix")}`,assetId:ct.duplicateId,id:ct.duplicateId,creatorId:nt==null?void 0:nt.userId,creatorName:nt==null?void 0:nt.username,createdAt:Date.now(),slug:dt.slug||"",modifiedAt:Date.now(),modifierId:(nt==null?void 0:nt.userId)||"",modifierName:(nt==null?void 0:nt.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${nt==null?void 0:nt.userId}`]};ht&&rt.setQueryData(ut,xt=>{if(xt)return{...xt,pages:xt==null?void 0:xt.pages.map(yt=>({...yt,resources:[mt,...yt.resources]}))}}),st.id&&st.id!==FOLDER.DEFAULT&&moveToFolder({searchParams:et,resourceIds:[ct.duplicateId],folderId:st.id,folderIds:[],useAssetIds:!0})},onError:ct=>{tt.remove(lt),typeof ct=="string"&&tt.error(`${t$2("duplicate.error")}: ${ct}`)}})},useMoveItem=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),st=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedIds:ct,clearSelectedItems:dt,setTreeData:ht,setSearchParams:mt}=useStoreActions(),{filters:xt,trashed:yt}=rt,vt=["context",{folderId:xt.folder,filters:xt,trashed:yt}];return useMutation({mutationFn:async Et=>await moveToFolder({searchParams:rt,folderId:Et,folderIds:st,resourceIds:ut,useAssetIds:lt}),onError(Et){typeof Et=="string"&&tt.error(t$2(Et))},onSuccess:async(Et,bt)=>{if(et.getQueryData(vt))return et.setQueryData(vt,wt=>{var Rt;if(wt){const Ct=moveNode(nt,{destinationId:bt,folders:st}),Pt={...wt,pages:wt==null?void 0:wt.pages.map(It=>{var jt;return{...It,folders:It.folders.filter(Dt=>!st.includes(Dt.id)),pagination:{...It.pagination,maxIdx:((jt=It.pagination)==null?void 0:jt.maxIdx)-Et.resources.length},resources:It.resources.filter(Dt=>lt?!ot.includes(Dt.assetId):!ut.includes(Dt.id))}})};return ht(Ct),mt({...rt,pagination:{...rt.pagination,maxIdx:((Rt=rt.pagination)==null?void 0:Rt.maxIdx)-Et.resources.length}}),Pt}});et.invalidateQueries()},onSettled:()=>{dt(),ct()}})},useCreateFolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),{setTreeData:st}=useStoreActions(),{filters:ot,trashed:at}=rt,lt=["context",{folderId:ot.folder,filters:ot,trashed:at}];return useMutation({mutationFn:async({name:ut,parentId:ct})=>await createFolder({searchParams:rt,name:ut,parentId:ct}),onError(ut){typeof ut=="string"&&tt.error(t$2(ut))},onSuccess:async(ut,ct)=>{await et.cancelQueries({queryKey:lt});const dt=et.getQueryData(lt),ht={...ut,parentId:ct.parentId,children:[],rights:[`creator:${ut==null?void 0:ut.creator_id}`]};if(dt)return et.setQueryData(lt,mt=>{if(mt){const xt={...mt,pages:mt==null?void 0:mt.pages.map(vt=>({...vt,folders:[...vt.folders,ht]}))},yt=addNode(nt,{parentId:ct.parentId,newFolder:ht});return st(yt),xt}})}})},useUpdatefolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),{setFolderIds:st,setSelectedFolders:ot,setTreeData:at}=useStoreActions(),{filters:lt,trashed:ut}=rt,ct=["context",{folderId:lt.folder,filters:lt,trashed:ut}];return useMutation({mutationFn:async({folderId:dt,name:ht,parentId:mt})=>await updateFolder({searchParams:rt,folderId:dt,parentId:mt,name:ht}),onError(dt){typeof dt=="string"&&tt.error(t$2(dt))},onSuccess:async(dt,ht)=>{if(await et.cancelQueries({queryKey:ct}),et.getQueryData(ct))return et.setQueryData(ct,xt=>{if(xt){const yt={...xt,pages:xt==null?void 0:xt.pages.map(Et=>({...Et,folders:Et.folders.map(bt=>bt.id===dt.id?{...dt,parentId:ht.parentId,rights:bt.rights}:bt)}))},vt=updateNode(nt,{folderId:ht.folderId,newFolder:dt});return at(vt),yt}})},onSettled:()=>{st([]),ot([])}})},useShareResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{setResourceIds:nt,setSelectedResources:st}=useStoreActions(),{filters:ot,trashed:at}=rt,lt=["context",{folderId:ot.folder,filters:ot,trashed:at}];return useShareMutation({application:tt,options:{onSuccess:async(ut,ct)=>{if(await et.cancelQueries({queryKey:lt}),et.getQueryData(lt))return et.setQueryData(lt,ht=>{if(ht)return{...ht,pages:ht==null?void 0:ht.pages.map(mt=>({...mt,resources:mt.resources.map(xt=>{if(xt.assetId===(ct==null?void 0:ct.resourceId)){let yt=[`creator:${xt.creatorId}`];return(ct==null?void 0:ct.rights.length)>=1&&(yt=[...yt,...ct.rights.flatMap(vt=>vt.actions.map(Et=>`${vt.type}:${vt.id}:${Et.id}`))]),{...xt,rights:yt}}else return xt})}))}})},onSettled:()=>{nt([]),st([])}}})},useUpdateResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{filters:nt,trashed:st}=rt,ot=["context",{folderId:nt.folder,filters:nt,trashed:st}];return useUpdateMutation({application:tt,options:{onSuccess:async(at,lt)=>{if(await et.cancelQueries({queryKey:ot}),et.getQueryData(ot))return et.setQueryData(ot,ct=>{if(ct)return{...ct,pages:ct==null?void 0:ct.pages.map(dt=>({...dt,resources:dt.resources.map(ht=>{if(ht.assetId===(lt==null?void 0:lt.entId)){const{name:mt,thumbnail:xt,public:yt,description:vt,slug:Et,...bt}=lt;return{...ht,...bt,name:mt,thumbnail:typeof xt=="string"?xt:URL.createObjectURL(xt),public:yt,description:vt,slug:Et}}else return ht})}))}})}}})},useCreateResource=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),{user:nt}=useUser(),{appCode:st}=useEdificeClient(),ot=["context",{folderId:rt.filters.folder,filters:rt.filters,trashed:rt.trashed}];return useMutation({mutationFn:async at=>await createResource({searchParams:rt,params:at}),onError(at){typeof at=="string"&&tt.error(t$2(at))},onSuccess:async(at,lt)=>{var dt,ht,mt;await et.cancelQueries({queryKey:ot});const ut=et.getQueryData(ot),ct={...lt,thumbnail:at.thumbnail||"",application:st,assetId:at._id||at.entId||"",id:at._id||at.entId||"",creatorId:nt==null?void 0:nt.userId,creatorName:nt==null?void 0:nt.username,createdAt:Date.now(),slug:lt.slug||"",modifiedAt:((dt=at.modified)==null?void 0:dt.$date)||"",modifierId:((ht=at.author)==null?void 0:ht.userId)||"",modifierName:((mt=at.author)==null?void 0:mt.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${nt==null?void 0:nt.userId}`]};if(ut)return et.setQueryData(ot,xt=>{if(xt)return{...xt,pages:xt==null?void 0:xt.pages.map(yt=>({...yt,resources:[ct,...yt.resources]}))}})}})};function getChildrenIds(tt,et){var nt;const rt=findNodeById(tt,et);return(nt=rt==null?void 0:rt.folder)!=null&&nt.childrenIds?[...(rt==null?void 0:rt.folder.childrenIds)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function useDndKit(){const tt=useQueryClient(),et=useMoveItem(),rt=useToast(),{appCode:nt}=useEdificeClient(),{t:st}=useTranslation(["common",nt]),ot=st("explorer.filters.mine",{ns:nt}),{setResourceOrFolderIsDraggable:at,setElementDragOver:lt,setResourceIds:ut,setFolderIds:ct,fetchTreeData:dt}=useStoreActions(),ht=useTreeData(),xt=useSensor(PointerSensor,{activationConstraint:{delay:DELAY,tolerance:TOLERANCE}}),yt=useSensor(KeyboardSensor),vt=useSensors(xt,yt),Et=(Rt,Ct)=>{var Pt;((Pt=Rt.data.current)==null?void 0:Pt.type)==="resource"?rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[st("explorer.dragged.resource")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]})):rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[st("explorer.dragged.folder")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]}))};return{handleDragEnd:async Rt=>{const{over:Ct,active:Pt}=Rt,It=Ct==null?void 0:Ct.data.current,jt=Pt.data.current,Dt=getAncestors(ht,It==null?void 0:It.id),Vt=getChildrenIds(ht,It==null?void 0:It.id);if((jt==null?void 0:jt.id)==(It==null?void 0:It.id)||Dt.includes(jt==null?void 0:jt.id)||Vt.includes(jt==null?void 0:jt.id))ut([]),ct([]);else{const Ft=(It==null?void 0:It.name)??ot;if(Ct)try{await et.mutate(It==null?void 0:It.id),Et(Pt,Ft)}catch(Ht){console.error(Ht)}finally{lt({isOver:!1,overId:void 0,canMove:!0,isTreeview:!1})}}at({isDrag:!1,elementDrag:void 0})},handleDragStart:Rt=>{const{active:Ct}=Rt,Pt=Ct.data.current;(Pt==null?void 0:Pt.type)==="resource"?ut([Pt==null?void 0:Pt.id]):(Pt==null?void 0:Pt.type)==="folder"&&ct([Pt==null?void 0:Pt.id]),at({isDrag:!0,elementDrag:Pt==null?void 0:Pt.id})},handleDragOver:Rt=>{const{over:Ct,active:Pt}=Rt,It=Ct==null?void 0:Ct.data.current,jt=Pt==null?void 0:Pt.data.current,Dt=getAncestors(ht,It==null?void 0:It.id),Vt=getChildrenIds(ht,It==null?void 0:It.id);if(Ct){const Ft={isOver:!0,canMove:!1,overId:It==null?void 0:It.id,isTreeview:It==null?void 0:It.isTreeview};(jt==null?void 0:jt.id)===(It==null?void 0:It.id)||Dt.includes(jt==null?void 0:jt.id)||Vt.includes(jt==null?void 0:jt.id)?lt({...Ft,canMove:!1}):(dt(It==null?void 0:It.id,tt),lt({...Ft,canMove:!0}))}else lt({isOver:!1,overId:void 0,canMove:!0,isTreeview:!1})},sensors:vt}}const EmptyScreenApp$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenApp$1),void 0)),EmptyScreenSearch$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenSearch$1),void 0)),EmptyScreenError$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenError$1),void 0)),EmptyScreenNoContentInFolder$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenNoContentInFolder$1),void 0)),EmptyScreenTrash$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenTrash$1),void 0)),FoldersList$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FoldersList$1),void 0)),ResourcesList$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ResourcesList$1),void 0)),List=()=>{const tt=useIsRoot(),et=useIsTrash(),rt=useSelectedNodeId(),nt=useSearchParams(),st=useCurrentFolder(),ot=useToast(),at=useQueryClient(),{appCode:lt}=useEdificeClient(),{t:ut}=useTranslation([lt]),{setSearchParams:ct,setSearchConfig:dt,fetchTreeData:ht}=useStoreActions(),{data:mt,isError:xt,error:yt,isLoading:vt,isFetching:Et,fetchNextPage:bt}=useSearchContext(),St=(mt==null?void 0:mt.pages[0].folders.length)===0,wt=(mt==null?void 0:mt.pages[0].resources.length)===0,Rt=St&&wt;return reactExports.useEffect(()=>{var Ct,Pt;mt&&((Ct=mt==null?void 0:mt.pages[0])!=null&&Ct.searchConfig&&dt(mt.pages[0].searchConfig),!nt.search&&st.id==="default"&&ht(st.id,at),ct({...nt,pagination:(Pt=mt==null?void 0:mt.pages[(mt==null?void 0:mt.pages.length)-1])==null?void 0:Pt.pagination}))},[mt]),reactExports.useEffect(()=>{yt&&typeof yt=="string"&&ot.error(ut(yt))},[yt]),vt?jsxRuntimeExports.jsx(LoadingScreen,{}):xt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenError$2,{})}):nt.search&&Rt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenSearch$2,{})}):tt&&Rt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenApp$2,{})}):rt&&Rt&&!et?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenNoContentInFolder$2,{})}):et&&(mt==null?void 0:mt.pages[0].resources.length)===0?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenTrash$2,{})}):jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[jsxRuntimeExports.jsx(FoldersList$2,{data:mt,isFetching:Et}),jsxRuntimeExports.jsx(ResourcesList$2,{data:mt,isFetching:Et,fetchNextPage:bt})]})},SvgIconArrowLeft=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.707 4.293a1 1 0 0 1 0 1.414L6.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0",clipRule:"evenodd"})]}),SvgIconFiles=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20.91 9.14v1.27H8.25a4.7 4.7 0 0 0-3.86 1.98L1.5 16.53V6.4a2.3 2.3 0 0 1 .77-1.69A2.68 2.68 0 0 1 4.11 4h3.73a2.68 2.68 0 0 1 1.84.71c.25.22.45.48.58.77s.2.6.2.92v.34h7.84c.7.01 1.35.27 1.84.71.49.45.76 1.06.77 1.7ZM8.25 11.92h14.47c.63 0 1 .68.64 1.18l-3.52 5.04a3.13 3.13 0 0 1-2.57 1.32H2.79c-.62 0-.99-.68-.64-1.18l3.53-5.04a3.13 3.13 0 0 1 2.57-1.32",clipRule:"evenodd"})]}),SvgIconFilter=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.093 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .764 1.646L15 12.826V21a1 1 0 0 1-1.447.894l-4-2A1 1 0 0 1 9 19v-6.174l-7.764-9.18a1 1 0 0 1-.143-1.067M4.155 4l6.609 7.814a1 1 0 0 1 .236.646v5.922l2 1V12.46a1 1 0 0 1 .236-.646L19.845 4z",clipRule:"evenodd"})]}),SvgIconMove=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.707 8.293a1 1 0 0 1 0 1.414L3.414 12l2.293 2.293a1 1 0 1 1-1.414 1.414l-3-3a1 1 0 0 1 0-1.414l3-3a1 1 0 0 1 1.414 0M11.293 1.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.414L12 3.414 9.707 5.707a1 1 0 0 1-1.414-1.414zM8.293 18.293a1 1 0 0 1 1.414 0L12 20.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414M18.293 8.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L20.586 12l-2.293-2.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 12a1 1 0 0 1 1-1h20a1 1 0 1 1 0 2H2a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 1a1 1 0 0 1 1 1v20a1 1 0 1 1-2 0V2a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),useSearchForm=()=>{const tt=useSearchParams(),[et,rt]=reactExports.useState(""),nt=useSearchConfig(),st=useTreeStatus(),ot=reactExports.useRef(null),{setSearchParams:at}=useStoreActions(),lt=dt=>{const ht=dt.target.value;rt(ht.toString())},ut=dt=>{(dt.key==="Enter"||dt.key==="Return")&&(dt.preventDefault(),at({search:et||void 0}))},ct=dt=>{dt.preventDefault(),at({search:et||void 0})};return reactExports.useEffect(()=>{const ht=et.length==0||et.length>=nt.minLength?{search:et||void 0}:{};at({...tt,...ht})},[et,nt.minLength]),reactExports.useEffect(()=>{st==="select"&&rt("")},[st]),reactExports.useEffect(()=>{rt(()=>{var dt;return((dt=tt.search)==null?void 0:dt.toString())??""})},[tt]),{formRef:ot,inputSearch:et,handleInputSearchChange:lt,handleKeyPress:ut,handleSearchSubmit:ct}},useSelectedFilters=()=>{const{appCode:tt,currentApp:et}=useEdificeClient(),{t:rt}=useTranslation(),[nt,st]=reactExports.useState(""),ot=dt=>{if(dt==="0"){st("");return}st(dt)},at=useCurrentFolder(),lt=useSearchParams(),{setSearchParams:ut}=useStoreActions();reactExports.useEffect(()=>{const dt=()=>nt.includes("1")?!0:void 0,ht=()=>nt.includes("2")?!0:void 0,mt=()=>nt.includes("7")?!0:void 0;ut({...lt,filters:{owner:dt(),public:mt(),shared:ht(),folder:at?at.id:"default"}})},[at,ut,nt]);const ct=[{label:rt("explorer.filter.all",{ns:tt}),value:"0"},{label:rt("explorer.filter.owner",{ns:tt}),value:"1"},{label:rt("explorer.filter.shared",{ns:tt}),value:"2"},...(et==null?void 0:et.displayName)=="exercizer"?[{label:"Exercices interactifs",value:"3"}]:[],...(et==null?void 0:et.displayName)=="exercizer"?[{label:"Exercices à rendre",value:"4"}]:[],...(et==null?void 0:et.displayName)=="pages"?[{label:"Projets publics",value:"5"}]:[],...(et==null?void 0:et.displayName)=="pages"?[{label:"Projets internes",value:"6"}]:[],...(et==null?void 0:et.displayName)=="blog"?[{label:rt("explorer.filter.public",{ns:tt}),value:"7"}]:[]];return{selectedFilters:nt,options:ct,handleOnSelectFilter:ot}},SearchForm=()=>{const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation(),{selectedFilters:rt,options:nt,handleOnSelectFilter:st}=useSelectedFilters(),{formRef:ot,inputSearch:at,handleInputSearchChange:lt,handleKeyPress:ut,handleSearchSubmit:ct}=useSearchForm(),dt=rt.length>0?rt.length:void 0;return jsxRuntimeExports.jsxs("form",{noValidate:!0,className:"bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative d-flex gap-8",ref:ot,children:[jsxRuntimeExports.jsxs(FormControl,{id:"search",className:"input-group",children:[jsxRuntimeExports.jsx(Input,{type:"search",placeholder:et("explorer.label.search",{ns:tt}),size:"lg",noValidationIcon:!0,value:at,onChange:lt,onKeyDown:ut}),jsxRuntimeExports.jsx(SearchButton,{type:"submit","aria-label":et("explorer.label.search",{ns:tt}),onClick:ct})]}),jsxRuntimeExports.jsxs(Dropdown,{placement:"bottom-end",children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{label:et("explorer.filters"),icon:jsxRuntimeExports.jsx(SvgIconFilter,{width:20}),variant:"ghost",badgeContent:dt}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:nt.map(ht=>ht.value==="0"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>st(ht.value),children:ht.label}),jsxRuntimeExports.jsx(Dropdown.Separator,{})]},"0"):jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>st(ht.value),children:ht.label},ht.value))})]})]})},TrashButton=({id:tt,selected:et,onSelect:rt})=>{const{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:jsxRuntimeExports.jsx("li",{id:tt,role:"treeitem","aria-selected":et,children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:"action-container",children:jsxRuntimeExports.jsx("div",{onClick:rt,role:"button",tabIndex:0,children:jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-8 py-8 ps-24",children:[jsxRuntimeExports.jsx(SvgIconDelete,{width:"20",height:"20"}),jsxRuntimeExports.jsx("span",{children:nt("explorer.tree.trash")})]})})})})})})})},CreateFolderModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FolderModal$2),void 0)),TreeViewContainer=()=>{const[tt,et]=useToggle(),rt=useQueryClient(),nt=useTreeData(),st=useIsTrash(),ot=useSelectedNodeId(),at=useElementDragOver(),lt=useScrollToTop(),ut=st?FOLDER.BIN:ot,{appCode:ct}=useEdificeClient(),{t:dt}=useTranslation(["common",ct]),ht={...nt,name:dt("explorer.filters.mine",{ns:ct})},{goToTrash:mt,selectTreeItem:xt,clearSelectedItems:yt,clearSelectedIds:vt,fetchTreeData:Et}=useStoreActions(),bt=Rt=>{xt(Rt,rt),lt()},St=Rt=>{var It,jt;const Ct=findNodeById(nt,Rt),Pt=(It=Ct==null?void 0:Ct.children)==null?void 0:It.some(Dt=>{var Vt;return Array.isArray(Dt==null?void 0:Dt.children)&&((Vt=Dt.children)==null?void 0:Vt.length)>0});(jt=Ct==null?void 0:Ct.children)==null||jt.forEach(Dt=>{Pt||Et(Dt.id,rt)})},wt=()=>{yt(),vt(),et()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TreeView,{data:ht,selectedNodeId:ut,draggedNode:at!=null&&at.isTreeview?at:void 0,onTreeItemClick:bt,onTreeItemUnfold:St}),jsxRuntimeExports.jsx(TrashButton,{id:FOLDER.BIN,selected:st,onSelect:mt}),jsxRuntimeExports.jsx("div",{className:"d-grid my-16",children:jsxRuntimeExports.jsx(Button,{disabled:st,type:"button",color:"primary",variant:"outline",leftIcon:jsxRuntimeExports.jsx(SvgIconPlus,{}),onClick:wt,children:dt("explorer.folder.new")})}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:tt&&jsxRuntimeExports.jsx(CreateFolderModal,{edit:!1,isOpen:tt,onSuccess:et,onCancel:et})})]})};function ExplorerBreadcrumb(){const{appCode:tt}=useEdificeClient(),{gotoPreviousFolder:et}=useStoreActions(),{t:rt}=useTranslation(["common",tt]),{inputSearch:nt}=useSearchForm(),st=useSelectedNodeId(),ot=useIsTrash(),at=useCurrentFolder(),lt=rt("explorer.tree.trash"),ut=rt("explorer.tree.search"),ct=rt("explorer.filters.mine",{ns:tt}),dt=(at==null?void 0:at.name)||ct;return jsxRuntimeExports.jsx("div",{className:"py-16",children:st&&st!=="bin"&&st!=="default"&&!ot?jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-8",children:[jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconArrowLeft,{}),variant:"ghost",color:"tertiary","aria-label":rt("back"),className:"ms-n16",onClick:et}),jsxRuntimeExports.jsx("p",{className:"body py-8 text-truncate",children:jsxRuntimeExports.jsx("strong",{children:dt})})]}):jsxRuntimeExports.jsx("h2",{className:"body py-8 fw-bold",children:nt.length!==0?ut:ot?lt:ct})})}const illuTrashDelete="/assets/js/ode-explorer/illu-trash-delete.svg",illuTrashMenu="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='version_orange'%20data-name='version%20orange'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20576%20353.36'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23fff;%20}%20.cls-2%20{%20fill:%20%23aadaed;%20}%20.cls-3%20{%20fill:%20%23ffefe3;%20}%20.cls-4%20{%20fill:%20none;%20stroke:%20%23aadaed;%20stroke-miterlimit:%2010;%20stroke-width:%204px;%20}%20.cls-5%20{%20fill:%20%232a9cc8;%20}%20%3c/style%3e%3c/defs%3e%3cg%20id='ciseaux'%3e%3cpath%20class='cls-3'%20d='m512.64,45.09H61.92c-11.56,0-20.93,9.37-20.93,20.93v232.01c0,11.56,9.37,20.93,20.93,20.93h450.72c11.56,0,20.93-9.37,20.93-20.93V66.02c0-11.56-9.37-20.93-20.93-20.93ZM211.25,212.37c0,7.55-6.12,13.66-13.66,13.66h-108.21c-7.55,0-13.66-6.12-13.66-13.66v-112.62c0-7.55,6.12-13.66,13.66-13.66h108.21c7.55,0,13.66,6.12,13.66,13.66v112.62Zm150.21-41.03h-94.5c-4.42,0-8-3.58-8-8s3.58-8,8-8h94.5c4.42,0,8,3.58,8,8s-3.58,8-8,8Zm105.82,118.05H164.74c-4.42,0-8-3.58-8-8s3.58-8,8-8h302.55c4.42,0,8,3.58,8,8s-3.58,8-8,8Zm-3.54-169.27h-196.7c-6.38,0-11.55-5.17-11.55-11.55s5.17-11.55,11.55-11.55h196.7c6.38,0,11.55,5.17,11.55,11.55s-5.17,11.55-11.55,11.55Zm-332.66,158.93c0,13.56-10.99,24.55-24.55,24.55s-24.55-10.99-24.55-24.55,10.99-24.55,24.55-24.55,24.55,10.99,24.55,24.55Z'/%3e%3c/g%3e%3crect%20class='cls-5'%20x='420.8'%20y='58.38'%20width='100.39'%20height='100.39'%20rx='20'%20ry='20'/%3e%3cg%20id='ciseaux-2'%20data-name='ciseaux'%3e%3cpath%20class='cls-4'%20d='m513.58,45.09H60.99c-11.05,0-20,8.95-20,20v233.88c0,11.05,8.95,20,20,20h452.59c11.05,0,20-8.95,20-20V65.09c0-11.05-8.95-20-20-20Z'/%3e%3c/g%3e%3ccircle%20class='cls-1'%20cx='471'%20cy='84.02'%20r='7.02'/%3e%3ccircle%20class='cls-1'%20cx='471'%20cy='109.3'%20r='7.02'/%3e%3ccircle%20class='cls-1'%20cx='471'%20cy='133.13'%20r='7.02'/%3e%3cg%3e%3cpath%20class='cls-2'%20d='m449.99,215.32c-.39,0-.76-.08-1.12-.24l-9.44-4.22c-.69-.31-1.23-.9-1.48-1.62-.25-.72-.18-1.52.17-2.19l3.92-7.33-13.25-5.79c-.83-.36-1.43-1.11-1.6-2.01s.11-1.81.76-2.45l40.08-40.08c.52-.52,1.21-.81,1.94-.81,1.52,0,2.75,1.23,2.75,2.75v57.58c0,.75-.3,1.45-.83,1.97-.52.5-1.2.78-1.91.78h0c-.38,0-.75-.08-1.1-.23l-12.85-5.61-3.53,7.87c-.44.99-1.43,1.62-2.51,1.62Z'/%3e%3cpath%20class='cls-1'%20d='m469.97,150.6c.38,0,.75.3.75.75v57.58c0,.43-.35.75-.75.75-.1,0-.2-.02-.3-.06l-13.99-6.11c-.1-.04-.2-.06-.3-.06-.29,0-.56.16-.68.44l-4.03,9c-.12.28-.4.44-.68.44-.1,0-.21-.02-.3-.07l-9.44-4.22c-.4-.18-.56-.65-.35-1.04l4.56-8.53c.21-.38.04-.86-.36-1.04l-14.5-6.33c-.48-.21-.6-.84-.23-1.21l40.08-40.08c.15-.15.34-.22.52-.22m0-4c-1.26,0-2.45.49-3.35,1.39l-40.08,40.08c-1.11,1.11-1.6,2.7-1.31,4.24.29,1.54,1.33,2.84,2.77,3.47l11.27,4.92-2.9,5.42c-.62,1.16-.73,2.53-.31,3.78.42,1.24,1.36,2.26,2.55,2.8l9.44,4.22c.61.27,1.27.41,1.94.41,1.87,0,3.57-1.1,4.33-2.81l2.72-6.06,11.04,4.82c.6.26,1.24.4,1.9.4,2.62,0,4.75-2.13,4.75-4.75v-57.58c0-2.62-2.13-4.75-4.75-4.75h0Z'/%3e%3c/g%3e%3c/svg%3e",illuTrashNotif="data:image/svg+xml,%3csvg%20width='300'%20height='214'%20viewBox='0%200%20300%20214'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='300'%20height='214'%20fill='white'/%3e%3cpath%20d='M187.994%20193.875H108.563C103.268%20193.875%2098.878%20189.768%2098.5214%20184.484L90.1194%2059.0277H209.67L198.01%20184.741C197.529%20189.915%20193.19%20193.875%20187.99%20193.875H187.994Z'%20fill='%23FFEFE3'/%3e%3cpath%20d='M150.47%20150.31L164.483%20157.961C166.929%20159.296%20169.995%20158.395%20171.33%20155.95C171.999%20154.726%20172.106%20153.35%20171.742%20152.111C171.378%20150.872%20170.539%20149.773%20169.319%20149.103C167.223%20147.96%20166.638%20146.217%20166.954%20144.029C168.388%20134.186%20188.167%20115.393%20171.091%20102.13L162.134%2097.2392C141.741%2090.047%20136.626%20116.845%20129.121%20123.372C127.456%20124.824%20125.672%20125.273%20123.577%20124.126C121.131%20122.791%20118.065%20123.692%20116.73%20126.137C116.061%20127.358%20115.954%20128.736%20116.318%20129.976C116.682%20131.215%20117.521%20132.314%20118.741%20132.983L131.537%20139.97L132.751%20140.632L150.467%20150.306L150.47%20150.31Z'%20fill='%23AADAED'/%3e%3cpath%20opacity='0.2'%20d='M171.095%20102.13L171.117%20102.144L171.095%20102.13Z'%20fill='%23AADAED'/%3e%3cpath%20d='M171.095%20102.13L171.117%20102.141C171.187%20102.034%20171.253%20101.924%20171.315%20101.81C172.676%2099.3167%20171.76%2096.1913%20169.267%2094.8308C166.774%2093.4703%20163.649%2094.3895%20162.288%2096.8789C162.226%2096.9929%20162.167%2097.1068%20162.115%2097.2245L162.137%2097.2355L171.095%20102.126V102.13Z'%20fill='%23AADAED'/%3e%3cpath%20d='M133.67%20142.455C138.56%20145.228%20143.451%20148%20148.341%20150.773C146.422%20154.365%20142.929%20156.483%20139.421%20156.23C138.921%20156.193%20136.292%20155.954%20134.328%20153.884C131.769%20151.188%20131.438%20146.563%20133.674%20142.459L133.67%20142.455Z'%20fill='%23AADAED'/%3e%3cpath%20d='M145.56%2088.6624C145.125%2086.8475%20143.302%2085.7288%20141.488%2086.1636C139.674%2086.5984%20138.556%2088.4221%20138.991%2090.2369L156.729%20164.233C157.164%20166.048%20158.987%20167.166%20160.801%20166.732C162.615%20166.297%20163.732%20164.473%20163.297%20162.658L145.56%2088.6624Z'%20fill='%232A9CC8'/%3e%3cpath%20d='M214.66%2037.9143H195.186L189.833%2028.707C187.068%2023.9526%20181.938%2021%20176.441%2021H125.492C120.44%2021%20115.693%2023.471%20112.796%2027.6149L105.592%2037.9143H85.1334C81.1916%2037.9143%2078%2041.1096%2078%2045.0477V46.592C78%2050.5338%2081.1953%2053.7254%2085.1334%2053.7254H214.66C218.602%2053.7254%20221.793%2050.5301%20221.793%2046.592V45.0477C221.793%2041.1059%20218.598%2037.9143%20214.66%2037.9143ZM122.437%2034.3586C123.132%2033.3621%20124.275%2032.7664%20125.489%2032.7664H176.437C177.761%2032.7664%20178.993%2033.4761%20179.658%2034.6196L181.574%2037.9143H119.947L122.433%2034.3586H122.437Z'%20fill='%23FFEFE3'/%3e%3cpath%20d='M187.064%2093.9335C187.56%2093.9777%20188.046%2093.7864%20188.542%2093.7313C189.038%2093.6761%20189.63%2093.8232%20189.822%2094.2828C190.108%2094.9778%20189.274%2095.6911%20189.369%2096.4376C189.424%2096.8604%20189.763%2097.1803%20190.079%2097.4635C190.719%2098.0334%20191.362%2098.607%20192.002%2099.177C192.164%2099.3204%20192.329%2099.4748%20192.384%2099.6807C192.454%2099.9307%20192.34%20100.192%20192.245%20100.434C191.829%20101.49%20191.789%20102.894%20192.723%20103.542C192.98%20103.722%20193.304%20103.828%20193.488%20104.086C193.693%20104.376%20193.66%20104.766%20193.605%20105.119C193.473%20105.994%20193.278%20106.858%20193.021%20107.708'%20stroke='white'%20stroke-width='6.05'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M105.681%20138.694C105.611%20140.003%20105.658%20141.562%20106.751%20142.29C106.993%20142.452%20107.276%20142.558%20107.493%20142.757C108.122%20143.331%20107.931%20144.353%20107.633%20145.151C107.335%20145.949%20106.982%20146.868%20107.409%20147.6C107.817%20148.298%20108.762%20148.493%20109.284%20149.111C109.813%20149.732%20109.828%20150.685%20110.387%20151.28C110.626%20151.534%20110.964%20151.721%20111.089%20152.049C111.189%20152.31%20111.126%20152.597%20111.126%20152.876C111.126%20153.63%20111.597%20154.321%20112.196%20154.781C112.796%20155.24%20113.516%20155.501%20114.226%20155.755'%20stroke='white'%20stroke-width='6.05'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",AppAction$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>AppAction$1),void 0)),Library$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>Library$1),void 0)),ActionBar=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ActionBarContainer$1),void 0)),DisableModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>DisableModal$1),void 0)),TrashModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>TrashModal$1),void 0)),OnboardingModal$1=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>OnboardingModal),void 0)),Explorer=({config:tt})=>{const et=useSearchParams(),{setConfig:rt,setSearchParams:nt}=useStoreActions();reactExports.useEffect(()=>{rt(tt||{}),nt({...et,application:tt.app,types:tt.types})},[tt]);const{currentApp:st}=useEdificeClient(),{data:ot}=useActions(tt.actions),{isTrashedModalOpen:at,onTrashedCancel:lt}=useTrashModal(),{isActionDisableModalOpen:ut,onActionDisableCancel:ct}=useDisableModal(),{handleDragEnd:dt,handleDragOver:ht,handleDragStart:mt,sensors:xt}=useDndKit();useXitiTrackPageLoad();const yt=isActionAvailable("publish",ot),vt=isActionAvailable("create",ot);return tt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AppHeader,{render:()=>vt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(AppAction$2,{})}):null,children:jsxRuntimeExports.jsx(Breadcrumb,{app:st})}),jsxRuntimeExports.jsx(Grid,{className:"flex-grow-1",children:jsxRuntimeExports.jsxs(DndContext,{sensors:xt,modifiers:[snapCenterToCursor],onDragStart:mt,onDragEnd:dt,onDragOver:ht,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"3",lg:"2",xl:"3",className:"border-end pt-16 pe-16 d-none d-lg-block",as:"aside",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[jsxRuntimeExports.jsx(TreeViewContainer,{}),yt&&jsxRuntimeExports.jsx(Library$2,{})]})}),jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",lg:"6",xl:"9",children:[jsxRuntimeExports.jsx(SearchForm,{}),jsxRuntimeExports.jsx(ExplorerBreadcrumb,{}),jsxRuntimeExports.jsx(List,{})]}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[jsxRuntimeExports.jsx(ActionBar,{}),tt.enableOnboarding&&jsxRuntimeExports.jsx(OnboardingModal$1,{id:"showOnboardingTrash",items:[{src:illuTrashMenu,alt:"explorer.modal.onboarding.trash.screen1.alt",text:"explorer.modal.onboarding.trash.screen1.title"},{src:illuTrashNotif,alt:"explorer.modal.onboarding.trash.screen2.alt",text:"explorer.modal.onboarding.trash.screen2.alt"},{src:illuTrashDelete,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"}}),at&&jsxRuntimeExports.jsx(TrashModal$2,{isOpen:at,onCancel:lt}),ut&&jsxRuntimeExports.jsx(DisableModal$2,{isOpen:ut,onCancel:ct})]})]})})]})};function Root(){const{init:tt}=useEdificeClient(),et=getExplorerConfig();return tt?jsxRuntimeExports.jsx(Layout,{children:jsxRuntimeExports.jsx(Explorer,{config:et})}):jsxRuntimeExports.jsx(LoadingScreen,{position:!1})}var ReactQueryDevtools2=function(){return null};const queryClient=new QueryClient({queryCache:new QueryCache({onError:tt=>{typeof tt=="string"&&tt===ERROR_CODE.NOT_LOGGED_IN&&window.location.replace("/auth/login")}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),getHTMLConfig=getExplorerConfig(),Providers=({children:tt})=>jsxRuntimeExports.jsxs(QueryClientProvider,{client:queryClient,children:[jsxRuntimeExports.jsx(EdificeClientProvider,{params:{app:getHTMLConfig.app},children:jsxRuntimeExports.jsx(EdificeThemeProvider,{children:tt})}),jsxRuntimeExports.jsx(ReactQueryDevtools2,{initialIsOpen:!1})]}),root=document.getElementById("root");createRoot(root).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(Providers,{children:jsxRuntimeExports.jsx(Root,{})})}));const __variableDynamicImportRuntimeHelper=(tt,et,rt)=>{const nt=tt[et];return nt?typeof nt=="function"?nt():Promise.resolve(nt):new Promise((st,ot)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(ot.bind(null,new Error("Unknown variable dynamic import: "+et+(et.split("/").length!==rt?". Note that variables only represent file names one level deep.":""))))})};function EmptyScreenApp(){const{appCode:tt}=useEdificeClient(),{theme:et}=useEdificeTheme(),{t:rt}=useTranslation(),[nt,st]=reactExports.useState("");reactExports.useEffect(()=>{(async()=>{const ht=await __variableDynamicImportRuntimeHelper(Object.assign({"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-blog.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuBlog$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-collaborativeeditor.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuCollaborativeeditor$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-collaborativewall.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuCollaborativewall$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuError$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-exercizer.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuExercizer$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-mindmap.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuMindmap$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-no-content-in-folder.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuNoContentInFolder$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-pad.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuPad$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-scrapbook.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuScrapbook$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-search.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuSearch$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-timeline.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuTimeline$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-timelinegenerator.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuTimelinegenerator$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuTrash$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-wiki.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuWiki$1),void 0)}),`../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-${tt}.svg`,10);st(ht.default)})()},[tt]);const ot=useStoreContext(dt=>dt.config),{data:at}=useActions(ot==null?void 0:ot.actions),lt=at==null?void 0:at.find(dt=>dt.id==="create"),ut=()=>lt!=null&&lt.available&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.txt1d.create",{ns:tt}):lt!=null&&lt.available&&!(et!=null&&et.is1d)?rt("explorer.emptyScreen.txt2d.create",{ns:tt}):!(lt!=null&&lt.available)&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.txt1d.consultation",{ns:tt}):rt("explorer.emptyScreen.txt2d.consultation",{ns:tt}),ct=()=>lt!=null&&lt.available&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.title1d.create",{ns:tt}):lt!=null&&lt.available&&!(et!=null&&et.is1d)?rt("explorer.emptyScreen.title2d.create",{ns:tt}):!(lt!=null&&lt.available)&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.title1d.consultation",{ns:tt}):rt("explorer.emptyScreen.title2d.consultation",{ns:tt});return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:nt,imageAlt:rt("explorer.emptyScreen.app.alt",{ns:tt}),title:ct(),text:ut()})}const EmptyScreenApp$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenApp},Symbol.toStringTag,{value:"Module"})),illuSearch="/assets/js/ode-explorer/illu-search.svg",illuSearch$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuSearch},Symbol.toStringTag,{value:"Module"}));function EmptyScreenSearch(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuSearch,imageAlt:et("explorer.emptyScreen.search.alt",{ns:tt}),text:et("explorer.emptyScreen.search.text",{ns:tt})})}const EmptyScreenSearch$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenSearch},Symbol.toStringTag,{value:"Module"}));function EmptyScreenError(){const{t:tt}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,imageAlt:tt("explorer.emptyScreen.error.alt"),text:"explorer.emptyScreen.error.text"})}const EmptyScreenError$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenError},Symbol.toStringTag,{value:"Module"})),illuNoContentInFolder="/assets/js/ode-explorer/illu-no-content-in-folder.svg",illuNoContentInFolder$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuNoContentInFolder},Symbol.toStringTag,{value:"Module"}));function EmptyScreenNoContentInFolder(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuNoContentInFolder,imageAlt:et("explorer.emptyScreen.folder.empty.alt",{ns:tt}),text:et("explorer.emptyScreen.label",{ns:tt})})}const EmptyScreenNoContentInFolder$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenNoContentInFolder},Symbol.toStringTag,{value:"Module"}));function EmptyScreenTrash(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,imageAlt:et("explorer.emptyScreen.trash.alt"),title:et("explorer.emptyScreen.trash.title"),text:et("explorer.emptyScreen.trash.empty",{ns:tt})})}const EmptyScreenTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenTrash},Symbol.toStringTag,{value:"Module"}));function CardIcon({app:tt,type:et}){return et==="folder"?jsxRuntimeExports.jsx(SvgIconFiles,{width:"24",height:"24",className:`color-app-${tt==null?void 0:tt.displayName}`}):et==="resource"?jsxRuntimeExports.jsx(AppIcon,{app:tt,iconFit:"ratio",size:"24",variant:"rounded"}):null}const DraggableCard=({app:tt,type:et,name:rt})=>{const nt={flexDirection:"row",width:"252px",height:"32px",boxShadow:"0 0.2rem 0.6em rgba(0, 0, 0, 0.15)"};return jsxRuntimeExports.jsxs("div",{className:"d-inline-flex align-items-center card is-selected gap-8",style:nt,children:[jsxRuntimeExports.jsx("div",{className:"ms-8",children:jsxRuntimeExports.jsx(CardIcon,{app:tt,type:et})}),jsxRuntimeExports.jsx("div",{className:"text-truncate",children:rt})]})},FolderCard=({app:tt,name:et,idFolder:rt,isSelected:nt=!1,isSelectable:st=!0,onClick:ot,onSelect:at})=>{const[lt,ut]=reactExports.useState(!1),ct=reactExports.useId(),{lg:dt}=useBreakpoint(),{setNodeRef:ht}=useDroppable({id:ct,data:{id:rt,name:et,isTreeview:!1,accepts:["folder","resource"]}}),{attributes:mt,listeners:xt,setNodeRef:yt,transform:vt}=useDraggable({id:ct,data:{id:rt,type:"folder"},disabled:!dt}),Et=useResourceOrFolderIsDraggable(),bt=useElementDragOver(),St=Pt=>{yt(Pt),ht(Pt)},wt=bt.overId===rt,Rt=!bt.canMove&&bt.isTreeview?"no-drop":lt?"grabbing":"default",Ct={transform:`translate3d(${((vt==null?void 0:vt.x)??0)/1}px, ${((vt==null?void 0:vt.y)??0)/1}px, 0)`,cursor:Rt};return reactExports.useEffect(()=>{const Pt=Et.elementDrag===rt;ut(Pt)},[Et]),jsxRuntimeExports.jsx("div",{ref:St,style:{...Ct},children:lt?jsxRuntimeExports.jsx(DraggableCard,{name:et,app:tt,type:"folder"}):jsxRuntimeExports.jsx(Card,{app:tt,isSelectable:!lt&&st,isSelected:!lt&&nt||wt&&lt,isFocused:wt,onClick:ot,onSelect:at,children:Pt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!lt&&dt&&jsxRuntimeExports.jsx("div",{className:"card-header z-3",style:{position:"fixed",left:"37px"},children:jsxRuntimeExports.jsx(IconButton,{...xt,...mt,className:"bg-white z-3",color:"secondary",icon:jsxRuntimeExports.jsx(SvgIconMove,{}),variant:"ghost"})}),jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx(SvgIconFiles,{width:"48",height:"48",className:`color-app-${Pt}`}),jsxRuntimeExports.jsx(Card.Title,{children:et})]})]})})})};FolderCard.displayName="FolderCard";const FoldersList=({data:tt})=>{var xt,yt;const et=useQueryClient(),rt=useSelectedFolders(),nt=useFolderIds(),st=useResourceOrFolderIsDraggable(),ot=useScrollToTop(),{currentApp:at}=useEdificeClient(),{setSelectedFolders:lt,setFolderIds:ut,openFolder:ct}=useStoreActions();function dt(vt){nt.includes(vt.id)?(ut(nt.filter(Et=>Et!==vt.id)),lt(rt.filter(Et=>Et.id!==vt.id))):(ut([vt.id,...nt]),lt([vt,...rt]))}function ht(vt){ot(),ct({folder:vt,folderId:vt.id,queryClient:et})}const mt=useSpring({from:{opacity:0},to:{opacity:1}});return(xt=tt==null?void 0:tt.pages[0])!=null&&xt.folders.length?jsxRuntimeExports.jsx(animated.ul,{className:"grid ps-0 list-unstyled mb-24",children:(yt=tt==null?void 0:tt.pages[0])==null?void 0:yt.folders.map(vt=>{const{id:Et,name:bt}=vt,St=st.elementDrag===Et;return jsxRuntimeExports.jsx(animated.li,{className:`g-col-4 ${St?"z-2000":"z-1"}`,style:{position:"relative",...mt},children:jsxRuntimeExports.jsx(FolderCard,{name:bt,idFolder:Et,app:at,isSelected:nt.includes(vt.id),onClick:wt=>{wt.stopPropagation(),ht(vt)},onSelect:()=>dt(vt)})},Et)})}):null},FoldersList$1=Object.freeze(Object.defineProperty({__proto__:null,default:FoldersList},Symbol.toStringTag,{value:"Module"})),ResourceCard=({app:tt,resource:et,time:rt,isSelected:nt=!1,isSelectable:st=!0,onClick:ot,onSelect:at})=>{const[lt,ut]=reactExports.useState(!1),{lg:ct}=useBreakpoint(),dt=`/userbook/avatar/${et==null?void 0:et.creatorId}`;function ht(Pt){const{rights:It,creatorId:jt}=Pt||{};return It.filter(Vt=>!Vt.includes(jt)).length>=1}const mt=useIsTrash(),xt=ht(et),yt=et==null?void 0:et.public,vt=useResourceOrFolderIsDraggable(),{t:Et}=useTranslation(),{attributes:bt,listeners:St,setNodeRef:wt,transform:Rt}=useDraggable({id:et.id,data:{id:et.id,type:"resource"},disabled:!!mt||!ct}),Ct={position:lt?"absolute":"relative",zIndex:lt?2e3:1,transform:`translate3d(${((Rt==null?void 0:Rt.x)??0)/1}px, ${((Rt==null?void 0:Rt.y)??0)/1}px, 0)`};return reactExports.useEffect(()=>{const Pt=vt.elementDrag===et.id;ut(Pt)},[vt]),jsxRuntimeExports.jsx("div",{ref:wt,style:{...Ct},children:lt?jsxRuntimeExports.jsx(DraggableCard,{app:tt,type:"resource",name:et==null?void 0:et.name}):jsxRuntimeExports.jsx(Card,{app:tt,isSelected:!lt&&nt,isSelectable:!lt&&st,onClick:ot,onSelect:at,children:Pt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!lt&&ct&&jsxRuntimeExports.jsx("div",{className:"card-header z-3",style:{position:"fixed",left:"37px"},children:jsxRuntimeExports.jsx(IconButton,{...St,...bt,className:"bg-white z-3",color:"secondary",icon:jsxRuntimeExports.jsx(SvgIconMove,{}),variant:"ghost"})}),jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx("div",{className:"card-image medium",children:et!=null&&et.thumbnail?jsxRuntimeExports.jsx(Image$1,{alt:"",src:`${et==null?void 0:et.thumbnail}?thumbnail=80x80`,objectFit:"cover",className:"h-full w-100"}):jsxRuntimeExports.jsx(AppIcon,{app:tt,iconFit:"ratio",size:"80",variant:"rounded"})}),jsxRuntimeExports.jsxs("div",{className:"text-truncate",children:[jsxRuntimeExports.jsx(Card.Title,{children:et==null?void 0:et.name}),jsxRuntimeExports.jsx(Card.Text,{children:jsxRuntimeExports.jsx("em",{children:rt})})]})]}),jsxRuntimeExports.jsxs(Card.Footer,{children:[jsxRuntimeExports.jsxs("div",{className:"d-inline-flex align-items-center gap-8 text-truncate",children:[dt?jsxRuntimeExports.jsx(Avatar,{alt:(et==null?void 0:et.creatorName)||"",size:"xs",src:dt,variant:"circle",width:"24",height:"24"}):jsxRuntimeExports.jsx(SvgIconOneProfile,{}),jsxRuntimeExports.jsx(Card.Text,{children:et==null?void 0:et.creatorName})]}),jsxRuntimeExports.jsxs("div",{className:"d-inline-flex align-items-center gap-8",children:[xt&&jsxRuntimeExports.jsx(Tooltip,{message:Et("tooltip.shared",{ns:Pt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16,height:16})}),yt&&jsxRuntimeExports.jsx(Tooltip,{message:Et("tooltip.public",{ns:Pt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconGlobe,{width:16,height:16})})]})]})]})})})};ResourceCard.displayName="ResourceCard";const ResourcesList=({data:tt,fetchNextPage:et})=>{const{currentApp:rt}=useEdificeClient(),{t:nt}=useTranslation(),{fromNow:st}=useDate(),ot=useSearchParams(),at=useResourceIds(),lt=useSelectedResources(),{setSelectedResources:ut,setResourceIds:ct,openResource:dt,setResourceIsTrash:ht}=useStoreActions(),mt=useIsTrash(),xt=useSpring({from:{opacity:0},to:{opacity:1}}),vt=ot.pagination.startIdx+ot.pagination.pageSize<(ot.pagination.maxIdx||0),Et=reactExports.useCallback(()=>{et()},[]),bt=Rt=>{mt?(ht(!0),ct([Rt.id]),ut([Rt])):dt(Rt)};async function St(Rt){if(at.includes(Rt.id)){ct(at.filter(Ct=>Ct!==Rt.id)),ut(lt.filter(Ct=>Ct.id!==Rt.id));return}ct([...at,Rt.id]),ut([...lt,Rt])}const wt=clsx("grid ps-0 list-unstyled");return jsxRuntimeExports.jsxs(React$4.Fragment,{children:[jsxRuntimeExports.jsx(animated.ul,{className:wt,children:tt==null?void 0:tt.pages.map((Rt,Ct)=>jsxRuntimeExports.jsx(React$4.Fragment,{children:Rt.resources.map(Pt=>{const{id:It,updatedAt:jt}=Pt,Dt=st(jt);return jsxRuntimeExports.jsx(animated.li,{className:"g-col-4",style:{position:"relative",...xt},children:jsxRuntimeExports.jsx(ResourceCard,{app:rt,resource:Pt,time:Dt,isSelectable:!0,isSelected:at.includes(Pt.id),onClick:Vt=>{Vt.stopPropagation(),bt(Pt)},onSelect:()=>St(Pt)})},It)})},Ct))}),vt&&jsxRuntimeExports.jsx("div",{className:"d-grid gap-2 col-4 mx-auto my-24",children:jsxRuntimeExports.jsx(Button,{type:"button",color:"secondary",variant:"filled",onClick:Et,children:nt("explorer.see.more")})})]})},ResourcesList$1=Object.freeze(Object.defineProperty({__proto__:null,default:ResourcesList},Symbol.toStringTag,{value:"Module"}));function useFolderModal({edit:tt,onSuccess:et,onClose:rt}){var Rt;const nt=useSelectedFolders(),st=useCurrentFolder(),ot=useCreateFolder(),at=useUpdatefolder(),lt=tt?(Rt=nt[0])==null?void 0:Rt.name:void 0,{reset:ut,register:ct,handleSubmit:dt,setFocus:ht,formState:{errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt}}=useForm({mode:"onChange",values:{name:lt||""}}),Et=reactExports.useId(),bt=async function({name:Ct}){var Pt;try{if(tt){const It=(Pt=nt[0])==null?void 0:Pt.parentId,Dt=nt[0].id;await at.mutate({folderId:Dt,parentId:It,name:Ct}),ut(),et==null||et()}else{const It=(st==null?void 0:st.id)||FOLDER.DEFAULT;await ot.mutate({name:Ct,parentId:It}),ut(),et==null||et()}}catch(It){console.error(It)}};function St(){ut(),rt()}return{formId:`createModal_${Et}`,errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt,register:ct,setFocus:ht,handleSubmit:dt,onCancel:St,onSubmit:bt}}function FolderModal$1({isOpen:tt,edit:et,onSuccess:rt,onCancel:nt}){const{t:st}=useTranslation(),{isDirty:ot,isValid:at,isSubmitting:lt,formId:ut,onSubmit:ct,onCancel:dt,handleSubmit:ht,register:mt,setFocus:xt}=useFolderModal({edit:et,onSuccess:rt,onClose:nt});return reactExports.useEffect(()=>{tt&&xt("name")},[tt,xt]),tt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:dt,id:"modal_"+ut,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:dt,children:st(et?"explorer.rename.folder":"explorer.create.folder")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("form",{id:ut,onSubmit:ht(ct),children:jsxRuntimeExports.jsxs(FormControl,{id:"nameFolder",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:st("explorer.create.folder.name")}),jsxRuntimeExports.jsx(Input,{type:"text",...mt("name",{required:!0,maxLength:60,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:st("explorer.create.folder.name"),size:"md","aria-required":!0,maxLength:60})]})})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:dt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{form:ut,type:"submit",color:"primary",variant:"filled",disabled:!ot||!at||lt,children:st(et?"explorer.rename":"explorer.create")})]})]}),document.getElementById("portal")):null}const FolderModal$2=Object.freeze(Object.defineProperty({__proto__:null,default:FolderModal$1},Symbol.toStringTag,{value:"Module"})),CreateModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ResourceModal),void 0));function AppAction(){const[tt,et]=useToggle(),rt=useStoreContext(xt=>xt.config),{appCode:nt}=useEdificeClient(),{t:st}=useTranslation(nt),{clearSelectedItems:ot,clearSelectedIds:at}=useStoreActions(),{data:lt}=useActions(rt==null?void 0:rt.actions),ut=lt==null?void 0:lt.find(xt=>xt.id==="create"),ct=useCurrentFolder(),dt=useCreateResource(),ht=useSearchParams(),mt=()=>{if(nt=="scrapbook"){goToCreate({searchParams:ht,folderId:ct.id});return}ot(),at(),et()};return ut?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",leftIcon:jsxRuntimeExports.jsx(SvgIconPlus,{}),className:"ms-auto",onClick:mt,children:st("explorer.create.title")}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:tt&&jsxRuntimeExports.jsx(CreateModal,{mode:"create",currentFolder:ct,createResource:dt,isOpen:tt,onSuccess:et,onCancel:et,children:(xt,yt,vt,Et,bt)=>nt==="blog"&&isActionAvailable("createPublic",lt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:nt,isUpdating:yt,resource:xt,watch:vt,setValue:Et,register:bt})})})]}):null}const AppAction$1=Object.freeze(Object.defineProperty({__proto__:null,default:AppAction},Symbol.toStringTag,{value:"Module"})),useLibrary=()=>{const tt=useLibraryUrl(),{theme:et}=useEdificeTheme(),[rt,nt]=reactExports.useState("");return reactExports.useEffect(()=>{(async()=>{const at=await __variableDynamicImportRuntimeHelper(Object.assign({"../../../../node_modules/@edifice.io/bootstrap/dist/images/neo/image-library.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>imageLibrary$3),void 0),"../../../../node_modules/@edifice.io/bootstrap/dist/images/one/image-library.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>imageLibrary$1),void 0)}),`../../../../node_modules/@edifice.io/bootstrap/dist/images/${et==null?void 0:et.bootstrapVersion}/image-library.svg`,11);nt(at.default)})()},[et]),{libraryUrl:tt,imageFullURL:rt,handleClick:()=>{tt&&(window.open(tt,"_blank"),odeServices.data().trackAccessLibraryFromExplorer())}}},Library=()=>{const{libraryUrl:tt,imageFullURL:et,handleClick:rt}=useLibrary(),{t:nt}=useTranslation();return tt&&jsxRuntimeExports.jsxs("div",{className:"p-16",children:[jsxRuntimeExports.jsx(Image$1,{width:"270",height:"140",loading:"lazy",className:"rounded",src:et,alt:nt("explorer.libray.img.alt")}),jsxRuntimeExports.jsx("p",{className:"m-8",children:nt("explorer.libray.title")}),jsxRuntimeExports.jsxs("button",{type:"button",onClick:rt,rel:"noreferrer",className:"btn btn-ghost-primary d-inline-flex align-items-center gap-4 p-8",children:[jsxRuntimeExports.jsx("span",{children:nt("explorer.libray.btn")}),jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]})},Library$1=Object.freeze(Object.defineProperty({__proto__:null,default:Library},Symbol.toStringTag,{value:"Module"}));function useAccessControl({roles:tt,rights:et,action:rt}){const[nt,st]=reactExports.useState(!1),{user:ot}=useUser(),at=useIsTrash();reactExports.useEffect(()=>{ct()},[tt,et]);const lt=async function(dt){const ht=dt instanceof Array?dt:[dt];if(tt instanceof Array){const mt=await odeServices.rights().sessionHasAtLeastOneResourceRight(tt,ht);st(mt)}else{const mt=await odeServices.rights().sessionHasResourceRight(tt,ht);st(mt)}},ut=async function(dt){if(tt instanceof Array){const ht=await odeServices.rights().sessionHasAtLeastOneResourceRightForEachList(tt,dt);st(ht)}else{const ht=await odeServices.rights().sessionHasResourceRightForEachList(tt,dt);st(ht)}},ct=async function(){var dt,ht,mt;if(tt===void 0){st(!0);return}if(at&&((ht=(dt=et[0])==null?void 0:dt.trashedBy)!=null&&ht.includes(ot==null?void 0:ot.userId))&&rt==="restore"&&!((mt=et[0])!=null&&mt.trashed)){st(!0);return}if(et instanceof Array)if(et.length>0)if(typeof et[0]=="string")await lt(et);else{const xt=et.map(yt=>yt.rights);await ut(xt)}else st(!1);else typeof et=="string"?await lt(et):await lt(et.rights)};return{visible:nt,refreshState:ct}}function useActionBar(){const[tt,et]=reactExports.useState(!1),[rt,nt]=reactExports.useState("void"),[st,ot]=reactExports.useState(),at=useStoreContext(hr=>hr.config),lt=useCurrentFolder(),ut=useResourceIds(),ct=useSelectedResources(),dt=useSelectedFolders(),ht=useFolderIds(),mt=useIsTrash(),xt=useRestore(),yt=useResourceIsTrash(),vt=useSearchParams(),Et=useCopyResource(),bt=useResourceOrFolderIsDraggable(),{openResource:St,printSelectedResource:wt,openFolder:Rt,clearSelectedItems:Ct,clearSelectedIds:Pt}=useStoreActions(),{data:It}=useActions(at==null?void 0:at.actions);reactExports.useEffect(()=>{if(ut.length===0&&ht.length===0){et(!1);return}if(yt){et(!1);return}if(bt.isDrag){et(!1);return}et(!0)},[ut,ht]);async function jt(hr){var Ar;switch((Ar=document.getElementById("root"))==null||Ar.setAttribute("aria-hidden","true"),ot(hr),hr.id){case ACTION.OPEN:return ut.length>0?St(ct[0]):Rt({folder:dt[0],folderId:dt[0].id});case ACTION.COPY:return vr();case ACTION.MOVE:return nt("move");case ACTION.PRINT:return wt();case ACTION.DELETE:return nt("delete");case ACTION.RESTORE:return await Ft();case ACTION.PUBLISH:return nt("publish");case ACTION.UPD_PROPS:case"edit":return Er();case ACTION.SHARE:return nt("share");case ACTION.EXPORT:return nt("export");default:throw Error(`Unknown action: ${hr.id}`)}}function Dt(hr){const Ar=ut.length+ht.length,Cr=ut.length===1||ht.length===1,Ur=Ar===1,Sr=ht.length===0;switch(hr.id){case ACTION.OPEN:return Ur;case ACTION.MANAGE:return Cr;case ACTION.COPY:return Cr&&Sr;case ACTION.PUBLISH:return Cr&&Sr;case ACTION.UPD_PROPS:return Cr&&Sr;case ACTION.SHARE:return Sr&&Cr;case"export":return Cr&&Sr;case ACTION.PRINT:return Cr&&Sr;case"edit":return Ur;default:return!0}}const Vt=()=>!0;async function Ft(){try{if(mt)await xt.mutate();else throw new Error("Cannot restore untrashed resources");Ht()}catch(hr){console.error(hr)}}function Ht(){var hr;nt("void"),st!=null&&st.id&&((hr=document.getElementById(st==null?void 0:st.id))==null||hr.focus())}const Nt=hr=>()=>{rt===hr&&(Ht(),Ct(),Pt())},Lt=Nt("move"),Mt=Nt("move"),zt=Nt("delete"),Gt=Nt("delete"),$t=Nt("publish"),Ut=Nt("publish"),Bt=Nt("edit_folder"),Yt=Nt("edit_folder"),Zt=Nt("edit_resource"),Xt=Nt("edit_resource"),rr=Nt("share"),cr=Nt("share"),ur=Nt("export"),mr=Nt("export");async function vr(){if(ct&&ct.length>0){const hr=ct[0];await Et.mutate(hr),Ct(),Pt()}}function Er(){if(ut&&ut.length>0){const hr=ct[0].assetId;(at==null?void 0:at.app)==="scrapbook"?goToEdit({searchParams:vt,assetId:hr}):nt("edit_resource")}else nt("edit_folder")}function br(hr){return hr.id==="edit"&&ht.length>0?"explorer.rename":`explorer.actions.${hr.id}`}return{onRestore:Ft,actions:mt?at==null?void 0:at.trashActions:It,selectedElement:[...ct,...dt],currentFolderId:lt==null?void 0:lt.id,overrideLabel:br,handleClick:jt,isActivable:mt?Vt:Dt,isActionBarOpen:tt,isMoveModalOpen:rt==="move",onMoveCancel:Lt,onMoveSuccess:Mt,isDeleteModalOpen:rt==="delete",onDeleteCancel:Gt,onDeleteSuccess:zt,isPublishModalOpen:rt==="publish",onPublishCancel:Ut,onPublishSuccess:$t,isEditFolderOpen:rt==="edit_folder",onEditFolderCancel:Yt,onEditFolderSuccess:Bt,isEditResourceOpen:rt==="edit_resource",onEditResourceCancel:Xt,onEditResourceSuccess:Zt,isShareResourceOpen:rt==="share",onShareResourceCancel:cr,onShareResourceSuccess:rr,isExportModalOpen:rt==="export",onExportCancel:ur,onExportSuccess:mr,onClearActionBar:Ht}}function AccessControl({resourceRights:tt,roleExpected:et,action:rt,children:nt,renderWhenForbidden:st}){const{t:ot}=useTranslation(),{overrideLabel:at}=useActionBar(),{visible:lt}=useAccessControl({roles:et,rights:tt,action:rt==null?void 0:rt.id}),{setResourceActionDisable:ut}=useStoreActions(),ct=useIsTrash();return lt?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:nt}):st?st():ct&&!lt?jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",onClick:()=>{ut(!0)},children:ot(at(rt))}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}const PublishModal$1=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>PublishModal),void 0)),UpdateModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ResourceModal),void 0)),DeleteModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>DeleteModal$1),void 0)),MoveModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>MoveModal$1),void 0)),FolderModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FolderModal$2),void 0)),ExportModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ExportModal$1),void 0));function ActionBarContainer(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation(),{actions:rt,selectedElement:nt,isMoveModalOpen:st,isDeleteModalOpen:ot,isPublishModalOpen:at,isActionBarOpen:lt,isEditFolderOpen:ut,overrideLabel:ct,onEditFolderCancel:dt,onEditFolderSuccess:ht,isEditResourceOpen:mt,onEditResourceCancel:xt,onEditResourceSuccess:yt,isShareResourceOpen:vt,onShareResourceCancel:Et,onShareResourceSuccess:bt,isExportModalOpen:St,onExportCancel:wt,onExportSuccess:Rt,onMoveCancel:Ct,onMoveSuccess:Pt,onDeleteCancel:It,onDeleteSuccess:jt,onPublishCancel:Dt,onPublishSuccess:Vt,isActivable:Ft,handleClick:Ht}=useActionBar(),Lt=useSelectedResources()[0],Mt=useShareResource(tt),zt=useUpdateResource(tt),Gt=useTransition(lt,{from:{opacity:0,transform:"translateY(100%)"},enter:{opacity:1,transform:"translateY(0)"},leave:{opacity:0,transform:"translateY(100%)"}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Gt(($t,Ut)=>Ut&&jsxRuntimeExports.jsx(animated.div,{className:"position-fixed bottom-0 start-0 end-0",style:{...$t,zIndex:4},children:jsxRuntimeExports.jsx(ActionBar$1,{children:rt==null?void 0:rt.filter(Bt=>Bt.available&&Bt.target==="actionbar").map(Bt=>Ft(Bt)&&jsxRuntimeExports.jsx(AccessControl,{resourceRights:nt,roleExpected:Bt.right,action:Bt,children:jsxRuntimeExports.jsx(Button,{id:Bt.id,type:"button",color:"primary",variant:"filled",onClick:()=>{Ht(Bt)},children:et(ct(Bt))},Bt.id)},Bt.id))})})),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[st&&jsxRuntimeExports.jsx(MoveModal$2,{isOpen:st,onCancel:Ct,onSuccess:Pt}),ot&&jsxRuntimeExports.jsx(DeleteModal$2,{isOpen:ot,onCancel:It,onSuccess:jt}),at&&Lt&&jsxRuntimeExports.jsx(PublishModal$1,{isOpen:at,resourceId:Lt.assetId,onCancel:Dt,onSuccess:Vt}),ut&&jsxRuntimeExports.jsx(FolderModal,{edit:!0,isOpen:ut,onCancel:dt,onSuccess:ht}),mt&&Lt&&jsxRuntimeExports.jsx(UpdateModal,{mode:"update",isOpen:mt,resourceId:Lt.assetId,updateResource:zt,onCancel:xt,onSuccess:yt,children:($t,Ut,Bt,Yt,Zt)=>tt==="blog"&&isActionAvailable("createPublic",rt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:tt,isUpdating:Ut,resource:$t,watch:Bt,setValue:Yt,register:Zt})}),vt&&Lt&&jsxRuntimeExports.jsx(ShareResourceModal,{isOpen:vt,shareResource:Mt,shareOptions:{resourceCreatorId:Lt.creatorId,resourceId:Lt.assetId,resourceRights:Lt.rights},onCancel:Et,onSuccess:bt,children:tt==="blog"?jsxRuntimeExports.jsx(ShareBlog,{resourceId:Lt.assetId,updateResource:zt}):null}),St&&Lt&&jsxRuntimeExports.jsx(ExportModal$2,{isOpen:St,onCancel:wt,onSuccess:Rt})]})]})}const ActionBarContainer$1=Object.freeze(Object.defineProperty({__proto__:null,default:ActionBarContainer},Symbol.toStringTag,{value:"Module"}));function DisableModal({isOpen:tt,onCancel:et=()=>({})}){const{t:rt}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:et,id:"trash_action_disable_resource",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:()=>et(),children:rt("explorer.trash.action.modal.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:rt("explorer.trash.action.modal.text")})}),jsxRuntimeExports.jsx(Modal.Footer,{children:jsxRuntimeExports.jsx(Button,{color:"primary",onClick:et,type:"button",variant:"outline",children:rt("close")})})]}),document.getElementById("portal"))}const DisableModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:DisableModal},Symbol.toStringTag,{value:"Module"}));function TrashModal({isOpen:tt,onCancel:et=()=>({})}){const{t:rt}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:et,id:"trash_resource",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:()=>et(),children:rt("explorer.trash.modal.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:rt("explorer.trash.modal.text")})}),jsxRuntimeExports.jsx(Modal.Footer,{children:jsxRuntimeExports.jsx(Button,{color:"primary",onClick:et,type:"button",variant:"outline",children:rt("close")})})]}),document.getElementById("portal"))}const TrashModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:TrashModal},Symbol.toStringTag,{value:"Module"})),OnboardingModal=Object.freeze(Object.defineProperty({__proto__:null,default:OnboardingModal$2},Symbol.toStringTag,{value:"Module"})),illuBlog="/assets/js/ode-explorer/illu-blog.svg",illuBlog$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuBlog},Symbol.toStringTag,{value:"Module"})),illuCollaborativeeditor="/assets/js/ode-explorer/illu-pad.svg",illuCollaborativeeditor$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuCollaborativeeditor},Symbol.toStringTag,{value:"Module"})),illuCollaborativewall="/assets/js/ode-explorer/illu-collaborativewall.svg",illuCollaborativewall$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuCollaborativewall},Symbol.toStringTag,{value:"Module"})),illuExercizer="/assets/js/ode-explorer/illu-exercizer.svg",illuExercizer$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuExercizer},Symbol.toStringTag,{value:"Module"})),illuMindmap="/assets/js/ode-explorer/illu-mindmap.svg",illuMindmap$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuMindmap},Symbol.toStringTag,{value:"Module"})),illuPad="/assets/js/ode-explorer/illu-pad.svg",illuPad$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuPad},Symbol.toStringTag,{value:"Module"})),illuScrapbook="/assets/js/ode-explorer/illu-scrapbook.svg",illuScrapbook$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuScrapbook},Symbol.toStringTag,{value:"Module"})),illuTimeline="/assets/js/ode-explorer/illu-timeline.svg",illuTimeline$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTimeline},Symbol.toStringTag,{value:"Module"})),illuTimelinegenerator="/assets/js/ode-explorer/illu-timelinegenerator.svg",illuTimelinegenerator$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTimelinegenerator},Symbol.toStringTag,{value:"Module"})),illuWiki="/assets/js/ode-explorer/illu-wiki.svg",illuWiki$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuWiki},Symbol.toStringTag,{value:"Module"})),ResourceModal=Object.freeze(Object.defineProperty({__proto__:null,default:ResourceModal$1},Symbol.toStringTag,{value:"Module"})),imageLibrary$2="/assets/js/ode-explorer/image-library.svg",imageLibrary$3=Object.freeze(Object.defineProperty({__proto__:null,default:imageLibrary$2},Symbol.toStringTag,{value:"Module"})),imageLibrary="/assets/js/ode-explorer/image-library2.svg",imageLibrary$1=Object.freeze(Object.defineProperty({__proto__:null,default:imageLibrary},Symbol.toStringTag,{value:"Module"})),PublishModal=Object.freeze(Object.defineProperty({__proto__:null,default:PublishModal$2},Symbol.toStringTag,{value:"Module"}));function useDeleteModal({onSuccess:tt}){const et=useDelete(),rt=useTrash(),nt=useIsTrash();async function st(){try{nt?await et.mutate():await rt.mutate(),tt==null||tt()}catch(ot){console.error(ot)}}return{isTrashFolder:nt,onDelete:st}}function DeleteModal({isOpen:tt,onSuccess:et=()=>({}),onCancel:rt=()=>({})}){const{t:nt}=useTranslation(),{isTrashFolder:st,onDelete:ot}=useDeleteModal({onSuccess:et});return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"deleteModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:nt(st?"explorer.delete.title":"explorer.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:nt(st?"explorer.delete.subtitle":"explorer.trash.subtitle")})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"danger",onClick:ot,type:"button",variant:"filled",children:nt(st?"explorer.delete":"explorer.trash")})]})]}),document.getElementById("portal"))}const DeleteModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:DeleteModal},Symbol.toStringTag,{value:"Module"}));function useMoveModal({onSuccess:tt}){const[et,rt]=reactExports.useState(),nt=useQueryClient(),st=useMoveItem(),ot=useSelectedFolders(),at=useSelectedResources(),lt=useTreeData(),{fetchTreeData:ut}=useStoreActions();async function ct(){try{if(!et)throw new Error("explorer.move.selection.empty");await st.mutate(et),await(tt==null?void 0:tt())}catch(ht){console.error(ht)}}const dt=ht=>{var xt,yt;const mt=getAncestors(lt,ht);for(const vt of ot)if(ht===vt.id||ht===vt.parentId||(xt=vt.childrenIds)!=null&&xt.includes(ht)||mt.includes(vt.id))return!1;for(const vt of at)if(ht===((vt==null?void 0:vt.folderIds)&&vt.folderIds[0])||((yt=vt==null?void 0:vt.folderIds)==null?void 0:yt.length)===0&&ht==="default")return!1;return!0};return{treeData:lt,disableSubmit:!et,handleTreeItemSelect:ht=>{dt(ht)?rt(ht):rt(void 0)},handleOnTreeItemUnfold:ht=>{var yt,vt;const mt=findNodeById(lt,ht),xt=(yt=mt==null?void 0:mt.children)==null?void 0:yt.some(Et=>{var bt;return Array.isArray(Et==null?void 0:Et.children)&&((bt=Et.children)==null?void 0:bt.length)>0});(vt=mt==null?void 0:mt.children)==null||vt.forEach(Et=>{xt||ut(Et.id,nt)})},onMove:()=>ct()}}function MoveModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{appCode:nt}=useEdificeClient(),{t:st}=useTranslation(),{treeData:ot,handleTreeItemSelect:at,handleOnTreeItemUnfold:lt,onMove:ut,disableSubmit:ct}=useMoveModal({onSuccess:et}),dt={...ot,name:st("explorer.filters.mine",{ns:nt})};return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"moveModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:st("explorer.move.title")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:st("explorer.move.subtitle")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx(TreeView,{data:dt,onTreeItemClick:at,onTreeItemUnfold:lt})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:ut,type:"button",variant:"filled",disabled:ct,children:st("explorer.move")})]})]}),document.getElementById("portal"))}const MoveModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:MoveModal},Symbol.toStringTag,{value:"Module"})),useExportModal=tt=>{const et=useSelectedResources(),rt=useSearchParams(),nt=useToast(),{t:st}=useTranslation();return{handleExportClick:()=>{et.length?(goToExport({searchParams:rt,assetId:et[0].assetId}),tt()):nt.error(st("explorer.error.noResourceSelected"))}}};function ExportModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{handleExportClick:nt}=useExportModal(et),{t:st}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"exportModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:st("explorer.export.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsxs("ul",{children:[jsxRuntimeExports.jsx("li",{children:st("explorer.export.body.info.1")}),jsxRuntimeExports.jsx("li",{children:st("explorer.export.body.info.2")}),jsxRuntimeExports.jsx("li",{children:st("explorer.export.body.info.3")})]}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:st("explorer.export.body.warning")})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:nt,type:"button",variant:"filled",children:st("explorer.actions.export")})]})]}),document.getElementById("portal"))}const ExportModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:ExportModal},Symbol.toStringTag,{value:"Module"}))});export default s3();
1411
+ */var React=reactExports,shim=shimExports;function is(tt,et){return tt===et&&(tt!==0||1/tt===1/et)||tt!==tt&&et!==et}var objectIs=typeof Object.is=="function"?Object.is:is,useSyncExternalStore=shim.useSyncExternalStore,useRef=React.useRef,useEffect=React.useEffect,useMemo=React.useMemo,useDebugValue$1=React.useDebugValue;withSelector_production.useSyncExternalStoreWithSelector=function(tt,et,rt,nt,st){var ot=useRef(null);if(ot.current===null){var at={hasValue:!1,value:null};ot.current=at}else at=ot.current;ot=useMemo(function(){function ut(xt){if(!ct){if(ct=!0,dt=xt,xt=nt(xt),st!==void 0&&at.hasValue){var yt=at.value;if(st(yt,xt))return ht=yt}return ht=xt}if(yt=ht,objectIs(dt,xt))return yt;var vt=nt(xt);return st!==void 0&&st(yt,vt)?(dt=xt,yt):(dt=xt,ht=vt)}var ct=!1,dt,ht,mt=rt===void 0?null:rt;return[function(){return ut(et())},mt===null?void 0:function(){return ut(mt())}]},[et,rt,nt,st]);var lt=useSyncExternalStore(tt,ot[0],ot[1]);return useEffect(function(){at.hasValue=!0,at.value=lt},[lt]),useDebugValue$1(lt),lt};withSelector.exports=withSelector_production;var withSelectorExports=withSelector.exports;const useSyncExternalStoreExports=getDefaultExportFromCjs(withSelectorExports),{useDebugValue}=React$4,{useSyncExternalStoreWithSelector}=useSyncExternalStoreExports,identity=tt=>tt;function useStore(tt,et=identity,rt){const nt=useSyncExternalStoreWithSelector(tt.subscribe,tt.getState,tt.getServerState||tt.getInitialState,et,rt);return useDebugValue(nt),nt}const searchContext=async tt=>{const et=await odeServices.resource(tt.application).searchContext(tt);return{...et,folders:et.folders.filter(rt=>!rt.trashed)}},createFolder=async({searchParams:tt,name:et,parentId:rt})=>{const nt={name:et,parentId:rt,application:tt.application,type:tt.types[0]};return await odeServices.resource(tt.application).createFolder(nt)},updateFolder=async({folderId:tt,searchParams:et,parentId:rt,name:nt})=>{const st={folderId:tt,name:nt,parentId:rt,application:et.application,type:et.types[0]};return await odeServices.resource(et.application).updateFolder(st)},trashAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:nt})=>{const st={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:nt};return await odeServices.resource(tt.application).trashAll(st,rt)},deleteAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:nt})=>{const st={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:nt};return await odeServices.resource(tt.application).deleteAll(st,rt)},restoreAll=async({searchParams:tt,resourceIds:et,folderIds:rt,useAssetIds:nt})=>{const st={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:rt};return await odeServices.resource(tt.application).restoreAll(st,nt)},copyResource=async(tt,et)=>await odeServices.resource(tt.application).copy({application:tt.application,resourceId:et}),moveToFolder=async({searchParams:tt,resourceIds:et,folderId:rt,folderIds:nt,useAssetIds:st})=>{const ot={application:tt.application,folderId:rt,resourceIds:et,folderIds:nt};return await odeServices.resource(tt.application).moveToFolder(ot,st)},sessionHasWorkflowRights=async tt=>await odeServices.rights().sessionHasWorkflowRights(tt),goToResource=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getViewUrl(et);window.open(rt,"_self")},createResource=({searchParams:tt,params:et})=>odeServices.resource(tt.application).create(et),printResource=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getPrintUrl(et);return window.open(rt,"_blank")},goToCreate=({searchParams:tt,folderId:et})=>{const rt=odeServices.resource(tt.application).getFormUrl(et);return window.open(rt,"_self")},goToEdit=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getEditUrl(et);return window.open(rt,"_self")},goToExport=({searchParams:tt,assetId:et})=>{const rt=odeServices.resource(tt.application).getExportUrl(et);return window.open(rt,"_self")},defaultFolder={id:FOLDER.DEFAULT,name:t$2("explorer.filters.mine"),section:!0,children:[]},initialState={config:void 0,searchConfig:{minLength:1},searchParams:{filters:{folder:FOLDER.DEFAULT,owner:void 0,shared:void 0,public:void 0},orders:{updatedAt:SORT_ORDER.DESC},application:"",types:[],pagination:{startIdx:0,pageSize:48,maxIdx:0},trashed:!1},treeData:defaultFolder,selectedNodeId:"default",currentFolder:{id:"default"},selectedFolders:[],selectedResources:[],folderIds:[],resourceIds:[],resourceIsTrash:!1,resourceOrFolderIsDraggable:{isDrag:!1,elementDrag:void 0},elementDragOver:{isOver:!1,isTreeview:!1,canMove:!0,overId:void 0},resourceActionDisable:!1,status:void 0},store=createStore()((tt,et)=>({...initialState,actions:{setConfig:rt=>tt({config:rt}),setSearchConfig:rt=>tt(nt=>({searchConfig:{...nt.searchConfig,...rt}})),setTreeData:rt=>tt(()=>({treeData:rt})),setSearchParams:rt=>{tt(nt=>{const{searchParams:st}=nt;return st.search!==rt.search?rt.search?{...nt,selectedFolders:[],selectedNodeId:void 0,selectedResources:[],currentFolder:void 0,searchParams:{...st,...rt,trashed:!1,filters:{...st.filters,folder:void 0}}}:{...nt,selectedFolders:[],selectedNodeId:"default",selectedResources:[],currentFolder:{id:"default"},searchParams:{...st,...rt,trashed:!1,filters:{...st.filters}}}:{searchParams:{...st,...rt}}})},setSelectedFolders:rt=>tt(()=>({selectedFolders:rt})),setSelectedResources:rt=>tt(()=>({selectedResources:rt})),setFolderIds:rt=>tt(()=>({folderIds:rt})),setResourceIds:rt=>tt(()=>({resourceIds:rt})),setResourceIsTrash:rt=>tt(()=>({resourceIsTrash:rt})),setResourceOrFolderIsDraggable:rt=>tt(()=>({resourceOrFolderIsDraggable:rt})),setElementDragOver:rt=>tt(()=>({elementDragOver:rt})),setResourceActionDisable:rt=>tt(()=>({resourceActionDisable:rt})),clearSelectedItems:()=>tt(()=>({selectedFolders:[],selectedResources:[]})),clearSelectedIds:()=>tt(()=>({resourceIds:[],folderIds:[]})),openResource:rt=>{try{const{searchParams:nt}=et();goToResource({searchParams:nt,assetId:rt.assetId})}catch(nt){console.error("explorer open failed: ",nt)}},printSelectedResource:()=>{try{const{searchParams:rt,selectedResources:nt,resourceIds:st}=et();if(nt.length!==1)throw new Error("Cannot open more than 1 resource");const ot=nt.find(at=>at.id===st[0]);printResource({searchParams:rt,assetId:ot.assetId})}catch(rt){console.error("explorer print failed: ",rt)}},openFolder:({folderId:rt,folder:nt,queryClient:st})=>{const{searchParams:ot}=et(),at=ot.filters.folder,lt=rt;at!==rt&&(et().actions.fetchTreeData(rt,st),tt(ut=>({...ut,folderIds:[],resourceIds:[],selectedNodeId:lt,currentFolder:nt||{id:rt},searchParams:{...ot,search:void 0,filters:{...ot.filters,folder:rt},trashed:rt===FOLDER.BIN}})))},foldTreeItem:()=>tt(rt=>({...rt,status:"fold"})),fetchTreeData:async(rt,nt)=>{const st=findNodeById(et().treeData,rt),ot=st==null?void 0:st.id;if(Array.isArray(st==null?void 0:st.children)&&st.children.length)return;const at=await nt.fetchQuery({queryKey:["prefetchContext",{folderId:ot,trashed:!1}],queryFn:async()=>await searchContext({...et().searchParams,filters:{...et().searchParams.filters,folder:ot}})});et().actions.setTreeData(wrapTreeNode(et().treeData,at==null?void 0:at.folders,ot||FOLDER.DEFAULT))},selectTreeItem:(rt,nt)=>{const{treeData:st}=et(),{openFolder:ot,fetchTreeData:at}=et().actions,lt=findNodeById(st,rt);at(rt,nt),tt(ut=>({...ut,searchParams:{...ut.searchParams,search:void 0},status:"select",selectedResources:[]})),ot({folder:lt,folderId:rt})},gotoPreviousFolder:()=>{const{selectedNodeId:rt,treeData:nt,searchParams:st}=et(),{openFolder:ot}=et().actions;if(st.search&&ot({folder:defaultFolder,folderId:FOLDER.DEFAULT}),!rt)return;const at=findParentNode(nt,rt);ot({folder:at,folderId:(at==null?void 0:at.id)||FOLDER.DEFAULT})},goToTrash:()=>{tt(rt=>({...rt,selectedNodeId:void 0,selectedResources:[],resourceIds:[],folderIds:[],status:"select",searchParams:{...rt.searchParams,search:void 0,filters:{folder:FOLDER.BIN},trashed:!0},currentFolder:{id:FOLDER.BIN}}))}}}));function useStoreContext(tt){return useStore(store,tt)}const treeData=tt=>tt.treeData,actionsSelector=tt=>tt.actions,useTreeData=()=>useStoreContext(treeData),useStoreActions=()=>useStoreContext(actionsSelector),useSearchParams=()=>useStoreContext(tt=>tt.searchParams),useSelectedNodeId=()=>useStoreContext(tt=>tt.selectedNodeId),useSelectedFolders=()=>useStoreContext(tt=>tt.selectedFolders),useSelectedResources=()=>useStoreContext(tt=>tt.selectedResources),useSearchConfig=()=>useStoreContext(tt=>tt.searchConfig),useFolderIds=()=>useStoreContext(tt=>tt.folderIds),useResourceIds=()=>useStoreContext(tt=>tt.resourceIds),useResourceAssetIds=()=>useStoreContext(tt=>tt.selectedResources.map(et=>et.assetId)),useResourceWithoutIds=()=>useStoreContext(tt=>tt.selectedResources.filter(et=>et.assetId===et.id)),useCurrentFolder=()=>useStoreContext(tt=>tt.currentFolder),useIsTrash=()=>{const tt=useCurrentFolder();return(tt==null?void 0:tt.id)===FOLDER.BIN},useResourceIsTrash=()=>useStoreContext(tt=>tt.resourceIsTrash),useResourceOrFolderIsDraggable=()=>useStoreContext(tt=>tt.resourceOrFolderIsDraggable),useElementDragOver=()=>useStoreContext(tt=>tt.elementDragOver),useResourceActionDisable=()=>useStoreContext(tt=>tt.resourceActionDisable),useIsRoot=()=>{const tt=useCurrentFolder();return(tt==null?void 0:tt.id)==="default"},useTreeStatus=()=>useStoreContext(tt=>tt.status),useDisableModal=()=>{const tt=useResourceActionDisable(),{clearSelectedIds:et,setResourceActionDisable:rt,clearSelectedItems:nt}=useStoreActions();return{isActionDisableModalOpen:tt,onActionDisableCancel:()=>{et(),nt(),rt(!1)}}},useTrashModal=()=>{const tt=useResourceIsTrash(),{clearSelectedIds:et,setResourceIsTrash:rt,clearSelectedItems:nt}=useStoreActions();return{isTrashedModalOpen:tt,onTrashedCancel:()=>{et(),nt(),rt(!1)}}},DELAY=175,TOLERANCE=10,APP="blog",RESOURCE="blog";class BlogResourceService extends ResourceService{getEditUrl(){throw new Error("Method not implemented.")}async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",nt=et.public?"/blog/pub":"/blog",st=await this.http.post(nt,{title:et.name,description:et.description,visibility:et.public?"PUBLIC":"OWNER",thumbnail:rt,trashed:!1,folder:et.folder,slug:et.public?et.slug:"","publish-type":et.publishType||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(st),st}async update(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",nt=await this.http.put(`/blog/${et.entId}`,{trashed:et.trashed,_id:et.entId,title:et.name,thumbnail:rt,description:et.description,visibility:et.public?"PUBLIC":"OWNER",slug:et.public?et.slug:"","publish-type":et["publish-type"]||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(nt),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE}getApplication(){return APP}getFormUrl(et){return et?`/blog?folderid=${et}#/edit/new`:"/blog#/edit/new"}getViewUrl(et){return`/blog/id/${et}`}getPrintUrl(et){return`/blog/print/${et}`}}ResourceService.register({application:APP,resourceType:RESOURCE},tt=>new BlogResourceService(tt));const rootElement=document.querySelector("[data-explorer-config]");let config;function getExplorerConfig(){var tt;if((tt=rootElement==null?void 0:rootElement.dataset)!=null&&tt.explorerConfig){const{explorerConfig:et}=rootElement.dataset;try{const rt=JSON.parse(et);config={...rt,service:BlogResourceService,enableOnboarding:rt.enableOnboarding!==void 0?rt.enableOnboarding:!0}}catch(rt){console.error("[Explorer Config] could not parse app params from root data attributes:",rootElement==null?void 0:rootElement.dataset,rt)}}return config}const actionsQueryOptions=(tt,et)=>{const rt=tt.map(st=>st.workflow),nt=new Set(rt);return{queryKey:[...nt],queryFn:()=>sessionHasWorkflowRights([...nt]),select:st=>tt.filter(ot=>st[ot.workflow]).map(ot=>({...ot,available:!0})),staleTime:1/0,enabled:!!et}},useActions=tt=>{const et=useStoreContext(rt=>rt.config);return useQuery(actionsQueryOptions(tt,et))},useSearchContext=()=>{const tt=useStoreContext(at=>at.config),et=useSearchParams(),{filters:rt,trashed:nt,search:st}=et,ot=["context",{folderId:rt.folder,filters:rt,trashed:nt,search:st}];return useInfiniteQuery({queryKey:ot,queryFn:async({pageParam:at})=>await searchContext({...et,application:tt==null?void 0:tt.app,types:tt==null?void 0:tt.types,pagination:{...et.pagination,startIdx:at}}),staleTime:5e3,initialPageParam:0,enabled:!!tt,retry:!1,getNextPageParam:at=>at.pagination.startIdx+at.pagination.pageSize})},useTrash=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),st=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedItems:ct,clearSelectedIds:dt,setTreeData:ht,setSearchParams:mt}=useStoreActions(),{filters:xt,trashed:yt}=rt,vt=["context",{folderId:xt.folder,filters:xt,trashed:yt}];return useMutation({mutationFn:async()=>await trashAll({searchParams:rt,folderIds:st,resourceIds:ut,useAssetIds:lt}),onError(Et){typeof Et=="string"&&tt.error(t$2(Et))},onSuccess:async Et=>{if(await et.cancelQueries({queryKey:vt}),et.getQueryData(vt))return tt.success(t$2("explorer.trash.title")),et.setQueryData(vt,St=>{var wt;if(St){const Rt={...St,pages:St==null?void 0:St.pages.map(Pt=>{var It;return{...Pt,folders:Pt.folders.filter(jt=>!st.includes(jt.id)),pagination:{...Pt.pagination,maxIdx:((It=Pt==null?void 0:Pt.pagination)==null?void 0:It.maxIdx)-Et.resources.length},resources:Pt.resources.filter(jt=>lt?!ot.includes(jt.assetId):!ut.includes(jt.id))}})},Ct=deleteNode(nt,{folders:st});return ht(Ct),mt({...rt,pagination:{...rt.pagination,maxIdx:((wt=rt.pagination)==null?void 0:wt.maxIdx)-Et.resources.length}}),Rt}})},onSettled:()=>{ct(),dt()}})},useRestore=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useFolderIds(),st=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?st:ot,{setFolderIds:ut,setResourceIds:ct,setSelectedResources:dt,setSelectedFolders:ht}=useStoreActions(),{filters:mt,trashed:xt}=rt,yt=["context",{folderId:mt.folder,filters:mt,trashed:xt}];return useMutation({mutationFn:async()=>await restoreAll({searchParams:rt,folderIds:nt,resourceIds:lt,useAssetIds:at}),onError(vt){typeof vt=="string"&&tt.error(t$2(vt))},onSuccess:async()=>{if(await et.cancelQueries({queryKey:yt}),et.getQueryData(yt))return tt.success(t$2("explorer.trash.toast")),et.setQueryData(yt,Et=>{if(Et)return{...Et,pages:Et==null?void 0:Et.pages.map(bt=>({...bt,folders:bt.folders.filter(St=>!nt.includes(St.id)),resources:bt.resources.filter(St=>at?!st.includes(St.assetId):!lt.includes(St.id))}))}})},onSettled:()=>{ct([]),dt([]),ut([]),ht([])}})},useDelete=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useFolderIds(),st=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?st:ot,{clearSelectedItems:ut,clearSelectedIds:ct}=useStoreActions(),{filters:dt,trashed:ht}=rt,mt=["context",{folderId:dt.folder,filters:dt,trashed:ht}];return useMutation({mutationFn:async()=>await deleteAll({searchParams:rt,folderIds:nt,resourceIds:lt,useAssetIds:at}),onError(xt){typeof xt=="string"&&tt.error(t$2(xt))},onSuccess:async()=>{if(await et.cancelQueries({queryKey:mt}),et.getQueryData(mt))return tt.success(t$2("explorer.removed.from.trash")),et.setQueryData(mt,yt=>{if(yt)return{...yt,pages:yt==null?void 0:yt.pages.map(Et=>({...Et,folders:Et.folders.filter(bt=>!nt.includes(bt.id)),resources:Et.resources.filter(bt=>at?!st.includes(bt.assetId):!lt.includes(bt.id))}))}})},onSettled:()=>{ut(),ct()}})},useCopyResource=()=>{const tt=useToast(),et=useSearchParams(),rt=useQueryClient(),{user:nt}=useUser(),st=useCurrentFolder(),{filters:ot,trashed:at}=et,lt="duplicate_start",ut=["context",{folderId:ot.folder,filters:ot,trashed:at}];return useMutation({mutationFn:async ct=>(tt.info(t$2("duplicate.start"),{id:lt}),await copyResource(et,ct.assetId)),onSuccess:async(ct,dt)=>{tt.remove(lt),tt.success(t$2("duplicate.done")),await rt.cancelQueries({queryKey:ut});const ht=rt.getQueryData(ut),mt={...dt,name:`${dt.name}${t$2("duplicate.suffix")}`,assetId:ct.duplicateId,id:ct.duplicateId,creatorId:nt==null?void 0:nt.userId,creatorName:nt==null?void 0:nt.username,createdAt:Date.now(),slug:dt.slug||"",modifiedAt:Date.now(),modifierId:(nt==null?void 0:nt.userId)||"",modifierName:(nt==null?void 0:nt.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${nt==null?void 0:nt.userId}`]};ht&&rt.setQueryData(ut,xt=>{if(xt)return{...xt,pages:xt==null?void 0:xt.pages.map(yt=>({...yt,resources:[mt,...yt.resources]}))}}),st.id&&st.id!==FOLDER.DEFAULT&&moveToFolder({searchParams:et,resourceIds:[ct.duplicateId],folderId:st.id,folderIds:[],useAssetIds:!0})},onError:ct=>{tt.remove(lt),typeof ct=="string"&&tt.error(`${t$2("duplicate.error")}: ${ct}`)}})},useMoveItem=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),st=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedIds:ct,clearSelectedItems:dt,setTreeData:ht,setSearchParams:mt}=useStoreActions(),{filters:xt,trashed:yt}=rt,vt=["context",{folderId:xt.folder,filters:xt,trashed:yt}];return useMutation({mutationFn:async Et=>await moveToFolder({searchParams:rt,folderId:Et,folderIds:st,resourceIds:ut,useAssetIds:lt}),onError(Et){typeof Et=="string"&&tt.error(t$2(Et))},onSuccess:async(Et,bt)=>{if(et.getQueryData(vt))return et.setQueryData(vt,wt=>{var Rt;if(wt){const Ct=moveNode(nt,{destinationId:bt,folders:st}),Pt={...wt,pages:wt==null?void 0:wt.pages.map(It=>{var jt;return{...It,folders:It.folders.filter(Dt=>!st.includes(Dt.id)),pagination:{...It.pagination,maxIdx:((jt=It.pagination)==null?void 0:jt.maxIdx)-Et.resources.length},resources:It.resources.filter(Dt=>lt?!ot.includes(Dt.assetId):!ut.includes(Dt.id))}})};return ht(Ct),mt({...rt,pagination:{...rt.pagination,maxIdx:((Rt=rt.pagination)==null?void 0:Rt.maxIdx)-Et.resources.length}}),Pt}});et.invalidateQueries()},onSettled:()=>{dt(),ct()}})},useCreateFolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),{setTreeData:st}=useStoreActions(),{filters:ot,trashed:at}=rt,lt=["context",{folderId:ot.folder,filters:ot,trashed:at}];return useMutation({mutationFn:async({name:ut,parentId:ct})=>await createFolder({searchParams:rt,name:ut,parentId:ct}),onError(ut){typeof ut=="string"&&tt.error(t$2(ut))},onSuccess:async(ut,ct)=>{await et.cancelQueries({queryKey:lt});const dt=et.getQueryData(lt),ht={...ut,parentId:ct.parentId,children:[],rights:[`creator:${ut==null?void 0:ut.creator_id}`]};if(dt)return et.setQueryData(lt,mt=>{if(mt){const xt={...mt,pages:mt==null?void 0:mt.pages.map(vt=>({...vt,folders:[...vt.folders,ht]}))},yt=addNode(nt,{parentId:ct.parentId,newFolder:ht});return st(yt),xt}})}})},useUpdatefolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),nt=useTreeData(),{setFolderIds:st,setSelectedFolders:ot,setTreeData:at}=useStoreActions(),{filters:lt,trashed:ut}=rt,ct=["context",{folderId:lt.folder,filters:lt,trashed:ut}];return useMutation({mutationFn:async({folderId:dt,name:ht,parentId:mt})=>await updateFolder({searchParams:rt,folderId:dt,parentId:mt,name:ht}),onError(dt){typeof dt=="string"&&tt.error(t$2(dt))},onSuccess:async(dt,ht)=>{if(await et.cancelQueries({queryKey:ct}),et.getQueryData(ct))return et.setQueryData(ct,xt=>{if(xt){const yt={...xt,pages:xt==null?void 0:xt.pages.map(Et=>({...Et,folders:Et.folders.map(bt=>bt.id===dt.id?{...dt,parentId:ht.parentId,rights:bt.rights}:bt)}))},vt=updateNode(nt,{folderId:ht.folderId,newFolder:dt});return at(vt),yt}})},onSettled:()=>{st([]),ot([])}})},useShareResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{setResourceIds:nt,setSelectedResources:st}=useStoreActions(),{filters:ot,trashed:at}=rt,lt=["context",{folderId:ot.folder,filters:ot,trashed:at}];return useShareMutation({application:tt,options:{onSuccess:async(ut,ct)=>{if(await et.cancelQueries({queryKey:lt}),et.getQueryData(lt))return et.setQueryData(lt,ht=>{if(ht)return{...ht,pages:ht==null?void 0:ht.pages.map(mt=>({...mt,resources:mt.resources.map(xt=>{if(xt.assetId===(ct==null?void 0:ct.resourceId)){let yt=[`creator:${xt.creatorId}`];return(ct==null?void 0:ct.rights.length)>=1&&(yt=[...yt,...ct.rights.flatMap(vt=>vt.actions.map(Et=>`${vt.type}:${vt.id}:${Et.id}`))]),{...xt,rights:yt}}else return xt})}))}})},onSettled:()=>{nt([]),st([])}}})},useUpdateResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{filters:nt,trashed:st}=rt,ot=["context",{folderId:nt.folder,filters:nt,trashed:st}];return useUpdateMutation({application:tt,options:{onSuccess:async(at,lt)=>{if(await et.cancelQueries({queryKey:ot}),et.getQueryData(ot))return et.setQueryData(ot,ct=>{if(ct)return{...ct,pages:ct==null?void 0:ct.pages.map(dt=>({...dt,resources:dt.resources.map(ht=>{if(ht.assetId===(lt==null?void 0:lt.entId)){const{name:mt,thumbnail:xt,public:yt,description:vt,slug:Et,...bt}=lt;return{...ht,...bt,name:mt,thumbnail:typeof xt=="string"?xt:URL.createObjectURL(xt),public:yt,description:vt,slug:Et}}else return ht})}))}})}}})},useCreateResource=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),{user:nt}=useUser(),{appCode:st}=useEdificeClient(),ot=["context",{folderId:rt.filters.folder,filters:rt.filters,trashed:rt.trashed}];return useMutation({mutationFn:async at=>await createResource({searchParams:rt,params:at}),onError(at){typeof at=="string"&&tt.error(t$2(at))},onSuccess:async(at,lt)=>{var dt,ht,mt;await et.cancelQueries({queryKey:ot});const ut=et.getQueryData(ot),ct={...lt,thumbnail:at.thumbnail||"",application:st,assetId:at._id||at.entId||"",id:at._id||at.entId||"",creatorId:nt==null?void 0:nt.userId,creatorName:nt==null?void 0:nt.username,createdAt:Date.now(),slug:lt.slug||"",modifiedAt:((dt=at.modified)==null?void 0:dt.$date)||"",modifierId:((ht=at.author)==null?void 0:ht.userId)||"",modifierName:((mt=at.author)==null?void 0:mt.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${nt==null?void 0:nt.userId}`]};if(ut)return et.setQueryData(ot,xt=>{if(xt)return{...xt,pages:xt==null?void 0:xt.pages.map(yt=>({...yt,resources:[ct,...yt.resources]}))}})}})};function getChildrenIds(tt,et){var nt;const rt=findNodeById(tt,et);return(nt=rt==null?void 0:rt.folder)!=null&&nt.childrenIds?[...(rt==null?void 0:rt.folder.childrenIds)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function useDndKit(){const tt=useQueryClient(),et=useMoveItem(),rt=useToast(),{appCode:nt}=useEdificeClient(),{t:st}=useTranslation(["common",nt]),ot=st("explorer.filters.mine",{ns:nt}),{setResourceOrFolderIsDraggable:at,setElementDragOver:lt,setResourceIds:ut,setFolderIds:ct,fetchTreeData:dt}=useStoreActions(),ht=useTreeData(),xt=useSensor(PointerSensor,{activationConstraint:{delay:DELAY,tolerance:TOLERANCE}}),yt=useSensor(KeyboardSensor),vt=useSensors(xt,yt),Et=(Rt,Ct)=>{var Pt;((Pt=Rt.data.current)==null?void 0:Pt.type)==="resource"?rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[st("explorer.dragged.resource")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]})):rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[st("explorer.dragged.folder")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]}))};return{handleDragEnd:async Rt=>{const{over:Ct,active:Pt}=Rt,It=Ct==null?void 0:Ct.data.current,jt=Pt.data.current,Dt=getAncestors(ht,It==null?void 0:It.id),Vt=getChildrenIds(ht,It==null?void 0:It.id);if((jt==null?void 0:jt.id)==(It==null?void 0:It.id)||Dt.includes(jt==null?void 0:jt.id)||Vt.includes(jt==null?void 0:jt.id))ut([]),ct([]);else{const Ft=(It==null?void 0:It.name)??ot;if(Ct)try{await et.mutate(It==null?void 0:It.id),Et(Pt,Ft)}catch(Ht){console.error(Ht)}finally{lt({isOver:!1,overId:void 0,canMove:!0,isTreeview:!1})}}at({isDrag:!1,elementDrag:void 0})},handleDragStart:Rt=>{const{active:Ct}=Rt,Pt=Ct.data.current;(Pt==null?void 0:Pt.type)==="resource"?ut([Pt==null?void 0:Pt.id]):(Pt==null?void 0:Pt.type)==="folder"&&ct([Pt==null?void 0:Pt.id]),at({isDrag:!0,elementDrag:Pt==null?void 0:Pt.id})},handleDragOver:Rt=>{const{over:Ct,active:Pt}=Rt,It=Ct==null?void 0:Ct.data.current,jt=Pt==null?void 0:Pt.data.current,Dt=getAncestors(ht,It==null?void 0:It.id),Vt=getChildrenIds(ht,It==null?void 0:It.id);if(Ct){const Ft={isOver:!0,canMove:!1,overId:It==null?void 0:It.id,isTreeview:It==null?void 0:It.isTreeview};(jt==null?void 0:jt.id)===(It==null?void 0:It.id)||Dt.includes(jt==null?void 0:jt.id)||Vt.includes(jt==null?void 0:jt.id)?lt({...Ft,canMove:!1}):(dt(It==null?void 0:It.id,tt),lt({...Ft,canMove:!0}))}else lt({isOver:!1,overId:void 0,canMove:!0,isTreeview:!1})},sensors:vt}}const EmptyScreenApp$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenApp$1),void 0)),EmptyScreenSearch$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenSearch$1),void 0)),EmptyScreenError$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenError$1),void 0)),EmptyScreenNoContentInFolder$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenNoContentInFolder$1),void 0)),EmptyScreenTrash$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>EmptyScreenTrash$1),void 0)),FoldersList$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FoldersList$1),void 0)),ResourcesList$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ResourcesList$1),void 0)),List=()=>{const tt=useIsRoot(),et=useIsTrash(),rt=useSelectedNodeId(),nt=useSearchParams(),st=useCurrentFolder(),ot=useToast(),at=useQueryClient(),{appCode:lt}=useEdificeClient(),{t:ut}=useTranslation([lt]),{setSearchParams:ct,setSearchConfig:dt,fetchTreeData:ht}=useStoreActions(),{data:mt,isError:xt,error:yt,isLoading:vt,isFetching:Et,fetchNextPage:bt}=useSearchContext(),St=(mt==null?void 0:mt.pages[0].folders.length)===0,wt=(mt==null?void 0:mt.pages[0].resources.length)===0,Rt=St&&wt;return reactExports.useEffect(()=>{var Ct,Pt;mt&&((Ct=mt==null?void 0:mt.pages[0])!=null&&Ct.searchConfig&&dt(mt.pages[0].searchConfig),!nt.search&&st.id==="default"&&ht(st.id,at),ct({...nt,pagination:(Pt=mt==null?void 0:mt.pages[(mt==null?void 0:mt.pages.length)-1])==null?void 0:Pt.pagination}))},[mt]),reactExports.useEffect(()=>{yt&&typeof yt=="string"&&ot.error(ut(yt))},[yt]),vt?jsxRuntimeExports.jsx(LoadingScreen,{}):xt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenError$2,{})}):nt.search&&Rt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenSearch$2,{})}):tt&&Rt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenApp$2,{})}):rt&&Rt&&!et?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenNoContentInFolder$2,{})}):et&&(mt==null?void 0:mt.pages[0].resources.length)===0?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(EmptyScreenTrash$2,{})}):jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[jsxRuntimeExports.jsx(FoldersList$2,{data:mt,isFetching:Et}),jsxRuntimeExports.jsx(ResourcesList$2,{data:mt,isFetching:Et,fetchNextPage:bt})]})},SvgIconArrowLeft=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.707 4.293a1 1 0 0 1 0 1.414L6.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0",clipRule:"evenodd"})]}),SvgIconFiles=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20.91 9.14v1.27H8.25a4.7 4.7 0 0 0-3.86 1.98L1.5 16.53V6.4a2.3 2.3 0 0 1 .77-1.69A2.68 2.68 0 0 1 4.11 4h3.73a2.68 2.68 0 0 1 1.84.71c.25.22.45.48.58.77s.2.6.2.92v.34h7.84c.7.01 1.35.27 1.84.71.49.45.76 1.06.77 1.7ZM8.25 11.92h14.47c.63 0 1 .68.64 1.18l-3.52 5.04a3.13 3.13 0 0 1-2.57 1.32H2.79c-.62 0-.99-.68-.64-1.18l3.53-5.04a3.13 3.13 0 0 1 2.57-1.32",clipRule:"evenodd"})]}),SvgIconFilter=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.093 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .764 1.646L15 12.826V21a1 1 0 0 1-1.447.894l-4-2A1 1 0 0 1 9 19v-6.174l-7.764-9.18a1 1 0 0 1-.143-1.067M4.155 4l6.609 7.814a1 1 0 0 1 .236.646v5.922l2 1V12.46a1 1 0 0 1 .236-.646L19.845 4z",clipRule:"evenodd"})]}),SvgIconMove=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.707 8.293a1 1 0 0 1 0 1.414L3.414 12l2.293 2.293a1 1 0 1 1-1.414 1.414l-3-3a1 1 0 0 1 0-1.414l3-3a1 1 0 0 1 1.414 0M11.293 1.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.414L12 3.414 9.707 5.707a1 1 0 0 1-1.414-1.414zM8.293 18.293a1 1 0 0 1 1.414 0L12 20.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414M18.293 8.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L20.586 12l-2.293-2.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 12a1 1 0 0 1 1-1h20a1 1 0 1 1 0 2H2a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 1a1 1 0 0 1 1 1v20a1 1 0 1 1-2 0V2a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),useSearchForm=()=>{const tt=useSearchParams(),[et,rt]=reactExports.useState(""),nt=useSearchConfig(),st=useTreeStatus(),ot=reactExports.useRef(null),{setSearchParams:at}=useStoreActions(),lt=dt=>{const ht=dt.target.value;rt(ht.toString())},ut=dt=>{(dt.key==="Enter"||dt.key==="Return")&&(dt.preventDefault(),at({search:et||void 0}))},ct=dt=>{dt.preventDefault(),at({search:et||void 0})};return reactExports.useEffect(()=>{const ht=et.length==0||et.length>=nt.minLength?{search:et||void 0}:{};at({...tt,...ht})},[et,nt.minLength]),reactExports.useEffect(()=>{st==="select"&&rt("")},[st]),reactExports.useEffect(()=>{rt(()=>{var dt;return((dt=tt.search)==null?void 0:dt.toString())??""})},[tt]),{formRef:ot,inputSearch:et,handleInputSearchChange:lt,handleKeyPress:ut,handleSearchSubmit:ct}},useSelectedFilters=()=>{const{appCode:tt,currentApp:et}=useEdificeClient(),{t:rt}=useTranslation(),[nt,st]=reactExports.useState(""),ot=dt=>{if(dt==="0"){st("");return}st(dt)},at=useCurrentFolder(),lt=useSearchParams(),{setSearchParams:ut}=useStoreActions();reactExports.useEffect(()=>{const dt=()=>nt.includes("1")?!0:void 0,ht=()=>nt.includes("2")?!0:void 0,mt=()=>nt.includes("7")?!0:void 0;ut({...lt,filters:{owner:dt(),public:mt(),shared:ht(),folder:at?at.id:"default"}})},[at,ut,nt]);const ct=[{label:rt("explorer.filter.all",{ns:tt}),value:"0"},{label:rt("explorer.filter.owner",{ns:tt}),value:"1"},{label:rt("explorer.filter.shared",{ns:tt}),value:"2"},...(et==null?void 0:et.displayName)=="exercizer"?[{label:"Exercices interactifs",value:"3"}]:[],...(et==null?void 0:et.displayName)=="exercizer"?[{label:"Exercices à rendre",value:"4"}]:[],...(et==null?void 0:et.displayName)=="pages"?[{label:"Projets publics",value:"5"}]:[],...(et==null?void 0:et.displayName)=="pages"?[{label:"Projets internes",value:"6"}]:[],...(et==null?void 0:et.displayName)=="blog"?[{label:rt("explorer.filter.public",{ns:tt}),value:"7"}]:[]];return{selectedFilters:nt,options:ct,handleOnSelectFilter:ot}},SearchForm=()=>{const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation(),{selectedFilters:rt,options:nt,handleOnSelectFilter:st}=useSelectedFilters(),{formRef:ot,inputSearch:at,handleInputSearchChange:lt,handleKeyPress:ut,handleSearchSubmit:ct}=useSearchForm(),dt=rt.length>0?rt.length:void 0;return jsxRuntimeExports.jsxs("form",{noValidate:!0,className:"bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative d-flex gap-8",ref:ot,children:[jsxRuntimeExports.jsxs(FormControl,{id:"search",className:"input-group",children:[jsxRuntimeExports.jsx(Input,{type:"search",placeholder:et("explorer.label.search",{ns:tt}),size:"lg",noValidationIcon:!0,value:at,onChange:lt,onKeyDown:ut}),jsxRuntimeExports.jsx(SearchButton,{type:"submit","aria-label":et("explorer.label.search",{ns:tt}),onClick:ct})]}),jsxRuntimeExports.jsxs(Dropdown,{placement:"bottom-end",children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{label:et("explorer.filters"),icon:jsxRuntimeExports.jsx(SvgIconFilter,{width:20}),variant:"ghost",badgeContent:dt}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:nt.map(ht=>ht.value==="0"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>st(ht.value),children:ht.label}),jsxRuntimeExports.jsx(Dropdown.Separator,{})]},"0"):jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>st(ht.value),children:ht.label},ht.value))})]})]})},TrashButton=({id:tt,selected:et,onSelect:rt})=>{const{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:jsxRuntimeExports.jsx("li",{id:tt,role:"treeitem","aria-selected":et,children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:"action-container",children:jsxRuntimeExports.jsx("div",{onClick:rt,role:"button",tabIndex:0,children:jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-8 py-8 ps-24",children:[jsxRuntimeExports.jsx(SvgIconDelete,{width:"20",height:"20"}),jsxRuntimeExports.jsx("span",{children:nt("explorer.tree.trash")})]})})})})})})})},CreateFolderModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FolderModal$2),void 0)),TreeViewContainer=()=>{const[tt,et]=useToggle(),rt=useQueryClient(),nt=useTreeData(),st=useIsTrash(),ot=useSelectedNodeId(),at=useElementDragOver(),lt=useScrollToTop(),ut=st?FOLDER.BIN:ot,{appCode:ct}=useEdificeClient(),{t:dt}=useTranslation(["common",ct]),ht={...nt,name:dt("explorer.filters.mine",{ns:ct})},{goToTrash:mt,selectTreeItem:xt,clearSelectedItems:yt,clearSelectedIds:vt,fetchTreeData:Et}=useStoreActions(),bt=Rt=>{xt(Rt,rt),lt()},St=Rt=>{var It,jt;const Ct=findNodeById(nt,Rt),Pt=(It=Ct==null?void 0:Ct.children)==null?void 0:It.some(Dt=>{var Vt;return Array.isArray(Dt==null?void 0:Dt.children)&&((Vt=Dt.children)==null?void 0:Vt.length)>0});(jt=Ct==null?void 0:Ct.children)==null||jt.forEach(Dt=>{Pt||Et(Dt.id,rt)})},wt=()=>{yt(),vt(),et()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TreeView,{data:ht,selectedNodeId:ut,draggedNode:at!=null&&at.isTreeview?at:void 0,onTreeItemClick:bt,onTreeItemUnfold:St}),jsxRuntimeExports.jsx(TrashButton,{id:FOLDER.BIN,selected:st,onSelect:mt}),jsxRuntimeExports.jsx("div",{className:"d-grid my-16",children:jsxRuntimeExports.jsx(Button,{disabled:st,type:"button",color:"primary",variant:"outline",leftIcon:jsxRuntimeExports.jsx(SvgIconPlus,{}),onClick:wt,children:dt("explorer.folder.new")})}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:tt&&jsxRuntimeExports.jsx(CreateFolderModal,{edit:!1,isOpen:tt,onSuccess:et,onCancel:et})})]})};function ExplorerBreadcrumb(){const{appCode:tt}=useEdificeClient(),{gotoPreviousFolder:et}=useStoreActions(),{t:rt}=useTranslation(["common",tt]),{inputSearch:nt}=useSearchForm(),st=useSelectedNodeId(),ot=useIsTrash(),at=useCurrentFolder(),lt=rt("explorer.tree.trash"),ut=rt("explorer.tree.search"),ct=rt("explorer.filters.mine",{ns:tt}),dt=(at==null?void 0:at.name)||ct;return jsxRuntimeExports.jsx("div",{className:"py-16",children:st&&st!=="bin"&&st!=="default"&&!ot?jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-8",children:[jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconArrowLeft,{}),variant:"ghost",color:"tertiary","aria-label":rt("back"),className:"ms-n16",onClick:et}),jsxRuntimeExports.jsx("p",{className:"body py-8 text-truncate",children:jsxRuntimeExports.jsx("strong",{children:dt})})]}):jsxRuntimeExports.jsx("h2",{className:"body py-8 fw-bold",children:nt.length!==0?ut:ot?lt:ct})})}const illuTrashDelete="/assets/js/ode-explorer/illu-trash-delete.svg",illuTrashMenu="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='version_orange'%20data-name='version%20orange'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20576%20353.36'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23fff;%20}%20.cls-2%20{%20fill:%20%23aadaed;%20}%20.cls-3%20{%20fill:%20%23ffefe3;%20}%20.cls-4%20{%20fill:%20none;%20stroke:%20%23aadaed;%20stroke-miterlimit:%2010;%20stroke-width:%204px;%20}%20.cls-5%20{%20fill:%20%232a9cc8;%20}%20%3c/style%3e%3c/defs%3e%3cg%20id='ciseaux'%3e%3cpath%20class='cls-3'%20d='m512.64,45.09H61.92c-11.56,0-20.93,9.37-20.93,20.93v232.01c0,11.56,9.37,20.93,20.93,20.93h450.72c11.56,0,20.93-9.37,20.93-20.93V66.02c0-11.56-9.37-20.93-20.93-20.93ZM211.25,212.37c0,7.55-6.12,13.66-13.66,13.66h-108.21c-7.55,0-13.66-6.12-13.66-13.66v-112.62c0-7.55,6.12-13.66,13.66-13.66h108.21c7.55,0,13.66,6.12,13.66,13.66v112.62Zm150.21-41.03h-94.5c-4.42,0-8-3.58-8-8s3.58-8,8-8h94.5c4.42,0,8,3.58,8,8s-3.58,8-8,8Zm105.82,118.05H164.74c-4.42,0-8-3.58-8-8s3.58-8,8-8h302.55c4.42,0,8,3.58,8,8s-3.58,8-8,8Zm-3.54-169.27h-196.7c-6.38,0-11.55-5.17-11.55-11.55s5.17-11.55,11.55-11.55h196.7c6.38,0,11.55,5.17,11.55,11.55s-5.17,11.55-11.55,11.55Zm-332.66,158.93c0,13.56-10.99,24.55-24.55,24.55s-24.55-10.99-24.55-24.55,10.99-24.55,24.55-24.55,24.55,10.99,24.55,24.55Z'/%3e%3c/g%3e%3crect%20class='cls-5'%20x='420.8'%20y='58.38'%20width='100.39'%20height='100.39'%20rx='20'%20ry='20'/%3e%3cg%20id='ciseaux-2'%20data-name='ciseaux'%3e%3cpath%20class='cls-4'%20d='m513.58,45.09H60.99c-11.05,0-20,8.95-20,20v233.88c0,11.05,8.95,20,20,20h452.59c11.05,0,20-8.95,20-20V65.09c0-11.05-8.95-20-20-20Z'/%3e%3c/g%3e%3ccircle%20class='cls-1'%20cx='471'%20cy='84.02'%20r='7.02'/%3e%3ccircle%20class='cls-1'%20cx='471'%20cy='109.3'%20r='7.02'/%3e%3ccircle%20class='cls-1'%20cx='471'%20cy='133.13'%20r='7.02'/%3e%3cg%3e%3cpath%20class='cls-2'%20d='m449.99,215.32c-.39,0-.76-.08-1.12-.24l-9.44-4.22c-.69-.31-1.23-.9-1.48-1.62-.25-.72-.18-1.52.17-2.19l3.92-7.33-13.25-5.79c-.83-.36-1.43-1.11-1.6-2.01s.11-1.81.76-2.45l40.08-40.08c.52-.52,1.21-.81,1.94-.81,1.52,0,2.75,1.23,2.75,2.75v57.58c0,.75-.3,1.45-.83,1.97-.52.5-1.2.78-1.91.78h0c-.38,0-.75-.08-1.1-.23l-12.85-5.61-3.53,7.87c-.44.99-1.43,1.62-2.51,1.62Z'/%3e%3cpath%20class='cls-1'%20d='m469.97,150.6c.38,0,.75.3.75.75v57.58c0,.43-.35.75-.75.75-.1,0-.2-.02-.3-.06l-13.99-6.11c-.1-.04-.2-.06-.3-.06-.29,0-.56.16-.68.44l-4.03,9c-.12.28-.4.44-.68.44-.1,0-.21-.02-.3-.07l-9.44-4.22c-.4-.18-.56-.65-.35-1.04l4.56-8.53c.21-.38.04-.86-.36-1.04l-14.5-6.33c-.48-.21-.6-.84-.23-1.21l40.08-40.08c.15-.15.34-.22.52-.22m0-4c-1.26,0-2.45.49-3.35,1.39l-40.08,40.08c-1.11,1.11-1.6,2.7-1.31,4.24.29,1.54,1.33,2.84,2.77,3.47l11.27,4.92-2.9,5.42c-.62,1.16-.73,2.53-.31,3.78.42,1.24,1.36,2.26,2.55,2.8l9.44,4.22c.61.27,1.27.41,1.94.41,1.87,0,3.57-1.1,4.33-2.81l2.72-6.06,11.04,4.82c.6.26,1.24.4,1.9.4,2.62,0,4.75-2.13,4.75-4.75v-57.58c0-2.62-2.13-4.75-4.75-4.75h0Z'/%3e%3c/g%3e%3c/svg%3e",illuTrashNotif="data:image/svg+xml,%3csvg%20width='300'%20height='214'%20viewBox='0%200%20300%20214'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='300'%20height='214'%20fill='white'/%3e%3cpath%20d='M187.994%20193.875H108.563C103.268%20193.875%2098.878%20189.768%2098.5214%20184.484L90.1194%2059.0277H209.67L198.01%20184.741C197.529%20189.915%20193.19%20193.875%20187.99%20193.875H187.994Z'%20fill='%23FFEFE3'/%3e%3cpath%20d='M150.47%20150.31L164.483%20157.961C166.929%20159.296%20169.995%20158.395%20171.33%20155.95C171.999%20154.726%20172.106%20153.35%20171.742%20152.111C171.378%20150.872%20170.539%20149.773%20169.319%20149.103C167.223%20147.96%20166.638%20146.217%20166.954%20144.029C168.388%20134.186%20188.167%20115.393%20171.091%20102.13L162.134%2097.2392C141.741%2090.047%20136.626%20116.845%20129.121%20123.372C127.456%20124.824%20125.672%20125.273%20123.577%20124.126C121.131%20122.791%20118.065%20123.692%20116.73%20126.137C116.061%20127.358%20115.954%20128.736%20116.318%20129.976C116.682%20131.215%20117.521%20132.314%20118.741%20132.983L131.537%20139.97L132.751%20140.632L150.467%20150.306L150.47%20150.31Z'%20fill='%23AADAED'/%3e%3cpath%20opacity='0.2'%20d='M171.095%20102.13L171.117%20102.144L171.095%20102.13Z'%20fill='%23AADAED'/%3e%3cpath%20d='M171.095%20102.13L171.117%20102.141C171.187%20102.034%20171.253%20101.924%20171.315%20101.81C172.676%2099.3167%20171.76%2096.1913%20169.267%2094.8308C166.774%2093.4703%20163.649%2094.3895%20162.288%2096.8789C162.226%2096.9929%20162.167%2097.1068%20162.115%2097.2245L162.137%2097.2355L171.095%20102.126V102.13Z'%20fill='%23AADAED'/%3e%3cpath%20d='M133.67%20142.455C138.56%20145.228%20143.451%20148%20148.341%20150.773C146.422%20154.365%20142.929%20156.483%20139.421%20156.23C138.921%20156.193%20136.292%20155.954%20134.328%20153.884C131.769%20151.188%20131.438%20146.563%20133.674%20142.459L133.67%20142.455Z'%20fill='%23AADAED'/%3e%3cpath%20d='M145.56%2088.6624C145.125%2086.8475%20143.302%2085.7288%20141.488%2086.1636C139.674%2086.5984%20138.556%2088.4221%20138.991%2090.2369L156.729%20164.233C157.164%20166.048%20158.987%20167.166%20160.801%20166.732C162.615%20166.297%20163.732%20164.473%20163.297%20162.658L145.56%2088.6624Z'%20fill='%232A9CC8'/%3e%3cpath%20d='M214.66%2037.9143H195.186L189.833%2028.707C187.068%2023.9526%20181.938%2021%20176.441%2021H125.492C120.44%2021%20115.693%2023.471%20112.796%2027.6149L105.592%2037.9143H85.1334C81.1916%2037.9143%2078%2041.1096%2078%2045.0477V46.592C78%2050.5338%2081.1953%2053.7254%2085.1334%2053.7254H214.66C218.602%2053.7254%20221.793%2050.5301%20221.793%2046.592V45.0477C221.793%2041.1059%20218.598%2037.9143%20214.66%2037.9143ZM122.437%2034.3586C123.132%2033.3621%20124.275%2032.7664%20125.489%2032.7664H176.437C177.761%2032.7664%20178.993%2033.4761%20179.658%2034.6196L181.574%2037.9143H119.947L122.433%2034.3586H122.437Z'%20fill='%23FFEFE3'/%3e%3cpath%20d='M187.064%2093.9335C187.56%2093.9777%20188.046%2093.7864%20188.542%2093.7313C189.038%2093.6761%20189.63%2093.8232%20189.822%2094.2828C190.108%2094.9778%20189.274%2095.6911%20189.369%2096.4376C189.424%2096.8604%20189.763%2097.1803%20190.079%2097.4635C190.719%2098.0334%20191.362%2098.607%20192.002%2099.177C192.164%2099.3204%20192.329%2099.4748%20192.384%2099.6807C192.454%2099.9307%20192.34%20100.192%20192.245%20100.434C191.829%20101.49%20191.789%20102.894%20192.723%20103.542C192.98%20103.722%20193.304%20103.828%20193.488%20104.086C193.693%20104.376%20193.66%20104.766%20193.605%20105.119C193.473%20105.994%20193.278%20106.858%20193.021%20107.708'%20stroke='white'%20stroke-width='6.05'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M105.681%20138.694C105.611%20140.003%20105.658%20141.562%20106.751%20142.29C106.993%20142.452%20107.276%20142.558%20107.493%20142.757C108.122%20143.331%20107.931%20144.353%20107.633%20145.151C107.335%20145.949%20106.982%20146.868%20107.409%20147.6C107.817%20148.298%20108.762%20148.493%20109.284%20149.111C109.813%20149.732%20109.828%20150.685%20110.387%20151.28C110.626%20151.534%20110.964%20151.721%20111.089%20152.049C111.189%20152.31%20111.126%20152.597%20111.126%20152.876C111.126%20153.63%20111.597%20154.321%20112.196%20154.781C112.796%20155.24%20113.516%20155.501%20114.226%20155.755'%20stroke='white'%20stroke-width='6.05'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",AppAction$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>AppAction$1),void 0)),Library$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>Library$1),void 0)),ActionBar=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ActionBarContainer$1),void 0)),DisableModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>DisableModal$1),void 0)),TrashModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>TrashModal$1),void 0)),OnboardingModal$1=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>OnboardingModal),void 0)),Explorer=({config:tt})=>{const et=useSearchParams(),{setConfig:rt,setSearchParams:nt}=useStoreActions();reactExports.useEffect(()=>{rt(tt||{}),nt({...et,application:tt.app,types:tt.types})},[tt]);const{currentApp:st}=useEdificeClient(),{data:ot}=useActions(tt.actions),{isTrashedModalOpen:at,onTrashedCancel:lt}=useTrashModal(),{isActionDisableModalOpen:ut,onActionDisableCancel:ct}=useDisableModal(),{handleDragEnd:dt,handleDragOver:ht,handleDragStart:mt,sensors:xt}=useDndKit();useXitiTrackPageLoad();const yt=isActionAvailable("publish",ot),vt=isActionAvailable("create",ot);return tt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AppHeader,{render:()=>vt?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(AppAction$2,{})}):null,children:jsxRuntimeExports.jsx(Breadcrumb,{app:st})}),jsxRuntimeExports.jsx(Grid,{className:"flex-grow-1",children:jsxRuntimeExports.jsxs(DndContext,{sensors:xt,modifiers:[snapCenterToCursor],onDragStart:mt,onDragEnd:dt,onDragOver:ht,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"3",lg:"2",xl:"3",className:"border-end pt-16 pe-16 d-none d-lg-block",as:"aside",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[jsxRuntimeExports.jsx(TreeViewContainer,{}),yt&&jsxRuntimeExports.jsx(Library$2,{})]})}),jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",lg:"6",xl:"9",children:[jsxRuntimeExports.jsx(SearchForm,{}),jsxRuntimeExports.jsx(ExplorerBreadcrumb,{}),jsxRuntimeExports.jsx(List,{})]}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[jsxRuntimeExports.jsx(ActionBar,{}),tt.enableOnboarding&&jsxRuntimeExports.jsx(OnboardingModal$1,{id:"showOnboardingTrash",items:[{src:illuTrashMenu,alt:"explorer.modal.onboarding.trash.screen1.alt",text:"explorer.modal.onboarding.trash.screen1.title"},{src:illuTrashNotif,alt:"explorer.modal.onboarding.trash.screen2.alt",text:"explorer.modal.onboarding.trash.screen2.alt"},{src:illuTrashDelete,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"}}),at&&jsxRuntimeExports.jsx(TrashModal$2,{isOpen:at,onCancel:lt}),ut&&jsxRuntimeExports.jsx(DisableModal$2,{isOpen:ut,onCancel:ct})]})]})})]})};function Root(){const{init:tt}=useEdificeClient(),et=getExplorerConfig();return tt?jsxRuntimeExports.jsx(Layout,{children:jsxRuntimeExports.jsx(Explorer,{config:et})}):jsxRuntimeExports.jsx(LoadingScreen,{position:!1})}var ReactQueryDevtools2=function(){return null};const queryClient=new QueryClient({queryCache:new QueryCache({onError:tt=>{typeof tt=="string"&&tt===ERROR_CODE.NOT_LOGGED_IN&&window.location.replace("/auth/login")}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),getHTMLConfig=getExplorerConfig(),Providers=({children:tt})=>jsxRuntimeExports.jsxs(QueryClientProvider,{client:queryClient,children:[jsxRuntimeExports.jsx(EdificeClientProvider,{params:{app:getHTMLConfig.app},children:jsxRuntimeExports.jsx(EdificeThemeProvider,{children:tt})}),jsxRuntimeExports.jsx(ReactQueryDevtools2,{initialIsOpen:!1})]}),root=document.getElementById("root");createRoot(root).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(Providers,{children:jsxRuntimeExports.jsx(Root,{})})}));const __variableDynamicImportRuntimeHelper=(tt,et,rt)=>{const nt=tt[et];return nt?typeof nt=="function"?nt():Promise.resolve(nt):new Promise((st,ot)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(ot.bind(null,new Error("Unknown variable dynamic import: "+et+(et.split("/").length!==rt?". Note that variables only represent file names one level deep.":""))))})};function EmptyScreenApp(){const{appCode:tt}=useEdificeClient(),{theme:et}=useEdificeTheme(),{t:rt}=useTranslation(),[nt,st]=reactExports.useState("");reactExports.useEffect(()=>{(async()=>{const ht=await __variableDynamicImportRuntimeHelper(Object.assign({"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-blog.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuBlog$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-collaborativeeditor.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuCollaborativeeditor$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-collaborativewall.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuCollaborativewall$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuError$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-exercizer.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuExercizer$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-mindmap.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuMindmap$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-no-content-in-folder.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuNoContentInFolder$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-pad.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuPad$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-scrapbook.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuScrapbook$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-search.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuSearch$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-timeline.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuTimeline$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-timelinegenerator.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuTimelinegenerator$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuTrash$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-wiki.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuWiki$1),void 0)}),`../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-${tt}.svg`,10);st(ht.default)})()},[tt]);const ot=useStoreContext(dt=>dt.config),{data:at}=useActions(ot==null?void 0:ot.actions),lt=at==null?void 0:at.find(dt=>dt.id==="create"),ut=()=>lt!=null&&lt.available&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.txt1d.create",{ns:tt}):lt!=null&&lt.available&&!(et!=null&&et.is1d)?rt("explorer.emptyScreen.txt2d.create",{ns:tt}):!(lt!=null&&lt.available)&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.txt1d.consultation",{ns:tt}):rt("explorer.emptyScreen.txt2d.consultation",{ns:tt}),ct=()=>lt!=null&&lt.available&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.title1d.create",{ns:tt}):lt!=null&&lt.available&&!(et!=null&&et.is1d)?rt("explorer.emptyScreen.title2d.create",{ns:tt}):!(lt!=null&&lt.available)&&(et!=null&&et.is1d)?rt("explorer.emptyScreen.title1d.consultation",{ns:tt}):rt("explorer.emptyScreen.title2d.consultation",{ns:tt});return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:nt,imageAlt:rt("explorer.emptyScreen.app.alt",{ns:tt}),title:ct(),text:ut()})}const EmptyScreenApp$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenApp},Symbol.toStringTag,{value:"Module"})),illuSearch="/assets/js/ode-explorer/illu-search.svg",illuSearch$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuSearch},Symbol.toStringTag,{value:"Module"}));function EmptyScreenSearch(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuSearch,imageAlt:et("explorer.emptyScreen.search.alt",{ns:tt}),text:et("explorer.emptyScreen.search.text",{ns:tt})})}const EmptyScreenSearch$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenSearch},Symbol.toStringTag,{value:"Module"}));function EmptyScreenError(){const{t:tt}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,imageAlt:tt("explorer.emptyScreen.error.alt"),text:"explorer.emptyScreen.error.text"})}const EmptyScreenError$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenError},Symbol.toStringTag,{value:"Module"})),illuNoContentInFolder="/assets/js/ode-explorer/illu-no-content-in-folder.svg",illuNoContentInFolder$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuNoContentInFolder},Symbol.toStringTag,{value:"Module"}));function EmptyScreenNoContentInFolder(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuNoContentInFolder,imageAlt:et("explorer.emptyScreen.folder.empty.alt",{ns:tt}),text:et("explorer.emptyScreen.label",{ns:tt})})}const EmptyScreenNoContentInFolder$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenNoContentInFolder},Symbol.toStringTag,{value:"Module"}));function EmptyScreenTrash(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation();return jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,imageAlt:et("explorer.emptyScreen.trash.alt"),title:et("explorer.emptyScreen.trash.title"),text:et("explorer.emptyScreen.trash.empty",{ns:tt})})}const EmptyScreenTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:EmptyScreenTrash},Symbol.toStringTag,{value:"Module"}));function CardIcon({app:tt,type:et}){return et==="folder"?jsxRuntimeExports.jsx(SvgIconFiles,{width:"24",height:"24",className:`color-app-${tt==null?void 0:tt.displayName}`}):et==="resource"?jsxRuntimeExports.jsx(AppIcon,{app:tt,iconFit:"ratio",size:"24",variant:"rounded"}):null}const DraggableCard=({app:tt,type:et,name:rt})=>{const nt={flexDirection:"row",width:"252px",height:"32px",boxShadow:"0 0.2rem 0.6em rgba(0, 0, 0, 0.15)"};return jsxRuntimeExports.jsxs("div",{className:"d-inline-flex align-items-center card is-selected gap-8",style:nt,children:[jsxRuntimeExports.jsx("div",{className:"ms-8",children:jsxRuntimeExports.jsx(CardIcon,{app:tt,type:et})}),jsxRuntimeExports.jsx("div",{className:"text-truncate",children:rt})]})},FolderCard=({app:tt,name:et,idFolder:rt,isSelected:nt=!1,isSelectable:st=!0,onClick:ot,onSelect:at})=>{const[lt,ut]=reactExports.useState(!1),ct=reactExports.useId(),{lg:dt}=useBreakpoint(),{setNodeRef:ht}=useDroppable({id:ct,data:{id:rt,name:et,isTreeview:!1,accepts:["folder","resource"]}}),{attributes:mt,listeners:xt,setNodeRef:yt,transform:vt}=useDraggable({id:ct,data:{id:rt,type:"folder"},disabled:!dt}),Et=useResourceOrFolderIsDraggable(),bt=useElementDragOver(),St=Pt=>{yt(Pt),ht(Pt)},wt=bt.overId===rt,Rt=!bt.canMove&&bt.isTreeview?"no-drop":lt?"grabbing":"default",Ct={transform:`translate3d(${((vt==null?void 0:vt.x)??0)/1}px, ${((vt==null?void 0:vt.y)??0)/1}px, 0)`,cursor:Rt};return reactExports.useEffect(()=>{const Pt=Et.elementDrag===rt;ut(Pt)},[Et]),jsxRuntimeExports.jsx("div",{ref:St,style:{...Ct},children:lt?jsxRuntimeExports.jsx(DraggableCard,{name:et,app:tt,type:"folder"}):jsxRuntimeExports.jsx(Card,{app:tt,isSelectable:!lt&&st,isSelected:!lt&&nt||wt&&lt,isFocused:wt,onClick:ot,onSelect:at,children:Pt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!lt&&dt&&jsxRuntimeExports.jsx("div",{className:"card-header z-3",style:{position:"fixed",left:"37px"},children:jsxRuntimeExports.jsx(IconButton,{...xt,...mt,className:"bg-white z-3",color:"secondary",icon:jsxRuntimeExports.jsx(SvgIconMove,{}),variant:"ghost"})}),jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx(SvgIconFiles,{width:"48",height:"48",className:`color-app-${Pt}`}),jsxRuntimeExports.jsx(Card.Title,{children:et})]})]})})})};FolderCard.displayName="FolderCard";const FoldersList=({data:tt})=>{var xt,yt;const et=useQueryClient(),rt=useSelectedFolders(),nt=useFolderIds(),st=useResourceOrFolderIsDraggable(),ot=useScrollToTop(),{currentApp:at}=useEdificeClient(),{setSelectedFolders:lt,setFolderIds:ut,openFolder:ct}=useStoreActions();function dt(vt){nt.includes(vt.id)?(ut(nt.filter(Et=>Et!==vt.id)),lt(rt.filter(Et=>Et.id!==vt.id))):(ut([vt.id,...nt]),lt([vt,...rt]))}function ht(vt){ot(),ct({folder:vt,folderId:vt.id,queryClient:et})}const mt=useSpring({from:{opacity:0},to:{opacity:1}});return(xt=tt==null?void 0:tt.pages[0])!=null&&xt.folders.length?jsxRuntimeExports.jsx(animated.ul,{className:"grid ps-0 list-unstyled mb-24",children:(yt=tt==null?void 0:tt.pages[0])==null?void 0:yt.folders.map(vt=>{const{id:Et,name:bt}=vt,St=st.elementDrag===Et;return jsxRuntimeExports.jsx(animated.li,{className:`g-col-4 ${St?"z-2000":"z-1"}`,style:{position:"relative",...mt},children:jsxRuntimeExports.jsx(FolderCard,{name:bt,idFolder:Et,app:at,isSelected:nt.includes(vt.id),onClick:wt=>{wt.stopPropagation(),ht(vt)},onSelect:()=>dt(vt)})},Et)})}):null},FoldersList$1=Object.freeze(Object.defineProperty({__proto__:null,default:FoldersList},Symbol.toStringTag,{value:"Module"})),ResourceCard=({app:tt,resource:et,time:rt,isSelected:nt=!1,isSelectable:st=!0,onClick:ot,onSelect:at})=>{const[lt,ut]=reactExports.useState(!1),ct=useIsTrash(),{lg:dt}=useBreakpoint(),ht=`/userbook/avatar/${et==null?void 0:et.creatorId}`;function mt(Pt){const{rights:It,creatorId:jt}=Pt||{};return It.filter(Vt=>!Vt.includes(jt)).length>=1}const{attributes:xt,listeners:yt,setNodeRef:vt,transform:Et}=useDraggable({id:et.id,data:{id:et.id,type:"resource"},disabled:!!ct||!dt}),bt=mt(et),St=et==null?void 0:et.public,wt=useResourceOrFolderIsDraggable(),{t:Rt}=useTranslation(),Ct={position:lt?"absolute":"relative",zIndex:lt?2e3:1,transform:`translate3d(${((Et==null?void 0:Et.x)??0)/1}px, ${((Et==null?void 0:Et.y)??0)/1}px, 0)`};return reactExports.useEffect(()=>{const Pt=wt.elementDrag===et.id;ut(Pt)},[wt]),jsxRuntimeExports.jsx("div",{ref:vt,style:{...Ct},children:lt?jsxRuntimeExports.jsx(DraggableCard,{app:tt,type:"resource",name:et==null?void 0:et.name}):jsxRuntimeExports.jsx(Card,{app:tt,isSelected:!lt&&nt,isSelectable:!lt&&st,onClick:ot,onSelect:at,children:Pt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!lt&&dt&&jsxRuntimeExports.jsx("div",{className:"card-header z-3",style:{position:"fixed",left:"37px"},children:jsxRuntimeExports.jsx(IconButton,{...yt,...xt,className:"bg-white z-3",color:"secondary",icon:jsxRuntimeExports.jsx(SvgIconMove,{}),variant:"ghost"})}),jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx("div",{className:"card-image medium",children:et!=null&&et.thumbnail?jsxRuntimeExports.jsx(Image$1,{alt:"",src:`${et==null?void 0:et.thumbnail}?thumbnail=80x80`,objectFit:"cover",className:"h-full w-100"}):jsxRuntimeExports.jsx(AppIcon,{app:tt,iconFit:"ratio",size:"80",variant:"rounded"})}),jsxRuntimeExports.jsxs("div",{className:"text-truncate",children:[jsxRuntimeExports.jsx(Card.Title,{children:et==null?void 0:et.name}),jsxRuntimeExports.jsx(Card.Text,{children:jsxRuntimeExports.jsx("em",{children:rt})})]})]}),jsxRuntimeExports.jsxs(Card.Footer,{children:[jsxRuntimeExports.jsxs("div",{className:"d-inline-flex align-items-center gap-8 text-truncate",children:[ht?jsxRuntimeExports.jsx(Avatar,{alt:(et==null?void 0:et.creatorName)||"",size:"xs",src:ht,variant:"circle",width:"24",height:"24"}):jsxRuntimeExports.jsx(SvgIconOneProfile,{}),jsxRuntimeExports.jsx(Card.Text,{children:et==null?void 0:et.creatorName})]}),jsxRuntimeExports.jsxs("div",{className:"d-inline-flex align-items-center gap-8",children:[bt&&jsxRuntimeExports.jsx(Tooltip,{message:Rt("tooltip.shared",{ns:Pt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16,height:16})}),St&&jsxRuntimeExports.jsx(Tooltip,{message:Rt("tooltip.public",{ns:Pt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconGlobe,{width:16,height:16})})]})]})]})})})};ResourceCard.displayName="ResourceCard";const ResourcesList=({data:tt,fetchNextPage:et})=>{const{currentApp:rt}=useEdificeClient(),{t:nt}=useTranslation(),{fromNow:st}=useDate(),ot=useSearchParams(),at=useResourceIds(),lt=useSelectedResources(),{setSelectedResources:ut,setResourceIds:ct,openResource:dt,setResourceIsTrash:ht}=useStoreActions(),mt=useIsTrash(),xt=useSpring({from:{opacity:0},to:{opacity:1}}),vt=ot.pagination.startIdx+ot.pagination.pageSize<(ot.pagination.maxIdx||0),Et=reactExports.useCallback(()=>{et()},[]),bt=Rt=>{mt?(ht(!0),ct([Rt.id]),ut([Rt])):dt(Rt)};async function St(Rt){if(at.includes(Rt.id)){ct(at.filter(Ct=>Ct!==Rt.id)),ut(lt.filter(Ct=>Ct.id!==Rt.id));return}ct([...at,Rt.id]),ut([...lt,Rt])}const wt=clsx("grid ps-0 list-unstyled");return jsxRuntimeExports.jsxs(React$4.Fragment,{children:[jsxRuntimeExports.jsx(animated.ul,{className:wt,children:tt==null?void 0:tt.pages.map((Rt,Ct)=>jsxRuntimeExports.jsx(React$4.Fragment,{children:Rt.resources.map(Pt=>{const{id:It,updatedAt:jt}=Pt,Dt=st(jt);return jsxRuntimeExports.jsx(animated.li,{className:"g-col-4",style:{position:"relative",...xt},children:jsxRuntimeExports.jsx(ResourceCard,{app:rt,resource:Pt,time:Dt,isSelectable:!0,isSelected:at.includes(Pt.id),onClick:Vt=>{Vt.stopPropagation(),bt(Pt)},onSelect:()=>St(Pt)})},It)})},Ct))}),vt&&jsxRuntimeExports.jsx("div",{className:"d-grid gap-2 col-4 mx-auto my-24",children:jsxRuntimeExports.jsx(Button,{type:"button",color:"secondary",variant:"filled",onClick:Et,children:nt("explorer.see.more")})})]})},ResourcesList$1=Object.freeze(Object.defineProperty({__proto__:null,default:ResourcesList},Symbol.toStringTag,{value:"Module"}));function useFolderModal({edit:tt,onSuccess:et,onClose:rt}){var Rt;const nt=useSelectedFolders(),st=useCurrentFolder(),ot=useCreateFolder(),at=useUpdatefolder(),lt=tt?(Rt=nt[0])==null?void 0:Rt.name:void 0,{reset:ut,register:ct,handleSubmit:dt,setFocus:ht,formState:{errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt}}=useForm({mode:"onChange",values:{name:lt||""}}),Et=reactExports.useId(),bt=async function({name:Ct}){var Pt;try{if(tt){const It=(Pt=nt[0])==null?void 0:Pt.parentId,Dt=nt[0].id;await at.mutate({folderId:Dt,parentId:It,name:Ct}),ut(),et==null||et()}else{const It=(st==null?void 0:st.id)||FOLDER.DEFAULT;await ot.mutate({name:Ct,parentId:It}),ut(),et==null||et()}}catch(It){console.error(It)}};function St(){ut(),rt()}return{formId:`createModal_${Et}`,errors:mt,isSubmitting:xt,isDirty:yt,isValid:vt,register:ct,setFocus:ht,handleSubmit:dt,onCancel:St,onSubmit:bt}}function FolderModal$1({isOpen:tt,edit:et,onSuccess:rt,onCancel:nt}){const{t:st}=useTranslation(),{isDirty:ot,isValid:at,isSubmitting:lt,formId:ut,onSubmit:ct,onCancel:dt,handleSubmit:ht,register:mt,setFocus:xt}=useFolderModal({edit:et,onSuccess:rt,onClose:nt});return reactExports.useEffect(()=>{tt&&xt("name")},[tt,xt]),tt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:dt,id:"modal_"+ut,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:dt,children:st(et?"explorer.rename.folder":"explorer.create.folder")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("form",{id:ut,onSubmit:ht(ct),children:jsxRuntimeExports.jsxs(FormControl,{id:"nameFolder",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:st("explorer.create.folder.name")}),jsxRuntimeExports.jsx(Input,{type:"text",...mt("name",{required:!0,maxLength:60,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:st("explorer.create.folder.name"),size:"md","aria-required":!0,maxLength:60})]})})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:dt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{form:ut,type:"submit",color:"primary",variant:"filled",disabled:!ot||!at||lt,children:st(et?"explorer.rename":"explorer.create")})]})]}),document.getElementById("portal")):null}const FolderModal$2=Object.freeze(Object.defineProperty({__proto__:null,default:FolderModal$1},Symbol.toStringTag,{value:"Module"})),CreateModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ResourceModal),void 0));function AppAction(){const[tt,et]=useToggle(),rt=useStoreContext(xt=>xt.config),{appCode:nt}=useEdificeClient(),{t:st}=useTranslation(nt),{clearSelectedItems:ot,clearSelectedIds:at}=useStoreActions(),{data:lt}=useActions(rt==null?void 0:rt.actions),ut=lt==null?void 0:lt.find(xt=>xt.id==="create"),ct=useCurrentFolder(),dt=useCreateResource(),ht=useSearchParams(),mt=()=>{if(nt=="scrapbook"){goToCreate({searchParams:ht,folderId:ct.id});return}ot(),at(),et()};return ut?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",leftIcon:jsxRuntimeExports.jsx(SvgIconPlus,{}),className:"ms-auto",onClick:mt,children:st("explorer.create.title")}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:tt&&jsxRuntimeExports.jsx(CreateModal,{mode:"create",currentFolder:ct,createResource:dt,isOpen:tt,onSuccess:et,onCancel:et,children:(xt,yt,vt,Et,bt)=>nt==="blog"&&isActionAvailable("createPublic",lt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:nt,isUpdating:yt,resource:xt,watch:vt,setValue:Et,register:bt})})})]}):null}const AppAction$1=Object.freeze(Object.defineProperty({__proto__:null,default:AppAction},Symbol.toStringTag,{value:"Module"})),useLibrary=()=>{const tt=useLibraryUrl(),{theme:et}=useEdificeTheme(),[rt,nt]=reactExports.useState("");return reactExports.useEffect(()=>{(async()=>{const at=await __variableDynamicImportRuntimeHelper(Object.assign({"../../../../node_modules/@edifice.io/bootstrap/dist/images/neo/image-library.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>imageLibrary$3),void 0),"../../../../node_modules/@edifice.io/bootstrap/dist/images/one/image-library.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>imageLibrary$1),void 0)}),`../../../../node_modules/@edifice.io/bootstrap/dist/images/${et==null?void 0:et.bootstrapVersion}/image-library.svg`,11);nt(at.default)})()},[et]),{libraryUrl:tt,imageFullURL:rt,handleClick:()=>{tt&&(window.open(tt,"_blank"),odeServices.data().trackAccessLibraryFromExplorer())}}},Library=()=>{const{libraryUrl:tt,imageFullURL:et,handleClick:rt}=useLibrary(),{t:nt}=useTranslation();return tt&&jsxRuntimeExports.jsxs("div",{className:"p-16",children:[jsxRuntimeExports.jsx(Image$1,{width:"270",height:"140",loading:"lazy",className:"rounded",src:et,alt:nt("explorer.libray.img.alt")}),jsxRuntimeExports.jsx("p",{className:"m-8",children:nt("explorer.libray.title")}),jsxRuntimeExports.jsxs("button",{type:"button",onClick:rt,rel:"noreferrer",className:"btn btn-ghost-primary d-inline-flex align-items-center gap-4 p-8",children:[jsxRuntimeExports.jsx("span",{children:nt("explorer.libray.btn")}),jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]})},Library$1=Object.freeze(Object.defineProperty({__proto__:null,default:Library},Symbol.toStringTag,{value:"Module"}));function useAccessControl({roles:tt,rights:et,action:rt}){const[nt,st]=reactExports.useState(!1),{user:ot}=useUser(),at=useIsTrash();reactExports.useEffect(()=>{ct()},[tt,et]);const lt=async function(dt){const ht=dt instanceof Array?dt:[dt];if(tt instanceof Array){const mt=await odeServices.rights().sessionHasAtLeastOneResourceRight(tt,ht);st(mt)}else{const mt=await odeServices.rights().sessionHasResourceRight(tt,ht);st(mt)}},ut=async function(dt){if(tt instanceof Array){const ht=await odeServices.rights().sessionHasAtLeastOneResourceRightForEachList(tt,dt);st(ht)}else{const ht=await odeServices.rights().sessionHasResourceRightForEachList(tt,dt);st(ht)}},ct=async function(){var dt,ht,mt;if(tt===void 0){st(!0);return}if(at&&((ht=(dt=et[0])==null?void 0:dt.trashedBy)!=null&&ht.includes(ot==null?void 0:ot.userId))&&rt==="restore"&&!((mt=et[0])!=null&&mt.trashed)){st(!0);return}if(et instanceof Array)if(et.length>0)if(typeof et[0]=="string")await lt(et);else{const xt=et.map(yt=>yt.rights);await ut(xt)}else st(!1);else typeof et=="string"?await lt(et):await lt(et.rights)};return{visible:nt,refreshState:ct}}function useActionBar(){const[tt,et]=reactExports.useState(!1),[rt,nt]=reactExports.useState("void"),[st,ot]=reactExports.useState(),at=useStoreContext(hr=>hr.config),lt=useCurrentFolder(),ut=useResourceIds(),ct=useSelectedResources(),dt=useSelectedFolders(),ht=useFolderIds(),mt=useIsTrash(),xt=useRestore(),yt=useResourceIsTrash(),vt=useSearchParams(),Et=useCopyResource(),bt=useResourceOrFolderIsDraggable(),{openResource:St,printSelectedResource:wt,openFolder:Rt,clearSelectedItems:Ct,clearSelectedIds:Pt}=useStoreActions(),{data:It}=useActions(at==null?void 0:at.actions);reactExports.useEffect(()=>{if(ut.length===0&&ht.length===0){et(!1);return}if(yt){et(!1);return}if(bt.isDrag){et(!1);return}et(!0)},[ut,ht]);async function jt(hr){var Ar;switch((Ar=document.getElementById("root"))==null||Ar.setAttribute("aria-hidden","true"),ot(hr),hr.id){case ACTION.OPEN:return ut.length>0?St(ct[0]):Rt({folder:dt[0],folderId:dt[0].id});case ACTION.COPY:return vr();case ACTION.MOVE:return nt("move");case ACTION.PRINT:return wt();case ACTION.DELETE:return nt("delete");case ACTION.RESTORE:return await Ft();case ACTION.PUBLISH:return nt("publish");case ACTION.UPD_PROPS:case"edit":return Er();case ACTION.SHARE:return nt("share");case ACTION.EXPORT:return nt("export");default:throw Error(`Unknown action: ${hr.id}`)}}function Dt(hr){const Ar=ut.length+ht.length,Cr=ut.length===1||ht.length===1,Ur=Ar===1,Sr=ht.length===0;switch(hr.id){case ACTION.OPEN:return Ur;case ACTION.MANAGE:return Cr;case ACTION.COPY:return Cr&&Sr;case ACTION.PUBLISH:return Cr&&Sr;case ACTION.UPD_PROPS:return Cr&&Sr;case ACTION.SHARE:return Sr&&Cr;case"export":return Cr&&Sr;case ACTION.PRINT:return Cr&&Sr;case"edit":return Ur;default:return!0}}const Vt=()=>!0;async function Ft(){try{if(mt)await xt.mutate();else throw new Error("Cannot restore untrashed resources");Ht()}catch(hr){console.error(hr)}}function Ht(){var hr;nt("void"),st!=null&&st.id&&((hr=document.getElementById(st==null?void 0:st.id))==null||hr.focus())}const Nt=hr=>()=>{rt===hr&&(Ht(),Ct(),Pt())},Lt=Nt("move"),Mt=Nt("move"),zt=Nt("delete"),Gt=Nt("delete"),$t=Nt("publish"),Ut=Nt("publish"),Bt=Nt("edit_folder"),Yt=Nt("edit_folder"),Zt=Nt("edit_resource"),Xt=Nt("edit_resource"),rr=Nt("share"),cr=Nt("share"),ur=Nt("export"),mr=Nt("export");async function vr(){if(ct&&ct.length>0){const hr=ct[0];await Et.mutate(hr),Ct(),Pt()}}function Er(){if(ut&&ut.length>0){const hr=ct[0].assetId;(at==null?void 0:at.app)==="scrapbook"?goToEdit({searchParams:vt,assetId:hr}):nt("edit_resource")}else nt("edit_folder")}function br(hr){return hr.id==="edit"&&ht.length>0?"explorer.rename":`explorer.actions.${hr.id}`}return{onRestore:Ft,actions:mt?at==null?void 0:at.trashActions:It,selectedElement:[...ct,...dt],currentFolderId:lt==null?void 0:lt.id,overrideLabel:br,handleClick:jt,isActivable:mt?Vt:Dt,isActionBarOpen:tt,isMoveModalOpen:rt==="move",onMoveCancel:Lt,onMoveSuccess:Mt,isDeleteModalOpen:rt==="delete",onDeleteCancel:Gt,onDeleteSuccess:zt,isPublishModalOpen:rt==="publish",onPublishCancel:Ut,onPublishSuccess:$t,isEditFolderOpen:rt==="edit_folder",onEditFolderCancel:Yt,onEditFolderSuccess:Bt,isEditResourceOpen:rt==="edit_resource",onEditResourceCancel:Xt,onEditResourceSuccess:Zt,isShareResourceOpen:rt==="share",onShareResourceCancel:cr,onShareResourceSuccess:rr,isExportModalOpen:rt==="export",onExportCancel:ur,onExportSuccess:mr,onClearActionBar:Ht}}function AccessControl({resourceRights:tt,roleExpected:et,action:rt,children:nt,renderWhenForbidden:st}){const{t:ot}=useTranslation(),{overrideLabel:at}=useActionBar(),{visible:lt}=useAccessControl({roles:et,rights:tt,action:rt==null?void 0:rt.id}),{setResourceActionDisable:ut}=useStoreActions(),ct=useIsTrash();return lt?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:nt}):st?st():ct&&!lt?jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",onClick:()=>{ut(!0)},children:ot(at(rt))}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}const PublishModal$1=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>PublishModal),void 0)),UpdateModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ResourceModal),void 0)),DeleteModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>DeleteModal$1),void 0)),MoveModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>MoveModal$1),void 0)),FolderModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FolderModal$2),void 0)),ExportModal$2=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>ExportModal$1),void 0));function ActionBarContainer(){const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation(),{actions:rt,selectedElement:nt,isMoveModalOpen:st,isDeleteModalOpen:ot,isPublishModalOpen:at,isActionBarOpen:lt,isEditFolderOpen:ut,overrideLabel:ct,onEditFolderCancel:dt,onEditFolderSuccess:ht,isEditResourceOpen:mt,onEditResourceCancel:xt,onEditResourceSuccess:yt,isShareResourceOpen:vt,onShareResourceCancel:Et,onShareResourceSuccess:bt,isExportModalOpen:St,onExportCancel:wt,onExportSuccess:Rt,onMoveCancel:Ct,onMoveSuccess:Pt,onDeleteCancel:It,onDeleteSuccess:jt,onPublishCancel:Dt,onPublishSuccess:Vt,isActivable:Ft,handleClick:Ht}=useActionBar(),Lt=useSelectedResources()[0],Mt=useShareResource(tt),zt=useUpdateResource(tt),Gt=useTransition(lt,{from:{opacity:0,transform:"translateY(100%)"},enter:{opacity:1,transform:"translateY(0)"},leave:{opacity:0,transform:"translateY(100%)"}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Gt(($t,Ut)=>Ut&&jsxRuntimeExports.jsx(animated.div,{className:"position-fixed bottom-0 start-0 end-0",style:{...$t,zIndex:4},children:jsxRuntimeExports.jsx(ActionBar$1,{children:rt==null?void 0:rt.filter(Bt=>Bt.available&&Bt.target==="actionbar").map(Bt=>Ft(Bt)&&jsxRuntimeExports.jsx(AccessControl,{resourceRights:nt,roleExpected:Bt.right,action:Bt,children:jsxRuntimeExports.jsx(Button,{id:Bt.id,type:"button",color:"primary",variant:"filled",onClick:()=>{Ht(Bt)},children:et(ct(Bt))},Bt.id)},Bt.id))})})),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:[st&&jsxRuntimeExports.jsx(MoveModal$2,{isOpen:st,onCancel:Ct,onSuccess:Pt}),ot&&jsxRuntimeExports.jsx(DeleteModal$2,{isOpen:ot,onCancel:It,onSuccess:jt}),at&&Lt&&jsxRuntimeExports.jsx(PublishModal$1,{isOpen:at,resourceId:Lt.assetId,onCancel:Dt,onSuccess:Vt}),ut&&jsxRuntimeExports.jsx(FolderModal,{edit:!0,isOpen:ut,onCancel:dt,onSuccess:ht}),mt&&Lt&&jsxRuntimeExports.jsx(UpdateModal,{mode:"update",isOpen:mt,resourceId:Lt.assetId,updateResource:zt,onCancel:xt,onSuccess:yt,children:($t,Ut,Bt,Yt,Zt)=>tt==="blog"&&isActionAvailable("createPublic",rt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:tt,isUpdating:Ut,resource:$t,watch:Bt,setValue:Yt,register:Zt})}),vt&&Lt&&jsxRuntimeExports.jsx(ShareResourceModal,{isOpen:vt,shareResource:Mt,shareOptions:{resourceCreatorId:Lt.creatorId,resourceId:Lt.assetId,resourceRights:Lt.rights},onCancel:Et,onSuccess:bt,children:tt==="blog"?jsxRuntimeExports.jsx(ShareBlog,{resourceId:Lt.assetId,updateResource:zt}):null}),St&&Lt&&jsxRuntimeExports.jsx(ExportModal$2,{isOpen:St,onCancel:wt,onSuccess:Rt})]})]})}const ActionBarContainer$1=Object.freeze(Object.defineProperty({__proto__:null,default:ActionBarContainer},Symbol.toStringTag,{value:"Module"}));function DisableModal({isOpen:tt,onCancel:et=()=>({})}){const{t:rt}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:et,id:"trash_action_disable_resource",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:()=>et(),children:rt("explorer.trash.action.modal.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:rt("explorer.trash.action.modal.text")})}),jsxRuntimeExports.jsx(Modal.Footer,{children:jsxRuntimeExports.jsx(Button,{color:"primary",onClick:et,type:"button",variant:"outline",children:rt("close")})})]}),document.getElementById("portal"))}const DisableModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:DisableModal},Symbol.toStringTag,{value:"Module"}));function TrashModal({isOpen:tt,onCancel:et=()=>({})}){const{t:rt}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:et,id:"trash_resource",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:()=>et(),children:rt("explorer.trash.modal.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:rt("explorer.trash.modal.text")})}),jsxRuntimeExports.jsx(Modal.Footer,{children:jsxRuntimeExports.jsx(Button,{color:"primary",onClick:et,type:"button",variant:"outline",children:rt("close")})})]}),document.getElementById("portal"))}const TrashModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:TrashModal},Symbol.toStringTag,{value:"Module"})),OnboardingModal=Object.freeze(Object.defineProperty({__proto__:null,default:OnboardingModal$2},Symbol.toStringTag,{value:"Module"})),illuBlog="/assets/js/ode-explorer/illu-blog.svg",illuBlog$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuBlog},Symbol.toStringTag,{value:"Module"})),illuCollaborativeeditor="/assets/js/ode-explorer/illu-pad.svg",illuCollaborativeeditor$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuCollaborativeeditor},Symbol.toStringTag,{value:"Module"})),illuCollaborativewall="/assets/js/ode-explorer/illu-collaborativewall.svg",illuCollaborativewall$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuCollaborativewall},Symbol.toStringTag,{value:"Module"})),illuExercizer="/assets/js/ode-explorer/illu-exercizer.svg",illuExercizer$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuExercizer},Symbol.toStringTag,{value:"Module"})),illuMindmap="/assets/js/ode-explorer/illu-mindmap.svg",illuMindmap$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuMindmap},Symbol.toStringTag,{value:"Module"})),illuPad="/assets/js/ode-explorer/illu-pad.svg",illuPad$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuPad},Symbol.toStringTag,{value:"Module"})),illuScrapbook="/assets/js/ode-explorer/illu-scrapbook.svg",illuScrapbook$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuScrapbook},Symbol.toStringTag,{value:"Module"})),illuTimeline="/assets/js/ode-explorer/illu-timeline.svg",illuTimeline$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTimeline},Symbol.toStringTag,{value:"Module"})),illuTimelinegenerator="/assets/js/ode-explorer/illu-timelinegenerator.svg",illuTimelinegenerator$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTimelinegenerator},Symbol.toStringTag,{value:"Module"})),illuWiki="/assets/js/ode-explorer/illu-wiki.svg",illuWiki$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuWiki},Symbol.toStringTag,{value:"Module"})),ResourceModal=Object.freeze(Object.defineProperty({__proto__:null,default:ResourceModal$1},Symbol.toStringTag,{value:"Module"})),imageLibrary$2="/assets/js/ode-explorer/image-library.svg",imageLibrary$3=Object.freeze(Object.defineProperty({__proto__:null,default:imageLibrary$2},Symbol.toStringTag,{value:"Module"})),imageLibrary="/assets/js/ode-explorer/image-library2.svg",imageLibrary$1=Object.freeze(Object.defineProperty({__proto__:null,default:imageLibrary},Symbol.toStringTag,{value:"Module"})),PublishModal=Object.freeze(Object.defineProperty({__proto__:null,default:PublishModal$2},Symbol.toStringTag,{value:"Module"}));function useDeleteModal({onSuccess:tt}){const et=useDelete(),rt=useTrash(),nt=useIsTrash();async function st(){try{nt?await et.mutate():await rt.mutate(),tt==null||tt()}catch(ot){console.error(ot)}}return{isTrashFolder:nt,onDelete:st}}function DeleteModal({isOpen:tt,onSuccess:et=()=>({}),onCancel:rt=()=>({})}){const{t:nt}=useTranslation(),{isTrashFolder:st,onDelete:ot}=useDeleteModal({onSuccess:et});return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"deleteModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:nt(st?"explorer.delete.title":"explorer.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:nt(st?"explorer.delete.subtitle":"explorer.trash.subtitle")})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"danger",onClick:ot,type:"button",variant:"filled",children:nt(st?"explorer.delete":"explorer.trash")})]})]}),document.getElementById("portal"))}const DeleteModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:DeleteModal},Symbol.toStringTag,{value:"Module"}));function useMoveModal({onSuccess:tt}){const[et,rt]=reactExports.useState(),nt=useQueryClient(),st=useMoveItem(),ot=useSelectedFolders(),at=useSelectedResources(),lt=useTreeData(),{fetchTreeData:ut}=useStoreActions();async function ct(){try{if(!et)throw new Error("explorer.move.selection.empty");await st.mutate(et),await(tt==null?void 0:tt())}catch(ht){console.error(ht)}}const dt=ht=>{var xt,yt;const mt=getAncestors(lt,ht);for(const vt of ot)if(ht===vt.id||ht===vt.parentId||(xt=vt.childrenIds)!=null&&xt.includes(ht)||mt.includes(vt.id))return!1;for(const vt of at)if(ht===((vt==null?void 0:vt.folderIds)&&vt.folderIds[0])||((yt=vt==null?void 0:vt.folderIds)==null?void 0:yt.length)===0&&ht==="default")return!1;return!0};return{treeData:lt,disableSubmit:!et,handleTreeItemSelect:ht=>{dt(ht)?rt(ht):rt(void 0)},handleOnTreeItemUnfold:ht=>{var yt,vt;const mt=findNodeById(lt,ht),xt=(yt=mt==null?void 0:mt.children)==null?void 0:yt.some(Et=>{var bt;return Array.isArray(Et==null?void 0:Et.children)&&((bt=Et.children)==null?void 0:bt.length)>0});(vt=mt==null?void 0:mt.children)==null||vt.forEach(Et=>{xt||ut(Et.id,nt)})},onMove:()=>ct()}}function MoveModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{appCode:nt}=useEdificeClient(),{t:st}=useTranslation(),{treeData:ot,handleTreeItemSelect:at,handleOnTreeItemUnfold:lt,onMove:ut,disableSubmit:ct}=useMoveModal({onSuccess:et}),dt={...ot,name:st("explorer.filters.mine",{ns:nt})};return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"moveModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:st("explorer.move.title")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:st("explorer.move.subtitle")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx(TreeView,{data:dt,onTreeItemClick:at,onTreeItemUnfold:lt})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:ut,type:"button",variant:"filled",disabled:ct,children:st("explorer.move")})]})]}),document.getElementById("portal"))}const MoveModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:MoveModal},Symbol.toStringTag,{value:"Module"})),useExportModal=tt=>{const et=useSelectedResources(),rt=useSearchParams(),nt=useToast(),{t:st}=useTranslation();return{handleExportClick:()=>{et.length?(goToExport({searchParams:rt,assetId:et[0].assetId}),tt()):nt.error(st("explorer.error.noResourceSelected"))}}};function ExportModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{handleExportClick:nt}=useExportModal(et),{t:st}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"exportModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:st("explorer.export.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsxs("ul",{children:[jsxRuntimeExports.jsx("li",{children:st("explorer.export.body.info.1")}),jsxRuntimeExports.jsx("li",{children:st("explorer.export.body.info.2")}),jsxRuntimeExports.jsx("li",{children:st("explorer.export.body.info.3")})]}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:st("explorer.export.body.warning")})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:nt,type:"button",variant:"filled",children:st("explorer.actions.export")})]})]}),document.getElementById("portal"))}const ExportModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:ExportModal},Symbol.toStringTag,{value:"Module"}))});export default s3();