ode-explorer 2.3.0-develop-pedago.202510211804 → 2.3.0-develop-pedago.202510291701

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
@@ -44,10 +44,10 @@ Error generating stack: `+ot.message+`
44
44
  Press space again to drop the item in its new position, or press escape to cancel.
45
45
  `},defaultAnnouncements={onDragStart(tt){let{active:et}=tt;return"Picked up draggable item "+et.id+"."},onDragOver(tt){let{active:et,over:rt}=tt;return rt?"Draggable item "+et.id+" was moved over droppable area "+rt.id+".":"Draggable item "+et.id+" is no longer over a droppable area."},onDragEnd(tt){let{active:et,over:rt}=tt;return rt?"Draggable item "+et.id+" was dropped over droppable area "+rt.id:"Draggable item "+et.id+" was dropped."},onDragCancel(tt){let{active:et}=tt;return"Dragging was cancelled. Draggable item "+et.id+" was dropped."}};function Accessibility(tt){let{announcements:et=defaultAnnouncements,container:rt,hiddenTextDescribedById:st,screenReaderInstructions:nt=defaultScreenReaderInstructions}=tt;const{announce:ot,announcement:at}=useAnnouncement(),lt=useUniqueId("DndLiveRegion"),[ut,ct]=reactExports.useState(!1);if(reactExports.useEffect(()=>{ct(!0)},[]),useDndMonitor(reactExports.useMemo(()=>({onDragStart(ht){let{active:ft}=ht;ot(et.onDragStart({active:ft}))},onDragMove(ht){let{active:ft,over:xt}=ht;et.onDragMove&&ot(et.onDragMove({active:ft,over:xt}))},onDragOver(ht){let{active:ft,over:xt}=ht;ot(et.onDragOver({active:ft,over:xt}))},onDragEnd(ht){let{active:ft,over:xt}=ht;ot(et.onDragEnd({active:ft,over:xt}))},onDragCancel(ht){let{active:ft,over:xt}=ht;ot(et.onDragCancel({active:ft,over:xt}))}}),[ot,et])),!ut)return null;const dt=React$4.createElement(React$4.Fragment,null,React$4.createElement(HiddenText,{id:st,value:nt.draggable}),React$4.createElement(LiveRegion,{id:lt,announcement:at}));return rt?reactDomExports.createPortal(dt,rt):dt}var Action;(function(tt){tt.DragStart="dragStart",tt.DragMove="dragMove",tt.DragEnd="dragEnd",tt.DragCancel="dragCancel",tt.DragOver="dragOver",tt.RegisterDroppable="registerDroppable",tt.SetDroppableDisabled="setDroppableDisabled",tt.UnregisterDroppable="unregisterDroppable"})(Action||(Action={}));function noop$3(){}function useSensor(tt,et){return reactExports.useMemo(()=>({sensor:tt,options:et??{}}),[tt,et])}function useSensors(){for(var tt=arguments.length,et=new Array(tt),rt=0;rt<tt;rt++)et[rt]=arguments[rt];return reactExports.useMemo(()=>[...et].filter(st=>st!=null),[...et])}const defaultCoordinates=Object.freeze({x:0,y:0});function sortCollisionsDesc(tt,et){let{data:{value:rt}}=tt,{data:{value:st}}=et;return st-rt}function getFirstCollision(tt,et){if(!tt||tt.length===0)return null;const[rt]=tt;return rt[et]}function getIntersectionRatio(tt,et){const rt=Math.max(et.top,tt.top),st=Math.max(et.left,tt.left),nt=Math.min(et.left+et.width,tt.left+tt.width),ot=Math.min(et.top+et.height,tt.top+tt.height),at=nt-st,lt=ot-rt;if(st<nt&&rt<ot){const ut=et.width*et.height,ct=tt.width*tt.height,dt=at*lt,ht=dt/(ut+ct-dt);return Number(ht.toFixed(4))}return 0}const rectIntersection=tt=>{let{collisionRect:et,droppableRects:rt,droppableContainers:st}=tt;const nt=[];for(const ot of st){const{id:at}=ot,lt=rt.get(at);if(lt){const ut=getIntersectionRatio(lt,et);ut>0&&nt.push({id:at,data:{droppableContainer:ot,value:ut}})}}return nt.sort(sortCollisionsDesc)};function adjustScale(tt,et,rt){return{...tt,scaleX:et&&rt?et.width/rt.width:1,scaleY:et&&rt?et.height/rt.height:1}}function getRectDelta(tt,et){return tt&&et?{x:tt.left-et.left,y:tt.top-et.top}:defaultCoordinates}function createRectAdjustmentFn(tt){return function(rt){for(var st=arguments.length,nt=new Array(st>1?st-1:0),ot=1;ot<st;ot++)nt[ot-1]=arguments[ot];return nt.reduce((at,lt)=>({...at,top:at.top+tt*lt.y,bottom:at.bottom+tt*lt.y,left:at.left+tt*lt.x,right:at.right+tt*lt.x}),{...rt})}}const getAdjustedRect=createRectAdjustmentFn(1);function parseTransform(tt){if(tt.startsWith("matrix3d(")){const et=tt.slice(9,-1).split(/, /);return{x:+et[12],y:+et[13],scaleX:+et[0],scaleY:+et[5]}}else if(tt.startsWith("matrix(")){const et=tt.slice(7,-1).split(/, /);return{x:+et[4],y:+et[5],scaleX:+et[0],scaleY:+et[3]}}return null}function inverseTransform(tt,et,rt){const st=parseTransform(et);if(!st)return tt;const{scaleX:nt,scaleY:ot,x:at,y:lt}=st,ut=tt.left-at-(1-nt)*parseFloat(rt),ct=tt.top-lt-(1-ot)*parseFloat(rt.slice(rt.indexOf(" ")+1)),dt=nt?tt.width/nt:tt.width,ht=ot?tt.height/ot:tt.height;return{width:dt,height:ht,top:ct,right:ut+dt,bottom:ct+ht,left:ut}}const defaultOptions$1={ignoreTransform:!1};function getClientRect(tt,et){et===void 0&&(et=defaultOptions$1);let rt=tt.getBoundingClientRect();if(et.ignoreTransform){const{transform:ct,transformOrigin:dt}=getWindow$1(tt).getComputedStyle(tt);ct&&(rt=inverseTransform(rt,ct,dt))}const{top:st,left:nt,width:ot,height:at,bottom:lt,right:ut}=rt;return{top:st,left:nt,width:ot,height:at,bottom:lt,right:ut}}function getTransformAgnosticClientRect(tt){return getClientRect(tt,{ignoreTransform:!0})}function getWindowClientRect(tt){const et=tt.innerWidth,rt=tt.innerHeight;return{top:0,left:0,right:et,bottom:rt,width:et,height:rt}}function isFixed(tt,et){return et===void 0&&(et=getWindow$1(tt).getComputedStyle(tt)),et.position==="fixed"}function isScrollable(tt,et){et===void 0&&(et=getWindow$1(tt).getComputedStyle(tt));const rt=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(nt=>{const ot=et[nt];return typeof ot=="string"?rt.test(ot):!1})}function getScrollableAncestors(tt,et){const rt=[];function st(nt){if(et!=null&&rt.length>=et||!nt)return rt;if(isDocument$1(nt)&&nt.scrollingElement!=null&&!rt.includes(nt.scrollingElement))return rt.push(nt.scrollingElement),rt;if(!isHTMLElement$1(nt)||isSVGElement(nt)||rt.includes(nt))return rt;const ot=getWindow$1(tt).getComputedStyle(nt);return nt!==tt&&isScrollable(nt,ot)&&rt.push(nt),isFixed(nt,ot)?rt:st(nt.parentNode)}return tt?st(tt):rt}function getFirstScrollableAncestor(tt){const[et]=getScrollableAncestors(tt,1);return et??null}function getScrollableElement(tt){return!canUseDOM||!tt?null:isWindow(tt)?tt:isNode$1(tt)?isDocument$1(tt)||tt===getOwnerDocument(tt).scrollingElement?window:isHTMLElement$1(tt)?tt:null:null}function getScrollXCoordinate(tt){return isWindow(tt)?tt.scrollX:tt.scrollLeft}function getScrollYCoordinate(tt){return isWindow(tt)?tt.scrollY:tt.scrollTop}function getScrollCoordinates(tt){return{x:getScrollXCoordinate(tt),y:getScrollYCoordinate(tt)}}var Direction;(function(tt){tt[tt.Forward=1]="Forward",tt[tt.Backward=-1]="Backward"})(Direction||(Direction={}));function isDocumentScrollingElement(tt){return!canUseDOM||!tt?!1:tt===document.scrollingElement}function getScrollPosition(tt){const et={x:0,y:0},rt=isDocumentScrollingElement(tt)?{height:window.innerHeight,width:window.innerWidth}:{height:tt.clientHeight,width:tt.clientWidth},st={x:tt.scrollWidth-rt.width,y:tt.scrollHeight-rt.height},nt=tt.scrollTop<=et.y,ot=tt.scrollLeft<=et.x,at=tt.scrollTop>=st.y,lt=tt.scrollLeft>=st.x;return{isTop:nt,isLeft:ot,isBottom:at,isRight:lt,maxScroll:st,minScroll:et}}const defaultThreshold={x:.2,y:.2};function getScrollDirectionAndSpeed(tt,et,rt,st,nt){let{top:ot,left:at,right:lt,bottom:ut}=rt;st===void 0&&(st=10),nt===void 0&&(nt=defaultThreshold);const{isTop:ct,isBottom:dt,isLeft:ht,isRight:ft}=getScrollPosition(tt),xt={x:0,y:0},yt={x:0,y:0},vt={height:et.height*nt.y,width:et.width*nt.x};return!ct&&ot<=et.top+vt.height?(xt.y=Direction.Backward,yt.y=st*Math.abs((et.top+vt.height-ot)/vt.height)):!dt&&ut>=et.bottom-vt.height&&(xt.y=Direction.Forward,yt.y=st*Math.abs((et.bottom-vt.height-ut)/vt.height)),!ft&&lt>=et.right-vt.width?(xt.x=Direction.Forward,yt.x=st*Math.abs((et.right-vt.width-lt)/vt.width)):!ht&&at<=et.left+vt.width&&(xt.x=Direction.Backward,yt.x=st*Math.abs((et.left+vt.width-at)/vt.width)),{direction:xt,speed:yt}}function getScrollElementRect(tt){if(tt===document.scrollingElement){const{innerWidth:ot,innerHeight:at}=window;return{top:0,left:0,right:ot,bottom:at,width:ot,height:at}}const{top:et,left:rt,right:st,bottom:nt}=tt.getBoundingClientRect();return{top:et,left:rt,right:st,bottom:nt,width:tt.clientWidth,height:tt.clientHeight}}function getScrollOffsets(tt){return tt.reduce((et,rt)=>add(et,getScrollCoordinates(rt)),defaultCoordinates)}function getScrollXOffset(tt){return tt.reduce((et,rt)=>et+getScrollXCoordinate(rt),0)}function getScrollYOffset(tt){return tt.reduce((et,rt)=>et+getScrollYCoordinate(rt),0)}function scrollIntoViewIfNeeded(tt,et){if(et===void 0&&(et=getClientRect),!tt)return;const{top:rt,left:st,bottom:nt,right:ot}=et(tt);getFirstScrollableAncestor(tt)&&(nt<=0||ot<=0||rt>=window.innerHeight||st>=window.innerWidth)&&tt.scrollIntoView({block:"center",inline:"center"})}const properties$1=[["x",["left","right"],getScrollXOffset],["y",["top","bottom"],getScrollYOffset]];class Rect{constructor(et,rt){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const st=getScrollableAncestors(rt),nt=getScrollOffsets(st);this.rect={...et},this.width=et.width,this.height=et.height;for(const[ot,at,lt]of properties$1)for(const ut of at)Object.defineProperty(this,ut,{get:()=>{const ct=lt(st),dt=nt[ot]-ct;return this.rect[ut]+dt},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Listeners{constructor(et){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(rt=>{var st;return(st=this.target)==null?void 0:st.removeEventListener(...rt)})},this.target=et}add(et,rt,st){var nt;(nt=this.target)==null||nt.addEventListener(et,rt,st),this.listeners.push([et,rt,st])}}function getEventListenerTarget(tt){const{EventTarget:et}=getWindow$1(tt);return tt instanceof et?tt:getOwnerDocument(tt)}function hasExceededDistance(tt,et){const rt=Math.abs(tt.x),st=Math.abs(tt.y);return typeof et=="number"?Math.sqrt(rt**2+st**2)>et:"x"in et&&"y"in et?rt>et.x&&st>et.y:"x"in et?rt>et.x:"y"in et?st>et.y:!1}var EventName;(function(tt){tt.Click="click",tt.DragStart="dragstart",tt.Keydown="keydown",tt.ContextMenu="contextmenu",tt.Resize="resize",tt.SelectionChange="selectionchange",tt.VisibilityChange="visibilitychange"})(EventName||(EventName={}));function preventDefault(tt){tt.preventDefault()}function stopPropagation(tt){tt.stopPropagation()}var KeyboardCode;(function(tt){tt.Space="Space",tt.Down="ArrowDown",tt.Right="ArrowRight",tt.Left="ArrowLeft",tt.Up="ArrowUp",tt.Esc="Escape",tt.Enter="Enter",tt.Tab="Tab"})(KeyboardCode||(KeyboardCode={}));const defaultKeyboardCodes={start:[KeyboardCode.Space,KeyboardCode.Enter],cancel:[KeyboardCode.Esc],end:[KeyboardCode.Space,KeyboardCode.Enter,KeyboardCode.Tab]},defaultKeyboardCoordinateGetter=(tt,et)=>{let{currentCoordinates:rt}=et;switch(tt.code){case KeyboardCode.Right:return{...rt,x:rt.x+25};case KeyboardCode.Left:return{...rt,x:rt.x-25};case KeyboardCode.Down:return{...rt,y:rt.y+25};case KeyboardCode.Up:return{...rt,y:rt.y-25}}};class KeyboardSensor{constructor(et){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=et;const{event:{target:rt}}=et;this.props=et,this.listeners=new Listeners(getOwnerDocument(rt)),this.windowListeners=new Listeners(getWindow$1(rt)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(EventName.Resize,this.handleCancel),this.windowListeners.add(EventName.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(EventName.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:et,onStart:rt}=this.props,st=et.node.current;st&&scrollIntoViewIfNeeded(st),rt(defaultCoordinates)}handleKeyDown(et){if(isKeyboardEvent(et)){const{active:rt,context:st,options:nt}=this.props,{keyboardCodes:ot=defaultKeyboardCodes,coordinateGetter:at=defaultKeyboardCoordinateGetter,scrollBehavior:lt="smooth"}=nt,{code:ut}=et;if(ot.end.includes(ut)){this.handleEnd(et);return}if(ot.cancel.includes(ut)){this.handleCancel(et);return}const{collisionRect:ct}=st.current,dt=ct?{x:ct.left,y:ct.top}:defaultCoordinates;this.referenceCoordinates||(this.referenceCoordinates=dt);const ht=at(et,{active:rt,context:st.current,currentCoordinates:dt});if(ht){const ft=subtract(ht,dt),xt={x:0,y:0},{scrollableAncestors:yt}=st.current;for(const vt of yt){const Et=et.code,{isTop:wt,isRight:bt,isLeft:St,isBottom:Rt,maxScroll:Ct,minScroll:It}=getScrollPosition(vt),jt=getScrollElementRect(vt),Pt={x:Math.min(Et===KeyboardCode.Right?jt.right-jt.width/2:jt.right,Math.max(Et===KeyboardCode.Right?jt.left:jt.left+jt.width/2,ht.x)),y:Math.min(Et===KeyboardCode.Down?jt.bottom-jt.height/2:jt.bottom,Math.max(Et===KeyboardCode.Down?jt.top:jt.top+jt.height/2,ht.y))},Ot=Et===KeyboardCode.Right&&!bt||Et===KeyboardCode.Left&&!St,Ut=Et===KeyboardCode.Down&&!Rt||Et===KeyboardCode.Up&&!wt;if(Ot&&Pt.x!==ht.x){const Nt=vt.scrollLeft+ft.x,Ht=Et===KeyboardCode.Right&&Nt<=Ct.x||Et===KeyboardCode.Left&&Nt>=It.x;if(Ht&&!ft.y){vt.scrollTo({left:Nt,behavior:lt});return}Ht?xt.x=vt.scrollLeft-Nt:xt.x=Et===KeyboardCode.Right?vt.scrollLeft-Ct.x:vt.scrollLeft-It.x,xt.x&&vt.scrollBy({left:-xt.x,behavior:lt});break}else if(Ut&&Pt.y!==ht.y){const Nt=vt.scrollTop+ft.y,Ht=Et===KeyboardCode.Down&&Nt<=Ct.y||Et===KeyboardCode.Up&&Nt>=It.y;if(Ht&&!ft.x){vt.scrollTo({top:Nt,behavior:lt});return}Ht?xt.y=vt.scrollTop-Nt:xt.y=Et===KeyboardCode.Down?vt.scrollTop-Ct.y:vt.scrollTop-It.y,xt.y&&vt.scrollBy({top:-xt.y,behavior:lt});break}}this.handleMove(et,add(subtract(ht,this.referenceCoordinates),xt))}}}handleMove(et,rt){const{onMove:st}=this.props;et.preventDefault(),st(rt)}handleEnd(et){const{onEnd:rt}=this.props;et.preventDefault(),this.detach(),rt()}handleCancel(et){const{onCancel:rt}=this.props;et.preventDefault(),this.detach(),rt()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}KeyboardSensor.activators=[{eventName:"onKeyDown",handler:(tt,et,rt)=>{let{keyboardCodes:st=defaultKeyboardCodes,onActivation:nt}=et,{active:ot}=rt;const{code:at}=tt.nativeEvent;if(st.start.includes(at)){const lt=ot.activatorNode.current;return lt&&tt.target!==lt?!1:(tt.preventDefault(),nt==null||nt({event:tt.nativeEvent}),!0)}return!1}}];function isDistanceConstraint(tt){return!!(tt&&"distance"in tt)}function isDelayConstraint(tt){return!!(tt&&"delay"in tt)}class AbstractPointerSensor{constructor(et,rt,st){var nt;st===void 0&&(st=getEventListenerTarget(et.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=et,this.events=rt;const{event:ot}=et,{target:at}=ot;this.props=et,this.events=rt,this.document=getOwnerDocument(at),this.documentListeners=new Listeners(this.document),this.listeners=new Listeners(st),this.windowListeners=new Listeners(getWindow$1(at)),this.initialCoordinates=(nt=getEventCoordinates(ot))!=null?nt:defaultCoordinates,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:et,props:{options:{activationConstraint:rt,bypassActivationConstraint:st}}}=this;if(this.listeners.add(et.move.name,this.handleMove,{passive:!1}),this.listeners.add(et.end.name,this.handleEnd),et.cancel&&this.listeners.add(et.cancel.name,this.handleCancel),this.windowListeners.add(EventName.Resize,this.handleCancel),this.windowListeners.add(EventName.DragStart,preventDefault),this.windowListeners.add(EventName.VisibilityChange,this.handleCancel),this.windowListeners.add(EventName.ContextMenu,preventDefault),this.documentListeners.add(EventName.Keydown,this.handleKeydown),rt){if(st!=null&&st({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(isDelayConstraint(rt)){this.timeoutId=setTimeout(this.handleStart,rt.delay),this.handlePending(rt);return}if(isDistanceConstraint(rt)){this.handlePending(rt);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(et,rt){const{active:st,onPending:nt}=this.props;nt(st,et,this.initialCoordinates,rt)}handleStart(){const{initialCoordinates:et}=this,{onStart:rt}=this.props;et&&(this.activated=!0,this.documentListeners.add(EventName.Click,stopPropagation,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(EventName.SelectionChange,this.removeTextSelection),rt(et))}handleMove(et){var rt;const{activated:st,initialCoordinates:nt,props:ot}=this,{onMove:at,options:{activationConstraint:lt}}=ot;if(!nt)return;const ut=(rt=getEventCoordinates(et))!=null?rt:defaultCoordinates,ct=subtract(nt,ut);if(!st&&lt){if(isDistanceConstraint(lt)){if(lt.tolerance!=null&&hasExceededDistance(ct,lt.tolerance))return this.handleCancel();if(hasExceededDistance(ct,lt.distance))return this.handleStart()}if(isDelayConstraint(lt)&&hasExceededDistance(ct,lt.tolerance))return this.handleCancel();this.handlePending(lt,ct);return}et.cancelable&&et.preventDefault(),at(ut)}handleEnd(){const{onAbort:et,onEnd:rt}=this.props;this.detach(),this.activated||et(this.props.active),rt()}handleCancel(){const{onAbort:et,onCancel:rt}=this.props;this.detach(),this.activated||et(this.props.active),rt()}handleKeydown(et){et.code===KeyboardCode.Esc&&this.handleCancel()}removeTextSelection(){var et;(et=this.document.getSelection())==null||et.removeAllRanges()}}const events$2={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class PointerSensor extends AbstractPointerSensor{constructor(et){const{event:rt}=et,st=getOwnerDocument(rt.target);super(et,events$2,st)}}PointerSensor.activators=[{eventName:"onPointerDown",handler:(tt,et)=>{let{nativeEvent:rt}=tt,{onActivation:st}=et;return!rt.isPrimary||rt.button!==0?!1:(st==null||st({event:rt}),!0)}}];const events$1$1={move:{name:"mousemove"},end:{name:"mouseup"}};var MouseButton;(function(tt){tt[tt.RightClick=2]="RightClick"})(MouseButton||(MouseButton={}));class MouseSensor extends AbstractPointerSensor{constructor(et){super(et,events$1$1,getOwnerDocument(et.event.target))}}MouseSensor.activators=[{eventName:"onMouseDown",handler:(tt,et)=>{let{nativeEvent:rt}=tt,{onActivation:st}=et;return rt.button===MouseButton.RightClick?!1:(st==null||st({event:rt}),!0)}}];const events$2$1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class TouchSensor extends AbstractPointerSensor{constructor(et){super(et,events$2$1)}static setup(){return window.addEventListener(events$2$1.move.name,et,{capture:!1,passive:!1}),function(){window.removeEventListener(events$2$1.move.name,et)};function et(){}}}TouchSensor.activators=[{eventName:"onTouchStart",handler:(tt,et)=>{let{nativeEvent:rt}=tt,{onActivation:st}=et;const{touches:nt}=rt;return nt.length>1?!1:(st==null||st({event:rt}),!0)}}];var AutoScrollActivator;(function(tt){tt[tt.Pointer=0]="Pointer",tt[tt.DraggableRect=1]="DraggableRect"})(AutoScrollActivator||(AutoScrollActivator={}));var TraversalOrder;(function(tt){tt[tt.TreeOrder=0]="TreeOrder",tt[tt.ReversedTreeOrder=1]="ReversedTreeOrder"})(TraversalOrder||(TraversalOrder={}));function useAutoScroller(tt){let{acceleration:et,activator:rt=AutoScrollActivator.Pointer,canScroll:st,draggingRect:nt,enabled:ot,interval:at=5,order:lt=TraversalOrder.TreeOrder,pointerCoordinates:ut,scrollableAncestors:ct,scrollableAncestorRects:dt,delta:ht,threshold:ft}=tt;const xt=useScrollIntent({delta:ht,disabled:!ot}),[yt,vt]=useInterval(),Et=reactExports.useRef({x:0,y:0}),wt=reactExports.useRef({x:0,y:0}),bt=reactExports.useMemo(()=>{switch(rt){case AutoScrollActivator.Pointer:return ut?{top:ut.y,bottom:ut.y,left:ut.x,right:ut.x}:null;case AutoScrollActivator.DraggableRect:return nt}},[rt,nt,ut]),St=reactExports.useRef(null),Rt=reactExports.useCallback(()=>{const It=St.current;if(!It)return;const jt=Et.current.x*wt.current.x,Pt=Et.current.y*wt.current.y;It.scrollBy(jt,Pt)},[]),Ct=reactExports.useMemo(()=>lt===TraversalOrder.TreeOrder?[...ct].reverse():ct,[lt,ct]);reactExports.useEffect(()=>{if(!ot||!ct.length||!bt){vt();return}for(const It of Ct){if((st==null?void 0:st(It))===!1)continue;const jt=ct.indexOf(It),Pt=dt[jt];if(!Pt)continue;const{direction:Ot,speed:Ut}=getScrollDirectionAndSpeed(It,Pt,bt,et,ft);for(const Nt of["x","y"])xt[Nt][Ot[Nt]]||(Ut[Nt]=0,Ot[Nt]=0);if(Ut.x>0||Ut.y>0){vt(),St.current=It,yt(Rt,at),Et.current=Ut,wt.current=Ot;return}}Et.current={x:0,y:0},wt.current={x:0,y:0},vt()},[et,Rt,st,vt,ot,at,JSON.stringify(bt),JSON.stringify(xt),yt,ct,Ct,dt,JSON.stringify(ft)])}const defaultScrollIntent={x:{[Direction.Backward]:!1,[Direction.Forward]:!1},y:{[Direction.Backward]:!1,[Direction.Forward]:!1}};function useScrollIntent(tt){let{delta:et,disabled:rt}=tt;const st=usePrevious(et);return useLazyMemo(nt=>{if(rt||!st||!nt)return defaultScrollIntent;const ot={x:Math.sign(et.x-st.x),y:Math.sign(et.y-st.y)};return{x:{[Direction.Backward]:nt.x[Direction.Backward]||ot.x===-1,[Direction.Forward]:nt.x[Direction.Forward]||ot.x===1},y:{[Direction.Backward]:nt.y[Direction.Backward]||ot.y===-1,[Direction.Forward]:nt.y[Direction.Forward]||ot.y===1}}},[rt,et,st])}function useCachedNode(tt,et){const rt=et!=null?tt.get(et):void 0,st=rt?rt.node.current:null;return useLazyMemo(nt=>{var ot;return et==null?null:(ot=st??nt)!=null?ot:null},[st,et])}function useCombineActivators(tt,et){return reactExports.useMemo(()=>tt.reduce((rt,st)=>{const{sensor:nt}=st,ot=nt.activators.map(at=>({eventName:at.eventName,handler:et(at.handler,st)}));return[...rt,...ot]},[]),[tt,et])}var MeasuringStrategy;(function(tt){tt[tt.Always=0]="Always",tt[tt.BeforeDragging=1]="BeforeDragging",tt[tt.WhileDragging=2]="WhileDragging"})(MeasuringStrategy||(MeasuringStrategy={}));var MeasuringFrequency;(function(tt){tt.Optimized="optimized"})(MeasuringFrequency||(MeasuringFrequency={}));const defaultValue$1=new Map;function useDroppableMeasuring(tt,et){let{dragging:rt,dependencies:st,config:nt}=et;const[ot,at]=reactExports.useState(null),{frequency:lt,measure:ut,strategy:ct}=nt,dt=reactExports.useRef(tt),ht=Et(),ft=useLatestValue(ht),xt=reactExports.useCallback(function(wt){wt===void 0&&(wt=[]),!ft.current&&at(bt=>bt===null?wt:bt.concat(wt.filter(St=>!bt.includes(St))))},[ft]),yt=reactExports.useRef(null),vt=useLazyMemo(wt=>{if(ht&&!rt)return defaultValue$1;if(!wt||wt===defaultValue$1||dt.current!==tt||ot!=null){const bt=new Map;for(let St of tt){if(!St)continue;if(ot&&ot.length>0&&!ot.includes(St.id)&&St.rect.current){bt.set(St.id,St.rect.current);continue}const Rt=St.node.current,Ct=Rt?new Rect(ut(Rt),Rt):null;St.rect.current=Ct,Ct&&bt.set(St.id,Ct)}return bt}return wt},[tt,ot,rt,ht,ut]);return reactExports.useEffect(()=>{dt.current=tt},[tt]),reactExports.useEffect(()=>{ht||xt()},[rt,ht]),reactExports.useEffect(()=>{ot&&ot.length>0&&at(null)},[JSON.stringify(ot)]),reactExports.useEffect(()=>{ht||typeof lt!="number"||yt.current!==null||(yt.current=setTimeout(()=>{xt(),yt.current=null},lt))},[lt,ht,xt,...st]),{droppableRects:vt,measureDroppableContainers:xt,measuringScheduled:ot!=null};function Et(){switch(ct){case MeasuringStrategy.Always:return!1;case MeasuringStrategy.BeforeDragging:return rt;default:return!rt}}}function useInitialValue(tt,et){return useLazyMemo(rt=>tt?rt||(typeof et=="function"?et(tt):tt):null,[et,tt])}function useInitialRect(tt,et){return useInitialValue(tt,et)}function useMutationObserver(tt){let{callback:et,disabled:rt}=tt;const st=useEvent(et),nt=reactExports.useMemo(()=>{if(rt||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:ot}=window;return new ot(st)},[st,rt]);return reactExports.useEffect(()=>()=>nt==null?void 0:nt.disconnect(),[nt]),nt}function useResizeObserver(tt){let{callback:et,disabled:rt}=tt;const st=useEvent(et),nt=reactExports.useMemo(()=>{if(rt||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:ot}=window;return new ot(st)},[rt]);return reactExports.useEffect(()=>()=>nt==null?void 0:nt.disconnect(),[nt]),nt}function defaultMeasure(tt){return new Rect(getClientRect(tt),tt)}function useRect(tt,et,rt){et===void 0&&(et=defaultMeasure);const[st,nt]=reactExports.useState(null);function ot(){nt(ut=>{if(!tt)return null;if(tt.isConnected===!1){var ct;return(ct=ut??rt)!=null?ct:null}const dt=et(tt);return JSON.stringify(ut)===JSON.stringify(dt)?ut:dt})}const at=useMutationObserver({callback(ut){if(tt)for(const ct of ut){const{type:dt,target:ht}=ct;if(dt==="childList"&&ht instanceof HTMLElement&&ht.contains(tt)){ot();break}}}}),lt=useResizeObserver({callback:ot});return useIsomorphicLayoutEffect$2(()=>{ot(),tt?(lt==null||lt.observe(tt),at==null||at.observe(document.body,{childList:!0,subtree:!0})):(lt==null||lt.disconnect(),at==null||at.disconnect())},[tt]),st}function useRectDelta(tt){const et=useInitialValue(tt);return getRectDelta(tt,et)}const defaultValue$1$1=[];function useScrollableAncestors(tt){const et=reactExports.useRef(tt),rt=useLazyMemo(st=>tt?st&&st!==defaultValue$1$1&&tt&&et.current&&tt.parentNode===et.current.parentNode?st:getScrollableAncestors(tt):defaultValue$1$1,[tt]);return reactExports.useEffect(()=>{et.current=tt},[tt]),rt}function useScrollOffsets(tt){const[et,rt]=reactExports.useState(null),st=reactExports.useRef(tt),nt=reactExports.useCallback(ot=>{const at=getScrollableElement(ot.target);at&&rt(lt=>lt?(lt.set(at,getScrollCoordinates(at)),new Map(lt)):null)},[]);return reactExports.useEffect(()=>{const ot=st.current;if(tt!==ot){at(ot);const lt=tt.map(ut=>{const ct=getScrollableElement(ut);return ct?(ct.addEventListener("scroll",nt,{passive:!0}),[ct,getScrollCoordinates(ct)]):null}).filter(ut=>ut!=null);rt(lt.length?new Map(lt):null),st.current=tt}return()=>{at(tt),at(ot)};function at(lt){lt.forEach(ut=>{const ct=getScrollableElement(ut);ct==null||ct.removeEventListener("scroll",nt)})}},[nt,tt]),reactExports.useMemo(()=>tt.length?et?Array.from(et.values()).reduce((ot,at)=>add(ot,at),defaultCoordinates):getScrollOffsets(tt):defaultCoordinates,[tt,et])}function useScrollOffsetsDelta(tt,et){et===void 0&&(et=[]);const rt=reactExports.useRef(null);return reactExports.useEffect(()=>{rt.current=null},et),reactExports.useEffect(()=>{const st=tt!==defaultCoordinates;st&&!rt.current&&(rt.current=tt),!st&&rt.current&&(rt.current=null)},[tt]),rt.current?subtract(tt,rt.current):defaultCoordinates}function useSensorSetup(tt){reactExports.useEffect(()=>{if(!canUseDOM)return;const et=tt.map(rt=>{let{sensor:st}=rt;return st.setup==null?void 0:st.setup()});return()=>{for(const rt of et)rt==null||rt()}},tt.map(et=>{let{sensor:rt}=et;return rt}))}function useSyntheticListeners(tt,et){return reactExports.useMemo(()=>tt.reduce((rt,st)=>{let{eventName:nt,handler:ot}=st;return rt[nt]=at=>{ot(at,et)},rt},{}),[tt,et])}function useWindowRect(tt){return reactExports.useMemo(()=>tt?getWindowClientRect(tt):null,[tt])}const defaultValue$2=[];function useRects(tt,et){et===void 0&&(et=getClientRect);const[rt]=tt,st=useWindowRect(rt?getWindow$1(rt):null),[nt,ot]=reactExports.useState(defaultValue$2);function at(){ot(()=>tt.length?tt.map(ut=>isDocumentScrollingElement(ut)?st:new Rect(et(ut),ut)):defaultValue$2)}const lt=useResizeObserver({callback:at});return useIsomorphicLayoutEffect$2(()=>{lt==null||lt.disconnect(),at(),tt.forEach(ut=>lt==null?void 0:lt.observe(ut))},[tt]),nt}function getMeasurableNode(tt){if(!tt)return null;if(tt.children.length>1)return tt;const et=tt.children[0];return isHTMLElement$1(et)?et:tt}function useDragOverlayMeasuring(tt){let{measure:et}=tt;const[rt,st]=reactExports.useState(null),nt=reactExports.useCallback(ct=>{for(const{target:dt}of ct)if(isHTMLElement$1(dt)){st(ht=>{const ft=et(dt);return ht?{...ht,width:ft.width,height:ft.height}:ft});break}},[et]),ot=useResizeObserver({callback:nt}),at=reactExports.useCallback(ct=>{const dt=getMeasurableNode(ct);ot==null||ot.disconnect(),dt&&(ot==null||ot.observe(dt)),st(dt?et(dt):null)},[et,ot]),[lt,ut]=useNodeRef(at);return reactExports.useMemo(()=>({nodeRef:lt,rect:rt,setRef:ut}),[rt,lt,ut])}const defaultSensors=[{sensor:PointerSensor,options:{}},{sensor:KeyboardSensor,options:{}}],defaultData={current:{}},defaultMeasuringConfiguration={draggable:{measure:getTransformAgnosticClientRect},droppable:{measure:getTransformAgnosticClientRect,strategy:MeasuringStrategy.WhileDragging,frequency:MeasuringFrequency.Optimized},dragOverlay:{measure:getClientRect}};class DroppableContainersMap extends Map{get(et){var rt;return et!=null&&(rt=super.get(et))!=null?rt:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(et=>{let{disabled:rt}=et;return!rt})}getNodeFor(et){var rt,st;return(rt=(st=this.get(et))==null?void 0:st.node.current)!=null?rt:void 0}}const defaultPublicContext={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new DroppableContainersMap,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:noop$3},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:defaultMeasuringConfiguration,measureDroppableContainers:noop$3,windowRect:null,measuringScheduled:!1},defaultInternalContext={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:noop$3,draggableNodes:new Map,over:null,measureDroppableContainers:noop$3},InternalContext=reactExports.createContext(defaultInternalContext),PublicContext=reactExports.createContext(defaultPublicContext);function getInitialState(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new DroppableContainersMap}}}function reducer$2(tt,et){switch(et.type){case Action.DragStart:return{...tt,draggable:{...tt.draggable,initialCoordinates:et.initialCoordinates,active:et.active}};case Action.DragMove:return tt.draggable.active==null?tt:{...tt,draggable:{...tt.draggable,translate:{x:et.coordinates.x-tt.draggable.initialCoordinates.x,y:et.coordinates.y-tt.draggable.initialCoordinates.y}}};case Action.DragEnd:case Action.DragCancel:return{...tt,draggable:{...tt.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Action.RegisterDroppable:{const{element:rt}=et,{id:st}=rt,nt=new DroppableContainersMap(tt.droppable.containers);return nt.set(st,rt),{...tt,droppable:{...tt.droppable,containers:nt}}}case Action.SetDroppableDisabled:{const{id:rt,key:st,disabled:nt}=et,ot=tt.droppable.containers.get(rt);if(!ot||st!==ot.key)return tt;const at=new DroppableContainersMap(tt.droppable.containers);return at.set(rt,{...ot,disabled:nt}),{...tt,droppable:{...tt.droppable,containers:at}}}case Action.UnregisterDroppable:{const{id:rt,key:st}=et,nt=tt.droppable.containers.get(rt);if(!nt||st!==nt.key)return tt;const ot=new DroppableContainersMap(tt.droppable.containers);return ot.delete(rt),{...tt,droppable:{...tt.droppable,containers:ot}}}default:return tt}}function RestoreFocus(tt){let{disabled:et}=tt;const{active:rt,activatorEvent:st,draggableNodes:nt}=reactExports.useContext(InternalContext),ot=usePrevious(st),at=usePrevious(rt==null?void 0:rt.id);return reactExports.useEffect(()=>{if(!et&&!st&&ot&&at!=null){if(!isKeyboardEvent(ot)||document.activeElement===ot.target)return;const lt=nt.get(at);if(!lt)return;const{activatorNode:ut,node:ct}=lt;if(!ut.current&&!ct.current)return;requestAnimationFrame(()=>{for(const dt of[ut.current,ct.current]){if(!dt)continue;const ht=findFirstFocusableNode(dt);if(ht){ht.focus();break}}})}},[st,et,nt,at,ot]),null}function applyModifiers(tt,et){let{transform:rt,...st}=et;return tt!=null&&tt.length?tt.reduce((nt,ot)=>ot({transform:nt,...st}),rt):rt}function useMeasuringConfiguration(tt){return reactExports.useMemo(()=>({draggable:{...defaultMeasuringConfiguration.draggable,...tt==null?void 0:tt.draggable},droppable:{...defaultMeasuringConfiguration.droppable,...tt==null?void 0:tt.droppable},dragOverlay:{...defaultMeasuringConfiguration.dragOverlay,...tt==null?void 0:tt.dragOverlay}}),[tt==null?void 0:tt.draggable,tt==null?void 0:tt.droppable,tt==null?void 0:tt.dragOverlay])}function useLayoutShiftScrollCompensation(tt){let{activeNode:et,measure:rt,initialRect:st,config:nt=!0}=tt;const ot=reactExports.useRef(!1),{x:at,y:lt}=typeof nt=="boolean"?{x:nt,y:nt}:nt;useIsomorphicLayoutEffect$2(()=>{if(!at&&!lt||!et){ot.current=!1;return}if(ot.current||!st)return;const ct=et==null?void 0:et.node.current;if(!ct||ct.isConnected===!1)return;const dt=rt(ct),ht=getRectDelta(dt,st);if(at||(ht.x=0),lt||(ht.y=0),ot.current=!0,Math.abs(ht.x)>0||Math.abs(ht.y)>0){const ft=getFirstScrollableAncestor(ct);ft&&ft.scrollBy({top:ht.y,left:ht.x})}},[et,at,lt,st,rt])}const ActiveDraggableContext=reactExports.createContext({...defaultCoordinates,scaleX:1,scaleY:1});var Status;(function(tt){tt[tt.Uninitialized=0]="Uninitialized",tt[tt.Initializing=1]="Initializing",tt[tt.Initialized=2]="Initialized"})(Status||(Status={}));const DndContext=reactExports.memo(function(et){var rt,st,nt,ot;let{id:at,accessibility:lt,autoScroll:ut=!0,children:ct,sensors:dt=defaultSensors,collisionDetection:ht=rectIntersection,measuring:ft,modifiers:xt,...yt}=et;const vt=reactExports.useReducer(reducer$2,void 0,getInitialState),[Et,wt]=vt,[bt,St]=useDndMonitorProvider(),[Rt,Ct]=reactExports.useState(Status.Uninitialized),It=Rt===Status.Initialized,{draggable:{active:jt,nodes:Pt,translate:Ot},droppable:{containers:Ut}}=Et,Nt=jt!=null?Pt.get(jt):null,Ht=reactExports.useRef({initial:null,translated:null}),Lt=reactExports.useMemo(()=>{var ms;return jt!=null?{id:jt,data:(ms=Nt==null?void 0:Nt.data)!=null?ms:defaultData,rect:Ht}:null},[jt,Nt]),kt=reactExports.useRef(null),[$t,Ft]=reactExports.useState(null),[Gt,Mt]=reactExports.useState(null),Vt=useLatestValue(yt,Object.values(yt)),Bt=useUniqueId("DndDescribedBy",at),qt=reactExports.useMemo(()=>Ut.getEnabled(),[Ut]),Qt=useMeasuringConfiguration(ft),{droppableRects:Yt,measureDroppableContainers:tr,measuringScheduled:lr}=useDroppableMeasuring(qt,{dragging:It,dependencies:[Ot.x,Ot.y],config:Qt.droppable}),ur=useCachedNode(Pt,jt),mr=reactExports.useMemo(()=>Gt?getEventCoordinates(Gt):null,[Gt]),yr=Pl(),or=useInitialRect(ur,Qt.draggable.measure);useLayoutShiftScrollCompensation({activeNode:jt!=null?Pt.get(jt):null,config:yr.layoutShiftCompensation,initialRect:or,measure:Qt.draggable.measure});const hr=useRect(ur,Qt.draggable.measure,or),pr=useRect(ur?ur.parentElement:null),_r=reactExports.useRef({activatorEvent:null,active:null,activeNode:ur,collisionRect:null,collisions:null,droppableRects:Yt,draggableNodes:Pt,draggingNode:null,draggingNodeRect:null,droppableContainers:Ut,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ar=Ut.getNodeFor((rt=_r.current.over)==null?void 0:rt.id),Hr=useDragOverlayMeasuring({measure:Qt.dragOverlay.measure}),Ur=(st=Hr.nodeRef.current)!=null?st:ur,os=It?(nt=Hr.rect)!=null?nt:hr:null,Gs=!!(Hr.nodeRef.current&&Hr.rect),Es=useRectDelta(Gs?null:hr),Ws=useWindowRect(Ur?getWindow$1(Ur):null),Xt=useScrollableAncestors(It?Ar??ur:null),er=useRects(Xt),sr=applyModifiers(xt,{transform:{x:Ot.x-Es.x,y:Ot.y-Es.y,scaleX:1,scaleY:1},activatorEvent:Gt,active:Lt,activeNodeRect:hr,containerNodeRect:pr,draggingNodeRect:os,over:_r.current.over,overlayNodeRect:Hr.rect,scrollableAncestors:Xt,scrollableAncestorRects:er,windowRect:Ws}),br=mr?add(mr,Ot):null,gr=useScrollOffsets(Xt),vr=useScrollOffsetsDelta(gr),Tr=useScrollOffsetsDelta(gr,[hr]),Lr=add(sr,vr),Dr=os?getAdjustedRect(os,sr):null,Zr=Lt&&Dr?ht({active:Lt,collisionRect:Dr,droppableRects:Yt,droppableContainers:qt,pointerCoordinates:br}):null,ks=getFirstCollision(Zr,"id"),[Ir,Br]=reactExports.useState(null),kr=Gs?sr:add(sr,Tr),Wr=adjustScale(kr,(ot=Ir==null?void 0:Ir.rect)!=null?ot:null,hr),bs=reactExports.useRef(null),ps=reactExports.useCallback((ms,Is)=>{let{sensor:Rs,options:Xn}=Is;if(kt.current==null)return;const Ns=Pt.get(kt.current);if(!Ns)return;const ws=ms.nativeEvent,qs=new Rs({active:kt.current,activeNode:Ns,event:ws,options:Xn,context:_r,onAbort(hs){if(!Pt.get(hs))return;const{onDragAbort:An}=Vt.current,Mn={id:hs};An==null||An(Mn),bt({type:"onDragAbort",event:Mn})},onPending(hs,ro,An,Mn){if(!Pt.get(hs))return;const{onDragPending:Jo}=Vt.current,so={id:hs,constraint:ro,initialCoordinates:An,offset:Mn};Jo==null||Jo(so),bt({type:"onDragPending",event:so})},onStart(hs){const ro=kt.current;if(ro==null)return;const An=Pt.get(ro);if(!An)return;const{onDragStart:Mn}=Vt.current,wo={activatorEvent:ws,active:{id:ro,data:An.data,rect:Ht}};reactDomExports.unstable_batchedUpdates(()=>{Mn==null||Mn(wo),Ct(Status.Initializing),wt({type:Action.DragStart,initialCoordinates:hs,active:ro}),bt({type:"onDragStart",event:wo}),Ft(bs.current),Mt(ws)})},onMove(hs){wt({type:Action.DragMove,coordinates:hs})},onEnd:bo(Action.DragEnd),onCancel:bo(Action.DragCancel)});bs.current=qs;function bo(hs){return async function(){const{active:An,collisions:Mn,over:wo,scrollAdjustedTranslate:Jo}=_r.current;let so=null;if(An&&Jo){const{cancelDrop:no}=Vt.current;so={activatorEvent:ws,active:An,collisions:Mn,delta:Jo,over:wo},hs===Action.DragEnd&&typeof no=="function"&&await Promise.resolve(no(so))&&(hs=Action.DragCancel)}kt.current=null,reactDomExports.unstable_batchedUpdates(()=>{wt({type:hs}),Ct(Status.Uninitialized),Br(null),Ft(null),Mt(null),bs.current=null;const no=hs===Action.DragEnd?"onDragEnd":"onDragCancel";if(so){const du=Vt.current[no];du==null||du(so),bt({type:no,event:so})}})}}},[Pt]),zr=reactExports.useCallback((ms,Is)=>(Rs,Xn)=>{const Ns=Rs.nativeEvent,ws=Pt.get(Xn);if(kt.current!==null||!ws||Ns.dndKit||Ns.defaultPrevented)return;const qs={active:ws};ms(Rs,Is.options,qs)===!0&&(Ns.dndKit={capturedBy:Is.sensor},kt.current=Xn,ps(Rs,Is))},[Pt,ps]),$r=useCombineActivators(dt,zr);useSensorSetup(dt),useIsomorphicLayoutEffect$2(()=>{hr&&Rt===Status.Initializing&&Ct(Status.Initialized)},[hr,Rt]),reactExports.useEffect(()=>{const{onDragMove:ms}=Vt.current,{active:Is,activatorEvent:Rs,collisions:Xn,over:Ns}=_r.current;if(!Is||!Rs)return;const ws={active:Is,activatorEvent:Rs,collisions:Xn,delta:{x:Lr.x,y:Lr.y},over:Ns};reactDomExports.unstable_batchedUpdates(()=>{ms==null||ms(ws),bt({type:"onDragMove",event:ws})})},[Lr.x,Lr.y]),reactExports.useEffect(()=>{const{active:ms,activatorEvent:Is,collisions:Rs,droppableContainers:Xn,scrollAdjustedTranslate:Ns}=_r.current;if(!ms||kt.current==null||!Is||!Ns)return;const{onDragOver:ws}=Vt.current,qs=Xn.get(ks),bo=qs&&qs.rect.current?{id:qs.id,rect:qs.rect.current,data:qs.data,disabled:qs.disabled}:null,hs={active:ms,activatorEvent:Is,collisions:Rs,delta:{x:Ns.x,y:Ns.y},over:bo};reactDomExports.unstable_batchedUpdates(()=>{Br(bo),ws==null||ws(hs),bt({type:"onDragOver",event:hs})})},[ks]),useIsomorphicLayoutEffect$2(()=>{_r.current={activatorEvent:Gt,active:Lt,activeNode:ur,collisionRect:Dr,collisions:Zr,droppableRects:Yt,draggableNodes:Pt,draggingNode:Ur,draggingNodeRect:os,droppableContainers:Ut,over:Ir,scrollableAncestors:Xt,scrollAdjustedTranslate:Lr},Ht.current={initial:os,translated:Dr}},[Lt,ur,Zr,Dr,Pt,Ur,os,Yt,Ut,Ir,Xt,Lr]),useAutoScroller({...yr,delta:Ot,draggingRect:Dr,pointerCoordinates:br,scrollableAncestors:Xt,scrollableAncestorRects:er});const Ls=reactExports.useMemo(()=>({active:Lt,activeNode:ur,activeNodeRect:hr,activatorEvent:Gt,collisions:Zr,containerNodeRect:pr,dragOverlay:Hr,draggableNodes:Pt,droppableContainers:Ut,droppableRects:Yt,over:Ir,measureDroppableContainers:tr,scrollableAncestors:Xt,scrollableAncestorRects:er,measuringConfiguration:Qt,measuringScheduled:lr,windowRect:Ws}),[Lt,ur,hr,Gt,Zr,pr,Hr,Pt,Ut,Yt,Ir,tr,Xt,er,Qt,lr,Ws]),Zo=reactExports.useMemo(()=>({activatorEvent:Gt,activators:$r,active:Lt,activeNodeRect:hr,ariaDescribedById:{draggable:Bt},dispatch:wt,draggableNodes:Pt,over:Ir,measureDroppableContainers:tr}),[Gt,$r,Lt,hr,wt,Bt,Pt,Ir,tr]);return React$4.createElement(DndMonitorContext.Provider,{value:St},React$4.createElement(InternalContext.Provider,{value:Zo},React$4.createElement(PublicContext.Provider,{value:Ls},React$4.createElement(ActiveDraggableContext.Provider,{value:Wr},ct)),React$4.createElement(RestoreFocus,{disabled:(lt==null?void 0:lt.restoreFocus)===!1})),React$4.createElement(Accessibility,{...lt,hiddenTextDescribedById:Bt}));function Pl(){const ms=($t==null?void 0:$t.autoScrollEnabled)===!1,Is=typeof ut=="object"?ut.enabled===!1:ut===!1,Rs=It&&!ms&&!Is;return typeof ut=="object"?{...ut,enabled:Rs}:{enabled:Rs}}}),NullContext=reactExports.createContext(null),defaultRole="button",ID_PREFIX="Draggable";function useDraggable(tt){let{id:et,data:rt,disabled:st=!1,attributes:nt}=tt;const ot=useUniqueId(ID_PREFIX),{activators:at,activatorEvent:lt,active:ut,activeNodeRect:ct,ariaDescribedById:dt,draggableNodes:ht,over:ft}=reactExports.useContext(InternalContext),{role:xt=defaultRole,roleDescription:yt="draggable",tabIndex:vt=0}=nt??{},Et=(ut==null?void 0:ut.id)===et,wt=reactExports.useContext(Et?ActiveDraggableContext:NullContext),[bt,St]=useNodeRef(),[Rt,Ct]=useNodeRef(),It=useSyntheticListeners(at,et),jt=useLatestValue(rt);useIsomorphicLayoutEffect$2(()=>(ht.set(et,{id:et,key:ot,node:bt,activatorNode:Rt,data:jt}),()=>{const Ot=ht.get(et);Ot&&Ot.key===ot&&ht.delete(et)}),[ht,et]);const Pt=reactExports.useMemo(()=>({role:xt,tabIndex:vt,"aria-disabled":st,"aria-pressed":Et&&xt===defaultRole?!0:void 0,"aria-roledescription":yt,"aria-describedby":dt.draggable}),[st,xt,vt,Et,yt,dt.draggable]);return{active:ut,activatorEvent:lt,activeNodeRect:ct,attributes:Pt,isDragging:Et,listeners:st?void 0:It,node:bt,over:ft,setNodeRef:St,setActivatorNodeRef:Ct,transform:wt}}const ID_PREFIX$1="Droppable",defaultResizeObserverConfig={timeout:25};function useDroppable(tt){let{data:et,disabled:rt=!1,id:st,resizeObserverConfig:nt}=tt;const ot=useUniqueId(ID_PREFIX$1),{active:at,dispatch:lt,over:ut,measureDroppableContainers:ct}=reactExports.useContext(InternalContext),dt=reactExports.useRef({disabled:rt}),ht=reactExports.useRef(!1),ft=reactExports.useRef(null),xt=reactExports.useRef(null),{disabled:yt,updateMeasurementsFor:vt,timeout:Et}={...defaultResizeObserverConfig,...nt},wt=useLatestValue(vt??st),bt=reactExports.useCallback(()=>{if(!ht.current){ht.current=!0;return}xt.current!=null&&clearTimeout(xt.current),xt.current=setTimeout(()=>{ct(Array.isArray(wt.current)?wt.current:[wt.current]),xt.current=null},Et)},[Et]),St=useResizeObserver({callback:bt,disabled:yt||!at}),Rt=reactExports.useCallback((Pt,Ot)=>{St&&(Ot&&(St.unobserve(Ot),ht.current=!1),Pt&&St.observe(Pt))},[St]),[Ct,It]=useNodeRef(Rt),jt=useLatestValue(et);return reactExports.useEffect(()=>{!St||!Ct.current||(St.disconnect(),ht.current=!1,St.observe(Ct.current))},[Ct,St]),reactExports.useEffect(()=>(lt({type:Action.RegisterDroppable,element:{id:st,key:ot,disabled:rt,node:Ct,rect:ft,data:jt}}),()=>lt({type:Action.UnregisterDroppable,key:ot,id:st})),[st]),reactExports.useEffect(()=>{rt!==dt.current.disabled&&(lt({type:Action.SetDroppableDisabled,id:st,key:ot,disabled:rt}),dt.current.disabled=rt)},[st,ot,rt,lt]),{active:at,rect:ft,isOver:(ut==null?void 0:ut.id)===st,node:Ct,over:ut,setNodeRef:It}}function bind$3(tt,et){return function(){return tt.apply(et,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag:toStringTag$1}=Symbol,kindOf=(tt=>et=>{const rt=toString.call(et);return tt[rt]||(tt[rt]=rt.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=tt=>(tt=tt.toLowerCase(),et=>kindOf(et)===tt),typeOfTest=tt=>et=>typeof et===tt,{isArray:isArray$4}=Array,isUndefined$1=typeOfTest("undefined");function isBuffer$1(tt){return tt!==null&&!isUndefined$1(tt)&&tt.constructor!==null&&!isUndefined$1(tt.constructor)&&isFunction$2(tt.constructor.isBuffer)&&tt.constructor.isBuffer(tt)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(tt){let et;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?et=ArrayBuffer.isView(tt):et=tt&&tt.buffer&&isArrayBuffer(tt.buffer),et}const isString$2=typeOfTest("string"),isFunction$2=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$4=tt=>tt!==null&&typeof tt=="object",isBoolean$2=tt=>tt===!0||tt===!1,isPlainObject$2=tt=>{if(kindOf(tt)!=="object")return!1;const et=getPrototypeOf(tt);return(et===null||et===Object.prototype||Object.getPrototypeOf(et)===null)&&!(toStringTag$1 in tt)&&!(iterator in tt)},isEmptyObject$1=tt=>{if(!isObject$4(tt)||isBuffer$1(tt))return!1;try{return Object.keys(tt).length===0&&Object.getPrototypeOf(tt)===Object.prototype}catch{return!1}},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=tt=>isObject$4(tt)&&isFunction$2(tt.pipe),isFormData=tt=>{let et;return tt&&(typeof FormData=="function"&&tt instanceof FormData||isFunction$2(tt.append)&&((et=kindOf(tt))==="formdata"||et==="object"&&isFunction$2(tt.toString)&&tt.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim$1=tt=>tt.trim?tt.trim():tt.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(tt,et,{allOwnKeys:rt=!1}={}){if(tt===null||typeof tt>"u")return;let st,nt;if(typeof tt!="object"&&(tt=[tt]),isArray$4(tt))for(st=0,nt=tt.length;st<nt;st++)et.call(null,tt[st],st,tt);else{if(isBuffer$1(tt))return;const ot=rt?Object.getOwnPropertyNames(tt):Object.keys(tt),at=ot.length;let lt;for(st=0;st<at;st++)lt=ot[st],et.call(null,tt[lt],lt,tt)}}function findKey(tt,et){if(isBuffer$1(tt))return null;et=et.toLowerCase();const rt=Object.keys(tt);let st=rt.length,nt;for(;st-- >0;)if(nt=rt[st],et===nt.toLowerCase())return nt;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=tt=>!isUndefined$1(tt)&&tt!==_global;function merge$1(){const{caseless:tt,skipUndefined:et}=isContextDefined(this)&&this||{},rt={},st=(nt,ot)=>{const at=tt&&findKey(rt,ot)||ot;isPlainObject$2(rt[at])&&isPlainObject$2(nt)?rt[at]=merge$1(rt[at],nt):isPlainObject$2(nt)?rt[at]=merge$1({},nt):isArray$4(nt)?rt[at]=nt.slice():(!et||!isUndefined$1(nt))&&(rt[at]=nt)};for(let nt=0,ot=arguments.length;nt<ot;nt++)arguments[nt]&&forEach(arguments[nt],st);return rt}const extend$3=(tt,et,rt,{allOwnKeys:st}={})=>(forEach(et,(nt,ot)=>{rt&&isFunction$2(nt)?tt[ot]=bind$3(nt,rt):tt[ot]=nt},{allOwnKeys:st}),tt),stripBOM=tt=>(tt.charCodeAt(0)===65279&&(tt=tt.slice(1)),tt),inherits=(tt,et,rt,st)=>{tt.prototype=Object.create(et.prototype,st),tt.prototype.constructor=tt,Object.defineProperty(tt,"super",{value:et.prototype}),rt&&Object.assign(tt.prototype,rt)},toFlatObject=(tt,et,rt,st)=>{let nt,ot,at;const lt={};if(et=et||{},tt==null)return et;do{for(nt=Object.getOwnPropertyNames(tt),ot=nt.length;ot-- >0;)at=nt[ot],(!st||st(at,tt,et))&&!lt[at]&&(et[at]=tt[at],lt[at]=!0);tt=rt!==!1&&getPrototypeOf(tt)}while(tt&&(!rt||rt(tt,et))&&tt!==Object.prototype);return et},endsWith=(tt,et,rt)=>{tt=String(tt),(rt===void 0||rt>tt.length)&&(rt=tt.length),rt-=et.length;const st=tt.indexOf(et,rt);return st!==-1&&st===rt},toArray=tt=>{if(!tt)return null;if(isArray$4(tt))return tt;let et=tt.length;if(!isNumber$1(et))return null;const rt=new Array(et);for(;et-- >0;)rt[et]=tt[et];return rt},isTypedArray=(tt=>et=>tt&&et instanceof tt)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(tt,et)=>{const st=(tt&&tt[iterator]).call(tt);let nt;for(;(nt=st.next())&&!nt.done;){const ot=nt.value;et.call(tt,ot[0],ot[1])}},matchAll=(tt,et)=>{let rt;const st=[];for(;(rt=tt.exec(et))!==null;)st.push(rt);return st},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=tt=>tt.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(rt,st,nt){return st.toUpperCase()+nt}),hasOwnProperty=(({hasOwnProperty:tt})=>(et,rt)=>tt.call(et,rt))(Object.prototype),isRegExp$2=kindOfTest("RegExp"),reduceDescriptors=(tt,et)=>{const rt=Object.getOwnPropertyDescriptors(tt),st={};forEach(rt,(nt,ot)=>{let at;(at=et(nt,ot,tt))!==!1&&(st[ot]=at||nt)}),Object.defineProperties(tt,st)},freezeMethods=tt=>{reduceDescriptors(tt,(et,rt)=>{if(isFunction$2(tt)&&["arguments","caller","callee"].indexOf(rt)!==-1)return!1;const st=tt[rt];if(isFunction$2(st)){if(et.enumerable=!1,"writable"in et){et.writable=!1;return}et.set||(et.set=()=>{throw Error("Can not rewrite read-only method '"+rt+"'")})}})},toObjectSet=(tt,et)=>{const rt={},st=nt=>{nt.forEach(ot=>{rt[ot]=!0})};return isArray$4(tt)?st(tt):st(String(tt).split(et)),rt},noop$2=()=>{},toFiniteNumber=(tt,et)=>tt!=null&&Number.isFinite(tt=+tt)?tt:et;function isSpecCompliantForm(tt){return!!(tt&&isFunction$2(tt.append)&&tt[toStringTag$1]==="FormData"&&tt[iterator])}const toJSONObject=tt=>{const et=new Array(10),rt=(st,nt)=>{if(isObject$4(st)){if(et.indexOf(st)>=0)return;if(isBuffer$1(st))return st;if(!("toJSON"in st)){et[nt]=st;const ot=isArray$4(st)?[]:{};return forEach(st,(at,lt)=>{const ut=rt(at,nt+1);!isUndefined$1(ut)&&(ot[lt]=ut)}),et[nt]=void 0,ot}}return st};return rt(tt,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=tt=>tt&&(isObject$4(tt)||isFunction$2(tt))&&isFunction$2(tt.then)&&isFunction$2(tt.catch),_setImmediate=((tt,et)=>tt?setImmediate:et?((rt,st)=>(_global.addEventListener("message",({source:nt,data:ot})=>{nt===_global&&ot===rt&&st.length&&st.shift()()},!1),nt=>{st.push(nt),_global.postMessage(rt,"*")}))(`axios@${Math.random()}`,[]):rt=>setTimeout(rt))(typeof setImmediate=="function",isFunction$2(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=tt=>tt!=null&&isFunction$2(tt[iterator]),utils$4={isArray:isArray$4,isArrayBuffer,isBuffer:isBuffer$1,isFormData,isArrayBufferView,isString:isString$2,isNumber:isNumber$1,isBoolean:isBoolean$2,isObject:isObject$4,isPlainObject:isPlainObject$2,isEmptyObject:isEmptyObject$1,isReadableStream,isRequest,isResponse,isHeaders,isUndefined:isUndefined$1,isDate:isDate$1,isFile,isBlob,isRegExp:isRegExp$2,isFunction:isFunction$2,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge:merge$1,extend:extend$3,trim:trim$1,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$2,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(tt,et,rt,st,nt){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=tt,this.name="AxiosError",et&&(this.code=et),rt&&(this.config=rt),st&&(this.request=st),nt&&(this.response=nt,this.status=nt.status?nt.status:null)}utils$4.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$4.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(tt=>{descriptors[tt]={value:tt}});Object.defineProperties(AxiosError$1,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError$1.from=(tt,et,rt,st,nt,ot)=>{const at=Object.create(prototype$1);utils$4.toFlatObject(tt,at,function(dt){return dt!==Error.prototype},ct=>ct!=="isAxiosError");const lt=tt&&tt.message?tt.message:"Error",ut=et==null&&tt?tt.code:et;return AxiosError$1.call(at,lt,ut,rt,st,nt),tt&&at.cause==null&&Object.defineProperty(at,"cause",{value:tt,configurable:!0}),at.name=tt&&tt.name||"Error",ot&&Object.assign(at,ot),at};const httpAdapter=null;function isVisitable(tt){return utils$4.isPlainObject(tt)||utils$4.isArray(tt)}function removeBrackets(tt){return utils$4.endsWith(tt,"[]")?tt.slice(0,-2):tt}function renderKey(tt,et,rt){return tt?tt.concat(et).map(function(nt,ot){return nt=removeBrackets(nt),!rt&&ot?"["+nt+"]":nt}).join(rt?".":""):et}function isFlatArray(tt){return utils$4.isArray(tt)&&!tt.some(isVisitable)}const predicates=utils$4.toFlatObject(utils$4,{},null,function(et){return/^is[A-Z]/.test(et)});function toFormData$1(tt,et,rt){if(!utils$4.isObject(tt))throw new TypeError("target must be an object");et=et||new FormData,rt=utils$4.toFlatObject(rt,{metaTokens:!0,dots:!1,indexes:!1},!1,function(vt,Et){return!utils$4.isUndefined(Et[vt])});const st=rt.metaTokens,nt=rt.visitor||dt,ot=rt.dots,at=rt.indexes,ut=(rt.Blob||typeof Blob<"u"&&Blob)&&utils$4.isSpecCompliantForm(et);if(!utils$4.isFunction(nt))throw new TypeError("visitor must be a function");function ct(yt){if(yt===null)return"";if(utils$4.isDate(yt))return yt.toISOString();if(utils$4.isBoolean(yt))return yt.toString();if(!ut&&utils$4.isBlob(yt))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$4.isArrayBuffer(yt)||utils$4.isTypedArray(yt)?ut&&typeof Blob=="function"?new Blob([yt]):Buffer.from(yt):yt}function dt(yt,vt,Et){let wt=yt;if(yt&&!Et&&typeof yt=="object"){if(utils$4.endsWith(vt,"{}"))vt=st?vt:vt.slice(0,-2),yt=JSON.stringify(yt);else if(utils$4.isArray(yt)&&isFlatArray(yt)||(utils$4.isFileList(yt)||utils$4.endsWith(vt,"[]"))&&(wt=utils$4.toArray(yt)))return vt=removeBrackets(vt),wt.forEach(function(St,Rt){!(utils$4.isUndefined(St)||St===null)&&et.append(at===!0?renderKey([vt],Rt,ot):at===null?vt:vt+"[]",ct(St))}),!1}return isVisitable(yt)?!0:(et.append(renderKey(Et,vt,ot),ct(yt)),!1)}const ht=[],ft=Object.assign(predicates,{defaultVisitor:dt,convertValue:ct,isVisitable});function xt(yt,vt){if(!utils$4.isUndefined(yt)){if(ht.indexOf(yt)!==-1)throw Error("Circular reference detected in "+vt.join("."));ht.push(yt),utils$4.forEach(yt,function(wt,bt){(!(utils$4.isUndefined(wt)||wt===null)&&nt.call(et,wt,utils$4.isString(bt)?bt.trim():bt,vt,ft))===!0&&xt(wt,vt?vt.concat(bt):[bt])}),ht.pop()}}if(!utils$4.isObject(tt))throw new TypeError("data must be an object");return xt(tt),et}function encode$2(tt){const et={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(tt).replace(/[!'()~]|%20|%00/g,function(st){return et[st]})}function AxiosURLSearchParams(tt,et){this._pairs=[],tt&&toFormData$1(tt,this,et)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(et,rt){this._pairs.push([et,rt])};prototype.toString=function(et){const rt=et?function(st){return et.call(this,st,encode$2)}:encode$2;return this._pairs.map(function(nt){return rt(nt[0])+"="+rt(nt[1])},"").join("&")};function encode$1(tt){return encodeURIComponent(tt).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function buildURL(tt,et,rt){if(!et)return tt;const st=rt&&rt.encode||encode$1;utils$4.isFunction(rt)&&(rt={serialize:rt});const nt=rt&&rt.serialize;let ot;if(nt?ot=nt(et,rt):ot=utils$4.isURLSearchParams(et)?et.toString():new AxiosURLSearchParams(et,rt).toString(st),ot){const at=tt.indexOf("#");at!==-1&&(tt=tt.slice(0,at)),tt+=(tt.indexOf("?")===-1?"?":"&")+ot}return tt}class InterceptorManager{constructor(){this.handlers=[]}use(et,rt,st){return this.handlers.push({fulfilled:et,rejected:rt,synchronous:st?st.synchronous:!1,runWhen:st?st.runWhen:null}),this.handlers.length-1}eject(et){this.handlers[et]&&(this.handlers[et]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(et){utils$4.forEach(this.handlers,function(st){st!==null&&et(st)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$3=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils$3,...platform$1};function toURLEncodedForm(tt,et){return toFormData$1(tt,new platform.classes.URLSearchParams,{visitor:function(rt,st,nt,ot){return platform.isNode&&utils$4.isBuffer(rt)?(this.append(st,rt.toString("base64")),!1):ot.defaultVisitor.apply(this,arguments)},...et})}function parsePropPath(tt){return utils$4.matchAll(/\w+|\[(\w*)]/g,tt).map(et=>et[0]==="[]"?"":et[1]||et[0])}function arrayToObject$1(tt){const et={},rt=Object.keys(tt);let st;const nt=rt.length;let ot;for(st=0;st<nt;st++)ot=rt[st],et[ot]=tt[ot];return et}function formDataToJSON(tt){function et(rt,st,nt,ot){let at=rt[ot++];if(at==="__proto__")return!0;const lt=Number.isFinite(+at),ut=ot>=rt.length;return at=!at&&utils$4.isArray(nt)?nt.length:at,ut?(utils$4.hasOwnProp(nt,at)?nt[at]=[nt[at],st]:nt[at]=st,!lt):((!nt[at]||!utils$4.isObject(nt[at]))&&(nt[at]=[]),et(rt,st,nt[at],ot)&&utils$4.isArray(nt[at])&&(nt[at]=arrayToObject$1(nt[at])),!lt)}if(utils$4.isFormData(tt)&&utils$4.isFunction(tt.entries)){const rt={};return utils$4.forEachEntry(tt,(st,nt)=>{et(parsePropPath(st),nt,rt,0)}),rt}return null}function stringifySafely(tt,et,rt){if(utils$4.isString(tt))try{return(et||JSON.parse)(tt),utils$4.trim(tt)}catch(st){if(st.name!=="SyntaxError")throw st}return(rt||JSON.stringify)(tt)}const defaults$4={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(et,rt){const st=rt.getContentType()||"",nt=st.indexOf("application/json")>-1,ot=utils$4.isObject(et);if(ot&&utils$4.isHTMLForm(et)&&(et=new FormData(et)),utils$4.isFormData(et))return nt?JSON.stringify(formDataToJSON(et)):et;if(utils$4.isArrayBuffer(et)||utils$4.isBuffer(et)||utils$4.isStream(et)||utils$4.isFile(et)||utils$4.isBlob(et)||utils$4.isReadableStream(et))return et;if(utils$4.isArrayBufferView(et))return et.buffer;if(utils$4.isURLSearchParams(et))return rt.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),et.toString();let lt;if(ot){if(st.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(et,this.formSerializer).toString();if((lt=utils$4.isFileList(et))||st.indexOf("multipart/form-data")>-1){const ut=this.env&&this.env.FormData;return toFormData$1(lt?{"files[]":et}:et,ut&&new ut,this.formSerializer)}}return ot||nt?(rt.setContentType("application/json",!1),stringifySafely(et)):et}],transformResponse:[function(et){const rt=this.transitional||defaults$4.transitional,st=rt&&rt.forcedJSONParsing,nt=this.responseType==="json";if(utils$4.isResponse(et)||utils$4.isReadableStream(et))return et;if(et&&utils$4.isString(et)&&(st&&!this.responseType||nt)){const at=!(rt&&rt.silentJSONParsing)&&nt;try{return JSON.parse(et,this.parseReviver)}catch(lt){if(at)throw lt.name==="SyntaxError"?AxiosError$1.from(lt,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):lt}}return et}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(et){return et>=200&&et<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$4.forEach(["delete","get","head","post","put","patch"],tt=>{defaults$4.headers[tt]={}});const ignoreDuplicateOf=utils$4.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=tt=>{const et={};let rt,st,nt;return tt&&tt.split(`
46
46
  `).forEach(function(at){nt=at.indexOf(":"),rt=at.substring(0,nt).trim().toLowerCase(),st=at.substring(nt+1).trim(),!(!rt||et[rt]&&ignoreDuplicateOf[rt])&&(rt==="set-cookie"?et[rt]?et[rt].push(st):et[rt]=[st]:et[rt]=et[rt]?et[rt]+", "+st:st)}),et},$internals=Symbol("internals");function normalizeHeader(tt){return tt&&String(tt).trim().toLowerCase()}function normalizeValue(tt){return tt===!1||tt==null?tt:utils$4.isArray(tt)?tt.map(normalizeValue):String(tt)}function parseTokens(tt){const et=Object.create(null),rt=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let st;for(;st=rt.exec(tt);)et[st[1]]=st[2];return et}const isValidHeaderName=tt=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(tt.trim());function matchHeaderValue(tt,et,rt,st,nt){if(utils$4.isFunction(st))return st.call(this,et,rt);if(nt&&(et=rt),!!utils$4.isString(et)){if(utils$4.isString(st))return et.indexOf(st)!==-1;if(utils$4.isRegExp(st))return st.test(et)}}function formatHeader(tt){return tt.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(et,rt,st)=>rt.toUpperCase()+st)}function buildAccessors(tt,et){const rt=utils$4.toCamelCase(" "+et);["get","set","has"].forEach(st=>{Object.defineProperty(tt,st+rt,{value:function(nt,ot,at){return this[st].call(this,et,nt,ot,at)},configurable:!0})})}let AxiosHeaders$1=class{constructor(et){et&&this.set(et)}set(et,rt,st){const nt=this;function ot(lt,ut,ct){const dt=normalizeHeader(ut);if(!dt)throw new Error("header name must be a non-empty string");const ht=utils$4.findKey(nt,dt);(!ht||nt[ht]===void 0||ct===!0||ct===void 0&&nt[ht]!==!1)&&(nt[ht||ut]=normalizeValue(lt))}const at=(lt,ut)=>utils$4.forEach(lt,(ct,dt)=>ot(ct,dt,ut));if(utils$4.isPlainObject(et)||et instanceof this.constructor)at(et,rt);else if(utils$4.isString(et)&&(et=et.trim())&&!isValidHeaderName(et))at(parseHeaders(et),rt);else if(utils$4.isObject(et)&&utils$4.isIterable(et)){let lt={},ut,ct;for(const dt of et){if(!utils$4.isArray(dt))throw TypeError("Object iterator must return a key-value pair");lt[ct=dt[0]]=(ut=lt[ct])?utils$4.isArray(ut)?[...ut,dt[1]]:[ut,dt[1]]:dt[1]}at(lt,rt)}else et!=null&&ot(rt,et,st);return this}get(et,rt){if(et=normalizeHeader(et),et){const st=utils$4.findKey(this,et);if(st){const nt=this[st];if(!rt)return nt;if(rt===!0)return parseTokens(nt);if(utils$4.isFunction(rt))return rt.call(this,nt,st);if(utils$4.isRegExp(rt))return rt.exec(nt);throw new TypeError("parser must be boolean|regexp|function")}}}has(et,rt){if(et=normalizeHeader(et),et){const st=utils$4.findKey(this,et);return!!(st&&this[st]!==void 0&&(!rt||matchHeaderValue(this,this[st],st,rt)))}return!1}delete(et,rt){const st=this;let nt=!1;function ot(at){if(at=normalizeHeader(at),at){const lt=utils$4.findKey(st,at);lt&&(!rt||matchHeaderValue(st,st[lt],lt,rt))&&(delete st[lt],nt=!0)}}return utils$4.isArray(et)?et.forEach(ot):ot(et),nt}clear(et){const rt=Object.keys(this);let st=rt.length,nt=!1;for(;st--;){const ot=rt[st];(!et||matchHeaderValue(this,this[ot],ot,et,!0))&&(delete this[ot],nt=!0)}return nt}normalize(et){const rt=this,st={};return utils$4.forEach(this,(nt,ot)=>{const at=utils$4.findKey(st,ot);if(at){rt[at]=normalizeValue(nt),delete rt[ot];return}const lt=et?formatHeader(ot):String(ot).trim();lt!==ot&&delete rt[ot],rt[lt]=normalizeValue(nt),st[lt]=!0}),this}concat(...et){return this.constructor.concat(this,...et)}toJSON(et){const rt=Object.create(null);return utils$4.forEach(this,(st,nt)=>{st!=null&&st!==!1&&(rt[nt]=et&&utils$4.isArray(st)?st.join(", "):st)}),rt}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([et,rt])=>et+": "+rt).join(`
47
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(et){return et instanceof this?et:new this(et)}static concat(et,...rt){const st=new this(et);return rt.forEach(nt=>st.set(nt)),st}static accessor(et){const st=(this[$internals]=this[$internals]={accessors:{}}).accessors,nt=this.prototype;function ot(at){const lt=normalizeHeader(at);st[lt]||(buildAccessors(nt,at),st[lt]=!0)}return utils$4.isArray(et)?et.forEach(ot):ot(et),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$4.reduceDescriptors(AxiosHeaders$1.prototype,({value:tt},et)=>{let rt=et[0].toUpperCase()+et.slice(1);return{get:()=>tt,set(st){this[rt]=st}}});utils$4.freezeMethods(AxiosHeaders$1);function transformData(tt,et){const rt=this||defaults$4,st=et||rt,nt=AxiosHeaders$1.from(st.headers);let ot=st.data;return utils$4.forEach(tt,function(lt){ot=lt.call(rt,ot,nt.normalize(),et?et.status:void 0)}),nt.normalize(),ot}function isCancel$1(tt){return!!(tt&&tt.__CANCEL__)}function CanceledError$1(tt,et,rt){AxiosError$1.call(this,tt??"canceled",AxiosError$1.ERR_CANCELED,et,rt),this.name="CanceledError"}utils$4.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(tt,et,rt){const st=rt.config.validateStatus;!rt.status||!st||st(rt.status)?tt(rt):et(new AxiosError$1("Request failed with status code "+rt.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.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),st=new Array(tt);let nt=0,ot=0,at;return et=et!==void 0?et:1e3,function(ut){const ct=Date.now(),dt=st[ot];at||(at=ct),rt[nt]=ut,st[nt]=ct;let ht=ot,ft=0;for(;ht!==nt;)ft+=rt[ht++],ht=ht%tt;if(nt=(nt+1)%tt,nt===ot&&(ot=(ot+1)%tt),ct-at<et)return;const xt=dt&&ct-dt;return xt?Math.round(ft*1e3/xt):void 0}}function throttle(tt,et){let rt=0,st=1e3/et,nt,ot;const at=(ct,dt=Date.now())=>{rt=dt,nt=null,ot&&(clearTimeout(ot),ot=null),tt(...ct)};return[(...ct)=>{const dt=Date.now(),ht=dt-rt;ht>=st?at(ct,dt):(nt=ct,ot||(ot=setTimeout(()=>{ot=null,at(nt)},st-ht)))},()=>nt&&at(nt)]}const progressEventReducer=(tt,et,rt=3)=>{let st=0;const nt=speedometer(50,250);return throttle(ot=>{const at=ot.loaded,lt=ot.lengthComputable?ot.total:void 0,ut=at-st,ct=nt(ut),dt=at<=lt;st=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[st=>et[0]({lengthComputable:rt,total:tt,loaded:st}),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,st,nt,ot){const at=[tt+"="+encodeURIComponent(et)];utils$4.isNumber(rt)&&at.push("expires="+new Date(rt).toGMTString()),utils$4.isString(st)&&at.push("path="+st),utils$4.isString(nt)&&at.push("domain="+nt),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,rt){let st=!isAbsoluteURL(et);return tt&&(st||rt==!1)?combineURLs(tt,et):et}const headersToObject=tt=>tt instanceof AxiosHeaders$1?{...tt}:tt;function mergeConfig$1(tt,et){et=et||{};const rt={};function st(ct,dt,ht,ft){return utils$4.isPlainObject(ct)&&utils$4.isPlainObject(dt)?utils$4.merge.call({caseless:ft},ct,dt):utils$4.isPlainObject(dt)?utils$4.merge({},dt):utils$4.isArray(dt)?dt.slice():dt}function nt(ct,dt,ht,ft){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct,ht,ft)}else return st(ct,dt,ht,ft)}function ot(ct,dt){if(!utils$4.isUndefined(dt))return st(void 0,dt)}function at(ct,dt){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct)}else return st(void 0,dt)}function lt(ct,dt,ht){if(ht in et)return st(ct,dt);if(ht in tt)return st(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)=>nt(headersToObject(ct),headersToObject(dt),ht,!0)};return utils$4.forEach(Object.keys({...tt,...et}),function(dt){const ht=ut[dt]||nt,ft=ht(tt[dt],et[dt],dt);utils$4.isUndefined(ft)&&ht!==lt||(rt[dt]=ft)}),rt}const resolveConfig=tt=>{const et=mergeConfig$1({},tt);let{data:rt,withXSRFToken:st,xsrfHeaderName:nt,xsrfCookieName:ot,headers:at,auth:lt}=et;if(et.headers=at=AxiosHeaders$1.from(at),et.url=buildURL(buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls),tt.params,tt.paramsSerializer),lt&&at.set("Authorization","Basic "+btoa((lt.username||"")+":"+(lt.password?unescape(encodeURIComponent(lt.password)):""))),utils$4.isFormData(rt)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)at.setContentType(void 0);else if(utils$4.isFunction(rt.getHeaders)){const ut=rt.getHeaders(),ct=["content-type","content-length"];Object.entries(ut).forEach(([dt,ht])=>{ct.includes(dt.toLowerCase())&&at.set(dt,ht)})}}if(platform.hasStandardBrowserEnv&&(st&&utils$4.isFunction(st)&&(st=st(et)),st||st!==!1&&isURLSameOrigin(et.url))){const ut=nt&&ot&&cookies.read(ot);ut&&at.set(nt,ut)}return et},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(tt){return new Promise(function(rt,st){const nt=resolveConfig(tt);let ot=nt.data;const at=AxiosHeaders$1.from(nt.headers).normalize();let{responseType:lt,onUploadProgress:ut,onDownloadProgress:ct}=nt,dt,ht,ft,xt,yt;function vt(){xt&&xt(),yt&&yt(),nt.cancelToken&&nt.cancelToken.unsubscribe(dt),nt.signal&&nt.signal.removeEventListener("abort",dt)}let Et=new XMLHttpRequest;Et.open(nt.method.toUpperCase(),nt.url,!0),Et.timeout=nt.timeout;function wt(){if(!Et)return;const St=AxiosHeaders$1.from("getAllResponseHeaders"in Et&&Et.getAllResponseHeaders()),Ct={data:!lt||lt==="text"||lt==="json"?Et.responseText:Et.response,status:Et.status,statusText:Et.statusText,headers:St,config:tt,request:Et};settle(function(jt){rt(jt),vt()},function(jt){st(jt),vt()},Ct),Et=null}"onloadend"in Et?Et.onloadend=wt:Et.onreadystatechange=function(){!Et||Et.readyState!==4||Et.status===0&&!(Et.responseURL&&Et.responseURL.indexOf("file:")===0)||setTimeout(wt)},Et.onabort=function(){Et&&(st(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,tt,Et)),Et=null)},Et.onerror=function(Rt){const Ct=Rt&&Rt.message?Rt.message:"Network Error",It=new AxiosError$1(Ct,AxiosError$1.ERR_NETWORK,tt,Et);It.event=Rt||null,st(It),Et=null},Et.ontimeout=function(){let Rt=nt.timeout?"timeout of "+nt.timeout+"ms exceeded":"timeout exceeded";const Ct=nt.transitional||transitionalDefaults;nt.timeoutErrorMessage&&(Rt=nt.timeoutErrorMessage),st(new AxiosError$1(Rt,Ct.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.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(nt.withCredentials)||(Et.withCredentials=!!nt.withCredentials),lt&&lt!=="json"&&(Et.responseType=nt.responseType),ct&&([ft,yt]=progressEventReducer(ct,!0),Et.addEventListener("progress",ft)),ut&&Et.upload&&([ht,xt]=progressEventReducer(ut),Et.upload.addEventListener("progress",ht),Et.upload.addEventListener("loadend",xt)),(nt.cancelToken||nt.signal)&&(dt=St=>{Et&&(st(!St||St.type?new CanceledError$1(null,tt,Et):St),Et.abort(),Et=null)},nt.cancelToken&&nt.cancelToken.subscribe(dt),nt.signal&&(nt.signal.aborted?dt():nt.signal.addEventListener("abort",dt)));const bt=parseProtocol(nt.url);if(bt&&platform.protocols.indexOf(bt)===-1){st(new AxiosError$1("Unsupported protocol "+bt+":",AxiosError$1.ERR_BAD_REQUEST,tt));return}Et.send(ot||null)})},composeSignals=(tt,et)=>{const{length:rt}=tt=tt?tt.filter(Boolean):[];if(et||rt){let st=new AbortController,nt;const ot=function(ct){if(!nt){nt=!0,lt();const dt=ct instanceof Error?ct:this.reason;st.abort(dt instanceof AxiosError$1?dt:new CanceledError$1(dt instanceof Error?dt.message:dt))}};let at=et&&setTimeout(()=>{at=null,ot(new AxiosError$1(`timeout ${et} of ms exceeded`,AxiosError$1.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}=st;return ut.unsubscribe=()=>utils$4.asap(lt),ut}},streamChunk=function*(tt,et){let rt=tt.byteLength;if(rt<et){yield tt;return}let st=0,nt;for(;st<rt;)nt=st+et,yield tt.slice(st,nt),st=nt},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:st}=await et.read();if(rt)break;yield st}}finally{await et.cancel()}},trackStream=(tt,et,rt,st)=>{const nt=readBytes(tt,et);let ot=0,at,lt=ut=>{at||(at=!0,st&&st(ut))};return new ReadableStream({async pull(ut){try{const{done:ct,value:dt}=await nt.next();if(ct){lt(),ut.close();return}let ht=dt.byteLength;if(rt){let ft=ot+=ht;rt(ft)}ut.enqueue(new Uint8Array(dt))}catch(ct){throw lt(ct),ct}},cancel(ut){return lt(ut),nt.return()}},{highWaterMark:2})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction:isFunction$1}=utils$4,globalFetchAPI=(({Request:tt,Response:et})=>({Request:tt,Response:et}))(utils$4.global),{ReadableStream:ReadableStream$1,TextEncoder}=utils$4.global,test=(tt,...et)=>{try{return!!tt(...et)}catch{return!1}},factory=tt=>{tt=utils$4.merge.call({skipUndefined:!0},globalFetchAPI,tt);const{fetch:et,Request:rt,Response:st}=tt,nt=et?isFunction$1(et):typeof fetch=="function",ot=isFunction$1(rt),at=isFunction$1(st);if(!nt)return!1;const lt=nt&&isFunction$1(ReadableStream$1),ut=nt&&(typeof TextEncoder=="function"?(yt=>vt=>yt.encode(vt))(new TextEncoder):async yt=>new Uint8Array(await new rt(yt).arrayBuffer())),ct=ot&&lt&&test(()=>{let yt=!1;const vt=new rt(platform.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return yt=!0,"half"}}).headers.has("Content-Type");return yt&&!vt}),dt=at&&lt&&test(()=>utils$4.isReadableStream(new st("").body)),ht={stream:dt&&(yt=>yt.body)};nt&&["text","arrayBuffer","blob","formData","stream"].forEach(yt=>{!ht[yt]&&(ht[yt]=(vt,Et)=>{let wt=vt&&vt[yt];if(wt)return wt.call(vt);throw new AxiosError$1(`Response type '${yt}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,Et)})});const ft=async yt=>{if(yt==null)return 0;if(utils$4.isBlob(yt))return yt.size;if(utils$4.isSpecCompliantForm(yt))return(await new rt(platform.origin,{method:"POST",body:yt}).arrayBuffer()).byteLength;if(utils$4.isArrayBufferView(yt)||utils$4.isArrayBuffer(yt))return yt.byteLength;if(utils$4.isURLSearchParams(yt)&&(yt=yt+""),utils$4.isString(yt))return(await ut(yt)).byteLength},xt=async(yt,vt)=>{const Et=utils$4.toFiniteNumber(yt.getContentLength());return Et??ft(vt)};return async yt=>{let{url:vt,method:Et,data:wt,signal:bt,cancelToken:St,timeout:Rt,onDownloadProgress:Ct,onUploadProgress:It,responseType:jt,headers:Pt,withCredentials:Ot="same-origin",fetchOptions:Ut}=resolveConfig(yt),Nt=et||fetch;jt=jt?(jt+"").toLowerCase():"text";let Ht=composeSignals([bt,St&&St.toAbortSignal()],Rt),Lt=null;const kt=Ht&&Ht.unsubscribe&&(()=>{Ht.unsubscribe()});let $t;try{if(It&&ct&&Et!=="get"&&Et!=="head"&&($t=await xt(Pt,wt))!==0){let qt=new rt(vt,{method:"POST",body:wt,duplex:"half"}),Qt;if(utils$4.isFormData(wt)&&(Qt=qt.headers.get("content-type"))&&Pt.setContentType(Qt),qt.body){const[Yt,tr]=progressEventDecorator($t,progressEventReducer(asyncDecorator(It)));wt=trackStream(qt.body,DEFAULT_CHUNK_SIZE,Yt,tr)}}utils$4.isString(Ot)||(Ot=Ot?"include":"omit");const Ft=ot&&"credentials"in rt.prototype,Gt={...Ut,signal:Ht,method:Et.toUpperCase(),headers:Pt.normalize().toJSON(),body:wt,duplex:"half",credentials:Ft?Ot:void 0};Lt=ot&&new rt(vt,Gt);let Mt=await(ot?Nt(Lt,Ut):Nt(vt,Gt));const Vt=dt&&(jt==="stream"||jt==="response");if(dt&&(Ct||Vt&&kt)){const qt={};["status","statusText","headers"].forEach(lr=>{qt[lr]=Mt[lr]});const Qt=utils$4.toFiniteNumber(Mt.headers.get("content-length")),[Yt,tr]=Ct&&progressEventDecorator(Qt,progressEventReducer(asyncDecorator(Ct),!0))||[];Mt=new st(trackStream(Mt.body,DEFAULT_CHUNK_SIZE,Yt,()=>{tr&&tr(),kt&&kt()}),qt)}jt=jt||"text";let Bt=await ht[utils$4.findKey(ht,jt)||"text"](Mt,yt);return!Vt&&kt&&kt(),await new Promise((qt,Qt)=>{settle(qt,Qt,{data:Bt,headers:AxiosHeaders$1.from(Mt.headers),status:Mt.status,statusText:Mt.statusText,config:yt,request:Lt})})}catch(Ft){throw kt&&kt(),Ft&&Ft.name==="TypeError"&&/Load failed|fetch/i.test(Ft.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,yt,Lt),{cause:Ft.cause||Ft}):AxiosError$1.from(Ft,Ft&&Ft.code,yt,Lt)}}},seedCache=new Map,getFetch=tt=>{let et=tt?tt.env:{};const{fetch:rt,Request:st,Response:nt}=et,ot=[st,nt,rt];let at=ot.length,lt=at,ut,ct,dt=seedCache;for(;lt--;)ut=ot[lt],ct=dt.get(ut),ct===void 0&&dt.set(ut,ct=lt?new Map:factory(et)),dt=ct;return ct};getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};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,et)=>{tt=utils$4.isArray(tt)?tt:[tt];const{length:rt}=tt;let st,nt;const ot={};for(let at=0;at<rt;at++){st=tt[at];let lt;if(nt=st,!isResolvedHandle(st)&&(nt=knownAdapters[(lt=String(st)).toLowerCase()],nt===void 0))throw new AxiosError$1(`Unknown adapter '${lt}'`);if(nt&&(utils$4.isFunction(nt)||(nt=nt.get(et))))break;ot[lt||"#"+at]=nt}if(!nt){const at=Object.entries(ot).map(([ut,ct])=>`adapter ${ut} `+(ct===!1?"is not supported by the environment":"is not available in the build"));let lt=rt?at.length>1?`since :
47
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(et){return et instanceof this?et:new this(et)}static concat(et,...rt){const st=new this(et);return rt.forEach(nt=>st.set(nt)),st}static accessor(et){const st=(this[$internals]=this[$internals]={accessors:{}}).accessors,nt=this.prototype;function ot(at){const lt=normalizeHeader(at);st[lt]||(buildAccessors(nt,at),st[lt]=!0)}return utils$4.isArray(et)?et.forEach(ot):ot(et),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$4.reduceDescriptors(AxiosHeaders$1.prototype,({value:tt},et)=>{let rt=et[0].toUpperCase()+et.slice(1);return{get:()=>tt,set(st){this[rt]=st}}});utils$4.freezeMethods(AxiosHeaders$1);function transformData(tt,et){const rt=this||defaults$4,st=et||rt,nt=AxiosHeaders$1.from(st.headers);let ot=st.data;return utils$4.forEach(tt,function(lt){ot=lt.call(rt,ot,nt.normalize(),et?et.status:void 0)}),nt.normalize(),ot}function isCancel$1(tt){return!!(tt&&tt.__CANCEL__)}function CanceledError$1(tt,et,rt){AxiosError$1.call(this,tt??"canceled",AxiosError$1.ERR_CANCELED,et,rt),this.name="CanceledError"}utils$4.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(tt,et,rt){const st=rt.config.validateStatus;!rt.status||!st||st(rt.status)?tt(rt):et(new AxiosError$1("Request failed with status code "+rt.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.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),st=new Array(tt);let nt=0,ot=0,at;return et=et!==void 0?et:1e3,function(ut){const ct=Date.now(),dt=st[ot];at||(at=ct),rt[nt]=ut,st[nt]=ct;let ht=ot,ft=0;for(;ht!==nt;)ft+=rt[ht++],ht=ht%tt;if(nt=(nt+1)%tt,nt===ot&&(ot=(ot+1)%tt),ct-at<et)return;const xt=dt&&ct-dt;return xt?Math.round(ft*1e3/xt):void 0}}function throttle(tt,et){let rt=0,st=1e3/et,nt,ot;const at=(ct,dt=Date.now())=>{rt=dt,nt=null,ot&&(clearTimeout(ot),ot=null),tt(...ct)};return[(...ct)=>{const dt=Date.now(),ht=dt-rt;ht>=st?at(ct,dt):(nt=ct,ot||(ot=setTimeout(()=>{ot=null,at(nt)},st-ht)))},()=>nt&&at(nt)]}const progressEventReducer=(tt,et,rt=3)=>{let st=0;const nt=speedometer(50,250);return throttle(ot=>{const at=ot.loaded,lt=ot.lengthComputable?ot.total:void 0,ut=at-st,ct=nt(ut),dt=at<=lt;st=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[st=>et[0]({lengthComputable:rt,total:tt,loaded:st}),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,st,nt,ot,at){if(typeof document>"u")return;const lt=[`${tt}=${encodeURIComponent(et)}`];utils$4.isNumber(rt)&&lt.push(`expires=${new Date(rt).toUTCString()}`),utils$4.isString(st)&&lt.push(`path=${st}`),utils$4.isString(nt)&&lt.push(`domain=${nt}`),ot===!0&&lt.push("secure"),utils$4.isString(at)&&lt.push(`SameSite=${at}`),document.cookie=lt.join("; ")},read(tt){if(typeof document>"u")return null;const et=document.cookie.match(new RegExp("(?:^|; )"+tt+"=([^;]*)"));return et?decodeURIComponent(et[1]):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,rt){let st=!isAbsoluteURL(et);return tt&&(st||rt==!1)?combineURLs(tt,et):et}const headersToObject=tt=>tt instanceof AxiosHeaders$1?{...tt}:tt;function mergeConfig$1(tt,et){et=et||{};const rt={};function st(ct,dt,ht,ft){return utils$4.isPlainObject(ct)&&utils$4.isPlainObject(dt)?utils$4.merge.call({caseless:ft},ct,dt):utils$4.isPlainObject(dt)?utils$4.merge({},dt):utils$4.isArray(dt)?dt.slice():dt}function nt(ct,dt,ht,ft){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct,ht,ft)}else return st(ct,dt,ht,ft)}function ot(ct,dt){if(!utils$4.isUndefined(dt))return st(void 0,dt)}function at(ct,dt){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct)}else return st(void 0,dt)}function lt(ct,dt,ht){if(ht in et)return st(ct,dt);if(ht in tt)return st(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)=>nt(headersToObject(ct),headersToObject(dt),ht,!0)};return utils$4.forEach(Object.keys({...tt,...et}),function(dt){const ht=ut[dt]||nt,ft=ht(tt[dt],et[dt],dt);utils$4.isUndefined(ft)&&ht!==lt||(rt[dt]=ft)}),rt}const resolveConfig=tt=>{const et=mergeConfig$1({},tt);let{data:rt,withXSRFToken:st,xsrfHeaderName:nt,xsrfCookieName:ot,headers:at,auth:lt}=et;if(et.headers=at=AxiosHeaders$1.from(at),et.url=buildURL(buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls),tt.params,tt.paramsSerializer),lt&&at.set("Authorization","Basic "+btoa((lt.username||"")+":"+(lt.password?unescape(encodeURIComponent(lt.password)):""))),utils$4.isFormData(rt)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)at.setContentType(void 0);else if(utils$4.isFunction(rt.getHeaders)){const ut=rt.getHeaders(),ct=["content-type","content-length"];Object.entries(ut).forEach(([dt,ht])=>{ct.includes(dt.toLowerCase())&&at.set(dt,ht)})}}if(platform.hasStandardBrowserEnv&&(st&&utils$4.isFunction(st)&&(st=st(et)),st||st!==!1&&isURLSameOrigin(et.url))){const ut=nt&&ot&&cookies.read(ot);ut&&at.set(nt,ut)}return et},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(tt){return new Promise(function(rt,st){const nt=resolveConfig(tt);let ot=nt.data;const at=AxiosHeaders$1.from(nt.headers).normalize();let{responseType:lt,onUploadProgress:ut,onDownloadProgress:ct}=nt,dt,ht,ft,xt,yt;function vt(){xt&&xt(),yt&&yt(),nt.cancelToken&&nt.cancelToken.unsubscribe(dt),nt.signal&&nt.signal.removeEventListener("abort",dt)}let Et=new XMLHttpRequest;Et.open(nt.method.toUpperCase(),nt.url,!0),Et.timeout=nt.timeout;function wt(){if(!Et)return;const St=AxiosHeaders$1.from("getAllResponseHeaders"in Et&&Et.getAllResponseHeaders()),Ct={data:!lt||lt==="text"||lt==="json"?Et.responseText:Et.response,status:Et.status,statusText:Et.statusText,headers:St,config:tt,request:Et};settle(function(jt){rt(jt),vt()},function(jt){st(jt),vt()},Ct),Et=null}"onloadend"in Et?Et.onloadend=wt:Et.onreadystatechange=function(){!Et||Et.readyState!==4||Et.status===0&&!(Et.responseURL&&Et.responseURL.indexOf("file:")===0)||setTimeout(wt)},Et.onabort=function(){Et&&(st(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,tt,Et)),Et=null)},Et.onerror=function(Rt){const Ct=Rt&&Rt.message?Rt.message:"Network Error",It=new AxiosError$1(Ct,AxiosError$1.ERR_NETWORK,tt,Et);It.event=Rt||null,st(It),Et=null},Et.ontimeout=function(){let Rt=nt.timeout?"timeout of "+nt.timeout+"ms exceeded":"timeout exceeded";const Ct=nt.transitional||transitionalDefaults;nt.timeoutErrorMessage&&(Rt=nt.timeoutErrorMessage),st(new AxiosError$1(Rt,Ct.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.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(nt.withCredentials)||(Et.withCredentials=!!nt.withCredentials),lt&&lt!=="json"&&(Et.responseType=nt.responseType),ct&&([ft,yt]=progressEventReducer(ct,!0),Et.addEventListener("progress",ft)),ut&&Et.upload&&([ht,xt]=progressEventReducer(ut),Et.upload.addEventListener("progress",ht),Et.upload.addEventListener("loadend",xt)),(nt.cancelToken||nt.signal)&&(dt=St=>{Et&&(st(!St||St.type?new CanceledError$1(null,tt,Et):St),Et.abort(),Et=null)},nt.cancelToken&&nt.cancelToken.subscribe(dt),nt.signal&&(nt.signal.aborted?dt():nt.signal.addEventListener("abort",dt)));const bt=parseProtocol(nt.url);if(bt&&platform.protocols.indexOf(bt)===-1){st(new AxiosError$1("Unsupported protocol "+bt+":",AxiosError$1.ERR_BAD_REQUEST,tt));return}Et.send(ot||null)})},composeSignals=(tt,et)=>{const{length:rt}=tt=tt?tt.filter(Boolean):[];if(et||rt){let st=new AbortController,nt;const ot=function(ct){if(!nt){nt=!0,lt();const dt=ct instanceof Error?ct:this.reason;st.abort(dt instanceof AxiosError$1?dt:new CanceledError$1(dt instanceof Error?dt.message:dt))}};let at=et&&setTimeout(()=>{at=null,ot(new AxiosError$1(`timeout ${et} of ms exceeded`,AxiosError$1.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}=st;return ut.unsubscribe=()=>utils$4.asap(lt),ut}},streamChunk=function*(tt,et){let rt=tt.byteLength;if(rt<et){yield tt;return}let st=0,nt;for(;st<rt;)nt=st+et,yield tt.slice(st,nt),st=nt},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:st}=await et.read();if(rt)break;yield st}}finally{await et.cancel()}},trackStream=(tt,et,rt,st)=>{const nt=readBytes(tt,et);let ot=0,at,lt=ut=>{at||(at=!0,st&&st(ut))};return new ReadableStream({async pull(ut){try{const{done:ct,value:dt}=await nt.next();if(ct){lt(),ut.close();return}let ht=dt.byteLength;if(rt){let ft=ot+=ht;rt(ft)}ut.enqueue(new Uint8Array(dt))}catch(ct){throw lt(ct),ct}},cancel(ut){return lt(ut),nt.return()}},{highWaterMark:2})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction:isFunction$1}=utils$4,globalFetchAPI=(({Request:tt,Response:et})=>({Request:tt,Response:et}))(utils$4.global),{ReadableStream:ReadableStream$1,TextEncoder}=utils$4.global,test=(tt,...et)=>{try{return!!tt(...et)}catch{return!1}},factory=tt=>{tt=utils$4.merge.call({skipUndefined:!0},globalFetchAPI,tt);const{fetch:et,Request:rt,Response:st}=tt,nt=et?isFunction$1(et):typeof fetch=="function",ot=isFunction$1(rt),at=isFunction$1(st);if(!nt)return!1;const lt=nt&&isFunction$1(ReadableStream$1),ut=nt&&(typeof TextEncoder=="function"?(yt=>vt=>yt.encode(vt))(new TextEncoder):async yt=>new Uint8Array(await new rt(yt).arrayBuffer())),ct=ot&&lt&&test(()=>{let yt=!1;const vt=new rt(platform.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return yt=!0,"half"}}).headers.has("Content-Type");return yt&&!vt}),dt=at&&lt&&test(()=>utils$4.isReadableStream(new st("").body)),ht={stream:dt&&(yt=>yt.body)};nt&&["text","arrayBuffer","blob","formData","stream"].forEach(yt=>{!ht[yt]&&(ht[yt]=(vt,Et)=>{let wt=vt&&vt[yt];if(wt)return wt.call(vt);throw new AxiosError$1(`Response type '${yt}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,Et)})});const ft=async yt=>{if(yt==null)return 0;if(utils$4.isBlob(yt))return yt.size;if(utils$4.isSpecCompliantForm(yt))return(await new rt(platform.origin,{method:"POST",body:yt}).arrayBuffer()).byteLength;if(utils$4.isArrayBufferView(yt)||utils$4.isArrayBuffer(yt))return yt.byteLength;if(utils$4.isURLSearchParams(yt)&&(yt=yt+""),utils$4.isString(yt))return(await ut(yt)).byteLength},xt=async(yt,vt)=>{const Et=utils$4.toFiniteNumber(yt.getContentLength());return Et??ft(vt)};return async yt=>{let{url:vt,method:Et,data:wt,signal:bt,cancelToken:St,timeout:Rt,onDownloadProgress:Ct,onUploadProgress:It,responseType:jt,headers:Pt,withCredentials:Ot="same-origin",fetchOptions:Ut}=resolveConfig(yt),Nt=et||fetch;jt=jt?(jt+"").toLowerCase():"text";let Ht=composeSignals([bt,St&&St.toAbortSignal()],Rt),Lt=null;const kt=Ht&&Ht.unsubscribe&&(()=>{Ht.unsubscribe()});let $t;try{if(It&&ct&&Et!=="get"&&Et!=="head"&&($t=await xt(Pt,wt))!==0){let qt=new rt(vt,{method:"POST",body:wt,duplex:"half"}),Qt;if(utils$4.isFormData(wt)&&(Qt=qt.headers.get("content-type"))&&Pt.setContentType(Qt),qt.body){const[Yt,tr]=progressEventDecorator($t,progressEventReducer(asyncDecorator(It)));wt=trackStream(qt.body,DEFAULT_CHUNK_SIZE,Yt,tr)}}utils$4.isString(Ot)||(Ot=Ot?"include":"omit");const Ft=ot&&"credentials"in rt.prototype,Gt={...Ut,signal:Ht,method:Et.toUpperCase(),headers:Pt.normalize().toJSON(),body:wt,duplex:"half",credentials:Ft?Ot:void 0};Lt=ot&&new rt(vt,Gt);let Mt=await(ot?Nt(Lt,Ut):Nt(vt,Gt));const Vt=dt&&(jt==="stream"||jt==="response");if(dt&&(Ct||Vt&&kt)){const qt={};["status","statusText","headers"].forEach(lr=>{qt[lr]=Mt[lr]});const Qt=utils$4.toFiniteNumber(Mt.headers.get("content-length")),[Yt,tr]=Ct&&progressEventDecorator(Qt,progressEventReducer(asyncDecorator(Ct),!0))||[];Mt=new st(trackStream(Mt.body,DEFAULT_CHUNK_SIZE,Yt,()=>{tr&&tr(),kt&&kt()}),qt)}jt=jt||"text";let Bt=await ht[utils$4.findKey(ht,jt)||"text"](Mt,yt);return!Vt&&kt&&kt(),await new Promise((qt,Qt)=>{settle(qt,Qt,{data:Bt,headers:AxiosHeaders$1.from(Mt.headers),status:Mt.status,statusText:Mt.statusText,config:yt,request:Lt})})}catch(Ft){throw kt&&kt(),Ft&&Ft.name==="TypeError"&&/Load failed|fetch/i.test(Ft.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,yt,Lt),{cause:Ft.cause||Ft}):AxiosError$1.from(Ft,Ft&&Ft.code,yt,Lt)}}},seedCache=new Map,getFetch=tt=>{let et=tt&&tt.env||{};const{fetch:rt,Request:st,Response:nt}=et,ot=[st,nt,rt];let at=ot.length,lt=at,ut,ct,dt=seedCache;for(;lt--;)ut=ot[lt],ct=dt.get(ut),ct===void 0&&dt.set(ut,ct=lt?new Map:factory(et)),dt=ct;return ct};getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};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;function getAdapter$1(tt,et){tt=utils$4.isArray(tt)?tt:[tt];const{length:rt}=tt;let st,nt;const ot={};for(let at=0;at<rt;at++){st=tt[at];let lt;if(nt=st,!isResolvedHandle(st)&&(nt=knownAdapters[(lt=String(st)).toLowerCase()],nt===void 0))throw new AxiosError$1(`Unknown adapter '${lt}'`);if(nt&&(utils$4.isFunction(nt)||(nt=nt.get(et))))break;ot[lt||"#"+at]=nt}if(!nt){const at=Object.entries(ot).map(([ut,ct])=>`adapter ${ut} `+(ct===!1?"is not supported by the environment":"is not available in the build"));let lt=rt?at.length>1?`since :
48
48
  `+at.map(renderReason).join(`
49
- `):" "+renderReason(at[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+lt,"ERR_NOT_SUPPORT")}return nt},adapters:knownAdapters};function throwIfCancellationRequested(tt){if(tt.cancelToken&&tt.cancelToken.throwIfRequested(),tt.signal&&tt.signal.aborted)throw new CanceledError$1(null,tt)}function dispatchRequest(tt){return throwIfCancellationRequested(tt),tt.headers=AxiosHeaders$1.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$4.adapter,tt)(tt).then(function(st){return throwIfCancellationRequested(tt),st.data=transformData.call(tt,tt.transformResponse,st),st.headers=AxiosHeaders$1.from(st.headers),st},function(st){return isCancel$1(st)||(throwIfCancellationRequested(tt),st&&st.response&&(st.response.data=transformData.call(tt,tt.transformResponse,st.response),st.response.headers=AxiosHeaders$1.from(st.response.headers))),Promise.reject(st)})}const VERSION$1="1.12.2",validators$1={};["object","boolean","number","function","string","symbol"].forEach((tt,et)=>{validators$1[tt]=function(st){return typeof st===tt||"a"+(et<1?"n ":" ")+tt}});const deprecatedWarnings={};validators$1.transitional=function(et,rt,st){function nt(ot,at){return"[Axios v"+VERSION$1+"] Transitional option '"+ot+"'"+at+(st?". "+st:"")}return(ot,at,lt)=>{if(et===!1)throw new AxiosError$1(nt(at," has been removed"+(rt?" in "+rt:"")),AxiosError$1.ERR_DEPRECATED);return rt&&!deprecatedWarnings[at]&&(deprecatedWarnings[at]=!0,console.warn(nt(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,st)=>(console.warn(`${st} is likely a misspelling of ${et}`),!0)};function assertOptions(tt,et,rt){if(typeof tt!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const st=Object.keys(tt);let nt=st.length;for(;nt-- >0;){const ot=st[nt],at=et[ot];if(at){const lt=tt[ot],ut=lt===void 0||at(lt,ot,tt);if(ut!==!0)throw new AxiosError$1("option "+ot+" must be "+ut,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(rt!==!0)throw new AxiosError$1("Unknown option "+ot,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{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(st){if(st instanceof Error){let nt={};Error.captureStackTrace?Error.captureStackTrace(nt):nt=new Error;const ot=nt.stack?nt.stack.replace(/^.+\n/,""):"";try{st.stack?ot&&!String(st.stack).endsWith(ot.replace(/^.+\n.+\n/,""))&&(st.stack+=`
50
- `+ot):st.stack=ot}catch{}}throw st}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:st,paramsSerializer:nt,headers:ot}=rt;st!==void 0&&validator.assertOptions(st,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),nt!=null&&(utils$4.isFunction(nt)?rt.paramsSerializer={serialize:nt}:validator.assertOptions(nt,{encode:validators.function,serialize:validators.function},!0)),rt.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?rt.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:rt.allowAbsoluteUrls=!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$1.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,ft;if(!ut){const yt=[dispatchRequest.bind(this),void 0];for(yt.unshift(...lt),yt.push(...ct),ft=yt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(yt[ht++],yt[ht++]);return dt}ft=lt.length;let xt=rt;for(;ht<ft;){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,ft=ct.length;ht<ft;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls);return buildURL(rt,et.params,et.paramsSerializer)}};utils$4.forEach(["delete","get","head","options"],function(et){Axios$1.prototype[et]=function(rt,st){return this.request(mergeConfig$1(st||{},{method:et,url:rt,data:(st||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(st){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:st?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios$1.prototype[et]=rt(),Axios$1.prototype[et+"Form"]=rt(!0)});let CancelToken$1=class sm{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 st=this;this.promise.then(nt=>{if(!st._listeners)return;let ot=st._listeners.length;for(;ot-- >0;)st._listeners[ot](nt);st._listeners=null}),this.promise.then=nt=>{let ot;const at=new Promise(lt=>{st.subscribe(lt),ot=lt}).then(nt);return at.cancel=function(){st.unsubscribe(ot)},at},et(function(ot,at,lt){st.reason||(st.reason=new CanceledError$1(ot,at,lt),rt(st.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=st=>{et.abort(st)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new sm(function(nt){et=nt}),cancel:et}}};function spread$1(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError$1(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode$1={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$1).forEach(([tt,et])=>{HttpStatusCode$1[et]=tt});function createInstance(tt){const et=new Axios$1(tt),rt=bind$3(Axios$1.prototype.request,et);return utils$4.extend(rt,Axios$1.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(nt){return createInstance(mergeConfig$1(tt,nt))},rt}const axios=createInstance(defaults$4);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function m$3(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$2=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,st=et,nt=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(st))+" "+nt[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 st=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:st,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,st,nt){return st>nt&&(et=Math.round(et*nt/st),st=nt),et>rt&&(st=Math.round(st*rt/et),et=rt),{height:et,width:st}}static renameFileNameExtension(et,rt){const st=et.split(".");return st.pop(),st.join(".")+"."+rt}static resizeImage(et,rt,st,nt,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const ft=this.changeDimension(ht,nt,dt,st);dt=ft.width,ht=ft.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,st=1440,nt=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,st,ot,nt);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$5=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$5(this,"wordExtensions",new Set),n$5(this,"excelExtensions",new Set),n$5(this,"pptExtensions",new Set),n$5(this,"fileExtensionMap",new Map),n$5(this,"csvContentType",new Set),n$5(this,"csvExtensions",new Set),n$5(this,"txtExtensions",new Set),n$5(this,"mdExtensions",new Set),n$5(this,"PDF","application/pdf"),n$5(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 st=this.getExtensionForContentType(et);return st?this.wordExtensions.has(st):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.excelExtensions.has(st):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 st=this.getExtensionForContentType(et);return st?this.pptExtensions.has(st):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.txtExtensions.has(st):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.mdExtensions.has(st):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$5(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$4=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 T$1=Object.defineProperty,P$2=(tt,et,rt)=>et in tt?T$1(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$3=(tt,et,rt)=>P$2(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$4={VIDEO:"video"},b$1=class Iu{constructor(et){n$3(this,"name"),n$3(this,"listeners",new Set),this.name=et}static getChannel(et){let rt=Iu.channels.get(et);return rt||(rt=new Iu(et),Iu.channels.set(et,rt)),rt}listen(et){return this.listeners.add(et),()=>{this.listeners.delete(et)}}publish(et){for(const rt of Array.from(this.listeners))try{rt(et)}catch(st){console.error("[SimpleChannel] publish failed",st)}}close(){this.listeners.clear(),Iu.channels.delete(this.name)}};n$3(b$1,"channels",new Map);let SimpleChannel=b$1;class Subscription{constructor(et,rt){n$3(this,"revoke"),this._channel=et,this.revoke=this.setReceiver(st=>rt==null?void 0:rt(st))}setReceiver(et){if(!this._channel)return()=>{};const rt=this._channel.listen(et);return()=>{rt(),this._channel=void 0}}}class Subject{constructor(){n$3(this,"publishChannels",new Map)}getChannelName(et){return"Subject:"+et}getPublishChannel(et){const rt=this.getChannelName(et);let st=this.publishChannels.get(rt);return st||(st=this.newChannel(et),this.publishChannels.set(rt,st)),st}newChannel(et){const rt=this.getChannelName(et);return SimpleChannel.getChannel(rt)}publish(et,rt){typeof et=="string"&&this.getPublishChannel(et).publish(rt)}subscribe(et,rt){if(typeof et=="string"){const st=this.newChannel(et);return new Subscription(st,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$3(this,"_resolution"),n$3(this,"_rejection"),n$3(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$3(this,"promises",{}),n$3(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$3(this,"axios"),n$3(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 st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}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(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}post(et,rt,st){return this.axios.post(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}postFile(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}postJson(et,rt,st){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(st)).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}put(et,rt,st){return this.axios.put(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}putJson(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(st=>this.mapAxiosResponse(st)).catch(st=>this.mapAxiosError(st))}getScript(et,rt,st){const nt=st??"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 ${nt.split(".")[0]}={};${at};return ${nt};`;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(st=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){n$3(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$3(this,"_me",null),n$3(this,"_currentLanguage",""),n$3(this,"_notLoggedIn",!0),n$3(this,"_description"),n$3(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(st=>st.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const st=rt.right||rt,nt=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[st]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return nt&&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$3(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),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$3(this,"_conf"),n$3(this,"_loaded"),n$3(this,"skinName",""),n$3(this,"themeName",""),n$3(this,"skin","raw"),n$3(this,"themeUrl","/assets/themes/raw/default/"),n$3(this,"templateOverrides",{}),n$3(this,"portalTemplate","/assets/themes/raw/portal.html"),n$3(this,"basePath",""),n$3(this,"logoutCallback",""),n$3(this,"skins",[]),n$3(this,"is1D",!1),n$3(this,"is2D",!1),n$3(this,"_onSkinReady",notify.onSkinReady()),n$3(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,st;const nt=await this.listSkins();this.is1D=((rt=nt.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((st=nt.find(ot=>ot.child===this.skin))==null?void 0:st.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,st)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.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(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),st()})})}loadConnected(et){return new Promise((rt,st)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),rt()}).catch(nt=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}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(st=>st.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(st=>st.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 st=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}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,st){const nt=promises$1[rt];if(nt)st&&nt.then(st).catch(st);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 st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}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 UserPreferences{constructor(){n$3(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(st=>{try{return JSON.parse(st.preference)}catch{return rt??{}}}).then(st=>(this.data[et]=st??{},st))}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$3(this,"_me",null),n$3(this,"_keepOpenOnLogout",!1),n$3(this,"_preferences",new UserPreferences),n$3(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 st;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,st={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",st);return}else st=rt;st||(st={bookmarks:[],applications:[]});let nt=!0;const ot=[];st.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),nt=!1}),ot.forEach(at=>{const lt=st.bookmarks.indexOf(at);lt!==-1&&st.bookmarks.splice(lt,1)}),nt||transport.http.putJson("/userbook/preference/apps",st)})}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$3(this,"_publicConf",{}),n$3(this,"_currentApp"),n$3(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(st=>{if(st!=null&&st.prefix){const nt=st.prefix.replace("/","");this._appConf[nt]=st}else st!=null&&st.name&&st.name.toLowerCase()==et&&(rt=st)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){n$3(this,"_status","void"),n$3(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(st=>!rt||st.type===et||st.type==="multiple"?st[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,st=session.session.description;let nt;for(const ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.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||!nt.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:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st.profiles&&st.profiles.length>0?ut[st.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){n$3(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$3(this,"School",{}),n$3(this,"User",new User)}async initialize(et,rt){if(!et){const nt=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${nt(lt)}${nt(ut)}`}const st=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(st),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(st)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var D$2;(D$2=session==null?void 0:session.session)==null||D$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},st){this.set(`${et}:main`,st),this.set(`${et}:${rt}`,st)}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},st){const nt=this.get(`${et}:${rt}`);if(nt===void 0)throw`Service not found: ${et}:${rt}`;return nt(st)}}const m$2=class{constructor(et){n$3(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(st=>{rt.append("activityType[]",st)}),et.subjectArea.forEach(st=>{rt.append("subjectArea[]",st)}),et.age.forEach(st=>{rt.append("age[]",st.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(st=>{rt.append("keyWords[]",st.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 st=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(st)}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 st=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(st)}async trashAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(nt)}async restoreAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(nt)}async mapAssetIdToIds({application:et,assetIds:rt}){const st=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(nt=>{const ot=st.resources.find(at=>at.assetId===nt);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(st=>st.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[[st,nt]]=Object.entries(et.orders);rt.order_by=`${st}:${nt}`}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$3(m$2,"registry",new ServiceRegistry),n$3(m$2,"register",m$2.registry.register.bind(m$2.registry)),n$3(m$2,"findService",m$2.registry.findService.bind(m$2.registry)),n$3(m$2,"findMainService",m$2.registry.findMainService.bind(m$2.registry)),n$3(m$2,"isRegistered",m$2.registry.isRegistered.bind(m$2.registry));let ResourceService=m$2;const APP$3="scrapbook",RESOURCE$3="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$3}getApplication(){return APP$3}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$3,resourceType:RESOURCE$3},tt=>new ScrapbookResourceService(tt));const APP$2="homeworks",RESOURCE$2="homeworks";class HomeworksResourceService extends ResourceService{async create(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.post("/homeworks",{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats,folder:et.folder});return this.checkHttpResponse(st),{thumbnail:rt,entId:st._id}}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/homeworks/${et.entId}`,{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$2}getApplication(){return APP$2}getFormUrl(et){return et?`/homeworks?folderid=${et}#/create-homeworks/`:"/homeworks#/create-homeworks/"}getViewUrl(et){return`/homeworks#/view-homeworks/${et}`}getPrintUrl(et){return`/homeworks/print#/print-homeworks/${et}`}getEditUrl(et){return`/homeworks#/edit-homeworks/${et}`}getExportUrl(){throw new Error("Export not implemented.")}}ResourceService.register({application:RESOURCE$2,resourceType:RESOURCE$2},tt=>new HomeworksResourceService(tt));const APP$1="timelinegenerator",RESOURCE$1="timelinegenerator";class TimelineGeneratorResourceService extends ResourceService{async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=await this.http.post("/timelinegenerator/timelines",{headline:et.name,text:et.description,icon:rt,type:"default",folder:et.folder});return this.checkHttpResponse(st),st}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/timelinegenerator/timeline/${et.entId}`,{headline:et.name,text:et.description,icon:rt,trashed:!!et.trashed,_id:et.entId,type:"default"});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$1}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/timelinegenerator#/view/${et}`}getPrintUrl(et){return`/timelinegenerator/print#/print/${et}`}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new TimelineGeneratorResourceService(tt));const APP$5="collaborativeeditor",RESOURCE$4="collaborativeeditor";class CollaborativeEditorResourceService extends ResourceService{async create(et){const{name:rt,description:st,thumbnail:nt,folder:ot}=et,at=nt?await this.getThumbnailPath(nt):"",lt=await this.http.post("/collaborativeeditor",{name:rt,description:st,thumbnail:at,folder:ot});return this.checkHttpResponse(lt),lt}async update(et){const{name:rt,description:st,thumbnail:nt,entId:ot}=et,at=await this.getThumbnailPath(nt),lt=await this.http.put(`/collaborativeeditor/${ot}`,{name:rt,description:st,thumbnail:at});return this.checkHttpResponse(lt),{thumbnail:at,entId:ot}}getResourceType(){return RESOURCE$4}getApplication(){return APP$5}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/collaborativeeditor#/view/${et}`}getPrintUrl(){throw new Error("Method not implemented.")}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$4,resourceType:RESOURCE$4},tt=>new CollaborativeEditorResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,st){if(mutexPromise[et]!==void 0&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=rt();mutexPromise[et]=nt;const ot=await nt;return st(ot)&&(globalCache[et]=ot),ot}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}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 st=await this.http.get(et,rt),nt={...this.http.latestResponse};return{value:st,response:nt}},({response:st})=>!(st.status<200||st.status>=300))}async httpGetJson(et,rt){const{response:st,value:nt}=await this.httpGet(et,rt);if(st.status<200||st.status>=300)throw`Bad http status (${st.status}) for url: ${et}`;return nt}}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,st]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:st===void 0}),this.getWebAppConf({app:et,applications:st??[]})]),at={app:et,applications:st??[],conf:rt,currentApp:ot,theme:nt};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:st}=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 st}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(st=>{if(st!=null&&st.prefix)return(st==null?void 0:st.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:st}){var nt;const ot=await this.http.get("/theme"),at=(nt=rt==null?void 0:rt.overriding)==null?void 0:nt.find(ft=>st?ft.parent==="theme-open-ent"&&ft.bootstrapVersion==="ode-bootstrap-neo":ft.child===(ot==null?void 0:ot.themeName)),lt=st?"default":(ot==null?void 0:ot.skinName)||(at==null?void 0:at.skins[0]),ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at==null?void 0:at.child}/skins/${lt}/`,ct=at==null?void 0:at.skins,dt=at==null?void 0:at.bootstrapVersion.split("-").slice(-1)[0],ht=(at==null?void 0:at.parent)==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"",skin:at==null?void 0:at.child,skinName:lt,skins:ct,themeName:at==null?void 0:at.child,themeUrl:ut,npmTheme:(at==null?void 0:at.npmTheme)??void 0}}async getLogoutCallback(et){const{response:rt,value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return st.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,st="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${st}`:"/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:st,name:nt,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:st,displayName:nt,groups:rt.map(({name:at,id:lt,nbUsers:ut})=>({nbUsers:ut,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:st,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const ot=nt.map(ht=>typeof ht=="string"?ht:ht.id),at=st.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:ft,groups:xt,id:yt,users:vt}=await this.getBookMarkById(ht),Et=vt.map(bt=>bt.id),wt=xt.map(bt=>bt.id);return{displayName:ft,id:yt,members:[...wt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,ft)=>[...ht,...ft],[]),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$3(this,"axios"),n$3(this,"baseUrl"),n$3(this,"headers",{}),n$3(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 st=rt.headers??{};return rt.headers={...st,...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 st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}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:st,statusText:nt,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:st,statusText:nt,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 st=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async post(et,rt,st){try{const nt=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async postFile(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async postJson(et,rt,st){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async put(et,rt,st){try{const nt=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async patch(et,rt,st){try{const nt=await this.axios.patch(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.patch(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.patch(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async delete(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async deleteJson(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(st)}catch(st){throw this.mapAxiosError(st)}}getScript(et,rt,st){const nt=st??"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 ${nt.split(".")[0]}={};${at};return ${nt};`;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(st=>{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},st,nt){const ot=nt.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===st||rt.includes(at.id)&&at.type==="group"&&at.right===st)return!0;return!1}async sessionHasResourceRight(et,rt){try{const st=await this.session.getUser();return!!st&&this.hasResourceRight({groupIds:st.groupsIds,id:st.userId},et,rt)}catch(st){return console.error(`Unexpected error ${st} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const st of et)if(await this.sessionHasResourceRight(st,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let st=0;for(const nt of rt)await this.sessionHasResourceRight(et,nt)&&st++;return st===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const st of et){let nt=0;for(const ot of rt)await this.sessionHasResourceRight(st,ot)&&nt++;if(nt===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(st=>st===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(st=>st.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const st=await this.session.getUser();for(const nt of et)rt[nt]=!!st&&this.hasWorkflowRight(nt,st.authorizedActions.map(ot=>ot.name))}catch(st){console.error(`Unexpected error ${st} in sessionHasWorkflowRights()`);for(const nt of et)rt[nt]=!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,st,nt,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:st,currentLanguage:rt,userDescription:nt,userProfile:ot,bookmarkedApps:at}}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),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(st){return console.error(st),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let st;return rt?st=await this.loadUserLanguage():st=await this.loadDefaultLanguage(),st}catch(st){console.error(st)}}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(st=>st.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,st]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...st,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 st=JSON.parse(rt.preference);let nt;nt=st,nt||(nt={bookmarks:[],applications:[]});const ot=[];return nt.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,st;const{options:nt={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,nt);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((st=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:st.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(st=>{var nt;return st!=null&&st.prefix?(st==null?void 0:st.prefix.replace("/",""))===et||!1:st!=null&&st.address&&((nt=st.address)==null?void 0:nt.split("/")[1])===et||!1})}}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 st=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,st){this.loadBundle(et,rt,st)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,st){const nt=promises[rt];if(nt)st&&nt.then(st).catch(st);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 st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[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,st){const nt=StringUtils.removeAccents(st).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${st}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),yt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ht||"").toLowerCase();return yt.includes(nt)||xt.includes(nt)||ft.includes(nt)||vt.includes(nt)}).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(nt)).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(nt)).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 st of Object.keys(rt))if(st.includes(".")){const nt=st.split(".")[1],ot=rt[st];delete rt[st],rt[nt]=ot}return rt}getActionsAvailableFor({id:et,type:rt},st,nt){const ot=(rt==="user"?st.users.checked[et]:st.groups.checked[et])||[],at=Object.keys(nt),lt=[];for(const ut of at)nt[ut].filter(ct=>ot.includes(ct)).length>0&&lt.push(ut);return lt}async getRightsForResource(et,rt){const st=await this.directory.getBookMarks(),nt=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(nt),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,labels:Et})=>({labels:Et,displayName:xt||vt,id:yt})),ft=ot.users.visibles.map(({id:xt,profile:yt,username:vt,firstName:Et,lastName:wt,login:bt})=>({displayName:vt,firstName:Et,lastName:wt,login:bt,profile:yt,id:xt}));return{rights:dt,visibleBookmarks:st,visibleGroups:ht,visibleUsers:ft}}async saveRights(et,rt,st){const nt=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of st){const ut=lt.actions.map(dt=>nt[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"),st=await this.getShareMapping(et);return Object.keys(rt).map(nt=>{const ot=rt[nt];return{displayName:nt,id:nt,priority:ot.priority,requires:ot.requires}}).filter(nt=>{var ot;return((ot=st[nt.id])==null?void 0:ot.length)>0}).sort((nt,ot)=>nt.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}},C$2=class nm{static getRole(et){var rt,st;return nm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(st=et.metadata)==null?void 0:st.extension)}static role(et,rt=!1,st){if(st&&(st=st.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const nt={type:et,previewRole:rt,extension:st};for(const ot of this.roleMappers){const at=ot(nt);if(at)return at}return"unknown"}};n$3(C$2,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=C$2;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",st=rt.split("."),nt=et.type||"application/octet-stream",ot=st.length>1?st[st.length-1]:"",at={"content-type":nt,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(nt,!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:st,metadata:nt}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,st);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}`),nt.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,st){const{fullname:nt,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,nt);const lt=[];ot.role==="img"&&lt.push("quality=1"),st!=null&&st.alt&&lt.push(`alt=${st.alt}`),st!=null&&st.legend&&lt.push(`legend=${st.legend}`),st!=null&&st.name&&lt.push(`name=${st.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(st=>st._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 st=>st.deleted&&st.trasher?(rt==null?void 0:rt.userId)==st.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],st=await this.acceptDocuments(et);return rt.filter(st)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,st="protected"){const nt=[];if(et.forEach(ot=>{(st==="public"&&!ot.public||!ot.public&&!ot.protected)&&nt.push(ot)}),nt.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:st,ids:nt.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return nt.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,st=0){var nt,ot;const at=rt>0||st>0?`${rt}x${st}`:"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=(nt=et.metadata)==null?void 0:nt["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}}listFolder(et,rt=!1,st,nt){const ot={filter:et,hierarchical:rt,parentId:st,directShared:nt};return this.http.get("/workspace/folders/list",{queryParams:ot})}listOwnerFolders(et,rt){return this.listFolder("owner",et,rt)}listSharedFolders(et,rt){return this.listFolder("shared",et,rt,!0)}createFolder(et,rt){const st=new FormData;return st.append("name",et),rt&&st.append("parentFolderId",rt),this.http.postFile("/workspace/folder",st)}}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 st=rt.LIBELLE_SERVICE.default||null;for(const nt in rt.LIBELLE_SERVICE)if(nt!=="default"&&tt.indexOf(nt)>=0){st=rt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:st,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(),st=await this.session.getUserProfile();let nt;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.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:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st&&st.length>0?ut[st[0]]??"":""}}}const R$1=class Y0{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$4.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??Y0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??Y0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(st=>st.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:st,duration:nt}){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",""+st);let lt=`/video/encode?captation=${st}`;nt&&(lt+=`&duration=${nt}`);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 ft=await this.http.get(`/video/status/${ut.processid}`);if(ft.state=="succeed")return ft.videoworkspaceid&&ft.videosize&&this.context.data().trackVideoSave(ft.videoworkspaceid,Math.round(nt),ft.videosize,st,et.url,ot,et.device),ft;if(ft.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};n$3(R$1,"MAX_WEIGHT",50),n$3(R$1,"MAX_DURATION",3);let VideoService=R$1;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 st of et)if(this.isUrlFromProvider(rt,st))return st}urlIsFromPattern(et,rt){const st=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),nt=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(st)||[],lt=[];return(rt.match(nt)||[]).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 st of rt.url)if(this.urlIsFromPattern(et,st))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const st of et.url)if(this.urlIsFromPattern(rt,st)){const nt=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=st.match(nt)||[];let at=et.embed;for(const lt of ot){let ut=st.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=st.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const ft=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(ft,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){n$3(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 st=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:st,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","actualites"),n$3(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{let 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$3(this,"APP","blog"),n$3(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const st=await this.httpGet("/blog/linker"),nt=[];st.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}));nt.push(...at)}),et(nt)}catch(st){rt(st)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","collaborativewall"),n$3(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$3(this,"APP","community"),n$3(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{let 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$3(this,"APP","exercizer"),n$3(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 st,nt=!1;const ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(nt=!0,st=ot.groupList[0].name):ot.userList.length>0?(nt=!0,st=ot.userList[0].name):st="",ot.groupList.length+ot.userList.length>1&&(st+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:st,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:nt,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","formulaire"),n$3(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$3(this,"APP","forum"),n$3(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$3(this,"APP","homeworks"),n$3(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$3(this,"APP","magneto"),n$3(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$3(this,"APP","mindmap"),n$3(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$3(this,"APP","pages"),n$3(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(st=>{var nt;const ot=st.thumbnail?st.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:st.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})),(nt=st.pages)==null||nt.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id+"/"+at.titleLink,_id:st._id+"/"+at.titleLink,shared:typeof st.shared<"u",modified:st.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","poll"),n$3(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$3(this,"APP","scrapbook"),n$3(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$3(this,"APP","timelinegenerator"),n$3(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const st=(await this.httpGet("/timelinegenerator/timelines")).map(nt=>{const ot=nt.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:nt.headline,ownerName:nt.owner.displayName,owner:nt.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})});et(st)}catch(st){rt(st)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","wiki"),n$3(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let st;return typeof et.thumbnail>"u"||et.thumbnail===""?st="/img/icons/glyphicons_036_file.png":st=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:st,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$3(this,"APP","workspace"),n$3(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(st,nt)=>{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})});st(at)}catch(ot){nt(ot)}})}}const w$3=class{static async initialize(et,rt){const st=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[nt,ot]=await Promise.all([st.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&nt!=null&&nt.length&&(this.resourceProducingApps=nt.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(nt){console.warn("Failed to load resource-producing apps:",nt)}}return this.resourceProducingApps}static registerCustomBehaviour(et,rt,st){this.registry.register({application:et,resourceType:rt},st)}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const st={application:et,resourceType:rt};this.registry.register(st,nt=>this.serviceFor(nt,et,rt))})}static serviceFor(et,rt,st){let nt;switch(st){case"timelinegenerator":nt=new TimelinegeneratorBehaviour(et);break;case"workspace":nt=new WorkspaceBehaviour(et);break;case"blog":nt=new BlogBehaviour(et);break;case"actualites":nt=new ActualitesBehaviour(et);break;case"wiki":nt=new WikiBehaviour(et);break;case"pages":nt=new PagesBehaviour(et);break;case"poll":nt=new PollBehaviour(et);break;case"community":nt=new CommunityBehaviour(et);break;case"mindmap":nt=new MindmapBehaviour(et);break;case"forum":nt=new ForumBehaviour(et);break;case"homeworks":nt=new HomeworksBehaviour(et);break;case"scrapbook":nt=new ScrapbookBehaviour(et);break;case"collaborativewall":nt=new CollaborativewallBehaviour(et);break;case"exercizer":nt=new ExercizerBehaviour(et);break;case"formulaire":nt=new FormulaireBehaviour(et);break;case"magneto":nt=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return nt.APP=rt,nt}};n$3(w$3,"registry",new ServiceRegistry),n$3(w$3,"findBehaviour",w$3.registry.findService.bind(w$3.registry)),n$3(w$3,"hasBehaviour",w$3.registry.isRegistered.bind(w$3.registry)),n$3(w$3,"resourceProducingApps",[]);let SnipletsService=w$3;const SEND_ALL="*";class WebBroker{constructor(et){n$3(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(st=>SEND_ALL===st||et.data["event-type"]===st)>=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,st=>this.dispatchEvent(st,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){n$3(this,"_webBroker"),n$3(this,"app"),n$3(this,"user"),n$3(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,st,nt,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:this.app||"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,st,nt,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:nt,source:rt?"CAPTURED":"UPLOADED",url:st});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,st){this.context=et,this.module=rt,this.resourceType=st}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,st){const nt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${st}`);return this.http.isResponseError()?void 0:nt}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,st){this.context=et,this.module=rt,this.resourceType=st}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,st){this.context=et,this.module=rt,this.resourceType=st}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$3(this,"_analytics"),n$3(this,"_cache"),n$3(this,"_conf"),n$3(this,"_data"),n$3(this,"_directory"),n$3(this,"_http"),n$3(this,"_idiom"),n$3(this,"_notify"),n$3(this,"_rights"),n$3(this,"_session"),n$3(this,"_share"),n$3(this,"_video"),n$3(this,"_workspace"),n$3(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={OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",DELETE:"delete",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PUBLISH:"publish"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(st=>st.id===tt&&st.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$3(this,"_initialized"),n$3(this,"_widgets",[]),n$3(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(st=>{var nt;st&&st.widgets?(st.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()})):(nt=this._initialized)==null||nt.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,st=[];rt.listSkins().then(nt=>{var ot;const at=((ot=nt.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&&st.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$3(this,"_schoolConf",{}),n$3(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:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=st.has(tt.id),dt=nt==null?void 0:nt.current.has(tt.id),ht=rt===tt.id,ft=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":ft,"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"]}}),wt=Pt=>at==null?void 0:at(Pt),bt=Pt=>lt==null?void 0:lt(Pt),St=Pt=>ut==null?void 0:ut(Pt),Rt=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),at==null||at(tt.id))},Ct=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),lt==null||lt(tt.id))},It=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:vt("foldUnfold"),width:yt,height:yt}),jt=()=>{var Pt;const Ot=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),Ut=Array.isArray(tt.children)&&tt.children.length>0;return dt||Ot&&Ut};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:()=>bt(tt.id),onKeyDown:Ct,"aria-label":vt("foldUnfold"),children:jt()&&It(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>wt(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:()=>St(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(Pt=>jsxRuntimeExports.jsx(TreeNode,{node:Pt,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},Pt.id))})]})},tt.id)};var __defProp=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp(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 st=findTreeNode(rt,et);if(st)return st}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const st=findNodeById(rt,et);if(st)return st}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const st=findNodeById(rt,et);if(st)return st}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,st=>{var nt;if(st.id===et){const ot=[...((nt=st.folder)==null?void 0:nt.ancestors)||[]],at=arrayUnique([...ot,st.id]);return{...st,children:[...st.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return st})}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 st=findParentNode(rt,et);if(st)return st}};function getAncestors(tt,et){var rt;const st=findNodeById(tt,et);return(rt=st==null?void 0:st.folder)!=null&&rt.ancestors?[...(st==null?void 0:st.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 st;const nt=et(tt,rt);if((st=nt==null?void 0:nt.children)!=null&&st.length){const ot=[];for(const at of(nt==null?void 0:nt.children)||[]){const lt=doModify(at,et,nt);lt&&ot.push(lt)}return{...nt,children:ot}}return nt}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(st,nt)=>{var ot,at;if(et===st.id){const lt=[...((ot=st.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,st.id]),ct=[...st.children||[]],dt=((at=st.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const ft=findNodeById(st,ht);ft&&ct.push({...ft,folder:{...ft==null?void 0:ft.folder,ancestors:ut}})}return{...st,children:ct}}else return rt.includes(st.id)&&et!==(nt==null?void 0:nt.id)?void 0:st})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,st=>(st.id===rt&&(st.children=et==null?void 0:et.map(nt=>new TreeNodeFolderWrapper(nt))),st));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,st=>st.id===et?new TreeNodeFolderWrapper(rt):st)}function findPathById(tt,et){let rt=[];function st(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(st(lt,at.concat(ot.id)))return!0}return!1}function nt(ot){if(Array.isArray(ot)){for(const at of ot)if(st(at,[]))break}else st(ot,[])}return nt(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:st,allExpandedNodes:nt,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),ft=reactExports.useRef(new Set),[xt,yt]=reactExports.useState(void 0),vt=ut??rt;function Et(Nt){var Ht;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:$t})=>$t!==Lt.id).some($t=>$t.children&&$t.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach($t=>{var Ft;const Gt=(Ft=Lt.children)==null?void 0:Ft.filter(({id:Mt})=>Mt!==$t.id);Gt!=null&&Gt.some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add($t.id),Et($t)})}):(Ht=Nt.children)==null||Ht.forEach(Lt=>{var kt;const $t=new Set(ft.current),Ft=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Ft!=null&&Ft.some(Gt=>Gt.children&&Gt.children.length>0)&&($t.add(Lt.id),ft.current=$t),Et(Lt)})}const wt=Nt=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ht.add(Lt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&Ut(st.overId),yt(st.overId)):yt(void 0)},[st]);const bt=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Nt){Pt(Nt)},allExpandedNodes(){wt(nt)}}),[]);reactExports.useImperativeHandle(et,()=>bt,[bt]),reactExports.useEffect(()=>{wt(nt)},[]),reactExports.useEffect(()=>{rt&&!nt?(St(rt),ct(rt)):ct(void 0)},[rt]);const St=Nt=>{if(!findNodeById(tt,vt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Nt)},Rt=Nt=>{const Ht=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ht);Lt.forEach($t=>{const Ft=kt.indexOf($t);Ft>-1&&kt.splice(Ft,1),kt.push($t)}),Ht.clear(),kt.forEach($t=>Ht.add($t)),Ht.forEach($t=>ot==null?void 0:ot($t)),ht(Ht)},Ct=Nt=>{const Ht=new Set(dt);Ht.delete(Nt),Ht.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ht)},It=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},jt=Nt=>{vt!==Nt&&ct(Nt)},Pt=Nt=>{jt(Nt),Rt(Nt),lt==null||lt(Nt)},Ot=Nt=>{It(Nt)},Ut=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:vt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:Ot}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:st,onTreeItemUnfold:nt,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:st,onTreeItemFold:ot,onTreeItemUnfold:nt});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(wt=>jsxRuntimeExports.jsx(TreeNode,{node:wt,showIcon:ut,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et,handleItemAction:at},wt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et})})})}),VisuallyHidden=reactExports.forwardRef(({children:tt},et)=>jsxRuntimeExports.jsx("span",{className:"visually-hidden",ref:et,children:tt})),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(st=>{const nt=rt.has(st.displayName);return rt.add(st.displayName),!nt})}function useDebounce(tt,et){const[rt,st]=reactExports.useState(tt);return reactExports.useEffect(()=>{const nt=setTimeout(()=>{st(tt)},et);return()=>{clearTimeout(nt)}},[tt,et]),rt}function useHover$1(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=reactExports.useCallback(()=>{et(!0)},[]),nt=reactExports.useCallback(()=>{et(!1)},[]);return[reactExports.useCallback(at=>{var lt;((lt=rt.current)==null?void 0:lt.nodeType)===Node.ELEMENT_NODE&&(rt.current.removeEventListener("mouseenter",st),rt.current.removeEventListener("mouseleave",nt)),(at==null?void 0:at.nodeType)===Node.ELEMENT_NODE&&(at.addEventListener("mouseenter",st),at.addEventListener("mouseleave",nt)),rt.current=at},[st,nt]),tt]}function useMediaQuery(tt){const et=reactExports.useCallback(nt=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",nt),()=>{ot.removeEventListener("change",nt)}},[tt]),rt=()=>window.matchMedia(tt).matches,st=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,st)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),st=reactExports.useCallback(nt=>rt(typeof nt=="boolean"?nt:ot=>!ot),[]);return[et,st]}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,st){var nt="1.0.41",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",yt="type",vt="vendor",Et="version",wt="architecture",bt="console",St="mobile",Rt="tablet",Ct="smarttv",It="wearable",jt="embedded",Pt=500,Ot="Amazon",Ut="Apple",Nt="ASUS",Ht="BlackBerry",Lt="Browser",kt="Chrome",$t="Edge",Ft="Firefox",Gt="Google",Mt="Honor",Vt="Huawei",Bt="Lenovo",qt="LG",Qt="Microsoft",Yt="Motorola",tr="Nvidia",lr="OnePlus",ur="Opera",mr="OPPO",yr="Samsung",or="Sharp",hr="Sony",pr="Xiaomi",_r="Zebra",Ar="Facebook",Hr="Chromium OS",Ur="Mac OS",os=" Browser",Gs=function(Ir,Br){var kr={};for(var Wr in Ir)Br[Wr]&&Br[Wr].length%2===0?kr[Wr]=Br[Wr].concat(Ir[Wr]):kr[Wr]=Ir[Wr];return kr},Es=function(Ir){for(var Br={},kr=0;kr<Ir.length;kr++)Br[Ir[kr].toUpperCase()]=Ir[kr];return Br},Ws=function(Ir,Br){return typeof Ir===dt?Xt(Br).indexOf(Xt(Ir))!==-1:!1},Xt=function(Ir){return Ir.toLowerCase()},er=function(Ir){return typeof Ir===dt?Ir.replace(/[^\d\.]/g,ot).split(".")[0]:st},sr=function(Ir,Br){if(typeof Ir===dt)return Ir=Ir.replace(/^\s\s*/,ot),typeof Br===ut?Ir:Ir.substring(0,Pt)},br=function(Ir,Br){for(var kr=0,Wr,bs,ps,zr,$r,Ls;kr<Br.length&&!$r;){var Zo=Br[kr],Pl=Br[kr+1];for(Wr=bs=0;Wr<Zo.length&&!$r&&Zo[Wr];)if($r=Zo[Wr++].exec(Ir),$r)for(ps=0;ps<Pl.length;ps++)Ls=$r[++bs],zr=Pl[ps],typeof zr===ct&&zr.length>0?zr.length===2?typeof zr[1]==lt?this[zr[0]]=zr[1].call(this,Ls):this[zr[0]]=zr[1]:zr.length===3?typeof zr[1]===lt&&!(zr[1].exec&&zr[1].test)?this[zr[0]]=Ls?zr[1].call(this,Ls,zr[2]):st:this[zr[0]]=Ls?Ls.replace(zr[1],zr[2]):st:zr.length===4&&(this[zr[0]]=Ls?zr[3].call(this,Ls.replace(zr[1],zr[2])):st):this[zr]=Ls||st;kr+=2}},gr=function(Ir,Br){for(var kr in Br)if(typeof Br[kr]===ct&&Br[kr].length>0){for(var Wr=0;Wr<Br[kr].length;Wr++)if(Ws(Br[kr][Wr],Ir))return kr===at?st:kr}else if(Ws(Br[kr],Ir))return kr===at?st:kr;return Br.hasOwnProperty("*")?Br["*"]:Ir},vr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Tr={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"},Lr={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,ur+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,ur+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,ur]],[/\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"+Lt]],[/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 "+Lt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Lt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,Ft+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,ur+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,ur+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+os]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Ft]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+os],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,yr+" 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,Ar],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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,kt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,kt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Lt]],[/(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,gr,vr]],[/(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,Ft+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[wt,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[wt,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[wt,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[wt,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[wt,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[wt,/ower/,ot,Xt]],[/ sun4\w[;\)]/i],[[wt,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[wt,Xt]]],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],[ft,[vt,yr],[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],[ft,[vt,yr],[yt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[vt,Ut],[yt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[vt,Ut],[yt,Rt]],[/(macintosh);/i],[ft,[vt,Ut]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[vt,or],[yt,St]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[ft,[vt,Mt],[yt,Rt]],[/honor([-\w ]+)[;\)]/i],[ft,[vt,Mt],[yt,St]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[ft,[vt,Vt],[yt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[vt,Vt],[yt,St]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[ft,/_/g," "],[vt,pr],[yt,Rt]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[ft,/_/g," "],[vt,pr],[yt,St]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[vt,mr],[yt,St]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[ft,[vt,gr,{OnePlus:["304","403","203"],"*":mr}],[yt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[vt,"Vivo"],[yt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[vt,"Realme"],[yt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[vt,Yt],[yt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[vt,Yt],[yt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[vt,qt],[yt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[vt,qt],[yt,St]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[ft,[vt,Bt],[yt,Rt]],[/(nokia) (t[12][01])/i],[vt,ft,[yt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[ft,/_/g," "],[yt,St],[vt,"Nokia"]],[/(pixel (c|tablet))\b/i],[ft,[vt,Gt],[yt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[vt,Gt],[yt,St]],[/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],[ft,[vt,hr],[yt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[vt,hr],[yt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[vt,lr],[yt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[vt,Ot],[yt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[vt,Ot],[yt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,vt,[yt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[vt,Ht],[yt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[vt,Nt],[yt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[vt,Nt],[yt,St]],[/(nexus 9)/i],[ft,[vt,"HTC"],[yt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[vt,[ft,/_/g," "],[yt,St]],[/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],[ft,[vt,"TCL"],[yt,Rt]],[/(itel) ((\w+))/i],[[vt,Xt],ft,[yt,gr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[vt,"Acer"],[yt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[vt,"Meizu"],[yt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[vt,"Ulefone"],[yt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[vt,"Energizer"],[yt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[vt,"Cat"],[yt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[vt,"Smartfren"],[yt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[vt,"Nothing"],[yt,St]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[ft,[vt,"Archos"],[yt,Rt]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[ft,[vt,"Archos"],[yt,St]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[vt,ft,[yt,Rt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[vt,ft,[yt,St]],[/(kobo)\s(ereader|touch)/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,ft,[yt,Rt]],[/(surface duo)/i],[ft,[vt,Qt],[yt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[vt,"Fairphone"],[yt,St]],[/(u304aa)/i],[ft,[vt,"AT&T"],[yt,St]],[/\bsie-(\w*)/i],[ft,[vt,"Siemens"],[yt,St]],[/\b(rct\w+) b/i],[ft,[vt,"RCA"],[yt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[vt,"Dell"],[yt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[vt,"Verizon"],[yt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[vt,"Barnes & Noble"],[yt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[vt,"NuVision"],[yt,Rt]],[/\b(k88) b/i],[ft,[vt,"ZTE"],[yt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[vt,"ZTE"],[yt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[vt,"Swiss"],[yt,St]],[/\b(zur\d{3}) b/i],[ft,[vt,"Swiss"],[yt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[vt,"Zeki"],[yt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[vt,"Dragon Touch"],ft,[yt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[vt,"Insignia"],[yt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[vt,"NextBook"],[yt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[vt,"Voice"],ft,[yt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[vt,"LvTel"],ft,[yt,St]],[/\b(ph-1) /i],[ft,[vt,"Essential"],[yt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[vt,"Envizen"],[yt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[vt,"MachSpeed"],[yt,Rt]],[/\btu_(1491) b/i],[ft,[vt,"Rotor"],[yt,Rt]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[ft,[vt,tr],[yt,Rt]],[/(sprint) (\w+)/i],[vt,ft,[yt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[vt,Qt],[yt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[vt,_r],[yt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[vt,_r],[yt,St]],[/smart-tv.+(samsung)/i],[vt,[yt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[vt,yr],[yt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[vt,qt],[yt,Ct]],[/(apple) ?tv/i],[vt,[ft,Ut+" TV"],[yt,Ct]],[/crkey/i],[[ft,kt+"cast"],[vt,Gt],[yt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[vt,Ot],[yt,Ct]],[/(shield \w+ tv)/i],[ft,[vt,tr],[yt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[vt,or],[yt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[vt,hr],[yt,Ct]],[/(mi(tv|box)-?\w+) bui/i],[ft,[vt,pr],[yt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[vt,ft,[yt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[vt,sr],[ft,sr],[yt,Ct]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[ft,[yt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[yt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[vt,ft,[yt,bt]],[/droid.+; (shield)( bui|\))/i],[ft,[vt,tr],[yt,bt]],[/(playstation \w+)/i],[ft,[vt,hr],[yt,bt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[vt,Qt],[yt,bt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[ft,[vt,yr],[yt,It]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[vt,ft,[yt,It]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[ft,[vt,mr],[yt,It]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[vt,Ut],[yt,It]],[/(opwwe\d{3})/i],[ft,[vt,lr],[yt,It]],[/(moto 360)/i],[ft,[vt,Yt],[yt,It]],[/(smartwatch 3)/i],[ft,[vt,hr],[yt,It]],[/(g watch r)/i],[ft,[vt,qt],[yt,It]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[vt,_r],[yt,It]],[/droid.+; (glass) \d/i],[ft,[vt,Gt],[yt,It]],[/(pico) (4|neo3(?: link|pro)?)/i],[vt,ft,[yt,It]],[/; (quest( \d| pro)?)/i],[ft,[vt,Ar],[yt,It]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[vt,[yt,jt]],[/(aeobc)\b/i],[ft,[vt,Ot],[yt,jt]],[/(homepod).+mac os/i],[ft,[vt,Ut],[yt,jt]],[/windows iot/i],[[yt,jt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[yt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[yt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[yt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[yt,St]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[ft,[vt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,$t+"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],[/ladybird\//i],[[xt,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,gr,Tr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,gr,Tr],[xt,"Windows"]],[/[adehimnop]{4,7}\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,Ur],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(ubuntu) ([\w\.]+) like android/i],[[xt,/(.+)/,"$1 Touch"],Et],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Ft+" 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,kt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,Hr],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)(?: arm\w*| x86\w*| ?)([\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(Ir,Br){if(typeof Ir===ct&&(Br=Ir,Ir=st),!(this instanceof Dr))return new Dr(Ir,Br).getResult();var kr=typeof rt!==ut&&rt.navigator?rt.navigator:st,Wr=Ir||(kr&&kr.userAgent?kr.userAgent:ot),bs=kr&&kr.userAgentData?kr.userAgentData:st,ps=Br?Gs(Lr,Br):Lr,zr=kr&&kr.userAgent==Wr;return this.getBrowser=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.browser),$r[ht]=er($r[Et]),zr&&kr&&kr.brave&&typeof kr.brave.isBrave==lt&&($r[xt]="Brave"),$r},this.getCPU=function(){var $r={};return $r[wt]=st,br.call($r,Wr,ps.cpu),$r},this.getDevice=function(){var $r={};return $r[vt]=st,$r[ft]=st,$r[yt]=st,br.call($r,Wr,ps.device),zr&&!$r[yt]&&bs&&bs.mobile&&($r[yt]=St),zr&&$r[ft]=="Macintosh"&&kr&&typeof kr.standalone!==ut&&kr.maxTouchPoints&&kr.maxTouchPoints>2&&($r[ft]="iPad",$r[yt]=Rt),$r},this.getEngine=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.engine),$r},this.getOS=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.os),zr&&!$r[xt]&&bs&&bs.platform&&bs.platform!="Unknown"&&($r[xt]=bs.platform.replace(/chrome os/i,Hr).replace(/macos/i,Ur)),$r},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 Wr},this.setUA=function($r){return Wr=typeof $r===dt&&$r.length>Pt?sr($r,Pt):$r,this},this.setUA(Wr),this};Dr.VERSION=nt,Dr.BROWSER=Es([xt,Et,ht]),Dr.CPU=Es([wt]),Dr.DEVICE=Es([ft,vt,yt,bt,St,Ct,Rt,It,jt]),Dr.ENGINE=Dr.OS=Es([xt,Et]),tt.exports&&(et=tt.exports=Dr),et.UAParser=Dr;var Zr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(Zr&&!Zr.ua){var ks=new Dr;Zr.ua=ks.getResult(),Zr.ua.get=function(){return ks.getUA()},Zr.ua.set=function(Ir){ks.setUA(Ir);var Br=ks.getResult();for(var kr in Br)Zr.ua[kr]=Br[kr]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,st;const nt=new UAParser(tt),ot=nt.getOS(),at=nt.getDevice(),lt=nt.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((st=at.model)==null?void 0:st.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}function useHasWorkflow(tt){const[et,rt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt),rt(st)})()},[tt]),et}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$1(){}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:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){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||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,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!(st&&et.state.status!==st||nt&&!nt(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((st,nt)=>(st[nt]=rt[nt],st),{}):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 st=rt?tt:Object.keys(tt),nt=st.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&&st.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 nt===at&&ut===nt?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 st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}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 wl,Ho,Zl,qp,FocusManager=(qp=class extends Subscribable{constructor(){super();Or(this,wl);Or(this,Ho);Or(this,Zl);Sr(this,Zl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Ho)||this.setEventListener(Kt(this,Zl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Ho))==null||et.call(this),Sr(this,Ho,void 0))}setEventListener(et){var rt;Sr(this,Zl,et),(rt=Kt(this,Ho))==null||rt.call(this),Sr(this,Ho,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,wl)!==et&&(Sr(this,wl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,wl)=="boolean"?Kt(this,wl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},wl=new WeakMap,Ho=new WeakMap,Zl=new WeakMap,qp),focusManager=new FocusManager,Jl,Vo,eu,Xp,OnlineManager=(Xp=class extends Subscribable{constructor(){super();Or(this,Jl,!0);Or(this,Vo);Or(this,eu);Sr(this,eu,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,Vo)||this.setEventListener(Kt(this,eu))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Vo))==null||et.call(this),Sr(this,Vo,void 0))}setEventListener(et){var rt;Sr(this,eu,et),(rt=Kt(this,Vo))==null||rt.call(this),Sr(this,Vo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Jl)!==et&&(Sr(this,Jl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Jl)}},Jl=new WeakMap,Vo=new WeakMap,eu=new WeakMap,Xp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},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,st=!1,nt;const ot=pendingThenable(),at=vt=>{var Et;st||(ft(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;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),nt==null||nt(),ot.resolve(vt))},ft=vt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,vt),nt==null||nt(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;nt=wt=>{(st||ct())&&vt(wt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;nt=void 0,st||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(st)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(wt){vt=Promise.reject(wt)}Promise.resolve(vt).then(ht).catch(wt=>{var It;if(st)return;const bt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,wt):St,Ct=bt===!0||typeof bt=="number"&&rt<bt||typeof bt=="function"&&bt(rt,wt);if(et||!Ct){ft(wt);return}rt++,(It=tt.onFail)==null||It.call(tt,rt,wt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(wt):yt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{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=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),Sl,Yp,Removable=(Yp=class{constructor(){Or(this,Sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Sr(this,Sl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Sr(this,Sl,void 0))}},Sl=new WeakMap,Yp),tu,ru,qn,js,Nu,_l,eo,Co,Kp,Query=(Kp=class extends Removable{constructor(et){super();Or(this,eo);Or(this,tu);Or(this,ru);Or(this,qn);Or(this,js);Or(this,Nu);Or(this,_l);Sr(this,_l,!1),Sr(this,Nu,et.defaultOptions),this.setOptions(et.options),this.observers=[],Sr(this,qn,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Sr(this,tu,getDefaultState$1(this.options)),this.state=et.state??Kt(this,tu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,js))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Nu),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,qn).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Fr(this,eo,Co).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Fr(this,eo,Co).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,js))==null?void 0:st.promise;return(nt=Kt(this,js))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,tu))}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(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,qn).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,js)&&(Kt(this,_l)?Kt(this,js).cancel({revert:!0}):Kt(this,js).cancelRetry()),this.scheduleGc()),Kt(this,qn).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fr(this,eo,Co).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,js))return Kt(this,js).continueRetry(),Kt(this,js).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Sr(this,_l,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Sr(this,_l,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Sr(this,ru,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Fr(this,eo,Co).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,yt,vt;isCancelledError(ht)&&ht.silent||Fr(this,eo,Co).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,qn).config).onError)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,qn).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Sr(this,js,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,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=(ft=Kt(this,qn).config).onSuccess)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,qn).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Fr(this,eo,Co).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Fr(this,eo,Co).call(this,{type:"pause"})},onContinue:()=>{Fr(this,eo,Co).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,js).start()}},tu=new WeakMap,ru=new WeakMap,qn=new WeakMap,js=new WeakMap,Nu=new WeakMap,_l=new WeakMap,eo=new WeakSet,Co=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,ru)?{...Kt(this,ru),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,qn).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,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var xo,Qp,QueryCache=(Qp=class extends Subscribable{constructor(et={}){super();Or(this,xo);this.config=et,Sr(this,xo,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,xo).has(et.queryHash)||(Kt(this,xo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,xo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,xo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,xo).get(et)}getAll(){return[...Kt(this,xo).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):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()})})}},xo=new WeakMap,Qp),vo,Os,Rl,yo,Uo,Zp,Mutation=(Zp=class extends Removable{constructor(et){super();Or(this,yo);Or(this,vo);Or(this,Os);Or(this,Rl);this.mutationId=et.mutationId,Sr(this,Os,et.mutationCache),Sr(this,vo,[]),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,vo).includes(et)||(Kt(this,vo).push(et),this.clearGcTimeout(),Kt(this,Os).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Sr(this,vo,Kt(this,vo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,Os).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,vo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,Os).remove(this))}continue(){var et;return((et=Kt(this,Rl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,yt,vt,Et,wt,bt,St,Rt,Ct,It,jt;Sr(this,Rl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,Ot)=>{Fr(this,yo,Uo).call(this,{type:"failed",failureCount:Pt,error:Ot})},onPause:()=>{Fr(this,yo,Uo).call(this,{type:"pause"})},onContinue:()=>{Fr(this,yo,Uo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,Os).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,Rl).canStart();try{if(!rt){Fr(this,yo,Uo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,Os).config).onMutate)==null?void 0:ot.call(nt,et,this));const Ot=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Ot!==this.state.context&&Fr(this,yo,Uo).call(this,{type:"pending",context:Ot,variables:et,isPaused:st})}const Pt=await Kt(this,Rl).start();return await((ct=(ut=Kt(this,Os).config).onSuccess)==null?void 0:ct.call(ut,Pt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,Pt,et,this.state.context)),await((xt=(ft=Kt(this,Os).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,Pt,null,et,this.state.context)),Fr(this,yo,Uo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((wt=(Et=Kt(this,Os).config).onError)==null?void 0:wt.call(Et,Pt,et,this.state.context,this)),await((St=(bt=this.options).onError)==null?void 0:St.call(bt,Pt,et,this.state.context)),await((Ct=(Rt=Kt(this,Os).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((jt=(It=this.options).onSettled)==null?void 0:jt.call(It,void 0,Pt,et,this.state.context)),Pt}finally{Fr(this,yo,Uo).call(this,{type:"error",error:Pt})}}finally{Kt(this,Os).runNext(this)}}},vo=new WeakMap,Os=new WeakMap,Rl=new WeakMap,yo=new WeakSet,Uo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,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{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,vo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,Os).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,Fu,Jp,MutationCache=(Jp=class extends Subscribable{constructor(et={}){super();Or(this,Js);Or(this,Fu);this.config=et,Sr(this,Js,new Map),Sr(this,Fu,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++P1(this,Fu)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Js).get(rt)??[];st.push(et),Kt(this,Js).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Js).has(rt)){const nt=(st=Kt(this,Js).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Js).delete(rt):Kt(this,Js).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.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(st=>matchMutation(rt,st))}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$1))))}},Js=new WeakMap,Fu=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,ft,xt,yt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.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=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},wt=ensureQueryFn(et.options,et.fetchOptions),bt=async(St,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const It={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(It);const jt=await wt(It),{maxPages:Pt}=et.options,Ot=Ct?addToStart:addToEnd;return{pages:Ot(St.pages,jt,Pt),pageParams:Ot(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},It=Rt(st,Ct);lt=await bt(Ct,It,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await bt(lt,Rt),ut++}while(ut<St)}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 st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.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 us,Go,Wo,su,nu,qo,iu,ou,em,QueryClient=(em=class{constructor(tt={}){Or(this,us);Or(this,Go);Or(this,Wo);Or(this,su);Or(this,nu);Or(this,qo);Or(this,iu);Or(this,ou);Sr(this,us,tt.queryCache||new QueryCache),Sr(this,Go,tt.mutationCache||new MutationCache),Sr(this,Wo,tt.defaultOptions||{}),Sr(this,su,new Map),Sr(this,nu,new Map),Sr(this,qo,0)}mount(){P1(this,qo)._++,Kt(this,qo)===1&&(Sr(this,iu,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onFocus())})),Sr(this,ou,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onOnline())})))}unmount(){var tt,et;P1(this,qo)._--,Kt(this,qo)===0&&((tt=Kt(this,iu))==null||tt.call(this),Sr(this,iu,void 0),(et=Kt(this,ou))==null||et.call(this),Sr(this,ou,void 0))}isFetching(tt){return Kt(this,us).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Go).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,us).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,us).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,us).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,us).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,us).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,us);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,us),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,us).findAll(tt).forEach(st=>{st.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},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,us).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$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Go).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,us)}getMutationCache(){return Kt(this,Go)}getDefaultOptions(){return Kt(this,Wo)}setDefaultOptions(tt){Sr(this,Wo,tt)}setQueryDefaults(tt,et){Kt(this,su).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,su).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,nu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,nu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Wo).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,Wo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,us).clear(),Kt(this,Go).clear()}},us=new WeakMap,Go=new WeakMap,Wo=new WeakMap,su=new WeakMap,nu=new WeakMap,qo=new WeakMap,iu=new WeakMap,ou=new WeakMap,em),Hs,Gr,Bu,Ds,Tl,au,Xo,Eo,zu,lu,uu,Cl,Al,Yo,cu,Qr,Mu,K0,Q0,Z0,J0,_d,_h,e2,im,tm,QueryObserver=(tm=class extends Subscribable{constructor(et,rt){super();Or(this,Qr);Or(this,Hs);Or(this,Gr);Or(this,Bu);Or(this,Ds);Or(this,Tl);Or(this,au);Or(this,Xo);Or(this,Eo);Or(this,zu);Or(this,lu);Or(this,uu);Or(this,Cl);Or(this,Al);Or(this,Yo);Or(this,cu,new Set);this.options=rt,Sr(this,Hs,et),Sr(this,Eo,null),Sr(this,Xo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Xo).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,Gr).addObserver(this),shouldFetchOnMount(Kt(this,Gr),this.options)?Fr(this,Qr,Mu).call(this):this.updateResult(),Fr(this,Qr,J0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fr(this,Qr,_d).call(this),Fr(this,Qr,_h).call(this),Kt(this,Gr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Gr);if(this.options=Kt(this,Hs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Gr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fr(this,Qr,e2).call(this),Kt(this,Gr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Hs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Gr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Gr),nt,this.options,st)&&Fr(this,Qr,Mu).call(this),this.updateResult(rt),ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||resolveStaleTime(this.options.staleTime,Kt(this,Gr))!==resolveStaleTime(st.staleTime,Kt(this,Gr)))&&Fr(this,Qr,K0).call(this);const at=Fr(this,Qr,Q0).call(this);ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||at!==Kt(this,Yo))&&Fr(this,Qr,Z0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Sr(this,Ds,st),Sr(this,au,this.options),Sr(this,Tl,Kt(this,Gr).state)),st}getCurrentResult(){return Kt(this,Ds)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,cu).add(et)}getCurrentQuery(){return Kt(this,Gr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Hs).defaultQueryOptions(et),st=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Fr(this,Qr,Mu).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Ds)))}createResult(et,rt){var Pt;const st=Kt(this,Gr),nt=this.options,ot=Kt(this,Ds),at=Kt(this,Tl),lt=Kt(this,au),ct=et!==st?et.state:Kt(this,Bu),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Ot=this.hasListeners(),Ut=!Ot&&shouldFetchOnMount(et,rt),Nt=Ot&&shouldFetchOptionally(et,st,rt,nt);(Ut||Nt)&&(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,zu))xt=Kt(this,lu);else try{Sr(this,zu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Sr(this,lu,xt),Sr(this,Eo,null)}catch(Ot){Sr(this,Eo,Ot)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Ot;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Ot=ot.data;else if(Ot=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,uu))==null?void 0:Pt.state.data,Kt(this,uu)):rt.placeholderData,rt.select&&Ot!==void 0)try{Ot=rt.select(Ot),Sr(this,Eo,null)}catch(Ut){Sr(this,Eo,Ut)}Ot!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Ot,rt),ft=!0)}Kt(this,Eo)&&(yt=Kt(this,Eo),xt=Kt(this,lu),vt=Date.now(),Et="error");const wt=ht.fetchStatus==="fetching",bt=Et==="pending",St=Et==="error",Rt=bt&&wt,Ct=xt!==void 0,jt={status:Et,fetchStatus:ht.fetchStatus,isPending:bt,isSuccess:Et==="success",isError:St,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:wt,isRefetching:wt&&!bt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Xo)};if(this.options.experimental_prefetchInRender){const Ot=Ht=>{jt.status==="error"?Ht.reject(jt.error):jt.data!==void 0&&Ht.resolve(jt.data)},Ut=()=>{const Ht=Sr(this,Xo,jt.promise=pendingThenable());Ot(Ht)},Nt=Kt(this,Xo);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Ot(Nt);break;case"fulfilled":(jt.status==="error"||jt.data!==Nt.value)&&Ut();break;case"rejected":(jt.status!=="error"||jt.error!==Nt.reason)&&Ut();break}}return jt}updateResult(et){const rt=Kt(this,Ds),st=this.createResult(Kt(this,Gr),this.options);if(Sr(this,Tl,Kt(this,Gr).state),Sr(this,au,this.options),Kt(this,Tl).data!==void 0&&Sr(this,uu,Kt(this,Gr)),shallowEqualObjects(st,rt))return;Sr(this,Ds,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,cu).size)return!0;const ut=new Set(lt??Kt(this,cu));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Ds)).some(ct=>{const dt=ct;return Kt(this,Ds)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Fr(this,Qr,im).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fr(this,Qr,J0).call(this)}},Hs=new WeakMap,Gr=new WeakMap,Bu=new WeakMap,Ds=new WeakMap,Tl=new WeakMap,au=new WeakMap,Xo=new WeakMap,Eo=new WeakMap,zu=new WeakMap,lu=new WeakMap,uu=new WeakMap,Cl=new WeakMap,Al=new WeakMap,Yo=new WeakMap,cu=new WeakMap,Qr=new WeakSet,Mu=function(et){Fr(this,Qr,e2).call(this);let rt=Kt(this,Gr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},K0=function(){Fr(this,Qr,_d).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Gr));if(isServer||Kt(this,Ds).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Ds).dataUpdatedAt,et)+1;Sr(this,Cl,setTimeout(()=>{Kt(this,Ds).isStale||this.updateResult()},st))},Q0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Gr)):this.options.refetchInterval)??!1},Z0=function(et){Fr(this,Qr,_h).call(this),Sr(this,Yo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Gr))===!1||!isValidTimeout(Kt(this,Yo))||Kt(this,Yo)===0)&&Sr(this,Al,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Fr(this,Qr,Mu).call(this)},Kt(this,Yo)))},J0=function(){Fr(this,Qr,K0).call(this),Fr(this,Qr,Z0).call(this,Fr(this,Qr,Q0).call(this))},_d=function(){Kt(this,Cl)&&(clearTimeout(Kt(this,Cl)),Sr(this,Cl,void 0))},_h=function(){Kt(this,Al)&&(clearInterval(Kt(this,Al)),Sr(this,Al,void 0))},e2=function(){const et=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),this.options);if(et===Kt(this,Gr))return;const rt=Kt(this,Gr);Sr(this,Gr,et),Sr(this,Bu,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},im=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Ds))}),Kt(this,Hs).getQueryCache().notify({query:Kt(this,Gr),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 st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.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,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},Ko,Qo,Vs,Po,jo,j1,t2,rm,MutationObserver$1=(rm=class extends Subscribable{constructor(rt,st){super();Or(this,jo);Or(this,Ko);Or(this,Qo);Or(this,Vs);Or(this,Po);Sr(this,Ko,rt),this.setOptions(st),this.bindMethods(),Fr(this,jo,j1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,Ko).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,Ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,Vs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,Vs))==null?void 0:nt.state.status)==="pending"&&Kt(this,Vs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,Vs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Fr(this,jo,j1).call(this),Fr(this,jo,t2).call(this,rt)}getCurrentResult(){return Kt(this,Qo)}reset(){var rt;(rt=Kt(this,Vs))==null||rt.removeObserver(this),Sr(this,Vs,void 0),Fr(this,jo,j1).call(this),Fr(this,jo,t2).call(this)}mutate(rt,st){var nt;return Sr(this,Po,st),(nt=Kt(this,Vs))==null||nt.removeObserver(this),Sr(this,Vs,Kt(this,Ko).getMutationCache().build(Kt(this,Ko),this.options)),Kt(this,Vs).addObserver(this),Kt(this,Vs).execute(rt)}},Ko=new WeakMap,Qo=new WeakMap,Vs=new WeakMap,Po=new WeakMap,jo=new WeakSet,j1=function(){var st;const rt=((st=Kt(this,Vs))==null?void 0:st.state)??getDefaultState();Sr(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})},t2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,Po)&&this.hasListeners()){const ht=Kt(this,Qo).variables,ft=Kt(this,Qo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,Po)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,Po)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Po)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,Po)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}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(){}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:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),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,ft,xt,yt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,nt]),()=>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:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=st.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop).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(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,st]=reactExports.useState(""),nt={unread:!0,_:new Date().getTime()},{data:ot}=useQuery({queryKey:["folder","count","inbox"],queryFn:async()=>await odeServices.http().get(tt?"/zimbra/count/INBOX":"/conversation/count/inbox",{queryParams:nt}),staleTime:5*60*1e3}),at=async()=>{const lt="/zimbra/zimbra";try{const{preference:ut}=await odeServices.http().get("/userbook/preference/zimbra"),ct=ut?JSON.parse(ut).modeExpert:!1;st(ct&&et?"/zimbra/preauth":window.location.origin+lt)}catch(ut){console.error(ut),st(window.location.origin+lt)}};return reactExports.useEffect(()=>{at()},[]),{messages:ot?ot.count:0,msgLink:rt,zimbraWorkflow:tt}};var dayjs_min={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt=1e3,st=6e4,nt=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",ft="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+)?$/,wt=/\[([^\]]+)]|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,bt={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(kt){var $t=["th","st","nd","rd"],Ft=kt%100;return"["+kt+($t[(Ft-20)%10]||$t[Ft]||$t[0])+"]"}},St=function(kt,$t,Ft){var Gt=String(kt);return!Gt||Gt.length>=$t?kt:""+Array($t+1-Gt.length).join(Ft)+kt},Rt={s:St,z:function(kt){var $t=-kt.utcOffset(),Ft=Math.abs($t),Gt=Math.floor(Ft/60),Mt=Ft%60;return($t<=0?"+":"-")+St(Gt,2,"0")+":"+St(Mt,2,"0")},m:function kt($t,Ft){if($t.date()<Ft.date())return-kt(Ft,$t);var Gt=12*(Ft.year()-$t.year())+(Ft.month()-$t.month()),Mt=$t.clone().add(Gt,ht),Vt=Ft-Mt<0,Bt=$t.clone().add(Gt+(Vt?-1:1),ht);return+(-(Gt+(Ft-Mt)/(Vt?Mt-Bt:Bt-Mt))||0)},a:function(kt){return kt<0?Math.ceil(kt)||0:Math.floor(kt)},p:function(kt){return{M:ht,y:xt,w:dt,d:ct,D:yt,h:ut,m:lt,s:at,ms:ot,Q:ft}[kt]||String(kt||"").toLowerCase().replace(/s$/,"")},u:function(kt){return kt===void 0}},Ct="en",It={};It[Ct]=bt;var jt="$isDayjsObject",Pt=function(kt){return kt instanceof Ht||!(!kt||!kt[jt])},Ot=function kt($t,Ft,Gt){var Mt;if(!$t)return Ct;if(typeof $t=="string"){var Vt=$t.toLowerCase();It[Vt]&&(Mt=Vt),Ft&&(It[Vt]=Ft,Mt=Vt);var Bt=$t.split("-");if(!Mt&&Bt.length>1)return kt(Bt[0])}else{var qt=$t.name;It[qt]=$t,Mt=qt}return!Gt&&Mt&&(Ct=Mt),Mt||!Gt&&Ct},Ut=function(kt,$t){if(Pt(kt))return kt.clone();var Ft=typeof $t=="object"?$t:{};return Ft.date=kt,Ft.args=arguments,new Ht(Ft)},Nt=Rt;Nt.l=Ot,Nt.i=Pt,Nt.w=function(kt,$t){return Ut(kt,{locale:$t.$L,utc:$t.$u,x:$t.$x,$offset:$t.$offset})};var Ht=function(){function kt(Ft){this.$L=Ot(Ft.locale,null,!0),this.parse(Ft),this.$x=this.$x||Ft.x||{},this[jt]=!0}var $t=kt.prototype;return $t.parse=function(Ft){this.$d=function(Gt){var Mt=Gt.date,Vt=Gt.utc;if(Mt===null)return new Date(NaN);if(Nt.u(Mt))return new Date;if(Mt instanceof Date)return new Date(Mt);if(typeof Mt=="string"&&!/Z$/i.test(Mt)){var Bt=Mt.match(Et);if(Bt){var qt=Bt[2]-1||0,Qt=(Bt[7]||"0").substring(0,3);return Vt?new Date(Date.UTC(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)):new Date(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)}}return new Date(Mt)}(Ft),this.init()},$t.init=function(){var Ft=this.$d;this.$y=Ft.getFullYear(),this.$M=Ft.getMonth(),this.$D=Ft.getDate(),this.$W=Ft.getDay(),this.$H=Ft.getHours(),this.$m=Ft.getMinutes(),this.$s=Ft.getSeconds(),this.$ms=Ft.getMilliseconds()},$t.$utils=function(){return Nt},$t.isValid=function(){return this.$d.toString()!==vt},$t.isSame=function(Ft,Gt){var Mt=Ut(Ft);return this.startOf(Gt)<=Mt&&Mt<=this.endOf(Gt)},$t.isAfter=function(Ft,Gt){return Ut(Ft)<this.startOf(Gt)},$t.isBefore=function(Ft,Gt){return this.endOf(Gt)<Ut(Ft)},$t.$g=function(Ft,Gt,Mt){return Nt.u(Ft)?this[Gt]:this.set(Mt,Ft)},$t.unix=function(){return Math.floor(this.valueOf()/1e3)},$t.valueOf=function(){return this.$d.getTime()},$t.startOf=function(Ft,Gt){var Mt=this,Vt=!!Nt.u(Gt)||Gt,Bt=Nt.p(Ft),qt=function(or,hr){var pr=Nt.w(Mt.$u?Date.UTC(Mt.$y,hr,or):new Date(Mt.$y,hr,or),Mt);return Vt?pr:pr.endOf(ct)},Qt=function(or,hr){return Nt.w(Mt.toDate()[or].apply(Mt.toDate("s"),(Vt?[0,0,0,0]:[23,59,59,999]).slice(hr)),Mt)},Yt=this.$W,tr=this.$M,lr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Vt?qt(1,0):qt(31,11);case ht:return Vt?qt(1,tr):qt(0,tr+1);case dt:var mr=this.$locale().weekStart||0,yr=(Yt<mr?Yt+7:Yt)-mr;return qt(Vt?lr-yr:lr+(6-yr),tr);case ct:case yt:return Qt(ur+"Hours",0);case ut:return Qt(ur+"Minutes",1);case lt:return Qt(ur+"Seconds",2);case at:return Qt(ur+"Milliseconds",3);default:return this.clone()}},$t.endOf=function(Ft){return this.startOf(Ft,!1)},$t.$set=function(Ft,Gt){var Mt,Vt=Nt.p(Ft),Bt="set"+(this.$u?"UTC":""),qt=(Mt={},Mt[ct]=Bt+"Date",Mt[yt]=Bt+"Date",Mt[ht]=Bt+"Month",Mt[xt]=Bt+"FullYear",Mt[ut]=Bt+"Hours",Mt[lt]=Bt+"Minutes",Mt[at]=Bt+"Seconds",Mt[ot]=Bt+"Milliseconds",Mt)[Vt],Qt=Vt===ct?this.$D+(Gt-this.$W):Gt;if(Vt===ht||Vt===xt){var Yt=this.clone().set(yt,1);Yt.$d[qt](Qt),Yt.init(),this.$d=Yt.set(yt,Math.min(this.$D,Yt.daysInMonth())).$d}else qt&&this.$d[qt](Qt);return this.init(),this},$t.set=function(Ft,Gt){return this.clone().$set(Ft,Gt)},$t.get=function(Ft){return this[Nt.p(Ft)]()},$t.add=function(Ft,Gt){var Mt,Vt=this;Ft=Number(Ft);var Bt=Nt.p(Gt),qt=function(tr){var lr=Ut(Vt);return Nt.w(lr.date(lr.date()+Math.round(tr*Ft)),Vt)};if(Bt===ht)return this.set(ht,this.$M+Ft);if(Bt===xt)return this.set(xt,this.$y+Ft);if(Bt===ct)return qt(1);if(Bt===dt)return qt(7);var Qt=(Mt={},Mt[lt]=st,Mt[ut]=nt,Mt[at]=rt,Mt)[Bt]||1,Yt=this.$d.getTime()+Ft*Qt;return Nt.w(Yt,this)},$t.subtract=function(Ft,Gt){return this.add(-1*Ft,Gt)},$t.format=function(Ft){var Gt=this,Mt=this.$locale();if(!this.isValid())return Mt.invalidDate||vt;var Vt=Ft||"YYYY-MM-DDTHH:mm:ssZ",Bt=Nt.z(this),qt=this.$H,Qt=this.$m,Yt=this.$M,tr=Mt.weekdays,lr=Mt.months,ur=Mt.meridiem,mr=function(hr,pr,_r,Ar){return hr&&(hr[pr]||hr(Gt,Vt))||_r[pr].slice(0,Ar)},yr=function(hr){return Nt.s(qt%12||12,hr,"0")},or=ur||function(hr,pr,_r){var Ar=hr<12?"AM":"PM";return _r?Ar.toLowerCase():Ar};return Vt.replace(wt,function(hr,pr){return pr||function(_r){switch(_r){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Yt+1;case"MM":return Nt.s(Yt+1,2,"0");case"MMM":return mr(Mt.monthsShort,Yt,lr,3);case"MMMM":return mr(lr,Yt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr(Mt.weekdaysMin,Gt.$W,tr,2);case"ddd":return mr(Mt.weekdaysShort,Gt.$W,tr,3);case"dddd":return tr[Gt.$W];case"H":return String(qt);case"HH":return Nt.s(qt,2,"0");case"h":return yr(1);case"hh":return yr(2);case"a":return or(qt,Qt,!0);case"A":return or(qt,Qt,!1);case"m":return String(Qt);case"mm":return Nt.s(Qt,2,"0");case"s":return String(Gt.$s);case"ss":return Nt.s(Gt.$s,2,"0");case"SSS":return Nt.s(Gt.$ms,3,"0");case"Z":return Bt}return null}(hr)||Bt.replace(":","")})},$t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$t.diff=function(Ft,Gt,Mt){var Vt,Bt=this,qt=Nt.p(Gt),Qt=Ut(Ft),Yt=(Qt.utcOffset()-this.utcOffset())*st,tr=this-Qt,lr=function(){return Nt.m(Bt,Qt)};switch(qt){case xt:Vt=lr()/12;break;case ht:Vt=lr();break;case ft:Vt=lr()/3;break;case dt:Vt=(tr-Yt)/6048e5;break;case ct:Vt=(tr-Yt)/864e5;break;case ut:Vt=tr/nt;break;case lt:Vt=tr/st;break;case at:Vt=tr/rt;break;default:Vt=tr}return Mt?Vt:Nt.a(Vt)},$t.daysInMonth=function(){return this.endOf(ht).$D},$t.$locale=function(){return It[this.$L]},$t.locale=function(Ft,Gt){if(!Ft)return this.$L;var Mt=this.clone(),Vt=Ot(Ft,Gt,!0);return Vt&&(Mt.$L=Vt),Mt},$t.clone=function(){return Nt.w(this.$d,this)},$t.toDate=function(){return new Date(this.valueOf())},$t.toJSON=function(){return this.isValid()?this.toISOString():null},$t.toISOString=function(){return this.$d.toISOString()},$t.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ht.prototype;return Ut.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",yt]].forEach(function(kt){Lt[kt[1]]=function($t){return this.$g($t,kt[0],kt[1])}}),Ut.extend=function(kt,$t){return kt.$i||(kt($t,Ht,Ut),kt.$i=!0),Ut},Ut.locale=Ot,Ut.isDayjs=Pt,Ut.unix=function(kt){return Ut(1e3*kt)},Ut.en=It[Ct],Ut.Ls=It,Ut.p={},Ut})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(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"},st=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,nt=/\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 wt=Et.match(/([+-]|\d\d)/g),bt=60*wt[1]+(+wt[2]||0);return bt===0?0:wt[0]==="+"?-bt:bt}(vt)}],ht=function(vt){var Et=lt[vt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(vt,Et){var wt,bt=lt.meridiem;if(bt){for(var St=1;St<=24;St+=1)if(vt.indexOf(bt(St,0,Et))>-1){wt=St>12;break}}else wt=vt===(Et?"pm":"PM");return wt},xt={A:[at,function(vt){this.afternoon=ft(vt,!1)}],a:[at,function(vt){this.afternoon=ft(vt,!0)}],S:[/\d/,function(vt){this.milliseconds=100*+vt}],SS:[nt,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:[nt,ct("day")],Do:[at,function(vt){var Et=lt.ordinal,wt=vt.match(/\d+/);if(this.day=wt[0],Et)for(var bt=1;bt<=31;bt+=1)Et(bt).replace(/\[|\]/g,"")===vt&&(this.day=bt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(vt){var Et=ht("months"),wt=(ht("monthsShort")||Et.map(function(bt){return bt.slice(0,3)})).indexOf(vt)+1;if(wt<1)throw new Error;this.month=wt%12||wt}],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:[nt,function(vt){this.year=ut(vt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function yt(vt){var Et,wt;Et=vt,wt=lt&&lt.formats;for(var bt=(vt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Ot,Ut,Nt){var Ht=Nt&&Nt.toUpperCase();return Ut||wt[Nt]||rt[Nt]||wt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,$t){return kt||$t.slice(1)})})).match(st),St=bt.length,Rt=0;Rt<St;Rt+=1){var Ct=bt[Rt],It=xt[Ct],jt=It&&It[0],Pt=It&&It[1];bt[Rt]=Pt?{regex:jt,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function(Ot){for(var Ut={},Nt=0,Ht=0;Nt<St;Nt+=1){var Lt=bt[Nt];if(typeof Lt=="string")Ht+=Lt.length;else{var kt=Lt.regex,$t=Lt.parser,Ft=Ot.slice(Ht),Gt=kt.exec(Ft)[0];$t.call(Ut,Gt),Ot=Ot.replace(Gt,"")}}return function(Mt){var Vt=Mt.afternoon;if(Vt!==void 0){var Bt=Mt.hours;Vt?Bt<12&&(Mt.hours+=12):Bt===12&&(Mt.hours=0),delete Mt.afternoon}}(Ut),Ut}}return function(vt,Et,wt){wt.p.customParseFormat=!0,vt&&vt.parseTwoDigitYear&&(ut=vt.parseTwoDigitYear);var bt=Et.prototype,St=bt.parse;bt.parse=function(Rt){var Ct=Rt.date,It=Rt.utc,jt=Rt.args;this.$u=It;var Pt=jt[1];if(typeof Pt=="string"){var Ot=jt[2]===!0,Ut=jt[3]===!0,Nt=Ot||Ut,Ht=jt[2];Ut&&(Ht=jt[2]),lt=this.$locale(),!Ot&&Ht&&(lt=wt.Ls[Ht]),this.$d=function(Ft,Gt,Mt){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Ft);var Vt=yt(Gt)(Ft),Bt=Vt.year,qt=Vt.month,Qt=Vt.day,Yt=Vt.hours,tr=Vt.minutes,lr=Vt.seconds,ur=Vt.milliseconds,mr=Vt.zone,yr=new Date,or=Qt||(Bt||qt?1:yr.getDate()),hr=Bt||yr.getFullYear(),pr=0;Bt&&!qt||(pr=qt>0?qt-1:yr.getMonth());var _r=Yt||0,Ar=tr||0,Hr=lr||0,Ur=ur||0;return mr?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur+60*mr.offset*1e3)):Mt?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur)):new Date(hr,pr,or,_r,Ar,Hr,Ur)}catch{return new Date("")}}(Ct,Pt,It),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$L),Nt&&Ct!=this.format(Pt)&&(this.$d=new Date("")),lt={}}else if(Pt instanceof Array)for(var Lt=Pt.length,kt=1;kt<=Lt;kt+=1){jt[1]=Pt[kt-1];var $t=wt.apply(this,jt);if($t.isValid()){this.$d=$t.$d,this.$L=$t.$L,this.init();break}kt===Lt&&(this.$d=new Date(""))}else St.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(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(st,nt,ot){var at=nt.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,ft){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,yt,vt){var Et=vt&&vt.toUpperCase();return yt||ft[vt]||rt[vt]||ft[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(wt,bt,St){return bt||St.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,st){tt.exports=st()})(commonjsGlobal,function(){return function(rt,st,nt){rt=rt||{};var ot=st.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,ft){return ot.fromToBase(ct,dt,ht,ft)}nt.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,ft,xt){for(var yt,vt,Et,wt=ht.$locale().relativeTime||at,bt=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"}],St=bt.length,Rt=0;Rt<St;Rt+=1){var Ct=bt[Rt];Ct.d&&(yt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var It=(rt.rounding||Math.round)(Math.abs(yt));if(Et=yt>0,It<=Ct.r||!Ct.r){It<=1&&Rt>0&&(Ct=bt[Rt-1]);var jt=wt[Ct.l];xt&&(It=xt(""+It)),vt=typeof jt=="string"?jt.replace("%d",It):jt(It,dt,Ct.l,Et);break}}if(dt)return vt;var Pt=Et?wt.future:wt.past;return typeof Pt=="function"?Pt(vt):Pt.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?nt.utc():nt()};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$2={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var nt=st(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 nt.default.locale(lt,null,!0),lt})})(de$2);var es={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),{t:et}=useTranslation(),rt=reactExports.useCallback((lt,ut)=>{if(lt.length<11)return dayjs(lt,["YYYY-MM-DD"],ut);if(lt.split("").findIndex(ct=>"0">ct||ct>"9")<0)return dayjs(Number.parseInt(lt)).locale(tt);{let ct=dayjs(lt).locale(tt);return ct.isValid()||(ct=dayjs(lt,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),ct}},[tt]),st=reactExports.useCallback(lt=>{let ut=dayjs();try{return typeof lt>"u"?void 0:(typeof lt=="string"?ut=rt(lt):typeof lt=="number"?ut=dayjs(lt).locale(tt):typeof lt.$date=="number"?ut=dayjs(new Date(lt.$date)).locale(tt):typeof lt.$date=="string"&&(ut=rt(lt.$date)),ut)}catch(ct){console.error(ct)}return ut},[tt,rt]),nt=reactExports.useCallback(lt=>{const ut=st(lt);if(!(ut!=null&&ut.isValid()))return"";const ct=dayjs();return ut.isSame(ct,"date")?ut.fromNow():ut.isSame(ct.subtract(1,"day"),"date")?et("date.format.yesterday"):ct.diff(ut,"days")<=7?ut.format(et("date.format.currentWeek")):ut.isSame(ct,"year")?ut.format(et("date.format.currentYear")):ut.format(et("date.format.previousYear"))},[tt,rt]),ot=reactExports.useCallback(lt=>{const ut=st(lt);return ut!=null&&ut.isValid()?ut.fromNow():""},[tt,rt]),at=reactExports.useCallback((lt,ut="short")=>{const ct=st(lt);let dt="";switch(ut){case"short":dt="L";break;case"long":dt="LL";break;case"abbr":dt="ll";break;default:dt=ut}return ct!=null&&ct.isValid()?ct.locale(tt).format(dt):""},[tt,rt]);return{fromNow:ot,formatDate:at,formatTimeAgo:nt}}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=()=>{et(!0)},nt=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",st),ot.addEventListener("mouseout",nt),()=>{ot.removeEventListener("mouseover",st),ot.removeEventListener("mouseout",nt)}},[rt]),[rt,tt]}let e$1={data:""},t$1=tt=>{if(typeof window=="object"){let et=(tt?tt.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return et.nonce=window.__nonce__,et.parentNode||(tt||document.head).appendChild(et),et.firstChild}return tt||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$2=/\n+/g,o$1=(tt,et)=>{let rt="",st="",nt="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":st+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?st+=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(),nt+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&nt?et+"{"+nt+"}":nt)+st},c$1={},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,st,nt)=>{let ot=s$1(tt),at=c$1[ot]||(c$1[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$1[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,ft=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?ft.shift():dt[3]?(ht=dt[3].replace(n$2," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(tt);c$1[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$1.g?c$1.g:null;return rt&&(c$1.g=c$1[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$1[at],et,st,lt),at},p$1=(tt,et,rt)=>tt.reduce((st,nt,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 st+nt+(at??"")},"");function u$1(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((st,nt)=>Object.assign(st,nt&&nt.call?nt(et.p):nt),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$1.bind({g:1});let h$2=u$1.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function w$2(tt,et){let rt=this||{};return function(){let st=arguments;function nt(ot,at){let lt=Object.assign({},ot),ut=lt.className||nt.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$1.apply(rt,st)+(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 et?et(nt):nt}}var Z$1=tt=>typeof tt=="function",h$1=(tt,et)=>Z$1(tt)?tt(et):tt,W$2=(()=>{let tt=0;return()=>(++tt).toString()})(),E$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),re$1=20,k$2="default",H$3=(tt,et)=>{let{toastLimit:rt}=tt.settings;switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,rt)};case 1:return{...tt,toasts:tt.toasts.map(at=>at.id===et.toast.id?{...at,...et.toast}:at)};case 2:let{toast:st}=et;return H$3(tt,{type:tt.toasts.find(at=>at.id===st.id)?1:0,toast:st});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(at=>at.id===nt||nt===void 0?{...at,dismissed:!0,visible:!1}:at)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(at=>at.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let ot=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(at=>({...at,pauseDuration:at.pauseDuration+ot}))}}},v$1=[],j$2={toasts:[],pausedAt:void 0,settings:{toastLimit:re$1}},f$1={},Y$1=(tt,et=k$2)=>{f$1[et]=H$3(f$1[et]||j$2,tt),v$1.forEach(([rt,st])=>{rt===et&&st(f$1[et])})},_$1=tt=>Object.keys(f$1).forEach(et=>Y$1(tt,et)),Q$1=tt=>Object.keys(f$1).find(et=>f$1[et].toasts.some(rt=>rt.id===tt)),S$1=(tt=k$2)=>et=>{Y$1(et,tt)},se$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V$1=(tt={},et=k$2)=>{let[rt,st]=reactExports.useState(f$1[et]||j$2),nt=reactExports.useRef(f$1[et]);reactExports.useEffect(()=>(nt.current!==f$1[et]&&st(f$1[et]),v$1.push([et,st]),()=>{let at=v$1.findIndex(([lt])=>lt===et);at>-1&&v$1.splice(at,1)}),[et]);let ot=rt.toasts.map(at=>{var lt,ut,ct;return{...tt,...tt[at.type],...at,removeDelay:at.removeDelay||((lt=tt[at.type])==null?void 0:lt.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:at.duration||((ut=tt[at.type])==null?void 0:ut.duration)||(tt==null?void 0:tt.duration)||se$1[at.type],style:{...tt.style,...(ct=tt[at.type])==null?void 0:ct.style,...at.style}}});return{...rt,toasts:ot}},ie$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)||W$2()}),P$1=tt=>(et,rt)=>{let st=ie$1(et,tt,rt);return S$1(st.toasterId||Q$1(st.id))({type:2,toast:st}),st.id},n$1=(tt,et)=>P$1("blank")(tt,et);n$1.error=P$1("error");n$1.success=P$1("success");n$1.loading=P$1("loading");n$1.custom=P$1("custom");n$1.dismiss=(tt,et)=>{let rt={type:3,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.dismissAll=tt=>n$1.dismiss(void 0,tt);n$1.remove=(tt,et)=>{let rt={type:4,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.removeAll=tt=>n$1.remove(void 0,tt);n$1.promise=(tt,et,rt)=>{let st=n$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?h$1(et.success,nt):void 0;return ot?n$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):n$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?h$1(et.error,nt):void 0;ot?n$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):n$1.dismiss(st)}),tt};var ce$1=1e3,w$1=(tt,et="default")=>{let{toasts:rt,pausedAt:st}=V$1(tt,et),nt=reactExports.useRef(new Map).current,ot=reactExports.useCallback((ht,ft=ce$1)=>{if(nt.has(ht))return;let xt=setTimeout(()=>{nt.delete(ht),at({type:4,toastId:ht})},ft);nt.set(ht,xt)},[]);reactExports.useEffect(()=>{if(st)return;let ht=Date.now(),ft=rt.map(xt=>{if(xt.duration===1/0)return;let yt=(xt.duration||0)+xt.pauseDuration-(ht-xt.createdAt);if(yt<0){xt.visible&&n$1.dismiss(xt.id);return}return setTimeout(()=>n$1.dismiss(xt.id,et),yt)});return()=>{ft.forEach(xt=>xt&&clearTimeout(xt))}},[rt,st,et]);let at=reactExports.useCallback(S$1(et),[et]),lt=reactExports.useCallback(()=>{at({type:5,time:Date.now()})},[at]),ut=reactExports.useCallback((ht,ft)=>{at({type:1,toast:{id:ht,height:ft}})},[at]),ct=reactExports.useCallback(()=>{st&&at({type:6,time:Date.now()})},[st,at]),dt=reactExports.useCallback((ht,ft)=>{let{reverseOrder:xt=!1,gutter:yt=8,defaultPosition:vt}=ft||{},Et=rt.filter(St=>(St.position||vt)===(ht.position||vt)&&St.height),wt=Et.findIndex(St=>St.id===ht.id),bt=Et.filter((St,Rt)=>Rt<wt&&St.visible).length;return Et.filter(St=>St.visible).slice(...xt?[bt+1]:[0,bt]).reduce((St,Rt)=>St+(Rt.height||0)+yt,0)},[rt]);return reactExports.useEffect(()=>{rt.forEach(ht=>{if(ht.dismissed)ot(ht.id,ht.removeDelay);else{let ft=nt.get(ht.id);ft&&(clearTimeout(ft),nt.delete(ht.id))}})},[rt,ot]),{toasts:rt,handlers:{updateHeight:ut,startPause:lt,endPause:ct,calculateOffset:dt}}},de$1=h$2`
49
+ `):" "+renderReason(at[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+lt,"ERR_NOT_SUPPORT")}return nt}const adapters={getAdapter:getAdapter$1,adapters:knownAdapters};function throwIfCancellationRequested(tt){if(tt.cancelToken&&tt.cancelToken.throwIfRequested(),tt.signal&&tt.signal.aborted)throw new CanceledError$1(null,tt)}function dispatchRequest(tt){return throwIfCancellationRequested(tt),tt.headers=AxiosHeaders$1.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$4.adapter,tt)(tt).then(function(st){return throwIfCancellationRequested(tt),st.data=transformData.call(tt,tt.transformResponse,st),st.headers=AxiosHeaders$1.from(st.headers),st},function(st){return isCancel$1(st)||(throwIfCancellationRequested(tt),st&&st.response&&(st.response.data=transformData.call(tt,tt.transformResponse,st.response),st.response.headers=AxiosHeaders$1.from(st.response.headers))),Promise.reject(st)})}const VERSION$1="1.13.1",validators$1={};["object","boolean","number","function","string","symbol"].forEach((tt,et)=>{validators$1[tt]=function(st){return typeof st===tt||"a"+(et<1?"n ":" ")+tt}});const deprecatedWarnings={};validators$1.transitional=function(et,rt,st){function nt(ot,at){return"[Axios v"+VERSION$1+"] Transitional option '"+ot+"'"+at+(st?". "+st:"")}return(ot,at,lt)=>{if(et===!1)throw new AxiosError$1(nt(at," has been removed"+(rt?" in "+rt:"")),AxiosError$1.ERR_DEPRECATED);return rt&&!deprecatedWarnings[at]&&(deprecatedWarnings[at]=!0,console.warn(nt(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,st)=>(console.warn(`${st} is likely a misspelling of ${et}`),!0)};function assertOptions(tt,et,rt){if(typeof tt!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const st=Object.keys(tt);let nt=st.length;for(;nt-- >0;){const ot=st[nt],at=et[ot];if(at){const lt=tt[ot],ut=lt===void 0||at(lt,ot,tt);if(ut!==!0)throw new AxiosError$1("option "+ot+" must be "+ut,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(rt!==!0)throw new AxiosError$1("Unknown option "+ot,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{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(st){if(st instanceof Error){let nt={};Error.captureStackTrace?Error.captureStackTrace(nt):nt=new Error;const ot=nt.stack?nt.stack.replace(/^.+\n/,""):"";try{st.stack?ot&&!String(st.stack).endsWith(ot.replace(/^.+\n.+\n/,""))&&(st.stack+=`
50
+ `+ot):st.stack=ot}catch{}}throw st}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:st,paramsSerializer:nt,headers:ot}=rt;st!==void 0&&validator.assertOptions(st,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),nt!=null&&(utils$4.isFunction(nt)?rt.paramsSerializer={serialize:nt}:validator.assertOptions(nt,{encode:validators.function,serialize:validators.function},!0)),rt.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?rt.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:rt.allowAbsoluteUrls=!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$1.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,ft;if(!ut){const yt=[dispatchRequest.bind(this),void 0];for(yt.unshift(...lt),yt.push(...ct),ft=yt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(yt[ht++],yt[ht++]);return dt}ft=lt.length;let xt=rt;for(;ht<ft;){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,ft=ct.length;ht<ft;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls);return buildURL(rt,et.params,et.paramsSerializer)}};utils$4.forEach(["delete","get","head","options"],function(et){Axios$1.prototype[et]=function(rt,st){return this.request(mergeConfig$1(st||{},{method:et,url:rt,data:(st||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(st){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:st?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios$1.prototype[et]=rt(),Axios$1.prototype[et+"Form"]=rt(!0)});let CancelToken$1=class sm{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 st=this;this.promise.then(nt=>{if(!st._listeners)return;let ot=st._listeners.length;for(;ot-- >0;)st._listeners[ot](nt);st._listeners=null}),this.promise.then=nt=>{let ot;const at=new Promise(lt=>{st.subscribe(lt),ot=lt}).then(nt);return at.cancel=function(){st.unsubscribe(ot)},at},et(function(ot,at,lt){st.reason||(st.reason=new CanceledError$1(ot,at,lt),rt(st.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=st=>{et.abort(st)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new sm(function(nt){et=nt}),cancel:et}}};function spread$1(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError$1(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode$1={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(HttpStatusCode$1).forEach(([tt,et])=>{HttpStatusCode$1[et]=tt});function createInstance(tt){const et=new Axios$1(tt),rt=bind$3(Axios$1.prototype.request,et);return utils$4.extend(rt,Axios$1.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(nt){return createInstance(mergeConfig$1(tt,nt))},rt}const axios=createInstance(defaults$4);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function m$3(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$2=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,st=et,nt=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(st))+" "+nt[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 st=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:st,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,st,nt){return st>nt&&(et=Math.round(et*nt/st),st=nt),et>rt&&(st=Math.round(st*rt/et),et=rt),{height:et,width:st}}static renameFileNameExtension(et,rt){const st=et.split(".");return st.pop(),st.join(".")+"."+rt}static resizeImage(et,rt,st,nt,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const ft=this.changeDimension(ht,nt,dt,st);dt=ft.width,ht=ft.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,st=1440,nt=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,st,ot,nt);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$5=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$5(this,"wordExtensions",new Set),n$5(this,"excelExtensions",new Set),n$5(this,"pptExtensions",new Set),n$5(this,"fileExtensionMap",new Map),n$5(this,"csvContentType",new Set),n$5(this,"csvExtensions",new Set),n$5(this,"txtExtensions",new Set),n$5(this,"mdExtensions",new Set),n$5(this,"PDF","application/pdf"),n$5(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 st=this.getExtensionForContentType(et);return st?this.wordExtensions.has(st):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.excelExtensions.has(st):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 st=this.getExtensionForContentType(et);return st?this.pptExtensions.has(st):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.txtExtensions.has(st):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.mdExtensions.has(st):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$5(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$4=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 T$1=Object.defineProperty,P$2=(tt,et,rt)=>et in tt?T$1(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$3=(tt,et,rt)=>P$2(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$4={VIDEO:"video"},b$1=class Iu{constructor(et){n$3(this,"name"),n$3(this,"listeners",new Set),this.name=et}static getChannel(et){let rt=Iu.channels.get(et);return rt||(rt=new Iu(et),Iu.channels.set(et,rt)),rt}listen(et){return this.listeners.add(et),()=>{this.listeners.delete(et)}}publish(et){for(const rt of Array.from(this.listeners))try{rt(et)}catch(st){console.error("[SimpleChannel] publish failed",st)}}close(){this.listeners.clear(),Iu.channels.delete(this.name)}};n$3(b$1,"channels",new Map);let SimpleChannel=b$1;class Subscription{constructor(et,rt){n$3(this,"revoke"),this._channel=et,this.revoke=this.setReceiver(st=>rt==null?void 0:rt(st))}setReceiver(et){if(!this._channel)return()=>{};const rt=this._channel.listen(et);return()=>{rt(),this._channel=void 0}}}class Subject{constructor(){n$3(this,"publishChannels",new Map)}getChannelName(et){return"Subject:"+et}getPublishChannel(et){const rt=this.getChannelName(et);let st=this.publishChannels.get(rt);return st||(st=this.newChannel(et),this.publishChannels.set(rt,st)),st}newChannel(et){const rt=this.getChannelName(et);return SimpleChannel.getChannel(rt)}publish(et,rt){typeof et=="string"&&this.getPublishChannel(et).publish(rt)}subscribe(et,rt){if(typeof et=="string"){const st=this.newChannel(et);return new Subscription(st,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$3(this,"_resolution"),n$3(this,"_rejection"),n$3(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$3(this,"promises",{}),n$3(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$3(this,"axios"),n$3(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 st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}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(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}post(et,rt,st){return this.axios.post(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}postFile(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}postJson(et,rt,st){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(st)).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}put(et,rt,st){return this.axios.put(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}putJson(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(st=>this.mapAxiosResponse(st)).catch(st=>this.mapAxiosError(st))}getScript(et,rt,st){const nt=st??"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 ${nt.split(".")[0]}={};${at};return ${nt};`;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(st=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){n$3(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$3(this,"_me",null),n$3(this,"_currentLanguage",""),n$3(this,"_notLoggedIn",!0),n$3(this,"_description"),n$3(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(st=>st.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const st=rt.right||rt,nt=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[st]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return nt&&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$3(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),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$3(this,"_conf"),n$3(this,"_loaded"),n$3(this,"skinName",""),n$3(this,"themeName",""),n$3(this,"skin","raw"),n$3(this,"themeUrl","/assets/themes/raw/default/"),n$3(this,"templateOverrides",{}),n$3(this,"portalTemplate","/assets/themes/raw/portal.html"),n$3(this,"basePath",""),n$3(this,"logoutCallback",""),n$3(this,"skins",[]),n$3(this,"is1D",!1),n$3(this,"is2D",!1),n$3(this,"_onSkinReady",notify.onSkinReady()),n$3(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,st;const nt=await this.listSkins();this.is1D=((rt=nt.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((st=nt.find(ot=>ot.child===this.skin))==null?void 0:st.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,st)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.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(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),st()})})}loadConnected(et){return new Promise((rt,st)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),rt()}).catch(nt=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}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(st=>st.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(st=>st.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 st=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}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,st){const nt=promises$1[rt];if(nt)st&&nt.then(st).catch(st);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 st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}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 UserPreferences{constructor(){n$3(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(st=>{try{return JSON.parse(st.preference)}catch{return rt??{}}}).then(st=>(this.data[et]=st??{},st))}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$3(this,"_me",null),n$3(this,"_keepOpenOnLogout",!1),n$3(this,"_preferences",new UserPreferences),n$3(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 st;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,st={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",st);return}else st=rt;st||(st={bookmarks:[],applications:[]});let nt=!0;const ot=[];st.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),nt=!1}),ot.forEach(at=>{const lt=st.bookmarks.indexOf(at);lt!==-1&&st.bookmarks.splice(lt,1)}),nt||transport.http.putJson("/userbook/preference/apps",st)})}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$3(this,"_publicConf",{}),n$3(this,"_currentApp"),n$3(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(st=>{if(st!=null&&st.prefix){const nt=st.prefix.replace("/","");this._appConf[nt]=st}else st!=null&&st.name&&st.name.toLowerCase()==et&&(rt=st)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){n$3(this,"_status","void"),n$3(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(st=>!rt||st.type===et||st.type==="multiple"?st[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,st=session.session.description;let nt;for(const ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.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||!nt.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:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st.profiles&&st.profiles.length>0?ut[st.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){n$3(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$3(this,"School",{}),n$3(this,"User",new User)}async initialize(et,rt){if(!et){const nt=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${nt(lt)}${nt(ut)}`}const st=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(st),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(st)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var D$2;(D$2=session==null?void 0:session.session)==null||D$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},st){this.set(`${et}:main`,st),this.set(`${et}:${rt}`,st)}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},st){const nt=this.get(`${et}:${rt}`);if(nt===void 0)throw`Service not found: ${et}:${rt}`;return nt(st)}}const m$2=class{constructor(et){n$3(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(st=>{rt.append("activityType[]",st)}),et.subjectArea.forEach(st=>{rt.append("subjectArea[]",st)}),et.age.forEach(st=>{rt.append("age[]",st.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(st=>{rt.append("keyWords[]",st.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 st=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(st)}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 st=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(st)}async trashAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(nt)}async restoreAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(nt)}async mapAssetIdToIds({application:et,assetIds:rt}){const st=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(nt=>{const ot=st.resources.find(at=>at.assetId===nt);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(st=>st.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[[st,nt]]=Object.entries(et.orders);rt.order_by=`${st}:${nt}`}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$3(m$2,"registry",new ServiceRegistry),n$3(m$2,"register",m$2.registry.register.bind(m$2.registry)),n$3(m$2,"findService",m$2.registry.findService.bind(m$2.registry)),n$3(m$2,"findMainService",m$2.registry.findMainService.bind(m$2.registry)),n$3(m$2,"isRegistered",m$2.registry.isRegistered.bind(m$2.registry));let ResourceService=m$2;const APP$3="scrapbook",RESOURCE$3="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$3}getApplication(){return APP$3}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$3,resourceType:RESOURCE$3},tt=>new ScrapbookResourceService(tt));const APP$2="homeworks",RESOURCE$2="homeworks";class HomeworksResourceService extends ResourceService{async create(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.post("/homeworks",{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats,folder:et.folder});return this.checkHttpResponse(st),{thumbnail:rt,entId:st._id}}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/homeworks/${et.entId}`,{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$2}getApplication(){return APP$2}getFormUrl(et){return et?`/homeworks?folderid=${et}#/create-homeworks/`:"/homeworks#/create-homeworks/"}getViewUrl(et){return`/homeworks#/view-homeworks/${et}`}getPrintUrl(et){return`/homeworks/print#/print-homeworks/${et}`}getEditUrl(et){return`/homeworks#/edit-homeworks/${et}`}getExportUrl(){throw new Error("Export not implemented.")}}ResourceService.register({application:RESOURCE$2,resourceType:RESOURCE$2},tt=>new HomeworksResourceService(tt));const APP$1="timelinegenerator",RESOURCE$1="timelinegenerator";class TimelineGeneratorResourceService extends ResourceService{async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=await this.http.post("/timelinegenerator/timelines",{headline:et.name,text:et.description,icon:rt,type:"default",folder:et.folder});return this.checkHttpResponse(st),st}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/timelinegenerator/timeline/${et.entId}`,{headline:et.name,text:et.description,icon:rt,trashed:!!et.trashed,_id:et.entId,type:"default"});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$1}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/timelinegenerator#/view/${et}`}getPrintUrl(et){return`/timelinegenerator/print#/print/${et}`}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new TimelineGeneratorResourceService(tt));const APP$5="collaborativeeditor",RESOURCE$4="collaborativeeditor";class CollaborativeEditorResourceService extends ResourceService{async create(et){const{name:rt,description:st,thumbnail:nt,folder:ot}=et,at=nt?await this.getThumbnailPath(nt):"",lt=await this.http.post("/collaborativeeditor",{name:rt,description:st,thumbnail:at,folder:ot});return this.checkHttpResponse(lt),lt}async update(et){const{name:rt,description:st,thumbnail:nt,entId:ot}=et,at=await this.getThumbnailPath(nt),lt=await this.http.put(`/collaborativeeditor/${ot}`,{name:rt,description:st,thumbnail:at});return this.checkHttpResponse(lt),{thumbnail:at,entId:ot}}getResourceType(){return RESOURCE$4}getApplication(){return APP$5}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/collaborativeeditor#/view/${et}`}getPrintUrl(){throw new Error("Method not implemented.")}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$4,resourceType:RESOURCE$4},tt=>new CollaborativeEditorResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,st){if(mutexPromise[et]!==void 0&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=rt();mutexPromise[et]=nt;const ot=await nt;return st(ot)&&(globalCache[et]=ot),ot}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}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 st=await this.http.get(et,rt),nt={...this.http.latestResponse};return{value:st,response:nt}},({response:st})=>!(st.status<200||st.status>=300))}async httpGetJson(et,rt){const{response:st,value:nt}=await this.httpGet(et,rt);if(st.status<200||st.status>=300)throw`Bad http status (${st.status}) for url: ${et}`;return nt}}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,st]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:st===void 0}),this.getWebAppConf({app:et,applications:st??[]})]),at={app:et,applications:st??[],conf:rt,currentApp:ot,theme:nt};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:st}=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 st}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(st=>{if(st!=null&&st.prefix)return(st==null?void 0:st.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:st}){var nt;const ot=await this.http.get("/theme"),at=(nt=rt==null?void 0:rt.overriding)==null?void 0:nt.find(ft=>st?ft.parent==="theme-open-ent"&&ft.bootstrapVersion==="ode-bootstrap-neo":ft.child===(ot==null?void 0:ot.themeName)),lt=st?"default":(ot==null?void 0:ot.skinName)||(at==null?void 0:at.skins[0]),ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at==null?void 0:at.child}/skins/${lt}/`,ct=at==null?void 0:at.skins,dt=at==null?void 0:at.bootstrapVersion.split("-").slice(-1)[0],ht=(at==null?void 0:at.parent)==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"",skin:at==null?void 0:at.child,skinName:lt,skins:ct,themeName:at==null?void 0:at.child,themeUrl:ut,npmTheme:(at==null?void 0:at.npmTheme)??void 0}}async getLogoutCallback(et){const{response:rt,value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return st.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,st="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${st}`:"/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:st,name:nt,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:st,displayName:nt,groups:rt.map(({name:at,id:lt,nbUsers:ut})=>({nbUsers:ut,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:st,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const ot=nt.map(ht=>typeof ht=="string"?ht:ht.id),at=st.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:ft,groups:xt,id:yt,users:vt}=await this.getBookMarkById(ht),Et=vt.map(bt=>bt.id),wt=xt.map(bt=>bt.id);return{displayName:ft,id:yt,members:[...wt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,ft)=>[...ht,...ft],[]),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$3(this,"axios"),n$3(this,"baseUrl"),n$3(this,"headers",{}),n$3(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 st=rt.headers??{};return rt.headers={...st,...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 st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}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:st,statusText:nt,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:st,statusText:nt,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 st=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async post(et,rt,st){try{const nt=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async postFile(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async postJson(et,rt,st){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async put(et,rt,st){try{const nt=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async patch(et,rt,st){try{const nt=await this.axios.patch(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.patch(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.patch(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async delete(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async deleteJson(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(st)}catch(st){throw this.mapAxiosError(st)}}getScript(et,rt,st){const nt=st??"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 ${nt.split(".")[0]}={};${at};return ${nt};`;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(st=>{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},st,nt){const ot=nt.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===st||rt.includes(at.id)&&at.type==="group"&&at.right===st)return!0;return!1}async sessionHasResourceRight(et,rt){try{const st=await this.session.getUser();return!!st&&this.hasResourceRight({groupIds:st.groupsIds,id:st.userId},et,rt)}catch(st){return console.error(`Unexpected error ${st} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const st of et)if(await this.sessionHasResourceRight(st,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let st=0;for(const nt of rt)await this.sessionHasResourceRight(et,nt)&&st++;return st===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const st of et){let nt=0;for(const ot of rt)await this.sessionHasResourceRight(st,ot)&&nt++;if(nt===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(st=>st===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(st=>st.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const st=await this.session.getUser();for(const nt of et)rt[nt]=!!st&&this.hasWorkflowRight(nt,st.authorizedActions.map(ot=>ot.name))}catch(st){console.error(`Unexpected error ${st} in sessionHasWorkflowRights()`);for(const nt of et)rt[nt]=!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,st,nt,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:st,currentLanguage:rt,userDescription:nt,userProfile:ot,bookmarkedApps:at}}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),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(st){return console.error(st),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let st;return rt?st=await this.loadUserLanguage():st=await this.loadDefaultLanguage(),st}catch(st){console.error(st)}}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(st=>st.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,st]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...st,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 st=JSON.parse(rt.preference);let nt;nt=st,nt||(nt={bookmarks:[],applications:[]});const ot=[];return nt.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,st;const{options:nt={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,nt);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((st=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:st.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(st=>{var nt;return st!=null&&st.prefix?(st==null?void 0:st.prefix.replace("/",""))===et||!1:st!=null&&st.address&&((nt=st.address)==null?void 0:nt.split("/")[1])===et||!1})}}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 st=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,st){this.loadBundle(et,rt,st)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,st){const nt=promises[rt];if(nt)st&&nt.then(st).catch(st);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 st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[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,st){const nt=StringUtils.removeAccents(st).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${st}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),yt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ht||"").toLowerCase();return yt.includes(nt)||xt.includes(nt)||ft.includes(nt)||vt.includes(nt)}).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(nt)).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(nt)).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 st of Object.keys(rt))if(st.includes(".")){const nt=st.split(".")[1],ot=rt[st];delete rt[st],rt[nt]=ot}return rt}getActionsAvailableFor({id:et,type:rt},st,nt){const ot=(rt==="user"?st.users.checked[et]:st.groups.checked[et])||[],at=Object.keys(nt),lt=[];for(const ut of at)nt[ut].filter(ct=>ot.includes(ct)).length>0&&lt.push(ut);return lt}async getRightsForResource(et,rt){const st=await this.directory.getBookMarks(),nt=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(nt),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,labels:Et})=>({labels:Et,displayName:xt||vt,id:yt})),ft=ot.users.visibles.map(({id:xt,profile:yt,username:vt,firstName:Et,lastName:wt,login:bt})=>({displayName:vt,firstName:Et,lastName:wt,login:bt,profile:yt,id:xt}));return{rights:dt,visibleBookmarks:st,visibleGroups:ht,visibleUsers:ft}}async saveRights(et,rt,st){const nt=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of st){const ut=lt.actions.map(dt=>nt[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"),st=await this.getShareMapping(et);return Object.keys(rt).map(nt=>{const ot=rt[nt];return{displayName:nt,id:nt,priority:ot.priority,requires:ot.requires}}).filter(nt=>{var ot;return((ot=st[nt.id])==null?void 0:ot.length)>0}).sort((nt,ot)=>nt.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}},C$2=class nm{static getRole(et){var rt,st;return nm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(st=et.metadata)==null?void 0:st.extension)}static role(et,rt=!1,st){if(st&&(st=st.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const nt={type:et,previewRole:rt,extension:st};for(const ot of this.roleMappers){const at=ot(nt);if(at)return at}return"unknown"}};n$3(C$2,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=C$2;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",st=rt.split("."),nt=et.type||"application/octet-stream",ot=st.length>1?st[st.length-1]:"",at={"content-type":nt,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(nt,!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:st,metadata:nt}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,st);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}`),nt.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,st){const{fullname:nt,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,nt);const lt=[];ot.role==="img"&&lt.push("quality=1"),st!=null&&st.alt&&lt.push(`alt=${st.alt}`),st!=null&&st.legend&&lt.push(`legend=${st.legend}`),st!=null&&st.name&&lt.push(`name=${st.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(st=>st._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 st=>st.deleted&&st.trasher?(rt==null?void 0:rt.userId)==st.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],st=await this.acceptDocuments(et);return rt.filter(st)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,st="protected"){const nt=[];if(et.forEach(ot=>{(st==="public"&&!ot.public||!ot.public&&!ot.protected)&&nt.push(ot)}),nt.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:st,ids:nt.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return nt.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,st=0){var nt,ot;const at=rt>0||st>0?`${rt}x${st}`:"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=(nt=et.metadata)==null?void 0:nt["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}}listFolder(et,rt=!1,st,nt){const ot={filter:et,hierarchical:rt,parentId:st,directShared:nt};return this.http.get("/workspace/folders/list",{queryParams:ot})}listOwnerFolders(et,rt){return this.listFolder("owner",et,rt)}listSharedFolders(et,rt){return this.listFolder("shared",et,rt,!0)}createFolder(et,rt){const st=new FormData;return st.append("name",et),rt&&st.append("parentFolderId",rt),this.http.postFile("/workspace/folder",st)}}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 st=rt.LIBELLE_SERVICE.default||null;for(const nt in rt.LIBELLE_SERVICE)if(nt!=="default"&&tt.indexOf(nt)>=0){st=rt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:st,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(),st=await this.session.getUserProfile();let nt;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.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:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st&&st.length>0?ut[st[0]]??"":""}}}const R$1=class Y0{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$4.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??Y0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??Y0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(st=>st.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:st,duration:nt}){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",""+st);let lt=`/video/encode?captation=${st}`;nt&&(lt+=`&duration=${nt}`);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 ft=await this.http.get(`/video/status/${ut.processid}`);if(ft.state=="succeed")return ft.videoworkspaceid&&ft.videosize&&this.context.data().trackVideoSave(ft.videoworkspaceid,Math.round(nt),ft.videosize,st,et.url,ot,et.device),ft;if(ft.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};n$3(R$1,"MAX_WEIGHT",50),n$3(R$1,"MAX_DURATION",3);let VideoService=R$1;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 st of et)if(this.isUrlFromProvider(rt,st))return st}urlIsFromPattern(et,rt){const st=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),nt=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(st)||[],lt=[];return(rt.match(nt)||[]).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 st of rt.url)if(this.urlIsFromPattern(et,st))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const st of et.url)if(this.urlIsFromPattern(rt,st)){const nt=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=st.match(nt)||[];let at=et.embed;for(const lt of ot){let ut=st.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=st.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const ft=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(ft,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){n$3(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 st=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:st,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","actualites"),n$3(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{let 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$3(this,"APP","blog"),n$3(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const st=await this.httpGet("/blog/linker"),nt=[];st.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}));nt.push(...at)}),et(nt)}catch(st){rt(st)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","collaborativewall"),n$3(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$3(this,"APP","community"),n$3(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{let 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$3(this,"APP","exercizer"),n$3(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 st,nt=!1;const ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(nt=!0,st=ot.groupList[0].name):ot.userList.length>0?(nt=!0,st=ot.userList[0].name):st="",ot.groupList.length+ot.userList.length>1&&(st+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:st,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:nt,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","formulaire"),n$3(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$3(this,"APP","forum"),n$3(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$3(this,"APP","homeworks"),n$3(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$3(this,"APP","magneto"),n$3(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$3(this,"APP","mindmap"),n$3(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$3(this,"APP","pages"),n$3(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(st=>{var nt;const ot=st.thumbnail?st.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:st.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})),(nt=st.pages)==null||nt.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id+"/"+at.titleLink,_id:st._id+"/"+at.titleLink,shared:typeof st.shared<"u",modified:st.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","poll"),n$3(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$3(this,"APP","scrapbook"),n$3(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$3(this,"APP","timelinegenerator"),n$3(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const st=(await this.httpGet("/timelinegenerator/timelines")).map(nt=>{const ot=nt.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:nt.headline,ownerName:nt.owner.displayName,owner:nt.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})});et(st)}catch(st){rt(st)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","wiki"),n$3(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let st;return typeof et.thumbnail>"u"||et.thumbnail===""?st="/img/icons/glyphicons_036_file.png":st=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:st,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$3(this,"APP","workspace"),n$3(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(st,nt)=>{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})});st(at)}catch(ot){nt(ot)}})}}const w$3=class{static async initialize(et,rt){const st=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[nt,ot]=await Promise.all([st.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&nt!=null&&nt.length&&(this.resourceProducingApps=nt.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(nt){console.warn("Failed to load resource-producing apps:",nt)}}return this.resourceProducingApps}static registerCustomBehaviour(et,rt,st){this.registry.register({application:et,resourceType:rt},st)}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const st={application:et,resourceType:rt};this.registry.register(st,nt=>this.serviceFor(nt,et,rt))})}static serviceFor(et,rt,st){let nt;switch(st){case"timelinegenerator":nt=new TimelinegeneratorBehaviour(et);break;case"workspace":nt=new WorkspaceBehaviour(et);break;case"blog":nt=new BlogBehaviour(et);break;case"actualites":nt=new ActualitesBehaviour(et);break;case"wiki":nt=new WikiBehaviour(et);break;case"pages":nt=new PagesBehaviour(et);break;case"poll":nt=new PollBehaviour(et);break;case"community":nt=new CommunityBehaviour(et);break;case"mindmap":nt=new MindmapBehaviour(et);break;case"forum":nt=new ForumBehaviour(et);break;case"homeworks":nt=new HomeworksBehaviour(et);break;case"scrapbook":nt=new ScrapbookBehaviour(et);break;case"collaborativewall":nt=new CollaborativewallBehaviour(et);break;case"exercizer":nt=new ExercizerBehaviour(et);break;case"formulaire":nt=new FormulaireBehaviour(et);break;case"magneto":nt=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return nt.APP=rt,nt}};n$3(w$3,"registry",new ServiceRegistry),n$3(w$3,"findBehaviour",w$3.registry.findService.bind(w$3.registry)),n$3(w$3,"hasBehaviour",w$3.registry.isRegistered.bind(w$3.registry)),n$3(w$3,"resourceProducingApps",[]);let SnipletsService=w$3;const SEND_ALL="*";class WebBroker{constructor(et){n$3(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(st=>SEND_ALL===st||et.data["event-type"]===st)>=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,st=>this.dispatchEvent(st,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){n$3(this,"_webBroker"),n$3(this,"app"),n$3(this,"user"),n$3(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,st,nt,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:this.app||"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,st,nt,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:nt,source:rt?"CAPTURED":"UPLOADED",url:st});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,st){this.context=et,this.module=rt,this.resourceType=st}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,st){const nt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${st}`);return this.http.isResponseError()?void 0:nt}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,st){this.context=et,this.module=rt,this.resourceType=st}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,st){this.context=et,this.module=rt,this.resourceType=st}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$3(this,"_analytics"),n$3(this,"_cache"),n$3(this,"_conf"),n$3(this,"_data"),n$3(this,"_directory"),n$3(this,"_http"),n$3(this,"_idiom"),n$3(this,"_notify"),n$3(this,"_rights"),n$3(this,"_session"),n$3(this,"_share"),n$3(this,"_video"),n$3(this,"_workspace"),n$3(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={OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",DELETE:"delete",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PUBLISH:"publish"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(st=>st.id===tt&&st.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$3(this,"_initialized"),n$3(this,"_widgets",[]),n$3(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(st=>{var nt;st&&st.widgets?(st.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()})):(nt=this._initialized)==null||nt.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,st=[];rt.listSkins().then(nt=>{var ot;const at=((ot=nt.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&&st.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$3(this,"_schoolConf",{}),n$3(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:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=st.has(tt.id),dt=nt==null?void 0:nt.current.has(tt.id),ht=rt===tt.id,ft=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":ft,"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"]}}),wt=Pt=>at==null?void 0:at(Pt),bt=Pt=>lt==null?void 0:lt(Pt),St=Pt=>ut==null?void 0:ut(Pt),Rt=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),at==null||at(tt.id))},Ct=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),lt==null||lt(tt.id))},It=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:vt("foldUnfold"),width:yt,height:yt}),jt=()=>{var Pt;const Ot=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),Ut=Array.isArray(tt.children)&&tt.children.length>0;return dt||Ot&&Ut};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:()=>bt(tt.id),onKeyDown:Ct,"aria-label":vt("foldUnfold"),children:jt()&&It(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>wt(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:()=>St(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(Pt=>jsxRuntimeExports.jsx(TreeNode,{node:Pt,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},Pt.id))})]})},tt.id)};var __defProp=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp(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 st=findTreeNode(rt,et);if(st)return st}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const st=findNodeById(rt,et);if(st)return st}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const st=findNodeById(rt,et);if(st)return st}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,st=>{var nt;if(st.id===et){const ot=[...((nt=st.folder)==null?void 0:nt.ancestors)||[]],at=arrayUnique([...ot,st.id]);return{...st,children:[...st.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return st})}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 st=findParentNode(rt,et);if(st)return st}};function getAncestors(tt,et){var rt;const st=findNodeById(tt,et);return(rt=st==null?void 0:st.folder)!=null&&rt.ancestors?[...(st==null?void 0:st.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 st;const nt=et(tt,rt);if((st=nt==null?void 0:nt.children)!=null&&st.length){const ot=[];for(const at of(nt==null?void 0:nt.children)||[]){const lt=doModify(at,et,nt);lt&&ot.push(lt)}return{...nt,children:ot}}return nt}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(st,nt)=>{var ot,at;if(et===st.id){const lt=[...((ot=st.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,st.id]),ct=[...st.children||[]],dt=((at=st.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const ft=findNodeById(st,ht);ft&&ct.push({...ft,folder:{...ft==null?void 0:ft.folder,ancestors:ut}})}return{...st,children:ct}}else return rt.includes(st.id)&&et!==(nt==null?void 0:nt.id)?void 0:st})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,st=>(st.id===rt&&(st.children=et==null?void 0:et.map(nt=>new TreeNodeFolderWrapper(nt))),st));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,st=>st.id===et?new TreeNodeFolderWrapper(rt):st)}function findPathById(tt,et){let rt=[];function st(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(st(lt,at.concat(ot.id)))return!0}return!1}function nt(ot){if(Array.isArray(ot)){for(const at of ot)if(st(at,[]))break}else st(ot,[])}return nt(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:st,allExpandedNodes:nt,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),ft=reactExports.useRef(new Set),[xt,yt]=reactExports.useState(void 0),vt=ut??rt;function Et(Nt){var Ht;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:$t})=>$t!==Lt.id).some($t=>$t.children&&$t.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach($t=>{var Ft;const Gt=(Ft=Lt.children)==null?void 0:Ft.filter(({id:Mt})=>Mt!==$t.id);Gt!=null&&Gt.some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add($t.id),Et($t)})}):(Ht=Nt.children)==null||Ht.forEach(Lt=>{var kt;const $t=new Set(ft.current),Ft=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Ft!=null&&Ft.some(Gt=>Gt.children&&Gt.children.length>0)&&($t.add(Lt.id),ft.current=$t),Et(Lt)})}const wt=Nt=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ht.add(Lt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&Ut(st.overId),yt(st.overId)):yt(void 0)},[st]);const bt=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Nt){Pt(Nt)},allExpandedNodes(){wt(nt)}}),[]);reactExports.useImperativeHandle(et,()=>bt,[bt]),reactExports.useEffect(()=>{wt(nt)},[]),reactExports.useEffect(()=>{rt&&!nt?(St(rt),ct(rt)):ct(void 0)},[rt]);const St=Nt=>{if(!findNodeById(tt,vt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Nt)},Rt=Nt=>{const Ht=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ht);Lt.forEach($t=>{const Ft=kt.indexOf($t);Ft>-1&&kt.splice(Ft,1),kt.push($t)}),Ht.clear(),kt.forEach($t=>Ht.add($t)),Ht.forEach($t=>ot==null?void 0:ot($t)),ht(Ht)},Ct=Nt=>{const Ht=new Set(dt);Ht.delete(Nt),Ht.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ht)},It=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},jt=Nt=>{vt!==Nt&&ct(Nt)},Pt=Nt=>{jt(Nt),Rt(Nt),lt==null||lt(Nt)},Ot=Nt=>{It(Nt)},Ut=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:vt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:Ot}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:st,onTreeItemUnfold:nt,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:st,onTreeItemFold:ot,onTreeItemUnfold:nt});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(wt=>jsxRuntimeExports.jsx(TreeNode,{node:wt,showIcon:ut,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et,handleItemAction:at},wt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et})})})}),VisuallyHidden=reactExports.forwardRef(({children:tt},et)=>jsxRuntimeExports.jsx("span",{className:"visually-hidden",ref:et,children:tt})),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(st=>{const nt=rt.has(st.displayName);return rt.add(st.displayName),!nt})}function useDebounce(tt,et){const[rt,st]=reactExports.useState(tt);return reactExports.useEffect(()=>{const nt=setTimeout(()=>{st(tt)},et);return()=>{clearTimeout(nt)}},[tt,et]),rt}function useHover$1(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=reactExports.useCallback(()=>{et(!0)},[]),nt=reactExports.useCallback(()=>{et(!1)},[]);return[reactExports.useCallback(at=>{var lt;((lt=rt.current)==null?void 0:lt.nodeType)===Node.ELEMENT_NODE&&(rt.current.removeEventListener("mouseenter",st),rt.current.removeEventListener("mouseleave",nt)),(at==null?void 0:at.nodeType)===Node.ELEMENT_NODE&&(at.addEventListener("mouseenter",st),at.addEventListener("mouseleave",nt)),rt.current=at},[st,nt]),tt]}function useMediaQuery(tt){const et=reactExports.useCallback(nt=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",nt),()=>{ot.removeEventListener("change",nt)}},[tt]),rt=()=>window.matchMedia(tt).matches,st=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,st)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),st=reactExports.useCallback(nt=>rt(typeof nt=="boolean"?nt:ot=>!ot),[]);return[et,st]}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,st){var nt="1.0.41",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",yt="type",vt="vendor",Et="version",wt="architecture",bt="console",St="mobile",Rt="tablet",Ct="smarttv",It="wearable",jt="embedded",Pt=500,Ot="Amazon",Ut="Apple",Nt="ASUS",Ht="BlackBerry",Lt="Browser",kt="Chrome",$t="Edge",Ft="Firefox",Gt="Google",Mt="Honor",Vt="Huawei",Bt="Lenovo",qt="LG",Qt="Microsoft",Yt="Motorola",tr="Nvidia",lr="OnePlus",ur="Opera",mr="OPPO",yr="Samsung",or="Sharp",hr="Sony",pr="Xiaomi",_r="Zebra",Ar="Facebook",Hr="Chromium OS",Ur="Mac OS",os=" Browser",Gs=function(Ir,Br){var kr={};for(var Wr in Ir)Br[Wr]&&Br[Wr].length%2===0?kr[Wr]=Br[Wr].concat(Ir[Wr]):kr[Wr]=Ir[Wr];return kr},Es=function(Ir){for(var Br={},kr=0;kr<Ir.length;kr++)Br[Ir[kr].toUpperCase()]=Ir[kr];return Br},Ws=function(Ir,Br){return typeof Ir===dt?Xt(Br).indexOf(Xt(Ir))!==-1:!1},Xt=function(Ir){return Ir.toLowerCase()},er=function(Ir){return typeof Ir===dt?Ir.replace(/[^\d\.]/g,ot).split(".")[0]:st},sr=function(Ir,Br){if(typeof Ir===dt)return Ir=Ir.replace(/^\s\s*/,ot),typeof Br===ut?Ir:Ir.substring(0,Pt)},br=function(Ir,Br){for(var kr=0,Wr,bs,ps,zr,$r,Ls;kr<Br.length&&!$r;){var Zo=Br[kr],Pl=Br[kr+1];for(Wr=bs=0;Wr<Zo.length&&!$r&&Zo[Wr];)if($r=Zo[Wr++].exec(Ir),$r)for(ps=0;ps<Pl.length;ps++)Ls=$r[++bs],zr=Pl[ps],typeof zr===ct&&zr.length>0?zr.length===2?typeof zr[1]==lt?this[zr[0]]=zr[1].call(this,Ls):this[zr[0]]=zr[1]:zr.length===3?typeof zr[1]===lt&&!(zr[1].exec&&zr[1].test)?this[zr[0]]=Ls?zr[1].call(this,Ls,zr[2]):st:this[zr[0]]=Ls?Ls.replace(zr[1],zr[2]):st:zr.length===4&&(this[zr[0]]=Ls?zr[3].call(this,Ls.replace(zr[1],zr[2])):st):this[zr]=Ls||st;kr+=2}},gr=function(Ir,Br){for(var kr in Br)if(typeof Br[kr]===ct&&Br[kr].length>0){for(var Wr=0;Wr<Br[kr].length;Wr++)if(Ws(Br[kr][Wr],Ir))return kr===at?st:kr}else if(Ws(Br[kr],Ir))return kr===at?st:kr;return Br.hasOwnProperty("*")?Br["*"]:Ir},vr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Tr={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"},Lr={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,ur+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,ur+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,ur]],[/\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"+Lt]],[/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 "+Lt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Lt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,Ft+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,ur+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,ur+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+os]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Ft]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+os],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,yr+" 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,Ar],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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,kt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,kt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Lt]],[/(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,gr,vr]],[/(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,Ft+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[wt,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[wt,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[wt,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[wt,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[wt,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[wt,/ower/,ot,Xt]],[/ sun4\w[;\)]/i],[[wt,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[wt,Xt]]],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],[ft,[vt,yr],[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],[ft,[vt,yr],[yt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[vt,Ut],[yt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[vt,Ut],[yt,Rt]],[/(macintosh);/i],[ft,[vt,Ut]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[vt,or],[yt,St]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[ft,[vt,Mt],[yt,Rt]],[/honor([-\w ]+)[;\)]/i],[ft,[vt,Mt],[yt,St]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[ft,[vt,Vt],[yt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[vt,Vt],[yt,St]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[ft,/_/g," "],[vt,pr],[yt,Rt]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[ft,/_/g," "],[vt,pr],[yt,St]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[vt,mr],[yt,St]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[ft,[vt,gr,{OnePlus:["304","403","203"],"*":mr}],[yt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[vt,"Vivo"],[yt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[vt,"Realme"],[yt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[vt,Yt],[yt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[vt,Yt],[yt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[vt,qt],[yt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[vt,qt],[yt,St]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[ft,[vt,Bt],[yt,Rt]],[/(nokia) (t[12][01])/i],[vt,ft,[yt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[ft,/_/g," "],[yt,St],[vt,"Nokia"]],[/(pixel (c|tablet))\b/i],[ft,[vt,Gt],[yt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[vt,Gt],[yt,St]],[/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],[ft,[vt,hr],[yt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[vt,hr],[yt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[vt,lr],[yt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[vt,Ot],[yt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[vt,Ot],[yt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,vt,[yt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[vt,Ht],[yt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[vt,Nt],[yt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[vt,Nt],[yt,St]],[/(nexus 9)/i],[ft,[vt,"HTC"],[yt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[vt,[ft,/_/g," "],[yt,St]],[/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],[ft,[vt,"TCL"],[yt,Rt]],[/(itel) ((\w+))/i],[[vt,Xt],ft,[yt,gr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[vt,"Acer"],[yt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[vt,"Meizu"],[yt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[vt,"Ulefone"],[yt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[vt,"Energizer"],[yt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[vt,"Cat"],[yt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[vt,"Smartfren"],[yt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[vt,"Nothing"],[yt,St]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[ft,[vt,"Archos"],[yt,Rt]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[ft,[vt,"Archos"],[yt,St]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[vt,ft,[yt,Rt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[vt,ft,[yt,St]],[/(kobo)\s(ereader|touch)/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,ft,[yt,Rt]],[/(surface duo)/i],[ft,[vt,Qt],[yt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[vt,"Fairphone"],[yt,St]],[/(u304aa)/i],[ft,[vt,"AT&T"],[yt,St]],[/\bsie-(\w*)/i],[ft,[vt,"Siemens"],[yt,St]],[/\b(rct\w+) b/i],[ft,[vt,"RCA"],[yt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[vt,"Dell"],[yt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[vt,"Verizon"],[yt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[vt,"Barnes & Noble"],[yt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[vt,"NuVision"],[yt,Rt]],[/\b(k88) b/i],[ft,[vt,"ZTE"],[yt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[vt,"ZTE"],[yt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[vt,"Swiss"],[yt,St]],[/\b(zur\d{3}) b/i],[ft,[vt,"Swiss"],[yt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[vt,"Zeki"],[yt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[vt,"Dragon Touch"],ft,[yt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[vt,"Insignia"],[yt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[vt,"NextBook"],[yt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[vt,"Voice"],ft,[yt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[vt,"LvTel"],ft,[yt,St]],[/\b(ph-1) /i],[ft,[vt,"Essential"],[yt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[vt,"Envizen"],[yt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[vt,"MachSpeed"],[yt,Rt]],[/\btu_(1491) b/i],[ft,[vt,"Rotor"],[yt,Rt]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[ft,[vt,tr],[yt,Rt]],[/(sprint) (\w+)/i],[vt,ft,[yt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[vt,Qt],[yt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[vt,_r],[yt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[vt,_r],[yt,St]],[/smart-tv.+(samsung)/i],[vt,[yt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[vt,yr],[yt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[vt,qt],[yt,Ct]],[/(apple) ?tv/i],[vt,[ft,Ut+" TV"],[yt,Ct]],[/crkey/i],[[ft,kt+"cast"],[vt,Gt],[yt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[vt,Ot],[yt,Ct]],[/(shield \w+ tv)/i],[ft,[vt,tr],[yt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[vt,or],[yt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[vt,hr],[yt,Ct]],[/(mi(tv|box)-?\w+) bui/i],[ft,[vt,pr],[yt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[vt,ft,[yt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[vt,sr],[ft,sr],[yt,Ct]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[ft,[yt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[yt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[vt,ft,[yt,bt]],[/droid.+; (shield)( bui|\))/i],[ft,[vt,tr],[yt,bt]],[/(playstation \w+)/i],[ft,[vt,hr],[yt,bt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[vt,Qt],[yt,bt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[ft,[vt,yr],[yt,It]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[vt,ft,[yt,It]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[ft,[vt,mr],[yt,It]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[vt,Ut],[yt,It]],[/(opwwe\d{3})/i],[ft,[vt,lr],[yt,It]],[/(moto 360)/i],[ft,[vt,Yt],[yt,It]],[/(smartwatch 3)/i],[ft,[vt,hr],[yt,It]],[/(g watch r)/i],[ft,[vt,qt],[yt,It]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[vt,_r],[yt,It]],[/droid.+; (glass) \d/i],[ft,[vt,Gt],[yt,It]],[/(pico) (4|neo3(?: link|pro)?)/i],[vt,ft,[yt,It]],[/; (quest( \d| pro)?)/i],[ft,[vt,Ar],[yt,It]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[vt,[yt,jt]],[/(aeobc)\b/i],[ft,[vt,Ot],[yt,jt]],[/(homepod).+mac os/i],[ft,[vt,Ut],[yt,jt]],[/windows iot/i],[[yt,jt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[yt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[yt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[yt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[yt,St]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[ft,[vt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,$t+"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],[/ladybird\//i],[[xt,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,gr,Tr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,gr,Tr],[xt,"Windows"]],[/[adehimnop]{4,7}\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,Ur],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(ubuntu) ([\w\.]+) like android/i],[[xt,/(.+)/,"$1 Touch"],Et],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Ft+" 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,kt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,Hr],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)(?: arm\w*| x86\w*| ?)([\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(Ir,Br){if(typeof Ir===ct&&(Br=Ir,Ir=st),!(this instanceof Dr))return new Dr(Ir,Br).getResult();var kr=typeof rt!==ut&&rt.navigator?rt.navigator:st,Wr=Ir||(kr&&kr.userAgent?kr.userAgent:ot),bs=kr&&kr.userAgentData?kr.userAgentData:st,ps=Br?Gs(Lr,Br):Lr,zr=kr&&kr.userAgent==Wr;return this.getBrowser=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.browser),$r[ht]=er($r[Et]),zr&&kr&&kr.brave&&typeof kr.brave.isBrave==lt&&($r[xt]="Brave"),$r},this.getCPU=function(){var $r={};return $r[wt]=st,br.call($r,Wr,ps.cpu),$r},this.getDevice=function(){var $r={};return $r[vt]=st,$r[ft]=st,$r[yt]=st,br.call($r,Wr,ps.device),zr&&!$r[yt]&&bs&&bs.mobile&&($r[yt]=St),zr&&$r[ft]=="Macintosh"&&kr&&typeof kr.standalone!==ut&&kr.maxTouchPoints&&kr.maxTouchPoints>2&&($r[ft]="iPad",$r[yt]=Rt),$r},this.getEngine=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.engine),$r},this.getOS=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.os),zr&&!$r[xt]&&bs&&bs.platform&&bs.platform!="Unknown"&&($r[xt]=bs.platform.replace(/chrome os/i,Hr).replace(/macos/i,Ur)),$r},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 Wr},this.setUA=function($r){return Wr=typeof $r===dt&&$r.length>Pt?sr($r,Pt):$r,this},this.setUA(Wr),this};Dr.VERSION=nt,Dr.BROWSER=Es([xt,Et,ht]),Dr.CPU=Es([wt]),Dr.DEVICE=Es([ft,vt,yt,bt,St,Ct,Rt,It,jt]),Dr.ENGINE=Dr.OS=Es([xt,Et]),tt.exports&&(et=tt.exports=Dr),et.UAParser=Dr;var Zr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(Zr&&!Zr.ua){var ks=new Dr;Zr.ua=ks.getResult(),Zr.ua.get=function(){return ks.getUA()},Zr.ua.set=function(Ir){ks.setUA(Ir);var Br=ks.getResult();for(var kr in Br)Zr.ua[kr]=Br[kr]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,st;const nt=new UAParser(tt),ot=nt.getOS(),at=nt.getDevice(),lt=nt.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((st=at.model)==null?void 0:st.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}function useHasWorkflow(tt){const[et,rt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt),rt(st)})()},[tt]),et}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$1(){}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:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){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||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,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!(st&&et.state.status!==st||nt&&!nt(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((st,nt)=>(st[nt]=rt[nt],st),{}):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 st=rt?tt:Object.keys(tt),nt=st.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&&st.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 nt===at&&ut===nt?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 st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}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 wl,Ho,Zl,qp,FocusManager=(qp=class extends Subscribable{constructor(){super();Or(this,wl);Or(this,Ho);Or(this,Zl);Sr(this,Zl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Ho)||this.setEventListener(Kt(this,Zl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Ho))==null||et.call(this),Sr(this,Ho,void 0))}setEventListener(et){var rt;Sr(this,Zl,et),(rt=Kt(this,Ho))==null||rt.call(this),Sr(this,Ho,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,wl)!==et&&(Sr(this,wl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,wl)=="boolean"?Kt(this,wl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},wl=new WeakMap,Ho=new WeakMap,Zl=new WeakMap,qp),focusManager=new FocusManager,Jl,Vo,eu,Xp,OnlineManager=(Xp=class extends Subscribable{constructor(){super();Or(this,Jl,!0);Or(this,Vo);Or(this,eu);Sr(this,eu,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,Vo)||this.setEventListener(Kt(this,eu))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Vo))==null||et.call(this),Sr(this,Vo,void 0))}setEventListener(et){var rt;Sr(this,eu,et),(rt=Kt(this,Vo))==null||rt.call(this),Sr(this,Vo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Jl)!==et&&(Sr(this,Jl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Jl)}},Jl=new WeakMap,Vo=new WeakMap,eu=new WeakMap,Xp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},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,st=!1,nt;const ot=pendingThenable(),at=vt=>{var Et;st||(ft(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;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),nt==null||nt(),ot.resolve(vt))},ft=vt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,vt),nt==null||nt(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;nt=wt=>{(st||ct())&&vt(wt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;nt=void 0,st||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(st)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(wt){vt=Promise.reject(wt)}Promise.resolve(vt).then(ht).catch(wt=>{var It;if(st)return;const bt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,wt):St,Ct=bt===!0||typeof bt=="number"&&rt<bt||typeof bt=="function"&&bt(rt,wt);if(et||!Ct){ft(wt);return}rt++,(It=tt.onFail)==null||It.call(tt,rt,wt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(wt):yt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{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=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),Sl,Yp,Removable=(Yp=class{constructor(){Or(this,Sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Sr(this,Sl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Sr(this,Sl,void 0))}},Sl=new WeakMap,Yp),tu,ru,qn,js,Nu,_l,eo,Co,Kp,Query=(Kp=class extends Removable{constructor(et){super();Or(this,eo);Or(this,tu);Or(this,ru);Or(this,qn);Or(this,js);Or(this,Nu);Or(this,_l);Sr(this,_l,!1),Sr(this,Nu,et.defaultOptions),this.setOptions(et.options),this.observers=[],Sr(this,qn,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Sr(this,tu,getDefaultState$1(this.options)),this.state=et.state??Kt(this,tu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,js))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Nu),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,qn).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Fr(this,eo,Co).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Fr(this,eo,Co).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,js))==null?void 0:st.promise;return(nt=Kt(this,js))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,tu))}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(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,qn).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,js)&&(Kt(this,_l)?Kt(this,js).cancel({revert:!0}):Kt(this,js).cancelRetry()),this.scheduleGc()),Kt(this,qn).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fr(this,eo,Co).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,js))return Kt(this,js).continueRetry(),Kt(this,js).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Sr(this,_l,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Sr(this,_l,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Sr(this,ru,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Fr(this,eo,Co).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,yt,vt;isCancelledError(ht)&&ht.silent||Fr(this,eo,Co).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,qn).config).onError)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,qn).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Sr(this,js,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,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=(ft=Kt(this,qn).config).onSuccess)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,qn).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Fr(this,eo,Co).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Fr(this,eo,Co).call(this,{type:"pause"})},onContinue:()=>{Fr(this,eo,Co).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,js).start()}},tu=new WeakMap,ru=new WeakMap,qn=new WeakMap,js=new WeakMap,Nu=new WeakMap,_l=new WeakMap,eo=new WeakSet,Co=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,ru)?{...Kt(this,ru),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,qn).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,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var xo,Qp,QueryCache=(Qp=class extends Subscribable{constructor(et={}){super();Or(this,xo);this.config=et,Sr(this,xo,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,xo).has(et.queryHash)||(Kt(this,xo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,xo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,xo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,xo).get(et)}getAll(){return[...Kt(this,xo).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):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()})})}},xo=new WeakMap,Qp),vo,Os,Rl,yo,Uo,Zp,Mutation=(Zp=class extends Removable{constructor(et){super();Or(this,yo);Or(this,vo);Or(this,Os);Or(this,Rl);this.mutationId=et.mutationId,Sr(this,Os,et.mutationCache),Sr(this,vo,[]),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,vo).includes(et)||(Kt(this,vo).push(et),this.clearGcTimeout(),Kt(this,Os).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Sr(this,vo,Kt(this,vo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,Os).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,vo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,Os).remove(this))}continue(){var et;return((et=Kt(this,Rl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,yt,vt,Et,wt,bt,St,Rt,Ct,It,jt;Sr(this,Rl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,Ot)=>{Fr(this,yo,Uo).call(this,{type:"failed",failureCount:Pt,error:Ot})},onPause:()=>{Fr(this,yo,Uo).call(this,{type:"pause"})},onContinue:()=>{Fr(this,yo,Uo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,Os).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,Rl).canStart();try{if(!rt){Fr(this,yo,Uo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,Os).config).onMutate)==null?void 0:ot.call(nt,et,this));const Ot=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Ot!==this.state.context&&Fr(this,yo,Uo).call(this,{type:"pending",context:Ot,variables:et,isPaused:st})}const Pt=await Kt(this,Rl).start();return await((ct=(ut=Kt(this,Os).config).onSuccess)==null?void 0:ct.call(ut,Pt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,Pt,et,this.state.context)),await((xt=(ft=Kt(this,Os).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,Pt,null,et,this.state.context)),Fr(this,yo,Uo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((wt=(Et=Kt(this,Os).config).onError)==null?void 0:wt.call(Et,Pt,et,this.state.context,this)),await((St=(bt=this.options).onError)==null?void 0:St.call(bt,Pt,et,this.state.context)),await((Ct=(Rt=Kt(this,Os).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((jt=(It=this.options).onSettled)==null?void 0:jt.call(It,void 0,Pt,et,this.state.context)),Pt}finally{Fr(this,yo,Uo).call(this,{type:"error",error:Pt})}}finally{Kt(this,Os).runNext(this)}}},vo=new WeakMap,Os=new WeakMap,Rl=new WeakMap,yo=new WeakSet,Uo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,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{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,vo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,Os).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,Fu,Jp,MutationCache=(Jp=class extends Subscribable{constructor(et={}){super();Or(this,Js);Or(this,Fu);this.config=et,Sr(this,Js,new Map),Sr(this,Fu,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++P1(this,Fu)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Js).get(rt)??[];st.push(et),Kt(this,Js).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Js).has(rt)){const nt=(st=Kt(this,Js).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Js).delete(rt):Kt(this,Js).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.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(st=>matchMutation(rt,st))}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$1))))}},Js=new WeakMap,Fu=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,ft,xt,yt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.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=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},wt=ensureQueryFn(et.options,et.fetchOptions),bt=async(St,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const It={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(It);const jt=await wt(It),{maxPages:Pt}=et.options,Ot=Ct?addToStart:addToEnd;return{pages:Ot(St.pages,jt,Pt),pageParams:Ot(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},It=Rt(st,Ct);lt=await bt(Ct,It,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await bt(lt,Rt),ut++}while(ut<St)}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 st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.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 us,Go,Wo,su,nu,qo,iu,ou,em,QueryClient=(em=class{constructor(tt={}){Or(this,us);Or(this,Go);Or(this,Wo);Or(this,su);Or(this,nu);Or(this,qo);Or(this,iu);Or(this,ou);Sr(this,us,tt.queryCache||new QueryCache),Sr(this,Go,tt.mutationCache||new MutationCache),Sr(this,Wo,tt.defaultOptions||{}),Sr(this,su,new Map),Sr(this,nu,new Map),Sr(this,qo,0)}mount(){P1(this,qo)._++,Kt(this,qo)===1&&(Sr(this,iu,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onFocus())})),Sr(this,ou,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onOnline())})))}unmount(){var tt,et;P1(this,qo)._--,Kt(this,qo)===0&&((tt=Kt(this,iu))==null||tt.call(this),Sr(this,iu,void 0),(et=Kt(this,ou))==null||et.call(this),Sr(this,ou,void 0))}isFetching(tt){return Kt(this,us).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Go).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,us).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,us).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,us).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,us).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,us).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,us);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,us),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,us).findAll(tt).forEach(st=>{st.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},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,us).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$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Go).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,us)}getMutationCache(){return Kt(this,Go)}getDefaultOptions(){return Kt(this,Wo)}setDefaultOptions(tt){Sr(this,Wo,tt)}setQueryDefaults(tt,et){Kt(this,su).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,su).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,nu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,nu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Wo).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,Wo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,us).clear(),Kt(this,Go).clear()}},us=new WeakMap,Go=new WeakMap,Wo=new WeakMap,su=new WeakMap,nu=new WeakMap,qo=new WeakMap,iu=new WeakMap,ou=new WeakMap,em),Hs,Gr,Bu,Ds,Tl,au,Xo,Eo,zu,lu,uu,Cl,Al,Yo,cu,Qr,Mu,K0,Q0,Z0,J0,_d,_h,e2,im,tm,QueryObserver=(tm=class extends Subscribable{constructor(et,rt){super();Or(this,Qr);Or(this,Hs);Or(this,Gr);Or(this,Bu);Or(this,Ds);Or(this,Tl);Or(this,au);Or(this,Xo);Or(this,Eo);Or(this,zu);Or(this,lu);Or(this,uu);Or(this,Cl);Or(this,Al);Or(this,Yo);Or(this,cu,new Set);this.options=rt,Sr(this,Hs,et),Sr(this,Eo,null),Sr(this,Xo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Xo).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,Gr).addObserver(this),shouldFetchOnMount(Kt(this,Gr),this.options)?Fr(this,Qr,Mu).call(this):this.updateResult(),Fr(this,Qr,J0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fr(this,Qr,_d).call(this),Fr(this,Qr,_h).call(this),Kt(this,Gr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Gr);if(this.options=Kt(this,Hs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Gr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fr(this,Qr,e2).call(this),Kt(this,Gr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Hs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Gr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Gr),nt,this.options,st)&&Fr(this,Qr,Mu).call(this),this.updateResult(rt),ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||resolveStaleTime(this.options.staleTime,Kt(this,Gr))!==resolveStaleTime(st.staleTime,Kt(this,Gr)))&&Fr(this,Qr,K0).call(this);const at=Fr(this,Qr,Q0).call(this);ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||at!==Kt(this,Yo))&&Fr(this,Qr,Z0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Sr(this,Ds,st),Sr(this,au,this.options),Sr(this,Tl,Kt(this,Gr).state)),st}getCurrentResult(){return Kt(this,Ds)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,cu).add(et)}getCurrentQuery(){return Kt(this,Gr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Hs).defaultQueryOptions(et),st=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Fr(this,Qr,Mu).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Ds)))}createResult(et,rt){var Pt;const st=Kt(this,Gr),nt=this.options,ot=Kt(this,Ds),at=Kt(this,Tl),lt=Kt(this,au),ct=et!==st?et.state:Kt(this,Bu),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Ot=this.hasListeners(),Ut=!Ot&&shouldFetchOnMount(et,rt),Nt=Ot&&shouldFetchOptionally(et,st,rt,nt);(Ut||Nt)&&(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,zu))xt=Kt(this,lu);else try{Sr(this,zu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Sr(this,lu,xt),Sr(this,Eo,null)}catch(Ot){Sr(this,Eo,Ot)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Ot;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Ot=ot.data;else if(Ot=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,uu))==null?void 0:Pt.state.data,Kt(this,uu)):rt.placeholderData,rt.select&&Ot!==void 0)try{Ot=rt.select(Ot),Sr(this,Eo,null)}catch(Ut){Sr(this,Eo,Ut)}Ot!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Ot,rt),ft=!0)}Kt(this,Eo)&&(yt=Kt(this,Eo),xt=Kt(this,lu),vt=Date.now(),Et="error");const wt=ht.fetchStatus==="fetching",bt=Et==="pending",St=Et==="error",Rt=bt&&wt,Ct=xt!==void 0,jt={status:Et,fetchStatus:ht.fetchStatus,isPending:bt,isSuccess:Et==="success",isError:St,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:wt,isRefetching:wt&&!bt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Xo)};if(this.options.experimental_prefetchInRender){const Ot=Ht=>{jt.status==="error"?Ht.reject(jt.error):jt.data!==void 0&&Ht.resolve(jt.data)},Ut=()=>{const Ht=Sr(this,Xo,jt.promise=pendingThenable());Ot(Ht)},Nt=Kt(this,Xo);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Ot(Nt);break;case"fulfilled":(jt.status==="error"||jt.data!==Nt.value)&&Ut();break;case"rejected":(jt.status!=="error"||jt.error!==Nt.reason)&&Ut();break}}return jt}updateResult(et){const rt=Kt(this,Ds),st=this.createResult(Kt(this,Gr),this.options);if(Sr(this,Tl,Kt(this,Gr).state),Sr(this,au,this.options),Kt(this,Tl).data!==void 0&&Sr(this,uu,Kt(this,Gr)),shallowEqualObjects(st,rt))return;Sr(this,Ds,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,cu).size)return!0;const ut=new Set(lt??Kt(this,cu));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Ds)).some(ct=>{const dt=ct;return Kt(this,Ds)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Fr(this,Qr,im).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fr(this,Qr,J0).call(this)}},Hs=new WeakMap,Gr=new WeakMap,Bu=new WeakMap,Ds=new WeakMap,Tl=new WeakMap,au=new WeakMap,Xo=new WeakMap,Eo=new WeakMap,zu=new WeakMap,lu=new WeakMap,uu=new WeakMap,Cl=new WeakMap,Al=new WeakMap,Yo=new WeakMap,cu=new WeakMap,Qr=new WeakSet,Mu=function(et){Fr(this,Qr,e2).call(this);let rt=Kt(this,Gr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},K0=function(){Fr(this,Qr,_d).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Gr));if(isServer||Kt(this,Ds).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Ds).dataUpdatedAt,et)+1;Sr(this,Cl,setTimeout(()=>{Kt(this,Ds).isStale||this.updateResult()},st))},Q0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Gr)):this.options.refetchInterval)??!1},Z0=function(et){Fr(this,Qr,_h).call(this),Sr(this,Yo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Gr))===!1||!isValidTimeout(Kt(this,Yo))||Kt(this,Yo)===0)&&Sr(this,Al,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Fr(this,Qr,Mu).call(this)},Kt(this,Yo)))},J0=function(){Fr(this,Qr,K0).call(this),Fr(this,Qr,Z0).call(this,Fr(this,Qr,Q0).call(this))},_d=function(){Kt(this,Cl)&&(clearTimeout(Kt(this,Cl)),Sr(this,Cl,void 0))},_h=function(){Kt(this,Al)&&(clearInterval(Kt(this,Al)),Sr(this,Al,void 0))},e2=function(){const et=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),this.options);if(et===Kt(this,Gr))return;const rt=Kt(this,Gr);Sr(this,Gr,et),Sr(this,Bu,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},im=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Ds))}),Kt(this,Hs).getQueryCache().notify({query:Kt(this,Gr),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 st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.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,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},Ko,Qo,Vs,Po,jo,j1,t2,rm,MutationObserver$1=(rm=class extends Subscribable{constructor(rt,st){super();Or(this,jo);Or(this,Ko);Or(this,Qo);Or(this,Vs);Or(this,Po);Sr(this,Ko,rt),this.setOptions(st),this.bindMethods(),Fr(this,jo,j1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,Ko).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,Ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,Vs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,Vs))==null?void 0:nt.state.status)==="pending"&&Kt(this,Vs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,Vs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Fr(this,jo,j1).call(this),Fr(this,jo,t2).call(this,rt)}getCurrentResult(){return Kt(this,Qo)}reset(){var rt;(rt=Kt(this,Vs))==null||rt.removeObserver(this),Sr(this,Vs,void 0),Fr(this,jo,j1).call(this),Fr(this,jo,t2).call(this)}mutate(rt,st){var nt;return Sr(this,Po,st),(nt=Kt(this,Vs))==null||nt.removeObserver(this),Sr(this,Vs,Kt(this,Ko).getMutationCache().build(Kt(this,Ko),this.options)),Kt(this,Vs).addObserver(this),Kt(this,Vs).execute(rt)}},Ko=new WeakMap,Qo=new WeakMap,Vs=new WeakMap,Po=new WeakMap,jo=new WeakSet,j1=function(){var st;const rt=((st=Kt(this,Vs))==null?void 0:st.state)??getDefaultState();Sr(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})},t2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,Po)&&this.hasListeners()){const ht=Kt(this,Qo).variables,ft=Kt(this,Qo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,Po)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,Po)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Po)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,Po)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}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(){}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:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),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,ft,xt,yt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,nt]),()=>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:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=st.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop).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(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,st]=reactExports.useState(""),nt={unread:!0,_:new Date().getTime()},{data:ot}=useQuery({queryKey:["folder","count","inbox"],queryFn:async()=>await odeServices.http().get(tt?"/zimbra/count/INBOX":"/conversation/count/inbox",{queryParams:nt}),staleTime:5*60*1e3}),at=async()=>{const lt="/zimbra/zimbra";try{const{preference:ut}=await odeServices.http().get("/userbook/preference/zimbra"),ct=ut?JSON.parse(ut).modeExpert:!1;st(ct&&et?"/zimbra/preauth":window.location.origin+lt)}catch(ut){console.error(ut),st(window.location.origin+lt)}};return reactExports.useEffect(()=>{at()},[]),{messages:ot?ot.count:0,msgLink:rt,zimbraWorkflow:tt}};var dayjs_min={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt=1e3,st=6e4,nt=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",ft="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+)?$/,wt=/\[([^\]]+)]|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,bt={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(kt){var $t=["th","st","nd","rd"],Ft=kt%100;return"["+kt+($t[(Ft-20)%10]||$t[Ft]||$t[0])+"]"}},St=function(kt,$t,Ft){var Gt=String(kt);return!Gt||Gt.length>=$t?kt:""+Array($t+1-Gt.length).join(Ft)+kt},Rt={s:St,z:function(kt){var $t=-kt.utcOffset(),Ft=Math.abs($t),Gt=Math.floor(Ft/60),Mt=Ft%60;return($t<=0?"+":"-")+St(Gt,2,"0")+":"+St(Mt,2,"0")},m:function kt($t,Ft){if($t.date()<Ft.date())return-kt(Ft,$t);var Gt=12*(Ft.year()-$t.year())+(Ft.month()-$t.month()),Mt=$t.clone().add(Gt,ht),Vt=Ft-Mt<0,Bt=$t.clone().add(Gt+(Vt?-1:1),ht);return+(-(Gt+(Ft-Mt)/(Vt?Mt-Bt:Bt-Mt))||0)},a:function(kt){return kt<0?Math.ceil(kt)||0:Math.floor(kt)},p:function(kt){return{M:ht,y:xt,w:dt,d:ct,D:yt,h:ut,m:lt,s:at,ms:ot,Q:ft}[kt]||String(kt||"").toLowerCase().replace(/s$/,"")},u:function(kt){return kt===void 0}},Ct="en",It={};It[Ct]=bt;var jt="$isDayjsObject",Pt=function(kt){return kt instanceof Ht||!(!kt||!kt[jt])},Ot=function kt($t,Ft,Gt){var Mt;if(!$t)return Ct;if(typeof $t=="string"){var Vt=$t.toLowerCase();It[Vt]&&(Mt=Vt),Ft&&(It[Vt]=Ft,Mt=Vt);var Bt=$t.split("-");if(!Mt&&Bt.length>1)return kt(Bt[0])}else{var qt=$t.name;It[qt]=$t,Mt=qt}return!Gt&&Mt&&(Ct=Mt),Mt||!Gt&&Ct},Ut=function(kt,$t){if(Pt(kt))return kt.clone();var Ft=typeof $t=="object"?$t:{};return Ft.date=kt,Ft.args=arguments,new Ht(Ft)},Nt=Rt;Nt.l=Ot,Nt.i=Pt,Nt.w=function(kt,$t){return Ut(kt,{locale:$t.$L,utc:$t.$u,x:$t.$x,$offset:$t.$offset})};var Ht=function(){function kt(Ft){this.$L=Ot(Ft.locale,null,!0),this.parse(Ft),this.$x=this.$x||Ft.x||{},this[jt]=!0}var $t=kt.prototype;return $t.parse=function(Ft){this.$d=function(Gt){var Mt=Gt.date,Vt=Gt.utc;if(Mt===null)return new Date(NaN);if(Nt.u(Mt))return new Date;if(Mt instanceof Date)return new Date(Mt);if(typeof Mt=="string"&&!/Z$/i.test(Mt)){var Bt=Mt.match(Et);if(Bt){var qt=Bt[2]-1||0,Qt=(Bt[7]||"0").substring(0,3);return Vt?new Date(Date.UTC(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)):new Date(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)}}return new Date(Mt)}(Ft),this.init()},$t.init=function(){var Ft=this.$d;this.$y=Ft.getFullYear(),this.$M=Ft.getMonth(),this.$D=Ft.getDate(),this.$W=Ft.getDay(),this.$H=Ft.getHours(),this.$m=Ft.getMinutes(),this.$s=Ft.getSeconds(),this.$ms=Ft.getMilliseconds()},$t.$utils=function(){return Nt},$t.isValid=function(){return this.$d.toString()!==vt},$t.isSame=function(Ft,Gt){var Mt=Ut(Ft);return this.startOf(Gt)<=Mt&&Mt<=this.endOf(Gt)},$t.isAfter=function(Ft,Gt){return Ut(Ft)<this.startOf(Gt)},$t.isBefore=function(Ft,Gt){return this.endOf(Gt)<Ut(Ft)},$t.$g=function(Ft,Gt,Mt){return Nt.u(Ft)?this[Gt]:this.set(Mt,Ft)},$t.unix=function(){return Math.floor(this.valueOf()/1e3)},$t.valueOf=function(){return this.$d.getTime()},$t.startOf=function(Ft,Gt){var Mt=this,Vt=!!Nt.u(Gt)||Gt,Bt=Nt.p(Ft),qt=function(or,hr){var pr=Nt.w(Mt.$u?Date.UTC(Mt.$y,hr,or):new Date(Mt.$y,hr,or),Mt);return Vt?pr:pr.endOf(ct)},Qt=function(or,hr){return Nt.w(Mt.toDate()[or].apply(Mt.toDate("s"),(Vt?[0,0,0,0]:[23,59,59,999]).slice(hr)),Mt)},Yt=this.$W,tr=this.$M,lr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Vt?qt(1,0):qt(31,11);case ht:return Vt?qt(1,tr):qt(0,tr+1);case dt:var mr=this.$locale().weekStart||0,yr=(Yt<mr?Yt+7:Yt)-mr;return qt(Vt?lr-yr:lr+(6-yr),tr);case ct:case yt:return Qt(ur+"Hours",0);case ut:return Qt(ur+"Minutes",1);case lt:return Qt(ur+"Seconds",2);case at:return Qt(ur+"Milliseconds",3);default:return this.clone()}},$t.endOf=function(Ft){return this.startOf(Ft,!1)},$t.$set=function(Ft,Gt){var Mt,Vt=Nt.p(Ft),Bt="set"+(this.$u?"UTC":""),qt=(Mt={},Mt[ct]=Bt+"Date",Mt[yt]=Bt+"Date",Mt[ht]=Bt+"Month",Mt[xt]=Bt+"FullYear",Mt[ut]=Bt+"Hours",Mt[lt]=Bt+"Minutes",Mt[at]=Bt+"Seconds",Mt[ot]=Bt+"Milliseconds",Mt)[Vt],Qt=Vt===ct?this.$D+(Gt-this.$W):Gt;if(Vt===ht||Vt===xt){var Yt=this.clone().set(yt,1);Yt.$d[qt](Qt),Yt.init(),this.$d=Yt.set(yt,Math.min(this.$D,Yt.daysInMonth())).$d}else qt&&this.$d[qt](Qt);return this.init(),this},$t.set=function(Ft,Gt){return this.clone().$set(Ft,Gt)},$t.get=function(Ft){return this[Nt.p(Ft)]()},$t.add=function(Ft,Gt){var Mt,Vt=this;Ft=Number(Ft);var Bt=Nt.p(Gt),qt=function(tr){var lr=Ut(Vt);return Nt.w(lr.date(lr.date()+Math.round(tr*Ft)),Vt)};if(Bt===ht)return this.set(ht,this.$M+Ft);if(Bt===xt)return this.set(xt,this.$y+Ft);if(Bt===ct)return qt(1);if(Bt===dt)return qt(7);var Qt=(Mt={},Mt[lt]=st,Mt[ut]=nt,Mt[at]=rt,Mt)[Bt]||1,Yt=this.$d.getTime()+Ft*Qt;return Nt.w(Yt,this)},$t.subtract=function(Ft,Gt){return this.add(-1*Ft,Gt)},$t.format=function(Ft){var Gt=this,Mt=this.$locale();if(!this.isValid())return Mt.invalidDate||vt;var Vt=Ft||"YYYY-MM-DDTHH:mm:ssZ",Bt=Nt.z(this),qt=this.$H,Qt=this.$m,Yt=this.$M,tr=Mt.weekdays,lr=Mt.months,ur=Mt.meridiem,mr=function(hr,pr,_r,Ar){return hr&&(hr[pr]||hr(Gt,Vt))||_r[pr].slice(0,Ar)},yr=function(hr){return Nt.s(qt%12||12,hr,"0")},or=ur||function(hr,pr,_r){var Ar=hr<12?"AM":"PM";return _r?Ar.toLowerCase():Ar};return Vt.replace(wt,function(hr,pr){return pr||function(_r){switch(_r){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Yt+1;case"MM":return Nt.s(Yt+1,2,"0");case"MMM":return mr(Mt.monthsShort,Yt,lr,3);case"MMMM":return mr(lr,Yt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr(Mt.weekdaysMin,Gt.$W,tr,2);case"ddd":return mr(Mt.weekdaysShort,Gt.$W,tr,3);case"dddd":return tr[Gt.$W];case"H":return String(qt);case"HH":return Nt.s(qt,2,"0");case"h":return yr(1);case"hh":return yr(2);case"a":return or(qt,Qt,!0);case"A":return or(qt,Qt,!1);case"m":return String(Qt);case"mm":return Nt.s(Qt,2,"0");case"s":return String(Gt.$s);case"ss":return Nt.s(Gt.$s,2,"0");case"SSS":return Nt.s(Gt.$ms,3,"0");case"Z":return Bt}return null}(hr)||Bt.replace(":","")})},$t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$t.diff=function(Ft,Gt,Mt){var Vt,Bt=this,qt=Nt.p(Gt),Qt=Ut(Ft),Yt=(Qt.utcOffset()-this.utcOffset())*st,tr=this-Qt,lr=function(){return Nt.m(Bt,Qt)};switch(qt){case xt:Vt=lr()/12;break;case ht:Vt=lr();break;case ft:Vt=lr()/3;break;case dt:Vt=(tr-Yt)/6048e5;break;case ct:Vt=(tr-Yt)/864e5;break;case ut:Vt=tr/nt;break;case lt:Vt=tr/st;break;case at:Vt=tr/rt;break;default:Vt=tr}return Mt?Vt:Nt.a(Vt)},$t.daysInMonth=function(){return this.endOf(ht).$D},$t.$locale=function(){return It[this.$L]},$t.locale=function(Ft,Gt){if(!Ft)return this.$L;var Mt=this.clone(),Vt=Ot(Ft,Gt,!0);return Vt&&(Mt.$L=Vt),Mt},$t.clone=function(){return Nt.w(this.$d,this)},$t.toDate=function(){return new Date(this.valueOf())},$t.toJSON=function(){return this.isValid()?this.toISOString():null},$t.toISOString=function(){return this.$d.toISOString()},$t.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ht.prototype;return Ut.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",yt]].forEach(function(kt){Lt[kt[1]]=function($t){return this.$g($t,kt[0],kt[1])}}),Ut.extend=function(kt,$t){return kt.$i||(kt($t,Ht,Ut),kt.$i=!0),Ut},Ut.locale=Ot,Ut.isDayjs=Pt,Ut.unix=function(kt){return Ut(1e3*kt)},Ut.en=It[Ct],Ut.Ls=It,Ut.p={},Ut})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(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"},st=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,nt=/\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 wt=Et.match(/([+-]|\d\d)/g),bt=60*wt[1]+(+wt[2]||0);return bt===0?0:wt[0]==="+"?-bt:bt}(vt)}],ht=function(vt){var Et=lt[vt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(vt,Et){var wt,bt=lt.meridiem;if(bt){for(var St=1;St<=24;St+=1)if(vt.indexOf(bt(St,0,Et))>-1){wt=St>12;break}}else wt=vt===(Et?"pm":"PM");return wt},xt={A:[at,function(vt){this.afternoon=ft(vt,!1)}],a:[at,function(vt){this.afternoon=ft(vt,!0)}],S:[/\d/,function(vt){this.milliseconds=100*+vt}],SS:[nt,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:[nt,ct("day")],Do:[at,function(vt){var Et=lt.ordinal,wt=vt.match(/\d+/);if(this.day=wt[0],Et)for(var bt=1;bt<=31;bt+=1)Et(bt).replace(/\[|\]/g,"")===vt&&(this.day=bt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(vt){var Et=ht("months"),wt=(ht("monthsShort")||Et.map(function(bt){return bt.slice(0,3)})).indexOf(vt)+1;if(wt<1)throw new Error;this.month=wt%12||wt}],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:[nt,function(vt){this.year=ut(vt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function yt(vt){var Et,wt;Et=vt,wt=lt&&lt.formats;for(var bt=(vt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Ot,Ut,Nt){var Ht=Nt&&Nt.toUpperCase();return Ut||wt[Nt]||rt[Nt]||wt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,$t){return kt||$t.slice(1)})})).match(st),St=bt.length,Rt=0;Rt<St;Rt+=1){var Ct=bt[Rt],It=xt[Ct],jt=It&&It[0],Pt=It&&It[1];bt[Rt]=Pt?{regex:jt,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function(Ot){for(var Ut={},Nt=0,Ht=0;Nt<St;Nt+=1){var Lt=bt[Nt];if(typeof Lt=="string")Ht+=Lt.length;else{var kt=Lt.regex,$t=Lt.parser,Ft=Ot.slice(Ht),Gt=kt.exec(Ft)[0];$t.call(Ut,Gt),Ot=Ot.replace(Gt,"")}}return function(Mt){var Vt=Mt.afternoon;if(Vt!==void 0){var Bt=Mt.hours;Vt?Bt<12&&(Mt.hours+=12):Bt===12&&(Mt.hours=0),delete Mt.afternoon}}(Ut),Ut}}return function(vt,Et,wt){wt.p.customParseFormat=!0,vt&&vt.parseTwoDigitYear&&(ut=vt.parseTwoDigitYear);var bt=Et.prototype,St=bt.parse;bt.parse=function(Rt){var Ct=Rt.date,It=Rt.utc,jt=Rt.args;this.$u=It;var Pt=jt[1];if(typeof Pt=="string"){var Ot=jt[2]===!0,Ut=jt[3]===!0,Nt=Ot||Ut,Ht=jt[2];Ut&&(Ht=jt[2]),lt=this.$locale(),!Ot&&Ht&&(lt=wt.Ls[Ht]),this.$d=function(Ft,Gt,Mt){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Ft);var Vt=yt(Gt)(Ft),Bt=Vt.year,qt=Vt.month,Qt=Vt.day,Yt=Vt.hours,tr=Vt.minutes,lr=Vt.seconds,ur=Vt.milliseconds,mr=Vt.zone,yr=new Date,or=Qt||(Bt||qt?1:yr.getDate()),hr=Bt||yr.getFullYear(),pr=0;Bt&&!qt||(pr=qt>0?qt-1:yr.getMonth());var _r=Yt||0,Ar=tr||0,Hr=lr||0,Ur=ur||0;return mr?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur+60*mr.offset*1e3)):Mt?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur)):new Date(hr,pr,or,_r,Ar,Hr,Ur)}catch{return new Date("")}}(Ct,Pt,It),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$L),Nt&&Ct!=this.format(Pt)&&(this.$d=new Date("")),lt={}}else if(Pt instanceof Array)for(var Lt=Pt.length,kt=1;kt<=Lt;kt+=1){jt[1]=Pt[kt-1];var $t=wt.apply(this,jt);if($t.isValid()){this.$d=$t.$d,this.$L=$t.$L,this.init();break}kt===Lt&&(this.$d=new Date(""))}else St.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(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(st,nt,ot){var at=nt.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,ft){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,yt,vt){var Et=vt&&vt.toUpperCase();return yt||ft[vt]||rt[vt]||ft[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(wt,bt,St){return bt||St.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,st){tt.exports=st()})(commonjsGlobal,function(){return function(rt,st,nt){rt=rt||{};var ot=st.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,ft){return ot.fromToBase(ct,dt,ht,ft)}nt.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,ft,xt){for(var yt,vt,Et,wt=ht.$locale().relativeTime||at,bt=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"}],St=bt.length,Rt=0;Rt<St;Rt+=1){var Ct=bt[Rt];Ct.d&&(yt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var It=(rt.rounding||Math.round)(Math.abs(yt));if(Et=yt>0,It<=Ct.r||!Ct.r){It<=1&&Rt>0&&(Ct=bt[Rt-1]);var jt=wt[Ct.l];xt&&(It=xt(""+It)),vt=typeof jt=="string"?jt.replace("%d",It):jt(It,dt,Ct.l,Et);break}}if(dt)return vt;var Pt=Et?wt.future:wt.past;return typeof Pt=="function"?Pt(vt):Pt.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?nt.utc():nt()};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$2={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var nt=st(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 nt.default.locale(lt,null,!0),lt})})(de$2);var es={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(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 nt.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),{t:et}=useTranslation(),rt=reactExports.useCallback((lt,ut)=>{if(lt.length<11)return dayjs(lt,["YYYY-MM-DD"],ut);if(lt.split("").findIndex(ct=>"0">ct||ct>"9")<0)return dayjs(Number.parseInt(lt)).locale(tt);{let ct=dayjs(lt).locale(tt);return ct.isValid()||(ct=dayjs(lt,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),ct}},[tt]),st=reactExports.useCallback(lt=>{let ut=dayjs();try{return typeof lt>"u"?void 0:(typeof lt=="string"?ut=rt(lt):typeof lt=="number"?ut=dayjs(lt).locale(tt):typeof lt.$date=="number"?ut=dayjs(new Date(lt.$date)).locale(tt):typeof lt.$date=="string"&&(ut=rt(lt.$date)),ut)}catch(ct){console.error(ct)}return ut},[tt,rt]),nt=reactExports.useCallback(lt=>{const ut=st(lt);if(!(ut!=null&&ut.isValid()))return"";const ct=dayjs();return ut.isSame(ct,"date")?ut.fromNow():ut.isSame(ct.subtract(1,"day"),"date")?et("date.format.yesterday"):ct.diff(ut,"days")<=7?ut.format(et("date.format.currentWeek")):ut.isSame(ct,"year")?ut.format(et("date.format.currentYear")):ut.format(et("date.format.previousYear"))},[tt,rt]),ot=reactExports.useCallback(lt=>{const ut=st(lt);return ut!=null&&ut.isValid()?ut.fromNow():""},[tt,rt]),at=reactExports.useCallback((lt,ut="short")=>{const ct=st(lt);let dt="";switch(ut){case"short":dt="L";break;case"long":dt="LL";break;case"abbr":dt="ll";break;default:dt=ut}return ct!=null&&ct.isValid()?ct.locale(tt).format(dt):""},[tt,rt]);return{fromNow:ot,formatDate:at,formatTimeAgo:nt}}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=()=>{et(!0)},nt=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",st),ot.addEventListener("mouseout",nt),()=>{ot.removeEventListener("mouseover",st),ot.removeEventListener("mouseout",nt)}},[rt]),[rt,tt]}let e$1={data:""},t$1=tt=>{if(typeof window=="object"){let et=(tt?tt.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return et.nonce=window.__nonce__,et.parentNode||(tt||document.head).appendChild(et),et.firstChild}return tt||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$2=/\n+/g,o$1=(tt,et)=>{let rt="",st="",nt="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":st+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?st+=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(),nt+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&nt?et+"{"+nt+"}":nt)+st},c$1={},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,st,nt)=>{let ot=s$1(tt),at=c$1[ot]||(c$1[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$1[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,ft=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?ft.shift():dt[3]?(ht=dt[3].replace(n$2," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(tt);c$1[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$1.g?c$1.g:null;return rt&&(c$1.g=c$1[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$1[at],et,st,lt),at},p$1=(tt,et,rt)=>tt.reduce((st,nt,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 st+nt+(at??"")},"");function u$1(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((st,nt)=>Object.assign(st,nt&&nt.call?nt(et.p):nt),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$1.bind({g:1});let h$2=u$1.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function w$2(tt,et){let rt=this||{};return function(){let st=arguments;function nt(ot,at){let lt=Object.assign({},ot),ut=lt.className||nt.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$1.apply(rt,st)+(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 et?et(nt):nt}}var Z$1=tt=>typeof tt=="function",h$1=(tt,et)=>Z$1(tt)?tt(et):tt,W$2=(()=>{let tt=0;return()=>(++tt).toString()})(),E$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),re$1=20,k$2="default",H$3=(tt,et)=>{let{toastLimit:rt}=tt.settings;switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,rt)};case 1:return{...tt,toasts:tt.toasts.map(at=>at.id===et.toast.id?{...at,...et.toast}:at)};case 2:let{toast:st}=et;return H$3(tt,{type:tt.toasts.find(at=>at.id===st.id)?1:0,toast:st});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(at=>at.id===nt||nt===void 0?{...at,dismissed:!0,visible:!1}:at)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(at=>at.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let ot=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(at=>({...at,pauseDuration:at.pauseDuration+ot}))}}},v$1=[],j$2={toasts:[],pausedAt:void 0,settings:{toastLimit:re$1}},f$1={},Y$1=(tt,et=k$2)=>{f$1[et]=H$3(f$1[et]||j$2,tt),v$1.forEach(([rt,st])=>{rt===et&&st(f$1[et])})},_$1=tt=>Object.keys(f$1).forEach(et=>Y$1(tt,et)),Q$1=tt=>Object.keys(f$1).find(et=>f$1[et].toasts.some(rt=>rt.id===tt)),S$1=(tt=k$2)=>et=>{Y$1(et,tt)},se$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V$1=(tt={},et=k$2)=>{let[rt,st]=reactExports.useState(f$1[et]||j$2),nt=reactExports.useRef(f$1[et]);reactExports.useEffect(()=>(nt.current!==f$1[et]&&st(f$1[et]),v$1.push([et,st]),()=>{let at=v$1.findIndex(([lt])=>lt===et);at>-1&&v$1.splice(at,1)}),[et]);let ot=rt.toasts.map(at=>{var lt,ut,ct;return{...tt,...tt[at.type],...at,removeDelay:at.removeDelay||((lt=tt[at.type])==null?void 0:lt.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:at.duration||((ut=tt[at.type])==null?void 0:ut.duration)||(tt==null?void 0:tt.duration)||se$1[at.type],style:{...tt.style,...(ct=tt[at.type])==null?void 0:ct.style,...at.style}}});return{...rt,toasts:ot}},ie$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)||W$2()}),P$1=tt=>(et,rt)=>{let st=ie$1(et,tt,rt);return S$1(st.toasterId||Q$1(st.id))({type:2,toast:st}),st.id},n$1=(tt,et)=>P$1("blank")(tt,et);n$1.error=P$1("error");n$1.success=P$1("success");n$1.loading=P$1("loading");n$1.custom=P$1("custom");n$1.dismiss=(tt,et)=>{let rt={type:3,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.dismissAll=tt=>n$1.dismiss(void 0,tt);n$1.remove=(tt,et)=>{let rt={type:4,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.removeAll=tt=>n$1.remove(void 0,tt);n$1.promise=(tt,et,rt)=>{let st=n$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?h$1(et.success,nt):void 0;return ot?n$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):n$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?h$1(et.error,nt):void 0;ot?n$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):n$1.dismiss(st)}),tt};var ce$1=1e3,w$1=(tt,et="default")=>{let{toasts:rt,pausedAt:st}=V$1(tt,et),nt=reactExports.useRef(new Map).current,ot=reactExports.useCallback((ht,ft=ce$1)=>{if(nt.has(ht))return;let xt=setTimeout(()=>{nt.delete(ht),at({type:4,toastId:ht})},ft);nt.set(ht,xt)},[]);reactExports.useEffect(()=>{if(st)return;let ht=Date.now(),ft=rt.map(xt=>{if(xt.duration===1/0)return;let yt=(xt.duration||0)+xt.pauseDuration-(ht-xt.createdAt);if(yt<0){xt.visible&&n$1.dismiss(xt.id);return}return setTimeout(()=>n$1.dismiss(xt.id,et),yt)});return()=>{ft.forEach(xt=>xt&&clearTimeout(xt))}},[rt,st,et]);let at=reactExports.useCallback(S$1(et),[et]),lt=reactExports.useCallback(()=>{at({type:5,time:Date.now()})},[at]),ut=reactExports.useCallback((ht,ft)=>{at({type:1,toast:{id:ht,height:ft}})},[at]),ct=reactExports.useCallback(()=>{st&&at({type:6,time:Date.now()})},[st,at]),dt=reactExports.useCallback((ht,ft)=>{let{reverseOrder:xt=!1,gutter:yt=8,defaultPosition:vt}=ft||{},Et=rt.filter(St=>(St.position||vt)===(ht.position||vt)&&St.height),wt=Et.findIndex(St=>St.id===ht.id),bt=Et.filter((St,Rt)=>Rt<wt&&St.visible).length;return Et.filter(St=>St.visible).slice(...xt?[bt+1]:[0,bt]).reduce((St,Rt)=>St+(Rt.height||0)+yt,0)},[rt]);return reactExports.useEffect(()=>{rt.forEach(ht=>{if(ht.dismissed)ot(ht.id,ht.removeDelay);else{let ft=nt.get(ht.id);ft&&(clearTimeout(ft),nt.delete(ht.id))}})},[rt,ot]),{toasts:rt,handlers:{updateHeight:ut,startPause:lt,endPause:ct,calculateOffset:dt}}},de$1=h$2`
51
51
  from {
52
52
  transform: scale(0) rotate(45deg);
53
53
  opacity: 0;
@@ -1408,4 +1408,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
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,st,nt){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=st(xt),nt!==void 0&&at.hasValue){var yt=at.value;if(nt(yt,xt))return ht=yt}return ht=xt}if(yt=ht,objectIs(dt,xt))return yt;var vt=st(xt);return nt!==void 0&&nt(yt,vt)?(dt=xt,yt):(dt=xt,ht=vt)}var ct=!1,dt,ht,ft=rt===void 0?null:rt;return[function(){return ut(et())},ft===null?void 0:function(){return ut(ft())}]},[et,rt,st,nt]);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 st=useSyncExternalStoreWithSelector(tt.subscribe,tt.getState,tt.getServerState||tt.getInitialState,et,rt);return useDebugValue(st),st}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 st={name:et,parentId:rt,application:tt.application,type:tt.types[0]};return await odeServices.resource(tt.application).createFolder(st)},updateFolder=async({folderId:tt,searchParams:et,parentId:rt,name:st})=>{const nt={folderId:tt,name:st,parentId:rt,application:et.application,type:et.types[0]};return await odeServices.resource(et.application).updateFolder(nt)},trashAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:st})=>{const nt={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:st};return await odeServices.resource(tt.application).trashAll(nt,rt)},deleteAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:st})=>{const nt={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:st};return await odeServices.resource(tt.application).deleteAll(nt,rt)},restoreAll=async({searchParams:tt,resourceIds:et,folderIds:rt,useAssetIds:st})=>{const nt={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:rt};return await odeServices.resource(tt.application).restoreAll(nt,st)},copyResource=async(tt,et)=>await odeServices.resource(tt.application).copy({application:tt.application,resourceId:et}),moveToFolder=async({searchParams:tt,resourceIds:et,folderId:rt,folderIds:st,useAssetIds:nt})=>{const ot={application:tt.application,folderId:rt,resourceIds:et,folderIds:st};return await odeServices.resource(tt.application).moveToFolder(ot,nt)},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(st=>({searchConfig:{...st.searchConfig,...rt}})),setTreeData:rt=>tt(()=>({treeData:rt})),setSearchParams:rt=>{tt(st=>{const{searchParams:nt}=st;return nt.search!==rt.search?rt.search?{...st,selectedFolders:[],selectedNodeId:void 0,selectedResources:[],currentFolder:void 0,searchParams:{...nt,...rt,trashed:!1,filters:{...nt.filters,folder:void 0}}}:{...st,selectedFolders:[],selectedNodeId:"default",selectedResources:[],currentFolder:{id:"default"},searchParams:{...nt,...rt,trashed:!1,filters:{...nt.filters}}}:{searchParams:{...nt,...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:st}=et();goToResource({searchParams:st,assetId:rt.assetId})}catch(st){console.error("explorer open failed: ",st)}},printSelectedResource:()=>{try{const{searchParams:rt,selectedResources:st,resourceIds:nt}=et();if(st.length!==1)throw new Error("Cannot open more than 1 resource");const ot=st.find(at=>at.id===nt[0]);printResource({searchParams:rt,assetId:ot.assetId})}catch(rt){console.error("explorer print failed: ",rt)}},openFolder:({folderId:rt,folder:st,queryClient:nt})=>{const{searchParams:ot}=et(),at=ot.filters.folder,lt=rt;at!==rt&&(et().actions.fetchTreeData(rt,nt),tt(ut=>({...ut,folderIds:[],resourceIds:[],selectedNodeId:lt,currentFolder:st||{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,st)=>{const nt=findNodeById(et().treeData,rt),ot=nt==null?void 0:nt.id;if(Array.isArray(nt==null?void 0:nt.children)&&nt.children.length)return;const at=await st.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,st)=>{const{treeData:nt}=et(),{openFolder:ot,fetchTreeData:at}=et().actions,lt=findNodeById(nt,rt);at(rt,st),tt(ut=>({...ut,searchParams:{...ut.searchParams,search:void 0},status:"select",selectedResources:[]})),ot({folder:lt,folderId:rt})},gotoPreviousFolder:()=>{const{selectedNodeId:rt,treeData:st,searchParams:nt}=et(),{openFolder:ot}=et().actions;if(nt.search&&ot({folder:defaultFolder,folderId:FOLDER.DEFAULT}),!rt)return;const at=findParentNode(st,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:st}=useStoreActions();return{isActionDisableModalOpen:tt,onActionDisableCancel:()=>{et(),st(),rt(!1)}}},useTrashModal=()=>{const tt=useResourceIsTrash(),{clearSelectedIds:et,setResourceIsTrash:rt,clearSelectedItems:st}=useStoreActions();return{isTrashedModalOpen:tt,onTrashedCancel:()=>{et(),st(),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):"",st=et.public?"/blog/pub":"/blog",nt=await this.http.post(st,{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(nt),nt}async update(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=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(st),{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(nt=>nt.workflow),st=new Set(rt);return{queryKey:[...st],queryFn:()=>sessionHasWorkflowRights([...st]),select:nt=>tt.filter(ot=>nt[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:st,search:nt}=et,ot=["context",{folderId:rt.folder,filters:rt,trashed:st,search:nt}];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(),st=useTreeData(),nt=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedItems:ct,clearSelectedIds:dt,setTreeData:ht,setSearchParams:ft}=useStoreActions(),{filters:xt,trashed:yt}=rt,vt=["context",{folderId:xt.folder,filters:xt,trashed:yt}];return useMutation({mutationFn:async()=>await trashAll({searchParams:rt,folderIds:nt,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,bt=>{var St;if(bt){const Rt={...bt,pages:bt==null?void 0:bt.pages.map(It=>{var jt;return{...It,folders:It.folders.filter(Pt=>!nt.includes(Pt.id)),pagination:{...It.pagination,maxIdx:((jt=It==null?void 0:It.pagination)==null?void 0:jt.maxIdx)-Et.resources.length},resources:It.resources.filter(Pt=>lt?!ot.includes(Pt.assetId):!ut.includes(Pt.id))}})},Ct=deleteNode(st,{folders:nt});return ht(Ct),ft({...rt,pagination:{...rt.pagination,maxIdx:((St=rt.pagination)==null?void 0:St.maxIdx)-Et.resources.length}}),Rt}})},onSettled:()=>{ct(),dt()}})},useRestore=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useFolderIds(),nt=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?nt:ot,{setFolderIds:ut,setResourceIds:ct,setSelectedResources:dt,setSelectedFolders:ht}=useStoreActions(),{filters:ft,trashed:xt}=rt,yt=["context",{folderId:ft.folder,filters:ft,trashed:xt}];return useMutation({mutationFn:async()=>await restoreAll({searchParams:rt,folderIds:st,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(wt=>({...wt,folders:wt.folders.filter(bt=>!st.includes(bt.id)),resources:wt.resources.filter(bt=>at?!nt.includes(bt.assetId):!lt.includes(bt.id))}))}})},onSettled:()=>{ct([]),dt([]),ut([]),ht([])}})},useDelete=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useFolderIds(),nt=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?nt:ot,{clearSelectedItems:ut,clearSelectedIds:ct}=useStoreActions(),{filters:dt,trashed:ht}=rt,ft=["context",{folderId:dt.folder,filters:dt,trashed:ht}];return useMutation({mutationFn:async()=>await deleteAll({searchParams:rt,folderIds:st,resourceIds:lt,useAssetIds:at}),onError(xt){typeof xt=="string"&&tt.error(t$2(xt))},onSuccess:async()=>{if(await et.cancelQueries({queryKey:ft}),et.getQueryData(ft))return tt.success(t$2("explorer.removed.from.trash")),et.setQueryData(ft,yt=>{if(yt)return{...yt,pages:yt==null?void 0:yt.pages.map(Et=>({...Et,folders:Et.folders.filter(wt=>!st.includes(wt.id)),resources:Et.resources.filter(wt=>at?!nt.includes(wt.assetId):!lt.includes(wt.id))}))}})},onSettled:()=>{ut(),ct()}})},useCopyResource=()=>{const tt=useToast(),et=useSearchParams(),rt=useQueryClient(),{user:st}=useUser(),nt=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),ft={...dt,name:`${dt.name}${t$2("duplicate.suffix")}`,assetId:ct.duplicateId,id:ct.duplicateId,creatorId:st==null?void 0:st.userId,creatorName:st==null?void 0:st.username,createdAt:Date.now(),slug:dt.slug||"",modifiedAt:Date.now(),modifierId:(st==null?void 0:st.userId)||"",modifierName:(st==null?void 0:st.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${st==null?void 0:st.userId}`]};ht&&rt.setQueryData(ut,xt=>{if(xt)return{...xt,pages:xt==null?void 0:xt.pages.map(yt=>({...yt,resources:[ft,...yt.resources]}))}}),nt.id&&nt.id!==FOLDER.DEFAULT&&moveToFolder({searchParams:et,resourceIds:[ct.duplicateId],folderId:nt.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(),st=useTreeData(),nt=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedIds:ct,clearSelectedItems:dt,setTreeData:ht,setSearchParams:ft}=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:nt,resourceIds:ut,useAssetIds:lt}),onError(Et){typeof Et=="string"&&tt.error(t$2(Et))},onSuccess:async(Et,wt)=>{if(et.getQueryData(vt))return et.setQueryData(vt,St=>{var Rt;if(St){const Ct=moveNode(st,{destinationId:wt,folders:nt}),It={...St,pages:St==null?void 0:St.pages.map(jt=>{var Pt;return{...jt,folders:jt.folders.filter(Ot=>!nt.includes(Ot.id)),pagination:{...jt.pagination,maxIdx:((Pt=jt.pagination)==null?void 0:Pt.maxIdx)-Et.resources.length},resources:jt.resources.filter(Ot=>lt?!ot.includes(Ot.assetId):!ut.includes(Ot.id))}})};return ht(Ct),ft({...rt,pagination:{...rt.pagination,maxIdx:((Rt=rt.pagination)==null?void 0:Rt.maxIdx)-Et.resources.length}}),It}});et.invalidateQueries()},onSettled:()=>{dt(),ct()}})},useCreateFolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useTreeData(),{setTreeData:nt}=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,ft=>{if(ft){const xt={...ft,pages:ft==null?void 0:ft.pages.map(vt=>({...vt,folders:[...vt.folders,ht]}))},yt=addNode(st,{parentId:ct.parentId,newFolder:ht});return nt(yt),xt}})}})},useUpdatefolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useTreeData(),{setFolderIds:nt,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:ft})=>await updateFolder({searchParams:rt,folderId:dt,parentId:ft,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(wt=>wt.id===dt.id?{...dt,parentId:ht.parentId,rights:wt.rights}:wt)}))},vt=updateNode(st,{folderId:ht.folderId,newFolder:dt});return at(vt),yt}})},onSettled:()=>{nt([]),ot([])}})},useShareResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{setResourceIds:st,setSelectedResources:nt}=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(ft=>({...ft,resources:ft.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:()=>{st([]),nt([])}}})},useUpdateResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{filters:st,trashed:nt}=rt,ot=["context",{folderId:st.folder,filters:st,trashed:nt}];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:ft,thumbnail:xt,public:yt,description:vt,slug:Et,...wt}=lt;return{...ht,...wt,name:ft,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:st}=useUser(),{appCode:nt}=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,ft;await et.cancelQueries({queryKey:ot});const ut=et.getQueryData(ot),ct={...lt,thumbnail:at.thumbnail||"",application:nt,assetId:at._id||at.entId||"",id:at._id||at.entId||"",creatorId:st==null?void 0:st.userId,creatorName:st==null?void 0:st.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:((ft=at.author)==null?void 0:ft.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${st==null?void 0:st.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 st;const rt=findNodeById(tt,et);return(st=rt==null?void 0:rt.folder)!=null&&st.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:st}=useEdificeClient(),{t:nt}=useTranslation(["common",st]),ot=nt("explorer.filters.mine",{ns:st}),{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 It;((It=Rt.data.current)==null?void 0:It.type)==="resource"?rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[nt("explorer.dragged.resource")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]})):rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[nt("explorer.dragged.folder")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]}))};return{handleDragEnd:async Rt=>{const{over:Ct,active:It}=Rt,jt=Ct==null?void 0:Ct.data.current,Pt=It.data.current,Ot=getAncestors(ht,jt==null?void 0:jt.id),Ut=getChildrenIds(ht,jt==null?void 0:jt.id);if((Pt==null?void 0:Pt.id)==(jt==null?void 0:jt.id)||Ot.includes(Pt==null?void 0:Pt.id)||Ut.includes(Pt==null?void 0:Pt.id))ut([]),ct([]);else{const Nt=(jt==null?void 0:jt.name)??ot;if(Ct)try{await et.mutate(jt==null?void 0:jt.id),Et(It,Nt)}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,It=Ct.data.current;(It==null?void 0:It.type)==="resource"?ut([It==null?void 0:It.id]):(It==null?void 0:It.type)==="folder"&&ct([It==null?void 0:It.id]),at({isDrag:!0,elementDrag:It==null?void 0:It.id})},handleDragOver:Rt=>{const{over:Ct,active:It}=Rt,jt=Ct==null?void 0:Ct.data.current,Pt=It==null?void 0:It.data.current,Ot=getAncestors(ht,jt==null?void 0:jt.id),Ut=getChildrenIds(ht,jt==null?void 0:jt.id);if(Ct){const Nt={isOver:!0,canMove:!1,overId:jt==null?void 0:jt.id,isTreeview:jt==null?void 0:jt.isTreeview};(Pt==null?void 0:Pt.id)===(jt==null?void 0:jt.id)||Ot.includes(Pt==null?void 0:Pt.id)||Ut.includes(Pt==null?void 0:Pt.id)?lt({...Nt,canMove:!1}):(dt(jt==null?void 0:jt.id,tt),lt({...Nt,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(),st=useSearchParams(),nt=useCurrentFolder(),ot=useToast(),at=useQueryClient(),{appCode:lt}=useEdificeClient(),{t:ut}=useTranslation([lt]),{setSearchParams:ct,setSearchConfig:dt,fetchTreeData:ht}=useStoreActions(),{data:ft,isError:xt,error:yt,isLoading:vt,isFetching:Et,fetchNextPage:wt}=useSearchContext(),bt=(ft==null?void 0:ft.pages[0].folders.length)===0,St=(ft==null?void 0:ft.pages[0].resources.length)===0,Rt=bt&&St;return reactExports.useEffect(()=>{var Ct,It;ft&&((Ct=ft==null?void 0:ft.pages[0])!=null&&Ct.searchConfig&&dt(ft.pages[0].searchConfig),!st.search&&nt.id==="default"&&ht(nt.id,at),ct({...st,pagination:(It=ft==null?void 0:ft.pages[(ft==null?void 0:ft.pages.length)-1])==null?void 0:It.pagination}))},[ft]),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,{})}):st.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&&(ft==null?void 0:ft.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:ft,isFetching:Et}),jsxRuntimeExports.jsx(ResourcesList$2,{data:ft,isFetching:Et,fetchNextPage:wt})]})},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(""),st=useSearchConfig(),nt=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>=st.minLength?{search:et||void 0}:{};at({...tt,...ht})},[et,st.minLength]),reactExports.useEffect(()=>{nt==="select"&&rt("")},[nt]),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(),[st,nt]=reactExports.useState(""),ot=dt=>{if(dt==="0"){nt("");return}nt(dt)},at=useCurrentFolder(),lt=useSearchParams(),{setSearchParams:ut}=useStoreActions();reactExports.useEffect(()=>{const dt=()=>st.includes("1")?!0:void 0,ht=()=>st.includes("2")?!0:void 0,ft=()=>st.includes("7")?!0:void 0;ut({...lt,filters:{owner:dt(),public:ft(),shared:ht(),folder:at?at.id:"default"}})},[at,ut,st]);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:st,options:ct,handleOnSelectFilter:ot}},SearchForm=()=>{const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation(),{selectedFilters:rt,options:st,handleOnSelectFilter:nt}=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:st.map(ht=>ht.value==="0"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>nt(ht.value),children:ht.label}),jsxRuntimeExports.jsx(Dropdown.Separator,{})]},"0"):jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>nt(ht.value),children:ht.label},ht.value))})]})]})},TrashButton=({id:tt,selected:et,onSelect:rt})=>{const{t:st}=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:st("explorer.tree.trash")})]})})})})})})})},CreateFolderModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FolderModal$2),void 0)),TreeViewContainer=()=>{const[tt,et]=useToggle(),rt=useQueryClient(),st=useTreeData(),nt=useIsTrash(),ot=useSelectedNodeId(),at=useElementDragOver(),lt=useScrollToTop(),ut=nt?FOLDER.BIN:ot,{appCode:ct}=useEdificeClient(),{t:dt}=useTranslation(["common",ct]),ht={...st,name:dt("explorer.filters.mine",{ns:ct})},{goToTrash:ft,selectTreeItem:xt,clearSelectedItems:yt,clearSelectedIds:vt,fetchTreeData:Et}=useStoreActions(),wt=Rt=>{xt(Rt,rt),lt()},bt=Rt=>{var jt,Pt;const Ct=findNodeById(st,Rt),It=(jt=Ct==null?void 0:Ct.children)==null?void 0:jt.some(Ot=>{var Ut;return Array.isArray(Ot==null?void 0:Ot.children)&&((Ut=Ot.children)==null?void 0:Ut.length)>0});(Pt=Ct==null?void 0:Ct.children)==null||Pt.forEach(Ot=>{It||Et(Ot.id,rt)})},St=()=>{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:wt,onTreeItemUnfold:bt}),jsxRuntimeExports.jsx(TrashButton,{id:FOLDER.BIN,selected:nt,onSelect:ft}),jsxRuntimeExports.jsx("div",{className:"d-grid my-16",children:jsxRuntimeExports.jsx(Button,{disabled:nt,type:"button",color:"primary",variant:"outline",leftIcon:jsxRuntimeExports.jsx(SvgIconPlus,{}),onClick:St,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:st}=useSearchForm(),nt=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:nt&&nt!=="bin"&&nt!=="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:st.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:st}=useStoreActions();reactExports.useEffect(()=>{rt(tt||{}),st({...et,application:tt.app,types:tt.types})},[tt]);const{currentApp:nt}=useEdificeClient(),{data:ot}=useActions(tt.actions),{isTrashedModalOpen:at,onTrashedCancel:lt}=useTrashModal(),{isActionDisableModalOpen:ut,onActionDisableCancel:ct}=useDisableModal(),{handleDragEnd:dt,handleDragOver:ht,handleDragStart:ft,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:nt})}),jsxRuntimeExports.jsx(Grid,{className:"flex-grow-1",children:jsxRuntimeExports.jsxs(DndContext,{sensors:xt,modifiers:[snapCenterToCursor],onDragStart:ft,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 st=tt[et];return st?typeof st=="function"?st():Promise.resolve(st):new Promise((nt,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(),[st,nt]=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-homeworks.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuHomeworks$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-messagerie.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuMessagerie$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);nt(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:st,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 st={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:st,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:st=!1,isSelectable:nt=!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:ft,listeners:xt,setNodeRef:yt,transform:vt}=useDraggable({id:ct,data:{id:rt,type:"folder"},disabled:!dt}),Et=useResourceOrFolderIsDraggable(),wt=useElementDragOver(),bt=It=>{yt(It),ht(It)},St=wt.overId===rt,Rt=!wt.canMove&&wt.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 It=Et.elementDrag===rt;ut(It)},[Et]),jsxRuntimeExports.jsx("div",{ref:bt,style:{...Ct},children:lt?jsxRuntimeExports.jsx(DraggableCard,{name:et,app:tt,type:"folder"}):jsxRuntimeExports.jsx(Card,{app:tt,isSelectable:!lt&&nt,isSelected:!lt&&st||St&&lt,isFocused:St,onClick:ot,onSelect:at,children:It=>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,...ft,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-${It}`}),jsxRuntimeExports.jsx(Card.Title,{children:et})]})]})})})};FolderCard.displayName="FolderCard";const FoldersList=({data:tt})=>{var xt,yt;const et=useQueryClient(),rt=useSelectedFolders(),st=useFolderIds(),nt=useResourceOrFolderIsDraggable(),ot=useScrollToTop(),{currentApp:at}=useEdificeClient(),{setSelectedFolders:lt,setFolderIds:ut,openFolder:ct}=useStoreActions();function dt(vt){st.includes(vt.id)?(ut(st.filter(Et=>Et!==vt.id)),lt(rt.filter(Et=>Et.id!==vt.id))):(ut([vt.id,...st]),lt([vt,...rt]))}function ht(vt){ot(),ct({folder:vt,folderId:vt.id,queryClient:et})}const ft=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:wt}=vt,bt=nt.elementDrag===Et;return jsxRuntimeExports.jsx(animated.li,{className:`g-col-4 ${bt?"z-2000":"z-1"}`,style:{position:"relative",...ft},children:jsxRuntimeExports.jsx(FolderCard,{name:wt,idFolder:Et,app:at,isSelected:st.includes(vt.id),onClick:St=>{St.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:st=!1,isSelectable:nt=!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 ft(jt){const{rights:Pt,creatorId:Ot}=jt||{};return Pt.filter(Nt=>!Nt.includes(Ot)).length>=1}const{attributes:xt,listeners:yt,setNodeRef:vt,transform:Et}=useDraggable({id:et.id,data:{id:et.id,type:"resource"},disabled:!!ct||!dt}),wt=ft(et),bt=et==null?void 0:et.public,St=useResourceOrFolderIsDraggable(),{appCode:Rt}=useEdificeClient(),{t:Ct}=useTranslation(),It={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 jt=St.elementDrag===et.id;ut(jt)},[St]),jsxRuntimeExports.jsx("div",{ref:vt,style:{...It},children:lt?jsxRuntimeExports.jsx(DraggableCard,{app:tt,type:"resource",name:et==null?void 0:et.name}):jsxRuntimeExports.jsx(Card,{app:tt,isSelected:!lt&&st,isSelectable:!lt&&nt,onClick:ot,onSelect:at,children:()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!lt&&dt&&!ct&&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:[wt&&jsxRuntimeExports.jsx(Tooltip,{message:Ct("tooltip.shared",{ns:Rt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16,height:16})}),bt&&jsxRuntimeExports.jsx(Tooltip,{message:Ct("tooltip.public",{ns:Rt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconGlobe,{width:16,height:16})})]})]})]})})})};ResourceCard.displayName="ResourceCard";const ResourcesList=({data:tt,fetchNextPage:et})=>{const{currentApp:rt}=useEdificeClient(),{t:st}=useTranslation(),{fromNow:nt}=useDate(),ot=useSearchParams(),at=useResourceIds(),lt=useSelectedResources(),{setSelectedResources:ut,setResourceIds:ct,openResource:dt,setResourceIsTrash:ht}=useStoreActions(),ft=useIsTrash(),xt=useSpring({from:{opacity:0},to:{opacity:1}}),vt=ot.pagination.startIdx+ot.pagination.pageSize<(ot.pagination.maxIdx||0),Et=reactExports.useCallback(()=>{et()},[]),wt=Rt=>{ft?(ht(!0),ct([Rt.id]),ut([Rt])):dt(Rt)};async function bt(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 St=clsx("grid ps-0 list-unstyled");return jsxRuntimeExports.jsxs(React$4.Fragment,{children:[jsxRuntimeExports.jsx(animated.ul,{className:St,children:tt==null?void 0:tt.pages.map((Rt,Ct)=>jsxRuntimeExports.jsx(React$4.Fragment,{children:Rt.resources.map(It=>{const{id:jt,updatedAt:Pt}=It,Ot=nt(Pt);return jsxRuntimeExports.jsx(animated.li,{className:"g-col-4",style:{position:"relative",...xt},children:jsxRuntimeExports.jsx(ResourceCard,{app:rt,resource:It,time:Ot,isSelectable:!0,isSelected:at.includes(It.id),onClick:Ut=>{Ut.stopPropagation(),wt(It)},onSelect:()=>bt(It)})},jt)})},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:st("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 st=useSelectedFolders(),nt=useCurrentFolder(),ot=useCreateFolder(),at=useUpdatefolder(),lt=tt?(Rt=st[0])==null?void 0:Rt.name:void 0,{reset:ut,register:ct,handleSubmit:dt,setFocus:ht,formState:{errors:ft,isSubmitting:xt,isDirty:yt,isValid:vt}}=useForm({mode:"onChange",values:{name:lt||""}}),Et=reactExports.useId(),wt=async function({name:Ct}){var It;try{if(tt){const jt=(It=st[0])==null?void 0:It.parentId,Ot=st[0].id;await at.mutate({folderId:Ot,parentId:jt,name:Ct}),ut(),et==null||et()}else{const jt=(nt==null?void 0:nt.id)||FOLDER.DEFAULT;await ot.mutate({name:Ct,parentId:jt}),ut(),et==null||et()}}catch(jt){console.error(jt)}};function bt(){ut(),rt()}return{formId:`createModal_${Et}`,errors:ft,isSubmitting:xt,isDirty:yt,isValid:vt,register:ct,setFocus:ht,handleSubmit:dt,onCancel:bt,onSubmit:wt}}function FolderModal$1({isOpen:tt,edit:et,onSuccess:rt,onCancel:st}){const{t:nt}=useTranslation(),{isDirty:ot,isValid:at,isSubmitting:lt,formId:ut,onSubmit:ct,onCancel:dt,handleSubmit:ht,register:ft,setFocus:xt}=useFolderModal({edit:et,onSuccess:rt,onClose:st});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:nt(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:nt("explorer.create.folder.name")}),jsxRuntimeExports.jsx(Input,{type:"text",...ft("name",{required:!0,maxLength:60,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:nt("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:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{form:ut,type:"submit",color:"primary",variant:"filled",disabled:!ot||!at||lt,children:nt(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:st}=useEdificeClient(),{t:nt}=useTranslation(st),{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(),ft=()=>{if(st=="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:ft,children:nt("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,wt)=>st==="blog"&&isActionAvailable("createPublic",lt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:st,isUpdating:yt,resource:xt,watch:vt,setValue:Et,register:wt})})})]}):null}const AppAction$1=Object.freeze(Object.defineProperty({__proto__:null,default:AppAction},Symbol.toStringTag,{value:"Module"})),useLibrary=()=>{const tt=useLibraryUrl(),{theme:et}=useEdificeTheme(),[rt,st]=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);st(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:st}=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:st("explorer.libray.img.alt")}),jsxRuntimeExports.jsx("p",{className:"m-8",children:st("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:st("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[st,nt]=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 ft=await odeServices.rights().sessionHasAtLeastOneResourceRight(tt,ht);nt(ft)}else{const ft=await odeServices.rights().sessionHasResourceRight(tt,ht);nt(ft)}},ut=async function(dt){if(tt instanceof Array){const ht=await odeServices.rights().sessionHasAtLeastOneResourceRightForEachList(tt,dt);nt(ht)}else{const ht=await odeServices.rights().sessionHasResourceRightForEachList(tt,dt);nt(ht)}},ct=async function(){var dt,ht,ft;if(tt===void 0){nt(!0);return}if(at&&((ht=(dt=et[0])==null?void 0:dt.trashedBy)!=null&&ht.includes(ot==null?void 0:ot.userId))&&rt==="restore"&&!((ft=et[0])!=null&&ft.trashed)){nt(!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 nt(!1);else typeof et=="string"?await lt(et):await lt(et.rights)};return{visible:st,refreshState:ct}}function useActionBar(){const[tt,et]=reactExports.useState(!1),[rt,st]=reactExports.useState("void"),[nt,ot]=reactExports.useState(),at=useStoreContext(pr=>pr.config),lt=useCurrentFolder(),ut=useResourceIds(),ct=useSelectedResources(),dt=useSelectedFolders(),ht=useFolderIds(),ft=useIsTrash(),xt=useRestore(),yt=useResourceIsTrash(),vt=useSearchParams(),Et=useCopyResource(),wt=useResourceOrFolderIsDraggable(),{openResource:bt,printSelectedResource:St,openFolder:Rt,clearSelectedItems:Ct,clearSelectedIds:It}=useStoreActions(),{data:jt}=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(wt.isDrag){et(!1);return}et(!0)},[ut,ht]);async function Pt(pr){var _r;switch((_r=document.getElementById("root"))==null||_r.setAttribute("aria-hidden","true"),ot(pr),pr.id){case ACTION.OPEN:return ut.length>0?bt(ct[0]):Rt({folder:dt[0],folderId:dt[0].id});case ACTION.COPY:return yr();case ACTION.MOVE:return st("move");case ACTION.PRINT:return St();case ACTION.DELETE:return st("delete");case ACTION.RESTORE:return await Nt();case ACTION.PUBLISH:return st("publish");case ACTION.UPD_PROPS:case"edit":return or();case ACTION.SHARE:return st("share");case ACTION.EXPORT:return st("export");default:throw Error(`Unknown action: ${pr.id}`)}}function Ot(pr){const _r=ut.length+ht.length,Ar=ut.length===1||ht.length===1,Hr=_r===1,Ur=ht.length===0;switch(pr.id){case ACTION.OPEN:return Hr;case ACTION.MANAGE:return Ar;case ACTION.COPY:return Ar&&Ur;case ACTION.PUBLISH:return Ar&&Ur;case ACTION.UPD_PROPS:return Ar&&Ur;case ACTION.SHARE:return Ur&&Ar;case"export":return Ar&&Ur;case ACTION.PRINT:return Ar&&Ur;case"edit":return Hr;default:return!0}}const Ut=()=>!0;async function Nt(){try{if(ft)await xt.mutate();else throw new Error("Cannot restore untrashed resources");Ht()}catch(pr){console.error(pr)}}function Ht(){var pr;st("void"),nt!=null&&nt.id&&((pr=document.getElementById(nt==null?void 0:nt.id))==null||pr.focus())}const Lt=pr=>()=>{rt===pr&&(Ht(),Ct(),It())},kt=Lt("move"),$t=Lt("move"),Ft=Lt("delete"),Gt=Lt("delete"),Mt=Lt("publish"),Vt=Lt("publish"),Bt=Lt("edit_folder"),qt=Lt("edit_folder"),Qt=Lt("edit_resource"),Yt=Lt("edit_resource"),tr=Lt("share"),lr=Lt("share"),ur=Lt("export"),mr=Lt("export");async function yr(){if(ct&&ct.length>0){const pr=ct[0];await Et.mutate(pr),Ct(),It()}}function or(){if(ut&&ut.length>0){const pr=ct[0].assetId;(at==null?void 0:at.app)==="scrapbook"?goToEdit({searchParams:vt,assetId:pr}):st("edit_resource")}else st("edit_folder")}function hr(pr){return pr.id==="edit"&&ht.length>0?"explorer.rename":`explorer.actions.${pr.id}`}return{onRestore:Nt,actions:ft?at==null?void 0:at.trashActions:jt,selectedElement:[...ct,...dt],currentFolderId:lt==null?void 0:lt.id,overrideLabel:hr,handleClick:Pt,isActivable:ft?Ut:Ot,isActionBarOpen:tt,isMoveModalOpen:rt==="move",onMoveCancel:kt,onMoveSuccess:$t,isDeleteModalOpen:rt==="delete",onDeleteCancel:Gt,onDeleteSuccess:Ft,isPublishModalOpen:rt==="publish",onPublishCancel:Vt,onPublishSuccess:Mt,isEditFolderOpen:rt==="edit_folder",onEditFolderCancel:qt,onEditFolderSuccess:Bt,isEditResourceOpen:rt==="edit_resource",onEditResourceCancel:Yt,onEditResourceSuccess:Qt,isShareResourceOpen:rt==="share",onShareResourceCancel:lr,onShareResourceSuccess:tr,isExportModalOpen:rt==="export",onExportCancel:ur,onExportSuccess:mr,onClearActionBar:Ht}}function AccessControl({resourceRights:tt,roleExpected:et,action:rt,children:st,renderWhenForbidden:nt}){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:st}):nt?nt():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:st,isMoveModalOpen:nt,isDeleteModalOpen:ot,isPublishModalOpen:at,isActionBarOpen:lt,isEditFolderOpen:ut,overrideLabel:ct,onEditFolderCancel:dt,onEditFolderSuccess:ht,isEditResourceOpen:ft,onEditResourceCancel:xt,onEditResourceSuccess:yt,isShareResourceOpen:vt,onShareResourceCancel:Et,onShareResourceSuccess:wt,isExportModalOpen:bt,onExportCancel:St,onExportSuccess:Rt,onMoveCancel:Ct,onMoveSuccess:It,onDeleteCancel:jt,onDeleteSuccess:Pt,onPublishCancel:Ot,onPublishSuccess:Ut,isActivable:Nt,handleClick:Ht}=useActionBar(),kt=useSelectedResources()[0],$t=useShareResource(tt),Ft=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((Mt,Vt)=>Vt&&jsxRuntimeExports.jsx(animated.div,{className:"position-fixed bottom-0 start-0 end-0",style:{...Mt,zIndex:4},children:jsxRuntimeExports.jsx(ActionBar$1,{children:rt==null?void 0:rt.filter(Bt=>Bt.available&&Bt.target==="actionbar").map(Bt=>Nt(Bt)&&jsxRuntimeExports.jsx(AccessControl,{resourceRights:st,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:[nt&&jsxRuntimeExports.jsx(MoveModal$2,{isOpen:nt,onCancel:Ct,onSuccess:It}),ot&&jsxRuntimeExports.jsx(DeleteModal$2,{isOpen:ot,onCancel:jt,onSuccess:Pt}),at&&kt&&jsxRuntimeExports.jsx(PublishModal$1,{isOpen:at,resourceId:kt.assetId,onCancel:Ot,onSuccess:Ut}),ut&&jsxRuntimeExports.jsx(FolderModal,{edit:!0,isOpen:ut,onCancel:dt,onSuccess:ht}),ft&&kt&&jsxRuntimeExports.jsx(UpdateModal,{mode:"update",isOpen:ft,resourceId:kt.assetId,updateResource:Ft,onCancel:xt,onSuccess:yt,children:(Mt,Vt,Bt,qt,Qt)=>tt==="blog"&&isActionAvailable("createPublic",rt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:tt,isUpdating:Vt,resource:Mt,watch:Bt,setValue:qt,register:Qt})}),vt&&kt&&jsxRuntimeExports.jsx(ShareResourceModal,{isOpen:vt,shareResource:$t,shareOptions:{resourceCreatorId:kt.creatorId,resourceId:kt.assetId,resourceRights:kt.rights},onCancel:Et,onSuccess:wt,children:tt==="blog"?jsxRuntimeExports.jsx(ShareBlog,{resourceId:kt.assetId,updateResource:Ft}):null}),bt&&kt&&jsxRuntimeExports.jsx(ExportModal$2,{isOpen:bt,onCancel:St,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"})),illuHomeworks="/assets/js/ode-explorer/illu-homeworks.svg",illuHomeworks$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuHomeworks},Symbol.toStringTag,{value:"Module"})),illuMessagerie="/assets/js/ode-explorer/illu-messagerie.svg",illuMessagerie$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuMessagerie},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-library.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(),st=useIsTrash();async function nt(){try{st?await et.mutate():await rt.mutate(),tt==null||tt()}catch(ot){console.error(ot)}}return{isTrashFolder:st,onDelete:nt}}function DeleteModal({isOpen:tt,onSuccess:et=()=>({}),onCancel:rt=()=>({})}){const{t:st}=useTranslation(),{isTrashFolder:nt,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:st(nt?"explorer.delete.title":"explorer.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:st(nt?"explorer.delete.subtitle":"explorer.trash.subtitle")})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"danger",onClick:ot,type:"button",variant:"filled",children:st(nt?"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(),st=useQueryClient(),nt=useMoveItem(),ot=useSelectedFolders(),at=useSelectedResources(),lt=useTreeData(),{fetchTreeData:ut}=useStoreActions();async function ct(){try{if(!et)throw new Error("explorer.move.selection.empty");await nt.mutate(et),await(tt==null?void 0:tt())}catch(ht){console.error(ht)}}const dt=ht=>{var xt,yt;const ft=getAncestors(lt,ht);for(const vt of ot)if(ht===vt.id||ht===vt.parentId||(xt=vt.childrenIds)!=null&&xt.includes(ht)||ft.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 ft=findNodeById(lt,ht),xt=(yt=ft==null?void 0:ft.children)==null?void 0:yt.some(Et=>{var wt;return Array.isArray(Et==null?void 0:Et.children)&&((wt=Et.children)==null?void 0:wt.length)>0});(vt=ft==null?void 0:ft.children)==null||vt.forEach(Et=>{xt||ut(Et.id,st)})},onMove:()=>ct()}}function MoveModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{appCode:st}=useEdificeClient(),{t:nt}=useTranslation(),{treeData:ot,handleTreeItemSelect:at,handleOnTreeItemUnfold:lt,onMove:ut,disableSubmit:ct}=useMoveModal({onSuccess:et}),dt={...ot,name:nt("explorer.filters.mine",{ns:st})};return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"moveModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:nt("explorer.move.title")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:nt("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:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:ut,type:"button",variant:"filled",disabled:ct,children:nt("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(),st=useToast(),{t:nt}=useTranslation();return{handleExportClick:()=>{et.length?(goToExport({searchParams:rt,assetId:et[0].assetId}),tt()):st.error(nt("explorer.error.noResourceSelected"))}}};function ExportModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{handleExportClick:st}=useExportModal(et),{t:nt}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"exportModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:nt("explorer.export.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsxs("ul",{children:[jsxRuntimeExports.jsx("li",{children:nt("explorer.export.body.info.1")}),jsxRuntimeExports.jsx("li",{children:nt("explorer.export.body.info.2")}),jsxRuntimeExports.jsx("li",{children:nt("explorer.export.body.info.3")})]}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:nt("explorer.export.body.warning")})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:st,type:"button",variant:"filled",children:nt("explorer.actions.export")})]})]}),document.getElementById("portal"))}const ExportModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:ExportModal},Symbol.toStringTag,{value:"Module"}))});export default i3();
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,st,nt){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=st(xt),nt!==void 0&&at.hasValue){var yt=at.value;if(nt(yt,xt))return ht=yt}return ht=xt}if(yt=ht,objectIs(dt,xt))return yt;var vt=st(xt);return nt!==void 0&&nt(yt,vt)?(dt=xt,yt):(dt=xt,ht=vt)}var ct=!1,dt,ht,ft=rt===void 0?null:rt;return[function(){return ut(et())},ft===null?void 0:function(){return ut(ft())}]},[et,rt,st,nt]);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 st=useSyncExternalStoreWithSelector(tt.subscribe,tt.getState,tt.getServerState||tt.getInitialState,et,rt);return useDebugValue(st),st}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 st={name:et,parentId:rt,application:tt.application,type:tt.types[0]};return await odeServices.resource(tt.application).createFolder(st)},updateFolder=async({folderId:tt,searchParams:et,parentId:rt,name:st})=>{const nt={folderId:tt,name:st,parentId:rt,application:et.application,type:et.types[0]};return await odeServices.resource(et.application).updateFolder(nt)},trashAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:st})=>{const nt={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:st};return await odeServices.resource(tt.application).trashAll(nt,rt)},deleteAll=async({searchParams:tt,resourceIds:et,useAssetIds:rt,folderIds:st})=>{const nt={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:st};return await odeServices.resource(tt.application).deleteAll(nt,rt)},restoreAll=async({searchParams:tt,resourceIds:et,folderIds:rt,useAssetIds:st})=>{const nt={application:tt.application,resourceType:tt.types[0],resourceIds:et,folderIds:rt};return await odeServices.resource(tt.application).restoreAll(nt,st)},copyResource=async(tt,et)=>await odeServices.resource(tt.application).copy({application:tt.application,resourceId:et}),moveToFolder=async({searchParams:tt,resourceIds:et,folderId:rt,folderIds:st,useAssetIds:nt})=>{const ot={application:tt.application,folderId:rt,resourceIds:et,folderIds:st};return await odeServices.resource(tt.application).moveToFolder(ot,nt)},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(st=>({searchConfig:{...st.searchConfig,...rt}})),setTreeData:rt=>tt(()=>({treeData:rt})),setSearchParams:rt=>{tt(st=>{const{searchParams:nt}=st;return nt.search!==rt.search?rt.search?{...st,selectedFolders:[],selectedNodeId:void 0,selectedResources:[],currentFolder:void 0,searchParams:{...nt,...rt,trashed:!1,filters:{...nt.filters,folder:void 0}}}:{...st,selectedFolders:[],selectedNodeId:"default",selectedResources:[],currentFolder:{id:"default"},searchParams:{...nt,...rt,trashed:!1,filters:{...nt.filters}}}:{searchParams:{...nt,...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:st}=et();goToResource({searchParams:st,assetId:rt.assetId})}catch(st){console.error("explorer open failed: ",st)}},printSelectedResource:()=>{try{const{searchParams:rt,selectedResources:st,resourceIds:nt}=et();if(st.length!==1)throw new Error("Cannot open more than 1 resource");const ot=st.find(at=>at.id===nt[0]);printResource({searchParams:rt,assetId:ot.assetId})}catch(rt){console.error("explorer print failed: ",rt)}},openFolder:({folderId:rt,folder:st,queryClient:nt})=>{const{searchParams:ot}=et(),at=ot.filters.folder,lt=rt;at!==rt&&(et().actions.fetchTreeData(rt,nt),tt(ut=>({...ut,folderIds:[],resourceIds:[],selectedNodeId:lt,currentFolder:st||{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,st)=>{const nt=findNodeById(et().treeData,rt),ot=nt==null?void 0:nt.id;if(Array.isArray(nt==null?void 0:nt.children)&&nt.children.length)return;const at=await st.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,st)=>{const{treeData:nt}=et(),{openFolder:ot,fetchTreeData:at}=et().actions,lt=findNodeById(nt,rt);at(rt,st),tt(ut=>({...ut,searchParams:{...ut.searchParams,search:void 0},status:"select",selectedResources:[]})),ot({folder:lt,folderId:rt})},gotoPreviousFolder:()=>{const{selectedNodeId:rt,treeData:st,searchParams:nt}=et(),{openFolder:ot}=et().actions;if(nt.search&&ot({folder:defaultFolder,folderId:FOLDER.DEFAULT}),!rt)return;const at=findParentNode(st,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:st}=useStoreActions();return{isActionDisableModalOpen:tt,onActionDisableCancel:()=>{et(),st(),rt(!1)}}},useTrashModal=()=>{const tt=useResourceIsTrash(),{clearSelectedIds:et,setResourceIsTrash:rt,clearSelectedItems:st}=useStoreActions();return{isTrashedModalOpen:tt,onTrashedCancel:()=>{et(),st(),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):"",st=et.public?"/blog/pub":"/blog",nt=await this.http.post(st,{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(nt),nt}async update(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=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(st),{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(nt=>nt.workflow),st=new Set(rt);return{queryKey:[...st],queryFn:()=>sessionHasWorkflowRights([...st]),select:nt=>tt.filter(ot=>nt[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:st,search:nt}=et,ot=["context",{folderId:rt.folder,filters:rt,trashed:st,search:nt}];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(),st=useTreeData(),nt=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedItems:ct,clearSelectedIds:dt,setTreeData:ht,setSearchParams:ft}=useStoreActions(),{filters:xt,trashed:yt}=rt,vt=["context",{folderId:xt.folder,filters:xt,trashed:yt}];return useMutation({mutationFn:async()=>await trashAll({searchParams:rt,folderIds:nt,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,bt=>{var St;if(bt){const Rt={...bt,pages:bt==null?void 0:bt.pages.map(It=>{var jt;return{...It,folders:It.folders.filter(Pt=>!nt.includes(Pt.id)),pagination:{...It.pagination,maxIdx:((jt=It==null?void 0:It.pagination)==null?void 0:jt.maxIdx)-Et.resources.length},resources:It.resources.filter(Pt=>lt?!ot.includes(Pt.assetId):!ut.includes(Pt.id))}})},Ct=deleteNode(st,{folders:nt});return ht(Ct),ft({...rt,pagination:{...rt.pagination,maxIdx:((St=rt.pagination)==null?void 0:St.maxIdx)-Et.resources.length}}),Rt}})},onSettled:()=>{ct(),dt()}})},useRestore=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useFolderIds(),nt=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?nt:ot,{setFolderIds:ut,setResourceIds:ct,setSelectedResources:dt,setSelectedFolders:ht}=useStoreActions(),{filters:ft,trashed:xt}=rt,yt=["context",{folderId:ft.folder,filters:ft,trashed:xt}];return useMutation({mutationFn:async()=>await restoreAll({searchParams:rt,folderIds:st,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(wt=>({...wt,folders:wt.folders.filter(bt=>!st.includes(bt.id)),resources:wt.resources.filter(bt=>at?!nt.includes(bt.assetId):!lt.includes(bt.id))}))}})},onSettled:()=>{ct([]),dt([]),ut([]),ht([])}})},useDelete=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useFolderIds(),nt=useResourceAssetIds(),ot=useResourceIds(),at=useResourceWithoutIds().length>0,lt=at?nt:ot,{clearSelectedItems:ut,clearSelectedIds:ct}=useStoreActions(),{filters:dt,trashed:ht}=rt,ft=["context",{folderId:dt.folder,filters:dt,trashed:ht}];return useMutation({mutationFn:async()=>await deleteAll({searchParams:rt,folderIds:st,resourceIds:lt,useAssetIds:at}),onError(xt){typeof xt=="string"&&tt.error(t$2(xt))},onSuccess:async()=>{if(await et.cancelQueries({queryKey:ft}),et.getQueryData(ft))return tt.success(t$2("explorer.removed.from.trash")),et.setQueryData(ft,yt=>{if(yt)return{...yt,pages:yt==null?void 0:yt.pages.map(Et=>({...Et,folders:Et.folders.filter(wt=>!st.includes(wt.id)),resources:Et.resources.filter(wt=>at?!nt.includes(wt.assetId):!lt.includes(wt.id))}))}})},onSettled:()=>{ut(),ct()}})},useCopyResource=()=>{const tt=useToast(),et=useSearchParams(),rt=useQueryClient(),{user:st}=useUser(),nt=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),ft={...dt,name:`${dt.name}${t$2("duplicate.suffix")}`,assetId:ct.duplicateId,id:ct.duplicateId,creatorId:st==null?void 0:st.userId,creatorName:st==null?void 0:st.username,createdAt:Date.now(),slug:dt.slug||"",modifiedAt:Date.now(),modifierId:(st==null?void 0:st.userId)||"",modifierName:(st==null?void 0:st.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${st==null?void 0:st.userId}`]};ht&&rt.setQueryData(ut,xt=>{if(xt)return{...xt,pages:xt==null?void 0:xt.pages.map(yt=>({...yt,resources:[ft,...yt.resources]}))}}),nt.id&&nt.id!==FOLDER.DEFAULT&&moveToFolder({searchParams:et,resourceIds:[ct.duplicateId],folderId:nt.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(),st=useTreeData(),nt=useFolderIds(),ot=useResourceAssetIds(),at=useResourceIds(),lt=useResourceWithoutIds().length>0,ut=lt?ot:at,{clearSelectedIds:ct,clearSelectedItems:dt,setTreeData:ht,setSearchParams:ft}=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:nt,resourceIds:ut,useAssetIds:lt}),onError(Et){typeof Et=="string"&&tt.error(t$2(Et))},onSuccess:async(Et,wt)=>{if(et.getQueryData(vt))return et.setQueryData(vt,St=>{var Rt;if(St){const Ct=moveNode(st,{destinationId:wt,folders:nt}),It={...St,pages:St==null?void 0:St.pages.map(jt=>{var Pt;return{...jt,folders:jt.folders.filter(Ot=>!nt.includes(Ot.id)),pagination:{...jt.pagination,maxIdx:((Pt=jt.pagination)==null?void 0:Pt.maxIdx)-Et.resources.length},resources:jt.resources.filter(Ot=>lt?!ot.includes(Ot.assetId):!ut.includes(Ot.id))}})};return ht(Ct),ft({...rt,pagination:{...rt.pagination,maxIdx:((Rt=rt.pagination)==null?void 0:Rt.maxIdx)-Et.resources.length}}),It}});et.invalidateQueries()},onSettled:()=>{dt(),ct()}})},useCreateFolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useTreeData(),{setTreeData:nt}=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,ft=>{if(ft){const xt={...ft,pages:ft==null?void 0:ft.pages.map(vt=>({...vt,folders:[...vt.folders,ht]}))},yt=addNode(st,{parentId:ct.parentId,newFolder:ht});return nt(yt),xt}})}})},useUpdatefolder=()=>{const tt=useToast(),et=useQueryClient(),rt=useSearchParams(),st=useTreeData(),{setFolderIds:nt,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:ft})=>await updateFolder({searchParams:rt,folderId:dt,parentId:ft,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(wt=>wt.id===dt.id?{...dt,parentId:ht.parentId,rights:wt.rights}:wt)}))},vt=updateNode(st,{folderId:ht.folderId,newFolder:dt});return at(vt),yt}})},onSettled:()=>{nt([]),ot([])}})},useShareResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{setResourceIds:st,setSelectedResources:nt}=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(ft=>({...ft,resources:ft.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:()=>{st([]),nt([])}}})},useUpdateResource=tt=>{const et=useQueryClient(),rt=useSearchParams(),{filters:st,trashed:nt}=rt,ot=["context",{folderId:st.folder,filters:st,trashed:nt}];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:ft,thumbnail:xt,public:yt,description:vt,slug:Et,...wt}=lt;return{...ht,...wt,name:ft,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:st}=useUser(),{appCode:nt}=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,ft;await et.cancelQueries({queryKey:ot});const ut=et.getQueryData(ot),ct={...lt,thumbnail:at.thumbnail||"",application:nt,assetId:at._id||at.entId||"",id:at._id||at.entId||"",creatorId:st==null?void 0:st.userId,creatorName:st==null?void 0:st.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:((ft=at.author)==null?void 0:ft.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${st==null?void 0:st.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 st;const rt=findNodeById(tt,et);return(st=rt==null?void 0:rt.folder)!=null&&st.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:st}=useEdificeClient(),{t:nt}=useTranslation(["common",st]),ot=nt("explorer.filters.mine",{ns:st}),{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 It;((It=Rt.data.current)==null?void 0:It.type)==="resource"?rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[nt("explorer.dragged.resource")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]})):rt.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[nt("explorer.dragged.folder")," ",jsxRuntimeExports.jsx("strong",{children:Ct})]}))};return{handleDragEnd:async Rt=>{const{over:Ct,active:It}=Rt,jt=Ct==null?void 0:Ct.data.current,Pt=It.data.current,Ot=getAncestors(ht,jt==null?void 0:jt.id),Ut=getChildrenIds(ht,jt==null?void 0:jt.id);if((Pt==null?void 0:Pt.id)==(jt==null?void 0:jt.id)||Ot.includes(Pt==null?void 0:Pt.id)||Ut.includes(Pt==null?void 0:Pt.id))ut([]),ct([]);else{const Nt=(jt==null?void 0:jt.name)??ot;if(Ct)try{await et.mutate(jt==null?void 0:jt.id),Et(It,Nt)}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,It=Ct.data.current;(It==null?void 0:It.type)==="resource"?ut([It==null?void 0:It.id]):(It==null?void 0:It.type)==="folder"&&ct([It==null?void 0:It.id]),at({isDrag:!0,elementDrag:It==null?void 0:It.id})},handleDragOver:Rt=>{const{over:Ct,active:It}=Rt,jt=Ct==null?void 0:Ct.data.current,Pt=It==null?void 0:It.data.current,Ot=getAncestors(ht,jt==null?void 0:jt.id),Ut=getChildrenIds(ht,jt==null?void 0:jt.id);if(Ct){const Nt={isOver:!0,canMove:!1,overId:jt==null?void 0:jt.id,isTreeview:jt==null?void 0:jt.isTreeview};(Pt==null?void 0:Pt.id)===(jt==null?void 0:jt.id)||Ot.includes(Pt==null?void 0:Pt.id)||Ut.includes(Pt==null?void 0:Pt.id)?lt({...Nt,canMove:!1}):(dt(jt==null?void 0:jt.id,tt),lt({...Nt,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(),st=useSearchParams(),nt=useCurrentFolder(),ot=useToast(),at=useQueryClient(),{appCode:lt}=useEdificeClient(),{t:ut}=useTranslation([lt]),{setSearchParams:ct,setSearchConfig:dt,fetchTreeData:ht}=useStoreActions(),{data:ft,isError:xt,error:yt,isLoading:vt,isFetching:Et,fetchNextPage:wt}=useSearchContext(),bt=(ft==null?void 0:ft.pages[0].folders.length)===0,St=(ft==null?void 0:ft.pages[0].resources.length)===0,Rt=bt&&St;return reactExports.useEffect(()=>{var Ct,It;ft&&((Ct=ft==null?void 0:ft.pages[0])!=null&&Ct.searchConfig&&dt(ft.pages[0].searchConfig),!st.search&&nt.id==="default"&&ht(nt.id,at),ct({...st,pagination:(It=ft==null?void 0:ft.pages[(ft==null?void 0:ft.pages.length)-1])==null?void 0:It.pagination}))},[ft]),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,{})}):st.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&&(ft==null?void 0:ft.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:ft,isFetching:Et}),jsxRuntimeExports.jsx(ResourcesList$2,{data:ft,isFetching:Et,fetchNextPage:wt})]})},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(""),st=useSearchConfig(),nt=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>=st.minLength?{search:et||void 0}:{};at({...tt,...ht})},[et,st.minLength]),reactExports.useEffect(()=>{nt==="select"&&rt("")},[nt]),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(),[st,nt]=reactExports.useState(""),ot=dt=>{if(dt==="0"){nt("");return}nt(dt)},at=useCurrentFolder(),lt=useSearchParams(),{setSearchParams:ut}=useStoreActions();reactExports.useEffect(()=>{const dt=()=>st.includes("1")?!0:void 0,ht=()=>st.includes("2")?!0:void 0,ft=()=>st.includes("7")?!0:void 0;ut({...lt,filters:{owner:dt(),public:ft(),shared:ht(),folder:at?at.id:"default"}})},[at,ut,st]);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:st,options:ct,handleOnSelectFilter:ot}},SearchForm=()=>{const{appCode:tt}=useEdificeClient(),{t:et}=useTranslation(),{selectedFilters:rt,options:st,handleOnSelectFilter:nt}=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:st.map(ht=>ht.value==="0"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>nt(ht.value),children:ht.label}),jsxRuntimeExports.jsx(Dropdown.Separator,{})]},"0"):jsxRuntimeExports.jsx(Dropdown.RadioItem,{value:ht.value,model:rt,onChange:()=>nt(ht.value),children:ht.label},ht.value))})]})]})},TrashButton=({id:tt,selected:et,onSelect:rt})=>{const{t:st}=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:st("explorer.tree.trash")})]})})})})})})})},CreateFolderModal=reactExports.lazy(async()=>await __vitePreload(()=>Promise.resolve().then(()=>FolderModal$2),void 0)),TreeViewContainer=()=>{const[tt,et]=useToggle(),rt=useQueryClient(),st=useTreeData(),nt=useIsTrash(),ot=useSelectedNodeId(),at=useElementDragOver(),lt=useScrollToTop(),ut=nt?FOLDER.BIN:ot,{appCode:ct}=useEdificeClient(),{t:dt}=useTranslation(["common",ct]),ht={...st,name:dt("explorer.filters.mine",{ns:ct})},{goToTrash:ft,selectTreeItem:xt,clearSelectedItems:yt,clearSelectedIds:vt,fetchTreeData:Et}=useStoreActions(),wt=Rt=>{xt(Rt,rt),lt()},bt=Rt=>{var jt,Pt;const Ct=findNodeById(st,Rt),It=(jt=Ct==null?void 0:Ct.children)==null?void 0:jt.some(Ot=>{var Ut;return Array.isArray(Ot==null?void 0:Ot.children)&&((Ut=Ot.children)==null?void 0:Ut.length)>0});(Pt=Ct==null?void 0:Ct.children)==null||Pt.forEach(Ot=>{It||Et(Ot.id,rt)})},St=()=>{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:wt,onTreeItemUnfold:bt}),jsxRuntimeExports.jsx(TrashButton,{id:FOLDER.BIN,selected:nt,onSelect:ft}),jsxRuntimeExports.jsx("div",{className:"d-grid my-16",children:jsxRuntimeExports.jsx(Button,{disabled:nt,type:"button",color:"primary",variant:"outline",leftIcon:jsxRuntimeExports.jsx(SvgIconPlus,{}),onClick:St,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:st}=useSearchForm(),nt=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:nt&&nt!=="bin"&&nt!=="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:st.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:st}=useStoreActions();reactExports.useEffect(()=>{rt(tt||{}),st({...et,application:tt.app,types:tt.types})},[tt]);const{currentApp:nt}=useEdificeClient(),{data:ot}=useActions(tt.actions),{isTrashedModalOpen:at,onTrashedCancel:lt}=useTrashModal(),{isActionDisableModalOpen:ut,onActionDisableCancel:ct}=useDisableModal(),{handleDragEnd:dt,handleDragOver:ht,handleDragStart:ft,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:nt})}),jsxRuntimeExports.jsx(Grid,{className:"flex-grow-1",children:jsxRuntimeExports.jsxs(DndContext,{sensors:xt,modifiers:[snapCenterToCursor],onDragStart:ft,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 st=tt[et];return st?typeof st=="function"?st():Promise.resolve(st):new Promise((nt,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(),[st,nt]=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-homeworks.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuHomeworks$1),void 0),"../../../node_modules/@edifice.io/bootstrap/dist/images/emptyscreen/illu-messagerie.svg":()=>__vitePreload(()=>Promise.resolve().then(()=>illuMessagerie$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);nt(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:st,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 st={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:st,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:st=!1,isSelectable:nt=!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:ft,listeners:xt,setNodeRef:yt,transform:vt}=useDraggable({id:ct,data:{id:rt,type:"folder"},disabled:!dt}),Et=useResourceOrFolderIsDraggable(),wt=useElementDragOver(),bt=It=>{yt(It),ht(It)},St=wt.overId===rt,Rt=!wt.canMove&&wt.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 It=Et.elementDrag===rt;ut(It)},[Et]),jsxRuntimeExports.jsx("div",{ref:bt,style:{...Ct},children:lt?jsxRuntimeExports.jsx(DraggableCard,{name:et,app:tt,type:"folder"}):jsxRuntimeExports.jsx(Card,{app:tt,isSelectable:!lt&&nt,isSelected:!lt&&st||St&&lt,isFocused:St,onClick:ot,onSelect:at,children:It=>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,...ft,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-${It}`}),jsxRuntimeExports.jsx(Card.Title,{children:et})]})]})})})};FolderCard.displayName="FolderCard";const FoldersList=({data:tt})=>{var xt,yt;const et=useQueryClient(),rt=useSelectedFolders(),st=useFolderIds(),nt=useResourceOrFolderIsDraggable(),ot=useScrollToTop(),{currentApp:at}=useEdificeClient(),{setSelectedFolders:lt,setFolderIds:ut,openFolder:ct}=useStoreActions();function dt(vt){st.includes(vt.id)?(ut(st.filter(Et=>Et!==vt.id)),lt(rt.filter(Et=>Et.id!==vt.id))):(ut([vt.id,...st]),lt([vt,...rt]))}function ht(vt){ot(),ct({folder:vt,folderId:vt.id,queryClient:et})}const ft=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:wt}=vt,bt=nt.elementDrag===Et;return jsxRuntimeExports.jsx(animated.li,{className:`g-col-4 ${bt?"z-2000":"z-1"}`,style:{position:"relative",...ft},children:jsxRuntimeExports.jsx(FolderCard,{name:wt,idFolder:Et,app:at,isSelected:st.includes(vt.id),onClick:St=>{St.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:st=!1,isSelectable:nt=!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 ft(jt){const{rights:Pt,creatorId:Ot}=jt||{};return Pt.filter(Nt=>!Nt.includes(Ot)).length>=1}const{attributes:xt,listeners:yt,setNodeRef:vt,transform:Et}=useDraggable({id:et.id,data:{id:et.id,type:"resource"},disabled:!!ct||!dt}),wt=ft(et),bt=et==null?void 0:et.public,St=useResourceOrFolderIsDraggable(),{appCode:Rt}=useEdificeClient(),{t:Ct}=useTranslation(),It={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 jt=St.elementDrag===et.id;ut(jt)},[St]),jsxRuntimeExports.jsx("div",{ref:vt,style:{...It},children:lt?jsxRuntimeExports.jsx(DraggableCard,{app:tt,type:"resource",name:et==null?void 0:et.name}):jsxRuntimeExports.jsx(Card,{app:tt,isSelected:!lt&&st,isSelectable:!lt&&nt,onClick:ot,onSelect:at,children:()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!lt&&dt&&!ct&&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:[wt&&jsxRuntimeExports.jsx(Tooltip,{message:Ct("tooltip.shared",{ns:Rt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16,height:16})}),bt&&jsxRuntimeExports.jsx(Tooltip,{message:Ct("tooltip.public",{ns:Rt}),placement:"top",children:jsxRuntimeExports.jsx(SvgIconGlobe,{width:16,height:16})})]})]})]})})})};ResourceCard.displayName="ResourceCard";const ResourcesList=({data:tt,fetchNextPage:et})=>{const{currentApp:rt}=useEdificeClient(),{t:st}=useTranslation(),{fromNow:nt}=useDate(),ot=useSearchParams(),at=useResourceIds(),lt=useSelectedResources(),{setSelectedResources:ut,setResourceIds:ct,openResource:dt,setResourceIsTrash:ht}=useStoreActions(),ft=useIsTrash(),xt=useSpring({from:{opacity:0},to:{opacity:1}}),vt=ot.pagination.startIdx+ot.pagination.pageSize<(ot.pagination.maxIdx||0),Et=reactExports.useCallback(()=>{et()},[]),wt=Rt=>{ft?(ht(!0),ct([Rt.id]),ut([Rt])):dt(Rt)};async function bt(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 St=clsx("grid ps-0 list-unstyled");return jsxRuntimeExports.jsxs(React$4.Fragment,{children:[jsxRuntimeExports.jsx(animated.ul,{className:St,children:tt==null?void 0:tt.pages.map((Rt,Ct)=>jsxRuntimeExports.jsx(React$4.Fragment,{children:Rt.resources.map(It=>{const{id:jt,updatedAt:Pt}=It,Ot=nt(Pt);return jsxRuntimeExports.jsx(animated.li,{className:"g-col-4",style:{position:"relative",...xt},children:jsxRuntimeExports.jsx(ResourceCard,{app:rt,resource:It,time:Ot,isSelectable:!0,isSelected:at.includes(It.id),onClick:Ut=>{Ut.stopPropagation(),wt(It)},onSelect:()=>bt(It)})},jt)})},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:st("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 st=useSelectedFolders(),nt=useCurrentFolder(),ot=useCreateFolder(),at=useUpdatefolder(),lt=tt?(Rt=st[0])==null?void 0:Rt.name:void 0,{reset:ut,register:ct,handleSubmit:dt,setFocus:ht,formState:{errors:ft,isSubmitting:xt,isDirty:yt,isValid:vt}}=useForm({mode:"onChange",values:{name:lt||""}}),Et=reactExports.useId(),wt=async function({name:Ct}){var It;try{if(tt){const jt=(It=st[0])==null?void 0:It.parentId,Ot=st[0].id;await at.mutate({folderId:Ot,parentId:jt,name:Ct}),ut(),et==null||et()}else{const jt=(nt==null?void 0:nt.id)||FOLDER.DEFAULT;await ot.mutate({name:Ct,parentId:jt}),ut(),et==null||et()}}catch(jt){console.error(jt)}};function bt(){ut(),rt()}return{formId:`createModal_${Et}`,errors:ft,isSubmitting:xt,isDirty:yt,isValid:vt,register:ct,setFocus:ht,handleSubmit:dt,onCancel:bt,onSubmit:wt}}function FolderModal$1({isOpen:tt,edit:et,onSuccess:rt,onCancel:st}){const{t:nt}=useTranslation(),{isDirty:ot,isValid:at,isSubmitting:lt,formId:ut,onSubmit:ct,onCancel:dt,handleSubmit:ht,register:ft,setFocus:xt}=useFolderModal({edit:et,onSuccess:rt,onClose:st});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:nt(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:nt("explorer.create.folder.name")}),jsxRuntimeExports.jsx(Input,{type:"text",...ft("name",{required:!0,maxLength:60,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:nt("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:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{form:ut,type:"submit",color:"primary",variant:"filled",disabled:!ot||!at||lt,children:nt(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:st}=useEdificeClient(),{t:nt}=useTranslation(st),{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(),ft=()=>{if(st=="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:ft,children:nt("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,wt)=>st==="blog"&&isActionAvailable("createPublic",lt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:st,isUpdating:yt,resource:xt,watch:vt,setValue:Et,register:wt})})})]}):null}const AppAction$1=Object.freeze(Object.defineProperty({__proto__:null,default:AppAction},Symbol.toStringTag,{value:"Module"})),imageLibraryNeo="/assets/js/ode-explorer/image-library.svg",imageLibraryOne="/assets/js/ode-explorer/image-library.svg",useLibrary=()=>{const tt=useLibraryUrl(),{theme:et}=useEdificeTheme(),[rt,st]=reactExports.useState("");return reactExports.useEffect(()=>{var lt,ut;const ot={neo:imageLibraryNeo,one:imageLibraryOne},at=((ut=(lt=et==null?void 0:et.bootstrapVersion)==null?void 0:lt.toString())==null?void 0:ut.toLowerCase())||"neo";st(ot[at]||imageLibraryNeo)},[et]),{libraryUrl:tt,imageFullURL:rt,handleClick:()=>{tt&&(window.open(tt,"_blank"),odeServices.data().trackAccessLibraryFromExplorer())}}},Library=()=>{const{libraryUrl:tt,imageFullURL:et,handleClick:rt}=useLibrary(),{t:st}=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:st("explorer.libray.img.alt")}),jsxRuntimeExports.jsx("p",{className:"m-8",children:st("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:st("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[st,nt]=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 ft=await odeServices.rights().sessionHasAtLeastOneResourceRight(tt,ht);nt(ft)}else{const ft=await odeServices.rights().sessionHasResourceRight(tt,ht);nt(ft)}},ut=async function(dt){if(tt instanceof Array){const ht=await odeServices.rights().sessionHasAtLeastOneResourceRightForEachList(tt,dt);nt(ht)}else{const ht=await odeServices.rights().sessionHasResourceRightForEachList(tt,dt);nt(ht)}},ct=async function(){var dt,ht,ft;if(tt===void 0){nt(!0);return}if(at&&((ht=(dt=et[0])==null?void 0:dt.trashedBy)!=null&&ht.includes(ot==null?void 0:ot.userId))&&rt==="restore"&&!((ft=et[0])!=null&&ft.trashed)){nt(!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 nt(!1);else typeof et=="string"?await lt(et):await lt(et.rights)};return{visible:st,refreshState:ct}}function useActionBar(){const[tt,et]=reactExports.useState(!1),[rt,st]=reactExports.useState("void"),[nt,ot]=reactExports.useState(),at=useStoreContext(pr=>pr.config),lt=useCurrentFolder(),ut=useResourceIds(),ct=useSelectedResources(),dt=useSelectedFolders(),ht=useFolderIds(),ft=useIsTrash(),xt=useRestore(),yt=useResourceIsTrash(),vt=useSearchParams(),Et=useCopyResource(),wt=useResourceOrFolderIsDraggable(),{openResource:bt,printSelectedResource:St,openFolder:Rt,clearSelectedItems:Ct,clearSelectedIds:It}=useStoreActions(),{data:jt}=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(wt.isDrag){et(!1);return}et(!0)},[ut,ht]);async function Pt(pr){var _r;switch((_r=document.getElementById("root"))==null||_r.setAttribute("aria-hidden","true"),ot(pr),pr.id){case ACTION.OPEN:return ut.length>0?bt(ct[0]):Rt({folder:dt[0],folderId:dt[0].id});case ACTION.COPY:return yr();case ACTION.MOVE:return st("move");case ACTION.PRINT:return St();case ACTION.DELETE:return st("delete");case ACTION.RESTORE:return await Nt();case ACTION.PUBLISH:return st("publish");case ACTION.UPD_PROPS:case"edit":return or();case ACTION.SHARE:return st("share");case ACTION.EXPORT:return st("export");default:throw Error(`Unknown action: ${pr.id}`)}}function Ot(pr){const _r=ut.length+ht.length,Ar=ut.length===1||ht.length===1,Hr=_r===1,Ur=ht.length===0;switch(pr.id){case ACTION.OPEN:return Hr;case ACTION.MANAGE:return Ar;case ACTION.COPY:return Ar&&Ur;case ACTION.PUBLISH:return Ar&&Ur;case ACTION.UPD_PROPS:return Ar&&Ur;case ACTION.SHARE:return Ur&&Ar;case"export":return Ar&&Ur;case ACTION.PRINT:return Ar&&Ur;case"edit":return Hr;default:return!0}}const Ut=()=>!0;async function Nt(){try{if(ft)await xt.mutate();else throw new Error("Cannot restore untrashed resources");Ht()}catch(pr){console.error(pr)}}function Ht(){var pr;st("void"),nt!=null&&nt.id&&((pr=document.getElementById(nt==null?void 0:nt.id))==null||pr.focus())}const Lt=pr=>()=>{rt===pr&&(Ht(),Ct(),It())},kt=Lt("move"),$t=Lt("move"),Ft=Lt("delete"),Gt=Lt("delete"),Mt=Lt("publish"),Vt=Lt("publish"),Bt=Lt("edit_folder"),qt=Lt("edit_folder"),Qt=Lt("edit_resource"),Yt=Lt("edit_resource"),tr=Lt("share"),lr=Lt("share"),ur=Lt("export"),mr=Lt("export");async function yr(){if(ct&&ct.length>0){const pr=ct[0];await Et.mutate(pr),Ct(),It()}}function or(){if(ut&&ut.length>0){const pr=ct[0].assetId;(at==null?void 0:at.app)==="scrapbook"?goToEdit({searchParams:vt,assetId:pr}):st("edit_resource")}else st("edit_folder")}function hr(pr){return pr.id==="edit"&&ht.length>0?"explorer.rename":`explorer.actions.${pr.id}`}return{onRestore:Nt,actions:ft?at==null?void 0:at.trashActions:jt,selectedElement:[...ct,...dt],currentFolderId:lt==null?void 0:lt.id,overrideLabel:hr,handleClick:Pt,isActivable:ft?Ut:Ot,isActionBarOpen:tt,isMoveModalOpen:rt==="move",onMoveCancel:kt,onMoveSuccess:$t,isDeleteModalOpen:rt==="delete",onDeleteCancel:Gt,onDeleteSuccess:Ft,isPublishModalOpen:rt==="publish",onPublishCancel:Vt,onPublishSuccess:Mt,isEditFolderOpen:rt==="edit_folder",onEditFolderCancel:qt,onEditFolderSuccess:Bt,isEditResourceOpen:rt==="edit_resource",onEditResourceCancel:Yt,onEditResourceSuccess:Qt,isShareResourceOpen:rt==="share",onShareResourceCancel:lr,onShareResourceSuccess:tr,isExportModalOpen:rt==="export",onExportCancel:ur,onExportSuccess:mr,onClearActionBar:Ht}}function AccessControl({resourceRights:tt,roleExpected:et,action:rt,children:st,renderWhenForbidden:nt}){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:st}):nt?nt():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:st,isMoveModalOpen:nt,isDeleteModalOpen:ot,isPublishModalOpen:at,isActionBarOpen:lt,isEditFolderOpen:ut,overrideLabel:ct,onEditFolderCancel:dt,onEditFolderSuccess:ht,isEditResourceOpen:ft,onEditResourceCancel:xt,onEditResourceSuccess:yt,isShareResourceOpen:vt,onShareResourceCancel:Et,onShareResourceSuccess:wt,isExportModalOpen:bt,onExportCancel:St,onExportSuccess:Rt,onMoveCancel:Ct,onMoveSuccess:It,onDeleteCancel:jt,onDeleteSuccess:Pt,onPublishCancel:Ot,onPublishSuccess:Ut,isActivable:Nt,handleClick:Ht}=useActionBar(),kt=useSelectedResources()[0],$t=useShareResource(tt),Ft=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((Mt,Vt)=>Vt&&jsxRuntimeExports.jsx(animated.div,{className:"position-fixed bottom-0 start-0 end-0",style:{...Mt,zIndex:4},children:jsxRuntimeExports.jsx(ActionBar$1,{children:rt==null?void 0:rt.filter(Bt=>Bt.available&&Bt.target==="actionbar").map(Bt=>Nt(Bt)&&jsxRuntimeExports.jsx(AccessControl,{resourceRights:st,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:[nt&&jsxRuntimeExports.jsx(MoveModal$2,{isOpen:nt,onCancel:Ct,onSuccess:It}),ot&&jsxRuntimeExports.jsx(DeleteModal$2,{isOpen:ot,onCancel:jt,onSuccess:Pt}),at&&kt&&jsxRuntimeExports.jsx(PublishModal$1,{isOpen:at,resourceId:kt.assetId,onCancel:Ot,onSuccess:Ut}),ut&&jsxRuntimeExports.jsx(FolderModal,{edit:!0,isOpen:ut,onCancel:dt,onSuccess:ht}),ft&&kt&&jsxRuntimeExports.jsx(UpdateModal,{mode:"update",isOpen:ft,resourceId:kt.assetId,updateResource:Ft,onCancel:xt,onSuccess:yt,children:(Mt,Vt,Bt,qt,Qt)=>tt==="blog"&&isActionAvailable("createPublic",rt)&&jsxRuntimeExports.jsx(BlogPublic,{appCode:tt,isUpdating:Vt,resource:Mt,watch:Bt,setValue:qt,register:Qt})}),vt&&kt&&jsxRuntimeExports.jsx(ShareResourceModal,{isOpen:vt,shareResource:$t,shareOptions:{resourceCreatorId:kt.creatorId,resourceId:kt.assetId,resourceRights:kt.rights},onCancel:Et,onSuccess:wt,children:tt==="blog"?jsxRuntimeExports.jsx(ShareBlog,{resourceId:kt.assetId,updateResource:Ft}):null}),bt&&kt&&jsxRuntimeExports.jsx(ExportModal$2,{isOpen:bt,onCancel:St,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"})),illuHomeworks="/assets/js/ode-explorer/illu-homeworks.svg",illuHomeworks$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuHomeworks},Symbol.toStringTag,{value:"Module"})),illuMessagerie="/assets/js/ode-explorer/illu-messagerie.svg",illuMessagerie$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuMessagerie},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"})),PublishModal=Object.freeze(Object.defineProperty({__proto__:null,default:PublishModal$2},Symbol.toStringTag,{value:"Module"}));function useDeleteModal({onSuccess:tt}){const et=useDelete(),rt=useTrash(),st=useIsTrash();async function nt(){try{st?await et.mutate():await rt.mutate(),tt==null||tt()}catch(ot){console.error(ot)}}return{isTrashFolder:st,onDelete:nt}}function DeleteModal({isOpen:tt,onSuccess:et=()=>({}),onCancel:rt=()=>({})}){const{t:st}=useTranslation(),{isTrashFolder:nt,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:st(nt?"explorer.delete.title":"explorer.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx("p",{className:"body",children:st(nt?"explorer.delete.subtitle":"explorer.trash.subtitle")})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:st("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"danger",onClick:ot,type:"button",variant:"filled",children:st(nt?"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(),st=useQueryClient(),nt=useMoveItem(),ot=useSelectedFolders(),at=useSelectedResources(),lt=useTreeData(),{fetchTreeData:ut}=useStoreActions();async function ct(){try{if(!et)throw new Error("explorer.move.selection.empty");await nt.mutate(et),await(tt==null?void 0:tt())}catch(ht){console.error(ht)}}const dt=ht=>{var xt,yt;const ft=getAncestors(lt,ht);for(const vt of ot)if(ht===vt.id||ht===vt.parentId||(xt=vt.childrenIds)!=null&&xt.includes(ht)||ft.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 ft=findNodeById(lt,ht),xt=(yt=ft==null?void 0:ft.children)==null?void 0:yt.some(Et=>{var wt;return Array.isArray(Et==null?void 0:Et.children)&&((wt=Et.children)==null?void 0:wt.length)>0});(vt=ft==null?void 0:ft.children)==null||vt.forEach(Et=>{xt||ut(Et.id,st)})},onMove:()=>ct()}}function MoveModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{appCode:st}=useEdificeClient(),{t:nt}=useTranslation(),{treeData:ot,handleTreeItemSelect:at,handleOnTreeItemUnfold:lt,onMove:ut,disableSubmit:ct}=useMoveModal({onSuccess:et}),dt={...ot,name:nt("explorer.filters.mine",{ns:st})};return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"moveModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:nt("explorer.move.title")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:nt("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:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:ut,type:"button",variant:"filled",disabled:ct,children:nt("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(),st=useToast(),{t:nt}=useTranslation();return{handleExportClick:()=>{et.length?(goToExport({searchParams:rt,assetId:et[0].assetId}),tt()):st.error(nt("explorer.error.noResourceSelected"))}}};function ExportModal({isOpen:tt,onSuccess:et,onCancel:rt}){const{handleExportClick:st}=useExportModal(et),{t:nt}=useTranslation();return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:rt,id:"exportModal",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:rt,children:nt("explorer.export.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsxs("ul",{children:[jsxRuntimeExports.jsx("li",{children:nt("explorer.export.body.info.1")}),jsxRuntimeExports.jsx("li",{children:nt("explorer.export.body.info.2")}),jsxRuntimeExports.jsx("li",{children:nt("explorer.export.body.info.3")})]}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:nt("explorer.export.body.warning")})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:rt,type:"button",variant:"ghost",children:nt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:st,type:"button",variant:"filled",children:nt("explorer.actions.export")})]})]}),document.getElementById("portal"))}const ExportModal$1=Object.freeze(Object.defineProperty({__proto__:null,default:ExportModal},Symbol.toStringTag,{value:"Module"}))});export default i3();